{"source": "c4", "protocol": "08-dopex", "title": "0x11singh99 Analysis", "severity_raw": "High", "severity": "high", "description": "### RdpxV2Core.sol \n\nIt is the main contract of the system which is handling bonding and maintaining peg of `DpxEth` price with `weth` price. After analysis this contract i have some suggestions for it.\n\n1. To maintain data of reserve assets in this Core contract. We can change it's layout to remove 1 extra mapping `reservesIndex` and 1 array `reserveTokens`. Since all three is for 1 purpose only. Avoid using dynamic arrays if possible and use mappings because search time in arrays are O(n) while in mapping it is O(1).\nUse Token Symbol as key of the mapping.\n\n```diff\n File : /contracts/core/IRdpxV2Core.sol\n //@audit this is defined inside IRdpxV2Core\n struct ReserveAsset {\n address tokenAddress;\n uint256 tokenBalance;\n- string tokenSymbol;\n }\n``` \nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/IRdpxV2Core.sol#L43C2-L48C1\n\n\n```diff\nFile: /contracts/core/RdpxV2Core.sol\n- ReserveAsset[] public reserveAsset;\n \n- string[] public reserveTokens; \n\n- mapping(string => uint256) public reservesIndex;\n\n+ mapping(string => ReserveAsset) public reserveAssets;\n// One reserve Tokens addresses array can be maintained if protocol want to know which address exists but in current need it does not seem to be required.\n```\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L61C1-L73C51\n\nIt will simplify the accessing of reserve assets. Because contract is using symbol as the key to search asset, so it can also be done with it. By this change same goal can be achieved with many advantages. eg: Lesser state variables in contract saves lot of gas and slots by removing 2 arrays.\nNo need to traverse whole array when checking this token already there or not.\nAdding new reserve assets and removing old is easy and bug free.(in previous one removing asset have bug because of complex logic in `removeAssetFromtokenReserves`) hard to identify bug in them.\n\nSo change code of", "vulnerable_code": "https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/IRdpxV2Core.sol#L43C2-L48C1\n\n", "fixed_code": "https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L61C1-L73C51\n\nIt will simplify the accessing of reserve assets. Because contract is using symbol as the key to search asset, so it can also be done with it. By this change same goal can be achieved with many advantages. eg: Lesser state variables in contract saves lot of gas and slots by removing 2 arrays.\nNo need to traverse whole array when checking this token already there or not.\nAdding new reserve assets and removing old is easy and bug free.(in previous one removing asset have bug because of complex logic in `removeAssetFromtokenReserves`) hard to identify bug in them.\n\nSo change code of Core contract according to this above change.\n\n## Some other suggestions\n\n### 1. Always check amount is greater than zero when transferring, minting and burning tokens.\n\nIn the whole protocol all contracts in most of the places amount > 0 is not checked before calling `mint` , `burn`, `transfer`and `transferFrom`. \n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/0x11singh99-Analysis.md", "collected_at": "2026-01-02T18:24:08.304331+00:00", "source_hash": "00006e9fc18a8e03fa3cb1a162be98ab358027c14204782e7df45664158488bf", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 621, "github_ref_count": 2, "vulnerable_code_is_url": true, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File : /contracts/core/IRdpxV2Core.sol\n //@audit this is defined inside IRdpxV2Core\n struct ReserveAsset {\n address tokenAddress;\n uint256 tokenBalance;\n- string tokenSymbol;\n }", "primary_code_language": "diff", "primary_code_char_count": 224, "all_code_blocks": "// Code block 1 (diff):\nFile : /contracts/core/IRdpxV2Core.sol\n //@audit this is defined inside IRdpxV2Core\n struct ReserveAsset {\n address tokenAddress;\n uint256 tokenBalance;\n- string tokenSymbol;\n }\n\n// Code block 2 (diff):\nFile: /contracts/core/RdpxV2Core.sol\n- ReserveAsset[] public reserveAsset;\n \n- string[] public reserveTokens; \n\n- mapping(string => uint256) public reservesIndex;\n\n+ mapping(string => ReserveAsset) public reserveAssets;\n// One reserve Tokens addresses array can be maintained if protocol want to know which address exists but in current need it does not seem to be required.", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "File : /contracts/core/IRdpxV2Core.sol\n //@audit this is defined inside IRdpxV2Core\n struct ReserveAsset {\n address tokenAddress;\n uint256 tokenBalance;\n- string tokenSymbol;\n }\n\nFile: /contracts/core/RdpxV2Core.sol\n- ReserveAsset[] public reserveAsset;\n \n- string[] public reserveTokens; \n\n- mapping(string => uint256) public reservesIndex;\n\n+ mapping(string => ReserveAsset) public reserveAssets;\n// One reserve Tokens addresses array can be maintained if protocol want to know which address exists but in current need it does not seem to be required.", "solidity_code": "", "github_refs_formatted": "IRdpxV2Core.sol#L43-L2, RdpxV2Core.sol#L61-L1", "github_files_list": "RdpxV2Core.sol, IRdpxV2Core.sol", "github_refs_count": 2, "vulnerable_code_actual": "", "has_vulnerable_code_snippet": false, "fixed_code_actual": "https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L61C1-L73C51\n\nIt will simplify the accessing of reserve assets. Because contract is using symbol as the key to search asset, so it can also be done with it. By this change same goal can be achieved with many advantages. eg: Lesser state variables in contract saves lot of gas and slots by removing 2 arrays.\nNo need to traverse whole array when checking this token already there or not.\nAdding new reserve assets and removing old is easy and bug free.(in previous one removing asset have bug because of complex logic in `removeAssetFromtokenReserves`) hard to identify bug in them.\n\nSo change code of Core contract according to this above change.\n\n## Some other suggestions\n\n### 1. Always check amount is greater than zero when transferring, minting and burning tokens.\n\nIn the whole protocol all contracts in most of the places amount > 0 is not checked before calling `mint` , `burn`, `transfer`and `transferFrom`. \n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": false, "content_richness_score": 9} {"source": "c4", "protocol": "02-ethos", "title": "GalloDaSballo Q", "severity_raw": "Critical", "severity": "critical", "description": "# Executive Summary\n\nThe following QA Report is an aggregate of smaller reports divided by contract / topic\n\nThe following criteria are used for suggested severity\n\nL - Low Severity -> Some risk\n\nR - Refactoring -> Suggested changes for improvements\n\nNC - Non-Critical / Informational -> Minor suggestions\n\n\n# List of all findings\n\n* 1. [Vault](#Vault)\n\t* 1.1. [L - Strategy doesn't have `inCaseTokensGetStuck`](#L-StrategydoesnthaveinCaseTokensGetStuck)\n\t* 1.2. [L - Deposit / Withdraw use FOT compatible math, but withdrawing from strategy doesn't](#L-DepositWithdrawuseFOTcompatiblemathbutwithdrawingfromstrategydoesnt)\n\t* 1.3. [L - Roles for Vault and Strat are set separately](#L-RolesforVaultandStrataresetseparately)\n\t* 1.4. [L - MaxLoss hardcoded means the contract will revert if any loss bigger than BPS happens](#L-MaxLosshardcodedmeansthecontractwillrevertifanylossbiggerthanBPShappens)\n\t* 1.5. [R - Can refactor to simplify](#R-Canrefactortosimplify)\n\t* 1.6. [R - Track stats via Ninja](#R-TrackstatsviaNinja)\n\t* 1.7. [R - Track harvest health via Health Check (by Yearn)](#R-TrackharvesthealthviaHealthCheckbyYearn)\n\t* 1.8. [R - Consider forking Yearn.Watch](#R-ConsiderforkingYearn.Watch)\n\t* 1.9. [R - PERCENT_DIVISOR is more a BPS_DIVISOR](#R-PERCENT_DIVISORismoreaBPS_DIVISOR)\n\t* 1.10. [R - Math for issuing shares can be turned into an internal function](#R-Mathforissuingsharescanbeturnedintoaninternalfunction)\n\t* 1.11. [R - License may be incompatible with source code](#R-Licensemaybeincompatiblewithsourcecode)\n\t* 1.12. [R - Performance Fee is Paid Out to Treasury Twice](#R-PerformanceFeeisPaidOuttoTreasuryTwice)\n\t* 1.13. [NC - `_addLiquidityVelo` is unused](#NC-_addLiquidityVeloisunused)\n\t* 1.14. [L - Steps not validated](#L-Stepsnotvalidated)\n\t* 1.15. [R - Equivalent to aToken.balanceOf(this)](#R-EquivalenttoaToken.balanceOfthis)\n\t* 1.16. [R - Amount non-zero is known](#R-Amountnon-zeroisknown)\n* 2. [Redemption Helper](#RedemptionHelper)\n\t* 2.1. [L - Griefing redemp", "vulnerable_code": " uint256 public withdrawMaxLoss = 1;\n", "fixed_code": " function _atLeastRole(bytes32 _role) internal view {\n bytes32[] memory cascadingAccessRoles = _cascadingAccessRoles();\n uint256 numRoles = cascadingAccessRoles.length;\n bool specifiedRoleFound = false;\n bool senderHighestRoleFound = false;\n\n // {_role} must be found in the {cascadingAccessRoles} array.\n // Also, msg.sender's highest role index <= specified role index.\n for (uint256 i = 0; i < numRoles; i = i.uncheckedInc()) {\n // If the highest was not found and they have a role that is same or higher\n if (!senderHighestRoleFound && _hasRole(cascadingAccessRoles[i], msg.sender)) {\n senderHighestRoleFound = true;\n }\n // If we are at the this role part of the loop\n // E.g. we may or may have not found it here\n if (_role == cascadingAccessRoles[i]) {\n specifiedRoleFound = true;\n break;\n }\n }\n\n // require(senderHighestRoleFound)\n require(specifiedRoleFound && senderHighestRoleFound, \"Unauthorized access\");\n }\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/GalloDaSballo-Q.md", "collected_at": "2026-01-02T18:16:12.532910+00:00", "source_hash": "002a99aeb152e11d44f40ea0c3c5e6e74773e719f238e173ee0854806632159f", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " uint256 public withdrawMaxLoss = 1;\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function _atLeastRole(bytes32 _role) internal view {\n bytes32[] memory cascadingAccessRoles = _cascadingAccessRoles();\n uint256 numRoles = cascadingAccessRoles.length;\n bool specifiedRoleFound = false;\n bool senderHighestRoleFound = false;\n\n // {_role} must be found in the {cascadingAccessRoles} array.\n // Also, msg.sender's highest role index <= specified role index.\n for (uint256 i = 0; i < numRoles; i = i.uncheckedInc()) {\n // If the highest was not found and they have a role that is same or higher\n if (!senderHighestRoleFound && _hasRole(cascadingAccessRoles[i], msg.sender)) {\n senderHighestRoleFound = true;\n }\n // If we are at the this role part of the loop\n // E.g. we may or may have not found it here\n if (_role == cascadingAccessRoles[i]) {\n specifiedRoleFound = true;\n break;\n }\n }\n\n // require(senderHighestRoleFound)\n require(specifiedRoleFound && senderHighestRoleFound, \"Unauthorized access\");\n }\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "02-ethos", "title": "0x007 G", "severity_raw": "Gas", "severity": "gas", "description": "## Reduce the size of error messages (Long revert Strings)\nShortening revert strings to fit in 32 bytes will decrease deployment time gas and will decrease runtime gas when the revert condition is met.\nCases can be found in `find . -name \"*.sol\" |xargs grep -n -E 'require.*\".{36,}\"'`\n\n## Use multiple require statement instead of &&\n`find . -name \"*.sol\" |xargs grep -n \"require.*&&\"`\n\n## Mark constants as private instead of public\n`find . -name \"*.sol\" |xargs grep -n 'public constant'`\n\n## Pack structs into fewer storage slot\nThere are 2 cases in https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/PriceFeed.sol#L58-L71\nSuggested change would be\n```sol\nstruct ChainlinkResponse {\n uint80 roundId;\n uint8 decimals;\n bool success;\n int256 answer;\n uint256 timestamp;\n }\n\n struct TellorResponse {\n bool ifRetrieve;\n bool success;\n uint256 value;\n uint256 timestamp;\n }\n```\n\n", "vulnerable_code": "struct ChainlinkResponse {\n uint80 roundId;\n uint8 decimals;\n bool success;\n int256 answer;\n uint256 timestamp;\n }\n\n struct TellorResponse {\n bool ifRetrieve;\n bool success;\n uint256 value;\n uint256 timestamp;\n }", "fixed_code": "", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/0x007-G.md", "collected_at": "2026-01-02T18:15:40.626529+00:00", "source_hash": "002c6021d44956e92a1ee9701025b0c43934dbe330de2bc133c22655752648b8", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 284, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "struct ChainlinkResponse {\n uint80 roundId;\n uint8 decimals;\n bool success;\n int256 answer;\n uint256 timestamp;\n }\n\n struct TellorResponse {\n bool ifRetrieve;\n bool success;\n uint256 value;\n uint256 timestamp;\n }", "primary_code_language": "sol", "primary_code_char_count": 284, "all_code_blocks": "// Code block 1 (sol):\nstruct ChainlinkResponse {\n uint80 roundId;\n uint8 decimals;\n bool success;\n int256 answer;\n uint256 timestamp;\n }\n\n struct TellorResponse {\n bool ifRetrieve;\n bool success;\n uint256 value;\n uint256 timestamp;\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "struct ChainlinkResponse {\n uint80 roundId;\n uint8 decimals;\n bool success;\n int256 answer;\n uint256 timestamp;\n }\n\n struct TellorResponse {\n bool ifRetrieve;\n bool success;\n uint256 value;\n uint256 timestamp;\n }", "github_refs_formatted": "PriceFeed.sol#L58-L71", "github_files_list": "PriceFeed.sol", "github_refs_count": 1, "vulnerable_code_actual": "struct ChainlinkResponse {\n uint80 roundId;\n uint8 decimals;\n bool success;\n int256 answer;\n uint256 timestamp;\n }\n\n struct TellorResponse {\n bool ifRetrieve;\n bool success;\n uint256 value;\n uint256 timestamp;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.94} {"source": "c4", "protocol": "01-salty", "title": "K42 G", "severity_raw": "High", "severity": "high", "description": "## Gas Optimization Report for [Salty.IO](https://github.com/code-423n4/2024-01-salty) by K42\n\n- Note: I made sure these optimizations are unique in relation to the Bot Report and 4Analy3er Report. \n\n### Possible Optimizations in [ArbitrageSearch.sol](https://github.com/code-423n4/2024-01-salty/blob/main/src/arbitrage/ArbitrageSearch.sol)\n\nPossible Optimization 1 = \n- Use immutable variables ``wbtc``, ``weth``, and ``salt`` directly in the [_arbitragePath()](https://github.com/code-423n4/2024-01-salty/blob/main/src/arbitrage/ArbitrageSearch.sol#L31C1-L58C4) function.\n\nCode Snippet:\n\n\n\n\n\n```solidity\nfunction _arbitragePath(IERC20 swapTokenIn, IERC20 swapTokenOut) internal view returns (IERC20 arbToken2, IERC20 arbToken3) {\n if (address(swapTokenIn) == address(wbtc) && address(swapTokenOut) == address(weth)) {\n return (wbtc, salt);\n }\n // Other conditions using direct references to wbtc, weth, and salt\n}\n```\n\n\n\n\n\n- Estimated Gas Saved = Directly referencing immutable variables can save gas by avoiding additional memory or storage operations.\n\nPossible Optimization 2 = \n- Streamline the ``return`` statement in [_rightMoreProfitable()](https://github.com/code-423n4/2024-01-salty/blob/main/src/arbitrage/ArbitrageSearch.sol#L63C2-L90C4) by directly returning the comparison result.\n\nCode Snippet:\n\n\n\n\n\n```solidity\nfunction _rightMoreProfitable(...) internal pure returns (bool) {\n // ... [existing calculations]\n return int256(amountOutRight) - int256(midpoint + MIDPOINT_PRECISION) > profitMidpoint;\n}\n```\n\n\n\n\n\n- Estimated Gas Saved = This approach reduces the need for an extra variable and directly returns the comparison result, saving gas on variable assignment.\n\nPossible Optimization 3 = \n- Simplify the loop control in [_bisectionSearch()](https://github.com/code-423n4/2024-01-salty/blob/main/src/arbitrage/ArbitrageSearch.sol#L101C2-L136C4) for clarity and efficiency.\n\nCode Snippet:\n\n\n\n\n\n```solidity\nfunction _bisectionSearch(...) internal pure returns ", "vulnerable_code": "function _arbitragePath(IERC20 swapTokenIn, IERC20 swapTokenOut) internal view returns (IERC20 arbToken2, IERC20 arbToken3) {\n if (address(swapTokenIn) == address(wbtc) && address(swapTokenOut) == address(weth)) {\n return (wbtc, salt);\n }\n // Other conditions using direct references to wbtc, weth, and salt\n}", "fixed_code": "function _rightMoreProfitable(...) internal pure returns (bool) {\n // ... [existing calculations]\n return int256(amountOutRight) - int256(midpoint + MIDPOINT_PRECISION) > profitMidpoint;\n}", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/K42-G.md", "collected_at": "2026-01-02T19:01:22.378584+00:00", "source_hash": "00346fb83aaeb3174399c40495e624cd688420afa7d08a9e673b95f875fcea88", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 519, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _arbitragePath(IERC20 swapTokenIn, IERC20 swapTokenOut) internal view returns (IERC20 arbToken2, IERC20 arbToken3) {\n if (address(swapTokenIn) == address(wbtc) && address(swapTokenOut) == address(weth)) {\n return (wbtc, salt);\n }\n // Other conditions using direct references to wbtc, weth, and salt\n}", "primary_code_language": "solidity", "primary_code_char_count": 325, "all_code_blocks": "// Code block 1 (solidity):\nfunction _arbitragePath(IERC20 swapTokenIn, IERC20 swapTokenOut) internal view returns (IERC20 arbToken2, IERC20 arbToken3) {\n if (address(swapTokenIn) == address(wbtc) && address(swapTokenOut) == address(weth)) {\n return (wbtc, salt);\n }\n // Other conditions using direct references to wbtc, weth, and salt\n}\n\n// Code block 2 (solidity):\nfunction _rightMoreProfitable(...) internal pure returns (bool) {\n // ... [existing calculations]\n return int256(amountOutRight) - int256(midpoint + MIDPOINT_PRECISION) > profitMidpoint;\n}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function _arbitragePath(IERC20 swapTokenIn, IERC20 swapTokenOut) internal view returns (IERC20 arbToken2, IERC20 arbToken3) {\n if (address(swapTokenIn) == address(wbtc) && address(swapTokenOut) == address(weth)) {\n return (wbtc, salt);\n }\n // Other conditions using direct references to wbtc, weth, and salt\n}\n\nfunction _rightMoreProfitable(...) internal pure returns (bool) {\n // ... [existing calculations]\n return int256(amountOutRight) - int256(midpoint + MIDPOINT_PRECISION) > profitMidpoint;\n}", "github_refs_formatted": "ArbitrageSearch.sol, ArbitrageSearch.sol#L31-L1, ArbitrageSearch.sol#L63-L2, ArbitrageSearch.sol#L101-L2", "github_files_list": "ArbitrageSearch.sol", "github_refs_count": 4, "vulnerable_code_actual": "function _arbitragePath(IERC20 swapTokenIn, IERC20 swapTokenOut) internal view returns (IERC20 arbToken2, IERC20 arbToken3) {\n if (address(swapTokenIn) == address(wbtc) && address(swapTokenOut) == address(weth)) {\n return (wbtc, salt);\n }\n // Other conditions using direct references to wbtc, weth, and salt\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function _rightMoreProfitable(...) internal pure returns (bool) {\n // ... [existing calculations]\n return int256(amountOutRight) - int256(midpoint + MIDPOINT_PRECISION) > profitMidpoint;\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "08-dopex", "title": "Kaysoft Q", "severity_raw": "Low", "severity": "low", "description": "## [NC-01] `approveContractToSpend` will return wrong error message when `_amount` does not pass the validation check.\nFile: https://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/core/RdpxV2Core.sol#L410\n\n- Wrong error code was supplied to the third validation in this code. The right error code that is supposed to be passed is `4` instead of `17`\n\n```\nfunction approveContractToSpend(\n address _token,\n address _spender,\n uint256 _amount\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n _validate(_token != address(0), 17);\n _validate(_spender != address(0), 17);\n@> _validate(_amount > 0, 17);//@audit-info 17 error code wrong.\n IERC20WithBurn(_token).approve(_spender, _amount);\n }\n```\n```\n// ERROR CODES\n// E1: \"Insufficient bond amount\",\n// E2: \"Bond has expired\",\n// E3: \"Invalid parameters\",\n// E4: \"Invalid amount\",\n// E5: \"Not enough ETH available from the delegate\",\n// E6: \"Invalid bond ID\",\n// E7: \"Bond has not matured\",\n// E8: \"Fee cannot be more than 100\",\n// E9: \"msg.sender is not the owner\",\n// E10: \"Price is not above the upper peg\",\n// E11: \"Amount greater that max permissible amount\",\n// E12: \"Price is not lower than first lower peg\",\n// E13: \"Amount greater than max permissible amount\"\n// E14: \"Invalid delegate Id\"\n// E15: \"Invalid amount\"\n// E16: \"Funding already paid for the epoch\"\n// E17: \"Zero address\"\n// E18: \"Asset not found\"\n// E19: \"Token not found\"\n```\n\n#### Recommended Mitigation Steps\nReplace the `17` on the `amount` validation here with `4` like this.\n```\nfunction approveContractToSpend(\n address _token,\n address _spender,\n uint256 _amount\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n _validate(_token != address(0), 17);\n _validate(_spender != address(0), 17);\n- _validate(_amount > 0, 17);//@audit-info 17 error code wrong.\n+ _validate(_amount > 0, 4);\n IERC20WithBurn(_token).approve(_spender, _amount);\n }\n```\n\n## [NC-02] Double access control check for `mint()` ", "vulnerable_code": "function approveContractToSpend(\n address _token,\n address _spender,\n uint256 _amount\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n _validate(_token != address(0), 17);\n _validate(_spender != address(0), 17);\n@> _validate(_amount > 0, 17);//@audit-info 17 error code wrong.\n IERC20WithBurn(_token).approve(_spender, _amount);\n }", "fixed_code": "// ERROR CODES\n// E1: \"Insufficient bond amount\",\n// E2: \"Bond has expired\",\n// E3: \"Invalid parameters\",\n// E4: \"Invalid amount\",\n// E5: \"Not enough ETH available from the delegate\",\n// E6: \"Invalid bond ID\",\n// E7: \"Bond has not matured\",\n// E8: \"Fee cannot be more than 100\",\n// E9: \"msg.sender is not the owner\",\n// E10: \"Price is not above the upper peg\",\n// E11: \"Amount greater that max permissible amount\",\n// E12: \"Price is not lower than first lower peg\",\n// E13: \"Amount greater than max permissible amount\"\n// E14: \"Invalid delegate Id\"\n// E15: \"Invalid amount\"\n// E16: \"Funding already paid for the epoch\"\n// E17: \"Zero address\"\n// E18: \"Asset not found\"\n// E19: \"Token not found\"", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/Kaysoft-Q.md", "collected_at": "2026-01-02T18:24:46.584559+00:00", "source_hash": "0049135df58dc2121ea1a2df2ec7847962a83d93a58acc16f84ff81d6ce062bd", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 1420, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function approveContractToSpend(\n address _token,\n address _spender,\n uint256 _amount\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n _validate(_token != address(0), 17);\n _validate(_spender != address(0), 17);\n@> _validate(_amount > 0, 17);//@audit-info 17 error code wrong.\n IERC20WithBurn(_token).approve(_spender, _amount);\n }", "primary_code_language": "unknown", "primary_code_char_count": 349, "all_code_blocks": "// Code block 1 (unknown):\nfunction approveContractToSpend(\n address _token,\n address _spender,\n uint256 _amount\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n _validate(_token != address(0), 17);\n _validate(_spender != address(0), 17);\n@> _validate(_amount > 0, 17);//@audit-info 17 error code wrong.\n IERC20WithBurn(_token).approve(_spender, _amount);\n }\n\n// Code block 2 (unknown):\n// ERROR CODES\n// E1: \"Insufficient bond amount\",\n// E2: \"Bond has expired\",\n// E3: \"Invalid parameters\",\n// E4: \"Invalid amount\",\n// E5: \"Not enough ETH available from the delegate\",\n// E6: \"Invalid bond ID\",\n// E7: \"Bond has not matured\",\n// E8: \"Fee cannot be more than 100\",\n// E9: \"msg.sender is not the owner\",\n// E10: \"Price is not above the upper peg\",\n// E11: \"Amount greater that max permissible amount\",\n// E12: \"Price is not lower than first lower peg\",\n// E13: \"Amount greater than max permissible amount\"\n// E14: \"Invalid delegate Id\"\n// E15: \"Invalid amount\"\n// E16: \"Funding already paid for the epoch\"\n// E17: \"Zero address\"\n// E18: \"Asset not found\"\n// E19: \"Token not found\"\n\n// Code block 3 (unknown):\nfunction approveContractToSpend(\n address _token,\n address _spender,\n uint256 _amount\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n _validate(_token != address(0), 17);\n _validate(_spender != address(0), 17);\n- _validate(_amount > 0, 17);//@audit-info 17 error code wrong.\n+ _validate(_amount > 0, 4);\n IERC20WithBurn(_token).approve(_spender, _amount);\n }", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "RdpxV2Core.sol#L410", "github_files_list": "RdpxV2Core.sol", "github_refs_count": 1, "vulnerable_code_actual": "function approveContractToSpend(\n address _token,\n address _spender,\n uint256 _amount\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n _validate(_token != address(0), 17);\n _validate(_spender != address(0), 17);\n@> _validate(_amount > 0, 17);//@audit-info 17 error code wrong.\n IERC20WithBurn(_token).approve(_spender, _amount);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "// ERROR CODES\n// E1: \"Insufficient bond amount\",\n// E2: \"Bond has expired\",\n// E3: \"Invalid parameters\",\n// E4: \"Invalid amount\",\n// E5: \"Not enough ETH available from the delegate\",\n// E6: \"Invalid bond ID\",\n// E7: \"Bond has not matured\",\n// E8: \"Fee cannot be more than 100\",\n// E9: \"msg.sender is not the owner\",\n// E10: \"Price is not above the upper peg\",\n// E11: \"Amount greater that max permissible amount\",\n// E12: \"Price is not lower than first lower peg\",\n// E13: \"Amount greater than max permissible amount\"\n// E14: \"Invalid delegate Id\"\n// E15: \"Invalid amount\"\n// E16: \"Funding already paid for the epoch\"\n// E17: \"Zero address\"\n// E18: \"Asset not found\"\n// E19: \"Token not found\"", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "07-amphora", "title": "wahedtalash77 G", "severity_raw": "High", "severity": "high", "description": "## [G-01] For uint use != 0 instead of > 0\n558: `if (_fee > 0) usda.vaultControllerMint(owner(), _fee);`\nhttps://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/VaultController.sol#L558\n\n660: ` if (_tokenAmount > 0) _tokensToLiquidate = _tokenAmount;`\nhttps://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/VaultController.sol#L660\n\n206: `if (_totalCrvReward > 0 || _totalCvxReward > 0) {`\nhttps://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/Vault.sol#L206\n\n```\n223: if (_totalCvxReward > 0) CVX.transfer(_msgSender(), _totalCvxReward);\n224: if (_totalCrvReward > 0) CRV.transfer(_msgSender(), _totalCrvReward);\n```\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/core/Vault.sol#L223C6-L224C76\n\n## [G-02] Avoiding Initialization of Loop Index If It Is 0 and Avoid unnecessary read of array length in for loops can save gas\n259: `for (uint256 _i = 0; _i < _proposal.targets.length; _i++) {`\nhttps://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/governance/GovernorCharlie.sol#L259\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/governance/GovernorCharlie.sol#L382 \n\n## [G-03] unchecked { ++i } is more gas efficient than i++ for loops\n259: `for (uint256 _i = 0; _i < _proposal.targets.length; _i++) {`\nhttps://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/governance/GovernorCharlie.sol#L259\t\n## [G-04] Sort Solidity operations using short-circuit mode\nShort-circuiting is a solidity contract development model that uses OR/AND logic to sequence different cost operations. It puts low gas cost operations in the front and high gas cost operations in the back, so that if the front is low If the cost operation is feasible, you can skip (short-circuit) the subsequent high-cost Ethereum virtual machine operation.\n\n```\n//f(x) is a low gas cost operation \n", "vulnerable_code": "223: if (_totalCvxReward > 0) CVX.transfer(_msgSender(), _totalCvxReward);\n224: if (_totalCrvReward > 0) CRV.transfer(_msgSender(), _totalCrvReward);", "fixed_code": "//f(x) is a low gas cost operation \n//g(y) is a high gas cost operation \n\t//Sort operations with different gas costs as follows \nf(x) || g(y) \nf(x) && g(y)", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/wahedtalash77-G.md", "collected_at": "2026-01-02T18:24:04.914642+00:00", "source_hash": "006cd7fee2876c8d4033f26b53b5f916cced62539a55a075b58ffd5fad89330e", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 149, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "223: if (_totalCvxReward > 0) CVX.transfer(_msgSender(), _totalCvxReward);\n224: if (_totalCrvReward > 0) CRV.transfer(_msgSender(), _totalCrvReward);", "primary_code_language": "unknown", "primary_code_char_count": 149, "all_code_blocks": "// Code block 1 (unknown):\n223: if (_totalCvxReward > 0) CVX.transfer(_msgSender(), _totalCvxReward);\n224: if (_totalCrvReward > 0) CRV.transfer(_msgSender(), _totalCrvReward);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "VaultController.sol#L558, VaultController.sol#L660, Vault.sol#L206, Vault.sol#L223-L6, GovernorCharlie.sol#L259, GovernorCharlie.sol#L382", "github_files_list": "GovernorCharlie.sol, VaultController.sol, Vault.sol", "github_refs_count": 6, "vulnerable_code_actual": "223: if (_totalCvxReward > 0) CVX.transfer(_msgSender(), _totalCvxReward);\n224: if (_totalCrvReward > 0) CRV.transfer(_msgSender(), _totalCrvReward);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "//f(x) is a low gas cost operation \n//g(y) is a high gas cost operation \n\t//Sort operations with different gas costs as follows \nf(x) || g(y) \nf(x) && g(y)", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-asymmetry", "title": "DadeKuma Q", "severity_raw": "Critical", "severity": "critical", "description": "\n## Summary\n\n---\n\n### Low Risk Findings\n|Id|Title|Instances|\n|:--:|:-------|:--:|\n|[L-01]| No limits to max slippage | 1 |\n|[L-02]| Missing safe limits in `setMinAmount` and `setMaxAmount` | 1 |\n|[L-03]| Owner can renounce ownership | 17 |\n|[L-04]| Lack of two-step Ownership | 4 |\n\nTotal: 23 instances over 4 issues.\n\n### Non Critical Findings\n|Id|Title|Instances|\n|:--:|:-------|:--:|\n|[NC-01]| Static `keccak256` computed more than once | 1 |\n|[NC-02]| Parameter omission in events | 1 |\n|[NC-03]| Some functions don't follow the Solidity naming conventions | 4 |\n|[NC-04]| Use of floating pragma | 27 |\n|[NC-05]| Missing or incomplete NatSpec | 7 |\n\nTotal: 40 instances over 5 issues.\n\n## Low Risk Findings\n\n---\n\n### [L-01] No limits to max slippage\n\n\nA slippage set to 100% could result in massive loss of funds due to frontrunning. Consider setting a max limit to avoid this risk.\n\n\n*There is 1 instance of this issue.*\n\n\n```solidity\nFile: contracts/SafEth/SafEth.sol\n\n202: \t\t function setMaxSlippage(\n203: \t\t uint _derivativeIndex,\n204: \t\t uint _slippage\n205: \t\t ) external onlyOwner {\n206: \t\t derivatives[_derivativeIndex].setMaxSlippage(_slippage);\n207: \t\t emit SetMaxSlippage(_derivativeIndex, _slippage);\n208: \t\t }\n\n```\n\n### [L-02] Missing safe limits in `setMinAmount` and `setMaxAmount`\n\n\nThe `minAmount` should never be greater than `maxAmount`, as it would lock the `stake` function. Consider adding some safechecks to those setters.\n\n\n*There is 1 instance of this issue.*\n\n\n```solidity\nFile: contracts/SafEth/SafEth.sol\n\n214: \t\t function setMinAmount(uint256 _minAmount) external onlyOwner {\n215: \t\t minAmount = _minAmount;\n216: \t\t emit ChangeMinAmount(minAmount);\n217: \t\t }\n223: \t\t function setMaxAmount(uint256 _maxAmount) external onlyOwner {\n224: \t\t maxAmount = _maxAmount;\n225: \t\t emit ChangeMaxAmount(maxAmount);\n226: \t\t }\n\n```\n\n### [L-03] Owner can renounce ownership\n\nThe contract's owner is the acc", "vulnerable_code": "File: contracts/SafEth/SafEth.sol\n\n202: \t\t function setMaxSlippage(\n203: \t\t uint _derivativeIndex,\n204: \t\t uint _slippage\n205: \t\t ) external onlyOwner {\n206: \t\t derivatives[_derivativeIndex].setMaxSlippage(_slippage);\n207: \t\t emit SetMaxSlippage(_derivativeIndex, _slippage);\n208: \t\t }\n", "fixed_code": "File: contracts/SafEth/SafEth.sol\n\n214: \t\t function setMinAmount(uint256 _minAmount) external onlyOwner {\n215: \t\t minAmount = _minAmount;\n216: \t\t emit ChangeMinAmount(minAmount);\n217: \t\t }\n223: \t\t function setMaxAmount(uint256 _maxAmount) external onlyOwner {\n224: \t\t maxAmount = _maxAmount;\n225: \t\t emit ChangeMaxAmount(maxAmount);\n226: \t\t }\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/DadeKuma-Q.md", "collected_at": "2026-01-02T18:17:59.767058+00:00", "source_hash": "00acaef05b698847bfefa32055c8cba710d00377fa0c07ff7d9c5d14fe28d1ba", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 704, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/SafEth/SafEth.sol\n\n202: \t\t function setMaxSlippage(\n203: \t\t uint _derivativeIndex,\n204: \t\t uint _slippage\n205: \t\t ) external onlyOwner {\n206: \t\t derivatives[_derivativeIndex].setMaxSlippage(_slippage);\n207: \t\t emit SetMaxSlippage(_derivativeIndex, _slippage);\n208: \t\t }", "primary_code_language": "solidity", "primary_code_char_count": 322, "all_code_blocks": "// Code block 1 (solidity):\nFile: contracts/SafEth/SafEth.sol\n\n202: \t\t function setMaxSlippage(\n203: \t\t uint _derivativeIndex,\n204: \t\t uint _slippage\n205: \t\t ) external onlyOwner {\n206: \t\t derivatives[_derivativeIndex].setMaxSlippage(_slippage);\n207: \t\t emit SetMaxSlippage(_derivativeIndex, _slippage);\n208: \t\t }\n\n// Code block 2 (solidity):\nFile: contracts/SafEth/SafEth.sol\n\n214: \t\t function setMinAmount(uint256 _minAmount) external onlyOwner {\n215: \t\t minAmount = _minAmount;\n216: \t\t emit ChangeMinAmount(minAmount);\n217: \t\t }\n223: \t\t function setMaxAmount(uint256 _maxAmount) external onlyOwner {\n224: \t\t maxAmount = _maxAmount;\n225: \t\t emit ChangeMaxAmount(maxAmount);\n226: \t\t }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: contracts/SafEth/SafEth.sol\n\n202: \t\t function setMaxSlippage(\n203: \t\t uint _derivativeIndex,\n204: \t\t uint _slippage\n205: \t\t ) external onlyOwner {\n206: \t\t derivatives[_derivativeIndex].setMaxSlippage(_slippage);\n207: \t\t emit SetMaxSlippage(_derivativeIndex, _slippage);\n208: \t\t }\n\nFile: contracts/SafEth/SafEth.sol\n\n214: \t\t function setMinAmount(uint256 _minAmount) external onlyOwner {\n215: \t\t minAmount = _minAmount;\n216: \t\t emit ChangeMinAmount(minAmount);\n217: \t\t }\n223: \t\t function setMaxAmount(uint256 _maxAmount) external onlyOwner {\n224: \t\t maxAmount = _maxAmount;\n225: \t\t emit ChangeMaxAmount(maxAmount);\n226: \t\t }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: contracts/SafEth/SafEth.sol\n\n202: \t\t function setMaxSlippage(\n203: \t\t uint _derivativeIndex,\n204: \t\t uint _slippage\n205: \t\t ) external onlyOwner {\n206: \t\t derivatives[_derivativeIndex].setMaxSlippage(_slippage);\n207: \t\t emit SetMaxSlippage(_derivativeIndex, _slippage);\n208: \t\t }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/SafEth/SafEth.sol\n\n214: \t\t function setMinAmount(uint256 _minAmount) external onlyOwner {\n215: \t\t minAmount = _minAmount;\n216: \t\t emit ChangeMinAmount(minAmount);\n217: \t\t }\n223: \t\t function setMaxAmount(uint256 _maxAmount) external onlyOwner {\n224: \t\t maxAmount = _maxAmount;\n225: \t\t emit ChangeMaxAmount(maxAmount);\n226: \t\t }\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "09-ondo", "title": "catwhiskeys Q", "severity_raw": "Unknown", "severity": "unknown", "description": "# 1) Function with wrong functionality\nThe `_mul` function wasn't coded well. It should return multiplication of 2 numbers, but the function might return nothing.\n\nInstance:\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/rwaOracles/RWADynamicOracle.sol#L405\n\nPoC\nFor example, x=1, y=2. In this case, function will not return anything, because it doesn't pass any of the conditions.\ny != 0 and y!= x. The `_mul` function provides no value.\n\nRecommended mitigation steps:\nAccording to Company's needs, consider updating this function in this way:\n```\nfunction _mul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n\tif (y != 0) {\n\treturn z = x * y;\n}\n```\n\n# 2) Unauthorized users can pause oracle.\nEven though function `pauseOracle` is included in the admin's functions, it can be paused by any user.\nApparently, Company doesn't need oracle to be paused by unauthorized users, so consider adding access control checks.\n\nInstance:\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/rwaOracles/RWADynamicOracle.sol#L241\n\nRecommended mitigation steps:\nConsider making this function similar to `unpauseOracle`, by making it available only for admin.\n```\n- function pauseOracle() external onlyRole(PAUSER_ROLE) {\n+ function pauseOracle() external onlyRole(DEFAULT_ADMIN_ROLE) {\n _pause();\n}\n```\n", "vulnerable_code": "function _mul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n\tif (y != 0) {\n\treturn z = x * y;\n}", "fixed_code": "- function pauseOracle() external onlyRole(PAUSER_ROLE) {\n+ function pauseOracle() external onlyRole(DEFAULT_ADMIN_ROLE) {\n _pause();\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/catwhiskeys-Q.md", "collected_at": "2026-01-02T18:25:52.035771+00:00", "source_hash": "00b28b7de051f0271d24e95a420e719e0534b51a71c304fa4d5e7ec782cefb08", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 245, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _mul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n\tif (y != 0) {\n\treturn z = x * y;\n}", "primary_code_language": "unknown", "primary_code_char_count": 107, "all_code_blocks": "// Code block 1 (unknown):\nfunction _mul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n\tif (y != 0) {\n\treturn z = x * y;\n}\n\n// Code block 2 (unknown):\n- function pauseOracle() external onlyRole(PAUSER_ROLE) {\n+ function pauseOracle() external onlyRole(DEFAULT_ADMIN_ROLE) {\n _pause();\n}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "RWADynamicOracle.sol#L405, RWADynamicOracle.sol#L241", "github_files_list": "RWADynamicOracle.sol", "github_refs_count": 2, "vulnerable_code_actual": "function _mul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n\tif (y != 0) {\n\treturn z = x * y;\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "- function pauseOracle() external onlyRole(PAUSER_ROLE) {\n+ function pauseOracle() external onlyRole(DEFAULT_ADMIN_ROLE) {\n _pause();\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7.65} {"source": "c4", "protocol": "01-biconomy", "title": "W0RR1O G", "severity_raw": "Medium", "severity": "medium", "description": "Use ++i instead of i++ to save gas\n===============\n\nthis gas optimization can be done in the following lines:\n\n`https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L74`\n`https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L80`\n`https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L99`\n`https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L112`\n`https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L128`\n`https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L134`\n\nUse delegatecall or callcode instead of call to save gas\n===================================\n`https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/base/Executor.sol#L28`\n\nUse `REQUIRE` Instead of `ASSERT`\n======================\nThe solidity functions `assert()` and `require()` are used for error handling in solidity. Since solidity makes uses of state reverting error handling this means all changes made to the contract or any of its subcalls are undone if an error is occured.\n\nSince both of this functions are quite similar and they do almost the same thing here are the differences between them:\n\n* The `assert()` function when false uses up all the remaining gas and reverts all changes made.\n\n* However, the `require()` function in solidity refunds all the remaining gas that we offered to pay and reverts back all changes made in the contract.\n\nAffected code:\n* https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/Proxy.sol#L16\n\n* https://github.com/cod", "vulnerable_code": "pragma solidity ^0.8.12;\n\n//Not optimized contract\ncontract TestA{\n uint private num;\n function testA() public{\n num += 1;\n }\n}\n\n//Optimized contract\ncontract TestB{\n uint private num;\n function testB() public{\n num = num + 1;\n }\n}", "fixed_code": "contract TestA = 50027gas\ncontract TestB = 50012gas", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/W0RR1O-G.md", "collected_at": "2026-01-02T18:13:26.530549+00:00", "source_hash": "00e2fa3e965f168636430d93059c3f91fd8d428192c2a5fef9874ca7ae813b67", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 8, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "EntryPoint.sol#L74, EntryPoint.sol#L80, EntryPoint.sol#L99, EntryPoint.sol#L112, EntryPoint.sol#L128, EntryPoint.sol#L134, Executor.sol#L28, Proxy.sol#L16", "github_files_list": "Executor.sol, Proxy.sol, EntryPoint.sol", "github_refs_count": 8, "vulnerable_code_actual": "pragma solidity ^0.8.12;\n\n//Not optimized contract\ncontract TestA{\n uint private num;\n function testA() public{\n num += 1;\n }\n}\n\n//Optimized contract\ncontract TestB{\n uint private num;\n function testB() public{\n num = num + 1;\n }\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "contract TestA = 50027gas\ncontract TestB = 50012gas", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "11-kelp", "title": "0xhex G", "severity_raw": "Low", "severity": "low", "description": "# Gas-Optimization\n\n## [G-01] Use do while loops instead of for loops\n\n```solidity\nFile: src/LRTOracle.sol\n\n66 for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n```\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTOracle.sol#L66\n\n```solidity\nFile: src/LRTDepositPool.sol\n\n82 for (uint256 i; i < ndcsCount;) {\n\n168 for (uint256 i; i < length;) {\n```\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L82\n\n```solidity\nFile: src/NodeDelegator.sol\n\n109 for (uint256 i = 0; i < strategiesLength;) {\n```\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/NodeDelegator.sol#L109\n\n## [G-02] Using mappings instead of arrays to avoid length checks\n\n```solidity\nFile: src/LRTDepositPool.sol\n\n22 address[] public nodeDelegatorQueue;\n```\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L22\n\n```solidity\nFile: src/LRTConfig.sol\n\n19 address[] public supportedAssetList;\n```\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTConfig.sol#L19\n\n## [G-03] Don't make variables public unless necessary\n\n```solidity\nFile: src/RSETH.sol\n\n21 bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n\n22 bytes32 public constant BURNER_ROLE = keccak256(\"BURNER_ROLE\");\n```\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/RSETH.sol#L21\n\n```solidity\nFile: src/LRTDepositPool.sol\n\n20 uint256 public maxNodeDelegatorCount;\n\n22 address[] public nodeDelegatorQueue;\n```\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L20\n\n```solidity\nFile: src/LRTConfig.sol\n\n19 address[] public supportedAssetList;\n\n21 address public rsETH;\n```\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTConfig.sol#L19\n\n```solidity\nFile: src/utils/LRTConfigRoleChecker.sol\n\n14 ILRTConfig public lrtConfig;\n```\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/utils/LRTConfigRoleChecker.sol#L14\n\n```solidity\nFile: src/utils/LRTConstants.sol", "vulnerable_code": "File: src/LRTOracle.sol\n\n66 for (uint16 asset_idx; asset_idx < supportedAssetCount;) {", "fixed_code": "File: src/LRTDepositPool.sol\n\n82 for (uint256 i; i < ndcsCount;) {\n\n168 for (uint256 i; i < length;) {", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/0xhex-G.md", "collected_at": "2026-01-02T18:27:15.511639+00:00", "source_hash": "01246ab8601ca24ef3d737df26bc1883dede0e8c82fe48c4677f6faed634a8ab", "code_block_count": 9, "solidity_block_count": 9, "total_code_chars": 882, "github_ref_count": 8, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: src/LRTOracle.sol\n\n66 for (uint16 asset_idx; asset_idx < supportedAssetCount;) {", "primary_code_language": "solidity", "primary_code_char_count": 93, "all_code_blocks": "// Code block 1 (solidity):\nFile: src/LRTOracle.sol\n\n66 for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n\n// Code block 2 (solidity):\nFile: src/LRTDepositPool.sol\n\n82 for (uint256 i; i < ndcsCount;) {\n\n168 for (uint256 i; i < length;) {\n\n// Code block 3 (solidity):\nFile: src/NodeDelegator.sol\n\n109 for (uint256 i = 0; i < strategiesLength;) {\n\n// Code block 4 (solidity):\nFile: src/LRTDepositPool.sol\n\n22 address[] public nodeDelegatorQueue;\n\n// Code block 5 (solidity):\nFile: src/LRTConfig.sol\n\n19 address[] public supportedAssetList;\n\n// Code block 6 (solidity):\nFile: src/RSETH.sol\n\n21 bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n\n22 bytes32 public constant BURNER_ROLE = keccak256(\"BURNER_ROLE\");\n\n// Code block 7 (solidity):\nFile: src/LRTDepositPool.sol\n\n20 uint256 public maxNodeDelegatorCount;\n\n22 address[] public nodeDelegatorQueue;\n\n// Code block 8 (solidity):\nFile: src/LRTConfig.sol\n\n19 address[] public supportedAssetList;\n\n21 address public rsETH;\n\n// Code block 9 (solidity):\nFile: src/utils/LRTConfigRoleChecker.sol\n\n14 ILRTConfig public lrtConfig;", "all_code_blocks_count": 9, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: src/LRTOracle.sol\n\n66 for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n\nFile: src/LRTDepositPool.sol\n\n82 for (uint256 i; i < ndcsCount;) {\n\n168 for (uint256 i; i < length;) {\n\nFile: src/NodeDelegator.sol\n\n109 for (uint256 i = 0; i < strategiesLength;) {\n\nFile: src/LRTDepositPool.sol\n\n22 address[] public nodeDelegatorQueue;\n\nFile: src/LRTConfig.sol\n\n19 address[] public supportedAssetList;\n\nFile: src/RSETH.sol\n\n21 bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n\n22 bytes32 public constant BURNER_ROLE = keccak256(\"BURNER_ROLE\");\n\nFile: src/LRTDepositPool.sol\n\n20 uint256 public maxNodeDelegatorCount;\n\n22 address[] public nodeDelegatorQueue;\n\nFile: src/LRTConfig.sol\n\n19 address[] public supportedAssetList;\n\n21 address public rsETH;\n\nFile: src/utils/LRTConfigRoleChecker.sol\n\n14 ILRTConfig public lrtConfig;", "github_refs_formatted": "LRTOracle.sol#L66, LRTDepositPool.sol#L82, NodeDelegator.sol#L109, LRTDepositPool.sol#L22, LRTConfig.sol#L19, RSETH.sol#L21, LRTDepositPool.sol#L20, LRTConfigRoleChecker.sol#L14", "github_files_list": "LRTConfigRoleChecker.sol, LRTOracle.sol, RSETH.sol, NodeDelegator.sol, LRTConfig.sol, LRTDepositPool.sol", "github_refs_count": 8, "vulnerable_code_actual": "File: src/LRTOracle.sol\n\n66 for (uint16 asset_idx; asset_idx < supportedAssetCount;) {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: src/LRTDepositPool.sol\n\n82 for (uint256 i; i < ndcsCount;) {\n\n168 for (uint256 i; i < length;) {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 15} {"source": "c4", "protocol": "11-kelp", "title": "spark Q", "severity_raw": "Low", "severity": "low", "description": "# 1. Potential Data Inconsistency between `tokenMap` and `isSupportedAsset`\n\nIn contract `LRTConfig`, the token info is split into two storage: \n\n- ``tokenMap`` \n- `isSupportedAsset`.\n\nAnd each storage will be updated by the different role:\n\n- ``tokenMap`` -> admin\n- `isSupportedAsset` -> manager\n\nAs a result, there could be data inconsistency between the two storages.\n\n\n\n# 2. Unused Pause Functionality\n\nThe `LRTOracle` declare pause and unpause but no function is restricted with these methods.\n\n\n\n# 3. Missing Truncation Protection in `getRsETHAmountToMint`\n\n`getRsETHAmountToMint` will return the value that user can mint, however, there could be truncation when rsETH price is large or amount is too low. As a result user will deposit for nothing:\n\n```\nrsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();\n```\n\nIt's better to set a minimum deposit value(amount * asset value).", "vulnerable_code": "rsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/spark-Q.md", "collected_at": "2026-01-02T18:28:28.630091+00:00", "source_hash": "015cb04f97aad19d479bce89363eee5ac2f3b01a2563218ebb72a04e95c768cf", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 90, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "rsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();", "primary_code_language": "unknown", "primary_code_char_count": 90, "all_code_blocks": "// Code block 1 (unknown):\nrsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "rsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 3.85} {"source": "c4", "protocol": "11-kelp", "title": "phoenixV110 Q", "severity_raw": "Low", "severity": "low", "description": "# [L-01] Modifier `onlySupportedAsset()` is missing in `getAssetBalance()`\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/NodeDelegator.sol#L121-L124\n\n## Description\nThe method `getAssetBalance()` doesn't check if the asset is a supportedAsset or not. Which can revert or will return wrong values if **assetStrategy** is present for that asset.\n\n## Recommendations\nAdd `onlySupportedAsset()` modifier in `getAssetBalance()` method\n```\n- function getAssetBalance(address asset) external view override returns (uint256) {\n+ function getAssetBalance(address asset) external view override onlySupportedAsset(asset) returns (uint256) {\n address strategy = lrtConfig.assetStrategy(asset);\n return IStrategy(strategy).userUnderlyingView(address(this));\n }\n```\n# [L-02] While depositing assets in the LRTDepositPool, method getAssetPrice() can revert unexpectedly if price feed for the asset is not present in assetPriceFeed array\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTOracle.sol#L45-L47\n\n## Summary\nThe `getAssetPrice()` returns to price of an asset by fetching in from Chainlink oracle. It checks `onlySupportedAsset()` modifier but doesn't check if the price feed for this asset is present or not.\n\n## Vulnerability Details\nThe `getAssetPrice()` doesn't check if the price feed for the asset is added. It can revert unexpectedly when calculating RSETH or asset prices.\n\n```\nfunction getAssetPrice(address asset) external view onlySupportedAsset(asset) returns (uint256) {\n return AggregatorInterface(assetPriceFeed[asset]).latestAnswer();\n }\n```\n\n# [L-03] **rsethAmountToMint > 0** check is missing when executing `_mintRsETH()`\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L151-L157\n\n## Description\nThe method `_mintRsETH()` mint and sends RSETH to the caller. But the check **rsethAmountToMint != 0** is missing in the function. \n\n## Recommendations\n```\nif(rsethAmountToMint == 0) {\n revert(\"RSETH am", "vulnerable_code": "- function getAssetBalance(address asset) external view override returns (uint256) {\n+ function getAssetBalance(address asset) external view override onlySupportedAsset(asset) returns (uint256) {\n address strategy = lrtConfig.assetStrategy(asset);\n return IStrategy(strategy).userUnderlyingView(address(this));\n }", "fixed_code": "function getAssetPrice(address asset) external view onlySupportedAsset(asset) returns (uint256) {\n return AggregatorInterface(assetPriceFeed[asset]).latestAnswer();\n }", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/phoenixV110-Q.md", "collected_at": "2026-01-02T18:28:22.844057+00:00", "source_hash": "01693b230f9534497016992ffe1c5fe8df0a5d38ccd5cd325aa16a02cf109112", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 516, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "- function getAssetBalance(address asset) external view override returns (uint256) {\n+ function getAssetBalance(address asset) external view override onlySupportedAsset(asset) returns (uint256) {\n address strategy = lrtConfig.assetStrategy(asset);\n return IStrategy(strategy).userUnderlyingView(address(this));\n }", "primary_code_language": "unknown", "primary_code_char_count": 339, "all_code_blocks": "// Code block 1 (unknown):\n- function getAssetBalance(address asset) external view override returns (uint256) {\n+ function getAssetBalance(address asset) external view override onlySupportedAsset(asset) returns (uint256) {\n address strategy = lrtConfig.assetStrategy(asset);\n return IStrategy(strategy).userUnderlyingView(address(this));\n }\n\n// Code block 2 (unknown):\nfunction getAssetPrice(address asset) external view onlySupportedAsset(asset) returns (uint256) {\n return AggregatorInterface(assetPriceFeed[asset]).latestAnswer();\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "NodeDelegator.sol#L121-L124, LRTOracle.sol#L45-L47, LRTDepositPool.sol#L151-L157", "github_files_list": "NodeDelegator.sol, LRTDepositPool.sol, LRTOracle.sol", "github_refs_count": 3, "vulnerable_code_actual": "- function getAssetBalance(address asset) external view override returns (uint256) {\n+ function getAssetBalance(address asset) external view override onlySupportedAsset(asset) returns (uint256) {\n address strategy = lrtConfig.assetStrategy(asset);\n return IStrategy(strategy).userUnderlyingView(address(this));\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function getAssetPrice(address asset) external view onlySupportedAsset(asset) returns (uint256) {\n return AggregatorInterface(assetPriceFeed[asset]).latestAnswer();\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "05-ajna", "title": "codeslide Q", "severity_raw": "Critical", "severity": "critical", "description": "### Low Risk Issues List\n\n| Number | Issue | Instances |\n| :----: | :---------------------- | :-------: |\n| [L-01] | Unsafe casting of uints | 7 |\n\n#### [L-01] Unsafe casting of uints\n\nDowncasting from uint256 in Solidity does not revert on overflow. This can result in undesired exploitation or bugs since developers usually assume that overflows raise errors. [OpenZeppelin's SafeCast](https://docs.openzeppelin.com/contracts/3.x/api/utils#SafeCast) restores this intuition by reverting the transaction when such an operation overflows. Using this library instead of the unchecked operations eliminates an entire class of bugs, so it's recommended to always use it.\n\nAlthough SafeCast is used elsewhere in this code base, the following instances are not using it.\n\n```solidity\nFile: ajna-core/src/RewardsManager.sol\n\n179: toBucket.lpsAtStakeTime = uint128(positionManager.getLP(tokenId_, toIndex));\n180: toBucket.rateAtStakeTime = uint128(IPool(ajnaPool).bucketExchangeRate(toIndex));\n\n222: stakeInfo.stakingEpoch = uint96(curBurnEpoch);\n\n225: stakeInfo.lastClaimedEpoch = uint96(curBurnEpoch);\n\n236: bucketState.lpsAtStakeTime = uint128(positionManager.getLP(\n237: tokenId_,\n238: bucketId\n239: ));\n240: // record the bucket exchange rate at the time of staking\n241: bucketState.rateAtStakeTime = uint128(IPool(ajnaPool).bucketExchangeRate(bucketId));\n\n594: stakeInfo_.lastClaimedEpoch = uint96(epochToClaim_);\n```\n\n### Non Critical Issues\n\n| Number | Issue | Instances |\n| :-----: | :---------------------------------- | :-------: |\n| [NC-01] | Whitespace in Expressions | 17 |\n| [NC-02] | Use the complete name of data types | 6 |\n| [NC-03] | Control Structures | 13 |\n| [NC-04] | Constants in comparisons | 31 |\n\n#### [NC-01] Whitespace in Ex", "vulnerable_code": "File: ajna-core/src/RewardsManager.sol\n\n179: toBucket.lpsAtStakeTime = uint128(positionManager.getLP(tokenId_, toIndex));\n180: toBucket.rateAtStakeTime = uint128(IPool(ajnaPool).bucketExchangeRate(toIndex));\n\n222: stakeInfo.stakingEpoch = uint96(curBurnEpoch);\n\n225: stakeInfo.lastClaimedEpoch = uint96(curBurnEpoch);\n\n236: bucketState.lpsAtStakeTime = uint128(positionManager.getLP(\n237: tokenId_,\n238: bucketId\n239: ));\n240: // record the bucket exchange rate at the time of staking\n241: bucketState.rateAtStakeTime = uint128(IPool(ajnaPool).bucketExchangeRate(bucketId));\n\n594: stakeInfo_.lastClaimedEpoch = uint96(epochToClaim_);", "fixed_code": "// Yes\nx = 1;\ny = 2;\nlongVariable = 3;\n\n// No\nx = 1;\ny = 2;\nlongVariable = 3;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/codeslide-Q.md", "collected_at": "2026-01-02T18:21:24.387068+00:00", "source_hash": "01cb0f4b0d1ac42068ff43574adf0b1def5662dcd738b80578731d16d012323d", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 762, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: ajna-core/src/RewardsManager.sol\n\n179: toBucket.lpsAtStakeTime = uint128(positionManager.getLP(tokenId_, toIndex));\n180: toBucket.rateAtStakeTime = uint128(IPool(ajnaPool).bucketExchangeRate(toIndex));\n\n222: stakeInfo.stakingEpoch = uint96(curBurnEpoch);\n\n225: stakeInfo.lastClaimedEpoch = uint96(curBurnEpoch);\n\n236: bucketState.lpsAtStakeTime = uint128(positionManager.getLP(\n237: tokenId_,\n238: bucketId\n239: ));\n240: // record the bucket exchange rate at the time of staking\n241: bucketState.rateAtStakeTime = uint128(IPool(ajnaPool).bucketExchangeRate(bucketId));\n\n594: stakeInfo_.lastClaimedEpoch = uint96(epochToClaim_);", "primary_code_language": "solidity", "primary_code_char_count": 762, "all_code_blocks": "// Code block 1 (solidity):\nFile: ajna-core/src/RewardsManager.sol\n\n179: toBucket.lpsAtStakeTime = uint128(positionManager.getLP(tokenId_, toIndex));\n180: toBucket.rateAtStakeTime = uint128(IPool(ajnaPool).bucketExchangeRate(toIndex));\n\n222: stakeInfo.stakingEpoch = uint96(curBurnEpoch);\n\n225: stakeInfo.lastClaimedEpoch = uint96(curBurnEpoch);\n\n236: bucketState.lpsAtStakeTime = uint128(positionManager.getLP(\n237: tokenId_,\n238: bucketId\n239: ));\n240: // record the bucket exchange rate at the time of staking\n241: bucketState.rateAtStakeTime = uint128(IPool(ajnaPool).bucketExchangeRate(bucketId));\n\n594: stakeInfo_.lastClaimedEpoch = uint96(epochToClaim_);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: ajna-core/src/RewardsManager.sol\n\n179: toBucket.lpsAtStakeTime = uint128(positionManager.getLP(tokenId_, toIndex));\n180: toBucket.rateAtStakeTime = uint128(IPool(ajnaPool).bucketExchangeRate(toIndex));\n\n222: stakeInfo.stakingEpoch = uint96(curBurnEpoch);\n\n225: stakeInfo.lastClaimedEpoch = uint96(curBurnEpoch);\n\n236: bucketState.lpsAtStakeTime = uint128(positionManager.getLP(\n237: tokenId_,\n238: bucketId\n239: ));\n240: // record the bucket exchange rate at the time of staking\n241: bucketState.rateAtStakeTime = uint128(IPool(ajnaPool).bucketExchangeRate(bucketId));\n\n594: stakeInfo_.lastClaimedEpoch = uint96(epochToClaim_);", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: ajna-core/src/RewardsManager.sol\n\n179: toBucket.lpsAtStakeTime = uint128(positionManager.getLP(tokenId_, toIndex));\n180: toBucket.rateAtStakeTime = uint128(IPool(ajnaPool).bucketExchangeRate(toIndex));\n\n222: stakeInfo.stakingEpoch = uint96(curBurnEpoch);\n\n225: stakeInfo.lastClaimedEpoch = uint96(curBurnEpoch);\n\n236: bucketState.lpsAtStakeTime = uint128(positionManager.getLP(\n237: tokenId_,\n238: bucketId\n239: ));\n240: // record the bucket exchange rate at the time of staking\n241: bucketState.rateAtStakeTime = uint128(IPool(ajnaPool).bucketExchangeRate(bucketId));\n\n594: stakeInfo_.lastClaimedEpoch = uint96(epochToClaim_);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "// Yes\nx = 1;\ny = 2;\nlongVariable = 3;\n\n// No\nx = 1;\ny = 2;\nlongVariable = 3;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "08-dopex", "title": "Aymen0909 Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA Report\n\n## Summary\n\n| | Issue | Risk | Instances |\n| :-------------: |:-------------|:-------------:|:-------------:|\n| 1 | Potential underflow in `RdpxV2Core.calculateBondCost` will cause DOS of bond operations | Low | 1 |\n| 2 | Missing `sync()` after transferring funds to `RdpxV2Core` | Low | 2 |\n| 3 | Funds not transferred to correct recipient in `RdpxDecayingBonds.emergencyWithdraw`| Low | 1 |\n| 4 | `UniV2LiquidityAMO.approveContractToSpend` can't approve USDT transfer | Low | 1 |\n| 5 | `PerpetualAtlanticVaultLP` can never pull funds from `PerpetualAtlanticVault` | Low | |\n| 6 | `MANAGER_ROLE` not used in `PerpetualAtlanticVault` | Low | |\n| 7 | `underlyingSymbol` not set in `PerpetualAtlanticVaultLP` | NC | |\n| 8 | Unused state variable `collateralPrecision` in the `PerpetualAtlanticVault` contract | NC | |\n\n\n## Findings\n\n### 1- Potential underflow in `RdpxV2Core.calculateBondCost` will cause DOS of bond operations :\n\n#### Risk : Low\n\nThe function `RdpxV2Core.calculateBondCost` is used to calculate the amount of weth and rdpx tokens required to create a bond, in the case where `_rdpxBondId == 0` the function has to calculate the value of `bondDiscount` and it validate that its value is less than `100e8`.\n\nThe issue is that in the following lines of code there is this substraction operation :\n\n```\nrdpxRequired =\n ((RDPX_RATIO_PERCENTAGE - (bondDiscount / 2)) *\n _amount *\n DEFAULT_PRECISION) /\n (DEFAULT_PRECISION * rdpxPrice * 1e2);\n```\n\nwhere `RDPX_RATIO_PERCENTAGE = 25 * DEFAULT_PRECISION = 25e8`\n\nAs you can see if we have `bondDiscount / 2 > RDPX_RATIO_PERCENTAGE` the operation will revert due to an underflow, and because the check present in the function only ensures that `bondDiscount < 100e8`, it means that there are many valid values for `bondDiscount` that will make the function revert. For example if we take `bondDiscount = 60e8` (which is valid as it's less than 100e8) when the subtraction op go", "vulnerable_code": "rdpxRequired =\n ((RDPX_RATIO_PERCENTAGE - (bondDiscount / 2)) *\n _amount *\n DEFAULT_PRECISION) /\n (DEFAULT_PRECISION * rdpxPrice * 1e2);", "fixed_code": "function calculateBondCost(\n uint256 _amount,\n uint256 _rdpxBondId\n) public view returns (uint256 rdpxRequired, uint256 wethRequired) {\n uint256 rdpxPrice = getRdpxPrice();\n if (_rdpxBondId == 0) {\n uint256 bondDiscount = (bondDiscountFactor *\n Math.sqrt(IRdpxReserve(addresses.rdpxReserve).rdpxReserve()) *\n 1e2) / (Math.sqrt(1e18)); // 1e8 precision\n\n // @audit allow values of bondDiscount < 100e8 \n _validate(bondDiscount < 100e8, 14);\n\n // @audit can underflow if bondDiscount > 50e8\n rdpxRequired =\n ((RDPX_RATIO_PERCENTAGE - (bondDiscount / 2)) *\n _amount *\n DEFAULT_PRECISION) /\n (DEFAULT_PRECISION * rdpxPrice * 1e2);\n\n wethRequired =\n ((ETH_RATIO_PERCENTAGE - (bondDiscount / 2)) * _amount) /\n (DEFAULT_PRECISION * 1e2);\n } else {\n ...\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/Aymen0909-Q.md", "collected_at": "2026-01-02T18:24:30.378248+00:00", "source_hash": "01d558201cd0629413c725a041a2c7d44ec8d438bb433d14328dc9fb1f274fe3", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 156, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "rdpxRequired =\n ((RDPX_RATIO_PERCENTAGE - (bondDiscount / 2)) *\n _amount *\n DEFAULT_PRECISION) /\n (DEFAULT_PRECISION * rdpxPrice * 1e2);", "primary_code_language": "unknown", "primary_code_char_count": 156, "all_code_blocks": "// Code block 1 (unknown):\nrdpxRequired =\n ((RDPX_RATIO_PERCENTAGE - (bondDiscount / 2)) *\n _amount *\n DEFAULT_PRECISION) /\n (DEFAULT_PRECISION * rdpxPrice * 1e2);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "rdpxRequired =\n ((RDPX_RATIO_PERCENTAGE - (bondDiscount / 2)) *\n _amount *\n DEFAULT_PRECISION) /\n (DEFAULT_PRECISION * rdpxPrice * 1e2);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function calculateBondCost(\n uint256 _amount,\n uint256 _rdpxBondId\n) public view returns (uint256 rdpxRequired, uint256 wethRequired) {\n uint256 rdpxPrice = getRdpxPrice();\n if (_rdpxBondId == 0) {\n uint256 bondDiscount = (bondDiscountFactor *\n Math.sqrt(IRdpxReserve(addresses.rdpxReserve).rdpxReserve()) *\n 1e2) / (Math.sqrt(1e18)); // 1e8 precision\n\n // @audit allow values of bondDiscount < 100e8 \n _validate(bondDiscount < 100e8, 14);\n\n // @audit can underflow if bondDiscount > 50e8\n rdpxRequired =\n ((RDPX_RATIO_PERCENTAGE - (bondDiscount / 2)) *\n _amount *\n DEFAULT_PRECISION) /\n (DEFAULT_PRECISION * rdpxPrice * 1e2);\n\n wethRequired =\n ((ETH_RATIO_PERCENTAGE - (bondDiscount / 2)) * _amount) /\n (DEFAULT_PRECISION * 1e2);\n } else {\n ...\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "05-ajna", "title": "rbserver Q", "severity_raw": "Critical", "severity": "critical", "description": "## QA REPORT\n\n| |Issue|\n|-|:-|\n| [01] | `CHALLENGE_PERIOD_LENGTH`, `DISTRIBUTION_PERIOD_LENGTH`, `FUNDING_PERIOD_LENGTH`, AND `MAX_EFM_PROPOSAL_LENGTH` ARE HARDCODED BASED ON 7200 BLOCKS PER DAY |\n| [02] | AMBIGUITY IN `StandardFunding._standardProposalState` FUNCTION |\n| [03] | `ExtraordinaryFundingProposal.votesReceived` IN `ExtraordinaryFunding` CONTRACT IS `uint120` INSTEAD OF `uint128` |\n| [04] | CALLING `ExtraordinaryFunding.proposeExtraordinary` AND `StandardFunding.proposeStandard` FUNCTIONS CAN REVERT AND WASTE GAS |\n| [05] | `ajnaTokenAddress` IS HARDCODED |\n| [06] | CODE COMMENT IN `ExtraordinaryFunding._extraordinaryProposalSucceeded` FUNCTION CAN BE INCORRECT |\n| [07] | CODE COMMENT FOR `CHALLENGE_PERIOD_LENGTH` CAN BE MORE ACCURATE |\n| [08] | MISSING `address(0)` CHECKS FOR CRITICAL CONSTRUCTOR INPUTS |\n| [09] | SOLIDITY VERSION `0.8.19` CAN BE USED |\n| [10] | SETTING `support` TO `1` WHEN `voteParams_.votesUsed < 0` IS FALSE IN `StandardFunding._fundingVote` FUNCTION IS REDUNDANT |\n| [11] | REDUNDANT EXECUTION OF `if (sumOfTheSquareOfVotesCast > type(uint128).max) revert InsufficientVotingPower()` IN `StandardFunding._fundingVote` FUNCTION |\n| [12] | `InvalidVote` ERROR CAN BE MORE DESCRIPTIVE |\n| [13] | CONSTANTS CAN BE USED INSTEAD OF MAGIC NUMBERS |\n| [14] | UNDERSCORES CAN BE ADDED FOR NUMBERS |\n| [15] | `uint256` CAN BE USED INSTEAD OF `uint` |\n| [16] | SPACES CAN BE ADDED FOR BETTER READABILITY |\n\n## [01] `CHALLENGE_PERIOD_LENGTH`, `DISTRIBUTION_PERIOD_LENGTH`, `FUNDING_PERIOD_LENGTH`, AND `MAX_EFM_PROPOSAL_LENGTH` ARE HARDCODED BASED ON 7200 BLOCKS PER DAY\nThe following `CHALLENGE_PERIOD_LENGTH`, `DISTRIBUTION_PERIOD_LENGTH`, `FUNDING_PERIOD_LENGTH`, and `MAX_EFM_PROPOSAL_LENGTH` are hardcoded and assume that the number of blocks per day is 7200 and the number of seconds per block is 12. Yet, it is possible that the number of seconds per block is more or less than 12 due to network traffic and future chain upgrades. When the number of seconds p", "vulnerable_code": " /**\n * @notice Length of the challengephase of the distribution period in blocks.\n * @dev Roughly equivalent to the number of blocks in 7 days.\n * @dev The period in which funded proposal slates can be checked in updateSlate.\n */\n uint256 internal constant CHALLENGE_PERIOD_LENGTH = 50400;", "fixed_code": " /**\n * @notice Length of the distribution period in blocks.\n * @dev Roughly equivalent to the number of blocks in 90 days.\n */\n uint48 internal constant DISTRIBUTION_PERIOD_LENGTH = 648000;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/rbserver-Q.md", "collected_at": "2026-01-02T18:21:44.964488+00:00", "source_hash": "020204fc263ca1de1aa20e69d328e7ab101bcfe68411350f6cfb4d47def4bc67", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " /**\n * @notice Length of the challengephase of the distribution period in blocks.\n * @dev Roughly equivalent to the number of blocks in 7 days.\n * @dev The period in which funded proposal slates can be checked in updateSlate.\n */\n uint256 internal constant CHALLENGE_PERIOD_LENGTH = 50400;", "has_vulnerable_code_snippet": true, "fixed_code_actual": " /**\n * @notice Length of the distribution period in blocks.\n * @dev Roughly equivalent to the number of blocks in 90 days.\n */\n uint48 internal constant DISTRIBUTION_PERIOD_LENGTH = 648000;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "02-ethos", "title": "LethL Q", "severity_raw": "Critical", "severity": "critical", "description": "## Low Issues\n| | Issue | Instances |\n|---|---|---|\n| Low-1 | Lack of checks-effects-interactions | 1 |\n| Low-2 | Loss of precision due to rounding | 1 |\n| Low-3 | Outdated Compiler Version | 8 |\n\n### [Low-1] Lack of checks-effects-interactions\nExternal calls should be executed after state changes to avoid reetrancy bugs.\nConsider moving the external calls after the state changes in the following instances:\n\nInstances(1):\n```\nFile: Ethos-Core/contracts/LUSDToken.sol\n\n237: _transfer(sender, recipient, amount);\n238: _approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount, \"ERC20: transfer amount exceeds allowance\"));\n```\nLink to Code: https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L237-L238\n\n### [Low-2] Loss of precision due to rounding\nAdd scalars so roundings are negligible.\n\nInstances(1):\n```\nFile: Ethos-Vault/contracts/ReaperVaultV2.sol\n\n463: uint256 performanceFee = (gain * strategies[strategy].feeBPS) / PERCENT_DIVISOR;\n```\nLink to Code: https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L463\n\n### [Low-3] Outdated Compiler Version\nUsing an outdated compiler version (0.6.11) can be problematic if there are known bugs and issues with the current compiler version. It is recommended to use a latest stable version of the Solidity compiler (https://blog.soliditylang.org/2020/07/22/Solidity-0612-release-announcement/).\n\nInstances(8):\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol#L3\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L3\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L3\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol#L3\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/StabilityPool.sol#L3\nhttps://github.com/code-423n4/2023-02-et", "vulnerable_code": "File: Ethos-Core/contracts/LUSDToken.sol\n\n237: _transfer(sender, recipient, amount);\n238: _approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount, \"ERC20: transfer amount exceeds allowance\"));", "fixed_code": "File: Ethos-Vault/contracts/ReaperVaultV2.sol\n\n463: uint256 performanceFee = (gain * strategies[strategy].feeBPS) / PERCENT_DIVISOR;", "recommendation": "", "category": "slippage", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/LethL-Q.md", "collected_at": "2026-01-02T18:16:19.793349+00:00", "source_hash": "021c777991438066d83b490bb5fabcffbd39ff2bc4af35d9810759440aa9c8be", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 361, "github_ref_count": 7, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: Ethos-Core/contracts/LUSDToken.sol\n\n237: _transfer(sender, recipient, amount);\n238: _approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount, \"ERC20: transfer amount exceeds allowance\"));", "primary_code_language": "unknown", "primary_code_char_count": 222, "all_code_blocks": "// Code block 1 (unknown):\nFile: Ethos-Core/contracts/LUSDToken.sol\n\n237: _transfer(sender, recipient, amount);\n238: _approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount, \"ERC20: transfer amount exceeds allowance\"));\n\n// Code block 2 (unknown):\nFile: Ethos-Vault/contracts/ReaperVaultV2.sol\n\n463: uint256 performanceFee = (gain * strategies[strategy].feeBPS) / PERCENT_DIVISOR;", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LUSDToken.sol#L237-L238, ReaperVaultV2.sol#L463, CollateralConfig.sol#L3, BorrowerOperations.sol#L3, TroveManager.sol#L3, ActivePool.sol#L3, StabilityPool.sol#L3", "github_files_list": "StabilityPool.sol, TroveManager.sol, BorrowerOperations.sol, ReaperVaultV2.sol, LUSDToken.sol, ActivePool.sol, CollateralConfig.sol", "github_refs_count": 7, "vulnerable_code_actual": "File: Ethos-Core/contracts/LUSDToken.sol\n\n237: _transfer(sender, recipient, amount);\n238: _approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount, \"ERC20: transfer amount exceeds allowance\"));", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: Ethos-Vault/contracts/ReaperVaultV2.sol\n\n463: uint256 performanceFee = (gain * strategies[strategy].feeBPS) / PERCENT_DIVISOR;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "09-ondo", "title": "zigtur Q", "severity_raw": "Unknown", "severity": "unknown", "description": "# Unused code should be deleted and not commented out\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/MintRateLimiter.sol#L56-L64\n\nMintRateLimiter.sol constructor has some commented out code.\n\nThis code should be deleted if not used in production. Here is the fixed constructor:\n```solidity\n constructor(uint256 _mintResetDuration, uint256 _instantMintLimit) {\n resetMintDuration = _mintResetDuration; // can be zero for per-block limit\n mintLimit = _instantMintLimit; // can be zero to disable minting\n\n lastResetMintTime = block.timestamp;\n }\n```\n\n\n\n# SharesBurnt event is incorrect\nIn _burnShares, `preRebaseTokenAmount` and `postRebaseTokenAmount` get their value from `getRUSDYByShares(_sharesAmount)` before and after burning shares (`totalShares` and `shares[account]` are updated).\n\nAs `getRUSDYByShares` doesn't use any of the updated value and `sharesAmount` is not modified, then `preRebaseTokenAmount` and `postRebaseTokenAmount` will always be equal.\n\nSo the event will emit two values that will **always** be the same.\n\n## Proof of Concept\nScope: https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDY.sol#L586-L592, https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDY.sol#L172-L177\n\n\nTest `test_rUSDY_burn()` in `rUSDY_harness.t.sol` shows an example of it (use `-vvvvv` args with forge, and look at `SharesBurnt` log).\n\n## Recommended Mitigation Steps\nEvent `SharesBurnt` should emit only one of this variable, as the value doesn't change.", "vulnerable_code": " constructor(uint256 _mintResetDuration, uint256 _instantMintLimit) {\n resetMintDuration = _mintResetDuration; // can be zero for per-block limit\n mintLimit = _instantMintLimit; // can be zero to disable minting\n\n lastResetMintTime = block.timestamp;\n }", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/zigtur-Q.md", "collected_at": "2026-01-02T18:26:23.876288+00:00", "source_hash": "0270e83c30f0531078084990070eded176ed8c6bcfdcf3aa3fcc9b94f36b85a6", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 262, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "constructor(uint256 _mintResetDuration, uint256 _instantMintLimit) {\n resetMintDuration = _mintResetDuration; // can be zero for per-block limit\n mintLimit = _instantMintLimit; // can be zero to disable minting\n\n lastResetMintTime = block.timestamp;\n }", "primary_code_language": "solidity", "primary_code_char_count": 262, "all_code_blocks": "// Code block 1 (solidity):\nconstructor(uint256 _mintResetDuration, uint256 _instantMintLimit) {\n resetMintDuration = _mintResetDuration; // can be zero for per-block limit\n mintLimit = _instantMintLimit; // can be zero to disable minting\n\n lastResetMintTime = block.timestamp;\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "constructor(uint256 _mintResetDuration, uint256 _instantMintLimit) {\n resetMintDuration = _mintResetDuration; // can be zero for per-block limit\n mintLimit = _instantMintLimit; // can be zero to disable minting\n\n lastResetMintTime = block.timestamp;\n }", "github_refs_formatted": "MintRateLimiter.sol#L56-L64, rUSDY.sol#L586-L592, rUSDY.sol#L172-L177", "github_files_list": "rUSDY.sol, MintRateLimiter.sol", "github_refs_count": 3, "vulnerable_code_actual": " constructor(uint256 _mintResetDuration, uint256 _instantMintLimit) {\n resetMintDuration = _mintResetDuration; // can be zero for per-block limit\n mintLimit = _instantMintLimit; // can be zero to disable minting\n\n lastResetMintTime = block.timestamp;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "03-revert-lend", "title": "slvDev G", "severity_raw": "High", "severity": "high", "description": "## Gas Findings\n\n| | Issue | Instances | Total Gas Saved |\n|----|-------|:---------:|:---------:|\n| [G-01] | Optimize Storage Layout in Structs | 5 | 100000 |\n| [G-02] | Optimize Storage with Byte Truncation for Time Related State Variables | 1 | 20000 |\n| [G-03] | Contract storage can use fewer slots by changing the order of state variables | 1 | 20000 |\n| [G-04] | Optimize Storage Layout in Structs by Truncating Time Related Fields | 8 | 160000 |\n| [G-05] | `do`-`while` is cheaper than `for`-loops when the initial check can be skipped | 2 | 510 |\n| [G-06] | Use `assembly` for Efficient Event Emission | 49 | 18620 |\n| [G-07] | Use custom errors rather than `require()/assert()/revert(with msg)` with string to save gas | 3 | 150 |\n| [G-08] | Enable IR-based code generation | 11 | - |\n| [G-09] | Avoid Explicit Initialization to Zero for Non-Constant/Non-Immutable State Variables | 13 | 37700 |\n| [G-10] | Assembly: Check `msg.sender` using xor and the scratch space | 23 | 483 |\n| [G-11] | Assembly: Use scratch space for building calldata | 10 | 5060 |\n| [G-12] | Multiple `address`/ID mappings can be combined into a single `mapping` of an `address`/ID to a `struct` | 9 | - |\n| [G-13] | Assigning `state` variables directly with struct constructors wastes gas | 2 | 142 |\n| [G-14] | Assembly: Use scratch space when building emitted events with two data arguments | 35 | 525 |\n| [G-15] | Stack variable is only used once | 41 | 123 |\n| [G-16] | `abi.encodePacked `is more gas efficient than `abi.encode` | 4 | 800 |\n| [G-17] | Consider Using `selfbalance()` Over `address(this).balance` | 1 | - |\n| [G-18] | Use `assembly` to write mutable storage values | 50 | 550 |\n| [G-19] | Using `delete` on a `uint/int` variable is cheaper than assigning it to `0` | 5 | 40 |\n| [G-20] | Use `revert()` to gain maximum gas savings | 105 | 5250 |\n| [G-21] | `x.a = x.a + b` always cheaper than `x.a += b` for Structs | 14 | 70 |\n| [G-22] | Using `constants` instead of `enum` can save gas | 2 | ", "vulnerable_code": "File: src/V3Oracle.sol\n\n/// @audit - Struct used 6 storage slots, but can be packed to 4 storage slots.\n//\tstruct TokenConfig {\n//\t Mode mode;\n//\t IUniswapV3Pool pool;\n//\t AggregatorV3Interface feed;\n//\t uint32 twapSeconds;\n//\t uint32 maxFeedAge;\n//\t uint16 maxDifference;\n//\t uint8 tokenDecimals;\n//\t uint8 feedDecimals;\n//\t bool isToken0;\n//\t}\n43: struct TokenConfig {\n AggregatorV3Interface feed; // chainlink feed\n uint32 maxFeedAge;\n uint8 feedDecimals;\n uint8 tokenDecimals;\n IUniswapV3Pool pool; // reference pool\n bool isToken0;\n uint32 twapSeconds;\n Mode mode;\n uint16 maxDifference; // max price difference x10000\n }", "fixed_code": "File: src/automators/AutoExit.sol\n\n/// @audit - Struct used 7 storage slots, but can be packed to 6 storage slots.\n//\tstruct ExecuteParams {\n//\t uint256 deadline;\n//\t uint256 amountRemoveMin1;\n//\t uint256 amountRemoveMin0;\n//\t bytes swapData;\n//\t uint256 tokenId;\n//\t uint128 liquidity;\n//\t uint64 rewardX64;\n//\t}\n63: struct ExecuteParams {\n uint256 tokenId; // tokenid to process\n bytes swapData; // if its a swap order - must include swap data\n uint128 liquidity; // liquidity the calculations are based on\n uint256 amountRemoveMin0; // min amount to be removed from liquidity\n uint256 amountRemoveMin1; // min amount to be removed from liquidity\n uint256 deadline; // for uniswap operations - operator promises fair value\n uint64 rewardX64; // which reward will be used for protocol, can be max configured amount (considering onlyFees)\n }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/slvDev-G.md", "collected_at": "2026-01-02T19:03:17.736684+00:00", "source_hash": "027a908a2f124e1fe4e34524ccf0ad4c179f7b7685261d2de053edcd8bce6464", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: src/V3Oracle.sol\n\n/// @audit - Struct used 6 storage slots, but can be packed to 4 storage slots.\n//\tstruct TokenConfig {\n//\t Mode mode;\n//\t IUniswapV3Pool pool;\n//\t AggregatorV3Interface feed;\n//\t uint32 twapSeconds;\n//\t uint32 maxFeedAge;\n//\t uint16 maxDifference;\n//\t uint8 tokenDecimals;\n//\t uint8 feedDecimals;\n//\t bool isToken0;\n//\t}\n43: struct TokenConfig {\n AggregatorV3Interface feed; // chainlink feed\n uint32 maxFeedAge;\n uint8 feedDecimals;\n uint8 tokenDecimals;\n IUniswapV3Pool pool; // reference pool\n bool isToken0;\n uint32 twapSeconds;\n Mode mode;\n uint16 maxDifference; // max price difference x10000\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: src/automators/AutoExit.sol\n\n/// @audit - Struct used 7 storage slots, but can be packed to 6 storage slots.\n//\tstruct ExecuteParams {\n//\t uint256 deadline;\n//\t uint256 amountRemoveMin1;\n//\t uint256 amountRemoveMin0;\n//\t bytes swapData;\n//\t uint256 tokenId;\n//\t uint128 liquidity;\n//\t uint64 rewardX64;\n//\t}\n63: struct ExecuteParams {\n uint256 tokenId; // tokenid to process\n bytes swapData; // if its a swap order - must include swap data\n uint128 liquidity; // liquidity the calculations are based on\n uint256 amountRemoveMin0; // min amount to be removed from liquidity\n uint256 amountRemoveMin1; // min amount to be removed from liquidity\n uint256 deadline; // for uniswap operations - operator promises fair value\n uint64 rewardX64; // which reward will be used for protocol, can be max configured amount (considering onlyFees)\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "06-lybra", "title": "DavidGiladi G", "severity_raw": "High", "severity": "high", "description": "# Report: Identified 12 Distinct Gas Optimization Opportunities\n\n - [Multiplication and Division by 2 Should use in Bit Shifting](#multiplication-and-division-by-2-should-use-in-bit-shifting) (2 results) (Gas Optimization)\n - [Modulus operations that could be unchecked](#modulus-operations-that-could-be-unchecked) (1 results) (Gas Optimization)\n - [State variables that could be declared constant](#state-variables-that-could-be-declared-constant) (2 results) (Gas Optimization)\n - [Inefficient assignments to state variables](#inefficient-assignments-to-state-variables) (1 results) (Gas Optimization)\n - [Inefficient Parameter Storage](#inefficient-parameter-storage) (4 results) (Gas Optimization)\n - [Using Storage Instead of Memory for structs/arrays Saves Gas](#using-storage-instead-of-memory-for-structsarrays-saves-gas) (1 results) (Gas Optimization)\n - [Internal or Private Function that Called Once Should Be Inlined to Save Gas](#internal-or-private-function-that-called-once-should-be-inlined-to-save-gas) (4 results) (Gas Optimization)\n - [Optimal State Variable Order](#optimal-state-variable-order) (1 results) (Gas Optimization)\n - [Use Small Integer For Efficiency](#use-small-integer-for-efficiency) (2 results) (Gas Optimization)\n - [Avoid Unnecessary Computation Inside Loops](#avoid-unnecessary-computation-inside-loops) (1 results) (Gas Optimization)\n - [Redundant Contract Existence Check in Consecutive External Calls](#redundant-contract-existence-check-in-consecutive-external-calls) (1 results) (Gas Optimization)\n - [Usage of Custom Errors for Gas Efficiency](#usage-of-custom-errors-for-gas-efficiency) (4 results) (Gas Optimization)\n\n# \n## Optimal State Variable Order\n- Severity: Gas Optimization\n- Confidence: High\n\n### Description\nDetect optimal variable order in contract storage layouts to decrease the number of slots used.\n\n
\n\n\nThere are 1 instances of this issue:\n\n\n\n###\n- Optimization opportunity in storage variable layout of cont", "vulnerable_code": "Line: 17 abstract contract LybraEUSDVaultBase ", "fixed_code": "Line: 159 require(assetAmount * 2 <= depositedAsset[onBehalfOf], \"a max of 50% collateral can be liquidated\");\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/DavidGiladi-G.md", "collected_at": "2026-01-02T18:22:16.401600+00:00", "source_hash": "02ef14b7b45ee43de23aa9b2270b2853f3c798647a91c4881b5c0c4580009294", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "Line: 17 abstract contract LybraEUSDVaultBase ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "Line: 159 require(assetAmount * 2 <= depositedAsset[onBehalfOf], \"a max of 50% collateral can be liquidated\");\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "06-lybra", "title": "Chandr Q", "severity_raw": "Low", "severity": "low", "description": "L[1]: The depositEtherToMint function does not follow a standard pattern for total balance calculation\n\ncode: https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/LybraWstETHVault.sol#L29-L46\n\n```\n function depositEtherToMint(uint256 mintAmount) external payable override {\n require(msg.value >= 1 ether, \"DNL\");\n\n uint256 sharesAmount = lido.submit{value: msg.value}(address(configurator));\n require(sharesAmount > 0, \"ZERO_DEPOSIT\");\n\n lido.approve(address(collateralAsset), msg.value);\n\n uint256 wstETHAmount = IWstETH(address(collateralAsset)).wrap(msg.value);\n\n depositedAsset[msg.sender] += wstETHAmount;\n\n if (mintAmount > 0) {\n _mintPeUSD(msg.sender, msg.sender, mintAmount, getAssetPrice());\n }\n\n emit DepositEther(msg.sender, address(collateralAsset), msg.value,wstETHAmount, block.timestamp);\n }\n```\n\nmitigation:\nModify the depositEtherToMint function to calculate the total balance before and after the deposit", "vulnerable_code": " function depositEtherToMint(uint256 mintAmount) external payable override {\n require(msg.value >= 1 ether, \"DNL\");\n\n uint256 sharesAmount = lido.submit{value: msg.value}(address(configurator));\n require(sharesAmount > 0, \"ZERO_DEPOSIT\");\n\n lido.approve(address(collateralAsset), msg.value);\n\n uint256 wstETHAmount = IWstETH(address(collateralAsset)).wrap(msg.value);\n\n depositedAsset[msg.sender] += wstETHAmount;\n\n if (mintAmount > 0) {\n _mintPeUSD(msg.sender, msg.sender, mintAmount, getAssetPrice());\n }\n\n emit DepositEther(msg.sender, address(collateralAsset), msg.value,wstETHAmount, block.timestamp);\n }", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/Chandr-Q.md", "collected_at": "2026-01-02T18:22:13.462518+00:00", "source_hash": "0355aa725ebd413a5c86e3d07d1177a14365bf9cb00b4440b2adc15243918017", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 685, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function depositEtherToMint(uint256 mintAmount) external payable override {\n require(msg.value >= 1 ether, \"DNL\");\n\n uint256 sharesAmount = lido.submit{value: msg.value}(address(configurator));\n require(sharesAmount > 0, \"ZERO_DEPOSIT\");\n\n lido.approve(address(collateralAsset), msg.value);\n\n uint256 wstETHAmount = IWstETH(address(collateralAsset)).wrap(msg.value);\n\n depositedAsset[msg.sender] += wstETHAmount;\n\n if (mintAmount > 0) {\n _mintPeUSD(msg.sender, msg.sender, mintAmount, getAssetPrice());\n }\n\n emit DepositEther(msg.sender, address(collateralAsset), msg.value,wstETHAmount, block.timestamp);\n }", "primary_code_language": "unknown", "primary_code_char_count": 685, "all_code_blocks": "// Code block 1 (unknown):\nfunction depositEtherToMint(uint256 mintAmount) external payable override {\n require(msg.value >= 1 ether, \"DNL\");\n\n uint256 sharesAmount = lido.submit{value: msg.value}(address(configurator));\n require(sharesAmount > 0, \"ZERO_DEPOSIT\");\n\n lido.approve(address(collateralAsset), msg.value);\n\n uint256 wstETHAmount = IWstETH(address(collateralAsset)).wrap(msg.value);\n\n depositedAsset[msg.sender] += wstETHAmount;\n\n if (mintAmount > 0) {\n _mintPeUSD(msg.sender, msg.sender, mintAmount, getAssetPrice());\n }\n\n emit DepositEther(msg.sender, address(collateralAsset), msg.value,wstETHAmount, block.timestamp);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LybraWstETHVault.sol#L29-L46", "github_files_list": "LybraWstETHVault.sol", "github_refs_count": 1, "vulnerable_code_actual": " function depositEtherToMint(uint256 mintAmount) external payable override {\n require(msg.value >= 1 ether, \"DNL\");\n\n uint256 sharesAmount = lido.submit{value: msg.value}(address(configurator));\n require(sharesAmount > 0, \"ZERO_DEPOSIT\");\n\n lido.approve(address(collateralAsset), msg.value);\n\n uint256 wstETHAmount = IWstETH(address(collateralAsset)).wrap(msg.value);\n\n depositedAsset[msg.sender] += wstETHAmount;\n\n if (mintAmount > 0) {\n _mintPeUSD(msg.sender, msg.sender, mintAmount, getAssetPrice());\n }\n\n emit DepositEther(msg.sender, address(collateralAsset), msg.value,wstETHAmount, block.timestamp);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5.05} {"source": "c4", "protocol": "08-dopex", "title": "Strausses Q", "severity_raw": "Medium", "severity": "medium", "description": "L1 - Create an error when the first value is bigger than the second one.\n\nAdd this piece of code.\n```\n_validate(delegate.amount - delegate.activeCollateral, 15);\n```\nOtherwise tx could just revert without any error message\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/core/RdpxV2Core.sol#L983\n\n\nL2 - #Missing check for 0 address - missed spots by Bot race\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/perp-vault/PerpetualAtlanticVaultLP.sol#L120C13-L120C21\nMissing check that ```reciever``` is not 0 address\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/core/RdpxV2Core.sol#L1018\nMissing check that ```to``` is not 0 address\n\n\nL3 - Private func, should be named starting from \"_\" \nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/perp-vault/PerpetualAtlanticVaultLP.sol#L286\n\n\nL4 - Add custom error message when allowance is already 0/no allowance\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/perp-vault/PerpetualAtlanticVaultLP.sol#L156\n\n\nL5 - It would be better to add Sanity Checks\n\nSanity Check is a call to a contract to make sure that this is the expected/correct input\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/amo/UniV2LiquidityAmo.sol#L74-L102\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L305\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/reLP/ReLPContract.sol#L115\n\n", "vulnerable_code": "_validate(delegate.amount - delegate.activeCollateral, 15);", "fixed_code": "", "recommendation": "", "category": "validation", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/Strausses-Q.md", "collected_at": "2026-01-02T18:25:07.210115+00:00", "source_hash": "03c0ab52a3d681ac089f909d6999b79e07cb9e24745252fde2d9d0d996b785ba", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 59, "github_ref_count": 8, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "_validate(delegate.amount - delegate.activeCollateral, 15);", "primary_code_language": "unknown", "primary_code_char_count": 59, "all_code_blocks": "// Code block 1 (unknown):\n_validate(delegate.amount - delegate.activeCollateral, 15);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "RdpxV2Core.sol#L983, PerpetualAtlanticVaultLP.sol#L120-L13, RdpxV2Core.sol#L1018, PerpetualAtlanticVaultLP.sol#L286, PerpetualAtlanticVaultLP.sol#L156, UniV2LiquidityAmo.sol#L74-L102, RdpxV2Core.sol#L305, ReLPContract.sol#L115", "github_files_list": "ReLPContract.sol, RdpxV2Core.sol, UniV2LiquidityAmo.sol, PerpetualAtlanticVaultLP.sol", "github_refs_count": 8, "vulnerable_code_actual": "_validate(delegate.amount - delegate.activeCollateral, 15);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "01-biconomy", "title": "__141345__ G", "severity_raw": "Low", "severity": "low", "description": "#### Update value order can be adjusted to simplify the code and save gas\n\nFor example, to update the `val` variable with `newVal`, the current way is as following:\n\n```solidity\n uint oldVal = val;\n val = newVal;\n emit update(oldVal, newVal);\n```\n\nIf the execution order is adjusted, some operations can be saved (memory space allocation, variable assignment), reducing both the deployment and run time gas cost.\n\n```solidity\n emit update(val, newVal);\n val = newVal;\n```\n\nThe operation saved: 1 sload, 1 memory allocation, 1 mstore.\n\nThe demo of the gas comparison can be seen [here](https://github.com/141345/gas_demo/blob/main/oldnew.sol).\n\n\nThere are multiple places can use this trick for optimization, since the updates of parameters are widely and frequently used, the optimization can be beneficial.\n\nInstances number of this issue: 1\n```solidity \nFile: scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol\n109: function setOwner(address _newOwner) external mixedAuth {\n110: require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n111: address oldOwner = owner;\n112: owner = _newOwner;\n113: emit EOAChanged(address(this), oldOwner, _newOwner);\n114: }\n```\n\nThe above can be changed to:\n```solidity\n function setOwner(address _newOwner) external mixedAuth {\n require(_newOwner != address(0), \"Smart Account:: Signatory address cannot be zero\");\n emit EOAChanged(address(this), owner, _newOwner);\n owner = _newOwner;\n }\n```", "vulnerable_code": " uint oldVal = val;\n val = newVal;\n emit update(oldVal, newVal);", "fixed_code": " emit update(val, newVal);\n val = newVal;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/__141345__-G.md", "collected_at": "2026-01-02T18:13:27.901398+00:00", "source_hash": "03d0c89b090e0b5cfab4c3d8140366fb923e48ca5357fe87a0c957906db3c35e", "code_block_count": 3, "solidity_block_count": 2, "total_code_chars": 140, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "uint oldVal = val;\n val = newVal;\n emit update(oldVal, newVal);", "primary_code_language": "solidity", "primary_code_char_count": 69, "all_code_blocks": "// Code block 1 (solidity):\nuint oldVal = val;\n val = newVal;\n emit update(oldVal, newVal);\n\n// Code block 2 (solidity):\nemit update(val, newVal);\n val = newVal;\n\n// Code block 3 (unknown):\nThe above can be changed to:", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "uint oldVal = val;\n val = newVal;\n emit update(oldVal, newVal);\n\nemit update(val, newVal);\n val = newVal;", "github_refs_formatted": "oldnew.sol", "github_files_list": "oldnew.sol", "github_refs_count": 1, "vulnerable_code_actual": " uint oldVal = val;\n val = newVal;\n emit update(oldVal, newVal);", "has_vulnerable_code_snippet": true, "fixed_code_actual": " emit update(val, newVal);\n val = newVal;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "11-kelp", "title": "bronze_pickaxe Q", "severity_raw": "Low", "severity": "low", "description": "# 1. maxNodeDelegatorCount does not get enforced\n\n### Impact\n\nThere are a few problems with the usage of `maxNodeDelegatorCount` in `LRTDepositPool.sol`.\n\nFirst problem, consider the following:\n- `maxNodeDelegatorCount = 10`\n- 10 `NodeDelegators` have been added using `LRTDepositPool.addNodeDelegatorContractToQueue`\n- `maxNodeDelegatorCount` gets updated to `8`\n- However, `LRTDepositPool.getAssetDistributionData` will still use all 10 `NodeDelegators`, despite the max being set to `8`:\n\n[LRTDepositPool.sol#L81-L86](https://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L81-L86)\n```javascript\n uint256 ndcsCount = nodeDelegatorQueue.length;\n for (uint256 i; i < ndcsCount;) {\n assetLyingInNDCs += IERC20(asset).balanceOf(nodeDelegatorQueue[i]);\n assetStakedInEigenLayer += INodeDelegator(nodeDelegatorQueue[i]).getAssetBalance(asset);\n unchecked {\n ++i;\n```\n\n\nSecond problem, consider the following:\nFirst problem, consider the following:\n- `maxNodeDelegatorCount = 10`\n- 10 `NodeDelegators` have been added using `LRTDepositPool.addNodeDelegatorContractToQueue`\n- `maxNodeDelegatorCount` gets updated to `8`\n- However, it is still possible to send funds from `LRTDepositPool` to any `NodeDelegator` that has ever been added using `LRTDepositPool.transferAssetToNodeDelegator`\n\n[LRTDepositPool.sol#L193-195](https://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L193-195)\n```javascript\naddress nodeDelegator = nodeDelegatorQueue[ndcIndex];\n if (!IERC20(asset).transfer(nodeDelegator, amount)) {\n revert TokenTransferFailed();\n```\n\nThese two scenarios should not be possible.\n\n### Tools used\nManual Review\n\n### Recommended Mitigation Steps\n\nEither remove `NodeDelegators` from the `nodeDelegatorQueue` when setting a `maxNodeDelegatorCount < currentmaxNodeDelegatorCount`, or, remove the functionality of being able to set a `maxNodeDelegatorCount` that is less than the current ", "vulnerable_code": " uint256 ndcsCount = nodeDelegatorQueue.length;\n for (uint256 i; i < ndcsCount;) {\n assetLyingInNDCs += IERC20(asset).balanceOf(nodeDelegatorQueue[i]);\n assetStakedInEigenLayer += INodeDelegator(nodeDelegatorQueue[i]).getAssetBalance(asset);\n unchecked {\n ++i;", "fixed_code": "address nodeDelegator = nodeDelegatorQueue[ndcIndex];\n if (!IERC20(asset).transfer(nodeDelegator, amount)) {\n revert TokenTransferFailed();", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/bronze_pickaxe-Q.md", "collected_at": "2026-01-02T18:27:51.537433+00:00", "source_hash": "04218453c20e98518e966220c7707a07e11c32fb8bde5ad5ee5167ec665d3a3d", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 471, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "uint256 ndcsCount = nodeDelegatorQueue.length;\n for (uint256 i; i < ndcsCount;) {\n assetLyingInNDCs += IERC20(asset).balanceOf(nodeDelegatorQueue[i]);\n assetStakedInEigenLayer += INodeDelegator(nodeDelegatorQueue[i]).getAssetBalance(asset);\n unchecked {\n ++i;", "primary_code_language": "javascript", "primary_code_char_count": 314, "all_code_blocks": "// Code block 1 (javascript):\nuint256 ndcsCount = nodeDelegatorQueue.length;\n for (uint256 i; i < ndcsCount;) {\n assetLyingInNDCs += IERC20(asset).balanceOf(nodeDelegatorQueue[i]);\n assetStakedInEigenLayer += INodeDelegator(nodeDelegatorQueue[i]).getAssetBalance(asset);\n unchecked {\n ++i;\n\n// Code block 2 (javascript):\naddress nodeDelegator = nodeDelegatorQueue[ndcIndex];\n if (!IERC20(asset).transfer(nodeDelegator, amount)) {\n revert TokenTransferFailed();", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LRTDepositPool.sol#L81-L86, LRTDepositPool.sol#L193-L195", "github_files_list": "LRTDepositPool.sol", "github_refs_count": 2, "vulnerable_code_actual": " uint256 ndcsCount = nodeDelegatorQueue.length;\n for (uint256 i; i < ndcsCount;) {\n assetLyingInNDCs += IERC20(asset).balanceOf(nodeDelegatorQueue[i]);\n assetStakedInEigenLayer += INodeDelegator(nodeDelegatorQueue[i]).getAssetBalance(asset);\n unchecked {\n ++i;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "address nodeDelegator = nodeDelegatorQueue[ndcIndex];\n if (!IERC20(asset).transfer(nodeDelegator, amount)) {\n revert TokenTransferFailed();", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "11-kelp", "title": "0xAnah G", "severity_raw": "High", "severity": "high", "description": "# KELP PROTOCOL GAS OPTIMISATIONS\n\n\n\n## INTRODUCTION\nSome of optimizations underwent benchmarking using the protocol's tests, specifically employing the following configuration: `solc version 0.8.21`, `optimizer enabled,` and `10_000` runs. For optimizations that were not subjected to benchmarking, their rationale is elucidated through EVM gas expenses and opcodes.\n\nHighlighted below are optimizations exclusively targeting state-mutating functions and view/pure functions invoked by state-mutating functions. In the discussion that follows, only runtime gas is emphasized, given its inevitable dominance over deployment gas costs throughout the protocol's lifetime. \n\nPlease be aware that some code snippets may be shortened to conserve space, and certain code snippets may include @audit tags in comments to facilitate some issue explanations.\"\n\n\n\n\n\n## [G-01] Multiple mappings can be replaced with a single struct mapping\n\n### 1 Instance\n1. #### The mappings `mapping(address token => bool isSupported) public isSupportedAsset`, `mapping(address token => uint256 amount) public depositLimitByAsset` and `mapping(address token => address strategy) public override assetStrategy` should be converted to a single address to struct mapping\n- https://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTConfig.sol#L15-#L17\n\n\nThe mappings `mapping(address token => bool isSupported) public isSupportedAsset`, `mapping(address token => uint256 amount) public depositLimitByAsset` and `mapping(address token => address strategy) public override assetStrategy` should be converted to a single address to struct mapping. Implementing this would reduce the number of storage slots for these mappings (i.e the storage slots used in the keccak to determine the location of the mapping value) from 3 to 1 and the slots required for the values from 3 to 2 (if the newly defined struct is packed) therefore we would save 20k gas in avoiding `SSTORE` in setting each of these storage slots. In functions such as", "vulnerable_code": "file: src/LRTConfig.sol\n\n15: mapping(address token => bool isSupported) public isSupportedAsset;\n16: mapping(address token => uint256 amount) public depositLimitByAsset;\n17: mapping(address token => address strategy) public override assetStrategy;", "fixed_code": "```\nEstimated gas saved: 60k gas units", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/0xAnah-G.md", "collected_at": "2026-01-02T18:27:09.596200+00:00", "source_hash": "04b1ed0bfae3c1e7aa408e28fce8fda7d5ef82c70111f199da3723a1137375fb", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LRTConfig.sol#L15", "github_files_list": "LRTConfig.sol", "github_refs_count": 1, "vulnerable_code_actual": "file: src/LRTConfig.sol\n\n15: mapping(address token => bool isSupported) public isSupportedAsset;\n16: mapping(address token => uint256 amount) public depositLimitByAsset;\n17: mapping(address token => address strategy) public override assetStrategy;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "```\nEstimated gas saved: 60k gas units", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "02-ai-arena", "title": "Timenov G", "severity_raw": "Medium", "severity": "medium", "description": "# AI Arena Gas report by Timenov\n\n## Summary\n\n| |Issue|Instances|\n |-|:-|:-:|\n| G-01 | Array's cached length not used optimally. | 8 |\n| G-02 | Smaller uint can be used. | 1 |\n| G-03 | State variable can be removed. | 1 |\n| G-04 | State variable can be updated after loop. | 2 |\n| G-05 | Unnecessary validation. | 1 |\n| G-06 | Operation can be skipped. | 1 |\n\n### [G-01] Array's cached length not used optimally.\nThe protocol has done a good job on caching the length of an array before a loop. However there are places that this can be even more gas efficient.\n\n```diff\n function addAttributeDivisor(uint8[] memory attributeDivisors) external {\n require(msg.sender == _ownerAddress);\n+ uint256 attributesLength = attributes.length;\n- require(attributeDivisors.length == attributes.length);\n+ require(attributeDivisors.length == attributesLength);\n\n- uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n attributeToDnaDivisor[attributes[i]] = attributeDivisors[i];\n }\n }\n```\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/AiArenaHelper.sol#L70-L72\n\n```diff\n+ uint256 attributesLength = attributes.length;\n+ uint256[] memory finalAttributeProbabilityIndexes = new uint[](attributesLength);\n- uint256[] memory finalAttributeProbabilityIndexes = new uint[](attributes.length);\n\n- uint256 attributesLength = attributes.length;\n```\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/AiArenaHelper.sol#L96-L98\n\n```diff\n+ uint256 mintPassIdsToBurnLength = mintpassIdsToBurn.length;\n+ require(\n+ mintPassIdsToBurnLength == mintPassDnas.length && \n+ mintPassIdsToBurnLength == fighterTypes.length && \n+ mintPassIdsToBurnLength == modelHashes.length &&\n+ mintPassIdsToBurnLength == modelTypes.length\n+ );\n+ for (uint16 i = 0; i < mintPassIdsToBurnLength; i++) {\n \n- require(\n- ", "vulnerable_code": "https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/AiArenaHelper.sol#L70-L72\n", "fixed_code": "https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/AiArenaHelper.sol#L96-L98\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/Timenov-G.md", "collected_at": "2026-01-02T19:02:47.423442+00:00", "source_hash": "04f1027f67bac208e2ecce3eb1245ec5cbcc84723dfaf63987dc382c648a3858", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 788, "github_ref_count": 2, "vulnerable_code_is_url": true, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function addAttributeDivisor(uint8[] memory attributeDivisors) external {\n require(msg.sender == _ownerAddress);\n+ uint256 attributesLength = attributes.length;\n- require(attributeDivisors.length == attributes.length);\n+ require(attributeDivisors.length == attributesLength);\n\n- uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n attributeToDnaDivisor[attributes[i]] = attributeDivisors[i];\n }\n }", "primary_code_language": "diff", "primary_code_char_count": 499, "all_code_blocks": "// Code block 1 (diff):\nfunction addAttributeDivisor(uint8[] memory attributeDivisors) external {\n require(msg.sender == _ownerAddress);\n+ uint256 attributesLength = attributes.length;\n- require(attributeDivisors.length == attributes.length);\n+ require(attributeDivisors.length == attributesLength);\n\n- uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n attributeToDnaDivisor[attributes[i]] = attributeDivisors[i];\n }\n }\n\n// Code block 2 (diff):\n+ uint256 attributesLength = attributes.length;\n+ uint256[] memory finalAttributeProbabilityIndexes = new uint[](attributesLength);\n- uint256[] memory finalAttributeProbabilityIndexes = new uint[](attributes.length);\n\n- uint256 attributesLength = attributes.length;", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "function addAttributeDivisor(uint8[] memory attributeDivisors) external {\n require(msg.sender == _ownerAddress);\n+ uint256 attributesLength = attributes.length;\n- require(attributeDivisors.length == attributes.length);\n+ require(attributeDivisors.length == attributesLength);\n\n- uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n attributeToDnaDivisor[attributes[i]] = attributeDivisors[i];\n }\n }\n\n+ uint256 attributesLength = attributes.length;\n+ uint256[] memory finalAttributeProbabilityIndexes = new uint[](attributesLength);\n- uint256[] memory finalAttributeProbabilityIndexes = new uint[](attributes.length);\n\n- uint256 attributesLength = attributes.length;", "solidity_code": "", "github_refs_formatted": "AiArenaHelper.sol#L70-L72, AiArenaHelper.sol#L96-L98", "github_files_list": "AiArenaHelper.sol", "github_refs_count": 2, "vulnerable_code_actual": "", "has_vulnerable_code_snippet": false, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 8} {"source": "c4", "protocol": "03-asymmetry", "title": "PNS Q", "severity_raw": "Critical", "severity": "critical", "description": "[L-1] Missing event for critical parameter change\n===\n```solidity\nFile: contracts/SafEth/derivatives/Reth.sol\n58: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n59: maxSlippage = _slippage;\n60: }\n```\nSimilarly in `SfrxEth.sol` and `WstEth.sol`\nThis method can be called directly on a derivative contract or via a `SafETH.setMaxSlippage(uint, uint)` contract (where the event is emitted). \nIf called directly, there will be no event. \nIt's better to move the event to the derivative implementation, where we also have access to the changed value. \nThe event could look like this:\n```solidity\nemit SetMaxSlippage(oldMaxSlippage, newMaxSlippage);\n```\n[L-2] Add a timelock to critical functions\n===\nIt is a good practice to give time for users to react and adjust to critical changes. A timelock provides more guarantees and reduces the level of trust required, thus decreasing risk for users.\n\nConsider adding a timelock to:\n```solidity\nFile: contracts/SafEth/SafEth.sol\n165: function adjustWeight(\n166: uint256 _derivativeIndex,\n167: uint256 _weight\n168: ) external onlyOwner {\n```\n```solidity\nFile: contracts/SafEth/SafEth.sol\n182: function addDerivative(\n183: address _contractAddress,\n184: uint256 _weight\n185: ) external onlyOwner {\n```\n```solidity\nFile: contracts/SafEth/SafEth.sol\n202: function setMaxSlippage(\n203: uint _derivativeIndex,\n204: uint _slippage\n205: ) external onlyOwner {\n```\n\n[N-1] Constants in comparisons should appear on the left side\n===\n\n[It's a mechanism to avoid mistakes like this](https://stackoverflow.com/a/370373)\n\n```solidity\nFile: contracts/SafEth/SafEth.sol\n79: if (totalSupply == 0)\n```\n```solidity\nFile: contracts/SafEth/SafEth.sol\n87: if (weight == 0) continue;\n```\n```solidity\nFile: contracts/SafEth/SafEth.sol\n117: if (derivativeAmount == 0) continue; // if derivative empty ignore\n```\n```solidity\nFile: contracts/SafEth/Sa", "vulnerable_code": "File: contracts/SafEth/derivatives/Reth.sol\n58: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n59: maxSlippage = _slippage;\n60: }", "fixed_code": "emit SetMaxSlippage(oldMaxSlippage, newMaxSlippage);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/PNS-Q.md", "collected_at": "2026-01-02T18:18:24.291683+00:00", "source_hash": "05208d00e93b305b181822698aa3511647ff00485a4ee4dff3a7aa62c08f7ee7", "code_block_count": 8, "solidity_block_count": 8, "total_code_chars": 968, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/SafEth/derivatives/Reth.sol\n58: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n59: maxSlippage = _slippage;\n60: }", "primary_code_language": "solidity", "primary_code_char_count": 162, "all_code_blocks": "// Code block 1 (solidity):\nFile: contracts/SafEth/derivatives/Reth.sol\n58: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n59: maxSlippage = _slippage;\n60: }\n\n// Code block 2 (solidity):\nemit SetMaxSlippage(oldMaxSlippage, newMaxSlippage);\n\n// Code block 3 (solidity):\nFile: contracts/SafEth/SafEth.sol\n165: function adjustWeight(\n166: uint256 _derivativeIndex,\n167: uint256 _weight\n168: ) external onlyOwner {\n\n// Code block 4 (solidity):\nFile: contracts/SafEth/SafEth.sol\n182: function addDerivative(\n183: address _contractAddress,\n184: uint256 _weight\n185: ) external onlyOwner {\n\n// Code block 5 (solidity):\nFile: contracts/SafEth/SafEth.sol\n202: function setMaxSlippage(\n203: uint _derivativeIndex,\n204: uint _slippage\n205: ) external onlyOwner {\n\n// Code block 6 (solidity):\nFile: contracts/SafEth/SafEth.sol\n79: if (totalSupply == 0)\n\n// Code block 7 (solidity):\nFile: contracts/SafEth/SafEth.sol\n87: if (weight == 0) continue;\n\n// Code block 8 (solidity):\nFile: contracts/SafEth/SafEth.sol\n117: if (derivativeAmount == 0) continue; // if derivative empty ignore", "all_code_blocks_count": 8, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: contracts/SafEth/derivatives/Reth.sol\n58: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n59: maxSlippage = _slippage;\n60: }\n\nemit SetMaxSlippage(oldMaxSlippage, newMaxSlippage);\n\nFile: contracts/SafEth/SafEth.sol\n165: function adjustWeight(\n166: uint256 _derivativeIndex,\n167: uint256 _weight\n168: ) external onlyOwner {\n\nFile: contracts/SafEth/SafEth.sol\n182: function addDerivative(\n183: address _contractAddress,\n184: uint256 _weight\n185: ) external onlyOwner {\n\nFile: contracts/SafEth/SafEth.sol\n202: function setMaxSlippage(\n203: uint _derivativeIndex,\n204: uint _slippage\n205: ) external onlyOwner {\n\nFile: contracts/SafEth/SafEth.sol\n79: if (totalSupply == 0)\n\nFile: contracts/SafEth/SafEth.sol\n87: if (weight == 0) continue;\n\nFile: contracts/SafEth/SafEth.sol\n117: if (derivativeAmount == 0) continue; // if derivative empty ignore", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: contracts/SafEth/derivatives/Reth.sol\n58: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n59: maxSlippage = _slippage;\n60: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "emit SetMaxSlippage(oldMaxSlippage, newMaxSlippage);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 13} {"source": "c4", "protocol": "08-dopex", "title": "QiuhaoLi G", "severity_raw": "Gas", "severity": "gas", "description": "## We can use a put option for all delegate bonds instead of one for every option\n\nIn `bondWithDelegate` we can delecate more than once, and for every delegate we buy the option for the bond. Since all the bonds are in the same transaction, the strike price will be the same. To save gas, we can buy a single option outside the for loop in `bondWithDelegate`. This can save gas in two ways:\n\n1. When bonding with a delegate, we can save gas by only calling _purchaseOptions once.\n2. When we settle, instead of calling multiple times on different options, we can do that in one call.\n\nThis can save considerable gas if there are many delegates when calling `bondWithDelegate`.\n\n\n## When delegate.amount = 0, we can delete the slot or reuse it\n\nCurrently, we don't reuse the delegate ID (mapping) if a delegate is fully withdrawn by the owner, which brings a linear increase in storage used. This can be optimized to reuse slots or delete the mapping index for gas refund.\n\n## When a bond is withdrawn from RdpxV2Core, we can delete bonds[id] for gas refund\n\nCurrently, we don't reuse the bonds[id] or delete them if a user redeem the bond, which brings a linear increase in storage used. This can be optimized to resue the slot or delete the slot for gas refund in redeem().\n\n## Only calculate strike and timeToExpiry if putOptionsRequired\n\nCurrently, in calculateBondCost(), we always calculate the strike and timeToExpiry even put options is not required. This can be optimized to only calculated them if putOptionsRequired is set.\n\n## owner field of struct Bond in RdpxDecayingBonds is not used\n\nIn contracts/decaying-bonds/RdpxDecayingBonds.sol, the struct Bond has an owner field, but this field is never used. For example, in RdpxV2Core.sol:_transfer, we only use the expiry and amount fields. Deleting this field can reduce storage/gas used.\n\n## RdpxDecayingBonds:mint() has redundant hasRole check\n\nIn mint(), we have a onlyRole(MINTER_ROLE) modifier, but then we have a `require(hasRole(MINTE", "vulnerable_code": " collateralToken.safeTransfer(\n addresses.perpetualAtlanticVaultLP,\n (currentFundingRate * (nextFundingPaymentTimestamp() - startTime)) / // @audit-issue GAS this can be calculated only once\n 1e18\n );\n\n IPerpetualAtlanticVaultLP(addresses.perpetualAtlanticVaultLP)\n .addProceeds(\n (currentFundingRate * (nextFundingPaymentTimestamp() - startTime)) /\n 1e18\n );\n\n emit FundingPaid(\n msg.sender,\n ((currentFundingRate * (nextFundingPaymentTimestamp() - startTime)) /\n 1e18),\n latestFundingPaymentPointer\n );", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/QiuhaoLi-G.md", "collected_at": "2026-01-02T18:24:56.450269+00:00", "source_hash": "05796cce808c7135ccbb4d85d05792d96e65bf60b9cd801ff52ea9b5392861bc", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " collateralToken.safeTransfer(\n addresses.perpetualAtlanticVaultLP,\n (currentFundingRate * (nextFundingPaymentTimestamp() - startTime)) / // @audit-issue GAS this can be calculated only once\n 1e18\n );\n\n IPerpetualAtlanticVaultLP(addresses.perpetualAtlanticVaultLP)\n .addProceeds(\n (currentFundingRate * (nextFundingPaymentTimestamp() - startTime)) /\n 1e18\n );\n\n emit FundingPaid(\n msg.sender,\n ((currentFundingRate * (nextFundingPaymentTimestamp() - startTime)) /\n 1e18),\n latestFundingPaymentPointer\n );", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4} {"source": "c4", "protocol": "03-asymmetry", "title": "a3yip6 Q", "severity_raw": "Low", "severity": "low", "description": "## [L-01] Revert may happen if owner invoke `rebalanceToWeights` with too many tokens in derivatives\nThe function `rebalanceToWeights` is used by the owner to rebalence the weights of derivatives. The function would withdraw and deposit to each derivatives, which will exchange tokens with `maxSlippage`. Thus, the huge amounts of tokens in derivatives would make exchange fail because of exceeding `maxSlippage`, and the owner would fail to reblance the weights.\n\n```\nFile: /contracts/SafEth.sol\n\nfunction rebalanceToWeights() external onlyOwner {\n uint256 ethAmountBefore = address(this).balance;\n for (uint i = 0; i < derivativeCount; i++) {\n if (derivatives[i].balance() > 0)\n derivatives[i].withdraw(derivatives[i].balance());\n }\n uint256 ethAmountAfter = address(this).balance;\n uint256 ethAmountToRebalance = ethAmountAfter - ethAmountBefore;\n\n for (uint i = 0; i < derivativeCount; i++) {\n if (weights[i] == 0 || ethAmountToRebalance == 0) continue;\n uint256 ethAmount = (ethAmountToRebalance * weights[i]) /\n totalWeight;\n // Price will change due to slippage\n derivatives[i].deposit{value: ethAmount}();\n }\n emit Rebalanced();\n}\n```\n\n```\nFile: /contracts/WstEth.sol\n\nfunction withdraw(uint256 _amount) external onlyOwner {\n // burn WStETH and withdraw stETH\n IWStETH(WST_ETH).unwrap(_amount);\n uint256 stEthBal = IERC20(STETH_TOKEN).balanceOf(address(this));\n IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);\n uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n // exchange stETH to ETH\n IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n}\n\n```", "vulnerable_code": "File: /contracts/SafEth.sol\n\nfunction rebalanceToWeights() external onlyOwner {\n uint256 ethAmountBefore = address(this).balance;\n for (uint i = 0; i < derivativeCount; i++) {\n if (derivatives[i].balance() > 0)\n derivatives[i].withdraw(derivatives[i].balance());\n }\n uint256 ethAmountAfter = address(this).balance;\n uint256 ethAmountToRebalance = ethAmountAfter - ethAmountBefore;\n\n for (uint i = 0; i < derivativeCount; i++) {\n if (weights[i] == 0 || ethAmountToRebalance == 0) continue;\n uint256 ethAmount = (ethAmountToRebalance * weights[i]) /\n totalWeight;\n // Price will change due to slippage\n derivatives[i].deposit{value: ethAmount}();\n }\n emit Rebalanced();\n}", "fixed_code": "File: /contracts/WstEth.sol\n\nfunction withdraw(uint256 _amount) external onlyOwner {\n // burn WStETH and withdraw stETH\n IWStETH(WST_ETH).unwrap(_amount);\n uint256 stEthBal = IERC20(STETH_TOKEN).balanceOf(address(this));\n IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);\n uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n // exchange stETH to ETH\n IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n}\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/a3yip6-Q.md", "collected_at": "2026-01-02T18:18:42.301344+00:00", "source_hash": "0586eb934222f280e09747dc3235562f5febbb6bc3a469e1135d7ea3fc36f3ad", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 1376, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: /contracts/SafEth.sol\n\nfunction rebalanceToWeights() external onlyOwner {\n uint256 ethAmountBefore = address(this).balance;\n for (uint i = 0; i < derivativeCount; i++) {\n if (derivatives[i].balance() > 0)\n derivatives[i].withdraw(derivatives[i].balance());\n }\n uint256 ethAmountAfter = address(this).balance;\n uint256 ethAmountToRebalance = ethAmountAfter - ethAmountBefore;\n\n for (uint i = 0; i < derivativeCount; i++) {\n if (weights[i] == 0 || ethAmountToRebalance == 0) continue;\n uint256 ethAmount = (ethAmountToRebalance * weights[i]) /\n totalWeight;\n // Price will change due to slippage\n derivatives[i].deposit{value: ethAmount}();\n }\n emit Rebalanced();\n}", "primary_code_language": "unknown", "primary_code_char_count": 750, "all_code_blocks": "// Code block 1 (unknown):\nFile: /contracts/SafEth.sol\n\nfunction rebalanceToWeights() external onlyOwner {\n uint256 ethAmountBefore = address(this).balance;\n for (uint i = 0; i < derivativeCount; i++) {\n if (derivatives[i].balance() > 0)\n derivatives[i].withdraw(derivatives[i].balance());\n }\n uint256 ethAmountAfter = address(this).balance;\n uint256 ethAmountToRebalance = ethAmountAfter - ethAmountBefore;\n\n for (uint i = 0; i < derivativeCount; i++) {\n if (weights[i] == 0 || ethAmountToRebalance == 0) continue;\n uint256 ethAmount = (ethAmountToRebalance * weights[i]) /\n totalWeight;\n // Price will change due to slippage\n derivatives[i].deposit{value: ethAmount}();\n }\n emit Rebalanced();\n}\n\n// Code block 2 (unknown):\nFile: /contracts/WstEth.sol\n\nfunction withdraw(uint256 _amount) external onlyOwner {\n // burn WStETH and withdraw stETH\n IWStETH(WST_ETH).unwrap(_amount);\n uint256 stEthBal = IERC20(STETH_TOKEN).balanceOf(address(this));\n IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);\n uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n // exchange stETH to ETH\n IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: /contracts/SafEth.sol\n\nfunction rebalanceToWeights() external onlyOwner {\n uint256 ethAmountBefore = address(this).balance;\n for (uint i = 0; i < derivativeCount; i++) {\n if (derivatives[i].balance() > 0)\n derivatives[i].withdraw(derivatives[i].balance());\n }\n uint256 ethAmountAfter = address(this).balance;\n uint256 ethAmountToRebalance = ethAmountAfter - ethAmountBefore;\n\n for (uint i = 0; i < derivativeCount; i++) {\n if (weights[i] == 0 || ethAmountToRebalance == 0) continue;\n uint256 ethAmount = (ethAmountToRebalance * weights[i]) /\n totalWeight;\n // Price will change due to slippage\n derivatives[i].deposit{value: ethAmount}();\n }\n emit Rebalanced();\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: /contracts/WstEth.sol\n\nfunction withdraw(uint256 _amount) external onlyOwner {\n // burn WStETH and withdraw stETH\n IWStETH(WST_ETH).unwrap(_amount);\n uint256 stEthBal = IERC20(STETH_TOKEN).balanceOf(address(this));\n IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);\n uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n // exchange stETH to ETH\n IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n}\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-asymmetry", "title": "favelanky Q", "severity_raw": "Low", "severity": "low", "description": "## [L-1] Floating pragma\n\nThere are 5 instance of this issue:\n\n```solidity\npragma solidity ^0.8.13;\n```\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEthStorage.sol#L2\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L2\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L2\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol#L2\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol#L2\n\nhttps://swcregistry.io/docs/SWC-103\n\nRecommendation: using fixed solidity version.\n\n## [L-2] Division before multiplication\n\nThe final result may be truncated due to division before multiplication.\n\nThere are 1 instance of this issue:\n\n```\nuint256 minOut = (((ethPerDerivative(_amount) * _amount) / 10 ** 18) * (10 ** 18 - maxSlippage)) / 10 ** 18;\n```\n\nhttps://github.com/code-423n4/2023-03-neotokyo/blob/main/contracts/staking/NeoTokyoStaker.sol#L1155\nhttps://github.com/code-423n4/2023-03-neotokyo/blob/main/contracts/staking/NeoTokyoStaker.sol#L1388\n\n## [L-3] Unexploitable Re-Entrancy\n\n`SafEth.sol` contract has no Re-Entrancy protection in\u00a0`unstake`\u00a0and `stake` functions.\n\nThere is 2 instance of this issue:\n\n```solidity\nFile: SafEth.sol\n\nfunction stake() external payable {\n\nfunction unstake(uint256 _safEthAmount) external {\n```\n\nhttps://github.com/code-423n4/2023-03-neotokyo/blob/main/contracts/staking/NeoTokyoStaker.sol#L1737\n\nRecommendation: Use Openzeppelin's or Solmate's Re-Entrancy guard.\n\n## [L-4] Usage of `approve`\n\nThere a lot of problems with `approve` function. Best pracite is to use Openzepplin's SafeERC20 library when implement any actions with ERC20.\n\nThere are 2 instance of this issue:\n\n```solidity\nFile: Reth.sol\n\nIERC20(_tokenIn).approve(UNISWAP_ROUTER, _amountIn);\n\nFile: SfrxEth.sol\n\nIsFrxEth(FRX_ETH_ADDRESS).approve(\n\tFRX_ETH_CRV_POOL_ADDRESS,\n\tfrxEthBalance\n\t);\n\n```\n\nhttps://git", "vulnerable_code": "pragma solidity ^0.8.13;", "fixed_code": "uint256 minOut = (((ethPerDerivative(_amount) * _amount) / 10 ** 18) * (10 ** 18 - maxSlippage)) / 10 ** 18;", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/favelanky-Q.md", "collected_at": "2026-01-02T18:19:07.953350+00:00", "source_hash": "05a3f5641d8662a84eece4af99d4aaadc604ace8a2c93c4d4e74ded54cc4eb2f", "code_block_count": 4, "solidity_block_count": 3, "total_code_chars": 406, "github_ref_count": 7, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "pragma solidity ^0.8.13;", "primary_code_language": "solidity", "primary_code_char_count": 24, "all_code_blocks": "// Code block 1 (solidity):\npragma solidity ^0.8.13;\n\n// Code block 2 (unknown):\nuint256 minOut = (((ethPerDerivative(_amount) * _amount) / 10 ** 18) * (10 ** 18 - maxSlippage)) / 10 ** 18;\n\n// Code block 3 (solidity):\nFile: SafEth.sol\n\nfunction stake() external payable {\n\nfunction unstake(uint256 _safEthAmount) external {\n\n// Code block 4 (solidity):\nFile: Reth.sol\n\nIERC20(_tokenIn).approve(UNISWAP_ROUTER, _amountIn);\n\nFile: SfrxEth.sol\n\nIsFrxEth(FRX_ETH_ADDRESS).approve(\n\tFRX_ETH_CRV_POOL_ADDRESS,\n\tfrxEthBalance\n\t);", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "pragma solidity ^0.8.13;\n\nFile: SafEth.sol\n\nfunction stake() external payable {\n\nfunction unstake(uint256 _safEthAmount) external {\n\nFile: Reth.sol\n\nIERC20(_tokenIn).approve(UNISWAP_ROUTER, _amountIn);\n\nFile: SfrxEth.sol\n\nIsFrxEth(FRX_ETH_ADDRESS).approve(\n\tFRX_ETH_CRV_POOL_ADDRESS,\n\tfrxEthBalance\n\t);", "github_refs_formatted": "SafEthStorage.sol#L2, SafEth.sol#L2, SfrxEth.sol#L2, WstEth.sol#L2, NeoTokyoStaker.sol#L1155, NeoTokyoStaker.sol#L1388, NeoTokyoStaker.sol#L1737", "github_files_list": "SfrxEth.sol, SafEthStorage.sol, NeoTokyoStaker.sol, WstEth.sol, SafEth.sol", "github_refs_count": 7, "vulnerable_code_actual": "pragma solidity ^0.8.13;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "uint256 minOut = (((ethPerDerivative(_amount) * _amount) / 10 ** 18) * (10 ** 18 - maxSlippage)) / 10 ** 18;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "08-dopex", "title": "JCK G", "severity_raw": "High", "severity": "high", "description": "# Gas Optimizations\n\n| Number | Issue | Instances | Total Gas Saved |\n|--------|-------|-----------|-----------------|\n|[G-01]| State variables which are not modified within functions should be set as constant or immutable for values set at deployment | 7 | 70000 |\n|[G-02]| create variable immutable and avoid external call to save gas | 8 | |\n|[G-03]| Avoid emitting storage values | 4 | |\n|[G-04]| bytes constants are more eficient than string constans | 13 | |\n|[G-05]| Use assembly to hash values more efficiently | 9 | |\n|[G-06]| Use assembly to make more efficient back-to-back calls | 14 | |\n|[G-07]| Use assembly for loops | 9 | |\n|[G-08]| Use assembly to grab and cast value in byte array | 1 | |\n|[G-09]| Don\u2019t cache value if it is only used once | 2 | |\n|[G-10]| Use calldata instead of memory for immutable arguments | 5 | 1500 |\n|[G-11]| Use != 0 instead of > 0 for unsigned integer comparison | 19 | 57 |\n|[G-12]| Don\u2019t initialize variables with default value | 16 | 96 |\n|[G-13]| Use assembly to check for address(0) | 44 | 264 |\n|[G-14]| Usage of uints/ints smaller than 32 bytes (256 bits) incurs overhead | 4 | 40 |\n|[G-15]| Use hardcode address instead address(this) | 40 | |\n|[G-16]| require() or revert() statements that check input arguments should be at the top of the function (Also restructured some \u201cif\u2019s\u201d) | 4 | |\n|[G-17]| Use assembly to validate msg.sender | 2 | |\n|[G-18]| Cache external calls outside of loop to avoid re-calling function on each iteration | 3 | |\n|[G-19]| Return values from external calls can be cached to avoid unnecessary call | 11 | 39281 |\n|[G-20]| Move storage pointer to top of function to avoid offset calculation | 2 | 180 |\n|[G-21]| Cache storage values in memory to minimize SLOADs | 1 | 110 |\n|[G-22]| Public Functions not called by they contract should be declear External | 29 | |\n|[G-23]| Using storage instead of memory for structs/arrays saves gas | 3 | 12600 |\n|[G-24]| Mult", "vulnerable_code": "file: contracts/perp-vault/PerpetualAtlanticVault.sol\n\n51 string public underlyingSymbol;\n\n60 uint256 public collateralPrecision;\n", "fixed_code": "file: contracts/perp-vault/PerpetualAtlanticVaultLP.sol\n\n49 ERC20 public collateral;\n\n52 string public underlyingSymbol;\n\n55 string public collateralSymbol;\n\n67 address public rdpx;\n\n70 address public rdpxRdpxV2Core;\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/JCK-G.md", "collected_at": "2026-01-02T18:24:41.591957+00:00", "source_hash": "05f6783602df1d888c14bb97765b3c2c59f960c0682c7d177718e522c82fe698", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "file: contracts/perp-vault/PerpetualAtlanticVault.sol\n\n51 string public underlyingSymbol;\n\n60 uint256 public collateralPrecision;\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "file: contracts/perp-vault/PerpetualAtlanticVaultLP.sol\n\n49 ERC20 public collateral;\n\n52 string public underlyingSymbol;\n\n55 string public collateralSymbol;\n\n67 address public rdpx;\n\n70 address public rdpxRdpxV2Core;\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "08-dopex", "title": "Giorgio Q", "severity_raw": "Gas", "severity": "gas", "description": "## Title\nConsider changing variable to Constant\n\n### Details\n\nIn the `./PerpetualAtlanticVault.sol` the `roundingPrecision` variable is initialized to 1e6, however this variable could benefit from being set to Constant for clarity since it is never changed. \n\n#### Affected code\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/perp-vault/PerpetualAtlanticVault.sol#L103-L104\n\n## Title\nUseless Manager Role\n\n### Details\n\n`./PerpetualAtlanticVault.sol` the MANAGER_ROLE is set to msg.sender but never used for throughout the contract, for clarity I would suggest to remove it.\n\n#### Affected code\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/perp-vault/PerpetualAtlanticVault.sol#L44-L45\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/perp-vault/PerpetualAtlanticVault.sol#L127-L128\n\n## Title\n\nRedundant Authorization Check in settle and payFunding Functions\n\n### Details\n\nThe settle and payFunding functions have a redundant check using _isEligibleSender(), which serves no purpose as the function is already restricted to RDPXV2CORE_ROLE. This could potentially introduce confusion and make the code less maintainable.\n\n#### Affected code\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/perp-vault/PerpetualAtlanticVault.sol#L315-L324\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/perp-vault/PerpetualAtlanticVault.sol#L372-L380\n\n## Title\n\nOvercomplicated Calculation for timeToExpiry in Funding Logic\n\n### Details\n\nThe calculation for timeToExpiry involves redundant and unnecessarily complicated steps. \n\ntimeToExpiry=nextFundingPaymentTimestamp()\u2212(genesis+((latestFundingPaymentPointer\u22121)\u00d7fundingDuration))\n\nThe function nextFundingPaymentTimestamp returns:\n\n\n`nextFundingPaymentTimestamp()=genesis+(latestFundingPaymentPointe", "vulnerable_code": "timeToExpiry=(genesis+(latestFundingPaymentPointer\u00d7fundingDuration))\u2212(genesis+((latestFundingPaymentPointer\u22121)\u00d7fundingDuration))", "fixed_code": "timeToExpiry =\ngenesis + latestFundingPaymentPointer \u00d7 fundingDuration \u2212 genesis \u2212 latestFundingPaymentPointer\n\u00d7 fundingDuration + fundingDuration\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/Giorgio-Q.md", "collected_at": "2026-01-02T18:24:38.410538+00:00", "source_hash": "06b8650bd691fbde0055e81d27315dbec833ed8fe6618a9777867d71c461b9f9", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "PerpetualAtlanticVault.sol#L103-L104, PerpetualAtlanticVault.sol#L44-L45, PerpetualAtlanticVault.sol#L127-L128, PerpetualAtlanticVault.sol#L315-L324, PerpetualAtlanticVault.sol#L372-L380", "github_files_list": "PerpetualAtlanticVault.sol", "github_refs_count": 5, "vulnerable_code_actual": "timeToExpiry=(genesis+(latestFundingPaymentPointer\u00d7fundingDuration))\u2212(genesis+((latestFundingPaymentPointer\u22121)\u00d7fundingDuration))", "has_vulnerable_code_snippet": true, "fixed_code_actual": "timeToExpiry =\ngenesis + latestFundingPaymentPointer \u00d7 fundingDuration \u2212 genesis \u2212 latestFundingPaymentPointer\n\u00d7 fundingDuration + fundingDuration\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "10-badger", "title": "zabihullahazadzoi Q", "severity_raw": "Critical", "severity": "critical", "description": "## Low Issues\n\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [L-1](#L-1) | Code does not follow the best practice of check-effects-interaction | 1 |\n| [L-2](#L-2) | Consider implementing two-step procedure for updating protocol addresses | 13 |\n| [L-3](#L-3) | Division by zero not prevented | 19 |\n| [L-4](#L-4) | Empty `receive()`/`fallback()` function | 1 |\n| [L-5](#L-5) | Loss of precision | 33 |\n| [L-6](#L-6) | Missing checks for `address(0x0)` in the constructor | 19 |\n| [L-7](#L-7) | Missing checks for address(0x0) when updating address state variables | 51 |\n| [L-8](#L-8) | Missing contract-existence checks before yul `call()` | 2 |\n| [L-9](#L-9) | Numbers downcast to `address`es may result in collisions | 1 |\n| [L-10](#L-10) | `receive()`/`payable fallback()` function does not authorize requests | 2 |\n| [L-11](#L-11) | `require()` should be used instead of `assert()` | 1 |\n| [L-12](#L-12) | `safeApprove()` is deprecated | 2 |\n| [L-13](#L-13) | Some tokens may revert when large transfers are made | 6 |\n| [L-14](#L-14) | State variables not capped at reasonable values | 11 |\n| [L-15](#L-15) | Subtraction may underflow if multiplication is too large | 6 |\n\n Total: 168 instances over 15 issues.\n \n## Non Critical Issues\n\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [NC-1](#NC-1) | Large or complicated code bases should implement invariant tests | 1 |\n| [NC-2](#NC-2) | Adding a return statement when the function defines a named return variable, is redundant | 9 |\n| [NC-3](#NC-3) | Missing checks for `address(0)` when assigning values to address state variables | 4 |\n| [NC-4](#NC-4) | Array indices should be referenced via enums rather than via numeric literals | 2 |\n| [NC-5](#NC-5) | Array is `push()ed` but not `pop()ed` | 1 |\n| [NC-6](#NC-6) | Assembly blocks should have extensive comments | 4 |\n| [NC-7](#NC-7) | Avoid the use of sensitive terms | 7 |\n| [NC-8](#NC-8) | Cast to bytes or bytes32 for clearer semantic meaning | 1 |\n| [NC-9](#NC-9) | Complex casting | 2 |\n| [NC-10](#NC-10) |", "vulnerable_code": "File: packages/contracts/contracts/ActivePool.sol\n\n /// @audit syncGlobalAccountingAndGracePeriod() prior to this assignment\n 398: feeRecipientAddress = _feeRecipientAddress;\n", "fixed_code": "File: packages/contracts/contracts/ActivePool.sol\n\n 390: function setFeeRecipientAddress(address _feeRecipientAddress) external requiresAuth {\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/zabihullahazadzoi-Q.md", "collected_at": "2026-01-02T18:27:06.554425+00:00", "source_hash": "07304e7af8df19d2031dc49a1b4fd50b7c35984ebfba9cf2dff29ac674a25614", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: packages/contracts/contracts/ActivePool.sol\n\n /// @audit syncGlobalAccountingAndGracePeriod() prior to this assignment\n 398: feeRecipientAddress = _feeRecipientAddress;\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: packages/contracts/contracts/ActivePool.sol\n\n 390: function setFeeRecipientAddress(address _feeRecipientAddress) external requiresAuth {\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-ondo", "title": "erictee Q", "severity_raw": "Critical", "severity": "critical", "description": "### [L-01] ```require()``` should be used instead of ```assert()```\n\n\n#### Impact\nPrior to solidity version 0.8.0, hitting an assert consumes the remainder of the transaction\u2019s available gas rather than returning it, as ```require()```/```revert()``` do. ```assert()``` should be avoided even past solidity version 0.8.0 as its [documentation](https://docs.soliditylang.org/en/v0.8.14/control-structures.html#panic-via-assert-and-error-via-require) states that \u201cThe assert function creates an error of type Panic(uint256). \u2026 Properly functioning code should never create a Panic, not even on invalid external input. If this happens, then there is a bug in your contract which you should fix\u201d.\n\n\n#### Findings:\n```\ncontracts/cash/factory/CashKYCSenderFactory.sol:L106 assert(cashKYCSenderProxyAdmin.owner() == guardian);\n\ncontracts/cash/factory/CashFactory.sol:L97 assert(cashProxyAdmin.owner() == guardian);\n\ncontracts/cash/factory/CashKYCSenderReceiverFactory.sol:L106 assert(cashKYCSenderReceiverProxyAdmin.owner() == guardian);\n\n```\n\n### [L-02] ```decimals()``` not part of ERC20 standard.\n\n\n#### Impact\n```decimals()``` is not part of the official ERC20 standard and might fall for tokens that do not implement it. While in practice it is very unlikely, as usually most of the tokens implement it, this should still be considered as a potential issue.\n\n\n#### Findings:\n```\ncontracts/lending/OndoPriceOracleV2.sol:L262 uint256(IERC20Like(underlying).decimals()) -\n\ncontracts/lending/OndoPriceOracleV2.sol:L263 uint256(AggregatorV3Interface(chainlinkOracle).decimals())));\n\ncontracts/cash/CashManager.sol:L181 (IERC20Metadata(_cash).decimals() -\n\ncontracts/cash/CashManager.sol:L182 IERC20Metadata(_collateral).decimals());\n\n```\n\n### [L-03] Avoid floating pragmas for non-library contracts.\n\n\n#### Impact\nWhile floating pragmas make sense for libraries to allow them to be included with multiple different versions of applications, it may be a security risk f", "vulnerable_code": "#### Impact\nPrior to solidity version 0.8.0, hitting an assert consumes the remainder of the transaction\u2019s available gas rather than returning it, as ```require()```/```revert()``` do. ```assert()``` should be avoided even past solidity version 0.8.0 as its [documentation](https://docs.soliditylang.org/en/v0.8.14/control-structures.html#panic-via-assert-and-error-via-require) states that \u201cThe assert function creates an error of type Panic(uint256). \u2026 Properly functioning code should never create a Panic, not even on invalid external input. If this happens, then there is a bug in your contract which you should fix\u201d.\n\n\n#### Findings:", "fixed_code": "### [L-02] ```decimals()``` not part of ERC20 standard.\n\n\n#### Impact", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/erictee-Q.md", "collected_at": "2026-01-02T18:15:08.309850+00:00", "source_hash": "073a7289e6c1f79df0f76fe6de2120115b632b3e97269998078404b5d7641594", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 852, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "#### Impact\nPrior to solidity version 0.8.0, hitting an assert consumes the remainder of the transaction\u2019s available gas rather than returning it, as", "primary_code_language": "unknown", "primary_code_char_count": 149, "all_code_blocks": "// Code block 1 (unknown):\n#### Impact\nPrior to solidity version 0.8.0, hitting an assert consumes the remainder of the transaction\u2019s available gas rather than returning it, as\n\n// Code block 2 (unknown):\ncontracts/cash/factory/CashKYCSenderFactory.sol:L106 assert(cashKYCSenderProxyAdmin.owner() == guardian);\n\ncontracts/cash/factory/CashFactory.sol:L97 assert(cashProxyAdmin.owner() == guardian);\n\ncontracts/cash/factory/CashKYCSenderReceiverFactory.sol:L106 assert(cashKYCSenderReceiverProxyAdmin.owner() == guardian);\n\n// Code block 3 (unknown):\ncontracts/lending/OndoPriceOracleV2.sol:L262 uint256(IERC20Like(underlying).decimals()) -\n\ncontracts/lending/OndoPriceOracleV2.sol:L263 uint256(AggregatorV3Interface(chainlinkOracle).decimals())));\n\ncontracts/cash/CashManager.sol:L181 (IERC20Metadata(_cash).decimals() -\n\ncontracts/cash/CashManager.sol:L182 IERC20Metadata(_collateral).decimals());", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "#### Impact\nPrior to solidity version 0.8.0, hitting an assert consumes the remainder of the transaction\u2019s available gas rather than returning it, as ```require()```/```revert()``` do. ```assert()``` should be avoided even past solidity version 0.8.0 as its [documentation](https://docs.soliditylang.org/en/v0.8.14/control-structures.html#panic-via-assert-and-error-via-require) states that \u201cThe assert function creates an error of type Panic(uint256). \u2026 Properly functioning code should never create a Panic, not even on invalid external input. If this happens, then there is a bug in your contract which you should fix\u201d.\n\n\n#### Findings:", "has_vulnerable_code_snippet": true, "fixed_code_actual": "### [L-02] ```decimals()``` not part of ERC20 standard.\n\n\n#### Impact", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "07-amphora", "title": "0xWaitress G", "severity_raw": "Informational", "severity": "informational", "description": "### [G-1] paysInterest in USDA access storage repeatedly in a loop\n\nconsider retrieve `_vaultControllers.length()` once and use it from memory in the for loop\n```solidity\n modifier paysInterest() {\n for (uint256 _i; _i < _vaultControllers.length();) {\n IVaultController(_vaultControllers.at(_i)).calculateInterest();\n unchecked {\n _i++;\n }\n }\n _;\n }\n```\n\n### [G-2] _mint/_burn in USDA repeats computation of `_amount * _gonsPerFragment`.\n\n```solidity\n _gonBalances[_target] += _amount * __gonsPerFragment;\n // total supply is in fragments, and so we add amount\n _totalSupply += _amount;\n // and totalgons of course is in gons, and so we multiply amount by gonsperfragment to get the amount of gons we must add to totalGons\n _totalGons += _amount * __gonsPerFragment;\n```\n\n### [G-3] liquidation gas fee increases as enabledToken increases since external read on Vault increases linearly regardless if the liquidatedUser deposited the asset or not.\n\nliquidateVault would call `_getVaultBorrowingPower` at the end of execution to verify that the user is still not over-collateralized. However this function would loop over all the vault's balance on all enabledTokens, each is an external read on Vault, costing linear increasing gas even though the user may have just 1 asset deposited\n\n```solidity\n function _getVaultBorrowingPower(IVault _vault) private returns (uint192 _borrowPower) {\n // loop over each registed token, adding the indivuduals ltv to the total ltv of the vault\n for (uint192 _i; _i < enabledTokens.length; ++_i) {\n CollateralInfo memory _collateral = tokenAddressCollateralInfo[enabledTokens[_i]];\n // if the ltv is 0, continue\n if (_collateral.ltv == 0) continue;\n // get the address of the token through the array of enabled tokens\n // note that index 0 of enabledTokens corresponds to a vaultId of 1, so we must subtract 1 from i to get the correct index\n address _tokenAddress = enabledTokens[", "vulnerable_code": " modifier paysInterest() {\n for (uint256 _i; _i < _vaultControllers.length();) {\n IVaultController(_vaultControllers.at(_i)).calculateInterest();\n unchecked {\n _i++;\n }\n }\n _;\n }", "fixed_code": " _gonBalances[_target] += _amount * __gonsPerFragment;\n // total supply is in fragments, and so we add amount\n _totalSupply += _amount;\n // and totalgons of course is in gons, and so we multiply amount by gonsperfragment to get the amount of gons we must add to totalGons\n _totalGons += _amount * __gonsPerFragment;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/0xWaitress-G.md", "collected_at": "2026-01-02T18:23:20.141104+00:00", "source_hash": "074c684d16412908bc3a2e074e3b2613c434b917a6ffcd98220a25c4b1a2f4e9", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 535, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "modifier paysInterest() {\n for (uint256 _i; _i < _vaultControllers.length();) {\n IVaultController(_vaultControllers.at(_i)).calculateInterest();\n unchecked {\n _i++;\n }\n }\n _;\n }", "primary_code_language": "solidity", "primary_code_char_count": 209, "all_code_blocks": "// Code block 1 (solidity):\nmodifier paysInterest() {\n for (uint256 _i; _i < _vaultControllers.length();) {\n IVaultController(_vaultControllers.at(_i)).calculateInterest();\n unchecked {\n _i++;\n }\n }\n _;\n }\n\n// Code block 2 (solidity):\n_gonBalances[_target] += _amount * __gonsPerFragment;\n // total supply is in fragments, and so we add amount\n _totalSupply += _amount;\n // and totalgons of course is in gons, and so we multiply amount by gonsperfragment to get the amount of gons we must add to totalGons\n _totalGons += _amount * __gonsPerFragment;", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "modifier paysInterest() {\n for (uint256 _i; _i < _vaultControllers.length();) {\n IVaultController(_vaultControllers.at(_i)).calculateInterest();\n unchecked {\n _i++;\n }\n }\n _;\n }\n\n_gonBalances[_target] += _amount * __gonsPerFragment;\n // total supply is in fragments, and so we add amount\n _totalSupply += _amount;\n // and totalgons of course is in gons, and so we multiply amount by gonsperfragment to get the amount of gons we must add to totalGons\n _totalGons += _amount * __gonsPerFragment;", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " modifier paysInterest() {\n for (uint256 _i; _i < _vaultControllers.length();) {\n IVaultController(_vaultControllers.at(_i)).calculateInterest();\n unchecked {\n _i++;\n }\n }\n _;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " _gonBalances[_target] += _amount * __gonsPerFragment;\n // total supply is in fragments, and so we add amount\n _totalSupply += _amount;\n // and totalgons of course is in gons, and so we multiply amount by gonsperfragment to get the amount of gons we must add to totalGons\n _totalGons += _amount * __gonsPerFragment;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ethos", "title": "bin2chen Q", "severity_raw": "Low", "severity": "low", "description": "L-1:\nCollateralConfig.updateCollateralRatios() will modify the MCR and CCR, these two parameters will affect whether the user is liquidated, related to the user's collateral.\nAlthough the administrator is a multi-signature wallet, but still need to have an effective time, to give the user sufficient time to choose whether to keep trove or repayment\n\n\nL-2:\nincreaseLUSDDebt()/decreaseLUSDDebt()\nEvent missing emit\n```solidity\n function increaseLUSDDebt(address _collateral, uint _amount) external override {\n _requireValidCollateralAddress(_collateral);\n _requireCallerIsBOorTroveM();\n LUSDDebt[_collateral] = LUSDDebt[_collateral].add(_amount);\n- ActivePoolLUSDDebtUpdated(_collateral, LUSDDebt[_collateral]);\n+ emit ActivePoolLUSDDebtUpdated(_collateral, LUSDDebt[_collateral]);\n }\n```\n\nL-3:\nTroveManager._removeTroveOwner()\nForgot settings `Troves[_borrower][_collateral].arrayIndex = 0` when clearing Trove Owner\n\n function _removeTroveOwner(address _borrower, address _collateral, uint TroveOwnersArrayLength) internal {\n Status troveStatus = Troves[_borrower][_collateral].status;\n // It\u2019s set in caller function `_closeTrove`\n assert(troveStatus != Status.nonExistent && troveStatus != Status.active);\n\n uint128 index = Troves[_borrower][_collateral].arrayIndex;\n uint length = TroveOwnersArrayLength;\n uint idxLast = length.sub(1);\n\n assert(index <= idxLast);\n\n address addressToMove = TroveOwners[_collateral][idxLast];\n\n TroveOwners[_collateral][index] = addressToMove;\n Troves[addressToMove][_collateral].arrayIndex = index;\n emit TroveIndexUpdated(addressToMove, _collateral, index);\n\n+ Troves[_borrower][_collateral].arrayIndex = 0;\n TroveOwners[_collateral].pop();\n }\n", "vulnerable_code": " function increaseLUSDDebt(address _collateral, uint _amount) external override {\n _requireValidCollateralAddress(_collateral);\n _requireCallerIsBOorTroveM();\n LUSDDebt[_collateral] = LUSDDebt[_collateral].add(_amount);\n- ActivePoolLUSDDebtUpdated(_collateral, LUSDDebt[_collateral]);\n+ emit ActivePoolLUSDDebtUpdated(_collateral, LUSDDebt[_collateral]);\n }", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/bin2chen-Q.md", "collected_at": "2026-01-02T18:16:51.730460+00:00", "source_hash": "074d96225c0dc17314a8af3505b669e34c6e2ef3227d61f8710f0729a23b8da4", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 392, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function increaseLUSDDebt(address _collateral, uint _amount) external override {\n _requireValidCollateralAddress(_collateral);\n _requireCallerIsBOorTroveM();\n LUSDDebt[_collateral] = LUSDDebt[_collateral].add(_amount);\n- ActivePoolLUSDDebtUpdated(_collateral, LUSDDebt[_collateral]);\n+ emit ActivePoolLUSDDebtUpdated(_collateral, LUSDDebt[_collateral]);\n }", "primary_code_language": "solidity", "primary_code_char_count": 392, "all_code_blocks": "// Code block 1 (solidity):\nfunction increaseLUSDDebt(address _collateral, uint _amount) external override {\n _requireValidCollateralAddress(_collateral);\n _requireCallerIsBOorTroveM();\n LUSDDebt[_collateral] = LUSDDebt[_collateral].add(_amount);\n- ActivePoolLUSDDebtUpdated(_collateral, LUSDDebt[_collateral]);\n+ emit ActivePoolLUSDDebtUpdated(_collateral, LUSDDebt[_collateral]);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function increaseLUSDDebt(address _collateral, uint _amount) external override {\n _requireValidCollateralAddress(_collateral);\n _requireCallerIsBOorTroveM();\n LUSDDebt[_collateral] = LUSDDebt[_collateral].add(_amount);\n- ActivePoolLUSDDebtUpdated(_collateral, LUSDDebt[_collateral]);\n+ emit ActivePoolLUSDDebtUpdated(_collateral, LUSDDebt[_collateral]);\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function increaseLUSDDebt(address _collateral, uint _amount) external override {\n _requireValidCollateralAddress(_collateral);\n _requireCallerIsBOorTroveM();\n LUSDDebt[_collateral] = LUSDDebt[_collateral].add(_amount);\n- ActivePoolLUSDDebtUpdated(_collateral, LUSDDebt[_collateral]);\n+ emit ActivePoolLUSDDebtUpdated(_collateral, LUSDDebt[_collateral]);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "09-ondo", "title": "adriro Q", "severity_raw": "Critical", "severity": "critical", "description": "# Report\n\n## Summary\n\n### Low Issues\n\nTotal of **10 issues**:\n\n|ID|Issue|\n|:--:|:---|\n| [L-1](#l-1-confusing-semantics-for-bridged-messages-approvals) | Confusing semantics for bridged messages approvals |\n| [L-2](#l-2-no-default-threshold-configuration) | No default threshold configuration |\n| [L-3](#l-3-validate-number-of-approvers-in-setthresholds) | Validate number of approvers in `setThresholds()` |\n| [L-4](#l-4-missing-safe-wrapper-for-erc20-transfer-in-rescuetokens) | Missing safe wrapper for ERC20 transfer in `rescueTokens()` |\n| [L-5](#l-5-account-may-get-blacklisted-during-the-bridge-process) | Account may get blacklisted during the bridge process |\n| [L-6](#l-6-missing-validation-for-index-parameter-in-overriderange) | Missing validation for index parameter in `overrideRange()` |\n| [L-7](#l-7-oracle-assumes-asset-has-18-decimals) | Oracle assumes asset has 18 decimals |\n| [L-8](#l-8-wrong-argument-in-transfer-event-of-wrap-function) | Wrong argument in `Transfer` event of `wrap()` function |\n| [L-9](#l-9-wrong-argument-in-transfershares-event-of-wrap-function) | Wrong argument in `TransferShares` event of `wrap()` function |\n| [L-10](#l-10-contracts-can-be-re-deployed-in-rusdy-factory) | Contracts can be re-deployed in rUSDY factory |\n\n### Non Critical Issues\n\nTotal of **2 issues**:\n\n|ID|Issue|\n|:--:|:---|\n| [NC-1](#nc-1-missing-calls-to-base-initializers-in-rusdy) | Missing calls to base initializers in rUSDY |\n| [NC-2](#nc-2-missing-event-to-notify-oracle-has-changed-in-rusdy) | Missing event to notify oracle has changed in rUSDY |\n\n## Low Issues\n\n### [L-1] Confusing semantics for bridged messages approvals\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/DestinationBridge.sol#L111\n\nBridged messages get an \"automatic\" approval while the message is being executed in the destination bridge contract, which means that all messages effectively get one approval as soon as they are bridged.\n\nThis implies that \"real\" appr", "vulnerable_code": "emit Transfer(address(0), msg.sender, getRUSDYByShares(_USDYAmount * BPS_DENOMINATOR));", "fixed_code": "emit TransferShares(address(0), msg.sender, _USDYAmount * BPS_DENOMINATOR);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/adriro-Q.md", "collected_at": "2026-01-02T18:25:46.189325+00:00", "source_hash": "0762b39b8ef2e8149cefbd48476e87ac19022a877858c3b297a2467a15a81d38", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "DestinationBridge.sol#L111", "github_files_list": "DestinationBridge.sol", "github_refs_count": 1, "vulnerable_code_actual": "emit Transfer(address(0), msg.sender, getRUSDYByShares(_USDYAmount * BPS_DENOMINATOR));", "has_vulnerable_code_snippet": true, "fixed_code_actual": "emit TransferShares(address(0), msg.sender, _USDYAmount * BPS_DENOMINATOR);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "08-dopex", "title": "0xSmartContract Q", "severity_raw": "Critical", "severity": "critical", "description": "### QA Report Issues List\n\n- [x] **Low 01** \u2192 Role-based `PAUSER_ROLE` is incorrectly defined\n- [x] **Low 02** \u2192 `swap()` function becomes unusable after 13 years\n- [x] **Low 03** \u2192 getLpPrice() value is received from Oracle with External call , but doesn't check to value for unexpected return values\n- [x] **Low 04** \u2192 `maturity` may be less than expected due to arithmetic rounding\n- [x] **Low 05** \u2192 There is Timelock function information in the comments, but no Timelock architecture can be seen in the project\n- [x] **Low 06** \u2192 In the mint() function, the MINTER_ROLE mechanism check is used both times, which creates confusion\n- [x] **Low 07** \u2192 Uses the deprecated `_setupRole` function\n- [x] **Low 08** \u2192 Although there is a role-based security approach with Access Control, the same address is defined for all roles.\n- [x] **Low 09** \u2192 The `BURNER_ROLE ` constructor is also not defined\n- [x] **Non-Critical 10** \u2192 MANAGER_ROLE is defined but never used\n- [x] **Non-Critical 11** \u2192 Use `AccessControlDefaultAdminRule` instead of `AccessControl`\n- [x] **Non-Critical 12** \u2192 Typo\n- [x] **Non-Critical 13** \u2192 Project Upgrade and Stop Scenario should be\n- [x] **Non-Critical 14** \u2192 Missing Event for initialize\n\n
\n
\n\n### [Low-01] Role-based `PAUSER_ROLE` is incorrectly defined\n\n`RdpxReserve.pause() ` and `RdpxReserve.unpause() ` functions have `onlyRole` modifier like a other important functions in Project , but they functions has `DEFAULT_ADMIN_ROL`E check in `onlyRole` modifier instead `PAUSER_ROLE`\n\nSince `DEFAULT_ADMIN_ROLE` and `PAUSER_ROLE` are `msg.sender`, the owner of both roles is the same in theory at first, but it should be noted that these roles can be changed in the future.\n\nThe fact that `PAUSER_ROLE` is defined in the constructor, that the function is `pause() ` and `unpase() ` and that `PAUSER_ROLE` is not used elsewhere in the `RdpxReserve` contract proves this.\n\n```solidity\n\ncontracts\\reserve\\RdpxReserve.sol:\n 22 \n 23: constructor(address _", "vulnerable_code": "contracts\\reserve\\RdpxReserve.sol:\n 22 \n 23: constructor(address _rdpx) {\n 24: rdpx = _rdpx;\n 25: _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);\n 26: _grantRole(PAUSER_ROLE, msg.sender);\n 27: }\n 28: \n 29: /**\n 30: * @notice Pauses the vault for emergency cases\n 31: * @dev Can only be called by the owner\n 32: **/\n 33: function pause() external onlyRole(DEFAULT_ADMIN_ROLE) { // @audit onlyRole not PAUSER_ROLE\n 34: _pause();\n 35: }\n 36: \n 37: /**\n 38: * @notice Unpauses the vault\n 39: * @dev Can only be called by the owner\n 40: **/\n 41: function unpause() external onlyRole(DEFAULT_ADMIN_ROLE) { // @audit onlyRole not PAUSER_ROLE\n 42: _unpause();\n 43: }\n", "fixed_code": "### [Low-02] swap() function becomes unusable after 13 years\n\n`UniV3LiquidityAmo.swap() ` function is very important role in project, in line 295 also we can see , deadline is 2105300114 unixtime value , this value means ; This function becomes unusable in 13 years later\n\n13 years not as far and this contract not upgradable artitecture.\n\nI recommend that the deadline value be in a user-definable architecture, not hardcoded.\n\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/0xSmartContract-Q.md", "collected_at": "2026-01-02T18:24:19.561647+00:00", "source_hash": "078cbbeb7d698b3951ae43f112d2c0bf6ac888bbc5b4a2d2030b36817980303a", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "contracts\\reserve\\RdpxReserve.sol:\n 22 \n 23: constructor(address _rdpx) {\n 24: rdpx = _rdpx;\n 25: _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);\n 26: _grantRole(PAUSER_ROLE, msg.sender);\n 27: }\n 28: \n 29: /**\n 30: * @notice Pauses the vault for emergency cases\n 31: * @dev Can only be called by the owner\n 32: **/\n 33: function pause() external onlyRole(DEFAULT_ADMIN_ROLE) { // @audit onlyRole not PAUSER_ROLE\n 34: _pause();\n 35: }\n 36: \n 37: /**\n 38: * @notice Unpauses the vault\n 39: * @dev Can only be called by the owner\n 40: **/\n 41: function unpause() external onlyRole(DEFAULT_ADMIN_ROLE) { // @audit onlyRole not PAUSER_ROLE\n 42: _unpause();\n 43: }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "### [Low-02] swap() function becomes unusable after 13 years\n\n`UniV3LiquidityAmo.swap() ` function is very important role in project, in line 295 also we can see , deadline is 2105300114 unixtime value , this value means ; This function becomes unusable in 13 years later\n\n13 years not as far and this contract not upgradable artitecture.\n\nI recommend that the deadline value be in a user-definable architecture, not hardcoded.\n\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "07-amphora", "title": "Aymen0909 G", "severity_raw": "Low", "severity": "low", "description": "# Gas Optimizations\n\n## Summary\n\n| | Issue | Instances |\n| :---: |:-------------|:------------:|\n| 1 | State variables should be packed to save storage slots | 3 |\n| 2 | Emit events outside the for loops | 3 |\n| 3 | Multiple address/IDs mappings can be combined into a single mapping of an address/id to a struct | 2 |\n\n\n## Findings\n\n### 1- State variables should be packed to save storage slots :\n\nState variables inside contract should be packed if possible to save storage slots and thus will save gas cost.\n\nThere are 3 instances of this issue:\n\n* Instance 1 :\n\n```\nFile: core/AMPHClaimer.sol\n\n45 uint256 public cvxRewardFee;\n48 uint256 public crvRewardFee;\n```\n\nBoth variables represents a fee value that cannot go above 1e18, which means that boths variables cannot overflow uint128, and they should be packed to save gas, **save 1 storage slot** : \n\n```\n/// @dev Percentage of rewards taken in CVX (1e18 == 100%)\nuint256 public cvxRewardFee;\n\n/// @dev Percentage of rewards taken in CRV (1e18 == 100%)\nuint256 public crvRewardFee;\n```\n\n* Instance 2 :\n\n```\nFile: core/VaultController.sol\n\n67 uint192 public protocolFee;\n69 uint192 public initialBorrowingFee;\n71 uint192 public liquidationFee;\n```\n\nThe 3 variables represent fee values that cannot go above 1e18, which means that all those variables cannot overflow uint96, and they should be packed to save gas, **save 2 storage slot** :\n\n```\n/// @dev The protocol's fee\nuint96 public protocolFee;\n/// @dev The initial borrowing fee (1e18 == 100%)\nuint96 public initialBorrowingFee;\n/// @dev The fee taken from the liquidator profit (1e18 == 100%)\nuint96 public liquidationFee;\n```\n\n* Instance 3 :\n\n```\nFile: core/AMPHClaimer.sol\n\n35 uint256 public votingDelay;\n38 uint256 public votingPeriod;\n```\n\nBoth variables represent a time value that cannot realistically overflow uint64, so they should be packed to save gas **save 1 storage slot** : \n\n```\n/// @notice The delay before voting on a pro", "vulnerable_code": "File: core/AMPHClaimer.sol\n\n45 uint256 public cvxRewardFee;\n48 uint256 public crvRewardFee;", "fixed_code": "/// @dev Percentage of rewards taken in CVX (1e18 == 100%)\nuint256 public cvxRewardFee;\n\n/// @dev Percentage of rewards taken in CRV (1e18 == 100%)\nuint256 public crvRewardFee;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/Aymen0909-G.md", "collected_at": "2026-01-02T18:23:22.400450+00:00", "source_hash": "07b05b20259f5b7276fc1773e91ad9ad9538675c0fd7a0a2fa673e579779fecf", "code_block_count": 5, "solidity_block_count": 0, "total_code_chars": 761, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: core/AMPHClaimer.sol\n\n45 uint256 public cvxRewardFee;\n48 uint256 public crvRewardFee;", "primary_code_language": "unknown", "primary_code_char_count": 101, "all_code_blocks": "// Code block 1 (unknown):\nFile: core/AMPHClaimer.sol\n\n45 uint256 public cvxRewardFee;\n48 uint256 public crvRewardFee;\n\n// Code block 2 (unknown):\n/// @dev Percentage of rewards taken in CVX (1e18 == 100%)\nuint256 public cvxRewardFee;\n\n/// @dev Percentage of rewards taken in CRV (1e18 == 100%)\nuint256 public crvRewardFee;\n\n// Code block 3 (unknown):\nFile: core/VaultController.sol\n\n67 uint192 public protocolFee;\n69 uint192 public initialBorrowingFee;\n71 uint192 public liquidationFee;\n\n// Code block 4 (unknown):\n/// @dev The protocol's fee\nuint96 public protocolFee;\n/// @dev The initial borrowing fee (1e18 == 100%)\nuint96 public initialBorrowingFee;\n/// @dev The fee taken from the liquidator profit (1e18 == 100%)\nuint96 public liquidationFee;\n\n// Code block 5 (unknown):\nFile: core/AMPHClaimer.sol\n\n35 uint256 public votingDelay;\n38 uint256 public votingPeriod;", "all_code_blocks_count": 5, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: core/AMPHClaimer.sol\n\n45 uint256 public cvxRewardFee;\n48 uint256 public crvRewardFee;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "/// @dev Percentage of rewards taken in CVX (1e18 == 100%)\nuint256 public cvxRewardFee;\n\n/// @dev Percentage of rewards taken in CRV (1e18 == 100%)\nuint256 public crvRewardFee;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "09-ondo", "title": "John_Femi Q", "severity_raw": "High", "severity": "high", "description": "# 1\n## Title\nUnbounded loops used\n## Impact\nIn the `setThresholds` function we see the function allows owner to input an unbounded length of arrays for amounts and numOfApprovers. This can lead to a long list of input which could cause the gasLimit to be hit and txn reverted with gas wasted.\n## Proof of Concept\nWith amount array length of 15 and above, it is highly likely to hit the gasLimit\n## Tools Used\nManual Review\n\n## Recommended Mitigation Steps\nAdd a max length of array with mitigation steps to either revert or deal with the max limit of array length only\n\n# 2\n## Title\nUse Maps rather than array\n## Impact\nWe see the code `mapping(bytes32 => TxnThreshold) public txnToThresholdSet;` and \n```solidity\nstruct TxnThreshold {\n uint256 numberOfApprovalsNeeded;\n address[] approvers;\n } \n```\n## Proof of Concept\n\n## Tools Used\nManual Review\n\n## Recommended Mitigation Steps\nIt could easily be update to `mapping(bytes32 => address => TxnThreshold)public txnToThresholdSet;` and \n```solidity\nstruct TxnThreshold {\n uint256 numberOfApprovalsNeeded;\n address approver;\n } \n```\nand `mapping(bytes32 => number) TxnThreshold` for length of approvers, this is to avoid use of long arrays\n\n# 3\n## Title\nUse an admin role instead of onlyOwner\n## Impact\nIt is better to use admin or ownership roles to allow for inheritance and multiple access incase of wallet hacks and also to avoid a single point of failure.\n## Proof of Concept\nownership can be stolen with wallet hacks, as seen by recent hacks\n## Tools Used\nManual Review\n\n## Recommended Mitigation Steps\nIt is better to use admin or ownership roles to allow for inheritance and multiple access incase of wallet hacks and also to avoid a single point of failure.\n\n# 4\n## Title\nNo check for number of approvers\n## Impact\nThere is no check for the sorting of numOfApprovers in the `setThreshold` function, while the amount is checked to be sorted,there could be a scenario where `numOfApprovers` is not and this could lead to inconsist", "vulnerable_code": "struct TxnThreshold {\n uint256 numberOfApprovalsNeeded;\n address[] approvers;\n } ", "fixed_code": "struct TxnThreshold {\n uint256 numberOfApprovalsNeeded;\n address approver;\n } ", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/John_Femi-Q.md", "collected_at": "2026-01-02T18:25:32.662831+00:00", "source_hash": "08431411cafa1ef2edda8cf4b679ff754077693e15e03486af19a30b048c0aac", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 171, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "struct TxnThreshold {\n uint256 numberOfApprovalsNeeded;\n address[] approvers;\n }", "primary_code_language": "solidity", "primary_code_char_count": 87, "all_code_blocks": "// Code block 1 (solidity):\nstruct TxnThreshold {\n uint256 numberOfApprovalsNeeded;\n address[] approvers;\n }\n\n// Code block 2 (solidity):\nstruct TxnThreshold {\n uint256 numberOfApprovalsNeeded;\n address approver;\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "struct TxnThreshold {\n uint256 numberOfApprovalsNeeded;\n address[] approvers;\n }\n\nstruct TxnThreshold {\n uint256 numberOfApprovalsNeeded;\n address approver;\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "struct TxnThreshold {\n uint256 numberOfApprovalsNeeded;\n address[] approvers;\n } ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "struct TxnThreshold {\n uint256 numberOfApprovalsNeeded;\n address approver;\n } ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "09-ondo", "title": "Stormreckson Q", "severity_raw": "High", "severity": "high", "description": "1- The following functions in `rUSDY.sol` lack checks on the returned values of the external calls made.\nNot checking the return value of an external call can result in undesired state changes within the contract. This may lead to loss of funds, incorrect calculations or balances, or unintended consequences that can negatively impact the contract and its users.\nAdding return value checks can be beneficial to ensure that the intended actions are executed successfully and to handle any potential errors or issues that may arise during the execution of the function. \n\n`Burn()`\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L680-L681\n\n```\n usdy.transfer(msg.sender, sharesAmount / BPS_DENOMINATOR);\n```\n`Unwrap()`\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L454-L455\n\n```\nusdy.transfer(msg.sender, usdyAmount / BPS_DENOMINATOR);\n```\n\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L436\n\n```\n usdy.transferFrom(msg.sender, address(this), _USDYAmount);\n```\n`Wrap()`\n\nexample of how you can add return value checks to the transfer function calls in the unwrap and burn functions:\n\ni. `Unwrap` Function:\n\n```\nfunction unwrap(uint256 _rUSDYAmount) external whenNotPaused {\n require(_rUSDYAmount > 0, \"rUSDY: can't unwrap zero rUSDY tokens\");\n uint256 usdyAmount = getSharesByRUSDY(_rUSDYAmount);\n if (usdyAmount < BPS_DENOMINATOR) revert UnwrapTooSmall();\n _burnShares(msg.sender, usdyAmount);\n require(usdy.transfer(msg.sender, usdyAmount / BPS_DENOMINATOR), \"Transfer failed\");\n emit TokensBurnt(msg.sender, _rUSDYAmount);\n}\n```\n\nii. `Burn` Function:\n\n```\nfunction burn(address _account, uint256 _amount) external onlyRole(BURNER_ROLE) {\n uint256 sharesAmount = getSharesByRUSDY(_amount);\n _burnShares(_account, sharesAmount);\n require(usdy.transfer(msg.sender, sharesAmount / ", "vulnerable_code": " usdy.transfer(msg.sender, sharesAmount / BPS_DENOMINATOR);", "fixed_code": "usdy.transfer(msg.sender, usdyAmount / BPS_DENOMINATOR);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/Stormreckson-Q.md", "collected_at": "2026-01-02T18:25:41.739133+00:00", "source_hash": "08a7ccabc059dd1a698bed75279861abebe31cb96cd46e3035199a2c3947a4c2", "code_block_count": 4, "solidity_block_count": 0, "total_code_chars": 594, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "usdy.transfer(msg.sender, sharesAmount / BPS_DENOMINATOR);", "primary_code_language": "unknown", "primary_code_char_count": 58, "all_code_blocks": "// Code block 1 (unknown):\nusdy.transfer(msg.sender, sharesAmount / BPS_DENOMINATOR);\n\n// Code block 2 (unknown):\nusdy.transfer(msg.sender, usdyAmount / BPS_DENOMINATOR);\n\n// Code block 3 (unknown):\nusdy.transferFrom(msg.sender, address(this), _USDYAmount);\n\n// Code block 4 (unknown):\nfunction unwrap(uint256 _rUSDYAmount) external whenNotPaused {\n require(_rUSDYAmount > 0, \"rUSDY: can't unwrap zero rUSDY tokens\");\n uint256 usdyAmount = getSharesByRUSDY(_rUSDYAmount);\n if (usdyAmount < BPS_DENOMINATOR) revert UnwrapTooSmall();\n _burnShares(msg.sender, usdyAmount);\n require(usdy.transfer(msg.sender, usdyAmount / BPS_DENOMINATOR), \"Transfer failed\");\n emit TokensBurnt(msg.sender, _rUSDYAmount);\n}", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "rUSDY.sol#L680-L681, rUSDY.sol#L454-L455, rUSDY.sol#L436", "github_files_list": "rUSDY.sol", "github_refs_count": 3, "vulnerable_code_actual": " usdy.transfer(msg.sender, sharesAmount / BPS_DENOMINATOR);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "usdy.transfer(msg.sender, usdyAmount / BPS_DENOMINATOR);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "02-ethos", "title": "BanPaleo G", "severity_raw": "Low", "severity": "low", "description": "(1) We can pack structs to smaller size to save storage slot\n\nStructs containing `uint256` should be checked again if it is really necessary to use `uint256` and instead can use a lower value such as `uint128` as it is unlikely there is ever need to pass the max value of `uint128`. By using `uint128` it can save significantly a large margin of gas to all affected structs.\nEach storage slot would save about `~2.1k` in gas. Just by changing all `uint256` to `uint128` we can save about `~54` storage slots which total up to `~113,400` in gas savings. The gas savings can increase more if we can allow the use of even smaller `uint` such as `uint96` or `uint64`\n\n```solidity\nActivePool.sol:\n 218 \n 219 // Due to \"stack too deep\" error\n 220: struct LocalVariables_rebalance {\n 221: uint256 currentAllocated;\n 222: IERC4626 yieldGenerator;\n 223: uint256 ownedShares;\n 224: uint256 sharesToAssets;\n 225: uint256 profit;\n 226: uint256 finalBalance;\n 227: uint256 percentOfFinalBal;\n 228: uint256 yieldingPercentage;\n 229: uint256 toDeposit;\n 230: uint256 toWithdraw;\n 231: uint256 yieldingAmount;\n 232: uint256 finalYieldingAmount;\n 233: int256 netAssetMovement;\n 234: uint256 treasurySplit;\n 235: uint256 stakingSplit;\n 236: uint256 stabilityPoolSplit;\n\n //@audit Can save about 8 storage slots\n\nBorrowerOperations.sol:\n 47: struct LocalVariables_adjustTrove {\n 48: uint256 collCCR;\n 49: uint256 collMCR;\n 50: uint256 collDecimals;\n 51: uint price;\n 52: uint collChange;\n 53: uint netDebtChange;\n 54: bool isCollIncrease;\n 55: uint debt;\n 56: uint coll;\n 57: uint oldICR;\n 58: uint newICR;\n 59: uint newTCR;\n 60: uint LUSDFee;\n 61: uint newDebt;\n 62: uint newColl;\n 63: uint st", "vulnerable_code": "ActivePool.sol:\n 218 \n 219 // Due to \"stack too deep\" error\n 220: struct LocalVariables_rebalance {\n 221: uint256 currentAllocated;\n 222: IERC4626 yieldGenerator;\n 223: uint256 ownedShares;\n 224: uint256 sharesToAssets;\n 225: uint256 profit;\n 226: uint256 finalBalance;\n 227: uint256 percentOfFinalBal;\n 228: uint256 yieldingPercentage;\n 229: uint256 toDeposit;\n 230: uint256 toWithdraw;\n 231: uint256 yieldingAmount;\n 232: uint256 finalYieldingAmount;\n 233: int256 netAssetMovement;\n 234: uint256 treasurySplit;\n 235: uint256 stakingSplit;\n 236: uint256 stabilityPoolSplit;\n\n //@audit Can save about 8 storage slots\n\nBorrowerOperations.sol:\n 47: struct LocalVariables_adjustTrove {\n 48: uint256 collCCR;\n 49: uint256 collMCR;\n 50: uint256 collDecimals;\n 51: uint price;\n 52: uint collChange;\n 53: uint netDebtChange;\n 54: bool isCollIncrease;\n 55: uint debt;\n 56: uint coll;\n 57: uint oldICR;\n 58: uint newICR;\n 59: uint newTCR;\n 60: uint LUSDFee;\n 61: uint newDebt;\n 62: uint newColl;\n 63: uint stake;\n 64: }\n\n //@audit Can save about 8 storage slots\n\n 65 \n 66: struct LocalVariables_openTrove {\n 67: uint256 collCCR;\n 68: uint256 collMCR;\n 69: uint256 collDecimals;\n 70: uint price;\n 71: uint LUSDFee;\n 72: uint netDebt;\n 73: uint compositeDebt;\n 74: uint ICR;\n 75: uint NICR;\n 76: uint stake;\n 77: uint arrayIndex;\n 78: }\n //@audit Can save about 5 storage slots\n\nCollateralConfig.sol:\n 27: struct Config {\n 28: bool allowed;\n 29: uint256 decimals;\n 30: uint256 MCR;\n 31: uint256 CCR;\n 32: ", "fixed_code": "ActivePool.sol:\n 3: pragma solidity 0.6.11;\n\nBorrowerOperations.sol:\n 3: pragma solidity 0.6.11;\n\nCollateralConfig.sol:\n 3: pragma solidity 0.6.11;\n\nLUSDToken.sol:\n 3: pragma solidity 0.6.11;\n\nStabilityPool.sol:\n 3: pragma solidity 0.6.11;\n\nTroveManager.sol:\n 3: pragma solidity 0.6.11;\n\nCommunityIssuance.sol:\n 3: pragma solidity 0.6.11;\n\nLQTYStaking.sol:\n 3: pragma solidity 0.6.11;", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/BanPaleo-G.md", "collected_at": "2026-01-02T18:15:58.580948+00:00", "source_hash": "08ac136849f8aacbd949fd56e3336db1057c1a4653981562e31401745de14271", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "ActivePool.sol:\n 218 \n 219 // Due to \"stack too deep\" error\n 220: struct LocalVariables_rebalance {\n 221: uint256 currentAllocated;\n 222: IERC4626 yieldGenerator;\n 223: uint256 ownedShares;\n 224: uint256 sharesToAssets;\n 225: uint256 profit;\n 226: uint256 finalBalance;\n 227: uint256 percentOfFinalBal;\n 228: uint256 yieldingPercentage;\n 229: uint256 toDeposit;\n 230: uint256 toWithdraw;\n 231: uint256 yieldingAmount;\n 232: uint256 finalYieldingAmount;\n 233: int256 netAssetMovement;\n 234: uint256 treasurySplit;\n 235: uint256 stakingSplit;\n 236: uint256 stabilityPoolSplit;\n\n //@audit Can save about 8 storage slots\n\nBorrowerOperations.sol:\n 47: struct LocalVariables_adjustTrove {\n 48: uint256 collCCR;\n 49: uint256 collMCR;\n 50: uint256 collDecimals;\n 51: uint price;\n 52: uint collChange;\n 53: uint netDebtChange;\n 54: bool isCollIncrease;\n 55: uint debt;\n 56: uint coll;\n 57: uint oldICR;\n 58: uint newICR;\n 59: uint newTCR;\n 60: uint LUSDFee;\n 61: uint newDebt;\n 62: uint newColl;\n 63: uint stake;\n 64: }\n\n //@audit Can save about 8 storage slots\n\n 65 \n 66: struct LocalVariables_openTrove {\n 67: uint256 collCCR;\n 68: uint256 collMCR;\n 69: uint256 collDecimals;\n 70: uint price;\n 71: uint LUSDFee;\n 72: uint netDebt;\n 73: uint compositeDebt;\n 74: uint ICR;\n 75: uint NICR;\n 76: uint stake;\n 77: uint arrayIndex;\n 78: }\n //@audit Can save about 5 storage slots\n\nCollateralConfig.sol:\n 27: struct Config {\n 28: bool allowed;\n 29: uint256 decimals;\n 30: uint256 MCR;\n 31: uint256 CCR;\n 32: ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "ActivePool.sol:\n 3: pragma solidity 0.6.11;\n\nBorrowerOperations.sol:\n 3: pragma solidity 0.6.11;\n\nCollateralConfig.sol:\n 3: pragma solidity 0.6.11;\n\nLUSDToken.sol:\n 3: pragma solidity 0.6.11;\n\nStabilityPool.sol:\n 3: pragma solidity 0.6.11;\n\nTroveManager.sol:\n 3: pragma solidity 0.6.11;\n\nCommunityIssuance.sol:\n 3: pragma solidity 0.6.11;\n\nLQTYStaking.sol:\n 3: pragma solidity 0.6.11;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "06-lybra", "title": "report", "severity_raw": "Critical", "severity": "critical", "description": "---\nsponsor: \"Lybra Finance\"\nslug: \"2023-06-lybra\"\ndate: \"2023-08-21\"\ntitle: \"Lybra Finance\"\nfindings: \"https://github.com/code-423n4/2023-06-lybra-findings/issues\"\ncontest: 254\n---\n\n# Overview\n\n## About C4\n\nCode4rena (C4) is an open organization consisting of security researchers, auditors, developers, and individuals with domain expertise in smart contracts.\n\nA C4 audit is an event in which community participants, referred to as Wardens, review, audit, or analyze smart contract logic in exchange for a bounty provided by sponsoring projects.\n\nDuring the audit outlined in this document, C4 conducted an analysis of the Lybra Finance smart contract system written in Solidity. The audit took place between June 23 - July 3 2023.\n\n## Wardens\n\n136 Wardens contributed reports to the Lybra Finance:\n\n 1. 0x3b\n 2. [0xAnah](https://twitter.com/0xAnah)\n 3. 0xMAKEOUTHILL\n 4. 0xNightRaven\n 5. 0xRobocop\n 6. 0xbrett8571\n 7. 0xcm\n 8. [0xgrbr](https://twitter.com/x0grbr)\n 9. 0xhacksmithh\n 10. 0xkazim\n 11. [0xnacho](https://twitter.com/0xnacho17)\n 12. [0xnev](https://twitter.com/0xnevi)\n 13. [3agle](https://twitter.com/0x34gle)\n 14. [8olidity](https://twitter.com/8olidity)\n 15. [ABAIKUNANBAEV](https://twitter.com/_onlyowner)\n 16. [Arz](https://twitter.com/arzdev)\n 17. [Bauchibred](https://twitter.com/bauchibred?s=21&t=7sv-1qcnwtkdTA81Iog0yQ )\n 18. Breeje\n 19. Brenzee\n 20. [BugBusters](https://twitter.com/0xnirlin) ([nirlin](https://twitter.com/0xnirlin) and [0xepley](https://twitter.com/0xepley))\n 21. Bughunter101\n 22. [Co0nan](https://twitter.com/Conan0x3)\n 23. [CrypticShepherd](https://twitter.com/CrypticShepherd)\n 24. [Cryptor](https://twitter.com/DeFiCast)\n 25. D\\_Auditor\n 26. DavidGiladi\n 27. [DedOhWale](https://twitter.com/dedohwale)\n 28. [DelerRH](https://twitter.com/deler_rh)\n 29. HE1M\n 30. Hama\n 31. IceBear\n 32. Inspecktor\n 33. Iurii3\n 34. [JCN](https://twitter.com/0xJCN)\n 35. [Jorgect](https://twitter.com/TamayoNft)\n 36. [K42", "vulnerable_code": "contract GnosisSafeProxy {\n // singleton always needs to be first declared variable, to ensure that it is at the same location in the contracts to which calls are delegated.\n // To reduce deployment costs this variable is internal and needs to be retrieved via `getStorageAt`\n address internal singleton;\n\n /// @dev Constructor function sets address of singleton contract.\n /// @param _singleton Singleton address.\n constructor(address _singleton) {\n require(_singleton != address(0), \"Invalid singleton address provided\");\n singleton = _singleton;\n }\n\n /// @dev Fallback function forwards all transactions and returns all received return data.\n fallback() external payable {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let _singleton := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff)\n // 0xa619486e == keccak(\"masterCopy()\"). The value is right padded to 32-bytes with 0s\n if eq(calldataload(0), 0xa619486e00000000000000000000000000000000000000000000000000000000) {\n mstore(0, _singleton)\n return(0, 0x20)\n }\n calldatacopy(0, 0, calldatasize())\n let success := delegatecall(gas(), _singleton, 0, calldatasize(), 0, 0)\n returndatacopy(0, 0, returndatasize())\n if eq(success, 0) {\n revert(0, returndatasize())\n }\n return(0, returndatasize())\n }\n }\n}", "fixed_code": "uint256 onBehalfOfCollateralRatio = (depositedAsset[onBehalfOf] * assetPrice * 100) / getBorrowedOf(onBehalfOf);", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/report.md", "collected_at": "2026-01-02T18:23:15.409200+00:00", "source_hash": "08d21db2b12c6790c5a30893833f3e845a111a937e474be6ad30a3523b50c707", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "contract GnosisSafeProxy {\n // singleton always needs to be first declared variable, to ensure that it is at the same location in the contracts to which calls are delegated.\n // To reduce deployment costs this variable is internal and needs to be retrieved via `getStorageAt`\n address internal singleton;\n\n /// @dev Constructor function sets address of singleton contract.\n /// @param _singleton Singleton address.\n constructor(address _singleton) {\n require(_singleton != address(0), \"Invalid singleton address provided\");\n singleton = _singleton;\n }\n\n /// @dev Fallback function forwards all transactions and returns all received return data.\n fallback() external payable {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let _singleton := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff)\n // 0xa619486e == keccak(\"masterCopy()\"). The value is right padded to 32-bytes with 0s\n if eq(calldataload(0), 0xa619486e00000000000000000000000000000000000000000000000000000000) {\n mstore(0, _singleton)\n return(0, 0x20)\n }\n calldatacopy(0, 0, calldatasize())\n let success := delegatecall(gas(), _singleton, 0, calldatasize(), 0, 0)\n returndatacopy(0, 0, returndatasize())\n if eq(success, 0) {\n revert(0, returndatasize())\n }\n return(0, returndatasize())\n }\n }\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "uint256 onBehalfOfCollateralRatio = (depositedAsset[onBehalfOf] * assetPrice * 100) / getBorrowedOf(onBehalfOf);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "04-caviar", "title": "codeslide G", "severity_raw": "Low", "severity": "low", "description": "### Gas Optimizations\n\n| Number | Issue | Instances |\n| :----: | :---- | :-------: |\n| [G-01] | Use short circuiting to save gas | 5 |\n| [G-02] | Use assembly to check for address(0) | 22 |\n| [G-03] | Change function visibility from public to external | 19 |\n| [G-04] | State variables should be cached | 28 |\n| [G-05] | Check amount before transfer | 8 |\n| [G-06] | Mark functions as payable | 11 |\n| [G-07] | Subtraction syntax | 2 |\n\n#### [G-01] Use short circuiting to save gas\nUse short circuiting to save gas by putting the cheaper comparison first.\n\n```solidity\nFile: src/EthRouter.sol\n\n// before - always reading block.timestamp\n102: if (block.timestamp > deadline && deadline != 0) {\n\n// after - don't have to read block.timestamp if local variable is zero\n102: if (deadline != 0 && block.timestamp > deadline) {\n\n// same as line 102\n154: if (block.timestamp > deadline && deadline != 0) {\n\n// same as line 102\n228: if (block.timestamp > deadline && deadline != 0) {\n\n// same as line 102\n256: if (block.timestamp > deadline && deadline != 0) {\n```\n\n#### [G-02] Use assembly to check for address(0)\n\nUse assembly to check for address(0). Code example is at Solidity Assembly: Checking if an Address is 0 (Efficiently).\n\n```solidity\nFile: src/Factory.sol\n\n87: if ((_baseToken == address(0) && msg.value != baseTokenAmount) || (_baseToken != address(0) && msg.value > 0)) {\n\n110: if (_baseToken == address(0)) {\n```\n\n```solidity\nFile: src/PrivatePool.sol\n\n225: if (baseToken != address(0) && msg.value > 0) revert InvalidEthAmount();\n\n254: if (baseToken != address(0)) {\n\n277: if (royaltyFee > 0 && recipient != address(0)) {\n278: if (baseToken != address(0)) {\n\n344: if (royaltyFee > 0 && recipient != address(0)) {\n345: if (baseToken != address(0)) {\n\n357: if (baseToken == address(0)) {\n\n397: if (baseToken != address(0) && msg.value > 0) revert InvalidEthAmount();\n\n421: if (baseToken != address(0)) {\n\n489: if ((baseToken == addres", "vulnerable_code": "File: src/EthRouter.sol\n\n// before - always reading block.timestamp\n102: if (block.timestamp > deadline && deadline != 0) {\n\n// after - don't have to read block.timestamp if local variable is zero\n102: if (deadline != 0 && block.timestamp > deadline) {\n\n// same as line 102\n154: if (block.timestamp > deadline && deadline != 0) {\n\n// same as line 102\n228: if (block.timestamp > deadline && deadline != 0) {\n\n// same as line 102\n256: if (block.timestamp > deadline && deadline != 0) {", "fixed_code": "File: src/Factory.sol\n\n87: if ((_baseToken == address(0) && msg.value != baseTokenAmount) || (_baseToken != address(0) && msg.value > 0)) {\n\n110: if (_baseToken == address(0)) {", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/codeslide-G.md", "collected_at": "2026-01-02T18:20:22.210382+00:00", "source_hash": "08ee4b401427cdf34e72ad97c6943b69aa3b3b79a9177d6ad68556c1fb35d84e", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 680, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: src/EthRouter.sol\n\n// before - always reading block.timestamp\n102: if (block.timestamp > deadline && deadline != 0) {\n\n// after - don't have to read block.timestamp if local variable is zero\n102: if (deadline != 0 && block.timestamp > deadline) {\n\n// same as line 102\n154: if (block.timestamp > deadline && deadline != 0) {\n\n// same as line 102\n228: if (block.timestamp > deadline && deadline != 0) {\n\n// same as line 102\n256: if (block.timestamp > deadline && deadline != 0) {", "primary_code_language": "solidity", "primary_code_char_count": 498, "all_code_blocks": "// Code block 1 (solidity):\nFile: src/EthRouter.sol\n\n// before - always reading block.timestamp\n102: if (block.timestamp > deadline && deadline != 0) {\n\n// after - don't have to read block.timestamp if local variable is zero\n102: if (deadline != 0 && block.timestamp > deadline) {\n\n// same as line 102\n154: if (block.timestamp > deadline && deadline != 0) {\n\n// same as line 102\n228: if (block.timestamp > deadline && deadline != 0) {\n\n// same as line 102\n256: if (block.timestamp > deadline && deadline != 0) {\n\n// Code block 2 (solidity):\nFile: src/Factory.sol\n\n87: if ((_baseToken == address(0) && msg.value != baseTokenAmount) || (_baseToken != address(0) && msg.value > 0)) {\n\n110: if (_baseToken == address(0)) {", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: src/EthRouter.sol\n\n// before - always reading block.timestamp\n102: if (block.timestamp > deadline && deadline != 0) {\n\n// after - don't have to read block.timestamp if local variable is zero\n102: if (deadline != 0 && block.timestamp > deadline) {\n\n// same as line 102\n154: if (block.timestamp > deadline && deadline != 0) {\n\n// same as line 102\n228: if (block.timestamp > deadline && deadline != 0) {\n\n// same as line 102\n256: if (block.timestamp > deadline && deadline != 0) {\n\nFile: src/Factory.sol\n\n87: if ((_baseToken == address(0) && msg.value != baseTokenAmount) || (_baseToken != address(0) && msg.value > 0)) {\n\n110: if (_baseToken == address(0)) {", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: src/EthRouter.sol\n\n// before - always reading block.timestamp\n102: if (block.timestamp > deadline && deadline != 0) {\n\n// after - don't have to read block.timestamp if local variable is zero\n102: if (deadline != 0 && block.timestamp > deadline) {\n\n// same as line 102\n154: if (block.timestamp > deadline && deadline != 0) {\n\n// same as line 102\n228: if (block.timestamp > deadline && deadline != 0) {\n\n// same as line 102\n256: if (block.timestamp > deadline && deadline != 0) {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: src/Factory.sol\n\n87: if ((_baseToken == address(0) && msg.value != baseTokenAmount) || (_baseToken != address(0) && msg.value > 0)) {\n\n110: if (_baseToken == address(0)) {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "04-caviar", "title": "Bauchibred Q", "severity_raw": "Critical", "severity": "critical", "description": "# Caviar QA report\n\n# Low Issues\n\n## L-01 Solmate\u2019s SafeTransferLib doesn\u2019t check whether the ERC20 contract exists\n\n### Proof of Concept\n\n[PrivatePool.sol L30](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L30)\n\n[Factory.sol L27](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/Factory.sol#L27)\n[EthRouter.sol L32](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L32)\n\nSolmate\u2019s SafeTransferLib, which is often used to interact with non-compliant/unsafe ERC20 tokens, does not check whether the ERC20 contract exists. The following code will not revert in case the token doesn\u2019t exist (yet).\n\nThis is stated in the Solmate library: https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol#L9\n\n### Recommendation\n\nAdd a contract exist control in functions\n\n## L-02 Low level calls don\u2019t check for contract existence\n\n### Proof of Concept\n\nLow level calls return success if called on a destructed contract. See OpenZeppelin\u2019s Address.so which checks address.code.length\n\nThere is 1 instance of this issue:\n\n[PrivatePool.execute()](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L459-L476)\n\n```\n function execute(address target, bytes memory data) public payable onlyOwner returns (bytes memory) {\n // call the target with the value and data\n (bool success, bytes memory returnData) = target.call{value: msg.value}(data);\n\n // if the call succeeded return the return data\n if (success) return returnData;\n\n // if we got an error bubble up the error message\n if (returnData.length > 0) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let returnData_size := mload(returnData)\n revert(add(32, returnData), returnData_size)\n ", "vulnerable_code": " function execute(address target, bytes memory data) public payable onlyOwner returns (bytes memory) {\n // call the target with the value and data\n (bool success, bytes memory returnData) = target.call{value: msg.value}(data);\n\n // if the call succeeded return the return data\n if (success) return returnData;\n\n // if we got an error bubble up the error message\n if (returnData.length > 0) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let returnData_size := mload(returnData)\n revert(add(32, returnData), returnData_size)\n }\n } else {\n revert();\n }\n }\n", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/Bauchibred-Q.md", "collected_at": "2026-01-02T18:19:31.176871+00:00", "source_hash": "090fa0343d57da69d1fd9e86fd1c6bd7fd4009f408d27627b853ca71224b112a", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "PrivatePool.sol#L30, Factory.sol#L27, EthRouter.sol#L32, SafeTransferLib.sol#L9, PrivatePool.sol#L459-L476", "github_files_list": "EthRouter.sol, SafeTransferLib.sol, PrivatePool.sol, Factory.sol", "github_refs_count": 5, "vulnerable_code_actual": " function execute(address target, bytes memory data) public payable onlyOwner returns (bytes memory) {\n // call the target with the value and data\n (bool success, bytes memory returnData) = target.call{value: msg.value}(data);\n\n // if the call succeeded return the return data\n if (success) return returnData;\n\n // if we got an error bubble up the error message\n if (returnData.length > 0) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let returnData_size := mload(returnData)\n revert(add(32, returnData), returnData_size)\n }\n } else {\n revert();\n }\n }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "05-ajna", "title": "niki G", "severity_raw": "Unknown", "severity": "unknown", "description": "### Don't Initialize Variables with Default Value\n\n#### Findings:\n```\nFunding.sol::62 => for (uint256 i = 0; i < targets_.length; ++i) {\nFunding.sol::112 => for (uint256 i = 0; i < targets_.length;) {\nPositionManager.sol::181 => for (uint256 i = 0; i < indexesLength; ) {\nPositionManager.sol::364 => for (uint256 i = 0; i < indexesLength; ) {\nPositionManager.sol::474 => uint256 filteredIndexesLength = 0;\nPositionManager.sol::476 => for (uint256 i = 0; i < indexesLength; ) {\nRewardsManager.sol::163 => for (uint256 i = 0; i < fromBucketLength; ) {\nRewardsManager.sol::229 => for (uint256 i = 0; i < positionIndexes.length; ) {\nRewardsManager.sol::290 => for (uint256 i = 0; i < positionIndexes.length; ) {\nRewardsManager.sol::440 => for (uint256 i = 0; i < positionIndexes_.length; ) {\nRewardsManager.sol::680 => for (uint256 i = 0; i < indexes_.length; ) {\nRewardsManager.sol::704 => for (uint256 i = 0; i < indexes_.length; ) {\nStandardFunding.sol::208 => for (uint i = 0; i < numFundedProposals; ) {\nStandardFunding.sol::324 => for (uint i = 0; i < numProposalsInSlate; ) {\nStandardFunding.sol::431 => uint256 totalTokensRequested = 0;\nStandardFunding.sol::434 => for (uint i = 0; i < numProposalsInSlate_; ) {\nStandardFunding.sol::468 => for (uint i = 0; i < numProposals; ) {\nStandardFunding.sol::491 => for (uint i = 0; i < proposalIdSubset_.length;) {\nStandardFunding.sol::549 => for (uint256 i = 0; i < numVotesCast; ) {\nStandardFunding.sol::582 => for (uint256 i = 0; i < numVotesCast; ) {\nStandardFunding.sol::848 => for (uint256 i = 0; i < numVotesCast; ) {\n```\n### Cache Array Length Outside of Loop\n\n#### Findings:\n```\nFunding.sol::62 => for (uint256 i = 0; i < targets_.length; ++i) {\nFunding.sol::112 => for (uint256 i = 0; i < targets_.length;) {\nRewardsManager.sol::229 => for (uint256 i = 0; i < positionIndexes.length; ) {\nRewardsManager.sol::290 => for (uint256 i = 0; i < positionIndexes.length; ) {\nRewardsManager.sol::440 => for (uint256 i = 0; i < positionIndexes_.length; )", "vulnerable_code": "Funding.sol::62 => for (uint256 i = 0; i < targets_.length; ++i) {\nFunding.sol::112 => for (uint256 i = 0; i < targets_.length;) {\nPositionManager.sol::181 => for (uint256 i = 0; i < indexesLength; ) {\nPositionManager.sol::364 => for (uint256 i = 0; i < indexesLength; ) {\nPositionManager.sol::474 => uint256 filteredIndexesLength = 0;\nPositionManager.sol::476 => for (uint256 i = 0; i < indexesLength; ) {\nRewardsManager.sol::163 => for (uint256 i = 0; i < fromBucketLength; ) {\nRewardsManager.sol::229 => for (uint256 i = 0; i < positionIndexes.length; ) {\nRewardsManager.sol::290 => for (uint256 i = 0; i < positionIndexes.length; ) {\nRewardsManager.sol::440 => for (uint256 i = 0; i < positionIndexes_.length; ) {\nRewardsManager.sol::680 => for (uint256 i = 0; i < indexes_.length; ) {\nRewardsManager.sol::704 => for (uint256 i = 0; i < indexes_.length; ) {\nStandardFunding.sol::208 => for (uint i = 0; i < numFundedProposals; ) {\nStandardFunding.sol::324 => for (uint i = 0; i < numProposalsInSlate; ) {\nStandardFunding.sol::431 => uint256 totalTokensRequested = 0;\nStandardFunding.sol::434 => for (uint i = 0; i < numProposalsInSlate_; ) {\nStandardFunding.sol::468 => for (uint i = 0; i < numProposals; ) {\nStandardFunding.sol::491 => for (uint i = 0; i < proposalIdSubset_.length;) {\nStandardFunding.sol::549 => for (uint256 i = 0; i < numVotesCast; ) {\nStandardFunding.sol::582 => for (uint256 i = 0; i < numVotesCast; ) {\nStandardFunding.sol::848 => for (uint256 i = 0; i < numVotesCast; ) {", "fixed_code": "Funding.sol::62 => for (uint256 i = 0; i < targets_.length; ++i) {\nFunding.sol::112 => for (uint256 i = 0; i < targets_.length;) {\nRewardsManager.sol::229 => for (uint256 i = 0; i < positionIndexes.length; ) {\nRewardsManager.sol::290 => for (uint256 i = 0; i < positionIndexes.length; ) {\nRewardsManager.sol::440 => for (uint256 i = 0; i < positionIndexes_.length; ) {\nRewardsManager.sol::680 => for (uint256 i = 0; i < indexes_.length; ) {\nRewardsManager.sol::704 => for (uint256 i = 0; i < indexes_.length; ) {\nStandardFunding.sol::491 => for (uint i = 0; i < proposalIdSubset_.length;) {", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/niki-G.md", "collected_at": "2026-01-02T18:21:39.510020+00:00", "source_hash": "092e9441baad52c288b2c71864495c0b2492c5693f3f87e234b0c38e9413a4cd", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 1500, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "Funding.sol::62 => for (uint256 i = 0; i < targets_.length; ++i) {\nFunding.sol::112 => for (uint256 i = 0; i < targets_.length;) {\nPositionManager.sol::181 => for (uint256 i = 0; i < indexesLength; ) {\nPositionManager.sol::364 => for (uint256 i = 0; i < indexesLength; ) {\nPositionManager.sol::474 => uint256 filteredIndexesLength = 0;\nPositionManager.sol::476 => for (uint256 i = 0; i < indexesLength; ) {\nRewardsManager.sol::163 => for (uint256 i = 0; i < fromBucketLength; ) {\nRewardsManager.sol::229 => for (uint256 i = 0; i < positionIndexes.length; ) {\nRewardsManager.sol::290 => for (uint256 i = 0; i < positionIndexes.length; ) {\nRewardsManager.sol::440 => for (uint256 i = 0; i < positionIndexes_.length; ) {\nRewardsManager.sol::680 => for (uint256 i = 0; i < indexes_.length; ) {\nRewardsManager.sol::704 => for (uint256 i = 0; i < indexes_.length; ) {\nStandardFunding.sol::208 => for (uint i = 0; i < numFundedProposals; ) {\nStandardFunding.sol::324 => for (uint i = 0; i < numProposalsInSlate; ) {\nStandardFunding.sol::431 => uint256 totalTokensRequested = 0;\nStandardFunding.sol::434 => for (uint i = 0; i < numProposalsInSlate_; ) {\nStandardFunding.sol::468 => for (uint i = 0; i < numProposals; ) {\nStandardFunding.sol::491 => for (uint i = 0; i < proposalIdSubset_.length;) {\nStandardFunding.sol::549 => for (uint256 i = 0; i < numVotesCast; ) {\nStandardFunding.sol::582 => for (uint256 i = 0; i < numVotesCast; ) {\nStandardFunding.sol::848 => for (uint256 i = 0; i < numVotesCast; ) {", "primary_code_language": "unknown", "primary_code_char_count": 1500, "all_code_blocks": "// Code block 1 (unknown):\nFunding.sol::62 => for (uint256 i = 0; i < targets_.length; ++i) {\nFunding.sol::112 => for (uint256 i = 0; i < targets_.length;) {\nPositionManager.sol::181 => for (uint256 i = 0; i < indexesLength; ) {\nPositionManager.sol::364 => for (uint256 i = 0; i < indexesLength; ) {\nPositionManager.sol::474 => uint256 filteredIndexesLength = 0;\nPositionManager.sol::476 => for (uint256 i = 0; i < indexesLength; ) {\nRewardsManager.sol::163 => for (uint256 i = 0; i < fromBucketLength; ) {\nRewardsManager.sol::229 => for (uint256 i = 0; i < positionIndexes.length; ) {\nRewardsManager.sol::290 => for (uint256 i = 0; i < positionIndexes.length; ) {\nRewardsManager.sol::440 => for (uint256 i = 0; i < positionIndexes_.length; ) {\nRewardsManager.sol::680 => for (uint256 i = 0; i < indexes_.length; ) {\nRewardsManager.sol::704 => for (uint256 i = 0; i < indexes_.length; ) {\nStandardFunding.sol::208 => for (uint i = 0; i < numFundedProposals; ) {\nStandardFunding.sol::324 => for (uint i = 0; i < numProposalsInSlate; ) {\nStandardFunding.sol::431 => uint256 totalTokensRequested = 0;\nStandardFunding.sol::434 => for (uint i = 0; i < numProposalsInSlate_; ) {\nStandardFunding.sol::468 => for (uint i = 0; i < numProposals; ) {\nStandardFunding.sol::491 => for (uint i = 0; i < proposalIdSubset_.length;) {\nStandardFunding.sol::549 => for (uint256 i = 0; i < numVotesCast; ) {\nStandardFunding.sol::582 => for (uint256 i = 0; i < numVotesCast; ) {\nStandardFunding.sol::848 => for (uint256 i = 0; i < numVotesCast; ) {", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "Funding.sol::62 => for (uint256 i = 0; i < targets_.length; ++i) {\nFunding.sol::112 => for (uint256 i = 0; i < targets_.length;) {\nPositionManager.sol::181 => for (uint256 i = 0; i < indexesLength; ) {\nPositionManager.sol::364 => for (uint256 i = 0; i < indexesLength; ) {\nPositionManager.sol::474 => uint256 filteredIndexesLength = 0;\nPositionManager.sol::476 => for (uint256 i = 0; i < indexesLength; ) {\nRewardsManager.sol::163 => for (uint256 i = 0; i < fromBucketLength; ) {\nRewardsManager.sol::229 => for (uint256 i = 0; i < positionIndexes.length; ) {\nRewardsManager.sol::290 => for (uint256 i = 0; i < positionIndexes.length; ) {\nRewardsManager.sol::440 => for (uint256 i = 0; i < positionIndexes_.length; ) {\nRewardsManager.sol::680 => for (uint256 i = 0; i < indexes_.length; ) {\nRewardsManager.sol::704 => for (uint256 i = 0; i < indexes_.length; ) {\nStandardFunding.sol::208 => for (uint i = 0; i < numFundedProposals; ) {\nStandardFunding.sol::324 => for (uint i = 0; i < numProposalsInSlate; ) {\nStandardFunding.sol::431 => uint256 totalTokensRequested = 0;\nStandardFunding.sol::434 => for (uint i = 0; i < numProposalsInSlate_; ) {\nStandardFunding.sol::468 => for (uint i = 0; i < numProposals; ) {\nStandardFunding.sol::491 => for (uint i = 0; i < proposalIdSubset_.length;) {\nStandardFunding.sol::549 => for (uint256 i = 0; i < numVotesCast; ) {\nStandardFunding.sol::582 => for (uint256 i = 0; i < numVotesCast; ) {\nStandardFunding.sol::848 => for (uint256 i = 0; i < numVotesCast; ) {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "Funding.sol::62 => for (uint256 i = 0; i < targets_.length; ++i) {\nFunding.sol::112 => for (uint256 i = 0; i < targets_.length;) {\nRewardsManager.sol::229 => for (uint256 i = 0; i < positionIndexes.length; ) {\nRewardsManager.sol::290 => for (uint256 i = 0; i < positionIndexes.length; ) {\nRewardsManager.sol::440 => for (uint256 i = 0; i < positionIndexes_.length; ) {\nRewardsManager.sol::680 => for (uint256 i = 0; i < indexes_.length; ) {\nRewardsManager.sol::704 => for (uint256 i = 0; i < indexes_.length; ) {\nStandardFunding.sol::491 => for (uint i = 0; i < proposalIdSubset_.length;) {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "08-dopex", "title": "LeoS G", "severity_raw": "Medium", "severity": "medium", "description": "# Summary\n| | Issue | Instances | Gas Saved |\n|--------|-------|-----------|-----------|\n|[G-01]|Use `calldata` instead of `memory`|7|-15 946|\n|[G-02]| Addition to automated findings [G-07]|1|-210|\n|[G-03]|Parts of the solmate library are available more efficiently|1|-104|\n|[G-04]|Variables do not need to be cached|1|-89|\n|[G-05]|Increase the number of optimiser runs|-|-133 044|\n\n\n\nThe gas saved column simply adds up the evolution in the snapshot, using the method described in the next section.\n\n# Benchmark\nA benchmark is performed on each optimization, using the tests snapshot provided by foundry. This snapshot is based on tests and therefore does not take into account all functions, this loss is accepted. But it is also subject to intrinsic variance. This means that some tests are not relevant to the comparison because they vary too much and are thus not taken into account. These are listed below:\n>testSettle\n>testIntegration\n>testRedeem\n\n\n\n# [G-01] Use `calldata` instead of `memory`\nUsing `calldata` instead of `memory` for function parameters can save gas if the argument is only read in the function. Only instances compilable with a simple type swap are considered valid.\n\n*7 instances*\n\n- [RdpxV2Core.sol#L242](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L242)\n- [RdpxV2Core.sol#L271](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L271)\n- [RdpxV2Core.sol#L821](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L821)\n- [RdpxV2Core.sol#L822](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L822)\n- [RdpxV2Core.sol#L1136](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L1136)\n- [PerpetualAtlanticVault.sol#L316](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/perp-vault/PerpetualAtlanticVault.sol#L316)\n- [PerpetualAtlanticVault.sol#L406](https://github.com/code-423n4/2", "vulnerable_code": "testAdminFunctions() (gas: -12 (-0.004%))\ntestEmergencyWithdrawNonNative() (gas: 32 (0.030%))\ntestFundingAccruedForOneOption() (gas: -215 (-0.030%))\ntestRedeemOnBehalfOf() (gas: -396 (-0.044%))\ntestBondWithDelegateMintDecayRiptide() (gas: -580 (-0.045%))\ntestWithdraw() (gas: -685 (-0.048%))\ntestBondWithoutOptions() (gas: -1940 (-0.050%))\ntestMockups() (gas: -645 (-0.052%))\ntestPayFunding() (gas: -1264 (-0.053%))\ntestBond() (gas: -1940 (-0.053%))\ntestEmergencyWithdraw() (gas: 63 (0.053%))\ntestBondWithDelegate() (gas: -5066 (-0.154%))\ntestUpperDepeg() (gas: -970 (-0.298%))\ntestlowerDepeg() (gas: -2328 (-0.374%))\nOverall gas change: -15946 (-0.040%)", "fixed_code": "testAddToDelegate() (gas: -210 (-0.061%))\nOverall gas change: -210 (-0.001%)", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/LeoS-G.md", "collected_at": "2026-01-02T18:24:49.281308+00:00", "source_hash": "098dd93b3560925b94c9924c3fd300dc72441b28428720dc80af4ad855e7aa31", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "RdpxV2Core.sol#L242, RdpxV2Core.sol#L271, RdpxV2Core.sol#L821, RdpxV2Core.sol#L822, RdpxV2Core.sol#L1136, PerpetualAtlanticVault.sol#L316", "github_files_list": "PerpetualAtlanticVault.sol, RdpxV2Core.sol", "github_refs_count": 6, "vulnerable_code_actual": "testAdminFunctions() (gas: -12 (-0.004%))\ntestEmergencyWithdrawNonNative() (gas: 32 (0.030%))\ntestFundingAccruedForOneOption() (gas: -215 (-0.030%))\ntestRedeemOnBehalfOf() (gas: -396 (-0.044%))\ntestBondWithDelegateMintDecayRiptide() (gas: -580 (-0.045%))\ntestWithdraw() (gas: -685 (-0.048%))\ntestBondWithoutOptions() (gas: -1940 (-0.050%))\ntestMockups() (gas: -645 (-0.052%))\ntestPayFunding() (gas: -1264 (-0.053%))\ntestBond() (gas: -1940 (-0.053%))\ntestEmergencyWithdraw() (gas: 63 (0.053%))\ntestBondWithDelegate() (gas: -5066 (-0.154%))\ntestUpperDepeg() (gas: -970 (-0.298%))\ntestlowerDepeg() (gas: -2328 (-0.374%))\nOverall gas change: -15946 (-0.040%)", "has_vulnerable_code_snippet": true, "fixed_code_actual": "testAddToDelegate() (gas: -210 (-0.061%))\nOverall gas change: -210 (-0.001%)", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "08-dopex", "title": "Daniel526 Q", "severity_raw": "Critical", "severity": "critical", "description": "A. The `mint` function in the RdpxDecayingBonds contract contains potentially duplicative access control checks, which might lead to code redundancy and confusion during maintenance. Ensuring consistency and reducing complexity in access control mechanisms is crucial to prevent vulnerabilities from creeping into the contract.\n```solidity\nfunction mint(address to, uint256 expiry, uint256 rdpxAmount) external onlyRole(MINTER_ROLE) {\n _whenNotPaused();\n require(hasRole(MINTER_ROLE, msg.sender), \"Caller is not a minter\");\n uint256 bondId = _mintToken(to);\n bonds[bondId] = Bond(to, expiry, rdpxAmount);\n emit BondMinted(to, bondId, expiry, rdpxAmount);\n}\n```\n- In the provided snippet, the `mint` function includes both the `onlyRole(MINTER_ROLE)` modifier and a subsequent `require` statement to check if the caller has the `MINTER_ROLE` role. This redundancy might lead to inconsistencies and potentially introduce confusion in understanding the code's intended behavior.\n- Redundant checks can lead to maintenance challenges, overlooked vulnerabilities, and code that is harder to understand. Additionally, it might increase the risk of mistakenly modifying one instance of the check without updating the other, introducing vulnerabilities due to inconsistencies.\n- Create a single point of access control verification and apply it consistently across all relevant functions.\n
\nB. Possibility of Exceeding Available Collateral in `lockCollateral` Function\nThe `lockCollateral` function within the ERC4626 Vault contract does not include a mechanism to prevent the locking of collateral exceeding the total available collateral. This can potentially lead to situations where more collateral is locked than what is present in the contract.\nThe `lockCollateral` function, as provided in the code snippet, allows for the locking of a specified `amount` of collateral. However, the function does not contain any explicit checks to ensure that the cumulative `_activeCollateral` doe", "vulnerable_code": "function mint(address to, uint256 expiry, uint256 rdpxAmount) external onlyRole(MINTER_ROLE) {\n _whenNotPaused();\n require(hasRole(MINTER_ROLE, msg.sender), \"Caller is not a minter\");\n uint256 bondId = _mintToken(to);\n bonds[bondId] = Bond(to, expiry, rdpxAmount);\n emit BondMinted(to, bondId, expiry, rdpxAmount);\n}", "fixed_code": "function lockCollateral(uint256 amount) public onlyPerpVault {\n require(_activeCollateral + amount <= totalCollateral(), \"Insufficient available collateral\");\n _activeCollateral += amount;\n}\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/Daniel526-Q.md", "collected_at": "2026-01-02T18:24:33.518577+00:00", "source_hash": "09c994939032531ee68289589f0a4643796e0468fc697904679dd6273907b315", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 331, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function mint(address to, uint256 expiry, uint256 rdpxAmount) external onlyRole(MINTER_ROLE) {\n _whenNotPaused();\n require(hasRole(MINTER_ROLE, msg.sender), \"Caller is not a minter\");\n uint256 bondId = _mintToken(to);\n bonds[bondId] = Bond(to, expiry, rdpxAmount);\n emit BondMinted(to, bondId, expiry, rdpxAmount);\n}", "primary_code_language": "solidity", "primary_code_char_count": 331, "all_code_blocks": "// Code block 1 (solidity):\nfunction mint(address to, uint256 expiry, uint256 rdpxAmount) external onlyRole(MINTER_ROLE) {\n _whenNotPaused();\n require(hasRole(MINTER_ROLE, msg.sender), \"Caller is not a minter\");\n uint256 bondId = _mintToken(to);\n bonds[bondId] = Bond(to, expiry, rdpxAmount);\n emit BondMinted(to, bondId, expiry, rdpxAmount);\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function mint(address to, uint256 expiry, uint256 rdpxAmount) external onlyRole(MINTER_ROLE) {\n _whenNotPaused();\n require(hasRole(MINTER_ROLE, msg.sender), \"Caller is not a minter\");\n uint256 bondId = _mintToken(to);\n bonds[bondId] = Bond(to, expiry, rdpxAmount);\n emit BondMinted(to, bondId, expiry, rdpxAmount);\n}", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function mint(address to, uint256 expiry, uint256 rdpxAmount) external onlyRole(MINTER_ROLE) {\n _whenNotPaused();\n require(hasRole(MINTER_ROLE, msg.sender), \"Caller is not a minter\");\n uint256 bondId = _mintToken(to);\n bonds[bondId] = Bond(to, expiry, rdpxAmount);\n emit BondMinted(to, bondId, expiry, rdpxAmount);\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function lockCollateral(uint256 amount) public onlyPerpVault {\n require(_activeCollateral + amount <= totalCollateral(), \"Insufficient available collateral\");\n _activeCollateral += amount;\n}\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "03-asymmetry", "title": "Madalad G", "severity_raw": "Medium", "severity": "medium", "description": "# Gas Optimizations Summary\n| |Issue|Instances|\n|:-:|:-|:-:|\n|[G-01]|Functions guaranteed to revert when called by normal users can be marked `payable`|14|\n|[G-02]|Use assembly to calculate hashes|6|\n|[G-03]|Do not compare boolean expressions to boolean literals|2|\n|[G-04]|Division/Multiplication by 2 should use bit shifting|1|\n|[G-05]|Use `indexed` to save gas|6|\n|[G-06]|Use `unchecked` for operations that cannot overflow/underflow|7|\n|[G-07]|Use `private` rather than `public` for constants|11|\n|[G-08]|Change `public` functions to `external`|8|\n|[G-09]|Use named return values|15|\n\nTotal issues: 9\n\nTotal instances: 70\n\n \n# Gas Optimizations\n## [G-01] Functions guaranteed to revert when called by normal users can be marked `payable`\n\nIf a function modifier such as `onlyOwner` is used, the function will revert if a normal user tries to pay the function. Marking the function as payable will lower the gas cost for legitimate callers because the compiler will not include checks for whether a payment was provided.\n\nThe extra opcodes avoided are CALLVALUE(2), DUP1(3), ISZERO(3), PUSH2(3), JUMPI(10), PUSH1(3), DUP1(3), REVERT(0), JUMPDEST(1), POP(2), which costs an average of about 21 gas per call to the function, in addition to the extra deployment cost (2400 per instance).\n\nInstances: 14\n```solidity\nFile: contracts/SafEth/derivatives/Reth.sol\n\n58: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n\n107: function withdraw(uint256 amount) external onlyOwner {\n\n```\n- [contracts/SafEth/derivatives/Reth.sol#L58](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L58)\n- [contracts/SafEth/derivatives/Reth.sol#L107](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L107)\n\n```solidity\nFile: contracts/SafEth/derivatives/WstEth.sol\n\n48: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n\n56: function withdraw(uint256 _amount) external onlyOwner {\n", "vulnerable_code": "File: contracts/SafEth/derivatives/Reth.sol\n\n58: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n\n107: function withdraw(uint256 amount) external onlyOwner {\n", "fixed_code": "File: contracts/SafEth/derivatives/WstEth.sol\n\n48: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n\n56: function withdraw(uint256 _amount) external onlyOwner {\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Madalad-G.md", "collected_at": "2026-01-02T18:18:18.450744+00:00", "source_hash": "09ee2d9f612aee8aad707ea368d2984ce005440ffa73c1991420a43c83c51632", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 181, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/SafEth/derivatives/Reth.sol\n\n58: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n\n107: function withdraw(uint256 amount) external onlyOwner {", "primary_code_language": "solidity", "primary_code_char_count": 181, "all_code_blocks": "// Code block 1 (solidity):\nFile: contracts/SafEth/derivatives/Reth.sol\n\n58: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n\n107: function withdraw(uint256 amount) external onlyOwner {", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: contracts/SafEth/derivatives/Reth.sol\n\n58: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n\n107: function withdraw(uint256 amount) external onlyOwner {", "github_refs_formatted": "Reth.sol#L58, Reth.sol#L107", "github_files_list": "Reth.sol", "github_refs_count": 2, "vulnerable_code_actual": "File: contracts/SafEth/derivatives/Reth.sol\n\n58: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n\n107: function withdraw(uint256 amount) external onlyOwner {\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/SafEth/derivatives/WstEth.sol\n\n48: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n\n56: function withdraw(uint256 _amount) external onlyOwner {\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ethos", "title": "MiniGlome G", "severity_raw": "High", "severity": "high", "description": "## Gas Optimizations\n| |Issue|Instances|\n|-|:-|:-:|\n| [GAS-01] | Use custom errors rather than `revert()`/`require()` strings | 96 | \n| [GAS-02] | Don't Initialize Variables with Default Value | 27 | \n| [GAS-03] | Long Revert String | 36 | \n| [GAS-04] | Use Shift Right/Left instead of Division/Multiplication if possible | 2 | \n| [GAS-05] | `++i`/`i++` Should Be `unchecked{++i}`/`unchecked{i++}` When It Is Not Possible For Them To Overflow | 17 | \n| [GAS-06] | Splitting `require()` statements that use `&&` saves gas | 2 | \n| [GAS-07] | Superfluous event fields | 1 | \n| [GAS-08] | Setting the `constructor` to `payable` | 6 | \n| [GAS-09] | Usage of uint/int smaller than 32 bytes | 5 | \n| [GAS-10] | Use `<`/`>` instead of `>=`/`>=` | 3 | \n| [GAS-11] | Using fixed bytes is cheaper than using `string` | 18 | \n| [GAS-12] | ` += ` Costs More Gas Than ` = + ` For State Variables | 9 | \n### [GAS-01] Use custom errors rather than `revert()`/`require()` strings\nCustom errors are available from solidity version 0.8.4. Custom errors save [~50 gas](https://gist.github.com/IllIllI000/ad1bd0d29a0101b25e57c293b4b0c746) each time they're hit by [avoiding having to allocate and store the revert string](https://blog.soliditylang.org/2021/04/21/custom-errors/#errors-in-depth). Not defining the strings also save deployment gas.\n\n*Instances (96)*:\n```solidity\nFile: Ethos\\ActivePool.sol\n85: require(!addressesSet, \"Can call setAddresses only once\");\n\n93: require(_treasuryAddress != address(0), \"Treasury cannot be 0 address\");\n\n107: require(numCollaterals == _erc4626vaults.length, \"Vaults array length must match number of collaterals\");\n\n111: require(IERC4626(vault).asset() == collateral, \"Vault asset must be collateral\");\n\n127: require(_bps <= 10_000, \"Invalid BPS value\");\n\n133: require(_driftBps <= 500, \"Exceeds max allowed value of 500 BPS\");\n\n145: require(_treasurySplit + _SPSplit + _stakingSplit == 10_000, \"Splits must ", "vulnerable_code": "File: Ethos\\ActivePool.sol\n85: require(!addressesSet, \"Can call setAddresses only once\");\n\n93: require(_treasuryAddress != address(0), \"Treasury cannot be 0 address\");\n\n107: require(numCollaterals == _erc4626vaults.length, \"Vaults array length must match number of collaterals\");\n\n111: require(IERC4626(vault).asset() == collateral, \"Vault asset must be collateral\");\n\n127: require(_bps <= 10_000, \"Invalid BPS value\");\n\n133: require(_driftBps <= 500, \"Exceeds max allowed value of 500 BPS\");\n\n145: require(_treasurySplit + _SPSplit + _stakingSplit == 10_000, \"Splits must add up to 10000 BPS\");\n\n314: require(\n ICollateralConfig(collateralConfigAddress).isCollateralAllowed(_collateral),\n \"Invalid collateral address\"\n );\n\n321: require(\n msg.sender == borrowerOperationsAddress ||\n msg.sender == defaultPoolAddress,\n \"ActivePool: Caller is neither BO nor Default Pool\");\n\n329: require(\n msg.sender == borrowerOperationsAddress ||\n msg.sender == troveManagerAddress ||\n msg.sender == redemptionHelper ||\n msg.sender == stabilityPoolAddress,\n \"ActivePool: Caller is neither BorrowerOperations nor TroveManager nor StabilityPool\");\n\n338: require(\n msg.sender == borrowerOperationsAddress ||\n msg.sender == troveManagerAddress,\n \"ActivePool: Caller is neither BorrowerOperations nor TroveManager\");\n", "fixed_code": "File: Ethos\\BorrowerOperations.sol\n525: require(collateralConfig.isCollateralAllowed(_collateral), \"BorrowerOps: Invalid collateral address\");\n\n529: require(IERC20(_collateral).balanceOf(_user) >= _collAmount, \"BorrowerOperations: Insufficient user collateral balance\");\n\n530: require(IERC20(_collateral).allowance(_user, address(this)) >= _collAmount, \"BorrowerOperations: Insufficient collateral allowance\");\n\n534: require(_collTopUp == 0 || _collWithdrawal == 0, \"BorrowerOperations: Cannot withdraw and add coll\");\n\n538: require(_collTopUp != 0 || _collWithdrawal != 0 || _LUSDChange != 0, \"BorrowerOps: There must be either a collateral change or a debt change\");\n\n543: require(status == 1, \"BorrowerOps: Trove does not exist or is closed\");\n\n548: require(status != 1, \"BorrowerOps: Trove is active\");\n\n552: require(_LUSDChange > 0, \"BorrowerOps: Debt increase requires non-zero debtChange\");\n\n561: require(\n !_checkRecoveryMode(_collateral, _price, _CCR, _collateralDecimals),\n \"BorrowerOps: Operation not permitted during Recovery Mode\"\n );\n\n568: require(_collWithdrawal == 0, \"BorrowerOps: Collateral withdrawal not permitted Recovery Mode\");\n\n617: require(_newICR >= _MCR, \"BorrowerOps: An operation that would result in ICR < MCR is not permitted\");\n\n621: require(_newICR >= _CCR, \"BorrowerOps: Operation must leave trove with ICR >= CCR\");\n\n625: require(_newICR >= _oldICR, \"BorrowerOps: Cannot decrease your Trove's ICR in Recovery Mode\");\n\n629: require(_newTCR >= _CCR, \"BorrowerOps: An operation that would result in TCR < CCR is not permitted\");\n\n633: require (_netDebt >= MIN_NET_DEBT, \"BorrowerOps: Trove's net debt must be greater than minimum\");\n\n637: require(_debtRepayment <= _currentDebt.sub(LUSD_GAS_COMPENSATION), \"BorrowerOps: Amount repaid must not be larger than the Trove's debt\");\n\n641: require(msg.sender == stabilityPoolA", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/MiniGlome-G.md", "collected_at": "2026-01-02T18:16:21.602719+00:00", "source_hash": "0a10b3865a2082eb8d5476752ebfd486d821b3bd96e9d45bf7a2da8407298d94", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: Ethos\\ActivePool.sol\n85: require(!addressesSet, \"Can call setAddresses only once\");\n\n93: require(_treasuryAddress != address(0), \"Treasury cannot be 0 address\");\n\n107: require(numCollaterals == _erc4626vaults.length, \"Vaults array length must match number of collaterals\");\n\n111: require(IERC4626(vault).asset() == collateral, \"Vault asset must be collateral\");\n\n127: require(_bps <= 10_000, \"Invalid BPS value\");\n\n133: require(_driftBps <= 500, \"Exceeds max allowed value of 500 BPS\");\n\n145: require(_treasurySplit + _SPSplit + _stakingSplit == 10_000, \"Splits must add up to 10000 BPS\");\n\n314: require(\n ICollateralConfig(collateralConfigAddress).isCollateralAllowed(_collateral),\n \"Invalid collateral address\"\n );\n\n321: require(\n msg.sender == borrowerOperationsAddress ||\n msg.sender == defaultPoolAddress,\n \"ActivePool: Caller is neither BO nor Default Pool\");\n\n329: require(\n msg.sender == borrowerOperationsAddress ||\n msg.sender == troveManagerAddress ||\n msg.sender == redemptionHelper ||\n msg.sender == stabilityPoolAddress,\n \"ActivePool: Caller is neither BorrowerOperations nor TroveManager nor StabilityPool\");\n\n338: require(\n msg.sender == borrowerOperationsAddress ||\n msg.sender == troveManagerAddress,\n \"ActivePool: Caller is neither BorrowerOperations nor TroveManager\");\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: Ethos\\BorrowerOperations.sol\n525: require(collateralConfig.isCollateralAllowed(_collateral), \"BorrowerOps: Invalid collateral address\");\n\n529: require(IERC20(_collateral).balanceOf(_user) >= _collAmount, \"BorrowerOperations: Insufficient user collateral balance\");\n\n530: require(IERC20(_collateral).allowance(_user, address(this)) >= _collAmount, \"BorrowerOperations: Insufficient collateral allowance\");\n\n534: require(_collTopUp == 0 || _collWithdrawal == 0, \"BorrowerOperations: Cannot withdraw and add coll\");\n\n538: require(_collTopUp != 0 || _collWithdrawal != 0 || _LUSDChange != 0, \"BorrowerOps: There must be either a collateral change or a debt change\");\n\n543: require(status == 1, \"BorrowerOps: Trove does not exist or is closed\");\n\n548: require(status != 1, \"BorrowerOps: Trove is active\");\n\n552: require(_LUSDChange > 0, \"BorrowerOps: Debt increase requires non-zero debtChange\");\n\n561: require(\n !_checkRecoveryMode(_collateral, _price, _CCR, _collateralDecimals),\n \"BorrowerOps: Operation not permitted during Recovery Mode\"\n );\n\n568: require(_collWithdrawal == 0, \"BorrowerOps: Collateral withdrawal not permitted Recovery Mode\");\n\n617: require(_newICR >= _MCR, \"BorrowerOps: An operation that would result in ICR < MCR is not permitted\");\n\n621: require(_newICR >= _CCR, \"BorrowerOps: Operation must leave trove with ICR >= CCR\");\n\n625: require(_newICR >= _oldICR, \"BorrowerOps: Cannot decrease your Trove's ICR in Recovery Mode\");\n\n629: require(_newTCR >= _CCR, \"BorrowerOps: An operation that would result in TCR < CCR is not permitted\");\n\n633: require (_netDebt >= MIN_NET_DEBT, \"BorrowerOps: Trove's net debt must be greater than minimum\");\n\n637: require(_debtRepayment <= _currentDebt.sub(LUSD_GAS_COMPENSATION), \"BorrowerOps: Amount repaid must not be larger than the Trove's debt\");\n\n641: require(msg.sender == stabilityPoolA", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "09-ondo", "title": "0xweb3boy Q", "severity_raw": "Unknown", "severity": "unknown", "description": "NC-01 : incorrect naming of local variable in unwrap() in rUSDY.sol\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDY.sol#L451\n\n```solidity\n\nfunction unwrap(uint256 _rUSDYAmount) external whenNotPaused {\n require(_rUSDYAmount > 0, \"rUSDY: can't unwrap zero rUSDY tokens\");\n uint256 usdyAmount = getSharesByRUSDY(_rUSDYAmount);\n if (usdyAmount < BPS_DENOMINATOR) revert UnwrapTooSmall();\n _burnShares(msg.sender, usdyAmount);\n usdy.transfer(msg.sender, usdyAmount / BPS_DENOMINATOR);\n emit TokensBurnt(msg.sender, _rUSDYAmount);\n }\n```\n\nThis function is basically unwrapping rUSDYAmount and burning the amount of equivalent rUSDY but in\n```\nuint256 usdyAmount = getSharesByRUSDY(_rUSDYAmount);\n```\n\nhere while calculating `getSharesByRUSDY(_rUSDYAmount)` it is being stored in `usdyAmount` instead the correct name should be `rUSDYAmount` since the amount to be burned is in `rUSDY` and not `usdy`\n", "vulnerable_code": "function unwrap(uint256 _rUSDYAmount) external whenNotPaused {\n require(_rUSDYAmount > 0, \"rUSDY: can't unwrap zero rUSDY tokens\");\n uint256 usdyAmount = getSharesByRUSDY(_rUSDYAmount);\n if (usdyAmount < BPS_DENOMINATOR) revert UnwrapTooSmall();\n _burnShares(msg.sender, usdyAmount);\n usdy.transfer(msg.sender, usdyAmount / BPS_DENOMINATOR);\n emit TokensBurnt(msg.sender, _rUSDYAmount);\n }", "fixed_code": "uint256 usdyAmount = getSharesByRUSDY(_rUSDYAmount);", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/0xweb3boy-Q.md", "collected_at": "2026-01-02T18:25:19.665053+00:00", "source_hash": "0a2bd9ee3426bcfd1e9ad9072427a61aaf9d86812f98d479361d772b93534dbf", "code_block_count": 2, "solidity_block_count": 1, "total_code_chars": 460, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function unwrap(uint256 _rUSDYAmount) external whenNotPaused {\n require(_rUSDYAmount > 0, \"rUSDY: can't unwrap zero rUSDY tokens\");\n uint256 usdyAmount = getSharesByRUSDY(_rUSDYAmount);\n if (usdyAmount < BPS_DENOMINATOR) revert UnwrapTooSmall();\n _burnShares(msg.sender, usdyAmount);\n usdy.transfer(msg.sender, usdyAmount / BPS_DENOMINATOR);\n emit TokensBurnt(msg.sender, _rUSDYAmount);\n }", "primary_code_language": "solidity", "primary_code_char_count": 408, "all_code_blocks": "// Code block 1 (solidity):\nfunction unwrap(uint256 _rUSDYAmount) external whenNotPaused {\n require(_rUSDYAmount > 0, \"rUSDY: can't unwrap zero rUSDY tokens\");\n uint256 usdyAmount = getSharesByRUSDY(_rUSDYAmount);\n if (usdyAmount < BPS_DENOMINATOR) revert UnwrapTooSmall();\n _burnShares(msg.sender, usdyAmount);\n usdy.transfer(msg.sender, usdyAmount / BPS_DENOMINATOR);\n emit TokensBurnt(msg.sender, _rUSDYAmount);\n }\n\n// Code block 2 (unknown):\nuint256 usdyAmount = getSharesByRUSDY(_rUSDYAmount);", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function unwrap(uint256 _rUSDYAmount) external whenNotPaused {\n require(_rUSDYAmount > 0, \"rUSDY: can't unwrap zero rUSDY tokens\");\n uint256 usdyAmount = getSharesByRUSDY(_rUSDYAmount);\n if (usdyAmount < BPS_DENOMINATOR) revert UnwrapTooSmall();\n _burnShares(msg.sender, usdyAmount);\n usdy.transfer(msg.sender, usdyAmount / BPS_DENOMINATOR);\n emit TokensBurnt(msg.sender, _rUSDYAmount);\n }", "github_refs_formatted": "rUSDY.sol#L451", "github_files_list": "rUSDY.sol", "github_refs_count": 1, "vulnerable_code_actual": "function unwrap(uint256 _rUSDYAmount) external whenNotPaused {\n require(_rUSDYAmount > 0, \"rUSDY: can't unwrap zero rUSDY tokens\");\n uint256 usdyAmount = getSharesByRUSDY(_rUSDYAmount);\n if (usdyAmount < BPS_DENOMINATOR) revert UnwrapTooSmall();\n _burnShares(msg.sender, usdyAmount);\n usdy.transfer(msg.sender, usdyAmount / BPS_DENOMINATOR);\n emit TokensBurnt(msg.sender, _rUSDYAmount);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "uint256 usdyAmount = getSharesByRUSDY(_rUSDYAmount);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6.88} {"source": "c4", "protocol": "02-ethos", "title": "Rickard G", "severity_raw": "High", "severity": "high", "description": "# [G-01] `bytes constant` are more efficient than `string constant`\n\n## Lines of code\n[https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol#L30](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol#L30) \n[https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L21](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L21) \n[https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L32-L34](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L32-L34) \n[https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/StabilityPool.sol#L150](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/StabilityPool.sol#L150) \n[https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LQTY/CommunityIssuance.sol#L19](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LQTY/CommunityIssuance.sol#L19) \n[https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LQTY/LQTYStaking.sol#L23](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LQTY/LQTYStaking.sol#L23)\n## Vulnerability details\nIf data can fit into 32 bytes, then you should use bytes32 datatype rather than bytes or strings as it is cheaper in solidity. \n[https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol#L30](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol#L30)\n````solidity\n\tstring constant public NAME = \"ActivePool\";\n````\n[https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L21](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L21) \n````solidity\n\tstring constant public NAME = \"BorrowerOperati", "vulnerable_code": "\tstring constant public NAME = \"ActivePool\";", "fixed_code": "\tstring constant public NAME = \"BorrowerOperations\";", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/Rickard-G.md", "collected_at": "2026-01-02T18:16:34.170005+00:00", "source_hash": "0a4174576e5594b0f99787d78a127984402bdf440cd61a7f9085919d0a2eefd1", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 43, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "string constant public NAME = \"ActivePool\";", "primary_code_language": "solidity", "primary_code_char_count": 43, "all_code_blocks": "// Code block 1 (solidity):\nstring constant public NAME = \"ActivePool\";", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "string constant public NAME = \"ActivePool\";", "github_refs_formatted": "ActivePool.sol#L30, BorrowerOperations.sol#L21, LUSDToken.sol#L32-L34, StabilityPool.sol#L150, CommunityIssuance.sol#L19, LQTYStaking.sol#L23", "github_files_list": "StabilityPool.sol, BorrowerOperations.sol, LQTYStaking.sol, LUSDToken.sol, ActivePool.sol, CommunityIssuance.sol", "github_refs_count": 6, "vulnerable_code_actual": "\tstring constant public NAME = \"ActivePool\";", "has_vulnerable_code_snippet": true, "fixed_code_actual": "\tstring constant public NAME = \"BorrowerOperations\";", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-asymmetry", "title": "dingo2077 Q", "severity_raw": "Low", "severity": "low", "description": "## [L-01] Users can't stake and unstake if owner added derivative contract with inappropriate interface.\nSC: SafEth.sol\n\nThe core of lack is lying in function `addDerivative()` where any address can be added as vault.\nIf in new vault has not implemented IDerivative interface or even uncorrect realization of functions - user's can't stake or stake their funds. Also there is no function to delete derivative contract.\n![](https://i.imgur.com/YUZkIb1.png)\n \n## Proof of Concept\nFoundry test:\n`forge test --fork-url mainnet -vvv`\n```solidity\npragma solidity ^0.8.13;\n\nimport \"forge-std/Test.sol\";\nimport \"../../src/SafEth/SafEth.sol\";\nimport \"../../src/SafEth/derivatives/Reth.sol\";\nimport \"../../src/SafEth/derivatives/SfrxEth.sol\";\nimport \"../../src/SafEth/derivatives/WstEth.sol\";\nimport \"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\";\n\n\ncontract SafEthAudit is Test {\n\n SafEth public safEthSC;\n SafEth public SafEthProxy;\n ERC1967Proxy public safERC1967ProxySC;\n\n Reth public rethEthSC;\n Reth public RethProxy;\n ERC1967Proxy public rethERC1967ProxySC;\n\n SfrxEth public SfrxEthSC;\n SfrxEth public SfrxEthProxy;\n ERC1967Proxy public sfrxEthERC1967ProxySC;\n\n WstEth public WstEthSC;\n WstEth public WstEthProxy;\n ERC1967Proxy public wstEthERC1967ProxySC;\n\n address eoa = vm.addr(123);\n address user1 = vm.addr(12347);\n address attacker = vm.addr(1234);\n \n\n function setUp() public {\n\n vm.deal(eoa, 100 ether);\n vm.deal(user1, 100 ether);\n vm.deal(attacker, 100000 ether);\n\n vm.startPrank(eoa);\n //SafEthProxy and SafETH deploy;\n safEthSC = new SafEth();\n safERC1967ProxySC = new ERC1967Proxy(address(safEthSC),abi.encodeWithSelector(\n safEthSC.initialize.selector,\n \"TokenName\",\n \"TSBL\"\n ));\n\n SafEthProxy = SafEth(payable(address(safERC1967ProxySC)));\n\n //RethProxy and Reth deploy;\n rethEthSC = n", "vulnerable_code": "pragma solidity ^0.8.13;\n\nimport \"forge-std/Test.sol\";\nimport \"../../src/SafEth/SafEth.sol\";\nimport \"../../src/SafEth/derivatives/Reth.sol\";\nimport \"../../src/SafEth/derivatives/SfrxEth.sol\";\nimport \"../../src/SafEth/derivatives/WstEth.sol\";\nimport \"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\";\n\n\ncontract SafEthAudit is Test {\n\n SafEth public safEthSC;\n SafEth public SafEthProxy;\n ERC1967Proxy public safERC1967ProxySC;\n\n Reth public rethEthSC;\n Reth public RethProxy;\n ERC1967Proxy public rethERC1967ProxySC;\n\n SfrxEth public SfrxEthSC;\n SfrxEth public SfrxEthProxy;\n ERC1967Proxy public sfrxEthERC1967ProxySC;\n\n WstEth public WstEthSC;\n WstEth public WstEthProxy;\n ERC1967Proxy public wstEthERC1967ProxySC;\n\n address eoa = vm.addr(123);\n address user1 = vm.addr(12347);\n address attacker = vm.addr(1234);\n \n\n function setUp() public {\n\n vm.deal(eoa, 100 ether);\n vm.deal(user1, 100 ether);\n vm.deal(attacker, 100000 ether);\n\n vm.startPrank(eoa);\n //SafEthProxy and SafETH deploy;\n safEthSC = new SafEth();\n safERC1967ProxySC = new ERC1967Proxy(address(safEthSC),abi.encodeWithSelector(\n safEthSC.initialize.selector,\n \"TokenName\",\n \"TSBL\"\n ));\n\n SafEthProxy = SafEth(payable(address(safERC1967ProxySC)));\n\n //RethProxy and Reth deploy;\n rethEthSC = new Reth();\n rethERC1967ProxySC = new ERC1967Proxy(address(rethEthSC),abi.encodeWithSelector(\n rethEthSC.initialize.selector,address(SafEthProxy)));\n\n RethProxy = Reth(payable(address(rethERC1967ProxySC)));\n\n //SfrxEthProxy and SfrxEth deploy;\n SfrxEthSC = new SfrxEth();\n sfrxEthERC1967ProxySC = new ERC1967Proxy(address(SfrxEthSC),abi.encodeWithSelector(\n SfrxEthSC.initialize.selector,address(SafEthProxy)));\n\n SfrxEthProxy = SfrxEth(payable(address(sfrxEthER", "fixed_code": "uint256 maxSlip = 1e16;\n\n function testFuzz_Slippage(uint256 ethDep) public {\n vm.assume(ethDep > 1 ether && ethDep < 200 ether);\n console.log(\"ethDep: \",ethDep);\n console.log(\"maxSlip: \",maxSlip);\n uint256 minOutSC = (ethDep * (10 ** 18 - maxSlip)) / 10 ** 18;\n uint256 minOutReal = ethDep - 1e16 * ethDep / 1e18;\n uint256 actualSlippage = ethDep - minOutSC;\n \n console.log(\"Slippace calculated in current SC: \",1e16);\n console.log(\"Slippace calculated appropriatly w/o roundring: \",actualSlippage);\n \n assertEq(1e16,actualSlippage);\n \n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/dingo2077-Q.md", "collected_at": "2026-01-02T18:19:05.247902+00:00", "source_hash": "0a4b7bd35dabfb7b87225f30c10a58585c046f33824eacfa289ea6cbc5b44238", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "pragma solidity ^0.8.13;\n\nimport \"forge-std/Test.sol\";\nimport \"../../src/SafEth/SafEth.sol\";\nimport \"../../src/SafEth/derivatives/Reth.sol\";\nimport \"../../src/SafEth/derivatives/SfrxEth.sol\";\nimport \"../../src/SafEth/derivatives/WstEth.sol\";\nimport \"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\";\n\n\ncontract SafEthAudit is Test {\n\n SafEth public safEthSC;\n SafEth public SafEthProxy;\n ERC1967Proxy public safERC1967ProxySC;\n\n Reth public rethEthSC;\n Reth public RethProxy;\n ERC1967Proxy public rethERC1967ProxySC;\n\n SfrxEth public SfrxEthSC;\n SfrxEth public SfrxEthProxy;\n ERC1967Proxy public sfrxEthERC1967ProxySC;\n\n WstEth public WstEthSC;\n WstEth public WstEthProxy;\n ERC1967Proxy public wstEthERC1967ProxySC;\n\n address eoa = vm.addr(123);\n address user1 = vm.addr(12347);\n address attacker = vm.addr(1234);\n \n\n function setUp() public {\n\n vm.deal(eoa, 100 ether);\n vm.deal(user1, 100 ether);\n vm.deal(attacker, 100000 ether);\n\n vm.startPrank(eoa);\n //SafEthProxy and SafETH deploy;\n safEthSC = new SafEth();\n safERC1967ProxySC = new ERC1967Proxy(address(safEthSC),abi.encodeWithSelector(\n safEthSC.initialize.selector,\n \"TokenName\",\n \"TSBL\"\n ));\n\n SafEthProxy = SafEth(payable(address(safERC1967ProxySC)));\n\n //RethProxy and Reth deploy;\n rethEthSC = new Reth();\n rethERC1967ProxySC = new ERC1967Proxy(address(rethEthSC),abi.encodeWithSelector(\n rethEthSC.initialize.selector,address(SafEthProxy)));\n\n RethProxy = Reth(payable(address(rethERC1967ProxySC)));\n\n //SfrxEthProxy and SfrxEth deploy;\n SfrxEthSC = new SfrxEth();\n sfrxEthERC1967ProxySC = new ERC1967Proxy(address(SfrxEthSC),abi.encodeWithSelector(\n SfrxEthSC.initialize.selector,address(SafEthProxy)));\n\n SfrxEthProxy = SfrxEth(payable(address(sfrxEthER", "has_vulnerable_code_snippet": true, "fixed_code_actual": "uint256 maxSlip = 1e16;\n\n function testFuzz_Slippage(uint256 ethDep) public {\n vm.assume(ethDep > 1 ether && ethDep < 200 ether);\n console.log(\"ethDep: \",ethDep);\n console.log(\"maxSlip: \",maxSlip);\n uint256 minOutSC = (ethDep * (10 ** 18 - maxSlip)) / 10 ** 18;\n uint256 minOutReal = ethDep - 1e16 * ethDep / 1e18;\n uint256 actualSlippage = ethDep - minOutSC;\n \n console.log(\"Slippace calculated in current SC: \",1e16);\n console.log(\"Slippace calculated appropriatly w/o roundring: \",actualSlippage);\n \n assertEq(1e16,actualSlippage);\n \n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "09-ondo", "title": "0x11singh99 G", "severity_raw": "High", "severity": "high", "description": "## Gas Optimizations\n| Number |Issue|Instances|\n|-|:-|:-:|\n| [[G-01](#g-01-structs-can-be-packed-into-fewer-storage-slots)] | `Structs` can be packed into fewer storage slots. | 1 | \n| [[G-02](#g-02-abiencode-is-less-efficient-than-abiencodepacked-to-save-gas)] | `abi.encode()` is less efficient than `abi.encodePacked()` to save gas. | 3 | \n| [[G-03](#g-03-use-calldata-instead-of-memory-for-function-arguments-that-do-not-get-mutated)] | Use `calldata` instead of `memory` for function arguments that do not get mutated. | 3 |\n| [[G-04](#g-04-no-need-to-explicitly-initialize-variables-with-default-values)] | No need to explicitly initialize variables with `default` values. | 8 |\n| [[G-05](#g-05-using-ternary-operator-instead-of-if-else-saves-gas)] | Using `ternary` operator instead of `if-else` saves gas | 1 |\n| [[G-06](#g-06-use-hardcode-address-instead-addressthis)] | Use `hardcode address` instead `address(this)` | 2 |\n| [[G-07](#g-07-change-constant-to-immutable-for-keccak-variables-20-gas-per-keccak)] | Change `Constant` to `Immutable` for keccak Variables (20 gas per keccak) | 7 |\n\nTotal 7 issues.\n\n## [G-01] Structs can be packed into fewer storage slots.\n\nThe EVM works with 32 byte words. Variables less than 32 bytes can be declared next to each other in storage and this will pack the values together into a single 32 byte storage slot (if values combined are <= 32 bytes). If the variables packed together are retrieved together in functions (more likely with structs), we will effectively save ~2000 gas with every subsequent SLOAD for that storage slot. This is due to us incurring a Gwarmaccess (100 gas) versus a Gcoldsload (2100 gas).\n\n**_1 Instance - 1 File_**\n\n### Reduce uint type for `start`,`end` and `dailyInterestRate` and pack them into 1 storage slot to save 2 SLOT (~4000 Gas) \n\nThese `start`,`end` can be reduced to `uint64` because they are holding timestamps and `uint64` is more than enough to hold timestamps.\n\n`dailyInterestRate` are holding *%* valu", "vulnerable_code": "File : contracts/rwaOracles/RWADynamicOracle.sol\n\n295: struct Range {\n296: uint256 start;\n297: uint256 end;\n298: uint256 dailyInterestRate;\n299: uint256 prevRangeClosePrice;\n300: }", "fixed_code": "## [G-02] abi.encode() is less efficient than abi.encodePacked() to save gas.\n\nIn Solidity, abi.encode() and abi.encodePacked() are used to encode function arguments and data into a byte array for storage or transmission. However, abi.encodePacked() is generally more gas-efficient than abi.encode() because it does not add padding to the encoded data.\nWhen using abi.encode(), the function arguments are encoded with padding to ensure that the encoded data is a multiple of 32 bytes. This padding can add unnecessary zeros to the encoded data, which can increase the size and gas cost of the transaction.\nOn the other hand, abi.encodePacked() does not add padding to the encoded data and returns a tightly packed representation of the input data. This can reduce the size and gas cost of the transaction, as it avoids unnecessary padding.\n\n**_3 Instances - 2 Files_**\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/0x11singh99-G.md", "collected_at": "2026-01-02T18:25:11.221480+00:00", "source_hash": "0a4c447bc469cf0d6ebfebaa2faf3d17972dbf2a6f5c443ca154ddd584070f9b", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File : contracts/rwaOracles/RWADynamicOracle.sol\n\n295: struct Range {\n296: uint256 start;\n297: uint256 end;\n298: uint256 dailyInterestRate;\n299: uint256 prevRangeClosePrice;\n300: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## [G-02] abi.encode() is less efficient than abi.encodePacked() to save gas.\n\nIn Solidity, abi.encode() and abi.encodePacked() are used to encode function arguments and data into a byte array for storage or transmission. However, abi.encodePacked() is generally more gas-efficient than abi.encode() because it does not add padding to the encoded data.\nWhen using abi.encode(), the function arguments are encoded with padding to ensure that the encoded data is a multiple of 32 bytes. This padding can add unnecessary zeros to the encoded data, which can increase the size and gas cost of the transaction.\nOn the other hand, abi.encodePacked() does not add padding to the encoded data and returns a tightly packed representation of the input data. This can reduce the size and gas cost of the transaction, as it avoids unnecessary padding.\n\n**_3 Instances - 2 Files_**\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "06-lybra", "title": "0xAnah G", "severity_raw": "High", "severity": "high", "description": "# **GAS OPTIMIZATIONS**\n\n## [G-01] Unused Imports\nThe following files were imported but were not used. These files would costs gas during deployment and is a bad coding practice .\n\n\n- https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/LybraWbETHVault.sol#L5\n- https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/LybraWbETHVault.sol#L7\n- https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/LybraWstETHVault.sol#L5\n- https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/LybraWstETHVault.sol#L7\n- https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/LybraRETHVault.sol#L5\n- https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/LybraRETHVault.solL7\n- https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/LybraStETHVault.sol#5\n\n\n## [G-02] Use bit shifting for multiplication by 2\n\n- https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L130\n\n\n## [G-03] Sort Solidity operations using short-circuit mode\nShort-circuiting is a solidity contract development model that uses OR/AND logic to sequence different cost operations. It puts low gas cost operations in the front and high gas cost operations in the back, so that if the front is low If the cost operation is feasible, you can skip (short-circuit) the subsequent high-cost Ethereum virtual machine operation.\n\n//f(x) is a low gas cost operation \n//g(y) is a high gas cost operation \n\n//Sort operations with different gas costs as follows \nf(x) || g(y) \nf(x) && g(y)\n\nThe following instances could be restructured to use short-circuit mode\n- https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/token/PeUSD.sol#L46\n- https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/token/LBR.sol#L64\n- https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/token/PeUSDMainnetStableVision.sol#L199\n-", "vulnerable_code": "function mint(address onBehalfOf, uint256 amount) external virtual {\n require(onBehalfOf != address(0), \"TZA\");\n require(amount > 0, \"ZA\");\n _mintPeUSD(msg.sender, onBehalfOf, amount, getAssetPrice());\n}", "fixed_code": "function mint(address onBehalfOf, uint256 amount) external virtual {\n require(amount > 0, \"ZA\");\n require(onBehalfOf != address(0), \"TZA\");\n _mintPeUSD(msg.sender, onBehalfOf, amount, getAssetPrice());\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/0xAnah-G.md", "collected_at": "2026-01-02T18:22:00.668916+00:00", "source_hash": "0a80a8ceac6f2a8eda1b9c3e04f38a89cf6bc156128c92f5a67e2862127cf3f9", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 11, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LybraWbETHVault.sol#L5, LybraWbETHVault.sol#L7, LybraWstETHVault.sol#L5, LybraWstETHVault.sol#L7, LybraRETHVault.sol#L5, LybraRETHVault.sol, LybraStETHVault.sol, LybraPeUSDVaultBase.sol#L130, PeUSD.sol#L46, LBR.sol#L64, PeUSDMainnetStableVision.sol#L199", "github_files_list": "LybraWstETHVault.sol, LybraRETHVault.sol, PeUSDMainnetStableVision.sol, LybraStETHVault.sol, LybraWbETHVault.sol, PeUSD.sol, LBR.sol, LybraPeUSDVaultBase.sol", "github_refs_count": 11, "vulnerable_code_actual": "function mint(address onBehalfOf, uint256 amount) external virtual {\n require(onBehalfOf != address(0), \"TZA\");\n require(amount > 0, \"ZA\");\n _mintPeUSD(msg.sender, onBehalfOf, amount, getAssetPrice());\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function mint(address onBehalfOf, uint256 amount) external virtual {\n require(amount > 0, \"ZA\");\n require(onBehalfOf != address(0), \"TZA\");\n _mintPeUSD(msg.sender, onBehalfOf, amount, getAssetPrice());\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "03-asymmetry", "title": "Kaysoft Q", "severity_raw": "Critical", "severity": "critical", "description": "## [NC-1] Import declarations should import specific identifiers, rather than the whole file\nUsing import declarations of the form `import {} from \"My/Contract.sol\"` avoids polluting the symbol namespace making flattened files smaller, and speeds up compilation. Avoid import declarations of the form `import \"My/Contract.sol;`.\nFiles: All files.\n\nConsider using named imports\n\nFiles: All files.\n\n## [NC-2] INCOMPLETE NATSPEC COMMENTS\nThe NatSpec comments on the does not include the input field. Consider adding the amount argument to Natspec definition.\nFiles:\n- [contracts/SafEth/derivatives/Reth.sol#L105](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/Reth.sol#L105)\n- [contracts/SafEth/derivatives/WstEth.sol#L86](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/WstEth.sol#L86)\n- [contracts/SafEth/derivatives/WstEth.sol#L56](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/WstEth.sol#L56)\n\n```\n/**\n @notice - Convert derivative into ETH\n */\n function withdraw(uint256 amount) external onlyOwner {\n RocketTokenRETHInterface(rethAddress()).burn(amount);\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n }\n\n /**\n @notice - Get price of derivative in terms of ETH\n */\n function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n uint256 frxAmount = IsFrxEth(SFRX_ETH_ADDRESS).convertToAssets(\n 10 ** 18\n );\n return ((10 ** 18 * frxAmount) /\n IFrxEthEthPool(FRX_ETH_CRV_POOL_ADDRESS).price_oracle());\n }\n\n```\n\n## [NC-3] USE LATEST SOLIDITY PRAGMA VERSION\nConsider using Solidity latest stable pragma version 0.", "vulnerable_code": "/**\n @notice - Convert derivative into ETH\n */\n function withdraw(uint256 amount) external onlyOwner {\n RocketTokenRETHInterface(rethAddress()).burn(amount);\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n }\n\n /**\n @notice - Get price of derivative in terms of ETH\n */\n function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n uint256 frxAmount = IsFrxEth(SFRX_ETH_ADDRESS).convertToAssets(\n 10 ** 18\n );\n return ((10 ** 18 * frxAmount) /\n IFrxEthEthPool(FRX_ETH_CRV_POOL_ADDRESS).price_oracle());\n }\n", "fixed_code": "pragma solidity 0.8.19;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Kaysoft-Q.md", "collected_at": "2026-01-02T18:18:14.791411+00:00", "source_hash": "0ab50fdc7f0df8d7c08adc1351db839f83395dac9728bcd3d6848cfb97701690", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 749, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "/**\n @notice - Convert derivative into ETH\n */\n function withdraw(uint256 amount) external onlyOwner {\n RocketTokenRETHInterface(rethAddress()).burn(amount);\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n }\n\n /**\n @notice - Get price of derivative in terms of ETH\n */\n function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n uint256 frxAmount = IsFrxEth(SFRX_ETH_ADDRESS).convertToAssets(\n 10 ** 18\n );\n return ((10 ** 18 * frxAmount) /\n IFrxEthEthPool(FRX_ETH_CRV_POOL_ADDRESS).price_oracle());\n }", "primary_code_language": "unknown", "primary_code_char_count": 749, "all_code_blocks": "// Code block 1 (unknown):\n/**\n @notice - Convert derivative into ETH\n */\n function withdraw(uint256 amount) external onlyOwner {\n RocketTokenRETHInterface(rethAddress()).burn(amount);\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n }\n\n /**\n @notice - Get price of derivative in terms of ETH\n */\n function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n uint256 frxAmount = IsFrxEth(SFRX_ETH_ADDRESS).convertToAssets(\n 10 ** 18\n );\n return ((10 ** 18 * frxAmount) /\n IFrxEthEthPool(FRX_ETH_CRV_POOL_ADDRESS).price_oracle());\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Reth.sol#L105, WstEth.sol#L86, WstEth.sol#L56", "github_files_list": "Reth.sol, WstEth.sol", "github_refs_count": 3, "vulnerable_code_actual": "/**\n @notice - Convert derivative into ETH\n */\n function withdraw(uint256 amount) external onlyOwner {\n RocketTokenRETHInterface(rethAddress()).burn(amount);\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n }\n\n /**\n @notice - Get price of derivative in terms of ETH\n */\n function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n uint256 frxAmount = IsFrxEth(SFRX_ETH_ADDRESS).convertToAssets(\n 10 ** 18\n );\n return ((10 ** 18 * frxAmount) /\n IFrxEthEthPool(FRX_ETH_CRV_POOL_ADDRESS).price_oracle());\n }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "pragma solidity 0.8.19;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ethos", "title": "TheSavageTeddy G", "severity_raw": "Low", "severity": "low", "description": "# Using bitwise-not `~` instead of `-(i+1)` saves gas\nCalculating `-(i+1)` instead of `~` costs **9 more gas**, because of the extra `ADD` , `SUB` and `PUSH`s that can be replaced by `NOT` to achieve the same result.\n\n`startIdx = uint(-(_startIdx + 1));` => `startIdx = uint(~_startIdx);`\n\n*There is 1 instance of this issue:*\n```solidity\nFile: MultiTroveGetter.sol\n44: startIdx = uint(-(_startIdx + 1));\n```\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/MultiTroveGetter.sol#L44\n\n# Check `Require()` / `Revert()` statements that use less gas first\nChecks that cost less gas, such as checking function parameters, should be placed before more expensive checks such as ones that invoke `msg.sender`, because the function will be able to revert before checking more expensive statements. In this case, `require(msg.sender == vault, \"Only vault can withdraw\");` should be placed after the other `require()` statements which use less gas, to prevent wasting around **24680 gas**.\n\n*There is 1 instance of this issue:*\n```solidity\nFile: ReaperBaseStrategyv4.sol\n95: function withdraw(uint256 _amount) external override returns (uint256 loss) {\n96: require(msg.sender == vault, \"Only vault can withdraw\");\n97: require(_amount != 0, \"Amount cannot be zero\");\n98: require(_amount <= balanceOf(), \"Ammount must be less than balance\");\n```\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/abstract/ReaperBaseStrategyv4.sol#L95-L98\n\n# Expressions for constant values such as calling `KECCAK256()` should use `immutable` rather than `constant`\nConstant values for function calls result in increased gas costs as `immutable`s are evaluated at deployment time, in contrast to `constants` which are executed at runtime for each invocation.\n\n*There are 8 instances of this issue:*\n```solidity\nFile: ReaperVaultV2.sol\n73: bytes32 public constant DEPOSITOR = keccak256(\"DEPOSITOR\");\n74: bytes32 public constant STR", "vulnerable_code": "File: MultiTroveGetter.sol\n44: startIdx = uint(-(_startIdx + 1));", "fixed_code": "File: ReaperBaseStrategyv4.sol\n95: function withdraw(uint256 _amount) external override returns (uint256 loss) {\n96: require(msg.sender == vault, \"Only vault can withdraw\");\n97: require(_amount != 0, \"Amount cannot be zero\");\n98: require(_amount <= balanceOf(), \"Ammount must be less than balance\");", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/TheSavageTeddy-G.md", "collected_at": "2026-01-02T18:16:40.509385+00:00", "source_hash": "0ac58e381b984cb15446cda6b4c6bf3978398ac2da4862667067f7063aabf1c7", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 404, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: MultiTroveGetter.sol\n44: startIdx = uint(-(_startIdx + 1));", "primary_code_language": "solidity", "primary_code_char_count": 77, "all_code_blocks": "// Code block 1 (solidity):\nFile: MultiTroveGetter.sol\n44: startIdx = uint(-(_startIdx + 1));\n\n// Code block 2 (solidity):\nFile: ReaperBaseStrategyv4.sol\n95: function withdraw(uint256 _amount) external override returns (uint256 loss) {\n96: require(msg.sender == vault, \"Only vault can withdraw\");\n97: require(_amount != 0, \"Amount cannot be zero\");\n98: require(_amount <= balanceOf(), \"Ammount must be less than balance\");", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: MultiTroveGetter.sol\n44: startIdx = uint(-(_startIdx + 1));\n\nFile: ReaperBaseStrategyv4.sol\n95: function withdraw(uint256 _amount) external override returns (uint256 loss) {\n96: require(msg.sender == vault, \"Only vault can withdraw\");\n97: require(_amount != 0, \"Amount cannot be zero\");\n98: require(_amount <= balanceOf(), \"Ammount must be less than balance\");", "github_refs_formatted": "MultiTroveGetter.sol#L44, ReaperBaseStrategyv4.sol#L95-L98", "github_files_list": "ReaperBaseStrategyv4.sol, MultiTroveGetter.sol", "github_refs_count": 2, "vulnerable_code_actual": "File: MultiTroveGetter.sol\n44: startIdx = uint(-(_startIdx + 1));", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: ReaperBaseStrategyv4.sol\n95: function withdraw(uint256 _amount) external override returns (uint256 loss) {\n96: require(msg.sender == vault, \"Only vault can withdraw\");\n97: require(_amount != 0, \"Amount cannot be zero\");\n98: require(_amount <= balanceOf(), \"Ammount must be less than balance\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "09-ondo", "title": "ABAIKUNANBAEV Q", "severity_raw": "Low", "severity": "low", "description": "## Finding Summary \n\n| ID | Description | Severity |\n| - | - | :-: |\n| [L-01](#l-01-unnecessary-abundance-of-roles) | Unnecessary abundance of roles in `rUSDY.sol` | Low |\n| [L-02](#l-02-unchecked-return-data-when-implementing-multiexcall) | Unchecked return data when implementing multiexcall in `SourceBridge.sol` | Low |\n\n## [L-01] Unnecessary abundance of roles in `rUSDY.sol` \n\nIn `rUSDY.sol` contract, there are plenty of roles used to impement access control system but they are not actually needed as it's the one address that is granted all these roles.\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDY.sol#L141-146\n```\n_grantRole(DEFAULT_ADMIN_ROLE, guardian);\n _grantRole(USDY_MANAGER_ROLE, guardian);\n _grantRole(PAUSER_ROLE, guardian);\n _grantRole(MINTER_ROLE, guardian);\n _grantRole(BURNER_ROLE, guardian);\n _grantRole(LIST_CONFIGURER_ROLE, guardian);\n```\n\nThis can create additional difficulties when looking at different functions (especially for auditors) as most of them will have different roles.\n\n### Recommendation\n\nDelegate all this roles to `DEFAULT_ADMIN_ROLE`.\n\n## [L-02] Unchecked return data when implementing multiexcall in `SourceBridge.sol` \n\nWhen implementing the call using `call()` opcode it's important to check the size of the return data as it's copied to memory. And if it's too big payload returned from `target`, the usage of memory can become expensive and even lead to DoS:\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/SourceBridge.sol#L165-169\n```\n (bool success, bytes memory ret) = address(exCallData[i].target).call{\n value: exCallData[i].value\n }(exCallData[i].data);\n require(success, \"Call Failed\");\n results[i] = ret;\n\n```\n\n### Recommendation\n\nCheck the return data using assembly.", "vulnerable_code": "_grantRole(DEFAULT_ADMIN_ROLE, guardian);\n _grantRole(USDY_MANAGER_ROLE, guardian);\n _grantRole(PAUSER_ROLE, guardian);\n _grantRole(MINTER_ROLE, guardian);\n _grantRole(BURNER_ROLE, guardian);\n _grantRole(LIST_CONFIGURER_ROLE, guardian);", "fixed_code": " (bool success, bytes memory ret) = address(exCallData[i].target).call{\n value: exCallData[i].value\n }(exCallData[i].data);\n require(success, \"Call Failed\");\n results[i] = ret;\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/ABAIKUNANBAEV-Q.md", "collected_at": "2026-01-02T18:25:21.921321+00:00", "source_hash": "0adbf7873c4379ae3b950fc144958cd6e43284451f313f73879a872642c0b683", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 448, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "_grantRole(DEFAULT_ADMIN_ROLE, guardian);\n _grantRole(USDY_MANAGER_ROLE, guardian);\n _grantRole(PAUSER_ROLE, guardian);\n _grantRole(MINTER_ROLE, guardian);\n _grantRole(BURNER_ROLE, guardian);\n _grantRole(LIST_CONFIGURER_ROLE, guardian);", "primary_code_language": "unknown", "primary_code_char_count": 251, "all_code_blocks": "// Code block 1 (unknown):\n_grantRole(DEFAULT_ADMIN_ROLE, guardian);\n _grantRole(USDY_MANAGER_ROLE, guardian);\n _grantRole(PAUSER_ROLE, guardian);\n _grantRole(MINTER_ROLE, guardian);\n _grantRole(BURNER_ROLE, guardian);\n _grantRole(LIST_CONFIGURER_ROLE, guardian);\n\n// Code block 2 (unknown):\n(bool success, bytes memory ret) = address(exCallData[i].target).call{\n value: exCallData[i].value\n }(exCallData[i].data);\n require(success, \"Call Failed\");\n results[i] = ret;", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "rUSDY.sol#L141-L146, SourceBridge.sol#L165-L169", "github_files_list": "rUSDY.sol, SourceBridge.sol", "github_refs_count": 2, "vulnerable_code_actual": "_grantRole(DEFAULT_ADMIN_ROLE, guardian);\n _grantRole(USDY_MANAGER_ROLE, guardian);\n _grantRole(PAUSER_ROLE, guardian);\n _grantRole(MINTER_ROLE, guardian);\n _grantRole(BURNER_ROLE, guardian);\n _grantRole(LIST_CONFIGURER_ROLE, guardian);", "has_vulnerable_code_snippet": true, "fixed_code_actual": " (bool success, bytes memory ret) = address(exCallData[i].target).call{\n value: exCallData[i].value\n }(exCallData[i].data);\n require(success, \"Call Failed\");\n results[i] = ret;\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "02-ethos", "title": "eyexploit Q", "severity_raw": "Critical", "severity": "critical", "description": "# Finding 1 : Risk of updating CR via `updateCollateralRatios()` can be minimized \n\nhttps://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/CollateralConfig.sol#L78-L100\n\nThere might be a scenario where you want to lower the `MCR` but keeping the `CCR` unchanged for a collateral or vice-versa. But when doing it through `updateCollateralRatios` where we only want to update the `MCR`, we risk the updating of the `CCR` accidentally also. \n\nAnd as it says \n```\n // !!!PLEASE USE EXTREME CARE AND CAUTION. THIS IS IRREVERSIBLE!!!\n\n // You probably don't want to do this unless a specific asset has proved itself through tough times.\n // Doing this irresponsibly can permanently harm the protocol.\n```\n\n**Recommendation**\nThis risk can be minimize by splitting the `udpateCollateralRatios` into two different function,\n\n```solidity\n function updateMinimumCollateralRatio(address _collateral, uint256 _MCR) external onlyOwner checkCollateral(_collateral) {\n Config storage config = collateralConfig[_collateral];\n require(_MCR <= config.MCR, \"Can only walk down the MCR\");\n\n require(_MCR >= MIN_ALLOWED_MCR, \"MCR below allowed minimum\");\n config.MCR = _MCR;\n\n emit CollateralRatiosUpdated(_collateral, _MCR, config.CCR);\n }\n\n function updateCriticalCollateralRatio(address _collateral, uint256 _CCR) external onlyOwner checkCollateral(_collateral) {\n Config storage config = collateralConfig[_collateral];\n require(_CCR <= config.CCR, \"Can only walk down the CCR\");\n\n require(_CCR >= MIN_ALLOWED_CCR, \"CCR below allowed minimum\");\n config.CCR = _CCR;\n emit CollateralRatiosUpdated(_collateral, config.MCR, _CCR);\n }\n```\n\n# Finding 2 : Wrong error message return when validating `_feeBPS`\nhttps://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Vault/contracts/ReaperVaultV2.sol#L155\nhttps://github.com/code-423n4/", "vulnerable_code": " // !!!PLEASE USE EXTREME CARE AND CAUTION. THIS IS IRREVERSIBLE!!!\n\n // You probably don't want to do this unless a specific asset has proved itself through tough times.\n // Doing this irresponsibly can permanently harm the protocol.", "fixed_code": " function updateMinimumCollateralRatio(address _collateral, uint256 _MCR) external onlyOwner checkCollateral(_collateral) {\n Config storage config = collateralConfig[_collateral];\n require(_MCR <= config.MCR, \"Can only walk down the MCR\");\n\n require(_MCR >= MIN_ALLOWED_MCR, \"MCR below allowed minimum\");\n config.MCR = _MCR;\n\n emit CollateralRatiosUpdated(_collateral, _MCR, config.CCR);\n }\n\n function updateCriticalCollateralRatio(address _collateral, uint256 _CCR) external onlyOwner checkCollateral(_collateral) {\n Config storage config = collateralConfig[_collateral];\n require(_CCR <= config.CCR, \"Can only walk down the CCR\");\n\n require(_CCR >= MIN_ALLOWED_CCR, \"CCR below allowed minimum\");\n config.CCR = _CCR;\n emit CollateralRatiosUpdated(_collateral, config.MCR, _CCR);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/eyexploit-Q.md", "collected_at": "2026-01-02T18:17:10.069509+00:00", "source_hash": "0b37d3bd3415e1243adc06c9b872504d3a1b4a305a818fb109dba6bb2c972998", "code_block_count": 2, "solidity_block_count": 1, "total_code_chars": 1101, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "// !!!PLEASE USE EXTREME CARE AND CAUTION. THIS IS IRREVERSIBLE!!!\n\n // You probably don't want to do this unless a specific asset has proved itself through tough times.\n // Doing this irresponsibly can permanently harm the protocol.", "primary_code_language": "unknown", "primary_code_char_count": 241, "all_code_blocks": "// Code block 1 (unknown):\n// !!!PLEASE USE EXTREME CARE AND CAUTION. THIS IS IRREVERSIBLE!!!\n\n // You probably don't want to do this unless a specific asset has proved itself through tough times.\n // Doing this irresponsibly can permanently harm the protocol.\n\n// Code block 2 (solidity):\nfunction updateMinimumCollateralRatio(address _collateral, uint256 _MCR) external onlyOwner checkCollateral(_collateral) {\n Config storage config = collateralConfig[_collateral];\n require(_MCR <= config.MCR, \"Can only walk down the MCR\");\n\n require(_MCR >= MIN_ALLOWED_MCR, \"MCR below allowed minimum\");\n config.MCR = _MCR;\n\n emit CollateralRatiosUpdated(_collateral, _MCR, config.CCR);\n }\n\n function updateCriticalCollateralRatio(address _collateral, uint256 _CCR) external onlyOwner checkCollateral(_collateral) {\n Config storage config = collateralConfig[_collateral];\n require(_CCR <= config.CCR, \"Can only walk down the CCR\");\n\n require(_CCR >= MIN_ALLOWED_CCR, \"CCR below allowed minimum\");\n config.CCR = _CCR;\n emit CollateralRatiosUpdated(_collateral, config.MCR, _CCR);\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function updateMinimumCollateralRatio(address _collateral, uint256 _MCR) external onlyOwner checkCollateral(_collateral) {\n Config storage config = collateralConfig[_collateral];\n require(_MCR <= config.MCR, \"Can only walk down the MCR\");\n\n require(_MCR >= MIN_ALLOWED_MCR, \"MCR below allowed minimum\");\n config.MCR = _MCR;\n\n emit CollateralRatiosUpdated(_collateral, _MCR, config.CCR);\n }\n\n function updateCriticalCollateralRatio(address _collateral, uint256 _CCR) external onlyOwner checkCollateral(_collateral) {\n Config storage config = collateralConfig[_collateral];\n require(_CCR <= config.CCR, \"Can only walk down the CCR\");\n\n require(_CCR >= MIN_ALLOWED_CCR, \"CCR below allowed minimum\");\n config.CCR = _CCR;\n emit CollateralRatiosUpdated(_collateral, config.MCR, _CCR);\n }", "github_refs_formatted": "CollateralConfig.sol#L78-L100, ReaperVaultV2.sol#L155", "github_files_list": "CollateralConfig.sol, ReaperVaultV2.sol", "github_refs_count": 2, "vulnerable_code_actual": " // !!!PLEASE USE EXTREME CARE AND CAUTION. THIS IS IRREVERSIBLE!!!\n\n // You probably don't want to do this unless a specific asset has proved itself through tough times.\n // Doing this irresponsibly can permanently harm the protocol.", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function updateMinimumCollateralRatio(address _collateral, uint256 _MCR) external onlyOwner checkCollateral(_collateral) {\n Config storage config = collateralConfig[_collateral];\n require(_MCR <= config.MCR, \"Can only walk down the MCR\");\n\n require(_MCR >= MIN_ALLOWED_MCR, \"MCR below allowed minimum\");\n config.MCR = _MCR;\n\n emit CollateralRatiosUpdated(_collateral, _MCR, config.CCR);\n }\n\n function updateCriticalCollateralRatio(address _collateral, uint256 _CCR) external onlyOwner checkCollateral(_collateral) {\n Config storage config = collateralConfig[_collateral];\n require(_CCR <= config.CCR, \"Can only walk down the CCR\");\n\n require(_CCR >= MIN_ALLOWED_CCR, \"CCR below allowed minimum\");\n config.CCR = _CCR;\n emit CollateralRatiosUpdated(_collateral, config.MCR, _CCR);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "06-lybra", "title": "Iurii3 Q", "severity_raw": "High", "severity": "high", "description": "1. During initiation of tokens in LybraConfiguration.sol wrong interface is used\n\n[LybraConfigurator.solL100](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/configuration/LybraConfigurator.sol#L100C1-L100C65)\n\nShould use IPeUSD instead of IEUSD. However, this mistake won't escalate into bigger error as IEUSD interface has all necessary functions\n\nCorrect line of code: ``` if (address(peUSD) == address(0)) peUSD = IPeUSD(_peusd); ```\n\n2. setTokenMiner function may revert due to array length discrepancies \n\n[LybraConfigurator.solL235-240](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/configuration/LybraConfigurator.sol#L235C1-L240C6)\n\nsetTokenMiner function has two arguments - array of _contracts and array of _bools. In case their length is not equal function will revert while using extensive amount of gas in a for loop.\nAdding ```require(_contracts.length == _bools.length, \"Length of contracts not equal to bools\"); ``` will save gas in this situation\n\n3. Check in setLockStatus might be done wrongly \n\n[esLBRBoost.solL41](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/esLBRBoost.sol#L42)\n\nConsidering Lybra Fincance allow users to extend the time of lock-up, this require statement is not correctly implemented.\n\nFor example\n* user's current LockStatus is (unlockTime = +7 days from now; duration = 90 days, miningBoost = 30 * 1e18) \n* user want to change in to (unlockTime = +30 days from now; duration = 30 days, miningBoost = 20 * 1e18)\n* his lock-up time will increase from 7 to 30 days, but it is currently not allowed as overall duration will be lowered.\n\nTeam should consider rewriting requirement to\n``` require(userStatus.unlockTime <= block.timestamp + _setting.duration, \"Your lock-in period has not ended, and the term can only be extended, not reduced.\"); ```\n\n4. Vaults would be almost im", "vulnerable_code": "2. setTokenMiner function may revert due to array length discrepancies \n\n[LybraConfigurator.solL235-240](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/configuration/LybraConfigurator.sol#L235C1-L240C6)\n\nsetTokenMiner function has two arguments - array of _contracts and array of _bools. In case their length is not equal function will revert while using extensive amount of gas in a for loop.\nAdding ```require(_contracts.length == _bools.length, \"Length of contracts not equal to bools\"); ``` will save gas in this situation\n\n3. Check in setLockStatus might be done wrongly \n\n[esLBRBoost.solL41](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/esLBRBoost.sol#L42)\n\nConsidering Lybra Fincance allow users to extend the time of lock-up, this require statement is not correctly implemented.\n\nFor example\n* user's current LockStatus is (unlockTime = +7 days from now; duration = 90 days, miningBoost = 30 * 1e18) \n* user want to change in to (unlockTime = +30 days from now; duration = 30 days, miningBoost = 20 * 1e18)\n* his lock-up time will increase from 7 to 30 days, but it is currently not allowed as overall duration will be lowered.\n\nTeam should consider rewriting requirement to", "fixed_code": "4. Vaults would be almost impossible to use with assets with decimals < 18.\n\n[LybraEUSDVaultBase.solL73](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/pools/base/LybraEUSDVaultBase.sol#L73-L73)\n[LybraPeUSDVaultBase.solL59](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L59-L59)\n\nCurrently Lybra Vaults may be used with 18-decimal LSD assets - stETH, wstETH, rETH, wbETH. \n\nAs it stated in Lybra docs \"_Collateral is any asset that a borrower must provide to take out a loan, acting as security for the debt._\" \nShould there appear LSD asset with lower decimals, or if team decides to add 6-decimal USDC/USDT as a possible collateral this requirement ``` require(assetAmount >= 1 ether, \"\") ``` would be passed only with much bigger amount then anticipated. For 6 decimal assets user would need to deposit 1_000_000_000_000 token to pass this requirement\n\nTeam might consider adding mapping with assets decimals (address => uint) or move this requirement from base abstract contract to higher level contract for particular asset\n\n5. Check before transfer would save gas cost in case of revert\n[LybraEUSDVaultBase.solL109](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/pools/base/LybraEUSDVaultBase.sol#L109-L109)\n\n6. Wrong notation. Should use collateral asset instead of stETH\n[LybraPeUSDVaultBase.solL80](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L80-L80)\n[LybraPeUSDVaultBase.solL123](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L123-L123)\n[LybraPeUSDVaultBase.solL149](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/pools/base/", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/Iurii3-Q.md", "collected_at": "2026-01-02T18:22:21.454464+00:00", "source_hash": "0b5d3264d2f6d377ac66be66379ec076fc3895ab612d958033142b69e7271714", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 459, "github_ref_count": 8, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "2. setTokenMiner function may revert due to array length discrepancies \n\n[LybraConfigurator.solL235-240](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/configuration/LybraConfigurator.sol#L235C1-L240C6)\n\nsetTokenMiner function has two arguments - array of _contracts and array of _bools. In case their length is not equal function will revert while using extensive amount of gas in a for loop.\nAdding", "primary_code_language": "unknown", "primary_code_char_count": 459, "all_code_blocks": "// Code block 1 (unknown):\n2. setTokenMiner function may revert due to array length discrepancies \n\n[LybraConfigurator.solL235-240](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/configuration/LybraConfigurator.sol#L235C1-L240C6)\n\nsetTokenMiner function has two arguments - array of _contracts and array of _bools. In case their length is not equal function will revert while using extensive amount of gas in a for loop.\nAdding", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LybraConfigurator.sol#L100-L1, LybraConfigurator.sol#L235-L1, esLBRBoost.sol#L42, LybraEUSDVaultBase.sol#L73, LybraPeUSDVaultBase.sol#L59, LybraEUSDVaultBase.sol#L109, LybraPeUSDVaultBase.sol#L80, LybraPeUSDVaultBase.sol#L123", "github_files_list": "esLBRBoost.sol, LybraConfigurator.sol, LybraPeUSDVaultBase.sol, LybraEUSDVaultBase.sol", "github_refs_count": 8, "vulnerable_code_actual": "2. setTokenMiner function may revert due to array length discrepancies \n\n[LybraConfigurator.solL235-240](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/configuration/LybraConfigurator.sol#L235C1-L240C6)\n\nsetTokenMiner function has two arguments - array of _contracts and array of _bools. In case their length is not equal function will revert while using extensive amount of gas in a for loop.\nAdding ```require(_contracts.length == _bools.length, \"Length of contracts not equal to bools\"); ``` will save gas in this situation\n\n3. Check in setLockStatus might be done wrongly \n\n[esLBRBoost.solL41](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/esLBRBoost.sol#L42)\n\nConsidering Lybra Fincance allow users to extend the time of lock-up, this require statement is not correctly implemented.\n\nFor example\n* user's current LockStatus is (unlockTime = +7 days from now; duration = 90 days, miningBoost = 30 * 1e18) \n* user want to change in to (unlockTime = +30 days from now; duration = 30 days, miningBoost = 20 * 1e18)\n* his lock-up time will increase from 7 to 30 days, but it is currently not allowed as overall duration will be lowered.\n\nTeam should consider rewriting requirement to", "has_vulnerable_code_snippet": true, "fixed_code_actual": "4. Vaults would be almost impossible to use with assets with decimals < 18.\n\n[LybraEUSDVaultBase.solL73](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/pools/base/LybraEUSDVaultBase.sol#L73-L73)\n[LybraPeUSDVaultBase.solL59](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L59-L59)\n\nCurrently Lybra Vaults may be used with 18-decimal LSD assets - stETH, wstETH, rETH, wbETH. \n\nAs it stated in Lybra docs \"_Collateral is any asset that a borrower must provide to take out a loan, acting as security for the debt._\" \nShould there appear LSD asset with lower decimals, or if team decides to add 6-decimal USDC/USDT as a possible collateral this requirement ``` require(assetAmount >= 1 ether, \"\") ``` would be passed only with much bigger amount then anticipated. For 6 decimal assets user would need to deposit 1_000_000_000_000 token to pass this requirement\n\nTeam might consider adding mapping with assets decimals (address => uint) or move this requirement from base abstract contract to higher level contract for particular asset\n\n5. Check before transfer would save gas cost in case of revert\n[LybraEUSDVaultBase.solL109](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/pools/base/LybraEUSDVaultBase.sol#L109-L109)\n\n6. Wrong notation. Should use collateral asset instead of stETH\n[LybraPeUSDVaultBase.solL80](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L80-L80)\n[LybraPeUSDVaultBase.solL123](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L123-L123)\n[LybraPeUSDVaultBase.solL149](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/pools/base/", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-asymmetry", "title": "0xNorman Q", "severity_raw": "High", "severity": "high", "description": "1. Lack of input validation in setPauseStaking() and setPauseUnstaking()\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L232-L244\n\nWhen using the ```setPauseStaking``` and ```setPauseUnstaking``` function, it's better to check if the input parameters are different than the global ones. So unnecessary changes will be discarded and confusing events won't be out:\n\n```\nfunction setPauseStaking(bool _pause) external onlyOwner {\n require(_pause != pauseStaking, \" pauseStaking unchanged!\");\n pauseStaking = _pause;\n emit StakingPaused(pauseStaking);\n }\n\n /**\n @notice - Owner only function that enables/disables the unstake function\n @param _pause - true disables unstaking / false enables unstaking\n */\n function setPauseUnstaking(bool _pause) external onlyOwner {\n require(_pause != pauseUnstaking, \"pauseUnstaking unchanged!\");\n pauseUnstaking = _pause;\n emit UnstakingPaused(pauseUnstaking);\n }\n\n```\n\n2. lack of validation for the existence of derivative in adjustWeight()\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L165-L175\nThe existence of derivatives should be checked before adjusting the weight, otherwise if weight is set for an unexisting derivative, will result in the wrong totalWeight and cause panic in stake(), unstake() function.\n```\nfunction adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n ) external onlyOwner {\n require(__derivativeIndex < derivativeCount, \"derivative does not exist!\")\n weights[_derivativeIndex] = _weight;\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit WeightChange(_derivativeIndex, _weight);\n }\n```\nLack of input checks on setMinAmount() and setMax", "vulnerable_code": "function setPauseStaking(bool _pause) external onlyOwner {\n require(_pause != pauseStaking, \" pauseStaking unchanged!\");\n pauseStaking = _pause;\n emit StakingPaused(pauseStaking);\n }\n\n /**\n @notice - Owner only function that enables/disables the unstake function\n @param _pause - true disables unstaking / false enables unstaking\n */\n function setPauseUnstaking(bool _pause) external onlyOwner {\n require(_pause != pauseUnstaking, \"pauseUnstaking unchanged!\");\n pauseUnstaking = _pause;\n emit UnstakingPaused(pauseUnstaking);\n }\n", "fixed_code": "function adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n ) external onlyOwner {\n require(__derivativeIndex < derivativeCount, \"derivative does not exist!\")\n weights[_derivativeIndex] = _weight;\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit WeightChange(_derivativeIndex, _weight);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/0xNorman-Q.md", "collected_at": "2026-01-02T18:17:35.498046+00:00", "source_hash": "0b88a3337a36a32f4f1234a3a0c8ba2ca47b1c03b8b14f3057cfaab7c67f3434", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 1070, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function setPauseStaking(bool _pause) external onlyOwner {\n require(_pause != pauseStaking, \" pauseStaking unchanged!\");\n pauseStaking = _pause;\n emit StakingPaused(pauseStaking);\n }\n\n /**\n @notice - Owner only function that enables/disables the unstake function\n @param _pause - true disables unstaking / false enables unstaking\n */\n function setPauseUnstaking(bool _pause) external onlyOwner {\n require(_pause != pauseUnstaking, \"pauseUnstaking unchanged!\");\n pauseUnstaking = _pause;\n emit UnstakingPaused(pauseUnstaking);\n }", "primary_code_language": "unknown", "primary_code_char_count": 599, "all_code_blocks": "// Code block 1 (unknown):\nfunction setPauseStaking(bool _pause) external onlyOwner {\n require(_pause != pauseStaking, \" pauseStaking unchanged!\");\n pauseStaking = _pause;\n emit StakingPaused(pauseStaking);\n }\n\n /**\n @notice - Owner only function that enables/disables the unstake function\n @param _pause - true disables unstaking / false enables unstaking\n */\n function setPauseUnstaking(bool _pause) external onlyOwner {\n require(_pause != pauseUnstaking, \"pauseUnstaking unchanged!\");\n pauseUnstaking = _pause;\n emit UnstakingPaused(pauseUnstaking);\n }\n\n// Code block 2 (unknown):\nfunction adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n ) external onlyOwner {\n require(__derivativeIndex < derivativeCount, \"derivative does not exist!\")\n weights[_derivativeIndex] = _weight;\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit WeightChange(_derivativeIndex, _weight);\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol#L232-L244, SafEth.sol#L165-L175", "github_files_list": "SafEth.sol", "github_refs_count": 2, "vulnerable_code_actual": "function setPauseStaking(bool _pause) external onlyOwner {\n require(_pause != pauseStaking, \" pauseStaking unchanged!\");\n pauseStaking = _pause;\n emit StakingPaused(pauseStaking);\n }\n\n /**\n @notice - Owner only function that enables/disables the unstake function\n @param _pause - true disables unstaking / false enables unstaking\n */\n function setPauseUnstaking(bool _pause) external onlyOwner {\n require(_pause != pauseUnstaking, \"pauseUnstaking unchanged!\");\n pauseUnstaking = _pause;\n emit UnstakingPaused(pauseUnstaking);\n }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n ) external onlyOwner {\n require(__derivativeIndex < derivativeCount, \"derivative does not exist!\")\n weights[_derivativeIndex] = _weight;\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit WeightChange(_derivativeIndex, _weight);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "11-kelp", "title": "rouhsamad Q", "severity_raw": "Unknown", "severity": "unknown", "description": "## rounding down error when depositing stETH tokens\nThe `transfer` function in stETH token first converts the amount that is being transferred to correct amount of shares using getSharesByPooledEth function:\n```\n function getSharesByPooledEth(uint256 _ethAmount) public view returns (uint256) {\n return _ethAmount\n .mul(_getTotalShares())\n .div(_getTotalPooledEther());\n }\n```\nthis conversion causes a rounding down error. for example, if a user deposited 1 ether of stETH into the pool, (1 ether - 1) will be received by the contract, this means both the emitted event (AssetDeposit) and calculation of rsETH to mint, are done using a wrong number.\n\nPOC:\nTests were done on ETH mainnet (forked):\n```\n function test_DepositSTETHFlooring() external {\n uint256 amountToDeposit = 1 ether;\n vm.startPrank(manager);\n lrtConfig.updateAssetDepositLimit(address(stETH), amountToDeposit);\n vm.stopPrank();\n\n vm.startPrank(alice);\n //approve the pool\n stETH.approve(address(lrtDepositPool), ~uint256(0));\n\n //wrong even emitted, contract received 1 ether - 1, not 1 ether\n vm.expectEmit(true, true, true, false);\n emit AssetDeposit(address(stETH), 1 ether, rseth.balanceOf(alice));\n lrtDepositPool.depositAsset(address(stETH), amountToDeposit);\n\n //stETH balance of contract is 1 ether - 1\n assertEq(stETH.balanceOf(address(lrtDepositPool)), 1 ether - 1);\n\n vm.stopPrank();\n }\n```\nMitigation:\nConsider calculating how much asset deposit pool actually received instead of relaying on `depositAmount`", "vulnerable_code": " function getSharesByPooledEth(uint256 _ethAmount) public view returns (uint256) {\n return _ethAmount\n .mul(_getTotalShares())\n .div(_getTotalPooledEther());\n }", "fixed_code": " function test_DepositSTETHFlooring() external {\n uint256 amountToDeposit = 1 ether;\n vm.startPrank(manager);\n lrtConfig.updateAssetDepositLimit(address(stETH), amountToDeposit);\n vm.stopPrank();\n\n vm.startPrank(alice);\n //approve the pool\n stETH.approve(address(lrtDepositPool), ~uint256(0));\n\n //wrong even emitted, contract received 1 ether - 1, not 1 ether\n vm.expectEmit(true, true, true, false);\n emit AssetDeposit(address(stETH), 1 ether, rseth.balanceOf(alice));\n lrtDepositPool.depositAsset(address(stETH), amountToDeposit);\n\n //stETH balance of contract is 1 ether - 1\n assertEq(stETH.balanceOf(address(lrtDepositPool)), 1 ether - 1);\n\n vm.stopPrank();\n }", "recommendation": "", "category": "rounding", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/rouhsamad-Q.md", "collected_at": "2026-01-02T18:28:25.123618+00:00", "source_hash": "0ba40ac3a3d3a855f63b1520999699707d458e79e167ea74e98848b92365d8cc", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 957, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function getSharesByPooledEth(uint256 _ethAmount) public view returns (uint256) {\n return _ethAmount\n .mul(_getTotalShares())\n .div(_getTotalPooledEther());\n }", "primary_code_language": "unknown", "primary_code_char_count": 191, "all_code_blocks": "// Code block 1 (unknown):\nfunction getSharesByPooledEth(uint256 _ethAmount) public view returns (uint256) {\n return _ethAmount\n .mul(_getTotalShares())\n .div(_getTotalPooledEther());\n }\n\n// Code block 2 (unknown):\nfunction test_DepositSTETHFlooring() external {\n uint256 amountToDeposit = 1 ether;\n vm.startPrank(manager);\n lrtConfig.updateAssetDepositLimit(address(stETH), amountToDeposit);\n vm.stopPrank();\n\n vm.startPrank(alice);\n //approve the pool\n stETH.approve(address(lrtDepositPool), ~uint256(0));\n\n //wrong even emitted, contract received 1 ether - 1, not 1 ether\n vm.expectEmit(true, true, true, false);\n emit AssetDeposit(address(stETH), 1 ether, rseth.balanceOf(alice));\n lrtDepositPool.depositAsset(address(stETH), amountToDeposit);\n\n //stETH balance of contract is 1 ether - 1\n assertEq(stETH.balanceOf(address(lrtDepositPool)), 1 ether - 1);\n\n vm.stopPrank();\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function getSharesByPooledEth(uint256 _ethAmount) public view returns (uint256) {\n return _ethAmount\n .mul(_getTotalShares())\n .div(_getTotalPooledEther());\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function test_DepositSTETHFlooring() external {\n uint256 amountToDeposit = 1 ether;\n vm.startPrank(manager);\n lrtConfig.updateAssetDepositLimit(address(stETH), amountToDeposit);\n vm.stopPrank();\n\n vm.startPrank(alice);\n //approve the pool\n stETH.approve(address(lrtDepositPool), ~uint256(0));\n\n //wrong even emitted, contract received 1 ether - 1, not 1 ether\n vm.expectEmit(true, true, true, false);\n emit AssetDeposit(address(stETH), 1 ether, rseth.balanceOf(alice));\n lrtDepositPool.depositAsset(address(stETH), amountToDeposit);\n\n //stETH balance of contract is 1 ether - 1\n assertEq(stETH.balanceOf(address(lrtDepositPool)), 1 ether - 1);\n\n vm.stopPrank();\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "07-amphora", "title": "qpzm Q", "severity_raw": "Medium", "severity": "medium", "description": "## Unnecessary _eta check in `GovernorCharlie._queueTransaction` \n`if (_eta < (_getBlockTimestamp() + _delay)) revert GovernorCharlie_DelayNotReached();` is not necessary.\nhttps://github.com/code-423n4/2023-07-amphora/blob/5d1cea9410db5448760c834f001af04a72edf3e0/core/solidity/contracts/governance/GovernorCharlie.sol#L297\nIt is because `_eta = block.timestamp + delay` in [`GovernorCharlie.queue`](https://github.com/code-423n4/2023-07-amphora/blob/5d1cea9410db5448760c834f001af04a72edf3e0/core/solidity/contracts/governance/GovernorCharlie.sol#L258).\n\n## Revert with the original error message in `GovernorCharlie.executeTransaction`.\nOpenzeppelin TimelockController preserves the original error message. It is more informational than `GovernorCharlie_ProposalNotSucceeded`.\n```solidity\nfunction _execute(address target, uint256 value, bytes calldata data) internal virtual {\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n Address.verifyCallResult(success, returndata);\n}\n```\nhttps://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/governance/TimelockController.sol#L412-L415\nhttps://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Address.sol#L204", "vulnerable_code": "function _execute(address target, uint256 value, bytes calldata data) internal virtual {\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n Address.verifyCallResult(success, returndata);\n}", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/qpzm-Q.md", "collected_at": "2026-01-02T18:23:59.967417+00:00", "source_hash": "0be042b80de1d8ed136d71a808af85c64f94246c05fcacf243b4a048008c526b", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 220, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _execute(address target, uint256 value, bytes calldata data) internal virtual {\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n Address.verifyCallResult(success, returndata);\n}", "primary_code_language": "solidity", "primary_code_char_count": 220, "all_code_blocks": "// Code block 1 (solidity):\nfunction _execute(address target, uint256 value, bytes calldata data) internal virtual {\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n Address.verifyCallResult(success, returndata);\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function _execute(address target, uint256 value, bytes calldata data) internal virtual {\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n Address.verifyCallResult(success, returndata);\n}", "github_refs_formatted": "GovernorCharlie.sol#L297, GovernorCharlie.sol#L258, TimelockController.sol#L412-L415, Address.sol#L204", "github_files_list": "TimelockController.sol, GovernorCharlie.sol, Address.sol", "github_refs_count": 4, "vulnerable_code_actual": "function _execute(address target, uint256 value, bytes calldata data) internal virtual {\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n Address.verifyCallResult(success, returndata);\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5.47} {"source": "c4", "protocol": "01-ondo", "title": "report", "severity_raw": "Critical", "severity": "critical", "description": "---\nsponsor: \"Ondo Finance\"\nslug: \"2023-01-ondo\"\ndate: \"2023-02-28\"\ntitle: \"Ondo Finance contest\"\nfindings: \"https://github.com/code-423n4/2023-01-ondo-findings/issues\"\ncontest: 204\n---\n\n# Overview\n\n## About C4\n\nCode4rena (C4) is an open organization consisting of security researchers, auditors, developers, and individuals with domain expertise in smart contracts.\n\nA C4 audit contest is an event in which community participants, referred to as Wardens, review, audit, or analyze smart contract logic in exchange for a bounty provided by sponsoring projects.\n\nDuring the audit contest outlined in this document, C4 conducted an analysis of the Ondo Finance smart contract system written in Solidity. The audit contest took place between January 11\u2014January 17 2023.\n\n## Wardens\n\n74 Wardens contributed reports to the Ondo Finance contest:\n\n 1. 0x1f8b\n 2. 0x52\n 3. 0x5rings\n 4. [0xAgro](https://twitter.com/0xAgro)\n 5. [0xSmartContract](https://twitter.com/0xSmartContract)\n 6. 0xcm\n 7. 0xjuicer\n 8. 0xkato\n 9. 2997ms\n 10. [AkshaySrivastav](https://twitter.com/akshaysrivastv)\n 11. [Aymen0909](https://github.com/Aymen1001)\n 12. BClabs (nalus and Reptilia)\n 13. BPZ (pa6221, Bitcoinfever244 and PrasadLak)\n 14. BRONZEDISC\n 15. Bauer\n 16. Bnke0x0\n 17. CodingNameKiki\n 18. Deekshith99\n 19. Diana\n 20. IllIllI\n 21. Josiah\n 22. [Kaysoft](https://www.linkedin.com/in/kayode-okunlade-862001142/)\n 23. RaymondFam\n 24. Rolezn\n 25. SaeedAlipoor01988\n 26. [Sathish9098](https://www.linkedin.com/in/sathishkumar-p-26069915a)\n 27. SleepingBugs ([Deivitto](https://twitter.com/Deivitto) and 0xLovesleep)\n 28. Tajobin\n 29. [Udsen](https://github.com/udsene)\n 30. Viktor\\_Cortess\n 31. [adriro](https://github.com/romeroadrian)\n 32. arialblack14\n 33. [betweenETHlines](https://twitter.com/eth_lines)\n 34. [bin2chen](https://twitter.com/bin2chen)\n 35. btk\n 36. [c3phas](https://twitter.com/c3ph_)\n 37. cccz\n 38. chaduke\n 39. chrisdior4\n 40. cryptostellar5\n 41. cryptphi\n 42. ", "vulnerable_code": "function completeRedemptions(\n address[] calldata redeemers,\n address[] calldata refundees,\n uint256 collateralAmountToDist,\n uint256 epochToService,\n uint256 fees\n) external override updateEpoch onlyRole(MANAGER_ADMIN) {\n _checkAddressesKYC(redeemers);\n _checkAddressesKYC(refundees);\n if (epochToService >= currentEpoch) {\n revert MustServicePastEpoch();\n }\n // Calculate the total quantity of shares tokens burned w/n an epoch\n uint256 refundedAmt = _processRefund(refundees, epochToService);\n uint256 quantityBurned = redemptionInfoPerEpoch[epochToService]\n .totalBurned - refundedAmt;\n uint256 amountToDist = collateralAmountToDist - fees;\n _processRedemption(redeemers, amountToDist, quantityBurned, epochToService);\n collateral.safeTransferFrom(assetSender, feeRecipient, fees);\n emit RedemptionFeesCollected(feeRecipient, fees, epochToService);\n}", "fixed_code": "uint256 collateralAmountDue = (amountToDist * cashAmountReturned) /\n quantityBurned;", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/report.md", "collected_at": "2026-01-02T18:15:39.005339+00:00", "source_hash": "0bf168c4f555402132b6f5546eacfc0c763a35e18dde694d82e42cf99d0985c7", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function completeRedemptions(\n address[] calldata redeemers,\n address[] calldata refundees,\n uint256 collateralAmountToDist,\n uint256 epochToService,\n uint256 fees\n) external override updateEpoch onlyRole(MANAGER_ADMIN) {\n _checkAddressesKYC(redeemers);\n _checkAddressesKYC(refundees);\n if (epochToService >= currentEpoch) {\n revert MustServicePastEpoch();\n }\n // Calculate the total quantity of shares tokens burned w/n an epoch\n uint256 refundedAmt = _processRefund(refundees, epochToService);\n uint256 quantityBurned = redemptionInfoPerEpoch[epochToService]\n .totalBurned - refundedAmt;\n uint256 amountToDist = collateralAmountToDist - fees;\n _processRedemption(redeemers, amountToDist, quantityBurned, epochToService);\n collateral.safeTransferFrom(assetSender, feeRecipient, fees);\n emit RedemptionFeesCollected(feeRecipient, fees, epochToService);\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "uint256 collateralAmountDue = (amountToDist * cashAmountReturned) /\n quantityBurned;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "05-ajna", "title": "lfzkoala Q", "severity_raw": "High", "severity": "high", "description": "#Issue: Missing Access Control (Minor)\nDescription of the security issue: The `fundTreasury` function does not have any access control in place. This means that any address can call this function and increase the treasury amount, which might not be the intended behavior.\n\nLocation of the security issue: ajna-grants/src/grants/GrantFund.sol#58-68\n\nHow to resolve the security issue: Implement access control for the `fundTreasury` function, such as restricting it to only the contract owner or specific authorized addresses.\n\n\n#Issue: No Constructor or Initialization Function (MInor)\nDescription of the security issue: The contract does not have a constructor or initialization function to set the initial state or configuration parameters, such as the `ajnaTokenAddress`. Without proper initialization, the contract may not function as expected.\nLocation of the security issue: ajna-grants/src/grants/GrantFund.sol\nHow to resolve the security issue: Add a constructor or an initialization function to set the initial state or configuration parameters, such as the `ajnaTokenAddress`. Ensure that proper access control is in place if using an initialization function.\n\n#Issue: IERC20 is not used\nDescription: The IERC20 is imported but not used in the contract\nLocation: ajna-core/src/PositionManager.sol\nSuggestion: Clarify whether it should be used, if not, delete it. \n\n#Issue: Lack Owner Validation\nDescription: The `memorializePositions()` function allows any address to call it, potentially causing unauthorized actions.\nLocation: ajna-core/src/PositionManager.sol#170-216\nSuggestion: One of the simplest ways to add access control is to check whether `msg.sender` is the owner of the token. The `ownerOf` function, which is standard in ERC721 contracts, can be used for this purpose. If `msg.sender` isn't the owner, the function can revert. \n\nHere's an example of how this might look like:\n\n```solidity\nfunction memorializePositions(\n MemorializePositionsParams calldata params_\n) extern", "vulnerable_code": "function memorializePositions(\n MemorializePositionsParams calldata params_\n) external override {\n address owner = ownerOf(params_.tokenId);\n\n // Check if the sender is the owner of the token\n require(msg.sender == owner, \"Not token owner\");\n\n // ... rest of your code ...\n}", "fixed_code": "import \"@openzeppelin/contracts/utils/math/SafeMath.sol\";\n\ncontract PositionManager is ERC721, PermitERC721, IPositionManager, Multicall, ReentrancyGuard {\n using SafeMath for uint256;\n ...\n function memorializePositions(MemorializePositionsParams calldata params_) external override mayInteract(poolKey[params_.tokenId], params_.tokenId) {\n ...\n for (uint256 i = 0; i < indexesLength; ) {\n ...\n // Update token position LP using SafeMath to prevent overflow\n position.lps = position.lps.add(lpBalance);\n ...\n }\n ...\n }\n}", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/lfzkoala-Q.md", "collected_at": "2026-01-02T18:21:34.685209+00:00", "source_hash": "0cacac0e53c5cb0178b341b58a26577d1469afd82a9267b9393a7585c6e2180e", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function memorializePositions(\n MemorializePositionsParams calldata params_\n) external override {\n address owner = ownerOf(params_.tokenId);\n\n // Check if the sender is the owner of the token\n require(msg.sender == owner, \"Not token owner\");\n\n // ... rest of your code ...\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "import \"@openzeppelin/contracts/utils/math/SafeMath.sol\";\n\ncontract PositionManager is ERC721, PermitERC721, IPositionManager, Multicall, ReentrancyGuard {\n using SafeMath for uint256;\n ...\n function memorializePositions(MemorializePositionsParams calldata params_) external override mayInteract(poolKey[params_.tokenId], params_.tokenId) {\n ...\n for (uint256 i = 0; i < indexesLength; ) {\n ...\n // Update token position LP using SafeMath to prevent overflow\n position.lps = position.lps.add(lpBalance);\n ...\n }\n ...\n }\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-revert-lend", "title": "browep Q", "severity_raw": "Unknown", "severity": "unknown", "description": "Multiple misspellings of \"receive\", \"receives\", \"received\".\n\n```\n$ find . -name \"*.sol\" | xargs grep -n recieve\n./src/transformers/V3Utils.sol:633: // check if recieved correct amount of tokens\n./src/V3Vault.sol:230: /// @return liquidationValue If position is liquidatable - the value of the (partial) position which the liquidator recieves - otherwise 0\n./src/V3Vault.sol:399: /// @param recipient Address to recieve the position in the vault\n./src/V3Vault.sol:407: /// @param recipient Address to recieve the position in the vault\n./src/V3Vault.sol:427: /// @notice Whenever a token is recieved it either creates a new loan, or modifies an existing one when in transform mode.\n```\n", "vulnerable_code": "$ find . -name \"*.sol\" | xargs grep -n recieve\n./src/transformers/V3Utils.sol:633: // check if recieved correct amount of tokens\n./src/V3Vault.sol:230: /// @return liquidationValue If position is liquidatable - the value of the (partial) position which the liquidator recieves - otherwise 0\n./src/V3Vault.sol:399: /// @param recipient Address to recieve the position in the vault\n./src/V3Vault.sol:407: /// @param recipient Address to recieve the position in the vault\n./src/V3Vault.sol:427: /// @notice Whenever a token is recieved it either creates a new loan, or modifies an existing one when in transform mode.", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/browep-Q.md", "collected_at": "2026-01-02T19:03:07.764894+00:00", "source_hash": "0cb89a8f61af1eaf903d1681af051055fb2ffdce5e0c3681239027af5a6d7b73", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 633, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "$ find . -name \"*.sol\" | xargs grep -n recieve\n./src/transformers/V3Utils.sol:633: // check if recieved correct amount of tokens\n./src/V3Vault.sol:230: /// @return liquidationValue If position is liquidatable - the value of the (partial) position which the liquidator recieves - otherwise 0\n./src/V3Vault.sol:399: /// @param recipient Address to recieve the position in the vault\n./src/V3Vault.sol:407: /// @param recipient Address to recieve the position in the vault\n./src/V3Vault.sol:427: /// @notice Whenever a token is recieved it either creates a new loan, or modifies an existing one when in transform mode.", "primary_code_language": "unknown", "primary_code_char_count": 633, "all_code_blocks": "// Code block 1 (unknown):\n$ find . -name \"*.sol\" | xargs grep -n recieve\n./src/transformers/V3Utils.sol:633: // check if recieved correct amount of tokens\n./src/V3Vault.sol:230: /// @return liquidationValue If position is liquidatable - the value of the (partial) position which the liquidator recieves - otherwise 0\n./src/V3Vault.sol:399: /// @param recipient Address to recieve the position in the vault\n./src/V3Vault.sol:407: /// @param recipient Address to recieve the position in the vault\n./src/V3Vault.sol:427: /// @notice Whenever a token is recieved it either creates a new loan, or modifies an existing one when in transform mode.", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "$ find . -name \"*.sol\" | xargs grep -n recieve\n./src/transformers/V3Utils.sol:633: // check if recieved correct amount of tokens\n./src/V3Vault.sol:230: /// @return liquidationValue If position is liquidatable - the value of the (partial) position which the liquidator recieves - otherwise 0\n./src/V3Vault.sol:399: /// @param recipient Address to recieve the position in the vault\n./src/V3Vault.sol:407: /// @param recipient Address to recieve the position in the vault\n./src/V3Vault.sol:427: /// @notice Whenever a token is recieved it either creates a new loan, or modifies an existing one when in transform mode.", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 3.41} {"source": "c4", "protocol": "03-asymmetry", "title": "carlitox477 Q", "severity_raw": "Medium", "severity": "medium", "description": "# wstETH: If the protocol is meant to be multichain, then WST_ETH, LIDO_CRV_POOL and STETH_TOKEN should be immutable and the constructor modified\nIn order to not change the current code every time a deployment is done, the mentioned variables should be delcared as immutable and their values set in the constructor:\n\n```diff\n contract WstEth is IDerivative, Initializable, OwnableUpgradeable {\n- address public constant WST_ETH =\n- 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0;\n+ address public immutable WST_ETH;\n- address public constant LIDO_CRV_POOL =\n- 0xDC24316b9AE028F1497c275EB9192a3Ea0f67022;\n+ address public immutable LIDO_CRV_POOL;\n- address public constant STETH_TOKEN =\n- 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84;\n+ address public immutable STETH_TOKEN;\n\n uint256 public maxSlippage;\n\n // As recommended by https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable\n /// @custom:oz-upgrades-unsafe-allow constructor\n- constructor() {\n+ constructor(address _WST_ETH, address _LIDO_CRV_POOL, address _STETH_TOKEN) {\n _disableInitializers();\n+ WST_ETH = _WST_ETH;\n+ LIDO_CRV_POOL = _LIDO_CRV_POOL;\n+ STETH_TOKEN = _STETH_TOKEN;\n }\n```\n\n# `WstEth.setMaxSlippage(uint256)`, `Reth.setMaxSlippage(uint256)` and `Sfrx.setMaxSlippage(uint256)` should limit their inputs values to `1e18`\nGiven that `1e16` is 1%, then 100% would be `1e18`. Given that the slippage should never be greater than 100%.\n\nThis would DOS function withdraw/deposit in the different contracts:\n* [wstEth](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/WstEth.sol#L60)\n* [Reth](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/Reth.sol#L173-L174)\n* [SfrxEth](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd", "vulnerable_code": "# `WstEth.setMaxSlippage(uint256)`, `Reth.setMaxSlippage(uint256)` and `Sfrx.setMaxSlippage(uint256)` should limit their inputs values to `1e18`\nGiven that `1e16` is 1%, then 100% would be `1e18`. Given that the slippage should never be greater than 100%.\n\nThis would DOS function withdraw/deposit in the different contracts:\n* [wstEth](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/WstEth.sol#L60)\n* [Reth](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/Reth.sol#L173-L174)\n* [SfrxEth](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/SfrxEth.sol#L74-L75)\n\nThis constraint must be checked.\n\n# `SafETH.stake()`: avoid totalSupply shadowing\nCurrent code creates a variable which shadows `totalSupply`. It's name should be replaced by `_totalSupply`. This means:\n", "fixed_code": "# `SafETH` Stuck ETH would be freeze forever\nCurrent `SafETH` allows receiving ETH from anyone. In case that a user/contract mistakenly sent ETH to this `SafEth` or in case that `msg.value * weight < totalWeight` in [stake](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L88) function, these funds will be freeze forever. Given that `rebalance` function takes into account the funds at the start of it calls, and the funds after converting derivatives to ETH.\n\nThere are three ways to approach this issue:\n\n## Option A: Stuck ETH belongs to the owner\nThis would mean that a `withdrawStuckETH` function should be added. Given that ETH corresponding to stake/unstake actions are immediately sent to the corresponding contract/user, this function is easy to implement\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/carlitox477-Q.md", "collected_at": "2026-01-02T18:18:54.853353+00:00", "source_hash": "0cb9339fbe5757ae9792c7e8f3f6fdb7537abd86ca1a5e857cd3c8edd26b5901", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 965, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "contract WstEth is IDerivative, Initializable, OwnableUpgradeable {\n- address public constant WST_ETH =\n- 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0;\n+ address public immutable WST_ETH;\n- address public constant LIDO_CRV_POOL =\n- 0xDC24316b9AE028F1497c275EB9192a3Ea0f67022;\n+ address public immutable LIDO_CRV_POOL;\n- address public constant STETH_TOKEN =\n- 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84;\n+ address public immutable STETH_TOKEN;\n\n uint256 public maxSlippage;\n\n // As recommended by https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable\n /// @custom:oz-upgrades-unsafe-allow constructor\n- constructor() {\n+ constructor(address _WST_ETH, address _LIDO_CRV_POOL, address _STETH_TOKEN) {\n _disableInitializers();\n+ WST_ETH = _WST_ETH;\n+ LIDO_CRV_POOL = _LIDO_CRV_POOL;\n+ STETH_TOKEN = _STETH_TOKEN;\n }", "primary_code_language": "diff", "primary_code_char_count": 965, "all_code_blocks": "// Code block 1 (diff):\ncontract WstEth is IDerivative, Initializable, OwnableUpgradeable {\n- address public constant WST_ETH =\n- 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0;\n+ address public immutable WST_ETH;\n- address public constant LIDO_CRV_POOL =\n- 0xDC24316b9AE028F1497c275EB9192a3Ea0f67022;\n+ address public immutable LIDO_CRV_POOL;\n- address public constant STETH_TOKEN =\n- 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84;\n+ address public immutable STETH_TOKEN;\n\n uint256 public maxSlippage;\n\n // As recommended by https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable\n /// @custom:oz-upgrades-unsafe-allow constructor\n- constructor() {\n+ constructor(address _WST_ETH, address _LIDO_CRV_POOL, address _STETH_TOKEN) {\n _disableInitializers();\n+ WST_ETH = _WST_ETH;\n+ LIDO_CRV_POOL = _LIDO_CRV_POOL;\n+ STETH_TOKEN = _STETH_TOKEN;\n }", "all_code_blocks_count": 1, "has_diff_blocks": true, "diff_code": "contract WstEth is IDerivative, Initializable, OwnableUpgradeable {\n- address public constant WST_ETH =\n- 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0;\n+ address public immutable WST_ETH;\n- address public constant LIDO_CRV_POOL =\n- 0xDC24316b9AE028F1497c275EB9192a3Ea0f67022;\n+ address public immutable LIDO_CRV_POOL;\n- address public constant STETH_TOKEN =\n- 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84;\n+ address public immutable STETH_TOKEN;\n\n uint256 public maxSlippage;\n\n // As recommended by https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable\n /// @custom:oz-upgrades-unsafe-allow constructor\n- constructor() {\n+ constructor(address _WST_ETH, address _LIDO_CRV_POOL, address _STETH_TOKEN) {\n _disableInitializers();\n+ WST_ETH = _WST_ETH;\n+ LIDO_CRV_POOL = _LIDO_CRV_POOL;\n+ STETH_TOKEN = _STETH_TOKEN;\n }", "solidity_code": "", "github_refs_formatted": "WstEth.sol#L60, Reth.sol#L173-L174, SfrxEth.sol#L74-L75, SafEth.sol#L88", "github_files_list": "SfrxEth.sol, Reth.sol, WstEth.sol, SafEth.sol", "github_refs_count": 4, "vulnerable_code_actual": "# `WstEth.setMaxSlippage(uint256)`, `Reth.setMaxSlippage(uint256)` and `Sfrx.setMaxSlippage(uint256)` should limit their inputs values to `1e18`\nGiven that `1e16` is 1%, then 100% would be `1e18`. Given that the slippage should never be greater than 100%.\n\nThis would DOS function withdraw/deposit in the different contracts:\n* [wstEth](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/WstEth.sol#L60)\n* [Reth](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/Reth.sol#L173-L174)\n* [SfrxEth](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/SfrxEth.sol#L74-L75)\n\nThis constraint must be checked.\n\n# `SafETH.stake()`: avoid totalSupply shadowing\nCurrent code creates a variable which shadows `totalSupply`. It's name should be replaced by `_totalSupply`. This means:\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "# `SafETH` Stuck ETH would be freeze forever\nCurrent `SafETH` allows receiving ETH from anyone. In case that a user/contract mistakenly sent ETH to this `SafEth` or in case that `msg.value * weight < totalWeight` in [stake](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L88) function, these funds will be freeze forever. Given that `rebalance` function takes into account the funds at the start of it calls, and the funds after converting derivatives to ETH.\n\nThere are three ways to approach this issue:\n\n## Option A: Stuck ETH belongs to the owner\nThis would mean that a `withdrawStuckETH` function should be added. Given that ETH corresponding to stake/unstake actions are immediately sent to the corresponding contract/user, this function is easy to implement\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "05-ajna", "title": "descharre G", "severity_raw": "High", "severity": "high", "description": "# Summary\n|ID | Finding| Gas saved | Instances|\n|:----: | :--- | :----: |:----: |\n|G-01 |Do budget check at the end of the for loop| - | 1 |\n|G-02 |Use constants instead of type(uintx).max| 20 | 1 |\n|G-03 |Remove block.number from events| 20 | 2 |\n|G-04 |Use double if statement instead of &&| 30 | 1 |\n|G-05 |Make up to 3 fields in an event indexed| 100 | - |\n\n# Details\n## [G-01] Do budget check at the end of the for loop\nThe if statement to check if the slate has exceeded the budget in [`_validateSlate()`](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L421-L454) is now in every iteration. Gas can be saved when you put it at the end of the for loop.\n[StandardFunding.sol#L421-L454](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L421-L454)\n```diff\n for (uint i = 0; i < numProposalsInSlate_; ) {\n Proposal memory proposal = _standardFundingProposals[proposalIds_[i]];\n\n // check if Proposal is in the topTenProposals list\n if (_findProposalIndex(proposalIds_[i], _topTenProposals[distributionId_]) == -1) revert InvalidProposalSlate();\n\n // account for fundingVotesReceived possibly being negative\n if (proposal.fundingVotesReceived < 0) revert InvalidProposalSlate();\n\n // update counters\n sum_ += uint128(proposal.fundingVotesReceived); // since we are converting from int128 to uint128, we can safely assume that the value will not overflow\n totalTokensRequested += proposal.tokensRequested;\n\n // check if slate of proposals exceeded budget constraint ( 90% of GBC )\n- if (totalTokensRequested > (gbc * 9 / 10)) {\n- revert InvalidProposalSlate();\n- }\n\n unchecked { ++i; }\n }\n+ if (totalTokensRequested > (gbc * 9 / 10)) {\n+ revert InvalidProposa", "vulnerable_code": "## [G-02] Use constants instead of type(uintx).max\nIt's more gas effici\u00ebnt to use a constant instead of a max from a type. The constant won't be pretty if it's a high value but it will save around 20 gas everytime the function gets called.\n\n[StandardFunding.sol#L659](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L659)", "fixed_code": "## [G-03] Remove block.number from events\nblock.number is added by default to event information. Around 300 gas can be saved if you remove block.number when emitting events.", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/descharre-G.md", "collected_at": "2026-01-02T18:21:24.906494+00:00", "source_hash": "0d232714fab676bf0839ced60279a81f0301b7925d7a18162fc2d12ccb3749e8", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "StandardFunding.sol#L421-L454, StandardFunding.sol#L659", "github_files_list": "StandardFunding.sol", "github_refs_count": 2, "vulnerable_code_actual": "## [G-02] Use constants instead of type(uintx).max\nIt's more gas effici\u00ebnt to use a constant instead of a max from a type. The constant won't be pretty if it's a high value but it will save around 20 gas everytime the function gets called.\n\n[StandardFunding.sol#L659](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L659)", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## [G-03] Remove block.number from events\nblock.number is added by default to event information. Around 300 gas can be saved if you remove block.number when emitting events.", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "11-kelp", "title": "chaduke Q", "severity_raw": "Low", "severity": "low", "description": "QA1. It might overwrite an existing key: \n\nhttps://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTConfig.sol#L156-L163\n\nMitigation:\n\n```diff\n function _setToken(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n- if (tokenMap[key] == val) {\n+ if (tokenMap[key] != address(0)) {\n\n revert ValueAlreadyInUse();\n }\n tokenMap[key] = val;\n emit SetToken(key, val);\n }\n```\n\nQA2. LRTConfigRoleChecker.lrtConfigAddr() has the danger to lose the admin for the newly set lrtConfigAddr. \n\n[https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/utils/LRTConfigRoleChecker.sol#L47-L50]\n\nThe function is only callable by the current LRTAdmin, which might not be the LRTAdmin for the newly set lrtConfigAddr. If an invalid lrtConfigAddr is set, then there is no way to correct it. \n\nMitigation: ensure that the current LRTadmin will also be the LRTAdmin for the new lrtConfigAddr. After that, one can also transfer the LRTadmin to another use using a two-step procedure. \n\n\nQA3. There is no mechanism to check whether duplicate nodeDelegatorContract is added to the array or not. \n\n[https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTDepositPool.sol#L162-L176](https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTDepositPool.sol#L162-L176)\n\nImpact: getTotalAssetDeposits() might return the wrong total value since the balance for the duplicate nodeDelegatorContract will be doubly accounted. A user might not be able to deposit asset due to falsely inflated total deposit amount.\n\nMitigation: \nIntroduce a mapping so that one can check whether we are adding a new nodeDelegatorContract or not to avoid adding duplicate. Otherwise, the limit ``maxNodeDelegatorCount`` might be wasted due to duplicates. \n\nQA4. LRTDepositPool.updateMaxNodeDelegatorCount() might decrease ", "vulnerable_code": "", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/chaduke-Q.md", "collected_at": "2026-01-02T18:27:52.888706+00:00", "source_hash": "0d3dc98c6313d97b49920774e80c3baad0796271838662dc7cf47175083e795e", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 296, "github_ref_count": 3, "vulnerable_code_is_url": true, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function _setToken(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n- if (tokenMap[key] == val) {\n+ if (tokenMap[key] != address(0)) {\n\n revert ValueAlreadyInUse();\n }\n tokenMap[key] = val;\n emit SetToken(key, val);\n }", "primary_code_language": "diff", "primary_code_char_count": 296, "all_code_blocks": "// Code block 1 (diff):\nfunction _setToken(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n- if (tokenMap[key] == val) {\n+ if (tokenMap[key] != address(0)) {\n\n revert ValueAlreadyInUse();\n }\n tokenMap[key] = val;\n emit SetToken(key, val);\n }", "all_code_blocks_count": 1, "has_diff_blocks": true, "diff_code": "function _setToken(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n- if (tokenMap[key] == val) {\n+ if (tokenMap[key] != address(0)) {\n\n revert ValueAlreadyInUse();\n }\n tokenMap[key] = val;\n emit SetToken(key, val);\n }", "solidity_code": "", "github_refs_formatted": "LRTConfig.sol#L156-L163, LRTConfigRoleChecker.sol#L47-L50, LRTDepositPool.sol#L162-L176", "github_files_list": "LRTConfig.sol, LRTDepositPool.sol, LRTConfigRoleChecker.sol", "github_refs_count": 3, "vulnerable_code_actual": "", "has_vulnerable_code_snippet": false, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 7} {"source": "c4", "protocol": "02-ethos", "title": "chrisdior4 Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA report\n\n## Low Risk\n| L-N |Issue|\n|:------:|:----|\n| [L‑01] | Single-step ownership transfer pattern is dangerous | 9 |\n| [L‑02] | Decimals() not part of ERC20 standard | 1 |\n| [L‑03] | Open TODO in the code | 2 |\n| [L‑04] | Using vulnerable dependency of OpenZeppelin | 2 |\n| [L‑05] | Usage of `ecrecover` should be replaced with usage of OpenZeppelin's ECDSA library \n\nTotal: 5 issues\n\n## Non-critical\n\n| N-N |Issue|\n|:------:|:----|\n| [N‑01] | Solidity safe pragma best practices are not used | 2 |\n| [N‑02] | NatSpecs are missing | 6 |\n| [N‑03] | Events, structs and custom errors declaration | 11 |\n| [N‑04] | Event is missing `indexed` fields | 19 |\n| [N‑05] | Typos in the comments | 31 |\n| [N‑06] | Redundant code | 2 |\n| [N‑07] | Use of magic number | 1 |\n| [N‑08] | Interchangeable usage of uint and uint256 in in `BorrowerOperations.sol` | 1 |\n| [N‑09] | Lines are too long | 1 |\n\nTotal: 9 issues\n\n## Low Risk\n\n### [L-01] Single-step ownership transfer pattern is dangerous\n\nFile: `CollateralConfig.sol`\n\nInheriting from OpenZeppelin's `Ownable` contract means you are using a single-step ownership transfer pattern. If an admin provides an incorrect address for the new owner this will result in none of the `onlyOwner` marked methods being callable again. The better way to do this is to use a two-step ownership transfer approach, where the new owner should first claim its new rights before they are transferred.\n\n```solidity\nimport \"./Dependencies/Ownable.sol\";\n```\n\nLines of code:\n\n- https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/CollateralConfig.sol#L6\n\n#### Recommendation\n\nUse OpenZeppelin's `Ownable2Step` instead of `Ownable`\n\n\n### [L-02] Decimals() not part of ERC20 standard\n\nFile: `CollateralConfig.sol`\n\n\nThe `initialize` method is looping through `_collaterals` array and fetching tokens decimals. H", "vulnerable_code": "import \"./Dependencies/Ownable.sol\";", "fixed_code": "uint256 decimals = IERC20(collateral).decimals();", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/chrisdior4-Q.md", "collected_at": "2026-01-02T18:16:57.100264+00:00", "source_hash": "0dca1dd483650c56cecf15b26615b1d927548ad21bec4be4015f46e6d3409f22", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 36, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "import \"./Dependencies/Ownable.sol\";", "primary_code_language": "solidity", "primary_code_char_count": 36, "all_code_blocks": "// Code block 1 (solidity):\nimport \"./Dependencies/Ownable.sol\";", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "import \"./Dependencies/Ownable.sol\";", "github_refs_formatted": "CollateralConfig.sol#L6", "github_files_list": "CollateralConfig.sol", "github_refs_count": 1, "vulnerable_code_actual": "import \"./Dependencies/Ownable.sol\";", "has_vulnerable_code_snippet": true, "fixed_code_actual": "uint256 decimals = IERC20(collateral).decimals();", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "09-ondo", "title": "lokacho G", "severity_raw": "Gas", "severity": "gas", "description": "# Gas Report\n\n## Summary\n\n### Gas Optimizations\n\n| | Issue | Instances |\n| --- | --- | --- |\n| [G\u201101] | preRebaseTokenAmount & postRebaseTokenAmount are same | 1 |\n\nNote: The table above as well as its gas numbers are created by considering the **automatic findings** which are not included.\n\n---\n\n## Gas Optimizations\n\n### [G\u201101]\n\nsummary: The preRebaseTokenAmount & postRebaseTokenAmount are same and its not gas efficient.\n\n*There is 1 instance of this issue:*\n\n```solidity\nuint256 preRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n```\n\n```solidity\nuint256 preRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n```\n\nLink(s):\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDY.sol#L586\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDY.sol#L592\n\nRecommended mitigation step:\nuse only one of them.", "vulnerable_code": "uint256 preRebaseTokenAmount = getRUSDYByShares(_sharesAmount);", "fixed_code": "uint256 preRebaseTokenAmount = getRUSDYByShares(_sharesAmount);", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/lokacho-G.md", "collected_at": "2026-01-02T18:26:03.231292+00:00", "source_hash": "0dcd0fc95f02565ffab7b2e7846a823f7ffafd0bbd913c3e9735bdb4fc6d29cf", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 126, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "uint256 preRebaseTokenAmount = getRUSDYByShares(_sharesAmount);", "primary_code_language": "solidity", "primary_code_char_count": 63, "all_code_blocks": "// Code block 1 (solidity):\nuint256 preRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\n// Code block 2 (solidity):\nuint256 preRebaseTokenAmount = getRUSDYByShares(_sharesAmount);", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "uint256 preRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\nuint256 preRebaseTokenAmount = getRUSDYByShares(_sharesAmount);", "github_refs_formatted": "rUSDY.sol#L586, rUSDY.sol#L592", "github_files_list": "rUSDY.sol", "github_refs_count": 2, "vulnerable_code_actual": "uint256 preRebaseTokenAmount = getRUSDYByShares(_sharesAmount);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "uint256 preRebaseTokenAmount = getRUSDYByShares(_sharesAmount);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6.71} {"source": "c4", "protocol": "07-amphora", "title": "8olidity Q", "severity_raw": "Unknown", "severity": "unknown", "description": "## The return value of AddressSet is not checked\n\nIn the EnumerableSet.AddressSet library, both success and failure of adding will have a return value. But all calls do not check the return value, even if the addition fails or the deletion fails. functions can be executed normally\n\n```solidity\nfunction add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n}\nfunction remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n}\n```\nunchecked return value\n```solidty\ncore\\solidity\\contracts\\core\\USDA.sol:\n 278 function addVaultController(address _vaultController) external onlyOwner {\n 279: _vaultControllers.add(_vaultController);\n 280 _grantRole(VAULT_CONTROLLER_ROLE, _vaultController);\n\ncore\\solidity\\contracts\\core\\USDA.sol:\n 287 function removeVaultController(address _vaultController) external onlyOwner {\n 288: _vaultControllers.remove(_vaultController);\n 289 _revokeRole(VAULT_CONTROLLER_ROLE, _vaultController);\n\n 297 function removeVaultControllerFromList(address _vaultController) external onlyOwner {\n 298: _vaultControllers.remove(_vaultController);\n 299\n```\n\nIt is recommended to check the return value of the function call", "vulnerable_code": "function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n}\nfunction remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n}", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/8olidity-Q.md", "collected_at": "2026-01-02T18:23:21.520318+00:00", "source_hash": "0dd007d576718fe2ac1e817b51d970c74c281a004a4cf5c3faa83f7eff1149ba", "code_block_count": 2, "solidity_block_count": 1, "total_code_chars": 933, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n}\nfunction remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n}", "primary_code_language": "solidity", "primary_code_char_count": 291, "all_code_blocks": "// Code block 1 (solidity):\nfunction add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n}\nfunction remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n}\n\n// Code block 2 (solidty):\ncore\\solidity\\contracts\\core\\USDA.sol:\n 278 function addVaultController(address _vaultController) external onlyOwner {\n 279: _vaultControllers.add(_vaultController);\n 280 _grantRole(VAULT_CONTROLLER_ROLE, _vaultController);\n\ncore\\solidity\\contracts\\core\\USDA.sol:\n 287 function removeVaultController(address _vaultController) external onlyOwner {\n 288: _vaultControllers.remove(_vaultController);\n 289 _revokeRole(VAULT_CONTROLLER_ROLE, _vaultController);\n\n 297 function removeVaultControllerFromList(address _vaultController) external onlyOwner {\n 298: _vaultControllers.remove(_vaultController);\n 299", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n}\nfunction remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n}", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n}\nfunction remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5.67} {"source": "c4", "protocol": "04-caviar", "title": "W0RR1O Q", "severity_raw": "Critical", "severity": "critical", "description": "## QA Report(low/non-critical)\n\n[L-01] Consider using OpenZeppelin\u2019s SafeCast library to prevent unexpected overflows when casting from uint256\n================================================================================================================\nIn the function `buy()` and `sell()` of the contract `PrivatePool.sol` the function first set the variables `netInputAmount`,`feeAmount`,`protocolFeeAmount` and `weightSum` to be of type `uint256`. However, later on in the function the value of the variables are downcasted to `uint128` and is used to update the virtual reserves.\n\n## Proof Of Concept\nThe `buy()` function in the contract `PrivatePool.sol`:\n* https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L211-#L231\n\nThe `sell()` function in the contract `PrivatePool.sol`:\n* https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L301-#L324\n\n[L-02] Use of `block.timestamp` in the contract `EthRouter.sol`\n================================================================\nIn the contract `EthRouter.sol` there are 4 instances where `block.timestamp` is used to to check whether or not a deadline has been passed. However, `block.timestamp` does not mean current time. Miners can influence the value of `blok.timestamp` to perform a Maximal Extractable Value (MEV) attack. Furthermore, miners can modify the timestamp by up to 900 seconds. \n\n## Proof Of Concept:\nThere are 4 instances in the contract `EthRouter.sol`:\n* https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L101\n* https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L154\n* https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L228\n* https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L256\n## Recommended Mitigation\nUse `block.number` instead of `block.timestamp` or `now`. Furthermore, it is also recommended to use oracles.\n\n[L-03] Update codes to avoid Compilation Errors\n=====================", "vulnerable_code": "warning[2072]: Warning: Unused local variable.\n --> test/PrivatePool/Quotes.t.sol:115:37:\n |\n115 | (uint256 returnedFeeAmount, uint256 protocolFeeAmount) = privatePool.changeFeeQuote(inputAmount);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^", "fixed_code": "", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/W0RR1O-Q.md", "collected_at": "2026-01-02T18:20:11.726294+00:00", "source_hash": "0df175301f8d1ed4b4916a9fb22663029a12038c3cdc12b55f7b1ff1595a7960", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "PrivatePool.sol#L211, PrivatePool.sol#L301, EthRouter.sol#L101, EthRouter.sol#L154, EthRouter.sol#L228, EthRouter.sol#L256", "github_files_list": "EthRouter.sol, PrivatePool.sol", "github_refs_count": 6, "vulnerable_code_actual": "warning[2072]: Warning: Unused local variable.\n --> test/PrivatePool/Quotes.t.sol:115:37:\n |\n115 | (uint256 returnedFeeAmount, uint256 protocolFeeAmount) = privatePool.changeFeeQuote(inputAmount);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "05-ajna", "title": "j4ld1na G", "severity_raw": "High", "severity": "high", "description": "| | Issues | Instances |\n| :--- | :---------------------------------------------------------------------------------------------- | --------: |\n| G-01 | Default value initialization. | 24 |\n| G-02 | Do not calculate constants. | 6 |\n| G-03 | Using `calldata` instead of `memory` for read-only arguments in `external` functions saves gas. | 6 |\n| G-04 | `abi.encode()` is less efficient than `abi.encodePacked()`. | 7 |\n| G-05 | Use assembly to check for `address(0)`. | 1 |\n| G-06 | Revert as early as possible. | 1 |\n| G-07 | When possible, use assembly instead of `unchecked{++i}`. | 1 |\n| G-08 | `Assembly` for `If Statements`. Save Gas. | 1 |\n\n## [01] Default value initialization.\n\n_If a variable is not set/initialized, it is assumed to have the default value (`0`, `false`, `0x0` etc depending on the data type).\nExplicitly initializing it with its default value is an anti-pattern and wastes gas._\n\nThere are 24 instances:\n\n[ajna-core/src/PositionManager.sol#L181](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/PositionManager.sol#L181)\n\n```java\nfor (uint256 i = 0; i < indexesLength; ) {\n```\n\n[ajna-core/src/PositionManager.sol#L364](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/PositionManager.sol#L364)\n\n```java\nfor (uint256 i = 0; i < indexesLength; ) {\n```\n\n[ajna-core/src/PositionManager.sol#L474](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/PositionManager.sol#L474)\n\n```java\n", "vulnerable_code": "[ajna-core/src/PositionManager.sol#L364](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/PositionManager.sol#L364)\n", "fixed_code": "[ajna-core/src/PositionManager.sol#L474](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/PositionManager.sol#L474)\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/j4ld1na-G.md", "collected_at": "2026-01-02T18:21:31.297205+00:00", "source_hash": "0e3d08cc2a79ef1bb4891e842ebfd4bfb56591948d4fdb42ad2dc160f8cfc741", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 84, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "for (uint256 i = 0; i < indexesLength; ) {", "primary_code_language": "java", "primary_code_char_count": 42, "all_code_blocks": "// Code block 1 (java):\nfor (uint256 i = 0; i < indexesLength; ) {\n\n// Code block 2 (java):\nfor (uint256 i = 0; i < indexesLength; ) {", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "PositionManager.sol#L181, PositionManager.sol#L364, PositionManager.sol#L474", "github_files_list": "PositionManager.sol", "github_refs_count": 3, "vulnerable_code_actual": "[ajna-core/src/PositionManager.sol#L364](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/PositionManager.sol#L364)\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "[ajna-core/src/PositionManager.sol#L474](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/PositionManager.sol#L474)\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-ondo", "title": "yongskiws Q", "severity_raw": "Medium", "severity": "medium", "description": "### [LOW-1] require() should be used instead of assert()\n``` solidity\nFile: cash\\factory\\CashFactory.sol\n97: assert(cashProxyAdmin.owner() == guardian);\n\nFile: cash\\factory\\CashKYCSenderFactory.sol\n106: assert(cashKYCSenderProxyAdmin.owner() == guardian);\n\nFile: cash\\factory\\CashKYCSenderReceiverFactory.sol\n106: assert(cashKYCSenderReceiverProxyAdmin.owner() == guardian);\n\nFile: lending\\compound\\Comptroller.sol\n266: assert(assetIndex < len);\n443: assert(markets[cToken].accountMembership[borrower]);\n```\n\n### [LOW-2] Lack of zero address check \n``` solidity\nFile: cash\\CashManager.sol\n128: address _collateral,\n129: address _cash,\n132: address _assetRecipient,\n133: address _assetSender,\n134: address _feeRecipient,\n138: address _kycRegistry,\n```\n\n### [LOW-3] function onlyOwner doesn't have strict validation consider use multisig\n``` solidity \n\nFile: lending\\OndoPriceOracle.sol\n80: function setPrice(address fToken, uint256 price) external override onlyOwner {\n81: uint256 oldPrice = fTokenToUnderlyingPrice[fToken];\n82: fTokenToUnderlyingPrice[fToken] = price;\n83: emit UnderlyingPriceSet(fToken, oldPrice, price);\n84: }\n\nFile: lending\\OndoPriceOracle.sol\n92: function setFTokenToCToken(\n93: address fToken,\n94: address cToken\n95: ) external override onlyOwner {\n96: address oldCToken = fTokenToCToken[fToken];\n97: _setFTokenToCToken(fToken, cToken);\n98: emit FTokenToCTokenSet(fToken, oldCToken, cToken);\n99: }\n\nFile: lending\\OndoPriceOracle.sol\n106: function setOracle(address newOracle) external override onlyOwner {\n107: address oldOracle = address(cTokenOracle);\n108: cTokenOracle = CTokenOracle(newOracle);\n109: emit CTokenOracleSet(oldOracle, newOracle);\n110: }\n111: \n\nFile: lending\\OndoPriceOracleV2.sol\n130: function setPriceCap(\n131: address fToken,\n132: uint256 value\n133: ) external override onlyOwner {\n134: uint256 oldPriceCap = fTokenToUnderlyingPriceCap[fTok", "vulnerable_code": "### [LOW-2] Lack of zero address check ", "fixed_code": "### [LOW-3] function onlyOwner doesn't have strict validation consider use multisig", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/yongskiws-Q.md", "collected_at": "2026-01-02T18:15:38.067469+00:00", "source_hash": "0e576257b864b2b49a30668eeaf0f5a49d756b04b7be60a923f964ddc352bc00", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 121, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "### [LOW-2] Lack of zero address check", "primary_code_language": "unknown", "primary_code_char_count": 38, "all_code_blocks": "// Code block 1 (unknown):\n### [LOW-2] Lack of zero address check\n\n// Code block 2 (unknown):\n### [LOW-3] function onlyOwner doesn't have strict validation consider use multisig", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "### [LOW-2] Lack of zero address check ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "### [LOW-3] function onlyOwner doesn't have strict validation consider use multisig", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-biconomy", "title": "sorrynotsorry Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA (LOW & NON-CRITICAL)\n\n## [L-01] Wrong visibility in SmartAccount contract \nSmartAccount contract implements `mixedAuth` modifier to validate the caller is the `owner` OR the contract itself. The functions implementing this modifier have `external` visibility which the contract itself can't call due to visibility. Recommend changing the `external` visibility to `public` visibility.\n\nModifier;\n```solidity\n modifier mixedAuth {\n require(msg.sender == owner || msg.sender == address(this),\"Only owner or self\");\n _;\n }\n```\n[Link](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L82-L85)\n\nInstances where the modifier is called in external visibility;\n\n[setOwner()](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L109)\n[UpdateImplementation()](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L120)\n[UpdateEntryPoint()](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L127)\n\n## [L-02] SmartAccountFactory's frontrunnable functions\nSmartAccountFactory has `deployCounterFactualWallet` and `deployWallet` functions to deploy SCW using create2/create and pointing it to `_defaultImpl` address. However, these functions are prone to be frontrunned by an actor. \n### Impact\nAn actor who monitors the mempool for this func-sig can frontrun it and set the parameters `_entryPointAddress`, `_handler` to arbitrary addresses while the `_owner` address is the frontrunned address. \nSince these functions also initialize the proxy and finalizes the SWC setup, it will not be possible to re-create a SWC with the same calling EOA. And if the caller is a dAp", "vulnerable_code": " modifier mixedAuth {\n require(msg.sender == owner || msg.sender == address(this),\"Only owner or self\");\n _;\n }", "fixed_code": " function deployCounterFactualWallet(address _owner, address _entryPoint, address _handler, uint _index) public returns(address proxy){\n bytes32 salt = keccak256(abi.encodePacked(_owner, address(uint160(_index))));\n bytes memory deploymentData = abi.encodePacked(type(Proxy).creationCode, uint(uint160(_defaultImpl)));\n // solhint-disable-next-line no-inline-assembly\n assembly {\n proxy := create2(0x0, add(0x20, deploymentData), mload(deploymentData), salt)\n }\n require(address(proxy) != address(0), \"Create2 call failed\");\n // EOA + Version tracking\n emit SmartAccountCreated(proxy,_defaultImpl,_owner, VERSION, _index);\n BaseSmartAccount(proxy).init(_owner, _entryPoint, _handler);\n isAccountExist[proxy] = true;\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/sorrynotsorry-Q.md", "collected_at": "2026-01-02T18:14:12.793412+00:00", "source_hash": "0e5d80742b2c831ae1cbd4f1c6b1e9061b4f0feadf32a0bd08b4f7f3796c1e5e", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 126, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "modifier mixedAuth {\n require(msg.sender == owner || msg.sender == address(this),\"Only owner or self\");\n _;\n }", "primary_code_language": "solidity", "primary_code_char_count": 126, "all_code_blocks": "// Code block 1 (solidity):\nmodifier mixedAuth {\n require(msg.sender == owner || msg.sender == address(this),\"Only owner or self\");\n _;\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "modifier mixedAuth {\n require(msg.sender == owner || msg.sender == address(this),\"Only owner or self\");\n _;\n }", "github_refs_formatted": "SmartAccount.sol#L82-L85, SmartAccount.sol#L109, SmartAccount.sol#L120, SmartAccount.sol#L127", "github_files_list": "SmartAccount.sol", "github_refs_count": 4, "vulnerable_code_actual": " modifier mixedAuth {\n require(msg.sender == owner || msg.sender == address(this),\"Only owner or self\");\n _;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function deployCounterFactualWallet(address _owner, address _entryPoint, address _handler, uint _index) public returns(address proxy){\n bytes32 salt = keccak256(abi.encodePacked(_owner, address(uint160(_index))));\n bytes memory deploymentData = abi.encodePacked(type(Proxy).creationCode, uint(uint160(_defaultImpl)));\n // solhint-disable-next-line no-inline-assembly\n assembly {\n proxy := create2(0x0, add(0x20, deploymentData), mload(deploymentData), salt)\n }\n require(address(proxy) != address(0), \"Create2 call failed\");\n // EOA + Version tracking\n emit SmartAccountCreated(proxy,_defaultImpl,_owner, VERSION, _index);\n BaseSmartAccount(proxy).init(_owner, _entryPoint, _handler);\n isAccountExist[proxy] = true;\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-asymmetry", "title": "0xhacksmithh Q", "severity_raw": "Critical", "severity": "critical", "description": "### [Low-01] User may lost his ```ETH``` due to precision loss\nInside ```stake()``` User deposited ```ETH``` sent to different derivative contracts according to their weights.\nNow the amount of eth will sent to those each derivative contract is decided by following\n```solidity\nfor (uint i = 0; i < derivativeCount; i++) { \n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight == 0) continue;\n uint256 ethAmount = (msg.value * weight) / totalWeight; \n\n ......\n ......\n``` \nHere calculated ```ethAmount``` may suffers from precision loss and user will get less `safETH` than he actually deserve.\n```\nFile: contracts/SafEth/SafEth.sol\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L84-L88\n```\n\n### [Low-02] Old Solidity Version Used\n```Instances(4)```\n```\nFile: contracts/SafEth/SafEth.sol\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L2\n```\n```\nFile: contracts/SafEth/derivatives/Reth.sol\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L2\n```\n```\nFile: contracts/SafEth/derivatives/SfrxEth.sol\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol#L2\n```\n```\nFile: contracts/SafEth/derivatives/WstEth.sol\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol#L2\n```\n\n### [Low-03] Single point of failure\nThe\u00a0`owner`\u00a0role has a single point of failure and\u00a0`onlyOwner`\u00a0can use critical a few functions.\n\n`owner`\u00a0role in the project:\n\nOwner is not behind a multisig and changes are not behind a timelock.\n\nEven if protocol admins/developers are not malicious there is still a chance for Owner keys to be stolen. In such a case, the attacker can cause serious damage to the project due to important functions. In such a case, users who have invested in project will suffer high financial ", "vulnerable_code": "for (uint i = 0; i < derivativeCount; i++) { \n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight == 0) continue;\n uint256 ethAmount = (msg.value * weight) / totalWeight; \n\n ......\n ......", "fixed_code": "File: contracts/SafEth/SafEth.sol\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L84-L88", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/0xhacksmithh-Q.md", "collected_at": "2026-01-02T18:17:42.712205+00:00", "source_hash": "0eb7f185ec8b98fca87e46527b0783cf34fb1573d29ff572038631fcb4c29f3d", "code_block_count": 2, "solidity_block_count": 1, "total_code_chars": 414, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "for (uint i = 0; i < derivativeCount; i++) { \n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight == 0) continue;\n uint256 ethAmount = (msg.value * weight) / totalWeight; \n\n ......\n ......", "primary_code_language": "solidity", "primary_code_char_count": 287, "all_code_blocks": "// Code block 1 (solidity):\nfor (uint i = 0; i < derivativeCount; i++) { \n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight == 0) continue;\n uint256 ethAmount = (msg.value * weight) / totalWeight; \n\n ......\n ......\n\n// Code block 2 (unknown):\nFile: contracts/SafEth/SafEth.sol\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L84-L88", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "for (uint i = 0; i < derivativeCount; i++) { \n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight == 0) continue;\n uint256 ethAmount = (msg.value * weight) / totalWeight; \n\n ......\n ......", "github_refs_formatted": "SafEth.sol#L84-L88, SafEth.sol#L2, Reth.sol#L2, SfrxEth.sol#L2, WstEth.sol#L2", "github_files_list": "SfrxEth.sol, Reth.sol, WstEth.sol, SafEth.sol", "github_refs_count": 5, "vulnerable_code_actual": "for (uint i = 0; i < derivativeCount; i++) { \n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight == 0) continue;\n uint256 ethAmount = (msg.value * weight) / totalWeight; \n\n ......\n ......", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/SafEth/SafEth.sol\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L84-L88", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "03-asymmetry", "title": "Madalad Q", "severity_raw": "Critical", "severity": "critical", "description": "# Low Summary\n| |Issue|Instances|\n|:-:|:-|:-:|\n|[L-01]|Use two-step ownership transfers|4|\n|[L-02]|Sanitise inputs for critical parameter changes|9|\n|[L-03]|Use timelock for critical parameter changes|8|\n\nTotal Issues: 3\n\nTotal instances: 21\n\n \n# Non-Critical Summary\n| |Issue|Instances|\n|:-:|:-|:-:|\n|[N-01]|Use `indexed` for event parameters|6|\n|[N-02]|Use fixed compiler version|4|\n|[N-03]|Use appropriate function naming convention|4|\n|[N-04]|Update import usages|31|\n|[N-05]|Implementing `renounceOwnership` is dangerous|4|\n|[N-06]|Remove unused imports|6|\n|[N-07]|Missing `address(0)` checks in constructor/initialize|3|\n|[N-08]|Use built in constants over magic numbers|3|\n|[N-09]|Typo in comments|1|\n\nTotal issues: 9\n\nTotal instances: 62\n\n \n# Low Risk Issues\n## [L-01] Use two-step ownership transfers\n\nThe current ownership transfer process involves the current owner calling `transferOwnership()`. This function checks the new owner is not the zero address and proceeds to write the new owner's address into the owner's state variable.\n\nIf the nominated EOA account is not a valid account, it is entirely possible the owner may accidentally transfer ownership to an uncontrolled account, breaking all functions with the onlyOwner() modifier.\n\nConsider implementing a two step process where the owner nominates an account and the nominated account needs to call an acceptOwnership() function for the transfer of ownership to fully succeed.\n\nThis can be achieved using OpenZeppelin's `Ownable2Step` or `Ownable2StepUpgradeable`.\n\nInstances: 4\n```solidity\nFile: contracts/SafEth/derivatives/Reth.sol\n\n19: contract Reth is IDerivative, Initializable, OwnableUpgradeable {\n\n```\n- [contracts/SafEth/derivatives/Reth.sol#L19](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L19)\n\n```solidity\nFile: contracts/SafEth/derivatives/WstEth.sol\n\n12: contract WstEth is IDerivative, Initializable, OwnableUpgradeable {\n\n```\n- [contracts/SafEth/der", "vulnerable_code": "File: contracts/SafEth/derivatives/Reth.sol\n\n19: contract Reth is IDerivative, Initializable, OwnableUpgradeable {\n", "fixed_code": "File: contracts/SafEth/derivatives/WstEth.sol\n\n12: contract WstEth is IDerivative, Initializable, OwnableUpgradeable {\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Madalad-Q.md", "collected_at": "2026-01-02T18:18:18.907776+00:00", "source_hash": "0efb1a672e0530e4acf76d390d7bb383f481e75a4d3265e49a32d24514241d7e", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 232, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/SafEth/derivatives/Reth.sol\n\n19: contract Reth is IDerivative, Initializable, OwnableUpgradeable {", "primary_code_language": "solidity", "primary_code_char_count": 114, "all_code_blocks": "// Code block 1 (solidity):\nFile: contracts/SafEth/derivatives/Reth.sol\n\n19: contract Reth is IDerivative, Initializable, OwnableUpgradeable {\n\n// Code block 2 (solidity):\nFile: contracts/SafEth/derivatives/WstEth.sol\n\n12: contract WstEth is IDerivative, Initializable, OwnableUpgradeable {", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: contracts/SafEth/derivatives/Reth.sol\n\n19: contract Reth is IDerivative, Initializable, OwnableUpgradeable {\n\nFile: contracts/SafEth/derivatives/WstEth.sol\n\n12: contract WstEth is IDerivative, Initializable, OwnableUpgradeable {", "github_refs_formatted": "Reth.sol#L19", "github_files_list": "Reth.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: contracts/SafEth/derivatives/Reth.sol\n\n19: contract Reth is IDerivative, Initializable, OwnableUpgradeable {\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/SafEth/derivatives/WstEth.sol\n\n12: contract WstEth is IDerivative, Initializable, OwnableUpgradeable {\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-biconomy", "title": "gz627 Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA Report\n\n## Non-Critical Issues\n\nC4 checked:\n| | Issue | Instances |\n| ---- |:----------------------------------------------------------- |:---------:|\n| NC-1 | Emit event when receiving ETH | 1 |\n| NC-2 | Missing checks for `address(0)` in low-level call | 1 |\n| NC-3 | Redundant verification | 2 |\n| NC-4 | Versioning | 1 | \n\n\n\n### [NC-1] Emit event when receiving ETH\n\nIt's a good practice to emit an event whenever a state variable changes especially when receiving ETH. Function `SmartAccount.receive()` can emit an event to indicate receiving ETH, e.g. `emit ReceivedETH(from, to, amount)`. The event can be defined as:\n\nThe `receive function can be:`\n```solidity\nFile: https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n\n event ReceivedETH(address indexed from, address indexed to, uint256 indexed amount);\n\n receive() external payable {\n emit ReceivedETH(msg.sender, address(this), msg.value);\n }\n\n```\n\n---\n### [NC-2] Missing checks for `address(0)` in low-level call\n\n[Link to code](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L477-L484)\n\n```solidity\nFile: https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n\n477: function _call(address target, uint256 value, bytes memory data) internal {\n478: (bool success, bytes memory result) = target.call{value : value}(data);\n if (!success) {\n assembly {\n revert(add(result, 32), mload(result))\n }\n }\n }\n```\nIn the above function, `target` is not verified. So, if there is no code at `target` address, the low-l", "vulnerable_code": "File: https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n\n event ReceivedETH(address indexed from, address indexed to, uint256 indexed amount);\n\n receive() external payable {\n emit ReceivedETH(msg.sender, address(this), msg.value);\n }\n", "fixed_code": "File: https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n\n477: function _call(address target, uint256 value, bytes memory data) internal {\n478: (bool success, bytes memory result) = target.call{value : value}(data);\n if (!success) {\n assembly {\n revert(add(result, 32), mload(result))\n }\n }\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/gz627-Q.md", "collected_at": "2026-01-02T18:13:47.256399+00:00", "source_hash": "0f4365af3e9ea5ef46744ee4112aa328ab0bd0cf23677464cc8334009301f539", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 769, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n\n event ReceivedETH(address indexed from, address indexed to, uint256 indexed amount);\n\n receive() external payable {\n emit ReceivedETH(msg.sender, address(this), msg.value);\n }", "primary_code_language": "solidity", "primary_code_char_count": 319, "all_code_blocks": "// Code block 1 (solidity):\nFile: https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n\n event ReceivedETH(address indexed from, address indexed to, uint256 indexed amount);\n\n receive() external payable {\n emit ReceivedETH(msg.sender, address(this), msg.value);\n }\n\n// Code block 2 (solidity):\nFile: https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n\n477: function _call(address target, uint256 value, bytes memory data) internal {\n478: (bool success, bytes memory result) = target.call{value : value}(data);\n if (!success) {\n assembly {\n revert(add(result, 32), mload(result))\n }\n }\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n\n event ReceivedETH(address indexed from, address indexed to, uint256 indexed amount);\n\n receive() external payable {\n emit ReceivedETH(msg.sender, address(this), msg.value);\n }\n\nFile: https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n\n477: function _call(address target, uint256 value, bytes memory data) internal {\n478: (bool success, bytes memory result) = target.call{value : value}(data);\n if (!success) {\n assembly {\n revert(add(result, 32), mload(result))\n }\n }\n }", "github_refs_formatted": "SmartAccount.sol, SmartAccount.sol#L477-L484", "github_files_list": "SmartAccount.sol", "github_refs_count": 2, "vulnerable_code_actual": "File: https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n\n event ReceivedETH(address indexed from, address indexed to, uint256 indexed amount);\n\n receive() external payable {\n emit ReceivedETH(msg.sender, address(this), msg.value);\n }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n\n477: function _call(address target, uint256 value, bytes memory data) internal {\n478: (bool success, bytes memory result) = target.call{value : value}(data);\n if (!success) {\n assembly {\n revert(add(result, 32), mload(result))\n }\n }\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "06-lybra", "title": "dharma09 G", "severity_raw": "Low", "severity": "low", "description": "**Table of contents**\n\n- [The result of a function call should be cached rather than re-calling the function](#The-result-of-a-function-call-should-be-cached-rather-than-re-calling-the-function)\n - [ProtocolRewardsPool.sol.notifyRewardAmount() : Results of `totalStaked()` should be cached](#protocolrewardspool.sol.notifyrewardamount()-:-results-of-`totalstaked()`-should-be-cached)\n - [EUSDMiningIncentives.sol.rewardPerToken() : Result of `totalStaled()` should be cached](#eusdminingincentives.sol.rewardpertoken()`-:-result-of-`totalstaled()`-should-be-cached)\n - [PeUSDMainnetStableVision.sol.convertToPeUSDAndCrossChain() : Results of _msgsender() should be cached](#peusdmainnetstablevision.sol.converttopeusdandcrosschain()-:-results-of-_msgsender()-should-be-cached)\n - [PeUSDMainnetStableVision.sol.convertToPeUSD : Results of `_msgsender()` should be cached](#peusdmainnetstablevision.sol.converttopeusd`-:-results-of-`_msgsender()`-should-be-cached)\n- [State variables only set in the constructor should be declared\u00a0`immutable`](#state-variables-only-set-in-the-constructor-should-be-declared\u00a0`immutable)\n- [Multiple accesses of a mapping/array should use a local variable cache](#multiple-accesses-of-a-mapping/array-should-use-a-local-variable-cache)\n - [LybraGovernance.sol.proposals()` :`proposalData[proposalId] should be cached in local storage](#lybragovernance.sol.proposals()`-:`proposaldata[proposalid]`-should-be-cached-in-local-storage)\n - [LybraGovernance.sol.getReceipt()` :`proposalData[proposalId] should be cached in local storage](#lybragovernance.sol.getreceipt()`-:`proposaldata[proposalid]`-should-be-cached-in-local-storage)\n- [Internal or private functions only called once can be inlined to save gas\u00a0Gas saved: 20 * 20= 400](#internal-or-private-functions-only-called-once-can-be-inlined-to-save-gas\u00a0gas-saved:-20-*-20=-400)\n- [Using storage instead of memory for structs/arrays saves gas](#using-storage-instead-of-memory-for-structs/arrays-sav", "vulnerable_code": "File: contracts/lybra/miner/ProtocolRewardsPool.sol\n\t227: function notifyRewardAmount(uint amount, uint tokenType) external {\n\t228: require(msg.sender == address(configurator));\n\t229: if (totalStaked() == 0) return; //@audit: Initial call\n\t230: require(amount > 0, \"amount = 0\");\n\t231: if(tokenType == 0) {\n\t232: uint256 share = IEUSD(configurator.getEUSDAddress()).getSharesByMintedEUSD(amount);\n\t233: rewardPerTokenStored = rewardPerTokenStored + (share * 1e18) / totalStaked(); //@audit: 2nd call\n\t234 } else if(tokenType == 1) {\n\t235: ERC20 token = ERC20(configurator.stableToken());\n\t236: rewardPerTokenStored = rewardPerTokenStored + (amount * 1e36 / token.decimals()) / totalStaked(); //@audit 2nd call\n\t234 } else if(tokenType == 1) {\n\t237: } else {\n\t238: rewardPerTokenStored = rewardPerTokenStored + (amount * 1e18) / totalStaked(); //@audit 2nd call\n\t234 } else if(tokenType == 1) {\n\t239: }\n\t240: }", "fixed_code": "# `EUSDMiningIncentives.sol.rewardPerToken()` : Result of `totalStaled()` should be cached\n\n---\n\n- https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/miner/EUSDMiningIncentives.sol#L163C4-L169C6\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/dharma09-G.md", "collected_at": "2026-01-02T18:22:55.676924+00:00", "source_hash": "0f831cfeb0eef54b88b6007beda47dcf93769ad44a199ea3ee65fdd84c2cd08e", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "EUSDMiningIncentives.sol#L163-L4", "github_files_list": "EUSDMiningIncentives.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: contracts/lybra/miner/ProtocolRewardsPool.sol\n\t227: function notifyRewardAmount(uint amount, uint tokenType) external {\n\t228: require(msg.sender == address(configurator));\n\t229: if (totalStaked() == 0) return; //@audit: Initial call\n\t230: require(amount > 0, \"amount = 0\");\n\t231: if(tokenType == 0) {\n\t232: uint256 share = IEUSD(configurator.getEUSDAddress()).getSharesByMintedEUSD(amount);\n\t233: rewardPerTokenStored = rewardPerTokenStored + (share * 1e18) / totalStaked(); //@audit: 2nd call\n\t234 } else if(tokenType == 1) {\n\t235: ERC20 token = ERC20(configurator.stableToken());\n\t236: rewardPerTokenStored = rewardPerTokenStored + (amount * 1e36 / token.decimals()) / totalStaked(); //@audit 2nd call\n\t234 } else if(tokenType == 1) {\n\t237: } else {\n\t238: rewardPerTokenStored = rewardPerTokenStored + (amount * 1e18) / totalStaked(); //@audit 2nd call\n\t234 } else if(tokenType == 1) {\n\t239: }\n\t240: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "# `EUSDMiningIncentives.sol.rewardPerToken()` : Result of `totalStaled()` should be cached\n\n---\n\n- https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/miner/EUSDMiningIncentives.sol#L163C4-L169C6\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "03-asymmetry", "title": "adriro G", "severity_raw": "Medium", "severity": "medium", "description": "# `SafEth` contract:\n\n- `derivatives[i].balance()` is called twice in the `stake` function. Consider caching the first result to avoid an extra call and read from storage. \n https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L73-L74\n \n- `derivatives[i].balance()` is called twice in the `rebalanceToWeights` function. Consider caching the first result to avoid an extra call and read from storage. \n https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L141-L142\n\n- In `adjustWeight`, instead of looping all derivatives to recalculate the `totalWeight`, the function can just subtract the current weight for the derivative being modified and add the new weight. \n https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L171-L173 \n ```solidity\n function adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n ) external onlyOwner {\n uint256 currentWeight = weights[_derivativeIndex];\n weights[_derivativeIndex] = _weight;\n totalWeight = totalWeight - currentWeight + _weight;\n emit WeightChange(_derivativeIndex, _weight);\n }\n ```\n\n- In the `addDerivative` function, instead of recalculating the totalWeight by looping all derivatives, the implementations can just add the weight value for the new derivative to the `totalWeight` variable. \n https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L190-L193 \n ```solidity\n function addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n totalWeight += _weight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n }\n ```\n\n- `derivativeCount` variable is read from storage 4 times in the `addDerivative` function. Consider caching this value in a local variable. \n ht", "vulnerable_code": "", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/adriro-G.md", "collected_at": "2026-01-02T18:18:44.082572+00:00", "source_hash": "0fbc2b9ed60c3dc8607279370484926e11dbbd99556c48b1eb260c0e59a7e291", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 659, "github_ref_count": 4, "vulnerable_code_is_url": true, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n ) external onlyOwner {\n uint256 currentWeight = weights[_derivativeIndex];\n weights[_derivativeIndex] = _weight;\n totalWeight = totalWeight - currentWeight + _weight;\n emit WeightChange(_derivativeIndex, _weight);\n }", "primary_code_language": "solidity", "primary_code_char_count": 316, "all_code_blocks": "// Code block 1 (solidity):\nfunction adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n ) external onlyOwner {\n uint256 currentWeight = weights[_derivativeIndex];\n weights[_derivativeIndex] = _weight;\n totalWeight = totalWeight - currentWeight + _weight;\n emit WeightChange(_derivativeIndex, _weight);\n }\n\n// Code block 2 (solidity):\nfunction addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n totalWeight += _weight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n ) external onlyOwner {\n uint256 currentWeight = weights[_derivativeIndex];\n weights[_derivativeIndex] = _weight;\n totalWeight = totalWeight - currentWeight + _weight;\n emit WeightChange(_derivativeIndex, _weight);\n }\n\nfunction addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n totalWeight += _weight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n }", "github_refs_formatted": "SafEth.sol#L73-L74, SafEth.sol#L141-L142, SafEth.sol#L171-L173, SafEth.sol#L190-L193", "github_files_list": "SafEth.sol", "github_refs_count": 4, "vulnerable_code_actual": "", "has_vulnerable_code_snippet": false, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "04-caviar", "title": "favelanky G", "severity_raw": "Medium", "severity": "medium", "description": "## [G-1] Move checks to the top\n\nChecks, effects, interactions is a general best practice and can be applicable to more than just reentrancy concerns. When one of the following error scenarios applies, users pay gas for all statements executed up until the revert itself. By performing checks such as these as early as possible, you are saving users gas in failure scenarios without any sacrifice to the happy case costs.\n\nMoving the requirements to the top of the function can also improve readability.\n\nThere are 1 instances of this issue:\n\n```solidity\nFile: /src/PrivatePool.sol\n\n225: if (baseToken != address(0) && msg.value > 0) revert InvalidEthAmount();\n\n```\n\nhttps://github.com/code-423n4/2023-04-caviar/tree/main/src/PrivatePool.sol#L225\n\n## [G-2] Use function for repetitive blocks of code\n\nThere is 1 instances of this issue:\n\n```solidity\nFile: /src/PrivatePool.sol\n\n277: if (royaltyFee > 0 && recipient != address(0)) {\n\t\t\tif (baseToken != address(0)) {\n\t\t\t\tERC20(baseToken).safeTransfer(recipient, royaltyFee);\n\t\t\t} else {\n\t\t\t\trecipient.safeTransferETH(royaltyFee);\n\t\t\t}\n\t\t}\n\n```\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L277-L283\n\n\n## [G-3] Use nested if and, avoid multiple check combinations\n\nUsing nested is cheaper than using && multiple check combinations. There are more advantages, such as easier to read code and better coverage reports.\n\nThere are 11 instances of this issue:\n\n```solidity\nFile: /src/Factory.sol\n\n87: if ((_baseToken == address(0) && msg.value != baseTokenAmount) || (_baseToken != address(0) && msg.value > 0)) {\n\n```\n\nhttps://github.com/code-423n4/2023-04-caviar/tree/main/src/Factory.sol#L87\n\n```solidity\nFile: /src/PrivatePool.sol\n\n225: if (baseToken != address(0) && msg.value > 0) revert InvalidEthAmount();\n\n277: if (royaltyFee > 0 && recipient != address(0)) {\n\n344: if (royaltyFee > 0 && recipient != address(0)) {\n\n397: if (baseToken != address(0) && msg.value > 0) revert InvalidEthAmount();\n\n489: if ((ba", "vulnerable_code": "File: /src/PrivatePool.sol\n\n225: if (baseToken != address(0) && msg.value > 0) revert InvalidEthAmount();\n", "fixed_code": "File: /src/PrivatePool.sol\n\n277: if (royaltyFee > 0 && recipient != address(0)) {\n\t\t\tif (baseToken != address(0)) {\n\t\t\t\tERC20(baseToken).safeTransfer(recipient, royaltyFee);\n\t\t\t} else {\n\t\t\t\trecipient.safeTransferETH(royaltyFee);\n\t\t\t}\n\t\t}\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/favelanky-G.md", "collected_at": "2026-01-02T18:20:31.431302+00:00", "source_hash": "0fbea96316726ea81e71d8eba375c38ae8e77706e0a0b3d693411884e163be35", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 487, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: /src/PrivatePool.sol\n\n225: if (baseToken != address(0) && msg.value > 0) revert InvalidEthAmount();", "primary_code_language": "solidity", "primary_code_char_count": 106, "all_code_blocks": "// Code block 1 (solidity):\nFile: /src/PrivatePool.sol\n\n225: if (baseToken != address(0) && msg.value > 0) revert InvalidEthAmount();\n\n// Code block 2 (solidity):\nFile: /src/PrivatePool.sol\n\n277: if (royaltyFee > 0 && recipient != address(0)) {\n\t\t\tif (baseToken != address(0)) {\n\t\t\t\tERC20(baseToken).safeTransfer(recipient, royaltyFee);\n\t\t\t} else {\n\t\t\t\trecipient.safeTransferETH(royaltyFee);\n\t\t\t}\n\t\t}\n\n// Code block 3 (solidity):\nFile: /src/Factory.sol\n\n87: if ((_baseToken == address(0) && msg.value != baseTokenAmount) || (_baseToken != address(0) && msg.value > 0)) {", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: /src/PrivatePool.sol\n\n225: if (baseToken != address(0) && msg.value > 0) revert InvalidEthAmount();\n\nFile: /src/PrivatePool.sol\n\n277: if (royaltyFee > 0 && recipient != address(0)) {\n\t\t\tif (baseToken != address(0)) {\n\t\t\t\tERC20(baseToken).safeTransfer(recipient, royaltyFee);\n\t\t\t} else {\n\t\t\t\trecipient.safeTransferETH(royaltyFee);\n\t\t\t}\n\t\t}\n\nFile: /src/Factory.sol\n\n87: if ((_baseToken == address(0) && msg.value != baseTokenAmount) || (_baseToken != address(0) && msg.value > 0)) {", "github_refs_formatted": "PrivatePool.sol#L225, PrivatePool.sol#L277-L283, Factory.sol#L87", "github_files_list": "PrivatePool.sol, Factory.sol", "github_refs_count": 3, "vulnerable_code_actual": "File: /src/PrivatePool.sol\n\n225: if (baseToken != address(0) && msg.value > 0) revert InvalidEthAmount();\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: /src/PrivatePool.sol\n\n277: if (royaltyFee > 0 && recipient != address(0)) {\n\t\t\tif (baseToken != address(0)) {\n\t\t\t\tERC20(baseToken).safeTransfer(recipient, royaltyFee);\n\t\t\t} else {\n\t\t\t\trecipient.safeTransferETH(royaltyFee);\n\t\t\t}\n\t\t}\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "01-ondo", "title": "ch0bu Q", "severity_raw": "Low", "severity": "low", "description": "## 1. Use a more recent version of Solidity, and avoid floating pragma statements\n\n- Use a solidity version of at least 0.8.4 to get `bytes.concat()` instead of `abi.encodePacked(,)` \n- Use a solidity version of at least 0.8.12 to get `string.concat()` instead of `abi.encodePacked(,)`\n- Use a solidity version of at least 0.8.13 to get the ability to use `using for` with a list of free functions\n\nMost contracts in scope use up to date version of 0.8.16, but there are some that use ^0.8.10, 0.6.12, ^0.5.16. These need to be updated, especially the ones that are not in the 0.8.x range.\n\n\n## 2. File does not contain an SPDX Identifier\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cErc20ModifiedDelegator.sol\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/JumpRateModelV2.sol\n\n\n## 3. Function order\n\nFunctions should be ordered following [the Solidity conventions](https://docs.soliditylang.org/en/v0.8.17/style-guide.html#order-of-functions):\n\n\"Functions should be grouped according to their visibility and ordered:\n\n- constructor\n- receive function (if exists)\n- fallback function (if exists)\n- external\n- public\n- internal\n- private\"\n\nIn a lot of contracts this best practice has not been followed.\n\n\n## 4. Use modifiers for better readability and code reuse\n\nTo improve readability and code reuse, a modifer function can be defined instead of performing a manual conditional check within multiple affected functions.\n\n```\n\trequire(msg.sender == admin, \"Only admin can set KYC registry\");\n```\n\n## 5. `require()` should be used instead of `assert()`\n\nPrior to solidity version 0.8.0, hitting an assert consumes the remainder of the transaction\u2019s available gas rather than returning it, as `require()`/`revert()` do. `assert()` should be avoided even past solidity version 0.8.0 as its [documentation](https://docs.soliditylang.org/en/v0.8.14/control-structures.html#panic-via-assert-and-error-via-require) states ", "vulnerable_code": "\trequire(msg.sender == admin, \"Only admin can set KYC registry\");", "fixed_code": "97 assert(cashProxyAdmin.owner() == guardian);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/ch0bu-Q.md", "collected_at": "2026-01-02T18:14:59.172389+00:00", "source_hash": "0fde033259f3c8405d43966c59739b9c45a063bf0576e28be5f310df06b7711e", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 64, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "require(msg.sender == admin, \"Only admin can set KYC registry\");", "primary_code_language": "unknown", "primary_code_char_count": 64, "all_code_blocks": "// Code block 1 (unknown):\nrequire(msg.sender == admin, \"Only admin can set KYC registry\");", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "cErc20ModifiedDelegator.sol, JumpRateModelV2.sol", "github_files_list": "JumpRateModelV2.sol, cErc20ModifiedDelegator.sol", "github_refs_count": 2, "vulnerable_code_actual": "\trequire(msg.sender == admin, \"Only admin can set KYC registry\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": "97 assert(cashProxyAdmin.owner() == guardian);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-ondo", "title": "0xjuicer G", "severity_raw": "Low", "severity": "low", "description": "## Gas - Creating a old variable isn't necessary.\n\n\nThe following pathern can be seen in multiples places in the code.\n\n```solidity\n uint256 oldPriceCap = fTokenToUnderlyingPriceCap[fToken];\n fTokenToUnderlyingPriceCap[fToken] = value;\n emit PriceCapSet(fToken, oldPriceCap, value);\n```\n\nIt can be replaced by:\n\n```solidity\n emit PriceCapSet(fToken, fTokenToUnderlyingPriceCap[fToken], value);\n fTokenToUnderlyingPriceCap[fToken] = value;\n```\n\nThe following pathern can be found on the following files:\n- OndoPriceOracleV2.sol\n- CashManager.sol\n- OndoPriceOracle.sol\n- KYCRegistryClient.sol\n- And some more from compound\n\n## Gas - Use merkle trees instead of array of addresses\n\nOn the `completeRedemptions()` function, the input has two arrays, `redeemers` and `refundees`, I suggest to use two merkle tree instead of two lists of addresses in order to save some gas when submiting the `completeRedemptions`.\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L708-L709", "vulnerable_code": " uint256 oldPriceCap = fTokenToUnderlyingPriceCap[fToken];\n fTokenToUnderlyingPriceCap[fToken] = value;\n emit PriceCapSet(fToken, oldPriceCap, value);", "fixed_code": " emit PriceCapSet(fToken, fTokenToUnderlyingPriceCap[fToken], value);\n fTokenToUnderlyingPriceCap[fToken] = value;", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/0xjuicer-G.md", "collected_at": "2026-01-02T18:14:22.989020+00:00", "source_hash": "0fe6d27ec226f870aefcb9f09b5b0a7608b6d6df74632454588475c8fc915e1a", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 271, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "uint256 oldPriceCap = fTokenToUnderlyingPriceCap[fToken];\n fTokenToUnderlyingPriceCap[fToken] = value;\n emit PriceCapSet(fToken, oldPriceCap, value);", "primary_code_language": "solidity", "primary_code_char_count": 155, "all_code_blocks": "// Code block 1 (solidity):\nuint256 oldPriceCap = fTokenToUnderlyingPriceCap[fToken];\n fTokenToUnderlyingPriceCap[fToken] = value;\n emit PriceCapSet(fToken, oldPriceCap, value);\n\n// Code block 2 (solidity):\nemit PriceCapSet(fToken, fTokenToUnderlyingPriceCap[fToken], value);\n fTokenToUnderlyingPriceCap[fToken] = value;", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "uint256 oldPriceCap = fTokenToUnderlyingPriceCap[fToken];\n fTokenToUnderlyingPriceCap[fToken] = value;\n emit PriceCapSet(fToken, oldPriceCap, value);\n\nemit PriceCapSet(fToken, fTokenToUnderlyingPriceCap[fToken], value);\n fTokenToUnderlyingPriceCap[fToken] = value;", "github_refs_formatted": "CashManager.sol#L708-L709", "github_files_list": "CashManager.sol", "github_refs_count": 1, "vulnerable_code_actual": " uint256 oldPriceCap = fTokenToUnderlyingPriceCap[fToken];\n fTokenToUnderlyingPriceCap[fToken] = value;\n emit PriceCapSet(fToken, oldPriceCap, value);", "has_vulnerable_code_snippet": true, "fixed_code_actual": " emit PriceCapSet(fToken, fTokenToUnderlyingPriceCap[fToken], value);\n fTokenToUnderlyingPriceCap[fToken] = value;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7.04} {"source": "c4", "protocol": "07-amphora", "title": "BRONZEDISC Q", "severity_raw": "Medium", "severity": "medium", "description": "## QA\n---\n\n### Layout Order [1]\n\n- The best-practices for layout within a contract is the following order: state variables, events, modifiers, constructor and functions.\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/governance/GovernorCharlie.sol\n\n```solidity\n// place this modifier before the constructor\n106: modifier onlyGov() {\n```\n\n---\n\n### Function Visibility [2]\n\n- Order of Functions: Ordering helps readers identify which functions they can call and to find the constructor and fallback definitions easier. Functions should be grouped according to their visibility and ordered: constructor, receive function (if exists), fallback function (if exists), external, public, internal, private. Within a grouping, place the view and pure functions last.\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/periphery/oracles/OracleRelay.sol\n\n```solidity\n// place this internal function after all the others\n19: function _setUnderlying(address _underlying) internal {\n```\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/periphery/oracles/ChainlinkTokenOracleRelay.sol\n\n```solidity\n// place this external function right after the constructor\n40: function isStale() external view returns (bool _stale) {\n```\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/periphery/oracles/EthSafeStableCurveOracle.sol\n\n```solidity\n// place this right after the constructor\n54: fallback() external {}\n```\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/periphery/oracles/CTokenOracle.sol\n\n```solidity\n// place this external function before all the other ones\n57: function changeAnchoredView(address _anchoredViewUnderlying) external onlyOwner {\n```\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/periphery/oracles/ChainlinkOracleRelay.sol\n\n```solidity\n// place this public function after the external ones.\n51: fun", "vulnerable_code": "// place this modifier before the constructor\n106: modifier onlyGov() {", "fixed_code": "// place this internal function after all the others\n19: function _setUnderlying(address _underlying) internal {", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/BRONZEDISC-Q.md", "collected_at": "2026-01-02T18:23:22.847922+00:00", "source_hash": "0fe7e691e9283f2582644aa6ac568318bf423e6ebd537b13aee6d095d74d138c", "code_block_count": 5, "solidity_block_count": 5, "total_code_chars": 519, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "// place this modifier before the constructor\n106: modifier onlyGov() {", "primary_code_language": "solidity", "primary_code_char_count": 72, "all_code_blocks": "// Code block 1 (solidity):\n// place this modifier before the constructor\n106: modifier onlyGov() {\n\n// Code block 2 (solidity):\n// place this internal function after all the others\n19: function _setUnderlying(address _underlying) internal {\n\n// Code block 3 (solidity):\n// place this external function right after the constructor\n40: function isStale() external view returns (bool _stale) {\n\n// Code block 4 (solidity):\n// place this right after the constructor\n54: fallback() external {}\n\n// Code block 5 (solidity):\n// place this external function before all the other ones\n57: function changeAnchoredView(address _anchoredViewUnderlying) external onlyOwner {", "all_code_blocks_count": 5, "has_diff_blocks": false, "diff_code": "", "solidity_code": "// place this modifier before the constructor\n106: modifier onlyGov() {\n\n// place this internal function after all the others\n19: function _setUnderlying(address _underlying) internal {\n\n// place this external function right after the constructor\n40: function isStale() external view returns (bool _stale) {\n\n// place this right after the constructor\n54: fallback() external {}\n\n// place this external function before all the other ones\n57: function changeAnchoredView(address _anchoredViewUnderlying) external onlyOwner {", "github_refs_formatted": "GovernorCharlie.sol, OracleRelay.sol, ChainlinkTokenOracleRelay.sol, EthSafeStableCurveOracle.sol, CTokenOracle.sol, ChainlinkOracleRelay.sol", "github_files_list": "EthSafeStableCurveOracle.sol, GovernorCharlie.sol, ChainlinkTokenOracleRelay.sol, OracleRelay.sol, ChainlinkOracleRelay.sol, CTokenOracle.sol", "github_refs_count": 6, "vulnerable_code_actual": "// place this modifier before the constructor\n106: modifier onlyGov() {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "// place this internal function after all the others\n19: function _setUnderlying(address _underlying) internal {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 11} {"source": "c4", "protocol": "10-badger", "title": "oualidpro G", "severity_raw": "High", "severity": "high", "description": "## Summary\n\n### Gas Optimizations\n\n| |Issue|Instances|Total Gas Saved|\n|-|:-|:-:|:-:|\n| [[GAS‑1](#gas1-multiple-accesses-of-a-mapping-array-should-use-a-local-variable-cache)] | Multiple accesses of a mapping/array should use a local variable cache | 4 | 168 | \n| [[GAS‑2](#gas2-use-assembly-to-calculate-hashes-to-save-gas)] | Use assembly to calculate hashes to save gas | 15 | 1200 | \n| [[GAS‑3](#gas3-use-assembly-to-check-for-address-0)] | Use assembly to check for `address(0)` | 29 | 174 | \n| [[GAS‑4](#gas4-optimize-address-storage-value-management-with-assembly)] | Optimize Address Storage Value Management with `assembly` | 23 | - | \n| [[GAS‑5](#gas5-use-assembly-to-emit-events)] | Use assembly to emit events | 88 | 3344 | \n| [[GAS‑6](#gas6-avoid-contract-existence-checks-by-using-low-level-calls)] | Avoid contract existence checks by using low level calls | 10 | 1000 | \n| [[GAS‑7](#gas7-using-bools-for-storage-incurs-overhead)] | Using bools for storage incurs overhead | 14 | 1400 | \n| [[GAS‑8](#gas8-cache-array-length-outside-of-loop)] | Cache array length outside of loop | 5 | 485 | \n| [[GAS‑9](#gas9-state-variables-should-be-cached-in-stack-variables-rather-than-re-reading-them-from-storage)] | State variables should be cached in stack variables rather than re-reading them from storage | 2 | 194 | \n| [[GAS‑10](#gas10-use-calldata-instead-of-memory-for-function-arguments-that-do-not-get-mutated)] | Use calldata instead of memory for function arguments that do not get mutated | 4 | - | \n| [[GAS‑11](#gas11-add-unchecked-for-subtractions-where-the-operands-cannot-underflow-because-of-a-previous-require-or-if-statement)] | Add `unchecked {}` for subtractions where the operands cannot underflow because of a previous `require()` or `if`-statement | 13 | 1105 | \n| [[GAS‑12](#gas12-don-t-compare-boolean-expressions-to-boolean-literals)] | Don't compare boolean expressions to boolean li", "vulnerable_code": "File: packages/contracts/contracts/CdpManagerStorage.sol\n\n// @audit Cdps[_cdpId]\n272: Cdps[_cdpId].coll = 0;\n\n", "fixed_code": "File: packages/contracts/contracts/Dependencies/RolesAuthority.sol\n\n// @audit capabilityFlag[target]\n98: capabilityFlag[target][functionSig] = CapabilityFlag.None;\n\n// @audit getRolesWithCapability[target]\n113: getRolesWithCapability[target][functionSig] |= bytes32(1 << role);\n\n// @audit enabledFunctionSigsByTarget[target]\n114: enabledFunctionSigsByTarget[target].add(bytes32(functionSig));\n\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/oualidpro-G.md", "collected_at": "2026-01-02T18:26:58.772441+00:00", "source_hash": "0fec0bed9107f419be85db233875382f0043e3a5e598393f438c340abc4d4a1c", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: packages/contracts/contracts/CdpManagerStorage.sol\n\n// @audit Cdps[_cdpId]\n272: Cdps[_cdpId].coll = 0;\n\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: packages/contracts/contracts/Dependencies/RolesAuthority.sol\n\n// @audit capabilityFlag[target]\n98: capabilityFlag[target][functionSig] = CapabilityFlag.None;\n\n// @audit getRolesWithCapability[target]\n113: getRolesWithCapability[target][functionSig] |= bytes32(1 << role);\n\n// @audit enabledFunctionSigsByTarget[target]\n114: enabledFunctionSigsByTarget[target].add(bytes32(functionSig));\n\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "10-badger", "title": "naszam G", "severity_raw": "Medium", "severity": "medium", "description": "# Gas Optimization: consider removing redundant checks in SortedCdps.reInsert()\n\n**Context:** [SortedCdps.sol#L506-L508](https://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/SortedCdps.sol#L506-L508)\n\n**Description:**\n`reInsert` currently uses a check to ensure `contains(_id)` (the List contains the id) even though it should be already checked in `_remove(_id)` method, same for the other check to ensure `_newNICR > 0` that should be already checked in `_insert(_id, _newNICR, _prevId, _nextId)`.\n\n**Recommendation:**\nConsider removing those redundant checks to improve gas efficiency.\n\n```diff\ndiff --git a/packages/contracts/contracts/SortedCdps.sol b/packages/contracts/contracts/SortedCdps.sol\nindex 0fd34e7..1e3b413 100644\n--- a/packages/contracts/contracts/SortedCdps.sol\n+++ b/packages/contracts/contracts/SortedCdps.sol\n@@ -502,10 +502,6 @@ contract SortedCdps is ISortedCdps {\n bytes32 _nextId\n ) external override {\n _requireCallerIsBOorCdpM();\n- // List must contain the node\n- require(contains(_id), \"SortedCdps: List does not contain the id\");\n- // NICR must be non-zero\n- require(_newNICR > 0, \"SortedCdps: NICR must be positive\");\n \n // Remove node from the list\n _remove(_id);\n```\n- Tests PASS\n`yarn && forge build && forge test`\n`Ran 39 test suites: 229 tests passed, 0 failed, 0 skipped (229 total tests)`\n\n`yarn test`\n```\n 607 passing (34m)\n 40 pending\n\nDone in 2020.92s.\n```\n\n- Gas Report:\n\n**Before**\n```haskell\n| contracts/SortedCdps.sol:SortedCdps contract | | | | | |\n|----------------------------------------------|-----------------|--------|--------|---------|---------|\n| Deployment Cost | Deployment Size | | | | |\n| 1462626 | 7742 | | | | |\n| Function Name ", "vulnerable_code": "- Tests PASS\n`yarn && forge build && forge test`\n`Ran 39 test suites: 229 tests passed, 0 failed, 0 skipped (229 total tests)`\n\n`yarn test`", "fixed_code": "- Gas Report:\n\n**Before**", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/naszam-G.md", "collected_at": "2026-01-02T18:26:56.937559+00:00", "source_hash": "103b6781281c9749ad61311d93dd7a416d37fff7e94d3f59b5e8766cf0dc2235", "code_block_count": 2, "solidity_block_count": 1, "total_code_chars": 710, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "diff --git a/packages/contracts/contracts/SortedCdps.sol b/packages/contracts/contracts/SortedCdps.sol\nindex 0fd34e7..1e3b413 100644\n--- a/packages/contracts/contracts/SortedCdps.sol\n+++ b/packages/contracts/contracts/SortedCdps.sol\n@@ -502,10 +502,6 @@ contract SortedCdps is ISortedCdps {\n bytes32 _nextId\n ) external override {\n _requireCallerIsBOorCdpM();\n- // List must contain the node\n- require(contains(_id), \"SortedCdps: List does not contain the id\");\n- // NICR must be non-zero\n- require(_newNICR > 0, \"SortedCdps: NICR must be positive\");\n \n // Remove node from the list\n _remove(_id);", "primary_code_language": "diff", "primary_code_char_count": 661, "all_code_blocks": "// Code block 1 (diff):\ndiff --git a/packages/contracts/contracts/SortedCdps.sol b/packages/contracts/contracts/SortedCdps.sol\nindex 0fd34e7..1e3b413 100644\n--- a/packages/contracts/contracts/SortedCdps.sol\n+++ b/packages/contracts/contracts/SortedCdps.sol\n@@ -502,10 +502,6 @@ contract SortedCdps is ISortedCdps {\n bytes32 _nextId\n ) external override {\n _requireCallerIsBOorCdpM();\n- // List must contain the node\n- require(contains(_id), \"SortedCdps: List does not contain the id\");\n- // NICR must be non-zero\n- require(_newNICR > 0, \"SortedCdps: NICR must be positive\");\n \n // Remove node from the list\n _remove(_id);\n\n// Code block 2 (unknown):\n607 passing (34m)\n 40 pending\n\nDone in 2020.92s.", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "diff --git a/packages/contracts/contracts/SortedCdps.sol b/packages/contracts/contracts/SortedCdps.sol\nindex 0fd34e7..1e3b413 100644\n--- a/packages/contracts/contracts/SortedCdps.sol\n+++ b/packages/contracts/contracts/SortedCdps.sol\n@@ -502,10 +502,6 @@ contract SortedCdps is ISortedCdps {\n bytes32 _nextId\n ) external override {\n _requireCallerIsBOorCdpM();\n- // List must contain the node\n- require(contains(_id), \"SortedCdps: List does not contain the id\");\n- // NICR must be non-zero\n- require(_newNICR > 0, \"SortedCdps: NICR must be positive\");\n \n // Remove node from the list\n _remove(_id);", "solidity_code": "", "github_refs_formatted": "SortedCdps.sol#L506-L508", "github_files_list": "SortedCdps.sol", "github_refs_count": 1, "vulnerable_code_actual": "- Tests PASS\n`yarn && forge build && forge test`\n`Ran 39 test suites: 229 tests passed, 0 failed, 0 skipped (229 total tests)`\n\n`yarn test`", "has_vulnerable_code_snippet": true, "fixed_code_actual": "- Gas Report:\n\n**Before**", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "02-ethos", "title": "btk Q", "severity_raw": "Critical", "severity": "critical", "description": "| Total Low issues |\n|------------------|\n\n| Risk | Issues Details | Number |\n|--------|-----------------------------------------------------------------------------------------|---------------|\n| [L-01] | Low level calls with solidity version 0.8.14 and lower can result in optimiser bug | 1 |\n| [L-02] | No Storage Gap for Upgradeable contracts | 2 |\n| [L-03] | Loss of precision due to rounding | 10 |\n| [L-04] | ERC4626Cloned 's implmentation is not fully up to EIP-4626's specification | 1 |\n| [L-05] | Multiple Pragma used | All Contracts |\n| [L-06] | Missing Event for initialize | 2 |\n| [L-07] | Not all tokens support approve-max | 1 |\n| [L-08] | Value is not validated to be different than the existing one\t | 2 |\n| [L-09] | Use require instead of assert | 20 |\n| [L-10] | Misleading comment on `ActivePool.sol` | 1 |\n| [L-11] | Integer overflow by unsafe casting | 3 |\n\n| Total Non-Critical issues |\n|---------------------------|\n \n| Risk | Issues Details | Number |\n|---------|------------------------------------------------------------------------------------------------|---------------|\n| [NC-01] | Include return parameters in NatSpec comments | All Contracts", "vulnerable_code": " function _chainID() private pure returns (uint256 chainID) {\n assembly {\n chainID := chainid()\n }\n }", "fixed_code": " /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/btk-Q.md", "collected_at": "2026-01-02T18:16:53.080775+00:00", "source_hash": "106b2f95e9e1bc1f000e6b9e09ae647363484e583057895121a16b98e5377a9e", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function _chainID() private pure returns (uint256 chainID) {\n assembly {\n chainID := chainid()\n }\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "07-amphora", "title": "VIELITE Q", "severity_raw": "Unknown", "severity": "unknown", "description": "Repeated or Identical functions in the `WUSDA.sol` contract \n\n```solidity\nfunction burnAll() external override returns (uint256 _usdaAmount) {\n uint256 _wusdaAmount = balanceOf(_msgSender());\n _usdaAmount = _wUSDAToUSDA(_wusdaAmount, _usdaSupply());\n _withdraw(_msgSender(), _msgSender(), _usdaAmount, _wusdaAmount);\n }\n function withdrawAll() external override returns (uint256 _wusdaAmount) {\n _wusdaAmount = balanceOf(_msgSender());\n uint256 _usdaAmount = _wUSDAToUSDA(_wusdaAmount, _usdaSupply());\n _withdraw(_msgSender(), _msgSender(), _usdaAmount, _wusdaAmount);\n }\n```\n`link to code :` core/solidity/contracts/core/WUSDA.sol", "vulnerable_code": "function burnAll() external override returns (uint256 _usdaAmount) {\n uint256 _wusdaAmount = balanceOf(_msgSender());\n _usdaAmount = _wUSDAToUSDA(_wusdaAmount, _usdaSupply());\n _withdraw(_msgSender(), _msgSender(), _usdaAmount, _wusdaAmount);\n }\n function withdrawAll() external override returns (uint256 _wusdaAmount) {\n _wusdaAmount = balanceOf(_msgSender());\n uint256 _usdaAmount = _wUSDAToUSDA(_wusdaAmount, _usdaSupply());\n _withdraw(_msgSender(), _msgSender(), _usdaAmount, _wusdaAmount);\n }", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/VIELITE-Q.md", "collected_at": "2026-01-02T18:23:38.107091+00:00", "source_hash": "108acbd03817a499b50ee26931507133deb7e8f62739eb1d922f4be95f2c659b", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 518, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function burnAll() external override returns (uint256 _usdaAmount) {\n uint256 _wusdaAmount = balanceOf(_msgSender());\n _usdaAmount = _wUSDAToUSDA(_wusdaAmount, _usdaSupply());\n _withdraw(_msgSender(), _msgSender(), _usdaAmount, _wusdaAmount);\n }\n function withdrawAll() external override returns (uint256 _wusdaAmount) {\n _wusdaAmount = balanceOf(_msgSender());\n uint256 _usdaAmount = _wUSDAToUSDA(_wusdaAmount, _usdaSupply());\n _withdraw(_msgSender(), _msgSender(), _usdaAmount, _wusdaAmount);\n }", "primary_code_language": "solidity", "primary_code_char_count": 518, "all_code_blocks": "// Code block 1 (solidity):\nfunction burnAll() external override returns (uint256 _usdaAmount) {\n uint256 _wusdaAmount = balanceOf(_msgSender());\n _usdaAmount = _wUSDAToUSDA(_wusdaAmount, _usdaSupply());\n _withdraw(_msgSender(), _msgSender(), _usdaAmount, _wusdaAmount);\n }\n function withdrawAll() external override returns (uint256 _wusdaAmount) {\n _wusdaAmount = balanceOf(_msgSender());\n uint256 _usdaAmount = _wUSDAToUSDA(_wusdaAmount, _usdaSupply());\n _withdraw(_msgSender(), _msgSender(), _usdaAmount, _wusdaAmount);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function burnAll() external override returns (uint256 _usdaAmount) {\n uint256 _wusdaAmount = balanceOf(_msgSender());\n _usdaAmount = _wUSDAToUSDA(_wusdaAmount, _usdaSupply());\n _withdraw(_msgSender(), _msgSender(), _usdaAmount, _wusdaAmount);\n }\n function withdrawAll() external override returns (uint256 _wusdaAmount) {\n _wusdaAmount = balanceOf(_msgSender());\n uint256 _usdaAmount = _wUSDAToUSDA(_wusdaAmount, _usdaSupply());\n _withdraw(_msgSender(), _msgSender(), _usdaAmount, _wusdaAmount);\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function burnAll() external override returns (uint256 _usdaAmount) {\n uint256 _wusdaAmount = balanceOf(_msgSender());\n _usdaAmount = _wUSDAToUSDA(_wusdaAmount, _usdaSupply());\n _withdraw(_msgSender(), _msgSender(), _usdaAmount, _wusdaAmount);\n }\n function withdrawAll() external override returns (uint256 _wusdaAmount) {\n _wusdaAmount = balanceOf(_msgSender());\n uint256 _usdaAmount = _wUSDAToUSDA(_wusdaAmount, _usdaSupply());\n _withdraw(_msgSender(), _msgSender(), _usdaAmount, _wusdaAmount);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 3.3} {"source": "c4", "protocol": "08-dopex", "title": "Baki G", "severity_raw": "Low", "severity": "low", "description": "## G-01 Calculate minOut only if minAmount == 0 \n\n## Details \nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/core/RdpxV2Core.sol#L545\n\nIf `minAmount` is > 0 , then we should not calculate `minOut` as it is a gas wastage.\n\nso instead what we can do is\n```solidity\n if (minAmount == 0) {\n minAmount = _ethToDpxEth\n ? (((_amount * getDpxEthPrice()) / 1e8) -\n (((_amount * getDpxEthPrice()) * slippageTolerance) / 1e16))\n : (((_amount * getEthPrice()) / 1e8) -\n (((_amount * getEthPrice()) * slippageTolerance) / 1e16));\n }\n\n // Swap the tokens\n amountOut = dpxEthCurvePool.exchange(\n _ethToDpxEth ? int128(int256(a)) : int128(int256(b)),\n _ethToDpxEth ? int128(int256(b)) : int128(int256(a)),\n _amount,\n minAmount\n );\n```\n\n## G-02 Only compute strike & timeToExpiry if needed\n\n### Details\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/core/RdpxV2Core.sol#L1189\n\nOnly compute `strike` & `timeToExpiry` if `putOptionsRequired` == true \n\nso instead what we can do is\n\n```solidity\n\n if (putOptionsRequired) {\n uint256 timeToExpiry = IPerpetualAtlanticVault(\n addresses.perpetualAtlanticVault\n ).nextFundingPaymentTimestamp() - block.timestamp;\n\n uint256 strike = IPerpetualAtlanticVault(addresses.perpetualAtlanticVault)\n .roundUp(rdpxPrice - (rdpxPrice / 4)); // 25% below the current price\n\n wethRequired += IPerpetualAtlanticVault(addresses.perpetualAtlanticVault)\n .calculatePremium(strike, rdpxRequired, timeToExpiry, 0);\n }\n```\n\n## G-03 token balances are tracked separately on storage costing extra gas \n\nthere are some instances like https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/amo/UniV2LiquidityAmo.sol#L54 & https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/IRdpxV2Core.sol#L45 where token balances are tracked in a separately in storage rather ", "vulnerable_code": " if (minAmount == 0) {\n minAmount = _ethToDpxEth\n ? (((_amount * getDpxEthPrice()) / 1e8) -\n (((_amount * getDpxEthPrice()) * slippageTolerance) / 1e16))\n : (((_amount * getEthPrice()) / 1e8) -\n (((_amount * getEthPrice()) * slippageTolerance) / 1e16));\n }\n\n // Swap the tokens\n amountOut = dpxEthCurvePool.exchange(\n _ethToDpxEth ? int128(int256(a)) : int128(int256(b)),\n _ethToDpxEth ? int128(int256(b)) : int128(int256(a)),\n _amount,\n minAmount\n );", "fixed_code": " if (putOptionsRequired) {\n uint256 timeToExpiry = IPerpetualAtlanticVault(\n addresses.perpetualAtlanticVault\n ).nextFundingPaymentTimestamp() - block.timestamp;\n\n uint256 strike = IPerpetualAtlanticVault(addresses.perpetualAtlanticVault)\n .roundUp(rdpxPrice - (rdpxPrice / 4)); // 25% below the current price\n\n wethRequired += IPerpetualAtlanticVault(addresses.perpetualAtlanticVault)\n .calculatePremium(strike, rdpxRequired, timeToExpiry, 0);\n }", "recommendation": "", "category": "slippage", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/Baki-G.md", "collected_at": "2026-01-02T18:24:31.727654+00:00", "source_hash": "108c1b397cca143de7d705646a57b06695f823de528332994e27bfe620f540bd", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 996, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "if (minAmount == 0) {\n minAmount = _ethToDpxEth\n ? (((_amount * getDpxEthPrice()) / 1e8) -\n (((_amount * getDpxEthPrice()) * slippageTolerance) / 1e16))\n : (((_amount * getEthPrice()) / 1e8) -\n (((_amount * getEthPrice()) * slippageTolerance) / 1e16));\n }\n\n // Swap the tokens\n amountOut = dpxEthCurvePool.exchange(\n _ethToDpxEth ? int128(int256(a)) : int128(int256(b)),\n _ethToDpxEth ? int128(int256(b)) : int128(int256(a)),\n _amount,\n minAmount\n );", "primary_code_language": "solidity", "primary_code_char_count": 510, "all_code_blocks": "// Code block 1 (solidity):\nif (minAmount == 0) {\n minAmount = _ethToDpxEth\n ? (((_amount * getDpxEthPrice()) / 1e8) -\n (((_amount * getDpxEthPrice()) * slippageTolerance) / 1e16))\n : (((_amount * getEthPrice()) / 1e8) -\n (((_amount * getEthPrice()) * slippageTolerance) / 1e16));\n }\n\n // Swap the tokens\n amountOut = dpxEthCurvePool.exchange(\n _ethToDpxEth ? int128(int256(a)) : int128(int256(b)),\n _ethToDpxEth ? int128(int256(b)) : int128(int256(a)),\n _amount,\n minAmount\n );\n\n// Code block 2 (solidity):\nif (putOptionsRequired) {\n uint256 timeToExpiry = IPerpetualAtlanticVault(\n addresses.perpetualAtlanticVault\n ).nextFundingPaymentTimestamp() - block.timestamp;\n\n uint256 strike = IPerpetualAtlanticVault(addresses.perpetualAtlanticVault)\n .roundUp(rdpxPrice - (rdpxPrice / 4)); // 25% below the current price\n\n wethRequired += IPerpetualAtlanticVault(addresses.perpetualAtlanticVault)\n .calculatePremium(strike, rdpxRequired, timeToExpiry, 0);\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "if (minAmount == 0) {\n minAmount = _ethToDpxEth\n ? (((_amount * getDpxEthPrice()) / 1e8) -\n (((_amount * getDpxEthPrice()) * slippageTolerance) / 1e16))\n : (((_amount * getEthPrice()) / 1e8) -\n (((_amount * getEthPrice()) * slippageTolerance) / 1e16));\n }\n\n // Swap the tokens\n amountOut = dpxEthCurvePool.exchange(\n _ethToDpxEth ? int128(int256(a)) : int128(int256(b)),\n _ethToDpxEth ? int128(int256(b)) : int128(int256(a)),\n _amount,\n minAmount\n );\n\nif (putOptionsRequired) {\n uint256 timeToExpiry = IPerpetualAtlanticVault(\n addresses.perpetualAtlanticVault\n ).nextFundingPaymentTimestamp() - block.timestamp;\n\n uint256 strike = IPerpetualAtlanticVault(addresses.perpetualAtlanticVault)\n .roundUp(rdpxPrice - (rdpxPrice / 4)); // 25% below the current price\n\n wethRequired += IPerpetualAtlanticVault(addresses.perpetualAtlanticVault)\n .calculatePremium(strike, rdpxRequired, timeToExpiry, 0);\n }", "github_refs_formatted": "RdpxV2Core.sol#L545, RdpxV2Core.sol#L1189, UniV2LiquidityAmo.sol#L54, IRdpxV2Core.sol#L45", "github_files_list": "RdpxV2Core.sol, IRdpxV2Core.sol, UniV2LiquidityAmo.sol", "github_refs_count": 4, "vulnerable_code_actual": " if (minAmount == 0) {\n minAmount = _ethToDpxEth\n ? (((_amount * getDpxEthPrice()) / 1e8) -\n (((_amount * getDpxEthPrice()) * slippageTolerance) / 1e16))\n : (((_amount * getEthPrice()) / 1e8) -\n (((_amount * getEthPrice()) * slippageTolerance) / 1e16));\n }\n\n // Swap the tokens\n amountOut = dpxEthCurvePool.exchange(\n _ethToDpxEth ? int128(int256(a)) : int128(int256(b)),\n _ethToDpxEth ? int128(int256(b)) : int128(int256(a)),\n _amount,\n minAmount\n );", "has_vulnerable_code_snippet": true, "fixed_code_actual": " if (putOptionsRequired) {\n uint256 timeToExpiry = IPerpetualAtlanticVault(\n addresses.perpetualAtlanticVault\n ).nextFundingPaymentTimestamp() - block.timestamp;\n\n uint256 strike = IPerpetualAtlanticVault(addresses.perpetualAtlanticVault)\n .roundUp(rdpxPrice - (rdpxPrice / 4)); // 25% below the current price\n\n wethRequired += IPerpetualAtlanticVault(addresses.perpetualAtlanticVault)\n .calculatePremium(strike, rdpxRequired, timeToExpiry, 0);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "02-ai-arena", "title": "MrPotatoMagic Q", "severity_raw": "Critical", "severity": "critical", "description": "# Quality Assurance\n\n| ID | Issues |\n|--------|-------------------------------------------------------------------------------------------------------------------------------------------|\n| [L-01] | 0 value function calls can spam off-chain tracking system |\n| [L-02] | Function spendVoltage() only allows spending 255 voltage maximum |\n| [L-03] | Avoid hardcoding tokenId 0 for battery game item |\n| [L-04] | Owner address is not provided admin access on transferOwnership() |\n| [L-05] | Admin access of previous owner is not revoked when ownership is transferred |\n| [L-06] | Function updateFighterStaking() is not updated if user loses all his stake and round ends |\n| [L-07] | Incorrect use of < instead of <= allows minting maximum of 1 NRN token less than expected total supply of 1 billion |\n| [L-08] | Consider pausing/access controlling function burn() initially for a guarded launch |\n| [L-09] | Transferring/selling Fighter NFT before winners are picked causes loss of reward NFT to previous owner |\n| [L-10] | Function claimRewards() does not check if the custom attribute values for weight and element fall in range [65,95] and [0,2] respectively |\n| [L-11] | Nested for loops in function claimRewards() can DOS due to OOG exception |\n| [L-12] | Attac", "vulnerable_code": "File: VoltageManager.sol\n109: function spendVoltage(address spender, uint8 voltageSpent) public {\n110: require(spender == msg.sender || allowedVoltageSpenders[msg.sender]);\n111: if (ownerVoltageReplenishTime[spender] <= block.timestamp) {\n112: _replenishVoltage(spender);\n113: }\n114: ownerVoltage[spender] -= voltageSpent;\n115: emit VoltageRemaining(spender, ownerVoltage[spender]);\n116: }", "fixed_code": "File: Neuron.sol\n147: function claim(uint256 amount) external {\n148: \n149: require(\n150: allowance(treasuryAddress, msg.sender) >= amount, \n151: \"ERC20: claim amount exceeds allowance\"\n152: );\n153: \n154: transferFrom(treasuryAddress, msg.sender, amount);\n155: emit TokensClaimed(msg.sender, amount);\n156: }\n157: ", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/MrPotatoMagic-Q.md", "collected_at": "2026-01-02T19:02:35.392532+00:00", "source_hash": "1091cd3c8621e2abcc601354dec4c9e857e353d49cd2039e8ffe336b630a02e5", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: VoltageManager.sol\n109: function spendVoltage(address spender, uint8 voltageSpent) public {\n110: require(spender == msg.sender || allowedVoltageSpenders[msg.sender]);\n111: if (ownerVoltageReplenishTime[spender] <= block.timestamp) {\n112: _replenishVoltage(spender);\n113: }\n114: ownerVoltage[spender] -= voltageSpent;\n115: emit VoltageRemaining(spender, ownerVoltage[spender]);\n116: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: Neuron.sol\n147: function claim(uint256 amount) external {\n148: \n149: require(\n150: allowance(treasuryAddress, msg.sender) >= amount, \n151: \"ERC20: claim amount exceeds allowance\"\n152: );\n153: \n154: transferFrom(treasuryAddress, msg.sender, amount);\n155: emit TokensClaimed(msg.sender, amount);\n156: }\n157: ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-biconomy", "title": "darkbluedot Q", "severity_raw": "High", "severity": "high", "description": "Quality Assurance - \n\nSimple Account - \n\n1 - The function call in the modifier is not necessary, we can also use this in the modifier and achieve the same results. The use of the modifier is suggested as that makes the code clean and readable. Also, it saves some gas on the way as well. So, instead of writing the modifier the way it's written, it can also be written as \n```\n modifier onlyOwner(){\n require(msg.sender == address(this) || owner == msg.sender , \"Only Owner\");\n _;\n }\n```\nAlso, you can see that here the msg.sender == address(this) is written first, and then the other check is written. This is because the probability that the calling node is not a contract and just an EOA is higher so, the if statement will short-circuit and will not check the other statement. This will in turn save some gas costs in execution. \n\n2 - The function requireFromEntryPointOrOwner is used as a guard check in many functions. It's suggested to use a modifier to add guard checks rather than calling this function everywhere. \n", "vulnerable_code": " modifier onlyOwner(){\n require(msg.sender == address(this) || owner == msg.sender , \"Only Owner\");\n _;\n }", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/darkbluedot-Q.md", "collected_at": "2026-01-02T18:13:41.409895+00:00", "source_hash": "109630da12da0fbf8a7ab5d62391fd5c0bf9d8cc6652296ebc0732e8e94c479a", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 123, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "modifier onlyOwner(){\n require(msg.sender == address(this) || owner == msg.sender , \"Only Owner\");\n _;\n }", "primary_code_language": "unknown", "primary_code_char_count": 123, "all_code_blocks": "// Code block 1 (unknown):\nmodifier onlyOwner(){\n require(msg.sender == address(this) || owner == msg.sender , \"Only Owner\");\n _;\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " modifier onlyOwner(){\n require(msg.sender == address(this) || owner == msg.sender , \"Only Owner\");\n _;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.09} {"source": "c4", "protocol": "03-asymmetry", "title": "Shubham G", "severity_raw": "Medium", "severity": "medium", "description": "## Gas Optimizations\n\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [GAS-01](#GAS-01) | With assembly, `.call (bool sent)` transfer can be done to optimize gas | 5 |\n| [GAS-02](#GAS-02) | Setting the constructor to `payable`| 4 |\n| [GAS-03](#GAS-03) | Make for loop unchecked | 7 |\n| [GAS-04](#GAS-04) | Unnecessary check in `if` condition | 1 |\n\n\n\n## [GAS-01] With assembly, `.call (bool sent)` transfer can be done to optimize gas \n\n\"(bool success, bytes memory returnData) = target.call()\" automatically copies the return data to memory even if you omit the returnData variable. \nIf a relayer executes transactions with such calls it can lead to a gas-griefing attack.\n\nIn the given contracts, it is advisable that `return` data `(bool sent,)` which by default is stored due to EVM architecture, is executed with the parameters \ninOffset, inSize, retOffset, retSize values set to (0,0,0,0). In this way, the storage disappears and gas optimization is provided.\n\nFor reference, refer to this thread\nhttps://twitter.com/pashovkrum/status/1607024043718316032?t=xs30iD6ORWtE2bTTYsCFIQ&s=19\n\n\n|Contract|Method|Before|After|Gas Saved|\n|:-|:-:|:-:|:-:|:-:|\n| Reth | deposit | 176462 | 176448 | 14 |\n| Reth | withdraw | 181057 | 181003 | 54 |\n| SafeEth | rebalanceToWeights | 727618 | 727388 | 230|\n| SafeEth | stake | 527253 | 527184 | 69 |\n| SafeEth | unstake | 516303 | 516075 | 228|\n| SafeEthV2Mock | adminWithdrawDerivative | 195722 | 195668 | 54|\n| [Total](#Total) | | | | [649](#649) |\n\n\nThere are 5 instances of the topic.\n**Before:**\n\n```solidity\nFile: 2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol\n\n60: (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n```\n```solidity\nFile: 2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol\n\n84: (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n\n```\n\n```solidity\nFile: 2023-03-asymmetry/blob/main/contracts/SafEth/derivat", "vulnerable_code": "File: 2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol\n\n60: (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );", "fixed_code": "File: 2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol\n\n84: (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Shubham-G.md", "collected_at": "2026-01-02T18:18:34.170445+00:00", "source_hash": "10d9bbbaa9aa855a81f689b4aa57fa4913893d71b705d329de061e884d029755", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 366, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: 2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol\n\n60: (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );", "primary_code_language": "solidity", "primary_code_char_count": 181, "all_code_blocks": "// Code block 1 (solidity):\nFile: 2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol\n\n60: (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n\n// Code block 2 (solidity):\nFile: 2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol\n\n84: (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: 2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol\n\n60: (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n\nFile: 2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol\n\n84: (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: 2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol\n\n60: (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: 2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol\n\n84: (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-revert-lend", "title": "dharma09 G", "severity_raw": "High", "severity": "high", "description": "\n## REVRT LEND GAS OPTIMIZATIONS\n\n## INTRODUCTION\n\nHighlighted below are optimizations exclusively targeting state-mutating functions and view/pure functions invoked by state-mutating functions. In the discussion that follows, only runtime gas is emphasized, given its inevitable dominance over deployment gas costs throughout the protocol's lifetime.\n\nPlease be aware that some code snippets may be shortened to conserve space, and certain code snippets may include @audit tags in comments to facilitate issue explanations.\n\n- [Re-arrange state variable order to save storage slots (Saves ~4000 Gas)](#g-01-re-arrange-state-variable-order-to-save-storage-slots-saves-4000-gas)\n- [Reduce the size of struct variables and pack them together to save storage slots(Instances Missed by bot)(Gas Saved ~ 4000 Gas)](#g-02-reduce-the-size-of-struct-variables-and-pack-them-together-to-save-storage-slotsinstances-missed-by-botgas-saved--4000-gas)\n- [Reorder accessing state variables in `execute` function to save gas \n](#g-03-reorder-accessing-state-variables-in-execute-function-to-save-gas)\n- [Cache repeated calculations to avoid recalculating the same values multiple times](#g-04-cache-repeated-calculations-to-avoid-recalculating-the-same-values-multiple-times)\n- [Cache calculations in loop to avoid re-calculating on each iteration](#g-05-cache-calculations-in-loop-to-avoid-re-calculating-on-each-iteration)\n- [Using YUL's selfbalance is cheaper than address(this).balance](#g-06-using-yuls-selfbalance-is-cheaper-than-addressthisbalance)\n- [Reduce Storage Access By not accessing positionBalances[tokenId][token] a second time to subtract amount](#g-07-reduce-storage-access-by-not-accessing-positionbalancestokenidtoken-a-second-time-to-subtract-amount)\n- [Utilize local variables instead of repeatedly accessing storage variables](#g-08-utilize-local-variables-instead-of-repeatedly-accessing-storage-variables)\n\n\n## Gas report\n\n**Note: The issues addressed here were not reported by the bot, f", "vulnerable_code": "File: src/V3Oracle.sol\n25: uint16 public constant MIN_PRICE_DIFFERENCE = 200; //2% /@audit pack\n\n uint256 private constant Q96 = 2 ** 96;\n uint256 private constant Q128 = 2 ** 128;", "fixed_code": "### Instances 2\n\nWe can re-arrange the order of V3vault.sol to save 1 storage slot (~2000 Gas) pack emergencyAdmin address with MIN_RESERVE_PROTECTION_FACTOR_X32address\n### Proof of Code\n- [V3Vault.sol#L167](https://github.com/code-423n4/2024-03-revert-lend/blob/main/src/V3Vault.sol#L167)", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/dharma09-G.md", "collected_at": "2026-01-02T19:03:10.495436+00:00", "source_hash": "113730268553a5bc5e1bd6b5f1592d2d89fdaaed97e43a5a16cbc943d1342c48", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "V3Vault.sol#L167", "github_files_list": "V3Vault.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: src/V3Oracle.sol\n25: uint16 public constant MIN_PRICE_DIFFERENCE = 200; //2% /@audit pack\n\n uint256 private constant Q96 = 2 ** 96;\n uint256 private constant Q128 = 2 ** 128;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "### Instances 2\n\nWe can re-arrange the order of V3vault.sol to save 1 storage slot (~2000 Gas) pack emergencyAdmin address with MIN_RESERVE_PROTECTION_FACTOR_X32address\n### Proof of Code\n- [V3Vault.sol#L167](https://github.com/code-423n4/2024-03-revert-lend/blob/main/src/V3Vault.sol#L167)", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "09-ondo", "title": "Raihan Q", "severity_raw": "Critical", "severity": "critical", "description": "# [L-01] Reentrancy Vulnerability in DestinationBridge._mintIfThresholdMet Function\n\nThe function _mintIfThresholdMet(bytes32) in the DestinationBridge contract is vulnerable to a reentrancy attack. This is due to external calls being made before state variables are updated.\n\nDetails\nThe _mintIfThresholdMet(bytes32) function makes external calls to ALLOWLIST.setAccountStatus(txn.sender,ALLOWLIST.getValidTermIndexes()[0],true) and TOKEN.mint(txn.sender,txn.amount). After these calls, the state variable txnHashToTransaction[txnHash] is deleted. This order of operations opens up the potential for a reentrancy attack.\n\nCode Snippet\n\n```solidity\n337: function _mintIfThresholdMet(bytes32 txnHash) internal {\n338: bool thresholdMet = _checkThresholdMet(txnHash);\n339: Transaction memory txn = txnHashToTransaction[txnHash];\n340: if (thresholdMet) {\n341: _checkAndUpdateInstantMintLimit(txn.amount);\n342: if (!ALLOWLIST.isAllowed(txn.sender)) {\n343: ALLOWLIST.setAccountStatus(\n344: txn.sender,\n345: ALLOWLIST.getValidTermIndexes()[0],\n346: true\n347: );\n348: }\n349: TOKEN.mint(txn.sender, txn.amount);\n350: delete txnHashToTransaction[txnHash];\n351: emit BridgeCompleted(txn.sender, txn.amount);\n352: }\n353: }\n```\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/DestinationBridge.sol#L337-L353\n\n### Recommendation\nTo mitigate this issue, the check-effects-interactions pattern should be applied. This means that all the state changes should be made before calling external contracts. This can prevent potential reentrancy attacks. The state variable txnHashToTransaction[txnHash] should be deleted before the external calls to ALLOWLIST.setAccountStatus and TOKEN.mint.\n\n# [L-02] Variable Shadowing in DestinationBridge Constructor\nThe _owner variable in the DestinationBridge constructor shadows the _owner state variable from the Ownable contrac", "vulnerable_code": "337: function _mintIfThresholdMet(bytes32 txnHash) internal {\n338: bool thresholdMet = _checkThresholdMet(txnHash);\n339: Transaction memory txn = txnHashToTransaction[txnHash];\n340: if (thresholdMet) {\n341: _checkAndUpdateInstantMintLimit(txn.amount);\n342: if (!ALLOWLIST.isAllowed(txn.sender)) {\n343: ALLOWLIST.setAccountStatus(\n344: txn.sender,\n345: ALLOWLIST.getValidTermIndexes()[0],\n346: true\n347: );\n348: }\n349: TOKEN.mint(txn.sender, txn.amount);\n350: delete txnHashToTransaction[txnHash];\n351: emit BridgeCompleted(txn.sender, txn.amount);\n352: }\n353: }", "fixed_code": "60: constructor(\n61: address _token,\n62: address _axelarGateway,\n63: address _allowlist,\n64: address _ondoApprover,\n65: address _owner,\n66: uint256 _mintLimit,\n67: uint256 _mintDuration\n68: )", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/Raihan-Q.md", "collected_at": "2026-01-02T18:25:38.538962+00:00", "source_hash": "113a2fab6363a79e7dd331b8db7cdd06e743d940d56e7dd107fa1bd93c69d4aa", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 691, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "337: function _mintIfThresholdMet(bytes32 txnHash) internal {\n338: bool thresholdMet = _checkThresholdMet(txnHash);\n339: Transaction memory txn = txnHashToTransaction[txnHash];\n340: if (thresholdMet) {\n341: _checkAndUpdateInstantMintLimit(txn.amount);\n342: if (!ALLOWLIST.isAllowed(txn.sender)) {\n343: ALLOWLIST.setAccountStatus(\n344: txn.sender,\n345: ALLOWLIST.getValidTermIndexes()[0],\n346: true\n347: );\n348: }\n349: TOKEN.mint(txn.sender, txn.amount);\n350: delete txnHashToTransaction[txnHash];\n351: emit BridgeCompleted(txn.sender, txn.amount);\n352: }\n353: }", "primary_code_language": "solidity", "primary_code_char_count": 691, "all_code_blocks": "// Code block 1 (solidity):\n337: function _mintIfThresholdMet(bytes32 txnHash) internal {\n338: bool thresholdMet = _checkThresholdMet(txnHash);\n339: Transaction memory txn = txnHashToTransaction[txnHash];\n340: if (thresholdMet) {\n341: _checkAndUpdateInstantMintLimit(txn.amount);\n342: if (!ALLOWLIST.isAllowed(txn.sender)) {\n343: ALLOWLIST.setAccountStatus(\n344: txn.sender,\n345: ALLOWLIST.getValidTermIndexes()[0],\n346: true\n347: );\n348: }\n349: TOKEN.mint(txn.sender, txn.amount);\n350: delete txnHashToTransaction[txnHash];\n351: emit BridgeCompleted(txn.sender, txn.amount);\n352: }\n353: }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "337: function _mintIfThresholdMet(bytes32 txnHash) internal {\n338: bool thresholdMet = _checkThresholdMet(txnHash);\n339: Transaction memory txn = txnHashToTransaction[txnHash];\n340: if (thresholdMet) {\n341: _checkAndUpdateInstantMintLimit(txn.amount);\n342: if (!ALLOWLIST.isAllowed(txn.sender)) {\n343: ALLOWLIST.setAccountStatus(\n344: txn.sender,\n345: ALLOWLIST.getValidTermIndexes()[0],\n346: true\n347: );\n348: }\n349: TOKEN.mint(txn.sender, txn.amount);\n350: delete txnHashToTransaction[txnHash];\n351: emit BridgeCompleted(txn.sender, txn.amount);\n352: }\n353: }", "github_refs_formatted": "DestinationBridge.sol#L337-L353", "github_files_list": "DestinationBridge.sol", "github_refs_count": 1, "vulnerable_code_actual": "337: function _mintIfThresholdMet(bytes32 txnHash) internal {\n338: bool thresholdMet = _checkThresholdMet(txnHash);\n339: Transaction memory txn = txnHashToTransaction[txnHash];\n340: if (thresholdMet) {\n341: _checkAndUpdateInstantMintLimit(txn.amount);\n342: if (!ALLOWLIST.isAllowed(txn.sender)) {\n343: ALLOWLIST.setAccountStatus(\n344: txn.sender,\n345: ALLOWLIST.getValidTermIndexes()[0],\n346: true\n347: );\n348: }\n349: TOKEN.mint(txn.sender, txn.amount);\n350: delete txnHashToTransaction[txnHash];\n351: emit BridgeCompleted(txn.sender, txn.amount);\n352: }\n353: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "60: constructor(\n61: address _token,\n62: address _axelarGateway,\n63: address _allowlist,\n64: address _ondoApprover,\n65: address _owner,\n66: uint256 _mintLimit,\n67: uint256 _mintDuration\n68: )", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "06-lybra", "title": "Co0nan Q", "severity_raw": "QA", "severity": "qa", "description": "1. setPools will reset the pools array if it's called with an empty array.\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/miner/EUSDMiningIncentives.sol#L93\n```\n function setPools(address[] memory _pools) external onlyOwner {\n for (uint i = 0; i < _pools.length; i++) {\n require(configurator.mintVault(_pools[i]), \"NOT_VAULT\");\n }\n //@audit-qa if the function called with 0 array length. it will resetr the pools. Must check it's > 0\n pools = _pools;\n }\n```\n\n2. User can front-run the TX which invoke `notifyRewardAmount` and stake large amount to profit from the reward.\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/miner/ProtocolRewardsPool.sol#L227\n```\nfunction notifyRewardAmount(uint amount, uint tokenType) external { // @audit-qa bot can fornt-run and stake large amount to before ditrbuiteRewards\n require(msg.sender == address(configurator));\n if (totalStaked() == 0) return;\n require(amount > 0, \"amount = 0\");\n if(tokenType == 0) {\n uint256 share = IEUSD(configurator.getEUSDAddress()).getSharesByMintedEUSD(amount);\n rewardPerTokenStored = rewardPerTokenStored + (share * 1e18) / totalStaked();\n } else if(tokenType == 1) {\n ERC20 token = ERC20(configurator.stableToken());\n rewardPerTokenStored = rewardPerTokenStored + (amount * 1e36 / token.decimals()) / totalStaked();\n } else {\n rewardPerTokenStored = rewardPerTokenStored + (amount * 1e18) / totalStaked();\n }\n }\n```\n\n3. `executeFlashloan` shouldn't be marked as payable, any ETH sent by mistake could be lost.\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/token/PeUSDMainnetStableVision.sol#L129\n\n4. Due to rounding error on `grabEsLBR` function when calculating the amount to be burned, an attacker can send 3 WEI as amount which will result attacker mint 3 WEI without burning any tokens due to the calculati", "vulnerable_code": " function setPools(address[] memory _pools) external onlyOwner {\n for (uint i = 0; i < _pools.length; i++) {\n require(configurator.mintVault(_pools[i]), \"NOT_VAULT\");\n }\n //@audit-qa if the function called with 0 array length. it will resetr the pools. Must check it's > 0\n pools = _pools;\n }", "fixed_code": "function notifyRewardAmount(uint amount, uint tokenType) external { // @audit-qa bot can fornt-run and stake large amount to before ditrbuiteRewards\n require(msg.sender == address(configurator));\n if (totalStaked() == 0) return;\n require(amount > 0, \"amount = 0\");\n if(tokenType == 0) {\n uint256 share = IEUSD(configurator.getEUSDAddress()).getSharesByMintedEUSD(amount);\n rewardPerTokenStored = rewardPerTokenStored + (share * 1e18) / totalStaked();\n } else if(tokenType == 1) {\n ERC20 token = ERC20(configurator.stableToken());\n rewardPerTokenStored = rewardPerTokenStored + (amount * 1e36 / token.decimals()) / totalStaked();\n } else {\n rewardPerTokenStored = rewardPerTokenStored + (amount * 1e18) / totalStaked();\n }\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/Co0nan-Q.md", "collected_at": "2026-01-02T18:22:14.682050+00:00", "source_hash": "11661a22d3530ff85facc514241b542078de293f24f6d78ee397ced648748331", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 1164, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function setPools(address[] memory _pools) external onlyOwner {\n for (uint i = 0; i < _pools.length; i++) {\n require(configurator.mintVault(_pools[i]), \"NOT_VAULT\");\n }\n //@audit-qa if the function called with 0 array length. it will resetr the pools. Must check it's > 0\n pools = _pools;\n }", "primary_code_language": "unknown", "primary_code_char_count": 333, "all_code_blocks": "// Code block 1 (unknown):\nfunction setPools(address[] memory _pools) external onlyOwner {\n for (uint i = 0; i < _pools.length; i++) {\n require(configurator.mintVault(_pools[i]), \"NOT_VAULT\");\n }\n //@audit-qa if the function called with 0 array length. it will resetr the pools. Must check it's > 0\n pools = _pools;\n }\n\n// Code block 2 (unknown):\nfunction notifyRewardAmount(uint amount, uint tokenType) external { // @audit-qa bot can fornt-run and stake large amount to before ditrbuiteRewards\n require(msg.sender == address(configurator));\n if (totalStaked() == 0) return;\n require(amount > 0, \"amount = 0\");\n if(tokenType == 0) {\n uint256 share = IEUSD(configurator.getEUSDAddress()).getSharesByMintedEUSD(amount);\n rewardPerTokenStored = rewardPerTokenStored + (share * 1e18) / totalStaked();\n } else if(tokenType == 1) {\n ERC20 token = ERC20(configurator.stableToken());\n rewardPerTokenStored = rewardPerTokenStored + (amount * 1e36 / token.decimals()) / totalStaked();\n } else {\n rewardPerTokenStored = rewardPerTokenStored + (amount * 1e18) / totalStaked();\n }\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "EUSDMiningIncentives.sol#L93, ProtocolRewardsPool.sol#L227, PeUSDMainnetStableVision.sol#L129", "github_files_list": "EUSDMiningIncentives.sol, ProtocolRewardsPool.sol, PeUSDMainnetStableVision.sol", "github_refs_count": 3, "vulnerable_code_actual": " function setPools(address[] memory _pools) external onlyOwner {\n for (uint i = 0; i < _pools.length; i++) {\n require(configurator.mintVault(_pools[i]), \"NOT_VAULT\");\n }\n //@audit-qa if the function called with 0 array length. it will resetr the pools. Must check it's > 0\n pools = _pools;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function notifyRewardAmount(uint amount, uint tokenType) external { // @audit-qa bot can fornt-run and stake large amount to before ditrbuiteRewards\n require(msg.sender == address(configurator));\n if (totalStaked() == 0) return;\n require(amount > 0, \"amount = 0\");\n if(tokenType == 0) {\n uint256 share = IEUSD(configurator.getEUSDAddress()).getSharesByMintedEUSD(amount);\n rewardPerTokenStored = rewardPerTokenStored + (share * 1e18) / totalStaked();\n } else if(tokenType == 1) {\n ERC20 token = ERC20(configurator.stableToken());\n rewardPerTokenStored = rewardPerTokenStored + (amount * 1e36 / token.decimals()) / totalStaked();\n } else {\n rewardPerTokenStored = rewardPerTokenStored + (amount * 1e18) / totalStaked();\n }\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "10-badger", "title": "petrichor G", "severity_raw": "High", "severity": "high", "description": "# GAS OPTIMIZATION\n\n# SUMMARY\n| | issue | instance |\n|------|---------|------------|\n|[G\u201101]|Optimize External Calls with Assembly for Memory Efficiency|115|\n|[G\u201102]|Use assembly to validate\u00a0msg.sender |22|\n|[G\u201103]|Avoid contract existence checks by using low level calls|19|\n|[G\u201104]|\u00a0>=\u00a0costs less gas than\u00a0>|14|\n|[G\u201105]|Amounts should be checked for 0 before calling a transfer|6|\n|[G\u201106]|Functions guaranteed to revert when called by normal users can be marked\u00a0payable|11|\n|[G\u201107]|Structs can be modified to fit in fewer storage slots|17|\n|[G\u201108]| Use constants instead of type(uintx).max|19|\n|[G\u201109]|Using storage instead of memory for structs/arrays saves gas|38|\n|[G\u201110]|Can Make The Variable Outside The Loop To Save Gas |4|\n|[G\u201111]|Use Modifiers Instead of Functions To Save Gas|9|\n|[G\u201112]|\u00a0bytes\u00a0constants are more eficient than\u00a0string\u00a0constans|12|\n|[G\u201113]|Use assembly to hash instead of solidity|8|\n|[G\u201114]|internal functions only called once can be inlined to save gas|20|\n|[G\u201115]|Use nested if statements instead of &&|15|\n|[G\u201116]|Do-While loops are cheaper than for loops|3|\n|[G\u201117]|Use hardcode address instead address(this)|17|\n|[G\u201118]|Not using the named return variables when a function returns, wastes deployment gas|7|\n|[G\u201119]|Unnecessary computation|3|\n|[G\u201120]|Pre-increment and pre-decrement are cheaper than +1 ,-1|6|\n|[G\u201121]|Structs can be packed to use fewer storage slots|3|\n|[G\u201122]|abi.encode()\u00a0is less efficient than\u00a0abi.encodePacked()|2|\n|[G\u201123]|Use assembly in place of abi.decode to extract calldata values more efficiently|4|\n|[G\u201124]|Use of += is cheaper for mappings|2|\n|[G\u201125]|Use assembly to write address storage values|6|\n|[G\u201126]|Splitting\u00a0\u00a0Require() Statements That Use\u00a0\u00a0&& Saves |9|\n|[G\u201127]|Sort Solidity operations using short-circuit mode|2|\n|[G\u201128]|Avoid updating storage when the value hasn't changed|12|\n|[G\u201129]| Multiple Address/id Mappings Can Be Combined Into A Single Mapping Of An Address/id To A Struct, Where Appropriate|2|\n|[G\u201130]| Use ass", "vulnerable_code": "File: packages/contracts/contracts/HintHelpers.sol\n72 vars.currentCdpId = sortedCdps.getPrev(vars.currentCdpId);\n vars.currentCdpUser = sortedCdps.getOwnerAddress(vars.currentCdpId);\n\n\n90 uint256 currentCdpDebt = cdpManager.getSyncedCdpDebt(vars.currentCdpId);\n\n116 vars.currentCdpId = sortedCdps.getPrev(vars.currentCdpId);\n vars.currentCdpUser = sortedCdps.getOwnerAddress(vars.currentCdpId);\n\n141 uint256 newCollShare = cdpManager.getSyncedCdpCollShares(vars.currentCdpId);\n\n169 uint256 arrayLength = cdpManager.getActiveCdpsCount();\n\n175 hint = sortedCdps.getLast();\n\n185 bytes32 _cId = cdpManager.getIdFromCdpIdsArray(arrayIndex);\n uint256 currentNICR = cdpManager.getSyncedNominalICR(_cId); \n", "fixed_code": "File: packages/contracts/contracts/LeverageMacroBase.sol\n143 initialCdpIndex = sortedCdps.cdpCountOf(address(this));\n\n148 IERC3156FlashLender(address(borrowerOperations)).flashLoan(\n\n155 IERC3156FlashLender(address(activePool)).flashLoan(\n\n173 bytes32 cdpId = sortedCdps.cdpOfOwnerByIndex(address(this), initialCdpIndex);\n\n187 ICdpManagerData.Cdp memory cdpInfo = cdpManager.Cdps(checkParams.cdpId);\n\n199 ICdpManagerData.Cdp memory cdpInfo = cdpManager.Cdps(checkParams.cdpId);\n\n220 uint256 ebtcBal = ebtcToken.balanceOf(address(this));\n uint256 collateralBal = stETH.sharesOf(address(this));\n\n224 ebtcToken.transfer(msg.sender, ebtcBal);\n\n228 stETH.transferShares(msg.sender, collateralBal);\n\n237 IERC20(token).safeTransfer(msg.sender, amount);\n\n405 IERC20(swapData.tokenForSwap).safeApprove(\n\n427 IERC20(swapData.tokenForSwap).safeApprove(swapData.addressForApprove, 0); ", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/petrichor-G.md", "collected_at": "2026-01-02T18:27:00.364171+00:00", "source_hash": "1187e7c17f4ffb735af673a8c2314cc3e9dcc29bf5cb5cc280a6c76752a6dff6", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: packages/contracts/contracts/HintHelpers.sol\n72 vars.currentCdpId = sortedCdps.getPrev(vars.currentCdpId);\n vars.currentCdpUser = sortedCdps.getOwnerAddress(vars.currentCdpId);\n\n\n90 uint256 currentCdpDebt = cdpManager.getSyncedCdpDebt(vars.currentCdpId);\n\n116 vars.currentCdpId = sortedCdps.getPrev(vars.currentCdpId);\n vars.currentCdpUser = sortedCdps.getOwnerAddress(vars.currentCdpId);\n\n141 uint256 newCollShare = cdpManager.getSyncedCdpCollShares(vars.currentCdpId);\n\n169 uint256 arrayLength = cdpManager.getActiveCdpsCount();\n\n175 hint = sortedCdps.getLast();\n\n185 bytes32 _cId = cdpManager.getIdFromCdpIdsArray(arrayIndex);\n uint256 currentNICR = cdpManager.getSyncedNominalICR(_cId); \n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: packages/contracts/contracts/LeverageMacroBase.sol\n143 initialCdpIndex = sortedCdps.cdpCountOf(address(this));\n\n148 IERC3156FlashLender(address(borrowerOperations)).flashLoan(\n\n155 IERC3156FlashLender(address(activePool)).flashLoan(\n\n173 bytes32 cdpId = sortedCdps.cdpOfOwnerByIndex(address(this), initialCdpIndex);\n\n187 ICdpManagerData.Cdp memory cdpInfo = cdpManager.Cdps(checkParams.cdpId);\n\n199 ICdpManagerData.Cdp memory cdpInfo = cdpManager.Cdps(checkParams.cdpId);\n\n220 uint256 ebtcBal = ebtcToken.balanceOf(address(this));\n uint256 collateralBal = stETH.sharesOf(address(this));\n\n224 ebtcToken.transfer(msg.sender, ebtcBal);\n\n228 stETH.transferShares(msg.sender, collateralBal);\n\n237 IERC20(token).safeTransfer(msg.sender, amount);\n\n405 IERC20(swapData.tokenForSwap).safeApprove(\n\n427 IERC20(swapData.tokenForSwap).safeApprove(swapData.addressForApprove, 0); ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-salty", "title": "Sathish9098 Analysis", "severity_raw": "Critical", "severity": "critical", "description": "# Salty.IO Analysis\n\n## Overview\nSalty.IO is a Decentralized Exchange (DEX) built on the Ethereum blockchain, featuring an innovative Automatic Atomic Arbitrage (AAA) mechanism. This mechanism seeks to capitalize on market inefficiencies during token swaps, generating profits which are then distributed among liquidity providers and stakers. Salty.IO also introduces USDS, an overcollateralized ERC20 stablecoin, backed by WBTC/WETH LP tokens. The platform is wholly decentralized from inception, with governance, parameters, and contract operations controlled by a Decentralized Autonomous Organization (DAO). Salty.IO emphasizes zero fees on swaps, enhancing its attractiveness to users. It uses a mix of Chainlink, Uniswap v3 TWAP, and its own reserve data to maintain accurate price feeds, ensuring robustness and resilience against market manipulation.\n \n## Systemic risks\n \n### Oracle Reliability and Manipulation\n\n#### Chainlink Oracle Risks (CoreChainlinkFeed Contract):\n\n``Data Source Centralization``: Chainlink, while decentralized, still relies on a set of node operators to provide data. If these nodes are compromised or colluded, it might lead to false data being fed into the system.\n\n ``Time Lag in Data Updates``: Prices provided by Chainlink are not real-time; they have a certain latency. Rapid market movements might not be reflected immediately in the oracle data, leading to temporal arbitrage opportunities.\n\n ``Smart Contract Integration Risk``: The integration of Chainlink oracles within the CoreChainlinkFeed contract requires careful handling of data retrieval and error checking. Mismanagement here could lead to incorrect data being accepted as valid.\n \n#### Uniswap v3 TWAP Oracle Risks (CoreUniswapFeed Contract):\n\n``Manipulation via Pool``: TWAP (Time-Weighted Average Price) is derived from a Uniswap v3 pool. If a pool's liquidity is low or if there are large trades, it could temporarily skew the price, affecting the TWAP.\n\n ``Vulnerability to Flash Loans``", "vulnerable_code": "function changeBootstrappingRewards(bool increase) external onlyOwner\nfunction changePercentPolRewardsBurned(bool increase) external onlyOwner\nfunction changeBaseBallotQuorumPercent(bool increase) external onlyOwner\nfunction changeBallotDuration(bool increase) external onlyOwner\nfunction changeRequiredProposalPercentStake(bool increase) external onlyOwner\nfunction changeMaxPendingTokensForWhitelisting(bool increase) external onlyOwner\nfunction changeArbitrageProfitsPercentPOL(bool increase) external onlyOwner\nfunction changeUpkeepRewardPercent(bool increase) external onlyOwner\nfunction whitelistPool( IPools pools, IERC20 tokenA, IERC20 tokenB ) external onlyOwner\nfunction unwhitelistPool( IPools pools, IERC20 tokenA, IERC20 tokenB ) external onlyOwner\nfunction changeMaximumWhitelistedPools(bool increase) external onlyOwner\nfunction changeMaximumInternalSwapPercentTimes1000(bool increase) external onlyOwner\nfunction setContracts( IDAO _dao, ICollateralAndLiquidity _collateralAndLiquidity ) external onlyOwner\nfunction setInitialFeeds( IPriceFeed _priceFeed1, IPriceFeed _priceFeed2, IPriceFeed _priceFeed3 ) public onlyOwner\nfunction setPriceFeed( uint256 priceFeedNum, IPriceFeed newPriceFeed ) public onlyOwner\nfunction changeMaximumPriceFeedPercentDifferenceTimes1000(bool increase) public onlyOwner\nfunction changePriceFeedModificationCooldown(bool increase) public onlyOwner\nfunction changeRewardsEmitterDailyPercent(bool increase) external onlyOwner\nfunction changeEmissionsWeeklyPercent(bool increase) external onlyOwner\nfunction changeStakingRewardsPercent(bool increase) external onlyOwner\nfunction changePercentRewardsSaltUSDS(bool increase) external onlyOwner\nfunction setCollateralAndLiquidity( ICollateralAndLiquidity _collateralAndLiquidity ) external onlyOwner\nfunction changeRewardPercentForCallingLiquidation(bool increase) external onlyOwner\nfunction changeMaxRewardValueForCallingLiquidation(bool increase) external onlyOwner\nfunction changeMinimumCollateralValueForB", "fixed_code": "function step1() public onlySameContract\nfunction step2(address receiver) public onlySameContract\nfunction step3() public onlySameContract\nfunction step4() public onlySameContract\nfunction step5() public onlySameContract\nfunction step6() public onlySameContract\nfunction step7() public onlySameContract\nfunction step8() public onlySameContract\nfunction step9() public onlySameContract\nfunction step10() public onlySameContract\nfunction step11() public onlySameContract\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/Sathish9098-Analysis.md", "collected_at": "2026-01-02T19:01:29.108624+00:00", "source_hash": "119c485f249bcb472941212acb912d7a33b39f8b4fc5ebeddf473e7c27504414", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function changeBootstrappingRewards(bool increase) external onlyOwner\nfunction changePercentPolRewardsBurned(bool increase) external onlyOwner\nfunction changeBaseBallotQuorumPercent(bool increase) external onlyOwner\nfunction changeBallotDuration(bool increase) external onlyOwner\nfunction changeRequiredProposalPercentStake(bool increase) external onlyOwner\nfunction changeMaxPendingTokensForWhitelisting(bool increase) external onlyOwner\nfunction changeArbitrageProfitsPercentPOL(bool increase) external onlyOwner\nfunction changeUpkeepRewardPercent(bool increase) external onlyOwner\nfunction whitelistPool( IPools pools, IERC20 tokenA, IERC20 tokenB ) external onlyOwner\nfunction unwhitelistPool( IPools pools, IERC20 tokenA, IERC20 tokenB ) external onlyOwner\nfunction changeMaximumWhitelistedPools(bool increase) external onlyOwner\nfunction changeMaximumInternalSwapPercentTimes1000(bool increase) external onlyOwner\nfunction setContracts( IDAO _dao, ICollateralAndLiquidity _collateralAndLiquidity ) external onlyOwner\nfunction setInitialFeeds( IPriceFeed _priceFeed1, IPriceFeed _priceFeed2, IPriceFeed _priceFeed3 ) public onlyOwner\nfunction setPriceFeed( uint256 priceFeedNum, IPriceFeed newPriceFeed ) public onlyOwner\nfunction changeMaximumPriceFeedPercentDifferenceTimes1000(bool increase) public onlyOwner\nfunction changePriceFeedModificationCooldown(bool increase) public onlyOwner\nfunction changeRewardsEmitterDailyPercent(bool increase) external onlyOwner\nfunction changeEmissionsWeeklyPercent(bool increase) external onlyOwner\nfunction changeStakingRewardsPercent(bool increase) external onlyOwner\nfunction changePercentRewardsSaltUSDS(bool increase) external onlyOwner\nfunction setCollateralAndLiquidity( ICollateralAndLiquidity _collateralAndLiquidity ) external onlyOwner\nfunction changeRewardPercentForCallingLiquidation(bool increase) external onlyOwner\nfunction changeMaxRewardValueForCallingLiquidation(bool increase) external onlyOwner\nfunction changeMinimumCollateralValueForB", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function step1() public onlySameContract\nfunction step2(address receiver) public onlySameContract\nfunction step3() public onlySameContract\nfunction step4() public onlySameContract\nfunction step5() public onlySameContract\nfunction step6() public onlySameContract\nfunction step7() public onlySameContract\nfunction step8() public onlySameContract\nfunction step9() public onlySameContract\nfunction step10() public onlySameContract\nfunction step11() public onlySameContract\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "07-amphora", "title": "twcctop Q", "severity_raw": "Unknown", "severity": "unknown", "description": "https://github.com/code-423n4/2023-07-amphora/blob/5d1cea9410db5448760c834f001af04a72edf3e0/core/solidity/contracts/core/VaultController.sol#L561\n\n\n```solidity\n \nif (_isUSDA) {\n // now send usda to the target, equal to the amount they are owed\n usda.vaultControllerMint(_target, _amount);\n } else {\n // send sUSD to the target from reserve instead of mint\n usda.vaultControllerTransfer(_target, _amount);\n }\n\n// emit the event\n emit BorrowUSDA(_id, address(_vault), _amount, _fee);\n\n\n```\n\nseem that whether borrow asset is USDA or sUSD,it will emit same message", "vulnerable_code": "if (_isUSDA) {\n // now send usda to the target, equal to the amount they are owed\n usda.vaultControllerMint(_target, _amount);\n } else {\n // send sUSD to the target from reserve instead of mint\n usda.vaultControllerTransfer(_target, _amount);\n }\n\n// emit the event\n emit BorrowUSDA(_id, address(_vault), _amount, _fee);\n\n", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/twcctop-Q.md", "collected_at": "2026-01-02T18:24:04.032075+00:00", "source_hash": "11a1c015a34b0ab65f522c53ff77c32ad2cae05c659bde71f8fe113d0e97aeeb", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 348, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "if (_isUSDA) {\n // now send usda to the target, equal to the amount they are owed\n usda.vaultControllerMint(_target, _amount);\n } else {\n // send sUSD to the target from reserve instead of mint\n usda.vaultControllerTransfer(_target, _amount);\n }\n\n// emit the event\n emit BorrowUSDA(_id, address(_vault), _amount, _fee);", "primary_code_language": "solidity", "primary_code_char_count": 348, "all_code_blocks": "// Code block 1 (solidity):\nif (_isUSDA) {\n // now send usda to the target, equal to the amount they are owed\n usda.vaultControllerMint(_target, _amount);\n } else {\n // send sUSD to the target from reserve instead of mint\n usda.vaultControllerTransfer(_target, _amount);\n }\n\n// emit the event\n emit BorrowUSDA(_id, address(_vault), _amount, _fee);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "if (_isUSDA) {\n // now send usda to the target, equal to the amount they are owed\n usda.vaultControllerMint(_target, _amount);\n } else {\n // send sUSD to the target from reserve instead of mint\n usda.vaultControllerTransfer(_target, _amount);\n }\n\n// emit the event\n emit BorrowUSDA(_id, address(_vault), _amount, _fee);", "github_refs_formatted": "VaultController.sol#L561", "github_files_list": "VaultController.sol", "github_refs_count": 1, "vulnerable_code_actual": "if (_isUSDA) {\n // now send usda to the target, equal to the amount they are owed\n usda.vaultControllerMint(_target, _amount);\n } else {\n // send sUSD to the target from reserve instead of mint\n usda.vaultControllerTransfer(_target, _amount);\n }\n\n// emit the event\n emit BorrowUSDA(_id, address(_vault), _amount, _fee);\n\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.19} {"source": "c4", "protocol": "09-ondo", "title": "mrudenko Q", "severity_raw": "Medium", "severity": "medium", "description": "QA report\nRWADynamicOracle\n1) While the variable names are mostly descriptive, there are places where they could be clearer. For instance, dailyIR could be renamed to dailyInterestRate for clarity.\n2) Allow Deletion of Ranges:\n```\nfunction deleteRange(uint256 indexToDelete) external onlyRole(DEFAULT_ADMIN_ROLE) {\n require(indexToDelete < ranges.length, \"Invalid index\");\n for (uint256 i = indexToDelete; i < ranges.length - 1; i++) {\n ranges[i] = ranges[i + 1];\n }\n ranges.pop();\n}\n\n```\n\nSourceBridge.sol\nAdd a Function to Remove Supported Chains:\n```\nfunction removeDestinationChain(string memory destinationChain) external onlyOwner {\n require(bytes(destChainToContractAddr[destinationChain]).length != 0, \"Chain not found\");\n delete destChainToContractAddr[destinationChain];\n emit DestinationChainRemoved(destinationChain);\n}\n\n```\n\nIn the setDestinationChainContractAddress function, consider adding checks to ensure that the provided address is not the zero address.\n\n```\nrequire(contractAddress != address(0), \"Invalid address\");\n```\n\nIn the burnAndCallAxelar function, there's a check for msg.value == 0. Consider making the required gas fee a variable or a setting in the contract so that it can be adjusted as gas prices change, rather than hardcoding a check against 0\n\nDestinationBridge.sol\nAdd a Function to Remove Supported Chains:\n```\nfunction removeChainSupport(string memory srcChain) external onlyOwner {\n require(chainToApprovedSender[srcChain] != bytes32(0), \"Chain not found\");\n delete chainToApprovedSender[srcChain];\n emit ChainSupportRemoved(srcChain);\n}\n\n```\n\nIn the addChainSupport and setThresholds functions, consider adding checks to ensure that the provided addresses or values are not default values (e.g., address(0) or 0).\n```\nrequire(_token != address(0), \"Invalid token address\");\n```", "vulnerable_code": "function deleteRange(uint256 indexToDelete) external onlyRole(DEFAULT_ADMIN_ROLE) {\n require(indexToDelete < ranges.length, \"Invalid index\");\n for (uint256 i = indexToDelete; i < ranges.length - 1; i++) {\n ranges[i] = ranges[i + 1];\n }\n ranges.pop();\n}\n", "fixed_code": "function removeDestinationChain(string memory destinationChain) external onlyOwner {\n require(bytes(destChainToContractAddr[destinationChain]).length != 0, \"Chain not found\");\n delete destChainToContractAddr[destinationChain];\n emit DestinationChainRemoved(destinationChain);\n}\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/mrudenko-Q.md", "collected_at": "2026-01-02T18:26:08.145982+00:00", "source_hash": "11c246793290aa3b21cf7020c2c31d21a2143ef6d5d075b69f76f1de7c3434a5", "code_block_count": 5, "solidity_block_count": 0, "total_code_chars": 907, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function deleteRange(uint256 indexToDelete) external onlyRole(DEFAULT_ADMIN_ROLE) {\n require(indexToDelete < ranges.length, \"Invalid index\");\n for (uint256 i = indexToDelete; i < ranges.length - 1; i++) {\n ranges[i] = ranges[i + 1];\n }\n ranges.pop();\n}", "primary_code_language": "unknown", "primary_code_char_count": 271, "all_code_blocks": "// Code block 1 (unknown):\nfunction deleteRange(uint256 indexToDelete) external onlyRole(DEFAULT_ADMIN_ROLE) {\n require(indexToDelete < ranges.length, \"Invalid index\");\n for (uint256 i = indexToDelete; i < ranges.length - 1; i++) {\n ranges[i] = ranges[i + 1];\n }\n ranges.pop();\n}\n\n// Code block 2 (unknown):\nfunction removeDestinationChain(string memory destinationChain) external onlyOwner {\n require(bytes(destChainToContractAddr[destinationChain]).length != 0, \"Chain not found\");\n delete destChainToContractAddr[destinationChain];\n emit DestinationChainRemoved(destinationChain);\n}\n\n// Code block 3 (unknown):\nrequire(contractAddress != address(0), \"Invalid address\");\n\n// Code block 4 (unknown):\nfunction removeChainSupport(string memory srcChain) external onlyOwner {\n require(chainToApprovedSender[srcChain] != bytes32(0), \"Chain not found\");\n delete chainToApprovedSender[srcChain];\n emit ChainSupportRemoved(srcChain);\n}\n\n// Code block 5 (unknown):\nrequire(_token != address(0), \"Invalid token address\");", "all_code_blocks_count": 5, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function deleteRange(uint256 indexToDelete) external onlyRole(DEFAULT_ADMIN_ROLE) {\n require(indexToDelete < ranges.length, \"Invalid index\");\n for (uint256 i = indexToDelete; i < ranges.length - 1; i++) {\n ranges[i] = ranges[i + 1];\n }\n ranges.pop();\n}\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function removeDestinationChain(string memory destinationChain) external onlyOwner {\n require(bytes(destChainToContractAddr[destinationChain]).length != 0, \"Chain not found\");\n delete destChainToContractAddr[destinationChain];\n emit DestinationChainRemoved(destinationChain);\n}\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "03-revert-lend", "title": "lightoasis Q", "severity_raw": "High", "severity": "high", "description": "## 1. There are no min and max values set for the reserve factor.\n\nThe reserve factor is the percentage difference between debt and lend interest. There are currently no max and min values for the reserve factor. This could impact the borrowers and the lenders it is set too high or too low.\n[V3Vault.sol#L838](https://github.com/code-423n4/2024-03-revert-lend/blob/435b054f9ad2404173f36f0f74a5096c894b12b7/src/V3Vault.sol#L838)\n```\n function setReserveFactor(uint32 _reserveFactorX32) external onlyOwner {\n reserveFactorX32 = _reserveFactorX32;\n emit SetReserveFactor(_reserveFactorX32);\n }\n```\n\n## Tools Used\nManual Review\n\n## Recommended Mitigation Steps\nConsider implementing max and min values for the reserve factor. These values shouldn't be exceeded when setting the reserve factor.\n\n## 2. Reentrancy issue in V3Vault.create()\n\n\n### Vulnerability details\n### Bug Description\n\nIn create, a token transfer is triggered without a reentrancy guard in place which can lead to exploits. The function also doesn't follow CEI (Checks and Effects Interaction pattern) which means to make neccessary checks and update the contract's state before makinng any external calls. The function in it's current implementation is vulnerabile to reentrancy attacks. \n[V3Vault.sol#L401C36-L401C52](https://github.com/code-423n4/2024-03-revert-lend/blob/435b054f9ad2404173f36f0f74a5096c894b12b7/src/V3Vault.sol#L401C36-L401C52)\n\n```\n function create(uint256 tokenId, address recipient) external override {\n nonfungiblePositionManager.safeTransferFrom(msg.sender, address(this), tokenId, abi.encode(recipient));\n }\n```\n\n## Impact\nTheft of funds through reentrancy exploits. The lack of a reentrancy guard and necessary state updates before the external call leaves the function open to reentrancy attacks which can lead to a theft of funds.\n\n## Recommended Mitigation\nConsider Implementing a reentrancy guard on the create function.\n\n\n", "vulnerable_code": " function setReserveFactor(uint32 _reserveFactorX32) external onlyOwner {\n reserveFactorX32 = _reserveFactorX32;\n emit SetReserveFactor(_reserveFactorX32);\n }", "fixed_code": " function create(uint256 tokenId, address recipient) external override {\n nonfungiblePositionManager.safeTransferFrom(msg.sender, address(this), tokenId, abi.encode(recipient));\n }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/lightoasis-Q.md", "collected_at": "2026-01-02T19:03:14.566763+00:00", "source_hash": "11eca9746cf7ae00e17900ffc7ba520713b1bc416c0582b6443a6e095d427af3", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 363, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function setReserveFactor(uint32 _reserveFactorX32) external onlyOwner {\n reserveFactorX32 = _reserveFactorX32;\n emit SetReserveFactor(_reserveFactorX32);\n }", "primary_code_language": "unknown", "primary_code_char_count": 174, "all_code_blocks": "// Code block 1 (unknown):\nfunction setReserveFactor(uint32 _reserveFactorX32) external onlyOwner {\n reserveFactorX32 = _reserveFactorX32;\n emit SetReserveFactor(_reserveFactorX32);\n }\n\n// Code block 2 (unknown):\nfunction create(uint256 tokenId, address recipient) external override {\n nonfungiblePositionManager.safeTransferFrom(msg.sender, address(this), tokenId, abi.encode(recipient));\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "V3Vault.sol#L838, V3Vault.sol#L401-L36", "github_files_list": "V3Vault.sol", "github_refs_count": 2, "vulnerable_code_actual": " function setReserveFactor(uint32 _reserveFactorX32) external onlyOwner {\n reserveFactorX32 = _reserveFactorX32;\n emit SetReserveFactor(_reserveFactorX32);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function create(uint256 tokenId, address recipient) external override {\n nonfungiblePositionManager.safeTransferFrom(msg.sender, address(this), tokenId, abi.encode(recipient));\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "02-ethos", "title": "oyc_109 Q", "severity_raw": "Critical", "severity": "critical", "description": "\n\n## [L-01] Unspecific Compiler Version Pragma\n\nAvoid floating pragmas for non-library contracts.\n\nWhile floating pragmas make sense for libraries to allow them to be included with multiple different versions of applications, it may be a security risk for application implementations.\n\nA known vulnerable compiler version may accidentally be selected or security tools might fall-back to an older compiler version ending up checking a different EVM compilation that is ultimately deployed on the blockchain.\n\nIt is recommended to pin to a concrete compiler version.\n\n```\n2023-02-ethos/Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/ReaperVaultERC4626.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/ReaperVaultV2.sol::3 => pragma solidity ^0.8.0;\n```\n\n## [L-02] Use of Block.timestamp\n\nBlock timestamps have historically been used for a variety of applications, such as entropy for random numbers (see the Entropy Illusion for further details), locking funds for periods of time, and various state-changing conditional statements that are time-dependent. Miners have the ability to adjust timestamps slightly, which can prove to be dangerous if block timestamps are used incorrectly in smart contracts.\n\n```\n2023-02-ethos/Ethos-Core/contracts/LQTY/CommunityIssuance.sol::87 => uint256 endTimestamp = block.timestamp > lastDistributionTime ? lastDistributionTime : block.timestamp;\n2023-02-ethos/Ethos-Core/contracts/LQTY/CommunityIssuance.sol::93 => lastIssuanceTimestamp = block.timestamp;\n2023-02-ethos/Ethos-Core/contracts/LQTY/CommunityIssuance.sol::113 => lastDistributionTime = block.timestamp.add(distributionPeriod);\n2023-02-ethos/Ethos-Core/contracts/LQTY/CommunityIssuance.sol::114 => lastIssuanceTimestamp = block.timestamp;\n2023-02-ethos/Ethos-Core/contracts/LUSDToken.sol::128 => deploymentStartTime = block.timestamp;\n2023-02-ethos/Ethos-Core/contracts/PriceFeed.sol::417 => if (_respons", "vulnerable_code": "2023-02-ethos/Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/ReaperVaultERC4626.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/ReaperVaultV2.sol::3 => pragma solidity ^0.8.0;", "fixed_code": "2023-02-ethos/Ethos-Core/contracts/LQTY/CommunityIssuance.sol::87 => uint256 endTimestamp = block.timestamp > lastDistributionTime ? lastDistributionTime : block.timestamp;\n2023-02-ethos/Ethos-Core/contracts/LQTY/CommunityIssuance.sol::93 => lastIssuanceTimestamp = block.timestamp;\n2023-02-ethos/Ethos-Core/contracts/LQTY/CommunityIssuance.sol::113 => lastDistributionTime = block.timestamp.add(distributionPeriod);\n2023-02-ethos/Ethos-Core/contracts/LQTY/CommunityIssuance.sol::114 => lastIssuanceTimestamp = block.timestamp;\n2023-02-ethos/Ethos-Core/contracts/LUSDToken.sol::128 => deploymentStartTime = block.timestamp;\n2023-02-ethos/Ethos-Core/contracts/PriceFeed.sol::417 => if (_response.timestamp == 0 || _response.timestamp > block.timestamp) {return true;}\n2023-02-ethos/Ethos-Core/contracts/PriceFeed.sol::425 => return block.timestamp.sub(_response.timestamp) > TIMEOUT;\n2023-02-ethos/Ethos-Core/contracts/PriceFeed.sol::450 => if (_response.timestamp == 0 || _response.timestamp > block.timestamp) {return true;}\n2023-02-ethos/Ethos-Core/contracts/PriceFeed.sol::458 => return block.timestamp.sub(_tellorResponse.timestamp) > TIMEOUT;\n2023-02-ethos/Ethos-Core/contracts/RedemptionHelper.sol::309 => require(block.timestamp >= systemDeploymentTime.add(BOOTSTRAP_PERIOD));\n2023-02-ethos/Ethos-Core/contracts/TroveManager.sol::1501 => uint timePassed = block.timestamp.sub(lastFeeOperationTime);\n2023-02-ethos/Ethos-Core/contracts/TroveManager.sol::1504 => lastFeeOperationTime = block.timestamp;\n2023-02-ethos/Ethos-Core/contracts/TroveManager.sol::1505 => emit LastFeeOpTimeUpdated(block.timestamp);\n2023-02-ethos/Ethos-Core/contracts/TroveManager.sol::1517 => return (block.timestamp.sub(lastFeeOperationTime)).div(SECONDS_IN_ONE_MINUTE);\n2023-02-ethos/Ethos-Vault/contracts/ReaperVaultV2.sol::26 => uint256 activation; // Activation block.timestamp\n2023-02-ethos/Ethos-Vault/contracts/ReaperVaultV2.sol::32 => uint256 lastReport; // block.timestamp of the last time a report occured\n202", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/oyc_109-Q.md", "collected_at": "2026-01-02T18:17:26.674746+00:00", "source_hash": "11fb377406e1a8a1ec38970c0e8340ab44b620fbc90b3251df23543b5dd81640", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 274, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "2023-02-ethos/Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/ReaperVaultERC4626.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/ReaperVaultV2.sol::3 => pragma solidity ^0.8.0;", "primary_code_language": "unknown", "primary_code_char_count": 274, "all_code_blocks": "// Code block 1 (unknown):\n2023-02-ethos/Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/ReaperVaultERC4626.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/ReaperVaultV2.sol::3 => pragma solidity ^0.8.0;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "2023-02-ethos/Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/ReaperVaultERC4626.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/ReaperVaultV2.sol::3 => pragma solidity ^0.8.0;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "2023-02-ethos/Ethos-Core/contracts/LQTY/CommunityIssuance.sol::87 => uint256 endTimestamp = block.timestamp > lastDistributionTime ? lastDistributionTime : block.timestamp;\n2023-02-ethos/Ethos-Core/contracts/LQTY/CommunityIssuance.sol::93 => lastIssuanceTimestamp = block.timestamp;\n2023-02-ethos/Ethos-Core/contracts/LQTY/CommunityIssuance.sol::113 => lastDistributionTime = block.timestamp.add(distributionPeriod);\n2023-02-ethos/Ethos-Core/contracts/LQTY/CommunityIssuance.sol::114 => lastIssuanceTimestamp = block.timestamp;\n2023-02-ethos/Ethos-Core/contracts/LUSDToken.sol::128 => deploymentStartTime = block.timestamp;\n2023-02-ethos/Ethos-Core/contracts/PriceFeed.sol::417 => if (_response.timestamp == 0 || _response.timestamp > block.timestamp) {return true;}\n2023-02-ethos/Ethos-Core/contracts/PriceFeed.sol::425 => return block.timestamp.sub(_response.timestamp) > TIMEOUT;\n2023-02-ethos/Ethos-Core/contracts/PriceFeed.sol::450 => if (_response.timestamp == 0 || _response.timestamp > block.timestamp) {return true;}\n2023-02-ethos/Ethos-Core/contracts/PriceFeed.sol::458 => return block.timestamp.sub(_tellorResponse.timestamp) > TIMEOUT;\n2023-02-ethos/Ethos-Core/contracts/RedemptionHelper.sol::309 => require(block.timestamp >= systemDeploymentTime.add(BOOTSTRAP_PERIOD));\n2023-02-ethos/Ethos-Core/contracts/TroveManager.sol::1501 => uint timePassed = block.timestamp.sub(lastFeeOperationTime);\n2023-02-ethos/Ethos-Core/contracts/TroveManager.sol::1504 => lastFeeOperationTime = block.timestamp;\n2023-02-ethos/Ethos-Core/contracts/TroveManager.sol::1505 => emit LastFeeOpTimeUpdated(block.timestamp);\n2023-02-ethos/Ethos-Core/contracts/TroveManager.sol::1517 => return (block.timestamp.sub(lastFeeOperationTime)).div(SECONDS_IN_ONE_MINUTE);\n2023-02-ethos/Ethos-Vault/contracts/ReaperVaultV2.sol::26 => uint256 activation; // Activation block.timestamp\n2023-02-ethos/Ethos-Vault/contracts/ReaperVaultV2.sol::32 => uint256 lastReport; // block.timestamp of the last time a report occured\n202", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "11-kelp", "title": "T1MOH Q", "severity_raw": "High", "severity": "high", "description": "## 1. Low. `getAssetCurrentLimit()` will revert if admin sets new limit to less than deposited now\n### Vulnerability Details\nhttps://github.com/code-423n4/2023-11-kelp/blob/c5fdc2e62c5e1d78769f44d6e34a6fb9e40c00f0/src/LRTDepositPool.sol#L56-L58\n\nLimit from config can be lower than actually deposited, therefore function will revert instead of returning 0\n```solidity\n function getAssetCurrentLimit(address asset) public view override returns (uint256) {\n return lrtConfig.depositLimitByAsset(asset) - getTotalAssetDeposits(asset);\n }\n```\n\n### Recommended mitigation steps\nReturn 0 instead of revert\n```diff\n function getAssetCurrentLimit(address asset) public view override returns (uint256) {\n- return lrtConfig.depositLimitByAsset(asset) - getTotalAssetDeposits(asset);\n+ return lrtConfig.depositLimitByAsset(asset) > getTotalAssetDeposits(asset)\n+ ? lrtConfig.depositLimitByAsset(asset) - getTotalAssetDeposits(asset)\n+ : 0;\n }\n```\n\n## 2. Low. Protocol assumes that all LSTs have 18 decimals\n### Vulnerability Details\nhttps://github.com/code-423n4/2023-11-kelp/blob/c5fdc2e62c5e1d78769f44d6e34a6fb9e40c00f0/src/LRTOracle.sol#L52-L79\n\nProtocol assumes that all LSTs have 18 decimals, it can be different in the future.\nHere function expects that `totalAssetAmt` has 1e18 precission. Otherwise it will over/under-estimate asset:\n```solidity\n function getRSETHPrice() external view returns (uint256 rsETHPrice) {\n address rsETHTokenAddress = lrtConfig.rsETH();\n uint256 rsEthSupply = IRSETH(rsETHTokenAddress).totalSupply();\n\n if (rsEthSupply == 0) {\n return 1 ether;\n }\n\n uint256 totalETHInPool;\n address lrtDepositPoolAddr = lrtConfig.getContract(LRTConstants.LRT_DEPOSIT_POOL);\n\n address[] memory supportedAssets = lrtConfig.getSupportedAssetList();\n uint256 supportedAssetCount = supportedAssets.length;\n\n for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n ", "vulnerable_code": " function getAssetCurrentLimit(address asset) public view override returns (uint256) {\n return lrtConfig.depositLimitByAsset(asset) - getTotalAssetDeposits(asset);\n }", "fixed_code": "## 2. Low. Protocol assumes that all LSTs have 18 decimals\n### Vulnerability Details\nhttps://github.com/code-423n4/2023-11-kelp/blob/c5fdc2e62c5e1d78769f44d6e34a6fb9e40c00f0/src/LRTOracle.sol#L52-L79\n\nProtocol assumes that all LSTs have 18 decimals, it can be different in the future.\nHere function expects that `totalAssetAmt` has 1e18 precission. Otherwise it will over/under-estimate asset:", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/T1MOH-Q.md", "collected_at": "2026-01-02T18:27:41.663262+00:00", "source_hash": "1214ca1be6deb93eea6b56125b612dd0c1516966eee2351c41bf8803af2d13d3", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 532, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function getAssetCurrentLimit(address asset) public view override returns (uint256) {\n return lrtConfig.depositLimitByAsset(asset) - getTotalAssetDeposits(asset);\n }", "primary_code_language": "solidity", "primary_code_char_count": 175, "all_code_blocks": "// Code block 1 (solidity):\nfunction getAssetCurrentLimit(address asset) public view override returns (uint256) {\n return lrtConfig.depositLimitByAsset(asset) - getTotalAssetDeposits(asset);\n }\n\n// Code block 2 (diff):\nfunction getAssetCurrentLimit(address asset) public view override returns (uint256) {\n- return lrtConfig.depositLimitByAsset(asset) - getTotalAssetDeposits(asset);\n+ return lrtConfig.depositLimitByAsset(asset) > getTotalAssetDeposits(asset)\n+ ? lrtConfig.depositLimitByAsset(asset) - getTotalAssetDeposits(asset)\n+ : 0;\n }", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "function getAssetCurrentLimit(address asset) public view override returns (uint256) {\n- return lrtConfig.depositLimitByAsset(asset) - getTotalAssetDeposits(asset);\n+ return lrtConfig.depositLimitByAsset(asset) > getTotalAssetDeposits(asset)\n+ ? lrtConfig.depositLimitByAsset(asset) - getTotalAssetDeposits(asset)\n+ : 0;\n }", "solidity_code": "function getAssetCurrentLimit(address asset) public view override returns (uint256) {\n return lrtConfig.depositLimitByAsset(asset) - getTotalAssetDeposits(asset);\n }", "github_refs_formatted": "LRTDepositPool.sol#L56-L58, LRTOracle.sol#L52-L79", "github_files_list": "LRTDepositPool.sol, LRTOracle.sol", "github_refs_count": 2, "vulnerable_code_actual": " function getAssetCurrentLimit(address asset) public view override returns (uint256) {\n return lrtConfig.depositLimitByAsset(asset) - getTotalAssetDeposits(asset);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## 2. Low. Protocol assumes that all LSTs have 18 decimals\n### Vulnerability Details\nhttps://github.com/code-423n4/2023-11-kelp/blob/c5fdc2e62c5e1d78769f44d6e34a6fb9e40c00f0/src/LRTOracle.sol#L52-L79\n\nProtocol assumes that all LSTs have 18 decimals, it can be different in the future.\nHere function expects that `totalAssetAmt` has 1e18 precission. Otherwise it will over/under-estimate asset:", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "02-ethos", "title": "Bough Q", "severity_raw": "High", "severity": "high", "description": "# [L-01] Dependence on predictable environment variable \n https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L1501\n https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L1504\n https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L1505\n https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L1516\n \n The block.timestamp environment variable is used to determine a control flow decision. The the value of variable block.imestamp is predictable and can be manipulated by a malicious miner.\n\n# [N-01] Use a more recent version of Solidity\nThe use of the more recent version of solidity can help in preventing Integer Arithmetic Bugs (>0.8.0)\n\n# [N-02] Function writing that does not comply with the Solidity Style Guide\n\nOrder of Functions; ordering helps readers identify which functions they can call and to find the constructor and fallback definitions easier. But there are contracts in the project that do not comply with this.\n\nFunctions should be grouped according to their visibility and ordered:\n\n- constructor\n- receive function (if exists)\n- fallback function (if exists)\n- external\n- public\n- internal\n- private\n- within a grouping, place the view and pure functions last\n\nThis style guide is proposed by solidity community. It intended to provide coding conventions for writing Solidity code\nhttps://docs.soliditylang.org/en/v0.8.17/style-guide.html\n\n# [N-03] require()/revert() statements should have descriptive reason strings\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/RedemptionHelper.sol#L179\n```require(totals.totalCollateralDrawn > 0);```\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/RedemptionHelper.sol#L304\n``` require(_maxFeePercentage >= troveManager.REDEMPTION_FEE_FLOOR() && _maxFeePercentage <= DECIMAL_PRECISION);```\n\nhttps://github.com/", "vulnerable_code": "https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/RedemptionHelper.sol#L304", "fixed_code": "https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/RedemptionHelper.sol#L309", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/Bough-Q.md", "collected_at": "2026-01-02T18:16:00.850195+00:00", "source_hash": "125fd5183d7824b71c63970eea1d8e9d80e20ead139741b884feff0fc7f31a02", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 100, "github_ref_count": 7, "vulnerable_code_is_url": true, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/RedemptionHelper.sol#L304", "primary_code_language": "unknown", "primary_code_char_count": 100, "all_code_blocks": "// Code block 1 (unknown):\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/RedemptionHelper.sol#L304", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "TroveManager.sol#L1501, TroveManager.sol#L1504, TroveManager.sol#L1505, TroveManager.sol#L1516, RedemptionHelper.sol#L179, RedemptionHelper.sol#L304, RedemptionHelper.sol#L309", "github_files_list": "TroveManager.sol, RedemptionHelper.sol", "github_refs_count": 7, "vulnerable_code_actual": "", "has_vulnerable_code_snippet": false, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "04-caviar", "title": "minhtrng Q", "severity_raw": "Low", "severity": "low", "description": "## [01] missing check for msg.value if baseToken not ETH\n\n`PrivatePool.flashLoan` does not check if ETH has been sent, even though baseToken is not ETH. The functions `buy`, `change`, `deposit` do perform this check:\n\n```js\nif (baseToken != address(0) && msg.value > 0) revert InvalidEthAmount();\n```\n\nThis could lead to users sending ETH to the contract on accident. \n\nMitigation: perform the check\n\n## [02] underflow for tokens with less than 4 decimals\n\nFunction `PrivatePool.changeFeeQuote` will revert if the baseToken has less than 4 decimals, rendering `change` function unusable:\n\n```js\nfunction changeFeeQuote(uint256 inputAmount) public view returns (uint256 feeAmount, uint256 protocolFeeAmount) {\n\nuint256 exponent = baseToken == address(0) ? 18 - 4 : ERC20(baseToken).decimals() - 4;\n```\n\nTokens with less than 4 decimals are too rare for this to likely be an issue, but it could be fixed by adjusting the math (dividing by `10 ** (4-token.decimals)` if `decimals <= 3`).\n\n## [03] owner can do MEV at cost of users\n\nThe functions `setFeeRate` and `setVirtualReserves` can be used by the owner to do MEV by frontrunning user transactions and adjusting the values to reach the users max slippage values. \n\nOnly viable mitigation would be removing them. But slippage is something that a user has to take into account anyway, so only a minor issue and likely users responsibility to use periphery properly.\n\n## [04] Documentation-implementation-mismatch for deposits and LPs\n\nAccording to https://docs.caviar.sh/: `\"Custom Pools: [...] Like shared pools, liquidity providers earn fees from trades against their pool.\"` \n\nThis is not the case in the current implementation (by design) and users might deposit in the believe of earning yield and being able to redeem, but would lose their deposits instead. Mitigation: update docs\n\n## [05] Function documentation misleading for `EthRouter.buy`\n\n`EthRouter.buy` states:\n\n```js\n/// @param payRoyalties Whether to pay royalties or not.\n```\n\nIt mi", "vulnerable_code": "if (baseToken != address(0) && msg.value > 0) revert InvalidEthAmount();", "fixed_code": "function changeFeeQuote(uint256 inputAmount) public view returns (uint256 feeAmount, uint256 protocolFeeAmount) {\n\nuint256 exponent = baseToken == address(0) ? 18 - 4 : ERC20(baseToken).decimals() - 4;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/minhtrng-Q.md", "collected_at": "2026-01-02T18:20:43.949311+00:00", "source_hash": "128281328e22e2ab548320b096353412d29ec89b9ae380f185be4397a109cbd6", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 329, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "if (baseToken != address(0) && msg.value > 0) revert InvalidEthAmount();", "primary_code_language": "js", "primary_code_char_count": 72, "all_code_blocks": "// Code block 1 (js):\nif (baseToken != address(0) && msg.value > 0) revert InvalidEthAmount();\n\n// Code block 2 (js):\nfunction changeFeeQuote(uint256 inputAmount) public view returns (uint256 feeAmount, uint256 protocolFeeAmount) {\n\nuint256 exponent = baseToken == address(0) ? 18 - 4 : ERC20(baseToken).decimals() - 4;\n\n// Code block 3 (js):\n/// @param payRoyalties Whether to pay royalties or not.", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "if (baseToken != address(0) && msg.value > 0) revert InvalidEthAmount();", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function changeFeeQuote(uint256 inputAmount) public view returns (uint256 feeAmount, uint256 protocolFeeAmount) {\n\nuint256 exponent = baseToken == address(0) ? 18 - 4 : ERC20(baseToken).decimals() - 4;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "11-kelp", "title": "gkrastenov Q", "severity_raw": "Medium", "severity": "medium", "description": "## [NC-01] Unnecessarily checking for non-zero address\nThe addresses of tokens `stETH`, `rETH` and `cbETH` are unnecessarily checked for a non-zero address in the `initialize` function of the `LRTConfig` contract. This check is also performed in the `_setToken` function.\n\n```solidity\nUtilLib.checkNonZeroAddress(stETH);\nUtilLib.checkNonZeroAddress(rETH);\nUtilLib.checkNonZeroAddress(cbETH);\n```\n\n```solidity\n function _setContract(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n\n .....\n }\n```\n\n## [NC-02] Typos in the codebase\n1. Typo in the comment above `initialize` function of the `LRTConfig` contract.\n\n```diff\n /// @param cbETH cbETH address -> coinbase staked eth\n- /// @param rsETH_ cbETH address \n+ /// @param rsETH_ rsETH_ address \n function initialize(\n address admin,\n address stETH,\n```\n\n2. Typo in the naming of the event\n\n```diff\n-emit NodeDelegatorAddedinQueue(nodeDelegatorContracts[i]); \n+emit NodeDelegatorAddedInQueue(nodeDelegatorContracts[i]); \n```\n\n## [NC-03] Check return shares for successful deposit\nThe `depositIntoStrategy` function of the Eigen StrategyManager contract returns shares of a depositor. It can be checked if `shares != 0` for a successful deposit.\n\n```diff\n-IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);\n\n+uint256 shares = IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);\n\n+ if(shares == 0) revert UnsuccessfulDeposit();\n\n```\n\n## [NC-04] Check if new deposit limit is below total asset deposits\nThe Manager has the right to update the deposit limit for every asset. If the new value for the deposit limit is below the total asset deposits `getTotalAssetDeposits` (of the DepositPool, all NDCs and staked ethers in the EigenLayer protocol) a stack underflow will occur in the calculation of `getAssetCurrentLimit()`.\n\n```solidity\nreturn lrtConfig.depositLimitByA", "vulnerable_code": "UtilLib.checkNonZeroAddress(stETH);\nUtilLib.checkNonZeroAddress(rETH);\nUtilLib.checkNonZeroAddress(cbETH);", "fixed_code": " function _setContract(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n\n .....\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/gkrastenov-Q.md", "collected_at": "2026-01-02T18:28:04.135234+00:00", "source_hash": "128d622fc2e53f6c7e7d0e23c21faf0a4e94cfd80f66ad6ca93791c660eaaf4f", "code_block_count": 5, "solidity_block_count": 5, "total_code_chars": 838, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "UtilLib.checkNonZeroAddress(stETH);\nUtilLib.checkNonZeroAddress(rETH);\nUtilLib.checkNonZeroAddress(cbETH);", "primary_code_language": "solidity", "primary_code_char_count": 106, "all_code_blocks": "// Code block 1 (solidity):\nUtilLib.checkNonZeroAddress(stETH);\nUtilLib.checkNonZeroAddress(rETH);\nUtilLib.checkNonZeroAddress(cbETH);\n\n// Code block 2 (solidity):\nfunction _setContract(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n\n .....\n }\n\n// Code block 3 (diff):\n/// @param cbETH cbETH address -> coinbase staked eth\n- /// @param rsETH_ cbETH address \n+ /// @param rsETH_ rsETH_ address \n function initialize(\n address admin,\n address stETH,\n\n// Code block 4 (diff):\n-emit NodeDelegatorAddedinQueue(nodeDelegatorContracts[i]); \n+emit NodeDelegatorAddedInQueue(nodeDelegatorContracts[i]);\n\n// Code block 5 (diff):\n-IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);\n\n+uint256 shares = IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);\n\n+ if(shares == 0) revert UnsuccessfulDeposit();", "all_code_blocks_count": 5, "has_diff_blocks": true, "diff_code": "/// @param cbETH cbETH address -> coinbase staked eth\n- /// @param rsETH_ cbETH address \n+ /// @param rsETH_ rsETH_ address \n function initialize(\n address admin,\n address stETH,\n\n-emit NodeDelegatorAddedinQueue(nodeDelegatorContracts[i]); \n+emit NodeDelegatorAddedInQueue(nodeDelegatorContracts[i]);\n\n-IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);\n\n+uint256 shares = IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);\n\n+ if(shares == 0) revert UnsuccessfulDeposit();", "solidity_code": "UtilLib.checkNonZeroAddress(stETH);\nUtilLib.checkNonZeroAddress(rETH);\nUtilLib.checkNonZeroAddress(cbETH);\n\nfunction _setContract(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n\n .....\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "UtilLib.checkNonZeroAddress(stETH);\nUtilLib.checkNonZeroAddress(rETH);\nUtilLib.checkNonZeroAddress(cbETH);", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function _setContract(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n\n .....\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 12} {"source": "c4", "protocol": "05-ajna", "title": "Aymen0909 G", "severity_raw": "Medium", "severity": "medium", "description": "# Gas Optimizations\n\n## Summary\n\n| | Issue | Instances |\n| :---: |:-------------|:------------:|\n| 1 | Using `storage` instead of `memory` for struct/array saves gas | 8 |\n| 2 | `storage` variable should be cached into `memory` variables instead of re-reading them | 1 |\n| 3 | Use `unchecked` blocks to save gas | 3 |\n| 4 | Use `calldata` instead of `memory` for function parameters type | 13 |\n| 5 | Multiple address/IDs mappings can be combined into a single mapping of an address/id to a struct | 13 |\n| 6 | `x += y/x -= y` costs more gas than `x = x + y/x = x - y` for state variables | 10 |\n\n## Findings\n\n### 1- Using `storage` instead of `memory` for struct/array saves gas :\n\nWhen fetching data from a `storage` location, assigning the data to a `memory` variable causes all fields of the struct/array to be read from `storage`, which incurs a Gcoldsload (2100 gas) for each field of the struct/array. If the fields are read from the new `memory` variable, they incur an additional MLOAD rather than a cheap stack read. Instead of declearing the variable with the `memory` keyword, declaring the variable with the `storage` keyword and caching any fields that need to be re-read in stack variables, will be much cheaper, only incuring the Gcoldsload for the fields actually read. \n\nThe only time it makes sense to read the whole struct/array into a `memory` variable, is if the full struct/array is being returned by the function, is being passed to a function that requires `memory`, or if the array/struct is being read from another `memory` array/struct.\n\nThere are 8 instances of this issue :\n\nFile: RewardsManager.sol [Line 442](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/RewardsManager.sol#L442)\n```\nBucketState memory bucketSnapshot = stakes[tokenId_].snapshot[bucketIndex];\n```\n\nFile: StandardFunding.sol [Line 203](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L203)\n```\nuint256[] ", "vulnerable_code": "BucketState memory bucketSnapshot = stakes[tokenId_].snapshot[bucketIndex];", "fixed_code": "uint256[] memory fundingProposalIds = _fundedProposalSlates[fundedSlateHash];", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/Aymen0909-G.md", "collected_at": "2026-01-02T18:20:54.173929+00:00", "source_hash": "13105b1e0bddd9b2532787647493fa284f616eb03235a7c76cf2e960dc290ca5", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 75, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "BucketState memory bucketSnapshot = stakes[tokenId_].snapshot[bucketIndex];", "primary_code_language": "unknown", "primary_code_char_count": 75, "all_code_blocks": "// Code block 1 (unknown):\nBucketState memory bucketSnapshot = stakes[tokenId_].snapshot[bucketIndex];", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "RewardsManager.sol#L442, StandardFunding.sol#L203", "github_files_list": "RewardsManager.sol, StandardFunding.sol", "github_refs_count": 2, "vulnerable_code_actual": "BucketState memory bucketSnapshot = stakes[tokenId_].snapshot[bucketIndex];", "has_vulnerable_code_snippet": true, "fixed_code_actual": "uint256[] memory fundingProposalIds = _fundedProposalSlates[fundedSlateHash];", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-biconomy", "title": "Dinesh11G G", "severity_raw": "Medium", "severity": "medium", "description": "### 1st BUG\nDon't Initialize Variables with Default Value\n\n#### Impact\nIssue Information: \nUninitialized variables are assigned with the types default value.\n\nExplicitly initializing a variable with it's default value costs unnecessary gas.\n\nExample\n\ud83e\udd26 Bad:\n\nuint256 x = 0;\nbool y = false;\n\ud83d\ude80 Good:\n\nuint256 x;\nbool y;\n\n#### Findings:\n```\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::234 => uint256 payment = 0;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::305 => uint256 i = 0;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::458 => for (uint i = 0; i < dest.length;) { uint256 missingAccountFunds = 0;\n```\n#### Tools used\nManual code review on vs code\n\n### 2nd BUG\nCache Array Length Outside of Loop\n\n#### Impact\nIssue Information: \nCaching the array length outside a loop saves reading it on each iteration, as long as the array's length is not changed during the loop.\n\nExample\n\ud83e\udd26 Bad:\n\nfor (uint256 i = 0; i < array.length; i++) {\n // invariant: array's length is not changed\n}\n\ud83d\ude80 Good:\n\nuint256 len = array.length\nfor (uint256 i = 0; i < len; i++) {\n // invariant: array's length is not changed\n}\n\n#### Findings:\n```\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/BaseSmartAccount.sol::64 => if (userOp.initCode.length == 0) {\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::199 => // ~= 21k + calldata.length * [1/3 * 16 + 2/3 * 4]\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::200 => uint256 startGas = gasleft() + 21000 + msg.data.length * 8;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::201 => //console.log(\"init %s\", 21000 + msg.data.length * 8);\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::324 => // Check that signature data pointer (s) is in bounds (points to the length of data -> 32 bytes)\n", "vulnerable_code": "2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::234 => uint256 payment = 0;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::305 => uint256 i = 0;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::458 => for (uint i = 0; i < dest.length;) { uint256 missingAccountFunds = 0;", "fixed_code": "2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/BaseSmartAccount.sol::64 => if (userOp.initCode.length == 0) {\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::199 => // ~= 21k + calldata.length * [1/3 * 16 + 2/3 * 4]\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::200 => uint256 startGas = gasleft() + 21000 + msg.data.length * 8;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::201 => //console.log(\"init %s\", 21000 + msg.data.length * 8);\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::324 => // Check that signature data pointer (s) is in bounds (points to the length of data -> 32 bytes)\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::325 => require(uint256(s) + 32 <= signatures.length, \"BSA022\");\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::327 => // Check if the contract signature is in bounds: start of data is s + 32 and end is start + signature length\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::333 => require(uint256(s) + 32 + contractSignatureLen <= signatures.length, \"BSA023\");\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::467 => require(dest.length == func.length, \"wrong array lengths\");\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::199 => // ~= 21k + calldata.length * [1/3 * 16 + 2/3 * 4]\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::200 => uint256 startGas = gasleft() + 21000 + msg.data.length * 8;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::201 => //console.log(\"init %s\", 21000 + msg.data.length * 8);\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::319 => // Check that signature data pointer ", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/Dinesh11G-G.md", "collected_at": "2026-01-02T18:13:03.547563+00:00", "source_hash": "13198aa64535a4df9c7dffc7ecd18684c705f52ee318bd79f8fad1330f7767af", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 387, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::234 => uint256 payment = 0;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::305 => uint256 i = 0;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::458 => for (uint i = 0; i < dest.length;) { uint256 missingAccountFunds = 0;", "primary_code_language": "unknown", "primary_code_char_count": 387, "all_code_blocks": "// Code block 1 (unknown):\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::234 => uint256 payment = 0;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::305 => uint256 i = 0;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::458 => for (uint i = 0; i < dest.length;) { uint256 missingAccountFunds = 0;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::234 => uint256 payment = 0;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::305 => uint256 i = 0;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::458 => for (uint i = 0; i < dest.length;) { uint256 missingAccountFunds = 0;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/BaseSmartAccount.sol::64 => if (userOp.initCode.length == 0) {\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::199 => // ~= 21k + calldata.length * [1/3 * 16 + 2/3 * 4]\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::200 => uint256 startGas = gasleft() + 21000 + msg.data.length * 8;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::201 => //console.log(\"init %s\", 21000 + msg.data.length * 8);\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::324 => // Check that signature data pointer (s) is in bounds (points to the length of data -> 32 bytes)\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::325 => require(uint256(s) + 32 <= signatures.length, \"BSA022\");\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::327 => // Check if the contract signature is in bounds: start of data is s + 32 and end is start + signature length\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::333 => require(uint256(s) + 32 + contractSignatureLen <= signatures.length, \"BSA023\");\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::467 => require(dest.length == func.length, \"wrong array lengths\");\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::199 => // ~= 21k + calldata.length * [1/3 * 16 + 2/3 * 4]\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::200 => uint256 startGas = gasleft() + 21000 + msg.data.length * 8;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::201 => //console.log(\"init %s\", 21000 + msg.data.length * 8);\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::319 => // Check that signature data pointer ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-ondo", "title": "Bnke0x0 Q", "severity_raw": "Critical", "severity": "critical", "description": "\n### [L01] require() should be used instead of assert()\n\n\n#### Findings:\n```\n2023-01-ondo/contracts/cash/factory/CashFactory.sol::97 => assert(cashProxyAdmin.owner() == guardian);\n2023-01-ondo/contracts/cash/factory/CashKYCSenderFactory.sol::106 => assert(cashKYCSenderProxyAdmin.owner() == guardian);\n2023-01-ondo/contracts/cash/factory/CashKYCSenderReceiverFactory.sol::106 => assert(cashKYCSenderReceiverProxyAdmin.owner() == guardian);\n```\n\n\n\n\n\n\n### [L02] Missing checks for `address(0x0)` when assigning values to `address` state variables\n\n\n#### Findings:\n```\n2023-01-ondo/contracts/cash/CashManager.sol::165 => feeRecipient = _feeRecipient;\n2023-01-ondo/contracts/cash/CashManager.sol::166 => assetRecipient = _assetRecipient;\n2023-01-ondo/contracts/cash/CashManager.sol::167 => assetSender = _assetSender;\n2023-01-ondo/contracts/cash/CashManager.sol::168 => currentEpoch = currentEpoch;\n2023-01-ondo/contracts/cash/CashManager.sol::170 => mintLimit = _mintLimit;\n2023-01-ondo/contracts/cash/CashManager.sol::171 => redeemLimit = _redeemLimit;\n2023-01-ondo/contracts/cash/CashManager.sol::172 => epochDuration = _epochDuration;\n2023-01-ondo/contracts/cash/CashManager.sol::377 => lastSetMintExchangeRate = _lastSetMintExchangeRate;\n2023-01-ondo/contracts/cash/CashManager.sol::395 => uint256 oldExchangeRateDeltaLimit = exchangeRateDeltaLimit;\n2023-01-ondo/contracts/cash/CashManager.sol::396 => exchangeRateDeltaLimit = _exchangeRateDeltaLimit;\n2023-01-ondo/contracts/cash/CashManager.sol::417 => mintFee = _mintFee;\n2023-01-ondo/contracts/cash/CashManager.sol::440 => minimumDepositAmount = _minimumDepositAmount;\n2023-01-ondo/contracts/cash/CashManager.sol::456 => feeRecipient = _feeRecipient;\n2023-01-ondo/contracts/cash/CashManager.sol::469 => assetRecipient = _assetRecipient;\n2023-01-ondo/contracts/cash/CashManager.sol::491 => uint256 amountE24 = _scaleUp(collateralAmountIn) * 1e6;\n2023-01-ondo/contracts/cash/CashManager.sol::550 => epochDuration = _epochDuration;\n2023-01-ondo/cont", "vulnerable_code": "2023-01-ondo/contracts/cash/factory/CashFactory.sol::97 => assert(cashProxyAdmin.owner() == guardian);\n2023-01-ondo/contracts/cash/factory/CashKYCSenderFactory.sol::106 => assert(cashKYCSenderProxyAdmin.owner() == guardian);\n2023-01-ondo/contracts/cash/factory/CashKYCSenderReceiverFactory.sol::106 => assert(cashKYCSenderReceiverProxyAdmin.owner() == guardian);", "fixed_code": "2023-01-ondo/contracts/cash/CashManager.sol::165 => feeRecipient = _feeRecipient;\n2023-01-ondo/contracts/cash/CashManager.sol::166 => assetRecipient = _assetRecipient;\n2023-01-ondo/contracts/cash/CashManager.sol::167 => assetSender = _assetSender;\n2023-01-ondo/contracts/cash/CashManager.sol::168 => currentEpoch = currentEpoch;\n2023-01-ondo/contracts/cash/CashManager.sol::170 => mintLimit = _mintLimit;\n2023-01-ondo/contracts/cash/CashManager.sol::171 => redeemLimit = _redeemLimit;\n2023-01-ondo/contracts/cash/CashManager.sol::172 => epochDuration = _epochDuration;\n2023-01-ondo/contracts/cash/CashManager.sol::377 => lastSetMintExchangeRate = _lastSetMintExchangeRate;\n2023-01-ondo/contracts/cash/CashManager.sol::395 => uint256 oldExchangeRateDeltaLimit = exchangeRateDeltaLimit;\n2023-01-ondo/contracts/cash/CashManager.sol::396 => exchangeRateDeltaLimit = _exchangeRateDeltaLimit;\n2023-01-ondo/contracts/cash/CashManager.sol::417 => mintFee = _mintFee;\n2023-01-ondo/contracts/cash/CashManager.sol::440 => minimumDepositAmount = _minimumDepositAmount;\n2023-01-ondo/contracts/cash/CashManager.sol::456 => feeRecipient = _feeRecipient;\n2023-01-ondo/contracts/cash/CashManager.sol::469 => assetRecipient = _assetRecipient;\n2023-01-ondo/contracts/cash/CashManager.sol::491 => uint256 amountE24 = _scaleUp(collateralAmountIn) * 1e6;\n2023-01-ondo/contracts/cash/CashManager.sol::550 => epochDuration = _epochDuration;\n2023-01-ondo/contracts/cash/CashManager.sol::598 => mintLimit = _mintLimit;\n2023-01-ondo/contracts/cash/CashManager.sol::613 => redeemLimit = _redeemLimit;\n2023-01-ondo/contracts/cash/factory/CashFactory.sol::54 => guardian = _guardian;\n2023-01-ondo/contracts/cash/factory/CashKYCSenderFactory.sol::54 => guardian = _guardian;\n2023-01-ondo/contracts/cash/factory/CashKYCSenderReceiverFactory.sol::54 => guardian = _guardian;\n2023-01-ondo/contracts/cash/kyc/KYCRegistryClient.sol::56 => kycRequirementGroup = _kycRequirementGroup;\n2023-01-ondo/contracts/lending/OndoPriceOracleV2.sol:", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/Bnke0x0-Q.md", "collected_at": "2026-01-02T18:14:32.422104+00:00", "source_hash": "1362e085cec87f4c903ce0fb7707f31c036bffe2173c66b4d2f7da3f67aa289a", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 362, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "2023-01-ondo/contracts/cash/factory/CashFactory.sol::97 => assert(cashProxyAdmin.owner() == guardian);\n2023-01-ondo/contracts/cash/factory/CashKYCSenderFactory.sol::106 => assert(cashKYCSenderProxyAdmin.owner() == guardian);\n2023-01-ondo/contracts/cash/factory/CashKYCSenderReceiverFactory.sol::106 => assert(cashKYCSenderReceiverProxyAdmin.owner() == guardian);", "primary_code_language": "unknown", "primary_code_char_count": 362, "all_code_blocks": "// Code block 1 (unknown):\n2023-01-ondo/contracts/cash/factory/CashFactory.sol::97 => assert(cashProxyAdmin.owner() == guardian);\n2023-01-ondo/contracts/cash/factory/CashKYCSenderFactory.sol::106 => assert(cashKYCSenderProxyAdmin.owner() == guardian);\n2023-01-ondo/contracts/cash/factory/CashKYCSenderReceiverFactory.sol::106 => assert(cashKYCSenderReceiverProxyAdmin.owner() == guardian);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "2023-01-ondo/contracts/cash/factory/CashFactory.sol::97 => assert(cashProxyAdmin.owner() == guardian);\n2023-01-ondo/contracts/cash/factory/CashKYCSenderFactory.sol::106 => assert(cashKYCSenderProxyAdmin.owner() == guardian);\n2023-01-ondo/contracts/cash/factory/CashKYCSenderReceiverFactory.sol::106 => assert(cashKYCSenderReceiverProxyAdmin.owner() == guardian);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "2023-01-ondo/contracts/cash/CashManager.sol::165 => feeRecipient = _feeRecipient;\n2023-01-ondo/contracts/cash/CashManager.sol::166 => assetRecipient = _assetRecipient;\n2023-01-ondo/contracts/cash/CashManager.sol::167 => assetSender = _assetSender;\n2023-01-ondo/contracts/cash/CashManager.sol::168 => currentEpoch = currentEpoch;\n2023-01-ondo/contracts/cash/CashManager.sol::170 => mintLimit = _mintLimit;\n2023-01-ondo/contracts/cash/CashManager.sol::171 => redeemLimit = _redeemLimit;\n2023-01-ondo/contracts/cash/CashManager.sol::172 => epochDuration = _epochDuration;\n2023-01-ondo/contracts/cash/CashManager.sol::377 => lastSetMintExchangeRate = _lastSetMintExchangeRate;\n2023-01-ondo/contracts/cash/CashManager.sol::395 => uint256 oldExchangeRateDeltaLimit = exchangeRateDeltaLimit;\n2023-01-ondo/contracts/cash/CashManager.sol::396 => exchangeRateDeltaLimit = _exchangeRateDeltaLimit;\n2023-01-ondo/contracts/cash/CashManager.sol::417 => mintFee = _mintFee;\n2023-01-ondo/contracts/cash/CashManager.sol::440 => minimumDepositAmount = _minimumDepositAmount;\n2023-01-ondo/contracts/cash/CashManager.sol::456 => feeRecipient = _feeRecipient;\n2023-01-ondo/contracts/cash/CashManager.sol::469 => assetRecipient = _assetRecipient;\n2023-01-ondo/contracts/cash/CashManager.sol::491 => uint256 amountE24 = _scaleUp(collateralAmountIn) * 1e6;\n2023-01-ondo/contracts/cash/CashManager.sol::550 => epochDuration = _epochDuration;\n2023-01-ondo/contracts/cash/CashManager.sol::598 => mintLimit = _mintLimit;\n2023-01-ondo/contracts/cash/CashManager.sol::613 => redeemLimit = _redeemLimit;\n2023-01-ondo/contracts/cash/factory/CashFactory.sol::54 => guardian = _guardian;\n2023-01-ondo/contracts/cash/factory/CashKYCSenderFactory.sol::54 => guardian = _guardian;\n2023-01-ondo/contracts/cash/factory/CashKYCSenderReceiverFactory.sol::54 => guardian = _guardian;\n2023-01-ondo/contracts/cash/kyc/KYCRegistryClient.sol::56 => kycRequirementGroup = _kycRequirementGroup;\n2023-01-ondo/contracts/lending/OndoPriceOracleV2.sol:", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "10-badger", "title": "leegh G", "severity_raw": "High", "severity": "high", "description": "## [G-01] Redundant require check.\nOne ```require``` statement's conditiion is already included in another ```require``` statement, and thus can be removed.\n```solidity\nFile: packages/contracts/contracts/BorrowerOperations.sol\n\n394: _requireValidDebtRepayment(vars.debt, vars.netDebtChange); // @audit: included in L396\n395: _requireSufficientEbtcTokenBalance(msg.sender, vars.netDebtChange);\n396: _requireNonZeroDebt(vars.debt - vars.netDebtChange);\n\n454: _requireAtLeastMinNetStEthBalance(vars.netStEthBalance);\n463: require(vars.netStEthBalance > 0, \"BorrowerOperations: zero collateral for openCdp()!\"); // @audit: included in L454\n```\n[[L394-L396](https://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/BorrowerOperations.sol#L394-L396), [L454-L463](https://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/BorrowerOperations.sol#L454-L463)]\n\n\n\n## [G-02] Unnecessary intialization of local variables.\n```solidity\n1038: uint256 newCollShares = _collShares; // @audit: L1041 overrides this initialization\n1039: uint256 newDebt = _debt; // @audit: L1044 overrides this initialization\n1040:\n1041: newCollShares = _isCollIncrease\n1042: ? _collShares + _collSharesChange\n1043: : _collShares - _collSharesChange;\n1044: newDebt = _isDebtIncrease ? _debt + _debtChange : _debt - _debtChange;\n```\n[[L1038-L1044](https://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/BorrowerOperations.sol#L1038-L1044)]\n\n## [G-03] Transfer tokens after approve operation to save gas when approve operation reverts. \n```solidity\nFile: packages/contracts/contracts/EBTCToken.sol\n\n140: _transfer(sender, recipient, amount); // @audit: move `transfer` before return, after `approve`\n141:\n142: uint256 cachedAllowance = _allowances[sender][msg.sender];\n143: if (cachedAllowance != type(uint256).max) {\n144: requi", "vulnerable_code": "File: packages/contracts/contracts/BorrowerOperations.sol\n\n394: _requireValidDebtRepayment(vars.debt, vars.netDebtChange); // @audit: included in L396\n395: _requireSufficientEbtcTokenBalance(msg.sender, vars.netDebtChange);\n396: _requireNonZeroDebt(vars.debt - vars.netDebtChange);\n\n454: _requireAtLeastMinNetStEthBalance(vars.netStEthBalance);\n463: require(vars.netStEthBalance > 0, \"BorrowerOperations: zero collateral for openCdp()!\"); // @audit: included in L454", "fixed_code": "1038: uint256 newCollShares = _collShares; // @audit: L1041 overrides this initialization\n1039: uint256 newDebt = _debt; // @audit: L1044 overrides this initialization\n1040:\n1041: newCollShares = _isCollIncrease\n1042: ? _collShares + _collSharesChange\n1043: : _collShares - _collSharesChange;\n1044: newDebt = _isDebtIncrease ? _debt + _debtChange : _debt - _debtChange;", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/leegh-G.md", "collected_at": "2026-01-02T18:26:54.265873+00:00", "source_hash": "1382ef7abed70e710ebcc4a2404c9c4f4e7da595d8727283511f44a62a73cb9c", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 932, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: packages/contracts/contracts/BorrowerOperations.sol\n\n394: _requireValidDebtRepayment(vars.debt, vars.netDebtChange); // @audit: included in L396\n395: _requireSufficientEbtcTokenBalance(msg.sender, vars.netDebtChange);\n396: _requireNonZeroDebt(vars.debt - vars.netDebtChange);\n\n454: _requireAtLeastMinNetStEthBalance(vars.netStEthBalance);\n463: require(vars.netStEthBalance > 0, \"BorrowerOperations: zero collateral for openCdp()!\"); // @audit: included in L454", "primary_code_language": "solidity", "primary_code_char_count": 513, "all_code_blocks": "// Code block 1 (solidity):\nFile: packages/contracts/contracts/BorrowerOperations.sol\n\n394: _requireValidDebtRepayment(vars.debt, vars.netDebtChange); // @audit: included in L396\n395: _requireSufficientEbtcTokenBalance(msg.sender, vars.netDebtChange);\n396: _requireNonZeroDebt(vars.debt - vars.netDebtChange);\n\n454: _requireAtLeastMinNetStEthBalance(vars.netStEthBalance);\n463: require(vars.netStEthBalance > 0, \"BorrowerOperations: zero collateral for openCdp()!\"); // @audit: included in L454\n\n// Code block 2 (solidity):\n1038: uint256 newCollShares = _collShares; // @audit: L1041 overrides this initialization\n1039: uint256 newDebt = _debt; // @audit: L1044 overrides this initialization\n1040:\n1041: newCollShares = _isCollIncrease\n1042: ? _collShares + _collSharesChange\n1043: : _collShares - _collSharesChange;\n1044: newDebt = _isDebtIncrease ? _debt + _debtChange : _debt - _debtChange;", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: packages/contracts/contracts/BorrowerOperations.sol\n\n394: _requireValidDebtRepayment(vars.debt, vars.netDebtChange); // @audit: included in L396\n395: _requireSufficientEbtcTokenBalance(msg.sender, vars.netDebtChange);\n396: _requireNonZeroDebt(vars.debt - vars.netDebtChange);\n\n454: _requireAtLeastMinNetStEthBalance(vars.netStEthBalance);\n463: require(vars.netStEthBalance > 0, \"BorrowerOperations: zero collateral for openCdp()!\"); // @audit: included in L454\n\n1038: uint256 newCollShares = _collShares; // @audit: L1041 overrides this initialization\n1039: uint256 newDebt = _debt; // @audit: L1044 overrides this initialization\n1040:\n1041: newCollShares = _isCollIncrease\n1042: ? _collShares + _collSharesChange\n1043: : _collShares - _collSharesChange;\n1044: newDebt = _isDebtIncrease ? _debt + _debtChange : _debt - _debtChange;", "github_refs_formatted": "BorrowerOperations.sol#L394-L396, BorrowerOperations.sol#L454-L463, BorrowerOperations.sol#L1038-L1044", "github_files_list": "BorrowerOperations.sol", "github_refs_count": 3, "vulnerable_code_actual": "File: packages/contracts/contracts/BorrowerOperations.sol\n\n394: _requireValidDebtRepayment(vars.debt, vars.netDebtChange); // @audit: included in L396\n395: _requireSufficientEbtcTokenBalance(msg.sender, vars.netDebtChange);\n396: _requireNonZeroDebt(vars.debt - vars.netDebtChange);\n\n454: _requireAtLeastMinNetStEthBalance(vars.netStEthBalance);\n463: require(vars.netStEthBalance > 0, \"BorrowerOperations: zero collateral for openCdp()!\"); // @audit: included in L454", "has_vulnerable_code_snippet": true, "fixed_code_actual": "1038: uint256 newCollShares = _collShares; // @audit: L1041 overrides this initialization\n1039: uint256 newDebt = _debt; // @audit: L1044 overrides this initialization\n1040:\n1041: newCollShares = _isCollIncrease\n1042: ? _collShares + _collSharesChange\n1043: : _collShares - _collSharesChange;\n1044: newDebt = _isDebtIncrease ? _debt + _debtChange : _debt - _debtChange;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-salty", "title": "Bauchibred Q", "severity_raw": "High", "severity": "high", "description": "# QA Report\n\n## Table of Contents\n\n| Issue ID | Description |\n| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |\n| [QA-01](#qa-01-proposecountryinclusion-does-not-have-proper-checks-to-ensure-that-a-valid-country-is-proposed-to-be-included) | `proposeCountryInclusion()` does not have proper checks to ensure that a valid country is proposed to be included |\n| [QA-02](#qa-02-hardcoding-recipient-while-withdrawing-is-bad-practice) | Hardcoding recipient while withdrawing is bad practice |\n| [QA-03](#qa-03-protocols-implementation-of-feed-addresses-could-lead-to-a-dos-of-not-less-than-a-month) | Protocol's implementation of feed addresses could lead to a DOS of not less than a month |\n| [QA-04](#qa-04-liquidation-could-be-frontrun) | Liquidation could be frontrun |\n| [QA-05](#qa-05-latestrounddata-returns-0-in-any-failure-would-probably-fault-multiple-logics) | `latestRoundData()` returns 0 in any failure would probably fault multiple logics |\n| [QA-06](#qa-06-values-are-still-being-stored-in-ether-value) | Values are still being stored in ether value ", "vulnerable_code": "\tfunction proposeCountryInclusion( string calldata country, string calldata description ) external nonReentrant returns (uint256 ballotID)\n\t\t{\n\t\trequire( bytes(country).length == 2, \"Country must be an ISO 3166 Alpha-2 Code\" );\n\n\t\tstring memory ballotName = string.concat(\"include:\", country );\n\t\treturn _possiblyCreateProposal( ballotName, BallotType.INCLUDE_COUNTRY, address(0), 0, country, description );\n\t\t}\n\n", "fixed_code": "// Example of a vulnerable input\nstring calldata country = \"A,\"; // Contains a comma\nstring calldata description = \"Some description\";\n\n// Calling the function with the vulnerable input\nuint256 ballotID = proposeCountryInclusion(country, description);", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/Bauchibred-Q.md", "collected_at": "2026-01-02T19:01:13.189742+00:00", "source_hash": "13e6d6ea11d1f911969a2adf4f4d9c436aa9c48e3ce3e8d5acdea3eeb45b91f7", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "\tfunction proposeCountryInclusion( string calldata country, string calldata description ) external nonReentrant returns (uint256 ballotID)\n\t\t{\n\t\trequire( bytes(country).length == 2, \"Country must be an ISO 3166 Alpha-2 Code\" );\n\n\t\tstring memory ballotName = string.concat(\"include:\", country );\n\t\treturn _possiblyCreateProposal( ballotName, BallotType.INCLUDE_COUNTRY, address(0), 0, country, description );\n\t\t}\n\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "// Example of a vulnerable input\nstring calldata country = \"A,\"; // Contains a comma\nstring calldata description = \"Some description\";\n\n// Calling the function with the vulnerable input\nuint256 ballotID = proposeCountryInclusion(country, description);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "07-amphora", "title": "giovannidisiena Q", "severity_raw": "Low", "severity": "low", "description": "## Low Issues\n### `UniswapV3OracleRelay` should validate token0/1 is actually the quote token\nThe `UniswapV3OracleRelay` constructor contains the following logic:\n```solidity\nconstructor(uint32 _lookback, address _poolAddress, bool _quoteTokenIsToken0) OracleRelay(OracleType.Uniswap) {\n ...\n QUOTE_TOKEN_IS_TOKEN0 = _quoteTokenIsToken0;\n POOL = IUniswapV3Pool(_poolAddress);\n\n address _token0 = POOL.token0();\n address _token1 = POOL.token1(); // @audit-info - LOW: should validate that quote token is actually weth\n\n (BASE_TOKEN, QUOTE_TOKEN) = QUOTE_TOKEN_IS_TOKEN0 ? (_token1, _token0) : (_token0, _token1);\n BASE_TOKEN_DECIMALS = IERC20Metadata(BASE_TOKEN).decimals();\n QUOTE_TOKEN_DECIMALS = IERC20Metadata(QUOTE_TOKEN).decimals();\n ...\n}\n```\nThis is inherited by only `UniswapV3TokenOracleRelay` which expects the quote token to be ETH, corresponding to the ETH/USDC data feed address, which will be wrapped as WETH on Uniswap. Currently, as above, the pool tokens are retrieved directly from the pool address but there is no validation that either token is indeed WETH. A check should be added to ensure the quote token assigned is actually WETH.\n\n### Unchecked return values of `EnumerableSet.AddressSet::add/remove`\n```solidity\nfunction addVaultController(address _vaultController) external onlyOwner {\n _vaultControllers.add(_vaultController); // @audit-info - LOW: unchecked return value, only grant/revoke role & emit event if true\n _grantRole(VAULT_CONTROLLER_ROLE, _vaultController);\n\n emit VaultControllerAdded(_vaultController);\n }\n```\nWhen calling `add/remove` on `EnumerableSet.AddressSet` it is important to check the boolean return values as if the address in question has already been added/does not exist in the set respectively then these functions will return false. In this case, events will be erroneously emitted when calling `USDA::addVaultController`, `USDA::removeVaultController` and `USDA::removeVaultControllerFromList` which cou", "vulnerable_code": "constructor(uint32 _lookback, address _poolAddress, bool _quoteTokenIsToken0) OracleRelay(OracleType.Uniswap) {\n ...\n QUOTE_TOKEN_IS_TOKEN0 = _quoteTokenIsToken0;\n POOL = IUniswapV3Pool(_poolAddress);\n\n address _token0 = POOL.token0();\n address _token1 = POOL.token1(); // @audit-info - LOW: should validate that quote token is actually weth\n\n (BASE_TOKEN, QUOTE_TOKEN) = QUOTE_TOKEN_IS_TOKEN0 ? (_token1, _token0) : (_token0, _token1);\n BASE_TOKEN_DECIMALS = IERC20Metadata(BASE_TOKEN).decimals();\n QUOTE_TOKEN_DECIMALS = IERC20Metadata(QUOTE_TOKEN).decimals();\n ...\n}", "fixed_code": "function addVaultController(address _vaultController) external onlyOwner {\n _vaultControllers.add(_vaultController); // @audit-info - LOW: unchecked return value, only grant/revoke role & emit event if true\n _grantRole(VAULT_CONTROLLER_ROLE, _vaultController);\n\n emit VaultControllerAdded(_vaultController);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/giovannidisiena-Q.md", "collected_at": "2026-01-02T18:23:48.366086+00:00", "source_hash": "13fcf5e904f3a8aa28ed0e5ea0f1d861c757c1b00a6d2a1c560301e32b68175d", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 916, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "constructor(uint32 _lookback, address _poolAddress, bool _quoteTokenIsToken0) OracleRelay(OracleType.Uniswap) {\n ...\n QUOTE_TOKEN_IS_TOKEN0 = _quoteTokenIsToken0;\n POOL = IUniswapV3Pool(_poolAddress);\n\n address _token0 = POOL.token0();\n address _token1 = POOL.token1(); // @audit-info - LOW: should validate that quote token is actually weth\n\n (BASE_TOKEN, QUOTE_TOKEN) = QUOTE_TOKEN_IS_TOKEN0 ? (_token1, _token0) : (_token0, _token1);\n BASE_TOKEN_DECIMALS = IERC20Metadata(BASE_TOKEN).decimals();\n QUOTE_TOKEN_DECIMALS = IERC20Metadata(QUOTE_TOKEN).decimals();\n ...\n}", "primary_code_language": "solidity", "primary_code_char_count": 596, "all_code_blocks": "// Code block 1 (solidity):\nconstructor(uint32 _lookback, address _poolAddress, bool _quoteTokenIsToken0) OracleRelay(OracleType.Uniswap) {\n ...\n QUOTE_TOKEN_IS_TOKEN0 = _quoteTokenIsToken0;\n POOL = IUniswapV3Pool(_poolAddress);\n\n address _token0 = POOL.token0();\n address _token1 = POOL.token1(); // @audit-info - LOW: should validate that quote token is actually weth\n\n (BASE_TOKEN, QUOTE_TOKEN) = QUOTE_TOKEN_IS_TOKEN0 ? (_token1, _token0) : (_token0, _token1);\n BASE_TOKEN_DECIMALS = IERC20Metadata(BASE_TOKEN).decimals();\n QUOTE_TOKEN_DECIMALS = IERC20Metadata(QUOTE_TOKEN).decimals();\n ...\n}\n\n// Code block 2 (solidity):\nfunction addVaultController(address _vaultController) external onlyOwner {\n _vaultControllers.add(_vaultController); // @audit-info - LOW: unchecked return value, only grant/revoke role & emit event if true\n _grantRole(VAULT_CONTROLLER_ROLE, _vaultController);\n\n emit VaultControllerAdded(_vaultController);\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "constructor(uint32 _lookback, address _poolAddress, bool _quoteTokenIsToken0) OracleRelay(OracleType.Uniswap) {\n ...\n QUOTE_TOKEN_IS_TOKEN0 = _quoteTokenIsToken0;\n POOL = IUniswapV3Pool(_poolAddress);\n\n address _token0 = POOL.token0();\n address _token1 = POOL.token1(); // @audit-info - LOW: should validate that quote token is actually weth\n\n (BASE_TOKEN, QUOTE_TOKEN) = QUOTE_TOKEN_IS_TOKEN0 ? (_token1, _token0) : (_token0, _token1);\n BASE_TOKEN_DECIMALS = IERC20Metadata(BASE_TOKEN).decimals();\n QUOTE_TOKEN_DECIMALS = IERC20Metadata(QUOTE_TOKEN).decimals();\n ...\n}\n\nfunction addVaultController(address _vaultController) external onlyOwner {\n _vaultControllers.add(_vaultController); // @audit-info - LOW: unchecked return value, only grant/revoke role & emit event if true\n _grantRole(VAULT_CONTROLLER_ROLE, _vaultController);\n\n emit VaultControllerAdded(_vaultController);\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "constructor(uint32 _lookback, address _poolAddress, bool _quoteTokenIsToken0) OracleRelay(OracleType.Uniswap) {\n ...\n QUOTE_TOKEN_IS_TOKEN0 = _quoteTokenIsToken0;\n POOL = IUniswapV3Pool(_poolAddress);\n\n address _token0 = POOL.token0();\n address _token1 = POOL.token1(); // @audit-info - LOW: should validate that quote token is actually weth\n\n (BASE_TOKEN, QUOTE_TOKEN) = QUOTE_TOKEN_IS_TOKEN0 ? (_token1, _token0) : (_token0, _token1);\n BASE_TOKEN_DECIMALS = IERC20Metadata(BASE_TOKEN).decimals();\n QUOTE_TOKEN_DECIMALS = IERC20Metadata(QUOTE_TOKEN).decimals();\n ...\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function addVaultController(address _vaultController) external onlyOwner {\n _vaultControllers.add(_vaultController); // @audit-info - LOW: unchecked return value, only grant/revoke role & emit event if true\n _grantRole(VAULT_CONTROLLER_ROLE, _vaultController);\n\n emit VaultControllerAdded(_vaultController);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "04-caviar", "title": "Madalad Q", "severity_raw": "Critical", "severity": "critical", "description": "# Low Risk Summary\n| |Issue|Instances|\n|:-:|:-|:-:|\n|[L-01]|Use `safeTransfer` instead of `transfer` for token transfers|5|\n|[L-02]|Downcasting `uint` or `int` may result in overflow|2|\n\nTotal issues: 2\n\nTotal instances: 7\n\n \n# Non-Critical Summary\n| |Issue|Instances|\n|:-:|:-|:-:|\n|[N-01]|Use `indexed` for event parameters|11|\n|[N-02]|Use fixed compiler version|4|\n|[N-03]|Use appropriate function naming convention|1|\n|[N-04]|Lines too long|4|\n|[N-05]|Missing `address(0)` checks in constructor/initialize|3|\n\nTotal issues: 5\n\nTotal instances: 23\n\n \n# Low Risk Issues\n## [L-01] Use `safeTransfer` instead of `transfer` for token transfers\n\n`SafeERC20` is a wrapper around ERC20 operations that throw on failure (when the token contract returns false). This prevents calls executing if a token transfer is unsuccessful. Simply add `using SafeERC20 for ERC20`.\n\nInstances: 5\n```solidity\nFile: src/Factory.sol\n\n115: ERC20(_baseToken).transferFrom(msg.sender, address(privatePool), baseTokenAmount);\n\n152: ERC20(token).transfer(msg.sender, amount);\n\n```\n- [src/Factory.sol#L115](https://github.com/code-423n4/2023-04-caviar/blob/main/src/Factory.sol#L115)\n- [src/Factory.sol#L152](https://github.com/code-423n4/2023-04-caviar/blob/main/src/Factory.sol#L152)\n\n```solidity\nFile: src/PrivatePool.sol\n\n365: ERC20(baseToken).transfer(msg.sender, netOutputAmount);\n\n527: ERC20(token).transfer(msg.sender, tokenAmount);\n\n651: if (baseToken != address(0)) ERC20(baseToken).transferFrom(msg.sender, address(this), fee);\n\n```\n- [src/PrivatePool.sol#L365](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L365)\n- [src/PrivatePool.sol#L527](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L527)\n- [src/PrivatePool.sol#L651](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L651)\n\n \n## [L-02] Downcasting `uint` or `int` may result in overflow\n\nConsider using Open", "vulnerable_code": "File: src/Factory.sol\n\n115: ERC20(_baseToken).transferFrom(msg.sender, address(privatePool), baseTokenAmount);\n\n152: ERC20(token).transfer(msg.sender, amount);\n", "fixed_code": "File: src/PrivatePool.sol\n\n365: ERC20(baseToken).transfer(msg.sender, netOutputAmount);\n\n527: ERC20(token).transfer(msg.sender, tokenAmount);\n\n651: if (baseToken != address(0)) ERC20(baseToken).transferFrom(msg.sender, address(this), fee);\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/Madalad-Q.md", "collected_at": "2026-01-02T18:19:50.554333+00:00", "source_hash": "1414512a8001e486cb4161d275fa1a57a412be3e723842acdf8eaf01ac2eff91", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 454, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: src/Factory.sol\n\n115: ERC20(_baseToken).transferFrom(msg.sender, address(privatePool), baseTokenAmount);\n\n152: ERC20(token).transfer(msg.sender, amount);", "primary_code_language": "solidity", "primary_code_char_count": 183, "all_code_blocks": "// Code block 1 (solidity):\nFile: src/Factory.sol\n\n115: ERC20(_baseToken).transferFrom(msg.sender, address(privatePool), baseTokenAmount);\n\n152: ERC20(token).transfer(msg.sender, amount);\n\n// Code block 2 (solidity):\nFile: src/PrivatePool.sol\n\n365: ERC20(baseToken).transfer(msg.sender, netOutputAmount);\n\n527: ERC20(token).transfer(msg.sender, tokenAmount);\n\n651: if (baseToken != address(0)) ERC20(baseToken).transferFrom(msg.sender, address(this), fee);", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: src/Factory.sol\n\n115: ERC20(_baseToken).transferFrom(msg.sender, address(privatePool), baseTokenAmount);\n\n152: ERC20(token).transfer(msg.sender, amount);\n\nFile: src/PrivatePool.sol\n\n365: ERC20(baseToken).transfer(msg.sender, netOutputAmount);\n\n527: ERC20(token).transfer(msg.sender, tokenAmount);\n\n651: if (baseToken != address(0)) ERC20(baseToken).transferFrom(msg.sender, address(this), fee);", "github_refs_formatted": "Factory.sol#L115, Factory.sol#L152, PrivatePool.sol#L365, PrivatePool.sol#L527, PrivatePool.sol#L651", "github_files_list": "PrivatePool.sol, Factory.sol", "github_refs_count": 5, "vulnerable_code_actual": "File: src/Factory.sol\n\n115: ERC20(_baseToken).transferFrom(msg.sender, address(privatePool), baseTokenAmount);\n\n152: ERC20(token).transfer(msg.sender, amount);\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: src/PrivatePool.sol\n\n365: ERC20(baseToken).transfer(msg.sender, netOutputAmount);\n\n527: ERC20(token).transfer(msg.sender, tokenAmount);\n\n651: if (baseToken != address(0)) ERC20(baseToken).transferFrom(msg.sender, address(this), fee);\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "04-caviar", "title": "adriro Q", "severity_raw": "High", "severity": "high", "description": "# Report\n\n\n## Low Issues\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [L-1](#L-1) | Contract files should define a locked compiler version | 4 |\n| [L-2](#L-2) | Royalties are paid assuming all NFTs in the batch are equally priced | - |\n| [L-3](#L-3) | Potential loss of funds when paying royalties | - |\n| [L-4](#L-4) | NFT address is not validated in Factory `create` | - |\n| [L-5](#L-5) | Missing event for important parameter change | 3 |\n| [L-6](#L-6) | Factory `setProtocolFeeRate` should validate that the fee rate is within an acceptable range | - |\n| [L-7](#L-7) | Potential overflow while updating reserves values in PrivatePool contract | - |\n| [L-8](#L-8) | Zero amount ERC20 token transfers may fail some implementations | - |\n| [L-9](#L-9) | `price` function will revert for ERC20 token with high decimals | - |\n\n\n### [L-1] Contract files should define a locked compiler version\nContracts should be deployed with the same compiler version and flags that they have been tested with thoroughly. Locking the pragma helps to ensure that contracts do not accidentally get deployed using, for example, an outdated compiler version that might introduce bugs that affect the contract system negatively.\n\n*Instances (4)*:\n```solidity\nFile: src/EthRouter.sol\n\n2: pragma solidity ^0.8.19;\n\n```\n\n```solidity\nFile: src/Factory.sol\n\n2: pragma solidity ^0.8.19;\n\n```\n\n```solidity\nFile: src/PrivatePool.sol\n\n2: pragma solidity ^0.8.19;\n\n```\n\n```solidity\nFile: src/PrivatePoolMetadata.sol\n\n2: pragma solidity ^0.8.19;\n\n```\n\n### [L-2] Royalties are paid assuming all NFTs in the batch are equally priced\n\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L236\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L335\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L115\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L182\n\nIn the EthRouter and PrivatePool contracts, when b", "vulnerable_code": "File: src/EthRouter.sol\n\n2: pragma solidity ^0.8.19;\n", "fixed_code": "File: src/Factory.sol\n\n2: pragma solidity ^0.8.19;\n", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/adriro-Q.md", "collected_at": "2026-01-02T18:20:14.727830+00:00", "source_hash": "142df0b324aec5a3f9e9a46fbdbcc7ea966d8b6701e1e0b50c50654daf33b5b6", "code_block_count": 4, "solidity_block_count": 4, "total_code_chars": 218, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: src/EthRouter.sol\n\n2: pragma solidity ^0.8.19;", "primary_code_language": "solidity", "primary_code_char_count": 52, "all_code_blocks": "// Code block 1 (solidity):\nFile: src/EthRouter.sol\n\n2: pragma solidity ^0.8.19;\n\n// Code block 2 (solidity):\nFile: src/Factory.sol\n\n2: pragma solidity ^0.8.19;\n\n// Code block 3 (solidity):\nFile: src/PrivatePool.sol\n\n2: pragma solidity ^0.8.19;\n\n// Code block 4 (solidity):\nFile: src/PrivatePoolMetadata.sol\n\n2: pragma solidity ^0.8.19;", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: src/EthRouter.sol\n\n2: pragma solidity ^0.8.19;\n\nFile: src/Factory.sol\n\n2: pragma solidity ^0.8.19;\n\nFile: src/PrivatePool.sol\n\n2: pragma solidity ^0.8.19;\n\nFile: src/PrivatePoolMetadata.sol\n\n2: pragma solidity ^0.8.19;", "github_refs_formatted": "PrivatePool.sol#L236, PrivatePool.sol#L335, EthRouter.sol#L115, EthRouter.sol#L182", "github_files_list": "EthRouter.sol, PrivatePool.sol", "github_refs_count": 4, "vulnerable_code_actual": "File: src/EthRouter.sol\n\n2: pragma solidity ^0.8.19;\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: src/Factory.sol\n\n2: pragma solidity ^0.8.19;\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "04-caviar", "title": "Shubham G", "severity_raw": "Medium", "severity": "medium", "description": "## Gas Optimization\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [G-01](#G-01) | `x += y/x -= y` costs more gas than `x = x + y/x = x - y` for state variables | 9 |\n| [G-02](#G-02) | Setting the constructor to `payable` | 2 |\n\n## [G-01] `x += y/x -= y` costs more gas than `x = x + y/x = x - y` for state variables\n\n*There are 9 instances of this issue*\n\n```solidity\nFile: main/src/PrivatePool.sol\n\nL:230 virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\nL:231 virtualNftReserves -= uint128(weightSum);\nL:247 royaltyFeeAmount += royaltyFee;\nL:252 netInputAmount += royaltyFeeAmount;\nL:323 virtualBaseTokenReserves -= uint128(netOutputAmount + protocolFeeAmount + feeAmount);\nL:324 virtualNftReserves += uint128(weightSum);\nL:341 royaltyFeeAmount += royaltyFee;\nL:355 netOutputAmount -= royaltyFeeAmount;\nL:678 sum += tokenWeights[i];\n```\n## Recommended Step\n\n```solidity\nFile: main/src/PrivatePool.sol\n\n - L:230 virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n + L:230 virtualBaseTokenReserves = virtualBaseTokenReserves + uint128(netInputAmount - feeAmount - protocolFeeAmount);\n```\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L230\n\n```solidity\nFile: main/src/PrivatePool.sol\n\n - L:231 virtualNftReserves -= uint128(weightSum);\n + L:231 virtualNftReserves = virtualNftReserves - uint128(weightSum);\n```\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L231\n\n```solidity\nFile: main/src/PrivatePool.sol\n\n - L:247 royaltyFeeAmount += royaltyFee;\n + L:247 royaltyFeeAmount = royaltyFeeAmount + royaltyFee;\n```\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L247\n\n```solidity\nFile: main/src/PrivatePool.sol\n\n - L:252 netInputAmount += royaltyFeeAmount;\n + L:252 netInputAmount = netInputAmount + royaltyFeeAmount;\n```\nhttps://github.com/co", "vulnerable_code": "File: main/src/PrivatePool.sol\n\nL:230 virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\nL:231 virtualNftReserves -= uint128(weightSum);\nL:247 royaltyFeeAmount += royaltyFee;\nL:252 netInputAmount += royaltyFeeAmount;\nL:323 virtualBaseTokenReserves -= uint128(netOutputAmount + protocolFeeAmount + feeAmount);\nL:324 virtualNftReserves += uint128(weightSum);\nL:341 royaltyFeeAmount += royaltyFee;\nL:355 netOutputAmount -= royaltyFeeAmount;\nL:678 sum += tokenWeights[i];", "fixed_code": "File: main/src/PrivatePool.sol\n\n - L:230 virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n + L:230 virtualBaseTokenReserves = virtualBaseTokenReserves + uint128(netInputAmount - feeAmount - protocolFeeAmount);", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/Shubham-G.md", "collected_at": "2026-01-02T18:20:07.119192+00:00", "source_hash": "147b2bfb566067222f8cd4b151fc69f37563930fdc80b9055f4b343c9928c1d0", "code_block_count": 5, "solidity_block_count": 5, "total_code_chars": 1286, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: main/src/PrivatePool.sol\n\nL:230 virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\nL:231 virtualNftReserves -= uint128(weightSum);\nL:247 royaltyFeeAmount += royaltyFee;\nL:252 netInputAmount += royaltyFeeAmount;\nL:323 virtualBaseTokenReserves -= uint128(netOutputAmount + protocolFeeAmount + feeAmount);\nL:324 virtualNftReserves += uint128(weightSum);\nL:341 royaltyFeeAmount += royaltyFee;\nL:355 netOutputAmount -= royaltyFeeAmount;\nL:678 sum += tokenWeights[i];", "primary_code_language": "solidity", "primary_code_char_count": 564, "all_code_blocks": "// Code block 1 (solidity):\nFile: main/src/PrivatePool.sol\n\nL:230 virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\nL:231 virtualNftReserves -= uint128(weightSum);\nL:247 royaltyFeeAmount += royaltyFee;\nL:252 netInputAmount += royaltyFeeAmount;\nL:323 virtualBaseTokenReserves -= uint128(netOutputAmount + protocolFeeAmount + feeAmount);\nL:324 virtualNftReserves += uint128(weightSum);\nL:341 royaltyFeeAmount += royaltyFee;\nL:355 netOutputAmount -= royaltyFeeAmount;\nL:678 sum += tokenWeights[i];\n\n// Code block 2 (solidity):\nFile: main/src/PrivatePool.sol\n\n - L:230 virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n + L:230 virtualBaseTokenReserves = virtualBaseTokenReserves + uint128(netInputAmount - feeAmount - protocolFeeAmount);\n\n// Code block 3 (solidity):\nFile: main/src/PrivatePool.sol\n\n - L:231 virtualNftReserves -= uint128(weightSum);\n + L:231 virtualNftReserves = virtualNftReserves - uint128(weightSum);\n\n// Code block 4 (solidity):\nFile: main/src/PrivatePool.sol\n\n - L:247 royaltyFeeAmount += royaltyFee;\n + L:247 royaltyFeeAmount = royaltyFeeAmount + royaltyFee;\n\n// Code block 5 (solidity):\nFile: main/src/PrivatePool.sol\n\n - L:252 netInputAmount += royaltyFeeAmount;\n + L:252 netInputAmount = netInputAmount + royaltyFeeAmount;", "all_code_blocks_count": 5, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: main/src/PrivatePool.sol\n\nL:230 virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\nL:231 virtualNftReserves -= uint128(weightSum);\nL:247 royaltyFeeAmount += royaltyFee;\nL:252 netInputAmount += royaltyFeeAmount;\nL:323 virtualBaseTokenReserves -= uint128(netOutputAmount + protocolFeeAmount + feeAmount);\nL:324 virtualNftReserves += uint128(weightSum);\nL:341 royaltyFeeAmount += royaltyFee;\nL:355 netOutputAmount -= royaltyFeeAmount;\nL:678 sum += tokenWeights[i];\n\nFile: main/src/PrivatePool.sol\n\n - L:230 virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n + L:230 virtualBaseTokenReserves = virtualBaseTokenReserves + uint128(netInputAmount - feeAmount - protocolFeeAmount);\n\nFile: main/src/PrivatePool.sol\n\n - L:231 virtualNftReserves -= uint128(weightSum);\n + L:231 virtualNftReserves = virtualNftReserves - uint128(weightSum);\n\nFile: main/src/PrivatePool.sol\n\n - L:247 royaltyFeeAmount += royaltyFee;\n + L:247 royaltyFeeAmount = royaltyFeeAmount + royaltyFee;\n\nFile: main/src/PrivatePool.sol\n\n - L:252 netInputAmount += royaltyFeeAmount;\n + L:252 netInputAmount = netInputAmount + royaltyFeeAmount;", "github_refs_formatted": "PrivatePool.sol#L230, PrivatePool.sol#L231, PrivatePool.sol#L247", "github_files_list": "PrivatePool.sol", "github_refs_count": 3, "vulnerable_code_actual": "File: main/src/PrivatePool.sol\n\nL:230 virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\nL:231 virtualNftReserves -= uint128(weightSum);\nL:247 royaltyFeeAmount += royaltyFee;\nL:252 netInputAmount += royaltyFeeAmount;\nL:323 virtualBaseTokenReserves -= uint128(netOutputAmount + protocolFeeAmount + feeAmount);\nL:324 virtualNftReserves += uint128(weightSum);\nL:341 royaltyFeeAmount += royaltyFee;\nL:355 netOutputAmount -= royaltyFeeAmount;\nL:678 sum += tokenWeights[i];", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: main/src/PrivatePool.sol\n\n - L:230 virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n + L:230 virtualBaseTokenReserves = virtualBaseTokenReserves + uint128(netInputAmount - feeAmount - protocolFeeAmount);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 11} {"source": "c4", "protocol": "11-kelp", "title": "TeamSS G", "severity_raw": "Low", "severity": "low", "description": "## Disclaimer \n*Gas findings in this report has been thoroughly tested to hold no inherent risk (security or otherwise) to the operations of the protocol but we strongly advise the Kelp DAO team to properly test before applying the recommended fix.*\n\n## [G-0] Use modifier instead of a function for zero address checks. \nIn multiple instances of the Kelp DAO codebase, `UtilLib::checkNonZeroAddress` is used to check for the presence of _zero address_ in addresses passed as arguments to core protocol functions. The problem with this approach is that it consumes more gas vs a modifier version. Although, it is worth noting that modifiers can't be defined in Libraries. For this, we suggest the usage of a helper/wrapper contract to contain the zero address modifier logic. It is true that modifiers \n\n[Reference](https://github.com/code-423n4/2022-01-elasticswap-findings/issues/77)\n\n#### Instances: used across 6 contracts. \nexample: \n```\n function updatePriceFeedFor(address asset, address priceFeed) external onlyLRTManager onlySupportedAsset(asset) {\n UtilLib.checkNonZeroAddress(priceFeed); // This line. \n assetPriceFeed[asset] = priceFeed;\n emit AssetPriceFeedUpdate(asset, priceFeed);\n }\n```\n\n#### POC\n\n```\n// SPDX-License-Identifier: MIT\n \n pragma solidity 0.8.21; \n\n\n/// @notice helper contract with the modifier for zero address check.\n contract Modifier {\n // deployment tx cost: 66854 gas\n // usage cost: 685 gas \n\n error ZeroAddressNotAllowed();\n\n modifier checkNonZeroAddress(address address_) {\n if (address_ == address(0)) revert ZeroAddressNotAllowed();\n _;\n }\n\n \n }\n\n /// @notice Library with the function with zero address check. \n\n library Function {\n // deployment tx cost: 72062 gas\n // 731 gas \n error ZeroAddressNotAllowed();\n\n function checkNonZeroAddress(address address_) internal pure {\n if (address_ == address(0)) revert ZeroAddressNotAllowed();\n }\n\n \n }\n\n /// @dev contract to test t", "vulnerable_code": " function updatePriceFeedFor(address asset, address priceFeed) external onlyLRTManager onlySupportedAsset(asset) {\n UtilLib.checkNonZeroAddress(priceFeed); // This line. \n assetPriceFeed[asset] = priceFeed;\n emit AssetPriceFeedUpdate(asset, priceFeed);\n }", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/TeamSS-G.md", "collected_at": "2026-01-02T18:27:42.539555+00:00", "source_hash": "14e32ca6833fdc68f0c00c335e428ceacdba4a6daa0ea3ae057b7df7cc4f70a9", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 278, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function updatePriceFeedFor(address asset, address priceFeed) external onlyLRTManager onlySupportedAsset(asset) {\n UtilLib.checkNonZeroAddress(priceFeed); // This line. \n assetPriceFeed[asset] = priceFeed;\n emit AssetPriceFeedUpdate(asset, priceFeed);\n }", "primary_code_language": "unknown", "primary_code_char_count": 278, "all_code_blocks": "// Code block 1 (unknown):\nfunction updatePriceFeedFor(address asset, address priceFeed) external onlyLRTManager onlySupportedAsset(asset) {\n UtilLib.checkNonZeroAddress(priceFeed); // This line. \n assetPriceFeed[asset] = priceFeed;\n emit AssetPriceFeedUpdate(asset, priceFeed);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function updatePriceFeedFor(address asset, address priceFeed) external onlyLRTManager onlySupportedAsset(asset) {\n UtilLib.checkNonZeroAddress(priceFeed); // This line. \n assetPriceFeed[asset] = priceFeed;\n emit AssetPriceFeedUpdate(asset, priceFeed);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "01-salty", "title": "inmarelibero G", "severity_raw": "Unknown", "severity": "unknown", "description": "## Summary\n\nThe function `burnTokensInContract()` in `SALT.sol` calls `_burn()` and emits an Event even if the balance is zero (there are no tokens to burn)\n\n## Impact\n\nUseless operations can be avoided by performing them only if the balance is > 0\n\n## Proof of Concept\n\nThe function body shows how there are no controls before calling `_burn()`:\n\n```\nfunction burnTokensInContract() external\n\t{\n\tuint256 balance = balanceOf( address(this) );\n\t_burn( address(this), balance );\n\n\temit SALTBurned(balance);\n\t}\n```\n\n## Tools Used\n\nManual review\n\n## Recommended Mitigation Steps\n\nCall `_burn()` and emit Event only when balance is > 0\n\n```diff\ndiff --git a/src/Salt.sol b/src/Salt.sol\nindex da51dc1..1bd1510 100644\n--- a/src/Salt.sol\n+++ b/src/Salt.sol\n@@ -25,10 +25,13 @@ contract Salt is ISalt, ERC20\n function burnTokensInContract() external\n \t{\n \tuint256 balance = balanceOf( address(this) );\n+ \n+ if (balance > 0) {\n \t_burn( address(this), balance );\n \n \temit SALTBurned(balance);\n \t}\n+ }\n```\n", "vulnerable_code": "function burnTokensInContract() external\n\t{\n\tuint256 balance = balanceOf( address(this) );\n\t_burn( address(this), balance );\n\n\temit SALTBurned(balance);\n\t}", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/inmarelibero-G.md", "collected_at": "2026-01-02T19:01:44.442667+00:00", "source_hash": "1531327b5eafd0ab9793e5a602afad80dfbad186713172af3cfb3d5d34120682", "code_block_count": 2, "solidity_block_count": 1, "total_code_chars": 546, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function burnTokensInContract() external\n\t{\n\tuint256 balance = balanceOf( address(this) );\n\t_burn( address(this), balance );\n\n\temit SALTBurned(balance);\n\t}", "primary_code_language": "unknown", "primary_code_char_count": 155, "all_code_blocks": "// Code block 1 (unknown):\nfunction burnTokensInContract() external\n\t{\n\tuint256 balance = balanceOf( address(this) );\n\t_burn( address(this), balance );\n\n\temit SALTBurned(balance);\n\t}\n\n// Code block 2 (diff):\ndiff --git a/src/Salt.sol b/src/Salt.sol\nindex da51dc1..1bd1510 100644\n--- a/src/Salt.sol\n+++ b/src/Salt.sol\n@@ -25,10 +25,13 @@ contract Salt is ISalt, ERC20\n function burnTokensInContract() external\n \t{\n \tuint256 balance = balanceOf( address(this) );\n+ \n+ if (balance > 0) {\n \t_burn( address(this), balance );\n \n \temit SALTBurned(balance);\n \t}\n+ }", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "diff --git a/src/Salt.sol b/src/Salt.sol\nindex da51dc1..1bd1510 100644\n--- a/src/Salt.sol\n+++ b/src/Salt.sol\n@@ -25,10 +25,13 @@ contract Salt is ISalt, ERC20\n function burnTokensInContract() external\n \t{\n \tuint256 balance = balanceOf( address(this) );\n+ \n+ if (balance > 0) {\n \t_burn( address(this), balance );\n \n \temit SALTBurned(balance);\n \t}\n+ }", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function burnTokensInContract() external\n\t{\n\tuint256 balance = balanceOf( address(this) );\n\t_burn( address(this), balance );\n\n\temit SALTBurned(balance);\n\t}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 7.07} {"source": "c4", "protocol": "11-kelp", "title": "CatsSecurity Q", "severity_raw": "Medium", "severity": "medium", "description": "## [NC - 1] - Add `onlySupportedAsset(asset)` modifier to `getAssetBalance()` in NodeDelegator.sol\nThe modifier can be added to the function to catch the mistake earlier instead of reverting letter\n```diff\n function getAssetBalance(address asset) \nexternal \nview \noverride \n+ onlySupportedAsset(asset)\nreturns (uint256) {\n address strategy = lrtConfig.assetStrategy(asset);\n return IStrategy(strategy).userUnderlyingView(address(this));\n }\n ```\n \n https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/NodeDelegator.sol#L121-L124\n \n ## [NC-2] `updateMaxNodeDelegatorCount` can increase or decrease the maxDelegatorCount but there is no mechanism to remove the extra delegators in case the maxNodeDelegatorCount is decreased from current value\n \n The following function can either increase or decrease the max number of node delegators, lets say currently there are 10 node delegators, all handling the funds. There is no mechanism to remove extras from `nodeDelegatorQueue` in case the max is decreased from current value.\n \n ```solidity\n function updateMaxNodeDelegatorCount(uint256 maxNodeDelegatorCount_) external onlyLRTAdmin {\n maxNodeDelegatorCount = maxNodeDelegatorCount_;\n emit MaxNodeDelegatorCountUpdated(maxNodeDelegatorCount);\n }\n```\n \n## [NC-3] Emit the depositers address too in `depositAsset()`\n This instance was not reported in the bot so adding it here.\n`depositAsset` function should emit the address of the depositer too along with the other parameters for easy off-chain tracking.\n\n```diff\n function depositAsset(\n address asset,\n uint256 depositAmount\n )\n external\n whenNotPaused\n nonReentrant\n onlySupportedAsset(asset)\n {\n // checks\n if (depositAmount == 0) {\n revert InvalidAmount();\n }\n if (depositAmount > getAssetCurrentLimit(asset)) {\n revert MaximumDepositLimitReached()", "vulnerable_code": " https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/NodeDelegator.sol#L121-L124\n \n ## [NC-2] `updateMaxNodeDelegatorCount` can increase or decrease the maxDelegatorCount but there is no mechanism to remove the extra delegators in case the maxNodeDelegatorCount is decreased from current value\n \n The following function can either increase or decrease the max number of node delegators, lets say currently there are 10 node delegators, all handling the funds. There is no mechanism to remove extras from `nodeDelegatorQueue` in case the max is decreased from current value.\n \n ```solidity\n function updateMaxNodeDelegatorCount(uint256 maxNodeDelegatorCount_) external onlyLRTAdmin {\n maxNodeDelegatorCount = maxNodeDelegatorCount_;\n emit MaxNodeDelegatorCountUpdated(maxNodeDelegatorCount);\n }", "fixed_code": "## [NC-4] There is no mechanism to handle in case the deposit limit is decreased below the current deposits in the contracts.\nDeposit limit can be increased or decreased anytime but the contracts implement no mechanism to handle in case it is decreased and current deposits in the system are greater than the deposit limit. There should be a mechanism whenever the limit is decreased below current funds the extra should be immediately taken out of eigen layer\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/CatsSecurity-Q.md", "collected_at": "2026-01-02T18:27:23.732207+00:00", "source_hash": "15376ca538f209f6ce910e899e19597af5110f272819294c8e93328262b2c0c1", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 469, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function getAssetBalance(address asset) \nexternal \nview \noverride \n+ onlySupportedAsset(asset)\nreturns (uint256) {\n address strategy = lrtConfig.assetStrategy(asset);\n return IStrategy(strategy).userUnderlyingView(address(this));\n }", "primary_code_language": "diff", "primary_code_char_count": 249, "all_code_blocks": "// Code block 1 (diff):\nfunction getAssetBalance(address asset) \nexternal \nview \noverride \n+ onlySupportedAsset(asset)\nreturns (uint256) {\n address strategy = lrtConfig.assetStrategy(asset);\n return IStrategy(strategy).userUnderlyingView(address(this));\n }\n\n// Code block 2 (solidity):\nfunction updateMaxNodeDelegatorCount(uint256 maxNodeDelegatorCount_) external onlyLRTAdmin {\n maxNodeDelegatorCount = maxNodeDelegatorCount_;\n emit MaxNodeDelegatorCountUpdated(maxNodeDelegatorCount);\n }", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "function getAssetBalance(address asset) \nexternal \nview \noverride \n+ onlySupportedAsset(asset)\nreturns (uint256) {\n address strategy = lrtConfig.assetStrategy(asset);\n return IStrategy(strategy).userUnderlyingView(address(this));\n }", "solidity_code": "function updateMaxNodeDelegatorCount(uint256 maxNodeDelegatorCount_) external onlyLRTAdmin {\n maxNodeDelegatorCount = maxNodeDelegatorCount_;\n emit MaxNodeDelegatorCountUpdated(maxNodeDelegatorCount);\n }", "github_refs_formatted": "NodeDelegator.sol#L121-L124", "github_files_list": "NodeDelegator.sol", "github_refs_count": 1, "vulnerable_code_actual": " https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/NodeDelegator.sol#L121-L124\n \n ## [NC-2] `updateMaxNodeDelegatorCount` can increase or decrease the maxDelegatorCount but there is no mechanism to remove the extra delegators in case the maxNodeDelegatorCount is decreased from current value\n \n The following function can either increase or decrease the max number of node delegators, lets say currently there are 10 node delegators, all handling the funds. There is no mechanism to remove extras from `nodeDelegatorQueue` in case the max is decreased from current value.\n \n ```solidity\n function updateMaxNodeDelegatorCount(uint256 maxNodeDelegatorCount_) external onlyLRTAdmin {\n maxNodeDelegatorCount = maxNodeDelegatorCount_;\n emit MaxNodeDelegatorCountUpdated(maxNodeDelegatorCount);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## [NC-4] There is no mechanism to handle in case the deposit limit is decreased below the current deposits in the contracts.\nDeposit limit can be increased or decreased anytime but the contracts implement no mechanism to handle in case it is decreased and current deposits in the system are greater than the deposit limit. There should be a mechanism whenever the limit is decreased below current funds the extra should be immediately taken out of eigen layer\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "09-ondo", "title": "Aymen0909 Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA Report\n\n## Summary\n\n| | Issue | Risk | Instances |\n| :-------------: |:-------------|:-------------:|:-------------:|\n| 1 | `preRebaseTokenAmount` and `postRebaseTokenAmount` will both have the same value which is misleading | Low | 1 |\n| 2 | Wrong fields emitted in `wrap` function events | Low | 2 |\n| 3 | `MINTER_ROLE` not usable as there is no external/public mint function | NC | 1 |\n| 4 | Comments at the top of `USDYFactory` are wrong | NC | 1 |\n\n\n## Findings\n\n### 1- `preRebaseTokenAmount` and `postRebaseTokenAmount` will both have the same value which is misleading :\n\n#### Risk : Low\n\nIn the `_burnShares` function, there two values that are computed `preRebaseTokenAmount` and `postRebaseTokenAmount` which represent the RUSDY amount before and after the change in the value of `totalShares` : \n\n```\nfunction _burnShares(\n address _account,\n uint256 _sharesAmount\n ) internal whenNotPaused returns (uint256) {\n require(_account != address(0), \"BURN_FROM_THE_ZERO_ADDRESS\");\n\n _beforeTokenTransfer(_account, address(0), _sharesAmount);\n\n uint256 accountShares = shares[_account];\n require(_sharesAmount <= accountShares, \"BURN_AMOUNT_EXCEEDS_BALANCE\");\n\n uint256 preRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\n totalShares -= _sharesAmount;\n\n shares[_account] = accountShares - _sharesAmount;\n\n uint256 postRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\n emit SharesBurnt(\n _account,\n preRebaseTokenAmount,\n postRebaseTokenAmount,\n _sharesAmount\n );\n\n ...\n}\n```\n\nThe issue is that those two values will have exactly the same value as they are both obtained from the `getRUSDYByShares` function at the same block timestamp :\n\n```\nfunction getRUSDYByShares(uint256 _shares) public view returns (uint256) {\n return (_shares * oracle.getPrice()) / (1e18 * BPS_DENOMINATOR);\n}\n```\n\nAs you can see the value returned from `getRUSDYByShares` doesn't depend on the `totalShares` cha", "vulnerable_code": "function _burnShares(\n address _account,\n uint256 _sharesAmount\n ) internal whenNotPaused returns (uint256) {\n require(_account != address(0), \"BURN_FROM_THE_ZERO_ADDRESS\");\n\n _beforeTokenTransfer(_account, address(0), _sharesAmount);\n\n uint256 accountShares = shares[_account];\n require(_sharesAmount <= accountShares, \"BURN_AMOUNT_EXCEEDS_BALANCE\");\n\n uint256 preRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\n totalShares -= _sharesAmount;\n\n shares[_account] = accountShares - _sharesAmount;\n\n uint256 postRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\n emit SharesBurnt(\n _account,\n preRebaseTokenAmount,\n postRebaseTokenAmount,\n _sharesAmount\n );\n\n ...\n}", "fixed_code": "function getRUSDYByShares(uint256 _shares) public view returns (uint256) {\n return (_shares * oracle.getPrice()) / (1e18 * BPS_DENOMINATOR);\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/Aymen0909-Q.md", "collected_at": "2026-01-02T18:25:23.722359+00:00", "source_hash": "15bea41fcf56b8e6bbd5823fc9c6a9dbb4c91e2362ec1f26f375ed406ca14e97", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 878, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _burnShares(\n address _account,\n uint256 _sharesAmount\n ) internal whenNotPaused returns (uint256) {\n require(_account != address(0), \"BURN_FROM_THE_ZERO_ADDRESS\");\n\n _beforeTokenTransfer(_account, address(0), _sharesAmount);\n\n uint256 accountShares = shares[_account];\n require(_sharesAmount <= accountShares, \"BURN_AMOUNT_EXCEEDS_BALANCE\");\n\n uint256 preRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\n totalShares -= _sharesAmount;\n\n shares[_account] = accountShares - _sharesAmount;\n\n uint256 postRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\n emit SharesBurnt(\n _account,\n preRebaseTokenAmount,\n postRebaseTokenAmount,\n _sharesAmount\n );\n\n ...\n}", "primary_code_language": "unknown", "primary_code_char_count": 733, "all_code_blocks": "// Code block 1 (unknown):\nfunction _burnShares(\n address _account,\n uint256 _sharesAmount\n ) internal whenNotPaused returns (uint256) {\n require(_account != address(0), \"BURN_FROM_THE_ZERO_ADDRESS\");\n\n _beforeTokenTransfer(_account, address(0), _sharesAmount);\n\n uint256 accountShares = shares[_account];\n require(_sharesAmount <= accountShares, \"BURN_AMOUNT_EXCEEDS_BALANCE\");\n\n uint256 preRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\n totalShares -= _sharesAmount;\n\n shares[_account] = accountShares - _sharesAmount;\n\n uint256 postRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\n emit SharesBurnt(\n _account,\n preRebaseTokenAmount,\n postRebaseTokenAmount,\n _sharesAmount\n );\n\n ...\n}\n\n// Code block 2 (unknown):\nfunction getRUSDYByShares(uint256 _shares) public view returns (uint256) {\n return (_shares * oracle.getPrice()) / (1e18 * BPS_DENOMINATOR);\n}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function _burnShares(\n address _account,\n uint256 _sharesAmount\n ) internal whenNotPaused returns (uint256) {\n require(_account != address(0), \"BURN_FROM_THE_ZERO_ADDRESS\");\n\n _beforeTokenTransfer(_account, address(0), _sharesAmount);\n\n uint256 accountShares = shares[_account];\n require(_sharesAmount <= accountShares, \"BURN_AMOUNT_EXCEEDS_BALANCE\");\n\n uint256 preRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\n totalShares -= _sharesAmount;\n\n shares[_account] = accountShares - _sharesAmount;\n\n uint256 postRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\n emit SharesBurnt(\n _account,\n preRebaseTokenAmount,\n postRebaseTokenAmount,\n _sharesAmount\n );\n\n ...\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function getRUSDYByShares(uint256 _shares) public view returns (uint256) {\n return (_shares * oracle.getPrice()) / (1e18 * BPS_DENOMINATOR);\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ethos", "title": "Bjorn_bug Q", "severity_raw": "Critical", "severity": "critical", "description": "## [L-01] In case of an emergency exit a compromised KEEPER can liquidate all positions\nAccording to the Natspec at `ReaperBaseStrategyv4.sol`, it does not mention that the `KEEPER` role is a multi-signature role. Therefore, in case of an emergency exit being activated, a compromised `KEEPER` could call the `harvest()` and `liquidateAllPositions()` back to the vault, even if it is not the desired action by the protocol team.\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/abstract/ReaperBaseStrategyv4.sol#L105-L138\n## Recommended Mitigation Steps\nLimit access to non-multi-sign wallets Roles for calling sensitive functions in the protocol to mitigate the impact of a compromised actor\n\n## [L-02] `SafeMath` library is used but not imported in `LiquityBase.sol`\nThe contract `LiquityBase` uses `SafeMath` library for units without importing it, and it uses the `0.6.11` compiler version. which makes the contract and others contracts that will interact with it(e.g,`BorrowerOperations.sol`) vulnerable to underflow and overflow attacks.\nhttps://github.com/OpenZeppelin/openzeppelin-conSafeMath library not imported in LiquityBase contracttracts/blob/master/contracts/utils/math/SafeMath.sol\n## Recommended Mitigation Steps\nImport and use the latest version of the SafeMath library from OpenZeppelin and update the compiler version to ^0.8.16.\n\n## [L-03] Use OpenZeppelin `ECDA` for `erecover`\nThe `LUSDToken.sol` contract's permit function uses the `ecrecover` to verify signatures. I would recommend using the `ECDSA` from OpenZeppelin as it does more validations when verifying the signature.\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L287\n## Recommended Mitigation Steps\n```\nimport {ECDSA} from \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\n//...\n//Before\naddress recoveredAddress = ecrecover(digest, v, r, s);\n// After\naddress recoveredAddress = ECDSA.recover(digest, v, r, s);\n...//\n```\n\n## [N-01] Use a ", "vulnerable_code": "import {ECDSA} from \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\n//...\n//Before\naddress recoveredAddress = ecrecover(digest, v, r, s);\n// After\naddress recoveredAddress = ECDSA.recover(digest, v, r, s);\n...//", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/Bjorn_bug-Q.md", "collected_at": "2026-01-02T18:15:59.029755+00:00", "source_hash": "15bf77267dbf5c558ef106affbd3082f9e3cd51fbeca5315fedef09231cdc67a", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 219, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "import {ECDSA} from \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\n//...\n//Before\naddress recoveredAddress = ecrecover(digest, v, r, s);\n// After\naddress recoveredAddress = ECDSA.recover(digest, v, r, s);\n...//", "primary_code_language": "unknown", "primary_code_char_count": 219, "all_code_blocks": "// Code block 1 (unknown):\nimport {ECDSA} from \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\n//...\n//Before\naddress recoveredAddress = ecrecover(digest, v, r, s);\n// After\naddress recoveredAddress = ECDSA.recover(digest, v, r, s);\n...//", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ReaperBaseStrategyv4.sol#L105-L138, SafeMath.sol, LUSDToken.sol#L287", "github_files_list": "SafeMath.sol, ReaperBaseStrategyv4.sol, LUSDToken.sol", "github_refs_count": 3, "vulnerable_code_actual": "import {ECDSA} from \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\n//...\n//Before\naddress recoveredAddress = ecrecover(digest, v, r, s);\n// After\naddress recoveredAddress = ECDSA.recover(digest, v, r, s);\n...//", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "09-ondo", "title": "Walter Q", "severity_raw": "Unknown", "severity": "unknown", "description": "## DynamicOracle\nExpected prices on test(rwaDynamicOracle) are different from real prices of usdy over time,in fact,the first 2 months are good expect from October on that are all wrongly expected in the array,resulting in all usdy real prices of October:\nExpected(wrongly set):\n```\n 1.00823938 * 1e18, \n 1.00842629 * 1e18, \n 1.00861323 * 1e18, \n 1.00880021 * 1e18, \n 1.00898722 * 1e18, \n 1.00917427 * 1e18, \n 1.00936135 * 1e18, \n 1.00954846 * 1e18, \n 1.00973561 * 1e18, \n 1.00992280 * 1e18, \n 1.01011002 * 1e18, \n 1.01029727 * 1e18, \n 1.01048456 * 1e18, \n 1.01067188 * 1e18, \n 1.01085924 * 1e18, \n 1.01104664 * 1e18, \n 1.01123406 * 1e18, \n 1.01142153 * 1e18, \n 1.01160902 * 1e18, \n 1.01179655 * 1e18, \n 1.01198412 * 1e18, \n 1.01217172 * 1e18, \n 1.01235936 * 1e18, \n 1.01254703 * 1e18, \n 1.01273474 * 1e18, \n 1.01292248 * 1e18, \n 1.01311025 * 1e18, \n 1.01329806 * 1e18, \n 1.01348591 * 1e18, \n 1.01367379 * 1e18, \n 1.01386170 * 1e18\n```\nVs the effective real price,gain using the already available test,by customizing a function that will continue printing every real prices without comparing to the ones quoted above\n```\nThe derived price is: 1008187270000000000\n The derived price is: 1008322040000000000\n The derived price is: 1008456840000000000\n The derived price is: 1008591650000000000\n The derived price is: 1008726470000000000\n The derived price is: 1008861320000000000\n The derived price is: 1008996190000000000\n The derived price is: 1009131070000000000\n The derived price is: 1009265970000000000\n The derived price is: 1009400890000000000\n The derived price is: 1009535820000000000\n The derived price is: 1009670780000000000\n The derived price is: 1009805750000000000\n The derived price is: 1009940740000000000\n The derived price is: 1010075750000000000\n The derived price is: 1010210780000000000\n The derived price is: 1010345820000", "vulnerable_code": " 1.00823938 * 1e18, \n 1.00842629 * 1e18, \n 1.00861323 * 1e18, \n 1.00880021 * 1e18, \n 1.00898722 * 1e18, \n 1.00917427 * 1e18, \n 1.00936135 * 1e18, \n 1.00954846 * 1e18, \n 1.00973561 * 1e18, \n 1.00992280 * 1e18, \n 1.01011002 * 1e18, \n 1.01029727 * 1e18, \n 1.01048456 * 1e18, \n 1.01067188 * 1e18, \n 1.01085924 * 1e18, \n 1.01104664 * 1e18, \n 1.01123406 * 1e18, \n 1.01142153 * 1e18, \n 1.01160902 * 1e18, \n 1.01179655 * 1e18, \n 1.01198412 * 1e18, \n 1.01217172 * 1e18, \n 1.01235936 * 1e18, \n 1.01254703 * 1e18, \n 1.01273474 * 1e18, \n 1.01292248 * 1e18, \n 1.01311025 * 1e18, \n 1.01329806 * 1e18, \n 1.01348591 * 1e18, \n 1.01367379 * 1e18, \n 1.01386170 * 1e18", "fixed_code": "The derived price is: 1008187270000000000\n The derived price is: 1008322040000000000\n The derived price is: 1008456840000000000\n The derived price is: 1008591650000000000\n The derived price is: 1008726470000000000\n The derived price is: 1008861320000000000\n The derived price is: 1008996190000000000\n The derived price is: 1009131070000000000\n The derived price is: 1009265970000000000\n The derived price is: 1009400890000000000\n The derived price is: 1009535820000000000\n The derived price is: 1009670780000000000\n The derived price is: 1009805750000000000\n The derived price is: 1009940740000000000\n The derived price is: 1010075750000000000\n The derived price is: 1010210780000000000\n The derived price is: 1010345820000000000\n The derived price is: 1010480890000000000\n The derived price is: 1010615970000000000\n The derived price is: 1010751070000000000\n The derived price is: 1010886180000000000\n The derived price is: 1011021320000000000\n The derived price is: 1011156470000000000\n The derived price is: 1011291640000000000\n The derived price is: 1011426830000000000\n The derived price is: 1011562040000000000\n The derived price is: 1011697270000000000\n The derived price is: 1011832510000000000\n The derived price is: 1011967770000000000\n The derived price is: 1012103050000000000\n The derived price is: 1012238350000000000\n The derived price is: 1012373670000000000", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/Walter-Q.md", "collected_at": "2026-01-02T18:25:45.304115+00:00", "source_hash": "15d474aa98640cde4746f22846057f79de76972be2eea62f0c83000eaaafd3d2", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 767, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "1.00823938 * 1e18, \n 1.00842629 * 1e18, \n 1.00861323 * 1e18, \n 1.00880021 * 1e18, \n 1.00898722 * 1e18, \n 1.00917427 * 1e18, \n 1.00936135 * 1e18, \n 1.00954846 * 1e18, \n 1.00973561 * 1e18, \n 1.00992280 * 1e18, \n 1.01011002 * 1e18, \n 1.01029727 * 1e18, \n 1.01048456 * 1e18, \n 1.01067188 * 1e18, \n 1.01085924 * 1e18, \n 1.01104664 * 1e18, \n 1.01123406 * 1e18, \n 1.01142153 * 1e18, \n 1.01160902 * 1e18, \n 1.01179655 * 1e18, \n 1.01198412 * 1e18, \n 1.01217172 * 1e18, \n 1.01235936 * 1e18, \n 1.01254703 * 1e18, \n 1.01273474 * 1e18, \n 1.01292248 * 1e18, \n 1.01311025 * 1e18, \n 1.01329806 * 1e18, \n 1.01348591 * 1e18, \n 1.01367379 * 1e18, \n 1.01386170 * 1e18", "primary_code_language": "unknown", "primary_code_char_count": 767, "all_code_blocks": "// Code block 1 (unknown):\n1.00823938 * 1e18, \n 1.00842629 * 1e18, \n 1.00861323 * 1e18, \n 1.00880021 * 1e18, \n 1.00898722 * 1e18, \n 1.00917427 * 1e18, \n 1.00936135 * 1e18, \n 1.00954846 * 1e18, \n 1.00973561 * 1e18, \n 1.00992280 * 1e18, \n 1.01011002 * 1e18, \n 1.01029727 * 1e18, \n 1.01048456 * 1e18, \n 1.01067188 * 1e18, \n 1.01085924 * 1e18, \n 1.01104664 * 1e18, \n 1.01123406 * 1e18, \n 1.01142153 * 1e18, \n 1.01160902 * 1e18, \n 1.01179655 * 1e18, \n 1.01198412 * 1e18, \n 1.01217172 * 1e18, \n 1.01235936 * 1e18, \n 1.01254703 * 1e18, \n 1.01273474 * 1e18, \n 1.01292248 * 1e18, \n 1.01311025 * 1e18, \n 1.01329806 * 1e18, \n 1.01348591 * 1e18, \n 1.01367379 * 1e18, \n 1.01386170 * 1e18", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " 1.00823938 * 1e18, \n 1.00842629 * 1e18, \n 1.00861323 * 1e18, \n 1.00880021 * 1e18, \n 1.00898722 * 1e18, \n 1.00917427 * 1e18, \n 1.00936135 * 1e18, \n 1.00954846 * 1e18, \n 1.00973561 * 1e18, \n 1.00992280 * 1e18, \n 1.01011002 * 1e18, \n 1.01029727 * 1e18, \n 1.01048456 * 1e18, \n 1.01067188 * 1e18, \n 1.01085924 * 1e18, \n 1.01104664 * 1e18, \n 1.01123406 * 1e18, \n 1.01142153 * 1e18, \n 1.01160902 * 1e18, \n 1.01179655 * 1e18, \n 1.01198412 * 1e18, \n 1.01217172 * 1e18, \n 1.01235936 * 1e18, \n 1.01254703 * 1e18, \n 1.01273474 * 1e18, \n 1.01292248 * 1e18, \n 1.01311025 * 1e18, \n 1.01329806 * 1e18, \n 1.01348591 * 1e18, \n 1.01367379 * 1e18, \n 1.01386170 * 1e18", "has_vulnerable_code_snippet": true, "fixed_code_actual": "The derived price is: 1008187270000000000\n The derived price is: 1008322040000000000\n The derived price is: 1008456840000000000\n The derived price is: 1008591650000000000\n The derived price is: 1008726470000000000\n The derived price is: 1008861320000000000\n The derived price is: 1008996190000000000\n The derived price is: 1009131070000000000\n The derived price is: 1009265970000000000\n The derived price is: 1009400890000000000\n The derived price is: 1009535820000000000\n The derived price is: 1009670780000000000\n The derived price is: 1009805750000000000\n The derived price is: 1009940740000000000\n The derived price is: 1010075750000000000\n The derived price is: 1010210780000000000\n The derived price is: 1010345820000000000\n The derived price is: 1010480890000000000\n The derived price is: 1010615970000000000\n The derived price is: 1010751070000000000\n The derived price is: 1010886180000000000\n The derived price is: 1011021320000000000\n The derived price is: 1011156470000000000\n The derived price is: 1011291640000000000\n The derived price is: 1011426830000000000\n The derived price is: 1011562040000000000\n The derived price is: 1011697270000000000\n The derived price is: 1011832510000000000\n The derived price is: 1011967770000000000\n The derived price is: 1012103050000000000\n The derived price is: 1012238350000000000\n The derived price is: 1012373670000000000", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-ondo", "title": "tsvetanovv Q", "severity_raw": "Medium", "severity": "medium", "description": "## [QA-01] Use latest Solidity version\n\nSolidity pragma versioning should be upgraded to latest available version. \n***\n\n## [QA-02] Use stable pragma statement\n\nUsing a floating pragma `^0.8.10` statement is discouraged as code can compile to different bytecodes with different compiler versions. Use a stable pragma statement to get a deterministic bytecode.\n```\nCCashDelegate.sol:\npragma solidity ^0.8.10;\n\nCTokenDelegate.sol:\npragma solidity ^0.8.10;\n\nJumpRateModelV2.sol:\npragma solidity ^0.5.16;\n\nCCash.sol:\npragma solidity ^0.8.10;\n\nCErc20.sol:\npragma solidity ^0.8.10;\n\nCTokenInterfacesModifiedCash.sol:\npragma solidity ^0.8.10;\n\nCTokenInterfacesModified.sol:\npragma solidity ^0.8.10;\n\ncErc20ModifiedDelegator.sol:\npragma solidity ^0.5.12;\n\nCTokenCash.sol:\npragma solidity ^0.8.10;\n\nCTokenModified.sol::\npragma solidity ^0.8.10;\n```\n***\n\n## [QA-03] Different pragma directives are used\n\nUse one Solidity version on each contract.\n***\n\n## [QA-04] USE NAMED IMPORTS INSTEAD OF PLAIN `IMPORT \u2018FILE.SOL\u2019\n```\nProxy.sol:\n18: import \"contracts/cash/external/openzeppelin/contracts/proxy/TransparentUpgradeableProxy.sol\";\n\nCash.sol:\n18: import \"contracts/cash/external/openzeppelin/contracts-upgradeable/token/ERC20/ERC20PresetMinterPauserUpgradeable.sol\";\n\nCCashDelegate.sol:\n4: import \"./CCash.sol\";\n\nCTokenDelegate.sol:\n4: import \"./CErc20.sol\";\n\nCashKYCSender.sol:\n18: import \"contracts/cash/external/openzeppelin/contracts-upgradeable/token/ERC20/ERC20PresetMinterPauserUpgradeable.sol\";\n19: import \"contracts/cash/kyc/KYCRegistryClientInitializable.sol\";\n\nOndoPriceOracle.sol:\n17: import \"./IOndoPriceOracle.sol\";\n18: import \"contracts/lending/compound/Ownable.sol\";\n\nCashKYCSenderReceiver.sol:\n18: import \"contracts/cash/external/openzeppelin/contracts-upgradeable/token/ERC20/ERC20PresetMinterPauserUpgradeable.sol\";\n19: import \"contracts/cash/kyc/KYCRegistryClientInitializable.sol\";\n\nCashFactory.sol:\n19: import \"contracts/cash/external/openzeppelin/contracts/proxy/ProxyAdmin.sol\";\n20: impo", "vulnerable_code": "CCashDelegate.sol:\npragma solidity ^0.8.10;\n\nCTokenDelegate.sol:\npragma solidity ^0.8.10;\n\nJumpRateModelV2.sol:\npragma solidity ^0.5.16;\n\nCCash.sol:\npragma solidity ^0.8.10;\n\nCErc20.sol:\npragma solidity ^0.8.10;\n\nCTokenInterfacesModifiedCash.sol:\npragma solidity ^0.8.10;\n\nCTokenInterfacesModified.sol:\npragma solidity ^0.8.10;\n\ncErc20ModifiedDelegator.sol:\npragma solidity ^0.5.12;\n\nCTokenCash.sol:\npragma solidity ^0.8.10;\n\nCTokenModified.sol::\npragma solidity ^0.8.10;", "fixed_code": "Proxy.sol:\n18: import \"contracts/cash/external/openzeppelin/contracts/proxy/TransparentUpgradeableProxy.sol\";\n\nCash.sol:\n18: import \"contracts/cash/external/openzeppelin/contracts-upgradeable/token/ERC20/ERC20PresetMinterPauserUpgradeable.sol\";\n\nCCashDelegate.sol:\n4: import \"./CCash.sol\";\n\nCTokenDelegate.sol:\n4: import \"./CErc20.sol\";\n\nCashKYCSender.sol:\n18: import \"contracts/cash/external/openzeppelin/contracts-upgradeable/token/ERC20/ERC20PresetMinterPauserUpgradeable.sol\";\n19: import \"contracts/cash/kyc/KYCRegistryClientInitializable.sol\";\n\nOndoPriceOracle.sol:\n17: import \"./IOndoPriceOracle.sol\";\n18: import \"contracts/lending/compound/Ownable.sol\";\n\nCashKYCSenderReceiver.sol:\n18: import \"contracts/cash/external/openzeppelin/contracts-upgradeable/token/ERC20/ERC20PresetMinterPauserUpgradeable.sol\";\n19: import \"contracts/cash/kyc/KYCRegistryClientInitializable.sol\";\n\nCashFactory.sol:\n19: import \"contracts/cash/external/openzeppelin/contracts/proxy/ProxyAdmin.sol\";\n20: import \"contracts/cash/Proxy.sol\";\n21: import \"contracts/cash/token/Cash.sol\";\n22: import \"contracts/cash/interfaces/IMulticall.sol\";\n\nCashKYCSenderFactory.sol:\n19: import \"contracts/cash/external/openzeppelin/contracts/proxy/ProxyAdmin.sol\";\n20: import \"contracts/cash/Proxy.sol\";\n21: import \"contracts/cash/token/CashKYCSender.sol\";\n22: import \"contracts/cash/interfaces/IMulticall.sol\";\n\nCashKYCSenderReceiverFactory.sol:\n19: import \"contracts/cash/external/openzeppelin/contracts/proxy/ProxyAdmin.sol\";\n20: import \"contracts/cash/Proxy.sol\";\n21: import \"contracts/cash/token/CashKYCSenderReceiver.sol\";\n22: import \"contracts/cash/interfaces/IMulticall.sol\";\n\nJumpRateModelV2.sol:\n3: import \"./compound/InterestRateModel.sol\";\n4: import \"./compound/SafeMath.sol\";\n\nKYCRegistry.sol:\n18: import \"contracts/cash/interfaces/IKYCRegistry.sol\";\n19: import \"contracts/cash/external/openzeppelin/contracts/access/AccessControlEnumerable.sol\";\n20: import \"contracts/cash/external/chainalysis/ISanctionsList.sol\";\n21: impo", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/tsvetanovv-Q.md", "collected_at": "2026-01-02T18:15:37.628701+00:00", "source_hash": "15d6d44718d6146be0b1e0a34a3003fd4f196d5350a4e002956528c8d92a2a70", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 471, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "CCashDelegate.sol:\npragma solidity ^0.8.10;\n\nCTokenDelegate.sol:\npragma solidity ^0.8.10;\n\nJumpRateModelV2.sol:\npragma solidity ^0.5.16;\n\nCCash.sol:\npragma solidity ^0.8.10;\n\nCErc20.sol:\npragma solidity ^0.8.10;\n\nCTokenInterfacesModifiedCash.sol:\npragma solidity ^0.8.10;\n\nCTokenInterfacesModified.sol:\npragma solidity ^0.8.10;\n\ncErc20ModifiedDelegator.sol:\npragma solidity ^0.5.12;\n\nCTokenCash.sol:\npragma solidity ^0.8.10;\n\nCTokenModified.sol::\npragma solidity ^0.8.10;", "primary_code_language": "unknown", "primary_code_char_count": 471, "all_code_blocks": "// Code block 1 (unknown):\nCCashDelegate.sol:\npragma solidity ^0.8.10;\n\nCTokenDelegate.sol:\npragma solidity ^0.8.10;\n\nJumpRateModelV2.sol:\npragma solidity ^0.5.16;\n\nCCash.sol:\npragma solidity ^0.8.10;\n\nCErc20.sol:\npragma solidity ^0.8.10;\n\nCTokenInterfacesModifiedCash.sol:\npragma solidity ^0.8.10;\n\nCTokenInterfacesModified.sol:\npragma solidity ^0.8.10;\n\ncErc20ModifiedDelegator.sol:\npragma solidity ^0.5.12;\n\nCTokenCash.sol:\npragma solidity ^0.8.10;\n\nCTokenModified.sol::\npragma solidity ^0.8.10;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "CCashDelegate.sol:\npragma solidity ^0.8.10;\n\nCTokenDelegate.sol:\npragma solidity ^0.8.10;\n\nJumpRateModelV2.sol:\npragma solidity ^0.5.16;\n\nCCash.sol:\npragma solidity ^0.8.10;\n\nCErc20.sol:\npragma solidity ^0.8.10;\n\nCTokenInterfacesModifiedCash.sol:\npragma solidity ^0.8.10;\n\nCTokenInterfacesModified.sol:\npragma solidity ^0.8.10;\n\ncErc20ModifiedDelegator.sol:\npragma solidity ^0.5.12;\n\nCTokenCash.sol:\npragma solidity ^0.8.10;\n\nCTokenModified.sol::\npragma solidity ^0.8.10;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "Proxy.sol:\n18: import \"contracts/cash/external/openzeppelin/contracts/proxy/TransparentUpgradeableProxy.sol\";\n\nCash.sol:\n18: import \"contracts/cash/external/openzeppelin/contracts-upgradeable/token/ERC20/ERC20PresetMinterPauserUpgradeable.sol\";\n\nCCashDelegate.sol:\n4: import \"./CCash.sol\";\n\nCTokenDelegate.sol:\n4: import \"./CErc20.sol\";\n\nCashKYCSender.sol:\n18: import \"contracts/cash/external/openzeppelin/contracts-upgradeable/token/ERC20/ERC20PresetMinterPauserUpgradeable.sol\";\n19: import \"contracts/cash/kyc/KYCRegistryClientInitializable.sol\";\n\nOndoPriceOracle.sol:\n17: import \"./IOndoPriceOracle.sol\";\n18: import \"contracts/lending/compound/Ownable.sol\";\n\nCashKYCSenderReceiver.sol:\n18: import \"contracts/cash/external/openzeppelin/contracts-upgradeable/token/ERC20/ERC20PresetMinterPauserUpgradeable.sol\";\n19: import \"contracts/cash/kyc/KYCRegistryClientInitializable.sol\";\n\nCashFactory.sol:\n19: import \"contracts/cash/external/openzeppelin/contracts/proxy/ProxyAdmin.sol\";\n20: import \"contracts/cash/Proxy.sol\";\n21: import \"contracts/cash/token/Cash.sol\";\n22: import \"contracts/cash/interfaces/IMulticall.sol\";\n\nCashKYCSenderFactory.sol:\n19: import \"contracts/cash/external/openzeppelin/contracts/proxy/ProxyAdmin.sol\";\n20: import \"contracts/cash/Proxy.sol\";\n21: import \"contracts/cash/token/CashKYCSender.sol\";\n22: import \"contracts/cash/interfaces/IMulticall.sol\";\n\nCashKYCSenderReceiverFactory.sol:\n19: import \"contracts/cash/external/openzeppelin/contracts/proxy/ProxyAdmin.sol\";\n20: import \"contracts/cash/Proxy.sol\";\n21: import \"contracts/cash/token/CashKYCSenderReceiver.sol\";\n22: import \"contracts/cash/interfaces/IMulticall.sol\";\n\nJumpRateModelV2.sol:\n3: import \"./compound/InterestRateModel.sol\";\n4: import \"./compound/SafeMath.sol\";\n\nKYCRegistry.sol:\n18: import \"contracts/cash/interfaces/IKYCRegistry.sol\";\n19: import \"contracts/cash/external/openzeppelin/contracts/access/AccessControlEnumerable.sol\";\n20: import \"contracts/cash/external/chainalysis/ISanctionsList.sol\";\n21: impo", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "03-asymmetry", "title": "climber2002 G", "severity_raw": "Gas", "severity": "gas", "description": "# Cache derivativeCount in a local variable when looping\n`derivativeCount` is a storage variable. When looping it's more gas efficient to cache it in a local variable.\n\nChange\n```solidity\nfor (uint256 i = 0; i < derivativeCount; i++)\n```\n\nto\n```solidity\nuint256 localDerivativeCount = derivativeCount;\nfor (uint256 i = 0; i < localDerivativeCount; i++)\n```\n\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L71\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L84\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L113\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L140\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L147\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L171\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L191\n", "vulnerable_code": "for (uint256 i = 0; i < derivativeCount; i++)", "fixed_code": "uint256 localDerivativeCount = derivativeCount;\nfor (uint256 i = 0; i < localDerivativeCount; i++)", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/climber2002-G.md", "collected_at": "2026-01-02T18:18:59.822545+00:00", "source_hash": "15d9131e4c67fe562dcf2e53b1d95293de8aabe474346622afc7d61bd493c3fd", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 143, "github_ref_count": 7, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "for (uint256 i = 0; i < derivativeCount; i++)", "primary_code_language": "solidity", "primary_code_char_count": 45, "all_code_blocks": "// Code block 1 (solidity):\nfor (uint256 i = 0; i < derivativeCount; i++)\n\n// Code block 2 (solidity):\nuint256 localDerivativeCount = derivativeCount;\nfor (uint256 i = 0; i < localDerivativeCount; i++)", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "for (uint256 i = 0; i < derivativeCount; i++)\n\nuint256 localDerivativeCount = derivativeCount;\nfor (uint256 i = 0; i < localDerivativeCount; i++)", "github_refs_formatted": "SafEth.sol#L71, SafEth.sol#L84, SafEth.sol#L113, SafEth.sol#L140, SafEth.sol#L147, SafEth.sol#L171, SafEth.sol#L191", "github_files_list": "SafEth.sol", "github_refs_count": 7, "vulnerable_code_actual": "for (uint256 i = 0; i < derivativeCount; i++)", "has_vulnerable_code_snippet": true, "fixed_code_actual": "uint256 localDerivativeCount = derivativeCount;\nfor (uint256 i = 0; i < localDerivativeCount; i++)", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7.49} {"source": "c4", "protocol": "08-dopex", "title": "Krace Q", "severity_raw": "Low", "severity": "low", "description": "## [Low] PerpetualAtlanticVaultLP.constructor should use && to check the address\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/perp-vault/PerpetualAtlanticVaultLP.sol#L81\n`require(_perpetualAtlanticVault != address(0) || _rdpx != address(0),\"ZERO_ADDRESS\");` means one of `_perpetualAtlanticVault` and `_rdpx` could be zero address, I think `&&` should be used here.\n\n```\n constructor(\n address _perpetualAtlanticVault,\n address _rdpxRdpxV2Core,\n address _collateral,\n address _rdpx,\n string memory _collateralSymbol\n )\n ERC20(\n \"PerpetualAtlanticVault LP Token\",\n _collateralSymbol,\n ERC20(_collateral).decimals()\n )\n {\n require(\n _perpetualAtlanticVault != address(0) || _rdpx != address(0),\n \"ZERO_ADDRESS\"\n );\n perpetualAtlanticVault = IPerpetualAtlanticVault(_perpetualAtlanticVault);\n rdpxRdpxV2Core = _rdpxRdpxV2Core;\n collateralSymbol = _collateralSymbol;\n rdpx = _rdpx;\n collateral = ERC20(_collateral);\n\n symbol = string.concat(_collateralSymbol, \"-LP\");\n\n collateral.approve(_perpetualAtlanticVault, type(uint256).max);\n ERC20(rdpx).approve(_perpetualAtlanticVault, type(uint256).max);\n }\n```\n\n\n## [Low] Address in UniV3LiquidityAmo should be immutable\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/amo/UniV3LiquidityAmo.sol#L82-L88\nThe address of `univ3_factory`, `univ3_positions` and `univ3_router` are set in Constructor, and is not changeable, maybe you should set them to `immutable` or add a function to let admin change them.\n\n\n\n\n## [Low] Implementation of `numPositions` may not be as expected\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/amo/UniV3LiquidityAmo.sol#L111\nThe comment of `UniV3LiquidityAmo.numPositions` said that it `Only counts non-withdrawn positions`, but it just returns the length of `positions_array` directly. It s", "vulnerable_code": " constructor(\n address _perpetualAtlanticVault,\n address _rdpxRdpxV2Core,\n address _collateral,\n address _rdpx,\n string memory _collateralSymbol\n )\n ERC20(\n \"PerpetualAtlanticVault LP Token\",\n _collateralSymbol,\n ERC20(_collateral).decimals()\n )\n {\n require(\n _perpetualAtlanticVault != address(0) || _rdpx != address(0),\n \"ZERO_ADDRESS\"\n );\n perpetualAtlanticVault = IPerpetualAtlanticVault(_perpetualAtlanticVault);\n rdpxRdpxV2Core = _rdpxRdpxV2Core;\n collateralSymbol = _collateralSymbol;\n rdpx = _rdpx;\n collateral = ERC20(_collateral);\n\n symbol = string.concat(_collateralSymbol, \"-LP\");\n\n collateral.approve(_perpetualAtlanticVault, type(uint256).max);\n ERC20(rdpx).approve(_perpetualAtlanticVault, type(uint256).max);\n }", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/Krace-Q.md", "collected_at": "2026-01-02T18:24:48.394715+00:00", "source_hash": "15f6ba10f9620454c4608e4de24b4352404eb2b0dc768c44c417277fb8f441b9", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 805, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "constructor(\n address _perpetualAtlanticVault,\n address _rdpxRdpxV2Core,\n address _collateral,\n address _rdpx,\n string memory _collateralSymbol\n )\n ERC20(\n \"PerpetualAtlanticVault LP Token\",\n _collateralSymbol,\n ERC20(_collateral).decimals()\n )\n {\n require(\n _perpetualAtlanticVault != address(0) || _rdpx != address(0),\n \"ZERO_ADDRESS\"\n );\n perpetualAtlanticVault = IPerpetualAtlanticVault(_perpetualAtlanticVault);\n rdpxRdpxV2Core = _rdpxRdpxV2Core;\n collateralSymbol = _collateralSymbol;\n rdpx = _rdpx;\n collateral = ERC20(_collateral);\n\n symbol = string.concat(_collateralSymbol, \"-LP\");\n\n collateral.approve(_perpetualAtlanticVault, type(uint256).max);\n ERC20(rdpx).approve(_perpetualAtlanticVault, type(uint256).max);\n }", "primary_code_language": "unknown", "primary_code_char_count": 805, "all_code_blocks": "// Code block 1 (unknown):\nconstructor(\n address _perpetualAtlanticVault,\n address _rdpxRdpxV2Core,\n address _collateral,\n address _rdpx,\n string memory _collateralSymbol\n )\n ERC20(\n \"PerpetualAtlanticVault LP Token\",\n _collateralSymbol,\n ERC20(_collateral).decimals()\n )\n {\n require(\n _perpetualAtlanticVault != address(0) || _rdpx != address(0),\n \"ZERO_ADDRESS\"\n );\n perpetualAtlanticVault = IPerpetualAtlanticVault(_perpetualAtlanticVault);\n rdpxRdpxV2Core = _rdpxRdpxV2Core;\n collateralSymbol = _collateralSymbol;\n rdpx = _rdpx;\n collateral = ERC20(_collateral);\n\n symbol = string.concat(_collateralSymbol, \"-LP\");\n\n collateral.approve(_perpetualAtlanticVault, type(uint256).max);\n ERC20(rdpx).approve(_perpetualAtlanticVault, type(uint256).max);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "PerpetualAtlanticVaultLP.sol#L81, UniV3LiquidityAmo.sol#L82-L88, UniV3LiquidityAmo.sol#L111", "github_files_list": "UniV3LiquidityAmo.sol, PerpetualAtlanticVaultLP.sol", "github_refs_count": 3, "vulnerable_code_actual": " constructor(\n address _perpetualAtlanticVault,\n address _rdpxRdpxV2Core,\n address _collateral,\n address _rdpx,\n string memory _collateralSymbol\n )\n ERC20(\n \"PerpetualAtlanticVault LP Token\",\n _collateralSymbol,\n ERC20(_collateral).decimals()\n )\n {\n require(\n _perpetualAtlanticVault != address(0) || _rdpx != address(0),\n \"ZERO_ADDRESS\"\n );\n perpetualAtlanticVault = IPerpetualAtlanticVault(_perpetualAtlanticVault);\n rdpxRdpxV2Core = _rdpxRdpxV2Core;\n collateralSymbol = _collateralSymbol;\n rdpx = _rdpx;\n collateral = ERC20(_collateral);\n\n symbol = string.concat(_collateralSymbol, \"-LP\");\n\n collateral.approve(_perpetualAtlanticVault, type(uint256).max);\n ERC20(rdpx).approve(_perpetualAtlanticVault, type(uint256).max);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "04-caviar", "title": "Polaris_tow Q", "severity_raw": "Low", "severity": "low", "description": "## possible address conflict\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/Factory.sol#L92\n```\n privatePool = PrivatePool(payable(privatePoolImplementation.cloneDeterministic(_salt)));\n```\n\n\nThis contract uses the cloneDeterministic() function from the LibClone library to create a cloned copy of the minimal proxy contract, which computes a deterministic address. However, there may be potential risks and issues if the computed address is already occupied by someone else.\n## Code readability\nThis smart contract uses multiple nested conditional statements and loops, making the code complex and hard to understand. This could lead to errors by developers while writing or modifying the code, thus increasing the risk of vulnerabilities.\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol\n\n## Token recovery not implemented\nThe contract does not have a token recovery mechanism in place. If users accidentally send tokens to the contract address, these tokens will be permanently lost and cannot be retrieved from the contract.\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol\n\n## Unconsidered reentrancy attack\nIf a reentrant attack occurs before the receiver.onFlashLoan() function is executed in the flashLoan function, it may result in multiple calls to the onFlashLoan() function and potential fund loss. It is recommended to use OpenZeppelin's ReentrancyGuard or similar protection measures to prevent such attacks.\n In the _getRoyalty function, if the lookupAddress returned by the royaltyRegistry smart contract does not implement the ERC-2981 interface, it will result in uninitialized recipient and royaltyFee variables being returned by the function. This may allow malicious attackers to call this function through reentrancy attacks or other means and potentially lead to fund loss or other vulnerabilities. It is recommended to add an extra check to ensure that the lookupAddre", "vulnerable_code": " privatePool = PrivatePool(payable(privatePoolImplementation.cloneDeterministic(_salt)));", "fixed_code": "", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/Polaris_tow-Q.md", "collected_at": "2026-01-02T18:19:58.225275+00:00", "source_hash": "162c7307dcf8936cd5394de16ff6667ac4807503e3734e5290854f0e6636ea23", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 88, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "privatePool = PrivatePool(payable(privatePoolImplementation.cloneDeterministic(_salt)));", "primary_code_language": "unknown", "primary_code_char_count": 88, "all_code_blocks": "// Code block 1 (unknown):\nprivatePool = PrivatePool(payable(privatePoolImplementation.cloneDeterministic(_salt)));", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Factory.sol#L92, PrivatePool.sol", "github_files_list": "PrivatePool.sol, Factory.sol", "github_refs_count": 2, "vulnerable_code_actual": " privatePool = PrivatePool(payable(privatePoolImplementation.cloneDeterministic(_salt)));", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "10-badger", "title": "sivanesh_808 G", "severity_raw": "Low", "severity": "low", "description": "### G-01: Rearrange the Struct to save slot \n\n#### Description:\nRearranging the structure of the `MoveTokensParams` struct can lead to significant gas savings in smart contracts. Each slot saved in the struct can potentially avoid an extra SSTORE operation, which costs around 20,000 gas for the first setting of the struct.\n\n\n#### File:\n[BorrowerOperations.sol](https://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/BorrowerOperations.sol)\n\n#### Code Snippet:\n**Before Rearrangement:**\n```solidity\nstruct MoveTokensParams {\n address user;\n uint256 collSharesChange;\n uint256 collAddUnderlying; // ONLY for isCollIncrease=true\n bool isCollIncrease;\n uint256 netDebtChange;\n bool isDebtIncrease;\n}\n```\n\n**After Rearrangement:**\n```solidity\nstruct MoveTokensParams {\n uint256 collSharesChange;\n uint256 collAddUnderlying;\n uint256 netDebtChange;\n address user;\n bool isCollIncrease;\n bool isDebtIncrease;\n // potentially more bools or small fields here\n}\n```\n\n#### Gas Savings Analysis:\n- **Slot Savings**: The rearranged structure saves 2 slots.\n- **Gas Savings**: With each slot potentially saving 20,000 gas on the first setting, the total gas savings could be up to 40,000 gas.\n\n#### GitHub Link:\n[BorrowerOperations.sol](https://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/BorrowerOperations.sol)\n\n\n\n#### File:\n[IPriceFeed.sol](https://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/Interfaces/IPriceFeed.sol#L17C5-L24C6)\n\n\n\n#### Code Snippet:\n**Before Rearrangement:**\n```solidity\nstruct ChainlinkResponse {\n uint80 roundEthBtcId;\n uint80 roundStEthEthId;\n uint256 answer;\n uint256 timestampEthBtc;\n uint256 timestampStEthEth;\n bool success;\n}\n```\n\n**After Rearrangement:**\n```solidity\nstruct ChainlinkResponse {\n uint80 roundEthBtcId;\n uint80 roundStEthEthId;\n bool success;\n uint256 answer;\n uint256 timestampEthBtc;\n uint256 ti", "vulnerable_code": "struct MoveTokensParams {\n address user;\n uint256 collSharesChange;\n uint256 collAddUnderlying; // ONLY for isCollIncrease=true\n bool isCollIncrease;\n uint256 netDebtChange;\n bool isDebtIncrease;\n}", "fixed_code": "struct MoveTokensParams {\n uint256 collSharesChange;\n uint256 collAddUnderlying;\n uint256 netDebtChange;\n address user;\n bool isCollIncrease;\n bool isDebtIncrease;\n // potentially more bools or small fields here\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/sivanesh_808-G.md", "collected_at": "2026-01-02T18:27:02.232341+00:00", "source_hash": "16c7553673cd6de0171e02c84db2a792730c3f31092190e72afa3f8ab1e20c5a", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 629, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "struct MoveTokensParams {\n address user;\n uint256 collSharesChange;\n uint256 collAddUnderlying; // ONLY for isCollIncrease=true\n bool isCollIncrease;\n uint256 netDebtChange;\n bool isDebtIncrease;\n}", "primary_code_language": "solidity", "primary_code_char_count": 215, "all_code_blocks": "// Code block 1 (solidity):\nstruct MoveTokensParams {\n address user;\n uint256 collSharesChange;\n uint256 collAddUnderlying; // ONLY for isCollIncrease=true\n bool isCollIncrease;\n uint256 netDebtChange;\n bool isDebtIncrease;\n}\n\n// Code block 2 (solidity):\nstruct MoveTokensParams {\n uint256 collSharesChange;\n uint256 collAddUnderlying;\n uint256 netDebtChange;\n address user;\n bool isCollIncrease;\n bool isDebtIncrease;\n // potentially more bools or small fields here\n}\n\n// Code block 3 (solidity):\nstruct ChainlinkResponse {\n uint80 roundEthBtcId;\n uint80 roundStEthEthId;\n uint256 answer;\n uint256 timestampEthBtc;\n uint256 timestampStEthEth;\n bool success;\n}", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "struct MoveTokensParams {\n address user;\n uint256 collSharesChange;\n uint256 collAddUnderlying; // ONLY for isCollIncrease=true\n bool isCollIncrease;\n uint256 netDebtChange;\n bool isDebtIncrease;\n}\n\nstruct MoveTokensParams {\n uint256 collSharesChange;\n uint256 collAddUnderlying;\n uint256 netDebtChange;\n address user;\n bool isCollIncrease;\n bool isDebtIncrease;\n // potentially more bools or small fields here\n}\n\nstruct ChainlinkResponse {\n uint80 roundEthBtcId;\n uint80 roundStEthEthId;\n uint256 answer;\n uint256 timestampEthBtc;\n uint256 timestampStEthEth;\n bool success;\n}", "github_refs_formatted": "BorrowerOperations.sol, IPriceFeed.sol#L17-L5", "github_files_list": "BorrowerOperations.sol, IPriceFeed.sol", "github_refs_count": 2, "vulnerable_code_actual": "struct MoveTokensParams {\n address user;\n uint256 collSharesChange;\n uint256 collAddUnderlying; // ONLY for isCollIncrease=true\n bool isCollIncrease;\n uint256 netDebtChange;\n bool isDebtIncrease;\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "struct MoveTokensParams {\n uint256 collSharesChange;\n uint256 collAddUnderlying;\n uint256 netDebtChange;\n address user;\n bool isCollIncrease;\n bool isDebtIncrease;\n // potentially more bools or small fields here\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "11-kelp", "title": "Myd Analysis", "severity_raw": "Critical", "severity": "critical", "description": "**Kelp DAO**\n\nThe Kelp DAO is designed to collectively govern and grow the liquid restaking ecosystem.\n\n- The DAO treasury will receive fees and rewards from the protocol.\n\n- Kelp token holders can submit and vote on proposals to direct treasury funds.\n\n- Proposals could include adding new asset integrations, funding development, etc.\n\n- The DAO can set parameters like deposit limits and reward rates.\n\n- Smart contracts will execute proposal outcomes. \n\n**rsETH Token**\n\nThe rsETH token represents a claim on assets deposited into the protocol:\n\n- When users deposit supported assets, they receive rsETH in return.\n\n- The total rsETH supply corresponds to the value of assets deposited.\n\n- rsETH can be freely transferred or used in other DeFi protocols.\n\n- Users burn rsETH when they want to withdraw their deposited assets.\n\n- The token is minted/burned by the LRTDepositPool contract.\n\n**Benefits**\n\n- rsETH unlocks liquidity and DeFi for staked ETH and other staked assets.\n\n- Users can earn yields on assets while still earning staking rewards. \n\n- Governance by Kelp DAO token holders provides decentralized control.\n\n**Architecture**\n\nThe architecture centers around the LRTConfig as the main configuration contract that stores addresses of other core contracts like LRTDepositPool and LRTOracle. This provides flexibility to upgrade contracts over time. The admin role in LRTConfig has significant control and permissions. \n\nOther contracts inherit from base contracts like LRTConfigRoleChecker to enforce admin/manager roles. This is a simple access control scheme without decentralized governance.\n\n**Issue:** Significant centralization risks due to administrative privileges in LRTConfig\n\n**Impact:** The admin role in LRTConfig has permission to update core contract addresses, add/remove assets, update rates, and pause contracts. This provides a central point of control over critical operations.\n\n**Root cause:** \n\n[LRTConfig.sol](https://github.com/code-423n4/2023-11-kelp/blob/ma", "vulnerable_code": "// Admin can set any contract address\nfunction setContract(bytes32 key, address addr) external onlyRole(DEFAULT_ADMIN_ROLE) \n\n// Admin can add/remove assets\nfunction addAsset(address asset) external onlyRole(DEFAULT_ADMIN_ROLE)\n\n// Admin can pause any contract\nfunction pause(address contractAddr) external onlyRole(DEFAULT_ADMIN_ROLE)", "fixed_code": "function deposit(address asset, uint amount) external {\n\n // No check if asset is approved\n // Vulnerable to depositing unapproved tokens\n\n balances[asset] += amount; \n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/Myd-Analysis.md", "collected_at": "2026-01-02T18:27:33.150988+00:00", "source_hash": "170a02e0a7115b206138b9d9cf2264061fe8d08e0314678a73c05733263a9347", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "// Admin can set any contract address\nfunction setContract(bytes32 key, address addr) external onlyRole(DEFAULT_ADMIN_ROLE) \n\n// Admin can add/remove assets\nfunction addAsset(address asset) external onlyRole(DEFAULT_ADMIN_ROLE)\n\n// Admin can pause any contract\nfunction pause(address contractAddr) external onlyRole(DEFAULT_ADMIN_ROLE)", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function deposit(address asset, uint amount) external {\n\n // No check if asset is approved\n // Vulnerable to depositing unapproved tokens\n\n balances[asset] += amount; \n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "02-ethos", "title": "DeFiHackLabs Q", "severity_raw": "High", "severity": "high", "description": "# C4_ethos_QA_report\n\n## [L1] Solidity outdate version\n\n### Proof of concept\n```js\npragma solidity 0.6.11;\n```\n\nin all Ethos contract, ex:\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L3\n\n### **Recommendation:**\nUpdate solidity 0.8.18 or higher which has the fix for some vulnerabilites.\n\n## [L2] Susceptible to Signature Malleability\n\nIn Solidity ecrecover function directly to verify the given signatures. However, the ecrecover EVM opcode allows malleable (non-unique) signatures and thus is susceptible to replay attacks.\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L287\n```js\n address recoveredAddress = ecrecover(digest, v, r, s);\n require(recoveredAddress == owner, 'LUSD: invalid signature');\n```\n\n### **Recommendation:**\nUse the recover function from [OpenZeppelin's ECDSA library](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/ECDSA.sol) for signature verification.\n\n```js\nfunction permit\n (\n address owner, \n address spender, \n uint amount, \n uint deadline, \n uint8 v, \n bytes32 r, \n bytes32 s\n ) \n external \n override \n {\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n revert('LUSD: Invalid s value');\n }\n\n require(deadline >= block.timestamp, 'LUSD: expired deadline'); \n bytes32 digest = keccak256(abi.encodePacked(\n '\\x19\\x01',\n domainSeparator(),\n keccak256(abi.encode(\n _PERMIT_TYPEHASH,\n owner,\n spender,\n amount,\n nonces[owner]++,\n deadline\n ))\n ));\n \n address recoveredAddress = recover(digest, r, s);\n require(recoveredAddress == owner, 'LUSD: invalid signature');\n _approve(owner, spender", "vulnerable_code": "pragma solidity 0.6.11;", "fixed_code": " address recoveredAddress = ecrecover(digest, v, r, s);\n require(recoveredAddress == owner, 'LUSD: invalid signature');", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/DeFiHackLabs-Q.md", "collected_at": "2026-01-02T18:16:07.576220+00:00", "source_hash": "1722d0f591152a276a3cca28048f23ce30bc4596b388b216bf50657c1e2e7d1d", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 148, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "pragma solidity 0.6.11;", "primary_code_language": "js", "primary_code_char_count": 23, "all_code_blocks": "// Code block 1 (js):\npragma solidity 0.6.11;\n\n// Code block 2 (js):\naddress recoveredAddress = ecrecover(digest, v, r, s);\n require(recoveredAddress == owner, 'LUSD: invalid signature');", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "BorrowerOperations.sol#L3, LUSDToken.sol#L287, ECDSA.sol", "github_files_list": "LUSDToken.sol, BorrowerOperations.sol, ECDSA.sol", "github_refs_count": 3, "vulnerable_code_actual": "pragma solidity 0.6.11;", "has_vulnerable_code_snippet": true, "fixed_code_actual": " address recoveredAddress = ecrecover(digest, v, r, s);\n require(recoveredAddress == owner, 'LUSD: invalid signature');", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-biconomy", "title": "_Adam G", "severity_raw": "High", "severity": "high", "description": "#### [G01] Unchecked increments in for loops\n**Description:**\nWhen incrementing i in for loops there is no chance of overflow so unchecked can be used to save gas. I ran a simple test in remix and found deployment savings of ~31,653 gas and on each function call saved ~141 gas per iteration.\n\n**LOC:**\n[EntryPoint.sol#L100](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L100) \n[EntryPoint.sol#L107](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L107) \n[EntryPoint.sol#L112](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L112) \n[EntryPoint.sol#L128](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L128) \n[EntryPoint.sol#L134](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L134) \n\n**Gas Savings Test:**\n``` \ncontract Test { \n\tfunction loopTest() external { \n\t\tfor (uint256 i; i < 1; ++i) { \n\t\t\tDeployment Cost: 125,637, Cost on function call: 24,601 \n\t\t\n\t\tvs \n\t\t\n\t\tfor (uint256 i; i < 1; ) { \n\t\t\t// for loop body \n\t\t\tunchecked { ++i } \n\t\t\tDeployment Cost: 93,984, Cost on function call: 24,460 \n\t\t} \n\t} \n} \n```\n\n\n#### [G02] x = x + y is Cheaper than x += y\n**Description:** \nWhen incrementing a state variables current value by y, you can save a small amount of gas by using the pattern x = x +/- y instead of x +/-= y. Based on a test in remix you can save ~1,007 gas on deployment and ~15 gas on each execution.\n\n**LOC:**\n[VerifyingSingletonPaymaster.sol#L51](https://github.com/code-423n4/2023-", "vulnerable_code": "contract Test { \n\tfunction loopTest() external { \n\t\tfor (uint256 i; i < 1; ++i) { \n\t\t\tDeployment Cost: 125,637, Cost on function call: 24,601 \n\t\t\n\t\tvs \n\t\t\n\t\tfor (uint256 i; i < 1; ) { \n\t\t\t// for loop body \n\t\t\tunchecked { ++i } \n\t\t\tDeployment Cost: 93,984, Cost on function call: 24,460 \n\t\t} \n\t} \n} ", "fixed_code": "contract Test { \n\tuint256 x = 1; \n\tfunction test() external { \n\t\tx += 3; \n\t\t(Deployment Cost: 153,124, Execution Cost: 30,369) \n\t\t\n\t\tvs \n\t\t\n\t\tx = x + 1; \n\t\t(Deployment Cost: 152,117, Execution Cost: 30,354) \n\t} \n} ", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/_Adam-G.md", "collected_at": "2026-01-02T18:13:27.454616+00:00", "source_hash": "17354d8ff4565a6a88db22f2aea9579dcb6e82a3ad78c765e1e267dce3be2d9c", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "EntryPoint.sol#L100, EntryPoint.sol#L107, EntryPoint.sol#L112, EntryPoint.sol#L128, EntryPoint.sol#L134", "github_files_list": "EntryPoint.sol", "github_refs_count": 5, "vulnerable_code_actual": "contract Test { \n\tfunction loopTest() external { \n\t\tfor (uint256 i; i < 1; ++i) { \n\t\t\tDeployment Cost: 125,637, Cost on function call: 24,601 \n\t\t\n\t\tvs \n\t\t\n\t\tfor (uint256 i; i < 1; ) { \n\t\t\t// for loop body \n\t\t\tunchecked { ++i } \n\t\t\tDeployment Cost: 93,984, Cost on function call: 24,460 \n\t\t} \n\t} \n} ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "contract Test { \n\tuint256 x = 1; \n\tfunction test() external { \n\t\tx += 3; \n\t\t(Deployment Cost: 153,124, Execution Cost: 30,369) \n\t\t\n\t\tvs \n\t\t\n\t\tx = x + 1; \n\t\t(Deployment Cost: 152,117, Execution Cost: 30,354) \n\t} \n} ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "02-ethos", "title": "ReyAdmirado G", "severity_raw": "High", "severity": "high", "description": "| | issue |\n| ----------- | ----------- |\n| 1 | [state variables can be packed into fewer storage slots](#) |\n| 2 | [expressions for constant values such as a call to keccak256(), should use immutable rather than constant](#) |\n| 3 | [Multiple address/ID mappings can be combined into a single mapping of an address/ID to a struct, where appropriate](#) |\n| 4 | [state variables should be cached in stack variables rather than re-reading them from storage](#) |\n| 5 | [` += ` costs more gas than ` = + ` for state variables](#) |\n| 6 | [not using the named return variables when a function returns, wastes deployment gas](#) |\n| 7 | [can make the variable outside the loop to save gas](#) |\n| 8 | [splitting require() statements that use `&&` saves gas](#) |\n| 9 | [require() or revert() statements that check input arguments should be at the top of the function](#) |\n| 10 | [Avoid a SLOAD optimistically](#) |\n| 11 | [use a more recent version of solidity](#) |\n| 12 | [internal functions only called once can be inlined to save gas](#) |\n| 13 | [avoid an unnecessary sstore by not writing a default value for bools](#) |\n| 14 | [Using fixed bytes is cheaper than using string](#) |\n| 15 | [ Ternary over if ... else](#) |\n| 16 | [public functions not called by the contract should be declared external instead](#) |\n| 17 | [state var is defined but not used anywhere but](#) |\n| 18 | [Optimize names to save gas](#) |\n| 19 | [Non-strict inequalities are cheaper than strict ones](#) |\n| 20 | [instead of assigning to zero use `delete`](#) |\n| 21 | [precalculating part of code will reduce the number of operations being done](#) |\n| 22 | [use argument instead of state var](#) |\n\n\n## 1. state variables can be packed into fewer storage slots\n\nIf variables occupying the same slot are both written the same function or by the constructor, avoids a separate Gsset (20000 gas). Reads of the variables are also cheaper.\n\n`stabilityPoolAddress` and `initialized` can be put together in ", "vulnerable_code": " collAmount[_collateral] = collAmount[_collateral].sub(_amount);\n emit ActivePoolCollateralBalanceUpdated(_collateral, collAmount[_collateral]);", "fixed_code": " uint256 someVariable = collAmount[_collateral].sub(_amount);\n collAmount[_collateral] = someVariable\n emit ActivePoolCollateralBalanceUpdated(_collateral, someVariable);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/ReyAdmirado-G.md", "collected_at": "2026-01-02T18:16:33.719952+00:00", "source_hash": "173abd18f6fa2493ea7f6fc166b5473f339b00b7e166226a3b848350af0e6180", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " collAmount[_collateral] = collAmount[_collateral].sub(_amount);\n emit ActivePoolCollateralBalanceUpdated(_collateral, collAmount[_collateral]);", "has_vulnerable_code_snippet": true, "fixed_code_actual": " uint256 someVariable = collAmount[_collateral].sub(_amount);\n collAmount[_collateral] = someVariable\n emit ActivePoolCollateralBalanceUpdated(_collateral, someVariable);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "02-ai-arena", "title": "Tekken Q", "severity_raw": "Medium", "severity": "medium", "description": "## Low\n### [L-1] [`MergingPool::getFighterPoints`](https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/MergingPool.sol#L205) should take two arguments instead of one, to be able to preview a range of fighter's points, instead of iterating through all of them up to the `maxId`\n\n**Impact:** The function `getFighterPoints` currently does not provide a way to set a starting index for points to be retrieved. It always starts from the beginning (i = 0). If you want to provide a way to get fighter points inside a range, you should include a startId parameter to the function.\n\n**Recommended Adjustment:** \n```js\n function getFighterPoints(uint256 startId, uint256 endId) public view returns(uint256[] memory) {\n uint256 range = endId - startId;\n uint256[] memory points = new uint256[](range);\n for (uint256 i = startId; i < range; i++) {\n points[i] = fighterPoints[i];\n }\n return points;\n }\n}\n```\n\n### [L-2] Unused [event `Neuron::TokensMinted`](https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/Neuron.sol#L21) which is missing from the [`Neuron::constructor`](https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/Neuron.sol#L74-L75) and [`Neuron::mint`](https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/Neuron.sol#L158), to emit of the event of minting tokens\n\n**Description:** Event `TokensMinted` is not emitted during minting in the `constructor` and `mint` functions. The ERC20's event for the `_mint` function only displays a Transfer function, which could be cofusing when inspecting the events, even-though it is a transfer, it's still a minting function and that should be made clear by utilizing the unused `TokensMinted` event. \n\n**Impact:** It's bad practice to miss out on emitting events for essential state modifications or significant function cal", "vulnerable_code": " function getFighterPoints(uint256 startId, uint256 endId) public view returns(uint256[] memory) {\n uint256 range = endId - startId;\n uint256[] memory points = new uint256[](range);\n for (uint256 i = startId; i < range; i++) {\n points[i] = fighterPoints[i];\n }\n return points;\n }\n}", "fixed_code": "## Informational\n### [I-1] In the function `Neuron::claim`, [`transferFrom`](https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/Neuron.sol#L143) is not checked for success\n\n**Recommended Adjustment:** ", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/Tekken-Q.md", "collected_at": "2026-01-02T19:02:46.979963+00:00", "source_hash": "1749647e586d978271d823fbd263866ce2b0f6c53f07693963ca1c0e255975b5", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 329, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function getFighterPoints(uint256 startId, uint256 endId) public view returns(uint256[] memory) {\n uint256 range = endId - startId;\n uint256[] memory points = new uint256[](range);\n for (uint256 i = startId; i < range; i++) {\n points[i] = fighterPoints[i];\n }\n return points;\n }\n}", "primary_code_language": "js", "primary_code_char_count": 329, "all_code_blocks": "// Code block 1 (js):\nfunction getFighterPoints(uint256 startId, uint256 endId) public view returns(uint256[] memory) {\n uint256 range = endId - startId;\n uint256[] memory points = new uint256[](range);\n for (uint256 i = startId; i < range; i++) {\n points[i] = fighterPoints[i];\n }\n return points;\n }\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "MergingPool.sol#L205, Neuron.sol#L21, Neuron.sol#L74-L75, Neuron.sol#L158, Neuron.sol#L143", "github_files_list": "Neuron.sol, MergingPool.sol", "github_refs_count": 5, "vulnerable_code_actual": " function getFighterPoints(uint256 startId, uint256 endId) public view returns(uint256[] memory) {\n uint256 range = endId - startId;\n uint256[] memory points = new uint256[](range);\n for (uint256 i = startId; i < range; i++) {\n points[i] = fighterPoints[i];\n }\n return points;\n }\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## Informational\n### [I-1] In the function `Neuron::claim`, [`transferFrom`](https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/Neuron.sol#L143) is not checked for success\n\n**Recommended Adjustment:** ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "07-amphora", "title": "bigtone Q", "severity_raw": "Critical", "severity": "critical", "description": "\n## Non Critical Issues\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [NC-1](#NC-1) | The `USDA_ZeroAmount` check should be moved to the `_mint` function from the current location in the `mint` function | 1 |\n| [NC-2](#NC-2) | The `USDA_ZeroAmount` check should be moved to the `_burn` function from the current location in the `burn` function | 1 |\n\n\n### [NC-1] The `USDA_ZeroAmount` check should be moved to the `_mint` function from the current location in the `mint` function\n\nThere's other functions to use _mint function, so zeroAmount check should be in the `_mint`\n\n*Instances (1)*:\n```diff\nFile: https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/AMPHClaimer.sol:L161-L164\n\n function mint(uint256 _susdAmount) external override paysInterest onlyOwner {\n- if (_susdAmount == 0) revert USDA_ZeroAmount(); // @audit here\n _mint(_msgSender(), _susdAmount);\n }\n\nFile: https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/AMPHClaimer.sol:L167-L178\n function _mint(address _target, uint256 _amount) internal {\n+ if (_amount == 0) revert USDA_ZeroAmount();\n uint256 __gonsPerFragment = _gonsPerFragment;\n // the gonbalances of the sender is in gons, therefore we must multiply the deposit amount, which is in fragments, by gonsperfragment\n _gonBalances[_target] += _amount * __gonsPerFragment;\n // total supply is in fragments, and so we add amount\n _totalSupply += _amount;\n // and totalgons of course is in gons, and so we multiply amount by gonsperfragment to get the amount of gons we must add to totalGons\n _totalGons += _amount * __gonsPerFragment;\n // emit both a mint and transfer event\n emit Transfer(address(0), _target, _amount);\n emit Mint(_target, _amount);\n }\n\n```\n\n### [NC-2] The `USDA_ZeroAmount` check should be moved to the `_burn` function from the current location in the `burn` funct", "vulnerable_code": "### [NC-2] The `USDA_ZeroAmount` check should be moved to the `_burn` function from the current location in the `burn` function\n\nThere's other functions to use _burn function, so zeroAmount check should be in the `_burn`\n\n*Instances (1)*:", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/bigtone-Q.md", "collected_at": "2026-01-02T18:23:42.557092+00:00", "source_hash": "17c817f6592ecf736b2905a39f33c1d22cb21d53eaae8119ed09e71380b709be", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 1244, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/AMPHClaimer.sol:L161-L164\n\n function mint(uint256 _susdAmount) external override paysInterest onlyOwner {\n- if (_susdAmount == 0) revert USDA_ZeroAmount(); // @audit here\n _mint(_msgSender(), _susdAmount);\n }\n\nFile: https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/AMPHClaimer.sol:L167-L178\n function _mint(address _target, uint256 _amount) internal {\n+ if (_amount == 0) revert USDA_ZeroAmount();\n uint256 __gonsPerFragment = _gonsPerFragment;\n // the gonbalances of the sender is in gons, therefore we must multiply the deposit amount, which is in fragments, by gonsperfragment\n _gonBalances[_target] += _amount * __gonsPerFragment;\n // total supply is in fragments, and so we add amount\n _totalSupply += _amount;\n // and totalgons of course is in gons, and so we multiply amount by gonsperfragment to get the amount of gons we must add to totalGons\n _totalGons += _amount * __gonsPerFragment;\n // emit both a mint and transfer event\n emit Transfer(address(0), _target, _amount);\n emit Mint(_target, _amount);\n }", "primary_code_language": "diff", "primary_code_char_count": 1244, "all_code_blocks": "// Code block 1 (diff):\nFile: https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/AMPHClaimer.sol:L161-L164\n\n function mint(uint256 _susdAmount) external override paysInterest onlyOwner {\n- if (_susdAmount == 0) revert USDA_ZeroAmount(); // @audit here\n _mint(_msgSender(), _susdAmount);\n }\n\nFile: https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/AMPHClaimer.sol:L167-L178\n function _mint(address _target, uint256 _amount) internal {\n+ if (_amount == 0) revert USDA_ZeroAmount();\n uint256 __gonsPerFragment = _gonsPerFragment;\n // the gonbalances of the sender is in gons, therefore we must multiply the deposit amount, which is in fragments, by gonsperfragment\n _gonBalances[_target] += _amount * __gonsPerFragment;\n // total supply is in fragments, and so we add amount\n _totalSupply += _amount;\n // and totalgons of course is in gons, and so we multiply amount by gonsperfragment to get the amount of gons we must add to totalGons\n _totalGons += _amount * __gonsPerFragment;\n // emit both a mint and transfer event\n emit Transfer(address(0), _target, _amount);\n emit Mint(_target, _amount);\n }", "all_code_blocks_count": 1, "has_diff_blocks": true, "diff_code": "File: https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/AMPHClaimer.sol:L161-L164\n\n function mint(uint256 _susdAmount) external override paysInterest onlyOwner {\n- if (_susdAmount == 0) revert USDA_ZeroAmount(); // @audit here\n _mint(_msgSender(), _susdAmount);\n }\n\nFile: https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/AMPHClaimer.sol:L167-L178\n function _mint(address _target, uint256 _amount) internal {\n+ if (_amount == 0) revert USDA_ZeroAmount();\n uint256 __gonsPerFragment = _gonsPerFragment;\n // the gonbalances of the sender is in gons, therefore we must multiply the deposit amount, which is in fragments, by gonsperfragment\n _gonBalances[_target] += _amount * __gonsPerFragment;\n // total supply is in fragments, and so we add amount\n _totalSupply += _amount;\n // and totalgons of course is in gons, and so we multiply amount by gonsperfragment to get the amount of gons we must add to totalGons\n _totalGons += _amount * __gonsPerFragment;\n // emit both a mint and transfer event\n emit Transfer(address(0), _target, _amount);\n emit Mint(_target, _amount);\n }", "solidity_code": "", "github_refs_formatted": "AMPHClaimer.sol", "github_files_list": "AMPHClaimer.sol", "github_refs_count": 1, "vulnerable_code_actual": "### [NC-2] The `USDA_ZeroAmount` check should be moved to the `_burn` function from the current location in the `burn` function\n\nThere's other functions to use _burn function, so zeroAmount check should be in the `_burn`\n\n*Instances (1)*:", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 8} {"source": "c4", "protocol": "11-kelp", "title": "Tumelo_Crypto Q", "severity_raw": "Low", "severity": "low", "description": "# [L-01] DepositLimit can be exceeded due to stETH being a rebase token\n\n## Impact\nAlthough low risk as deposit limit is said to be 100 000 Eth, this will cause problems when interacting with Eigenlayer contracts as they share similar deposit limit.\n\n## Proof of Concept\nstETH is a rebasing token that can increase or decrease as the balance of Eth in certain pools changes to maintain 1:1 peg. Should total deposits reach limit specified at any time and stETH supply increases, the protocol will be over the deposit Limit and could encounter problems interacting with the Eignelayer contracts as they are said to have a similar limit.\n\n```solidity\n if (depositAmount > getAssetCurrentLimit(asset)) {\n revert MaximumDepositLimitReached();\n }\n```\n\nLikelihood of this happening is low as protocol would have to reach or come really close to deposit limit of 100K ETH first.\n\n## Tools Used\nManuel review\n\n## Recommended Mitigation Steps\nProtocol should include separate checks to see if changes in stETH have pushed past depositLimit before depositing into NodeDelegator or EigenLayer strategies. If limit has been passed then protocol should remove some stETH from contract to remain under or equal to depositLimit.", "vulnerable_code": " if (depositAmount > getAssetCurrentLimit(asset)) {\n revert MaximumDepositLimitReached();\n }", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/Tumelo_Crypto-Q.md", "collected_at": "2026-01-02T18:27:43.438732+00:00", "source_hash": "17ef2ece109661fe39b7f27a768bbd28015879b2594455da34e9acfa999eee0a", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 109, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "if (depositAmount > getAssetCurrentLimit(asset)) {\n revert MaximumDepositLimitReached();\n }", "primary_code_language": "solidity", "primary_code_char_count": 109, "all_code_blocks": "// Code block 1 (solidity):\nif (depositAmount > getAssetCurrentLimit(asset)) {\n revert MaximumDepositLimitReached();\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "if (depositAmount > getAssetCurrentLimit(asset)) {\n revert MaximumDepositLimitReached();\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " if (depositAmount > getAssetCurrentLimit(asset)) {\n revert MaximumDepositLimitReached();\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.48} {"source": "c4", "protocol": "04-caviar", "title": "0xAgro Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA Report\n## Finding Summary\n\n[**Low Severity**](#Low-Severity)\n1. [**Unchecked Cast May Overflow**](#1-Unchecked-Cast-May-Overflow)\n2. [**Early Use of Compiler Version**](#2-Early-Use-of-Compiler-Version)\n3. [**Single Step Owner Transfer**](#3-Single-Step-Owner-Transfer)\n4. [**Tokens Without Decimals Will Not Give Price**](#4-Tokens-Without-Decimals-Will-Not-Give-Price)\n5. [**Withdraw Event Manipulation**](#5-Withdraw-Event-Manipulation)\n6. [**Private Pool Creation Event Manipulation**](#6-Private-Pool-Creation-Event-Manipulation)\n\n[**Non-Critical**](#Non-Critical)\n1. [**Incomplete NatSpec**](#1-Incomplete-NatSpec)\n2. [**Inconsistent Named Returns**](#2-Inconsistent-Named-Returns)\n3. [**Spelling Mistakes**](#3-Spelling-Mistakes)\n4. [**Events Not Indexed**](#4-Events-Not-Indexed)\n5. [**bytes.concat() Can Be Used Over abi.encodePacked()**](#5-bytesconcat-can-be-used-over-abiencodepacked)\n6. [**Inconsistent ASCII Art Starting Point**](#6-Inconsistent-ASCII-Art-Starting-Point)\n7. [**Unbounded Compiler Version**](#7-Unbounded-Compiler-Version)\n8. [**Value Can Be Used Again**](#8-Value-Can-Be-Used-Again)\n9. [**Documentation Should Describe Functionality**](#9-Documentation-Should-Describe-Functionality)\n10. [**Assembly Should Be Documented**](#10-Assembly-Should-Be-Documented)\n11. [**Magic Number Used**](#11-Magic-Number-Used)*\n\n[**Style Guide Violations**](#Style-Guide-Violations)\n1. [**Maximum Line Length**](#1-Maximum-Line-Length)\n2. [**Order of Functions**](#2-Order-of-Functions)\n3. [**Order of Layout**](#3-Order-of-Layout)\n4. [**Single Quote String**](#4-Single-Quote-String)\n\n# Low Severity\n\n## 1. Unchecked Cast May Overflow\n\nAs of Solidity 0.8 overflows are handled automatically; however, not for casting. For example `uint32(4294967300)` will result in `4` without reversion. Consider using OpenZepplin's SafeCast library. Even if it seems as though a value cannot overflow, it is best to be safe.\n\n*/src/PrivatePool.sol*\n\n```solidity\n230:\tvirtualBaseTokenReserves +=", "vulnerable_code": "230:\tvirtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n231:\tvirtualNftReserves -= uint128(weightSum);\n323:\tvirtualBaseTokenReserves -= uint128(netOutputAmount + protocolFeeAmount + feeAmount);\n324:\tvirtualNftReserves += uint128(weightSum);", "fixed_code": "39: function transferOwnership(address newOwner) public virtual onlyOwner {\n40: owner = newOwner;\n41: \n42: emit OwnershipTransferred(msg.sender, newOwner);\n43: }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/0xAgro-Q.md", "collected_at": "2026-01-02T18:19:18.089140+00:00", "source_hash": "186289006ce277eddbbd14a294d74abcad907bd1283d915df6d7ff9d816ff310", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "230:\tvirtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n231:\tvirtualNftReserves -= uint128(weightSum);\n323:\tvirtualBaseTokenReserves -= uint128(netOutputAmount + protocolFeeAmount + feeAmount);\n324:\tvirtualNftReserves += uint128(weightSum);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "39: function transferOwnership(address newOwner) public virtual onlyOwner {\n40: owner = newOwner;\n41: \n42: emit OwnershipTransferred(msg.sender, newOwner);\n43: }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-ondo", "title": "shark Q", "severity_raw": "Medium", "severity": "medium", "description": "## 0. Zero price is considered valid\n\nIn the following contract, `int answer` is required to be `>= 0`. However, this allows `int answer` to be zero, meaning a pointlessly scaled zero value could be returned.\n\nFile: `OndoPriceOracleV2.sol` [Line 297](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/OndoPriceOracleV2.sol#L297)\n\n```solidity\n require(answer >= 0, \"Price cannot be negative\");\n```\n\nInstead of the above, consider refactoring to:\n\n```solidity\n require(answer > 0, \"Price must be greater than zero\");\n```\n\n## 1. Use time units when applicable\n\nSee this: [docs.soliditylang.org/en/v0.8.14/units-and-global-variables.html#time-units](https://docs.soliditylang.org/en/v0.8.14/units-and-global-variables.html#time-units)\n\nWith that in mind, the following declaration may be refactored:\n\nFile: `OndoPriceOracleV2.sol` [Line 77](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/OndoPriceOracleV2.sol#L77)\n\n```solidity\n uint256 public maxChainlinkOracleTimeDelay = 90000; // 25 hours\n```\n\nFrom the above to, this:\n\n```solidity\n uint256 public maxChainlinkOracleTimeDelay = 25 hours;\n```\n\n## 2. Use delete to clear variables instead of zero assignment\n\nUsing the [`delete`](https://docs.soliditylang.org/en/v0.8.17/types.html#delete) keyword more clearly states your intention.\n\nFor example:\n\nFile: `CashManager.sol` [Line 259](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L259)\n\n```solidity\n mintRequestsPerEpoch[epochToClaim][user] = 0;\n```\n\nThe above instance could be refactored to use the `delete` keyword:\n\n```solidity\n delete mintRequestsPerEpoch[epochToClaim][user];\n```\n\n## 3. Typo mistakes\n\nIt is not recommended to spell words incorrectly as this will decreases readability. However, this is issue is present in many contracts. Consider fixing the following typos to increase readability:\n\nFile: `KYCRegistry.sol` ([Line 62](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts", "vulnerable_code": " require(answer >= 0, \"Price cannot be negative\");", "fixed_code": " require(answer > 0, \"Price must be greater than zero\");", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/shark-Q.md", "collected_at": "2026-01-02T18:15:33.590777+00:00", "source_hash": "189104ef243f12ce4445ad0b5449d3c123f95df22dbb9ed8cbca4aba03273035", "code_block_count": 6, "solidity_block_count": 6, "total_code_chars": 314, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "require(answer >= 0, \"Price cannot be negative\");", "primary_code_language": "solidity", "primary_code_char_count": 49, "all_code_blocks": "// Code block 1 (solidity):\nrequire(answer >= 0, \"Price cannot be negative\");\n\n// Code block 2 (solidity):\nrequire(answer > 0, \"Price must be greater than zero\");\n\n// Code block 3 (solidity):\nuint256 public maxChainlinkOracleTimeDelay = 90000; // 25 hours\n\n// Code block 4 (solidity):\nuint256 public maxChainlinkOracleTimeDelay = 25 hours;\n\n// Code block 5 (solidity):\nmintRequestsPerEpoch[epochToClaim][user] = 0;\n\n// Code block 6 (solidity):\ndelete mintRequestsPerEpoch[epochToClaim][user];", "all_code_blocks_count": 6, "has_diff_blocks": false, "diff_code": "", "solidity_code": "require(answer >= 0, \"Price cannot be negative\");\n\nrequire(answer > 0, \"Price must be greater than zero\");\n\nuint256 public maxChainlinkOracleTimeDelay = 90000; // 25 hours\n\nuint256 public maxChainlinkOracleTimeDelay = 25 hours;\n\nmintRequestsPerEpoch[epochToClaim][user] = 0;\n\ndelete mintRequestsPerEpoch[epochToClaim][user];", "github_refs_formatted": "OndoPriceOracleV2.sol#L297, OndoPriceOracleV2.sol#L77, CashManager.sol#L259", "github_files_list": "CashManager.sol, OndoPriceOracleV2.sol", "github_refs_count": 3, "vulnerable_code_actual": " require(answer >= 0, \"Price cannot be negative\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": " require(answer > 0, \"Price must be greater than zero\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 12} {"source": "c4", "protocol": "07-amphora", "title": "kutugu Q", "severity_raw": "High", "severity": "high", "description": "# Findings Summary\n\n| ID | Title | Severity |\n| ------ | ------------------------------------------------------------------------------------------ | -------- |\n| [L-01] | UFragments transferAllFrom should round up when calculating allowance value | Low |\n| [L-02] | GovernorCharlie queue proposal time check is invalid and always success | Low |\n| [L-03] | UniswapV3Oracle obtains the price at a single tick that is susceptible to manipulation | Low |\n| [L-04] | The failure of the user to repay after the pause of the protocol may lead to liquidation | Low |\n| [L-05] | VaultController _getVaultBorrowingPower function possible exhaustes gas | Low |\n| [L-06] | The decimal of the oracle price may not be 18, causing vault to miscalculate | Low |\n| [L-07] | If sUSD is depegged, The vault can be arbitraged | Low |\n\n# Detailed Findings\n\n# [L-01] UFragments transferAllFrom should round up when calculating value\n\n## Description\n\n```solidity\n function transferAllFrom(address _from, address _to) external validRecipient(_to) returns (bool _success) {\n uint256 _gonValue = _gonBalances[_from];\n uint256 _value = _gonValue / _gonsPerFragment;\n\n _allowedFragments[_from][msg.sender] = _allowedFragments[_from][msg.sender] - _value;\n\n delete _gonBalances[_from];\n _gonBalances[_to] = _gonBalances[_to] + _gonValue;\n\n emit Transfer(_from, _to, _value);\n return true;\n }\n```\n\nThe allowance to be consumed should be rounded up. Since _gonsPerFragment is variable, it is possible that _gonValue will eventually divide by _gonsPerFragment with a remainder, so there will be a precision error in division, resulting in the reduced allowance being 1 lower than the actual allowance.\nIf _gonsPerFragment = 10000, _gonValue = 19999, then allowance con", "vulnerable_code": " function transferAllFrom(address _from, address _to) external validRecipient(_to) returns (bool _success) {\n uint256 _gonValue = _gonBalances[_from];\n uint256 _value = _gonValue / _gonsPerFragment;\n\n _allowedFragments[_from][msg.sender] = _allowedFragments[_from][msg.sender] - _value;\n\n delete _gonBalances[_from];\n _gonBalances[_to] = _gonBalances[_to] + _gonValue;\n\n emit Transfer(_from, _to, _value);\n return true;\n }", "fixed_code": " function queue(uint256 _proposalId) external override {\n if (state(_proposalId) != ProposalState.Succeeded) revert GovernorCharlie_ProposalNotSucceeded();\n Proposal storage _proposal = proposals[_proposalId];\n uint256 _eta = block.timestamp + _proposal.delay;\n for (uint256 _i = 0; _i < _proposal.targets.length; _i++) {\n if (\n queuedTransactions[keccak256(\n abi.encode(\n _proposal.targets[_i], _proposal.values[_i], _proposal.signatures[_i], _proposal.calldatas[_i], _eta\n )\n )]\n ) revert GovernorCharlie_ProposalAlreadyQueued();\n _queueTransaction(\n _proposal.targets[_i],\n _proposal.values[_i],\n _proposal.signatures[_i],\n _proposal.calldatas[_i],\n _eta,\n _proposal.delay\n );\n }\n _proposal.eta = _eta;\n emit ProposalQueuedIndexed(_proposalId, _eta);\n emit ProposalQueued(_proposalId, _eta);\n }\n\n function _queueTransaction(\n address _target,\n uint256 _value,\n string memory _signature,\n bytes memory _data,\n uint256 _eta,\n uint256 _delay\n ) internal returns (bytes32 _txHash) {\n if (_eta < (_getBlockTimestamp() + _delay)) revert GovernorCharlie_DelayNotReached();\n\n _txHash = keccak256(abi.encode(_target, _value, _signature, _data, _eta));\n queuedTransactions[_txHash] = true;\n\n emit QueueTransaction(_txHash, _target, _value, _signature, _data, _eta);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/kutugu-Q.md", "collected_at": "2026-01-02T18:23:53.704430+00:00", "source_hash": "18c4999e0060bac4aec1aa634f9ae926022604ec6829301cbc6bbab12692f54e", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 443, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function transferAllFrom(address _from, address _to) external validRecipient(_to) returns (bool _success) {\n uint256 _gonValue = _gonBalances[_from];\n uint256 _value = _gonValue / _gonsPerFragment;\n\n _allowedFragments[_from][msg.sender] = _allowedFragments[_from][msg.sender] - _value;\n\n delete _gonBalances[_from];\n _gonBalances[_to] = _gonBalances[_to] + _gonValue;\n\n emit Transfer(_from, _to, _value);\n return true;\n }", "primary_code_language": "solidity", "primary_code_char_count": 443, "all_code_blocks": "// Code block 1 (solidity):\nfunction transferAllFrom(address _from, address _to) external validRecipient(_to) returns (bool _success) {\n uint256 _gonValue = _gonBalances[_from];\n uint256 _value = _gonValue / _gonsPerFragment;\n\n _allowedFragments[_from][msg.sender] = _allowedFragments[_from][msg.sender] - _value;\n\n delete _gonBalances[_from];\n _gonBalances[_to] = _gonBalances[_to] + _gonValue;\n\n emit Transfer(_from, _to, _value);\n return true;\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function transferAllFrom(address _from, address _to) external validRecipient(_to) returns (bool _success) {\n uint256 _gonValue = _gonBalances[_from];\n uint256 _value = _gonValue / _gonsPerFragment;\n\n _allowedFragments[_from][msg.sender] = _allowedFragments[_from][msg.sender] - _value;\n\n delete _gonBalances[_from];\n _gonBalances[_to] = _gonBalances[_to] + _gonValue;\n\n emit Transfer(_from, _to, _value);\n return true;\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function transferAllFrom(address _from, address _to) external validRecipient(_to) returns (bool _success) {\n uint256 _gonValue = _gonBalances[_from];\n uint256 _value = _gonValue / _gonsPerFragment;\n\n _allowedFragments[_from][msg.sender] = _allowedFragments[_from][msg.sender] - _value;\n\n delete _gonBalances[_from];\n _gonBalances[_to] = _gonBalances[_to] + _gonValue;\n\n emit Transfer(_from, _to, _value);\n return true;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function queue(uint256 _proposalId) external override {\n if (state(_proposalId) != ProposalState.Succeeded) revert GovernorCharlie_ProposalNotSucceeded();\n Proposal storage _proposal = proposals[_proposalId];\n uint256 _eta = block.timestamp + _proposal.delay;\n for (uint256 _i = 0; _i < _proposal.targets.length; _i++) {\n if (\n queuedTransactions[keccak256(\n abi.encode(\n _proposal.targets[_i], _proposal.values[_i], _proposal.signatures[_i], _proposal.calldatas[_i], _eta\n )\n )]\n ) revert GovernorCharlie_ProposalAlreadyQueued();\n _queueTransaction(\n _proposal.targets[_i],\n _proposal.values[_i],\n _proposal.signatures[_i],\n _proposal.calldatas[_i],\n _eta,\n _proposal.delay\n );\n }\n _proposal.eta = _eta;\n emit ProposalQueuedIndexed(_proposalId, _eta);\n emit ProposalQueued(_proposalId, _eta);\n }\n\n function _queueTransaction(\n address _target,\n uint256 _value,\n string memory _signature,\n bytes memory _data,\n uint256 _eta,\n uint256 _delay\n ) internal returns (bytes32 _txHash) {\n if (_eta < (_getBlockTimestamp() + _delay)) revert GovernorCharlie_DelayNotReached();\n\n _txHash = keccak256(abi.encode(_target, _value, _signature, _data, _eta));\n queuedTransactions[_txHash] = true;\n\n emit QueueTransaction(_txHash, _target, _value, _signature, _data, _eta);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "02-ethos", "title": "ch0bu G", "severity_raw": "High", "severity": "high", "description": "1. ## Use a more recent version of solidity\n\n- Use a solidity version of at least 0.8.0 to get overflow/underflow protection without `SafeMath` \n- Use a solidity version of at least 0.8.2 to get compiler automatic inlining \n- Use a solidity version of at least 0.8.3 to get better struct packing and cheaper multiple storage reads \n- Use a solidity version of at least 0.8.4 to get custom errors, which are cheaper at deployment than `revert()/require()` strings \n- Use a solidity version of at least 0.8.10 to have external calls skip contract existence checks if the external call has a return value\n- Use a solidity version of at least 0.8.12 to get `string.concat()` to be used instead of `abi.encodePacked(,)`\n- Use a solidity version of at least 0.8.13 to get the ability to use `using for` with a list of free functions\n- Use a solidity version of 0.8.15 where conditions necessary for inlining are relaxed. It shows significant dicrease in the bytecode size (and thus reduced deployment cost)\n- Use a solidity version of 0.8.17 to prevent the incorrect removal of storage writes before calls to Yul functions that conditionally terminate the external EVM call; Simplify the starting offset of zero-length operations to zero; More efficient overflow checks for multiplication\n\n```\nAll contracts in scope\n```\n\n2. ## Using unchecked blocks to save gas - increments in for loop can be unchecked\n\nIf the team decides to migrate all contracts in scope to solidity ^0.8.0 then the majority of Solidity for loops increment a uint256 variable that starts at 0. These increment operations never need to be checked for overflow/underflow because the variable will never reach the max number of uint256 (will run out of gas long before that happens). The default overflow/underflow check wastes gas in every iteration of virtually every for loop.\n\nThis saves 30-40 gas per loop iteration.\n\ne.g Let\u2019s work with a sample loop below.\n```\nfor(uint256 i; i < 10; i++){\n//doSomething\n}\n```\ncan be", "vulnerable_code": "All contracts in scope", "fixed_code": "for(uint256 i; i < 10; i++){\n//doSomething\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/ch0bu-G.md", "collected_at": "2026-01-02T18:16:54.884394+00:00", "source_hash": "18e519c23d7ce487858284e3e335cbe6b3657eb762ec7869281862d073601e65", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 66, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "All contracts in scope", "primary_code_language": "unknown", "primary_code_char_count": 22, "all_code_blocks": "// Code block 1 (unknown):\nAll contracts in scope\n\n// Code block 2 (unknown):\nfor(uint256 i; i < 10; i++){\n//doSomething\n}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "All contracts in scope", "has_vulnerable_code_snippet": true, "fixed_code_actual": "for(uint256 i; i < 10; i++){\n//doSomething\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-ondo", "title": "seeu Q", "severity_raw": "High", "severity": "high", "description": "## [L-01] Compiler version Pragma is non-specific\n\n### Description\n\nFor non-library contracts, floating pragmas may be a security risk for application implementations, since a known vulnerable compiler version may accidentally be selected or security tools might fallback to an older compiler version ending up checking a different EVM compilation that is ultimately deployed on the blockchain.\n\n### Findings\n\n- [contracts/lending/tokens/cCash/CCash.sol](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cCash/CCash.sol) => `pragma solidity ^0.8.10;`\n- [contracts/lending/tokens/cCash/CCashDelegate.sol](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cCash/CCashDelegate.sol) => `pragma solidity ^0.8.10;`\n- [contracts/lending/tokens/cToken/CErc20.sol](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cToken/CErc20.sol) => `pragma solidity ^0.8.10;`\n- [contracts/lending/tokens/cCash/CTokenCash.sol](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cCash/CTokenCash.sol) => `pragma solidity ^0.8.10;`\n- [contracts/lending/tokens/cToken/CTokenDelegate.sol](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cToken/CTokenDelegate.sol) => `pragma solidity ^0.8.10;`\n- [contracts/lending/tokens/cToken/CTokenInterfacesModified.sol](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cToken/CTokenInterfacesModified.sol) => `pragma solidity ^0.8.10;`\n- [contracts/lending/tokens/cCash/CTokenInterfacesModifiedCash.sol](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cCash/CTokenInterfacesModifiedCash.sol) => `pragma solidity ^0.8.10;`\n- [contracts/lending/tokens/cToken/CTokenModified.sol](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cToken/CTokenModified.sol) => `pragma solidity ^0.8.10;`\n- [contracts/lending/JumpRateModelV2.sol](https://github.com/code-423n4/20", "vulnerable_code": "https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cCash/CCash.sol\n::66 => function mint(uint mintAmount) external override returns (uint) {\n::77 => function redeem(uint redeemTokens) external override returns (uint) {\n::100 => function borrow(uint borrowAmount) external override returns (uint) {\n::110 => function repayBorrow(uint repayAmount) external override returns (uint) {\n::168 => function _addReserves(uint addAmount) external override returns (uint) {\n::179 => function getCashPrior() internal view virtual override returns (uint) {\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cToken/CErc20.sol\n::66 => function mint(uint mintAmount) external override returns (uint) {\n::77 => function redeem(uint redeemTokens) external override returns (uint) {\n::100 => function borrow(uint borrowAmount) external override returns (uint) {\n::110 => function repayBorrow(uint repayAmount) external override returns (uint) {\n::168 => function _addReserves(uint addAmount) external override returns (uint) {\n::179 => function getCashPrior() internal view virtual override returns (uint) {\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cCash/CTokenCash.sol\n::210 => function balanceOf(address owner) external view override returns (uint256) {\n::220 => function balanceOfUnderlying(address owner) external override returns (uint) {\n::246 => function getBlockNumber() internal view virtual returns (uint) {\n::254 => function borrowRatePerBlock() external view override returns (uint) {\n::267 => function supplyRatePerBlock() external view override returns (uint) {\n::281 => function totalBorrowsCurrent() external override nonReentrant returns (uint) {\n::338 => function exchangeRateCurrent() public override nonReentrant returns (uint) {\n::348 => function exchangeRateStored() public view override returns (uint) {\n::357 => function exchangeRateStoredInternal() internal ", "fixed_code": "", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/seeu-Q.md", "collected_at": "2026-01-02T18:15:32.701540+00:00", "source_hash": "192783ee7facf62bcdfb995046f23efd5f9c4f60b1681448bb2688d2a4bdde10", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 8, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CCash.sol, CCashDelegate.sol, CErc20.sol, CTokenCash.sol, CTokenDelegate.sol, CTokenInterfacesModified.sol, CTokenInterfacesModifiedCash.sol, CTokenModified.sol", "github_files_list": "CTokenCash.sol, CErc20.sol, CTokenModified.sol, CTokenInterfacesModified.sol, CTokenDelegate.sol, CTokenInterfacesModifiedCash.sol, CCash.sol, CCashDelegate.sol", "github_refs_count": 8, "vulnerable_code_actual": "https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cCash/CCash.sol\n::66 => function mint(uint mintAmount) external override returns (uint) {\n::77 => function redeem(uint redeemTokens) external override returns (uint) {\n::100 => function borrow(uint borrowAmount) external override returns (uint) {\n::110 => function repayBorrow(uint repayAmount) external override returns (uint) {\n::168 => function _addReserves(uint addAmount) external override returns (uint) {\n::179 => function getCashPrior() internal view virtual override returns (uint) {\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cToken/CErc20.sol\n::66 => function mint(uint mintAmount) external override returns (uint) {\n::77 => function redeem(uint redeemTokens) external override returns (uint) {\n::100 => function borrow(uint borrowAmount) external override returns (uint) {\n::110 => function repayBorrow(uint repayAmount) external override returns (uint) {\n::168 => function _addReserves(uint addAmount) external override returns (uint) {\n::179 => function getCashPrior() internal view virtual override returns (uint) {\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cCash/CTokenCash.sol\n::210 => function balanceOf(address owner) external view override returns (uint256) {\n::220 => function balanceOfUnderlying(address owner) external override returns (uint) {\n::246 => function getBlockNumber() internal view virtual returns (uint) {\n::254 => function borrowRatePerBlock() external view override returns (uint) {\n::267 => function supplyRatePerBlock() external view override returns (uint) {\n::281 => function totalBorrowsCurrent() external override nonReentrant returns (uint) {\n::338 => function exchangeRateCurrent() public override nonReentrant returns (uint) {\n::348 => function exchangeRateStored() public view override returns (uint) {\n::357 => function exchangeRateStoredInternal() internal ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "01-salty", "title": "Krace Analysis", "severity_raw": "Unknown", "severity": "unknown", "description": "\nThe comment in the function `_bisectionSearch` says that:\n\n```\n\t// Assuming that the profit function is unimodal (has only one peak), the two profit calculations can show us which half of the range the maximum profit is in (where to keep looking).\n```\n\nBut I think this profit function is monotonically increasing. The profit function is composed of three parts, where the output of the former is the input of the latter. If these three functions are monotonically increasing, then the entire profit function is also increasing on [0, $\\infty$).\n\nWe have:\n`amountOut = (reservesA1 * bestArbAmountIn) / (reservesA0 + bestArbAmountIn);`\n\nso we can get this funciton: `y = (reservesA1 * x) / (reservesA0 + x)` where $x > 0, reservesA0 > 100, reservesA1 > 100$.\n\nLet $x_1 > x_0 >= 0$, so $y_1 - y_0 = (reservesA1 * x_1) / (reservesA0 + x_1) - (reservesA1 * x_0) / (reservesA0 + x_0)$\n$= reservesA1 * (reservesA0*x_1 + x_1*x_0 - reservesA0*x_0 - x_1*x_0) / (reservesA0 + x_0)*(reservesA0 + x_1)$\n$= reservesA1 * reservesA0 * (x_1 - x_0) / (reservesA0 + x_0)*(reservesA0 + x_1)$\n\nBecause $x_1 > x_0$, so $x_1 - x_0 > 0$, which means $y_1 > y_0$ when $x_1 > x_0$, this function is monotonically increasing.\n\nTherefore, I think there is no need to use binary search. The maximum return is always obtained at the time of maximum input.\n\n### Time spent:\n30 hours", "vulnerable_code": "\t// Assuming that the profit function is unimodal (has only one peak), the two profit calculations can show us which half of the range the maximum profit is in (where to keep looking).", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/Krace-Analysis.md", "collected_at": "2026-01-02T19:01:23.732599+00:00", "source_hash": "19518aec6328dead4570b00800f594772710d9fd1618d8ec210e2ae7603eab7f", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 183, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "// Assuming that the profit function is unimodal (has only one peak), the two profit calculations can show us which half of the range the maximum profit is in (where to keep looking).", "primary_code_language": "unknown", "primary_code_char_count": 183, "all_code_blocks": "// Code block 1 (unknown):\n// Assuming that the profit function is unimodal (has only one peak), the two profit calculations can show us which half of the range the maximum profit is in (where to keep looking).", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "\t// Assuming that the profit function is unimodal (has only one peak), the two profit calculations can show us which half of the range the maximum profit is in (where to keep looking).", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.71} {"source": "c4", "protocol": "02-ai-arena", "title": "SpicyMeatball Q", "severity_raw": "Medium", "severity": "medium", "description": "### `transferOwnership` doesn't revoke admin rights from the old owner\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/VoltageManager.sol#L64\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/Neuron.sol#L85\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/GameItems.sol#L108\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/MergingPool.sol#L89\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/RankedBattle.sol#L167\n\nThe owner is granted admin rights when the contract is created\n```solidity\n constructor(address ownerAddress, address gameItemsContractAddress) {\n _ownerAddress = ownerAddress;\n _gameItemsContractInstance = GameItems(gameItemsContractAddress);\n>> isAdmin[_ownerAddress] = true;\n } \n```\nWhen transferring ownership to another address, the old owner still retains that role. Consider setting `isAdmin` for the old owner to `false`.\n\n### User can bypass voltage limit by participating in battles from different addresses\n\nInitiator of the ranked battle needs to spend 10 voltage units to participate\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/RankedBattle.sol#L345-L347\n```solidity\n function spendVoltage(address spender, uint8 voltageSpent) public {\n require(spender == msg.sender || allowedVoltageSpenders[msg.sender]);\n if (ownerVoltageReplenishTime[spender] <= block.timestamp) {\n _replenishVoltage(spender);\n }\n ownerVoltage[spender] -= voltageSpent;\n emit VoltageRemaining(spender, ownerVoltage[spender]);\n }\n```\nThe voltage is replenished after 24 hours or by sacrificing a special NFT\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/VoltageManager.sol#L117\n```solidity\n function _replenishVoltage(address owner) private {\n>> ownerVoltage[owner] = 100;\n ownerVoltageReplenishTime[owner] = uint32(block.timestamp + 1 days);\n } \n```\nAs we can see, the voltage is bound to the fighter owner's add", "vulnerable_code": " constructor(address ownerAddress, address gameItemsContractAddress) {\n _ownerAddress = ownerAddress;\n _gameItemsContractInstance = GameItems(gameItemsContractAddress);\n>> isAdmin[_ownerAddress] = true;\n } ", "fixed_code": " function spendVoltage(address spender, uint8 voltageSpent) public {\n require(spender == msg.sender || allowedVoltageSpenders[msg.sender]);\n if (ownerVoltageReplenishTime[spender] <= block.timestamp) {\n _replenishVoltage(spender);\n }\n ownerVoltage[spender] -= voltageSpent;\n emit VoltageRemaining(spender, ownerVoltage[spender]);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/SpicyMeatball-Q.md", "collected_at": "2026-01-02T19:02:46.086957+00:00", "source_hash": "198f03cfb08907028a7c5291408415e555de58bdbfca025ea9010ddc7e6a93a0", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 775, "github_ref_count": 7, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "constructor(address ownerAddress, address gameItemsContractAddress) {\n _ownerAddress = ownerAddress;\n _gameItemsContractInstance = GameItems(gameItemsContractAddress);\n>> isAdmin[_ownerAddress] = true;\n }", "primary_code_language": "solidity", "primary_code_char_count": 226, "all_code_blocks": "// Code block 1 (solidity):\nconstructor(address ownerAddress, address gameItemsContractAddress) {\n _ownerAddress = ownerAddress;\n _gameItemsContractInstance = GameItems(gameItemsContractAddress);\n>> isAdmin[_ownerAddress] = true;\n }\n\n// Code block 2 (solidity):\nfunction spendVoltage(address spender, uint8 voltageSpent) public {\n require(spender == msg.sender || allowedVoltageSpenders[msg.sender]);\n if (ownerVoltageReplenishTime[spender] <= block.timestamp) {\n _replenishVoltage(spender);\n }\n ownerVoltage[spender] -= voltageSpent;\n emit VoltageRemaining(spender, ownerVoltage[spender]);\n }\n\n// Code block 3 (solidity):\nfunction _replenishVoltage(address owner) private {\n>> ownerVoltage[owner] = 100;\n ownerVoltageReplenishTime[owner] = uint32(block.timestamp + 1 days);\n }", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "constructor(address ownerAddress, address gameItemsContractAddress) {\n _ownerAddress = ownerAddress;\n _gameItemsContractInstance = GameItems(gameItemsContractAddress);\n>> isAdmin[_ownerAddress] = true;\n }\n\nfunction spendVoltage(address spender, uint8 voltageSpent) public {\n require(spender == msg.sender || allowedVoltageSpenders[msg.sender]);\n if (ownerVoltageReplenishTime[spender] <= block.timestamp) {\n _replenishVoltage(spender);\n }\n ownerVoltage[spender] -= voltageSpent;\n emit VoltageRemaining(spender, ownerVoltage[spender]);\n }\n\nfunction _replenishVoltage(address owner) private {\n>> ownerVoltage[owner] = 100;\n ownerVoltageReplenishTime[owner] = uint32(block.timestamp + 1 days);\n }", "github_refs_formatted": "VoltageManager.sol#L64, Neuron.sol#L85, GameItems.sol#L108, MergingPool.sol#L89, RankedBattle.sol#L167, RankedBattle.sol#L345-L347, VoltageManager.sol#L117", "github_files_list": "VoltageManager.sol, Neuron.sol, GameItems.sol, RankedBattle.sol, MergingPool.sol", "github_refs_count": 7, "vulnerable_code_actual": " constructor(address ownerAddress, address gameItemsContractAddress) {\n _ownerAddress = ownerAddress;\n _gameItemsContractInstance = GameItems(gameItemsContractAddress);\n>> isAdmin[_ownerAddress] = true;\n } ", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function spendVoltage(address spender, uint8 voltageSpent) public {\n require(spender == msg.sender || allowedVoltageSpenders[msg.sender]);\n if (ownerVoltageReplenishTime[spender] <= block.timestamp) {\n _replenishVoltage(spender);\n }\n ownerVoltage[spender] -= voltageSpent;\n emit VoltageRemaining(spender, ownerVoltage[spender]);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "01-ondo", "title": "cryptostellar5 G", "severity_raw": "High", "severity": "high", "description": "### G-01 ++I or I++ SHOULD BE UNCHECKED{++I} or UNCHECKED{I++} WHEN IT IS NOT POSSIBLE FOR THEM TO OVERFLOW, AS IS THE CASE WHEN USED IN FOR- AND WHILE-LOOPS\n\n*Number of Instances Identified: 9*\n\nThe\u00a0`unchecked`\u00a0keyword is new in solidity version 0.8.0, so this only applies to that version or higher, which these instances are. This saves\u00a0**30-40 gas\u00a0[per loop](https://gist.github.com/hrkrshnn/ee8fabd532058307229d65dcd5836ddc#the-increment-in-for-loop-post-condition-can-be-made-unchecked)**.\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol\n\n```\n750: for (uint256 i = 0; i < size; ++i)\n786: for (uint256 i = 0; i < size; ++i) \n933: for (uint256 i = 0; i < size; ++i)\n961: for (uint256 i = 0; i < exCallData.length; ++i)\n```\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashFactory.sol\n\n```\n127: for (uint256 i = 0; i < exCallData.length; ++i)\n```\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashKYCSenderFactory.sol\n\n```\n137: for (uint256 i = 0; i < exCallData.length; ++i)\n```\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashKYCSenderReceiverFactory.sol\n\n```\n137: for (uint256 i = 0; i < exCallData.length; ++i)\n```\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistry.sol\n\n```\n163: for (uint256 i = 0; i < length; i++)\n180: for (uint256 i = 0; i < length; i++)\n```\n\n\n### G-02 X += Y COSTS MORE GAS THAN X = X + Y FOR STATE VARIABLES\n\n*Number of Instances Identified: 9*\n\nUsing the addition operator instead of plus-equals saves **[113 gas]([https://gist.github.com/IllIllI000/cbbfb267425b898e5be734d4008d4fe8)**\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol\n\n```\n221: mintRequestsPerEpoch[currentEpoch][msg.sender] += depositValueAfterFees;\n582: currentEpoch += epochDifference;\n630: currentMintAmount += collateralAmountIn;\n649: currentRedeemAmount += amount;\n678-680: redemptionInfoPerEp", "vulnerable_code": "750: for (uint256 i = 0; i < size; ++i)\n786: for (uint256 i = 0; i < size; ++i) \n933: for (uint256 i = 0; i < size; ++i)\n961: for (uint256 i = 0; i < exCallData.length; ++i)", "fixed_code": "127: for (uint256 i = 0; i < exCallData.length; ++i)", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/cryptostellar5-G.md", "collected_at": "2026-01-02T18:15:02.336719+00:00", "source_hash": "19aeb3821d94c1db27b157771859a447ea4b63e3ee2e7115a725f0b88417436e", "code_block_count": 5, "solidity_block_count": 0, "total_code_chars": 412, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "750: for (uint256 i = 0; i < size; ++i)\n786: for (uint256 i = 0; i < size; ++i) \n933: for (uint256 i = 0; i < size; ++i)\n961: for (uint256 i = 0; i < exCallData.length; ++i)", "primary_code_language": "unknown", "primary_code_char_count": 173, "all_code_blocks": "// Code block 1 (unknown):\n750: for (uint256 i = 0; i < size; ++i)\n786: for (uint256 i = 0; i < size; ++i) \n933: for (uint256 i = 0; i < size; ++i)\n961: for (uint256 i = 0; i < exCallData.length; ++i)\n\n// Code block 2 (unknown):\n127: for (uint256 i = 0; i < exCallData.length; ++i)\n\n// Code block 3 (unknown):\n137: for (uint256 i = 0; i < exCallData.length; ++i)\n\n// Code block 4 (unknown):\n137: for (uint256 i = 0; i < exCallData.length; ++i)\n\n// Code block 5 (unknown):\n163: for (uint256 i = 0; i < length; i++)\n180: for (uint256 i = 0; i < length; i++)", "all_code_blocks_count": 5, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CashManager.sol, CashFactory.sol, CashKYCSenderFactory.sol, CashKYCSenderReceiverFactory.sol, KYCRegistry.sol", "github_files_list": "CashManager.sol, CashKYCSenderFactory.sol, CashFactory.sol, KYCRegistry.sol, CashKYCSenderReceiverFactory.sol", "github_refs_count": 5, "vulnerable_code_actual": "750: for (uint256 i = 0; i < size; ++i)\n786: for (uint256 i = 0; i < size; ++i) \n933: for (uint256 i = 0; i < size; ++i)\n961: for (uint256 i = 0; i < exCallData.length; ++i)", "has_vulnerable_code_snippet": true, "fixed_code_actual": "127: for (uint256 i = 0; i < exCallData.length; ++i)", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 11} {"source": "c4", "protocol": "01-salty", "title": "Jorgect Q", "severity_raw": "Medium", "severity": "medium", "description": "#LOW ISSUES REPORT \n\n## [L-01] Require xsalt for proposal can be so low\n\nTo submit a proposal in the Salty protocol, users must have staked a specific quantity of salt. The exact amount is determined by a percentage set by the DAO, multiplied by the total number of salt tokens staked in the protocol.\n\nThe issue arises when the total staked amount is very low, as it results in a low requirement of XSALT needed to make a proposal. \n\n```\nfunction _possiblyCreateProposal( string memory ballotName, BallotType ballotType, address address1, uint256 number1, string memory string1, string memory string2 ) internal returns (uint256 ballotID)\n\t\t{\n\t\trequire( block.timestamp >= firstPossibleProposalTimestamp, \"Cannot propose ballots within the first 45 days of deployment\" );\n\n\t\t// The DAO can create confirmation proposals which won't have the below requirements\n\t\tif ( msg.sender != address(exchangeConfig.dao() ) )\n\t\t\t{\n\t\t\t// Make sure that the sender has the minimum amount of xSALT required to make the proposal\n\t\t\tuint256 totalStaked = staking.totalShares(PoolUtils.STAKED_SALT);\n\t\t\tuint256 requiredXSalt = ( totalStaked * daoConfig.requiredProposalPercentStakeTimes1000() ) / ( 100 * 1000 );\n\n\t\t\trequire( requiredXSalt > 0, \"requiredXSalt cannot be zero\" );\n\n\t\t\tuint256 userXSalt = staking.userShareForPool( msg.sender, PoolUtils.STAKED_SALT );\n\t\t\trequire( userXSalt >= requiredXSalt, \"Sender does not \n have enough xSALT to make the proposal\" ); <--------\n\n\t\t\t// Make sure that the user doesn't already have an active proposal\n\t\t\trequire( ! _userHasActiveProposal[msg.sender], \"Users can only have one active proposal at a time\" );\n\t\t\t}\n...\n}\n```\n[[Link]](https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/dao/Proposals.sol#L81C2-L99C5)\n\n## Impact\nthe dao can be spamed making so many proposals for part of the users.\n\n## Recomendation\nConsider implementing a minimum threshold that users must stake to submit a proposal. \n\n## [L-02] missing <= in ", "vulnerable_code": "function _possiblyCreateProposal( string memory ballotName, BallotType ballotType, address address1, uint256 number1, string memory string1, string memory string2 ) internal returns (uint256 ballotID)\n\t\t{\n\t\trequire( block.timestamp >= firstPossibleProposalTimestamp, \"Cannot propose ballots within the first 45 days of deployment\" );\n\n\t\t// The DAO can create confirmation proposals which won't have the below requirements\n\t\tif ( msg.sender != address(exchangeConfig.dao() ) )\n\t\t\t{\n\t\t\t// Make sure that the sender has the minimum amount of xSALT required to make the proposal\n\t\t\tuint256 totalStaked = staking.totalShares(PoolUtils.STAKED_SALT);\n\t\t\tuint256 requiredXSalt = ( totalStaked * daoConfig.requiredProposalPercentStakeTimes1000() ) / ( 100 * 1000 );\n\n\t\t\trequire( requiredXSalt > 0, \"requiredXSalt cannot be zero\" );\n\n\t\t\tuint256 userXSalt = staking.userShareForPool( msg.sender, PoolUtils.STAKED_SALT );\n\t\t\trequire( userXSalt >= requiredXSalt, \"Sender does not \n have enough xSALT to make the proposal\" ); <--------\n\n\t\t\t// Make sure that the user doesn't already have an active proposal\n\t\t\trequire( ! _userHasActiveProposal[msg.sender], \"Users can only have one active proposal at a time\" );\n\t\t\t}\n...\n}", "fixed_code": "function proposeTokenWhitelisting( IERC20 token, string calldata tokenIconURL, string calldata description ) external nonReentrant returns (uint256 _ballotID)\n\t\t{\n\t\trequire( address(token) != address(0), \"token cannot be address(0)\" );\n\t\trequire( token.totalSupply() < type(uint112).max, \"Token supply cannot exceed uint112.max\" ); // 5 quadrillion max supply with 18 decimals of precision <--------\n\n\t\trequire( _openBallotsForTokenWhitelisting.length() < daoConfig.maxPendingTokensForWhitelisting(), \"The maximum number of token whitelisting proposals are already pending\" );\n\t\trequire( poolsConfig.numberOfWhitelistedPools() < poolsConfig.maximumWhitelistedPools(), \"Maximum number of whitelisted pools already reached\" );\n\t\trequire( ! poolsConfig.tokenHasBeenWhitelisted(token, exchangeConfig.wbtc(), exchangeConfig.weth()), \"The token has already been whitelisted\" );\n\n\t\tstring memory ballotName = string.concat(\"whitelist:\", Strings.toHexString(address(token)) );\n\n\t\tuint256 ballotID = _possiblyCreateProposal( ballotName, BallotType.WHITELIST_TOKEN, address(token), 0, tokenIconURL, description );\n\t\t_openBallotsForTokenWhitelisting.add( ballotID );\n\n\t\treturn ballotID;\n\t\t}", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/Jorgect-Q.md", "collected_at": "2026-01-02T19:01:21.486442+00:00", "source_hash": "1a09fb1e1f15f0d4223f8be73967f31560611f2eef45f44df03a6dc6e6d19a49", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 1210, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _possiblyCreateProposal( string memory ballotName, BallotType ballotType, address address1, uint256 number1, string memory string1, string memory string2 ) internal returns (uint256 ballotID)\n\t\t{\n\t\trequire( block.timestamp >= firstPossibleProposalTimestamp, \"Cannot propose ballots within the first 45 days of deployment\" );\n\n\t\t// The DAO can create confirmation proposals which won't have the below requirements\n\t\tif ( msg.sender != address(exchangeConfig.dao() ) )\n\t\t\t{\n\t\t\t// Make sure that the sender has the minimum amount of xSALT required to make the proposal\n\t\t\tuint256 totalStaked = staking.totalShares(PoolUtils.STAKED_SALT);\n\t\t\tuint256 requiredXSalt = ( totalStaked * daoConfig.requiredProposalPercentStakeTimes1000() ) / ( 100 * 1000 );\n\n\t\t\trequire( requiredXSalt > 0, \"requiredXSalt cannot be zero\" );\n\n\t\t\tuint256 userXSalt = staking.userShareForPool( msg.sender, PoolUtils.STAKED_SALT );\n\t\t\trequire( userXSalt >= requiredXSalt, \"Sender does not \n have enough xSALT to make the proposal\" ); <--------\n\n\t\t\t// Make sure that the user doesn't already have an active proposal\n\t\t\trequire( ! _userHasActiveProposal[msg.sender], \"Users can only have one active proposal at a time\" );\n\t\t\t}\n...\n}", "primary_code_language": "unknown", "primary_code_char_count": 1210, "all_code_blocks": "// Code block 1 (unknown):\nfunction _possiblyCreateProposal( string memory ballotName, BallotType ballotType, address address1, uint256 number1, string memory string1, string memory string2 ) internal returns (uint256 ballotID)\n\t\t{\n\t\trequire( block.timestamp >= firstPossibleProposalTimestamp, \"Cannot propose ballots within the first 45 days of deployment\" );\n\n\t\t// The DAO can create confirmation proposals which won't have the below requirements\n\t\tif ( msg.sender != address(exchangeConfig.dao() ) )\n\t\t\t{\n\t\t\t// Make sure that the sender has the minimum amount of xSALT required to make the proposal\n\t\t\tuint256 totalStaked = staking.totalShares(PoolUtils.STAKED_SALT);\n\t\t\tuint256 requiredXSalt = ( totalStaked * daoConfig.requiredProposalPercentStakeTimes1000() ) / ( 100 * 1000 );\n\n\t\t\trequire( requiredXSalt > 0, \"requiredXSalt cannot be zero\" );\n\n\t\t\tuint256 userXSalt = staking.userShareForPool( msg.sender, PoolUtils.STAKED_SALT );\n\t\t\trequire( userXSalt >= requiredXSalt, \"Sender does not \n have enough xSALT to make the proposal\" ); <--------\n\n\t\t\t// Make sure that the user doesn't already have an active proposal\n\t\t\trequire( ! _userHasActiveProposal[msg.sender], \"Users can only have one active proposal at a time\" );\n\t\t\t}\n...\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Proposals.sol#L81-L2", "github_files_list": "Proposals.sol", "github_refs_count": 1, "vulnerable_code_actual": "function _possiblyCreateProposal( string memory ballotName, BallotType ballotType, address address1, uint256 number1, string memory string1, string memory string2 ) internal returns (uint256 ballotID)\n\t\t{\n\t\trequire( block.timestamp >= firstPossibleProposalTimestamp, \"Cannot propose ballots within the first 45 days of deployment\" );\n\n\t\t// The DAO can create confirmation proposals which won't have the below requirements\n\t\tif ( msg.sender != address(exchangeConfig.dao() ) )\n\t\t\t{\n\t\t\t// Make sure that the sender has the minimum amount of xSALT required to make the proposal\n\t\t\tuint256 totalStaked = staking.totalShares(PoolUtils.STAKED_SALT);\n\t\t\tuint256 requiredXSalt = ( totalStaked * daoConfig.requiredProposalPercentStakeTimes1000() ) / ( 100 * 1000 );\n\n\t\t\trequire( requiredXSalt > 0, \"requiredXSalt cannot be zero\" );\n\n\t\t\tuint256 userXSalt = staking.userShareForPool( msg.sender, PoolUtils.STAKED_SALT );\n\t\t\trequire( userXSalt >= requiredXSalt, \"Sender does not \n have enough xSALT to make the proposal\" ); <--------\n\n\t\t\t// Make sure that the user doesn't already have an active proposal\n\t\t\trequire( ! _userHasActiveProposal[msg.sender], \"Users can only have one active proposal at a time\" );\n\t\t\t}\n...\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function proposeTokenWhitelisting( IERC20 token, string calldata tokenIconURL, string calldata description ) external nonReentrant returns (uint256 _ballotID)\n\t\t{\n\t\trequire( address(token) != address(0), \"token cannot be address(0)\" );\n\t\trequire( token.totalSupply() < type(uint112).max, \"Token supply cannot exceed uint112.max\" ); // 5 quadrillion max supply with 18 decimals of precision <--------\n\n\t\trequire( _openBallotsForTokenWhitelisting.length() < daoConfig.maxPendingTokensForWhitelisting(), \"The maximum number of token whitelisting proposals are already pending\" );\n\t\trequire( poolsConfig.numberOfWhitelistedPools() < poolsConfig.maximumWhitelistedPools(), \"Maximum number of whitelisted pools already reached\" );\n\t\trequire( ! poolsConfig.tokenHasBeenWhitelisted(token, exchangeConfig.wbtc(), exchangeConfig.weth()), \"The token has already been whitelisted\" );\n\n\t\tstring memory ballotName = string.concat(\"whitelist:\", Strings.toHexString(address(token)) );\n\n\t\tuint256 ballotID = _possiblyCreateProposal( ballotName, BallotType.WHITELIST_TOKEN, address(token), 0, tokenIconURL, description );\n\t\t_openBallotsForTokenWhitelisting.add( ballotID );\n\n\t\treturn ballotID;\n\t\t}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "11-kelp", "title": "deepkin Q", "severity_raw": "Unknown", "severity": "unknown", "description": "## LRTConfig.sol\n\n### initialize param doc typo\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTConfig.sol#L40\n\n### updateAssetStrategy() doesn't verify Strategy underlying token\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTConfig.sol#L109-L122\n\nIgnoring Strategy underlying token can lead to errors.\n\n#### Recommendation\nCheck underlying token\nhttps://github.com/Layr-Labs/eigenlayer-contracts/blob/master/src/contracts/strategies/StrategyBase.sol#L53C19-L53C34\n\n## LRTDepositPool.sol\n### There is no option to transfer back assets that have been transferred by mistake.\nIt's still useful to have such fallback in case of mistakes.\n#### Recommendation\nImplement admin access function to send assets back.\n\n### transferAssetToNodeDelegator not protected with \"whenNotPaused\"\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L183-L197 \nFrom overall context it seems that during any error it's better to freeze not only external, but also internal DAO intercommunications\n\n## NodeDelegator.sol\n\n### With current implementation maxApproveToEigenStrategyManager() can be merged with depositAssetIntoStrategy() because there are no another scenarios where approve is needed\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/NodeDelegator.sol#L38-L68\n\n\n## LRTOracle.sol\n### Pricing calculation depends on Eigenlayer shares state\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTOracle.sol#L52-L79\n```\n@audit getTotalAssetDeposits will use Eigenlayer Strategy contracts underhood\nuint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);\n```\nIf something bad may happen with Eigenlayer strategy it will have huge impact on the Oracle and Kelp contracts.\n#### Recommendation\nIt make sense to add some additional logic to mitigate the such issues(TWAP, price snapshots, etc).\n\n### No \"whenNotPaused\" usage but contract is still Pausable\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTOracle.s", "vulnerable_code": "@audit getTotalAssetDeposits will use Eigenlayer Strategy contracts underhood\nuint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/deepkin-Q.md", "collected_at": "2026-01-02T18:27:58.279241+00:00", "source_hash": "1a37c8e365a0e2f21c3a5cc79a1a98e8c7fd9d4f85e55b4783f912e4e21977e6", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 167, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "@audit getTotalAssetDeposits will use Eigenlayer Strategy contracts underhood\nuint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);", "primary_code_language": "unknown", "primary_code_char_count": 167, "all_code_blocks": "// Code block 1 (unknown):\n@audit getTotalAssetDeposits will use Eigenlayer Strategy contracts underhood\nuint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LRTConfig.sol#L40, LRTConfig.sol#L109-L122, StrategyBase.sol#L53-L19, LRTDepositPool.sol#L183-L197, NodeDelegator.sol#L38-L68, LRTOracle.sol#L52-L79", "github_files_list": "LRTOracle.sol, NodeDelegator.sol, StrategyBase.sol, LRTConfig.sol, LRTDepositPool.sol", "github_refs_count": 6, "vulnerable_code_actual": "@audit getTotalAssetDeposits will use Eigenlayer Strategy contracts underhood\nuint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "04-caviar", "title": "indijanc G", "severity_raw": "Medium", "severity": "medium", "description": "## Use unchecked{} when there's logically no way of under- or overflow\nThere's a lot of places in the contracts where an unchecked block can be used to reduce gas cost. Pretty much all the for loops can have the unchecked index increment as there's no way of under- or overflow. Testing in Remix the cost savings between `i++` and `unchecked{i++}` is 120 gas. With so many for loop iteration this can save up a considerable amount of gas. See the following diff where the unchecked block could be added and see the audit comments for the rationale. See bottom tables to review gas savings as recorded by the project test suite.\n\n#### Diff\n```diff\ndiff --git a/src/EthRouter.sol b/src/EthRouter.sol\nindex 125001d..6e99563 100644\n--- a/src/EthRouter.sol\n+++ b/src/EthRouter.sol\n@@ -103,7 +103,8 @@ contract EthRouter is ERC721TokenReceiver {\n }\n \n // loop through and execute the the buys\n- for (uint256 i = 0; i < buys.length; i++) {\n+ // @audit-info - no way of providing so many buys that this would overflow before getting out of gas error (same for inner loops)\n+ for (uint256 i = 0; i < buys.length; i = uncheckedInc(i)) {\n if (buys[i].isPublicPool) {\n // execute the buy against a public pool\n uint256 inputAmount = Pair(buys[i].pool).nftBuy{value: buys[i].baseTokenAmount}(\n@@ -113,7 +114,7 @@ contract EthRouter is ERC721TokenReceiver {\n // pay the royalties if buyer has opted-in\n if (payRoyalties) {\n uint256 salePrice = inputAmount / buys[i].tokenIds.length;\n- for (uint256 j = 0; j < buys[i].tokenIds.length; j++) {\n+ for (uint256 j = 0; j < buys[i].tokenIds.length; j = uncheckedInc(j)) {\n // get the royalty fee and recipient\n (uint256 royaltyFee, address royaltyRecipient) =\n getRoyalty(buys[i].nft, buys[i].tokenIds[j], salePrice);\n@@ -13", "vulnerable_code": "#### Gas savings as recorded by tests\nDisplaying only rows where there's a difference in gas cost.\n\nOriginal tests:\n| src/EthRouter.sol:EthRouter contract | | | | | |\n|--------------------------------------|-----------------|--------|--------|--------|---------|\n| Deployment Cost | Deployment Size | | | | |\n| 2022979 | 10289 | | | | |\n| Function Name | min | avg | median | max | # calls |\n| buy | 670 | 199750 | 187054 | 397581 | 7 |\n| change | 588 | 217295 | 284857 | 298879 | 4 |\n| deposit | 785 | 29900 | 2371 | 114072 | 4 |\n| sell | 744 | 232102 | 217300 | 402940 | 7 |\n\n| src/Factory.sol:Factory contract | | | | | |\n|----------------------------------|-----------------|--------|--------|--------|---------|\n| Deployment Cost | Deployment Size | | | | |\n| 1433451 | 7420 | | | | |\n| Function Name | min | avg | median | max | # calls |\n| create | 1641 | 148801 | 161124 | 245619 | 35 |\n\n| src/PrivatePool.sol:PrivatePool contract | | | | | |\n|------------------------------------------|-----------------|--------|--------|---------|---------|\n| Deployment Cost | Deployment Size | | | | |\n| 3248407 | 16682 | | | | |\n| Function Name | min |", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/indijanc-G.md", "collected_at": "2026-01-02T18:20:35.903233+00:00", "source_hash": "1a6568a3f717fd626c2dfc140c061961c9b2ea4775b99056d124cfe3a7a208cf", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "#### Gas savings as recorded by tests\nDisplaying only rows where there's a difference in gas cost.\n\nOriginal tests:\n| src/EthRouter.sol:EthRouter contract | | | | | |\n|--------------------------------------|-----------------|--------|--------|--------|---------|\n| Deployment Cost | Deployment Size | | | | |\n| 2022979 | 10289 | | | | |\n| Function Name | min | avg | median | max | # calls |\n| buy | 670 | 199750 | 187054 | 397581 | 7 |\n| change | 588 | 217295 | 284857 | 298879 | 4 |\n| deposit | 785 | 29900 | 2371 | 114072 | 4 |\n| sell | 744 | 232102 | 217300 | 402940 | 7 |\n\n| src/Factory.sol:Factory contract | | | | | |\n|----------------------------------|-----------------|--------|--------|--------|---------|\n| Deployment Cost | Deployment Size | | | | |\n| 1433451 | 7420 | | | | |\n| Function Name | min | avg | median | max | # calls |\n| create | 1641 | 148801 | 161124 | 245619 | 35 |\n\n| src/PrivatePool.sol:PrivatePool contract | | | | | |\n|------------------------------------------|-----------------|--------|--------|---------|---------|\n| Deployment Cost | Deployment Size | | | | |\n| 3248407 | 16682 | | | | |\n| Function Name | min |", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4} {"source": "c4", "protocol": "01-salty", "title": "report", "severity_raw": "Critical", "severity": "critical", "description": "---\nsponsor: \"Salty.IO\"\nslug: \"2024-01-salty\"\ndate: \"2024-04-19\"\ntitle: \"Salty.IO\"\nfindings: \"https://github.com/code-423n4/2024-01-salty-findings/issues\"\ncontest: 320\n---\n\n# Overview\n\n## About C4\n\nCode4rena (C4) is an open organization consisting of security researchers, auditors, developers, and individuals with domain expertise in smart contracts.\n\nA C4 audit is an event in which community participants, referred to as Wardens, review, audit, or analyze smart contract logic in exchange for a bounty provided by sponsoring projects.\n\nDuring the audit outlined in this document, C4 conducted an analysis of the Salty.IO smart contract system written in Solidity. The audit took place between January 16\u2014January 30 2024.\n\nFollowing the C4 audit, 3 wardens, [0xpiken](https://code4rena.com/@0xpiken), [t0x1c](https://code4rena.com/@t0x1c), and [zzebra83](https://code4rena.com/@zzebra83) reviewed the mitigations for all identified issues; the [mitigation review report](#mitigation-review) is appended below the audit report.\n\n## Wardens\n\n180 Wardens contributed reports to Salty.IO:\n\n 1. [0xpiken](https://code4rena.com/@0xpiken)\n 2. [t0x1c](https://code4rena.com/@t0x1c)\n 3. [handsomegiraffe](https://code4rena.com/@handsomegiraffe)\n 4. [zzebra83](https://code4rena.com/@zzebra83)\n 5. [0xRobocop](https://code4rena.com/@0xRobocop)\n 6. [Banditx0x](https://code4rena.com/@Banditx0x)\n 7. [klau5](https://code4rena.com/@klau5)\n 8. [niroh](https://code4rena.com/@niroh)\n 9. [oakcobalt](https://code4rena.com/@oakcobalt)\n 10. [Bauchibred](https://code4rena.com/@Bauchibred)\n 11. [fnanni](https://code4rena.com/@fnanni)\n 12. [peanuts](https://code4rena.com/@peanuts)\n 13. [ether\\_sky](https://code4rena.com/@ether_sky)\n 14. [0xAsen](https://code4rena.com/@0xAsen)\n 15. [grearlake](https://code4rena.com/@grearlake)\n 16. [Draiakoo](https://code4rena.com/@Draiakoo)\n 17. [Toshii](https://code4rena.com/@Toshii)\n 18. [J4X](https://code4rena.com/@J4X)\n 19. [haxatron](https://code4rena.", "vulnerable_code": "62: \tsalt.safeTransfer( address(teamVestingWallet), 10 * MILLION_ETHER );", "fixed_code": " teamVestingWallet = new VestingWallet( address(upkeep), uint64(block.timestamp), 60 * 60 * 24 * 365 * 10 );", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/report.md", "collected_at": "2026-01-02T19:01:54.835422+00:00", "source_hash": "1a679b0384df9eca9c9028ebfae8a682082f79e52d54835a02f374dab1443885", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "62: \tsalt.safeTransfer( address(teamVestingWallet), 10 * MILLION_ETHER );", "has_vulnerable_code_snippet": true, "fixed_code_actual": " teamVestingWallet = new VestingWallet( address(upkeep), uint64(block.timestamp), 60 * 60 * 24 * 365 * 10 );", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "10-badger", "title": "peanuts Q", "severity_raw": "High", "severity": "high", "description": "### [L-01] Two-step ownership is good when changing owners\n\nAuth.sol transferOwnership transfers the authority of an owner without having a two-step process. It is desirable to have a two-step process when changing the authority to prevent any mistakes. \n\n```\n function isAuthorized(address user, bytes4 functionSig) internal view virtual returns (bool) {\n Authority auth = authority; // Memoizing authority saves us a warm SLOAD, around 100 gas.\n\n // Checking if the caller is the owner only after calling the authority saves gas in most cases, but be\n // aware that this makes protected functions uncallable even to the owner if the authority is out of order.\n return\n (address(auth) != address(0) && auth.canCall(user, address(this), functionSig)) ||\n user == owner;\n }\n```\n\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/Dependencies/Auth.sol\n\n### [L-02] Check for 0 address input in constructors and important state changes\n\nCheck for 0 address input when changing addresses in important state changes as well as constructors, to prevent wrong address changes that may be irreversible, or would waste a lot of gas if redeployed.\n\n```\n constructor(address _owner, Authority _authority) {\n // Check owner is zero address\n owner = _owner;\n authority = _authority;\n\n emit OwnershipTransferred(msg.sender, _owner);\n emit AuthorityUpdated(msg.sender, _authority);\n }\n```\n\n### [L-03] closedStatus is checked twice when removing a cdp\n\n`_removeCdp()` checks that cdpStatus is not nonExistent or Active. `_removeCdp()` is internal and only called in `_closeCdp()`. `_closeCdp()` also checks that the closedStatus is not nonExistent or Active. Since `_removeCdp()` is only called through `_closeCdp()` and not anywhere else, the check should only be in `_removeCdp()` and not in `_closeCdp()`. \n\n```\n function _closeCdpWithoutRemovingSortedCdps(bytes32 _cdpId, Status cl", "vulnerable_code": " function isAuthorized(address user, bytes4 functionSig) internal view virtual returns (bool) {\n Authority auth = authority; // Memoizing authority saves us a warm SLOAD, around 100 gas.\n\n // Checking if the caller is the owner only after calling the authority saves gas in most cases, but be\n // aware that this makes protected functions uncallable even to the owner if the authority is out of order.\n return\n (address(auth) != address(0) && auth.canCall(user, address(this), functionSig)) ||\n user == owner;\n }", "fixed_code": " constructor(address _owner, Authority _authority) {\n // Check owner is zero address\n owner = _owner;\n authority = _authority;\n\n emit OwnershipTransferred(msg.sender, _owner);\n emit AuthorityUpdated(msg.sender, _authority);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/peanuts-Q.md", "collected_at": "2026-01-02T18:26:59.863405+00:00", "source_hash": "1a8400ad6e0d1d9007ca480b98270b67fb2163ba973956e328ad1628c8ac93d5", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 827, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function isAuthorized(address user, bytes4 functionSig) internal view virtual returns (bool) {\n Authority auth = authority; // Memoizing authority saves us a warm SLOAD, around 100 gas.\n\n // Checking if the caller is the owner only after calling the authority saves gas in most cases, but be\n // aware that this makes protected functions uncallable even to the owner if the authority is out of order.\n return\n (address(auth) != address(0) && auth.canCall(user, address(this), functionSig)) ||\n user == owner;\n }", "primary_code_language": "unknown", "primary_code_char_count": 564, "all_code_blocks": "// Code block 1 (unknown):\nfunction isAuthorized(address user, bytes4 functionSig) internal view virtual returns (bool) {\n Authority auth = authority; // Memoizing authority saves us a warm SLOAD, around 100 gas.\n\n // Checking if the caller is the owner only after calling the authority saves gas in most cases, but be\n // aware that this makes protected functions uncallable even to the owner if the authority is out of order.\n return\n (address(auth) != address(0) && auth.canCall(user, address(this), functionSig)) ||\n user == owner;\n }\n\n// Code block 2 (unknown):\nconstructor(address _owner, Authority _authority) {\n // Check owner is zero address\n owner = _owner;\n authority = _authority;\n\n emit OwnershipTransferred(msg.sender, _owner);\n emit AuthorityUpdated(msg.sender, _authority);\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Auth.sol", "github_files_list": "Auth.sol", "github_refs_count": 1, "vulnerable_code_actual": " function isAuthorized(address user, bytes4 functionSig) internal view virtual returns (bool) {\n Authority auth = authority; // Memoizing authority saves us a warm SLOAD, around 100 gas.\n\n // Checking if the caller is the owner only after calling the authority saves gas in most cases, but be\n // aware that this makes protected functions uncallable even to the owner if the authority is out of order.\n return\n (address(auth) != address(0) && auth.canCall(user, address(this), functionSig)) ||\n user == owner;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " constructor(address _owner, Authority _authority) {\n // Check owner is zero address\n owner = _owner;\n authority = _authority;\n\n emit OwnershipTransferred(msg.sender, _owner);\n emit AuthorityUpdated(msg.sender, _authority);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "04-caviar", "title": "Bnke0x0 G", "severity_raw": "Medium", "severity": "medium", "description": "\n### [G01] State variables only set in the constructor should be declared `immutable`\n\n#### Impact\nAvoids a Gusset (20000 gas)\n\n#### Findings:\n```\n2023-04-caviar/src/EthRouter.sol::220 => address payable privatePool,\n2023-04-caviar/src/Factory.sol::45 => address public privatePoolImplementation;\n2023-04-caviar/src/Factory.sol::48 => address public privatePoolMetadata;\n2023-04-caviar/src/Factory.sol::51 => uint16 public protocolFeeRate;\n2023-04-caviar/src/PrivatePool.sol::82 => address public baseToken;\n2023-04-caviar/src/PrivatePool.sol::85 => address public nft;\n2023-04-caviar/src/PrivatePool.sol::88 => uint56 public changeFee;\n2023-04-caviar/src/PrivatePool.sol::91 => uint16 public feeRate;\n2023-04-caviar/src/PrivatePool.sol::94 => bool public initialized;\n2023-04-caviar/src/PrivatePool.sol::97 => bool public payRoyalties;\n2023-04-caviar/src/PrivatePool.sol::100 => bool public useStolenNftOracle;\n2023-04-caviar/src/PrivatePool.sol::104 => uint128 public virtualBaseTokenReserves;\n2023-04-caviar/src/PrivatePool.sol::112 => uint128 public virtualNftReserves;\n2023-04-caviar/src/PrivatePool.sol::116 => bytes32 public merkleRoot;\n```\n\n\n\n\n### [G02] Not using the named return variables when a function returns, wastes deployment gas\n\n\n#### Findings:\n```\n2023-04-caviar/src/PrivatePoolMetadata.sol::109 => return _svg;\n```\n\n\n### [G03] It costs more gas to initialize variables to zero than to let the default of zero be applied\n\n#### Impact\nIssue Information: [G011](https://github.com/Bnke0x0/c4-common-issues/blob/main/0-Gas-Optimizations.md#g011---It-costs-more-gas-to-initialize-variables-to-zero-than-to-let-the-default-of-zero-be-applied)\n\n#### Findings:\n```\n2023-04-caviar/src/EthRouter.sol::106 => for (uint256 i = 0; i < buys.length; i++) {\n2023-04-caviar/src/EthRouter.sol::116 => for (uint256 j = 0; j < buys[i].tokenIds.length; j++) {\n2023-04-caviar/src/EthRouter.sol::134 => for (uint256 j = 0; j < buys[i].tokenIds.length; j++) {\n2023-04-caviar/src/EthRouter.sol::159 => for", "vulnerable_code": "2023-04-caviar/src/EthRouter.sol::220 => address payable privatePool,\n2023-04-caviar/src/Factory.sol::45 => address public privatePoolImplementation;\n2023-04-caviar/src/Factory.sol::48 => address public privatePoolMetadata;\n2023-04-caviar/src/Factory.sol::51 => uint16 public protocolFeeRate;\n2023-04-caviar/src/PrivatePool.sol::82 => address public baseToken;\n2023-04-caviar/src/PrivatePool.sol::85 => address public nft;\n2023-04-caviar/src/PrivatePool.sol::88 => uint56 public changeFee;\n2023-04-caviar/src/PrivatePool.sol::91 => uint16 public feeRate;\n2023-04-caviar/src/PrivatePool.sol::94 => bool public initialized;\n2023-04-caviar/src/PrivatePool.sol::97 => bool public payRoyalties;\n2023-04-caviar/src/PrivatePool.sol::100 => bool public useStolenNftOracle;\n2023-04-caviar/src/PrivatePool.sol::104 => uint128 public virtualBaseTokenReserves;\n2023-04-caviar/src/PrivatePool.sol::112 => uint128 public virtualNftReserves;\n2023-04-caviar/src/PrivatePool.sol::116 => bytes32 public merkleRoot;", "fixed_code": "2023-04-caviar/src/PrivatePoolMetadata.sol::109 => return _svg;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/Bnke0x0-G.md", "collected_at": "2026-01-02T18:19:32.594874+00:00", "source_hash": "1a8c65c67023db198b8efdbf8e1a6e53b2c2ad684248b84d381dcb873ba9b5fc", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 1059, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "2023-04-caviar/src/EthRouter.sol::220 => address payable privatePool,\n2023-04-caviar/src/Factory.sol::45 => address public privatePoolImplementation;\n2023-04-caviar/src/Factory.sol::48 => address public privatePoolMetadata;\n2023-04-caviar/src/Factory.sol::51 => uint16 public protocolFeeRate;\n2023-04-caviar/src/PrivatePool.sol::82 => address public baseToken;\n2023-04-caviar/src/PrivatePool.sol::85 => address public nft;\n2023-04-caviar/src/PrivatePool.sol::88 => uint56 public changeFee;\n2023-04-caviar/src/PrivatePool.sol::91 => uint16 public feeRate;\n2023-04-caviar/src/PrivatePool.sol::94 => bool public initialized;\n2023-04-caviar/src/PrivatePool.sol::97 => bool public payRoyalties;\n2023-04-caviar/src/PrivatePool.sol::100 => bool public useStolenNftOracle;\n2023-04-caviar/src/PrivatePool.sol::104 => uint128 public virtualBaseTokenReserves;\n2023-04-caviar/src/PrivatePool.sol::112 => uint128 public virtualNftReserves;\n2023-04-caviar/src/PrivatePool.sol::116 => bytes32 public merkleRoot;", "primary_code_language": "unknown", "primary_code_char_count": 996, "all_code_blocks": "// Code block 1 (unknown):\n2023-04-caviar/src/EthRouter.sol::220 => address payable privatePool,\n2023-04-caviar/src/Factory.sol::45 => address public privatePoolImplementation;\n2023-04-caviar/src/Factory.sol::48 => address public privatePoolMetadata;\n2023-04-caviar/src/Factory.sol::51 => uint16 public protocolFeeRate;\n2023-04-caviar/src/PrivatePool.sol::82 => address public baseToken;\n2023-04-caviar/src/PrivatePool.sol::85 => address public nft;\n2023-04-caviar/src/PrivatePool.sol::88 => uint56 public changeFee;\n2023-04-caviar/src/PrivatePool.sol::91 => uint16 public feeRate;\n2023-04-caviar/src/PrivatePool.sol::94 => bool public initialized;\n2023-04-caviar/src/PrivatePool.sol::97 => bool public payRoyalties;\n2023-04-caviar/src/PrivatePool.sol::100 => bool public useStolenNftOracle;\n2023-04-caviar/src/PrivatePool.sol::104 => uint128 public virtualBaseTokenReserves;\n2023-04-caviar/src/PrivatePool.sol::112 => uint128 public virtualNftReserves;\n2023-04-caviar/src/PrivatePool.sol::116 => bytes32 public merkleRoot;\n\n// Code block 2 (unknown):\n2023-04-caviar/src/PrivatePoolMetadata.sol::109 => return _svg;", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "2023-04-caviar/src/EthRouter.sol::220 => address payable privatePool,\n2023-04-caviar/src/Factory.sol::45 => address public privatePoolImplementation;\n2023-04-caviar/src/Factory.sol::48 => address public privatePoolMetadata;\n2023-04-caviar/src/Factory.sol::51 => uint16 public protocolFeeRate;\n2023-04-caviar/src/PrivatePool.sol::82 => address public baseToken;\n2023-04-caviar/src/PrivatePool.sol::85 => address public nft;\n2023-04-caviar/src/PrivatePool.sol::88 => uint56 public changeFee;\n2023-04-caviar/src/PrivatePool.sol::91 => uint16 public feeRate;\n2023-04-caviar/src/PrivatePool.sol::94 => bool public initialized;\n2023-04-caviar/src/PrivatePool.sol::97 => bool public payRoyalties;\n2023-04-caviar/src/PrivatePool.sol::100 => bool public useStolenNftOracle;\n2023-04-caviar/src/PrivatePool.sol::104 => uint128 public virtualBaseTokenReserves;\n2023-04-caviar/src/PrivatePool.sol::112 => uint128 public virtualNftReserves;\n2023-04-caviar/src/PrivatePool.sol::116 => bytes32 public merkleRoot;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "2023-04-caviar/src/PrivatePoolMetadata.sol::109 => return _svg;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-ondo", "title": "0xAgro Q", "severity_raw": "Medium", "severity": "medium", "description": "# QA Report\n## Finding Summary\n||Issue|Instances|\n|-|-|-|\n|[NC-01]|Long Lines (> 120 Characters)|26|\n|[NC-02]|Spelling Mistakes|8|\n|[NC-03]|`assert` Used Over `require`|2|\n|[NC-04]|Underscore Notation Not Used / Not Used Consistently|2|\n|[NC-05]|Named Imports Not Used|All Contracts|\n|[NC-06]|Contract Layout Voids Solidity Docs|13 Contracts|\n|[NC-07]|Explicit Data Types Not Used Consistently|10 Contracts|\n|[NC-08]|Contracts Missing `@title` NatSpec Tag|8 Contracts|\n|[NC-09]|Order of Functions Not Compliant With Solidity Docs|7 Contracts|\n|[NC-10]|No License Indication|2 Contracts|\n\n### [NC-01 Long Lines (> 120 Characters)\n\nLines with greater length than 120 characters are used. The [Solidity Style Guide](https://docs.soliditylang.org/en/v0.8.17/style-guide.html#maximum-line-lengthhttps://docs.soliditylang.org/en/v0.8.17/style-guide.html#maximum-line-length) suggests that all lines should be 120 characters or less in width.\n\nThe following lines are longer than 120 characters, it is suggested to shorten these lines:\n\n*contracts/lending/JumpRateModelV2.sol*\n* [57](https://github.com/code-423n4/2023-01-ondo/tree/main/contracts/lending/JumpRateModelV2.sol#L57).\n\n*contracts/lending/tokens/cCash/CCash.sol*\n* [147](https://github.com/code-423n4/2023-01-ondo/tree/main/contracts/lending/tokens/cCash/CCash.sol#L147), [191](https://github.com/code-423n4/2023-01-ondo/tree/main/contracts/lending/tokens/cCash/CCash.sol#L191), [230](https://github.com/code-423n4/2023-01-ondo/tree/main/contracts/lending/tokens/cCash/CCash.sol#L230), [234](https://github.com/code-423n4/2023-01-ondo/tree/main/contracts/lending/tokens/cCash/CCash.sol#L234). \n\n*contracts/lending/tokens/cToken/CErc20.sol*\n* [147](https://github.com/code-423n4/2023-01-ondo/tree/main/contracts/lending/tokens/cToken/CErc20.sol#L147), [191](https://github.com/code-423n4/2023-01-ondo/tree/main/contracts/lending/tokens/cToken/CErc20.sol#L191), [230](https://github.com/code-423n4/2023-01-ondo/tree/main/contracts/lending/token", "vulnerable_code": "97:\tassert(cashProxyAdmin.owner() == guardian);", "fixed_code": "106:\tassert(cashKYCSenderProxyAdmin.owner() == guardian);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/0xAgro-Q.md", "collected_at": "2026-01-02T18:14:20.721702+00:00", "source_hash": "1a8fcd366244fb2302b1c430a6dff5770e98c44767548ded8f3f13dc3230f685", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 7, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "JumpRateModelV2.sol#L57, CCash.sol#L147, CCash.sol#L191, CCash.sol#L230, CCash.sol#L234, CErc20.sol#L147, CErc20.sol#L191", "github_files_list": "JumpRateModelV2.sol, CErc20.sol, CCash.sol", "github_refs_count": 7, "vulnerable_code_actual": "97:\tassert(cashProxyAdmin.owner() == guardian);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "106:\tassert(cashKYCSenderProxyAdmin.owner() == guardian);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-biconomy", "title": "DJINN Q", "severity_raw": "Low", "severity": "low", "description": "# Solidity version out of date\n``` \npragma solidity 0.8.12;\n```\n## Affected files\n- All files in scope\n\n## Synopsis\nUsing an out-of-date Solidity compiler can introduce vulnerabilities and bugs into your smart contracts for a few reasons:\n\n- Outdated compilers may not support the latest features or optimizations, which can result in contracts that are less efficient or less secure.\n- Outdated compilers may not fix known bugs or vulnerabilities in the compiler itself, which could allow an attacker to exploit these issues to compromise your contract. \n- Newer versions of Solidity may introduce breaking changes that can cause existing contracts compiled with an older version to behave in unexpected ways. This can lead to vulnerabilities if the contract relies on certain assumptions that are no longer valid in the newer version of Solidity.\n\n## Details\nSome bugs present in version 0.8.12:\n- SOL-2022-6\n- SOL-2022-5\n- SOL-2022-2\n- SOL-2022-1\n\n*you can find a more complete list of all the known vulnerabilities [here](https://docs.soliditylang.org/en/v0.8.17/bugs.html)*\n## Recommendation\nIt is generally a good idea to use the latest version of Solidity when writing or deploying contracts, as this will ensure that you have access to the latest features and optimizations and that you are not using a version of the compiler that is known to have vulnerabilities.\n\n", "vulnerable_code": "pragma solidity 0.8.12;", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/DJINN-Q.md", "collected_at": "2026-01-02T18:13:01.310061+00:00", "source_hash": "1aa68039996fdee40e82cd38de72d33be30af98eae023354cd367b60087fc521", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "pragma solidity 0.8.12;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 3.75} {"source": "c4", "protocol": "01-biconomy", "title": "tnevler G", "severity_raw": "Low", "severity": "low", "description": "# Report\n## Gas Optimizations ##\n### [G-1]: The increment in for loop post condition can be made unchecked\n**Context:**\n\n1. ```for (uint256 i = 0; i < opasLen; i++) {``` [L100](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L100) \n1. ```for (uint256 a = 0; a < opasLen; a++) {``` [L107](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L107) \n1. ```for (uint256 i = 0; i < opslen; i++) {``` [L112](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L112) \n1. ```for (uint256 a = 0; a < opasLen; a++) {``` [L128](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L128) \n1. ```for (uint256 i = 0; i < opslen; i++) {``` [L134](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L134) \n\n**Description:**\n\n[This](https://gist.github.com/hrkrshnn/ee8fabd532058307229d65dcd5836ddc#the-increment-in-for-loop-post-condition-can-be-made-unchecked) can save 30-40 gas per loop iteration.\n\n**Recommendation:**\n\nExample how to fix. Change:\n```\nfor (uint256 i = 0; i < orders.length; ++i) {\n // Do the thing\n}\n```\n\nTo:\n```\nfor (uint256 i = 0; i < orders.length;) {\n // Do the thing\n unchecked { ++i; }\n}\n```\n\n### [G-2]: Place subtractions where the operands can't underflow in unchecked {} block\n**Context:**\n\n```paymasterIdBalances[msg.sender] -= amount;``` [L58](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol#L58) \n\n**Description:**\n\nSome gas can be saved by using an unchecked {} block if an underflow isn't possible because of a previous require() or if-statement.\n\n### [G-3]: ", "vulnerable_code": "for (uint256 i = 0; i < orders.length; ++i) {\n // Do the thing\n}", "fixed_code": "for (uint256 i = 0; i < orders.length;) {\n // Do the thing\n unchecked { ++i; }\n}", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/tnevler-G.md", "collected_at": "2026-01-02T18:14:13.228263+00:00", "source_hash": "1b236c224e914245a05eda59ca130b23446df7fdb19ea67f8b6f1d9ac049649d", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 150, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "for (uint256 i = 0; i < orders.length; ++i) {\n // Do the thing\n}", "primary_code_language": "unknown", "primary_code_char_count": 66, "all_code_blocks": "// Code block 1 (unknown):\nfor (uint256 i = 0; i < orders.length; ++i) {\n // Do the thing\n}\n\n// Code block 2 (unknown):\nfor (uint256 i = 0; i < orders.length;) {\n // Do the thing\n unchecked { ++i; }\n}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "EntryPoint.sol#L100, EntryPoint.sol#L107, EntryPoint.sol#L112, EntryPoint.sol#L128, EntryPoint.sol#L134, VerifyingSingletonPaymaster.sol#L58", "github_files_list": "VerifyingSingletonPaymaster.sol, EntryPoint.sol", "github_refs_count": 6, "vulnerable_code_actual": "for (uint256 i = 0; i < orders.length; ++i) {\n // Do the thing\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "for (uint256 i = 0; i < orders.length;) {\n // Do the thing\n unchecked { ++i; }\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-ondo", "title": "horsefacts Q", "severity_raw": "Critical", "severity": "critical", "description": "# Low\n\n## `CashKYCSender`: KYC check may lead to unrecoverable assets\n\nThe `CashKYCSender` token applies a KYC check to the caller and `from` address in its [`_beforeTokenTransfer`](https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/cash/token/CashKYCSender.sol#L56-L75) function, but not to the `to` address:\n\n```solidity\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal override {\n super._beforeTokenTransfer(from, to, amount);\n\n require(\n _getKYCStatus(_msgSender()),\n \"CashKYCSender: must be KYC'd to initiate transfer\"\n );\n\n if (from != address(0)) {\n // Only check KYC if not minting\n require(\n _getKYCStatus(from),\n \"CashKYCSender: `from` address must be KYC'd to send tokens\"\n );\n }\n }\n```\n\nThis means it's possible for a KYC'd owner of a `CashKYCSender` token to lose access to their assets by transferring them to a contract address that does not represent a human and cannot KYC, like a smart wallet, vault contract, or noncustodial DeFi protocol. Once tokens are transferred in, the smart contract will be blocked from initiating token transfers out. The composability of ERC20 tokens and protocols that interact with them makes it especially easy for users to make this mistake.\n\nRecommendation: Since KYC checks break composability with other protocols, prevent all transfers to non-KYC'd addresses (i.e., use `CashKYCSenderReceiver` for all tokens).\n\n\n## `OndoPriceOracleV2`: Oracle cannot support tokens with more than 28 decimals\n\n`OndoPriceOracleV2` calculates a `scaleFactor` by subtracting the collateral token's `decimals()` and the configured Chainlink price feed's `decimals()` from 36. Since Chainlink USD price feeds use 8 decimals, this calculation will revert with a checked arithmetic error if a collateral token has more than 28 decimals:\n\n[`OndoPriceOracleV2`](https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b", "vulnerable_code": " function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal override {\n super._beforeTokenTransfer(from, to, amount);\n\n require(\n _getKYCStatus(_msgSender()),\n \"CashKYCSender: must be KYC'd to initiate transfer\"\n );\n\n if (from != address(0)) {\n // Only check KYC if not minting\n require(\n _getKYCStatus(from),\n \"CashKYCSender: `from` address must be KYC'd to send tokens\"\n );\n }\n }", "fixed_code": " fTokenToChainlinkOracle[fToken].scaleFactor = (10 **\n (36 -\n uint256(IERC20Like(underlying).decimals()) -\n uint256(AggregatorV3Interface(chainlinkOracle).decimals())));", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/horsefacts-Q.md", "collected_at": "2026-01-02T18:15:14.300988+00:00", "source_hash": "1b259eb3e6dfb38acb15e006ed5c172bf48c0ce5fa86d003948395374da6727e", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 473, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal override {\n super._beforeTokenTransfer(from, to, amount);\n\n require(\n _getKYCStatus(_msgSender()),\n \"CashKYCSender: must be KYC'd to initiate transfer\"\n );\n\n if (from != address(0)) {\n // Only check KYC if not minting\n require(\n _getKYCStatus(from),\n \"CashKYCSender: `from` address must be KYC'd to send tokens\"\n );\n }\n }", "primary_code_language": "solidity", "primary_code_char_count": 473, "all_code_blocks": "// Code block 1 (solidity):\nfunction _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal override {\n super._beforeTokenTransfer(from, to, amount);\n\n require(\n _getKYCStatus(_msgSender()),\n \"CashKYCSender: must be KYC'd to initiate transfer\"\n );\n\n if (from != address(0)) {\n // Only check KYC if not minting\n require(\n _getKYCStatus(from),\n \"CashKYCSender: `from` address must be KYC'd to send tokens\"\n );\n }\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal override {\n super._beforeTokenTransfer(from, to, amount);\n\n require(\n _getKYCStatus(_msgSender()),\n \"CashKYCSender: must be KYC'd to initiate transfer\"\n );\n\n if (from != address(0)) {\n // Only check KYC if not minting\n require(\n _getKYCStatus(from),\n \"CashKYCSender: `from` address must be KYC'd to send tokens\"\n );\n }\n }", "github_refs_formatted": "CashKYCSender.sol#L56-L75", "github_files_list": "CashKYCSender.sol", "github_refs_count": 1, "vulnerable_code_actual": " function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal override {\n super._beforeTokenTransfer(from, to, amount);\n\n require(\n _getKYCStatus(_msgSender()),\n \"CashKYCSender: must be KYC'd to initiate transfer\"\n );\n\n if (from != address(0)) {\n // Only check KYC if not minting\n require(\n _getKYCStatus(from),\n \"CashKYCSender: `from` address must be KYC'd to send tokens\"\n );\n }\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " fTokenToChainlinkOracle[fToken].scaleFactor = (10 **\n (36 -\n uint256(IERC20Like(underlying).decimals()) -\n uint256(AggregatorV3Interface(chainlinkOracle).decimals())));", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "07-amphora", "title": "eeshenggoh G", "severity_raw": "High", "severity": "high", "description": "## Summary\n\nThese are the findings for Gas Optimization. Will start from this hierarchy: \n1) [contracts/core]\n2) [contracts/governance]\n3) [contracts/periphery]\n4) [contracts/utils]\n\n## Vulnerability Details\n### [G002] Cache Array Length Outside of Loop\n```\nFile: USDA.sol\n\n47: modifier paysInterest() {\n48: for (uint256 _i; _i < _vaultControllers.length();) {\n49: IVaultController(_vaultControllers.at(_i)).calculateInterest();\n50: unchecked {\n51: _i++;\n52: }\n53: }\n54: _;\n55: }\n\n```\n```\nFile: Vault.sol\n169: for (uint256 _i; _i < _tokenAddresses.length;) {\n170: IVaultController.CollateralInfo memory _collateralInfo = CONTROLLER.tokenCollateralInfo(_tokenAddresses[_i]);\n171: if (_collateralInfo.tokenId == 0) revert Vault_TokenNotRegistered();\n172: if (_collateralInfo.collateralType != IVaultController.CollateralType.CurveLPStakedOnConvex) {\n173: revert Vault_TokenNotCurveLP();\n174: }\n\n```\n```\nFile: Vault.sol\n169: for (uint256 _i; _i < _tokenAddresses.length;) {\n170: IVaultController.CollateralInfo memory _collateralInfo = CONTROLLER.tokenCollateralInfo(_tokenAddresses[_i]);\n171: if (_collateralInfo.tokenId == 0) revert Vault_TokenNotRegistered();\n172: if (_collateralInfo.collateralType != IVaultController.CollateralType.CurveLPStakedOnConvex) {\n173: revert Vault_TokenNotCurveLP();\n174: }\n```\n```\nFile: VaultController.sol\n255: for (uint256 _i; _i < _tokenAddresses.length;) {\n256: _tokenId = _oldVaultController.tokenId(_tokenAddresses[_i]);\n257: if (_tokenId == 0) revert VaultController_WrongCollateralAddress();\n258: _tokensRegistered++;\n```\n```\nFile: VaultController.sol\n868: for (uint192 _i; _i < enabledTokens.length; ++_i) {\n869: CollateralInfo memory _collateral = tokenAddressCollateralInfo[enabledTokens[_i]];\n```\n```\nFile: VaultController.sol\n896: for (uint192 _i; _i < enabledTokens.length; ++_i) {\n897: CollateralIn", "vulnerable_code": "File: USDA.sol\n\n47: modifier paysInterest() {\n48: for (uint256 _i; _i < _vaultControllers.length();) {\n49: IVaultController(_vaultControllers.at(_i)).calculateInterest();\n50: unchecked {\n51: _i++;\n52: }\n53: }\n54: _;\n55: }\n", "fixed_code": "File: Vault.sol\n169: for (uint256 _i; _i < _tokenAddresses.length;) {\n170: IVaultController.CollateralInfo memory _collateralInfo = CONTROLLER.tokenCollateralInfo(_tokenAddresses[_i]);\n171: if (_collateralInfo.tokenId == 0) revert Vault_TokenNotRegistered();\n172: if (_collateralInfo.collateralType != IVaultController.CollateralType.CurveLPStakedOnConvex) {\n173: revert Vault_TokenNotCurveLP();\n174: }\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/eeshenggoh-G.md", "collected_at": "2026-01-02T18:23:43.930680+00:00", "source_hash": "1b427a36921473f9cb6a5275073bed4a527f5979af75603384d4e6751b8ee3ce", "code_block_count": 5, "solidity_block_count": 0, "total_code_chars": 1585, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: USDA.sol\n\n47: modifier paysInterest() {\n48: for (uint256 _i; _i < _vaultControllers.length();) {\n49: IVaultController(_vaultControllers.at(_i)).calculateInterest();\n50: unchecked {\n51: _i++;\n52: }\n53: }\n54: _;\n55: }", "primary_code_language": "unknown", "primary_code_char_count": 263, "all_code_blocks": "// Code block 1 (unknown):\nFile: USDA.sol\n\n47: modifier paysInterest() {\n48: for (uint256 _i; _i < _vaultControllers.length();) {\n49: IVaultController(_vaultControllers.at(_i)).calculateInterest();\n50: unchecked {\n51: _i++;\n52: }\n53: }\n54: _;\n55: }\n\n// Code block 2 (unknown):\nFile: Vault.sol\n169: for (uint256 _i; _i < _tokenAddresses.length;) {\n170: IVaultController.CollateralInfo memory _collateralInfo = CONTROLLER.tokenCollateralInfo(_tokenAddresses[_i]);\n171: if (_collateralInfo.tokenId == 0) revert Vault_TokenNotRegistered();\n172: if (_collateralInfo.collateralType != IVaultController.CollateralType.CurveLPStakedOnConvex) {\n173: revert Vault_TokenNotCurveLP();\n174: }\n\n// Code block 3 (unknown):\nFile: Vault.sol\n169: for (uint256 _i; _i < _tokenAddresses.length;) {\n170: IVaultController.CollateralInfo memory _collateralInfo = CONTROLLER.tokenCollateralInfo(_tokenAddresses[_i]);\n171: if (_collateralInfo.tokenId == 0) revert Vault_TokenNotRegistered();\n172: if (_collateralInfo.collateralType != IVaultController.CollateralType.CurveLPStakedOnConvex) {\n173: revert Vault_TokenNotCurveLP();\n174: }\n\n// Code block 4 (unknown):\nFile: VaultController.sol\n255: for (uint256 _i; _i < _tokenAddresses.length;) {\n256: _tokenId = _oldVaultController.tokenId(_tokenAddresses[_i]);\n257: if (_tokenId == 0) revert VaultController_WrongCollateralAddress();\n258: _tokensRegistered++;\n\n// Code block 5 (unknown):\nFile: VaultController.sol\n868: for (uint192 _i; _i < enabledTokens.length; ++_i) {\n869: CollateralInfo memory _collateral = tokenAddressCollateralInfo[enabledTokens[_i]];", "all_code_blocks_count": 5, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: USDA.sol\n\n47: modifier paysInterest() {\n48: for (uint256 _i; _i < _vaultControllers.length();) {\n49: IVaultController(_vaultControllers.at(_i)).calculateInterest();\n50: unchecked {\n51: _i++;\n52: }\n53: }\n54: _;\n55: }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: Vault.sol\n169: for (uint256 _i; _i < _tokenAddresses.length;) {\n170: IVaultController.CollateralInfo memory _collateralInfo = CONTROLLER.tokenCollateralInfo(_tokenAddresses[_i]);\n171: if (_collateralInfo.tokenId == 0) revert Vault_TokenNotRegistered();\n172: if (_collateralInfo.collateralType != IVaultController.CollateralType.CurveLPStakedOnConvex) {\n173: revert Vault_TokenNotCurveLP();\n174: }\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "02-ai-arena", "title": "McToady Q", "severity_raw": "Medium", "severity": "medium", "description": "## [I-01] Precision loss in RankedBattle NRN distribution\nActual $NRN claimable after a round in `RankedBattle` will likely be less than `rankedNrnDistribution` due to rounding errors.\n\n**PoC**\nLog showing this: \n```solidity\n Alice NRN 1206896551724137931034\n Bob NRN 1724137931034482758620\n Chad NRN 2068965517241379310344\n Dave NRN 0\n Error: a == b not satisfied [uint]\n Left: 4999999999999999999998\n Right: 5000000000000000000000\n```\nAdd the following foundry test to `RankedBattle.t.sol` to recreate this:\n```solidity\n function testClaimNRNNoPrecisionLoss() public {\n address alice = makeAddr(\"alice\");\n address bob = makeAddr(\"bob\");\n address chad = makeAddr(\"chad\");\n address dave = makeAddr(\"dave\");\n \n address[] memory users = new address[](4);\n users[0] = alice;\n users[1] = bob;\n users[2] = chad;\n users[3] = dave;\n \n // Set up all 4 users with a fighter, and have them stake 4k $NRN\n for (uint256 i; i < users.length; ++i) {\n address user = users[i];\n _mintFromMergingPool(user);\n _fundUserWith4kNeuronByTreasury(user);\n _fundUserWith4kNeuronByTreasury(user);\n uint256 stakeAmount = (i + 1) * 200 ether;\n vm.prank(user);\n _rankedBattleContract.stakeNRN(stakeAmount, i);\n }\n\n // Alice beats bob\n _rankedBattleContract.updateBattleRecord(0, 50, 0, 1500, false);\n _rankedBattleContract.updateBattleRecord(1, 50, 2, 1500, true);\n // Chad beats dave\n _rankedBattleContract.updateBattleRecord(2, 50, 0, 1500, false);\n _rankedBattleContract.updateBattleRecord(3, 50, 2, 1500, true);\n // Bob beats dave twice\n _rankedBattleContract.updateBattleRecord(1, 50, 0, 1500, false);\n _rankedBattleContract.updateBattleRecord(3, 50, 2, 1500, true);\n _rankedBattleContract.updateBattleRecord(1, 50, 0, 1500, false);\n _rankedBattleCont", "vulnerable_code": " Alice NRN 1206896551724137931034\n Bob NRN 1724137931034482758620\n Chad NRN 2068965517241379310344\n Dave NRN 0\n Error: a == b not satisfied [uint]\n Left: 4999999999999999999998\n Right: 5000000000000000000000", "fixed_code": " function testClaimNRNNoPrecisionLoss() public {\n address alice = makeAddr(\"alice\");\n address bob = makeAddr(\"bob\");\n address chad = makeAddr(\"chad\");\n address dave = makeAddr(\"dave\");\n \n address[] memory users = new address[](4);\n users[0] = alice;\n users[1] = bob;\n users[2] = chad;\n users[3] = dave;\n \n // Set up all 4 users with a fighter, and have them stake 4k $NRN\n for (uint256 i; i < users.length; ++i) {\n address user = users[i];\n _mintFromMergingPool(user);\n _fundUserWith4kNeuronByTreasury(user);\n _fundUserWith4kNeuronByTreasury(user);\n uint256 stakeAmount = (i + 1) * 200 ether;\n vm.prank(user);\n _rankedBattleContract.stakeNRN(stakeAmount, i);\n }\n\n // Alice beats bob\n _rankedBattleContract.updateBattleRecord(0, 50, 0, 1500, false);\n _rankedBattleContract.updateBattleRecord(1, 50, 2, 1500, true);\n // Chad beats dave\n _rankedBattleContract.updateBattleRecord(2, 50, 0, 1500, false);\n _rankedBattleContract.updateBattleRecord(3, 50, 2, 1500, true);\n // Bob beats dave twice\n _rankedBattleContract.updateBattleRecord(1, 50, 0, 1500, false);\n _rankedBattleContract.updateBattleRecord(3, 50, 2, 1500, true);\n _rankedBattleContract.updateBattleRecord(1, 50, 0, 1500, false);\n _rankedBattleContract.updateBattleRecord(3, 50, 2, 1500, true);\n\n for (uint256 i; i < users.length; ++i) {\n uint256 userPoints = _rankedBattleContract.accumulatedPointsPerAddress(users[i], 0);\n console.log(\"User Points\", userPoints);\n }\n vm.stopPrank();\n\n _rankedBattleContract.setNewRound();\n\n uint256 aliceNRN = _rankedBattleContract.getUnclaimedNRN(alice);\n uint256 bobNRN = _rankedBattleContract.getUnclaimedNRN(bob);\n uint256 chadNRN = _rankedBattleContract.getUnclaimedNRN(chad);\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/McToady-Q.md", "collected_at": "2026-01-02T19:02:34.945502+00:00", "source_hash": "1b570e7d677e2c08be0b6db2b23749c580a70a978a47100c24c6a86373371500", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 223, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "Alice NRN 1206896551724137931034\n Bob NRN 1724137931034482758620\n Chad NRN 2068965517241379310344\n Dave NRN 0\n Error: a == b not satisfied [uint]\n Left: 4999999999999999999998\n Right: 5000000000000000000000", "primary_code_language": "solidity", "primary_code_char_count": 223, "all_code_blocks": "// Code block 1 (solidity):\nAlice NRN 1206896551724137931034\n Bob NRN 1724137931034482758620\n Chad NRN 2068965517241379310344\n Dave NRN 0\n Error: a == b not satisfied [uint]\n Left: 4999999999999999999998\n Right: 5000000000000000000000", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "Alice NRN 1206896551724137931034\n Bob NRN 1724137931034482758620\n Chad NRN 2068965517241379310344\n Dave NRN 0\n Error: a == b not satisfied [uint]\n Left: 4999999999999999999998\n Right: 5000000000000000000000", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " Alice NRN 1206896551724137931034\n Bob NRN 1724137931034482758620\n Chad NRN 2068965517241379310344\n Dave NRN 0\n Error: a == b not satisfied [uint]\n Left: 4999999999999999999998\n Right: 5000000000000000000000", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function testClaimNRNNoPrecisionLoss() public {\n address alice = makeAddr(\"alice\");\n address bob = makeAddr(\"bob\");\n address chad = makeAddr(\"chad\");\n address dave = makeAddr(\"dave\");\n \n address[] memory users = new address[](4);\n users[0] = alice;\n users[1] = bob;\n users[2] = chad;\n users[3] = dave;\n \n // Set up all 4 users with a fighter, and have them stake 4k $NRN\n for (uint256 i; i < users.length; ++i) {\n address user = users[i];\n _mintFromMergingPool(user);\n _fundUserWith4kNeuronByTreasury(user);\n _fundUserWith4kNeuronByTreasury(user);\n uint256 stakeAmount = (i + 1) * 200 ether;\n vm.prank(user);\n _rankedBattleContract.stakeNRN(stakeAmount, i);\n }\n\n // Alice beats bob\n _rankedBattleContract.updateBattleRecord(0, 50, 0, 1500, false);\n _rankedBattleContract.updateBattleRecord(1, 50, 2, 1500, true);\n // Chad beats dave\n _rankedBattleContract.updateBattleRecord(2, 50, 0, 1500, false);\n _rankedBattleContract.updateBattleRecord(3, 50, 2, 1500, true);\n // Bob beats dave twice\n _rankedBattleContract.updateBattleRecord(1, 50, 0, 1500, false);\n _rankedBattleContract.updateBattleRecord(3, 50, 2, 1500, true);\n _rankedBattleContract.updateBattleRecord(1, 50, 0, 1500, false);\n _rankedBattleContract.updateBattleRecord(3, 50, 2, 1500, true);\n\n for (uint256 i; i < users.length; ++i) {\n uint256 userPoints = _rankedBattleContract.accumulatedPointsPerAddress(users[i], 0);\n console.log(\"User Points\", userPoints);\n }\n vm.stopPrank();\n\n _rankedBattleContract.setNewRound();\n\n uint256 aliceNRN = _rankedBattleContract.getUnclaimedNRN(alice);\n uint256 bobNRN = _rankedBattleContract.getUnclaimedNRN(bob);\n uint256 chadNRN = _rankedBattleContract.getUnclaimedNRN(chad);\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-biconomy", "title": "Bnke0x0 G", "severity_raw": "High", "severity": "high", "description": "\n\n### [G01] State variables only set in the constructor should be declared `immutable`\n\n#### Impact\nAvoids a Gusset (20000 gas)\n#### Findings:\n```\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccount.sol::51 => address public owner;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccount.sol::59 => IEntryPoint private _entryPoint;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::51 => address public owner;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::59 => IEntryPoint private _entryPoint;\n```\n\n\n\n### [G02] State variables can be packed into fewer storage slots\n\n#### Impact\nIf variables occupying the same slot are both written the same \nfunction or by the constructor avoids a separate Gsset (20000 gas). \n#### Findings:\n```\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccount.sol::51 => address public owner;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::51 => address public owner;\n```\n\n\n\n### [G03] `.length` should not be looked up in every loop of a `for` loop\n\n#### Impact\nEven memory arrays incur the overhead of bit tests and bit shifts to \ncalculate the array length. Storage array length checks incur an extra \nGwarmaccess (100 gas) PER-LOOP.\n#### Findings:\n```\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccount.sol::468 => for (uint i = 0; i < dest.length;) {\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::458 => for (uint i = 0; i < dest.length;) {\n```\n\n\n\n### [G04] `++i/i++` should be `unchecked{++i}`/`unchecked{++i}` when it is not possible for them to overflow, as is the case when used in `for` and `while` loops\n\n\n#### Findings:\n```\n2023-01-biconomy-main/contracts/smart-contract-wallet/libs/Strings.sol::56 => for (uint256 i = 2 * length + 1; i > 1; --i) {\n```\n\n\n\n### [G05] `require()`/`revert()` strings longer than 32 bytes cost extra gas\n\n\n#### Findings:\n```\n2023-01-biconomy-main/co", "vulnerable_code": "2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccount.sol::51 => address public owner;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccount.sol::59 => IEntryPoint private _entryPoint;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::51 => address public owner;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::59 => IEntryPoint private _entryPoint;", "fixed_code": "2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccount.sol::51 => address public owner;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::51 => address public owner;", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/Bnke0x0-G.md", "collected_at": "2026-01-02T18:12:58.562037+00:00", "source_hash": "1b75b41cb9667a4e5c9b1f1629c3efc1c985878df26d18767c5930d4a6cf67bf", "code_block_count": 4, "solidity_block_count": 0, "total_code_chars": 999, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccount.sol::51 => address public owner;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccount.sol::59 => IEntryPoint private _entryPoint;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::51 => address public owner;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::59 => IEntryPoint private _entryPoint;", "primary_code_language": "unknown", "primary_code_char_count": 433, "all_code_blocks": "// Code block 1 (unknown):\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccount.sol::51 => address public owner;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccount.sol::59 => IEntryPoint private _entryPoint;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::51 => address public owner;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::59 => IEntryPoint private _entryPoint;\n\n// Code block 2 (unknown):\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccount.sol::51 => address public owner;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::51 => address public owner;\n\n// Code block 3 (unknown):\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccount.sol::468 => for (uint i = 0; i < dest.length;) {\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::458 => for (uint i = 0; i < dest.length;) {\n\n// Code block 4 (unknown):\n2023-01-biconomy-main/contracts/smart-contract-wallet/libs/Strings.sol::56 => for (uint256 i = 2 * length + 1; i > 1; --i) {", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccount.sol::51 => address public owner;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccount.sol::59 => IEntryPoint private _entryPoint;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::51 => address public owner;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::59 => IEntryPoint private _entryPoint;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccount.sol::51 => address public owner;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::51 => address public owner;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "08-dopex", "title": "BRONZEDISC Q", "severity_raw": "Medium", "severity": "medium", "description": "# Low\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/perp-vault/PerpetualAtlanticVault.sol#L219-L230\n\n```solidity\n- does not check for 0 address in the `tokens` array\n- does check for repeated addresses\n```\n\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/decaying-bonds/RdpxDecayingBonds.sol#L89-L107\n\n```solidity\n- does not check for 0 address in the `tokens` array\n- does check for repeated addresses\n```\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L161-L173\n\n```solidity\n- does not check for 0 address in the `tokens` array\n- does check for repeated addresses\n```\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/amo/UniV2LiquidityAmo.sol#L142-L153\n\n```solidity\n- does not check for 0 address in the `tokens` array\n- does check for repeated addresses\n```\n\n\n# QA\n---\n\n### Layout Order [1]\n\n- The best-practices for layout within a contract is the following order: state variables, events, modifiers, constructor and functions.\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/reLP/ReLPContract.sol\n\n```solidity\n// place this event before the constructor\n311: event LogSetReLpFactor(uint256 _reLPFactor);\n```\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/perp-vault/PerpetualAtlanticVaultLP.sol\n\n```solidity\n// place this modifier before the constructor\n295: modifier onlyPerpVault() {\n```\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/amo/UniV3LiquidityAmo.sol\n\n```solidity\n// place these before the constructor\n368: event RecoveredERC20(address token, uint256 amount);\n369: event RecoveredERC721(address token, uint256 id);\n370: event LogAssetsTransfered(\n379: event log(uint);\n```\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/amo/UniV2LiquidityAmo.sol\n\n```solidity\n// place these before the constructor\n387: event LogAddLiquidity(\n398: event LogRemoveLiquidity(\n407: event LogSwap(\n415: event LogAssetsTransfered(\n421: ", "vulnerable_code": "- does not check for 0 address in the `tokens` array\n- does check for repeated addresses", "fixed_code": "- does not check for 0 address in the `tokens` array\n- does check for repeated addresses", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/BRONZEDISC-Q.md", "collected_at": "2026-01-02T18:24:30.825283+00:00", "source_hash": "1bb54f4a0a93af013f22b774335519625999fc9db39ff8460ffa7b6a139470bc", "code_block_count": 7, "solidity_block_count": 7, "total_code_chars": 731, "github_ref_count": 8, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "- does not check for 0 address in the `tokens` array\n- does check for repeated addresses", "primary_code_language": "solidity", "primary_code_char_count": 88, "all_code_blocks": "// Code block 1 (solidity):\n- does not check for 0 address in the `tokens` array\n- does check for repeated addresses\n\n// Code block 2 (solidity):\n- does not check for 0 address in the `tokens` array\n- does check for repeated addresses\n\n// Code block 3 (solidity):\n- does not check for 0 address in the `tokens` array\n- does check for repeated addresses\n\n// Code block 4 (solidity):\n- does not check for 0 address in the `tokens` array\n- does check for repeated addresses\n\n// Code block 5 (solidity):\n// place this event before the constructor\n311: event LogSetReLpFactor(uint256 _reLPFactor);\n\n// Code block 6 (solidity):\n// place this modifier before the constructor\n295: modifier onlyPerpVault() {\n\n// Code block 7 (solidity):\n// place these before the constructor\n368: event RecoveredERC20(address token, uint256 amount);\n369: event RecoveredERC721(address token, uint256 id);\n370: event LogAssetsTransfered(\n379: event log(uint);", "all_code_blocks_count": 7, "has_diff_blocks": false, "diff_code": "", "solidity_code": "- does not check for 0 address in the `tokens` array\n- does check for repeated addresses\n\n- does not check for 0 address in the `tokens` array\n- does check for repeated addresses\n\n- does not check for 0 address in the `tokens` array\n- does check for repeated addresses\n\n- does not check for 0 address in the `tokens` array\n- does check for repeated addresses\n\n// place this event before the constructor\n311: event LogSetReLpFactor(uint256 _reLPFactor);\n\n// place this modifier before the constructor\n295: modifier onlyPerpVault() {\n\n// place these before the constructor\n368: event RecoveredERC20(address token, uint256 amount);\n369: event RecoveredERC721(address token, uint256 id);\n370: event LogAssetsTransfered(\n379: event log(uint);", "github_refs_formatted": "PerpetualAtlanticVault.sol#L219-L230, RdpxDecayingBonds.sol#L89-L107, RdpxV2Core.sol#L161-L173, UniV2LiquidityAmo.sol#L142-L153, ReLPContract.sol, PerpetualAtlanticVaultLP.sol, UniV3LiquidityAmo.sol, UniV2LiquidityAmo.sol", "github_files_list": "RdpxDecayingBonds.sol, PerpetualAtlanticVault.sol, RdpxV2Core.sol, UniV3LiquidityAmo.sol, ReLPContract.sol, UniV2LiquidityAmo.sol, PerpetualAtlanticVaultLP.sol", "github_refs_count": 8, "vulnerable_code_actual": "- does not check for 0 address in the `tokens` array\n- does check for repeated addresses", "has_vulnerable_code_snippet": true, "fixed_code_actual": "- does not check for 0 address in the `tokens` array\n- does check for repeated addresses", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 13} {"source": "c4", "protocol": "02-ethos", "title": "Josiah Q", "severity_raw": "High", "severity": "high", "description": "## MODERN MODULARITY ON IMPORT USAGES\nFor cleaner Solidity code in conjunction with the rule of modularity and modular programming, it is recommended using named imports with curly braces (limiting to the needed instances if possible) instead of adopting the global import approach.\n\nSuggested fix for a contract instance as an example:\n\n[ReaperVaultERC4626.sol#L5-L6](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultERC4626.sol#L5-L6)\n\n```\nimport {ReaperVaultV2} from \"./ReaperVaultV2.sol\";\nimport {IERC4626Functions} from \"./interfaces/IERC4626Functions.sol\";\n```\n\n## CODE SIMPLIFICATION\nUnused or unneeded code lines can be removed from the function code block for better readability and logic flow. For example, no fee will be minted to LQTYStaking.sol when the system is in recovery mode. [`_requireValidMaxFeePercentage(_maxFeePercentage, isRecoveryMode)`](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L648-L656) in BorrowerOperations.sol should therefore have its `isRecoveryMode` parameter and associated code lines removed just like it has been adopted in RedemptionHelper.sol.\n\nSuggested fix:\n\n```\n function _requireValidMaxFeePercentage(uint _maxFeePercentage) internal pure {\n require(_maxFeePercentage >= BORROWING_FEE_FLOOR && _maxFeePercentage <= DECIMAL_PRECISION,\n \"Max fee percentage must be between 0.5% and 100%\");\n }\n```\n\nWith the above fix implemented, the functions, [`openTrove()`](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L648-L656) and [`_adjustTrove()`](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L293) calling it internally should also be refactored to:\n\n```\n _requireValidMaxFeePercentage(_maxFeePercentage);\n```\n\n## BASERATE REMAINS ZERO UNTIL IT GETS INITIALIZED\nThe default value of `baseRate` remains `0` in TroveManager.sol", "vulnerable_code": "import {ReaperVaultV2} from \"./ReaperVaultV2.sol\";\nimport {IERC4626Functions} from \"./interfaces/IERC4626Functions.sol\";", "fixed_code": " function _requireValidMaxFeePercentage(uint _maxFeePercentage) internal pure {\n require(_maxFeePercentage >= BORROWING_FEE_FLOOR && _maxFeePercentage <= DECIMAL_PRECISION,\n \"Max fee percentage must be between 0.5% and 100%\");\n }", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/Josiah-Q.md", "collected_at": "2026-01-02T18:16:16.180520+00:00", "source_hash": "1bc3fae0b643a5d173b336fc48db084a8daf436d1178cdfab1e1ea756d02488a", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 426, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "import {ReaperVaultV2} from \"./ReaperVaultV2.sol\";\nimport {IERC4626Functions} from \"./interfaces/IERC4626Functions.sol\";", "primary_code_language": "unknown", "primary_code_char_count": 120, "all_code_blocks": "// Code block 1 (unknown):\nimport {ReaperVaultV2} from \"./ReaperVaultV2.sol\";\nimport {IERC4626Functions} from \"./interfaces/IERC4626Functions.sol\";\n\n// Code block 2 (unknown):\nfunction _requireValidMaxFeePercentage(uint _maxFeePercentage) internal pure {\n require(_maxFeePercentage >= BORROWING_FEE_FLOOR && _maxFeePercentage <= DECIMAL_PRECISION,\n \"Max fee percentage must be between 0.5% and 100%\");\n }\n\n// Code block 3 (unknown):\n_requireValidMaxFeePercentage(_maxFeePercentage);", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ReaperVaultERC4626.sol#L5-L6, BorrowerOperations.sol#L648-L656, BorrowerOperations.sol#L293", "github_files_list": "BorrowerOperations.sol, ReaperVaultERC4626.sol", "github_refs_count": 3, "vulnerable_code_actual": "import {ReaperVaultV2} from \"./ReaperVaultV2.sol\";\nimport {IERC4626Functions} from \"./interfaces/IERC4626Functions.sol\";", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function _requireValidMaxFeePercentage(uint _maxFeePercentage) internal pure {\n require(_maxFeePercentage >= BORROWING_FEE_FLOOR && _maxFeePercentage <= DECIMAL_PRECISION,\n \"Max fee percentage must be between 0.5% and 100%\");\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "02-ethos", "title": "hansfriese Q", "severity_raw": "Critical", "severity": "critical", "description": "## Low severity findings\n\n### [L-01] Core contracts are susceptible to initializer re-entrancy due to OpenZeppelin version advisory\n\nThe version of OpenZeppelin in the core package falls within [this advisory](https://github.com/OpenZeppelin/openzeppelin-contracts/security/advisories/GHSA-9c22-pwxw-p6hx), so advised to upgrade to avoid accidentally adding a vulnerability if external calls are made.\n\n### [L-02] Re-entrancy risk in openTrove\n\n- https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L526\n Although unlikely bad collateral will be included, it is recommended to keep CEI pattern.\n Otherwise, malicious strategy can reenter `report()` function and cause problems.\n (It is understood strategy is added by admin and this is very unlikely)\n\n### [L-03] No rewards swapped in \\_harvestCore\n\n- https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol#L114-L125\n\nWhen `steps` are not initialized it seems admin has to `setHarvestSteps` first, but this may not happen so rewards aren't swapped.\n\n### [L-04] Call `_disableInitializers()`\n\n- https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Vault/contracts/abstract/ReaperBaseStrategyv4.sol#L61\n It is recommended to call `_disableInitializers()` in the initializer function.\n\n### [L-05] Wrong event string\n\n- https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Vault/contracts/ReaperVaultV2.sol#L155\n `require(_feeBPS <= PERCENT_DIVISOR / 5, \"Fee cannot be higher than 20 BPS\");`\n I believe the code is correct and the event string is misleading here, should be changed into 2000 BPS or 20%.\n\n### [L-06] Wrong comments\n\n- https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/BorrowerOperations.sol#L660\n \"collateral ratio\" \u2192 \"nominal ..\"\n- https://github.com/code-423n4/2023-02-ethos/blob/736", "vulnerable_code": "isValidCollateral\nisAllowedCollateral\nrequireValidCollateral", "fixed_code": "", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/hansfriese-Q.md", "collected_at": "2026-01-02T18:17:15.901414+00:00", "source_hash": "1be1f3bac8b5353590824f3f043cab1e881f6767731689106b39947eceb46a2d", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ReaperVaultV2.sol#L526, ReaperStrategyGranarySupplyOnly.sol#L114-L125, ReaperBaseStrategyv4.sol#L61, ReaperVaultV2.sol#L155, BorrowerOperations.sol#L660", "github_files_list": "ReaperBaseStrategyv4.sol, BorrowerOperations.sol, ReaperStrategyGranarySupplyOnly.sol, ReaperVaultV2.sol", "github_refs_count": 5, "vulnerable_code_actual": "isValidCollateral\nisAllowedCollateral\nrequireValidCollateral", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "09-ondo", "title": "umarkhatab_465 Q", "severity_raw": "Unknown", "severity": "unknown", "description": "# Unknown Dos to the Admin while calling `multiexCall` \n## Summary\nWhile calling the `multiexcall` function inside `SourceBridge.sol` , the admin passes multiple potential calls in the form of array. The function executes multiple calls( or transactions ) in a single call.\nBut here's the caveat , if one of them fails , the entire set of transactions fail.\n\n```solidity\n\nfunction multiexcall(\n ExCallData[] calldata exCallData\n ) external payable override onlyOwner returns (bytes[] memory results) {\n results = new bytes[](exCallData.length);\n for (uint256 i = 0; i < exCallData.length; ++i) {\n (bool success, bytes memory ret) = address(exCallData[i].target).call{\n value: exCallData[i].value\n }(exCallData[i].data);\n-> require(success, \"Call Failed\");\n results[i] = ret;\n }\n }\n```\n\nThe `require` statement at the end checks if the transaction has succeeded.\nIf not, it reverts.\n\nUnfortunately, the admin has no way of knowing which transaction failed!\nLet's say the admin has 10 transactions , he can't know which transaction was a black sheep to remove and execute the function again.\n\nSituation gets worse when the admin has calls in the factor 100s.\n\n# Recommendation\ninstead of require statement , try to have some offchain mechanism in conjuction with onchain (emitting events of reverting transaction data to try again with) or just an array of pending/unsuccessful transactions and rest should be proceeded if they all are independent.\n\n", "vulnerable_code": "function multiexcall(\n ExCallData[] calldata exCallData\n ) external payable override onlyOwner returns (bytes[] memory results) {\n results = new bytes[](exCallData.length);\n for (uint256 i = 0; i < exCallData.length; ++i) {\n (bool success, bytes memory ret) = address(exCallData[i].target).call{\n value: exCallData[i].value\n }(exCallData[i].data);\n-> require(success, \"Call Failed\");\n results[i] = ret;\n }\n }", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/umarkhatab_465-Q.md", "collected_at": "2026-01-02T18:26:20.699218+00:00", "source_hash": "1be266dd7ad0da837be0a334214494212ad3b7848afc6fb7193c056d2f3edbea", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 449, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function multiexcall(\n ExCallData[] calldata exCallData\n ) external payable override onlyOwner returns (bytes[] memory results) {\n results = new bytes[](exCallData.length);\n for (uint256 i = 0; i < exCallData.length; ++i) {\n (bool success, bytes memory ret) = address(exCallData[i].target).call{\n value: exCallData[i].value\n }(exCallData[i].data);\n-> require(success, \"Call Failed\");\n results[i] = ret;\n }\n }", "primary_code_language": "solidity", "primary_code_char_count": 449, "all_code_blocks": "// Code block 1 (solidity):\nfunction multiexcall(\n ExCallData[] calldata exCallData\n ) external payable override onlyOwner returns (bytes[] memory results) {\n results = new bytes[](exCallData.length);\n for (uint256 i = 0; i < exCallData.length; ++i) {\n (bool success, bytes memory ret) = address(exCallData[i].target).call{\n value: exCallData[i].value\n }(exCallData[i].data);\n-> require(success, \"Call Failed\");\n results[i] = ret;\n }\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function multiexcall(\n ExCallData[] calldata exCallData\n ) external payable override onlyOwner returns (bytes[] memory results) {\n results = new bytes[](exCallData.length);\n for (uint256 i = 0; i < exCallData.length; ++i) {\n (bool success, bytes memory ret) = address(exCallData[i].target).call{\n value: exCallData[i].value\n }(exCallData[i].data);\n-> require(success, \"Call Failed\");\n results[i] = ret;\n }\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function multiexcall(\n ExCallData[] calldata exCallData\n ) external payable override onlyOwner returns (bytes[] memory results) {\n results = new bytes[](exCallData.length);\n for (uint256 i = 0; i < exCallData.length; ++i) {\n (bool success, bytes memory ret) = address(exCallData[i].target).call{\n value: exCallData[i].value\n }(exCallData[i].data);\n-> require(success, \"Call Failed\");\n results[i] = ret;\n }\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.98} {"source": "c4", "protocol": "02-ethos", "title": "BRONZEDISC Q", "severity_raw": "Medium", "severity": "medium", "description": "## QA\n---\n\n### Layout Order [1]\n\n- The best-practices for layout within a contract is the following order: state variables, events, modifiers, constructor and functions.\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/StabilityPool.sol\n\n```solidity\n// struct coming after functions, should come before.\n646: struct LocalVariables_getSingularCollateralGain {\n```\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/HintHelpers.sol\n\n```solidity\n// struct coming after a function, should come before them.\n70: struct LocalVariables_getRedemptionHints {\n```\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol\n\n```solidity\n// modifier coming after all the functions\n128: modifier checkCollateral(address _collateral) {\n```\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol\n\n```solidity\n// struct coming after functions, should come before.\n220: struct LocalVariables_rebalance {\n```\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/StabilityPool.sol\n\n```solidity\n// struct coming after functions, should come before.\n643: struct LocalVariables_getSingularCollateralGain {\n```\n\n---\n\n### Function Visibility [2]\n\n- Order of Functions: Ordering helps readers identify which functions they can call and to find the constructor and fallback definitions easier. Functions should be grouped according to their visibility and ordered: constructor, receive function (if exists), fallback function (if exists), public, external, internal, private. Within a grouping, place the view and pure functions last.\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LQTY/LQTYStaking.sol\n\n```solidity\n// internal function coming before external one\n203: function _getPendingCollateralGain(address _user) internal view returns (address[] memory assets, uint[] memory amounts) {\n```\n\nhttps://github.com/code-423n4/202", "vulnerable_code": "// struct coming after functions, should come before.\n646: struct LocalVariables_getSingularCollateralGain {", "fixed_code": "// struct coming after a function, should come before them.\n70: struct LocalVariables_getRedemptionHints {", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/BRONZEDISC-Q.md", "collected_at": "2026-01-02T18:15:58.140359+00:00", "source_hash": "1be66e99be1424d1af388fc129fc4825f78a5a76e224bf49c49e63afc65106dc", "code_block_count": 6, "solidity_block_count": 6, "total_code_chars": 702, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "// struct coming after functions, should come before.\n646: struct LocalVariables_getSingularCollateralGain {", "primary_code_language": "solidity", "primary_code_char_count": 111, "all_code_blocks": "// Code block 1 (solidity):\n// struct coming after functions, should come before.\n646: struct LocalVariables_getSingularCollateralGain {\n\n// Code block 2 (solidity):\n// struct coming after a function, should come before them.\n70: struct LocalVariables_getRedemptionHints {\n\n// Code block 3 (solidity):\n// modifier coming after all the functions\n128: modifier checkCollateral(address _collateral) {\n\n// Code block 4 (solidity):\n// struct coming after functions, should come before.\n220: struct LocalVariables_rebalance {\n\n// Code block 5 (solidity):\n// struct coming after functions, should come before.\n643: struct LocalVariables_getSingularCollateralGain {\n\n// Code block 6 (solidity):\n// internal function coming before external one\n203: function _getPendingCollateralGain(address _user) internal view returns (address[] memory assets, uint[] memory amounts) {", "all_code_blocks_count": 6, "has_diff_blocks": false, "diff_code": "", "solidity_code": "// struct coming after functions, should come before.\n646: struct LocalVariables_getSingularCollateralGain {\n\n// struct coming after a function, should come before them.\n70: struct LocalVariables_getRedemptionHints {\n\n// modifier coming after all the functions\n128: modifier checkCollateral(address _collateral) {\n\n// struct coming after functions, should come before.\n220: struct LocalVariables_rebalance {\n\n// struct coming after functions, should come before.\n643: struct LocalVariables_getSingularCollateralGain {\n\n// internal function coming before external one\n203: function _getPendingCollateralGain(address _user) internal view returns (address[] memory assets, uint[] memory amounts) {", "github_refs_formatted": "StabilityPool.sol, HintHelpers.sol, CollateralConfig.sol, ActivePool.sol, LQTYStaking.sol", "github_files_list": "StabilityPool.sol, LQTYStaking.sol, ActivePool.sol, CollateralConfig.sol, HintHelpers.sol", "github_refs_count": 5, "vulnerable_code_actual": "// struct coming after functions, should come before.\n646: struct LocalVariables_getSingularCollateralGain {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "// struct coming after a function, should come before them.\n70: struct LocalVariables_getRedemptionHints {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 12} {"source": "c4", "protocol": "10-badger", "title": "BARW Q", "severity_raw": "Medium", "severity": "medium", "description": "# Redundant Check\n\n## Redundant Check at `cdpManager::_openCdp`\n`vars.netStEthBalance` is always greater than or equal 2e.\n\n\n```C++\n // @info vars.netStEthBalance >= 2e\n _requireAtLeastMinNetStEthBalance(vars.netStEthBalance);\n // @audit Redundant Check for netStEthBalance\n require(vars.netStEthBalance > 0, \"BorrowerOperations: zero collateral for openCdp()!\");\n```\n### [Related code](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/BorrowerOperations.sol#L439-L472)\n\n## Redundant Check at `EBTCToken::_requireValidRecipient`\n\n```C++\n function _requireValidRecipient(address _recipient) internal view {\n require(\n _recipient != address(0) && _recipient != address(this),\n \"EBTC: Cannot transfer tokens directly to the EBTC token contract or the zero address\"\n );\n require(\n _recipient != cdpManagerAddress && _recipient != borrowerOperationsAddress,\n \"EBTC: Cannot transfer tokens directly to the CdpManager or BorrowerOps\"\n );\n }\n```\n### [Related code](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/EBTCToken.sol#L295C42-L311)\n\n## Redundant value setting\n\n```C++\n uint256 liquidatorRewardShares = cdpManager.getCdpLiquidatorRewardShares(_cdpId);\n```\n\n`Cdps[_cdpId].liquidatorRewardShares` is always equals `collateral.getSharesByPooledEth(LIQUIDATOR_REWARD)`, there is no need to get it from the struct.\n\n## Should Prevent Zero Amount Transfer Attack\n\nThere is a restriction on transferring an amount of zero. It should be evaluated that the current allowance is greater than or equal to the maximum of the amount and 1, thereby necessitating the approval to be non-zero.\n\n```C++\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external override returns (bool) {\n _require", "vulnerable_code": "### [Related code](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/BorrowerOperations.sol#L439-L472)\n\n## Redundant Check at `EBTCToken::_requireValidRecipient`\n", "fixed_code": "### [Related code](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/EBTCToken.sol#L295C42-L311)\n\n## Redundant value setting\n", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/BARW-Q.md", "collected_at": "2026-01-02T18:26:29.508560+00:00", "source_hash": "1c07af51c8941931b1ad97a130cbf99025d78189373b4ba2c84ee447ada91767", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 845, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "### [Related code](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/BorrowerOperations.sol#L439-L472)\n\n## Redundant Check at `EBTCToken::_requireValidRecipient`", "primary_code_language": "unknown", "primary_code_char_count": 231, "all_code_blocks": "// Code block 1 (unknown):\n### [Related code](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/BorrowerOperations.sol#L439-L472)\n\n## Redundant Check at `EBTCToken::_requireValidRecipient`\n\n// Code block 2 (unknown):\n### [Related code](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/EBTCToken.sol#L295C42-L311)\n\n## Redundant value setting\n\n// Code block 3 (unknown):\n`Cdps[_cdpId].liquidatorRewardShares` is always equals `collateral.getSharesByPooledEth(LIQUIDATOR_REWARD)`, there is no need to get it from the struct.\n\n## Should Prevent Zero Amount Transfer Attack\n\nThere is a restriction on transferring an amount of zero. It should be evaluated that the current allowance is greater than or equal to the maximum of the amount and 1, thereby necessitating the approval to be non-zero.", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "BorrowerOperations.sol#L439-L472, EBTCToken.sol#L295-L42", "github_files_list": "EBTCToken.sol, BorrowerOperations.sol", "github_refs_count": 2, "vulnerable_code_actual": "### [Related code](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/BorrowerOperations.sol#L439-L472)\n\n## Redundant Check at `EBTCToken::_requireValidRecipient`\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "### [Related code](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/EBTCToken.sol#L295C42-L311)\n\n## Redundant value setting\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "08-dopex", "title": "Sathish9098 Q", "severity_raw": "Critical", "severity": "critical", "description": "# LOW FINDINGS\n\n\n| LOW COUNT | Issues | Instances |\n|---------- |---------|----------- |\n| [L-1] | The ``DEFAULT_ADMIN_ROLE`` to withdraw tokens, regardless of whether the situation is genuinely an ``emergency`` or ``not `` | 2 |\n| [L-2] | Using a very short deadline ``(block.timestamp + 1)`` can lead to ``Reverts`` | 3 |\n| [L-3] | Ensuring ``sufficient gas`` to prevent reverts in transactions involving ``UniswapV2Router`` and ``UniswapV2Pair `` | 1 |\n| [L-4] | ``DEFAULT_ADMIN_ROLE`` can be single point of failure | 10 |\n| [L-5] | Failure to check ``_whenNotPaused()`` in the ``redeem()``,``mint()`` function results in ``unintended behaviors`` and poses a ``potential risk`` | 2 |\n| [L-6] | Revert on ``approval`` to ``Zero Address`` | 1 |\n| [L-7] | Divide by zero should be avoided | 3 |\n| [L-8] | Signature use at deadlines should be allowed | 2 |\n| [L-9] | Vulnerable version of openzeppelin-Contracts used | 1 |\n| [L-10] | The absence of robust ``uint256`` value ``sanity checks`` for critical parameter assignments poses a technical risk | 1 |\n| [L-11] | Add ``blocklist`` function for ``NFT `` | - |\n| [L-12] | Don't use deprecated ``Counters.sol`` library | 1 |\n| [L-13] | Unchecked Return Value in ``swapExactTokensForTokens()`` Function May Lead to ``Loss of Funds`` | 2 |\n| [L-14] | Contracts Fail to check ``Token Blacklist`` before executing token transfers | - |\n| [L-15] | Add setter function to ``rdpxV2Core`` variable | 1 |\n| [L-16] | Lack of symbol existence check for ``_assetSymbol`` Allows for ``Duplicate Symbols `` | 1 |\n| [L-17] | Critical address changes should use ``two-step procedure`` | 2 |\n| [L-18] | Unused ``EnumerableSet`` library | 1 |\n\n\n\n##\n\n## [L-1] The ``DEFAULT_ADMIN_ROLE`` to withdraw tokens, regardless of whether the situation is ``genuinely`` an ``emergency`` or ``not ``\n\n### Impact\nAllowing ``administrators`` to withdraw tokens without restriction can create a ``conflict of interest``, where they may prioritiz", "vulnerable_code": "FILE: 2023-08-dopex/contracts/amo/UniV2LiquidityAmo.sol\n\nfunction emergencyWithdraw(\n address[] calldata tokens\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n IERC20WithBurn token;\n\n for (uint256 i = 0; i < tokens.length; i++) {\n token = IERC20WithBurn(tokens[i]);\n token.safeTransfer(msg.sender, token.balanceOf(address(this)));\n }\n\n emit LogEmergencyWithdraw(msg.sender, tokens);\n }\n", "fixed_code": "Require(emergencyActive, \"Protocol is not in emergency situation\");\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/Sathish9098-Q.md", "collected_at": "2026-01-02T18:25:04.505194+00:00", "source_hash": "1c412b61bdbf2366bee5e9434f5fabd5672371c038c9072524267dc422f5bbca", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "FILE: 2023-08-dopex/contracts/amo/UniV2LiquidityAmo.sol\n\nfunction emergencyWithdraw(\n address[] calldata tokens\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n IERC20WithBurn token;\n\n for (uint256 i = 0; i < tokens.length; i++) {\n token = IERC20WithBurn(tokens[i]);\n token.safeTransfer(msg.sender, token.balanceOf(address(this)));\n }\n\n emit LogEmergencyWithdraw(msg.sender, tokens);\n }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "Require(emergencyActive, \"Protocol is not in emergency situation\");\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "10-badger", "title": "ybansal2403 G", "severity_raw": "Medium", "severity": "medium", "description": "# Summary\n\nSome optimizations were benchmarked via the protocol's tests. Optimizations that were not benchmarked are explained properly. The following command was used to run the tests for the benchmarks below: `forge test` and the gas report was generated using `forge test --gas-report`\n\n## Gas Optimizations\n\n| Number | Issue | Instances |\n| ------------- | :--------------------------------------------------------------------------------------------- | :-------: |\n| [G-01](#g-01) | State variables that are used multiple times in a function should be cached in stack variables | 4 |\n| [G-02](#g-02) | Structs can be packed into fewer storage slots | 1 |\n| [G-03](#g-03) | State variables can be packed into fewer storage slots | 1 |\n| [G-04](#g-04) | Use do while loops instead of for loops | 8 |\n| [G-05](#g-05) | Use nested if statements instead of && | 9 |\n| [G-06](#g-06) | Use hardcode address instead of address(this) | 9 |\n| [G-07](#g-07) | Do not calculate constants | 2 |\n| [G-08](#g-08) | Use assembly to compute hashes to save gas | 4 |\n| [G-09](#g-09) | Use constants instead of type(uintx).max | 3 |\n\n\n\n## [G-01] State variables that are used multiple times in a function should be cached in stack variables\n\n_The following instances are missed in the 4naly3er report_\n\nWhen performing multiple operations on a state variable in a function, it is recommended to cache it f", "vulnerable_code": "File: packages/contracts/contracts/ActivePool.sol\n\n//@audit systemCollShares at line 295\n299: collateral.sharesOf(address(this)) >= systemCollShares,\n", "fixed_code": "https://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/CdpManagerStorage.sol#L454\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/ybansal2403-G.md", "collected_at": "2026-01-02T18:27:05.548837+00:00", "source_hash": "1cc6e0ee9ec4f6e4a16363952daaa9299bc55fedc44e1324ecdc2473102b6c0d", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CdpManagerStorage.sol#L454", "github_files_list": "CdpManagerStorage.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: packages/contracts/contracts/ActivePool.sol\n\n//@audit systemCollShares at line 295\n299: collateral.sharesOf(address(this)) >= systemCollShares,\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "02-ethos", "title": "arialblack14 Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA REPORT\n\n### Summary of low risk issues\n\n\n| Number | Issue details | Instances |\n| ------------- | ------------------------------------------------------- | :---------: |\n| [L-1](#L1) | Use of`block.timestamp` | 20 |\n| [L-2](#L3) | `ecrecover()` not checked for signer address of zero. | 2 |\n| [L-3](#L6) | Avoid hardcoded values. | 2 |\n| [L-4](#L8) | Lock pragmas to specific compiler version. | 4 |\n\n*Total: 4 issues.*\n\n### Summary of non-critical issues\n\n\n| Number | Issue details | Instances |\n| ---------------- | -------------------------------------------------------------------------------------------------------- | :---------: |\n| [NC-1](#NC1) | Consider adding checks for signature malleability. | 1 |\n| [NC-2](#NC3) | Missing timelock for critical changes. | 7 |\n| [NC-3](#NC5) | Use scientific notation (e.g.`1e18`) rather than exponentiation (e.g.`10**18`). | 2 |\n| [NC-4](#NC6) | Lines are too long. | 11 |\n| [NC-5](#NC7) | For modern and more readable code, update import usages. | 102 |\n| [NC-6](#NC11) | Avoid whitespaces while declaring mapping variables. | 35 |\n| [NC-7](#NC12) | Use of`bytes.concat()` instead of `abi.encodePacked()`. | 1 |\n\n*Total: 7 issues.*\n\n---\n\n### Low Risk Issues\n\n### [L-1] Use of `block.timestamp`\n\n##### Description\n\nBlock timestamps have historically been used f", "vulnerable_code": "87: uint256 endTimestamp = block.timestamp > lastDistributionTime ? lastDistributionTime : block.timestamp;\n93: lastIssuanceTimestamp = block.timestamp;\n113: lastDistributionTime = block.timestamp.add(distributionPeriod);\n114: lastIssuanceTimestamp = block.timestamp;", "fixed_code": "128: deploymentStartTime = block.timestamp;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/arialblack14-Q.md", "collected_at": "2026-01-02T18:16:48.573548+00:00", "source_hash": "1d1c55d54692b10b45040d2ede8e69d4a5ae0047a80c2dcc927bcd0992e69baf", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "87: uint256 endTimestamp = block.timestamp > lastDistributionTime ? lastDistributionTime : block.timestamp;\n93: lastIssuanceTimestamp = block.timestamp;\n113: lastDistributionTime = block.timestamp.add(distributionPeriod);\n114: lastIssuanceTimestamp = block.timestamp;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "128: deploymentStartTime = block.timestamp;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "10-badger", "title": "zabihullahazadzoi G", "severity_raw": "High", "severity": "high", "description": "## Gas Optimizations\n\n\n| |Issue|Instances|Estimated Gas Saved|\n|-|:-|:-:|-:|\n| [GAS-1](#GAS-1) | 'Don't compare boolean expressions to boolean literals' | 1 | 9 |\n| [GAS-2](#GAS-2) | Increments can be unchecked to save gas | 11 | 660 |\n| [GAS-3](#GAS-3) | `array[index] += amount` is cheaper than `array[index] = array[index] + amount` (or related variants) | 2 | 76 |\n| [GAS-4](#GAS-4) | Avoid emitting storage values | 2 | - |\n| [GAS-5](#GAS-5) | Avoid updating storage when the value hasn\u2019t changed | 63 | 50400 |\n| [GAS-6](#GAS-6) | Using this to access functions results in an external call, wasting gas | 6 | 600 |\n| [GAS-7](#GAS-7) | Using bools for storage incurs overhead | 4 | 400 |\n| [GAS-8](#GAS-8) | bytes constants are more efficient than string constants | 11 | - |\n| [GAS-9](#GAS-9) | Cache array length outside of loop | 5 | 15 |\n| [GAS-10](#GAS-10) | Multiple accesses of the same mapping/array key/index should be cached | 12 | 504 |\n| [GAS-11](#GAS-11) | The result of a function call should be cached rather than re-calling the function | 35 | 3500 |\n| [GAS-12](#GAS-12) | State variables that are used multiple times in a function should be cached in stack variables | 69 | 6900 |\n| [GAS-13](#GAS-13) | Use calldata instead of memory for function arguments that do not get mutated | 6 | 1800 |\n| [GAS-14](#GAS-14) | Gas savings can be achieved by changing the model for assigning value to the structure | 8 | 2080 |\n| [GAS-15](#GAS-15) | Multiple address/ID mappings can be combined into a single mapping of an address/ID to a struct, where appropriate | 6 | - |\n| [GAS-16](#GAS-16) | Consider activating via-ir for deploying | 1 | - |\n| [GAS-17](#GAS-17) | Expressions for constant values such as a call to\u00a0keccak256(), should use immutable rather than constant | 7 | - |\n| [GAS-18](#GAS-18) | Constructors can be marked as payable to save deployment gas | 19 | 399 |\n| [GAS-19](#GAS-19) | Use custom errors rather than revert()/require() strings to save gas | 150 | 7500 |\n| ", "vulnerable_code": "File: packages/contracts/contracts/CdpManager.sol\n\n 332: require(redemptionsPaused == false, \"CdpManager: Redemptions Paused\");\n", "fixed_code": "File: packages/contracts/contracts/Governor.sol\n\n 46: for (uint256 i = 0; i < users.length(); i++) {\n\n 57: for (uint256 i = 0; i < _usrs.length; i++) {\n\n 76: for (uint8 i = 0; i < type(uint8).max; i++) {\n\n 84: for (uint8 i = 0; i < type(uint8).max; i++) {\n\n 98: for (uint8 i = 0; i < type(uint8).max; i++) {\n\n 107: for (uint8 i = 0; i < type(uint8).max; i++) {\n\n 122: for (uint8 i = 0; i < roleIds.length; i++) {\n\n 137: for (uint256 i = 0; i < _sigs.length; ++i) {\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/zabihullahazadzoi-G.md", "collected_at": "2026-01-02T18:27:06.032725+00:00", "source_hash": "1d3e19a3cbf69ecd8eeb75c47a403dafbed4641ee06c45e72bc391f858b518ef", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: packages/contracts/contracts/CdpManager.sol\n\n 332: require(redemptionsPaused == false, \"CdpManager: Redemptions Paused\");\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: packages/contracts/contracts/Governor.sol\n\n 46: for (uint256 i = 0; i < users.length(); i++) {\n\n 57: for (uint256 i = 0; i < _usrs.length; i++) {\n\n 76: for (uint8 i = 0; i < type(uint8).max; i++) {\n\n 84: for (uint8 i = 0; i < type(uint8).max; i++) {\n\n 98: for (uint8 i = 0; i < type(uint8).max; i++) {\n\n 107: for (uint8 i = 0; i < type(uint8).max; i++) {\n\n 122: for (uint8 i = 0; i < roleIds.length; i++) {\n\n 137: for (uint256 i = 0; i < _sigs.length; ++i) {\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "02-ethos", "title": "emmac002 Q", "severity_raw": "Critical", "severity": "critical", "description": "# Report\n\n\n## Low Risk and Non-Critical Issues\n\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [LOW-1] | OWNER CAN RENOUNCE OWNERSHIP | 12 |\n| [LOW-2] | LOSS OF PRECISION DUE TO ROUNDING | 3 |\n| [LOW-3] | INITIALIZE() FUNCTION CAN BE CALLED BY ANYBODY | 1 |\n| [LOW-4] | VARIABLE NAME IS CONFUSING | 1 |\n| [LOW-5] | HARDCODE THE ADDRESS CAUSES NO FUTURE UPDATES | 6 |\n| [LOW-6] | REQUIRE()/REVERT() STATEMENTS SHOULD HAVE DESCRIPTIVE REASON STRINGS | 11 |\n| [LOW-7] | RECIPIENT MAY BE ADDRESS(0) | 3 |\n| [LOW-8] | MISSING EVENT FOR CRITICAL PARAMETERS INIT AND CHANGE | 6 |\n| [N-1] | CONSTANT VALUES SUCH AS A CALL TO KECCAK256(), SHOULD USED TO IMMUTABLE RATHER THAN CONSTANT | 8 |\n| [N-2] | FOR FUNCTIONS, FOLLOW SOLIDITY STANDARD NAMING CONVENTIONS | 1 |\n| [N-3] | LACK OF EVENT EMISSION AFTER CRITICAL INITIALIZE() FUNCTION | 1 |\n| [N-4] | UNUSED CONSTRUCTOR | 1 |\n| [N-5] | EMPTY BLOCKS SHOULD BE REMOVED OR EMIT SOMETHING | 2 |\n| [N-6] | FLOATING PRAGMA | 4 |\n| [N-7] | NOT USING THE NAMED RETURN VARIABLES ANYWHERE IN THE FUNCTION IS CONFUSING | 1 |\n| [N-8] | USE REQUIRE INSTEAD OF ASSERT | 20 |\n| [N-9] | OPEN TODOS | 2 |\n| [N-10] | DUPLICATE IMPORT STATEMENTS | 2 |\n| [N-11] | NUMERIC VALUES HAVING TO DO WITH TIME SHOULD USE TIME UNITS FOR READABILITY | 2 |\n| [N-12] | LARGE MULTIPLES OF TEN SHOULD USE SCIENTIFIC NOTATION | 1 |\n| [N-13] | USE SCIENTIFIC NOTATION (E.G. 1E18) RATHER THAN EXPONENTIATION (E.G. 10**18) | 1 |\n| [N-14] | DUPLICATED REQUIRE()/REVERT() CHECKS SHOULD BE REFACTORED TO A MODIFIER OR FUNCTION | 6 |\n| [N-15] | COMMENT DOUBLE SPACING | 1 |\n| [N-16] | INCONSISTENT NATSPEC FORMAT | 1 |\n\n### [LOW-1] OWNER CAN RENOUNCE OWNERSHIP\nTypically, the contract\u2019s owner is the account that deploys the contract. As a result, the owner is able to perform certain privileged activities.\n\nThe Openzeppelin\u2019s Ownable used in this project contract implements renounceOwnership. This can represent a certain risk if the ownership is renounced for any other reason than by design. Renouncing owner", "vulnerable_code": "File: Ethos-Core/contracts/CollateralConfig.sol\n\n46: function initialize(\n47: address[] calldata _collaterals,\n48: uint256[] calldata _MCRs,\n49: uint256[] calldata _CCRs\n50: ) external override onlyOwner \n\n85: function updateCollateralRatios(\n86: address _collateral,\n87: uint256 _MCR,\n88: uint256 _CCR\n89: ) external onlyOwner checkCollateral(_collateral) {\n", "fixed_code": "File: Ethos-Core/contracts/ActivePool.sol\n\n71: function setAddresses(\n72: address _collateralConfigAddress,\n73: address _borrowerOperationsAddress,\n74: address _troveManagerAddress,\n75: address _stabilityPoolAddress,\n76: address _defaultPoolAddress,\n77: address _collSurplusPoolAddress,\n78: address _treasuryAddress,\n79: address _lqtyStakingAddress,\n80: address[] calldata _erc4626vaults\n81: )\n82: external\n83: onlyOwner\n\n132: function setYieldingPercentageDrift(uint256 _driftBps) external onlyOwner {\n\n138: function setYieldClaimThreshold(address _collateral, uint256 _threshold) external onlyOwner {\n\n144: function setYieldDistributionParams(uint256 _treasurySplit, uint256 _SPSplit, uint256 _stakingSplit) external onlyOwner {\n\n214: function manualRebalance(address _collateral, uint256 _simulatedAmountLeavingPool) external onlyOwner {", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/emmac002-Q.md", "collected_at": "2026-01-02T18:17:08.273653+00:00", "source_hash": "1daab65c9236347a238adfbc7ee4a7dccf45195a6bfff8b9c06caa7a193fd4b4", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: Ethos-Core/contracts/CollateralConfig.sol\n\n46: function initialize(\n47: address[] calldata _collaterals,\n48: uint256[] calldata _MCRs,\n49: uint256[] calldata _CCRs\n50: ) external override onlyOwner \n\n85: function updateCollateralRatios(\n86: address _collateral,\n87: uint256 _MCR,\n88: uint256 _CCR\n89: ) external onlyOwner checkCollateral(_collateral) {\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: Ethos-Core/contracts/ActivePool.sol\n\n71: function setAddresses(\n72: address _collateralConfigAddress,\n73: address _borrowerOperationsAddress,\n74: address _troveManagerAddress,\n75: address _stabilityPoolAddress,\n76: address _defaultPoolAddress,\n77: address _collSurplusPoolAddress,\n78: address _treasuryAddress,\n79: address _lqtyStakingAddress,\n80: address[] calldata _erc4626vaults\n81: )\n82: external\n83: onlyOwner\n\n132: function setYieldingPercentageDrift(uint256 _driftBps) external onlyOwner {\n\n138: function setYieldClaimThreshold(address _collateral, uint256 _threshold) external onlyOwner {\n\n144: function setYieldDistributionParams(uint256 _treasurySplit, uint256 _SPSplit, uint256 _stakingSplit) external onlyOwner {\n\n214: function manualRebalance(address _collateral, uint256 _simulatedAmountLeavingPool) external onlyOwner {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "11-kelp", "title": "cryptonue Q", "severity_raw": "Unknown", "severity": "unknown", "description": "\n# [L] Lack of duplicate check on `nodeDelegatorQueue`\n\nThere is no unique check on nodeDelegatorQueue thus open for potential duplicates of data. Moreover there is no function to remove the nodeDelegatorQueue.\n\n```js\nFile: LRTDepositPool.sol\n162: function addNodeDelegatorContractToQueue(address[] calldata nodeDelegatorContracts) external onlyLRTAdmin {\n163: uint256 length = nodeDelegatorContracts.length;\n164: if (nodeDelegatorQueue.length + length > maxNodeDelegatorCount) {\n165: revert MaximumNodeDelegatorCountReached();\n166: }\n167:\n168: for (uint256 i; i < length;) {\n169: UtilLib.checkNonZeroAddress(nodeDelegatorContracts[i]);\n170: nodeDelegatorQueue.push(nodeDelegatorContracts[i]);\n171: emit NodeDelegatorAddedinQueue(nodeDelegatorContracts[i]);\n172: unchecked {\n173: ++i;\n174: }\n175: }\n176: }\n```\n\n# [NC] redundant variable\n\nas seen there is this code `IERC20 token = IERC20(asset);` which doesn't do anything much, redundant variable assignment, we can just use the `asset` directly rather than create a `token` variable.\n\n```js\nFile: NodeDelegator.sol\n51: function depositAssetIntoStrategy(address asset)\n52: external\n53: override\n54: whenNotPaused\n55: nonReentrant\n56: onlySupportedAsset(asset)\n57: onlyLRTManager\n58: {\n59: address strategy = lrtConfig.assetStrategy(asset);\n60: IERC20 token = IERC20(asset); // @audit why is this?\n61: address eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);\n62:\n63: uint256 balance = token.balanceOf(address(this));\n64:\n65: emit AssetDepositIntoStrategy(asset, strategy, balance);\n66:\n67: IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);\n68: }\n```", "vulnerable_code": "File: LRTDepositPool.sol\n162: function addNodeDelegatorContractToQueue(address[] calldata nodeDelegatorContracts) external onlyLRTAdmin {\n163: uint256 length = nodeDelegatorContracts.length;\n164: if (nodeDelegatorQueue.length + length > maxNodeDelegatorCount) {\n165: revert MaximumNodeDelegatorCountReached();\n166: }\n167:\n168: for (uint256 i; i < length;) {\n169: UtilLib.checkNonZeroAddress(nodeDelegatorContracts[i]);\n170: nodeDelegatorQueue.push(nodeDelegatorContracts[i]);\n171: emit NodeDelegatorAddedinQueue(nodeDelegatorContracts[i]);\n172: unchecked {\n173: ++i;\n174: }\n175: }\n176: }", "fixed_code": "File: NodeDelegator.sol\n51: function depositAssetIntoStrategy(address asset)\n52: external\n53: override\n54: whenNotPaused\n55: nonReentrant\n56: onlySupportedAsset(asset)\n57: onlyLRTManager\n58: {\n59: address strategy = lrtConfig.assetStrategy(asset);\n60: IERC20 token = IERC20(asset); // @audit why is this?\n61: address eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);\n62:\n63: uint256 balance = token.balanceOf(address(this));\n64:\n65: emit AssetDepositIntoStrategy(asset, strategy, balance);\n66:\n67: IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);\n68: }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/cryptonue-Q.md", "collected_at": "2026-01-02T18:27:56.035025+00:00", "source_hash": "1dd656497e676ee093e4bd6772d96ac1f6d050a25cba97b1f29614b0955638d4", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 1493, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: LRTDepositPool.sol\n162: function addNodeDelegatorContractToQueue(address[] calldata nodeDelegatorContracts) external onlyLRTAdmin {\n163: uint256 length = nodeDelegatorContracts.length;\n164: if (nodeDelegatorQueue.length + length > maxNodeDelegatorCount) {\n165: revert MaximumNodeDelegatorCountReached();\n166: }\n167:\n168: for (uint256 i; i < length;) {\n169: UtilLib.checkNonZeroAddress(nodeDelegatorContracts[i]);\n170: nodeDelegatorQueue.push(nodeDelegatorContracts[i]);\n171: emit NodeDelegatorAddedinQueue(nodeDelegatorContracts[i]);\n172: unchecked {\n173: ++i;\n174: }\n175: }\n176: }", "primary_code_language": "js", "primary_code_char_count": 723, "all_code_blocks": "// Code block 1 (js):\nFile: LRTDepositPool.sol\n162: function addNodeDelegatorContractToQueue(address[] calldata nodeDelegatorContracts) external onlyLRTAdmin {\n163: uint256 length = nodeDelegatorContracts.length;\n164: if (nodeDelegatorQueue.length + length > maxNodeDelegatorCount) {\n165: revert MaximumNodeDelegatorCountReached();\n166: }\n167:\n168: for (uint256 i; i < length;) {\n169: UtilLib.checkNonZeroAddress(nodeDelegatorContracts[i]);\n170: nodeDelegatorQueue.push(nodeDelegatorContracts[i]);\n171: emit NodeDelegatorAddedinQueue(nodeDelegatorContracts[i]);\n172: unchecked {\n173: ++i;\n174: }\n175: }\n176: }\n\n// Code block 2 (js):\nFile: NodeDelegator.sol\n51: function depositAssetIntoStrategy(address asset)\n52: external\n53: override\n54: whenNotPaused\n55: nonReentrant\n56: onlySupportedAsset(asset)\n57: onlyLRTManager\n58: {\n59: address strategy = lrtConfig.assetStrategy(asset);\n60: IERC20 token = IERC20(asset); // @audit why is this?\n61: address eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);\n62:\n63: uint256 balance = token.balanceOf(address(this));\n64:\n65: emit AssetDepositIntoStrategy(asset, strategy, balance);\n66:\n67: IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);\n68: }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: LRTDepositPool.sol\n162: function addNodeDelegatorContractToQueue(address[] calldata nodeDelegatorContracts) external onlyLRTAdmin {\n163: uint256 length = nodeDelegatorContracts.length;\n164: if (nodeDelegatorQueue.length + length > maxNodeDelegatorCount) {\n165: revert MaximumNodeDelegatorCountReached();\n166: }\n167:\n168: for (uint256 i; i < length;) {\n169: UtilLib.checkNonZeroAddress(nodeDelegatorContracts[i]);\n170: nodeDelegatorQueue.push(nodeDelegatorContracts[i]);\n171: emit NodeDelegatorAddedinQueue(nodeDelegatorContracts[i]);\n172: unchecked {\n173: ++i;\n174: }\n175: }\n176: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: NodeDelegator.sol\n51: function depositAssetIntoStrategy(address asset)\n52: external\n53: override\n54: whenNotPaused\n55: nonReentrant\n56: onlySupportedAsset(asset)\n57: onlyLRTManager\n58: {\n59: address strategy = lrtConfig.assetStrategy(asset);\n60: IERC20 token = IERC20(asset); // @audit why is this?\n61: address eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);\n62:\n63: uint256 balance = token.balanceOf(address(this));\n64:\n65: emit AssetDepositIntoStrategy(asset, strategy, balance);\n66:\n67: IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);\n68: }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-ondo", "title": "georgits Q", "severity_raw": "Unknown", "severity": "unknown", "description": "## Use latest Solidity version with a stable pragma statement\nFiles - [CTokenCash.sol](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cCash/CTokenCash.sol), [CTokenModified.sol](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cToken/CTokenModified.sol), [CCashDelegate.sol](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cCash/CCashDelegate.sol), [CTokenDelegate.sol](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cToken/CTokenDelegate.sol), [JumpRateModelV2.sol](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/JumpRateModelV2.sol), [CCash.sol](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cCash/CCash.sol), [CErc20.sol](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cToken/CErc20.sol), [CTokenInterfacesModifiedCash.sol](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cCash/CTokenInterfacesModifiedCash.sol), [cErc20ModifiedDelegator.sol](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cErc20ModifiedDelegator.sol)\n\n## Wrong input validation\nCTokenCash.sol - [585](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cCash/CTokenCash.sol#L585)\n\nCTokenModified.sol - [585](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cToken/CTokenModified.sol#L585)\n\n```\n *@param redeemTokensIn The number of cTokens to redeem into underlying (only one of redeemTokensIn or redeemAmountIn may be non-zero)\n *@param redeemAmountIn The number of underlying tokens to receive from redeeming cTokens (only one of redeemTokensIn or redeemAmountIn may be non-zero)\n```\nShould be something like `redeemTokensIn != 0 && redeemAmountIn == 0 || redeemTokensIn == 0 && redeemAmountIn != 0` since only of them one can have non-zero value\n\n## `initialize` can be called by anyone\nCashKYCSender.s", "vulnerable_code": " *@param redeemTokensIn The number of cTokens to redeem into underlying (only one of redeemTokensIn or redeemAmountIn may be non-zero)\n *@param redeemAmountIn The number of underlying tokens to receive from redeeming cTokens (only one of redeemTokensIn or redeemAmountIn may be non-zero)", "fixed_code": "", "recommendation": "", "category": "validation", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/georgits-Q.md", "collected_at": "2026-01-02T18:15:11.136749+00:00", "source_hash": "1de0a5be9f46d65d2a979e787775af395cf6ef5acd5639b531e822891301b386", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 286, "github_ref_count": 11, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "*@param redeemTokensIn The number of cTokens to redeem into underlying (only one of redeemTokensIn or redeemAmountIn may be non-zero)\n *@param redeemAmountIn The number of underlying tokens to receive from redeeming cTokens (only one of redeemTokensIn or redeemAmountIn may be non-zero)", "primary_code_language": "unknown", "primary_code_char_count": 286, "all_code_blocks": "// Code block 1 (unknown):\n*@param redeemTokensIn The number of cTokens to redeem into underlying (only one of redeemTokensIn or redeemAmountIn may be non-zero)\n *@param redeemAmountIn The number of underlying tokens to receive from redeeming cTokens (only one of redeemTokensIn or redeemAmountIn may be non-zero)", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CTokenCash.sol, CTokenModified.sol, CCashDelegate.sol, CTokenDelegate.sol, JumpRateModelV2.sol, CCash.sol, CErc20.sol, CTokenInterfacesModifiedCash.sol, cErc20ModifiedDelegator.sol, CTokenCash.sol#L585, CTokenModified.sol#L585", "github_files_list": "CTokenCash.sol, CTokenModified.sol, CErc20.sol, CTokenDelegate.sol, JumpRateModelV2.sol, cErc20ModifiedDelegator.sol, CTokenInterfacesModifiedCash.sol, CCash.sol, CCashDelegate.sol", "github_refs_count": 11, "vulnerable_code_actual": " *@param redeemTokensIn The number of cTokens to redeem into underlying (only one of redeemTokensIn or redeemAmountIn may be non-zero)\n *@param redeemAmountIn The number of underlying tokens to receive from redeeming cTokens (only one of redeemTokensIn or redeemAmountIn may be non-zero)", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "09-ondo", "title": "0xhex G", "severity_raw": "Medium", "severity": "medium", "description": "# Gas Optimization\n\n# Summary\n\n| Number | Gas | context |\n| :----: | :------------------------------------------------------------------------------------------------------- | :-----: |\n| [G-01] | Functions guaranteed to revert when called by normal users can be marked payable | 25 |\n| [G-02] | Use assembly to perform efficient back-to-back calls | 2 |\n| [G-03] | Expressions for constant values such as a call to keccak256(), should use immutable rather than constant | 5 |\n| [G-04] | Can make the variable outside the loop to save Gas | 2 |\n| [G-05] | Avoid emitting storage values | 2 |\n| [G-06] | Avoid contract existence checks by using low level calls | 3 |\n| [G-07] | Use do while loops instead of for loops | 5 |\n| [G-08] | abi.encode() is less efficient than abi.encodePacked() | 3 |\n| [G-09] | Stack variable used as a cheaper cache for a state variable is only used once | 1 |\n| [G-10] | Use Assembly To Check For address(0) | 8 |\n\n## [G-01] Functions guaranteed to revert when called by normal users can be marked payable\n\nIf a function modifier such as onlyOwner is used, the function will revert if a normal user tries to pay the function. Marking the function as payable will lower the gas cost for legitimate callers because the compiler will not include checks for whether a payment was provided.\n\n```solidity\nFile: contracts/bridge/SourceBridge.sol\n121 ", "vulnerable_code": "File: contracts/bridge/SourceBridge.sol\n121 function setDestinationChainContractAddress(\n string memory destinationChain,\n address contractAddress\n ) external onlyOwner {\n\n136 function pause() external onlyOwner {\n\n145 function unpause() external onlyOwner {", "fixed_code": "File: contracts/rwaOracles/RWADynamicOracle.sol\n151 function setRange(\n uint256 endTimestamp,\n uint256 dailyInterestRate\n ) external onlyRole(SETTER_ROLE) {\n\n186 function overrideRange(\n uint256 indexToModify,\n uint256 newStart,\n uint256 newEnd,\n uint256 newDailyIR,\n uint256 newPrevRangeClosePrice\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n\n241 function pauseOracle() external onlyRole(PAUSER_ROLE) {\n\n248 function unpauseOracle() external onlyRole(DEFAULT_ADMIN_ROLE) {", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/0xhex-G.md", "collected_at": "2026-01-02T18:25:16.815511+00:00", "source_hash": "1de292d8c88e419c9cbc70f0ea6d90a24625403e698b7a28ababa2506533e8b1", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: contracts/bridge/SourceBridge.sol\n121 function setDestinationChainContractAddress(\n string memory destinationChain,\n address contractAddress\n ) external onlyOwner {\n\n136 function pause() external onlyOwner {\n\n145 function unpause() external onlyOwner {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/rwaOracles/RWADynamicOracle.sol\n151 function setRange(\n uint256 endTimestamp,\n uint256 dailyInterestRate\n ) external onlyRole(SETTER_ROLE) {\n\n186 function overrideRange(\n uint256 indexToModify,\n uint256 newStart,\n uint256 newEnd,\n uint256 newDailyIR,\n uint256 newPrevRangeClosePrice\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n\n241 function pauseOracle() external onlyRole(PAUSER_ROLE) {\n\n248 function unpauseOracle() external onlyRole(DEFAULT_ADMIN_ROLE) {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "02-ai-arena", "title": "0xepley Analysis", "severity_raw": "Critical", "severity": "critical", "description": "# \ud83d\udee0\ufe0f AI Arena\n***In AI Arena you train an AI character to battle in a platform fighting game. Imagine a cross between Pok\u00e9mon and Super Smash Bros, but the characters are AIs, and you can train them to learn almost any skill in preparation for battle.***\n\n\n### Summary\n| List |Head |Details|\n|:--|:----------------|:------|\n|a) |Overview of the AI Arena Project| Summary of the whole Protocol |\n|b) |Technical Architecture| Architecture of the smart contracts |\n|c) |The approach I would follow when reviewing the code | Stages in my code review and analysis |\n|d) |Analysis of the code base | What is unique? How are the existing patterns used? \"Solidity-metrics\" was used |\n|e) |Test analysis | Test scope of the project and quality of tests |\n|f) |Security Approach of the Project | Audit approach of the Project |\n|g) |In-depth architecture assessment of business logic | Architecture of the Protocol|\n|h) |Codebase Quality | Overall Code Quality of the Project |\n|i) |Other Audit Reports and Automated Findings | What are the previous Audit reports and their analysis |\n|j) |Contract Functionalities| Functionality of different Contracts involved |\n|k) |Full representation of the project\u2019s risk model| What are the risks associated with the project |\n|l) |Packages and Dependencies Analysis | Details about the project Packages |\n|m) |New insights and learning of project from this audit | Things learned from the project |\n|n) |Point of improvements | Things that could be improved |\n\n\n\n## a) Overview of the AI Arena Project\nThe AI Arena is a comprehensive blockchain-based ecosystem that integrates NFT (Non-Fungible Token) technology with competitive gaming and an innovative economic model. This ecosystem allows users to own, train, and compete with unique digital fighters represented as NFTs, engaging in ranked battles within a global competitive landscape. Central to its economy is the Neuron ($NRN) token, which facilitates transactions, staking, and rewards within the AI Arena.\n\n", "vulnerable_code": "Install libraries using forge and compile contracts.\n", "fixed_code": "After installing and building contracts I ran this command to execute all the test scripts:\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/0xepley-Analysis.md", "collected_at": "2026-01-02T19:02:08.279736+00:00", "source_hash": "1df298508d7108db93f0d3242ce58f75ebdfac050a1a0820413fc82c17b98367", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "Install libraries using forge and compile contracts.\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "After installing and building contracts I ran this command to execute all the test scripts:\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "02-ethos", "title": "erictee Q", "severity_raw": "Medium", "severity": "medium", "description": "### [N-01] ```require()``` should be used instead of ```assert()```\n\n\n#### Impact\nPrior to solidity version 0.8.0, hitting an assert consumes the remainder of the transaction\u2019s available gas rather than returning it, as ```require()```/```revert()``` do. ```assert()``` should be avoided even past solidity version 0.8.0 as its [documentation](https://docs.soliditylang.org/en/v0.8.14/control-structures.html#panic-via-assert-and-error-via-require) states that \u201cThe assert function creates an error of type Panic(uint256). \u2026 Properly functioning code should never create a Panic, not even on invalid external input. If this happens, then there is a bug in your contract which you should fix\u201d.\n\n\n#### Findings:\n```\nEthos-Core/contracts/LUSDToken.sol:L312 assert(sender != address(0));\n\nEthos-Core/contracts/LUSDToken.sol:L313 assert(recipient != address(0));\n\nEthos-Core/contracts/LUSDToken.sol:L321 assert(account != address(0));\n\nEthos-Core/contracts/LUSDToken.sol:L329 assert(account != address(0));\n\nEthos-Core/contracts/LUSDToken.sol:L337 assert(owner != address(0));\n\nEthos-Core/contracts/LUSDToken.sol:L338 assert(spender != address(0));\n\nEthos-Core/contracts/TroveManager.sol:L417 assert(_LUSDInStabPool != 0);\n\nEthos-Core/contracts/TroveManager.sol:L1224 assert(totalStakesSnapshot[_collateral] > 0);\n\nEthos-Core/contracts/TroveManager.sol:L1279 assert(closedStatus != Status.nonExistent && closedStatus != Status.active);\n\nEthos-Core/contracts/TroveManager.sol:L1342 assert(troveStatus != Status.nonExistent && troveStatus != Status.active);\n\nEthos-Core/contracts/TroveManager.sol:L1348 assert(index <= idxLast);\n\nEthos-Core/contracts/TroveManager.sol:L1414 assert(newBaseRate > 0); // Base rate is always non-zero after redemption\n\nEthos-Core/contracts/TroveManager.sol:L1489 assert(decayedBaseRate <= DECIMAL_PRECISION); // The baseRate can decay to 0;\n\nEthos-Core/contracts/BorrowerOperat", "vulnerable_code": "#### Impact\nPrior to solidity version 0.8.0, hitting an assert consumes the remainder of the transaction\u2019s available gas rather than returning it, as ```require()```/```revert()``` do. ```assert()``` should be avoided even past solidity version 0.8.0 as its [documentation](https://docs.soliditylang.org/en/v0.8.14/control-structures.html#panic-via-assert-and-error-via-require) states that \u201cThe assert function creates an error of type Panic(uint256). \u2026 Properly functioning code should never create a Panic, not even on invalid external input. If this happens, then there is a bug in your contract which you should fix\u201d.\n\n\n#### Findings:", "fixed_code": "### [N-02] Unused named returns\n\n\n#### Impact\nusing both named returns and return statement is not neccessary, removing one of those can improve code clarity. ( see `@audit`)\n\n\n\n#### Findings:\n1.", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/erictee-Q.md", "collected_at": "2026-01-02T18:17:09.169440+00:00", "source_hash": "1df7fc277c54967bb4f928f490258b6996df9f3166bf82d0a381b8f15ea9d323", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 149, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "#### Impact\nPrior to solidity version 0.8.0, hitting an assert consumes the remainder of the transaction\u2019s available gas rather than returning it, as", "primary_code_language": "unknown", "primary_code_char_count": 149, "all_code_blocks": "// Code block 1 (unknown):\n#### Impact\nPrior to solidity version 0.8.0, hitting an assert consumes the remainder of the transaction\u2019s available gas rather than returning it, as", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "#### Impact\nPrior to solidity version 0.8.0, hitting an assert consumes the remainder of the transaction\u2019s available gas rather than returning it, as ```require()```/```revert()``` do. ```assert()``` should be avoided even past solidity version 0.8.0 as its [documentation](https://docs.soliditylang.org/en/v0.8.14/control-structures.html#panic-via-assert-and-error-via-require) states that \u201cThe assert function creates an error of type Panic(uint256). \u2026 Properly functioning code should never create a Panic, not even on invalid external input. If this happens, then there is a bug in your contract which you should fix\u201d.\n\n\n#### Findings:", "has_vulnerable_code_snippet": true, "fixed_code_actual": "### [N-02] Unused named returns\n\n\n#### Impact\nusing both named returns and return statement is not neccessary, removing one of those can improve code clarity. ( see `@audit`)\n\n\n\n#### Findings:\n1.", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "08-dopex", "title": "0xfave Q", "severity_raw": "Low", "severity": "low", "description": "# L-01 Missing zero-address checks\n## Impact\nChecking addresses against zero-address during initialization or during setting is a security best-practice. However, such checks are missing in all address variable initializations.\n\nImpact: Allowing zero-addresses will lead to contract reverts and force redeployments if there are no setters for such address variables.\n## Proof of concept\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L124-L126\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/amo/UniV3LiquidityAmo.sol#L76-L78\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/amo/UniV3LiquidityAmo.sol#L274-L287\n## Tools Used\nmanual review\n\n## Recommended Mitigation Steps\nadd zero address validation\nlike\n```\nrequire(_weth != address(0), \"RdpxV2Core: _weth cannot be 0 address\");\n```", "vulnerable_code": "require(_weth != address(0), \"RdpxV2Core: _weth cannot be 0 address\");", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/0xfave-Q.md", "collected_at": "2026-01-02T18:24:22.731325+00:00", "source_hash": "1e18b061ebfc6a9ceed59eaca2e1867f149bf2b2acb2fe19123eb9be989b8120", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 70, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "require(_weth != address(0), \"RdpxV2Core: _weth cannot be 0 address\");", "primary_code_language": "unknown", "primary_code_char_count": 70, "all_code_blocks": "// Code block 1 (unknown):\nrequire(_weth != address(0), \"RdpxV2Core: _weth cannot be 0 address\");", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "RdpxV2Core.sol#L124-L126, UniV3LiquidityAmo.sol#L76-L78, UniV3LiquidityAmo.sol#L274-L287", "github_files_list": "RdpxV2Core.sol, UniV3LiquidityAmo.sol", "github_refs_count": 3, "vulnerable_code_actual": "require(_weth != address(0), \"RdpxV2Core: _weth cannot be 0 address\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.85} {"source": "c4", "protocol": "03-asymmetry", "title": "0x4ka5h G", "severity_raw": "High", "severity": "high", "description": "### G[1] Use arithmetic operating instead using loop for calculating totalWeight adjustment \n[Link to github permalink](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L165-L175)\n```\nfunction adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n) external onlyOwner {\n+ uint256 oldWeight = weights[_derivativeIndex];\n+ weights[_derivativeIndex] = _weight;\n+ totalWeight = totalWeight - oldWeight + _weight;\n\n- weights[_derivativeIndex] = _weight;\n- uint256 localTotalWeight = 0;\n- for (uint256 i = 0; i < derivativeCount; i++)\n- localTotalWeight += weights[i];\n- totalWeight = localTotalWeight;\n emit WeightChange(_derivativeIndex, _weight);\n\n}\n```\n\nThe code above shows a function called `adjustWeight` that allows the owner to adjust the weight of a derivative. The function has been optimized to reduce gas consumption by eliminating the loop and instead, tracking the old weight, updating the new weight, and recalculating the total weight with a simple arithmetic operation.\n\nThis new code adds a variable `oldWeight` to store the original weight of the derivative before updating it. Then, the function updates the derivative's weight with the new weight provided by the owner and recalculates the total weight by subtracting the old weight and adding the new weight. This eliminates the need for a loop that calculates the total weight of all derivatives.\n\n## G[2] Use arithmetic operating instead using loop for new totalWeight calculating\n[Link to github permalink](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L182-L195)\n```\nfunction addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n // @remind gas/extra calcualtion\n+ totalWeight", "vulnerable_code": "function adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n) external onlyOwner {\n+ uint256 oldWeight = weights[_derivativeIndex];\n+ weights[_derivativeIndex] = _weight;\n+ totalWeight = totalWeight - oldWeight + _weight;\n\n- weights[_derivativeIndex] = _weight;\n- uint256 localTotalWeight = 0;\n- for (uint256 i = 0; i < derivativeCount; i++)\n- localTotalWeight += weights[i];\n- totalWeight = localTotalWeight;\n emit WeightChange(_derivativeIndex, _weight);\n\n}", "fixed_code": "function addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n // @remind gas/extra calcualtion\n+ totalWeight = totalWeight + _weight;\n\n- uint256 localTotalWeight = 0;\n- for (uint256 i = 0; i < derivativeCount; i++)\n- localTotalWeight += weights[i];\n- totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/0x4ka5h-G.md", "collected_at": "2026-01-02T18:17:31.869957+00:00", "source_hash": "1e26bb1a27f23a49af38b23c0da3fd2f7a1ecb6fdc1cb546c27f6970518a4aa5", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 502, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n) external onlyOwner {\n+ uint256 oldWeight = weights[_derivativeIndex];\n+ weights[_derivativeIndex] = _weight;\n+ totalWeight = totalWeight - oldWeight + _weight;\n\n- weights[_derivativeIndex] = _weight;\n- uint256 localTotalWeight = 0;\n- for (uint256 i = 0; i < derivativeCount; i++)\n- localTotalWeight += weights[i];\n- totalWeight = localTotalWeight;\n emit WeightChange(_derivativeIndex, _weight);\n\n}", "primary_code_language": "unknown", "primary_code_char_count": 502, "all_code_blocks": "// Code block 1 (unknown):\nfunction adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n) external onlyOwner {\n+ uint256 oldWeight = weights[_derivativeIndex];\n+ weights[_derivativeIndex] = _weight;\n+ totalWeight = totalWeight - oldWeight + _weight;\n\n- weights[_derivativeIndex] = _weight;\n- uint256 localTotalWeight = 0;\n- for (uint256 i = 0; i < derivativeCount; i++)\n- localTotalWeight += weights[i];\n- totalWeight = localTotalWeight;\n emit WeightChange(_derivativeIndex, _weight);\n\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol#L165-L175, SafEth.sol#L182-L195", "github_files_list": "SafEth.sol", "github_refs_count": 2, "vulnerable_code_actual": "function adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n) external onlyOwner {\n+ uint256 oldWeight = weights[_derivativeIndex];\n+ weights[_derivativeIndex] = _weight;\n+ totalWeight = totalWeight - oldWeight + _weight;\n\n- weights[_derivativeIndex] = _weight;\n- uint256 localTotalWeight = 0;\n- for (uint256 i = 0; i < derivativeCount; i++)\n- localTotalWeight += weights[i];\n- totalWeight = localTotalWeight;\n emit WeightChange(_derivativeIndex, _weight);\n\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n // @remind gas/extra calcualtion\n+ totalWeight = totalWeight + _weight;\n\n- uint256 localTotalWeight = 0;\n- for (uint256 i = 0; i < derivativeCount; i++)\n- localTotalWeight += weights[i];\n- totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "10-badger", "title": "hunter_w3b G", "severity_raw": "Low", "severity": "low", "description": "# Gas-Optimization For Badger eBTC\n\n## [G-01] Avoid contract existence checks by using low level calls\n\n**Issue Description**\\\nPrior versions of Solidity inserted unnecessary contract existence checks for external function calls, wasting gas.\n\n**Proposed Optimization**\\\nAvoid contract existence checks by using low level calls.For functions that make external calls with return values in Solidity <0.8.10, optimize the code to use low-level calls instead of regular calls. Low-level calls skip the unnecessary contract existence check.\n\nExample:\n\n```solidity\n//Before:\n\ncontract C {\n function f() external returns(uint) {\n address(otherContract).call(abi.encodeWithSignature(\"func()\"));\n }\n}\n\n\n//After:\n\ncontract C {\n function f() external returns(uint) {\n (bool success,) = address(otherContract).call(abi.encodeWithSignature(\"func()\"));\n require(success);\n return decodeReturnValue();\n }\n}\n```\n\n**Estimated Gas Savings**\\\nUp to 100 gas per external call by avoiding the EXTCODESIZE check for contract existence.\n\n**Attachments**\n\n- **Code Snippets**\n\n```solidity\nFile: contracts/contracts/ActivePool.sol\n\n183 collateral.transferShares(_account, _shares);\n\n186 ICollSurplusPool(_account).increaseTotalSurplusCollShares(_shares);\n\n272 uint256 oldRate = collateral.getPooledEthByShares(DECIMAL_PRECISION);\n\n274 collateral.transfer(address(receiver), amount);\n\n283 collateral.transferFrom(address(receiver), address(this), amountWithFee);\n\n286 collateral.transfer(feeRecipientAddress, fee);\n\n362 collateral.transferShares(feeRecipientAddress, _shares);\n\n376 uint256 balance = IERC20(token).balanceOf(address(this));\n\n381 IERC20(token).safeTransfer(cachedFeeRecipientAddress, amount);\n\n```\n\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/ActivePool.sol#L183\n\n```solidity\nFile: contracts/contracts/BorrowerOperations.sol\n\n363 vars.debt = cdpManager.getCdpDebt(_cdpId);\n\n364 ", "vulnerable_code": "//Before:\n\ncontract C {\n function f() external returns(uint) {\n address(otherContract).call(abi.encodeWithSignature(\"func()\"));\n }\n}\n\n\n//After:\n\ncontract C {\n function f() external returns(uint) {\n (bool success,) = address(otherContract).call(abi.encodeWithSignature(\"func()\"));\n require(success);\n return decodeReturnValue();\n }\n}", "fixed_code": "File: contracts/contracts/ActivePool.sol\n\n183 collateral.transferShares(_account, _shares);\n\n186 ICollSurplusPool(_account).increaseTotalSurplusCollShares(_shares);\n\n272 uint256 oldRate = collateral.getPooledEthByShares(DECIMAL_PRECISION);\n\n274 collateral.transfer(address(receiver), amount);\n\n283 collateral.transferFrom(address(receiver), address(this), amountWithFee);\n\n286 collateral.transfer(feeRecipientAddress, fee);\n\n362 collateral.transferShares(feeRecipientAddress, _shares);\n\n376 uint256 balance = IERC20(token).balanceOf(address(this));\n\n381 IERC20(token).safeTransfer(cachedFeeRecipientAddress, amount);\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/hunter_w3b-G.md", "collected_at": "2026-01-02T18:26:50.651458+00:00", "source_hash": "1edbd9d504e8e5beb25c8878e43b5a4566befe15ea3b0921c124d1d19c12b409", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 1031, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "//Before:\n\ncontract C {\n function f() external returns(uint) {\n address(otherContract).call(abi.encodeWithSignature(\"func()\"));\n }\n}\n\n\n//After:\n\ncontract C {\n function f() external returns(uint) {\n (bool success,) = address(otherContract).call(abi.encodeWithSignature(\"func()\"));\n require(success);\n return decodeReturnValue();\n }\n}", "primary_code_language": "solidity", "primary_code_char_count": 348, "all_code_blocks": "// Code block 1 (solidity):\n//Before:\n\ncontract C {\n function f() external returns(uint) {\n address(otherContract).call(abi.encodeWithSignature(\"func()\"));\n }\n}\n\n\n//After:\n\ncontract C {\n function f() external returns(uint) {\n (bool success,) = address(otherContract).call(abi.encodeWithSignature(\"func()\"));\n require(success);\n return decodeReturnValue();\n }\n}\n\n// Code block 2 (solidity):\nFile: contracts/contracts/ActivePool.sol\n\n183 collateral.transferShares(_account, _shares);\n\n186 ICollSurplusPool(_account).increaseTotalSurplusCollShares(_shares);\n\n272 uint256 oldRate = collateral.getPooledEthByShares(DECIMAL_PRECISION);\n\n274 collateral.transfer(address(receiver), amount);\n\n283 collateral.transferFrom(address(receiver), address(this), amountWithFee);\n\n286 collateral.transfer(feeRecipientAddress, fee);\n\n362 collateral.transferShares(feeRecipientAddress, _shares);\n\n376 uint256 balance = IERC20(token).balanceOf(address(this));\n\n381 IERC20(token).safeTransfer(cachedFeeRecipientAddress, amount);", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "//Before:\n\ncontract C {\n function f() external returns(uint) {\n address(otherContract).call(abi.encodeWithSignature(\"func()\"));\n }\n}\n\n\n//After:\n\ncontract C {\n function f() external returns(uint) {\n (bool success,) = address(otherContract).call(abi.encodeWithSignature(\"func()\"));\n require(success);\n return decodeReturnValue();\n }\n}\n\nFile: contracts/contracts/ActivePool.sol\n\n183 collateral.transferShares(_account, _shares);\n\n186 ICollSurplusPool(_account).increaseTotalSurplusCollShares(_shares);\n\n272 uint256 oldRate = collateral.getPooledEthByShares(DECIMAL_PRECISION);\n\n274 collateral.transfer(address(receiver), amount);\n\n283 collateral.transferFrom(address(receiver), address(this), amountWithFee);\n\n286 collateral.transfer(feeRecipientAddress, fee);\n\n362 collateral.transferShares(feeRecipientAddress, _shares);\n\n376 uint256 balance = IERC20(token).balanceOf(address(this));\n\n381 IERC20(token).safeTransfer(cachedFeeRecipientAddress, amount);", "github_refs_formatted": "ActivePool.sol#L183", "github_files_list": "ActivePool.sol", "github_refs_count": 1, "vulnerable_code_actual": "//Before:\n\ncontract C {\n function f() external returns(uint) {\n address(otherContract).call(abi.encodeWithSignature(\"func()\"));\n }\n}\n\n\n//After:\n\ncontract C {\n function f() external returns(uint) {\n (bool success,) = address(otherContract).call(abi.encodeWithSignature(\"func()\"));\n require(success);\n return decodeReturnValue();\n }\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/contracts/ActivePool.sol\n\n183 collateral.transferShares(_account, _shares);\n\n186 ICollSurplusPool(_account).increaseTotalSurplusCollShares(_shares);\n\n272 uint256 oldRate = collateral.getPooledEthByShares(DECIMAL_PRECISION);\n\n274 collateral.transfer(address(receiver), amount);\n\n283 collateral.transferFrom(address(receiver), address(this), amountWithFee);\n\n286 collateral.transfer(feeRecipientAddress, fee);\n\n362 collateral.transferShares(feeRecipientAddress, _shares);\n\n376 uint256 balance = IERC20(token).balanceOf(address(this));\n\n381 IERC20(token).safeTransfer(cachedFeeRecipientAddress, amount);\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "02-ai-arena", "title": "SAQ G", "severity_raw": "Gas", "severity": "gas", "description": "## Summary\n\n### Gas Optimization\n\nno | Issue |Instances||\n|-|:-|:-:|:-:|\n| [G-01] | `Internal` functions only called once can be inlined to save gas | 1 | - |\n| [G-02] | Using fixed bytes is cheaper than using string | 5 | - |\n| [G-03] | Should use arguments instead of state variable | 2 | - |\n| [G-04] | Before transfer of some functions, we should check some variables for possible gas save | 1 | - |\n| [G-05] | Do not calculate constant | 3 | - |\n| [G-06] | Use hardcode address instead `address(this)` | 2 | - |\n| [G-07] | Pre-increment and pre-decrement are cheaper than +1 ,-1 | 2 | - |\n\n## Gas Optimizations \n\n## [G-01] `Internal` functions only called once can be inlined to save gas\n\nNot inlining costs 20 to 40 gas because of two extra JUMP instructions and additional stack operations needed for function calls.\n\n\n```solidity\nfile: /src/FighterFarm.sol\n\n447 function _beforeTokenTransfer(address from, address to, uint256 tokenId)\n internal\n override(ERC721, ERC721Enumerable)\n {\n super._beforeTokenTransfer(from, to, tokenId);\n }\n\n\n```\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/FighterFarm.sol#L447C1-L452C6\n\n\n## [G-02] Using fixed bytes is cheaper than using string\n\nAs a rule of thumb, use\u00a0bytes for arbitrary-length raw byte data and string for arbitrary-length\u00a0string\u00a0(UTF-8) data.\nIf you can limit the length to a certain number of bytes, always use one of\u00a0bytes1\u00a0to\u00a0bytes32\u00a0because they are much cheaper.\n\n\n```solidity\nfile: /src/GameItems.sol\n\n49 string public name = \"AI Arena Game Items\";\n\n52 string public symbol = \"AGI\";\n\n```\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/GameItems.sol#L49C1-L49C48\n\n\n```solidity\nfile: /src/AiArenaHelper.sol\n\n17 string[] public attributes = [\"head\", \"eyes\", \"mouth\", \"body\", \"hands\", \"feet\"];\n\n```\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/AiArenaHelper.sol#17\n\n\n```solidity\nfile: /src/FighterOps.sol\n\n41 string modelHash;\n42 string ", "vulnerable_code": "file: /src/FighterFarm.sol\n\n447 function _beforeTokenTransfer(address from, address to, uint256 tokenId)\n internal\n override(ERC721, ERC721Enumerable)\n {\n super._beforeTokenTransfer(from, to, tokenId);\n }\n\n", "fixed_code": "file: /src/GameItems.sol\n\n49 string public name = \"AI Arena Game Items\";\n\n52 string public symbol = \"AGI\";\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/SAQ-G.md", "collected_at": "2026-01-02T19:02:42.930679+00:00", "source_hash": "1ee0538ed754c8ff7c912114787b330df49e54c5400460d11bb1abb9df64ce7e", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 462, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "file: /src/FighterFarm.sol\n\n447 function _beforeTokenTransfer(address from, address to, uint256 tokenId)\n internal\n override(ERC721, ERC721Enumerable)\n {\n super._beforeTokenTransfer(from, to, tokenId);\n }", "primary_code_language": "solidity", "primary_code_char_count": 234, "all_code_blocks": "// Code block 1 (solidity):\nfile: /src/FighterFarm.sol\n\n447 function _beforeTokenTransfer(address from, address to, uint256 tokenId)\n internal\n override(ERC721, ERC721Enumerable)\n {\n super._beforeTokenTransfer(from, to, tokenId);\n }\n\n// Code block 2 (solidity):\nfile: /src/GameItems.sol\n\n49 string public name = \"AI Arena Game Items\";\n\n52 string public symbol = \"AGI\";\n\n// Code block 3 (solidity):\nfile: /src/AiArenaHelper.sol\n\n17 string[] public attributes = [\"head\", \"eyes\", \"mouth\", \"body\", \"hands\", \"feet\"];", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "file: /src/FighterFarm.sol\n\n447 function _beforeTokenTransfer(address from, address to, uint256 tokenId)\n internal\n override(ERC721, ERC721Enumerable)\n {\n super._beforeTokenTransfer(from, to, tokenId);\n }\n\nfile: /src/GameItems.sol\n\n49 string public name = \"AI Arena Game Items\";\n\n52 string public symbol = \"AGI\";\n\nfile: /src/AiArenaHelper.sol\n\n17 string[] public attributes = [\"head\", \"eyes\", \"mouth\", \"body\", \"hands\", \"feet\"];", "github_refs_formatted": "FighterFarm.sol#L447-L1, GameItems.sol#L49-L1, AiArenaHelper.sol", "github_files_list": "GameItems.sol, FighterFarm.sol, AiArenaHelper.sol", "github_refs_count": 3, "vulnerable_code_actual": "file: /src/FighterFarm.sol\n\n447 function _beforeTokenTransfer(address from, address to, uint256 tokenId)\n internal\n override(ERC721, ERC721Enumerable)\n {\n super._beforeTokenTransfer(from, to, tokenId);\n }\n\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "file: /src/GameItems.sol\n\n49 string public name = \"AI Arena Game Items\";\n\n52 string public symbol = \"AGI\";\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "07-amphora", "title": "report", "severity_raw": "Critical", "severity": "critical", "description": "---\nsponsor: \"Amphora Protocol\"\nslug: \"2023-07-amphora\"\ndate: \"2024-04-22\"\ntitle: \"Amphora Protocol\"\nfindings: \"https://github.com/code-423n4/2023-07-amphora-findings/issues\"\ncontest: 266\n---\n\n# Overview\n\n## About C4\n\nCode4rena (C4) is an open organization consisting of security researchers, auditors, developers, and individuals with domain expertise in smart contracts.\n\nA C4 audit is an event in which community participants, referred to as Wardens, review, audit, or analyze smart contract logic in exchange for a bounty provided by sponsoring projects.\n\nDuring the audit outlined in this document, C4 conducted an analysis of the Amphora Protocol smart contract system written in Solidity. The audit took place between July 21\u2014July 26 2023.\n\n## Wardens\n\n73 Wardens contributed reports to the Amphora Protocol audit:\n\n 1. [minhtrng](https://code4rena.com/@minhtrng)\n 2. [said](https://code4rena.com/@said)\n 3. [0xComfyCat](https://code4rena.com/@0xComfyCat)\n 4. [ljmanini](https://code4rena.com/@ljmanini)\n 5. [SanketKogekar](https://code4rena.com/@SanketKogekar)\n 6. [emerald7017](https://code4rena.com/@emerald7017)\n 7. [ak1](https://code4rena.com/@ak1)\n 8. [K42](https://code4rena.com/@K42)\n 9. [0xSmartContract](https://code4rena.com/@0xSmartContract)\n 10. Musaka ([0x3b](https://code4rena.com/@0x3b) and [ZdravkoHr](https://code4rena.com/@ZdravkoHr))\n 11. [Limbooo](https://code4rena.com/@Limbooo)\n 12. [DavidGiladi](https://code4rena.com/@DavidGiladi)\n 13. [qpzm](https://code4rena.com/@qpzm)\n 14. [kutugu](https://code4rena.com/@kutugu)\n 15. [giovannidisiena](https://code4rena.com/@giovannidisiena)\n 16. [dharma09](https://code4rena.com/@dharma09)\n 17. [0xWaitress](https://code4rena.com/@0xWaitress)\n 18. [Giorgio](https://code4rena.com/@Giorgio)\n 19. [SpicyMeatball](https://code4rena.com/@SpicyMeatball)\n 20. [0xbranded](https://code4rena.com/@0xbranded)\n 21. [Bauchibred](https://code4rena.com/@Bauchibred)\n 22. [hunter\\_w3b](https://code4rena.com/@hunter_w3b)\n", "vulnerable_code": "function withdraw(uint256 _susdAmount) external override {\n _withdraw(_susdAmount, _msgSender());\n}", "fixed_code": " function _withdraw(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n if (reserveAmount == 0) revert USDA_EmptyReserve();\n if (_susdAmount == 0) revert USDA_ZeroAmount();\n if (_susdAmount > this.balanceOf(_msgSender())) revert USDA_InsufficientFunds();\n // Account for the susd withdrawn\n reserveAmount -= _susdAmount;\n sUSD.transfer(_target, _susdAmount);\n _burn(_msgSender(), _susdAmount);\n\n emit Withdraw(_target, _susdAmount);\n }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/report.md", "collected_at": "2026-01-02T18:24:06.285133+00:00", "source_hash": "1f459de818df4b07eb957cbc16e5b5039ce2bb59d9b4f2925235d62b2316fae0", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function withdraw(uint256 _susdAmount) external override {\n _withdraw(_susdAmount, _msgSender());\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function _withdraw(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n if (reserveAmount == 0) revert USDA_EmptyReserve();\n if (_susdAmount == 0) revert USDA_ZeroAmount();\n if (_susdAmount > this.balanceOf(_msgSender())) revert USDA_InsufficientFunds();\n // Account for the susd withdrawn\n reserveAmount -= _susdAmount;\n sUSD.transfer(_target, _susdAmount);\n _burn(_msgSender(), _susdAmount);\n\n emit Withdraw(_target, _susdAmount);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "04-caviar", "title": "0xhacksmithh Q", "severity_raw": "High", "severity": "high", "description": "### [Low-01] While setting ```virtualNftReserves``` Contract doesn't checking Its scaled up or not\nAccording to Code comments\n```/// @dev The virtual NFT reserves that a user sets. If it's desired to set the reserves to match 16 NFTs then the\n /// virtual reserves should be set to 16e18. If weights are enabled by setting the merkle root to be non-zero then\n /// the virtual reserves should be set to the sum of the weights of the NFTs; where floor NFTs all have a weight of\n /// 1e18. A rarer NFT may have a weight of 2.3e18 if it's 2.3x more valuable than a floor.\n```\nShould scaled up by 10e18, \nmay be creation of pool user may input wrong value\n*Instances()*\n```\nFile: \nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L178\n```\n### [Low-02] Absence Of upper bound for ```changeFee``` During contract initialization and in further fee change functions.\nSome upperbound should remain on chageFee parameter. Otherwise Pool owner could front-run and set fee to arbitary amount and draw more fund from user than intended.\n*Instances()*\n```\nFile: \nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L179\n```\n\n### [Low-03] Functions are expose to re-entrancy attacks\n```buy()```, ```sell()```, ```change()```\nNow there is no significant affect by reentrancy in pool, but it may affect future protocols that use this protocol as base.\nShould use Openzeppelin Reentrancy gaurd when functions making external calls.\n\n\n```\nFile: \nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L211-L280\n```\n### [Low-04] Nft transfer will be failed as is absence of approval\nFunction directly trying to send Nft Without approval, \nFirst pool have to approve user to transfer Nft on behalf of it.\n```solidity \n for (uint256 i = 0; i < tokenIds.length; i++) {\n // transfer the NFT to the caller\n ERC721(nft).safeTransferFrom(address(this), msg.sender, tokenIds[i]); // @audit i think missing approval\n```\n\n", "vulnerable_code": "Should scaled up by 10e18, \nmay be creation of pool user may input wrong value\n*Instances()*", "fixed_code": "### [Low-02] Absence Of upper bound for ```changeFee``` During contract initialization and in further fee change functions.\nSome upperbound should remain on chageFee parameter. Otherwise Pool owner could front-run and set fee to arbitary amount and draw more fund from user than intended.\n*Instances()*", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/0xhacksmithh-Q.md", "collected_at": "2026-01-02T18:19:23.496778+00:00", "source_hash": "1f45c21bc99f956ef9ad9fa6fe257c717797bfaaa65fe5c345a7d272462560e5", "code_block_count": 5, "solidity_block_count": 0, "total_code_chars": 607, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "Should scaled up by 10e18, \nmay be creation of pool user may input wrong value\n*Instances()*", "primary_code_language": "unknown", "primary_code_char_count": 92, "all_code_blocks": "// Code block 1 (unknown):\nShould scaled up by 10e18, \nmay be creation of pool user may input wrong value\n*Instances()*\n\n// Code block 2 (unknown):\n### [Low-02] Absence Of upper bound for\n\n// Code block 3 (unknown):\nFile: \nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L179\n\n// Code block 4 (unknown):\nNow there is no significant affect by reentrancy in pool, but it may affect future protocols that use this protocol as base.\nShould use Openzeppelin Reentrancy gaurd when functions making external calls.\n\n// Code block 5 (unknown):\n### [Low-04] Nft transfer will be failed as is absence of approval\nFunction directly trying to send Nft Without approval, \nFirst pool have to approve user to transfer Nft on behalf of it.", "all_code_blocks_count": 5, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "PrivatePool.sol#L178, PrivatePool.sol#L179, PrivatePool.sol#L211-L280", "github_files_list": "PrivatePool.sol", "github_refs_count": 3, "vulnerable_code_actual": "Should scaled up by 10e18, \nmay be creation of pool user may input wrong value\n*Instances()*", "has_vulnerable_code_snippet": true, "fixed_code_actual": "### [Low-02] Absence Of upper bound for ```changeFee``` During contract initialization and in further fee change functions.\nSome upperbound should remain on chageFee parameter. Otherwise Pool owner could front-run and set fee to arbitary amount and draw more fund from user than intended.\n*Instances()*", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 11} {"source": "c4", "protocol": "02-ethos", "title": "d3tonator G", "severity_raw": "Medium", "severity": "medium", "description": "###Summary \nWe measured the gas consumption of the loop using the Solidity compiler version 0.8.0 and compared it to the gas consumption of the same loop with pre-increments and pre-decrements.\n\nOur analysis indicates that using post-increments and post-decrements in for loops can increase gas consumption significantly. Specifically, we observed that the use of post-increments and post-decrements increased the gas consumption of the for loop by approximately 8% compared to the use of pre-increments and pre-decrements.\n\nWe note that the observed increase in gas consumption is primarily due to the fact that post-increments and post-decrements require an additional operation to be performed after the loop body has been executed. This operation is necessary to update the loop counter.\n\n\n###Proof of Concept\nDuring the review, it analyzes that the smart contract contains a for loop, where a variable is incremented or decremented using post-increment and post-decrement operators. Specifically, the code under investigation is as follows:\n\n````\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol\n\nLine 108: for(uint256 i = 0; i < numCollaterals; i++) {\n\n\n````\n\n###Recommendations:\nBased on our findings, we recommend that Solidity developers avoid the use of post-increments and post-decrements in for loops. Instead, developers should use pre-increments and pre-decrements wherever possible, as these operators do not require an additional operation to update the loop counter and are therefore more gas-efficient.", "vulnerable_code": "https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol\n\nLine 108: for(uint256 i = 0; i < numCollaterals; i++) {\n\n", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/d3tonator-G.md", "collected_at": "2026-01-02T18:17:02.441571+00:00", "source_hash": "1f7b832018c835d37b4b13db460fc57e0542c7962db456d0c75d235ab23cb11b", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 156, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol\n\nLine 108: for(uint256 i = 0; i < numCollaterals; i++) {", "primary_code_language": "unknown", "primary_code_char_count": 156, "all_code_blocks": "// Code block 1 (unknown):\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol\n\nLine 108: for(uint256 i = 0; i < numCollaterals; i++) {", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ActivePool.sol", "github_files_list": "ActivePool.sol", "github_refs_count": 1, "vulnerable_code_actual": "https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol\n\nLine 108: for(uint256 i = 0; i < numCollaterals; i++) {\n\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "08-dopex", "title": "SY_S G", "severity_raw": "High", "severity": "high", "description": "## Summary\n\n### Gas Optimization\n\nno | Issue |Instances||\n|-|:-|:-:|:-:|\n| [G-01] |Can make the variable outside the loop to save gas | |5| | \n| [G-02] |Use assembly to check for address(0) | |26| | \n| [G-03] |Use bitmap to save gas | |5| | \n| [G-04] |Require() or revert() statements that check input arguments should be at the top of the function | |1| | \n| [G-05] | Before transfer of some functions, we should check some variables for possible gas save | |6| | \n| [G-06] |keccak256() should only need to be called on a specific string literal once | |2| | \n| [G-07] |Empty blocks should be removed or emit something | |1| | \n| [G-08] |With assembly, .call (bool success) transfer can be done gas-optimized | |2| | \n| [G-09] | Don't initialize variables with default value | |1| | \n| [G-10] | Add unchecked{} for subtractions where the operands cannot underflow because of a previous require() or if statement | |2| | \n| [G-11] |Using fixed bytes is cheaper than using string | |8| | \n| [G-12] |Duplicated require()/if() checks should be refactored to a modifier or function | |1| | \n| [G-13] |Using calldata instead of memory for read-only arguments in external functions, saves gas | |5| | \n| [G-14] |Multiple accesses of a mapping/array should use a local variable cache | |2| | \n| [G-15] |Should use arguments instead of state variable | |4| | \n| [G-16] |Use assembly to write address storage values | |3| | \n| [G-17] |Usage of uints/ints smaller than 32 bytes (256 bits) incurs overhead | |1| | \n| [G-18] |Caching global variables is more expensive than using the actual variable (use msg.sender or block.timestamp instead of caching it) | |1| | \n| [G-19] |Use constants instead of type(uintx).max | |5| | \n| [G-20] |Expressions for constant values such as a call to keccak256(), should use immutable rather than constant | |5| | \n\n\n\n\n\n\n## Gas Optimizations \n\n## [G-1] Can make the variable outside the loop to save gas\n\nConsider making the stack variables before the loop which gonna ", "vulnerable_code": "file: /contracts/core/RdpxV2Core.sol\n\n997 uint256 balance = IERC20WithBurn(reserveAsset[i].tokenAddress).balanceOf(\n", "fixed_code": "file: /contracts/perp-vault/PerpetualAtlanticVault.sol\n\n329 uint256 strike = optionPositions[optionIds[i]].strike;\n\n330 uint256 amount = optionPositions[optionIds[i]].amount;\n\n419 uint256 strike = strikes[i];\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/SY_S-G.md", "collected_at": "2026-01-02T18:25:03.154671+00:00", "source_hash": "1f8c1c1963e5b7ebe25e3a4a9b5a851ea05e1fc4445d4380bc8e192b17d8808f", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "file: /contracts/core/RdpxV2Core.sol\n\n997 uint256 balance = IERC20WithBurn(reserveAsset[i].tokenAddress).balanceOf(\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "file: /contracts/perp-vault/PerpetualAtlanticVault.sol\n\n329 uint256 strike = optionPositions[optionIds[i]].strike;\n\n330 uint256 amount = optionPositions[optionIds[i]].amount;\n\n419 uint256 strike = strikes[i];\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-asymmetry", "title": "Infect3d G", "severity_raw": "High", "severity": "high", "description": "\n# Gas Optimizations\n\n## G-01 Cache storage value `derivativeCount` in memory before using it in a loop\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L71\nStoring `derivativeCount` \n##### SafeEth::stake\n\n```solidity\nFile: contracts\\SafeEth.sol\n70: // Getting underlying value in terms of ETH for each derivative\n71: for (uint i = 0; i < derivativeCount; i++)\n\n```\n\nbetter to do:\n```solidity\n // Getting underlying value in terms of ETH for each derivative\n uint256 _derivativeCount = derivativeCount;\n for (uint i = 0; i < _derivativeCount; i++)\n```\n\nAlso present here:\n\n```solidity\nFile: contracts\\SafeEth.sol\n084: for (uint i = 0; i < derivativeCount; i++) {\n---\n113: for (uint256 i = 0; i < derivativeCount; i++) {\n---\n140: for (uint i = 0; i < derivativeCount; i++) {\n---\n171: for (uint256 i = 0; i < derivativeCount; i++)\n---\n191: for (uint256 i = 0; i < derivativeCount; i++)\n\n```\n\n\n- https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L84\n- https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L113\n- https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L140\n- https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L147\n- https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L171\n- https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L191\n\n\n## G-02 x += y costs more gas than x = x + y\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L72-L74\n##### SafeEth::stake\n```solidity\nFile: contracts\\SafeEth.sol\n72: underlyingValue +=\n73: (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n74: derivatives[i].balance()) /\n75: 10 ** 18;\n```\n\nhttps://github.com/code-423n4/20", "vulnerable_code": "File: contracts\\SafeEth.sol\n70: // Getting underlying value in terms of ETH for each derivative\n71: for (uint i = 0; i < derivativeCount; i++)\n", "fixed_code": " // Getting underlying value in terms of ETH for each derivative\n uint256 _derivativeCount = derivativeCount;\n for (uint i = 0; i < _derivativeCount; i++)", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Infect3d-G.md", "collected_at": "2026-01-02T18:18:10.200398+00:00", "source_hash": "1fa2b4fc78a64b4c7e81e41e42c2381249a47ad22d17e123bd968e11b2ddf177", "code_block_count": 4, "solidity_block_count": 4, "total_code_chars": 888, "github_ref_count": 8, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts\\SafeEth.sol\n70: // Getting underlying value in terms of ETH for each derivative\n71: for (uint i = 0; i < derivativeCount; i++)", "primary_code_language": "solidity", "primary_code_char_count": 158, "all_code_blocks": "// Code block 1 (solidity):\nFile: contracts\\SafeEth.sol\n70: // Getting underlying value in terms of ETH for each derivative\n71: for (uint i = 0; i < derivativeCount; i++)\n\n// Code block 2 (solidity):\n// Getting underlying value in terms of ETH for each derivative\n uint256 _derivativeCount = derivativeCount;\n for (uint i = 0; i < _derivativeCount; i++)\n\n// Code block 3 (solidity):\nFile: contracts\\SafeEth.sol\n084: for (uint i = 0; i < derivativeCount; i++) {\n---\n113: for (uint256 i = 0; i < derivativeCount; i++) {\n---\n140: for (uint i = 0; i < derivativeCount; i++) {\n---\n171: for (uint256 i = 0; i < derivativeCount; i++)\n---\n191: for (uint256 i = 0; i < derivativeCount; i++)\n\n// Code block 4 (solidity):\nFile: contracts\\SafeEth.sol\n72: underlyingValue +=\n73: (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n74: derivatives[i].balance()) /\n75: 10 ** 18;", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: contracts\\SafeEth.sol\n70: // Getting underlying value in terms of ETH for each derivative\n71: for (uint i = 0; i < derivativeCount; i++)\n\n// Getting underlying value in terms of ETH for each derivative\n uint256 _derivativeCount = derivativeCount;\n for (uint i = 0; i < _derivativeCount; i++)\n\nFile: contracts\\SafeEth.sol\n084: for (uint i = 0; i < derivativeCount; i++) {\n---\n113: for (uint256 i = 0; i < derivativeCount; i++) {\n---\n140: for (uint i = 0; i < derivativeCount; i++) {\n---\n171: for (uint256 i = 0; i < derivativeCount; i++)\n---\n191: for (uint256 i = 0; i < derivativeCount; i++)\n\nFile: contracts\\SafeEth.sol\n72: underlyingValue +=\n73: (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n74: derivatives[i].balance()) /\n75: 10 ** 18;", "github_refs_formatted": "SafEth.sol#L71, SafEth.sol#L84, SafEth.sol#L113, SafEth.sol#L140, SafEth.sol#L147, SafEth.sol#L171, SafEth.sol#L191, SafEth.sol#L72-L74", "github_files_list": "SafEth.sol", "github_refs_count": 8, "vulnerable_code_actual": "File: contracts\\SafeEth.sol\n70: // Getting underlying value in terms of ETH for each derivative\n71: for (uint i = 0; i < derivativeCount; i++)\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": " // Getting underlying value in terms of ETH for each derivative\n uint256 _derivativeCount = derivativeCount;\n for (uint i = 0; i < _derivativeCount; i++)", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "05-ajna", "title": "pontifex G", "severity_raw": "Medium", "severity": "medium", "description": "### GAS-1 Move `if`/validation statements to the top of the function when validating input parameters\nThere are 3 instances.\n```solidity\n248: if(hasClaimedReward[distributionId_][msg.sender]) revert RewardAlreadyClaimed();\n```\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/StandardFunding.sol#LL248C22-L248C22\n```solidity\n100: if (block.number + MAX_EFM_PROPOSAL_LENGTH < endBlock_) revert InvalidProposal();\n```\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/ExtraordinaryFunding.sol#LL100C1-L100C90\n```solidity\n233: if (!_isAjnaPool(params_.pool, params_.poolSubsetHash)) revert NotAjnaPool();\n```\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-core/src/PositionManager.sol#L233\n\n### GAS-2 StandardFunding.sol#L743_Use `distributionId` caching variable instead `proposal_.distributionId` state variable\nUsing `distributionId` caching variable instead `proposal_.distributionId` in the line [L#743](https://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/StandardFunding.sol#LL743C28-L743C52) will save some gas.\n```solidity\n703: uint24 distributionId = proposal_.distributionId;\n...\n743: screeningVotesCast[proposal_.distributionId][account_] += votes_;\n```\n### GAS-3 StandardFunding.sol_Redundant type casting in the loop\nUse type casting only once instead of using it in the loop.\nThere are two instances.\n```solidity\n-768: int256 arrayLength = int256(array_.length);\n+768: uint256 arrayLength = array_.length;\n 769:\n-770: for (int256 i = 0; i < arrayLength;) {\n+770: for (uint256 i; i < arrayLength;) {\n 771: //slither-disable-next-line incorrect-equality\n-772: if (array_[uint256(i)] == proposalId_) {\n-773: index_ = i;\n+772: if (arra", "vulnerable_code": "248: if(hasClaimedReward[distributionId_][msg.sender]) revert RewardAlreadyClaimed();", "fixed_code": "100: if (block.number + MAX_EFM_PROPOSAL_LENGTH < endBlock_) revert InvalidProposal();", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/pontifex-G.md", "collected_at": "2026-01-02T18:21:43.529320+00:00", "source_hash": "1fd3ee86e8397ee6f65ab4def2587210ba9378d935ac0bbf729a1fac647ef0b0", "code_block_count": 4, "solidity_block_count": 4, "total_code_chars": 417, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "248: if(hasClaimedReward[distributionId_][msg.sender]) revert RewardAlreadyClaimed();", "primary_code_language": "solidity", "primary_code_char_count": 92, "all_code_blocks": "// Code block 1 (solidity):\n248: if(hasClaimedReward[distributionId_][msg.sender]) revert RewardAlreadyClaimed();\n\n// Code block 2 (solidity):\n100: if (block.number + MAX_EFM_PROPOSAL_LENGTH < endBlock_) revert InvalidProposal();\n\n// Code block 3 (solidity):\n233: if (!_isAjnaPool(params_.pool, params_.poolSubsetHash)) revert NotAjnaPool();\n\n// Code block 4 (solidity):\n703: uint24 distributionId = proposal_.distributionId;\n...\n743: screeningVotesCast[proposal_.distributionId][account_] += votes_;", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "248: if(hasClaimedReward[distributionId_][msg.sender]) revert RewardAlreadyClaimed();\n\n100: if (block.number + MAX_EFM_PROPOSAL_LENGTH < endBlock_) revert InvalidProposal();\n\n233: if (!_isAjnaPool(params_.pool, params_.poolSubsetHash)) revert NotAjnaPool();\n\n703: uint24 distributionId = proposal_.distributionId;\n...\n743: screeningVotesCast[proposal_.distributionId][account_] += votes_;", "github_refs_formatted": "StandardFunding.sol, ExtraordinaryFunding.sol, PositionManager.sol#L233", "github_files_list": "ExtraordinaryFunding.sol, StandardFunding.sol, PositionManager.sol", "github_refs_count": 3, "vulnerable_code_actual": "248: if(hasClaimedReward[distributionId_][msg.sender]) revert RewardAlreadyClaimed();", "has_vulnerable_code_snippet": true, "fixed_code_actual": "100: if (block.number + MAX_EFM_PROPOSAL_LENGTH < endBlock_) revert InvalidProposal();", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "03-asymmetry", "title": "Polaris_tow Q", "severity_raw": "Low", "severity": "low", "description": "## Lack of validation for function parameters\nSome functions like setMaxSlippage() and setMinAmount() lack validation for the incoming parameters, which may result in adverse effects.\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L165\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L202\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L223\n```\n function setMaxAmount(uint256 _maxAmount) external onlyOwner {\n maxAmount = _maxAmount;\n emit ChangeMaxAmount(maxAmount);\n }\n```\n## Lack of validation for contract addresses\nThere may be 0 addresses or incorrect addresses, causing bad effects\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L182-L195\n```\n function addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n }\n```\n## Lack of use of the SafeMath library\nThe code does not use the SafeMath library to prevent arithmetic overflow and underflow.\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L63-L101\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L108-L129\n```\n function unstake(uint256 _safEthAmount) external {\n require(pauseUnstaking == false, \"unstaking is paused\");\n", "vulnerable_code": " function setMaxAmount(uint256 _maxAmount) external onlyOwner {\n maxAmount = _maxAmount;\n emit ChangeMaxAmount(maxAmount);\n }", "fixed_code": " function addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Polaris_tow-Q.md", "collected_at": "2026-01-02T18:18:25.626603+00:00", "source_hash": "20430f5afd2eb741d74f80aa9f758453c8af55102cdf5d77b7798aff0ff3bd69", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 648, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function setMaxAmount(uint256 _maxAmount) external onlyOwner {\n maxAmount = _maxAmount;\n emit ChangeMaxAmount(maxAmount);\n }", "primary_code_language": "unknown", "primary_code_char_count": 141, "all_code_blocks": "// Code block 1 (unknown):\nfunction setMaxAmount(uint256 _maxAmount) external onlyOwner {\n maxAmount = _maxAmount;\n emit ChangeMaxAmount(maxAmount);\n }\n\n// Code block 2 (unknown):\nfunction addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol#L165, SafEth.sol#L202, SafEth.sol#L223, SafEth.sol#L182-L195, SafEth.sol#L63-L101, SafEth.sol#L108-L129", "github_files_list": "SafEth.sol", "github_refs_count": 6, "vulnerable_code_actual": " function setMaxAmount(uint256 _maxAmount) external onlyOwner {\n maxAmount = _maxAmount;\n emit ChangeMaxAmount(maxAmount);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "08-dopex", "title": "0xgrbr Q", "severity_raw": "Low", "severity": "low", "description": "## 1. Use of deprecated _setupRole function\nMultiple contracts make use of the deprecated function _setupRole from the AccessControl contract. \nhttps://github.com/OpenZeppelin/openzeppelin-contracts/issues/3488\n\nTotal Instances: 8\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L125\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Bond.sol#L25\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Bond.sol#L26\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/reLP/ReLPContract.sol#L80\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/amo/UniV2LiquidityAmo.sol#L58\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/amo/UniV3LiquidityAmo.sol#L80\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/perp-vault/PerpetualAtlanticVault.sol#L126\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/perp-vault/PerpetualAtlanticVault.sol#L127\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/decaying-bonds/RdpxDecayingBonds.sol#L61\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/decaying-bonds/RdpxDecayingBonds.sol#L62\n\nChange _setupRole to _grantRole\n\n## 2. Remove SafeMath (Unnecessary After Solidity 0.8.0)\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/amo/UniV3LiquidityAmo.sol#L29\n\nConsider removing the SafeMath import and its usage in the contract to simplify the code. Solidity 0.8.0 and later versions have built-in overflow and underflow checks, making SafeMath redundant.\n\nBy removing SafeMath, you will streamline the contract code and potentially reduce gas costs for contract deployment and function execution.\n\n## 3. Describe events\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/amo/UniV3LiquidityAmo.sol#L29\n\n``` \nemit log(positions_array.length); \nemit log(positions_mapping[pos.token_id].token_id);\n```\nThe contract uses generic log events without any ", "vulnerable_code": "emit log(positions_array.length); \nemit log(positions_mapping[pos.token_id].token_id);", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/0xgrbr-Q.md", "collected_at": "2026-01-02T18:24:23.610462+00:00", "source_hash": "2047f4cce3f31abe2325c76ac85f0d81266e8c45af5fcf9043bbf475ff5b3d55", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 11, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "RdpxV2Core.sol#L125, RdpxV2Bond.sol#L25, RdpxV2Bond.sol#L26, ReLPContract.sol#L80, UniV2LiquidityAmo.sol#L58, UniV3LiquidityAmo.sol#L80, PerpetualAtlanticVault.sol#L126, PerpetualAtlanticVault.sol#L127, RdpxDecayingBonds.sol#L61, RdpxDecayingBonds.sol#L62, UniV3LiquidityAmo.sol#L29", "github_files_list": "RdpxDecayingBonds.sol, PerpetualAtlanticVault.sol, RdpxV2Bond.sol, RdpxV2Core.sol, UniV3LiquidityAmo.sol, ReLPContract.sol, UniV2LiquidityAmo.sol", "github_refs_count": 11, "vulnerable_code_actual": "emit log(positions_array.length); \nemit log(positions_mapping[pos.token_id].token_id);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "01-salty", "title": "0xblackskull Q", "severity_raw": "Low", "severity": "low", "description": "### Lack of contract check in ExchangeConfig::setAccessManager\nhttps://github.com/code-423n4/2024-01-salty/blob/main/src/ExchangeConfig.sol#L62\n```\nfunction setAccessManager(IAccessManager _accessManager) external onlyOwner {\n require(address(_accessManager) != address(0), \"_accessManager cannot be address(0)\");\n //@audit // Missing contract check\n accessManager = _accessManager;\n\n emit AccessManagerSet(_accessManager);\n }\n```", "vulnerable_code": "function setAccessManager(IAccessManager _accessManager) external onlyOwner {\n require(address(_accessManager) != address(0), \"_accessManager cannot be address(0)\");\n //@audit // Missing contract check\n accessManager = _accessManager;\n\n emit AccessManagerSet(_accessManager);\n }", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/0xblackskull-Q.md", "collected_at": "2026-01-02T19:01:09.022701+00:00", "source_hash": "20a177ad7c00abfe16277b6f59b6e9a41d29ba1b240c4ae8a1548eb0ae1dec88", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 308, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function setAccessManager(IAccessManager _accessManager) external onlyOwner {\n require(address(_accessManager) != address(0), \"_accessManager cannot be address(0)\");\n //@audit // Missing contract check\n accessManager = _accessManager;\n\n emit AccessManagerSet(_accessManager);\n }", "primary_code_language": "unknown", "primary_code_char_count": 308, "all_code_blocks": "// Code block 1 (unknown):\nfunction setAccessManager(IAccessManager _accessManager) external onlyOwner {\n require(address(_accessManager) != address(0), \"_accessManager cannot be address(0)\");\n //@audit // Missing contract check\n accessManager = _accessManager;\n\n emit AccessManagerSet(_accessManager);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ExchangeConfig.sol#L62", "github_files_list": "ExchangeConfig.sol", "github_refs_count": 1, "vulnerable_code_actual": "function setAccessManager(IAccessManager _accessManager) external onlyOwner {\n require(address(_accessManager) != address(0), \"_accessManager cannot be address(0)\");\n //@audit // Missing contract check\n accessManager = _accessManager;\n\n emit AccessManagerSet(_accessManager);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 3.92} {"source": "c4", "protocol": "07-amphora", "title": "Raihan Q", "severity_raw": "Medium", "severity": "medium", "description": "# LOW\n\n# Summary\n| | issue | instance |\n|------|------------|------------|\n|[G-01]| _safeMint() should be used rather than _mint() wherever possible|6|\n|[G-02]| Contracts are not using their OZ upgradeable counterparts|35|\n|[L-03]| no check if the burn amount is zero or not|2|\n|[L-04]| Use fixed compiler version|~|\n|[L-05]| Ownable: Does not implement 2-Step-Process for transferring ownership|1|\n|[L-06]| Consider using OpenZeppelin\u2019s SafeCast library to prevent unexpected overflows when casting from various type int/uint values|24|\n|[L-07]| Division before multiple can lead to precision errors|1|\n|[L-08]| In the constructor, there is no return of incorrect address identification|1|\n|[G-09]| Signature use at deadlines should be allowed|2|\n|[L-10]| Some ERC20 tokens should need to approve(0) first|1|\n\n\n\n## [L-01] _safeMint() should be used rather than _mint() wherever possible\n_mint() is [discouraged](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/d4d8d2ed9798cc3383912a23b5e8d5cb602f7d4b/contracts/token/ERC721/ERC721.sol#L271) in favor of _safeMint() which ensures that the recipient is either an EOA or implements IERC721Receiver. Both open [OpenZeppelin](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/d4d8d2ed9798cc3383912a23b5e8d5cb602f7d4b/contracts/token/ERC721/ERC721.sol#L238-L250) and [solmate](https://github.com/Rari-Capital/solmate/blob/4eaf6b68202e36f67cab379768ac6be304c8ebde/src/tokens/ERC721.sol#L180) have versions of this function so that NFTs aren\u2019t lost if they\u2019re minted to contracts that cannot transfer them back out.\n\n```solidity\nFile: core/solidity/contracts/core/USDA.sol\n104 _mint(_target, _susdAmount);\n\n163 _mint(_msgSender(), _susdAmount);\n\n225 _mint(_target, _amount); \n```\nhttps://github.com/code-423n4/2023-07-amphora/blob/41cf810b02a150bb168698ff1eeb1f768d6bdcb0/core/solidity/contracts/core/USDA.sol#L104\n\n```solidity\nFile: core/solidity/contracts/core/WUSDA.sol\n216 _mint(_to, _wus", "vulnerable_code": "File: core/solidity/contracts/core/USDA.sol\n104 _mint(_target, _susdAmount);\n\n163 _mint(_msgSender(), _susdAmount);\n\n225 _mint(_target, _amount); ", "fixed_code": "File: core/solidity/contracts/core/WUSDA.sol\n216 _mint(_to, _wusdaAmount);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/Raihan-Q.md", "collected_at": "2026-01-02T18:23:31.370271+00:00", "source_hash": "20c3a2b98ce6ae21128176677d0125809b83dcd99b68ff4786f515170be4ae48", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 166, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: core/solidity/contracts/core/USDA.sol\n104 _mint(_target, _susdAmount);\n\n163 _mint(_msgSender(), _susdAmount);\n\n225 _mint(_target, _amount);", "primary_code_language": "solidity", "primary_code_char_count": 166, "all_code_blocks": "// Code block 1 (solidity):\nFile: core/solidity/contracts/core/USDA.sol\n104 _mint(_target, _susdAmount);\n\n163 _mint(_msgSender(), _susdAmount);\n\n225 _mint(_target, _amount);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: core/solidity/contracts/core/USDA.sol\n104 _mint(_target, _susdAmount);\n\n163 _mint(_msgSender(), _susdAmount);\n\n225 _mint(_target, _amount);", "github_refs_formatted": "ERC721.sol#L271, ERC721.sol#L238-L250, ERC721.sol#L180, USDA.sol#L104", "github_files_list": "ERC721.sol, USDA.sol", "github_refs_count": 4, "vulnerable_code_actual": "File: core/solidity/contracts/core/USDA.sol\n104 _mint(_target, _susdAmount);\n\n163 _mint(_msgSender(), _susdAmount);\n\n225 _mint(_target, _amount); ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: core/solidity/contracts/core/WUSDA.sol\n216 _mint(_to, _wusdaAmount);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "09-ondo", "title": "SY_S G", "severity_raw": "Medium", "severity": "medium", "description": "## Summary\n\n### Gas Optimization\n\nno | Issue |Instances||\n|-|:-|:-:|:-:|\n\n| [G-1] | A modifier used only once and not being inherited should be inlined to save gas | 1 | \n| [G-2] | abi.encode() is less efficient than abi.encodepacked() | 3 | \n| [G-3] | Do not calculate constant | 1 | \n| [G-4] | require() Should Be Used Instead Of assert() | 1 | \n| [G-5] | Use hardcode address instead address(this) | 3 | \n| [G-6] | Use assembly for math (add, sub, mul, div) | 3 | \n| [G-7] | Multiplication/division by two should use bit shifting | 1 | \n| [G-8] | Refactor event to avoid emitting empty data | 1 | \n| [G-9] | 2** should be re-written as type(uint).max | 1 | \n| [G-10] | Shorten the array rather than copying to a new one | 1 | \n| [G-11] | Avoid contract existence checks by using low level calls | 2 | \n| [G-12] | Pre-increments and pre-decrements are cheaper than post-increments and post-decrements | 1 | \n| [G-13] | Using fixed bytes is cheaper than using string | 2 | \n| [G-14] | Expressions for constant values such as a call to keccak256(), should use immutable rather than constant | 7 | \n| [G-15] | Not using the named return variable when a function returns, wastes deployment gas | 2 | \n| [G-16] | Should use arguments instead of state variable | 4 | \n| [G-17] | Before transfer of some functions, we should check some variables for possible gas save | 2 | \n| [G-18] | With assembly, .call (bool success) transfer can be done gas-optimized | 2 | \n| [G-19] | Duplicated require()/if() checks should be refactored to a modifier or function | 1 | \n\n## Gas Optimizations \n\n\n\n\n## [G-1] A modifier used only once and not being inherited should be inlined to save gas\n\n```solidity\nfile: /contracts/usdy/rUSDYFactory.sol\n\n154 modifier onlyGuardian() {\n require(msg.sender == guardian, \"rUSDYFactory: You are not the Guardian\");\n _;\n157 }\n\n```\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDYFactory.sol#L154-L157\n\n\n## [G-2] abi.encode() is less effic", "vulnerable_code": "file: /contracts/usdy/rUSDYFactory.sol\n\n154 modifier onlyGuardian() {\n require(msg.sender == guardian, \"rUSDYFactory: You are not the Guardian\");\n _;\n157 }\n", "fixed_code": "file: /contracts/bridge/DestinationBridge.sol\n\n99 if (chainToApprovedSender[srcChain] != keccak256(abi.encode(srcAddr))) {\n\n238 chainToApprovedSender[srcChain] = keccak256(abi.encode(srcContractAddress)); \n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/SY_S-G.md", "collected_at": "2026-01-02T18:25:39.903391+00:00", "source_hash": "213a1c51b3bc81c5fe224582bd4ac60f1a0166a0818b8022f25b6d7071bb279e", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 165, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "file: /contracts/usdy/rUSDYFactory.sol\n\n154 modifier onlyGuardian() {\n require(msg.sender == guardian, \"rUSDYFactory: You are not the Guardian\");\n _;\n157 }", "primary_code_language": "solidity", "primary_code_char_count": 165, "all_code_blocks": "// Code block 1 (solidity):\nfile: /contracts/usdy/rUSDYFactory.sol\n\n154 modifier onlyGuardian() {\n require(msg.sender == guardian, \"rUSDYFactory: You are not the Guardian\");\n _;\n157 }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "file: /contracts/usdy/rUSDYFactory.sol\n\n154 modifier onlyGuardian() {\n require(msg.sender == guardian, \"rUSDYFactory: You are not the Guardian\");\n _;\n157 }", "github_refs_formatted": "rUSDYFactory.sol#L154-L157", "github_files_list": "rUSDYFactory.sol", "github_refs_count": 1, "vulnerable_code_actual": "file: /contracts/usdy/rUSDYFactory.sol\n\n154 modifier onlyGuardian() {\n require(msg.sender == guardian, \"rUSDYFactory: You are not the Guardian\");\n _;\n157 }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "file: /contracts/bridge/DestinationBridge.sol\n\n99 if (chainToApprovedSender[srcChain] != keccak256(abi.encode(srcAddr))) {\n\n238 chainToApprovedSender[srcChain] = keccak256(abi.encode(srcContractAddress)); \n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "11-kelp", "title": "MSaptarshi G", "severity_raw": "Gas", "severity": "gas", "description": "https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTConfig.sol#L82\n```\nif (isSupportedAsset[asset]) {\n revert AssetAlreadySupported();\n }\n```\n```\n isSupportedAsset[asset] = true; \n```\nNo Need to check and write this , only checking this will save some gas\n", "vulnerable_code": "if (isSupportedAsset[asset]) {\n revert AssetAlreadySupported();\n }", "fixed_code": " isSupportedAsset[asset] = true; ", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/MSaptarshi-G.md", "collected_at": "2026-01-02T18:27:31.366627+00:00", "source_hash": "214755bce188347465233e86848e9afbc4464c173de052b281b98d8800275a8b", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 115, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "if (isSupportedAsset[asset]) {\n revert AssetAlreadySupported();\n }", "primary_code_language": "unknown", "primary_code_char_count": 84, "all_code_blocks": "// Code block 1 (unknown):\nif (isSupportedAsset[asset]) {\n revert AssetAlreadySupported();\n }\n\n// Code block 2 (unknown):\nisSupportedAsset[asset] = true;", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LRTConfig.sol#L82", "github_files_list": "LRTConfig.sol", "github_refs_count": 1, "vulnerable_code_actual": "if (isSupportedAsset[asset]) {\n revert AssetAlreadySupported();\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " isSupportedAsset[asset] = true; ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5.65} {"source": "c4", "protocol": "10-badger", "title": "debo G", "severity_raw": "Medium", "severity": "medium", "description": "## [G-01] DEFINE CONSTRUCTOR AS PAYABLE\n**Impact**\nDevelopers can save around 10 opcodes and some gas if the constructors are defined as payable.\nHowever, it should be noted that it comes with risks because payable constructors can accept ETH during deployment.\n**Remediation**\nIt is suggested to mark the constructors as payable to save some gas. Make sure it does not lead to any adverse effects in case an upgrade pattern is involved.\n**Locations**\n```txt\ncontracts/LeverageMacroReference.sol#L17-L42\ncontracts/LeverageMacroBase.sol#L51-L68\ncontracts/CdpManagerStorage.sol#L217-L237\ncontracts/BorrowerOperations.sol#L107-L137\ncontracts/contracts/EBTCToken.sol#L61-L78\ncontracts/contracts/ActivePool.sol#L46-L66\ncontracts/LiquidationLibrary.sol#L14-L34\ncontracts/contracts/Governor.sol#L36-L36\ncontracts/SimplifiedDiamondLike.sol#L44-L46\ncontracts/LeverageMacroDelegateTarget.sol#L41-L60\ncontracts/CdpManager.sol#L30-L60\ncontracts/LeverageMacroFactory.sol#L21-L35\ncontracts/Dependencies/RolesAuthority.sol#L20-L20\ncontracts/Dependencies/EbtcBase.sol#L52-L56\n```", "vulnerable_code": "", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/debo-G.md", "collected_at": "2026-01-02T18:26:46.504194+00:00", "source_hash": "215545bd2e3ab84caf15a383bbcd0f4c3d24b1900975037fa0081c9aecff1478", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 600, "github_ref_count": 0, "vulnerable_code_is_url": true, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "contracts/LeverageMacroReference.sol#L17-L42\ncontracts/LeverageMacroBase.sol#L51-L68\ncontracts/CdpManagerStorage.sol#L217-L237\ncontracts/BorrowerOperations.sol#L107-L137\ncontracts/contracts/EBTCToken.sol#L61-L78\ncontracts/contracts/ActivePool.sol#L46-L66\ncontracts/LiquidationLibrary.sol#L14-L34\ncontracts/contracts/Governor.sol#L36-L36\ncontracts/SimplifiedDiamondLike.sol#L44-L46\ncontracts/LeverageMacroDelegateTarget.sol#L41-L60\ncontracts/CdpManager.sol#L30-L60\ncontracts/LeverageMacroFactory.sol#L21-L35\ncontracts/Dependencies/RolesAuthority.sol#L20-L20\ncontracts/Dependencies/EbtcBase.sol#L52-L56", "primary_code_language": "txt", "primary_code_char_count": 600, "all_code_blocks": "// Code block 1 (txt):\ncontracts/LeverageMacroReference.sol#L17-L42\ncontracts/LeverageMacroBase.sol#L51-L68\ncontracts/CdpManagerStorage.sol#L217-L237\ncontracts/BorrowerOperations.sol#L107-L137\ncontracts/contracts/EBTCToken.sol#L61-L78\ncontracts/contracts/ActivePool.sol#L46-L66\ncontracts/LiquidationLibrary.sol#L14-L34\ncontracts/contracts/Governor.sol#L36-L36\ncontracts/SimplifiedDiamondLike.sol#L44-L46\ncontracts/LeverageMacroDelegateTarget.sol#L41-L60\ncontracts/CdpManager.sol#L30-L60\ncontracts/LeverageMacroFactory.sol#L21-L35\ncontracts/Dependencies/RolesAuthority.sol#L20-L20\ncontracts/Dependencies/EbtcBase.sol#L52-L56", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "", "has_vulnerable_code_snippet": false, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 3.13} {"source": "c4", "protocol": "02-ethos", "title": "chaduke G", "severity_raw": "Low", "severity": "low", "description": "G1. We can add some short-circuits below. For minutes = 1, 2, 3 how short circuits will win. \n```diff\nfunction _decPow(uint _base, uint _minutes) public pure returns (uint) {\n \n if (_minutes > 525600000) {_minutes = 525600000;} // cap to avoid overflow\n \n if (_minutes == 0) {return DECIMAL_PRECISION;}\n+ if (base == DECIMAL_PRECISION) {return DECIMAL_PRECISION;}\n\n+ if (_minutes == 1) return _base;\n+ if(_minutes == 2) return decMul(_base, _base);\n+ if(_minutes == 3) return decMul(decMul(_base, _base), _base);\n\n uint y = DECIMAL_PRECISION;\n uint x = _base;\n uint n = _minutes;\n\n // Exponentiation-by-squaring\n while (n > 1) {\n if (n % 2 == 0) {\n x = decMul(x, x);\n n = n / 2;\n } else { // if (n % 2 != 0)\n y = decMul(x, y);\n x = decMul(x, x);\n n = (n-1)/2\n }\n }\n\n return decMul(x, y);\n }\n}\n```\n\nG2. We can check where ``index < lastIndex`` to save gas for function ``_removeTroveOwner()``:\n\n[https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/TroveManager.sol#L1339-L1357](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/TroveManager.sol#L1339-L1357)\n\n```diff\nfunction _removeTroveOwner(address _borrower, address _collateral, uint TroveOwnersArrayLength) internal {\n Status troveStatus = Troves[_borrower][_collateral].status;\n // It\u2019s set in caller function `_closeTrove`\n assert(troveStatus != Status.nonExistent && troveStatus != Status.active);\n\n uint128 index = Troves[_borrower][_collateral].arrayIndex;\n uint length = TroveOwnersArrayLength;\n uint idxLast = length.sub(1);\n\n assert(index <= idxLast);\n\n+ if(index < idxLast){\n address addressToMove = TroveOwners[_collateral][idxLast];\n\n TroveOwners[_c", "vulnerable_code": "G2. We can check where ``index < lastIndex`` to save gas for function ``_removeTroveOwner()``:\n\n[https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/TroveManager.sol#L1339-L1357](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/TroveManager.sol#L1339-L1357)\n", "fixed_code": "G3. We can save gas here by not changing ``lastIssuanceTimestamp`` when ``lastIssuanceTimestamp >= lastDistributionTime``, it is not necessary. Also, we should not emit zero issuance event. \n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/chaduke-G.md", "collected_at": "2026-01-02T18:16:55.782194+00:00", "source_hash": "2175196ac2f50ced1cc004a167e36aaf2ed124794073bb28dc762890253614bf", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 888, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _decPow(uint _base, uint _minutes) public pure returns (uint) {\n \n if (_minutes > 525600000) {_minutes = 525600000;} // cap to avoid overflow\n \n if (_minutes == 0) {return DECIMAL_PRECISION;}\n+ if (base == DECIMAL_PRECISION) {return DECIMAL_PRECISION;}\n\n+ if (_minutes == 1) return _base;\n+ if(_minutes == 2) return decMul(_base, _base);\n+ if(_minutes == 3) return decMul(decMul(_base, _base), _base);\n\n uint y = DECIMAL_PRECISION;\n uint x = _base;\n uint n = _minutes;\n\n // Exponentiation-by-squaring\n while (n > 1) {\n if (n % 2 == 0) {\n x = decMul(x, x);\n n = n / 2;\n } else { // if (n % 2 != 0)\n y = decMul(x, y);\n x = decMul(x, x);\n n = (n-1)/2\n }\n }\n\n return decMul(x, y);\n }\n}", "primary_code_language": "diff", "primary_code_char_count": 888, "all_code_blocks": "// Code block 1 (diff):\nfunction _decPow(uint _base, uint _minutes) public pure returns (uint) {\n \n if (_minutes > 525600000) {_minutes = 525600000;} // cap to avoid overflow\n \n if (_minutes == 0) {return DECIMAL_PRECISION;}\n+ if (base == DECIMAL_PRECISION) {return DECIMAL_PRECISION;}\n\n+ if (_minutes == 1) return _base;\n+ if(_minutes == 2) return decMul(_base, _base);\n+ if(_minutes == 3) return decMul(decMul(_base, _base), _base);\n\n uint y = DECIMAL_PRECISION;\n uint x = _base;\n uint n = _minutes;\n\n // Exponentiation-by-squaring\n while (n > 1) {\n if (n % 2 == 0) {\n x = decMul(x, x);\n n = n / 2;\n } else { // if (n % 2 != 0)\n y = decMul(x, y);\n x = decMul(x, x);\n n = (n-1)/2\n }\n }\n\n return decMul(x, y);\n }\n}", "all_code_blocks_count": 1, "has_diff_blocks": true, "diff_code": "function _decPow(uint _base, uint _minutes) public pure returns (uint) {\n \n if (_minutes > 525600000) {_minutes = 525600000;} // cap to avoid overflow\n \n if (_minutes == 0) {return DECIMAL_PRECISION;}\n+ if (base == DECIMAL_PRECISION) {return DECIMAL_PRECISION;}\n\n+ if (_minutes == 1) return _base;\n+ if(_minutes == 2) return decMul(_base, _base);\n+ if(_minutes == 3) return decMul(decMul(_base, _base), _base);\n\n uint y = DECIMAL_PRECISION;\n uint x = _base;\n uint n = _minutes;\n\n // Exponentiation-by-squaring\n while (n > 1) {\n if (n % 2 == 0) {\n x = decMul(x, x);\n n = n / 2;\n } else { // if (n % 2 != 0)\n y = decMul(x, y);\n x = decMul(x, x);\n n = (n-1)/2\n }\n }\n\n return decMul(x, y);\n }\n}", "solidity_code": "", "github_refs_formatted": "TroveManager.sol#L1339-L1357", "github_files_list": "TroveManager.sol", "github_refs_count": 1, "vulnerable_code_actual": "G2. We can check where ``index < lastIndex`` to save gas for function ``_removeTroveOwner()``:\n\n[https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/TroveManager.sol#L1339-L1357](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/TroveManager.sol#L1339-L1357)\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "G3. We can save gas here by not changing ``lastIssuanceTimestamp`` when ``lastIssuanceTimestamp >= lastDistributionTime``, it is not necessary. Also, we should not emit zero issuance event. \n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "03-asymmetry", "title": "CodingNameKiki Q", "severity_raw": "Critical", "severity": "critical", "description": "### Issues Template\n| Letter | Name | Description |\n|:--:|:-------:|:-------:|\n| L | Low risk | Potential risk |\n| NC | Non-critical | Non risky findings |\n| R | Refactor | Changing the code |\n\n| Total Found Issues | 9 |\n|:--:|:--:|\n\n### Low Risk Template\n| Count | Explanation | Instances |\n|:--:|:-------|:--:|\n| L-01 | minAmount to stake shouldn't be set below the rocket pool minimum deposit, as the function stake will revert for derivative Reth | 1 |\n| L-02 | The function \"adjustWeight\" shouldn't be possible to set an amount of weight on a non-existing derivative, e.g should only issue indexes till the current count of derivatives | 1 | \n| L-03 | An already existing address of derivative can be added with the function \"addDerivative\", which might lead to wrong accounting on staking | 1 | \n| L-04 | The setter function for changing the current maxSlippage for a derivative should have a upper limit, so stakers won't experience a significant loss based on a big amount of slippage | 1 |\n| L-05 | There should be a way to remove derivatives and not just setting their weight as 0, as too many derivatives may lead to a greater gas consumption in the loops prior to staking and unstaking | 1 | \n| L-06 | The function \"rebalanceToWeights\" should not be used often or else the contracts will lose a significant amount of funds duo to slippage, by withdrawing and depositing again the funds to the derivatives | 1 | \n| L-07 | It should not be possible to set all of the derivatives weights as zero, as this issue leads to users losing their ether prior to calling the function stake | 1 |\n\n\n| Total Low Risk Issues | 7 |\n|:--:|:--:|\n\n### Non-Critical Template\n| Count | Explanation | Instances |\n|:--:|:-------|:--:|\n| N-01 | The initialize function should emit the already existing events for changing the minAmount and maxAmount | 3 |\n\n\n| Total Non-Critical Issues | 1 |\n|:--:|:--:|\n\n### Refactor Issues Template\n| Count | Explanation | Instances |\n|:--:|:-------|:--:|\n| R-01 | Unstaking", "vulnerable_code": "function setMinAmount(uint256 _minAmount) external onlyOwner {\n require(_minAmount >= rocketDAOProtocolSettingsDeposit.getMinimumDeposit(),\"\");\n minAmount = _minAmount;\n emit ChangeMinAmount(minAmount);\n }", "fixed_code": "function adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n ) external onlyOwner {\n weights[_derivativeIndex] = _weight;\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit WeightChange(_derivativeIndex, _weight);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/CodingNameKiki-Q.md", "collected_at": "2026-01-02T18:17:58.423261+00:00", "source_hash": "2186922f52e4fa9bd2dbc6954f2780dd88437b9be34cf95330fc0635119c9df5", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function setMinAmount(uint256 _minAmount) external onlyOwner {\n require(_minAmount >= rocketDAOProtocolSettingsDeposit.getMinimumDeposit(),\"\");\n minAmount = _minAmount;\n emit ChangeMinAmount(minAmount);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n ) external onlyOwner {\n weights[_derivativeIndex] = _weight;\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit WeightChange(_derivativeIndex, _weight);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "06-lybra", "title": "JCN G", "severity_raw": "High", "severity": "high", "description": "# Summary\nThe main objective of this report was to minimize storage operations. As such, gas optimizations that dealt with storage were prioritized so as to provide the most value when juxtaposed with the findings in the Bot Race. Since no tests are available and specific benchmarking is not possible, all optimizations are explained via EVM gas costs and opcodes.\n\n*Notes*: \n\n- Only optimizations to state-mutating functions and `view`/`pure` function invoked by state-mutating functions are highlighted below.\n- Only runtime gas is highlighted below, as it will inevitably out-weight deployment gas costs throughout the lifetime of the protocol.\n- Some code snippets may be truncated to save space. Code snippets may also be accompanied by @audit tags in comments to aid in explaining the issue.\n\n## Gas Optimizations\n| Number |Issue|Instances| Estimated Gas Saved |\n|-|:-|:-:|:-:| \n| [G-01](#state-variables-can-be-cached-instead-of-re-reading-them-from-storage) | State variables can be cached instead of re-reading them from storage | 22 | 2200 |\n| [G-02](#state-variables-only-set-during-construction-should-be-declared-constant) | State variables only set during construction should be declared constant | 2 | 4200 |\n| [G-03](#state-variables-can-be-packed-into-fewer-storage-slots) | State variables can be packed into fewer storage slots | 5 | 22000 |\n| [G-04](#structs-can-be-packed-into-fewer-storage-slots) | Structs can be packed into fewer storage slots | 1 | 2000 |\n| [G-05](#cache-state-variables-outside-of-loop-to-avoid-reading-storage-on-every-iteration) | Cache state variables outside of loop to avoid reading storage on every iteration | 1 | 100 |\n| [G-06](#use-calldata-instead-of-memory-for-function-parameters-that-dont-change) | Use `calldata` instead of `memory` for function parameters that don't change | 2 | 200 |\n| [G-07](#cache-function-calls) | Cache function calls | 5 | 600 |\n| [G-08](#refactor-functions-to-avoid-excessive-storage-reads) | Refactor functions to a", "vulnerable_code": "File: contracts/lybra/pools/base/LybraPeUSDVaultBase.sol\n212: function _withdraw(address _provider, address _onBehalfOf, uint256 _amount) internal {\n213: require(depositedAsset[_provider] >= _amount, \"Withdraw amount exceeds deposited amount.\"); // @audit: 1st sload\n214: depositedAsset[_provider] -= _amount; // @audit: 2nd sload", "fixed_code": "https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L161-L165\n\n### Cache `depositedAsset[provider]` to save 1 SLOAD", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/JCN-G.md", "collected_at": "2026-01-02T18:22:22.711733+00:00", "source_hash": "21f92bbcb43635c5e121d9f5eab37d9493e1b7b90a2b69ab4ae0dce60101eca8", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LybraPeUSDVaultBase.sol#L161-L165", "github_files_list": "LybraPeUSDVaultBase.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: contracts/lybra/pools/base/LybraPeUSDVaultBase.sol\n212: function _withdraw(address _provider, address _onBehalfOf, uint256 _amount) internal {\n213: require(depositedAsset[_provider] >= _amount, \"Withdraw amount exceeds deposited amount.\"); // @audit: 1st sload\n214: depositedAsset[_provider] -= _amount; // @audit: 2nd sload", "has_vulnerable_code_snippet": true, "fixed_code_actual": "https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L161-L165\n\n### Cache `depositedAsset[provider]` to save 1 SLOAD", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "04-caviar", "title": "nemveer Q", "severity_raw": "Low", "severity": "low", "description": "## 1. Consider implementing 2-step ownership transfer for Factory\nIf the owner of the Factory accidentally transfers ownership to an incorrect address, protected functions may become permanently inaccessible.\n```\n function transferOwnership(address newOwner) public virtual onlyOwner {\n owner = newOwner;\n\n emit OwnershipTransferred(msg.sender, newOwner);\n }\n}\n```\n\nSuggestion: Handle ownership transfers with two steps and two transactions. First, allow the current owner to propose a new owner address. Second, allow the proposed owner (and only the proposed owner) to accept ownership, and update the contract owner internally.\n\n## 2. There should be some upper limit on `protocolFeeRate` in Factory.sol\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/Factory.sol#L141-L143\n```\n function setProtocolFeeRate(uint16 _protocolFeeRate) public onlyOwner {\n protocolFeeRate = _protocolFeeRate;\n }\n```\nOtherwise, owner can set it to any arbitrary value.\n## 3. Owner of PrivatePool should not be decided based on ERC721.ownerOf(address(privatePool))\n\nCurrently, the owner of the private pool is decided based on the holder of that NFTId, not the one who created it. Although it creates a market for PrivatePool nftId, it may lead to some undesired behavior.\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L127-L132\n\n```\n modifier onlyOwner() virtual {\n if (msg.sender != Factory(factory).ownerOf(uint160(address(this)))) {\n revert Unauthorized();\n }\n _;\n }\n```\nAssume the case where the creator of PrivatePool has accidentally transferred the nft to someone else. Now that person is the owner of the pool and can withdraw all liquidity the original creator had provided.\n\n## 4. There should be some upper limit on changeFee and a function to change it\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePo", "vulnerable_code": " function transferOwnership(address newOwner) public virtual onlyOwner {\n owner = newOwner;\n\n emit OwnershipTransferred(msg.sender, newOwner);\n }\n}", "fixed_code": " function setProtocolFeeRate(uint16 _protocolFeeRate) public onlyOwner {\n protocolFeeRate = _protocolFeeRate;\n }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/nemveer-Q.md", "collected_at": "2026-01-02T18:20:44.916440+00:00", "source_hash": "21fe771c00fff0ebb9104bc55f5905b9d1293368644d7f2e24d68585b44918f8", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 454, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function transferOwnership(address newOwner) public virtual onlyOwner {\n owner = newOwner;\n\n emit OwnershipTransferred(msg.sender, newOwner);\n }\n}", "primary_code_language": "unknown", "primary_code_char_count": 163, "all_code_blocks": "// Code block 1 (unknown):\nfunction transferOwnership(address newOwner) public virtual onlyOwner {\n owner = newOwner;\n\n emit OwnershipTransferred(msg.sender, newOwner);\n }\n}\n\n// Code block 2 (unknown):\nfunction setProtocolFeeRate(uint16 _protocolFeeRate) public onlyOwner {\n protocolFeeRate = _protocolFeeRate;\n }\n\n// Code block 3 (unknown):\nmodifier onlyOwner() virtual {\n if (msg.sender != Factory(factory).ownerOf(uint160(address(this)))) {\n revert Unauthorized();\n }\n _;\n }", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Factory.sol#L141-L143, PrivatePool.sol#L127-L132", "github_files_list": "PrivatePool.sol, Factory.sol", "github_refs_count": 2, "vulnerable_code_actual": " function transferOwnership(address newOwner) public virtual onlyOwner {\n owner = newOwner;\n\n emit OwnershipTransferred(msg.sender, newOwner);\n }\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function setProtocolFeeRate(uint16 _protocolFeeRate) public onlyOwner {\n protocolFeeRate = _protocolFeeRate;\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "01-biconomy", "title": "chrisdior4 G", "severity_raw": "Medium", "severity": "medium", "description": "# Gas Optimization Report\n\n| G-O |Issue|\n|:------:|:----|\n| [G‑01] | Use x != 0 instead of x > 0 for uint types | 2 |\n| [G‑02] | Use custom errors instead of revert strings | 6 |\n| [G‑03] | x = x - y costs less gas than x -= y, same for addition | 11 |\n| [G‑04] | Remove public visibility from constant variables | 19 |\n| [G‑05] | ++I/I++ SHOULD BE UNCHECKED{++I}/UNCHECKED{I++} WHEN IT IS NOT POSSIBLE FOR THEM TO OVERFLOW, AS IS THE CASE WHEN USED IN FOR-LOOP AND WHILE-LOOPS | 31 |\n| [G‑06] | BYTES CONSTANTS ARE MORE EFFICIENT THAN STRING CONSTANTS | 2 |\n| [G‑07] | Using Solidity version 0.8.17 will provide an overall gas optimization | 1 |\n| [G‑08] | THERE\u2019S NO NEED TO SET DEFAULT VALUES FOR VARIABLES | 1 |\n| [G‑09] | USING STORAGE INSTEAD OF MEMORY FOR STRUCTS/ARRAYS SAVES GAS -3 | 1 |\n| [G‑10] | ++I COSTS LESS GAS THAN I++, ESPECIALLY WHEN IT\u2019S USED IN FOR-LOOPS (--I/I-- TOO) | 1 |\n\n\n\n\nTotal: 10 issues\n\n## Gas Optimization\n\n### [G-01] Use custom errors instead of revert strings\n\nSolidity 0.8.4 added the custom errors functionality, which can be use instead of revert strings, resulting in big gas savings on errors. Replace all revert statements with custom error ones\n\nExample from `EntryPoint.sol`:\n\n```solidity\nrequire(beneficiary != address(0), \"AA90 invalid beneficiary\");\n```\n\nLine of code:\n\n- https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L36\n\n### [G-02] Use x != 0 instead of x > 0 for uint types\n\nThe != operator costs less gas than > and for uint types you can use it to check for non-zero values to save gas\n\nFile: `SmartAccount.sol`\n\n```solidity\n if (refundInfo.gasPrice > 0) {\n```\nLines of code:\n\n- https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L236\n\n### [G-03] x = ", "vulnerable_code": "require(beneficiary != address(0), \"AA90 invalid beneficiary\");", "fixed_code": " if (refundInfo.gasPrice > 0) {", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/chrisdior4-G.md", "collected_at": "2026-01-02T18:13:37.349061+00:00", "source_hash": "220d2a2bf234f4a1e06b61b8eda46552e45e94d8370760f27a16cc8a52dbf842", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 93, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "require(beneficiary != address(0), \"AA90 invalid beneficiary\");", "primary_code_language": "solidity", "primary_code_char_count": 63, "all_code_blocks": "// Code block 1 (solidity):\nrequire(beneficiary != address(0), \"AA90 invalid beneficiary\");\n\n// Code block 2 (solidity):\nif (refundInfo.gasPrice > 0) {", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "require(beneficiary != address(0), \"AA90 invalid beneficiary\");\n\nif (refundInfo.gasPrice > 0) {", "github_refs_formatted": "EntryPoint.sol#L36, SmartAccount.sol#L236", "github_files_list": "SmartAccount.sol, EntryPoint.sol", "github_refs_count": 2, "vulnerable_code_actual": "require(beneficiary != address(0), \"AA90 invalid beneficiary\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": " if (refundInfo.gasPrice > 0) {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-ondo", "title": "mookimgo Q", "severity_raw": "Gas", "severity": "gas", "description": "# event KYCAddressAddViaSignature should mark kycRequirementGroup as indexed\n\n```\n event KYCAddressAddViaSignature(\n address indexed sender,\n address indexed user,\n address indexed signer,\n uint256 kycRequirementGroup,\n uint256 deadline\n );\n\n event KYCAddressesAdded(\n address indexed sender,\n uint256 indexed kycRequirementGroup,\n address[] addresses\n );\n```\n\nAs shown above, event KYCAddressesAdded has kycRequirementGroup indexed, but KYCAddressAddViaSignature don't\n\nThis will make log search using eth_getLogs by kycRequirementGroup infeasible.\n\n**Suggestion**: remove sender index and add kycRequirementGroup index\n\n# event KYCAddressAddViaSignature, KYCAddressesAdded, and KYCAddressesRemoved should move kycRequirementGroup to the first indexed argument\n\nConsidering we want to search KYC'ed users for a specific kycRequirementGroup.\n\nUsing eth_getLogs will can not do that, as it can only specify `topics0, topics1, ...` in order (cannot search by topics2 without topics1), and in current design, user is placed before kycRequirementGroup.\n\n**Suggestion**: change to:\n\n```\n event KYCAddressAddViaSignature(\n uint256 indexed kycRequirementGroup,\n address indexed user,\n address indexed signer,\n address sender,\n uint256 deadline\n );\n\n event KYCAddressesAdded(\n uint256 indexed kycRequirementGroup,\n address indexed sender,\n address[] addresses\n );\n\n event KYCAddressesRemoved(\n uint256 indexed kycRequirementGroup,\n address indexed sender,\n address[] addresses\n );\n```\n\n# sanctionsList in KYCRegistry should also be set as a constant 0x40C57923924B5c5c5455c48D93317139ADDaC8fb\n\nAs cErc20ModifiedDelegator.sol has used this address constant:\n\n```\n ISanctionsList public constant sanctionsList =\n ISanctionsList(0x40C57923924B5c5c5455c48D93317139ADDaC8fb);\n````\n\nThere seems no needs to set a constructor parameter, suggest changing https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistry.sol#L4", "vulnerable_code": " event KYCAddressAddViaSignature(\n address indexed sender,\n address indexed user,\n address indexed signer,\n uint256 kycRequirementGroup,\n uint256 deadline\n );\n\n event KYCAddressesAdded(\n address indexed sender,\n uint256 indexed kycRequirementGroup,\n address[] addresses\n );", "fixed_code": " event KYCAddressAddViaSignature(\n uint256 indexed kycRequirementGroup,\n address indexed user,\n address indexed signer,\n address sender,\n uint256 deadline\n );\n\n event KYCAddressesAdded(\n uint256 indexed kycRequirementGroup,\n address indexed sender,\n address[] addresses\n );\n\n event KYCAddressesRemoved(\n uint256 indexed kycRequirementGroup,\n address indexed sender,\n address[] addresses\n );", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/mookimgo-Q.md", "collected_at": "2026-01-02T18:15:22.375386+00:00", "source_hash": "2211778d3dcba04e5bd31c310e7de5c713521ba96fe6450154e8012e3f87e69d", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 836, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "event KYCAddressAddViaSignature(\n address indexed sender,\n address indexed user,\n address indexed signer,\n uint256 kycRequirementGroup,\n uint256 deadline\n );\n\n event KYCAddressesAdded(\n address indexed sender,\n uint256 indexed kycRequirementGroup,\n address[] addresses\n );", "primary_code_language": "unknown", "primary_code_char_count": 299, "all_code_blocks": "// Code block 1 (unknown):\nevent KYCAddressAddViaSignature(\n address indexed sender,\n address indexed user,\n address indexed signer,\n uint256 kycRequirementGroup,\n uint256 deadline\n );\n\n event KYCAddressesAdded(\n address indexed sender,\n uint256 indexed kycRequirementGroup,\n address[] addresses\n );\n\n// Code block 2 (unknown):\nevent KYCAddressAddViaSignature(\n uint256 indexed kycRequirementGroup,\n address indexed user,\n address indexed signer,\n address sender,\n uint256 deadline\n );\n\n event KYCAddressesAdded(\n uint256 indexed kycRequirementGroup,\n address indexed sender,\n address[] addresses\n );\n\n event KYCAddressesRemoved(\n uint256 indexed kycRequirementGroup,\n address indexed sender,\n address[] addresses\n );\n\n// Code block 3 (unknown):\nISanctionsList public constant sanctionsList =\n ISanctionsList(0x40C57923924B5c5c5455c48D93317139ADDaC8fb);", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "KYCRegistry.sol#L4", "github_files_list": "KYCRegistry.sol", "github_refs_count": 1, "vulnerable_code_actual": " event KYCAddressAddViaSignature(\n address indexed sender,\n address indexed user,\n address indexed signer,\n uint256 kycRequirementGroup,\n uint256 deadline\n );\n\n event KYCAddressesAdded(\n address indexed sender,\n uint256 indexed kycRequirementGroup,\n address[] addresses\n );", "has_vulnerable_code_snippet": true, "fixed_code_actual": " event KYCAddressAddViaSignature(\n uint256 indexed kycRequirementGroup,\n address indexed user,\n address indexed signer,\n address sender,\n uint256 deadline\n );\n\n event KYCAddressesAdded(\n uint256 indexed kycRequirementGroup,\n address indexed sender,\n address[] addresses\n );\n\n event KYCAddressesRemoved(\n uint256 indexed kycRequirementGroup,\n address indexed sender,\n address[] addresses\n );", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "01-biconomy", "title": "martin Q", "severity_raw": "Low", "severity": "low", "description": "# Biconomy\n\n## QA Report\n\n### L-01 `_safeMint()` should be used rather than `_mint()` wherever possible\n\n```solidity\n12: _mint(sender, amount);\n```\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/test/MockToken.sol\n\n```solidity\n17: _mint(sender, amount);\n\n22: _mint(_for, amount);\n```\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/test/StakedTestToken.sol\n\n### L-02 `require()` should be used instead of `assert()`\n\n```solidity\n16: assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));\n```\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/Proxy.sol\n\n### L-03 Unused `receive()`/`fallback()` function\n\nIf the intention is for the Ether to be used, the function should call another function, otherwise it should revert (e.g. require(msg.sender == address(weth))). Having no access control on the function means that someone may send Ether to the contract, and have no way to get anything back out, which is a loss of funds\n\n```solidity\n550: receive() external payable {}\n```\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n\n```solidity\n540: receive() external payable {}\n```\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol\n\n### L-04 Approve return values aren't checked\n\n```solidity\n17: token.approve(paymaster, type(uint256).max);\n```\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/samples/SimpleAccountForTokens.sol\n\n### N-01 Use scientific notation (e.g. `1e18`) rather than exponentiation (e.g. 10`**`18)\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/libs/Math.sol\n\n### N-02 Non-floating `pragma` should be", "vulnerable_code": "12: _mint(sender, amount);", "fixed_code": "17: _mint(sender, amount);\n\n22: _mint(_for, amount);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/martin-Q.md", "collected_at": "2026-01-02T18:13:56.209625+00:00", "source_hash": "2213a6f74c15d4daa28059672cfd0ee87b6a89167567be7415138ab87a6b4b02", "code_block_count": 6, "solidity_block_count": 6, "total_code_chars": 299, "github_ref_count": 7, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "12: _mint(sender, amount);", "primary_code_language": "solidity", "primary_code_char_count": 26, "all_code_blocks": "// Code block 1 (solidity):\n12: _mint(sender, amount);\n\n// Code block 2 (solidity):\n17: _mint(sender, amount);\n\n22: _mint(_for, amount);\n\n// Code block 3 (solidity):\n16: assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));\n\n// Code block 4 (solidity):\n550: receive() external payable {}\n\n// Code block 5 (solidity):\n540: receive() external payable {}\n\n// Code block 6 (solidity):\n17: token.approve(paymaster, type(uint256).max);", "all_code_blocks_count": 6, "has_diff_blocks": false, "diff_code": "", "solidity_code": "12: _mint(sender, amount);\n\n17: _mint(sender, amount);\n\n22: _mint(_for, amount);\n\n16: assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));\n\n550: receive() external payable {}\n\n540: receive() external payable {}\n\n17: token.approve(paymaster, type(uint256).max);", "github_refs_formatted": "MockToken.sol, StakedTestToken.sol, Proxy.sol, SmartAccount.sol, SmartAccountNoAuth.sol, SimpleAccountForTokens.sol, Math.sol", "github_files_list": "SmartAccountNoAuth.sol, SimpleAccountForTokens.sol, MockToken.sol, StakedTestToken.sol, Proxy.sol, Math.sol, SmartAccount.sol", "github_refs_count": 7, "vulnerable_code_actual": "12: _mint(sender, amount);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "17: _mint(sender, amount);\n\n22: _mint(_for, amount);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 12} {"source": "c4", "protocol": "02-ethos", "title": "brgltd Q", "severity_raw": "Critical", "severity": "critical", "description": "# [01] Calling `ReaperVaultV2.setWithdrawalQueue()` passing a `_withdrawalQueue` array with less items than `strategies` can accidentaly make strategy items useless.\n\n## Proof of Concept\n\n`ReaperVaultV2.addStrategy()` will add a new strategy and populate the `withdrawalQueue` array and the `strategies` mapping. \n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L158-L166\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L169\n\nIf the admin calls `ReaperVaultV2.setWithdrawalQueue()` with a `withdrawalQueue` containing less items than `strategies`, the \"extra\" strategies will be ignored while iterating the `withdrawalQueue` in `ReaperVaultV2._withdraw()`.\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L372-L397\n\nThe likelyhood is small (since it depends on the admin inputting bad values), but the impact can be considerable, since the some strategies won't be accounted while making withdrawals.\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L385\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/abstract/ReaperBaseStrategyv4.sol#L95-L103\n\n## Impact\n\nThe strategy allocated value will be used to transfer funds from the strategy into the vault. These funds will be missing if the number of `withdrawalQueue` items is smaller than the number of items in `strategies`.\n\n## Recommended Mitigation Steps\n\nConsider adding a check on `ReaperVaultV2.setWithdrawalQueue()` to ensure the length of `_withdrawalQueue` matches the length of the existing `strategies`. This can be done by checking the length of the argument `_withdrawalQueue` with the current `withdrawalQueue`, since the current `strategies` mapping will have the same length as the current `withdrawalQueue` array.\n\n```diff\ndiff --git a/ReaperVaultV2.sol.orig b/ReaperVaultV2.sol\nindex 87de400..3eb078e 100644\n--- a/Rea", "vulnerable_code": "Alternatively, if setting a new `strategies` array with less items than the current `strategies` array is an expected functionality of the system, consider documenting this behavior in `ReaperVaultV2.setWithdrawalQueue()`.\n\n# [02] `ReaperVaultV2.revokeStrategy()` won't remove the allocated value\n\n## Impact\n\n`ReaperVaultV2.revokeStrategy()` will remove the vault assets that should be allocated to the strategy (in BPS), but it won't remove the actual amount currently allocated.\n\nThe allocated value will still be used for withdrawals and for computing the capital available.\n\n## Proof of Concept\n\n`ReaperVaultV2.revokeStrategy()` sets `strategy.allocBPS` and `totalAlloBPS` to zero, but it doesn't change `strategy.allocated` or `totalAllocated`.\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L205-L217\n\n`ReaperVaultV2._withdraw()` will use the allocated value for the strategie(s).\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L379-L385\n\nThe allocated value will also be used for retrieving the available capital, and for strategy reporting.\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L225-L252\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L493-L560\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L432-L453\n\n## Recommended Mitigation Steps\n\nUpdate `strategies[_strategy].allocBPS` and `totalAllocated` when revoking a strategy.\n\nAlternatively, if this behavior is intentional (not resetting `allocBPS` and decreasing `totalAllocated` when revoking a strategy), consider adding a comment on `ReaperVaultV2.revokeStrategy()`. The comment on [L202](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L202) indicates that `ReaperVaultV2.revokeStrategy()` will remove any allocation.\n\n# [03] Incorrect bookkee", "fixed_code": "# [45] Statements can be simplified\n\nThe [Math.min](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L244-L246) logic for `ReaperVaultV2.availableCapital()` can be simplified to the following:\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/brgltd-Q.md", "collected_at": "2026-01-02T18:16:52.613632+00:00", "source_hash": "2228083228a5a58a5e9994eb05fdcc77384fe57df31e93a48dcf4f37c168efca", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 12, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ReaperVaultV2.sol#L158-L166, ReaperVaultV2.sol#L169, ReaperVaultV2.sol#L372-L397, ReaperVaultV2.sol#L385, ReaperBaseStrategyv4.sol#L95-L103, ReaperVaultV2.sol#L205-L217, ReaperVaultV2.sol#L379-L385, ReaperVaultV2.sol#L225-L252, ReaperVaultV2.sol#L493-L560, ReaperVaultV2.sol#L432-L453, ReaperVaultV2.sol#L202, ReaperVaultV2.sol#L244-L246", "github_files_list": "ReaperBaseStrategyv4.sol, ReaperVaultV2.sol", "github_refs_count": 12, "vulnerable_code_actual": "Alternatively, if setting a new `strategies` array with less items than the current `strategies` array is an expected functionality of the system, consider documenting this behavior in `ReaperVaultV2.setWithdrawalQueue()`.\n\n# [02] `ReaperVaultV2.revokeStrategy()` won't remove the allocated value\n\n## Impact\n\n`ReaperVaultV2.revokeStrategy()` will remove the vault assets that should be allocated to the strategy (in BPS), but it won't remove the actual amount currently allocated.\n\nThe allocated value will still be used for withdrawals and for computing the capital available.\n\n## Proof of Concept\n\n`ReaperVaultV2.revokeStrategy()` sets `strategy.allocBPS` and `totalAlloBPS` to zero, but it doesn't change `strategy.allocated` or `totalAllocated`.\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L205-L217\n\n`ReaperVaultV2._withdraw()` will use the allocated value for the strategie(s).\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L379-L385\n\nThe allocated value will also be used for retrieving the available capital, and for strategy reporting.\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L225-L252\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L493-L560\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L432-L453\n\n## Recommended Mitigation Steps\n\nUpdate `strategies[_strategy].allocBPS` and `totalAllocated` when revoking a strategy.\n\nAlternatively, if this behavior is intentional (not resetting `allocBPS` and decreasing `totalAllocated` when revoking a strategy), consider adding a comment on `ReaperVaultV2.revokeStrategy()`. The comment on [L202](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L202) indicates that `ReaperVaultV2.revokeStrategy()` will remove any allocation.\n\n# [03] Incorrect bookkee", "has_vulnerable_code_snippet": true, "fixed_code_actual": "# [45] Statements can be simplified\n\nThe [Math.min](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L244-L246) logic for `ReaperVaultV2.availableCapital()` can be simplified to the following:\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "03-asymmetry", "title": "Josiah Q", "severity_raw": "Critical", "severity": "critical", "description": "## USERS' ETH STUCK IN THE CONTRACT DUE TO UNINITIALIZED VARIABLES\nIn SatEth.sol, `initialize()` does not have `derivatives` and `weights` setup. Because `stake()` is unpaused upon contract deployment, users could start staking with `derivativeCount` still equal to zero. As a result, all for loops are skipped while `preDepositPrice` is set to 10 ** 18.\n\nIn the end, `mintAmount` is assigned 0 while the ETH sent in belongs to the contract that will be irretrievable by anyone.\n\nSuggested fix:\n\nIt is recommended initializing `derivatives` and `weights` in [`initialize()`](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L48-L56). \n\n## IRRETRIEVABLE ETH IN SAFETH CONTRACT\nIn conjunction to above finding, users` ETH stuck in SafEth.sol is irretrievable. Neither can the contract owner do anything about it. Additionally, there might be other reasons where ETH would be stuck in the contract, e.g. mistakenly sent into the contract or recipient contract non-existence leading to successful call() but zero ETH sent. \n\nSuggested fix:\n\nIt is recommended having a withdraw function implemented or have [`rebalanceToWeights()`](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L138) refactored such that `address(this).balance` instead of `ethAmountToRebalance = ethAmountAfter - ethAmountBefore` is used when repositing to the derivatives. At least, the unreachable ETH could be distributed to all existing stakers in the system. \n\n## MODERN MODULARITY ON IMPORT USAGES\nFor cleaner Solidity code in conjunction with the rule of modularity and modular programming, it is recommended using named imports with curly braces (limiting to the needed instances if possible) instead of adopting the global import approach.\n\nSuggested fix for a contract instance as an example:\n\n[SfrxEth.sol#L4-L9](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol#L4-L9)\n\n```\nimport {IDerivati", "vulnerable_code": "import {IDerivative} frpm \"../../interfaces/IDerivative.sol\";\nimport {IsFrxEth} from \"../../interfaces/frax/IsFrxEth.sol\";\nimport {OwnableUpgradeable} from \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {IFrxEthEthPool} from \"../../interfaces/curve/IFrxEthEthPool.sol\";\nimport {IFrxETHMinter} from \"../../interfaces/frax/IFrxETHMinter.sol\";", "fixed_code": " /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Josiah-Q.md", "collected_at": "2026-01-02T18:18:13.444066+00:00", "source_hash": "222adc09e27957b6d43f388332137b65537af335c61a030d81dc4218f25a12d5", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol#L48-L56, SafEth.sol#L138, SfrxEth.sol#L4-L9", "github_files_list": "SfrxEth.sol, SafEth.sol", "github_refs_count": 3, "vulnerable_code_actual": "import {IDerivative} frpm \"../../interfaces/IDerivative.sol\";\nimport {IsFrxEth} from \"../../interfaces/frax/IsFrxEth.sol\";\nimport {OwnableUpgradeable} from \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {IFrxEthEthPool} from \"../../interfaces/curve/IFrxEthEthPool.sol\";\nimport {IFrxETHMinter} from \"../../interfaces/frax/IFrxETHMinter.sol\";", "has_vulnerable_code_snippet": true, "fixed_code_actual": " /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "10-badger", "title": "flutter_developer G", "severity_raw": "High", "severity": "high", "description": "\n\n## Gas Optimization \n\n\n| No | Instance | Description |\n\n| [G-01] | Manages system-level internal accounting and stETH tokens.|\n| [G-02] | Entry point to Open, Adjust, and Close Cdps as well as delegate positionManagers.|\n| [G-03] | \tCdp operations and entry point for non-borrower operations on Cdps (Liquidations, Redemptions).|\n| [G-04] | \tContains liquidation-related functions. Split off due to maximum contract size, delegateCalled by CdpManager.|\n| [G-05] | \tShared storage variables between CdpManager and Liquidation Library, and common functions.|\n| [G-06] | Isolated storage of excess collateral owed to users from liquidations or redemptions. Not considered part of system for accounting.|\n| [G-07] | ERC20 EbtcToken, with permit approvals and extensible minting.|\n| [G-08] | Roles-based authorization contract, adapted and expanded from solmate Authority. Expanded with more convenience view functions and ability to permanently burn capabilities.|\n| [G-09] | riceFeed with primary and secondary oracles and state machine to switch between them and handle failure cases. |\n\n| [G-10]| \tData storage for the doubly-linked list of Cdps. Sorting of Cdps is used to enforce redemptions from lowest ICR to highest ICR.|\n\n| [G-11] | Generate approximate locations for proper linked list insertion locations for Cdps.|\n\n| [G-12] common base implementation of the LeverageMacro.|\n\n| [G-13] LeverageMacro variant for use with delegateCall with compatible smart wallets.|\n\n| [G-14] \tFactory for deploying LeverageMacroReference.|\n\n| [G-15] LeverageMacro variant for use as a zap with an individual owner.|\n\n| [G-16] Smart wallet with custom callback handler support.|\n\n| [G-17] Inherited by contracts consuming authorization rules of Governor.|\n\n| [G-18] \tInherited by contracts consuming authorization rules of Governor. Removes owner address that has global 'admin' permission from Auth.|\n\n| [G-19] Base for standardized flash loans|\n\n| [G-20] Common definition and base functions for system ", "vulnerable_code": "file: packages/contracts/contracts/ActivePool.sol", "fixed_code": "https://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/ActivePool.sol#L183", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/flutter_developer-G.md", "collected_at": "2026-01-02T18:26:49.171750+00:00", "source_hash": "224f02fb3135b64ebc71bf3e1f196b672aea491fa6718a6d19bc41783f598fad", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ActivePool.sol#L183", "github_files_list": "ActivePool.sol", "github_refs_count": 1, "vulnerable_code_actual": "file: packages/contracts/contracts/ActivePool.sol", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "01-ondo", "title": "martin Q", "severity_raw": "Low", "severity": "low", "description": "# Ondo Finance\n\n## QA Report\n\n### L-01 `_safeMint()` should be used rather than `_mint()` wherever possible\n\n_There are **2** instances of this issue:_\n\n```solidity\n260: cash.mint(user, cashOwed);\n\n791: cash.mint(refundee, cashAmountBurned);\n```\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol\n\n### L-02 `require()` should be used instead of `assert()`\n\n_There are **1** instances of this issue:_\n\n```solidity\n97: assert(cashProxyAdmin.owner() == guardian);\n```\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashFactory.sol\n\n### L-03 Very old version of solidity\n\nThis could have serious security implications due to the bug fixes in the new versions.\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/JumpRateModelV2.sol\n\n### L-04 Modifiers shouldn\u2019t update state\n\n_There are **2** instances of this issue:_\n\n```solidity\n1434: modifier nonReentrant() {\n```\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cCash/CTokenCash.sol\n\n```solidity\n1437: modifier nonReentrant() {\n```\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cToken/CTokenModified.sol\n\n### N-01 Non-floating `pragma` should be used\n\nNot using same version of solidity for different smart contracts is inconcistency, but it could also lead to security holes.\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cCash/CCashDelegate.sol\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cToken/CTokenDelegate.sol\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/JumpRateModelV2.sol\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cCash/CCash.sol\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cToken/CErc20.sol\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cCash/CTokenInterfacesModifiedCash.sol\n\nhttps://githu", "vulnerable_code": "260: cash.mint(user, cashOwed);\n\n791: cash.mint(refundee, cashAmountBurned);", "fixed_code": "97: assert(cashProxyAdmin.owner() == guardian);", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/martin-Q.md", "collected_at": "2026-01-02T18:15:20.564070+00:00", "source_hash": "22729d4f65e6a1368d22993b2bf7b9182ec5ec1092f3f0bbb722c022b222246e", "code_block_count": 4, "solidity_block_count": 4, "total_code_chars": 186, "github_ref_count": 10, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "260: cash.mint(user, cashOwed);\n\n791: cash.mint(refundee, cashAmountBurned);", "primary_code_language": "solidity", "primary_code_char_count": 76, "all_code_blocks": "// Code block 1 (solidity):\n260: cash.mint(user, cashOwed);\n\n791: cash.mint(refundee, cashAmountBurned);\n\n// Code block 2 (solidity):\n97: assert(cashProxyAdmin.owner() == guardian);\n\n// Code block 3 (solidity):\n1434: modifier nonReentrant() {\n\n// Code block 4 (solidity):\n1437: modifier nonReentrant() {", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "260: cash.mint(user, cashOwed);\n\n791: cash.mint(refundee, cashAmountBurned);\n\n97: assert(cashProxyAdmin.owner() == guardian);\n\n1434: modifier nonReentrant() {\n\n1437: modifier nonReentrant() {", "github_refs_formatted": "CashManager.sol, CashFactory.sol, JumpRateModelV2.sol, CTokenCash.sol, CTokenModified.sol, CCashDelegate.sol, CTokenDelegate.sol, CCash.sol, CErc20.sol, CTokenInterfacesModifiedCash.sol", "github_files_list": "CashManager.sol, CTokenCash.sol, CTokenModified.sol, CErc20.sol, CashFactory.sol, CTokenDelegate.sol, JumpRateModelV2.sol, CTokenInterfacesModifiedCash.sol, CCash.sol, CCashDelegate.sol", "github_refs_count": 10, "vulnerable_code_actual": "260: cash.mint(user, cashOwed);\n\n791: cash.mint(refundee, cashAmountBurned);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "97: assert(cashProxyAdmin.owner() == guardian);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "02-ethos", "title": "obsessed Q", "severity_raw": "Low", "severity": "low", "description": "# Report\n\n## QA Findings\n\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [L-1] | Usage of outdated solidity compiler | 9 |\n| [L-2] | Not following the NATSPEC convention | Many instances |\n| [L-3] | Function names are not readable | 2 |\n| [L-4] | Function _burn should also clear approval for underlying token | 1 |\n| [NC-1] | Unjustified usage of the '_' symbol in numbers | 3 |\n| [NC-2] | Code layout is out of order | 1 |\n| [NC-3] | Function and modifier have the same functionality | 2 |\n| [NC-4] | Interchangeable usage of uint and uint256 | Many instances |\n| [NC-5] | Incorrect use of uppercase letters for non constant variable | 1 |\n| [NC-6] | Local and state variables should use mixedCase letters | 2 |\n| [NC-7] | Defined events are not used | 2 |\n| [NC-8] | Usage of keyword 'super' will improve readability | 1 |\n| [NC-9] | One letter and uppercased variables | 1 |\n\n### [L-1] Usage of outdated solidity compiler\nUsage of outdated solidity compiler is a security risk because of well known old vulnerabilites, should be avoided.\n\n*Instances (9)*:\n```solidity\nFile: ActivePool.sol\nFile: BorrowerOperations.sol\nFile: CollateralConfig.sol\nFile: CommunityIssuance.sol\nFile: LQTYStaking.sol\nFile: LUSDToken.sol\nFile: StabilityPool.sol\nFile: TroveManager.sol\n```\n\n### [L-2] Not following the NATSPEC convention\nNot following the NATSPEC convention leads to poor documentation and very low readability. In many places there are no comments whatsoever.\n\n### [L-3] Function names are not readable \nFunction names that are not readable lowers clarity of the code.\n\n*Instances (2)*:\n```solidity\nFile: ActivePool.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol#L327-L342\n\n function _requireCallerIsBOorTroveMorSP() internal view {\n function _requireCallerIsBOorTroveM() internal view {\n\nFile: LUSDToken.sol\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L365-L373\n\n function _requireCallerIsBOorTroveMorSP() intern", "vulnerable_code": "File: ActivePool.sol\nFile: BorrowerOperations.sol\nFile: CollateralConfig.sol\nFile: CommunityIssuance.sol\nFile: LQTYStaking.sol\nFile: LUSDToken.sol\nFile: StabilityPool.sol\nFile: TroveManager.sol", "fixed_code": "File: ActivePool.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol#L327-L342\n\n function _requireCallerIsBOorTroveMorSP() internal view {\n function _requireCallerIsBOorTroveM() internal view {\n\nFile: LUSDToken.sol\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L365-L373\n\n function _requireCallerIsBOorTroveMorSP() internal view {", "recommendation": "", "category": "rounding", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/obsessed-Q.md", "collected_at": "2026-01-02T18:17:25.326511+00:00", "source_hash": "22c7c639d20de7b1700ec615e5e36b5499331f84fcf56809c35eda7dbf37e996", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 193, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: ActivePool.sol\nFile: BorrowerOperations.sol\nFile: CollateralConfig.sol\nFile: CommunityIssuance.sol\nFile: LQTYStaking.sol\nFile: LUSDToken.sol\nFile: StabilityPool.sol\nFile: TroveManager.sol", "primary_code_language": "solidity", "primary_code_char_count": 193, "all_code_blocks": "// Code block 1 (solidity):\nFile: ActivePool.sol\nFile: BorrowerOperations.sol\nFile: CollateralConfig.sol\nFile: CommunityIssuance.sol\nFile: LQTYStaking.sol\nFile: LUSDToken.sol\nFile: StabilityPool.sol\nFile: TroveManager.sol", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: ActivePool.sol\nFile: BorrowerOperations.sol\nFile: CollateralConfig.sol\nFile: CommunityIssuance.sol\nFile: LQTYStaking.sol\nFile: LUSDToken.sol\nFile: StabilityPool.sol\nFile: TroveManager.sol", "github_refs_formatted": "ActivePool.sol#L327-L342, LUSDToken.sol#L365-L373", "github_files_list": "LUSDToken.sol, ActivePool.sol", "github_refs_count": 2, "vulnerable_code_actual": "File: ActivePool.sol\nFile: BorrowerOperations.sol\nFile: CollateralConfig.sol\nFile: CommunityIssuance.sol\nFile: LQTYStaking.sol\nFile: LUSDToken.sol\nFile: StabilityPool.sol\nFile: TroveManager.sol", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: ActivePool.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol#L327-L342\n\n function _requireCallerIsBOorTroveMorSP() internal view {\n function _requireCallerIsBOorTroveM() internal view {\n\nFile: LUSDToken.sol\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L365-L373\n\n function _requireCallerIsBOorTroveMorSP() internal view {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-biconomy", "title": "0xhacksmithh Q", "severity_raw": "High", "severity": "high", "description": "\n### [Low-01] Old Solidity\n*Instances(36)*\nThe minimum required version must be\u00a0[0.8.17](https://github.com/ethereum/solidity/releases/tag/v0.8.17); otherwise, contracts will be affected by the following\u00a0**important bug fixes**:\n\n[0.8.14](https://blog.soliditylang.org/2022/05/18/solidity-0.8.14-release-announcement/):\n\n- ABI Encoder: When ABI-encoding values from calldata that contain nested arrays, correctly validate the nested array length against\u00a0`calldatasize()`\u00a0in all cases.\n- Override Checker: Allow changing data location for parameters only when overriding external functions.\n\n[0.8.15](https://blog.soliditylang.org/2022/06/15/solidity-0.8.15-release-announcement/)\n\n- Code Generation: Avoid writing dirty bytes to storage when copying\u00a0`bytes`\u00a0arrays.\n- Yul Optimizer: Keep all memory side-effects of inline assembly blocks.\n\n[0.8.16](https://blog.soliditylang.org/2022/08/08/solidity-0.8.16-release-announcement/)\n\n- Code Generation: Fix data corruption that affected ABI-encoding of calldata values represented by tuples: structs at any nesting level; argument lists of external functions, events and errors; return value lists of external functions. The 32 leading bytes of the first dynamically-encoded value in the tuple would get zeroed when the last component contained a statically-encoded array.\n\n[0.8.17](https://blog.soliditylang.org/2022/09/08/solidity-0.8.17-release-announcement/)\n\n- Yul Optimizer: Prevent the incorrect removal of storage writes before calls to Yul functions that conditionally terminate the external EVM call.\n\nApart from these, there are several minor bug fixes and improvements.\n\n### [Low-02] Multiple Solidity version used\n\nBelow contracts using Solidity ```0.8.12```\n```solidity \nFile: BaseSmartAccount.sol\nFile: Proxy.sol\nFile: SmartAccount.sol\nFile: SmartAccountFactory.sol\nFile: interfaces/ISignatureValidator.sol\nFile: interfaces/ERC1155TokenReceiver.sol\nFile: interfaces/ERC721TokenReceiver.sol\nFile: interfaces/ERC777TokensRecipient.sol\nFile: ", "vulnerable_code": "```solidity \nFile: BaseSmartAccount.sol\nFile: Proxy.sol\nFile: SmartAccount.sol\nFile: SmartAccountFactory.sol\nFile: interfaces/ISignatureValidator.sol\nFile: interfaces/ERC1155TokenReceiver.sol\nFile: interfaces/ERC721TokenReceiver.sol\nFile: interfaces/ERC777TokensRecipient.sol\nFile: interfaces/IERC1271Wallet.sol\nFile: common/Singleton.sol\nFile: common/SignatureDecoder.sol\nFile: base/Executor.sol\nFile: common/SecuredTokenTransfer.sol\nFile: base/ModuleManager.sol\nFile: base/FallbackManager.sol\nFile: interfaces/IERC165.sol\nFile: libs/Math.sol\nFile: libs/LibAddress.sol\nFile: paymasters/PaymasterHelpers.sol\nFile: paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol\nFile: common/Enum.sol\nFile: libs/MultiSend.sol\nFile: MultiSendCallOnly.sol", "fixed_code": "```solidity \nFile: aa-4337/interfaces/IAccount.sol\nFile: aa-4337/core/EntryPoint.sol\nFile: aa-4337/core/SenderCreator.sol\nFile: aa-4337/core/StakeManager.sol\nFile: aa-4337/utils/Exec.sol\nFile: aa-4337/interfaces/IAggregator.sol\nFile: aa-4337/interfaces/UserOperation.sol\nFile: aa-4337/interfaces/IStakeManager.sol\nFile: aa-4337/interfaces/IEntryPoint.sol\nFile: aa-4337/interfaces/IAggregatedAccount.sol\nFile: aa-4337/interfaces/IPaymaster.sol\nFile: paymasters/BasePaymaster.sol", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/0xhacksmithh-Q.md", "collected_at": "2026-01-02T18:12:50.870029+00:00", "source_hash": "22f1451607c816ab4dd776890985908267dbec2a7a15f2168e99476b5430e747", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "```solidity \nFile: BaseSmartAccount.sol\nFile: Proxy.sol\nFile: SmartAccount.sol\nFile: SmartAccountFactory.sol\nFile: interfaces/ISignatureValidator.sol\nFile: interfaces/ERC1155TokenReceiver.sol\nFile: interfaces/ERC721TokenReceiver.sol\nFile: interfaces/ERC777TokensRecipient.sol\nFile: interfaces/IERC1271Wallet.sol\nFile: common/Singleton.sol\nFile: common/SignatureDecoder.sol\nFile: base/Executor.sol\nFile: common/SecuredTokenTransfer.sol\nFile: base/ModuleManager.sol\nFile: base/FallbackManager.sol\nFile: interfaces/IERC165.sol\nFile: libs/Math.sol\nFile: libs/LibAddress.sol\nFile: paymasters/PaymasterHelpers.sol\nFile: paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol\nFile: common/Enum.sol\nFile: libs/MultiSend.sol\nFile: MultiSendCallOnly.sol", "has_vulnerable_code_snippet": true, "fixed_code_actual": "```solidity \nFile: aa-4337/interfaces/IAccount.sol\nFile: aa-4337/core/EntryPoint.sol\nFile: aa-4337/core/SenderCreator.sol\nFile: aa-4337/core/StakeManager.sol\nFile: aa-4337/utils/Exec.sol\nFile: aa-4337/interfaces/IAggregator.sol\nFile: aa-4337/interfaces/UserOperation.sol\nFile: aa-4337/interfaces/IStakeManager.sol\nFile: aa-4337/interfaces/IEntryPoint.sol\nFile: aa-4337/interfaces/IAggregatedAccount.sol\nFile: aa-4337/interfaces/IPaymaster.sol\nFile: paymasters/BasePaymaster.sol", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "06-lybra", "title": "ReyAdmirado G", "severity_raw": "High", "severity": "high", "description": "| | issue |\n| ----------- | ----------- |\n| 1 | [state variables can be packed into fewer storage slots](#1-state-variables-can-be-packed-into-fewer-storage-slots) |\n| 2 | [expressions for constant values such as a call to keccak256(), should use immutable rather than constant](#2-expressions-for-constant-values-such-as-a-call-to-keccak256-should-use-immutable-rather-than-constant) |\n| 3 | [state variables should be cached in stack variables rather than re-reading them from storage](#3-state-variables-should-be-cached-in-stack-variables-rather-than-re-reading-them-from-storage-ones-not-found-in-bot-audit) |\n| 4 | [can make the variable outside the loop to save gas](#4-can-make-the-variable-outside-the-loop-to-save-gas) |\n| 5 | [Avoid a SLOAD optimistically](#5-avoid-a-sload-optimistically) |\n| 6 | [using `calldata` instead of `memory` for read-only arguments in external functions saves gas](#6-using-calldata-instead-of-memory-for-read-only-arguments-in-external-functions-saves-gas) |\n| 7 | [Ternary over if ... else](#7-ternary-over-if--else) |\n| 8 | [Use assembly to check for address(0)](#8-use-assembly-to-check-for-address0) |\n| 9 | [state variable should be declared as constant which saves lots of gas](#9-state-variable-should-be-declared-as-constant-which-saves-lots-of-gas) |\n| 10 | [part of the code can be pre calculated](#10-part-of-the-code-can-be-pre-calculated) |\n| 11 | [cache parts of code for second use](#11-cache-parts-of-code-for-second-use) |\n| 12 | [Non-usage of specific imports](#12-non-usage-of-specific-imports) |\n\n\n\n## 1. state variables can be packed into fewer storage slots\n\nIf variables occupying the same slot are both written the same function or by the constructor, avoids a separate Gsset (20000 gas). Reads of the variables are also cheaper.\n\n`stableToken` and `premiumTradingEnabled` can be put together into one slot reducing slots used by 1 and also they are accessed in one function.\n- [LybraConfigurator.sol#L59-L61](https://github.com/code-42", "vulnerable_code": "import {OwnableUpgradeable} from \"openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol\";\nimport {SafeTransferLib} from \"solmate/utils/SafeTransferLib.sol\";\nimport {SafeCastLib} from \"solmate/utils/SafeCastLib.sol\";\nimport {ERC20} from \"solmate/tokens/ERC20.sol\";\nimport {IProducer} from \"src/interfaces/IProducer.sol\";\nimport {GlobalState, UserState} from \"src/Common.sol\";", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/ReyAdmirado-G.md", "collected_at": "2026-01-02T18:22:38.635388+00:00", "source_hash": "22f39e0f5d5ee327a8e3cc9f28c5f002ac1e95be29d26da5033b075b694f720b", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "import {OwnableUpgradeable} from \"openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol\";\nimport {SafeTransferLib} from \"solmate/utils/SafeTransferLib.sol\";\nimport {SafeCastLib} from \"solmate/utils/SafeCastLib.sol\";\nimport {ERC20} from \"solmate/tokens/ERC20.sol\";\nimport {IProducer} from \"src/interfaces/IProducer.sol\";\nimport {GlobalState, UserState} from \"src/Common.sol\";", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4} {"source": "c4", "protocol": "01-ondo", "title": "0xSmartContract G", "severity_raw": "High", "severity": "high", "description": "### Gas Optimizations List\n| Number | Optimization Details | Context |\n|:--:|:-------| :-----:|\n| [G-01] | Remove the `initializer` modifier |28 |\n| [G-02] |Use hardcode address instead ``address(this)``| 50 |\n| [G-03] |Duplicated require()/if() checks should be refactored to a modifier or function |17 |\n| [G-04] | Using ``delete`` instead of setting state variable/mapping to ``0`` saves gas |5 |\n| [G-05] | Using ``delete`` instead of setting ``address(0)`` saves gas |6|\n| [G-06] |Updating the `currentEpoch`` state variable again wastes gas |1 |\n| [G-07] |Unnecessary computation | 7 |\n| [G-08] | Don't use _msgSender() if not supporting EIP-2771 | 3 |\n| [G-09] | Add ``unchecked {}`` for subtractions where the operands cannot underflow because of a previous ``require`` or ``if`` statemen | 2 |\n| [G-10] | Empty blocks should be removed or emit something | 3 |\n| [G-11] | Use ``require`` instead of ``assert`` |3 |\n| [G-12] |Use ``assembly`` to write _address storage values_ | 28 |\n| [G-13] | Setting the _constructor_ to `payable` | 14 |\n| [G-14] |Use ``double require`` instead of using ``&&`` | 3 |\n| [G-15] |Sort Solidity operations using short-circuit mode | 2 |\n| [G-16] |`x += y (x -= y)` costs more gas than `x = x + y (x = x - y)` for state variables | 3 |\n| [G-17] |Upgrade Solidity's optimizer | |\n| [G-18] |Optimize names to save gas|All contracts |\n| [G-19] |Use a more recent version of solidity | 27 |\n\nTotal 19 issues\n\n\n### [G-01] Remove the `initializer` modifier\n\nif we can just ensure that the `initialize()` function could only be called from within the constructor, we shouldn't need to worry about it getting called again. \n\n2 results - 2 files:\n```solidity\ncontracts\\cash\\token\\CashKYCSenderReceiver.sol:\n 46: function initialize(\n 51 ) public initializer {\n```\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/token/CashKYCSender.sol#L46\n\n\n```solidity\ncontracts\\cash\\token\\CashKYCSenderReceiver.sol:\n 46: function initialize(\n ", "vulnerable_code": "contracts\\cash\\token\\CashKYCSenderReceiver.sol:\n 46: function initialize(\n 51 ) public initializer {", "fixed_code": "contracts\\cash\\token\\CashKYCSenderReceiver.sol:\n 46: function initialize(\n 51 ) public initializer {", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/0xSmartContract-G.md", "collected_at": "2026-01-02T18:14:21.627113+00:00", "source_hash": "23031ffdff0ccf4a37304c854fd10f3c787c169616028b4e3704b99f88b396b9", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 106, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "contracts\\cash\\token\\CashKYCSenderReceiver.sol:\n 46: function initialize(\n 51 ) public initializer {", "primary_code_language": "solidity", "primary_code_char_count": 106, "all_code_blocks": "// Code block 1 (solidity):\ncontracts\\cash\\token\\CashKYCSenderReceiver.sol:\n 46: function initialize(\n 51 ) public initializer {", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "contracts\\cash\\token\\CashKYCSenderReceiver.sol:\n 46: function initialize(\n 51 ) public initializer {", "github_refs_formatted": "CashKYCSender.sol#L46", "github_files_list": "CashKYCSender.sol", "github_refs_count": 1, "vulnerable_code_actual": "contracts\\cash\\token\\CashKYCSenderReceiver.sol:\n 46: function initialize(\n 51 ) public initializer {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "contracts\\cash\\token\\CashKYCSenderReceiver.sol:\n 46: function initialize(\n 51 ) public initializer {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-asymmetry", "title": "4lulz G", "severity_raw": "Gas", "severity": "gas", "description": "## Max approval\n\nAll derivative contracts could pre-approve maximum value `type(uint256).max` to reduce `CALL` operations for each transaction.\n\n### `Reth.sol` \n\nAdd maximum approval in [`initialize`](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/Reth.sol#L42).\n\n```Solidity\nIERC20(W_ETH_ADDRESS).approve(UNISWAP_ROUTER, type(uint256).max);\n```\n\nAnd remove approval in [`swapExactInputSingleHop`](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/Reth.sol#L83).\n\n### `SfrxEth.sol` \n\nAdd maximum approval in [`initialize`](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/SfrxEth.sol#L36).\n\n```Solidity\nIsFrxEth(FRX_ETH_ADDRESS).approve(FRX_ETH_CRV_POOL_ADDRESS, type(uint256).max);\n```\n\nAnd remove approval in [`withdraw`](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/SfrxEth.sol#L60).\n\n### `WstEth.sol`\n\nAdd maximum approval in [`initialize`](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/WstEth.sol#L33).\n\n```Solidity\nIERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, type(uint256).max);\n```\n\nAnd remove approval in [`withdraw`](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/WstEth.sol#L56).\n\n## Redundant calculations `SafEth`\n\nFunctions [`adjustWeight`](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L165) and ['addDerivative'](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L182) recalculates `totalWeight` iterating over all `weights`.\nThe more efficient way:\n ### [`adjustWeight`](https://git", "vulnerable_code": "IERC20(W_ETH_ADDRESS).approve(UNISWAP_ROUTER, type(uint256).max);", "fixed_code": "IsFrxEth(FRX_ETH_ADDRESS).approve(FRX_ETH_CRV_POOL_ADDRESS, type(uint256).max);", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/4lulz-G.md", "collected_at": "2026-01-02T18:17:47.687425+00:00", "source_hash": "233e5ffa911c927f6181f2fba8b7a139ca380a535b05f18843164f9446d38abd", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 206, "github_ref_count": 8, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "IERC20(W_ETH_ADDRESS).approve(UNISWAP_ROUTER, type(uint256).max);", "primary_code_language": "Solidity", "primary_code_char_count": 65, "all_code_blocks": "// Code block 1 (Solidity):\nIERC20(W_ETH_ADDRESS).approve(UNISWAP_ROUTER, type(uint256).max);\n\n// Code block 2 (Solidity):\nIsFrxEth(FRX_ETH_ADDRESS).approve(FRX_ETH_CRV_POOL_ADDRESS, type(uint256).max);\n\n// Code block 3 (Solidity):\nIERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, type(uint256).max);", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "IERC20(W_ETH_ADDRESS).approve(UNISWAP_ROUTER, type(uint256).max);\n\nIsFrxEth(FRX_ETH_ADDRESS).approve(FRX_ETH_CRV_POOL_ADDRESS, type(uint256).max);\n\nIERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, type(uint256).max);", "github_refs_formatted": "Reth.sol#L42, Reth.sol#L83, SfrxEth.sol#L36, SfrxEth.sol#L60, WstEth.sol#L33, WstEth.sol#L56, SafEth.sol#L165, SafEth.sol#L182", "github_files_list": "SfrxEth.sol, Reth.sol, WstEth.sol, SafEth.sol", "github_refs_count": 8, "vulnerable_code_actual": "IERC20(W_ETH_ADDRESS).approve(UNISWAP_ROUTER, type(uint256).max);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "IsFrxEth(FRX_ETH_ADDRESS).approve(FRX_ETH_CRV_POOL_ADDRESS, type(uint256).max);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "07-amphora", "title": "DavidGiladi G", "severity_raw": "High", "severity": "high", "description": "\n\n### Gas Optimization Issues\n|Title|Issue|Instances|Total Gas Saved|\n|-|:-|:-:|:-:|\n|[G-1] Inefficient use of abi.encode() | [Inefficient use of abi.encode()](#inefficient-use-of-abiencode) | 7 | 700 |\n|[G-2] Avoid unnecessary storage updates | [Avoid unnecessary storage updates](#avoid-unnecessary-storage-updates) | 21 | 16800 |\n|[G-3] Multiplication and Division by 2 Should use in Bit Shifting | [Multiplication and Division by 2 Should use in Bit Shifting](#multiplication-and-division-by-2-should-use-in-bit-shifting) | 2 | 40 |\n|[G-4] Check Arguments Early | [Check Arguments Early](#check-arguments-early) | 10 | - |\n|[G-5] Division operations between unsigned could be unchecked | [Division operations between unsigned could be unchecked](#division-operations-between-unsigned-could-be-unchecked) | 5 | 425 |\n|[G-6] Cache External Calls in Loops | [Cache External Calls in Loops](#cache-external-calls-in-loops) | 2 | 200 |\n|[G-7] Greater or Equal Comparison Costs Less Gas than Greater Comparison | [Greater or Equal Comparison Costs Less Gas than Greater Comparison](#greater-or-equal-comparison-costs-less-gas-than-greater-comparison) | 3 | 9 |\n|[G-8] Using Storage Instead of Memory for structs/arrays Saves Gas | [Using Storage Instead of Memory for structs/arrays Saves Gas](#using-storage-instead-of-memory-for-structsarrays-saves-gas) | 5 | 21000 |\n|[G-9] Optimal State Variable Order | [Optimal State Variable Order](#optimal-state-variable-order) | 1 | 5000 |\n|[G-10] Short-circuit rules can be used to optimize some gas usage | [Short-circuit rules can be used to optimize some gas usage](#short-circuit-rules-can-be-used-to-optimize-some-gas-usage) | 1 | 2100 |\n|[G-11] Unnecessary Casting of Variables | [Unnecessary Casting of Variables](#unnecessary-casting-of-variables) | 5 | - |\n\nTotal: 10 issues\n\n#\n\n## Inefficient use of abi.encode()\n- Severity: Gas Optimization\n- Confidence: High\n- Total Gas Saved: 700\n\n### Description\nThe `abi.encode()` function is less gas efficie", "vulnerable_code": "Line: 261 queuedTransactions[keccak256(\n abi.encode(\n _proposal.targets[_i], _proposal.values[_i], _proposal.signatures[_i], _proposal.calldatas[_i], _eta\n )\n )]", "fixed_code": "Line: 299 _txHash = keccak256(abi.encode(_target, _value, _signature, _data, _eta))", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/DavidGiladi-G.md", "collected_at": "2026-01-02T18:23:24.625452+00:00", "source_hash": "23584409e0c12b920901ed97ba75106163a13b42f08366f737f4b6c1e040fc1c", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "Line: 261 queuedTransactions[keccak256(\n abi.encode(\n _proposal.targets[_i], _proposal.values[_i], _proposal.signatures[_i], _proposal.calldatas[_i], _eta\n )\n )]", "has_vulnerable_code_snippet": true, "fixed_code_actual": "Line: 299 _txHash = keccak256(abi.encode(_target, _value, _signature, _data, _eta))", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "10-badger", "title": "shaka Q", "severity_raw": "Critical", "severity": "critical", "description": "# Low Risk Issues\n\n| ID |Title|Instances|\n|:--:|:-------|:--:|\n|[L-01]| Misleading comments for protocol integrations | 1 |\n\n## [L-01] Misleading comments for protocol integrations\n\n```solidity\nFile: SortedCdps.sol\n134: /// @notice Find a specific CDP for a given owner, indexed by it's place in the linked list relative to other Cdps owned by the same address\n135: /// @notice Reverts if the index exceeds the number of active Cdps owned by the given owner \ud83d\udc48\n136: /// @dev Intended for off-chain use, O(n) operation on size of SortedCdps linked list\n137: /// @param owner address of CDP owner\n138: /// @param index index of CDP, ordered by position in linked list relative to Cdps of the same owner\n139: /// @return CDP Id if found\n140: function cdpOfOwnerByIndex(\n```\n\nThe comment `Reverts if the index exceeds the number of active Cdps owned by the given owner` is not correct. If the index exceeds the number of active Cdps owned by the given owner, the function returns `dummyId` instead of reverting.\n\nThe only place where it is used is `LeverageMacroBase` and there are checks in place to ensure that the CDP is valid, but it is recommended either updating natspec or adding a require statement to avoid wrong assumptions in future integrations.\n\n# Non-Critical Issues\n\n| ID |Title|Instances|\n|:--:|:-------|:--:|\n|[N-01]| Unused or unnecessary variables | 3 |\n|[N-02]| Unused functions | 2 |\n|[N-03]| Incorrect comments and erratas | 16 |\n\n\n## [N-01] Unused or unnecessary variables\n\n```solidity\nFile: CdpManager.sol\n244: function _closeCdpByRedemption(\n245: bytes32 _cdpId,\n246: uint256 _EBTC, \ud83d\udc48 always 0\n247: uint256 _collSurplus,\n248: uint256 _liquidatorRewardShares,\n249: address _borrower\n250: ) internal {\n```\n\n```solidity\nFile: HintHelpers.sol\n19: struct LocalVariables_getRedemptionHints {\n20: uint256 remainingEbtcToRedeem;\n21: uint256 minNetDebtInBTC; \ud83d\udc48\n22: bytes32 currentCdpId", "vulnerable_code": "File: SortedCdps.sol\n134: /// @notice Find a specific CDP for a given owner, indexed by it's place in the linked list relative to other Cdps owned by the same address\n135: /// @notice Reverts if the index exceeds the number of active Cdps owned by the given owner \ud83d\udc48\n136: /// @dev Intended for off-chain use, O(n) operation on size of SortedCdps linked list\n137: /// @param owner address of CDP owner\n138: /// @param index index of CDP, ordered by position in linked list relative to Cdps of the same owner\n139: /// @return CDP Id if found\n140: function cdpOfOwnerByIndex(", "fixed_code": "File: CdpManager.sol\n244: function _closeCdpByRedemption(\n245: bytes32 _cdpId,\n246: uint256 _EBTC, \ud83d\udc48 always 0\n247: uint256 _collSurplus,\n248: uint256 _liquidatorRewardShares,\n249: address _borrower\n250: ) internal {", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/shaka-Q.md", "collected_at": "2026-01-02T18:27:01.734508+00:00", "source_hash": "23994bd4aee25b61beaf4cec2af1b69537c70bf9007ec4bc07cb45b3d4a8a818", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 862, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: SortedCdps.sol\n134: /// @notice Find a specific CDP for a given owner, indexed by it's place in the linked list relative to other Cdps owned by the same address\n135: /// @notice Reverts if the index exceeds the number of active Cdps owned by the given owner \ud83d\udc48\n136: /// @dev Intended for off-chain use, O(n) operation on size of SortedCdps linked list\n137: /// @param owner address of CDP owner\n138: /// @param index index of CDP, ordered by position in linked list relative to Cdps of the same owner\n139: /// @return CDP Id if found\n140: function cdpOfOwnerByIndex(", "primary_code_language": "solidity", "primary_code_char_count": 599, "all_code_blocks": "// Code block 1 (solidity):\nFile: SortedCdps.sol\n134: /// @notice Find a specific CDP for a given owner, indexed by it's place in the linked list relative to other Cdps owned by the same address\n135: /// @notice Reverts if the index exceeds the number of active Cdps owned by the given owner \ud83d\udc48\n136: /// @dev Intended for off-chain use, O(n) operation on size of SortedCdps linked list\n137: /// @param owner address of CDP owner\n138: /// @param index index of CDP, ordered by position in linked list relative to Cdps of the same owner\n139: /// @return CDP Id if found\n140: function cdpOfOwnerByIndex(\n\n// Code block 2 (solidity):\nFile: CdpManager.sol\n244: function _closeCdpByRedemption(\n245: bytes32 _cdpId,\n246: uint256 _EBTC, \ud83d\udc48 always 0\n247: uint256 _collSurplus,\n248: uint256 _liquidatorRewardShares,\n249: address _borrower\n250: ) internal {", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: SortedCdps.sol\n134: /// @notice Find a specific CDP for a given owner, indexed by it's place in the linked list relative to other Cdps owned by the same address\n135: /// @notice Reverts if the index exceeds the number of active Cdps owned by the given owner \ud83d\udc48\n136: /// @dev Intended for off-chain use, O(n) operation on size of SortedCdps linked list\n137: /// @param owner address of CDP owner\n138: /// @param index index of CDP, ordered by position in linked list relative to Cdps of the same owner\n139: /// @return CDP Id if found\n140: function cdpOfOwnerByIndex(\n\nFile: CdpManager.sol\n244: function _closeCdpByRedemption(\n245: bytes32 _cdpId,\n246: uint256 _EBTC, \ud83d\udc48 always 0\n247: uint256 _collSurplus,\n248: uint256 _liquidatorRewardShares,\n249: address _borrower\n250: ) internal {", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: SortedCdps.sol\n134: /// @notice Find a specific CDP for a given owner, indexed by it's place in the linked list relative to other Cdps owned by the same address\n135: /// @notice Reverts if the index exceeds the number of active Cdps owned by the given owner \ud83d\udc48\n136: /// @dev Intended for off-chain use, O(n) operation on size of SortedCdps linked list\n137: /// @param owner address of CDP owner\n138: /// @param index index of CDP, ordered by position in linked list relative to Cdps of the same owner\n139: /// @return CDP Id if found\n140: function cdpOfOwnerByIndex(", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: CdpManager.sol\n244: function _closeCdpByRedemption(\n245: bytes32 _cdpId,\n246: uint256 _EBTC, \ud83d\udc48 always 0\n247: uint256 _collSurplus,\n248: uint256 _liquidatorRewardShares,\n249: address _borrower\n250: ) internal {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "08-dopex", "title": "MohammedRizwan G", "severity_raw": "Medium", "severity": "medium", "description": "## Summary\n\n### Gas Optimizations\n| |Issue|Instances| |\n|-|:-|:-:|:-:|\n| [G‑01] | Use assembly to emit events | 15 |\n| [G‑02] | Use assembly to write address storage values | 4 |\n| [G‑03] | Use custom errors instead of require/assert | 21 |\n| [G‑04] | Avoid double access control checking in `mint()` to save gas by removing extra bytes | 1 |\n| [G‑05] | Amounts should be checked for 0 before calling a transfer | contracts |\n\n\n\n\n### [G‑01] Use assembly to emit events\nAssembly can be used to emit events efficiently by utilizing scratch space and the free memory pointer. This will allow us to potentially avoid memory expansion costs. \nNote: In order to do this optimization safely, we will need to cache and restore the free memory pointer.\n\nThere are 15 instances of this issue in contracts,\n\n1) `UniV2LiquidityAmo.sol` has 5 event.\n2) `UniV3LiquidityAmo.sol` has 5 event.\n3) `RdpxDecayingBonds.sol` has 2 event.\n4) `PerpetualAtlanticVaultLP.sol` has 2 event.\n5) `ReLPContract.sol` has 1 event.\n\n### [G‑02] Use assembly to write address storage values\nThere are 4 instances of this issue:\n\n1) In `UniV2LiquidityAmo.sol`, [`setAddresses()`](https://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/amo/UniV2LiquidityAmo.sol#L74-L102) function.\n\n2) In `RdpxV2Core.sol`, [`setAddresses()`](https://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/core/RdpxV2Core.sol#L304-L350) function\n\n3) In `PerpetualAtlanticVault.sol`, [`setAddresses()`](https://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/perp-vault/PerpetualAtlanticVault.sol#L181-L212)\n\n4) In `ReLPContract.sol`, [`setAddresses()`](https://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/reLP/ReLPContract.sol#L115-L148)\n\n### [G‑03] Use custom errors instead of require/assert\nThere are 21 instances of t", "vulnerable_code": "File: contracts/decaying-bonds/RdpxDecayingBonds.sol\n\n function mint(\n address to,\n uint256 expiry,\n uint256 rdpxAmount\n ) external onlyRole(MINTER_ROLE) {\n _whenNotPaused();\n require(hasRole(MINTER_ROLE, msg.sender), \"Caller is not a minter\");\n uint256 bondId = _mintToken(to);\n bonds[bondId] = Bond(to, expiry, rdpxAmount);\n\n emit BondMinted(to, bondId, expiry, rdpxAmount);\n }", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/MohammedRizwan-G.md", "collected_at": "2026-01-02T18:24:54.670651+00:00", "source_hash": "23aa2d40bb8fffd00259de5b1b2a5e46c43196dda4a80e2dc7ab7e13d7c1ef69", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "UniV2LiquidityAmo.sol#L74-L102, RdpxV2Core.sol#L304-L350, PerpetualAtlanticVault.sol#L181-L212, ReLPContract.sol#L115-L148", "github_files_list": "ReLPContract.sol, PerpetualAtlanticVault.sol, UniV2LiquidityAmo.sol, RdpxV2Core.sol", "github_refs_count": 4, "vulnerable_code_actual": "File: contracts/decaying-bonds/RdpxDecayingBonds.sol\n\n function mint(\n address to,\n uint256 expiry,\n uint256 rdpxAmount\n ) external onlyRole(MINTER_ROLE) {\n _whenNotPaused();\n require(hasRole(MINTER_ROLE, msg.sender), \"Caller is not a minter\");\n uint256 bondId = _mintToken(to);\n bonds[bondId] = Bond(to, expiry, rdpxAmount);\n\n emit BondMinted(to, bondId, expiry, rdpxAmount);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "08-dopex", "title": "0xCiphky Q", "severity_raw": "Low", "severity": "low", "description": "## Restriction for zero approvals can lead to a loss of funds if contract gets compromised\n\n### **Relevant GitHub Links:**\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/amo/UniV2LiquidityAmo.sol#L133\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/core/RdpxV2Core.sol#L410\n\n### **Summary:**\n\nThe protocol ensures a significant degree of independence between its contracts, further strengthened by the provision of methods to pause a contract and execute emergency withdrawals. Nonetheless, there remains a latent vulnerability. Contracts like **`UniV2LiquidityAMO`** and **`RdpxV2Core`** have the function **`approveContractToSpend`** which, under administrative privileges, can set an approval to any non-zero value. In the unfortunate event of a compromised contract, the majority of the funds can be shielded by resetting the approval but not all as we can\u2019t set approvals to zero.\n\n### **Impact:**\n\nSeverity: Low. The majority (about 99%) of the funds can be shielded by resetting the approval to the minimal value.\n\nLikelihood: Low. This vulnerability becomes relevant only if a contract is compromised.\n\n### **Tools Used:**\n\nManual analysis\n\n### **Recommendation:**\n\nAllow the following contracts to reset approvals to zero.\n\n## Event Emits Incorrect tokenId in UniV3LiquidityAMO's removeLiquidity Function\n\n### **Severity:**\n\n- Low Risk\n\n### **Relevant GitHub Links:**\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/amo/UniV3LiquidityAmo.sol#L269\n\n### **Summary:**\n\nThe **`removeLiquidity`** function within the **`UniV3LiquidityAMO`** contract is designed to emit an event that logs the **`tokenId`** for the liquidity position being removed. However, due to the sequence of operations, the emitted **`tokenId`** is always zero. This is because the function emits the **`tokenId`** after it's deleted from the **`positions_mappin", "vulnerable_code": " function removeLiquidity(uint256 positionIndex, uint256 minAmount0, uint256 minAmount1)\n public\n onlyRole(DEFAULT_ADMIN_ROLE)\n {\n // rest of the code\n\n positions_array[positionIndex] = positions_array[positions_array.length - 1];\n positions_array.pop();\n delete positions_mapping[pos.token_id];\n\n // send tokens to rdpxV2Core\n _sendTokensToRdpxV2Core(tokenA, tokenB);\n\n emit log(positions_array.length);\n emit log(positions_mapping[pos.token_id].token_id);\n }", "fixed_code": " function removeLiquidity(uint256 positionIndex, uint256 minAmount0, uint256 minAmount1)\n public\n onlyRole(DEFAULT_ADMIN_ROLE)\n {\n // rest of the code\n\n positions_array[positionIndex] = positions_array[positions_array.length - 1];\n positions_array.pop();\n\tuint256 tokenId = positions_mapping[pos.token_id]\n delete positions_mapping[pos.token_id];\n\n // send tokens to rdpxV2Core\n _sendTokensToRdpxV2Core(tokenA, tokenB);\n\n emit log(positions_array.length);\n emit log(tokenId);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/0xCiphky-Q.md", "collected_at": "2026-01-02T18:24:14.122108+00:00", "source_hash": "23ca6e1c794e112447edc8bb54fea735ffd91d7d4d40298c768bd16d066716ed", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "UniV2LiquidityAmo.sol#L133, RdpxV2Core.sol#L410, UniV3LiquidityAmo.sol#L269", "github_files_list": "UniV3LiquidityAmo.sol, UniV2LiquidityAmo.sol, RdpxV2Core.sol", "github_refs_count": 3, "vulnerable_code_actual": " function removeLiquidity(uint256 positionIndex, uint256 minAmount0, uint256 minAmount1)\n public\n onlyRole(DEFAULT_ADMIN_ROLE)\n {\n // rest of the code\n\n positions_array[positionIndex] = positions_array[positions_array.length - 1];\n positions_array.pop();\n delete positions_mapping[pos.token_id];\n\n // send tokens to rdpxV2Core\n _sendTokensToRdpxV2Core(tokenA, tokenB);\n\n emit log(positions_array.length);\n emit log(positions_mapping[pos.token_id].token_id);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function removeLiquidity(uint256 positionIndex, uint256 minAmount0, uint256 minAmount1)\n public\n onlyRole(DEFAULT_ADMIN_ROLE)\n {\n // rest of the code\n\n positions_array[positionIndex] = positions_array[positions_array.length - 1];\n positions_array.pop();\n\tuint256 tokenId = positions_mapping[pos.token_id]\n delete positions_mapping[pos.token_id];\n\n // send tokens to rdpxV2Core\n _sendTokensToRdpxV2Core(tokenA, tokenB);\n\n emit log(positions_array.length);\n emit log(tokenId);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-biconomy", "title": "zaskoh Q", "severity_raw": "Critical", "severity": "critical", "description": "## Summary\n\n### Low Risk Issues\n| |Issue|Instances|\n|-|:-|:-:|\n| L-01 | Unneccessary if condition for a check that is always true | 1 |\n| L-02 | Function deployWallet can be removed as it is not possible to check for deployed addresses | 1 |\n| L-03 | Always check important state vars before update | 2 |\n| L-04 | Deviating interfaces to current EIP-4337 | 5 |\n| L-05 | Return value not checked | 2 |\n| L-06 | Inconsistent minimum stake delay | 1 |\n\nTotal: 12 instances over 6 issues\n\n### Non-critical Issues\n| |Issue|Instances|\n|-|:-|:-:|\n| NC-01 | Remove unnecessary _requireFromEntryPointOrOwner() check in function | 2 |\n| NC-02 | Remove unused fields in events | 1 |\n| NC-03 | Remove unused variable names from functions | 1 |\n| NC-04 | Wrong handling of unused variables in function | 2 |\n| NC-05 | Inconsistent solidity version | 5 |\n| NC-06 | Update pragma versioning to a more recent version like 0.8.16 | 22 |\n| NC-07 | Use specific imports instead of just a global import | 54 |\n| NC-08 | Long lines | 7 |\n| NC-09 | Add missing documentation | 39 |\n| NC-10 | Typos | 3 |\n\nTotal: 136 instances over 10 issues\n\n---\n\n## Low Risk Issues\n\n### L-01 Unneccessary if condition for a check that is always true\nIn SmartAccount is a if condition that is always true and can be removed as it is checked 3 lines above with a require.\n\n```solidity\nFile: contracts/smart-contract-wallet/SmartAccount.sol\n166: function init(address _owner, address _entryPointAddress, address _handler) public override initializer { \n167: require(owner == address(0), \"Already initialized\");\n168: require(address(_entryPoint) == address(0), \"Already initialized\");\n169: require(_owner != address(0),\"Invalid owner\");\n170: require(_entryPointAddress != address(0), \"Invalid Entrypoint\");\n171: require(_handler != address(0), \"Invalid Entrypoint\");\n172: owner = _owner;\n173: _entryPoint = IEntryPoint(payable(_entryPointAddress));\n174: if (_handler != add", "vulnerable_code": "File: contracts/smart-contract-wallet/SmartAccount.sol\n166: function init(address _owner, address _entryPointAddress, address _handler) public override initializer { \n167: require(owner == address(0), \"Already initialized\");\n168: require(address(_entryPoint) == address(0), \"Already initialized\");\n169: require(_owner != address(0),\"Invalid owner\");\n170: require(_entryPointAddress != address(0), \"Invalid Entrypoint\");\n171: require(_handler != address(0), \"Invalid Entrypoint\");\n172: owner = _owner;\n173: _entryPoint = IEntryPoint(payable(_entryPointAddress));\n174: if (_handler != address(0)) internalSetFallbackHandler(_handler); // @audit-info if can be removed and internalSetFallbackHandler(_handler); can always be set - require(_handler != address(0), \"Invalid Entrypoint\"); checks for this\n175: setupModules(address(0), bytes(\"\"));\n176: }", "fixed_code": "File: contracts/smart-contract-wallet/SmartAccountFactory.sol\n53: function deployWallet(address _owner, address _entryPoint, address _handler) public returns(address proxy){\n54: bytes memory deploymentData = abi.encodePacked(type(Proxy).creationCode, uint(uint160(_defaultImpl)));\n55: // solhint-disable-next-line no-inline-assembly\n56: assembly {\n57: proxy := create(0x0, add(0x20, deploymentData), mload(deploymentData))\n58: }\n59: BaseSmartAccount(proxy).init(_owner, _entryPoint, _handler);\n60: isAccountExist[proxy] = true;\n61: }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/zaskoh-Q.md", "collected_at": "2026-01-02T18:14:16.895693+00:00", "source_hash": "2433ae7e097ad087bea5cbcbf5dbe20dc388714f8fbf35dc9add42dfadfcde18", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: contracts/smart-contract-wallet/SmartAccount.sol\n166: function init(address _owner, address _entryPointAddress, address _handler) public override initializer { \n167: require(owner == address(0), \"Already initialized\");\n168: require(address(_entryPoint) == address(0), \"Already initialized\");\n169: require(_owner != address(0),\"Invalid owner\");\n170: require(_entryPointAddress != address(0), \"Invalid Entrypoint\");\n171: require(_handler != address(0), \"Invalid Entrypoint\");\n172: owner = _owner;\n173: _entryPoint = IEntryPoint(payable(_entryPointAddress));\n174: if (_handler != address(0)) internalSetFallbackHandler(_handler); // @audit-info if can be removed and internalSetFallbackHandler(_handler); can always be set - require(_handler != address(0), \"Invalid Entrypoint\"); checks for this\n175: setupModules(address(0), bytes(\"\"));\n176: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/smart-contract-wallet/SmartAccountFactory.sol\n53: function deployWallet(address _owner, address _entryPoint, address _handler) public returns(address proxy){\n54: bytes memory deploymentData = abi.encodePacked(type(Proxy).creationCode, uint(uint160(_defaultImpl)));\n55: // solhint-disable-next-line no-inline-assembly\n56: assembly {\n57: proxy := create(0x0, add(0x20, deploymentData), mload(deploymentData))\n58: }\n59: BaseSmartAccount(proxy).init(_owner, _entryPoint, _handler);\n60: isAccountExist[proxy] = true;\n61: }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "09-ondo", "title": "report", "severity_raw": "Critical", "severity": "critical", "description": "---\nsponsor: \"Ondo Finance\"\nslug: \"2023-09-ondo\"\ndate: \"2023-10-12\"\ntitle: \"Ondo Finance\"\nfindings: \"https://github.com/code-423n4/2023-09-ondo-findings/issues\"\ncontest: 281\n---\n\n# Overview\n\n## About C4\n\nCode4rena (C4) is an open organization consisting of security researchers, auditors, developers, and individuals with domain expertise in smart contracts.\n\nA C4 audit is an event in which community participants, referred to as Wardens, review, audit, or analyze smart contract logic in exchange for a bounty provided by sponsoring projects.\n\nDuring the audit outlined in this document, C4 conducted an analysis of the Ondo Finance smart contract system written in Solidity. The audit took place between September 1 \u2014 September 7, 2023.\n\n## Wardens\n\n71 Wardens contributed reports to the Ondo Finance:\n\n 1. [adriro](https://code4rena.com/@adriro)\n 2. [gkrastenov](https://code4rena.com/@gkrastenov)\n 3. [lsaudit](https://code4rena.com/@lsaudit)\n 4. [0xpiken](https://code4rena.com/@0xpiken)\n 5. [nirlin](https://code4rena.com/@nirlin)\n 6. [ast3ros](https://code4rena.com/@ast3ros)\n 7. [ladboy233](https://code4rena.com/@ladboy233)\n 8. [pontifex](https://code4rena.com/@pontifex)\n 9. [0xAsen](https://code4rena.com/@0xAsen)\n 10. [0xStalin](https://code4rena.com/@0xStalin)\n 11. [Inspecktor](https://code4rena.com/@Inspecktor)\n 12. [Arz](https://code4rena.com/@Arz)\n 13. [BenRai](https://code4rena.com/@BenRai)\n 14. [merlin](https://code4rena.com/@merlin)\n 15. [Delvir0](https://code4rena.com/@Delvir0)\n 16. [Udsen](https://code4rena.com/@Udsen)\n 17. [kaveyjoe](https://code4rena.com/@kaveyjoe)\n 18. [kutugu](https://code4rena.com/@kutugu)\n 19. [bin2chen](https://code4rena.com/@bin2chen)\n 20. [pep7siup](https://code4rena.com/@pep7siup)\n 21. [0xDING99YA](https://code4rena.com/@0xDING99YA)\n 22. [SpicyMeatball](https://code4rena.com/@SpicyMeatball)\n 23. [bowtiedvirus](https://code4rena.com/@bowtiedvirus)\n 24. [catellatech](https://code4rena.com/@catellatech)\n 25. [hunter", "vulnerable_code": "121: function setDestinationChainContractAddress(\n122: string memory destinationChain,\n123: address contractAddress\n124: ) external onlyOwner {\n125: destChainToContractAddr[destinationChain] = AddressToString.toString(\n126: contractAddress\n127: );\n128: emit DestinationChainContractAddressSet(destinationChain, contractAddress);\n129: }", "fixed_code": "234: function addChainSupport(\n235: string calldata srcChain,\n236: string calldata srcContractAddress\n237: ) external onlyOwner {\n238: chainToApprovedSender[srcChain] = keccak256(abi.encode(srcContractAddress));\n239: emit ChainIdSupported(srcChain, srcContractAddress);\n240: }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/report.md", "collected_at": "2026-01-02T18:26:24.344299+00:00", "source_hash": "243f9cf41144954d17c44dc03844906668f00d942c417ac06229fa123755dd86", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "121: function setDestinationChainContractAddress(\n122: string memory destinationChain,\n123: address contractAddress\n124: ) external onlyOwner {\n125: destChainToContractAddr[destinationChain] = AddressToString.toString(\n126: contractAddress\n127: );\n128: emit DestinationChainContractAddressSet(destinationChain, contractAddress);\n129: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "234: function addChainSupport(\n235: string calldata srcChain,\n236: string calldata srcContractAddress\n237: ) external onlyOwner {\n238: chainToApprovedSender[srcChain] = keccak256(abi.encode(srcContractAddress));\n239: emit ChainIdSupported(srcChain, srcContractAddress);\n240: }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "05-ajna", "title": "kodyvim Q", "severity_raw": "Medium", "severity": "medium", "description": "# Approved NFT users can not stake in RewardsManager.\nif a user has approved his/her nft to someone or any protocol building on top of ajna they would not be able to stake on behave of the user, since the stake function only allows the owner.\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/RewardsManager.sol#L213\nRecommended Mitigation:\nconsider adding this check:\n```solidity\naddress owner = IERC721(address(positionManager)).ownerOf(tokenId_);\naddress approved = IERC721(address(positionManager)).getApproved(tokenId_);\nif (owner != msg.sender && approved != msg.sender) revert NotOwnerOfDeposit();\n```\n\n# `fromPosition.depositTime` is never resets to zero\nThere is a check if a user has already move liquidity after they've already done so but the `fromPosition.depositTime` which is a storage variable was never set to zero after moving the liquidity.\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/PositionManager.sol#L268-L271\n```solidity\nvars.depositTime = fromPosition.depositTime;\n // handle the case where owner attempts to move liquidity after they've already done so\n if (vars.depositTime == 0) revert RemovePositionFailed();\n```\n## Recommendation.\nset `fromPosition.depositTime` to zero after moving liquidity.\n\n# fix misleading comments\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/Funding.sol#L99\nfix comment to show the exact intent\n```diff\n- * @param values_ The amounts of ETH to send to each target.\n+ * @param values_ The amounts of ETH to send to each target should always be zero.\n```\n\n# variable known at compile time should be constant.\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/Funding.sol#L21\nchange immutable to constant.\n`address public immutable ajnaTokenAddress = 0x9a96ec9B57Fb64FbC60B423d1f4da7691Bd35079;`\n", "vulnerable_code": "address owner = IERC721(address(positionManager)).ownerOf(tokenId_);\naddress approved = IERC721(address(positionManager)).getApproved(tokenId_);\nif (owner != msg.sender && approved != msg.sender) revert NotOwnerOfDeposit();", "fixed_code": "vars.depositTime = fromPosition.depositTime;\n // handle the case where owner attempts to move liquidity after they've already done so\n if (vars.depositTime == 0) revert RemovePositionFailed();", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/kodyvim-Q.md", "collected_at": "2026-01-02T18:21:33.703859+00:00", "source_hash": "24a1d7caee218c60027fe0f4cf6a2906295e4fbe4e360ee115ef2a0d82ad803a", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 587, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "address owner = IERC721(address(positionManager)).ownerOf(tokenId_);\naddress approved = IERC721(address(positionManager)).getApproved(tokenId_);\nif (owner != msg.sender && approved != msg.sender) revert NotOwnerOfDeposit();", "primary_code_language": "solidity", "primary_code_char_count": 223, "all_code_blocks": "// Code block 1 (solidity):\naddress owner = IERC721(address(positionManager)).ownerOf(tokenId_);\naddress approved = IERC721(address(positionManager)).getApproved(tokenId_);\nif (owner != msg.sender && approved != msg.sender) revert NotOwnerOfDeposit();\n\n// Code block 2 (solidity):\nvars.depositTime = fromPosition.depositTime;\n // handle the case where owner attempts to move liquidity after they've already done so\n if (vars.depositTime == 0) revert RemovePositionFailed();\n\n// Code block 3 (diff):\n- * @param values_ The amounts of ETH to send to each target.\n+ * @param values_ The amounts of ETH to send to each target should always be zero.", "all_code_blocks_count": 3, "has_diff_blocks": true, "diff_code": "- * @param values_ The amounts of ETH to send to each target.\n+ * @param values_ The amounts of ETH to send to each target should always be zero.", "solidity_code": "address owner = IERC721(address(positionManager)).ownerOf(tokenId_);\naddress approved = IERC721(address(positionManager)).getApproved(tokenId_);\nif (owner != msg.sender && approved != msg.sender) revert NotOwnerOfDeposit();\n\nvars.depositTime = fromPosition.depositTime;\n // handle the case where owner attempts to move liquidity after they've already done so\n if (vars.depositTime == 0) revert RemovePositionFailed();", "github_refs_formatted": "RewardsManager.sol#L213, PositionManager.sol#L268-L271, Funding.sol#L99, Funding.sol#L21", "github_files_list": "RewardsManager.sol, Funding.sol, PositionManager.sol", "github_refs_count": 4, "vulnerable_code_actual": "address owner = IERC721(address(positionManager)).ownerOf(tokenId_);\naddress approved = IERC721(address(positionManager)).getApproved(tokenId_);\nif (owner != msg.sender && approved != msg.sender) revert NotOwnerOfDeposit();", "has_vulnerable_code_snippet": true, "fixed_code_actual": "vars.depositTime = fromPosition.depositTime;\n // handle the case where owner attempts to move liquidity after they've already done so\n if (vars.depositTime == 0) revert RemovePositionFailed();", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 11} {"source": "c4", "protocol": "04-caviar", "title": "dingo2077 Q", "severity_raw": "Low", "severity": "low", "description": "## [L-01] Users can't create pools while setPrivatePoolImplementation() didn't called by owner.\nSC: Factory.sol\n\n## Proof of Concept\nUsers can't create pools while setPrivatePoolImplementation() didn't called by owner.\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/Factory.sol#L135\n\n## Recommended Mitigation Steps\nTo avoid situation where users can't create pools it is necessary to set poolImplemmentation in factory constructor.\n\n## [L-02] Unsafe transferOwnership() by solmate.\nSC: Factory.sol with imported Owned.sol by solmate lib.\n\n## Proof of Concept\nThe function transferOwnership() transfer ownership to a new address. In case a wrong address ownership will be permanently lose.\n\n\n## Recommended Mitigation Steps\n\nThere is another Openzeppelin Ownable contract (Ownable2StepUpgradeable.sol) has transferOwnership function, use is more secure due to 2-stage ownership transfer.\n![Tux, the Linux mascot](https://i.imgur.com/buDGgQr.png)\n\n## [L-03] deposit() does not has `onlyOwner` modifier.\nSC: PrivatePool.sol\n\n## Proof of Concept\nDespite the fact that the owner mainly will use the function, it is likely that it will be called by an ordinary user due to the lack of `onlyOwner` modifier. There is no any rewards for whom who made deposit, no LPs, and no withdraw option for users.\n\n## Recommended Mitigation Steps\nAdd `onlyOwner` modifier.\n\n## [L-04] buy() function will be reverted if virtualNftReserves is equal or less than 1e18.\nSC: PrivatePool.sol\n\n## Proof of Concept\nDue to the buyQuote() calculation method, tx will be reverted, because outputAmount minimum is 1e18, and if `virtualNftReserves` will be = 1e18, denominator = 0 which lead to revert.\n```solidity\n uint256 inputAmount = FixedPointMathLib.mulDivUp(\n outputAmount,\n virtualBaseTokenReserves,\n (virtualNftReserves - outputAmount) //<<-here\n );\n``` \nFoundry test:\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidit", "vulnerable_code": " uint256 inputAmount = FixedPointMathLib.mulDivUp(\n outputAmount,\n virtualBaseTokenReserves,\n (virtualNftReserves - outputAmount) //<<-here\n );", "fixed_code": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\nimport \"forge-std/Test.sol\";\nimport \"../../src/Factory.sol\";\nimport \"../../src/EthRouter.sol\";\nimport \"../../src/PrivatePool.sol\";\nimport \"../shared/Milady.sol\";\n\ncontract MyLive is Test {\n address public nftArtist = vm.addr(123);\n address public royaltyRegistry = vm.addr(999);\n address public poolCreator = vm.addr(432);\n address public user2 = vm.addr(4323);\n\n uint256[] tokenWeights;\n PrivatePool.MerkleMultiProof proofs;\n\n Factory factory;\n EthRouter ethrouter;\n PrivatePool privatePool;\n Milady milady;\n\n function setUp() public {\n factory = new Factory();\n ethrouter = new EthRouter(royaltyRegistry); //accept royaltyRegistry addr in constructor;\n milady = new Milady();\n privatePool = new PrivatePool(\n address(factory),\n address(royaltyRegistry),\n address(0)\n ); //Deploy base for clones copy.\n vm.deal(poolCreator, 100 ether);\n vm.deal(user2, 100 ether);\n vm.startPrank(poolCreator);\n milady.mint(poolCreator, 1);\n milady.approve(address(factory), 1);\n vm.stopPrank();\n }\n\n function testFactory() public {\n console.log(\"address factory: \", address(factory));\n console.log(\"nftArtist for royalty receive: \", nftArtist);\n\n factory.setPrivatePoolImplementation(address(privatePool));\n\n vm.startPrank(poolCreator);\n uint256[] memory tokenIds = new uint256[](1);\n tokenIds[0] = 1;\n privatePool = factory.create{value: 1 ether}(\n address(0), //_baseToken\n address(milady), //nft\n 10e18, //_virtualBaseTokenReserves \n 1e18, //_virtualNftReserves \n 200, //_changeFee\n 0, //fee rate \n bytes32(0), //_merkleRoot\n true, //nft oracle\n false, //pay royalties\n bytes32(address(this).balance + 12345), //salt\n ", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/dingo2077-Q.md", "collected_at": "2026-01-02T18:20:29.597891+00:00", "source_hash": "24f4da10cf91e67f3aaeceaca069a8d88e1a0dac858f242217bfeffbbe92984a", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 182, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "uint256 inputAmount = FixedPointMathLib.mulDivUp(\n outputAmount,\n virtualBaseTokenReserves,\n (virtualNftReserves - outputAmount) //<<-here\n );", "primary_code_language": "solidity", "primary_code_char_count": 182, "all_code_blocks": "// Code block 1 (solidity):\nuint256 inputAmount = FixedPointMathLib.mulDivUp(\n outputAmount,\n virtualBaseTokenReserves,\n (virtualNftReserves - outputAmount) //<<-here\n );", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "uint256 inputAmount = FixedPointMathLib.mulDivUp(\n outputAmount,\n virtualBaseTokenReserves,\n (virtualNftReserves - outputAmount) //<<-here\n );", "github_refs_formatted": "Factory.sol#L135", "github_files_list": "Factory.sol", "github_refs_count": 1, "vulnerable_code_actual": " uint256 inputAmount = FixedPointMathLib.mulDivUp(\n outputAmount,\n virtualBaseTokenReserves,\n (virtualNftReserves - outputAmount) //<<-here\n );", "has_vulnerable_code_snippet": true, "fixed_code_actual": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.19;\nimport \"forge-std/Test.sol\";\nimport \"../../src/Factory.sol\";\nimport \"../../src/EthRouter.sol\";\nimport \"../../src/PrivatePool.sol\";\nimport \"../shared/Milady.sol\";\n\ncontract MyLive is Test {\n address public nftArtist = vm.addr(123);\n address public royaltyRegistry = vm.addr(999);\n address public poolCreator = vm.addr(432);\n address public user2 = vm.addr(4323);\n\n uint256[] tokenWeights;\n PrivatePool.MerkleMultiProof proofs;\n\n Factory factory;\n EthRouter ethrouter;\n PrivatePool privatePool;\n Milady milady;\n\n function setUp() public {\n factory = new Factory();\n ethrouter = new EthRouter(royaltyRegistry); //accept royaltyRegistry addr in constructor;\n milady = new Milady();\n privatePool = new PrivatePool(\n address(factory),\n address(royaltyRegistry),\n address(0)\n ); //Deploy base for clones copy.\n vm.deal(poolCreator, 100 ether);\n vm.deal(user2, 100 ether);\n vm.startPrank(poolCreator);\n milady.mint(poolCreator, 1);\n milady.approve(address(factory), 1);\n vm.stopPrank();\n }\n\n function testFactory() public {\n console.log(\"address factory: \", address(factory));\n console.log(\"nftArtist for royalty receive: \", nftArtist);\n\n factory.setPrivatePoolImplementation(address(privatePool));\n\n vm.startPrank(poolCreator);\n uint256[] memory tokenIds = new uint256[](1);\n tokenIds[0] = 1;\n privatePool = factory.create{value: 1 ether}(\n address(0), //_baseToken\n address(milady), //nft\n 10e18, //_virtualBaseTokenReserves \n 1e18, //_virtualNftReserves \n 200, //_changeFee\n 0, //fee rate \n bytes32(0), //_merkleRoot\n true, //nft oracle\n false, //pay royalties\n bytes32(address(this).balance + 12345), //salt\n ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ethos", "title": "c3phas G", "severity_raw": "High", "severity": "high", "description": "### Table of contents\n- [FINDINGS](#findings)\n- [Tighly pack storage variables/optimize the order of variable declaration(Total Gas saved: 16K gas )](#tighly-pack-storage-variablesoptimize-the-order-of-variable-declarationtotal-gas-saved-16k-gas-)\n - [LUSDToken.sol: Pack bool mintingPaused with address troveManagerAddress(Saves 1 SLOT: 2k gas)](#lusdtokensol-pack-bool-mintingpaused-with-address-trovemanageraddresssaves-1-slot-2k-gas)\n - [ReaperVaultV2.sol: pack treasury with emergencyShutdown and lastReport(4k gas)](#reapervaultv2sol-pack-treasury-with-emergencyshutdown-and-lastreport4k-gas)\n - [Save 1 SLOT(2k gas): Pack lastFeeOperationTime with owner](#save-1-slot2k-gas-pack-lastfeeoperationtime-with-owner)\n - [Save 2 SLOTS(4k gas): see description](#save-2-slots4k-gas-see-description)\n - [Save 2 SLOTS(4k gas): Pack lastHarvestTimestamp and upgradeProposalTime](#save-2-slots4k-gas-pack-lastharvesttimestamp-and-upgradeproposaltime)\n- [Pack structs by putting data types that fit together next to each other( Saves: 2K gas)](#pack-structs-by-putting-data-types-that-fit-together-next-to-each-other-saves-2k-gas)\n - [ReaperVaultV2.sol: Pack activation together with lastReport(Save 1 SLOT: 2k gas)](#reapervaultv2sol-pack-activation-together-with-lastreportsave-1-slot-2k-gas)\n- [Emitting storage values instead of the memory one.](#emitting-storage-values-instead-of-the-memory-one)\n - [Emit `_newTvlCap` instead of `tvlCap`](#emit-_newtvlcap-instead-of-tvlcap)\n- [IF's/require() statements that check input arguments should be at the top of the function](#ifsrequire-statements-that-check-input-arguments-should-be-at-the-top-of-the-function)\n - [reorder the require statement to have cheaper one before the gas consuming one](#reorder-the-require-statement-to-have-cheaper-one-before-the-gas-consuming-one)\n - [cheaper to check function argument against a constant as compared to checking it against a storaga variable](#cheaper-to-check-function-argument-against-a-constant-", "vulnerable_code": "File: /Ethos-Core/contracts/LUSDToken.sol\n37: bool public mintingPaused = false;\n\n51: bytes32 private immutable _HASHED_NAME;\n52: bytes32 private immutable _HASHED_VERSION;\n \n54: mapping (address => uint256) private _nonces;\n\n67: address public troveManagerAddress;", "fixed_code": "https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Vault/contracts/ReaperVaultV2.sol#L46-L78\n### ReaperVaultV2.sol: pack treasury with emergencyShutdown and lastReport(4k gas)\n**lastReport being a timestamp we can get away with using uint64 - should be safe for around 530 years(Following this direction we can save 2 SLOTS : 4k gas)**\n\n**If not willing to to reduce the timestamp variable we can pack `address treasury and bool emergencyShutdown` saving 1 SLOT: 2k gas", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/c3phas-G.md", "collected_at": "2026-01-02T18:16:53.998734+00:00", "source_hash": "254ba2d66f5c51a61d8efd99516750cc06c403e2231c0c7c4c3f2cccffc9bfeb", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ReaperVaultV2.sol#L46-L78", "github_files_list": "ReaperVaultV2.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: /Ethos-Core/contracts/LUSDToken.sol\n37: bool public mintingPaused = false;\n\n51: bytes32 private immutable _HASHED_NAME;\n52: bytes32 private immutable _HASHED_VERSION;\n \n54: mapping (address => uint256) private _nonces;\n\n67: address public troveManagerAddress;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Vault/contracts/ReaperVaultV2.sol#L46-L78\n### ReaperVaultV2.sol: pack treasury with emergencyShutdown and lastReport(4k gas)\n**lastReport being a timestamp we can get away with using uint64 - should be safe for around 530 years(Following this direction we can save 2 SLOTS : 4k gas)**\n\n**If not willing to to reduce the timestamp variable we can pack `address treasury and bool emergencyShutdown` saving 1 SLOT: 2k gas", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "08-dopex", "title": "0x3b Q", "severity_raw": "Low", "severity": "low", "description": "| *Issue* | *Description* |\n|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **[L-01]** | [upperDepeg](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L1051-L1070) has `DEFAULT_ADMIN_ROLE`, although it specifies that it should be called by users. |\n| **[L-02]** | Bond discount needs to be change every so often to avoid issues |\n| **[L-03]** | Wrong `_validate` |\n| **[L-04]** | [_stake](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L566-L583) does not return bondID leaving users to guess |\n\n### **[L-01]** [upperDepeg](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L1051-L1070) has `DEFAULT_ADMIN_ROLE`, although it specifies that it should be called by users.\nThe function is specified to allow Users to mint and increase the peg, however the function is noted with `DEFAULT_ADMIN_ROLE`.\n```jsx\n /**\n * @notice Lets users mint DpxEth at a 1:1 ratio when DpxEth pegs above 1.01 of the ETH token\n */\n function upperDepeg() external onlyRole(DEFAULT_ADMIN_ROLE) returns (uint256 wethReceived) {\n```\n\n### **[L-02]** Bond discount needs to be change every so often to avoid issues\nUnder [calculateBondCost](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#", "vulnerable_code": "### **[L-02]** Bond discount needs to be change every so often to avoid issues\nUnder [calculateBondCost](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L1163-L1165) `bondDiscount` is counted for with static value against movable `rdpxReserves` which means that with market turns up and down, this value needs to be changed constantly. This could be annoying and if forgotten or updated lately it can cause issue, either giving too much or too little discount.\n\n### **[L-03]** Wrong `_validate`\n`_validate` under [calculateBondCost](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L1163-L1165) is unnecessary since its check is useless. It check if `bondDiscount < 100e8` and reverts on true. However if `bondDiscount > 50e8` (half of this check) it will underflow in [rdpxRequired](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L1169-L1173). This is because [RDPX_RATIO_PERCENTAGE](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L88) is only 25e8 and if the sub-tractor is bigger than 50e8 it will cause an underflow revert. ", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/0x3b-Q.md", "collected_at": "2026-01-02T18:24:10.987737+00:00", "source_hash": "2568e2f6762acf3a837f6de432088ffac46a37956d09a55faa7f459edf6f5ad1", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 200, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "/**\n * @notice Lets users mint DpxEth at a 1:1 ratio when DpxEth pegs above 1.01 of the ETH token\n */\n function upperDepeg() external onlyRole(DEFAULT_ADMIN_ROLE) returns (uint256 wethReceived) {", "primary_code_language": "jsx", "primary_code_char_count": 200, "all_code_blocks": "// Code block 1 (jsx):\n/**\n * @notice Lets users mint DpxEth at a 1:1 ratio when DpxEth pegs above 1.01 of the ETH token\n */\n function upperDepeg() external onlyRole(DEFAULT_ADMIN_ROLE) returns (uint256 wethReceived) {", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "RdpxV2Core.sol#L1051-L1070, RdpxV2Core.sol#L566-L583, RdpxV2Core.sol, RdpxV2Core.sol#L1163-L1165, RdpxV2Core.sol#L1169-L1173, RdpxV2Core.sol#L88", "github_files_list": "RdpxV2Core.sol", "github_refs_count": 6, "vulnerable_code_actual": "### **[L-02]** Bond discount needs to be change every so often to avoid issues\nUnder [calculateBondCost](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L1163-L1165) `bondDiscount` is counted for with static value against movable `rdpxReserves` which means that with market turns up and down, this value needs to be changed constantly. This could be annoying and if forgotten or updated lately it can cause issue, either giving too much or too little discount.\n\n### **[L-03]** Wrong `_validate`\n`_validate` under [calculateBondCost](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L1163-L1165) is unnecessary since its check is useless. It check if `bondDiscount < 100e8` and reverts on true. However if `bondDiscount > 50e8` (half of this check) it will underflow in [rdpxRequired](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L1169-L1173). This is because [RDPX_RATIO_PERCENTAGE](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L88) is only 25e8 and if the sub-tractor is bigger than 50e8 it will cause an underflow revert. ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "01-ondo", "title": "martin G", "severity_raw": "High", "severity": "high", "description": "# Ondo Finance\n\n## Gas Optimizations Report\n\n### G-01 Splitting `require()` statements that use `&&` saves gas\n\n_There are **3** instances of this issue:_\n\nInstead of using `&&` on single require check using two require checks can save gas\n\n```solidity\n292: require(\n (answeredInRound >= roundId) &&\n (updatedAt >= block.timestamp - maxChainlinkOracleTimeDelay),\n \"Chainlink oracle price is stale\"\n );\n```\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/OndoPriceOracleV2.sol\n\n```solidity\n45: require(\n accrualBlockNumber == 0 && borrowIndex == 0,\n \"market may only be initialized once\"\n );\n```\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cCash/CCash.sol\n\n```solidity\n45: require(\n accrualBlockNumber == 0 && borrowIndex == 0,\n \"market may only be initialized once\"\n );\n```\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cToken/CTokenModified.sol\n\n### G-02 Replace `x <= y` with `x < y + 1`, and `x >= y` with `x > y \u2013 1`\n\nIn the EVM, there is no opcode for >= or <=. When using greater than or equal, two operations are performed: > and =. Using strict comparison operators hence saves gas\n\n_There are **3** instances of this issue:_\n\n```solidity\n92: require(block.timestamp <= deadline, \"KYCRegistry: signature expired\");\n```\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistry.sol\n\n```solidity\n417: borrowRateMantissa <= borrowRateMaxMantissa,\n```\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cCash/CTokenCash.sol\n\n```solidity\n416: require(\n borrowRateMantissa <= borrowRateMaxMantissa,\n \"borrow rate is absurdly high\"\n );\n```\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cToken/CTokenModified.sol\n", "vulnerable_code": "292: require(\n (answeredInRound >= roundId) &&\n (updatedAt >= block.timestamp - maxChainlinkOracleTimeDelay),\n \"Chainlink oracle price is stale\"\n );", "fixed_code": "45: require(\n accrualBlockNumber == 0 && borrowIndex == 0,\n \"market may only be initialized once\"\n );", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/martin-G.md", "collected_at": "2026-01-02T18:15:20.119949+00:00", "source_hash": "2584f3cf7233ba033c50fe355ccd968b3425929e05a0a45703ecf54c7d238622", "code_block_count": 6, "solidity_block_count": 6, "total_code_chars": 628, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "292: require(\n (answeredInRound >= roundId) &&\n (updatedAt >= block.timestamp - maxChainlinkOracleTimeDelay),\n \"Chainlink oracle price is stale\"\n );", "primary_code_language": "solidity", "primary_code_char_count": 168, "all_code_blocks": "// Code block 1 (solidity):\n292: require(\n (answeredInRound >= roundId) &&\n (updatedAt >= block.timestamp - maxChainlinkOracleTimeDelay),\n \"Chainlink oracle price is stale\"\n );\n\n// Code block 2 (solidity):\n45: require(\n accrualBlockNumber == 0 && borrowIndex == 0,\n \"market may only be initialized once\"\n );\n\n// Code block 3 (solidity):\n45: require(\n accrualBlockNumber == 0 && borrowIndex == 0,\n \"market may only be initialized once\"\n );\n\n// Code block 4 (solidity):\n92: require(block.timestamp <= deadline, \"KYCRegistry: signature expired\");\n\n// Code block 5 (solidity):\n417: borrowRateMantissa <= borrowRateMaxMantissa,\n\n// Code block 6 (solidity):\n416: require(\n borrowRateMantissa <= borrowRateMaxMantissa,\n \"borrow rate is absurdly high\"\n );", "all_code_blocks_count": 6, "has_diff_blocks": false, "diff_code": "", "solidity_code": "292: require(\n (answeredInRound >= roundId) &&\n (updatedAt >= block.timestamp - maxChainlinkOracleTimeDelay),\n \"Chainlink oracle price is stale\"\n );\n\n45: require(\n accrualBlockNumber == 0 && borrowIndex == 0,\n \"market may only be initialized once\"\n );\n\n45: require(\n accrualBlockNumber == 0 && borrowIndex == 0,\n \"market may only be initialized once\"\n );\n\n92: require(block.timestamp <= deadline, \"KYCRegistry: signature expired\");\n\n417: borrowRateMantissa <= borrowRateMaxMantissa,\n\n416: require(\n borrowRateMantissa <= borrowRateMaxMantissa,\n \"borrow rate is absurdly high\"\n );", "github_refs_formatted": "OndoPriceOracleV2.sol, CCash.sol, CTokenModified.sol, KYCRegistry.sol, CTokenCash.sol", "github_files_list": "CTokenCash.sol, CTokenModified.sol, KYCRegistry.sol, OndoPriceOracleV2.sol, CCash.sol", "github_refs_count": 5, "vulnerable_code_actual": "292: require(\n (answeredInRound >= roundId) &&\n (updatedAt >= block.timestamp - maxChainlinkOracleTimeDelay),\n \"Chainlink oracle price is stale\"\n );", "has_vulnerable_code_snippet": true, "fixed_code_actual": "45: require(\n accrualBlockNumber == 0 && borrowIndex == 0,\n \"market may only be initialized once\"\n );", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 12} {"source": "c4", "protocol": "01-biconomy", "title": "Rickard G", "severity_raw": "Low", "severity": "low", "description": "# STATE VARIABLES CAN BE PACKED INTO FEWER STORAGE SLOTS\nBaseSmartAccount.sol\n```\nstruct Transaction {\n \taddress to;\n- \tuint256 value;\n \tbytes data;\n \tEnum.Operation operation;\n+ \tuint256 value;\n \tuint256 targetTxGas;\n \t}\n\n```\n```\nstruct FeeRefund {\n+ \taddress gasToken;\n \tuint256 baseGas;\n \tuint256 gasPrice; //gasPrice or tokenGasPrice\n \tuint256 tokenGasPriceFactor;\n- \taddress gasToken;\n \taddress payable refundReceiver;\n \t}\n\n```\nEntryPoint.sol\n```\n \tstruct MemoryUserOp {\n \t\taddress sender;\n+\t\taddress paymaster;\n \t \tuint256 nonce;\n \t\tuint256 callGasLimit;\n \t\tuint256 verificationGasLimit;\n \t\tuint256 preVerificationGas;\n-\t\taddress paymaster;\n \t\tuint256 maxFeePerGas;\n \t\tuint256 maxPriorityFeePerGas;\n \t\t}\n```\n```\n \t\tstruct DepositInfo {\n-\t\tuint112 deposit;\n-\t\tbool staked;\n-\t\tuint112 stake;\n \t\tuint32 unstakeDelaySec;\n \t\tuint64 withdrawTime;\n+\t\tuint112 stake;\n+\t\tuint112 deposit;\n+\t\tbool staked;\n \t\t}\n```\n# BYTES CONSTANTS ARE MORE EFFICIENT THAN STRING CONSTANTS\nIf data can fit into 32 bytes, then you should use bytes32 datatype rather than bytes or strings as it is cheaper in solidity.\n[SmartAccount.sol](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L36)\n```\n string public constant VERSION = \"1.0.2\"; // using AA 0.3.0\n```\n[SmartAccountFactory.sol](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccountFactory.sol#L11)\n```\n string public constant VERSION = \"1.0.2\";\n```\nDefaultCallbackHandler.sol [L12](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/handler/DefaultCallbackHandler.sol#L12), [L13](https://github.com/code-423n4/20", "vulnerable_code": "struct Transaction {\n \taddress to;\n- \tuint256 value;\n \tbytes data;\n \tEnum.Operation operation;\n+ \tuint256 value;\n \tuint256 targetTxGas;\n \t}\n", "fixed_code": "struct FeeRefund {\n+ \taddress gasToken;\n \tuint256 baseGas;\n \tuint256 gasPrice; //gasPrice or tokenGasPrice\n \tuint256 tokenGasPriceFactor;\n- \taddress gasToken;\n \taddress payable refundReceiver;\n \t}\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/Rickard-G.md", "collected_at": "2026-01-02T18:13:16.107234+00:00", "source_hash": "25dffddb9c8823ba74c38ad9154a49a10a1ffc5566dfc5dc7ec5f31ddd1d3555", "code_block_count": 6, "solidity_block_count": 0, "total_code_chars": 1021, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "struct Transaction {\n \taddress to;\n- \tuint256 value;\n \tbytes data;\n \tEnum.Operation operation;\n+ \tuint256 value;\n \tuint256 targetTxGas;\n \t}", "primary_code_language": "unknown", "primary_code_char_count": 180, "all_code_blocks": "// Code block 1 (unknown):\nstruct Transaction {\n \taddress to;\n- \tuint256 value;\n \tbytes data;\n \tEnum.Operation operation;\n+ \tuint256 value;\n \tuint256 targetTxGas;\n \t}\n\n// Code block 2 (unknown):\nstruct FeeRefund {\n+ \taddress gasToken;\n \tuint256 baseGas;\n \tuint256 gasPrice; //gasPrice or tokenGasPrice\n \tuint256 tokenGasPriceFactor;\n- \taddress gasToken;\n \taddress payable refundReceiver;\n \t}\n\n// Code block 3 (unknown):\nstruct MemoryUserOp {\n \t\taddress sender;\n+\t\taddress paymaster;\n \t \tuint256 nonce;\n \t\tuint256 callGasLimit;\n \t\tuint256 verificationGasLimit;\n \t\tuint256 preVerificationGas;\n-\t\taddress paymaster;\n \t\tuint256 maxFeePerGas;\n \t\tuint256 maxPriorityFeePerGas;\n \t\t}\n\n// Code block 4 (unknown):\nstruct DepositInfo {\n-\t\tuint112 deposit;\n-\t\tbool staked;\n-\t\tuint112 stake;\n \t\tuint32 unstakeDelaySec;\n \t\tuint64 withdrawTime;\n+\t\tuint112 stake;\n+\t\tuint112 deposit;\n+\t\tbool staked;\n \t\t}\n\n// Code block 5 (unknown):\nstring public constant VERSION = \"1.0.2\"; // using AA 0.3.0\n\n// Code block 6 (unknown):\nstring public constant VERSION = \"1.0.2\";", "all_code_blocks_count": 6, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SmartAccount.sol#L36, SmartAccountFactory.sol#L11, DefaultCallbackHandler.sol#L12", "github_files_list": "DefaultCallbackHandler.sol, SmartAccount.sol, SmartAccountFactory.sol", "github_refs_count": 3, "vulnerable_code_actual": "struct Transaction {\n \taddress to;\n- \tuint256 value;\n \tbytes data;\n \tEnum.Operation operation;\n+ \tuint256 value;\n \tuint256 targetTxGas;\n \t}\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "struct FeeRefund {\n+ \taddress gasToken;\n \tuint256 baseGas;\n \tuint256 gasPrice; //gasPrice or tokenGasPrice\n \tuint256 tokenGasPriceFactor;\n- \taddress gasToken;\n \taddress payable refundReceiver;\n \t}\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 12} {"source": "c4", "protocol": "02-ethos", "title": "Rolezn Q", "severity_raw": "Critical", "severity": "critical", "description": "## Summary\n\n### Low Risk Issues\n| |Issue|Contexts|\n|-|:-|:-:|\n| [LOW‑1](#LOW‑1) | `decimals()` not part of ERC20 standard | 1 |\n| [LOW‑2](#LOW‑2) | Event is missing parameters | 2 |\n| [LOW‑3](#LOW‑3) | Function can risk gas exhaustion on large receipt calls due to multiple mandatory loops | 2 |\n| [LOW‑4](#LOW‑4) | Possible rounding issue | 2 |\n| [LOW‑5](#LOW‑5) | Contracts are not using their OZ Upgradeable counterparts | 6 |\n| [LOW‑6](#LOW‑6) | `require()` should be used instead of `assert()` | 20 |\n| [LOW‑7](#LOW‑7) | Inability to remove specific array values | 2 |\n| [LOW‑8](#LOW‑8) | Upgrade OpenZeppelin Contract Dependency | 3 |\n\nTotal: 38 contexts over 8 issues\n\n### Non-critical Issues\n| |Issue|Contexts|\n|-|:-|:-:|\n| [NC‑1](#NC‑1) | Add a timelock to critical functions | 15 |\n| [NC‑2](#NC‑2) | Avoid Floating Pragmas: The Version Should Be Locked | 3 |\n| [NC‑3](#NC‑3) | Variable Names That Consist Of All Capital Letters Should Be Reserved For Const/immutable Variables | 2 |\n| [NC‑4](#NC‑4) | Constants Should Be Defined Rather Than Using Magic Numbers | 4 |\n| [NC‑5](#NC‑5) | Constants in comparisons should appear on the left side | 12 |\n| [NC‑6](#NC‑6) | Critical Changes Should Use Two-step Procedure | 15 |\n| [NC‑7](#NC‑7) | Duplicated `require()`/`revert()` Checks Should Be Refactored To A Modifier Or Function | 6 |\n| [NC‑8](#NC‑8) | Duplicate imports | 2 |\n| [NC‑9](#NC‑9) | `block.timestamp` is already used when emitting events, no need to input timestamp | 1 |\n| [NC‑10](#NC‑10) | Function writing that does not comply with the Solidity Style Guide | 11 |\n| [NC‑11](#NC‑11) | Large or complicated code bases should implement fuzzing tests | 1 |\n| [NC‑12](#NC‑12) | Use `d", "vulnerable_code": "63: uint256 decimals = IERC20(collateral).decimals()", "fixed_code": "function pullCollateralFromBorrowerOperationsOrDefaultPool(address _collateral, uint _amount) external override {\n ...\n emit ActivePoolCollateralBalanceUpdated(_collateral, collAmount[_collateral]);\n ...\n }\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/Rolezn-Q.md", "collected_at": "2026-01-02T18:16:35.577174+00:00", "source_hash": "25fc73e5224c30ebbad3028d0aaeec37bb18c655a231ba6e14718fdaa63fe1aa", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "63: uint256 decimals = IERC20(collateral).decimals()", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function pullCollateralFromBorrowerOperationsOrDefaultPool(address _collateral, uint _amount) external override {\n ...\n emit ActivePoolCollateralBalanceUpdated(_collateral, collAmount[_collateral]);\n ...\n }\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "06-lybra", "title": "OpeOginni G", "severity_raw": "Low", "severity": "low", "description": "## 1. IF\u2019s/require() statements that check input arguments should be at the top of the function\n\n***Checks that involve constants should come before checks that involve state variables, function calls, and calculations. By doing these checks first, the function is able to revert before wasting a Gas in a function that may ultimately revert in the unhappy case.***\n\n``` \nFile: contracts/lybra/pools/base/LybraEUSDVaultBase.sol\n\n192: require(assetAmount <= depositedAsset[onBehalfOf], \"total of collateral can be liquidated at most\");\n```\n\nThis require statement only checks the values from the parameters of the Function `superLiquidation(address provider, address onBehalfOf, uint256 assetAmount)`, but is put below some other function calls that might waste gas if this Require statement ends up failing the whole function. Therefore it the require statement at line 192 should be put at the top of the function BEFORE any internal function calls.\n\nThis also happens in the following files:\n``` \nFile: contracts/lybra/pools/base/LybraPeUSDVaultBase.sol\n\n130: require(assetAmount * 2 <= depositedAsset[onBehalfOf], \"a max of 50% collateral can be liquidated\");\n require(PeUSD.allowance(provider, address(this)) > 0, \"provider should authorize to provide liquidation EUSD\");\n```", "vulnerable_code": "File: contracts/lybra/pools/base/LybraEUSDVaultBase.sol\n\n192: require(assetAmount <= depositedAsset[onBehalfOf], \"total of collateral can be liquidated at most\");", "fixed_code": "File: contracts/lybra/pools/base/LybraPeUSDVaultBase.sol\n\n130: require(assetAmount * 2 <= depositedAsset[onBehalfOf], \"a max of 50% collateral can be liquidated\");\n require(PeUSD.allowance(provider, address(this)) > 0, \"provider should authorize to provide liquidation EUSD\");", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/OpeOginni-G.md", "collected_at": "2026-01-02T18:22:33.277700+00:00", "source_hash": "2656af2644688425bb66363100c82e6630d16b80b85636df2296585d75dd1b24", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 453, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "This require statement only checks the values from the parameters of the Function `superLiquidation(address provider, address onBehalfOf, uint256 assetAmount)`, but is put below some other function calls that might waste gas if this Require statement ends up failing the whole function. Therefore it the require statement at line 192 should be put at the top of the function BEFORE any internal function calls.\n\nThis also happens in the following files:", "primary_code_language": "unknown", "primary_code_char_count": 453, "all_code_blocks": "// Code block 1 (unknown):\nThis require statement only checks the values from the parameters of the Function `superLiquidation(address provider, address onBehalfOf, uint256 assetAmount)`, but is put below some other function calls that might waste gas if this Require statement ends up failing the whole function. Therefore it the require statement at line 192 should be put at the top of the function BEFORE any internal function calls.\n\nThis also happens in the following files:", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: contracts/lybra/pools/base/LybraEUSDVaultBase.sol\n\n192: require(assetAmount <= depositedAsset[onBehalfOf], \"total of collateral can be liquidated at most\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/lybra/pools/base/LybraPeUSDVaultBase.sol\n\n130: require(assetAmount * 2 <= depositedAsset[onBehalfOf], \"a max of 50% collateral can be liquidated\");\n require(PeUSD.allowance(provider, address(this)) > 0, \"provider should authorize to provide liquidation EUSD\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5.6} {"source": "c4", "protocol": "01-biconomy", "title": "cyberinn G", "severity_raw": "Medium", "severity": "medium", "description": "# Gas Optimizations Report\n\n## G-01 Splitting `require()` statements that use `&&` saves gas\n\n### Impact\n\nWhen using `&&` in a `require()` statement, the entire statement will be evaluated before the transaction reverts. If the first condition is false, the second condition will not be evaluated. This means that if the first condition is false, the second condition will not be evaluated, which is a waste of gas. Splitting the `require()` statement into two separate statements will save gas.\n\n### Findings``\n\n[scw-contracts/contracts/smart-contract-wallet/base/ModuleManager.sol#L68](https://github.com/code-423n4/2023-01-biconomy/tree/main//scw-contracts/contracts/smart-contract-wallet/base/ModuleManager.sol#L68)\n\n```solidity\n68: require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \"BSA104\");\n```\n\n[scw-contracts/contracts/smart-contract-wallet/base/ModuleManager.sol#L34](https://github.com/code-423n4/2023-01-biconomy/tree/main//scw-contracts/contracts/smart-contract-wallet/base/ModuleManager.sol#L34)\n\n```solidity\n34: require(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");\n```\n\n[scw-contracts/contracts/smart-contract-wallet/base/ModuleManager.sol#L49](https://github.com/code-423n4/2023-01-biconomy/tree/main//scw-contracts/contracts/smart-contract-wallet/base/ModuleManager.sol#L49)\n\n```solidity\n49: require(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");\n```\n\n## G-02 Use named returns for local variables where it is possible.\n\n### Impact\n\nIt is not necessary to have both a named return and a return statement.\n\n### Findings\n\n[scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L486](https://github.com/code-423n4/2023-01-biconomy/tree/main//scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L486)\n\n```solidity\n486: uint256 maxFeePerGas = mUserOp.maxFeePerGas;\n```\n\n[scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/UserOperation.sol#L47](https://github", "vulnerable_code": "68: require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \"BSA104\");", "fixed_code": "34: require(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/cyberinn-G.md", "collected_at": "2026-01-02T18:13:40.045478+00:00", "source_hash": "26b7275411e974274e416bcffbdeb8a761b71b5af3204ff501f578a39e45c4ba", "code_block_count": 4, "solidity_block_count": 4, "total_code_chars": 300, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "68: require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \"BSA104\");", "primary_code_language": "solidity", "primary_code_char_count": 94, "all_code_blocks": "// Code block 1 (solidity):\n68: require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \"BSA104\");\n\n// Code block 2 (solidity):\n34: require(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");\n\n// Code block 3 (solidity):\n49: require(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");\n\n// Code block 4 (solidity):\n486: uint256 maxFeePerGas = mUserOp.maxFeePerGas;", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "68: require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \"BSA104\");\n\n34: require(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");\n\n49: require(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");\n\n486: uint256 maxFeePerGas = mUserOp.maxFeePerGas;", "github_refs_formatted": "ModuleManager.sol#L68, ModuleManager.sol#L34, ModuleManager.sol#L49, EntryPoint.sol#L486", "github_files_list": "ModuleManager.sol, EntryPoint.sol", "github_refs_count": 4, "vulnerable_code_actual": "68: require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \"BSA104\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": "34: require(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "11-kelp", "title": "adam idarrha Q", "severity_raw": "Medium", "severity": "medium", "description": "Title: depositors might not be able to deposit even if deposit limit is not reached\n\n## Lines of code:\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/oracles/ChainlinkPriceOracle.sol#L37-L39\n\n## Vulnerability details:\n### Details:\n\nthe protocol has a deposit limit per asset for all depositor calculated in the following way:\ntotal assets in LRTDepositPool + total assets in nodeDelegators + amountDepositedInEigenLayer: \n\n```solidity=47\nfunction getTotalAssetDeposits(address asset) public view override returns (uint256 totalAssetDeposit) {\n (uint256 assetLyingInDepositPool, uint256 assetLyingInNDCs, uint256 assetStakedInEigenLayer) =\n getAssetDistributionData(asset);\n return (assetLyingInDepositPool + assetLyingInNDCs + assetStakedInEigenLayer);\n }\n```\n\nthe amount Deposited in EigenLayer is calculated with the function `userUnderlyingView` which returns how much asset the user has in the pool, based on how many shares he has. which takes into account amount deposited + any rewards accrued from the strategy.\n\n`NodeDelegator`\n\n```solidity=121\nfunction getAssetBalance(address asset) external view override returns (uint256) {\n address strategy = lrtConfig.assetStrategy(asset);\n return IStrategy(strategy).userUnderlyingView(address(this));\n }\n```\n\n`StrategyBase.sol` out of scope:\n\n```solidity\n/**\n * @notice convenience function for fetching the current underlying value of all of the `user`'s shares in\n * this strategy. In contrast to `userUnderlying`, this function guarantees no state modifications\n */\n function userUnderlyingView(address user) external view virtual returns (uint256) {\n return sharesToUnderlyingView(shares(user));\n }\n```\n\nso the amount deposited in eigenlayer returns how much the user deposited + any rewards or slashing.\n\nwhich makes it that the protocol think that he reached the deposit limit without it actually reaching it.\n\n```solidity=56\n", "vulnerable_code": "the amount Deposited in EigenLayer is calculated with the function `userUnderlyingView` which returns how much asset the user has in the pool, based on how many shares he has. which takes into account amount deposited + any rewards accrued from the strategy.\n\n`NodeDelegator`\n", "fixed_code": "`StrategyBase.sol` out of scope:\n", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/adam-idarrha-Q.md", "collected_at": "2026-01-02T18:27:46.604524+00:00", "source_hash": "26cbb1d8dddf6e14e310b113942818f306336bdf588e97673c841ec2b7370039", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 514, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "the amount Deposited in EigenLayer is calculated with the function `userUnderlyingView` which returns how much asset the user has in the pool, based on how many shares he has. which takes into account amount deposited + any rewards accrued from the strategy.\n\n`NodeDelegator`", "primary_code_language": "unknown", "primary_code_char_count": 275, "all_code_blocks": "// Code block 1 (unknown):\nthe amount Deposited in EigenLayer is calculated with the function `userUnderlyingView` which returns how much asset the user has in the pool, based on how many shares he has. which takes into account amount deposited + any rewards accrued from the strategy.\n\n`NodeDelegator`\n\n// Code block 2 (unknown):\n`StrategyBase.sol` out of scope:\n\n// Code block 3 (unknown):\nso the amount deposited in eigenlayer returns how much the user deposited + any rewards or slashing.\n\nwhich makes it that the protocol think that he reached the deposit limit without it actually reaching it.", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ChainlinkPriceOracle.sol#L37-L39", "github_files_list": "ChainlinkPriceOracle.sol", "github_refs_count": 1, "vulnerable_code_actual": "the amount Deposited in EigenLayer is calculated with the function `userUnderlyingView` which returns how much asset the user has in the pool, based on how many shares he has. which takes into account amount deposited + any rewards accrued from the strategy.\n\n`NodeDelegator`\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "`StrategyBase.sol` out of scope:\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "01-biconomy", "title": "0xSmartContract Q", "severity_raw": "Critical", "severity": "critical", "description": "## Summary\n### Low Risk Issues List\n| Number |Issues Details|Context|\n|:--:|:-------|:--:|\n|[L-01]| Prevent division by 0| 1 |\n|[L-02]| Use of EIP 4337, which is likely to change, not recommended for general use or application | 1 |\n|[L-03]| Consider using OpenZeppelin's SafeCast library to prevent unexpected overflows when casting from uint256| 1 |\n|[L-04]| Gas griefing/theft is possible on unsafe external call| 8 |\n|[L-05]| Front running attacks by the `onlyOwner` | 1 |\n|[L-06]| A single point of failure | 14 |\n|[L-07]| Loss of precision due to rounding | 1 |\n|[L-08]| No Storage Gap for ` BaseSmartAccount ` and `ModuleManager `| 2 |\n|[L-09]| Missing Event for critical parameters init and change | 1 |\n|[L-10]| Use `2StepSetOwner ` instead of ` setOwner `| 1 |\n|[L-11]| init() function can be called by anybody| 1 |\n|[L-12]| The minimum transaction value of 21,000 gas may change in the future| 1 |\n\nTotal 12 issues\n\n\n### Non-Critical Issues List\n| Number |Issues Details|Context|\n|:--:|:-------|:--:|\n| [N-01]|Insufficient coverage|1|\n| [N-02] |Unused function parameter and local variable |2|\n| [N-03] |Initial value check is missing in Set Functions| 3 |\n| [N-04] |NatSpec comments should be increased in contracts |All Contracts|\n| [N-05] |`Function writing` that does not comply with the `Solidity Style Guide` |All Contracts|\n| [N-06] |Add a timelock to critical functions| 1|\n| [N-07] |For modern and more readable code; update import usages| 116 |\n| [N-08] |Include return parameters in NatSpec comments | All Contracts |\n| [N-09] |Long lines are not suitable for the \u2018Solidity Style Guide\u2019| 9 |\n| [N-10] |Need Fuzzing test| 23 |\n| [N-11] |Test environment comments and codes should not be in the main version| 1 |\n| [N-12] |Use of bytes.concat() instead of abi.encodePacked()| 5 |\n| [N-13] |For functions, follow Solidity standard naming conventions (internal function style rule)| 13 |\n| [N-14] |Omissions in Events| 1 |\n| [N-15] |Open TODOs | 1 |\n| [N-16] |Mark visibility of", "vulnerable_code": "2 results - 1 file\n\ncontracts/smart-contract-wallet/SmartAccount.sol:\n 264: payment = (gasUsed + baseGas) * (gasPrice) / (tokenGasPriceFactor);\n 288: payment = (gasUsed + baseGas) * (gasPrice) / (tokenGasPriceFactor);", "fixed_code": "contracts/smart-contract-wallet/SmartAccount.sol:\n 246 \n 247: function handlePayment(\n 248: uint256 gasUsed,\n 249: uint256 baseGas,\n 250: uint256 gasPrice,\n 251: uint256 tokenGasPriceFactor,\n 252: address gasToken,\n 253: address payable refundReceiver\n 254: ) private nonReentrant returns (uint256 payment) {\n 255: // uint256 startGas = gasleft();\n 256: // solhint-disable-next-line avoid-tx-origin\n 257: address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\n 258: if (gasToken == address(0)) {\n 259: // For ETH we will only adjust the gas price to not be higher than the actual used gas price\n 260: payment = (gasUsed + baseGas) * (gasPrice < tx.gasprice ? gasPrice : tx.gasprice);\n 261: (bool success,) = receiver.call{value: payment}(\"\");\n 262: require(success, \"BSA011\");\n 263: } else {\n 264: payment = (gasUsed + baseGas) * (gasPrice) / (tokenGasPriceFactor);\n 265: require(transferToken(gasToken, receiver, payment), \"BSA012\");\n 266: }\n 267: // uint256 requiredGas = startGas - gasleft();\n 268: //console.log(\"hp %s\", requiredGas);\n 269: }\n 270: \n 271: function handlePaymentRevert(\n 272: uint256 gasUsed,\n 273: uint256 baseGas,\n 274: uint256 gasPrice,\n 275: uint256 tokenGasPriceFactor,\n 276: address gasToken,\n 277: address payable refundReceiver\n 278: ) external returns (uint256 payment) {\n 279: uint256 startGas = gasleft();\n 280: // solhint-disable-next-line avoid-tx-origin\n 281: address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\n 282: if (gasToken == address(0)) {\n 283: // For ETH we will only adjust the gas price to not be higher than the actual used gas price\n ", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/0xSmartContract-Q.md", "collected_at": "2026-01-02T18:12:47.698176+00:00", "source_hash": "26fbd1330b2c5b47719a2ca177841381acb1dc6db5ef7ea2460fb6d6f1ec6b0c", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "2 results - 1 file\n\ncontracts/smart-contract-wallet/SmartAccount.sol:\n 264: payment = (gasUsed + baseGas) * (gasPrice) / (tokenGasPriceFactor);\n 288: payment = (gasUsed + baseGas) * (gasPrice) / (tokenGasPriceFactor);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "contracts/smart-contract-wallet/SmartAccount.sol:\n 246 \n 247: function handlePayment(\n 248: uint256 gasUsed,\n 249: uint256 baseGas,\n 250: uint256 gasPrice,\n 251: uint256 tokenGasPriceFactor,\n 252: address gasToken,\n 253: address payable refundReceiver\n 254: ) private nonReentrant returns (uint256 payment) {\n 255: // uint256 startGas = gasleft();\n 256: // solhint-disable-next-line avoid-tx-origin\n 257: address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\n 258: if (gasToken == address(0)) {\n 259: // For ETH we will only adjust the gas price to not be higher than the actual used gas price\n 260: payment = (gasUsed + baseGas) * (gasPrice < tx.gasprice ? gasPrice : tx.gasprice);\n 261: (bool success,) = receiver.call{value: payment}(\"\");\n 262: require(success, \"BSA011\");\n 263: } else {\n 264: payment = (gasUsed + baseGas) * (gasPrice) / (tokenGasPriceFactor);\n 265: require(transferToken(gasToken, receiver, payment), \"BSA012\");\n 266: }\n 267: // uint256 requiredGas = startGas - gasleft();\n 268: //console.log(\"hp %s\", requiredGas);\n 269: }\n 270: \n 271: function handlePaymentRevert(\n 272: uint256 gasUsed,\n 273: uint256 baseGas,\n 274: uint256 gasPrice,\n 275: uint256 tokenGasPriceFactor,\n 276: address gasToken,\n 277: address payable refundReceiver\n 278: ) external returns (uint256 payment) {\n 279: uint256 startGas = gasleft();\n 280: // solhint-disable-next-line avoid-tx-origin\n 281: address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\n 282: if (gasToken == address(0)) {\n 283: // For ETH we will only adjust the gas price to not be higher than the actual used gas price\n ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-ondo", "title": "AkshaySrivastav Q", "severity_raw": "Unknown", "severity": "unknown", "description": "- `KYCRegistryClientConstructable` contains double import statements.\n ```solidity\n import \"contracts/cash/kyc/KYCRegistryClient.sol\";\n import \"contracts/cash/kyc/KYCRegistryClient.sol\";\n ```\n- In CashManager contract more input validations should be added for privileged access restricted functions.\nLike:\n - `setMintExchangeRateDeltaLimit` - `_exchangeRateDeltaLimit` must be less than `BPS_DENOMINATOR`. \n - `setRedeemLimit` - `_redeemLimit` must not be less than `currentRedeemAmount`.\n\n- Ownable - no getter function present for `pendingOwnerAddr` variable.\n ```solidity\n address private pendingOwnerAddr;\n ```\n- `OndoPriceOracle.getUnderlyingPrice` should validate that `cTokenAddress != 0`. The the developer comments mentions a check but it is not implemented.\n ```solidity\n /**\n * @notice Retrieve the price of the provided fToken\n * contract's underlying asset\n * @param fToken fToken contract address\n * @dev This function first attempts to check if the price has been set directly \n in contract storage. If not set, we check if there is a corresponding cToken\n * set within `fTokenToCToken` and piggy back on an external price oracle.\n */\n function getUnderlyingPrice(address fToken) external view override returns (uint256) {\n if (fTokenToUnderlyingPrice[fToken] != 0) {\n return fTokenToUnderlyingPrice[fToken];\n } else {\n address cTokenAddress = fTokenToCToken[fToken]; // @audit-issue - should validate cTokenAddress != 0, \n return cTokenOracle.getUnderlyingPrice(cTokenAddress);\n }\n }\n ```\n- During research and discussion it was mentioned by Ondo team that interactions with Compound's CEth contract could be possible in the future. However the current state of Ondo contracts are not compatible with CEth interactions. Eg: - the `OndoPriceOracleV2` contract calls `underlying()` and `decimals()` functions of Compound's CT", "vulnerable_code": "", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/AkshaySrivastav-Q.md", "collected_at": "2026-01-02T18:14:26.588907+00:00", "source_hash": "275d1cb672de9edb677a0ab29c98b446292d7c681d164dc847794975b47cd360", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 977, "github_ref_count": 0, "vulnerable_code_is_url": true, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "import \"contracts/cash/kyc/KYCRegistryClient.sol\";\n import \"contracts/cash/kyc/KYCRegistryClient.sol\";", "primary_code_language": "solidity", "primary_code_char_count": 105, "all_code_blocks": "// Code block 1 (solidity):\nimport \"contracts/cash/kyc/KYCRegistryClient.sol\";\n import \"contracts/cash/kyc/KYCRegistryClient.sol\";\n\n// Code block 2 (solidity):\naddress private pendingOwnerAddr;\n\n// Code block 3 (solidity):\n/**\n * @notice Retrieve the price of the provided fToken\n * contract's underlying asset\n * @param fToken fToken contract address\n * @dev This function first attempts to check if the price has been set directly \n in contract storage. If not set, we check if there is a corresponding cToken\n * set within `fTokenToCToken` and piggy back on an external price oracle.\n */\n function getUnderlyingPrice(address fToken) external view override returns (uint256) {\n if (fTokenToUnderlyingPrice[fToken] != 0) {\n return fTokenToUnderlyingPrice[fToken];\n } else {\n address cTokenAddress = fTokenToCToken[fToken]; // @audit-issue - should validate cTokenAddress != 0, \n return cTokenOracle.getUnderlyingPrice(cTokenAddress);\n }\n }", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "import \"contracts/cash/kyc/KYCRegistryClient.sol\";\n import \"contracts/cash/kyc/KYCRegistryClient.sol\";\n\naddress private pendingOwnerAddr;\n\n/**\n * @notice Retrieve the price of the provided fToken\n * contract's underlying asset\n * @param fToken fToken contract address\n * @dev This function first attempts to check if the price has been set directly \n in contract storage. If not set, we check if there is a corresponding cToken\n * set within `fTokenToCToken` and piggy back on an external price oracle.\n */\n function getUnderlyingPrice(address fToken) external view override returns (uint256) {\n if (fTokenToUnderlyingPrice[fToken] != 0) {\n return fTokenToUnderlyingPrice[fToken];\n } else {\n address cTokenAddress = fTokenToCToken[fToken]; // @audit-issue - should validate cTokenAddress != 0, \n return cTokenOracle.getUnderlyingPrice(cTokenAddress);\n }\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "", "has_vulnerable_code_snippet": false, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "02-ethos", "title": "Aymen0909 Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA Report\n\n## Summary\n\n| | Issue | Risk | Instances |\n| :-------------: |:-------------|:-------------:|:-------------:|\n| 1 | `delegateBySig` doesn't revert when `signer` is `address(0)` | Low | 1 |\n| 2 | Front-runable `initialize` function | Low | 1 |\n| 3 | Mistake in the `feeBPS` checks revert string | NC | 2 |\n| 4 | Remove old code comment lines | NC | 1 |\n\n\n## Findings\n\n\n### 1- `permit` doesn't revert when `recoveredAddress` is `address(0)` :\n\n### Risk : Low\n\nThe function `permit` from the LUSDToken contract is used to allow the users to delegate by signatures and it uses the `ecrecover` function to get the `recoveredAddress` address, this function can in some cases return `address(0)` but the `permit` function does not check the `recoveredAddress` address and thus it will not revert in case of `recoveredAddress == address(0)`.\n\n### Proof of Concept\n\nthe issue occurs in the `permit` function below :\n\nFile: LUSDToken.sol [Line 262-294](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L262-L294)\n\n```solidity\nfunction permit\n(\n address owner, \n address spender, \n uint amount, \n uint deadline, \n uint8 v, \n bytes32 r, \n bytes32 s\n) \n external \n override \n{\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (301): 0 < s < secp256k1n \u00f7 2 + 1, and for v in (302): v \u2208 {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n revert('LUSD: Invalid s value');\n }\n require(deadline >= now, 'LUSD: expired deadline');\n bytes32 digest = keccak256(abi.encodePacked('\\x19\\x01', \n dom", "vulnerable_code": "function permit\n(\n address owner, \n address spender, \n uint amount, \n uint deadline, \n uint8 v, \n bytes32 r, \n bytes32 s\n) \n external \n override \n{\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (301): 0 < s < secp256k1n \u00f7 2 + 1, and for v in (302): v \u2208 {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n revert('LUSD: Invalid s value');\n }\n require(deadline >= now, 'LUSD: expired deadline');\n bytes32 digest = keccak256(abi.encodePacked('\\x19\\x01', \n domainSeparator(), keccak256(abi.encode(\n _PERMIT_TYPEHASH, owner, spender, amount, \n _nonces[owner]++, deadline))));\n address recoveredAddress = ecrecover(digest, v, r, s);\n require(recoveredAddress == owner, 'LUSD: invalid signature');\n _approve(owner, spender, amount);\n}", "fixed_code": "function initialize(\n address _vault,\n address[] memory _strategists,\n address[] memory _multisigRoles,\n IAToken _gWant\n) public initializer ", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/Aymen0909-Q.md", "collected_at": "2026-01-02T18:15:57.672668+00:00", "source_hash": "27c7e51a43eb80021ff807ee962f7bacf3b8f0b83c599bec6ed40e5041cf6c76", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LUSDToken.sol#L262-L294", "github_files_list": "LUSDToken.sol", "github_refs_count": 1, "vulnerable_code_actual": "function permit\n(\n address owner, \n address spender, \n uint amount, \n uint deadline, \n uint8 v, \n bytes32 r, \n bytes32 s\n) \n external \n override \n{\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (301): 0 < s < secp256k1n \u00f7 2 + 1, and for v in (302): v \u2208 {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n revert('LUSD: Invalid s value');\n }\n require(deadline >= now, 'LUSD: expired deadline');\n bytes32 digest = keccak256(abi.encodePacked('\\x19\\x01', \n domainSeparator(), keccak256(abi.encode(\n _PERMIT_TYPEHASH, owner, spender, amount, \n _nonces[owner]++, deadline))));\n address recoveredAddress = ecrecover(digest, v, r, s);\n require(recoveredAddress == owner, 'LUSD: invalid signature');\n _approve(owner, spender, amount);\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function initialize(\n address _vault,\n address[] memory _strategists,\n address[] memory _multisigRoles,\n IAToken _gWant\n) public initializer ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "03-asymmetry", "title": "Jerry0x Q", "severity_raw": "Low", "severity": "low", "description": "Confirm the derivative address to avoid incorrectly setting weight.\n```\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L165-L175\n\n function adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight,\n address _checkDerivative\n ) external onlyOwner {\n require(_checkDerivative == address(derivatives[_derivativeIndex]), \"wrong derivative\");\n weights[_derivativeIndex] = _weight;\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n for (uint i = 0; i < derivativeCount; i++) {\n uint256 weight = weights[i];\n if (weight == 0) continue;\n uint256 ethAmount = (minAmount * weight) / totalWeight;\n require(ethAmount > 0, \"weight too low\");\n }\n emit WeightChange(_derivativeIndex, _weight);\n }\n```\nAdding and removing functions can reduce gas costs and minimize unknown risks.\n```\n function removeDerivative(\n uint256 _derivativeIndex,\n address _checkDerivative\n ) external onlyOwner {\n require(_checkDerivative != address(0), \"invalid address\");\n require(_checkDerivative == address(derivatives[_derivativeIndex]), \"wrong derivative\");\n adjustWeight(_derivativeIndex, 0,_checkDerivative);\n rebalanceToWeights();\n --derivativeCount;\n derivatives[_derivativeIndex] = derivatives[derivativeCount];\n weights[_derivativeIndex] = weights[derivativeCount];\n }\n```\nLower gas, reduced risk, easier to understand.\n```\nstruct Derivative {\n IDerivative derivative;\n uint96 weight;\n}\nmapping(uint256 => Derivative) public derivatives;\n```\n\ntotalEth and totalEthAmount are not always equal, Whether returning or depositing, we should handle it.\n```\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L83-L96\n uint256 totalEth = ", "vulnerable_code": "https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L165-L175\n\n function adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight,\n address _checkDerivative\n ) external onlyOwner {\n require(_checkDerivative == address(derivatives[_derivativeIndex]), \"wrong derivative\");\n weights[_derivativeIndex] = _weight;\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n for (uint i = 0; i < derivativeCount; i++) {\n uint256 weight = weights[i];\n if (weight == 0) continue;\n uint256 ethAmount = (minAmount * weight) / totalWeight;\n require(ethAmount > 0, \"weight too low\");\n }\n emit WeightChange(_derivativeIndex, _weight);\n }", "fixed_code": " function removeDerivative(\n uint256 _derivativeIndex,\n address _checkDerivative\n ) external onlyOwner {\n require(_checkDerivative != address(0), \"invalid address\");\n require(_checkDerivative == address(derivatives[_derivativeIndex]), \"wrong derivative\");\n adjustWeight(_derivativeIndex, 0,_checkDerivative);\n rebalanceToWeights();\n --derivativeCount;\n derivatives[_derivativeIndex] = derivatives[derivativeCount];\n weights[_derivativeIndex] = weights[derivativeCount];\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Jerry0x-Q.md", "collected_at": "2026-01-02T18:18:12.467928+00:00", "source_hash": "27d691b738b20e765fb4e71bcc80d9687c10441141b3275853918286ebe7b063", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 1544, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L165-L175\n\n function adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight,\n address _checkDerivative\n ) external onlyOwner {\n require(_checkDerivative == address(derivatives[_derivativeIndex]), \"wrong derivative\");\n weights[_derivativeIndex] = _weight;\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n for (uint i = 0; i < derivativeCount; i++) {\n uint256 weight = weights[i];\n if (weight == 0) continue;\n uint256 ethAmount = (minAmount * weight) / totalWeight;\n require(ethAmount > 0, \"weight too low\");\n }\n emit WeightChange(_derivativeIndex, _weight);\n }", "primary_code_language": "unknown", "primary_code_char_count": 885, "all_code_blocks": "// Code block 1 (unknown):\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L165-L175\n\n function adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight,\n address _checkDerivative\n ) external onlyOwner {\n require(_checkDerivative == address(derivatives[_derivativeIndex]), \"wrong derivative\");\n weights[_derivativeIndex] = _weight;\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n for (uint i = 0; i < derivativeCount; i++) {\n uint256 weight = weights[i];\n if (weight == 0) continue;\n uint256 ethAmount = (minAmount * weight) / totalWeight;\n require(ethAmount > 0, \"weight too low\");\n }\n emit WeightChange(_derivativeIndex, _weight);\n }\n\n// Code block 2 (unknown):\nfunction removeDerivative(\n uint256 _derivativeIndex,\n address _checkDerivative\n ) external onlyOwner {\n require(_checkDerivative != address(0), \"invalid address\");\n require(_checkDerivative == address(derivatives[_derivativeIndex]), \"wrong derivative\");\n adjustWeight(_derivativeIndex, 0,_checkDerivative);\n rebalanceToWeights();\n --derivativeCount;\n derivatives[_derivativeIndex] = derivatives[derivativeCount];\n weights[_derivativeIndex] = weights[derivativeCount];\n }\n\n// Code block 3 (unknown):\nstruct Derivative {\n IDerivative derivative;\n uint96 weight;\n}\nmapping(uint256 => Derivative) public derivatives;", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol#L165-L175, SafEth.sol#L83-L96", "github_files_list": "SafEth.sol", "github_refs_count": 2, "vulnerable_code_actual": "https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L165-L175\n\n function adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight,\n address _checkDerivative\n ) external onlyOwner {\n require(_checkDerivative == address(derivatives[_derivativeIndex]), \"wrong derivative\");\n weights[_derivativeIndex] = _weight;\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n for (uint i = 0; i < derivativeCount; i++) {\n uint256 weight = weights[i];\n if (weight == 0) continue;\n uint256 ethAmount = (minAmount * weight) / totalWeight;\n require(ethAmount > 0, \"weight too low\");\n }\n emit WeightChange(_derivativeIndex, _weight);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function removeDerivative(\n uint256 _derivativeIndex,\n address _checkDerivative\n ) external onlyOwner {\n require(_checkDerivative != address(0), \"invalid address\");\n require(_checkDerivative == address(derivatives[_derivativeIndex]), \"wrong derivative\");\n adjustWeight(_derivativeIndex, 0,_checkDerivative);\n rebalanceToWeights();\n --derivativeCount;\n derivatives[_derivativeIndex] = derivatives[derivativeCount];\n weights[_derivativeIndex] = weights[derivativeCount];\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "01-biconomy", "title": "shark G", "severity_raw": "Low", "severity": "low", "description": "## 1. Splitting `require` statements that use `&&` saves gas\n\nInstead of using the `&&` operator to check multiple conditions, use multiple `require()` statements. This will save approximately 3 gas per `&&`.\n\nHere is an example of this issue:\n\nFile: `ModuleManager.sol` [Line 34](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/base/ModuleManager.sol#L34)\n\n```solidity\n require(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");\n```\n\nIn the example above, the `&&` could be split up:\n\n```solidity\n require(module != address(0), \"BSA101\");\n require(module != SENTINEL_MODULES, \"BSA101\");\n```\n\nHere are 2 other instances of this issue:\n\n- File: `ModuleManager.sol` [Line 49](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/base/ModuleManager.sol#L49)\n- File: `ModuleManager.sol` [Line 68](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/base/ModuleManager.sol#L68)\n\n## 2. Strict equalities cost less gas than non-strict\n\nStrict equalities (`<`, `>`) cost less gas than non-strict (`<=`, `>=`). This is because strict equality uses fewer opcodes.\n\nFor instance:\n\nFile: `EntryPoint.sol` [Line 213](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L213)\n\n```solidity\n require(paymasterAndData.length >= 20, \"AA93 invalid paymasterAndData\");\n```\n\nThe `require` statement above could use `>` instead of `>=` to save gas:\n\n```solidity\n require(paymasterAndData.length > 19, \"AA93 invalid paymasterAndData\");\n```\n\nHere are some more instances of this issue:\n\n- File: `StakeManager.sol` [Line 41](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/StakeManager.sol#L41)\n- File: `StakeManager.sol` [Line 62](https://github.com/code-423n4/2023-", "vulnerable_code": " require(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");", "fixed_code": " require(module != address(0), \"BSA101\");\n require(module != SENTINEL_MODULES, \"BSA101\");", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/shark-G.md", "collected_at": "2026-01-02T18:14:09.640429+00:00", "source_hash": "27e1b44875ab811239a729e9f57b368a808204b49b7231a634f25954af0cbb2c", "code_block_count": 4, "solidity_block_count": 4, "total_code_chars": 308, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "require(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");", "primary_code_language": "solidity", "primary_code_char_count": 70, "all_code_blocks": "// Code block 1 (solidity):\nrequire(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");\n\n// Code block 2 (solidity):\nrequire(module != address(0), \"BSA101\");\n require(module != SENTINEL_MODULES, \"BSA101\");\n\n// Code block 3 (solidity):\nrequire(paymasterAndData.length >= 20, \"AA93 invalid paymasterAndData\");\n\n// Code block 4 (solidity):\nrequire(paymasterAndData.length > 19, \"AA93 invalid paymasterAndData\");", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "require(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");\n\nrequire(module != address(0), \"BSA101\");\n require(module != SENTINEL_MODULES, \"BSA101\");\n\nrequire(paymasterAndData.length >= 20, \"AA93 invalid paymasterAndData\");\n\nrequire(paymasterAndData.length > 19, \"AA93 invalid paymasterAndData\");", "github_refs_formatted": "ModuleManager.sol#L34, ModuleManager.sol#L49, ModuleManager.sol#L68, EntryPoint.sol#L213, StakeManager.sol#L41", "github_files_list": "ModuleManager.sol, StakeManager.sol, EntryPoint.sol", "github_refs_count": 5, "vulnerable_code_actual": " require(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": " require(module != address(0), \"BSA101\");\n require(module != SENTINEL_MODULES, \"BSA101\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "09-ondo", "title": "MohammedRizwan G", "severity_raw": "Medium", "severity": "medium", "description": "## Summary\n\n### Gas Optimizations\n| |Issue|Instances| |\n|-|:-|:-:|:-:|\n| [G‑01] | `_rmul()` can gas optimized by removing extra lines of code | 1 |\n| [G‑02] | Use assembly to emit events | 1 |\n| [G‑03] | Catch arguments as local variables in `simulateRange()` | 1 |\n| [G‑04] | Catch `value` in `roundUpTo8()` | 1 |\n| [G‑05] | save gas by using 10e27 instead 10 ** 27 | 1 |\n| [G‑06] | `_rpow()` and `_rmul()` can be imported instead of hardcoding it | 1 |\n| [G‑07] | Short the string message in `onlyGuardian` to save 256 bit storage | 1 |\n\n### [G‑01] `_rmul()` can gas optimized by removing extra lines of code\n`_rmul()` has been used in `derivePrice()`. With current implementation it has added extra bytes resulting in more deployment cost. This can be further gas optimized per recommendation.\n\nThere is [1 instance](https://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/rwaOracles/RWADynamicOracle.sol#L400-L406) of this issue:\n\n```Solidity\nFile: contracts/rwaOracles/RWADynamicOracle.sol\n\n function _rmul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n z = _mul(x, y) / ONE;\n }\n\n function _mul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n require(y == 0 || (z = x * y) / y == x);\n }\n```\n\n### Recommended Mitigation steps\n\n```diff\n\n function _rmul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n- z = _mul(x, y) / ONE;\n+ z = x * y;\n+ require(y == 0 || z / y == x);\n+ z = z / ONE;\n }\n\n- function _mul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n- require(y == 0 || (z = x * y) / y == x);\n- }\n```\n\n### [G‑02] Use assembly to emit events\nAssembly can be used to emit events efficiently by utilizing scratch space and the free memory pointer. This will allow us to potentially avoid memory expansion costs.\nNote: In order to do this optimization safely, we will need to cache and restore the free memor", "vulnerable_code": "File: contracts/rwaOracles/RWADynamicOracle.sol\n\n function _rmul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n z = _mul(x, y) / ONE;\n }\n\n function _mul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n require(y == 0 || (z = x * y) / y == x);\n }", "fixed_code": "### [G‑02] Use assembly to emit events\nAssembly can be used to emit events efficiently by utilizing scratch space and the free memory pointer. This will allow us to potentially avoid memory expansion costs.\nNote: In order to do this optimization safely, we will need to cache and restore the free memory pointer.\n\nThere are 2 instances of this issue:\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/MohammedRizwan-G.md", "collected_at": "2026-01-02T18:25:37.190883+00:00", "source_hash": "27f642952282d65871e671f35239d39759f5d2fc6048bceebb50eb8c22e8e8f9", "code_block_count": 2, "solidity_block_count": 1, "total_code_chars": 580, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/rwaOracles/RWADynamicOracle.sol\n\n function _rmul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n z = _mul(x, y) / ONE;\n }\n\n function _mul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n require(y == 0 || (z = x * y) / y == x);\n }", "primary_code_language": "Solidity", "primary_code_char_count": 277, "all_code_blocks": "// Code block 1 (Solidity):\nFile: contracts/rwaOracles/RWADynamicOracle.sol\n\n function _rmul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n z = _mul(x, y) / ONE;\n }\n\n function _mul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n require(y == 0 || (z = x * y) / y == x);\n }\n\n// Code block 2 (diff):\nfunction _rmul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n- z = _mul(x, y) / ONE;\n+ z = x * y;\n+ require(y == 0 || z / y == x);\n+ z = z / ONE;\n }\n\n- function _mul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n- require(y == 0 || (z = x * y) / y == x);\n- }", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "function _rmul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n- z = _mul(x, y) / ONE;\n+ z = x * y;\n+ require(y == 0 || z / y == x);\n+ z = z / ONE;\n }\n\n- function _mul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n- require(y == 0 || (z = x * y) / y == x);\n- }", "solidity_code": "File: contracts/rwaOracles/RWADynamicOracle.sol\n\n function _rmul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n z = _mul(x, y) / ONE;\n }\n\n function _mul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n require(y == 0 || (z = x * y) / y == x);\n }", "github_refs_formatted": "RWADynamicOracle.sol#L400-L406", "github_files_list": "RWADynamicOracle.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: contracts/rwaOracles/RWADynamicOracle.sol\n\n function _rmul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n z = _mul(x, y) / ONE;\n }\n\n function _mul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n require(y == 0 || (z = x * y) / y == x);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "### [G‑02] Use assembly to emit events\nAssembly can be used to emit events efficiently by utilizing scratch space and the free memory pointer. This will allow us to potentially avoid memory expansion costs.\nNote: In order to do this optimization safely, we will need to cache and restore the free memory pointer.\n\nThere are 2 instances of this issue:\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "01-salty", "title": "IceBear Q", "severity_raw": "Medium", "severity": "medium", "description": "## [L-01] Hardcoding EXPECTED_SIGNER reduces future scalability.\nhttps://github.com/code-423n4/2024-01-salty/blob/main/src/SigningTools.sol#L7\n```\naddress constant public EXPECTED_SIGNER = 0x1234519DCA2ef23207E1CA7fd70b96f281893bAa;\n```\n## [L-02] No mechanism for blacklisting.\n\nOnce a user has been granted permission, there is no mechanism for removal in the absence of a blacklist.\nhttps://github.com/code-423n4/2024-01-salty/blob/main/src/AccessManager.sol#L65\n```\n// Grant access to the sender for the given geoVersion.\n// Requires the accompanying correct message signature from the offchain verifier.\nfunction grantAccess(bytes calldata signature) external\n {\n require( _verifyAccess(msg.sender, signature), \"Incorrect AccessManager.grantAccess signatory\" );\n\n _walletsWithAccess[geoVersion][msg.sender] = true;\n\n emit AccessGranted( msg.sender, geoVersion );\n } \n```\n\n## [L-03] Excess tokens approval will be give to the staking contract.\nThis issue is covered in the [bot race report](https://github.com/code-423n4/2024-01-salty/blob/main/bot-report.md#l-16) but lacks a more detailed explanation.\n\nsaltBalance is the salt balance of the Airdrop contract.\nsaltAmountForEachUser is calculated as follows:\n\nhttps://github.com/code-423n4/2024-01-salty/blob/main/src/launch/Airdrop.sol#L64\n```\nsaltAmountForEachUser = saltBalance / numberAuthorized();\n```\nAfterward, approve saltBalance to the staking contract.\nhttps://github.com/code-423n4/2024-01-salty/blob/main/src/launch/Airdrop.sol#L67\n```\nsalt.approve( address(staking), saltBalance );\n```\nclaimAirdrop() only sends out saltAmountForEachUser.\n\nhttps://github.com/code-423n4/2024-01-salty/blob/main/src/launch/Airdrop.sol#L81-L82\n```\n// Have the Airdrop contract stake a specified amount of SALT and then transfer it to the user\n\t\tstaking.stakeSALT( saltAmountForEachUser );\n\t\tstaking.transferStakedSaltFromAirdropToUser( msg.sender, saltAmountForEachUser );\n```\nConsider the following scenarios:\nIf saltBalan", "vulnerable_code": "address constant public EXPECTED_SIGNER = 0x1234519DCA2ef23207E1CA7fd70b96f281893bAa;", "fixed_code": "// Grant access to the sender for the given geoVersion.\n// Requires the accompanying correct message signature from the offchain verifier.\nfunction grantAccess(bytes calldata signature) external\n {\n require( _verifyAccess(msg.sender, signature), \"Incorrect AccessManager.grantAccess signatory\" );\n\n _walletsWithAccess[geoVersion][msg.sender] = true;\n\n emit AccessGranted( msg.sender, geoVersion );\n } ", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/IceBear-Q.md", "collected_at": "2026-01-02T19:01:17.892645+00:00", "source_hash": "28355889afd134341d5751190c121a95af7b16e547b1e82a627f56c0b3d5a742", "code_block_count": 5, "solidity_block_count": 0, "total_code_chars": 839, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "address constant public EXPECTED_SIGNER = 0x1234519DCA2ef23207E1CA7fd70b96f281893bAa;", "primary_code_language": "unknown", "primary_code_char_count": 85, "all_code_blocks": "// Code block 1 (unknown):\naddress constant public EXPECTED_SIGNER = 0x1234519DCA2ef23207E1CA7fd70b96f281893bAa;\n\n// Code block 2 (unknown):\n// Grant access to the sender for the given geoVersion.\n// Requires the accompanying correct message signature from the offchain verifier.\nfunction grantAccess(bytes calldata signature) external\n {\n require( _verifyAccess(msg.sender, signature), \"Incorrect AccessManager.grantAccess signatory\" );\n\n _walletsWithAccess[geoVersion][msg.sender] = true;\n\n emit AccessGranted( msg.sender, geoVersion );\n }\n\n// Code block 3 (unknown):\nsaltAmountForEachUser = saltBalance / numberAuthorized();\n\n// Code block 4 (unknown):\nsalt.approve( address(staking), saltBalance );\n\n// Code block 5 (unknown):\n// Have the Airdrop contract stake a specified amount of SALT and then transfer it to the user\n\t\tstaking.stakeSALT( saltAmountForEachUser );\n\t\tstaking.transferStakedSaltFromAirdropToUser( msg.sender, saltAmountForEachUser );", "all_code_blocks_count": 5, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SigningTools.sol#L7, AccessManager.sol#L65, Airdrop.sol#L64, Airdrop.sol#L67, Airdrop.sol#L81-L82", "github_files_list": "Airdrop.sol, SigningTools.sol, AccessManager.sol", "github_refs_count": 5, "vulnerable_code_actual": "address constant public EXPECTED_SIGNER = 0x1234519DCA2ef23207E1CA7fd70b96f281893bAa;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "// Grant access to the sender for the given geoVersion.\n// Requires the accompanying correct message signature from the offchain verifier.\nfunction grantAccess(bytes calldata signature) external\n {\n require( _verifyAccess(msg.sender, signature), \"Incorrect AccessManager.grantAccess signatory\" );\n\n _walletsWithAccess[geoVersion][msg.sender] = true;\n\n emit AccessGranted( msg.sender, geoVersion );\n } ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 11} {"source": "c4", "protocol": "06-lybra", "title": "KKat7531 Q", "severity_raw": "Critical", "severity": "critical", "description": "# Findings Summary\n\n| ID | Title | Severity |\n| ------ | ---------------------------------------------------------------------------------- | ------------- |\n| [L-01] | Missing zero address & pausable checks in `EUSD.sol` | Low |\n| [NC-01] | Use a safe pragma statement | Non-critical |\n| [NC-02] | Import OZ `SafeCast` library | Non-critical |\n\n# Findings\n\n# [L-01] Missing zero address & pausable checks in `EUSD.sol` \n\nNatspec comment mentioned checks that are not actually done, as you can see from the example below, there are no checks implemented to validate that recipient is not zero address or that the contract is not paused\n\n ```solidity\n * Requirements:\n *\n * - `_recipient` cannot be the zero address.\n * - the caller must have at least `_sharesAmount` shares.\n * - the contract must not be paused.\n *\n * @dev The `_sharesAmount` argument is the amount of shares, not tokens.\n */\n function transferShares(address _recipient, uint256 _sharesAmount) public returns (uint256) {\n address owner = _msgSender();\n _transferShares(owner, _recipient, _sharesAmount);\n emit TransferShares(owner, _recipient, _sharesAmount);\n uint256 tokensAmount = getMintedEUSDByShares(_sharesAmount);\n emit Transfer(owner, _recipient, tokensAmount);\n return tokensAmount;\n }\n```\n\n# [NC-01] Use a safe pragma statement\n\nAlways use stable pragma statement to lock the compiler version and to have deterministic compilation to bytecode. Finally consider upgrading the version to a newer one to use bugfixes and optimizations in the compiler. This is recommended to be changed in all contracts in the scope.\n\n# [NC-02] Import OZ `SafeCast` library \n\nFunction `clock` returns a `SafeCast.toUint48(blo", "vulnerable_code": " * Requirements:\n *\n * - `_recipient` cannot be the zero address.\n * - the caller must have at least `_sharesAmount` shares.\n * - the contract must not be paused.\n *\n * @dev The `_sharesAmount` argument is the amount of shares, not tokens.\n */\n function transferShares(address _recipient, uint256 _sharesAmount) public returns (uint256) {\n address owner = _msgSender();\n _transferShares(owner, _recipient, _sharesAmount);\n emit TransferShares(owner, _recipient, _sharesAmount);\n uint256 tokensAmount = getMintedEUSDByShares(_sharesAmount);\n emit Transfer(owner, _recipient, tokensAmount);\n return tokensAmount;\n }", "fixed_code": " function clock() public override view returns (uint48){\n return SafeCast.toUint48(block.number);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/KKat7531-Q.md", "collected_at": "2026-01-02T18:22:24.489908+00:00", "source_hash": "283689ec7b7ae1894a71bac382f33fabdbccad94e4727fd91b76f9b2b7522e93", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 688, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "* Requirements:\n *\n * - `_recipient` cannot be the zero address.\n * - the caller must have at least `_sharesAmount` shares.\n * - the contract must not be paused.\n *\n * @dev The `_sharesAmount` argument is the amount of shares, not tokens.\n */\n function transferShares(address _recipient, uint256 _sharesAmount) public returns (uint256) {\n address owner = _msgSender();\n _transferShares(owner, _recipient, _sharesAmount);\n emit TransferShares(owner, _recipient, _sharesAmount);\n uint256 tokensAmount = getMintedEUSDByShares(_sharesAmount);\n emit Transfer(owner, _recipient, tokensAmount);\n return tokensAmount;\n }", "primary_code_language": "solidity", "primary_code_char_count": 688, "all_code_blocks": "// Code block 1 (solidity):\n* Requirements:\n *\n * - `_recipient` cannot be the zero address.\n * - the caller must have at least `_sharesAmount` shares.\n * - the contract must not be paused.\n *\n * @dev The `_sharesAmount` argument is the amount of shares, not tokens.\n */\n function transferShares(address _recipient, uint256 _sharesAmount) public returns (uint256) {\n address owner = _msgSender();\n _transferShares(owner, _recipient, _sharesAmount);\n emit TransferShares(owner, _recipient, _sharesAmount);\n uint256 tokensAmount = getMintedEUSDByShares(_sharesAmount);\n emit Transfer(owner, _recipient, tokensAmount);\n return tokensAmount;\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "* Requirements:\n *\n * - `_recipient` cannot be the zero address.\n * - the caller must have at least `_sharesAmount` shares.\n * - the contract must not be paused.\n *\n * @dev The `_sharesAmount` argument is the amount of shares, not tokens.\n */\n function transferShares(address _recipient, uint256 _sharesAmount) public returns (uint256) {\n address owner = _msgSender();\n _transferShares(owner, _recipient, _sharesAmount);\n emit TransferShares(owner, _recipient, _sharesAmount);\n uint256 tokensAmount = getMintedEUSDByShares(_sharesAmount);\n emit Transfer(owner, _recipient, tokensAmount);\n return tokensAmount;\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " * Requirements:\n *\n * - `_recipient` cannot be the zero address.\n * - the caller must have at least `_sharesAmount` shares.\n * - the contract must not be paused.\n *\n * @dev The `_sharesAmount` argument is the amount of shares, not tokens.\n */\n function transferShares(address _recipient, uint256 _sharesAmount) public returns (uint256) {\n address owner = _msgSender();\n _transferShares(owner, _recipient, _sharesAmount);\n emit TransferShares(owner, _recipient, _sharesAmount);\n uint256 tokensAmount = getMintedEUSDByShares(_sharesAmount);\n emit Transfer(owner, _recipient, tokensAmount);\n return tokensAmount;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function clock() public override view returns (uint48){\n return SafeCast.toUint48(block.number);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "03-asymmetry", "title": "d3tonator Q", "severity_raw": "Low", "severity": "low", "description": "# [L-01] Outdated Compiler 0.8.13 Used by the Contracts\n\n#### Description:\n\nDuring the analysis it was observed that the contracts code written in Solidity uses an outdated compiler version 0.8.13. The use of an outdated compiler version 0.8.13 poses several security risks that can compromise the security and stability of the smart contract. The following are the key findings of our audit:\n\n**Code Generation:** Fix data corruption that affected ABI-encoding of calldata values represented by tuples: structs at any nesting level; argument lists of external functions, events and errors; return value lists of external functions. The 32 leading bytes of the first dynamically-encoded value in the tuple would get zeroed when the last component contained a statically-encoded array.\n\nApart from these, there are several minor bug fixes and improvements.\n\n- Assembler: Avoid duplicating subassembly bytecode where possible.\n- Code Generator: Avoid including references to the deployed label of referenced functions if they are called right away.\n- ContractLevelChecker: Properly distinguish the case of missing base constructor arguments from having an unimplemented base function.\n- SMTChecker: Fix internal error caused by unhandled\u00a0`z3`\u00a0expressions that come from the solver when bitwise operators are used.\n- SMTChecker: Fix internal error when using the custom NatSpec annotation to abstract free functions.\n- TypeChecker: Also allow external library functions in\u00a0`using for`.\n\n#### Steps to reproduce:\n\nNavigate to the following contracts and directory: \n\n`https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/interfaces/IDerivative.sol#L2`\n\n````\n\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n````\n\n`https://github.com/code-423n4/2023-03-asymmetry/tree/main/contracts](https://github.com/code-423n4/2023-03-asymmetry/tree/main/contracts)/*`\n\n#### Mitigation\n\nThe minimum required version must be\u00a0[0.8.19](https://github.com/ethere", "vulnerable_code": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;", "fixed_code": "99 _mint(msg.sender, mintAmount);\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/d3tonator-Q.md", "collected_at": "2026-01-02T18:19:02.539577+00:00", "source_hash": "283c9c914d1563599353cfb56e5ff484eefe69c3019b7cb0d42ee1a36080a346", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 56, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;", "primary_code_language": "unknown", "primary_code_char_count": 56, "all_code_blocks": "// Code block 1 (unknown):\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "IDerivative.sol#L2", "github_files_list": "IDerivative.sol", "github_refs_count": 1, "vulnerable_code_actual": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "99 _mint(msg.sender, mintAmount);\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-biconomy", "title": "sayan G", "severity_raw": "Low", "severity": "low", "description": "## 1. X = X + Y IS CHEAPER THAN X += Y\nFile: [EntryPoint.sol](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol)\nline:[81](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L81)\n\n```\n collected += _executeUserOp(i, ops[i], opInfos[i]);\n```\n\nFile: [EntryPoint.sol](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol) \nline:[101](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L101)\n```\n totalOps += opsPerAggregator[i].userOps.length;\n```\nFile: [EntryPoint.sol](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol)\nline:[135](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L135)\n```\n collected += _executeUserOp(opIndex, ops[i], opInfos[opIndex]);\n```\nFile:[VerifyingSingletonPaymaster.sol](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol)\nline:[51](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol#L51)\n```\n paymasterIdBalances[paymasterId] += msg.value;\n```\nFile:[Math.sol](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/libs/Math.sol)\nline:[210](https://github.", "vulnerable_code": " collected += _executeUserOp(i, ops[i], opInfos[i]);", "fixed_code": " totalOps += opsPerAggregator[i].userOps.length;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/sayan-G.md", "collected_at": "2026-01-02T18:14:06.970098+00:00", "source_hash": "287b1b67ad9bbca103137cddf37259fb481ec006cbe393069fed8f8d9fc4a8b3", "code_block_count": 4, "solidity_block_count": 0, "total_code_chars": 207, "github_ref_count": 7, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "collected += _executeUserOp(i, ops[i], opInfos[i]);", "primary_code_language": "unknown", "primary_code_char_count": 51, "all_code_blocks": "// Code block 1 (unknown):\ncollected += _executeUserOp(i, ops[i], opInfos[i]);\n\n// Code block 2 (unknown):\ntotalOps += opsPerAggregator[i].userOps.length;\n\n// Code block 3 (unknown):\ncollected += _executeUserOp(opIndex, ops[i], opInfos[opIndex]);\n\n// Code block 4 (unknown):\npaymasterIdBalances[paymasterId] += msg.value;", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "EntryPoint.sol, EntryPoint.sol#L81, EntryPoint.sol#L101, EntryPoint.sol#L135, VerifyingSingletonPaymaster.sol, VerifyingSingletonPaymaster.sol#L51, Math.sol", "github_files_list": "Math.sol, VerifyingSingletonPaymaster.sol, EntryPoint.sol", "github_refs_count": 7, "vulnerable_code_actual": " collected += _executeUserOp(i, ops[i], opInfos[i]);", "has_vulnerable_code_snippet": true, "fixed_code_actual": " totalOps += opsPerAggregator[i].userOps.length;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "02-ethos", "title": "0xnev G", "severity_raw": "High", "severity": "high", "description": "### Gas Optimization Template\n| Count | Title | Instances |\n|:--:|:-------|:--:|\n| [G-01] | Usage of `uint` smaller than 32 bytes (256 bits) incurs overhead | 7 |\n| [G-02] | Splitting `require()` statements that uses `&&` saves gas | 5 |\n| [G-03] | internal/private functions only called once can be inlined to save gas | 47 |\n| [G-04] | Multiple accesses of a mapping/array should use a local variable cache | 59 |\n| [G-05] | Use nested `if` statements to avoid multiple check combinations using `&&`| 11 |\n| [G-06] | Avoid caching global variables | 2 |\n| [G-07] | Check amount before execution of `transfer` functions for possible gas savings | 4 |\n| [G-08] | ` += ` costs more gas than ` = + ` for state variables | 6 |\n| [G-09] | ` -= ` costs more gas than ` = - ` for state variables | 11 |\n| [G-10] | Use a more recent version of solidity | - |\n| [G-11] | Do not initialize variables with default value | 4 |\n| [G-12] | Multiple address mappings can be combined into a single mapping of an address to a struct, where appropriate | 8 |\n| [G-13] | Unnecessary `return` statements in functions that do not return anything | 4 |\n| [G-14] |Unnecessary `return` statements in functions that have already define named return variable(s) | 4 |\n\n| Total Gas-Optimization Issues | 14 |\n|:--:|:--:|\n\n### [G-01] Usage of `uint` smaller than 32 bytes (256 bits) incurs overhead\nContext: \n```solidity\n7 results - 3 files\n\n/TroveManager.sol\n 82: uint128 arrayIndex;\n1321: uint128 index // dont need to downcast from uint256 to uint128\n\n/StabilityPool.sol\n 247: uint128 _epoch, uint128 _scale\n 248: uint128 _epoch, uint128 _scale\n 249: uint128 _currentEpoch\n 250: uint128 _currentScale\n\n /ReaperStrategyGranarySupplyOnly.sol\n 35: uint16 private constant LENDER_REFERRAL_CODE_NONE\n```\nAdditionally, if `index` is declared using `uint256`, the downcasting to `uint128`in line 1329 is not required\n```solidity\n1321: function _addTroveOwnerToArray(address _borrower, address _c", "vulnerable_code": "7 results - 3 files\n\n/TroveManager.sol\n 82: uint128 arrayIndex;\n1321: uint128 index // dont need to downcast from uint256 to uint128\n\n/StabilityPool.sol\n 247: uint128 _epoch, uint128 _scale\n 248: uint128 _epoch, uint128 _scale\n 249: uint128 _currentEpoch\n 250: uint128 _currentScale\n\n /ReaperStrategyGranarySupplyOnly.sol\n 35: uint16 private constant LENDER_REFERRAL_CODE_NONE", "fixed_code": "1321: function _addTroveOwnerToArray(address _borrower, address _collateral) internal returns (uint256 index) {\n1325: // Push the Troveowner to the array\n1326: TroveOwners[_collateral].push(_borrower);\n1327:\n1328: // Record the index of the new Troveowner on their Trove struct\n1329: index = TroveOwners[_collateral].length.sub(1);\n1330: Troves[_borrower][_collateral].arrayIndex = index;\n1331:\n1332: return index;\n1333: }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/0xnev-G.md", "collected_at": "2026-01-02T18:15:52.755392+00:00", "source_hash": "289d2f12dff50e84149d8cee909122fb38a405b3e90ad826ff70ac9d180f924e", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 378, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "7 results - 3 files\n\n/TroveManager.sol\n 82: uint128 arrayIndex;\n1321: uint128 index // dont need to downcast from uint256 to uint128\n\n/StabilityPool.sol\n 247: uint128 _epoch, uint128 _scale\n 248: uint128 _epoch, uint128 _scale\n 249: uint128 _currentEpoch\n 250: uint128 _currentScale\n\n /ReaperStrategyGranarySupplyOnly.sol\n 35: uint16 private constant LENDER_REFERRAL_CODE_NONE", "primary_code_language": "solidity", "primary_code_char_count": 378, "all_code_blocks": "// Code block 1 (solidity):\n7 results - 3 files\n\n/TroveManager.sol\n 82: uint128 arrayIndex;\n1321: uint128 index // dont need to downcast from uint256 to uint128\n\n/StabilityPool.sol\n 247: uint128 _epoch, uint128 _scale\n 248: uint128 _epoch, uint128 _scale\n 249: uint128 _currentEpoch\n 250: uint128 _currentScale\n\n /ReaperStrategyGranarySupplyOnly.sol\n 35: uint16 private constant LENDER_REFERRAL_CODE_NONE", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "7 results - 3 files\n\n/TroveManager.sol\n 82: uint128 arrayIndex;\n1321: uint128 index // dont need to downcast from uint256 to uint128\n\n/StabilityPool.sol\n 247: uint128 _epoch, uint128 _scale\n 248: uint128 _epoch, uint128 _scale\n 249: uint128 _currentEpoch\n 250: uint128 _currentScale\n\n /ReaperStrategyGranarySupplyOnly.sol\n 35: uint16 private constant LENDER_REFERRAL_CODE_NONE", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "7 results - 3 files\n\n/TroveManager.sol\n 82: uint128 arrayIndex;\n1321: uint128 index // dont need to downcast from uint256 to uint128\n\n/StabilityPool.sol\n 247: uint128 _epoch, uint128 _scale\n 248: uint128 _epoch, uint128 _scale\n 249: uint128 _currentEpoch\n 250: uint128 _currentScale\n\n /ReaperStrategyGranarySupplyOnly.sol\n 35: uint16 private constant LENDER_REFERRAL_CODE_NONE", "has_vulnerable_code_snippet": true, "fixed_code_actual": "1321: function _addTroveOwnerToArray(address _borrower, address _collateral) internal returns (uint256 index) {\n1325: // Push the Troveowner to the array\n1326: TroveOwners[_collateral].push(_borrower);\n1327:\n1328: // Record the index of the new Troveowner on their Trove struct\n1329: index = TroveOwners[_collateral].length.sub(1);\n1330: Troves[_borrower][_collateral].arrayIndex = index;\n1331:\n1332: return index;\n1333: }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "11-kelp", "title": "Pechenite Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA Report - Kelp DAO Audit Contest | 10 Nov 2023 - 15 Nov 2023\n\n---\n\n# Executive summary\n\n### Overview\n\n| | |\n| :----------- | :----------------------------------------------------------------------- |\n| Project Name | Kelp DAO |\n| Repository | https://github.com/code-423n4/2023-11-kelp |\n| Website | [Link](https://linktr.ee/kelpdao) |\n| Twitter | [Link](https://twitter.com/KelpDAO) |\n| Methods | Manual Review |\n| Total SLOC | 504 over 9 contracts |\n\n### Findings Summary\n\n| ID | Title | Severity |\n| ----------------- | ----- | ------------------------- |\n| [L‑1](#l1-do-not-allow-the-modification-of-the-asset-for-particular-eigenlayer-strategy-after-amount-of-the-specific-asset-has-already-been-deposited-into-the-eigenlayer-strategy) | Do not allow the modification of the `asset` for particular `EigenLayer Strategy` after `amount` of the specific `asset` has already been deposited into the `EigenLayer Strategy` | _Low_ |\n| [L‑2](#l2-a-malicious-lrt-manager-can-disrupt-the-deposit-process-for-a-particular-asset-by-setting-depositlimitbyassetasset-to-a-value-smaller-than-the-actual-total-supply-of-this-asset-within-contracts-consequently-the-depositing-function-will-consistently-revert-due-to-underflow) | A malicious `LRT Manager` can disrupt the deposit process for a particular asset by setting `depositLimitByAsset[asset]` to a value smaller than the `actual total supply of this asset within contracts`. Consequently, the depositing function will consistently revert due to underflow | _Low_ |\n| [L‑3](#l3-ownership-can-", "vulnerable_code": "function addNodeDelegatorContractToQueue(\n address[] calldata nodeDelegatorContracts\n) external onlyLRTAdmin {\n uint256 length = nodeDelegatorContracts.length;\n if (nodeDelegatorQueue.length + length > maxNodeDelegatorCount) {\n revert MaximumNodeDelegatorCountReached();\n }\n\n for (uint256 i; i < length; ) {\n UtilLib.checkNonZeroAddress(nodeDelegatorContracts[i]);\n nodeDelegatorQueue.push(nodeDelegatorContracts[i]);\n emit NodeDelegatorAddedinQueue(nodeDelegatorContracts[i]);\n unchecked {\n ++i;\n }\n }\n}", "fixed_code": "// Deploy LRTDepositPool contract\n// ...\n\n// Repeatedly add NodeDelegator contract addresses to the queue\nfor (uint256 i = 0; i < 1000; i++) {\n lrtDepositPool.addNodeDelegatorContractToQueue([nodeDelegatorAddress]);\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/Pechenite-Q.md", "collected_at": "2026-01-02T18:27:34.052706+00:00", "source_hash": "291b76fec56f5061ea9ae52a823c936419322c6a8e7789fe8ff2afb35f13376a", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function addNodeDelegatorContractToQueue(\n address[] calldata nodeDelegatorContracts\n) external onlyLRTAdmin {\n uint256 length = nodeDelegatorContracts.length;\n if (nodeDelegatorQueue.length + length > maxNodeDelegatorCount) {\n revert MaximumNodeDelegatorCountReached();\n }\n\n for (uint256 i; i < length; ) {\n UtilLib.checkNonZeroAddress(nodeDelegatorContracts[i]);\n nodeDelegatorQueue.push(nodeDelegatorContracts[i]);\n emit NodeDelegatorAddedinQueue(nodeDelegatorContracts[i]);\n unchecked {\n ++i;\n }\n }\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "// Deploy LRTDepositPool contract\n// ...\n\n// Repeatedly add NodeDelegator contract addresses to the queue\nfor (uint256 i = 0; i < 1000; i++) {\n lrtDepositPool.addNodeDelegatorContractToQueue([nodeDelegatorAddress]);\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-asymmetry", "title": "arialblack14 Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA REPORT\n\n### Summary of low risk issues\n| Number | Issue details | Instances |\n|---|---|:---:|\n| [L-1](#L1) | Lock pragmas to specific compiler version. | 4\n| [L-2](#L2) | It is not checked if `derivativeCount > 0` which can cause a Panic Error if something happens during deployment. | 1\n| [L-3](#L3) | No input validation for the `derivativeIndex` of `adjustWeight` function. | 1\n\n*Total: 3 issues.*\n\n### Summary of non-critical issues\n| Number | Issue details | Instances |\n|---|---|:---:|\n| [NC-1](#NC1) |Missing timelock for critical changes. | 14\n| [NC-2](#NC2) |For modern and more readable code, update import usages. | 31\n| [NC-3](#NC3) |Add parameter to emitted event. | 1\n| [NC-4](#NC4) |Use of `bytes.concat()` instead of `abi.encodePacked()`. | 6\n\n*Total: 4 issues.*\n\n---\n### Low Risk Issues\n\n### [L-1] Lock pragmas to specific compiler version.\n\n##### Description\nPragma statements can be allowed to float when a contract is intended for consumption by other developers, as in the case with contracts in a library or EthPM package. Otherwise, the developer would need to manually update the pragma in order to compile locally.\n\n##### Recommendation\nEthereum Smart Contract Best Practices - Lock pragmas to specific compiler version. [solidity-specific/locking-pragmas](https://consensys.github.io/smart-contract-best-practices/development-recommendations/solidity-specific/locking-pragmas/)\t\t\t\n\n##### *Instances (4):*\nFile: [2023-03-asymmetry/contracts/SafEth/SafEth.sol](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L2 )\n```solidity\n2: pragma solidity ^0.8.13;\n```\nFile: [2023-03-asymmetry/contracts/SafEth/derivatives/Reth.sol](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L2 )\n```solidity\n2: pragma solidity ^0.8.13;\n```\nFile: [2023-03-asymmetry/contracts/SafEth/derivatives/SfrxEth.sol](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives", "vulnerable_code": "2: pragma solidity ^0.8.13;", "fixed_code": "2: pragma solidity ^0.8.13;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/arialblack14-Q.md", "collected_at": "2026-01-02T18:18:48.581474+00:00", "source_hash": "291bc3a52a0a1a6bae107482a53721f6123c70762fac368e157e3d406ad259f3", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 54, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "2: pragma solidity ^0.8.13;", "primary_code_language": "solidity", "primary_code_char_count": 27, "all_code_blocks": "// Code block 1 (solidity):\n2: pragma solidity ^0.8.13;\n\n// Code block 2 (solidity):\n2: pragma solidity ^0.8.13;", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "2: pragma solidity ^0.8.13;\n\n2: pragma solidity ^0.8.13;", "github_refs_formatted": "SafEth.sol#L2, Reth.sol#L2", "github_files_list": "Reth.sol, SafEth.sol", "github_refs_count": 2, "vulnerable_code_actual": "2: pragma solidity ^0.8.13;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "2: pragma solidity ^0.8.13;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "11-kelp", "title": "0xLeveler Q", "severity_raw": "Unknown", "severity": "unknown", "description": "## Title\n`nodeDelegator` and `LRTDepositPoolContract` do not have any mechanism to remove node delegators from the queue when needed\n\n## Proof of Concept\ncontract has a mechanism to add node delegators, but none to validate if they're valid contracts and remove them if they're added by mistake.\n\n```solidity\nfunction addNodeDelegatorContractToQueue(address[] calldata nodeDelegatorContracts) external onlyLRTAdmin {\n uint256 length = nodeDelegatorContracts.length;\n if (nodeDelegatorQueue.length + length > maxNodeDelegatorCount) {\n revert MaximumNodeDelegatorCountReached();\n }\n\n for (uint256 i; i < length;) {\n UtilLib.checkNonZeroAddress(nodeDelegatorContracts[i]);\n nodeDelegatorQueue.push(nodeDelegatorContracts[i]);\n emit NodeDelegatorAddedinQueue(nodeDelegatorContracts[i]);\n unchecked {\n ++i;\n }\n }\n }\n```\n\n## Tools Used\nManual Review\n\n## Recommended Mitigation Steps\nAdding a mechanism to remove malicious or wrongly added node delegators.", "vulnerable_code": "function addNodeDelegatorContractToQueue(address[] calldata nodeDelegatorContracts) external onlyLRTAdmin {\n uint256 length = nodeDelegatorContracts.length;\n if (nodeDelegatorQueue.length + length > maxNodeDelegatorCount) {\n revert MaximumNodeDelegatorCountReached();\n }\n\n for (uint256 i; i < length;) {\n UtilLib.checkNonZeroAddress(nodeDelegatorContracts[i]);\n nodeDelegatorQueue.push(nodeDelegatorContracts[i]);\n emit NodeDelegatorAddedinQueue(nodeDelegatorContracts[i]);\n unchecked {\n ++i;\n }\n }\n }", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/0xLeveler-Q.md", "collected_at": "2026-01-02T18:27:10.057212+00:00", "source_hash": "293f6acef374598c8acdb6fad3853f13e2523e12d3bc11fb82afee0b610e65ff", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 620, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function addNodeDelegatorContractToQueue(address[] calldata nodeDelegatorContracts) external onlyLRTAdmin {\n uint256 length = nodeDelegatorContracts.length;\n if (nodeDelegatorQueue.length + length > maxNodeDelegatorCount) {\n revert MaximumNodeDelegatorCountReached();\n }\n\n for (uint256 i; i < length;) {\n UtilLib.checkNonZeroAddress(nodeDelegatorContracts[i]);\n nodeDelegatorQueue.push(nodeDelegatorContracts[i]);\n emit NodeDelegatorAddedinQueue(nodeDelegatorContracts[i]);\n unchecked {\n ++i;\n }\n }\n }", "primary_code_language": "solidity", "primary_code_char_count": 620, "all_code_blocks": "// Code block 1 (solidity):\nfunction addNodeDelegatorContractToQueue(address[] calldata nodeDelegatorContracts) external onlyLRTAdmin {\n uint256 length = nodeDelegatorContracts.length;\n if (nodeDelegatorQueue.length + length > maxNodeDelegatorCount) {\n revert MaximumNodeDelegatorCountReached();\n }\n\n for (uint256 i; i < length;) {\n UtilLib.checkNonZeroAddress(nodeDelegatorContracts[i]);\n nodeDelegatorQueue.push(nodeDelegatorContracts[i]);\n emit NodeDelegatorAddedinQueue(nodeDelegatorContracts[i]);\n unchecked {\n ++i;\n }\n }\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function addNodeDelegatorContractToQueue(address[] calldata nodeDelegatorContracts) external onlyLRTAdmin {\n uint256 length = nodeDelegatorContracts.length;\n if (nodeDelegatorQueue.length + length > maxNodeDelegatorCount) {\n revert MaximumNodeDelegatorCountReached();\n }\n\n for (uint256 i; i < length;) {\n UtilLib.checkNonZeroAddress(nodeDelegatorContracts[i]);\n nodeDelegatorQueue.push(nodeDelegatorContracts[i]);\n emit NodeDelegatorAddedinQueue(nodeDelegatorContracts[i]);\n unchecked {\n ++i;\n }\n }\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function addNodeDelegatorContractToQueue(address[] calldata nodeDelegatorContracts) external onlyLRTAdmin {\n uint256 length = nodeDelegatorContracts.length;\n if (nodeDelegatorQueue.length + length > maxNodeDelegatorCount) {\n revert MaximumNodeDelegatorCountReached();\n }\n\n for (uint256 i; i < length;) {\n UtilLib.checkNonZeroAddress(nodeDelegatorContracts[i]);\n nodeDelegatorQueue.push(nodeDelegatorContracts[i]);\n emit NodeDelegatorAddedinQueue(nodeDelegatorContracts[i]);\n unchecked {\n ++i;\n }\n }\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.14} {"source": "c4", "protocol": "01-biconomy", "title": "0xdeadbeef0x Q", "severity_raw": "Unknown", "severity": "unknown", "description": "## `executeBatch` will revert if single transaction fails\n\nIf an owner or EntryPoint (according to `_requireFromEntryPointOrOwner`) calls `executeBatch` with one transaction out of a batch that will fail, all other transactions in the batch will fail.\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L469\n```\nfunction executeBatch(address[] calldata dest, bytes[] calldata func) external onlyOwner{\n _requireFromEntryPointOrOwner();\n--------\n for (uint i = 0; i < dest.length;) {\n _call(dest[i], 0, func[i]);\n--------\n }\n }\n\n function _call(address target, uint256 value, bytes memory data) internal {\n (bool success, bytes memory result) = target.call{value : value}(data);\n if (!success) {\n assembly {\n revert(add(result, 32), mload(result))\n }\n }\n }\n```\n\n## Recommendation\n\nDo not revert if call did not succeed, instead emit a log or store the target and data in storage to be later troubleshooted by owner.\n\n----\n\n## `execute` and `executeBatch` have an onlyOwner modifier\n\n`_requireFromEntryPointOrOwner()` hints that `execute` and `executeBatch` are supposed to be called by an `EntryPoint`.\nThe current implementation of the function has an `onlyOwner` modifier and therefore cannot be called by the `EntryPoint`.\nhttps://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L461\n```\nfunction execute(address dest, uint value, bytes calldata func) external onlyOwner{\n _requireFromEntryPointOrOwner();\n------\n }\n\n function executeBatch(address[] calldata dest, bytes[] calldata func) external onlyOwner{\n _requireFromEntryPointOrOwner();\n------\n }\n```\n\n## Recommendation\n\nIf the functions are supposed to be called by the EntryPoint\n- Remove the `onlyOwner` mod", "vulnerable_code": "function executeBatch(address[] calldata dest, bytes[] calldata func) external onlyOwner{\n _requireFromEntryPointOrOwner();\n--------\n for (uint i = 0; i < dest.length;) {\n _call(dest[i], 0, func[i]);\n--------\n }\n }\n\n function _call(address target, uint256 value, bytes memory data) internal {\n (bool success, bytes memory result) = target.call{value : value}(data);\n if (!success) {\n assembly {\n revert(add(result, 32), mload(result))\n }\n }\n }", "fixed_code": "function execute(address dest, uint value, bytes calldata func) external onlyOwner{\n _requireFromEntryPointOrOwner();\n------\n }\n\n function executeBatch(address[] calldata dest, bytes[] calldata func) external onlyOwner{\n _requireFromEntryPointOrOwner();\n------\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/0xdeadbeef0x-Q.md", "collected_at": "2026-01-02T18:12:49.056389+00:00", "source_hash": "2943299f113fa2874cf692adfb2868cc8afe714ae3a9dc618315e0e05e13596a", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 832, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function executeBatch(address[] calldata dest, bytes[] calldata func) external onlyOwner{\n _requireFromEntryPointOrOwner();\n--------\n for (uint i = 0; i < dest.length;) {\n _call(dest[i], 0, func[i]);\n--------\n }\n }\n\n function _call(address target, uint256 value, bytes memory data) internal {\n (bool success, bytes memory result) = target.call{value : value}(data);\n if (!success) {\n assembly {\n revert(add(result, 32), mload(result))\n }\n }\n }", "primary_code_language": "unknown", "primary_code_char_count": 542, "all_code_blocks": "// Code block 1 (unknown):\nfunction executeBatch(address[] calldata dest, bytes[] calldata func) external onlyOwner{\n _requireFromEntryPointOrOwner();\n--------\n for (uint i = 0; i < dest.length;) {\n _call(dest[i], 0, func[i]);\n--------\n }\n }\n\n function _call(address target, uint256 value, bytes memory data) internal {\n (bool success, bytes memory result) = target.call{value : value}(data);\n if (!success) {\n assembly {\n revert(add(result, 32), mload(result))\n }\n }\n }\n\n// Code block 2 (unknown):\nfunction execute(address dest, uint value, bytes calldata func) external onlyOwner{\n _requireFromEntryPointOrOwner();\n------\n }\n\n function executeBatch(address[] calldata dest, bytes[] calldata func) external onlyOwner{\n _requireFromEntryPointOrOwner();\n------\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SmartAccount.sol#L469, SmartAccount.sol#L461", "github_files_list": "SmartAccount.sol", "github_refs_count": 2, "vulnerable_code_actual": "function executeBatch(address[] calldata dest, bytes[] calldata func) external onlyOwner{\n _requireFromEntryPointOrOwner();\n--------\n for (uint i = 0; i < dest.length;) {\n _call(dest[i], 0, func[i]);\n--------\n }\n }\n\n function _call(address target, uint256 value, bytes memory data) internal {\n (bool success, bytes memory result) = target.call{value : value}(data);\n if (!success) {\n assembly {\n revert(add(result, 32), mload(result))\n }\n }\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function execute(address dest, uint value, bytes calldata func) external onlyOwner{\n _requireFromEntryPointOrOwner();\n------\n }\n\n function executeBatch(address[] calldata dest, bytes[] calldata func) external onlyOwner{\n _requireFromEntryPointOrOwner();\n------\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "03-asymmetry", "title": "Ignite G", "severity_raw": "Gas", "severity": "gas", "description": "# Code4rena - Assymetic Gas\n\n## Gas Optimizations\n| | Issue | Instances |\n|---|---|---|\n| Gas-1 | Emitting events with variables from memory rather than state variables can help reduce gas costs | 4 |\n| Gas-2 | Declare local variables as part of the function instead of inside the function | 1 |\n\n### [Gas-1] Emitting events with variables from memory rather than state variables can help reduce gas costs\nUsing memory variable instead of state variable in the emit statement may be slightly more gas-efficient because it does not require the Solidity compiler to generate an additional `SLOAD` instruction to read the state variable from storage.\n\nInstances(4):\n\n\n```solidity\n emit ChangeMinAmount(minAmount);\n```\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L216\n\n```solidity\n emit ChangeMaxAmount(maxAmount);\n```\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L225\n\n```solidity\n emit StakingPaused(pauseStaking);\n```\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L234\n\n```solidity\n emit UnstakingPaused(pauseUnstaking);\n```\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L243\n\n\n### [Gas-2] Declare local variables as part of the function instead of inside the function\nDeclare local variables as part of the function instead of inside the function to save gas.\n\nInstances(1):\n\n```\n function deposit() external payable onlyOwner returns (uint256) {\n```\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol#L73\n\n", "vulnerable_code": " emit ChangeMinAmount(minAmount);", "fixed_code": " emit ChangeMaxAmount(maxAmount);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Ignite-G.md", "collected_at": "2026-01-02T18:18:08.360827+00:00", "source_hash": "297214ea11b6e9ee07cc1443750bc9cf5d6346de971f3cf37deb572a5ba76fd0", "code_block_count": 5, "solidity_block_count": 4, "total_code_chars": 199, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "emit ChangeMinAmount(minAmount);", "primary_code_language": "solidity", "primary_code_char_count": 32, "all_code_blocks": "// Code block 1 (solidity):\nemit ChangeMinAmount(minAmount);\n\n// Code block 2 (solidity):\nemit ChangeMaxAmount(maxAmount);\n\n// Code block 3 (solidity):\nemit StakingPaused(pauseStaking);\n\n// Code block 4 (solidity):\nemit UnstakingPaused(pauseUnstaking);\n\n// Code block 5 (unknown):\nfunction deposit() external payable onlyOwner returns (uint256) {", "all_code_blocks_count": 5, "has_diff_blocks": false, "diff_code": "", "solidity_code": "emit ChangeMinAmount(minAmount);\n\nemit ChangeMaxAmount(maxAmount);\n\nemit StakingPaused(pauseStaking);\n\nemit UnstakingPaused(pauseUnstaking);", "github_refs_formatted": "SafEth.sol#L216, SafEth.sol#L225, SafEth.sol#L234, SafEth.sol#L243, WstEth.sol#L73", "github_files_list": "WstEth.sol, SafEth.sol", "github_refs_count": 5, "vulnerable_code_actual": " emit ChangeMinAmount(minAmount);", "has_vulnerable_code_snippet": true, "fixed_code_actual": " emit ChangeMaxAmount(maxAmount);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 11} {"source": "c4", "protocol": "05-ajna", "title": "JCN G", "severity_raw": "High", "severity": "high", "description": "# Summary\nA majority of the optimizations were benchmarked via the protocol's tests, i.e. using the following config for `ajna-core`: `solc version 0.8.14`, `optimizer on`, `500 runs` and the following config for `ajna-grants`: `solc version 0.8.16`, `optimizer on`, `1000000 runs`. Optimizations that were not benchmarked are explained via EVM gas costs and opcodes.\n\nBelow are the overall average gas savings for the following tested functions, with all the optimizations applied (not including [issue 11](#refactor-event-to-avoid-emitting-data-that-is-already-present-in-transaction-data), [issue 12](#refactor-event-to-avoid-emitting-empty-data), [issue 13](#hash-proposal-values-offchain), and [issue 14](#sort-array-offchain-to-check-duplicates-in-on-instead-of-on2)):\n| Function | Before | After | Avg Gas Savings |\n| ------ | -------- | -------- | ------- |\n| GrantFund.claimDelegateReward | 65340 | 42268 | 23072 | \n| GrantFund.executeExtraordinary | 95823 | 95682 | 141 | \n| GrantFund.executeStandard | 47894 | 47520 | 374 | \n| GrantFund.fundTreasury | 65872 | 65788 | 84 | \n| GrantFund.fundingVote | 409345 | 396776 | 12569 | \n| GrantFund.proposeExtraordinary | 86505 | 86451 | 54 | \n| GrantFund.proposeStandard | 82900 | 82820 | 80 | \n| GrantFund.screeningVote | 399146 | 390626 | 8520 | \n| GrantFund.startNewDistributionPeriod | 75597 | 75139 | 458 | \n| GrantFund.updateSlate | 318329 | 310231 | 8098 | \n| GrantFund.voteExtraordinary | 31424 | 30811 | 613 | \n| PositionManager.burn | 10451 | 8524 | 1927 | \n| PositionManager.memorializePositions | 1134444 | 1133268 | 1176 | \n| PositionManager.mint | 98876 | 97653 | 1223 | \n| PositionManager.permit | 54387 | 32554 | 21833 | \n| RewardsManager.claimRewards | 393064 | 381560 | 11504 | \n| RewardsManager.moveStakedLiquidity | 2112272 | 2081035 | 31237 | \n\n**Total gas saved across all listed functions: 122963**\n\n*Notes*: \n\n- The `Avg`, `Med`, and `# of calls`", "vulnerable_code": "File: ajna-core/src/RewardsManager.sol\n135: function moveStakedLiquidity(\n136: uint256 tokenId_,\n137: uint256[] memory fromBuckets_,\n138: uint256[] memory toBuckets_,\n139: uint256 expiry_\n140: ) external nonReentrant override {", "fixed_code": "https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L519-L521\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L612-L618\n\n*Gas Savings for `GrantFund.fundingVote`, obtained via protocol's tests: Avg 1589 gas*\n\n| | Max |\n| ------ | -------- |\n| Before | 409345 | \n| After | 407756 | \n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/JCN-G.md", "collected_at": "2026-01-02T18:20:59.863093+00:00", "source_hash": "297fdc9c751a8bd95210f81534aeb14e5e955c919eda20acda22f8b82c63b61c", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "StandardFunding.sol#L519-L521, StandardFunding.sol#L612-L618", "github_files_list": "StandardFunding.sol", "github_refs_count": 2, "vulnerable_code_actual": "File: ajna-core/src/RewardsManager.sol\n135: function moveStakedLiquidity(\n136: uint256 tokenId_,\n137: uint256[] memory fromBuckets_,\n138: uint256[] memory toBuckets_,\n139: uint256 expiry_\n140: ) external nonReentrant override {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L519-L521\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L612-L618\n\n*Gas Savings for `GrantFund.fundingVote`, obtained via protocol's tests: Avg 1589 gas*\n\n| | Max |\n| ------ | -------- |\n| Before | 409345 | \n| After | 407756 | \n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "03-asymmetry", "title": "Diana G", "severity_raw": "Gas", "severity": "gas", "description": "\n---------------------------\n\n**Gas Optimization**\n\n----------\n\n| S No. | Issue | Instances | Gas Savings (from provided tests) |\n|-----|-----|-----|-----|\n| [G-01] | x += y costs more gas than x = x + y for state variables | 4 | 452 \n| [G-02] | Don't compare boolean expressions to boolean literals | 2 | 110\n\n-------------\n\n## G-01 x += y costs more gas than x = x + y for state variables\n\nUsing the addition operator instead of plus-equals saves\u00a0**[113 gas](https://gist.github.com/IllIllI000/cbbfb267425b898e5be734d4008d4fe8)**.\n\n_There are 4 instances of this issue_\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol\n\n```\nFile: SafEth/SafEth.sol\n\n72-75: underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;\n95: totalStakeValueEth += derivativeReceivedEthValue;\n172: localTotalWeight += weights[i];\n192: localTotalWeight += weights[i]; \n```\n\n-------\n\n## G-02 Don't compare boolean expressions to boolean literals\n\nComparing to a constant (`true`\u00a0or\u00a0`false`) is a bit more expensive than directly checking the returned boolean value. I suggest using\u00a0`if(!directValue)`\u00a0instead of\u00a0`if(directValue == false)`\n\n`if ( == true)`\u00a0=>\u00a0`if ()`,\u00a0`if ( == false)`\u00a0=>\u00a0`if (!)`\n\nGas Saved: **55**\n\n_There are 2 instances of this issue_\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol\n\n```\nFile: SafEth/SafEth.sol\n\n64: require(pauseStaking == false, \"staking is paused\");\n109: require(pauseUnstaking == false, \"unstaking is paused\");\n```\n\n------------\n\n", "vulnerable_code": "File: SafEth/SafEth.sol\n\n72-75: underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;\n95: totalStakeValueEth += derivativeReceivedEthValue;\n172: localTotalWeight += weights[i];\n192: localTotalWeight += weights[i]; ", "fixed_code": "File: SafEth/SafEth.sol\n\n64: require(pauseStaking == false, \"staking is paused\");\n109: require(pauseUnstaking == false, \"unstaking is paused\");", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Diana-G.md", "collected_at": "2026-01-02T18:18:02.017249+00:00", "source_hash": "29af425bca33f32621afc4d7332ec667269f5ac57311f3b3892df17d297208e9", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 472, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: SafEth/SafEth.sol\n\n72-75: underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;\n95: totalStakeValueEth += derivativeReceivedEthValue;\n172: localTotalWeight += weights[i];\n192: localTotalWeight += weights[i];", "primary_code_language": "unknown", "primary_code_char_count": 329, "all_code_blocks": "// Code block 1 (unknown):\nFile: SafEth/SafEth.sol\n\n72-75: underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;\n95: totalStakeValueEth += derivativeReceivedEthValue;\n172: localTotalWeight += weights[i];\n192: localTotalWeight += weights[i];\n\n// Code block 2 (unknown):\nFile: SafEth/SafEth.sol\n\n64: require(pauseStaking == false, \"staking is paused\");\n109: require(pauseUnstaking == false, \"unstaking is paused\");", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol", "github_files_list": "SafEth.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: SafEth/SafEth.sol\n\n72-75: underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;\n95: totalStakeValueEth += derivativeReceivedEthValue;\n172: localTotalWeight += weights[i];\n192: localTotalWeight += weights[i]; ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: SafEth/SafEth.sol\n\n64: require(pauseStaking == false, \"staking is paused\");\n109: require(pauseUnstaking == false, \"unstaking is paused\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "06-lybra", "title": "nadin Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA Report\n## Summary\nTotal 04 Low and 09 Non-Critical\n### Low Risk Issues\n[L-01] getAssetPrice() SHOULD BE TURNED INTO A VIEW FUNCTION\n[L-02] REFACTORING TO SUPPORT UINT256 AMOUNT\n[L-03] ROUNDING ERROR IN `purchaseOtherEarnings()` MIGHT RESULT IN `biddingFee`\n[L-04] MAY LEAD TO DOS IF `curvePool.exchange_underlying` REVERT\n\n## [L-01] getAssetPrice() SHOULD BE TURNED INTO A VIEW FUNCTION\n`getAssetPrice()` is used to get the price of the asset, it is used in most of the important functions, should be set to view function to avoid arbitrary price exploitation like reentrancy attack.\n```\nFile: LybraRETHVault\n46: function getAssetPrice() public override returns (uint256) {\nFile: LybraWbETHVault.sol\n34: function getAssetPrice() public override returns (uint256) { // @audit change to view function\nFile: LybraWstETHVault.sol\n48: function getAssetPrice() public override returns (uint256) {\nFile: LybraEUSDVaultBase.sol\n327: function getAssetPrice() public virtual returns (uint256);\nFile: LybraPeUSDVaultBase.sol\n269: function getAssetPrice() public virtual returns (uint256);\n```\n[LybraRETHVault.sol#L46](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/pools/LybraRETHVault.sol#L46)\n[LybraWstETHVault.sol#L48](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/pools/LybraWstETHVault.sol#L48)\n[LybraWbETHVault.sol#L34](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/pools/LybraWbETHVault.sol#L34)\n[LybraEUSDVaultBase.sol#L327](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/pools/base/LybraEUSDVaultBase.sol#L327)\n[LybraPeUSDVaultBase.sol#L269](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L269)\n\n## [L-02] REFACTORING TO SUPPORT UINT256 AMOUNT\n- Alth", "vulnerable_code": "File: LybraRETHVault\n46: function getAssetPrice() public override returns (uint256) {\nFile: LybraWbETHVault.sol\n34: function getAssetPrice() public override returns (uint256) { // @audit change to view function\nFile: LybraWstETHVault.sol\n48: function getAssetPrice() public override returns (uint256) {\nFile: LybraEUSDVaultBase.sol\n327: function getAssetPrice() public virtual returns (uint256);\nFile: LybraPeUSDVaultBase.sol\n269: function getAssetPrice() public virtual returns (uint256);", "fixed_code": "The scope of this PR:\n\nRemove type(uint64).max limit for amount from OFTV2Core, ProxyOFTV2 and ProxyOFTWithFee\nIntroduce OFTV2Aptos, ProxyOFTV2Aptos, ProxyOFTWithFeeAptos that allow no more than 6 shared decimals and have type(uint64).max limit for amount\nReplace abi.encodePacked with abi.encode in OFTV2Core and derived contracts\nUsing abi.encodePacked makes encoding inconsistent with previous versions and decoding ugly. Additionally, abi.encodePacked will be removed in a future version of Solidity (see Remove abi.encodePacked ethereum/solidity#11593)", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/nadin-Q.md", "collected_at": "2026-01-02T18:23:11.799662+00:00", "source_hash": "29d00837a27c6770f3bef904942b6b6a3b6e9f5b5f6d79146842d6764305fccd", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 504, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: LybraRETHVault\n46: function getAssetPrice() public override returns (uint256) {\nFile: LybraWbETHVault.sol\n34: function getAssetPrice() public override returns (uint256) { // @audit change to view function\nFile: LybraWstETHVault.sol\n48: function getAssetPrice() public override returns (uint256) {\nFile: LybraEUSDVaultBase.sol\n327: function getAssetPrice() public virtual returns (uint256);\nFile: LybraPeUSDVaultBase.sol\n269: function getAssetPrice() public virtual returns (uint256);", "primary_code_language": "unknown", "primary_code_char_count": 504, "all_code_blocks": "// Code block 1 (unknown):\nFile: LybraRETHVault\n46: function getAssetPrice() public override returns (uint256) {\nFile: LybraWbETHVault.sol\n34: function getAssetPrice() public override returns (uint256) { // @audit change to view function\nFile: LybraWstETHVault.sol\n48: function getAssetPrice() public override returns (uint256) {\nFile: LybraEUSDVaultBase.sol\n327: function getAssetPrice() public virtual returns (uint256);\nFile: LybraPeUSDVaultBase.sol\n269: function getAssetPrice() public virtual returns (uint256);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LybraRETHVault.sol#L46, LybraWstETHVault.sol#L48, LybraWbETHVault.sol#L34, LybraEUSDVaultBase.sol#L327, LybraPeUSDVaultBase.sol#L269", "github_files_list": "LybraEUSDVaultBase.sol, LybraWstETHVault.sol, LybraRETHVault.sol, LybraWbETHVault.sol, LybraPeUSDVaultBase.sol", "github_refs_count": 5, "vulnerable_code_actual": "File: LybraRETHVault\n46: function getAssetPrice() public override returns (uint256) {\nFile: LybraWbETHVault.sol\n34: function getAssetPrice() public override returns (uint256) { // @audit change to view function\nFile: LybraWstETHVault.sol\n48: function getAssetPrice() public override returns (uint256) {\nFile: LybraEUSDVaultBase.sol\n327: function getAssetPrice() public virtual returns (uint256);\nFile: LybraPeUSDVaultBase.sol\n269: function getAssetPrice() public virtual returns (uint256);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "The scope of this PR:\n\nRemove type(uint64).max limit for amount from OFTV2Core, ProxyOFTV2 and ProxyOFTWithFee\nIntroduce OFTV2Aptos, ProxyOFTV2Aptos, ProxyOFTWithFeeAptos that allow no more than 6 shared decimals and have type(uint64).max limit for amount\nReplace abi.encodePacked with abi.encode in OFTV2Core and derived contracts\nUsing abi.encodePacked makes encoding inconsistent with previous versions and decoding ugly. Additionally, abi.encodePacked will be removed in a future version of Solidity (see Remove abi.encodePacked ethereum/solidity#11593)", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "09-ondo", "title": "0xStalin Q", "severity_raw": "Low", "severity": "low", "description": "## [L-01] Number of approvers can be set to be greather than the existing approvers in the DestinatinationBridge contract\n\nWhen [setting the tresholds](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/DestinationBridge.sol#L255-L279) in the DestinationBridge, there is no checks to validate if the number of approvers that are been set to the ranges surpasses the existing maximum number of appprovers in the contract.\nSetting the number of required approvers greather than the total number of approvers will cause that tx never reaches the approved status until new approvers are added to the DestinationBridge contract.\n\n```solidity\nfunction setThresholds(\n string calldata srcChain,\n uint256[] calldata amounts,\n uint256[] calldata numOfApprovers\n) external onlyOwner {\n if (amounts.length != numOfApprovers.length) {\n revert ArrayLengthMismatch();\n }\n delete chainToThresholds[srcChain];\n for (uint256 i = 0; i < amounts.length; ++i) {\n if (i == 0) {\n chainToThresholds[srcChain].push(\n Threshold(amounts[i], numOfApprovers[i])\n );\n } else {\n if (chainToThresholds[srcChain][i - 1].amount > amounts[i]) {\n revert ThresholdsNotInAscendingOrder();\n }\n //@audit-issue => Not validating if numOfApprovers[i] is greather than the existing number of approvers\n chainToThresholds[srcChain].push(\n Threshold(amounts[i], numOfApprovers[i])\n );\n }\n }\n emit ThresholdSet(srcChain, amounts, numOfApprovers);\n}\n\n```\n\n**Fix:**\n- Keep track of the total numbers of approvers, and when setting thresholds validate if the number of required approvers is greather than the total approvers, if so, either revert the tx or set the number of required approvers as the total number of approvers, or emit an event to notify off-chain that will be required to add more approvers to the DestinationBridge\n\n\n## [L-02] When attaching thresholds, if the amount of tokens to be minted exceeds all the thresholds, the tx will be", "vulnerable_code": "function setThresholds(\n string calldata srcChain,\n uint256[] calldata amounts,\n uint256[] calldata numOfApprovers\n) external onlyOwner {\n if (amounts.length != numOfApprovers.length) {\n revert ArrayLengthMismatch();\n }\n delete chainToThresholds[srcChain];\n for (uint256 i = 0; i < amounts.length; ++i) {\n if (i == 0) {\n chainToThresholds[srcChain].push(\n Threshold(amounts[i], numOfApprovers[i])\n );\n } else {\n if (chainToThresholds[srcChain][i - 1].amount > amounts[i]) {\n revert ThresholdsNotInAscendingOrder();\n }\n //@audit-issue => Not validating if numOfApprovers[i] is greather than the existing number of approvers\n chainToThresholds[srcChain].push(\n Threshold(amounts[i], numOfApprovers[i])\n );\n }\n }\n emit ThresholdSet(srcChain, amounts, numOfApprovers);\n}\n", "fixed_code": "function _attachThreshold(\n uint256 amount,\n bytes32 txnHash,\n string memory srcChain\n) internal {\n Threshold[] memory thresholds = chainToThresholds[srcChain];\n for (uint256 i = 0; i < thresholds.length; ++i) {\n Threshold memory t = thresholds[i];\n if (amount <= t.amount) {\n txnToThresholdSet[txnHash] = TxnThreshold(\n t.numberOfApprovalsNeeded,\n new address[](0)\n );\n break;\n }\n }\n //@audit-info => If the amount exceeded all the thresholds, the numberOfApprovalsNeeded won't be updated, thus, the tx will be reverted!s\n if (txnToThresholdSet[txnHash].numberOfApprovalsNeeded == 0) {\n revert NoThresholdMatch();\n }\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/0xStalin-Q.md", "collected_at": "2026-01-02T18:25:14.393941+00:00", "source_hash": "29e4fd671d432b7aaaadb0b19debf53f23af7e5657f88f66f16ee860be988bb2", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 843, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function setThresholds(\n string calldata srcChain,\n uint256[] calldata amounts,\n uint256[] calldata numOfApprovers\n) external onlyOwner {\n if (amounts.length != numOfApprovers.length) {\n revert ArrayLengthMismatch();\n }\n delete chainToThresholds[srcChain];\n for (uint256 i = 0; i < amounts.length; ++i) {\n if (i == 0) {\n chainToThresholds[srcChain].push(\n Threshold(amounts[i], numOfApprovers[i])\n );\n } else {\n if (chainToThresholds[srcChain][i - 1].amount > amounts[i]) {\n revert ThresholdsNotInAscendingOrder();\n }\n //@audit-issue => Not validating if numOfApprovers[i] is greather than the existing number of approvers\n chainToThresholds[srcChain].push(\n Threshold(amounts[i], numOfApprovers[i])\n );\n }\n }\n emit ThresholdSet(srcChain, amounts, numOfApprovers);\n}", "primary_code_language": "solidity", "primary_code_char_count": 843, "all_code_blocks": "// Code block 1 (solidity):\nfunction setThresholds(\n string calldata srcChain,\n uint256[] calldata amounts,\n uint256[] calldata numOfApprovers\n) external onlyOwner {\n if (amounts.length != numOfApprovers.length) {\n revert ArrayLengthMismatch();\n }\n delete chainToThresholds[srcChain];\n for (uint256 i = 0; i < amounts.length; ++i) {\n if (i == 0) {\n chainToThresholds[srcChain].push(\n Threshold(amounts[i], numOfApprovers[i])\n );\n } else {\n if (chainToThresholds[srcChain][i - 1].amount > amounts[i]) {\n revert ThresholdsNotInAscendingOrder();\n }\n //@audit-issue => Not validating if numOfApprovers[i] is greather than the existing number of approvers\n chainToThresholds[srcChain].push(\n Threshold(amounts[i], numOfApprovers[i])\n );\n }\n }\n emit ThresholdSet(srcChain, amounts, numOfApprovers);\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function setThresholds(\n string calldata srcChain,\n uint256[] calldata amounts,\n uint256[] calldata numOfApprovers\n) external onlyOwner {\n if (amounts.length != numOfApprovers.length) {\n revert ArrayLengthMismatch();\n }\n delete chainToThresholds[srcChain];\n for (uint256 i = 0; i < amounts.length; ++i) {\n if (i == 0) {\n chainToThresholds[srcChain].push(\n Threshold(amounts[i], numOfApprovers[i])\n );\n } else {\n if (chainToThresholds[srcChain][i - 1].amount > amounts[i]) {\n revert ThresholdsNotInAscendingOrder();\n }\n //@audit-issue => Not validating if numOfApprovers[i] is greather than the existing number of approvers\n chainToThresholds[srcChain].push(\n Threshold(amounts[i], numOfApprovers[i])\n );\n }\n }\n emit ThresholdSet(srcChain, amounts, numOfApprovers);\n}", "github_refs_formatted": "DestinationBridge.sol#L255-L279", "github_files_list": "DestinationBridge.sol", "github_refs_count": 1, "vulnerable_code_actual": "function setThresholds(\n string calldata srcChain,\n uint256[] calldata amounts,\n uint256[] calldata numOfApprovers\n) external onlyOwner {\n if (amounts.length != numOfApprovers.length) {\n revert ArrayLengthMismatch();\n }\n delete chainToThresholds[srcChain];\n for (uint256 i = 0; i < amounts.length; ++i) {\n if (i == 0) {\n chainToThresholds[srcChain].push(\n Threshold(amounts[i], numOfApprovers[i])\n );\n } else {\n if (chainToThresholds[srcChain][i - 1].amount > amounts[i]) {\n revert ThresholdsNotInAscendingOrder();\n }\n //@audit-issue => Not validating if numOfApprovers[i] is greather than the existing number of approvers\n chainToThresholds[srcChain].push(\n Threshold(amounts[i], numOfApprovers[i])\n );\n }\n }\n emit ThresholdSet(srcChain, amounts, numOfApprovers);\n}\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function _attachThreshold(\n uint256 amount,\n bytes32 txnHash,\n string memory srcChain\n) internal {\n Threshold[] memory thresholds = chainToThresholds[srcChain];\n for (uint256 i = 0; i < thresholds.length; ++i) {\n Threshold memory t = thresholds[i];\n if (amount <= t.amount) {\n txnToThresholdSet[txnHash] = TxnThreshold(\n t.numberOfApprovalsNeeded,\n new address[](0)\n );\n break;\n }\n }\n //@audit-info => If the amount exceeded all the thresholds, the numberOfApprovalsNeeded won't be updated, thus, the tx will be reverted!s\n if (txnToThresholdSet[txnHash].numberOfApprovalsNeeded == 0) {\n revert NoThresholdMatch();\n }\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-salty", "title": "Raihan G", "severity_raw": "Critical", "severity": "critical", "description": "# GAS OPTIMIZATION\n\n# SUMMARY\n\n| | issue | instance |\n| ------ | ----------------------------------------------------------------------------------- | -------- |\n| [G\u201101] | Gas Optimization: Declare Variables Outside the Loop | 3 |\n| [G\u201102] | Gas Optimization: Using Assembly for Efficient Validation of `msg.sender` | 31 |\n| [G\u201103] | Gas Optimization: Use Assembly for Writing Address Storage Values | 8 |\n| [G\u201104] | Do not calculate constants | 1 |\n| [G\u201105] | Gas Optimization: Change Public State Variable Visibility to Private | 36 |\n| [G\u201106] | State variables can be packed to use fewer storage slots | 10 |\n| [G\u201107] | Gas Optimization Issue - Use Constants Instead of type(uintx).max | 15 |\n| [G\u201108] | Gas Optimization: Inlining Internal Functions | 8 |\n| [G\u201109] | Use assembly to perform efficient back-to-back calls | 7 |\n| [G\u201110] | Gas Optimization: Using Modifiers Instead of Functions | 2 |\n| [G\u201111] | Using delete instead of setting info struct to 0 saves gas | 2 |\n| [G\u201112] | Cache external calls outside of loop to avoid re-calling function on each iteration | 1 |\n| [G\u201113] | Access mappings directly rather than using accessor functions | 2 |\n| [G\u201114] | Pre-increment and pre-decrement are cheaper than `+1`, `-1` | 9 |\n| [G\u201115] | Using constants instead of enum can save gas | 1 |\n| [G\u201116] | Consider using OZ EnumerateSet in place of nested mappings | 5 |\n| [G\u201117] | Instead of cou", "vulnerable_code": "contract MyContract {\n function sum(uint256[] memory values) public pure returns (uint256) {\n for (uint256 i = 0; i < values.length; i++) {\n uint256 total; // This declaration is inside the loop and not initialized\n total += values[i];\n }\n\n return total; // This line will result in a compilation error; total is not visible here\n }\n}", "fixed_code": "contract MyContract {\n function sum(uint256[] memory values) public pure returns (uint256) {\n uint256 total; // Declare the variable outside the loop without initializing\n\n for (uint256 i = 0; i < values.length; i++) {\n total += values[i];\n }\n\n return total;\n }\n}", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/Raihan-G.md", "collected_at": "2026-01-02T19:01:26.421600+00:00", "source_hash": "2a625659e3576800a7cbecdbee556ceedf2bf17ac0a2fe522665a19bce3136c7", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "contract MyContract {\n function sum(uint256[] memory values) public pure returns (uint256) {\n for (uint256 i = 0; i < values.length; i++) {\n uint256 total; // This declaration is inside the loop and not initialized\n total += values[i];\n }\n\n return total; // This line will result in a compilation error; total is not visible here\n }\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "contract MyContract {\n function sum(uint256[] memory values) public pure returns (uint256) {\n uint256 total; // Declare the variable outside the loop without initializing\n\n for (uint256 i = 0; i < values.length; i++) {\n total += values[i];\n }\n\n return total;\n }\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "05-ajna", "title": "TS Q", "severity_raw": "Unknown", "severity": "unknown", "description": "#title\nLack of verification if NFT destination address handles ERC721\n\n#Description\nThe ``unstake`` of the ``RewardsManager`` contract does not verify if the NFT recipient is capable of receiving ERC721. The caller is responsible to confirm that the recipient is capable of receiving ERC721 or else they may be permanently lost.\n\nAffected code (https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/RewardsManager.sol#L250):\n```\n function unstake(\n uint256 tokenId_\n ) external override {\n ...omitted for brevity...\n IERC721(address(positionManager)).transferFrom(address(this), msg.sender, tokenId_);\n }\n``` \n\nIt is important to note that the ``unstake`` has to be done by an address that previously staked an NFT. However, it has to be taken into consideration that the address might be a proxy, which originally had a implementation that handled IERC721, but later that implementation changed to another that does not handle IERC721. In this case, the NFT would be lost after calling the ``unstake`` function.\n\n#Recommendation\nUse safeTransferFrom instead transferFrom", "vulnerable_code": " function unstake(\n uint256 tokenId_\n ) external override {\n ...omitted for brevity...\n IERC721(address(positionManager)).transferFrom(address(this), msg.sender, tokenId_);\n }", "fixed_code": "", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/TS-Q.md", "collected_at": "2026-01-02T18:21:16.387824+00:00", "source_hash": "2a8c8524ca283e24121af0343acad85ed21ecc95bfc7b0bbe9d26bd499c0f525", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 201, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function unstake(\n uint256 tokenId_\n ) external override {\n ...omitted for brevity...\n IERC721(address(positionManager)).transferFrom(address(this), msg.sender, tokenId_);\n }", "primary_code_language": "unknown", "primary_code_char_count": 201, "all_code_blocks": "// Code block 1 (unknown):\nfunction unstake(\n uint256 tokenId_\n ) external override {\n ...omitted for brevity...\n IERC721(address(positionManager)).transferFrom(address(this), msg.sender, tokenId_);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "RewardsManager.sol#L250", "github_files_list": "RewardsManager.sol", "github_refs_count": 1, "vulnerable_code_actual": " function unstake(\n uint256 tokenId_\n ) external override {\n ...omitted for brevity...\n IERC721(address(positionManager)).transferFrom(address(this), msg.sender, tokenId_);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5.23} {"source": "c4", "protocol": "04-caviar", "title": "0xWaitress Q", "severity_raw": "Unknown", "severity": "unknown", "description": "In the function PrivatePool::buy, tokenIds are looped twice, in the second loop the important task is to transfer royalty fee to the recipient, but the result of _getRoyalty can actually be skipped since it was called in the earlier loop\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L271-L283\n\n```solidity\n if (payRoyalties) {\n for (uint256 i = 0; i < tokenIds.length; i++) {\n // get the royalty fee for the NFT\n (uint256 royaltyFee, address recipient) = _getRoyalty(tokenIds[i], salePrice); @> audit\n\n // transfer the royalty fee to the recipient if it's greater than 0\n if (royaltyFee > 0 && recipient != address(0)) {\n if (baseToken != address(0)) {\n ERC20(baseToken).safeTransfer(recipient, royaltyFee);\n } else {\n recipient.safeTransferETH(royaltyFee);\n }\n }\n```\nsave the needed amount in an arrays in the first loop\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L238-L249\n\n```solidity\n+++ uint256[] memory royaltyFees;\n+++ address[] memory recipients;\nfor (uint256 i = 0; i < tokenIds.length; i++) {\n // transfer the NFT to the caller\n ERC721(nft).safeTransferFrom(address(this), msg.sender, tokenIds[i]);\n\n if (payRoyalties) {\n // get the royalty fee for the NFT\n (uint256 royaltyFee, address recipient) = _getRoyalty(tokenIds[i], salePrice);\n+++ royaltyFees[i] = royaltyFee; \n+++ recipients[i] = recipient; \n // add the royalty fee to the total royalty fee amount\n royaltyFeeAmount += royaltyFee;\n }\n }\n\n```", "vulnerable_code": " if (payRoyalties) {\n for (uint256 i = 0; i < tokenIds.length; i++) {\n // get the royalty fee for the NFT\n (uint256 royaltyFee, address recipient) = _getRoyalty(tokenIds[i], salePrice); @> audit\n\n // transfer the royalty fee to the recipient if it's greater than 0\n if (royaltyFee > 0 && recipient != address(0)) {\n if (baseToken != address(0)) {\n ERC20(baseToken).safeTransfer(recipient, royaltyFee);\n } else {\n recipient.safeTransferETH(royaltyFee);\n }\n }", "fixed_code": "+++ uint256[] memory royaltyFees;\n+++ address[] memory recipients;\nfor (uint256 i = 0; i < tokenIds.length; i++) {\n // transfer the NFT to the caller\n ERC721(nft).safeTransferFrom(address(this), msg.sender, tokenIds[i]);\n\n if (payRoyalties) {\n // get the royalty fee for the NFT\n (uint256 royaltyFee, address recipient) = _getRoyalty(tokenIds[i], salePrice);\n+++ royaltyFees[i] = royaltyFee; \n+++ recipients[i] = recipient; \n // add the royalty fee to the total royalty fee amount\n royaltyFeeAmount += royaltyFee;\n }\n }\n", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/0xWaitress-Q.md", "collected_at": "2026-01-02T18:19:21.234233+00:00", "source_hash": "2a98994d3323dad743ea2624fe46cce5417948939ca3968d0d57ed7349242e88", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 1299, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "if (payRoyalties) {\n for (uint256 i = 0; i < tokenIds.length; i++) {\n // get the royalty fee for the NFT\n (uint256 royaltyFee, address recipient) = _getRoyalty(tokenIds[i], salePrice); @> audit\n\n // transfer the royalty fee to the recipient if it's greater than 0\n if (royaltyFee > 0 && recipient != address(0)) {\n if (baseToken != address(0)) {\n ERC20(baseToken).safeTransfer(recipient, royaltyFee);\n } else {\n recipient.safeTransferETH(royaltyFee);\n }\n }", "primary_code_language": "solidity", "primary_code_char_count": 645, "all_code_blocks": "// Code block 1 (solidity):\nif (payRoyalties) {\n for (uint256 i = 0; i < tokenIds.length; i++) {\n // get the royalty fee for the NFT\n (uint256 royaltyFee, address recipient) = _getRoyalty(tokenIds[i], salePrice); @> audit\n\n // transfer the royalty fee to the recipient if it's greater than 0\n if (royaltyFee > 0 && recipient != address(0)) {\n if (baseToken != address(0)) {\n ERC20(baseToken).safeTransfer(recipient, royaltyFee);\n } else {\n recipient.safeTransferETH(royaltyFee);\n }\n }\n\n// Code block 2 (solidity):\n+++ uint256[] memory royaltyFees;\n+++ address[] memory recipients;\nfor (uint256 i = 0; i < tokenIds.length; i++) {\n // transfer the NFT to the caller\n ERC721(nft).safeTransferFrom(address(this), msg.sender, tokenIds[i]);\n\n if (payRoyalties) {\n // get the royalty fee for the NFT\n (uint256 royaltyFee, address recipient) = _getRoyalty(tokenIds[i], salePrice);\n+++ royaltyFees[i] = royaltyFee; \n+++ recipients[i] = recipient; \n // add the royalty fee to the total royalty fee amount\n royaltyFeeAmount += royaltyFee;\n }\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "if (payRoyalties) {\n for (uint256 i = 0; i < tokenIds.length; i++) {\n // get the royalty fee for the NFT\n (uint256 royaltyFee, address recipient) = _getRoyalty(tokenIds[i], salePrice); @> audit\n\n // transfer the royalty fee to the recipient if it's greater than 0\n if (royaltyFee > 0 && recipient != address(0)) {\n if (baseToken != address(0)) {\n ERC20(baseToken).safeTransfer(recipient, royaltyFee);\n } else {\n recipient.safeTransferETH(royaltyFee);\n }\n }\n\n+++ uint256[] memory royaltyFees;\n+++ address[] memory recipients;\nfor (uint256 i = 0; i < tokenIds.length; i++) {\n // transfer the NFT to the caller\n ERC721(nft).safeTransferFrom(address(this), msg.sender, tokenIds[i]);\n\n if (payRoyalties) {\n // get the royalty fee for the NFT\n (uint256 royaltyFee, address recipient) = _getRoyalty(tokenIds[i], salePrice);\n+++ royaltyFees[i] = royaltyFee; \n+++ recipients[i] = recipient; \n // add the royalty fee to the total royalty fee amount\n royaltyFeeAmount += royaltyFee;\n }\n }", "github_refs_formatted": "PrivatePool.sol#L271-L283, PrivatePool.sol#L238-L249", "github_files_list": "PrivatePool.sol", "github_refs_count": 2, "vulnerable_code_actual": " if (payRoyalties) {\n for (uint256 i = 0; i < tokenIds.length; i++) {\n // get the royalty fee for the NFT\n (uint256 royaltyFee, address recipient) = _getRoyalty(tokenIds[i], salePrice); @> audit\n\n // transfer the royalty fee to the recipient if it's greater than 0\n if (royaltyFee > 0 && recipient != address(0)) {\n if (baseToken != address(0)) {\n ERC20(baseToken).safeTransfer(recipient, royaltyFee);\n } else {\n recipient.safeTransferETH(royaltyFee);\n }\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "+++ uint256[] memory royaltyFees;\n+++ address[] memory recipients;\nfor (uint256 i = 0; i < tokenIds.length; i++) {\n // transfer the NFT to the caller\n ERC721(nft).safeTransferFrom(address(this), msg.sender, tokenIds[i]);\n\n if (payRoyalties) {\n // get the royalty fee for the NFT\n (uint256 royaltyFee, address recipient) = _getRoyalty(tokenIds[i], salePrice);\n+++ royaltyFees[i] = royaltyFee; \n+++ recipients[i] = recipient; \n // add the royalty fee to the total royalty fee amount\n royaltyFeeAmount += royaltyFee;\n }\n }\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-salty", "title": "BioMatriX Analysis", "severity_raw": "Critical", "severity": "critical", "description": "### [H-1] Unauthorized Access in InitialDistribution.sol (External Function Accessibility)\n\n**Description:** \nThe `distributionApproved` function is external and can be called by anyone. It's crucial to ensure that the `BootstrapBallot` contract itself has the proper access control to prevent unauthorized execution.\n\n**Impact:** \nHigh\n\n**Proof of Concept:** \n```\n`require( msg.sender == address(bootstrapBallot), \"InitialDistribution.distributionApproved can only be called from the BootstrapBallot contract\" );`\n```\n\n**Recommended Mitigation:** \nImplement strict access control mechanisms to ensure that only authorized contracts or addresses can call sensitive functions.\n\n---\n\n### [H-2] Unauthorized Access in Airdrop.sol (Contract Access Control)\n\n**Description:** \nIt's critical to ensure that referenced contracts (`initialDistribution().bootstrapBallot()` and `initialDistribution()`) have proper access controls to prevent unauthorized access and potential exploitation.\n\n**Impact:** \nHigh\n\n**Proof of Concept:** \n```\nrequire( msg.sender == address(exchangeConfig.initialDistribution().bootstrapBallot()), \"Only the BootstrapBallot can call Airdrop.authorizeWallet\" );\nrequire( ! claimingAllowed, \"Cannot authorize after claiming is allowed\" );\n```\n\n**Recommended Mitigation:** \nReview and reinforce the access control mechanisms for all referenced contracts to secure the protocol against unauthorized access.\n\n---\n\n### [H-3] Single Point of Failure in ExchangeConfig.sol (Owner Access Control)\n\n**Description:** \nProviding all access to the owner for different parameters can lead to a single point of failure. It's crucial to ensure that the owner is a trusted entity and has proper access control mechanisms in place.\n\n**Impact:** \nHigh\n\n**Proof of Concept:** \nFunction `setContracts` is externally accessible and modifiable only by the owner.\n\n**Recommended Mitigation:** \nConsider implementing multi-signature or decentralized governance mechanisms to mitigate the risks associated wi", "vulnerable_code": "`require( msg.sender == address(bootstrapBallot), \"InitialDistribution.distributionApproved can only be called from the BootstrapBallot contract\" );`", "fixed_code": "require( msg.sender == address(exchangeConfig.initialDistribution().bootstrapBallot()), \"Only the BootstrapBallot can call Airdrop.authorizeWallet\" );\nrequire( ! claimingAllowed, \"Cannot authorize after claiming is allowed\" );", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/BioMatriX-Analysis.md", "collected_at": "2026-01-02T19:01:14.647782+00:00", "source_hash": "2aa036d7b9a575a0be326569cc8be61077ae05e52859b3d25d18b8569672e92a", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 375, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "`require( msg.sender == address(bootstrapBallot), \"InitialDistribution.distributionApproved can only be called from the BootstrapBallot contract\" );`", "primary_code_language": "unknown", "primary_code_char_count": 149, "all_code_blocks": "// Code block 1 (unknown):\n`require( msg.sender == address(bootstrapBallot), \"InitialDistribution.distributionApproved can only be called from the BootstrapBallot contract\" );`\n\n// Code block 2 (unknown):\nrequire( msg.sender == address(exchangeConfig.initialDistribution().bootstrapBallot()), \"Only the BootstrapBallot can call Airdrop.authorizeWallet\" );\nrequire( ! claimingAllowed, \"Cannot authorize after claiming is allowed\" );", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "`require( msg.sender == address(bootstrapBallot), \"InitialDistribution.distributionApproved can only be called from the BootstrapBallot contract\" );`", "has_vulnerable_code_snippet": true, "fixed_code_actual": "require( msg.sender == address(exchangeConfig.initialDistribution().bootstrapBallot()), \"Only the BootstrapBallot can call Airdrop.authorizeWallet\" );\nrequire( ! claimingAllowed, \"Cannot authorize after claiming is allowed\" );", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "09-ondo", "title": "JP_Courses Q", "severity_raw": "Low", "severity": "low", "description": "0. QA/LOW: Lack of address(0) checks, relying solely on trusting that the privileged/admin access users will not accidentally pass zero addresses as function parameters.\n\n1. QA: lack of input validation for `_amount`, possible to pass zero value. Possible to send zero rUSDY tokens to another user.\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/3362e1252f3a54943e2517460e5a7988388bc821/contracts/usdy/rUSDY.sol#L246\n\nRecommendation:\n```solidity\n function transfer(address _recipient, uint256 _amount) public returns (bool) {\n ++ require(_amount != 0);\n _transfer(msg.sender, _recipient, _amount); \n return true;\n }\n```\n\n2. QA: seems approve() not internally called, so could use external modifier instead\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/3362e1252f3a54943e2517460e5a7988388bc821/contracts/usdy/rUSDY.sol#L276\n\n3. QA: unless planning to call this function internally, `public` should be changed to `external` visibility modifier\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/3362e1252f3a54943e2517460e5a7988388bc821/contracts/usdy/rUSDY.sol#L330\n\n4. LOW: recommend to use safetransferFrom() instead. fail without error message/return value nor revert?\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/3362e1252f3a54943e2517460e5a7988388bc821/contracts/usdy/rUSDY.sol#L437\n\n", "vulnerable_code": " function transfer(address _recipient, uint256 _amount) public returns (bool) {\n ++ require(_amount != 0);\n _transfer(msg.sender, _recipient, _amount); \n return true;\n }", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/JP_Courses-Q.md", "collected_at": "2026-01-02T18:25:31.309570+00:00", "source_hash": "2ab03368c3a6eaa91d114d5c3307f7c2b750535b1daa82acfa006c947cf589b2", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 176, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function transfer(address _recipient, uint256 _amount) public returns (bool) {\n ++ require(_amount != 0);\n _transfer(msg.sender, _recipient, _amount); \n return true;\n }", "primary_code_language": "solidity", "primary_code_char_count": 176, "all_code_blocks": "// Code block 1 (solidity):\nfunction transfer(address _recipient, uint256 _amount) public returns (bool) {\n ++ require(_amount != 0);\n _transfer(msg.sender, _recipient, _amount); \n return true;\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function transfer(address _recipient, uint256 _amount) public returns (bool) {\n ++ require(_amount != 0);\n _transfer(msg.sender, _recipient, _amount); \n return true;\n }", "github_refs_formatted": "rUSDY.sol#L246, rUSDY.sol#L276, rUSDY.sol#L330, rUSDY.sol#L437", "github_files_list": "rUSDY.sol", "github_refs_count": 4, "vulnerable_code_actual": " function transfer(address _recipient, uint256 _amount) public returns (bool) {\n ++ require(_amount != 0);\n _transfer(msg.sender, _recipient, _amount); \n return true;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5.61} {"source": "c4", "protocol": "01-biconomy", "title": "chrisdior4 Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA report\n\n## Low Risk\n| L-R |Issue|Instances|\n|:------:|:----|:-------:|\n| [L‑01] | Use the latest version of OpenZeppelin | 1 |\n| [L‑02] | Unused/empty receive()/fallback() function | 1 |\n| [L‑03] | Avoid the use of tx.origin | 1 |\n\nTotal: 3 instances over 3 issues\n\n## Non-critical\n\n| N-C |Issue|Instances|\n|:------:|:----|:-------:|\n| [N‑01] | Event is missing indexed fields | 2 |\n| [N‑02] | Commented out code | 2 |\n| [N‑03] | Use the latest Solidity version | 1 |\n| [N‑04] | Constants should be defined rather than using magic numbers | 2 |\n\nTotal: 7 instances over 4 issues\n\n## Low Risk\n\n# [L-01] Use the latest version of OpenZeppelin\n\nTo prevent any issues in the future (e.g. using solely hardhat to compile and deploy the contracts), upgrade the used OZ packages within the package.json to the latest versions.\n\n```solidity\n\"@openzeppelin/contracts\": \"^4.7.3\",\n```\n\n### Recommended Mitigation Steps:\n\nConsider using the latest OZ packages (v4.8.0) within package.json.\n\n\n# [L-02] Unused/empty receive()/fallback() function\nSometimes Ether might be mistakenly sent to the contract. It's better to prevent this from happening.\nsmartAccount.sol\nIf the intention is for the Ether to be used, the function should call another function, otherwise it should revert\nIf a method does not have an external call then it is impossible to reenter, so you can skip this modifier in such methods\n\nFile: SmartAccount.sol\n\n```solidity\n receive() external payable {}\n```\n\nLines of code:\n\n- https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L550\n\n# [L-03] Avoid the use of tx.origin\n\nThe tx.origin environment variable has been found to influence a control flow decision. Note that using tx.origin as a security control might cause a situation where a user inadvertently authorizes a smart contract to perform an action on their behalf. It is", "vulnerable_code": "\"@openzeppelin/contracts\": \"^4.7.3\",", "fixed_code": " receive() external payable {}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/chrisdior4-Q.md", "collected_at": "2026-01-02T18:13:37.797329+00:00", "source_hash": "2ac2f795ce4d038e4b31900fa1f47fa9ffe342663478b14d869dcef0e68ea871", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 65, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "\"@openzeppelin/contracts\": \"^4.7.3\",", "primary_code_language": "solidity", "primary_code_char_count": 36, "all_code_blocks": "// Code block 1 (solidity):\n\"@openzeppelin/contracts\": \"^4.7.3\",\n\n// Code block 2 (solidity):\nreceive() external payable {}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "\"@openzeppelin/contracts\": \"^4.7.3\",\n\nreceive() external payable {}", "github_refs_formatted": "SmartAccount.sol#L550", "github_files_list": "SmartAccount.sol", "github_refs_count": 1, "vulnerable_code_actual": "\"@openzeppelin/contracts\": \"^4.7.3\",", "has_vulnerable_code_snippet": true, "fixed_code_actual": " receive() external payable {}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "04-caviar", "title": "abiih G", "severity_raw": "High", "severity": "high", "description": "# Report\n\n---\n\n## Gas Optimizations\n\n---\n\n| | Issue |\n| --- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| 1 | [Usage of uints/ints smaller than 32 bytes (256 bits) incurs overhead](#usage-of-uintsints-smaller-than-32-bytes-256-bits-incurs-overhead) |\n| 2 | [Use external instead of public where possible](#use-external-instead-of-public-where-possible) |\n| 3 | [Functions Guaranteed To Revert When Called By Normal Users Can Be Marked Payable](#functions-guaranteed-to-revert-when-called-by-normal-users-can-be-marked-payable) |\n| 4 | [ Use calldata instead of memory for function arguments that do not get mutated](#use-calldata-instead-of-memory-for-function-arguments-that-do-not-get-mutated) |\n\n---\n\n1. ### Usage of uints/ints smaller than 32 bytes (256 bits) incurs overhead\n\n When using elements that are smaller than 32 bytes, your contract\u2019s gas usage may be higher.\n This is because the EVM operates on 32 bytes at a time. Therefore, if the element is smaller than that, the EVM must use more operations in order to reduce the size of the element from 32 bytes to the desired size.\n\n - https://github.com/code-423n4/2023-04-caviar/blob/main/src/Factory.sol#L51\n - https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L88\n - https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L91\n\n```diff\n- uint16 public protocolFeeRate;\n+ uint16 public protocolFeeRate;\n\n```\n\n2. ### Use external instead of public where possible\n Functions with the public visibility modifier are costlier than external. Default to using the external modifie", "vulnerable_code": "2. ### Use external instead of public where possible\n Functions with the public visibility modifier are costlier than external. Default to using the external modifier until you need to expose it to other functions within your contract.\n\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L157\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L211\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L301\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L385\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L459\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L484\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L602\n", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/abiih-G.md", "collected_at": "2026-01-02T18:20:12.864424+00:00", "source_hash": "2adfcf8f4aa947dcda0698951cba3176d502bfa4e8c13c1ccdb23263c7e00667", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 73, "github_ref_count": 10, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "- uint16 public protocolFeeRate;\n+ uint16 public protocolFeeRate;", "primary_code_language": "diff", "primary_code_char_count": 73, "all_code_blocks": "// Code block 1 (diff):\n- uint16 public protocolFeeRate;\n+ uint16 public protocolFeeRate;", "all_code_blocks_count": 1, "has_diff_blocks": true, "diff_code": "- uint16 public protocolFeeRate;\n+ uint16 public protocolFeeRate;", "solidity_code": "", "github_refs_formatted": "Factory.sol#L51, PrivatePool.sol#L88, PrivatePool.sol#L91, PrivatePool.sol#L157, PrivatePool.sol#L211, PrivatePool.sol#L301, PrivatePool.sol#L385, PrivatePool.sol#L459, PrivatePool.sol#L484, PrivatePool.sol#L602", "github_files_list": "PrivatePool.sol, Factory.sol", "github_refs_count": 10, "vulnerable_code_actual": "2. ### Use external instead of public where possible\n Functions with the public visibility modifier are costlier than external. Default to using the external modifier until you need to expose it to other functions within your contract.\n\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L157\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L211\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L301\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L385\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L459\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L484\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L602\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 8} {"source": "c4", "protocol": "08-dopex", "title": "report", "severity_raw": "Critical", "severity": "critical", "description": "---\nsponsor: \"Dopex\"\nslug: \"2023-08-dopex\"\ndate: \"2023-12-29\"\ntitle: \"Dopex \"\nfindings: \"https://github.com/code-423n4/2023-08-dopex-findings/issues\"\ncontest: 278\n---\n\n# Overview\n\n## About C4\n\nCode4rena (C4) is an open organization consisting of security researchers, auditors, developers, and individuals with domain expertise in smart contracts.\n\nA C4 audit is an event in which community participants, referred to as Wardens, review, audit, or analyze smart contract logic in exchange for a bounty provided by sponsoring projects.\n\nDuring the audit outlined in this document, C4 conducted an analysis of the Dopex smart contract system written in Solidity. The audit took place between August 21\u2014September 6 2023.\n\n## Wardens\n\n203 Wardens contributed reports to Dopex:\n\n 1. [said](https://code4rena.com/@said)\n 2. [peakbolt](https://code4rena.com/@peakbolt)\n 3. [Toshii](https://code4rena.com/@Toshii)\n 4. [\\_\\_141345\\_\\_](https://code4rena.com/@__141345__)\n 5. [LokiThe5th](https://code4rena.com/@LokiThe5th)\n 6. [Evo](https://code4rena.com/@Evo)\n 7. [deadrxsezzz](https://code4rena.com/@deadrxsezzz)\n 8. [volodya](https://code4rena.com/@volodya)\n 9. [rvierdiiev](https://code4rena.com/@rvierdiiev)\n 10. [0xnev](https://code4rena.com/@0xnev)\n 11. [pep7siup](https://code4rena.com/@pep7siup)\n 12. [juancito](https://code4rena.com/@juancito)\n 13. [kutugu](https://code4rena.com/@kutugu)\n 14. [QiuhaoLi](https://code4rena.com/@QiuhaoLi)\n 15. [Yanchuan](https://code4rena.com/@Yanchuan)\n 16. [catellatech](https://code4rena.com/@catellatech)\n 17. [glcanvas](https://code4rena.com/@glcanvas)\n 18. [nirlin](https://code4rena.com/@nirlin)\n 19. [T1MOH](https://code4rena.com/@T1MOH)\n 20. [c3phas](https://code4rena.com/@c3phas)\n 21. [RED-LOTUS-REACH](https://code4rena.com/@RED-LOTUS-REACH) ([BlockChomper](https://code4rena.com/@BlockChomper), [DedOhWale](https://code4rena.com/@DedOhWale), [reentrant](https://code4rena.com/@reentrant), and [escrow](https://code4rena.com/@escrow))", "vulnerable_code": "function bond(\n uint256 _amount,\n uint256 rdpxBondId,\n address _to\n) public returns (uint256 receiptTokenAmount) {\n _whenNotPaused();\n // Validate amount\n _validate(_amount > 0, 4);\n\n // Compute the bond cost\n (uint256 rdpxRequired, uint256 wethRequired) = calculateBondCost(\n _amount,\n rdpxBondId\n );\n ...\n}", "fixed_code": "function calculateBondCost(\n uint256 _amount,\n uint256 _rdpxBondId\n) public view returns (uint256 rdpxRequired, uint256 wethRequired) {\n uint256 rdpxPrice = getRdpxPrice();\n\n ...\n\n uint256 strike = IPerpetualAtlanticVault(addresses.perpetualAtlanticVault)\n .roundUp(rdpxPrice - (rdpxPrice / 4)); // 25% below the current price\n\n uint256 timeToExpiry = IPerpetualAtlanticVault(\n addresses.perpetualAtlanticVault\n ).nextFundingPaymentTimestamp() - block.timestamp;\n if (putOptionsRequired) {\n wethRequired += IPerpetualAtlanticVault(addresses.perpetualAtlanticVault)\n .calculatePremium(strike, rdpxRequired, timeToExpiry, 0);\n }\n}", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/report.md", "collected_at": "2026-01-02T18:25:09.501072+00:00", "source_hash": "2b27b3bac7c747ce517b3d3de123a4e27d522376b7636e5dbbeeb4917b7fe769", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function bond(\n uint256 _amount,\n uint256 rdpxBondId,\n address _to\n) public returns (uint256 receiptTokenAmount) {\n _whenNotPaused();\n // Validate amount\n _validate(_amount > 0, 4);\n\n // Compute the bond cost\n (uint256 rdpxRequired, uint256 wethRequired) = calculateBondCost(\n _amount,\n rdpxBondId\n );\n ...\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function calculateBondCost(\n uint256 _amount,\n uint256 _rdpxBondId\n) public view returns (uint256 rdpxRequired, uint256 wethRequired) {\n uint256 rdpxPrice = getRdpxPrice();\n\n ...\n\n uint256 strike = IPerpetualAtlanticVault(addresses.perpetualAtlanticVault)\n .roundUp(rdpxPrice - (rdpxPrice / 4)); // 25% below the current price\n\n uint256 timeToExpiry = IPerpetualAtlanticVault(\n addresses.perpetualAtlanticVault\n ).nextFundingPaymentTimestamp() - block.timestamp;\n if (putOptionsRequired) {\n wethRequired += IPerpetualAtlanticVault(addresses.perpetualAtlanticVault)\n .calculatePremium(strike, rdpxRequired, timeToExpiry, 0);\n }\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "11-kelp", "title": "Rickard G", "severity_raw": "Medium", "severity": "medium", "description": "## [G-01] Remove the `initializer` modifier\nIf we can just ensure that the `initialize()` function can only be called from within the constructor, we shouldn\u2019t need to worry about it getting called again.\n````solidity\nsrc/LRTConfig.sol\n41: function initialize(\n42: address admin,\n43: address stETH,\n44: address rETH,\n45: address cbETH,\n46: address rsETH_\n47: )\n48: external\n49: initializer\n50: {\n````\n[https://github.com/code-423n4/2023-11-kelp/blob/c5fdc2e62c5e1d78769f44d6e34a6fb9e40c00f0/src/LRTConfig.sol#L41-L50](https://github.com/code-423n4/2023-11-kelp/blob/c5fdc2e62c5e1d78769f44d6e34a6fb9e40c00f0/src/LRTConfig.sol#L41-L50)\n````solidity\nsrc/LRTDepositPool.sol\n31: function initialize(address lrtConfigAddr) external initializer {\n````\n[https://github.com/code-423n4/2023-11-kelp/blob/c5fdc2e62c5e1d78769f44d6e34a6fb9e40c00f0/src/LRTDepositPool.sol#L31](https://github.com/code-423n4/2023-11-kelp/blob/c5fdc2e62c5e1d78769f44d6e34a6fb9e40c00f0/src/LRTDepositPool.sol#L31)\n````solidity\nsrc/LRTOracle.sol\n29: function initialize(address lrtConfigAddr) external initializer {\n````\n[https://github.com/code-423n4/2023-11-kelp/blob/c5fdc2e62c5e1d78769f44d6e34a6fb9e40c00f0/src/LRTOracle.sol#L29](https://github.com/code-423n4/2023-11-kelp/blob/c5fdc2e62c5e1d78769f44d6e34a6fb9e40c00f0/src/LRTOracle.sol#L29)\n````solidity\nsrc/NodeDelegator.sol\n26: function initialize(address lrtConfigAddr) external initializer {\n````\n[https://github.com/code-423n4/2023-11-kelp/blob/c5fdc2e62c5e1d78769f44d6e34a6fb9e40c00f0/src/NodeDelegator.sol#L26](https://github.com/code-423n4/2023-11-kelp/blob/c5fdc2e62c5e1d78769f44d6e34a6fb9e40c00f0/src/NodeDelegator.sol#L26)\n````solidity\nsrc/RSETH.sol\n32: function initialize(address admin, address lrtConfigAddr) external initializer {\n````\n[https://github.com/code-423n4/2023-11-kelp/blob/c5fdc2e62c5e1d78769f44d6e34a6fb9e40c00f0/src/RSETH.sol#L32](https://github.com/code-423n4/2023-11-kelp/blob/c5", "vulnerable_code": "src/LRTConfig.sol\n41: function initialize(\n42: address admin,\n43: address stETH,\n44: address rETH,\n45: address cbETH,\n46: address rsETH_\n47: )\n48: external\n49: initializer\n50: {", "fixed_code": "src/LRTDepositPool.sol\n31: function initialize(address lrtConfigAddr) external initializer {", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/Rickard-G.md", "collected_at": "2026-01-02T18:27:36.302906+00:00", "source_hash": "2b42b073f4e55b07ac6abcb2e858cb194541114e40d94d4d28f4838179046f3b", "code_block_count": 5, "solidity_block_count": 5, "total_code_chars": 615, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "src/LRTConfig.sol\n41: function initialize(\n42: address admin,\n43: address stETH,\n44: address rETH,\n45: address cbETH,\n46: address rsETH_\n47: )\n48: external\n49: initializer\n50: {", "primary_code_language": "solidity", "primary_code_char_count": 235, "all_code_blocks": "// Code block 1 (solidity):\nsrc/LRTConfig.sol\n41: function initialize(\n42: address admin,\n43: address stETH,\n44: address rETH,\n45: address cbETH,\n46: address rsETH_\n47: )\n48: external\n49: initializer\n50: {\n\n// Code block 2 (solidity):\nsrc/LRTDepositPool.sol\n31: function initialize(address lrtConfigAddr) external initializer {\n\n// Code block 3 (solidity):\nsrc/LRTOracle.sol\n29: function initialize(address lrtConfigAddr) external initializer {\n\n// Code block 4 (solidity):\nsrc/NodeDelegator.sol\n26: function initialize(address lrtConfigAddr) external initializer {\n\n// Code block 5 (solidity):\nsrc/RSETH.sol\n32: function initialize(address admin, address lrtConfigAddr) external initializer {", "all_code_blocks_count": 5, "has_diff_blocks": false, "diff_code": "", "solidity_code": "src/LRTConfig.sol\n41: function initialize(\n42: address admin,\n43: address stETH,\n44: address rETH,\n45: address cbETH,\n46: address rsETH_\n47: )\n48: external\n49: initializer\n50: {\n\nsrc/LRTDepositPool.sol\n31: function initialize(address lrtConfigAddr) external initializer {\n\nsrc/LRTOracle.sol\n29: function initialize(address lrtConfigAddr) external initializer {\n\nsrc/NodeDelegator.sol\n26: function initialize(address lrtConfigAddr) external initializer {\n\nsrc/RSETH.sol\n32: function initialize(address admin, address lrtConfigAddr) external initializer {", "github_refs_formatted": "LRTConfig.sol#L41-L50, LRTDepositPool.sol#L31, LRTOracle.sol#L29, NodeDelegator.sol#L26, RSETH.sol#L32", "github_files_list": "LRTOracle.sol, RSETH.sol, NodeDelegator.sol, LRTConfig.sol, LRTDepositPool.sol", "github_refs_count": 5, "vulnerable_code_actual": "src/LRTConfig.sol\n41: function initialize(\n42: address admin,\n43: address stETH,\n44: address rETH,\n45: address cbETH,\n46: address rsETH_\n47: )\n48: external\n49: initializer\n50: {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "src/LRTDepositPool.sol\n31: function initialize(address lrtConfigAddr) external initializer {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 11} {"source": "c4", "protocol": "02-ethos", "title": "descharre G", "severity_raw": "High", "severity": "high", "description": "# Summary\n|ID | Finding| Gas saved | Instances|\n|:----: | :--- | :----: |:----: |\n|G-01 |Make for loops unchecked| - | 12 |\n|G-02 |Add unchecked block when operands can't under/overflow| 536 | 15 |\n|G-03 |Don't write to memory when variable is only used once| 10 | 1 |\n|G-04 |Unnecessary nonReentrant modifier| 2374 | 1 |\n|G-05 |Save return value to memory instead of calling function multiple times| - | 1 |\n|G-06 |function `_atLeastRole()` can be made more gas effici\u00ebnt| 300 | 1 |\n|G-07 |Initialize a static array instead of a dynamic array| 300 | - |\n|G-08 |Unnecessary if/require statements| - | 2 |\n|G-09 |Internal functions only called once can be inlined to save gas| 30 | 1 |\n|G-10 |Using double if/require statement instead of && consumes less gas| 15 | 7 |\n|G-11 |Use the calldata variable when it has the same value as a state variable| 200 | 1 |\n|G-12 |Bytes32 constant is cheaper than string constant| - | 4 |\n|G-13 |Combine events to save gas| 5000 | 6 |\n|G-14 |Amount is always equal to balance after - balance before| 980 | 1 |\n# Details\n## [G-01] Make for loops unchecked\nThe risk of for loops getting overflowed is extremely low. Because it always increments by 1 and is limited to the arrays length. Even if the arrays are extremely long, it will take a massive amount of time and gas to let the for loop overflow. The longer the array, the more gas you will save.\n\n- [ActivePool.sol#L108-L113](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol#L108-L113)\n- [CollateralConfig.sol#L56-L73](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol#L56-L73)\n- [StabilityPool.sol#L351-L356](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/StabilityPool.sol#L351-L356)\n- [StabilityPool.sol#L397-L403](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/", "vulnerable_code": "## [G-02] Add unchecked block when operands can't under/overflow\nWhen operands can't underflow/overflow because of a previous require() or if statement, you can use an unchecked block.\nThe default \"checked\" behavior costs more gas when calculating, because under-the-hood the EVM does extra checks for over/underflow.\n|Code |Explanation| Function | Gas saved |\n|:----: | :--- | :----: |:----: |\n|[ReaperVaultV2.sol#L194](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L194)|AllocBPS can never be higher than the totalAllocBPS| `updateStrategyAllocBPS()` |170 |\n|[ReaperVaultV2.sol#L391](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L391)|Loss is decremented from value in the line above.
If loss would be really high it would already revert there.| `withdraw()` |90 |\n|[ReaperVaultV2.sol#L396](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L396)| Total allocated is always more than the allocation of one strategy| `updateStrategyAllocBPS()` |218 |\n|[ReaperVaultV2.sol#L330](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L330)| When tokens are sent to the vault, balance after is always
greater than or equal to balance before| `deposit()` |58 |\n|[ReaperStrategyGranarySupplyOnly.sol#L93](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol#L93)| Can be done because of previous if check| `_liquidatePosition()` |- |\n|[ReaperStrategyGranarySupplyOnly.sol#L100](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol#L100)| Can be done because of previous if check| `_liquidatePosition()` |- |\n\nThis can also be done for divisions.\n\nThe expression type(int).min / (-1) is the only case where division causes an overflow. On average 35 gas saved:\n- [Re", "fixed_code": "Can be changed to:", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/descharre-G.md", "collected_at": "2026-01-02T18:17:05.125830+00:00", "source_hash": "2b96c1151e7caec8daec3d83f1b0a6a2e0c8f19081bf08505daa5ae85f4c62b8", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 9, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ActivePool.sol#L108-L113, CollateralConfig.sol#L56-L73, StabilityPool.sol#L351-L356, ReaperVaultV2.sol#L194, ReaperVaultV2.sol#L391, ReaperVaultV2.sol#L396, ReaperVaultV2.sol#L330, ReaperStrategyGranarySupplyOnly.sol#L93, ReaperStrategyGranarySupplyOnly.sol#L100", "github_files_list": "StabilityPool.sol, ReaperStrategyGranarySupplyOnly.sol, ReaperVaultV2.sol, ActivePool.sol, CollateralConfig.sol", "github_refs_count": 9, "vulnerable_code_actual": "## [G-02] Add unchecked block when operands can't under/overflow\nWhen operands can't underflow/overflow because of a previous require() or if statement, you can use an unchecked block.\nThe default \"checked\" behavior costs more gas when calculating, because under-the-hood the EVM does extra checks for over/underflow.\n|Code |Explanation| Function | Gas saved |\n|:----: | :--- | :----: |:----: |\n|[ReaperVaultV2.sol#L194](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L194)|AllocBPS can never be higher than the totalAllocBPS| `updateStrategyAllocBPS()` |170 |\n|[ReaperVaultV2.sol#L391](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L391)|Loss is decremented from value in the line above.
If loss would be really high it would already revert there.| `withdraw()` |90 |\n|[ReaperVaultV2.sol#L396](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L396)| Total allocated is always more than the allocation of one strategy| `updateStrategyAllocBPS()` |218 |\n|[ReaperVaultV2.sol#L330](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L330)| When tokens are sent to the vault, balance after is always
greater than or equal to balance before| `deposit()` |58 |\n|[ReaperStrategyGranarySupplyOnly.sol#L93](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol#L93)| Can be done because of previous if check| `_liquidatePosition()` |- |\n|[ReaperStrategyGranarySupplyOnly.sol#L100](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol#L100)| Can be done because of previous if check| `_liquidatePosition()` |- |\n\nThis can also be done for divisions.\n\nThe expression type(int).min / (-1) is the only case where division causes an overflow. On average 35 gas saved:\n- [Re", "has_vulnerable_code_snippet": true, "fixed_code_actual": "Can be changed to:", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "04-caviar", "title": "ACai G", "severity_raw": "Gas", "severity": "gas", "description": "# verifing `public` to `external` for saving gas\n\nSuggest to verify the function visibility quantifiers from `public` to `external` for saving gas.\n\n- Factory.setPrivatePoolMetadata, Line 129\n- Factory.setPrivatePoolImplementation, Line 135\n- Factory.setProtocolFeeRate, Line 141\n- Factory.withdraw, Line 148\n\n# verifing the parameter visibility to `immutable` for saving gas\nPrivatePool.constructor, Line 143-147\nThese `factory`, `royaltyRegistry` and `stolenNftOracle` parameter only set in the constructor function. So suggest to add `immutable` for saving gas.\n```solidity\n constructor(address _factory, address _royaltyRegistry, address _stolenNftOracle) {\n factory = payable(_factory);\n royaltyRegistry = _royaltyRegistry;\n stolenNftOracle = _stolenNftOracle;\n }\n```", "vulnerable_code": " constructor(address _factory, address _royaltyRegistry, address _stolenNftOracle) {\n factory = payable(_factory);\n royaltyRegistry = _royaltyRegistry;\n stolenNftOracle = _stolenNftOracle;\n }", "fixed_code": "", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/ACai-G.md", "collected_at": "2026-01-02T18:19:26.230435+00:00", "source_hash": "2b9c5813cd767856c21eab19ac399198c34e9254b849e658a051220be3f36451", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 214, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "constructor(address _factory, address _royaltyRegistry, address _stolenNftOracle) {\n factory = payable(_factory);\n royaltyRegistry = _royaltyRegistry;\n stolenNftOracle = _stolenNftOracle;\n }", "primary_code_language": "solidity", "primary_code_char_count": 214, "all_code_blocks": "// Code block 1 (solidity):\nconstructor(address _factory, address _royaltyRegistry, address _stolenNftOracle) {\n factory = payable(_factory);\n royaltyRegistry = _royaltyRegistry;\n stolenNftOracle = _stolenNftOracle;\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "constructor(address _factory, address _royaltyRegistry, address _stolenNftOracle) {\n factory = payable(_factory);\n royaltyRegistry = _royaltyRegistry;\n stolenNftOracle = _stolenNftOracle;\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " constructor(address _factory, address _royaltyRegistry, address _stolenNftOracle) {\n factory = payable(_factory);\n royaltyRegistry = _royaltyRegistry;\n stolenNftOracle = _stolenNftOracle;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 3.6} {"source": "c4", "protocol": "11-kelp", "title": "report", "severity_raw": "Critical", "severity": "critical", "description": "---\nsponsor: \"Kelp DAO\"\nslug: \"2023-11-kelp\"\ndate: \"2023-12-11\"\ntitle: \"Kelp DAO | rsETH\"\nfindings: \"https://github.com/code-423n4/2023-11-kelp-findings/issues\"\ncontest: 305\n---\n\n# Overview\n\n## About C4\n\nCode4rena (C4) is an open organization consisting of security researchers, auditors, developers, and individuals with domain expertise in smart contracts.\n\nA C4 audit is an event in which community participants, referred to as Wardens, review, audit, or analyze smart contract logic in exchange for a bounty provided by sponsoring projects.\n\nDuring the audit outlined in this document, C4 conducted an analysis of the Kelp DAO | rsETH smart contract system written in Solidity. The audit took place between November 10\u2014November 15 2023.\n\n## Wardens\n\n194 Wardens contributed reports to the Kelp DAO | rsETH audit:\n\n 1. [m\\_Rassska](https://code4rena.com/@m_Rassska)\n 2. [CatsSecurity](https://code4rena.com/@CatsSecurity) ([nirlin](https://code4rena.com/@nirlin) and [cats](https://code4rena.com/@cats))\n 3. [adriro](https://code4rena.com/@adriro)\n 4. [Bauchibred](https://code4rena.com/@Bauchibred)\n 5. [PENGUN](https://code4rena.com/@PENGUN)\n 6. [SBSecurity](https://code4rena.com/@SBSecurity) ([Slavcheww](https://code4rena.com/@Slavcheww) and [Blckhv](https://code4rena.com/@Blckhv))\n 7. [deth](https://code4rena.com/@deth)\n 8. [0xDING99YA](https://code4rena.com/@0xDING99YA)\n 9. [jayfromthe13th](https://code4rena.com/@jayfromthe13th)\n 10. [Aamir](https://code4rena.com/@Aamir)\n 11. [HChang26](https://code4rena.com/@HChang26)\n 12. [almurhasan](https://code4rena.com/@almurhasan)\n 13. [d3e4](https://code4rena.com/@d3e4)\n 14. [anarcheuz](https://code4rena.com/@anarcheuz)\n 15. [circlelooper](https://code4rena.com/@circlelooper)\n 16. [hals](https://code4rena.com/@hals)\n 17. [Bauer](https://code4rena.com/@Bauer)\n 18. [ck](https://code4rena.com/@ck)\n 19. [Pechenite](https://code4rena.com/@Pechenite) ([Bozho](https://code4rena.com/@Bozho) and [radev\\_sw](https://code4rena", "vulnerable_code": " contract LRTOracleMock {\n uint256 public price;\n\n\n constructor(uint256 _price) {\n price = _price;\n }\n\n function getAssetPrice(address) external view returns (uint256) {\n return price;\n }\n\n function submitNewAssetPrice(uint256 _newPrice) external {\n price = _newPrice;\n }\n }\n ```\n * `setUp()`:\n * ```Solidity\n contract LRTDepositPoolTest is BaseTest, RSETHTest {\n LRTDepositPool public lrtDepositPool;\n\n function setUp() public virtual override(RSETHTest, BaseTest) {\n super.setUp();\n\n // deploy LRTDepositPool\n ProxyAdmin proxyAdmin = new ProxyAdmin();\n LRTDepositPool contractImpl = new LRTDepositPool();\n TransparentUpgradeableProxy contractProxy = new TransparentUpgradeableProxy(\n address(contractImpl),\n address(proxyAdmin),\n \"\"\n );\n \n lrtDepositPool = LRTDepositPool(address(contractProxy));\n\n // initialize RSETH. LRTCOnfig is already initialized in RSETHTest\n rseth.initialize(address(admin), address(lrtConfig));\n vm.startPrank(admin);\n // add rsETH to LRT config\n lrtConfig.setRSETH(address(rseth));\n // add oracle to LRT config\n lrtConfig.setContract(LRTConstants.LRT_ORACLE, address(new LRTOracle()));\n lrtConfig.setContract(LRTConstants.LRT_DEPOSIT_POOL, address(lrtDepositPool));\n LRTOracle(lrtConfig.getContract(LRTConstants.LRT_ORACLE)).initialize(address(lrtConfig));\n\n\n lrtDepositPool.initialize(address(lrtConfig));\n // add minter role for rseth to lrtDepositPool\n ", "fixed_code": "There is long chain of calls:\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/report.md", "collected_at": "2026-01-02T18:28:31.501320+00:00", "source_hash": "2bf63e52c8da8b83a0a36edaa50d860832015f580d0b7a12254e554b9e807778", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " contract LRTOracleMock {\n uint256 public price;\n\n\n constructor(uint256 _price) {\n price = _price;\n }\n\n function getAssetPrice(address) external view returns (uint256) {\n return price;\n }\n\n function submitNewAssetPrice(uint256 _newPrice) external {\n price = _newPrice;\n }\n }\n ```\n * `setUp()`:\n * ```Solidity\n contract LRTDepositPoolTest is BaseTest, RSETHTest {\n LRTDepositPool public lrtDepositPool;\n\n function setUp() public virtual override(RSETHTest, BaseTest) {\n super.setUp();\n\n // deploy LRTDepositPool\n ProxyAdmin proxyAdmin = new ProxyAdmin();\n LRTDepositPool contractImpl = new LRTDepositPool();\n TransparentUpgradeableProxy contractProxy = new TransparentUpgradeableProxy(\n address(contractImpl),\n address(proxyAdmin),\n \"\"\n );\n \n lrtDepositPool = LRTDepositPool(address(contractProxy));\n\n // initialize RSETH. LRTCOnfig is already initialized in RSETHTest\n rseth.initialize(address(admin), address(lrtConfig));\n vm.startPrank(admin);\n // add rsETH to LRT config\n lrtConfig.setRSETH(address(rseth));\n // add oracle to LRT config\n lrtConfig.setContract(LRTConstants.LRT_ORACLE, address(new LRTOracle()));\n lrtConfig.setContract(LRTConstants.LRT_DEPOSIT_POOL, address(lrtDepositPool));\n LRTOracle(lrtConfig.getContract(LRTConstants.LRT_ORACLE)).initialize(address(lrtConfig));\n\n\n lrtDepositPool.initialize(address(lrtConfig));\n // add minter role for rseth to lrtDepositPool\n ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "There is long chain of calls:\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "10-badger", "title": "ladboy233 Q", "severity_raw": "Critical", "severity": "critical", "description": "| Issue Number | Description | Suggested Action |\n|--------------|---------------------------------------------------------------------|----------------------------------------------|\n| 1 | Function `flashFee` in `ActivePool` is not fully EIP 3156 compliant | Ensure compliance with EIP 3156 |\n| 2 | Use of `increaseAllowance` / `decreaseAllowance` is deprecated in `EBTC.sol` token | Replace with secure alternatives |\n| 3 | Should validate if `ecrecover` returns address(0) | Implement validation for `ecrecover` return |\n| 4 | Address open `@todo` and `@audit` before deployment | Complete all TODOs and audits |\n| 5 | Rename `Governor` contract to `ACM` (Access Control Manager) | Rename the contract as suggested |\n\n\n# function flashFee in ActivePool is not fully EIP 3156 complicant\n\nAccording to https://code4rena.com/contests/2023-10-badger-ebtc-audit-certora-formal-verification-competition#top\n\n> EIP Compliance\nActivePool: Should comply with EIP3156\n\naccording to https://eips.ethereum.org/EIPS/eip-3156\n\n> The flashFee function MUST return the fee charged for a loan of amount token. If the token is not supported flashFee MUST revert.\n\nso external implementation may replies on this function to validate whether flashloan is supported \n\nif the active pool collateral is stETH,\n\nif we take a look at the stETH smart contract\n\nhttps://etherscan.io/token/0xae7ab96520de3a18e5e111b5eaab095312d7fe84#readProxyContract\n\nthe implementation contract is https://etherscan.io/address/0x17144556fd3424edc8fc8a4c940b2d04936d17eb#code\n\nwhen the admin of stETH paused the token, no transfer can be allowed and no flashloan can be borrowed\n\nhttps://etherscan.io/address/0x17144556fd3424edc8fc8a4c940b2d04936d17eb#code#F27#L445\n\n```solidity\n function _transferShares(add", "vulnerable_code": " function _transferShares(address _sender, address _recipient, uint256 _sharesAmount) internal {\n require(_sender != address(0), \"TRANSFER_FROM_ZERO_ADDR\");\n require(_recipient != address(0), \"TRANSFER_TO_ZERO_ADDR\");\n require(_recipient != address(this), \"TRANSFER_TO_STETH_CONTRACT\");\n _whenNotStopped();\n\n uint256 currentSenderShares = shares[_sender];\n require(_sharesAmount <= currentSenderShares, \"BALANCE_EXCEEDED\");\n\n shares[_sender] = currentSenderShares.sub(_sharesAmount);\n shares[_recipient] = shares[_recipient].add(_sharesAmount);\n }", "fixed_code": " function flashFee(address token, uint256 amount) public view override returns (uint256) {\n require(token == address(collateral), \"ActivePool: collateral Only\");\n require(!flashLoansPaused, \"ActivePool: Flash Loans Paused\");\n require(ACTIVE_FLAG_POSITION.getStorageBool(), \"collateral paused\") // added code\n return (amount * feeBps) / MAX_BPS;\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/ladboy233-Q.md", "collected_at": "2026-01-02T18:26:53.808055+00:00", "source_hash": "2bf743be0cbbaabcc8411c09617fdb1bc0070265775059ea26a7292a28757e9f", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function _transferShares(address _sender, address _recipient, uint256 _sharesAmount) internal {\n require(_sender != address(0), \"TRANSFER_FROM_ZERO_ADDR\");\n require(_recipient != address(0), \"TRANSFER_TO_ZERO_ADDR\");\n require(_recipient != address(this), \"TRANSFER_TO_STETH_CONTRACT\");\n _whenNotStopped();\n\n uint256 currentSenderShares = shares[_sender];\n require(_sharesAmount <= currentSenderShares, \"BALANCE_EXCEEDED\");\n\n shares[_sender] = currentSenderShares.sub(_sharesAmount);\n shares[_recipient] = shares[_recipient].add(_sharesAmount);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function flashFee(address token, uint256 amount) public view override returns (uint256) {\n require(token == address(collateral), \"ActivePool: collateral Only\");\n require(!flashLoansPaused, \"ActivePool: Flash Loans Paused\");\n require(ACTIVE_FLAG_POSITION.getStorageBool(), \"collateral paused\") // added code\n return (amount * feeBps) / MAX_BPS;\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "09-ondo", "title": "jnrlouis G", "severity_raw": "Low", "severity": "low", "description": "# Report\n\n## Gas Optimization\n\n| | Issue | Instances |\n| ---------------------- | ------------ | -------------- |\n| [GAS-1] | Cache array length outside of loop | 5 |\n| [GAS-2] | Don't initialize variables with default value | 8 |\n| [GAS-3] | Functions guaranteed to revert when called by normal users can be marked payable | 12 |\n| [GAS-4] | Double && operator more expensive than nested if loop | 2 |\n\n### [GAS-1] Cache array length outside of loop\n\nIf not cached, the solidity compiler will always read the length of the array during each iteration. That is, if it is a storage array, this is an extra sload operation (100 additional extra gas for each iteration except for the first) and if it is a memory array, this is an extra mload operation (3 additional gas for each iteration except for the first).\n\n*Instances (5)*:\n\n```\nFile: SourceBridge.sol\n\n for (uint256 i = 0; i < exCallData.length; ++i)\n\n```\n\n```\nFile: DesinationBridge.sol\n\n134 for (uint256 i = 0; i < thresholds.length; ++i)\n\n160 for (uint256 i = 0; i < t.approvers.length; ++i) \n\n264 for (uint256 i = 0; i < amounts.length; ++i)\n\n\n```\n\n```\nFile: rUSDYFactory.sol\n\n130 for (uint256 i = 0; i < exCallData.length; ++i)\n\n```\n\n### [GAS-2] Don't initialize variables with default value\n\n*Instances (8)*:\n\n```\nFile: SourceBridge.sol\n\n for (uint256 i = 0; i < exCallData.length; ++i)\n\n```\n\n```\nFile: DesinationBridge.sol\n\n134 for (uint256 i = 0; i < thresholds.length; ++i)\n\n160 for (uint256 i = 0; i < t.approvers.length; ++i) \n\n264 for (uint256 i = 0; i < amounts.length; ++i)\n\n\n```\n\n```\nFile: rUSDYFactory.sol\n\n130 for (uint256 i = 0; i < exCallData.length; ++i)\n\n```\n\n```\nFile: RWADynamicOracle.sol\n\n77 for (uint256 i = 0; i < length; ++i)\n\n113 for (uint256 i = 0; i < length; ++i)\n\n129 for (uint256 i = 0; i < length + 1; ++i)\n```\n\n### [GAS-3] Functions guaranteed to revert when called by normal users c", "vulnerable_code": "File: SourceBridge.sol\n\n for (uint256 i = 0; i < exCallData.length; ++i)\n", "fixed_code": "File: DesinationBridge.sol\n\n134 for (uint256 i = 0; i < thresholds.length; ++i)\n\n160 for (uint256 i = 0; i < t.approvers.length; ++i) \n\n264 for (uint256 i = 0; i < amounts.length; ++i)\n\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/jnrlouis-G.md", "collected_at": "2026-01-02T18:26:00.536186+00:00", "source_hash": "2c089c8fd9a0b279ecb6371663897c135d84fa995d6573a6ae02ee0ae7381a2e", "code_block_count": 7, "solidity_block_count": 0, "total_code_chars": 860, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: SourceBridge.sol\n\n for (uint256 i = 0; i < exCallData.length; ++i)", "primary_code_language": "unknown", "primary_code_char_count": 75, "all_code_blocks": "// Code block 1 (unknown):\nFile: SourceBridge.sol\n\n for (uint256 i = 0; i < exCallData.length; ++i)\n\n// Code block 2 (unknown):\nFile: DesinationBridge.sol\n\n134 for (uint256 i = 0; i < thresholds.length; ++i)\n\n160 for (uint256 i = 0; i < t.approvers.length; ++i) \n\n264 for (uint256 i = 0; i < amounts.length; ++i)\n\n// Code block 3 (unknown):\nFile: rUSDYFactory.sol\n\n130 for (uint256 i = 0; i < exCallData.length; ++i)\n\n// Code block 4 (unknown):\nFile: SourceBridge.sol\n\n for (uint256 i = 0; i < exCallData.length; ++i)\n\n// Code block 5 (unknown):\nFile: DesinationBridge.sol\n\n134 for (uint256 i = 0; i < thresholds.length; ++i)\n\n160 for (uint256 i = 0; i < t.approvers.length; ++i) \n\n264 for (uint256 i = 0; i < amounts.length; ++i)\n\n// Code block 6 (unknown):\nFile: rUSDYFactory.sol\n\n130 for (uint256 i = 0; i < exCallData.length; ++i)\n\n// Code block 7 (unknown):\nFile: RWADynamicOracle.sol\n\n77 for (uint256 i = 0; i < length; ++i)\n\n113 for (uint256 i = 0; i < length; ++i)\n\n129 for (uint256 i = 0; i < length + 1; ++i)", "all_code_blocks_count": 7, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: SourceBridge.sol\n\n for (uint256 i = 0; i < exCallData.length; ++i)\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: DesinationBridge.sol\n\n134 for (uint256 i = 0; i < thresholds.length; ++i)\n\n160 for (uint256 i = 0; i < t.approvers.length; ++i) \n\n264 for (uint256 i = 0; i < amounts.length; ++i)\n\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 12} {"source": "c4", "protocol": "05-ajna", "title": "ayden Q", "severity_raw": "Medium", "severity": "medium", "description": "1.The initial value of rewards is 0, so there is no need to use the += operator. We can simply use the = operator to assign the value\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/RewardsManager.sol#L801\n\n```solidity\n // skip reward calculation if update at the previous epoch was missed and if exchange rate decreased due to bad debt\n // prevents excess rewards from being provided from using a 0 value as an input to the interestFactor calculation below.\n if (prevBucketExchangeRate != 0 && prevBucketExchangeRate < curBucketExchangeRate) {\n\n // retrieve current deposit of the bucket\n (, , , uint256 bucketDeposit, ) = IPool(pool_).bucketInfo(bucketIndex_);\n\n uint256 burnFactor = Maths.wmul(totalBurned_, bucketDeposit);\n uint256 interestFactor = interestEarned_ == 0 ? 0 : Maths.wdiv(\n Maths.WAD - Maths.wdiv(prevBucketExchangeRate, curBucketExchangeRate),\n interestEarned_\n );\n\n // calculate rewards earned for updating bucket exchange rate\n- rewards_ += Maths.wmul(UPDATE_CLAIM_REWARD, Maths.wmul(burnFactor, interestFactor));\n+ rewards_ = Maths.wmul(UPDATE_CLAIM_REWARD, Maths.wmul(burnFactor, interestFactor));\n }\n```\n\n2.In the case where there is already a lastClaimedEpoch, setting up a separate mapping to track whether the epochToClaim* parameter has been claimed seems redundant. I believe it is sufficient to check whether epochToClaim* is greater than lastClaimedEpoch.\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/RewardsManager.sol#L114#L125\n\n```solidity\n function claimRewards(\n uint256 tokenId_,\n uint256 epochToClaim_\n ) external override {\n StakeInfo storage stakeInfo = stakes[tokenId_];\n\n if (msg.sender != stakeInfo.owner) revert NotOwnerOfDeposit();\n\n_ if (isEpochClaimed[tokenId_][epochToClaim_]) revert AlreadyClaimed();\n\n+ if (epochToClaim_ <= stakeInfo.lastClaimedEpoch) revert AlreadyCla", "vulnerable_code": " // skip reward calculation if update at the previous epoch was missed and if exchange rate decreased due to bad debt\n // prevents excess rewards from being provided from using a 0 value as an input to the interestFactor calculation below.\n if (prevBucketExchangeRate != 0 && prevBucketExchangeRate < curBucketExchangeRate) {\n\n // retrieve current deposit of the bucket\n (, , , uint256 bucketDeposit, ) = IPool(pool_).bucketInfo(bucketIndex_);\n\n uint256 burnFactor = Maths.wmul(totalBurned_, bucketDeposit);\n uint256 interestFactor = interestEarned_ == 0 ? 0 : Maths.wdiv(\n Maths.WAD - Maths.wdiv(prevBucketExchangeRate, curBucketExchangeRate),\n interestEarned_\n );\n\n // calculate rewards earned for updating bucket exchange rate\n- rewards_ += Maths.wmul(UPDATE_CLAIM_REWARD, Maths.wmul(burnFactor, interestFactor));\n+ rewards_ = Maths.wmul(UPDATE_CLAIM_REWARD, Maths.wmul(burnFactor, interestFactor));\n }", "fixed_code": " function claimRewards(\n uint256 tokenId_,\n uint256 epochToClaim_\n ) external override {\n StakeInfo storage stakeInfo = stakes[tokenId_];\n\n if (msg.sender != stakeInfo.owner) revert NotOwnerOfDeposit();\n\n_ if (isEpochClaimed[tokenId_][epochToClaim_]) revert AlreadyClaimed();\n\n+ if (epochToClaim_ <= stakeInfo.lastClaimedEpoch) revert AlreadyClaimed();\n\n _claimRewards(stakeInfo, tokenId_, epochToClaim_, true, stakeInfo.ajnaPool);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/ayden-Q.md", "collected_at": "2026-01-02T18:21:21.582044+00:00", "source_hash": "2c3357d8b3b1b6bd4eb974557f017a5af8e2566d860110b8ce9e5bd9d19f0d37", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 994, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "// skip reward calculation if update at the previous epoch was missed and if exchange rate decreased due to bad debt\n // prevents excess rewards from being provided from using a 0 value as an input to the interestFactor calculation below.\n if (prevBucketExchangeRate != 0 && prevBucketExchangeRate < curBucketExchangeRate) {\n\n // retrieve current deposit of the bucket\n (, , , uint256 bucketDeposit, ) = IPool(pool_).bucketInfo(bucketIndex_);\n\n uint256 burnFactor = Maths.wmul(totalBurned_, bucketDeposit);\n uint256 interestFactor = interestEarned_ == 0 ? 0 : Maths.wdiv(\n Maths.WAD - Maths.wdiv(prevBucketExchangeRate, curBucketExchangeRate),\n interestEarned_\n );\n\n // calculate rewards earned for updating bucket exchange rate\n- rewards_ += Maths.wmul(UPDATE_CLAIM_REWARD, Maths.wmul(burnFactor, interestFactor));\n+ rewards_ = Maths.wmul(UPDATE_CLAIM_REWARD, Maths.wmul(burnFactor, interestFactor));\n }", "primary_code_language": "solidity", "primary_code_char_count": 994, "all_code_blocks": "// Code block 1 (solidity):\n// skip reward calculation if update at the previous epoch was missed and if exchange rate decreased due to bad debt\n // prevents excess rewards from being provided from using a 0 value as an input to the interestFactor calculation below.\n if (prevBucketExchangeRate != 0 && prevBucketExchangeRate < curBucketExchangeRate) {\n\n // retrieve current deposit of the bucket\n (, , , uint256 bucketDeposit, ) = IPool(pool_).bucketInfo(bucketIndex_);\n\n uint256 burnFactor = Maths.wmul(totalBurned_, bucketDeposit);\n uint256 interestFactor = interestEarned_ == 0 ? 0 : Maths.wdiv(\n Maths.WAD - Maths.wdiv(prevBucketExchangeRate, curBucketExchangeRate),\n interestEarned_\n );\n\n // calculate rewards earned for updating bucket exchange rate\n- rewards_ += Maths.wmul(UPDATE_CLAIM_REWARD, Maths.wmul(burnFactor, interestFactor));\n+ rewards_ = Maths.wmul(UPDATE_CLAIM_REWARD, Maths.wmul(burnFactor, interestFactor));\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "// skip reward calculation if update at the previous epoch was missed and if exchange rate decreased due to bad debt\n // prevents excess rewards from being provided from using a 0 value as an input to the interestFactor calculation below.\n if (prevBucketExchangeRate != 0 && prevBucketExchangeRate < curBucketExchangeRate) {\n\n // retrieve current deposit of the bucket\n (, , , uint256 bucketDeposit, ) = IPool(pool_).bucketInfo(bucketIndex_);\n\n uint256 burnFactor = Maths.wmul(totalBurned_, bucketDeposit);\n uint256 interestFactor = interestEarned_ == 0 ? 0 : Maths.wdiv(\n Maths.WAD - Maths.wdiv(prevBucketExchangeRate, curBucketExchangeRate),\n interestEarned_\n );\n\n // calculate rewards earned for updating bucket exchange rate\n- rewards_ += Maths.wmul(UPDATE_CLAIM_REWARD, Maths.wmul(burnFactor, interestFactor));\n+ rewards_ = Maths.wmul(UPDATE_CLAIM_REWARD, Maths.wmul(burnFactor, interestFactor));\n }", "github_refs_formatted": "RewardsManager.sol#L801, RewardsManager.sol#L114", "github_files_list": "RewardsManager.sol", "github_refs_count": 2, "vulnerable_code_actual": " // skip reward calculation if update at the previous epoch was missed and if exchange rate decreased due to bad debt\n // prevents excess rewards from being provided from using a 0 value as an input to the interestFactor calculation below.\n if (prevBucketExchangeRate != 0 && prevBucketExchangeRate < curBucketExchangeRate) {\n\n // retrieve current deposit of the bucket\n (, , , uint256 bucketDeposit, ) = IPool(pool_).bucketInfo(bucketIndex_);\n\n uint256 burnFactor = Maths.wmul(totalBurned_, bucketDeposit);\n uint256 interestFactor = interestEarned_ == 0 ? 0 : Maths.wdiv(\n Maths.WAD - Maths.wdiv(prevBucketExchangeRate, curBucketExchangeRate),\n interestEarned_\n );\n\n // calculate rewards earned for updating bucket exchange rate\n- rewards_ += Maths.wmul(UPDATE_CLAIM_REWARD, Maths.wmul(burnFactor, interestFactor));\n+ rewards_ = Maths.wmul(UPDATE_CLAIM_REWARD, Maths.wmul(burnFactor, interestFactor));\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function claimRewards(\n uint256 tokenId_,\n uint256 epochToClaim_\n ) external override {\n StakeInfo storage stakeInfo = stakes[tokenId_];\n\n if (msg.sender != stakeInfo.owner) revert NotOwnerOfDeposit();\n\n_ if (isEpochClaimed[tokenId_][epochToClaim_]) revert AlreadyClaimed();\n\n+ if (epochToClaim_ <= stakeInfo.lastClaimedEpoch) revert AlreadyClaimed();\n\n _claimRewards(stakeInfo, tokenId_, epochToClaim_, true, stakeInfo.ajnaPool);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "11-kelp", "title": "kerdakov Q", "severity_raw": "Low", "severity": "low", "description": "The use of `unchecked` in the for loop in [NodeDelegator](https://github.com/code-423n4/2023-11-kelp/blob/c5fdc2e62c5e1d78769f44d6e34a6fb9e40c00f0/src/NodeDelegator.sol#L109C8-L115C10) seems unnecessary and could potentially lead to unintended consequences. The loop itself doesn't involve arithmetic operations that could overflow or underflow, so using `unchecked` here is unnecessary.\n\n```\nfor (uint256 i = 0; i < strategiesLength;) {\n assets[i] = address(IStrategy(strategies[i]).underlyingToken());\n assetBalances[i] = IStrategy(strategies[i]).userUnderlyingView(address(this));\n unchecked {\n ++i;\n }\n}\n```\n\nIn fact, it's more common and safer to use a standard for loop without unchecked:\n\n```\nfor (uint256 i = 0; i < strategiesLength; i++) {\n assets[i] = address(IStrategy(strategies[i]).underlyingToken());\n assetBalances[i] = IStrategy(strategies[i]).userUnderlyingView(address(this));\n}\n```", "vulnerable_code": "for (uint256 i = 0; i < strategiesLength;) {\n assets[i] = address(IStrategy(strategies[i]).underlyingToken());\n assetBalances[i] = IStrategy(strategies[i]).userUnderlyingView(address(this));\n unchecked {\n ++i;\n }\n}", "fixed_code": "for (uint256 i = 0; i < strategiesLength; i++) {\n assets[i] = address(IStrategy(strategies[i]).underlyingToken());\n assetBalances[i] = IStrategy(strategies[i]).userUnderlyingView(address(this));\n}", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/kerdakov-Q.md", "collected_at": "2026-01-02T18:28:11.798257+00:00", "source_hash": "2cdc1008d7986ce57bbb337942783ebe9b18cb04452e7c902fbd722099ba5453", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 435, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "for (uint256 i = 0; i < strategiesLength;) {\n assets[i] = address(IStrategy(strategies[i]).underlyingToken());\n assetBalances[i] = IStrategy(strategies[i]).userUnderlyingView(address(this));\n unchecked {\n ++i;\n }\n}", "primary_code_language": "unknown", "primary_code_char_count": 233, "all_code_blocks": "// Code block 1 (unknown):\nfor (uint256 i = 0; i < strategiesLength;) {\n assets[i] = address(IStrategy(strategies[i]).underlyingToken());\n assetBalances[i] = IStrategy(strategies[i]).userUnderlyingView(address(this));\n unchecked {\n ++i;\n }\n}\n\n// Code block 2 (unknown):\nfor (uint256 i = 0; i < strategiesLength; i++) {\n assets[i] = address(IStrategy(strategies[i]).underlyingToken());\n assetBalances[i] = IStrategy(strategies[i]).userUnderlyingView(address(this));\n}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "NodeDelegator.sol#L109-L8", "github_files_list": "NodeDelegator.sol", "github_refs_count": 1, "vulnerable_code_actual": "for (uint256 i = 0; i < strategiesLength;) {\n assets[i] = address(IStrategy(strategies[i]).underlyingToken());\n assetBalances[i] = IStrategy(strategies[i]).userUnderlyingView(address(this));\n unchecked {\n ++i;\n }\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "for (uint256 i = 0; i < strategiesLength; i++) {\n assets[i] = address(IStrategy(strategies[i]).underlyingToken());\n assetBalances[i] = IStrategy(strategies[i]).userUnderlyingView(address(this));\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6.85} {"source": "c4", "protocol": "06-lybra", "title": "mahyar G", "severity_raw": "Low", "severity": "low", "description": "## Caching in local variable\n\nSolidity by default checks underflow/overflow when doing any calculation, this uses some gas and calculating same values multiple times is not good approach. In [ProtocolRewardsPool](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/ProtocolRewardsPool.sol#L190) inside `getReward()` function `reward - eUSDShare` is used multiple times. It should be cached in local variable and use the variable insted of calculate it multiple times.\n\n## Using `constant` variables\n\nIn [esLBR](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/token/esLBR.sol#L20) and [LBR](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/token/LBR.sol#L15) contracts `maxSupply` variable should be changed to `constant` variable since its value is not changing in the code, this can reduce gas costs.\n\n## Using `immutable` variables\n\nThese variables can be changed to `immutable` since their value its not changing after initialization\n\n1. [Line 50](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/configuration/LybraConfigurator.sol#L50) in LybraConfigurator contract\n\n2. [Line 55](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/EUSDMiningIncentives.sol#L55) in EUSDMiningIncentives contract\n\n3. [Line 11](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/governance/LybraGovernance.sol#L11C19-L11C24) and [Line 12](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/governance/LybraGovernance.sol#L12) in LybraGovernance contract\n\n## Using ternary operator insted of if statement\n\nUsing ternary operator can reduce deployment size and deployment costs\n\n1. [Line 301](https://github.com/co", "vulnerable_code": "return totalMintedEUSD == 0 ? 0 : _EUSDAmount.mul(_totalShares).div(totalMintedEUSD);", "fixed_code": "return _totalShares == 0 ? 0 : _sharesAmount.mul(_totalSupply).div(_totalShares);", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/mahyar-G.md", "collected_at": "2026-01-02T18:23:07.783971+00:00", "source_hash": "2d15b44ed734eb862175170c16008a63a91ade3b46bbaa9464aaccd8669c1e4c", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 7, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ProtocolRewardsPool.sol#L190, esLBR.sol#L20, LBR.sol#L15, LybraConfigurator.sol#L50, EUSDMiningIncentives.sol#L55, LybraGovernance.sol#L11-L19, LybraGovernance.sol#L12", "github_files_list": "EUSDMiningIncentives.sol, LybraConfigurator.sol, ProtocolRewardsPool.sol, esLBR.sol, LBR.sol, LybraGovernance.sol", "github_refs_count": 7, "vulnerable_code_actual": "return totalMintedEUSD == 0 ? 0 : _EUSDAmount.mul(_totalShares).div(totalMintedEUSD);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "return _totalShares == 0 ? 0 : _sharesAmount.mul(_totalSupply).div(_totalShares);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-ondo", "title": "Bnke0x0 G", "severity_raw": "High", "severity": "high", "description": "\n\n### [G01] State variables only set in the constructor should be declared `immutable`\n\n#### Impact\nAvoids a Gusset (20000 gas)\n#### Findings:\n```\n\n2023-01-ondo/contracts/cash/CashManager.sol::47 => address public assetRecipient;\n2023-01-ondo/contracts/cash/CashManager.sol::50 => address public feeRecipient;\n2023-01-ondo/contracts/cash/CashManager.sol::53 => address public assetSender;\n2023-01-ondo/contracts/cash/CashManager.sol::97 => uint256 public currentEpoch;\n2023-01-ondo/contracts/cash/CashManager.sol::100 => uint256 public epochDuration;\n2023-01-ondo/contracts/cash/CashManager.sol::103 => uint256 public currentEpochStartTimestamp;\n2023-01-ondo/contracts/cash/CashManager.sol::110 => uint256 public mintLimit;\n2023-01-ondo/contracts/cash/CashManager.sol::113 => uint256 public currentMintAmount;\n2023-01-ondo/contracts/cash/CashManager.sol::116 => uint256 public redeemLimit;\n2023-01-ondo/contracts/cash/CashManager.sol::119 => uint256 public currentRedeemAmount;\n2023-01-ondo/contracts/cash/factory/CashFactory.sol::49 => Cash public cashImplementation;\n2023-01-ondo/contracts/cash/factory/CashFactory.sol::50 => ProxyAdmin public cashProxyAdmin;\n2023-01-ondo/contracts/cash/factory/CashFactory.sol::51 => TokenProxy public cashProxy;\n2023-01-ondo/contracts/cash/factory/CashKYCSenderFactory.sol::49 => CashKYCSender public cashKYCSenderImplementation;\n2023-01-ondo/contracts/cash/factory/CashKYCSenderFactory.sol::50 => ProxyAdmin public cashKYCSenderProxyAdmin;\n2023-01-ondo/contracts/cash/factory/CashKYCSenderFactory.sol::51 => TokenProxy public cashKYCSenderProxy;\n2023-01-ondo/contracts/cash/factory/CashKYCSenderReceiverFactory.sol::49 => CashKYCSenderReceiver public cashKYCSenderReceiverImplementation;\n2023-01-ondo/contracts/cash/factory/CashKYCSenderReceiverFactory.sol::50 => ProxyAdmin public cashKYCSenderReceiverProxyAdmin;\n2023-01-ondo/contracts/cash/factory/CashKYCSenderReceiverFactory.sol::51 => TokenProxy public cashKYCSenderReceiverProxy;\n2023-01-ondo/contracts/c", "vulnerable_code": "2023-01-ondo/contracts/cash/CashManager.sol::47 => address public assetRecipient;\n2023-01-ondo/contracts/cash/CashManager.sol::50 => address public feeRecipient;\n2023-01-ondo/contracts/cash/CashManager.sol::53 => address public assetSender;\n2023-01-ondo/contracts/cash/CashManager.sol::97 => uint256 public currentEpoch;\n2023-01-ondo/contracts/cash/CashManager.sol::100 => uint256 public epochDuration;\n2023-01-ondo/contracts/cash/CashManager.sol::103 => uint256 public currentEpochStartTimestamp;\n2023-01-ondo/contracts/cash/CashManager.sol::110 => uint256 public mintLimit;\n2023-01-ondo/contracts/cash/CashManager.sol::113 => uint256 public currentMintAmount;\n2023-01-ondo/contracts/cash/CashManager.sol::116 => uint256 public redeemLimit;\n2023-01-ondo/contracts/cash/CashManager.sol::119 => uint256 public currentRedeemAmount;\n2023-01-ondo/contracts/cash/factory/CashFactory.sol::49 => Cash public cashImplementation;\n2023-01-ondo/contracts/cash/factory/CashFactory.sol::50 => ProxyAdmin public cashProxyAdmin;\n2023-01-ondo/contracts/cash/factory/CashFactory.sol::51 => TokenProxy public cashProxy;\n2023-01-ondo/contracts/cash/factory/CashKYCSenderFactory.sol::49 => CashKYCSender public cashKYCSenderImplementation;\n2023-01-ondo/contracts/cash/factory/CashKYCSenderFactory.sol::50 => ProxyAdmin public cashKYCSenderProxyAdmin;\n2023-01-ondo/contracts/cash/factory/CashKYCSenderFactory.sol::51 => TokenProxy public cashKYCSenderProxy;\n2023-01-ondo/contracts/cash/factory/CashKYCSenderReceiverFactory.sol::49 => CashKYCSenderReceiver public cashKYCSenderReceiverImplementation;\n2023-01-ondo/contracts/cash/factory/CashKYCSenderReceiverFactory.sol::50 => ProxyAdmin public cashKYCSenderReceiverProxyAdmin;\n2023-01-ondo/contracts/cash/factory/CashKYCSenderReceiverFactory.sol::51 => TokenProxy public cashKYCSenderReceiverProxy;\n2023-01-ondo/contracts/cash/kyc/KYCRegistryClient.sol::30 => IKYCRegistry public override kycRegistry;\n2023-01-ondo/contracts/cash/kyc/KYCRegistryClient.sol::32 => uint256 ", "fixed_code": "2023-01-ondo/contracts/cash/CashManager.sol::47 => address public assetRecipient;\n2023-01-ondo/contracts/cash/CashManager.sol::50 => address public feeRecipient;\n2023-01-ondo/contracts/cash/CashManager.sol::53 => address public assetSender;\n2023-01-ondo/contracts/lending/JumpRateModelV2.sol::24 => address public owner;\n2023-01-ondo/contracts/lending/tokens/cCash/CTokenInterfacesModifiedCash.sol::387 => address public underlying;\n2023-01-ondo/contracts/lending/tokens/cCash/CTokenInterfacesModifiedCash.sol::425 => address public implementation;\n2023-01-ondo/contracts/lending/tokens/cErc20ModifiedDelegator.sol::573 => address public underlying;\n2023-01-ondo/contracts/lending/tokens/cErc20ModifiedDelegator.sol::609 => address public implementation;\n2023-01-ondo/contracts/lending/tokens/cToken/CTokenInterfacesModified.sol::385 => address public underlying;\n2023-01-ondo/contracts/lending/tokens/cToken/CTokenInterfacesModified.sol::423 => address public implementation;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/Bnke0x0-G.md", "collected_at": "2026-01-02T18:14:31.968371+00:00", "source_hash": "2d1c7601a6b7b1d87cf8f05dbff4f5da9d31ae57420c0a9cf9f66c2660566db2", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "2023-01-ondo/contracts/cash/CashManager.sol::47 => address public assetRecipient;\n2023-01-ondo/contracts/cash/CashManager.sol::50 => address public feeRecipient;\n2023-01-ondo/contracts/cash/CashManager.sol::53 => address public assetSender;\n2023-01-ondo/contracts/cash/CashManager.sol::97 => uint256 public currentEpoch;\n2023-01-ondo/contracts/cash/CashManager.sol::100 => uint256 public epochDuration;\n2023-01-ondo/contracts/cash/CashManager.sol::103 => uint256 public currentEpochStartTimestamp;\n2023-01-ondo/contracts/cash/CashManager.sol::110 => uint256 public mintLimit;\n2023-01-ondo/contracts/cash/CashManager.sol::113 => uint256 public currentMintAmount;\n2023-01-ondo/contracts/cash/CashManager.sol::116 => uint256 public redeemLimit;\n2023-01-ondo/contracts/cash/CashManager.sol::119 => uint256 public currentRedeemAmount;\n2023-01-ondo/contracts/cash/factory/CashFactory.sol::49 => Cash public cashImplementation;\n2023-01-ondo/contracts/cash/factory/CashFactory.sol::50 => ProxyAdmin public cashProxyAdmin;\n2023-01-ondo/contracts/cash/factory/CashFactory.sol::51 => TokenProxy public cashProxy;\n2023-01-ondo/contracts/cash/factory/CashKYCSenderFactory.sol::49 => CashKYCSender public cashKYCSenderImplementation;\n2023-01-ondo/contracts/cash/factory/CashKYCSenderFactory.sol::50 => ProxyAdmin public cashKYCSenderProxyAdmin;\n2023-01-ondo/contracts/cash/factory/CashKYCSenderFactory.sol::51 => TokenProxy public cashKYCSenderProxy;\n2023-01-ondo/contracts/cash/factory/CashKYCSenderReceiverFactory.sol::49 => CashKYCSenderReceiver public cashKYCSenderReceiverImplementation;\n2023-01-ondo/contracts/cash/factory/CashKYCSenderReceiverFactory.sol::50 => ProxyAdmin public cashKYCSenderReceiverProxyAdmin;\n2023-01-ondo/contracts/cash/factory/CashKYCSenderReceiverFactory.sol::51 => TokenProxy public cashKYCSenderReceiverProxy;\n2023-01-ondo/contracts/cash/kyc/KYCRegistryClient.sol::30 => IKYCRegistry public override kycRegistry;\n2023-01-ondo/contracts/cash/kyc/KYCRegistryClient.sol::32 => uint256 ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "2023-01-ondo/contracts/cash/CashManager.sol::47 => address public assetRecipient;\n2023-01-ondo/contracts/cash/CashManager.sol::50 => address public feeRecipient;\n2023-01-ondo/contracts/cash/CashManager.sol::53 => address public assetSender;\n2023-01-ondo/contracts/lending/JumpRateModelV2.sol::24 => address public owner;\n2023-01-ondo/contracts/lending/tokens/cCash/CTokenInterfacesModifiedCash.sol::387 => address public underlying;\n2023-01-ondo/contracts/lending/tokens/cCash/CTokenInterfacesModifiedCash.sol::425 => address public implementation;\n2023-01-ondo/contracts/lending/tokens/cErc20ModifiedDelegator.sol::573 => address public underlying;\n2023-01-ondo/contracts/lending/tokens/cErc20ModifiedDelegator.sol::609 => address public implementation;\n2023-01-ondo/contracts/lending/tokens/cToken/CTokenInterfacesModified.sol::385 => address public underlying;\n2023-01-ondo/contracts/lending/tokens/cToken/CTokenInterfacesModified.sol::423 => address public implementation;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "06-lybra", "title": "ayo_dev G", "severity_raw": "Medium", "severity": "medium", "description": "### 1. Use Uint256 to store Constants instead of Bytes32\nInstead of using a bytes32 to store keccack256 hash as state variable, we can instead use a uint256 to store the state variables examples can be found in solady contract https://github.com/Vectorized/solady/blob/8c751db06e614e26e6acb9b385b463feef5e3a9f/src/tokens/ERC20.sol#L51 \n```\ncontract test {//deployment cost 113364 gas, \n uint256 public constant _TRANSFER_EVENT_SIGNATURE =\n 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef; //\n}\n\ncontract test {//deployment cost 121071 gas, \n bytes32 public constant _TRANSFER_EVENT_SIGNATURE =\n keccak256(bytes(\"Transfer(address,address,uint256)\"));\n}\n```\none reason this might be is because i think solidity use extra operations to check whether the bytes are valid bytes but does not do this for uint256 \nNOTE: uint256 is equal to bytes32 they both contain 32 bytes and can be typecasted and vice versa\nan example of this problem can be found in the `LybraConfigurator` contract\n\nInstances in the code:\nhttps://github.com/code-423n4/2023-06-lybra/blob/5d70170f2c68dbd3f7b8c0c8fd6b0b2218784ea6/contracts/lybra/configuration/LybraConfigurator.sol#L76\nhttps://github.com/code-423n4/2023-06-lybra/blob/5d70170f2c68dbd3f7b8c0c8fd6b0b2218784ea6/contracts/lybra/configuration/LybraConfigurator.sol#L77\nhttps://github.com/code-423n4/2023-06-lybra/blob/5d70170f2c68dbd3f7b8c0c8fd6b0b2218784ea6/contracts/lybra/configuration/LybraConfigurator.sol#L78\nhttps://github.com/code-423n4/2023-06-lybra/blob/5d70170f2c68dbd3f7b8c0c8fd6b0b2218784ea6/contracts/lybra/governance/GovernanceTimelock.sol#L10\nhttps://github.com/code-423n4/2023-06-lybra/blob/5d70170f2c68dbd3f7b8c0c8fd6b0b2218784ea6/contracts/lybra/governance/GovernanceTimelock.sol#L11\n\n\n### 2. Change The Visibility of the Bytes32 constant to private from public\nThere's no reason to use public on bytes32 constant variable, when you use public for a function solidity creates a getter for that variable similar to ", "vulnerable_code": "contract test {//deployment cost 113364 gas, \n uint256 public constant _TRANSFER_EVENT_SIGNATURE =\n 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef; //\n}\n\ncontract test {//deployment cost 121071 gas, \n bytes32 public constant _TRANSFER_EVENT_SIGNATURE =\n keccak256(bytes(\"Transfer(address,address,uint256)\"));\n}", "fixed_code": "contract test { //Deployment cost: 77126 gas\n bytes32 private constant _TRANSFER_EVENT_SIGNATURE =\n keccak256(bytes(\"Transfer(address,address,uint256)\"));\n}\n\ncontract test { //Deployment cost: 121071 gas\n bytes32 public constant _TRANSFER_EVENT_SIGNATURE =\n keccak256(bytes(\"Transfer(address,address,uint256)\"));\n}", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/ayo_dev-G.md", "collected_at": "2026-01-02T18:22:51.672775+00:00", "source_hash": "2d896efad034b77831c5ffa17a7f7252249567810a1edc9bcf6430add1009ea0", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 350, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "contract test {//deployment cost 113364 gas, \n uint256 public constant _TRANSFER_EVENT_SIGNATURE =\n 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef; //\n}\n\ncontract test {//deployment cost 121071 gas, \n bytes32 public constant _TRANSFER_EVENT_SIGNATURE =\n keccak256(bytes(\"Transfer(address,address,uint256)\"));\n}", "primary_code_language": "unknown", "primary_code_char_count": 350, "all_code_blocks": "// Code block 1 (unknown):\ncontract test {//deployment cost 113364 gas, \n uint256 public constant _TRANSFER_EVENT_SIGNATURE =\n 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef; //\n}\n\ncontract test {//deployment cost 121071 gas, \n bytes32 public constant _TRANSFER_EVENT_SIGNATURE =\n keccak256(bytes(\"Transfer(address,address,uint256)\"));\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ERC20.sol#L51, LybraConfigurator.sol#L76, LybraConfigurator.sol#L77, LybraConfigurator.sol#L78, GovernanceTimelock.sol#L10, GovernanceTimelock.sol#L11", "github_files_list": "ERC20.sol, LybraConfigurator.sol, GovernanceTimelock.sol", "github_refs_count": 6, "vulnerable_code_actual": "contract test {//deployment cost 113364 gas, \n uint256 public constant _TRANSFER_EVENT_SIGNATURE =\n 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef; //\n}\n\ncontract test {//deployment cost 121071 gas, \n bytes32 public constant _TRANSFER_EVENT_SIGNATURE =\n keccak256(bytes(\"Transfer(address,address,uint256)\"));\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "contract test { //Deployment cost: 77126 gas\n bytes32 private constant _TRANSFER_EVENT_SIGNATURE =\n keccak256(bytes(\"Transfer(address,address,uint256)\"));\n}\n\ncontract test { //Deployment cost: 121071 gas\n bytes32 public constant _TRANSFER_EVENT_SIGNATURE =\n keccak256(bytes(\"Transfer(address,address,uint256)\"));\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "05-ajna", "title": "Kenshin Q", "severity_raw": "Critical", "severity": "critical", "description": "# Low/QA\n## Summary\n| **Risk** | **Number of findings** |\n| :---: | :---: |\n| Low | 2 |\n| Non Critical | 1 |\n\n## Low Risk Issues\n| **#** | **Findings** | **Instances** |\n| :---: | :--- | :---: |\n| [L-01](#l-01-executeextraordinary-could-be-prevented-by-startnewdistributionperiodL-01-executeExtraordinary-could-be-prevented-by-startNewDistributionPeriod) | `executeExtraordinary()` could be prevented by `startNewDistributionPeriod()` | 2 |\n| [L-02](#l-02-multiple-functions-can-have-the-same-signature) | Multiple functions can have the same signature | 1 |\n\n---\n\n### L-01 `executeExtraordinary()` could be prevented by `startNewDistributionPeriod()`\n#### Permalinks\n**Number of instances:** `2`\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/ExtraordinaryFunding.sol#L226\n```solidity\nFile: ajna-grants/src/grants/base/ExtraordinaryFunding.sol\n\n222: function _getSliceOfNonTreasury(\n223: uint256 percentage_\n224: ) internal view returns (uint256) {\n225: uint256 totalAjnaSupply = IERC20(ajnaTokenAddress).totalSupply();\n // @audit treasury can be decreased from `startNewDistributionPeriod()`\n226: return Maths.wmul(totalAjnaSupply - treasury, percentage_);\n227: }\n```\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/ExtraordinaryFunding.sol#L237\n```solidity\nFile: ajna-grants/src/grants/base/ExtraordinaryFunding.sol\n\n234: function _getSliceOfTreasury(\n235: uint256 percentage_\n236: ) internal view returns (uint256) {\n // @audit treasury can be decreased from `startNewDistributionPeriod()`\n237: return Maths.wmul(treasury, percentage_);\n238: }\n```\n\n#### Description\nUpon executing an extraordinary proposal, [2 conditions must be met](https://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/", "vulnerable_code": "File: ajna-grants/src/grants/base/ExtraordinaryFunding.sol\n\n222: function _getSliceOfNonTreasury(\n223: uint256 percentage_\n224: ) internal view returns (uint256) {\n225: uint256 totalAjnaSupply = IERC20(ajnaTokenAddress).totalSupply();\n // @audit treasury can be decreased from `startNewDistributionPeriod()`\n226: return Maths.wmul(totalAjnaSupply - treasury, percentage_);\n227: }", "fixed_code": "File: ajna-grants/src/grants/base/ExtraordinaryFunding.sol\n\n234: function _getSliceOfTreasury(\n235: uint256 percentage_\n236: ) internal view returns (uint256) {\n // @audit treasury can be decreased from `startNewDistributionPeriod()`\n237: return Maths.wmul(treasury, percentage_);\n238: }", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/Kenshin-Q.md", "collected_at": "2026-01-02T18:21:03.231548+00:00", "source_hash": "2dcbad0802121bac5094a580d3f034bf23e382b105272ba4fcba3b615b930dc9", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 741, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: ajna-grants/src/grants/base/ExtraordinaryFunding.sol\n\n222: function _getSliceOfNonTreasury(\n223: uint256 percentage_\n224: ) internal view returns (uint256) {\n225: uint256 totalAjnaSupply = IERC20(ajnaTokenAddress).totalSupply();\n // @audit treasury can be decreased from `startNewDistributionPeriod()`\n226: return Maths.wmul(totalAjnaSupply - treasury, percentage_);\n227: }", "primary_code_language": "solidity", "primary_code_char_count": 420, "all_code_blocks": "// Code block 1 (solidity):\nFile: ajna-grants/src/grants/base/ExtraordinaryFunding.sol\n\n222: function _getSliceOfNonTreasury(\n223: uint256 percentage_\n224: ) internal view returns (uint256) {\n225: uint256 totalAjnaSupply = IERC20(ajnaTokenAddress).totalSupply();\n // @audit treasury can be decreased from `startNewDistributionPeriod()`\n226: return Maths.wmul(totalAjnaSupply - treasury, percentage_);\n227: }\n\n// Code block 2 (solidity):\nFile: ajna-grants/src/grants/base/ExtraordinaryFunding.sol\n\n234: function _getSliceOfTreasury(\n235: uint256 percentage_\n236: ) internal view returns (uint256) {\n // @audit treasury can be decreased from `startNewDistributionPeriod()`\n237: return Maths.wmul(treasury, percentage_);\n238: }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: ajna-grants/src/grants/base/ExtraordinaryFunding.sol\n\n222: function _getSliceOfNonTreasury(\n223: uint256 percentage_\n224: ) internal view returns (uint256) {\n225: uint256 totalAjnaSupply = IERC20(ajnaTokenAddress).totalSupply();\n // @audit treasury can be decreased from `startNewDistributionPeriod()`\n226: return Maths.wmul(totalAjnaSupply - treasury, percentage_);\n227: }\n\nFile: ajna-grants/src/grants/base/ExtraordinaryFunding.sol\n\n234: function _getSliceOfTreasury(\n235: uint256 percentage_\n236: ) internal view returns (uint256) {\n // @audit treasury can be decreased from `startNewDistributionPeriod()`\n237: return Maths.wmul(treasury, percentage_);\n238: }", "github_refs_formatted": "ExtraordinaryFunding.sol#L226, ExtraordinaryFunding.sol#L237", "github_files_list": "ExtraordinaryFunding.sol", "github_refs_count": 2, "vulnerable_code_actual": "File: ajna-grants/src/grants/base/ExtraordinaryFunding.sol\n\n222: function _getSliceOfNonTreasury(\n223: uint256 percentage_\n224: ) internal view returns (uint256) {\n225: uint256 totalAjnaSupply = IERC20(ajnaTokenAddress).totalSupply();\n // @audit treasury can be decreased from `startNewDistributionPeriod()`\n226: return Maths.wmul(totalAjnaSupply - treasury, percentage_);\n227: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: ajna-grants/src/grants/base/ExtraordinaryFunding.sol\n\n234: function _getSliceOfTreasury(\n235: uint256 percentage_\n236: ) internal view returns (uint256) {\n // @audit treasury can be decreased from `startNewDistributionPeriod()`\n237: return Maths.wmul(treasury, percentage_);\n238: }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "11-kelp", "title": "Sathish9098 Analysis", "severity_raw": "Critical", "severity": "critical", "description": "# Analysis- Kelp DAO\n\n## Overiew\nA collective DAO designed to unlock liquidity, DeFi and higher rewards for restaked assets through liquid restaking.\n\n#### LRTConfig\nThis contract is used to manage the configuration of the LRT (Lido Rocket Pool) protocol. It stores the addresses of the core contracts, the list of supported assets, and the deposit limits for each asset. It also provides functions for adding new supported assets, updating deposit limits, and updating asset strategies.\n\n#### LRTDepositPool\nThis contract is used to manage the deposit pool for Lido Rocket Pool (LRT) tokens. It allows users to deposit LST tokens and mint rETH tokens in exchange. It also allows the LRT admin to add new node delegator contracts and transfer assets to them. The contract can be paused or unpaused by the LRT admin.\n\n#### NodeDelegator\nThe NodeDelegator contract is responsible for depositing assets into strategies. It can also transfer assets back to the LRT deposit pool.\n\n#### LRTOracle\nThe LRTOracle contract is responsible for calculating the exchange rate of assets. It does this by reading from the priceFetcher interface, which may fetch the price from any supported oracle.\n\n#### RSETH\nThe rsETH token contract is an ERC20 token contract that is used to represent the rsETH token. The rsETH token is a staked ETH token that is used to earn rewards on staked ETH.\n\n## Architecture Recommentations\n\n### Implementing Supported Asset Removal in the LRT Token Ecosystem\n\nIt is currently not possible to remove supported assets once they have been added to the ``supportedAssetList``\n\nImplementing an asset removal mechanism in your smart contract can be a prudent decision, especially if there's a possibility that certain assets might need to be delisted or removed for various reasons.\n\n```solidity\n\nfunction _addNewSupportedAsset(address asset, uint256 depositLimit) private {\n UtilLib.checkNonZeroAddress(asset);\n if (isSupportedAsset[asset]) {\n revert AssetAlreadyS", "vulnerable_code": "function _addNewSupportedAsset(address asset, uint256 depositLimit) private {\n UtilLib.checkNonZeroAddress(asset);\n if (isSupportedAsset[asset]) {\n revert AssetAlreadySupported();\n }\n isSupportedAsset[asset] = true;\n supportedAssetList.push(asset);\n depositLimitByAsset[asset] = depositLimit;\n emit AddedNewSupportedAsset(asset, depositLimit);\n }\n", "fixed_code": "/// @dev private function to remove a supported asset\n/// @param asset Asset address\nfunction _removeSupportedAsset(address asset) private {\n require(isSupportedAsset[asset], \"Asset not supported\");\n\n isSupportedAsset[asset] = false;\n _removeAssetFromList(asset);\n delete depositLimitByAsset[asset];\n\n emit RemovedSupportedAsset(asset);\n}\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/Sathish9098-Analysis.md", "collected_at": "2026-01-02T18:27:39.410974+00:00", "source_hash": "2debd4160d7c9cb0de40538b52aa867fbf0bf533dd3ba0d6da4b07d934c65eed", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function _addNewSupportedAsset(address asset, uint256 depositLimit) private {\n UtilLib.checkNonZeroAddress(asset);\n if (isSupportedAsset[asset]) {\n revert AssetAlreadySupported();\n }\n isSupportedAsset[asset] = true;\n supportedAssetList.push(asset);\n depositLimitByAsset[asset] = depositLimit;\n emit AddedNewSupportedAsset(asset, depositLimit);\n }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "/// @dev private function to remove a supported asset\n/// @param asset Asset address\nfunction _removeSupportedAsset(address asset) private {\n require(isSupportedAsset[asset], \"Asset not supported\");\n\n isSupportedAsset[asset] = false;\n _removeAssetFromList(asset);\n delete depositLimitByAsset[asset];\n\n emit RemovedSupportedAsset(asset);\n}\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-asymmetry", "title": "JCN G", "severity_raw": "High", "severity": "high", "description": "# Summary\nAll optimizations (*with the exception of issue [G-10](#adding-a-derivative-will-increase-gas-costs-for-users-staking-and-unstaking-even-after-the-derivative-is-removed)*) were benchmarked via the protocol's tests, i.e. using the following config: `solc version 0.8.13`, `optimizer on`, and `100_000 runs`.\n\nBelow are the overall average gas savings for the tested functions (with all the optimizations applied):\n| Function | Before | After | Avg Gas Savings |\n| ------ | -------- | -------- | ------- |\n| stake | 527253 | 511519 | 15734 | \n| unstake | 516303 | 513131 | 3172 | \n| addDerivative | 102462 | 99120 | 3342 | \n| adjustWeight| 46519 | 39195 | 7324 | \n| rebalanceToWeights| 727618 | 717607 | 10011 | \n| setMaxAmount| 37155 | 37146 | 9 | \n| setMaxSlippage| 58574 | 58532 | 42 | \n| setMinAmount| 37099 | 37090 | 9 | \n| setPauseStaking| 54296 | 54263 | 33 | \n| setPauseUnstaking| 37243 | 37193 | 50 | \n| deposit| 176462 | 176124 | 338 | \n| withdraw| 181057 | 180930 | 127 | \n| adminWithdrawDerivative| 195722 | 195594 | 128 |\n\n**Total gas saved across all listed functions: 40319**\n\n*Notes*: \n\n- The [`gasReporter`](#gasreporter-output-with-all-optimizations-applied) output and [diffs](#diff-for-safethsol-with-all-optimizations-applied) with **all the optimizations applied** (*with the exception of issue [G-10](#adding-a-derivative-will-increase-gas-costs-for-users-staking-and-unstaking-even-after-the-derivative-is-removed)*) can be found at the end of the report.\n- Some code snippets may be truncated to save space. Code snippets may also be accompanied by `@audit` tags in comments to aid in explaining the issue.\n\n## Gas Optimizations\n| Number |Issue|Instances|\n|-|:-|:-:|\n| [G-01](#state-variables-can-be-cached-instead-of-re-reading-them-from-storage) | State variables can be cached instead of re-reading them from storage | 22 |\n| [G-02](#avoid-emitting-storage-values) | Avoid emitting storage valu", "vulnerable_code": "File: contracts/SafEth/SafEth.sol\n63: function stake() external payable {\n64: require(pauseStaking == false, \"staking is paused\");\n65: require(msg.value >= minAmount, \"amount too low\");\n66: require(msg.value <= maxAmount, \"amount too high\");\n67:\n68: uint256 underlyingValue = 0;\n69:\n70: // Getting underlying value in terms of ETH for each derivative\n71: for (uint i = 0; i < derivativeCount; i++) // @audit: sload on every iteration\n72: underlyingValue +=\n73: (derivatives[i].ethPerDerivative(derivatives[i].balance()) * // @audit: 1st and 2nd sload\n74: derivatives[i].balance()) / // @audit: 3rd sload\n75: 10 ** 18;\n76:\n77: uint256 totalSupply = totalSupply();\n78: uint256 preDepositPrice; // Price of safETH in regards to ETH\n79: if (totalSupply == 0)\n80: preDepositPrice = 10 ** 18; // initializes with a price of 1\n81: else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n82:\n83: uint256 totalStakeValueEth = 0; // total amount of derivatives worth of ETH in system\n84: for (uint i = 0; i < derivativeCount; i++) { // @audit: sload on every iteration\n85: uint256 weight = weights[i];\n86: IDerivative derivative = derivatives[i]; // @audit: unecessary sload if weight == 0, move below if statement\n87: if (weight == 0) continue;\n88: uint256 ethAmount = (msg.value * weight) / totalWeight; // @audit: sload on every iteration\n89:\n90: // This is slightly less than ethAmount because slippage\n91: uint256 depositAmount = derivative.deposit{value: ethAmount}();\n92: uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n93: depositAmount\n94: ) * depositAmount) / 10 ** 18;\n95: totalStakeValueEth += derivativeReceivedEthValue;\n96: }", "fixed_code": "https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L108-L119\n\n### Cache `derivativeCount` and `derivatives[i]` to save ~ 3 SLOADs\n\n*More SLOADs would actually be saved since storage slot access is occuring within a loop.*", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/JCN-G.md", "collected_at": "2026-01-02T18:18:11.118912+00:00", "source_hash": "2dfa823445c0182669941b9f6fc0c0da2474c6e8c146c0940b310ad186a365e5", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol#L108-L119", "github_files_list": "SafEth.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: contracts/SafEth/SafEth.sol\n63: function stake() external payable {\n64: require(pauseStaking == false, \"staking is paused\");\n65: require(msg.value >= minAmount, \"amount too low\");\n66: require(msg.value <= maxAmount, \"amount too high\");\n67:\n68: uint256 underlyingValue = 0;\n69:\n70: // Getting underlying value in terms of ETH for each derivative\n71: for (uint i = 0; i < derivativeCount; i++) // @audit: sload on every iteration\n72: underlyingValue +=\n73: (derivatives[i].ethPerDerivative(derivatives[i].balance()) * // @audit: 1st and 2nd sload\n74: derivatives[i].balance()) / // @audit: 3rd sload\n75: 10 ** 18;\n76:\n77: uint256 totalSupply = totalSupply();\n78: uint256 preDepositPrice; // Price of safETH in regards to ETH\n79: if (totalSupply == 0)\n80: preDepositPrice = 10 ** 18; // initializes with a price of 1\n81: else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n82:\n83: uint256 totalStakeValueEth = 0; // total amount of derivatives worth of ETH in system\n84: for (uint i = 0; i < derivativeCount; i++) { // @audit: sload on every iteration\n85: uint256 weight = weights[i];\n86: IDerivative derivative = derivatives[i]; // @audit: unecessary sload if weight == 0, move below if statement\n87: if (weight == 0) continue;\n88: uint256 ethAmount = (msg.value * weight) / totalWeight; // @audit: sload on every iteration\n89:\n90: // This is slightly less than ethAmount because slippage\n91: uint256 depositAmount = derivative.deposit{value: ethAmount}();\n92: uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n93: depositAmount\n94: ) * depositAmount) / 10 ** 18;\n95: totalStakeValueEth += derivativeReceivedEthValue;\n96: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L108-L119\n\n### Cache `derivativeCount` and `derivatives[i]` to save ~ 3 SLOADs\n\n*More SLOADs would actually be saved since storage slot access is occuring within a loop.*", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "11-kelp", "title": "KeyKiril Q", "severity_raw": "Low", "severity": "low", "description": "# Essential Early Checks\n\nKey checks should be placed at the beginning part of a function logic where possible:\n\n```solidity\n function getRSETHPrice() external view returns (uint256 rsETHPrice) {\n + if (rsEthSupply == 0) {\n + return 1 ether;\n + }\n address rsETHTokenAddress = lrtConfig.rsETH();\n uint256 rsEthSupply = IRSETH(rsETHTokenAddress).totalSupply();\n\n\n - if (rsEthSupply == 0) {\n - return 1 ether;\n - }\n\n\n uint256 totalETHInPool;\n address lrtDepositPoolAddr = lrtConfig.getContract(LRTConstants.LRT_DEPOSIT_POOL);\n\n\n address[] memory supportedAssets = lrtConfig.getSupportedAssetList();\n uint256 supportedAssetCount = supportedAssets.length;\n\n\n for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n address asset = supportedAssets[asset_idx];\n uint256 assetER = getAssetPrice(asset);\n\n\n uint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);\n totalETHInPool += totalAssetAmt * assetER;\n\n\n unchecked {\n ++asset_idx;\n }\n }\n\n\n return totalETHInPool / rsEthSupply;\n }\n```", "vulnerable_code": " function getRSETHPrice() external view returns (uint256 rsETHPrice) {\n + if (rsEthSupply == 0) {\n + return 1 ether;\n + }\n address rsETHTokenAddress = lrtConfig.rsETH();\n uint256 rsEthSupply = IRSETH(rsETHTokenAddress).totalSupply();\n\n\n - if (rsEthSupply == 0) {\n - return 1 ether;\n - }\n\n\n uint256 totalETHInPool;\n address lrtDepositPoolAddr = lrtConfig.getContract(LRTConstants.LRT_DEPOSIT_POOL);\n\n\n address[] memory supportedAssets = lrtConfig.getSupportedAssetList();\n uint256 supportedAssetCount = supportedAssets.length;\n\n\n for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n address asset = supportedAssets[asset_idx];\n uint256 assetER = getAssetPrice(asset);\n\n\n uint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);\n totalETHInPool += totalAssetAmt * assetER;\n\n\n unchecked {\n ++asset_idx;\n }\n }\n\n\n return totalETHInPool / rsEthSupply;\n }", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/KeyKiril-Q.md", "collected_at": "2026-01-02T18:27:30.479041+00:00", "source_hash": "2e74962cc16845dbffb80c90d3cc2c0adf6b4eff848eb477a94302bece2ab5ff", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 1074, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function getRSETHPrice() external view returns (uint256 rsETHPrice) {\n + if (rsEthSupply == 0) {\n + return 1 ether;\n + }\n address rsETHTokenAddress = lrtConfig.rsETH();\n uint256 rsEthSupply = IRSETH(rsETHTokenAddress).totalSupply();\n\n\n - if (rsEthSupply == 0) {\n - return 1 ether;\n - }\n\n\n uint256 totalETHInPool;\n address lrtDepositPoolAddr = lrtConfig.getContract(LRTConstants.LRT_DEPOSIT_POOL);\n\n\n address[] memory supportedAssets = lrtConfig.getSupportedAssetList();\n uint256 supportedAssetCount = supportedAssets.length;\n\n\n for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n address asset = supportedAssets[asset_idx];\n uint256 assetER = getAssetPrice(asset);\n\n\n uint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);\n totalETHInPool += totalAssetAmt * assetER;\n\n\n unchecked {\n ++asset_idx;\n }\n }\n\n\n return totalETHInPool / rsEthSupply;\n }", "primary_code_language": "solidity", "primary_code_char_count": 1074, "all_code_blocks": "// Code block 1 (solidity):\nfunction getRSETHPrice() external view returns (uint256 rsETHPrice) {\n + if (rsEthSupply == 0) {\n + return 1 ether;\n + }\n address rsETHTokenAddress = lrtConfig.rsETH();\n uint256 rsEthSupply = IRSETH(rsETHTokenAddress).totalSupply();\n\n\n - if (rsEthSupply == 0) {\n - return 1 ether;\n - }\n\n\n uint256 totalETHInPool;\n address lrtDepositPoolAddr = lrtConfig.getContract(LRTConstants.LRT_DEPOSIT_POOL);\n\n\n address[] memory supportedAssets = lrtConfig.getSupportedAssetList();\n uint256 supportedAssetCount = supportedAssets.length;\n\n\n for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n address asset = supportedAssets[asset_idx];\n uint256 assetER = getAssetPrice(asset);\n\n\n uint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);\n totalETHInPool += totalAssetAmt * assetER;\n\n\n unchecked {\n ++asset_idx;\n }\n }\n\n\n return totalETHInPool / rsEthSupply;\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function getRSETHPrice() external view returns (uint256 rsETHPrice) {\n + if (rsEthSupply == 0) {\n + return 1 ether;\n + }\n address rsETHTokenAddress = lrtConfig.rsETH();\n uint256 rsEthSupply = IRSETH(rsETHTokenAddress).totalSupply();\n\n\n - if (rsEthSupply == 0) {\n - return 1 ether;\n - }\n\n\n uint256 totalETHInPool;\n address lrtDepositPoolAddr = lrtConfig.getContract(LRTConstants.LRT_DEPOSIT_POOL);\n\n\n address[] memory supportedAssets = lrtConfig.getSupportedAssetList();\n uint256 supportedAssetCount = supportedAssets.length;\n\n\n for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n address asset = supportedAssets[asset_idx];\n uint256 assetER = getAssetPrice(asset);\n\n\n uint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);\n totalETHInPool += totalAssetAmt * assetER;\n\n\n unchecked {\n ++asset_idx;\n }\n }\n\n\n return totalETHInPool / rsEthSupply;\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function getRSETHPrice() external view returns (uint256 rsETHPrice) {\n + if (rsEthSupply == 0) {\n + return 1 ether;\n + }\n address rsETHTokenAddress = lrtConfig.rsETH();\n uint256 rsEthSupply = IRSETH(rsETHTokenAddress).totalSupply();\n\n\n - if (rsEthSupply == 0) {\n - return 1 ether;\n - }\n\n\n uint256 totalETHInPool;\n address lrtDepositPoolAddr = lrtConfig.getContract(LRTConstants.LRT_DEPOSIT_POOL);\n\n\n address[] memory supportedAssets = lrtConfig.getSupportedAssetList();\n uint256 supportedAssetCount = supportedAssets.length;\n\n\n for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n address asset = supportedAssets[asset_idx];\n uint256 assetER = getAssetPrice(asset);\n\n\n uint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);\n totalETHInPool += totalAssetAmt * assetER;\n\n\n unchecked {\n ++asset_idx;\n }\n }\n\n\n return totalETHInPool / rsEthSupply;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.41} {"source": "c4", "protocol": "09-ondo", "title": "Topmark Q", "severity_raw": "Unknown", "severity": "unknown", "description": "### Issue 1:\nUsing same name to represent different variables could cause conflict of interest and misrepresentations when dealing with Threshold and TxnThreshold struct in the DestinationBridge.sol contract. Variable Names should be adjusted accordingly.\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/DestinationBridge.sol#L369-L377\n```solidity\n struct Threshold {\n uint256 amount;\n---> uint256 numberOfApprovalsNeeded;\n }\n\n struct TxnThreshold {\n---> uint256 numberOfApprovalsNeeded;\n address[] approvers;\n }\n```", "vulnerable_code": " struct Threshold {\n uint256 amount;\n---> uint256 numberOfApprovalsNeeded;\n }\n\n struct TxnThreshold {\n---> uint256 numberOfApprovalsNeeded;\n address[] approvers;\n }", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/Topmark-Q.md", "collected_at": "2026-01-02T18:25:43.527940+00:00", "source_hash": "2ee5afb4cd589933012eb00fbde2b3ca56fe158fd315aba4e711c73eb8fffb6e", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 178, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "struct Threshold {\n uint256 amount;\n---> uint256 numberOfApprovalsNeeded;\n }\n\n struct TxnThreshold {\n---> uint256 numberOfApprovalsNeeded;\n address[] approvers;\n }", "primary_code_language": "solidity", "primary_code_char_count": 178, "all_code_blocks": "// Code block 1 (solidity):\nstruct Threshold {\n uint256 amount;\n---> uint256 numberOfApprovalsNeeded;\n }\n\n struct TxnThreshold {\n---> uint256 numberOfApprovalsNeeded;\n address[] approvers;\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "struct Threshold {\n uint256 amount;\n---> uint256 numberOfApprovalsNeeded;\n }\n\n struct TxnThreshold {\n---> uint256 numberOfApprovalsNeeded;\n address[] approvers;\n }", "github_refs_formatted": "DestinationBridge.sol#L369-L377", "github_files_list": "DestinationBridge.sol", "github_refs_count": 1, "vulnerable_code_actual": " struct Threshold {\n uint256 amount;\n---> uint256 numberOfApprovalsNeeded;\n }\n\n struct TxnThreshold {\n---> uint256 numberOfApprovalsNeeded;\n address[] approvers;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.11} {"source": "c4", "protocol": "01-ondo", "title": "oyc_109 Q", "severity_raw": "Critical", "severity": "critical", "description": "\n\n## [L-01] Unspecific Compiler Version Pragma\n\nAvoid floating pragmas for non-library contracts.\n\nWhile floating pragmas make sense for libraries to allow them to be included with multiple different versions of applications, it may be a security risk for application implementations.\n\nA known vulnerable compiler version may accidentally be selected or security tools might fall-back to an older compiler version ending up checking a different EVM compilation that is ultimately deployed on the blockchain.\n\nIt is recommended to pin to a concrete compiler version.\n\n```\n2023-01-ondo/contracts/lending/CompoundLens.sol::1 => pragma solidity ^0.5.16;\n2023-01-ondo/contracts/lending/JumpRateModelV2.sol::1 => pragma solidity ^0.5.16;\n2023-01-ondo/contracts/lending/ondo/ondo-token/IOndo.sol::2 => pragma solidity >=0.8.3;\n2023-01-ondo/contracts/lending/ondo/ondo-token/LinearTimelock.sol::2 => pragma solidity >=0.8.3;\n2023-01-ondo/contracts/lending/tokens/cCash/CCash.sol::2 => pragma solidity ^0.8.10;\n2023-01-ondo/contracts/lending/tokens/cCash/CCashDelegate.sol::2 => pragma solidity ^0.8.10;\n2023-01-ondo/contracts/lending/tokens/cCash/CTokenCash.sol::2 => pragma solidity ^0.8.10;\n2023-01-ondo/contracts/lending/tokens/cCash/CTokenInterfacesModifiedCash.sol::2 => pragma solidity ^0.8.10;\n2023-01-ondo/contracts/lending/tokens/cErc20Delegate/CTokenInterfaces.sol::2 => pragma solidity ^0.8.10;\n2023-01-ondo/contracts/lending/tokens/cErc20Delegate/ComptrollerInterface.sol::2 => pragma solidity ^0.8.10;\n2023-01-ondo/contracts/lending/tokens/cErc20Delegate/EIP20Interface.sol::2 => pragma solidity ^0.8.10;\n2023-01-ondo/contracts/lending/tokens/cErc20Delegate/EIP20NonStandardInterface.sol::2 => pragma solidity ^0.8.10;\n2023-01-ondo/contracts/lending/tokens/cErc20Delegate/ErrorReporter.sol::2 => pragma solidity ^0.8.10;\n2023-01-ondo/contracts/lending/tokens/cErc20Delegate/ExponentialNoError.sol::2 => pragma solidity ^0.8.10;\n2023-01-ondo/contracts/lending/tokens/cErc20Delegate/InterestRateMo", "vulnerable_code": "2023-01-ondo/contracts/lending/CompoundLens.sol::1 => pragma solidity ^0.5.16;\n2023-01-ondo/contracts/lending/JumpRateModelV2.sol::1 => pragma solidity ^0.5.16;\n2023-01-ondo/contracts/lending/ondo/ondo-token/IOndo.sol::2 => pragma solidity >=0.8.3;\n2023-01-ondo/contracts/lending/ondo/ondo-token/LinearTimelock.sol::2 => pragma solidity >=0.8.3;\n2023-01-ondo/contracts/lending/tokens/cCash/CCash.sol::2 => pragma solidity ^0.8.10;\n2023-01-ondo/contracts/lending/tokens/cCash/CCashDelegate.sol::2 => pragma solidity ^0.8.10;\n2023-01-ondo/contracts/lending/tokens/cCash/CTokenCash.sol::2 => pragma solidity ^0.8.10;\n2023-01-ondo/contracts/lending/tokens/cCash/CTokenInterfacesModifiedCash.sol::2 => pragma solidity ^0.8.10;\n2023-01-ondo/contracts/lending/tokens/cErc20Delegate/CTokenInterfaces.sol::2 => pragma solidity ^0.8.10;\n2023-01-ondo/contracts/lending/tokens/cErc20Delegate/ComptrollerInterface.sol::2 => pragma solidity ^0.8.10;\n2023-01-ondo/contracts/lending/tokens/cErc20Delegate/EIP20Interface.sol::2 => pragma solidity ^0.8.10;\n2023-01-ondo/contracts/lending/tokens/cErc20Delegate/EIP20NonStandardInterface.sol::2 => pragma solidity ^0.8.10;\n2023-01-ondo/contracts/lending/tokens/cErc20Delegate/ErrorReporter.sol::2 => pragma solidity ^0.8.10;\n2023-01-ondo/contracts/lending/tokens/cErc20Delegate/ExponentialNoError.sol::2 => pragma solidity ^0.8.10;\n2023-01-ondo/contracts/lending/tokens/cErc20Delegate/InterestRateModel.sol::2 => pragma solidity ^0.8.10;\n2023-01-ondo/contracts/lending/tokens/cErc20ModifiedDelegator.sol::7 => pragma solidity ^0.5.12;\n2023-01-ondo/contracts/lending/tokens/cErc20ModifiedDelegator.sol::138 => pragma solidity ^0.5.12;\n2023-01-ondo/contracts/lending/tokens/cErc20ModifiedDelegator.sol::181 => pragma solidity ^0.5.12;\n2023-01-ondo/contracts/lending/tokens/cErc20ModifiedDelegator.sol::296 => pragma solidity ^0.5.16;\n2023-01-ondo/contracts/lending/tokens/cErc20ModifiedDelegator.sol::302 => pragma solidity ^0.5.16;\n2023-01-ondo/contracts/lending/tokens/c", "fixed_code": "2023-01-ondo/contracts/cash/CashManager.sol::175 => block.timestamp -\n2023-01-ondo/contracts/cash/CashManager.sol::176 => (block.timestamp % epochDuration);\n2023-01-ondo/contracts/cash/CashManager.sol::577 => uint256 epochDifference = (block.timestamp - currentEpochStartTimestamp) /\n2023-01-ondo/contracts/cash/CashManager.sol::584 => block.timestamp -\n2023-01-ondo/contracts/cash/CashManager.sol::585 => (block.timestamp % epochDuration);\n2023-01-ondo/contracts/cash/kyc/KYCRegistry.sol::92 => require(block.timestamp <= deadline, \"KYCRegistry: signature expired\");\n2023-01-ondo/contracts/lending/OndoPriceOracleV2.sol::294 => (updatedAt >= block.timestamp - maxChainlinkOracleTimeDelay),\n2023-01-ondo/contracts/lending/ondo/ondo-token/LinearTimelock.sol::39 => return block.timestamp > cliffTimestamp;\n2023-01-ondo/contracts/lending/ondo/ondo-token/LinearTimelock.sol::44 => return block.timestamp > cliffTimestamp + seedVestingPeriod;\n2023-01-ondo/contracts/lending/ondo/ondo-token/LinearTimelock.sol::78 => elapsed = block.timestamp - cliffTimestamp;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/oyc_109-Q.md", "collected_at": "2026-01-02T18:15:26.383143+00:00", "source_hash": "2f0fef41a49f4e468423b0dfd6b909e6a8a1e8df036d752c21d500eae00f1818", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "2023-01-ondo/contracts/lending/CompoundLens.sol::1 => pragma solidity ^0.5.16;\n2023-01-ondo/contracts/lending/JumpRateModelV2.sol::1 => pragma solidity ^0.5.16;\n2023-01-ondo/contracts/lending/ondo/ondo-token/IOndo.sol::2 => pragma solidity >=0.8.3;\n2023-01-ondo/contracts/lending/ondo/ondo-token/LinearTimelock.sol::2 => pragma solidity >=0.8.3;\n2023-01-ondo/contracts/lending/tokens/cCash/CCash.sol::2 => pragma solidity ^0.8.10;\n2023-01-ondo/contracts/lending/tokens/cCash/CCashDelegate.sol::2 => pragma solidity ^0.8.10;\n2023-01-ondo/contracts/lending/tokens/cCash/CTokenCash.sol::2 => pragma solidity ^0.8.10;\n2023-01-ondo/contracts/lending/tokens/cCash/CTokenInterfacesModifiedCash.sol::2 => pragma solidity ^0.8.10;\n2023-01-ondo/contracts/lending/tokens/cErc20Delegate/CTokenInterfaces.sol::2 => pragma solidity ^0.8.10;\n2023-01-ondo/contracts/lending/tokens/cErc20Delegate/ComptrollerInterface.sol::2 => pragma solidity ^0.8.10;\n2023-01-ondo/contracts/lending/tokens/cErc20Delegate/EIP20Interface.sol::2 => pragma solidity ^0.8.10;\n2023-01-ondo/contracts/lending/tokens/cErc20Delegate/EIP20NonStandardInterface.sol::2 => pragma solidity ^0.8.10;\n2023-01-ondo/contracts/lending/tokens/cErc20Delegate/ErrorReporter.sol::2 => pragma solidity ^0.8.10;\n2023-01-ondo/contracts/lending/tokens/cErc20Delegate/ExponentialNoError.sol::2 => pragma solidity ^0.8.10;\n2023-01-ondo/contracts/lending/tokens/cErc20Delegate/InterestRateModel.sol::2 => pragma solidity ^0.8.10;\n2023-01-ondo/contracts/lending/tokens/cErc20ModifiedDelegator.sol::7 => pragma solidity ^0.5.12;\n2023-01-ondo/contracts/lending/tokens/cErc20ModifiedDelegator.sol::138 => pragma solidity ^0.5.12;\n2023-01-ondo/contracts/lending/tokens/cErc20ModifiedDelegator.sol::181 => pragma solidity ^0.5.12;\n2023-01-ondo/contracts/lending/tokens/cErc20ModifiedDelegator.sol::296 => pragma solidity ^0.5.16;\n2023-01-ondo/contracts/lending/tokens/cErc20ModifiedDelegator.sol::302 => pragma solidity ^0.5.16;\n2023-01-ondo/contracts/lending/tokens/c", "has_vulnerable_code_snippet": true, "fixed_code_actual": "2023-01-ondo/contracts/cash/CashManager.sol::175 => block.timestamp -\n2023-01-ondo/contracts/cash/CashManager.sol::176 => (block.timestamp % epochDuration);\n2023-01-ondo/contracts/cash/CashManager.sol::577 => uint256 epochDifference = (block.timestamp - currentEpochStartTimestamp) /\n2023-01-ondo/contracts/cash/CashManager.sol::584 => block.timestamp -\n2023-01-ondo/contracts/cash/CashManager.sol::585 => (block.timestamp % epochDuration);\n2023-01-ondo/contracts/cash/kyc/KYCRegistry.sol::92 => require(block.timestamp <= deadline, \"KYCRegistry: signature expired\");\n2023-01-ondo/contracts/lending/OndoPriceOracleV2.sol::294 => (updatedAt >= block.timestamp - maxChainlinkOracleTimeDelay),\n2023-01-ondo/contracts/lending/ondo/ondo-token/LinearTimelock.sol::39 => return block.timestamp > cliffTimestamp;\n2023-01-ondo/contracts/lending/ondo/ondo-token/LinearTimelock.sol::44 => return block.timestamp > cliffTimestamp + seedVestingPeriod;\n2023-01-ondo/contracts/lending/ondo/ondo-token/LinearTimelock.sol::78 => elapsed = block.timestamp - cliffTimestamp;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "02-ethos", "title": "0xNazgul Q", "severity_raw": "Low", "severity": "low", "description": "## [NAZ-L1] `removeTvlCap()` doesn't remove TVL cap\n**Severity**: Low\n**Context**: [`ReaperVaultV2.sol#L587`](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L587)\n\n**Description**:\n`removeTvlCap()` doesn't completely remove TVL cap. Although it does so effectively, it can be reset to lower than `type(uint256).max`. \n\n**Recommendation**:\nConsider adding in a check in `updateTvlCap()` like so:\n```Solidity\nfunction updateTvlCap(uint256 _newTvlCap) public {\n _atLeastRole(ADMIN);\n if (tvlCap != type(uint256).max) {\n tvlCap = _newTvlCap;\n emit TvlCapUpdated(tvlCap);\n }\n}\n```", "vulnerable_code": "function updateTvlCap(uint256 _newTvlCap) public {\n _atLeastRole(ADMIN);\n if (tvlCap != type(uint256).max) {\n tvlCap = _newTvlCap;\n emit TvlCapUpdated(tvlCap);\n }\n}", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/0xNazgul-Q.md", "collected_at": "2026-01-02T18:15:46.001799+00:00", "source_hash": "2f43c78a097f89a1570c8164b3dcf2742dce6e361db612b02e5f648a32527413", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 187, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function updateTvlCap(uint256 _newTvlCap) public {\n _atLeastRole(ADMIN);\n if (tvlCap != type(uint256).max) {\n tvlCap = _newTvlCap;\n emit TvlCapUpdated(tvlCap);\n }\n}", "primary_code_language": "Solidity", "primary_code_char_count": 187, "all_code_blocks": "// Code block 1 (Solidity):\nfunction updateTvlCap(uint256 _newTvlCap) public {\n _atLeastRole(ADMIN);\n if (tvlCap != type(uint256).max) {\n tvlCap = _newTvlCap;\n emit TvlCapUpdated(tvlCap);\n }\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function updateTvlCap(uint256 _newTvlCap) public {\n _atLeastRole(ADMIN);\n if (tvlCap != type(uint256).max) {\n tvlCap = _newTvlCap;\n emit TvlCapUpdated(tvlCap);\n }\n}", "github_refs_formatted": "ReaperVaultV2.sol#L587", "github_files_list": "ReaperVaultV2.sol", "github_refs_count": 1, "vulnerable_code_actual": "function updateTvlCap(uint256 _newTvlCap) public {\n _atLeastRole(ADMIN);\n if (tvlCap != type(uint256).max) {\n tvlCap = _newTvlCap;\n emit TvlCapUpdated(tvlCap);\n }\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.29} {"source": "c4", "protocol": "07-amphora", "title": "Eeyore Q", "severity_raw": "Low", "severity": "low", "description": "## [L-01] Absence of duplicate address validation in `_tokenAddresses` array in `VaultController#_migrateCollateralsFrom` function\n\n### Description\n\nThe `VaultController` contract offers the option to migrate token collateral data from an old contract during the `constructor` call. \n\nHowever, if the `_migrateCollateralsFrom` function receives the same valid token address multiple times in the `_tokenAddresses` array, it can misconfigure the new `VaultController` contract.\n\nThis situation could lead to an overlong `enabledTokens` array that contains duplicate token addresses. As this array is utilized for collateral calculations, each entry should be unique to ensure accurate computations.\n\n### Recommendation\n\nAn additional check should be added to the `_migrateCollateralsFrom` function to prevent duplicate addresses from entering the `enabledTokens` array. \n\n```diff\n if (_tokenId == 0) revert VaultController_WrongCollateralAddress();\n+ if (tokenAddressCollateralInfo[_tokenAddress].tokenId != 0) revert VaultController_TokenAlreadyRegistered();\n _tokensRegistered++;\n```\n\n## [L-02] `USDA` contract address should be registered only once in `VaultController` contract\n\n### Description\n\nIn the `registerUSDA` function, no check is present that prevents changing an already registered `USDA` address. \n\nThere should never be a need to alter a set `USDA` address, as such a change could disrupt the composability of the `Amphora` protocol and potentially lead to user fund losses.\n\n### Recommendation\n\nAdd a one-time registration check to the `registerUSDA` function to ensure that the `USDA` address cannot be modified once it has been set.\n\n```diff\n function registerUSDA(address _usdaAddress) external override onlyOwner {\n+ if (usda != address(0)) revert VaultController_UsdaAlreadyRegistered();\n usda = IUSDA(_usdaAddress);\n```\n\n## [L-03] Incorrect check in `VaultController#changeInitialBorrowingFee` function\n\n### Description\n\nIn the `changeInitialBorrowingFee` funct", "vulnerable_code": "## [L-02] `USDA` contract address should be registered only once in `VaultController` contract\n\n### Description\n\nIn the `registerUSDA` function, no check is present that prevents changing an already registered `USDA` address. \n\nThere should never be a need to alter a set `USDA` address, as such a change could disrupt the composability of the `Amphora` protocol and potentially lead to user fund losses.\n\n### Recommendation\n\nAdd a one-time registration check to the `registerUSDA` function to ensure that the `USDA` address cannot be modified once it has been set.\n", "fixed_code": "## [L-03] Incorrect check in `VaultController#changeInitialBorrowingFee` function\n\n### Description\n\nIn the `changeInitialBorrowingFee` function, the conditional check used to verify the new borrowing fee against `MAX_INIT_BORROWING_FEE` is flawed. The condition `_newBorrowingFee >= MAX_INIT_BORROWING_FEE` should be `_newBorrowingFee > MAX_INIT_BORROWING_FEE` to allow `MAX_INIT_BORROWING_FEE` as a valid maximum value.\n\n### Recommendation\n\nCorrect the conditional check in the `changeInitialBorrowingFee` function to include `MAX_INIT_BORROWING_FEE` as the maximum value for `_newBorrowingFee`.\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/Eeyore-Q.md", "collected_at": "2026-01-02T18:23:25.984327+00:00", "source_hash": "2f7e525fcf975546650b070943ce08df48e865772570505d2c7536c07794d2cf", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 386, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "if (_tokenId == 0) revert VaultController_WrongCollateralAddress();\n+ if (tokenAddressCollateralInfo[_tokenAddress].tokenId != 0) revert VaultController_TokenAlreadyRegistered();\n _tokensRegistered++;", "primary_code_language": "diff", "primary_code_char_count": 205, "all_code_blocks": "// Code block 1 (diff):\nif (_tokenId == 0) revert VaultController_WrongCollateralAddress();\n+ if (tokenAddressCollateralInfo[_tokenAddress].tokenId != 0) revert VaultController_TokenAlreadyRegistered();\n _tokensRegistered++;\n\n// Code block 2 (diff):\nfunction registerUSDA(address _usdaAddress) external override onlyOwner {\n+ if (usda != address(0)) revert VaultController_UsdaAlreadyRegistered();\n usda = IUSDA(_usdaAddress);", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "if (_tokenId == 0) revert VaultController_WrongCollateralAddress();\n+ if (tokenAddressCollateralInfo[_tokenAddress].tokenId != 0) revert VaultController_TokenAlreadyRegistered();\n _tokensRegistered++;\n\nfunction registerUSDA(address _usdaAddress) external override onlyOwner {\n+ if (usda != address(0)) revert VaultController_UsdaAlreadyRegistered();\n usda = IUSDA(_usdaAddress);", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "## [L-02] `USDA` contract address should be registered only once in `VaultController` contract\n\n### Description\n\nIn the `registerUSDA` function, no check is present that prevents changing an already registered `USDA` address. \n\nThere should never be a need to alter a set `USDA` address, as such a change could disrupt the composability of the `Amphora` protocol and potentially lead to user fund losses.\n\n### Recommendation\n\nAdd a one-time registration check to the `registerUSDA` function to ensure that the `USDA` address cannot be modified once it has been set.\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## [L-03] Incorrect check in `VaultController#changeInitialBorrowingFee` function\n\n### Description\n\nIn the `changeInitialBorrowingFee` function, the conditional check used to verify the new borrowing fee against `MAX_INIT_BORROWING_FEE` is flawed. The condition `_newBorrowingFee >= MAX_INIT_BORROWING_FEE` should be `_newBorrowingFee > MAX_INIT_BORROWING_FEE` to allow `MAX_INIT_BORROWING_FEE` as a valid maximum value.\n\n### Recommendation\n\nCorrect the conditional check in the `changeInitialBorrowingFee` function to include `MAX_INIT_BORROWING_FEE` as the maximum value for `_newBorrowingFee`.\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "05-ajna", "title": "REACH Q", "severity_raw": "High", "severity": "high", "description": "## [L-01] NFTs may be minted without a liquidity pool position\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/PositionManager.sol#L227-L241\n\nWithin `PositionManager.sol`, the mint function does not check for liquidity pool positions. This could lead to future vulnerabilities if improvements are made without this in mind.\n\nWe recommend checking for liquidity prior to minting an NFT.\n\n## [L-02] Empty NFTs may be staked\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/RewardsManager.sol#L207-L245\n\nWithin `RewardsManager.sol`, an empty NFT can be staked. Rewards cannot be distributed, thus we are marking this as a low. However, similar to L-01, care must be taken here with future upgrades.\n\nMitigation from L-01 will suffice.\n\n## [L-03] Period lengths in block numbers are constant\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L29-L46\n\nThe blocks/minute is variable within Ethereum, and may even change drastically with forks.\n\nAs it stands, the average block is mined in 12.11 seconds today, down from 13.56 a year ago.\n\nIf you want the block count to remain constant, then you should update the documentation to reflect that. If you want the time(days/seconds/etc.) to remain constant, then you should be able to change the block numbers in period lengths. Adding setter functions and removing the `constant` modifier would suffice.\n\nE.g., At 15 seconds per block (4 per minute), within `StandardFunding.sol`, the FUNDING_PERIOD_LENGTH should be 57600 for ~10 days. At 12.11 seconds, it should be 70965 blocks. It is set to 72000.\n\n## [L-04] Global constant `GLOBAL_BUDGET_CONSTRAINT` does not match documentation\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L27\n\nFrom the docs pertaining to the Primary Funding Mechanism:\n\n\"Each quarter (90 days), up to a 2% of the treasury can be distributed to projects that win a competitive bidding p", "vulnerable_code": "/**\n * @notice Maximum percentage of tokens that can be distributed by the treasury in a quarter.\n * @dev Stored as a Wad percentage.\n */\n uint256 internal constant GLOBAL_BUDGET_CONSTRAINT = 0.03 * 1e18;", "fixed_code": "", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/REACH-Q.md", "collected_at": "2026-01-02T18:21:07.983145+00:00", "source_hash": "2f85b5ba2d23b2dfe7be50f68e8779d9d7d874223ff0a74d8ef8529a92fadac4", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "PositionManager.sol#L227-L241, RewardsManager.sol#L207-L245, StandardFunding.sol#L29-L46, StandardFunding.sol#L27", "github_files_list": "RewardsManager.sol, PositionManager.sol, StandardFunding.sol", "github_refs_count": 4, "vulnerable_code_actual": "/**\n * @notice Maximum percentage of tokens that can be distributed by the treasury in a quarter.\n * @dev Stored as a Wad percentage.\n */\n uint256 internal constant GLOBAL_BUDGET_CONSTRAINT = 0.03 * 1e18;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "02-ethos", "title": "0xSmartContract Q", "severity_raw": "Critical", "severity": "critical", "description": "## Summary\n### Low Risk Issues List\n| Number |Issues Details|Context|\n|:--:|:-------|:--:|\n|[L-01]|Use ERC-5143: Slippage Protection for Tokenized Vault| 1 |\n|[L-02]|Head Overflow Bug in Calldata Tuple ABI-Reencoding| 1 |\n|[L-03]|`uint` type argument was use instead `uint256` for `permit`function , this will cause the function selector to be miscalculated | 1 |\n|[L-04]|First\u00a0ERC4626\u00a0deposit exploit can break share calculation |1 |\n|[L-05]|initialize() function can be called by anybody| 1 |\n|[L-06]|Insufficient coverage|All Contracts |\n|[L-07]|Missing Event for initialize| 1 |\n|[L-08]|Project Upgrade and Stop Scenario should be| 1 |\n|[L-09]|Loss of precision due to rounding in ` amount / uint256(rewardsPerSecond) `|1 |\n|[L-10]|Use Fuzzing Test for complicated code bases | |\n|[L-11]|Update codes to avoid Compile Errors|11 |\n|[L-12]|Add to Event-Emit for critical functions|3 |\n|[L-13]|Use `uint256` instead `uint`|477 |\n|[L-14]|Signature Malleability of EVM's\u00a0ecrecover()|1 |\n|[L-15]|`sendCollateral` event is missing parameters|1 |\n|[L-16]|Lack of Input Validation|1 |\n|[L-17]|Prevent division by `0`|1 |\n|[L-18]|Project has NPM Dependency which uses a vulnerable version : `@openzeppelin`|1 |\n|[L-19]|Keccak Constant values should used to immutable rather than constant|8 |\n|[L-20]|Due to the novelty of the ERC4626 standard, it is safer to use as upgradeable| |\n|[L-21]|In the `setAddresses` function, there is no return of incorrect address identification|1 |\n\nTotal 21 issues\n\n\n### Non-Critical Issues List\n| Number |Issues Details|Context|\n|:--:|:-------|:--:|\n| [N-01] |Omissions in Events|2|\n| [N-02] |NatSpec comments should be increased in contracts |All Contracts|\n| [N-03] |`Function writing` that does not comply with the `Solidity Style Guide`| All Contracts |\n| [N-04] |Include return parameters in NatSpec comments| All Constracs |\n| [N-05] |Tokens accidentally sent to the contract cannot be recovered|1 |\n| [N-06] |Repeated validation logic can be converted into a functi", "vulnerable_code": "Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol:\n 159 */\n 160: function setHarvestSteps(address[2][] calldata _newSteps) external {\n 161: _atLeastRole(ADMIN);\n 162: delete steps;\n 163: \n 164: uint256 numSteps = _newSteps.length;\n 165: for (uint256 i = 0; i < numSteps; i = i.uncheckedInc()) {\n 166: address[2] memory step = _newSteps[i];\n 167: require(step[0] != address(0));\n 168: require(step[1] != address(0));\n 169: steps.push(step);\n 170: }\n 171: }\n", "fixed_code": "Ethos-Core/contracts/LUSDToken.sol:\n 261 \n 262: function permit\n 263: (\n 264: address owner, \n 265: address spender, \n 266: uint amount, \n 267: uint deadline, \n 268: uint8 v, \n 269: bytes32 r, \n 270: bytes32 s\n 271: ) \n 272: external \n 273: override \n 274: {", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/0xSmartContract-Q.md", "collected_at": "2026-01-02T18:15:46.916005+00:00", "source_hash": "2f8c475c751583768c7fe2f931aa0a17b8ee27ecfa7e9b39258d6391bced1245", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol:\n 159 */\n 160: function setHarvestSteps(address[2][] calldata _newSteps) external {\n 161: _atLeastRole(ADMIN);\n 162: delete steps;\n 163: \n 164: uint256 numSteps = _newSteps.length;\n 165: for (uint256 i = 0; i < numSteps; i = i.uncheckedInc()) {\n 166: address[2] memory step = _newSteps[i];\n 167: require(step[0] != address(0));\n 168: require(step[1] != address(0));\n 169: steps.push(step);\n 170: }\n 171: }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "Ethos-Core/contracts/LUSDToken.sol:\n 261 \n 262: function permit\n 263: (\n 264: address owner, \n 265: address spender, \n 266: uint amount, \n 267: uint deadline, \n 268: uint8 v, \n 269: bytes32 r, \n 270: bytes32 s\n 271: ) \n 272: external \n 273: override \n 274: {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-revert-lend", "title": "sil3th Q", "severity_raw": "High", "severity": "high", "description": "## DOS due to blacklisted addresses\nTokens such as USDC which is supported by the protocol allow for address blacklisting. Add a check at the withdraw function to check whether the address to withdraw the shares to is blacklisted.\n```@solidity\n function withdraw(uint256 assets, address receiver, address owner) external override returns (uint256) {\n (, uint256 shares) = _withdraw(receiver, owner, assets, false);\n return shares;\n }\n```\n[_withdraw](https://github.com/code-423n4/2024-03-revert-lend/blob/435b054f9ad2404173f36f0f74a5096c894b12b7/src/V3Vault.sol#L920-L952)\n\n## No check whether `SetVault` is active\nAutocompound transformer adjusts tokens which are in the vault via transform mode. The vault is set and or changed by the operator and can be in an active or inactive state. There is no check in the [AutoCompound](https://github.com/code-423n4/2024-03-revert-lend/blob/435b054f9ad2404173f36f0f74a5096c894b12b7/src/transformers/AutoCompound.sol#L87-L96) and [AutoRange](https://github.com/code-423n4/2024-03-revert-lend/blob/435b054f9ad2404173f36f0f74a5096c894b12b7/src/transformers/AutoRange.sol#L97-L104) transformers whether the vault is active or not. \n\n## DOS in `_removeTokenFromOwner`\nWhen the length of token Indexes becomes larger iterating through the tokenIndexes may become costly and result in gas cost that is more than block gas limit leaving the removal of tokens from owner in a DOS state since token Ids are not deleted even after removal.\n```@solidity\nfunction _removeTokenFromOwner(address from, uint256 tokenId) internal {\n uint256 lastTokenIndex = ownedTokens[from].length - 1;\n uint256 tokenIndex = ownedTokensIndex[tokenId];\n \n //if array becomes large since its not deleted itll lead to DOS due to oog\n if (tokenIndex != lastTokenIndex) {\n uint256 lastTokenId = ownedTokens[from][lastTokenIndex];\n ownedTokens[from][tokenIndex] = lastTokenId;\n ownedTokensIndex[lastTokenId] ", "vulnerable_code": "[_withdraw](https://github.com/code-423n4/2024-03-revert-lend/blob/435b054f9ad2404173f36f0f74a5096c894b12b7/src/V3Vault.sol#L920-L952)\n\n## No check whether `SetVault` is active\nAutocompound transformer adjusts tokens which are in the vault via transform mode. The vault is set and or changed by the operator and can be in an active or inactive state. There is no check in the [AutoCompound](https://github.com/code-423n4/2024-03-revert-lend/blob/435b054f9ad2404173f36f0f74a5096c894b12b7/src/transformers/AutoCompound.sol#L87-L96) and [AutoRange](https://github.com/code-423n4/2024-03-revert-lend/blob/435b054f9ad2404173f36f0f74a5096c894b12b7/src/transformers/AutoRange.sol#L97-L104) transformers whether the vault is active or not. \n\n## DOS in `_removeTokenFromOwner`\nWhen the length of token Indexes becomes larger iterating through the tokenIndexes may become costly and result in gas cost that is more than block gas limit leaving the removal of tokens from owner in a DOS state since token Ids are not deleted even after removal.", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/sil3th-Q.md", "collected_at": "2026-01-02T19:03:17.265569+00:00", "source_hash": "2ff7837e1e0742e4ef20ace901f00974af5a8c3c6e5a3770921a28dfee5c721b", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 1033, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "[_withdraw](https://github.com/code-423n4/2024-03-revert-lend/blob/435b054f9ad2404173f36f0f74a5096c894b12b7/src/V3Vault.sol#L920-L952)\n\n## No check whether `SetVault` is active\nAutocompound transformer adjusts tokens which are in the vault via transform mode. The vault is set and or changed by the operator and can be in an active or inactive state. There is no check in the [AutoCompound](https://github.com/code-423n4/2024-03-revert-lend/blob/435b054f9ad2404173f36f0f74a5096c894b12b7/src/transformers/AutoCompound.sol#L87-L96) and [AutoRange](https://github.com/code-423n4/2024-03-revert-lend/blob/435b054f9ad2404173f36f0f74a5096c894b12b7/src/transformers/AutoRange.sol#L97-L104) transformers whether the vault is active or not. \n\n## DOS in `_removeTokenFromOwner`\nWhen the length of token Indexes becomes larger iterating through the tokenIndexes may become costly and result in gas cost that is more than block gas limit leaving the removal of tokens from owner in a DOS state since token Ids are not deleted even after removal.", "primary_code_language": "unknown", "primary_code_char_count": 1033, "all_code_blocks": "// Code block 1 (unknown):\n[_withdraw](https://github.com/code-423n4/2024-03-revert-lend/blob/435b054f9ad2404173f36f0f74a5096c894b12b7/src/V3Vault.sol#L920-L952)\n\n## No check whether `SetVault` is active\nAutocompound transformer adjusts tokens which are in the vault via transform mode. The vault is set and or changed by the operator and can be in an active or inactive state. There is no check in the [AutoCompound](https://github.com/code-423n4/2024-03-revert-lend/blob/435b054f9ad2404173f36f0f74a5096c894b12b7/src/transformers/AutoCompound.sol#L87-L96) and [AutoRange](https://github.com/code-423n4/2024-03-revert-lend/blob/435b054f9ad2404173f36f0f74a5096c894b12b7/src/transformers/AutoRange.sol#L97-L104) transformers whether the vault is active or not. \n\n## DOS in `_removeTokenFromOwner`\nWhen the length of token Indexes becomes larger iterating through the tokenIndexes may become costly and result in gas cost that is more than block gas limit leaving the removal of tokens from owner in a DOS state since token Ids are not deleted even after removal.", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "V3Vault.sol#L920-L952, AutoCompound.sol#L87-L96, AutoRange.sol#L97-L104", "github_files_list": "V3Vault.sol, AutoCompound.sol, AutoRange.sol", "github_refs_count": 3, "vulnerable_code_actual": "[_withdraw](https://github.com/code-423n4/2024-03-revert-lend/blob/435b054f9ad2404173f36f0f74a5096c894b12b7/src/V3Vault.sol#L920-L952)\n\n## No check whether `SetVault` is active\nAutocompound transformer adjusts tokens which are in the vault via transform mode. The vault is set and or changed by the operator and can be in an active or inactive state. There is no check in the [AutoCompound](https://github.com/code-423n4/2024-03-revert-lend/blob/435b054f9ad2404173f36f0f74a5096c894b12b7/src/transformers/AutoCompound.sol#L87-L96) and [AutoRange](https://github.com/code-423n4/2024-03-revert-lend/blob/435b054f9ad2404173f36f0f74a5096c894b12b7/src/transformers/AutoRange.sol#L97-L104) transformers whether the vault is active or not. \n\n## DOS in `_removeTokenFromOwner`\nWhen the length of token Indexes becomes larger iterating through the tokenIndexes may become costly and result in gas cost that is more than block gas limit leaving the removal of tokens from owner in a DOS state since token Ids are not deleted even after removal.", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "02-ai-arena", "title": "0xAkira Q", "severity_raw": "Critical", "severity": "critical", "description": "## 1. Non-Critical-01. Using dynamic arrays\n\n### Relevant GitHub Links\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/AiArenaHelper.sol#L17\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/AiArenaHelper.sol#L20\n\n## Summary\n\nDynamic arrays are used instead of fixed size arrays\n\n## Vulnerability Details\n\nUse dynamic arrays to store elements, although there are no plans to add new arrays in the future.\n\n## Impact\n\nUsing fixed-size arrays can help avoid potential problems associated with unexpected growth of dynamic structures. They are easy to manage in memory because their size remains constant throughout execution. Using fixed-size arrays saves gas\n\n## Tools Used\n\n[Forge](https://book.getfoundry.sh/reference/forge/forge)\n\n## Recommendations\n\nI recommend specifying a fixed size for arrays that will not grow over time.\n\n```diff\n\n- string[] public attributes = [\n \"head\",\n \"eyes\",\n \"mouth\",\n \"body\",\n \"hands\",\n \"feet\"\n ];\n\n\n+ string[6] public attributes = [\n\"head\",\n\"eyes\",\n\"mouth\",\n\"body\",\n\"hands\",\n\"feet\"\n];\n```\n\n---\n\n## 2. Non-Critical-02. Two identical actions in the constructor\n\n### Relevant GitHub Links\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/AiArenaHelper.sol#L41-L52\n\n## Summary\n\nThere are two identical actions in the constructor.\n\n## Vulnerability Details\n\nIn the constructor there is a function `addAttributeProbabilities(0, probabilities);` which is used to Add attribute probabilities for a given generation. But also in this `constructor` below this function there is a loop that also Add attribute probabilities for generation 0\n\n- loop in the constructor:\n\n```solidity\nfor (uint8 i = 0; i < attributesLength; i++) {\n attributeProbabilities[0][attributes[i]] = probabilities[i];\n attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n }\n```\n\n- function `addAttributeProbabilities`\n\n```solidity\nfunction addAttributeProbabilities(uint256 generation, uint8[][] memory probabilit", "vulnerable_code": "---\n\n## 2. Non-Critical-02. Two identical actions in the constructor\n\n### Relevant GitHub Links\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/AiArenaHelper.sol#L41-L52\n\n## Summary\n\nThere are two identical actions in the constructor.\n\n## Vulnerability Details\n\nIn the constructor there is a function `addAttributeProbabilities(0, probabilities);` which is used to Add attribute probabilities for a given generation. But also in this `constructor` below this function there is a loop that also Add attribute probabilities for generation 0\n\n- loop in the constructor:\n", "fixed_code": "- function `addAttributeProbabilities`\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/0xAkira-Q.md", "collected_at": "2026-01-02T19:01:58.361399+00:00", "source_hash": "300d3967264af827790bedfdcea81080e4f18ca4861245751cd5aad9623a23b2", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 394, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "- string[] public attributes = [\n \"head\",\n \"eyes\",\n \"mouth\",\n \"body\",\n \"hands\",\n \"feet\"\n ];\n\n\n+ string[6] public attributes = [\n\"head\",\n\"eyes\",\n\"mouth\",\n\"body\",\n\"hands\",\n\"feet\"\n];", "primary_code_language": "diff", "primary_code_char_count": 186, "all_code_blocks": "// Code block 1 (diff):\n- string[] public attributes = [\n \"head\",\n \"eyes\",\n \"mouth\",\n \"body\",\n \"hands\",\n \"feet\"\n ];\n\n\n+ string[6] public attributes = [\n\"head\",\n\"eyes\",\n\"mouth\",\n\"body\",\n\"hands\",\n\"feet\"\n];\n\n// Code block 2 (solidity):\nfor (uint8 i = 0; i < attributesLength; i++) {\n attributeProbabilities[0][attributes[i]] = probabilities[i];\n attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n }", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "- string[] public attributes = [\n \"head\",\n \"eyes\",\n \"mouth\",\n \"body\",\n \"hands\",\n \"feet\"\n ];\n\n\n+ string[6] public attributes = [\n\"head\",\n\"eyes\",\n\"mouth\",\n\"body\",\n\"hands\",\n\"feet\"\n];", "solidity_code": "for (uint8 i = 0; i < attributesLength; i++) {\n attributeProbabilities[0][attributes[i]] = probabilities[i];\n attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n }", "github_refs_formatted": "AiArenaHelper.sol#L17, AiArenaHelper.sol#L20, AiArenaHelper.sol#L41-L52", "github_files_list": "AiArenaHelper.sol", "github_refs_count": 3, "vulnerable_code_actual": "---\n\n## 2. Non-Critical-02. Two identical actions in the constructor\n\n### Relevant GitHub Links\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/AiArenaHelper.sol#L41-L52\n\n## Summary\n\nThere are two identical actions in the constructor.\n\n## Vulnerability Details\n\nIn the constructor there is a function `addAttributeProbabilities(0, probabilities);` which is used to Add attribute probabilities for a given generation. But also in this `constructor` below this function there is a loop that also Add attribute probabilities for generation 0\n\n- loop in the constructor:\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "- function `addAttributeProbabilities`\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "01-ondo", "title": "SleepingBugs G", "severity_raw": "Medium", "severity": "medium", "description": "## Use of `safeMath` in `pragma ^0.8.0`\n### Summary\n`SafeMath` is used but it's not needed anymore\n\n### Github Permalinks\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70//contracts/lending/JumpRateModelV2.sol#L4\n`import \"./compound/SafeMath.sol\";`\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70//contracts/lending/JumpRateModelV2.sol#L12\n`using SafeMath for uint;`\n\n### Mitigation\n`SafeMath` can be not used as version `pragma ^0.8.0` avoiding a library deployment / calls to it\n\n\n## Increments can be `unchecked` in loops\n### Summary\nUnchecked operations as the `++i` on for loops are cheaper than checked one.\n\n### Details\nIn Solidity 0.8+, there\u2019s a default overflow check on unsigned integers. It\u2019s possible to uncheck this in for-loops and save some gas at each iteration, but at the cost of some code readability, as this uncheck cannot be made inline..\n\n```diff\n- for (uint256 i; i < numIterations; i++) {\n+ for (uint256 i; i < numIterations;) {\n // ...\n+ unchecked { ++i; }\n // The risk of overflow is inexistent for a uint256 here.\n }\n```\n\n### Github Permalinks\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70//contracts/cash/factory/CashFactory.sol#L127\n`for (uint256 i = 0; i < exCallData.length; ++i) {`\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70//contracts/cash/factory/CashKYCSenderFactory.sol#L137\n`for (uint256 i = 0; i < exCallData.length; ++i) {`\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70//contracts/cash/factory/CashKYCSenderReceiverFactory.sol#L137\n`for (uint256 i = 0; i < exCallData.length; ++i) {`\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70//contracts/cash/kyc/KYCRegistry.sol#L163\n`for (uint256 i = 0; i < length; i++) {`\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e0", "vulnerable_code": "### Github Permalinks\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70//contracts/cash/factory/CashFactory.sol#L127\n`for (uint256 i = 0; i < exCallData.length; ++i) {`\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70//contracts/cash/factory/CashKYCSenderFactory.sol#L137\n`for (uint256 i = 0; i < exCallData.length; ++i) {`\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70//contracts/cash/factory/CashKYCSenderReceiverFactory.sol#L137\n`for (uint256 i = 0; i < exCallData.length; ++i) {`\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70//contracts/cash/kyc/KYCRegistry.sol#L163\n`for (uint256 i = 0; i < length; i++) {`\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70//contracts/cash/kyc/KYCRegistry.sol#L180\n`for (uint256 i = 0; i < length; i++) {`\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70//contracts/cash/CashManager.sol#L750\n`for (uint256 i = 0; i < size; ++i) {`\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70//contracts/cash/CashManager.sol#L786\n`for (uint256 i = 0; i < size; ++i) {`\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70//contracts/cash/CashManager.sol#L933\n`for (uint256 i = 0; i < size; ++i) {`\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70//contracts/cash/CashManager.sol#L961\n`for (uint256 i = 0; i < exCallData.length; ++i) {`\n\n### Mitigation\nAdd unchecked `++i` at the end of all the for loop where it's not expected to overflow and remove them from the for header\n\n## Store using `Struct` over multiple `mappings`\n### Summary\nAll these variables could be combine in a `Struct` in order to reduce the gas cost. \n\n### Details\nAs noticed in this [gist](https://gist.github.com/alexon1234/b101e3ac51b", "fixed_code": "- - - \n\nAll indexes are `fToken`\nhttps://github.com/code-423n4/2023-01-ondo/blob/12537cc94f4b0e9b213d53906aa2f95e425dd899/contracts/lending/OndoPriceOracleV2.sol#L54-L62\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/SleepingBugs-G.md", "collected_at": "2026-01-02T18:14:48.461929+00:00", "source_hash": "30a70a0562369e08325b98ce2d300fd4c2a79cf2cb3f5176de1e73773b38b17c", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 196, "github_ref_count": 12, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "- for (uint256 i; i < numIterations; i++) {\n+ for (uint256 i; i < numIterations;) {\n // ...\n+ unchecked { ++i; }\n // The risk of overflow is inexistent for a uint256 here.\n }", "primary_code_language": "diff", "primary_code_char_count": 196, "all_code_blocks": "// Code block 1 (diff):\n- for (uint256 i; i < numIterations; i++) {\n+ for (uint256 i; i < numIterations;) {\n // ...\n+ unchecked { ++i; }\n // The risk of overflow is inexistent for a uint256 here.\n }", "all_code_blocks_count": 1, "has_diff_blocks": true, "diff_code": "- for (uint256 i; i < numIterations; i++) {\n+ for (uint256 i; i < numIterations;) {\n // ...\n+ unchecked { ++i; }\n // The risk of overflow is inexistent for a uint256 here.\n }", "solidity_code": "", "github_refs_formatted": "JumpRateModelV2.sol#L4, JumpRateModelV2.sol#L12, CashFactory.sol#L127, CashKYCSenderFactory.sol#L137, CashKYCSenderReceiverFactory.sol#L137, KYCRegistry.sol#L163, KYCRegistry.sol#L180, CashManager.sol#L750, CashManager.sol#L786, CashManager.sol#L933, CashManager.sol#L961, OndoPriceOracleV2.sol#L54-L62", "github_files_list": "CashManager.sol, CashKYCSenderFactory.sol, CashFactory.sol, JumpRateModelV2.sol, OndoPriceOracleV2.sol, KYCRegistry.sol, CashKYCSenderReceiverFactory.sol", "github_refs_count": 12, "vulnerable_code_actual": "### Github Permalinks\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70//contracts/cash/factory/CashFactory.sol#L127\n`for (uint256 i = 0; i < exCallData.length; ++i) {`\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70//contracts/cash/factory/CashKYCSenderFactory.sol#L137\n`for (uint256 i = 0; i < exCallData.length; ++i) {`\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70//contracts/cash/factory/CashKYCSenderReceiverFactory.sol#L137\n`for (uint256 i = 0; i < exCallData.length; ++i) {`\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70//contracts/cash/kyc/KYCRegistry.sol#L163\n`for (uint256 i = 0; i < length; i++) {`\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70//contracts/cash/kyc/KYCRegistry.sol#L180\n`for (uint256 i = 0; i < length; i++) {`\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70//contracts/cash/CashManager.sol#L750\n`for (uint256 i = 0; i < size; ++i) {`\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70//contracts/cash/CashManager.sol#L786\n`for (uint256 i = 0; i < size; ++i) {`\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70//contracts/cash/CashManager.sol#L933\n`for (uint256 i = 0; i < size; ++i) {`\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70//contracts/cash/CashManager.sol#L961\n`for (uint256 i = 0; i < exCallData.length; ++i) {`\n\n### Mitigation\nAdd unchecked `++i` at the end of all the for loop where it's not expected to overflow and remove them from the for header\n\n## Store using `Struct` over multiple `mappings`\n### Summary\nAll these variables could be combine in a `Struct` in order to reduce the gas cost. \n\n### Details\nAs noticed in this [gist](https://gist.github.com/alexon1234/b101e3ac51b", "has_vulnerable_code_snippet": true, "fixed_code_actual": "- - - \n\nAll indexes are `fToken`\nhttps://github.com/code-423n4/2023-01-ondo/blob/12537cc94f4b0e9b213d53906aa2f95e425dd899/contracts/lending/OndoPriceOracleV2.sol#L54-L62\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "07-amphora", "title": "twcctop G", "severity_raw": "Medium", "severity": "medium", "description": "https://github.com/code-423n4/2023-07-amphora/blob/5d1cea9410db5448760c834f001af04a72edf3e0/core/solidity/contracts/core/Vault.sol#L188-L200\n```solidity\n\n for (uint256 _j; _j < _extraRewards;) {\n IVirtualBalanceRewardPool _virtualReward = _rewardsContract.extraRewards(_j);\n IERC20 _rewardToken = _virtualReward.rewardToken();\n uint256 _earnedReward = _virtualReward.earned(address(this));\n if (_earnedReward != 0) {\n _virtualReward.getReward();\n _rewardToken.transfer(_msgSender(), _earnedReward);\n emit ClaimedReward(address(_rewardToken), _earnedReward);\n }\n unchecked {\n ++_j;\n }\n }\n\n```\n\ntransfer token in loop, take all amount in one time transfer is better", "vulnerable_code": " for (uint256 _j; _j < _extraRewards;) {\n IVirtualBalanceRewardPool _virtualReward = _rewardsContract.extraRewards(_j);\n IERC20 _rewardToken = _virtualReward.rewardToken();\n uint256 _earnedReward = _virtualReward.earned(address(this));\n if (_earnedReward != 0) {\n _virtualReward.getReward();\n _rewardToken.transfer(_msgSender(), _earnedReward);\n emit ClaimedReward(address(_rewardToken), _earnedReward);\n }\n unchecked {\n ++_j;\n }\n }\n", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/twcctop-G.md", "collected_at": "2026-01-02T18:24:03.574191+00:00", "source_hash": "30a7e8404d3d72ecd12724f66a5a8fd90fcc9e4ef2fd2ffa2940fe84f1df0607", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 521, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "for (uint256 _j; _j < _extraRewards;) {\n IVirtualBalanceRewardPool _virtualReward = _rewardsContract.extraRewards(_j);\n IERC20 _rewardToken = _virtualReward.rewardToken();\n uint256 _earnedReward = _virtualReward.earned(address(this));\n if (_earnedReward != 0) {\n _virtualReward.getReward();\n _rewardToken.transfer(_msgSender(), _earnedReward);\n emit ClaimedReward(address(_rewardToken), _earnedReward);\n }\n unchecked {\n ++_j;\n }\n }", "primary_code_language": "solidity", "primary_code_char_count": 521, "all_code_blocks": "// Code block 1 (solidity):\nfor (uint256 _j; _j < _extraRewards;) {\n IVirtualBalanceRewardPool _virtualReward = _rewardsContract.extraRewards(_j);\n IERC20 _rewardToken = _virtualReward.rewardToken();\n uint256 _earnedReward = _virtualReward.earned(address(this));\n if (_earnedReward != 0) {\n _virtualReward.getReward();\n _rewardToken.transfer(_msgSender(), _earnedReward);\n emit ClaimedReward(address(_rewardToken), _earnedReward);\n }\n unchecked {\n ++_j;\n }\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "for (uint256 _j; _j < _extraRewards;) {\n IVirtualBalanceRewardPool _virtualReward = _rewardsContract.extraRewards(_j);\n IERC20 _rewardToken = _virtualReward.rewardToken();\n uint256 _earnedReward = _virtualReward.earned(address(this));\n if (_earnedReward != 0) {\n _virtualReward.getReward();\n _rewardToken.transfer(_msgSender(), _earnedReward);\n emit ClaimedReward(address(_rewardToken), _earnedReward);\n }\n unchecked {\n ++_j;\n }\n }", "github_refs_formatted": "Vault.sol#L188-L200", "github_files_list": "Vault.sol", "github_refs_count": 1, "vulnerable_code_actual": " for (uint256 _j; _j < _extraRewards;) {\n IVirtualBalanceRewardPool _virtualReward = _rewardsContract.extraRewards(_j);\n IERC20 _rewardToken = _virtualReward.rewardToken();\n uint256 _earnedReward = _virtualReward.earned(address(this));\n if (_earnedReward != 0) {\n _virtualReward.getReward();\n _rewardToken.transfer(_msgSender(), _earnedReward);\n emit ClaimedReward(address(_rewardToken), _earnedReward);\n }\n unchecked {\n ++_j;\n }\n }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.51} {"source": "c4", "protocol": "02-ethos", "title": "0x6980 Q", "severity_raw": "Low", "severity": "low", "description": "# 1. for modern and more readable code; update import usages\nContext:\n```js\n//File: Ethos-Core/contracts/CollateralConfig.sol\nimport \"./Dependencies/CheckContract.sol\";\nimport \"./Dependencies/Ownable.sol\";\nimport \"./Dependencies/SafeERC20.sol\";\nimport \"./Interfaces/ICollateralConfig.sol\";\n\n//File: Ethos-Core/contracts/BorrowerOperations.sol\nimport \"./Interfaces/IBorrowerOperations.sol\";\nimport \"./Interfaces/ICollateralConfig.sol\";\nimport \"./Interfaces/ITroveManager.sol\";\nimport \"./Interfaces/ILUSDToken.sol\";\nimport \"./Interfaces/ICollSurplusPool.sol\";\nimport \"./Interfaces/ISortedTroves.sol\";\nimport \"./Interfaces/ILQTYStaking.sol\";\nimport \"./Dependencies/LiquityBase.sol\";\nimport \"./Dependencies/Ownable.sol\";\nimport \"./Dependencies/CheckContract.sol\";\nimport \"./Dependencies/console.sol\";\nimport \"./Dependencies/SafeERC20.sol\";\n\n//File: Ethos-Core/contracts/TroveManager.sol\nimport \"./Interfaces/ICollateralConfig.sol\";\nimport \"./Interfaces/ITroveManager.sol\";\nimport \"./Interfaces/IStabilityPool.sol\";\nimport \"./Interfaces/ICollSurplusPool.sol\";\nimport \"./Interfaces/ILUSDToken.sol\";\nimport \"./Interfaces/ISortedTroves.sol\";\nimport \"./Interfaces/ILQTYStaking.sol\";\nimport \"./Interfaces/IRedemptionHelper.sol\";\nimport \"./Dependencies/LiquityBase.sol\";\n// import \"./Dependencies/Ownable.sol\";\nimport \"./Dependencies/CheckContract.sol\";\nimport \"./Dependencies/IERC20.sol\";\n\n//File: Ethos-Core/contracts/ActivePool.sol\nimport './Interfaces/IActivePool.sol';\nimport \"./Interfaces/ICollateralConfig.sol\";\nimport './Interfaces/IDefaultPool.sol';\nimport \"./Interfaces/ICollSurplusPool.sol\";\nimport \"./Interfaces/ILQTYStaking.sol\";\nimport \"./Interfaces/IStabilityPool.sol\";\nimport \"./Interfaces/ITroveManager.sol\";\nimport \"./Dependencies/SafeMath.sol\";\nimport \"./Dependencies/Ownable.sol\";\nimport \"./Dependencies/CheckContract.sol\";\nimport \"./Dependencies/console.sol\";\nimport \"./Dependencies/SafeERC20.sol\";\nimport \"./Dependencies/IERC4626.sol\";\n\n//File: Ethos-Core/contracts/StabilityPool.sol\nimpor", "vulnerable_code": "//File: Ethos-Core/contracts/CollateralConfig.sol\nimport \"./Dependencies/CheckContract.sol\";\nimport \"./Dependencies/Ownable.sol\";\nimport \"./Dependencies/SafeERC20.sol\";\nimport \"./Interfaces/ICollateralConfig.sol\";\n\n//File: Ethos-Core/contracts/BorrowerOperations.sol\nimport \"./Interfaces/IBorrowerOperations.sol\";\nimport \"./Interfaces/ICollateralConfig.sol\";\nimport \"./Interfaces/ITroveManager.sol\";\nimport \"./Interfaces/ILUSDToken.sol\";\nimport \"./Interfaces/ICollSurplusPool.sol\";\nimport \"./Interfaces/ISortedTroves.sol\";\nimport \"./Interfaces/ILQTYStaking.sol\";\nimport \"./Dependencies/LiquityBase.sol\";\nimport \"./Dependencies/Ownable.sol\";\nimport \"./Dependencies/CheckContract.sol\";\nimport \"./Dependencies/console.sol\";\nimport \"./Dependencies/SafeERC20.sol\";\n\n//File: Ethos-Core/contracts/TroveManager.sol\nimport \"./Interfaces/ICollateralConfig.sol\";\nimport \"./Interfaces/ITroveManager.sol\";\nimport \"./Interfaces/IStabilityPool.sol\";\nimport \"./Interfaces/ICollSurplusPool.sol\";\nimport \"./Interfaces/ILUSDToken.sol\";\nimport \"./Interfaces/ISortedTroves.sol\";\nimport \"./Interfaces/ILQTYStaking.sol\";\nimport \"./Interfaces/IRedemptionHelper.sol\";\nimport \"./Dependencies/LiquityBase.sol\";\n// import \"./Dependencies/Ownable.sol\";\nimport \"./Dependencies/CheckContract.sol\";\nimport \"./Dependencies/IERC20.sol\";\n\n//File: Ethos-Core/contracts/ActivePool.sol\nimport './Interfaces/IActivePool.sol';\nimport \"./Interfaces/ICollateralConfig.sol\";\nimport './Interfaces/IDefaultPool.sol';\nimport \"./Interfaces/ICollSurplusPool.sol\";\nimport \"./Interfaces/ILQTYStaking.sol\";\nimport \"./Interfaces/IStabilityPool.sol\";\nimport \"./Interfaces/ITroveManager.sol\";\nimport \"./Dependencies/SafeMath.sol\";\nimport \"./Dependencies/Ownable.sol\";\nimport \"./Dependencies/CheckContract.sol\";\nimport \"./Dependencies/console.sol\";\nimport \"./Dependencies/SafeERC20.sol\";\nimport \"./Dependencies/IERC4626.sol\";\n\n//File: Ethos-Core/contracts/StabilityPool.sol\nimport './Interfaces/IBorrowerOperations.sol';\nimport \"./Interfaces/ICollateralCo", "fixed_code": "# 2. Use underscores for number literals.\n- [TroveManager.sol#L54](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/TroveManager.sol#L54)\n- [ReaperVaultV2.sol#L41](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Vault/contracts/ReaperVaultV2.sol#L41)\nDescription:\nThere are occasions where certain numbers have been hardcoded, either in variable or in the code itself. Large numbers can become hard to read.\n\nRecommendation:\nConsider using underscores for number literals to improve its readability.\n# 3. Showing the actual values of numbers in natspec comments makes checking and reading code easier.\n- [ReaperBaseStrategyv4.sol#L24](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Vault/contracts/abstract/ReaperBaseStrategyv4.sol#L24)\n- [ReaperBaseStrategyv4.sol#L25](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Vault/contracts/abstract/ReaperBaseStrategyv4.sol#L25)", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/0x6980-Q.md", "collected_at": "2026-01-02T18:15:42.878508+00:00", "source_hash": "30debc659df96f268cebbb2ff20739e54ddbc9857f34ae5c1a32e1e8f50c6e74", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "TroveManager.sol#L54, ReaperVaultV2.sol#L41, ReaperBaseStrategyv4.sol#L24, ReaperBaseStrategyv4.sol#L25", "github_files_list": "TroveManager.sol, ReaperBaseStrategyv4.sol, ReaperVaultV2.sol", "github_refs_count": 4, "vulnerable_code_actual": "//File: Ethos-Core/contracts/CollateralConfig.sol\nimport \"./Dependencies/CheckContract.sol\";\nimport \"./Dependencies/Ownable.sol\";\nimport \"./Dependencies/SafeERC20.sol\";\nimport \"./Interfaces/ICollateralConfig.sol\";\n\n//File: Ethos-Core/contracts/BorrowerOperations.sol\nimport \"./Interfaces/IBorrowerOperations.sol\";\nimport \"./Interfaces/ICollateralConfig.sol\";\nimport \"./Interfaces/ITroveManager.sol\";\nimport \"./Interfaces/ILUSDToken.sol\";\nimport \"./Interfaces/ICollSurplusPool.sol\";\nimport \"./Interfaces/ISortedTroves.sol\";\nimport \"./Interfaces/ILQTYStaking.sol\";\nimport \"./Dependencies/LiquityBase.sol\";\nimport \"./Dependencies/Ownable.sol\";\nimport \"./Dependencies/CheckContract.sol\";\nimport \"./Dependencies/console.sol\";\nimport \"./Dependencies/SafeERC20.sol\";\n\n//File: Ethos-Core/contracts/TroveManager.sol\nimport \"./Interfaces/ICollateralConfig.sol\";\nimport \"./Interfaces/ITroveManager.sol\";\nimport \"./Interfaces/IStabilityPool.sol\";\nimport \"./Interfaces/ICollSurplusPool.sol\";\nimport \"./Interfaces/ILUSDToken.sol\";\nimport \"./Interfaces/ISortedTroves.sol\";\nimport \"./Interfaces/ILQTYStaking.sol\";\nimport \"./Interfaces/IRedemptionHelper.sol\";\nimport \"./Dependencies/LiquityBase.sol\";\n// import \"./Dependencies/Ownable.sol\";\nimport \"./Dependencies/CheckContract.sol\";\nimport \"./Dependencies/IERC20.sol\";\n\n//File: Ethos-Core/contracts/ActivePool.sol\nimport './Interfaces/IActivePool.sol';\nimport \"./Interfaces/ICollateralConfig.sol\";\nimport './Interfaces/IDefaultPool.sol';\nimport \"./Interfaces/ICollSurplusPool.sol\";\nimport \"./Interfaces/ILQTYStaking.sol\";\nimport \"./Interfaces/IStabilityPool.sol\";\nimport \"./Interfaces/ITroveManager.sol\";\nimport \"./Dependencies/SafeMath.sol\";\nimport \"./Dependencies/Ownable.sol\";\nimport \"./Dependencies/CheckContract.sol\";\nimport \"./Dependencies/console.sol\";\nimport \"./Dependencies/SafeERC20.sol\";\nimport \"./Dependencies/IERC4626.sol\";\n\n//File: Ethos-Core/contracts/StabilityPool.sol\nimport './Interfaces/IBorrowerOperations.sol';\nimport \"./Interfaces/ICollateralCo", "has_vulnerable_code_snippet": true, "fixed_code_actual": "# 2. Use underscores for number literals.\n- [TroveManager.sol#L54](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/TroveManager.sol#L54)\n- [ReaperVaultV2.sol#L41](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Vault/contracts/ReaperVaultV2.sol#L41)\nDescription:\nThere are occasions where certain numbers have been hardcoded, either in variable or in the code itself. Large numbers can become hard to read.\n\nRecommendation:\nConsider using underscores for number literals to improve its readability.\n# 3. Showing the actual values of numbers in natspec comments makes checking and reading code easier.\n- [ReaperBaseStrategyv4.sol#L24](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Vault/contracts/abstract/ReaperBaseStrategyv4.sol#L24)\n- [ReaperBaseStrategyv4.sol#L25](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Vault/contracts/abstract/ReaperBaseStrategyv4.sol#L25)", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "10-badger", "title": "ZanyBonzy G", "severity_raw": "Low", "severity": "low", "description": "### 1. It is cheaper to emit only once after the loop has finished.\n\n SortedCdps.sol [L451](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/SortedCdps.sol#L451)\n ```\n for (uint i = 0; i < _len; ++i) {\n delete data.nodes[_ids[i]];\n emit NodeRemoved(_ids[i]); //@gas \n }\n ```\n\n### 2. Multiple address/ID mappings can be combined into a single mapping of an address/ID to a struct, where appropriate\n\nEBTCtoken.sol [L50](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/EBTCToken.sol#L50)\n```\n // User data for EBTC token\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n```\n\nRolesAuthority.sol [L32](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/Dependencies/RolesAuthority.sol#L32)\n```\n mapping(address => bytes32) public getUserRoles;\n\n mapping(address => mapping(bytes4 => CapabilityFlag)) public capabilityFlag;\n\n mapping(address => mapping(bytes4 => bytes32)) public getRolesWithCapability;\n```\n\n### 3. Structs can be packed into fewer storage slots by truncating timestamp bytes for uint32 at the expense of breaking the protocol after the year 2106\n\nIPricFeed.sol [L17](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/Interfaces/IPriceFeed.sol#L17)\n```\nstruct ChainlinkResponse {\n uint80 roundEthBtcId;\n uint80 roundStEthEthId;\n uint256 answer;\n uint256 timestampEthBtc; //@note\n uint256 timestampStEthEth; //@note\n bool success;\n }\n```\n\nIPricFeed.sol [L26](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/Interfaces/IPriceFeed.sol#L26)\n```\n struct Fallb", "vulnerable_code": " for (uint i = 0; i < _len; ++i) {\n delete data.nodes[_ids[i]];\n emit NodeRemoved(_ids[i]); //@gas \n }\n ```\n\n### 2. Multiple address/ID mappings can be combined into a single mapping of an address/ID to a struct, where appropriate\n\nEBTCtoken.sol [L50](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/EBTCToken.sol#L50)", "fixed_code": "RolesAuthority.sol [L32](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/Dependencies/RolesAuthority.sol#L32)", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/ZanyBonzy-G.md", "collected_at": "2026-01-02T18:26:40.594555+00:00", "source_hash": "31404b9ccfad4af4af55cb15db92d301274862784be91b4b0d298ba52584b74c", "code_block_count": 4, "solidity_block_count": 0, "total_code_chars": 727, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "for (uint i = 0; i < _len; ++i) {\n delete data.nodes[_ids[i]];\n emit NodeRemoved(_ids[i]); //@gas \n }", "primary_code_language": "unknown", "primary_code_char_count": 139, "all_code_blocks": "// Code block 1 (unknown):\nfor (uint i = 0; i < _len; ++i) {\n delete data.nodes[_ids[i]];\n emit NodeRemoved(_ids[i]); //@gas \n }\n\n// Code block 2 (unknown):\n// User data for EBTC token\n mapping(address => uint256) private _balances;\n mapping(address => mapping(address => uint256)) private _allowances;\n\n// Code block 3 (unknown):\nmapping(address => bytes32) public getUserRoles;\n\n mapping(address => mapping(bytes4 => CapabilityFlag)) public capabilityFlag;\n\n mapping(address => mapping(bytes4 => bytes32)) public getRolesWithCapability;\n\n// Code block 4 (unknown):\nstruct ChainlinkResponse {\n uint80 roundEthBtcId;\n uint80 roundStEthEthId;\n uint256 answer;\n uint256 timestampEthBtc; //@note\n uint256 timestampStEthEth; //@note\n bool success;\n }", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SortedCdps.sol#L451, EBTCToken.sol#L50, RolesAuthority.sol#L32, IPriceFeed.sol#L17, IPriceFeed.sol#L26", "github_files_list": "SortedCdps.sol, RolesAuthority.sol, IPriceFeed.sol, EBTCToken.sol", "github_refs_count": 5, "vulnerable_code_actual": " for (uint i = 0; i < _len; ++i) {\n delete data.nodes[_ids[i]];\n emit NodeRemoved(_ids[i]); //@gas \n }\n ```\n\n### 2. Multiple address/ID mappings can be combined into a single mapping of an address/ID to a struct, where appropriate\n\nEBTCtoken.sol [L50](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/EBTCToken.sol#L50)", "has_vulnerable_code_snippet": true, "fixed_code_actual": "RolesAuthority.sol [L32](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/Dependencies/RolesAuthority.sol#L32)", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "02-ai-arena", "title": "BenasVol Q", "severity_raw": "Low", "severity": "low", "description": "# AI Arena QA Audit Report\n\nLead Auditors:\n\n- [Benas Volkovas](https://github.com/BenasVolkovas)\n\n# Table of Contents\n\n- [AI Arena QA Audit Report](#ai-arena-qa-audit-report)\n- [Table of Contents](#table-of-contents)\n- [Disclaimer](#disclaimer)\n- [Issues found](#issues-found)\n- [Findings](#findings)\n\n# Disclaimer\n\nI make all effort to find as many vulnerabilities in the code in the given time period, but holds no responsibilities for the findings provided in this document. A security audit is not an endorsement of the underlying business or product. The audit was time-boxed and the review of the code was solely on the security aspects of the Solidity implementation of the contracts.\n\n# Issues found\n\n| Severity | Number of issues found |\n| -------- | ---------------------- |\n| Low | 3 |\n| Info | 1 |\n| Total | 4 |\n\n# Findings\n\n## Low severity\n\n### [L-01] `MergingPool::getFighterPoints` can only return points for token id 0, which makes the function redundant and misleading\n\n**Description:** The `MergingPool::getFighterPoints` function is expected to return an array of points corresponding to the fighters' token IDs up to the specified maximum token ID. However, the return array `points` is only initialized with length of 1. If the `maxId` is greater than 1, the function will revert making it impossible to retrieve points for multiple fighters.\n\nAlso, the natspec documentation for the function is misleading as it states that `maxId` is the maximum token ID up to which the points will be retrieved. However, the loop inside only iterates up to `maxId - 1` and not including `maxId`.\n\n```javascript\n function getFighterPoints(uint256 maxId) public view returns(uint256[] memory) {\n@> uint256[] memory points = new uint256[](1);\n@> for (uint256 i = 0; i < maxId; i++) {\n points[i] = fighterPoints[i];\n }\n return points;\n }\n```\n\nReference: [MergingPool.s", "vulnerable_code": " function getFighterPoints(uint256 maxId) public view returns(uint256[] memory) {\n@> uint256[] memory points = new uint256[](1);\n@> for (uint256 i = 0; i < maxId; i++) {\n points[i] = fighterPoints[i];\n }\n return points;\n }", "fixed_code": "function test_audit_RevertsIfTryingToGet2FighterPoints() public {\n // owner mints a fighter by claiming\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_ownerAddress);\n assertEq(_fighterFarmContract.ownerOf(0), _ownerAddress);\n assertEq(_fighterFarmContract.ownerOf(1), _ownerAddress);\n\n // rankedeBattle contract adds points\n vm.startPrank(address(_rankedBattleContract));\n _mergingPoolContract.addPoints(0, 100);\n _mergingPoolContract.addPoints(1, 200);\n vm.stopPrank();\n\n assertEq(_mergingPoolContract.totalPoints(), 300);\n\n // getFighterPoints for owners fighter\n uint256 maxId = 2;\n vm.expectRevert(stdError.indexOOBError);\n _mergingPoolContract.getFighterPoints(maxId);\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/BenasVol-Q.md", "collected_at": "2026-01-02T19:02:16.125186+00:00", "source_hash": "31525349988dcf4e10a13fb9c10d90fb5bc5207acdcaa16cad9ef7c9acc9f973", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 259, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function getFighterPoints(uint256 maxId) public view returns(uint256[] memory) {\n@> uint256[] memory points = new uint256[](1);\n@> for (uint256 i = 0; i < maxId; i++) {\n points[i] = fighterPoints[i];\n }\n return points;\n }", "primary_code_language": "javascript", "primary_code_char_count": 259, "all_code_blocks": "// Code block 1 (javascript):\nfunction getFighterPoints(uint256 maxId) public view returns(uint256[] memory) {\n@> uint256[] memory points = new uint256[](1);\n@> for (uint256 i = 0; i < maxId; i++) {\n points[i] = fighterPoints[i];\n }\n return points;\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function getFighterPoints(uint256 maxId) public view returns(uint256[] memory) {\n@> uint256[] memory points = new uint256[](1);\n@> for (uint256 i = 0; i < maxId; i++) {\n points[i] = fighterPoints[i];\n }\n return points;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function test_audit_RevertsIfTryingToGet2FighterPoints() public {\n // owner mints a fighter by claiming\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_ownerAddress);\n assertEq(_fighterFarmContract.ownerOf(0), _ownerAddress);\n assertEq(_fighterFarmContract.ownerOf(1), _ownerAddress);\n\n // rankedeBattle contract adds points\n vm.startPrank(address(_rankedBattleContract));\n _mergingPoolContract.addPoints(0, 100);\n _mergingPoolContract.addPoints(1, 200);\n vm.stopPrank();\n\n assertEq(_mergingPoolContract.totalPoints(), 300);\n\n // getFighterPoints for owners fighter\n uint256 maxId = 2;\n vm.expectRevert(stdError.indexOOBError);\n _mergingPoolContract.getFighterPoints(maxId);\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "04-caviar", "title": "mariodev G", "severity_raw": "Gas", "severity": "gas", "description": "For all `for` loops, use prefix increment `++i` notation instead of postfix `i++`.\n\nAlthough minimal difference is observed, it is good practice to reduce as much as possible the amount of gas used if achieving the same functionality.\n\n### POC\n\n```solidity\n\ncontract One{\n uint256 public number;\n //Gas used : 43634\n function incrementByOne() public returns (uint256){\n return number++;\n }\n}\n\ncontract Two{\n uint256 public number;\n //Gas used : 43628\n function incrementByOne() public returns (uint256){\n return ++number;\n }\n}\n```\n\nSource: [Link](https://dev.to/jamiescript/gas-saving-techniques-in-solidity-324c#incrementing)", "vulnerable_code": "contract One{\n uint256 public number;\n //Gas used : 43634\n function incrementByOne() public returns (uint256){\n return number++;\n }\n}\n\ncontract Two{\n uint256 public number;\n //Gas used : 43628\n function incrementByOne() public returns (uint256){\n return ++number;\n }\n}", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/mariodev-G.md", "collected_at": "2026-01-02T18:20:39.171458+00:00", "source_hash": "317b4d8fae685739b18e5b892034a76e9cae4b99a3419db42b76846fe7621329", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 296, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "contract One{\n uint256 public number;\n //Gas used : 43634\n function incrementByOne() public returns (uint256){\n return number++;\n }\n}\n\ncontract Two{\n uint256 public number;\n //Gas used : 43628\n function incrementByOne() public returns (uint256){\n return ++number;\n }\n}", "primary_code_language": "solidity", "primary_code_char_count": 296, "all_code_blocks": "// Code block 1 (solidity):\ncontract One{\n uint256 public number;\n //Gas used : 43634\n function incrementByOne() public returns (uint256){\n return number++;\n }\n}\n\ncontract Two{\n uint256 public number;\n //Gas used : 43628\n function incrementByOne() public returns (uint256){\n return ++number;\n }\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "contract One{\n uint256 public number;\n //Gas used : 43634\n function incrementByOne() public returns (uint256){\n return number++;\n }\n}\n\ncontract Two{\n uint256 public number;\n //Gas used : 43628\n function incrementByOne() public returns (uint256){\n return ++number;\n }\n}", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "contract One{\n uint256 public number;\n //Gas used : 43634\n function incrementByOne() public returns (uint256){\n return number++;\n }\n}\n\ncontract Two{\n uint256 public number;\n //Gas used : 43628\n function incrementByOne() public returns (uint256){\n return ++number;\n }\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 3.31} {"source": "c4", "protocol": "03-asymmetry", "title": "Haipls Q", "severity_raw": "Low", "severity": "low", "description": "## Haven't require for add duplicate Derivative\nThe situation is aggravated by the fact that it is not possible to remove the derivative, only to exclude it from the calculations\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L182\n\n## Using the wrong OwnableUpgradeable initialization flow\n*Instances:*\n```solidity\ncontracts\\SafEth\\SafEth.sol\n\n53: _transferOwnership(msg.sender);\n```\n\nRecommendation:\n```solidity\n __Ownable_init()\n```\n\n\n## There are no methods to retrieve useful data for the user\nThe user can only check in manual mode whether it is profitable for him to `unstake` or not and how much he will receive eth in end\n\nRecommendation:\nAdd various auxiliary methods that will allow the user to calculate his final rewards, etc.\n\n\n## Owner can set incorrect settings\nThere is no validation for `setMinAmount` and `setMaxAmount`, `addDerivative` methods on valid input parameters.\n\nThe owner can mistakenly set 'minAmount > maxAmount', `maxAmount == 0` or set zero address to derivative, which will implicitly block the `stake` or `unstake` method\n\n*Instances*\n```solidity\ncontracts\\SafEth\\SafEth.sol\n\n214: function setMinAmount(uint256 _minAmount) external onlyOwner {\n215: minAmount = _minAmount;\n216: emit ChangeMinAmount(minAmount);\n217: }\n\n223: function setMaxAmount(uint256 _maxAmount) external onlyOwner {\n224: maxAmount = _maxAmount;\n225: emit ChangeMaxAmount(maxAmount);\n226: }\n```\nRecommendation:\nAdd at least that `_minAmount <= _maxAmount`, `_maxAmount > 0` requirement and check on zero address for `addDerivative`\n\n## Remove unused import\n*Instances*\n```solidity\ncontracts\\SafEth\\SafEth.sol\n\n4: import \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n5: import \"../interfaces/IWETH.sol\";\n6: import \"../interfaces/uniswap/ISwapRouter.sol\";\n7: import \"../interfaces/lido/IWStETH.sol\";\n8: import \"../interfaces/lido/IstETH.sol\";\n\ncontracts\\SafEth", "vulnerable_code": "contracts\\SafEth\\SafEth.sol\n\n53: _transferOwnership(msg.sender);", "fixed_code": " __Ownable_init()", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Haipls-Q.md", "collected_at": "2026-01-02T18:18:06.986314+00:00", "source_hash": "31c4852c3fe74d5875d061e954ace5c05cbad383d709c961b9dfb249b5f74bee", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 448, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "contracts\\SafEth\\SafEth.sol\n\n53: _transferOwnership(msg.sender);", "primary_code_language": "solidity", "primary_code_char_count": 71, "all_code_blocks": "// Code block 1 (solidity):\ncontracts\\SafEth\\SafEth.sol\n\n53: _transferOwnership(msg.sender);\n\n// Code block 2 (solidity):\n__Ownable_init()\n\n// Code block 3 (solidity):\ncontracts\\SafEth\\SafEth.sol\n\n214: function setMinAmount(uint256 _minAmount) external onlyOwner {\n215: minAmount = _minAmount;\n216: emit ChangeMinAmount(minAmount);\n217: }\n\n223: function setMaxAmount(uint256 _maxAmount) external onlyOwner {\n224: maxAmount = _maxAmount;\n225: emit ChangeMaxAmount(maxAmount);\n226: }", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "contracts\\SafEth\\SafEth.sol\n\n53: _transferOwnership(msg.sender);\n\n__Ownable_init()\n\ncontracts\\SafEth\\SafEth.sol\n\n214: function setMinAmount(uint256 _minAmount) external onlyOwner {\n215: minAmount = _minAmount;\n216: emit ChangeMinAmount(minAmount);\n217: }\n\n223: function setMaxAmount(uint256 _maxAmount) external onlyOwner {\n224: maxAmount = _maxAmount;\n225: emit ChangeMaxAmount(maxAmount);\n226: }", "github_refs_formatted": "SafEth.sol#L182", "github_files_list": "SafEth.sol", "github_refs_count": 1, "vulnerable_code_actual": "contracts\\SafEth\\SafEth.sol\n\n53: _transferOwnership(msg.sender);", "has_vulnerable_code_snippet": true, "fixed_code_actual": " __Ownable_init()", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "09-ondo", "title": "TomJ Q", "severity_raw": "Low", "severity": "low", "description": "## Table of Contents\n### Low Risk Issues\n- Consider adding checks of _sender and _recipient being different address for _transferShares() \n- BURNER_ROLE cannot burn when contract paused or cannot burn blocked user's share\n\n \n## Low Risk Issues\n### Consider adding checks of _sender and _recipient being different address for _transferShares() \n\nrUSDY.sol\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L514-L532\n\n#### Issue\nSince there is no input validation of _sender and _recipient being different address,\nit is possible to send shares within same addresses for transfer(), transferFrom() and transferShares().\nIt is ideal to add below check in _transferShares() to avoid user from executing meaningless transaction.\n```solidity\nrequire(_sender != _recipient, \"SAME_ADDRESS\");\n```\n\n \n### BURNER_ROLE cannot burn when contract paused or cannot burn blocked user's share\n\nrUSDY.sol\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L626-L655\n\n#### Issue\nOne of the reason that BURNER_ROLE can burn rUSDY tokens from any account is to be able to burn tokens that are compromised or stolen.\nIf this actually happens, then it is an emergency and protocol has to react to the incident as soon as possible. However executing \nburn function is not ideal for this situation since BURNER_ROLE has to specify exact amount of compromised/stolen amount as input parameter\n(if the amount is greater the function will revert and if its less then not of all compromised/stolen are burned).\nSo better approach is to pause a contract or add user account that stole the token to blocklist. However this cause another problem \nbecause BURNER_ROLE cannot burn rUSDY tokens when contract are paused or cannot burn blocked user's share.\nConsider changing burn function so that BURNER_ROLE can burn tokens even if contract are paused or burn tokens from blocklist user.\n\n \n", "vulnerable_code": "require(_sender != _recipient, \"SAME_ADDRESS\");", "fixed_code": "", "recommendation": "", "category": "validation", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/TomJ-Q.md", "collected_at": "2026-01-02T18:25:42.639716+00:00", "source_hash": "320f05828c3da824714fc5f791dbc043d050d53b03eb02bdfa16773c46bf7fcc", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 47, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "require(_sender != _recipient, \"SAME_ADDRESS\");", "primary_code_language": "solidity", "primary_code_char_count": 47, "all_code_blocks": "// Code block 1 (solidity):\nrequire(_sender != _recipient, \"SAME_ADDRESS\");", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "require(_sender != _recipient, \"SAME_ADDRESS\");", "github_refs_formatted": "rUSDY.sol#L514-L532, rUSDY.sol#L626-L655", "github_files_list": "rUSDY.sol", "github_refs_count": 2, "vulnerable_code_actual": "require(_sender != _recipient, \"SAME_ADDRESS\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "03-revert-lend", "title": "hunter_w3b Q", "severity_raw": "Medium", "severity": "medium", "description": "### L-1. In the `V3Oracle::getValue()` function, the `priceTokenX96` variable is calculated based on the `token` parameter passed to the function. However, when calculating the `value` and `feeValue` variables, the `priceTokenX96` variable is used regardless of whether the `token` parameter is `token0`, `token1`, or neither of them. This can lead to incorrect calculations of `value` and `feeValue` if the `token` parameter is not one of the tokens in the Uniswap V3 pool.\n\nhttps://github.com/code-423n4/2024-03-revert-lend/blob/main/src/V3Oracle.sol#L95-L131\n\n```solidity\n function getValue(uint256 tokenId, address token)\n external\n view\n override\n returns (uint256 value, uint256 feeValue, uint256 price0X96, uint256 price1X96)\n {\n (address token0, address token1, uint24 fee,, uint256 amount0, uint256 amount1, uint256 fees0, uint256 fees1) =\n getPositionBreakdown(tokenId);\n\n uint256 cachedChainlinkReferencePriceX96;\n\n (price0X96, cachedChainlinkReferencePriceX96) =\n _getReferenceTokenPriceX96(token0, cachedChainlinkReferencePriceX96);\n (price1X96, cachedChainlinkReferencePriceX96) =\n _getReferenceTokenPriceX96(token1, cachedChainlinkReferencePriceX96);\n\n uint256 priceTokenX96;\n if (token0 == token) {\n priceTokenX96 = price0X96;\n } else if (token1 == token) {\n priceTokenX96 = price1X96;\n } else {\n (priceTokenX96,) = _getReferenceTokenPriceX96(token, cachedChainlinkReferencePriceX96);\n }\n\n value = (price0X96 * (amount0 + fees0) / Q96 + price1X96 * (amount1 + fees1) / Q96) * Q96 / priceTokenX96;\n feeValue = (price0X96 * fees0 / Q96 + price1X96 * fees1 / Q96) * Q96 / priceTokenX96;\n price0X96 = price0X96 * Q96 / priceTokenX96;\n price1X96 = price1X96 * Q96 / priceTokenX96;\n\n // checks derived pool price for price manipulation attacks\n // this prevents manipulations of pool t", "vulnerable_code": " function getValue(uint256 tokenId, address token)\n external\n view\n override\n returns (uint256 value, uint256 feeValue, uint256 price0X96, uint256 price1X96)\n {\n (address token0, address token1, uint24 fee,, uint256 amount0, uint256 amount1, uint256 fees0, uint256 fees1) =\n getPositionBreakdown(tokenId);\n\n uint256 cachedChainlinkReferencePriceX96;\n\n (price0X96, cachedChainlinkReferencePriceX96) =\n _getReferenceTokenPriceX96(token0, cachedChainlinkReferencePriceX96);\n (price1X96, cachedChainlinkReferencePriceX96) =\n _getReferenceTokenPriceX96(token1, cachedChainlinkReferencePriceX96);\n\n uint256 priceTokenX96;\n if (token0 == token) {\n priceTokenX96 = price0X96;\n } else if (token1 == token) {\n priceTokenX96 = price1X96;\n } else {\n (priceTokenX96,) = _getReferenceTokenPriceX96(token, cachedChainlinkReferencePriceX96);\n }\n\n value = (price0X96 * (amount0 + fees0) / Q96 + price1X96 * (amount1 + fees1) / Q96) * Q96 / priceTokenX96;\n feeValue = (price0X96 * fees0 / Q96 + price1X96 * fees1 / Q96) * Q96 / priceTokenX96;\n price0X96 = price0X96 * Q96 / priceTokenX96;\n price1X96 = price1X96 * Q96 / priceTokenX96;\n\n // checks derived pool price for price manipulation attacks\n // this prevents manipulations of pool to get distorted proportions of collateral tokens - for borrowing\n // when a pool is in this state, liquidations will be disabled - but arbitrageurs (or liquidator himself)\n // will move price back to reasonable range and enable liquidation\n uint256 derivedPoolPriceX96 = price0X96 * Q96 / price1X96;\n _checkPoolPrice(token0, token1, fee, derivedPoolPriceX96);\n }", "fixed_code": " function _checkPoolPrice(address token0, address token1, uint24 fee, uint256 derivedPoolPriceX96) internal view {\n IUniswapV3Pool pool = _getPool(token0, token1, fee);\n uint256 priceX96 = _getReferencePoolPriceX96(pool, 0);\n _requireMaxDifference(priceX96, derivedPoolPriceX96, maxPoolPriceDifference);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/hunter_w3b-Q.md", "collected_at": "2026-01-02T19:03:12.325863+00:00", "source_hash": "3212bc7750047b47e1219f96797cc67db5ea66709eecd31361cda06d450b3550", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "V3Oracle.sol#L95-L131", "github_files_list": "V3Oracle.sol", "github_refs_count": 1, "vulnerable_code_actual": " function getValue(uint256 tokenId, address token)\n external\n view\n override\n returns (uint256 value, uint256 feeValue, uint256 price0X96, uint256 price1X96)\n {\n (address token0, address token1, uint24 fee,, uint256 amount0, uint256 amount1, uint256 fees0, uint256 fees1) =\n getPositionBreakdown(tokenId);\n\n uint256 cachedChainlinkReferencePriceX96;\n\n (price0X96, cachedChainlinkReferencePriceX96) =\n _getReferenceTokenPriceX96(token0, cachedChainlinkReferencePriceX96);\n (price1X96, cachedChainlinkReferencePriceX96) =\n _getReferenceTokenPriceX96(token1, cachedChainlinkReferencePriceX96);\n\n uint256 priceTokenX96;\n if (token0 == token) {\n priceTokenX96 = price0X96;\n } else if (token1 == token) {\n priceTokenX96 = price1X96;\n } else {\n (priceTokenX96,) = _getReferenceTokenPriceX96(token, cachedChainlinkReferencePriceX96);\n }\n\n value = (price0X96 * (amount0 + fees0) / Q96 + price1X96 * (amount1 + fees1) / Q96) * Q96 / priceTokenX96;\n feeValue = (price0X96 * fees0 / Q96 + price1X96 * fees1 / Q96) * Q96 / priceTokenX96;\n price0X96 = price0X96 * Q96 / priceTokenX96;\n price1X96 = price1X96 * Q96 / priceTokenX96;\n\n // checks derived pool price for price manipulation attacks\n // this prevents manipulations of pool to get distorted proportions of collateral tokens - for borrowing\n // when a pool is in this state, liquidations will be disabled - but arbitrageurs (or liquidator himself)\n // will move price back to reasonable range and enable liquidation\n uint256 derivedPoolPriceX96 = price0X96 * Q96 / price1X96;\n _checkPoolPrice(token0, token1, fee, derivedPoolPriceX96);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function _checkPoolPrice(address token0, address token1, uint24 fee, uint256 derivedPoolPriceX96) internal view {\n IUniswapV3Pool pool = _getPool(token0, token1, fee);\n uint256 priceX96 = _getReferencePoolPriceX96(pool, 0);\n _requireMaxDifference(priceX96, derivedPoolPriceX96, maxPoolPriceDifference);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "02-ethos", "title": "MohammedRizwan Q", "severity_raw": "Critical", "severity": "critical", "description": "## Summary\n\n### Low Risk Issues\n|Number|Issue|Instances| |\n|-|:-|:-:|:-:| \n| [L‑01] | should change decimal type to uint8 | 1 |\n| [L‑02] | Zero address and Zero msg.value(zero amount) checks are missing | 1 |\n| [L‑03] | Internal functions only called once can be inlined, code restructuring. | 1 |\n| [L‑04] | Missing check to ensure distribution period is not set as zero | 1 |\n| [L‑05] | Critical Addresses Changes should adopt two-step address change procedure | 3 |\n| [L‑06] | Used Hardcoded address causes no future updates and changes | 4 |\n\n### Non-Critical Issues\n|Number|Issue|Instances| |\n|-|:-|:-:|:-:| \n| [N‑01] | checkContract( ) dependencies can be used instead of require( ) | 1 |\n| [N‑02] | pauseMinting/unPauseMinting functions should emit event to notify users | 1 |\n| [N‑03] | Function writing that does not comply with the Solidity Style Guide | - |\n| [N‑04] | Do not use floting solidity compiler version. Lock the solidity compiler version | 4 |\n| [N‑05] | Events for critical change is missing | 1 |\n| [N‑06] | Use scientific notation rather than exponentiation | 2 |\n\n### Low Risk Issues\n### [L‑01] should change decimal type to uint8\nThe decimals of Config struct is uint256 and the function getCollateralDecimals ( ) also returns the uint256. But the decimals are usually type of uint8, referring IERC20 dependency used in contract.\n\n```solidity\nFile: Ethos-Core/contracts/CollateralConfig.sol\n\n27 struct Config {\n28 bool allowed;\n29 uint256 decimals;\n30 uint256 MCR;\n31 uint256 CCR;\n32 }\n\n---\n110 function getCollateralDecimals(\n111 address _collateral\n112 ) external override view checkCollateral(_collateral) returns (uint256) {\n113 return collateralConfig[_collateral].decimals;\n114 }\n```\nhttps://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/CollateralConfig.sol", "vulnerable_code": "File: Ethos-Core/contracts/CollateralConfig.sol\n\n27 struct Config {\n28 bool allowed;\n29 uint256 decimals;\n30 uint256 MCR;\n31 uint256 CCR;\n32 }\n\n---\n110 function getCollateralDecimals(\n111 address _collateral\n112 ) external override view checkCollateral(_collateral) returns (uint256) {\n113 return collateralConfig[_collateral].decimals;\n114 }", "fixed_code": "File: Ethos-Core/contracts/CollateralConfig.sol\n\n63 uint256 decimals = IERC20(collateral).decimals();", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/MohammedRizwan-Q.md", "collected_at": "2026-01-02T18:16:22.501476+00:00", "source_hash": "322f30b19bd64459e3b47d62a75381e1fa6421916235148422892865e9ea30b3", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 399, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: Ethos-Core/contracts/CollateralConfig.sol\n\n27 struct Config {\n28 bool allowed;\n29 uint256 decimals;\n30 uint256 MCR;\n31 uint256 CCR;\n32 }\n\n---\n110 function getCollateralDecimals(\n111 address _collateral\n112 ) external override view checkCollateral(_collateral) returns (uint256) {\n113 return collateralConfig[_collateral].decimals;\n114 }", "primary_code_language": "solidity", "primary_code_char_count": 399, "all_code_blocks": "// Code block 1 (solidity):\nFile: Ethos-Core/contracts/CollateralConfig.sol\n\n27 struct Config {\n28 bool allowed;\n29 uint256 decimals;\n30 uint256 MCR;\n31 uint256 CCR;\n32 }\n\n---\n110 function getCollateralDecimals(\n111 address _collateral\n112 ) external override view checkCollateral(_collateral) returns (uint256) {\n113 return collateralConfig[_collateral].decimals;\n114 }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: Ethos-Core/contracts/CollateralConfig.sol\n\n27 struct Config {\n28 bool allowed;\n29 uint256 decimals;\n30 uint256 MCR;\n31 uint256 CCR;\n32 }\n\n---\n110 function getCollateralDecimals(\n111 address _collateral\n112 ) external override view checkCollateral(_collateral) returns (uint256) {\n113 return collateralConfig[_collateral].decimals;\n114 }", "github_refs_formatted": "CollateralConfig.sol", "github_files_list": "CollateralConfig.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: Ethos-Core/contracts/CollateralConfig.sol\n\n27 struct Config {\n28 bool allowed;\n29 uint256 decimals;\n30 uint256 MCR;\n31 uint256 CCR;\n32 }\n\n---\n110 function getCollateralDecimals(\n111 address _collateral\n112 ) external override view checkCollateral(_collateral) returns (uint256) {\n113 return collateralConfig[_collateral].decimals;\n114 }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: Ethos-Core/contracts/CollateralConfig.sol\n\n63 uint256 decimals = IERC20(collateral).decimals();", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ethos", "title": "parsely Q", "severity_raw": "Medium", "severity": "medium", "description": "# [N-01] Consider in certain instances only importing only what is needed rather than using global imports.\n### Context\nAll contracts\n### Description\nImporting only what is necessary is preferred above global imports\n\n### Recommendation\n```import {contractName} from \"theContractFile.sol\";```\n\n# [N-02] NatSpec comments should be added to public contracts\n### Context\nAll public contracts eg. BorrowerOperations\n### Description\nAccording to the Solidity documentation it is recommended for all public contracts to have NatSpec comments added.\n### Recommendation\nAdd NatSpec comments to the contracts that may be interacted with. \n\n# [N-03] Remove unused import of Ownable in TroveManager.sol\n### Context\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L14\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L18\n### Description\nThe reference and import for Ownable is commented out.\n### Recommendation\nRemove unused import and reference to Ownable.\n\n# [N-04] Remove unused import of console\n### Context\n```\nLUSDToken.sol:9:import \"./Dependencies/console.sol\";\nStabilityPool.sol:18:import \"./Dependencies/console.sol\";\nLQTY/LQTYStaking.sol:9:import \"../Dependencies/console.sol\";\nBorrowerOperations.sol:15:import \"./Dependencies/console.sol\";\nActivePool.sol:15:import \"./Dependencies/console.sol\";\n```\n### Description\nIt does not seem that the logging function is used within the code.\n### Recommendation\nRemove unused imports.\n\n# [N-05] Once the setAddresses function is called there is no way to correct any incorrect addresses\n### Context\n```\nLQTY/LQTYStaking.sol:66: function setAddresses\nLQTY/CommunityIssuance.sol:61: function setAddresses\nTroveManager.sol:232: function setAddresses(\nBorrowerOperations.sol:110: function setAddresses(\nActivePool.sol:71: function setAddresses(\n```\n### Description\nOnce the setAddresses function has been called the ownership is changed to address(0) and there ", "vulnerable_code": "# [N-02] NatSpec comments should be added to public contracts\n### Context\nAll public contracts eg. BorrowerOperations\n### Description\nAccording to the Solidity documentation it is recommended for all public contracts to have NatSpec comments added.\n### Recommendation\nAdd NatSpec comments to the contracts that may be interacted with. \n\n# [N-03] Remove unused import of Ownable in TroveManager.sol\n### Context\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L14\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L18\n### Description\nThe reference and import for Ownable is commented out.\n### Recommendation\nRemove unused import and reference to Ownable.\n\n# [N-04] Remove unused import of console\n### Context", "fixed_code": "### Description\nIt does not seem that the logging function is used within the code.\n### Recommendation\nRemove unused imports.\n\n# [N-05] Once the setAddresses function is called there is no way to correct any incorrect addresses\n### Context", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/parsely-Q.md", "collected_at": "2026-01-02T18:17:27.997795+00:00", "source_hash": "324afe99d7bcdb61f2bee7ec3f6abaa2fb64718a2a21ed1eb6b4f9b701806192", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 1033, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "# [N-02] NatSpec comments should be added to public contracts\n### Context\nAll public contracts eg. BorrowerOperations\n### Description\nAccording to the Solidity documentation it is recommended for all public contracts to have NatSpec comments added.\n### Recommendation\nAdd NatSpec comments to the contracts that may be interacted with. \n\n# [N-03] Remove unused import of Ownable in TroveManager.sol\n### Context\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L14\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L18\n### Description\nThe reference and import for Ownable is commented out.\n### Recommendation\nRemove unused import and reference to Ownable.\n\n# [N-04] Remove unused import of console\n### Context", "primary_code_language": "unknown", "primary_code_char_count": 794, "all_code_blocks": "// Code block 1 (unknown):\n# [N-02] NatSpec comments should be added to public contracts\n### Context\nAll public contracts eg. BorrowerOperations\n### Description\nAccording to the Solidity documentation it is recommended for all public contracts to have NatSpec comments added.\n### Recommendation\nAdd NatSpec comments to the contracts that may be interacted with. \n\n# [N-03] Remove unused import of Ownable in TroveManager.sol\n### Context\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L14\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L18\n### Description\nThe reference and import for Ownable is commented out.\n### Recommendation\nRemove unused import and reference to Ownable.\n\n# [N-04] Remove unused import of console\n### Context\n\n// Code block 2 (unknown):\n### Description\nIt does not seem that the logging function is used within the code.\n### Recommendation\nRemove unused imports.\n\n# [N-05] Once the setAddresses function is called there is no way to correct any incorrect addresses\n### Context", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "TroveManager.sol#L14, TroveManager.sol#L18", "github_files_list": "TroveManager.sol", "github_refs_count": 2, "vulnerable_code_actual": "# [N-02] NatSpec comments should be added to public contracts\n### Context\nAll public contracts eg. BorrowerOperations\n### Description\nAccording to the Solidity documentation it is recommended for all public contracts to have NatSpec comments added.\n### Recommendation\nAdd NatSpec comments to the contracts that may be interacted with. \n\n# [N-03] Remove unused import of Ownable in TroveManager.sol\n### Context\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L14\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L18\n### Description\nThe reference and import for Ownable is commented out.\n### Recommendation\nRemove unused import and reference to Ownable.\n\n# [N-04] Remove unused import of console\n### Context", "has_vulnerable_code_snippet": true, "fixed_code_actual": "### Description\nIt does not seem that the logging function is used within the code.\n### Recommendation\nRemove unused imports.\n\n# [N-05] Once the setAddresses function is called there is no way to correct any incorrect addresses\n### Context", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "04-caviar", "title": "PNS Q", "severity_raw": "Critical", "severity": "critical", "description": "# Low Risk\n\n## Missing checks for `address(0x0)` when assigning values to address state variables\n\n```solidity\nFile: src/EthRouter.sol\n90: constructor(address _royaltyRegistry) {\n91: royaltyRegistry = _royaltyRegistry;\n92: }\n```\n```solidity\nFile: src/PrivatePool.sol\n143: constructor(address _factory, address _royaltyRegistry, address _stolenNftOracle) {\n144: factory = payable(_factory);\n145: royaltyRegistry = _royaltyRegistry;\n146: stolenNftOracle = _stolenNftOracle;\n147: }\n```\n```solidity\nFile: src/PrivatePool.sol\n175: baseToken = _baseToken;\n176: nft = _nft;\n```\n\n## Consider `isContract` checks in constructors\nSeveral addresses are assigned in the contract constructors and assigned to immutable variables. A successful deployment is sensitive to these addresses being assigned correctly for the current network, and that addresses were specified in the correct order. Consider adding checks, as aggressively as possible for the use case, to help ensure the deployment configuration is correct.\n`.isContract()` is referring to the [OZ Address library](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Address.sol#L40) or similar implementation.\n\n```solidity\nFile: src/EthRouter.sol\n90: constructor(address _royaltyRegistry) {\n91: royaltyRegistry = _royaltyRegistry;\n92: }\n```\n```solidity\nFile: src/PrivatePool.sol\n143: constructor(address _factory, address _royaltyRegistry, address _stolenNftOracle) {\n144: factory = payable(_factory);\n145: royaltyRegistry = _royaltyRegistry;\n146: stolenNftOracle = _stolenNftOracle;\n147: }\n```\n\n# Non-Critical\n\n## `public` functions not called by the contract should be declared `external` instead\n```solidity\nFile: src/EthRouter.sol\n99: function buy(Buy[] calldata buys, uint256 deadline, bool payRoyalties) public payable {\n...\n152: function sell(Sell[] calldata sells, uint256 minOutputAmount, uin", "vulnerable_code": "File: src/EthRouter.sol\n90: constructor(address _royaltyRegistry) {\n91: royaltyRegistry = _royaltyRegistry;\n92: }", "fixed_code": "File: src/PrivatePool.sol\n143: constructor(address _factory, address _royaltyRegistry, address _stolenNftOracle) {\n144: factory = payable(_factory);\n145: royaltyRegistry = _royaltyRegistry;\n146: stolenNftOracle = _stolenNftOracle;\n147: }", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/PNS-Q.md", "collected_at": "2026-01-02T18:19:56.627880+00:00", "source_hash": "325800dc0a8fcfdf83eb848629f9f0f5431309c378e87c74b03b94c44c9c8205", "code_block_count": 5, "solidity_block_count": 5, "total_code_chars": 883, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: src/EthRouter.sol\n90: constructor(address _royaltyRegistry) {\n91: royaltyRegistry = _royaltyRegistry;\n92: }", "primary_code_language": "solidity", "primary_code_char_count": 129, "all_code_blocks": "// Code block 1 (solidity):\nFile: src/EthRouter.sol\n90: constructor(address _royaltyRegistry) {\n91: royaltyRegistry = _royaltyRegistry;\n92: }\n\n// Code block 2 (solidity):\nFile: src/PrivatePool.sol\n143: constructor(address _factory, address _royaltyRegistry, address _stolenNftOracle) {\n144: factory = payable(_factory);\n145: royaltyRegistry = _royaltyRegistry;\n146: stolenNftOracle = _stolenNftOracle;\n147: }\n\n// Code block 3 (solidity):\nFile: src/PrivatePool.sol\n175: baseToken = _baseToken;\n176: nft = _nft;\n\n// Code block 4 (solidity):\nFile: src/EthRouter.sol\n90: constructor(address _royaltyRegistry) {\n91: royaltyRegistry = _royaltyRegistry;\n92: }\n\n// Code block 5 (solidity):\nFile: src/PrivatePool.sol\n143: constructor(address _factory, address _royaltyRegistry, address _stolenNftOracle) {\n144: factory = payable(_factory);\n145: royaltyRegistry = _royaltyRegistry;\n146: stolenNftOracle = _stolenNftOracle;\n147: }", "all_code_blocks_count": 5, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: src/EthRouter.sol\n90: constructor(address _royaltyRegistry) {\n91: royaltyRegistry = _royaltyRegistry;\n92: }\n\nFile: src/PrivatePool.sol\n143: constructor(address _factory, address _royaltyRegistry, address _stolenNftOracle) {\n144: factory = payable(_factory);\n145: royaltyRegistry = _royaltyRegistry;\n146: stolenNftOracle = _stolenNftOracle;\n147: }\n\nFile: src/PrivatePool.sol\n175: baseToken = _baseToken;\n176: nft = _nft;\n\nFile: src/EthRouter.sol\n90: constructor(address _royaltyRegistry) {\n91: royaltyRegistry = _royaltyRegistry;\n92: }\n\nFile: src/PrivatePool.sol\n143: constructor(address _factory, address _royaltyRegistry, address _stolenNftOracle) {\n144: factory = payable(_factory);\n145: royaltyRegistry = _royaltyRegistry;\n146: stolenNftOracle = _stolenNftOracle;\n147: }", "github_refs_formatted": "Address.sol#L40", "github_files_list": "Address.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: src/EthRouter.sol\n90: constructor(address _royaltyRegistry) {\n91: royaltyRegistry = _royaltyRegistry;\n92: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: src/PrivatePool.sol\n143: constructor(address _factory, address _royaltyRegistry, address _stolenNftOracle) {\n144: factory = payable(_factory);\n145: royaltyRegistry = _royaltyRegistry;\n146: stolenNftOracle = _stolenNftOracle;\n147: }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 11} {"source": "c4", "protocol": "06-lybra", "title": "BRONZEDISC Q", "severity_raw": "Medium", "severity": "medium", "description": "## QA\n---\n\n### Layout Order [1]\n\n- The best-practices for layout within a contract is the following order: state variables, events, modifiers, constructor and functions.\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/miner/EUSDMiningIncentives.sol\n\n```solidity\n72: modifier updateReward(address _account) {\n```\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/miner/ProtocolRewardsPool.sol\n\n```solidity\n// modifier should come before constructor\n178: modifier updateReward(address account) {\n```\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/miner/stakerewardV2pool.sol\n\n```solidity\n// modifier coming after constructor\n56: modifier updateReward(address _account) {\n```\n\n---\n\n### Function Visibility [2]\n\n- Order of Functions: Ordering helps readers identify which functions they can call and to find the constructor and fallback definitions easier. Functions should be grouped according to their visibility and ordered: constructor, receive function (if exists), fallback function (if exists), public, external, internal, private. Within a grouping, place the view and pure functions last.\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/base/LybraPeUSDVaultBase.sol\n\n```solidity\n// internal function coming before some public and external ones\n173: function _mintPeUSD(address _provider, address _onBehalfOf, uint256 _mintAmount, uint256 _assetPrice) internal virtual {\n192: function _repay(address _provider, address _onBehalfOf, uint256 _amount) internal virtual {\n212: function _withdraw(address _provider, address _onBehalfOf, uint256 _amount) internal {\n225: function _checkHealth(address user, uint256 price) internal view {\n230: function _updateFee(address user) internal {\n237: function _newFee(address user) internal view returns (uint256) {\n244: function _etherPrice() internal returns (uint256) {\n\n// public functions coming after internal and external ones", "vulnerable_code": "72: modifier updateReward(address _account) {", "fixed_code": "// modifier should come before constructor\n178: modifier updateReward(address account) {", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/BRONZEDISC-Q.md", "collected_at": "2026-01-02T18:22:12.299724+00:00", "source_hash": "326817af0de2e45d336d3f7c3a8ccad84d43183392d98092b8c638323714cd7a", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 224, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "72: modifier updateReward(address _account) {", "primary_code_language": "solidity", "primary_code_char_count": 48, "all_code_blocks": "// Code block 1 (solidity):\n72: modifier updateReward(address _account) {\n\n// Code block 2 (solidity):\n// modifier should come before constructor\n178: modifier updateReward(address account) {\n\n// Code block 3 (solidity):\n// modifier coming after constructor\n56: modifier updateReward(address _account) {", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "72: modifier updateReward(address _account) {\n\n// modifier should come before constructor\n178: modifier updateReward(address account) {\n\n// modifier coming after constructor\n56: modifier updateReward(address _account) {", "github_refs_formatted": "EUSDMiningIncentives.sol, ProtocolRewardsPool.sol, stakerewardV2pool.sol, LybraPeUSDVaultBase.sol", "github_files_list": "EUSDMiningIncentives.sol, LybraPeUSDVaultBase.sol, ProtocolRewardsPool.sol, stakerewardV2pool.sol", "github_refs_count": 4, "vulnerable_code_actual": "72: modifier updateReward(address _account) {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "// modifier should come before constructor\n178: modifier updateReward(address account) {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "01-biconomy", "title": "IllIllI Q", "severity_raw": "Critical", "severity": "critical", "description": "\n\n## Summary\n\n### Low Risk Issues\n| |Issue|Instances|\n|-|:-|:-:|\n| [L‑01] | Upgradeable contract not initialized | 1 | \n| [L‑02] | Not all parent contracts are upgradeable | 4 | \n| [L‑03] | Loss of precision | 1 | \n| [L‑04] | Signatures vulnerable | 1 | \n| [L‑05] | Empty `receive()`/`payable fallback()` function does not authorize requests | 1 | \n| [L‑06] | `require()` should be used instead of `assert()` | 2 | \n| [L‑07] | Open TODOs | 1 | \n\nTotal: 11 instances over 7 issues\n\n\n### Non-critical Issues\n| |Issue|Instances|\n|-|:-|:-:|\n| [N‑01] | Upgradeable contract is missing a `__gap[50]` storage variable to allow for new storage variables in later versions | 1 | \n| [N‑02] | Import declarations should import specific identifiers, rather than the whole file | 54 | \n| [N‑03] | Missing `initializer` modifier on constructor | 1 | \n| [N‑04] | Unused file | 2 | \n| [N‑05] | Adding a `return` statement when the function defines a named return variable, is redundant | 1 | \n| [N‑06] | `override` function arguments that are unused should have the variable name removed or commented out to avoid compiler warnings | 3 | \n| [N‑07] | Non-assembly method available | 2 | \n| [N‑08] | `constant`s should be defined rather than using magic numbers | 192 | \n| [N‑09] | Missing event and or timelock for critical parameter change | 2 | \n| [N‑10] | Events that mark critical parameter changes should contain both the old and the new value | 3 | \n| [N‑11] | Use a more recent version of solidity | 5 | \n| [N‑12] | Use scientific notation (e.g. `1e18`) rather than exponentiation (e.g. `10**18`) | 13 | \n| [N‑13] | Constant redefined elsewhere | 2 | \n| [N‑14] | Inconsistent spacing in comments | 30 | \n| [N‑15] | Lines are too long | 12 | \n| [N‑16] | Non-library/interface files should use fixed compiler versions, not floating ones | 2 | \n| [N&#x", "vulnerable_code": "File: scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n\n/// @audit missing __ReentrancyGuard_init()\n18: contract SmartAccount is \n", "fixed_code": "File: scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n\n/// @audit ModuleManager\n/// @audit SignatureDecoder\n/// @audit SecuredTokenTransfer\n/// @audit FallbackManager\n18: contract SmartAccount is \n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/IllIllI-Q.md", "collected_at": "2026-01-02T18:13:07.127872+00:00", "source_hash": "328aca61c9f60984c0b74dbc57a3aa35fe2991ff26c5cba6c8e7106b3f82d7db", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n\n/// @audit missing __ReentrancyGuard_init()\n18: contract SmartAccount is \n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n\n/// @audit ModuleManager\n/// @audit SignatureDecoder\n/// @audit SecuredTokenTransfer\n/// @audit FallbackManager\n18: contract SmartAccount is \n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "02-ai-arena", "title": "0xblackskull Q", "severity_raw": "Low", "severity": "low", "description": "### `_setupRole` is deprecated in favor of `_grantRole` in `Neuron.sol`\n- addMinter()\n- addStaker()\n- addSpender()\n\n### No check for 0 or 1 in FighterFarm::incrementGeneration \n```\n/// @param fighterType Type of fighter either 0 or 1 (champion or dendroid).\n```\n\n```solidity\nfunction incrementGeneration(uint8 fighterType) external returns (uint8) {\n require(msg.sender == _ownerAddress);\n generation[fighterType] += 1;\n maxRerollsAllowed[fighterType] += 1;\n return generation[fighterType];\n }\n```\nBut there is no check for fighterType would be 0 or 1, owner can trigger it by using any value. So add require check for fighterType is either 0 or 1\n```\nrequire(fighterType == 0 || fighterType == 1);\n```\n\n", "vulnerable_code": "/// @param fighterType Type of fighter either 0 or 1 (champion or dendroid).", "fixed_code": "function incrementGeneration(uint8 fighterType) external returns (uint8) {\n require(msg.sender == _ownerAddress);\n generation[fighterType] += 1;\n maxRerollsAllowed[fighterType] += 1;\n return generation[fighterType];\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/0xblackskull-Q.md", "collected_at": "2026-01-02T19:02:07.367958+00:00", "source_hash": "3328ccaf99d178c6430164a39adc88df63e7b9107520835b319e9bad5f138984", "code_block_count": 3, "solidity_block_count": 1, "total_code_chars": 371, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "/// @param fighterType Type of fighter either 0 or 1 (champion or dendroid).", "primary_code_language": "unknown", "primary_code_char_count": 76, "all_code_blocks": "// Code block 1 (unknown):\n/// @param fighterType Type of fighter either 0 or 1 (champion or dendroid).\n\n// Code block 2 (solidity):\nfunction incrementGeneration(uint8 fighterType) external returns (uint8) {\n require(msg.sender == _ownerAddress);\n generation[fighterType] += 1;\n maxRerollsAllowed[fighterType] += 1;\n return generation[fighterType];\n }\n\n// Code block 3 (unknown):\nrequire(fighterType == 0 || fighterType == 1);", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function incrementGeneration(uint8 fighterType) external returns (uint8) {\n require(msg.sender == _ownerAddress);\n generation[fighterType] += 1;\n maxRerollsAllowed[fighterType] += 1;\n return generation[fighterType];\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "/// @param fighterType Type of fighter either 0 or 1 (champion or dendroid).", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function incrementGeneration(uint8 fighterType) external returns (uint8) {\n require(msg.sender == _ownerAddress);\n generation[fighterType] += 1;\n maxRerollsAllowed[fighterType] += 1;\n return generation[fighterType];\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6.47} {"source": "c4", "protocol": "10-badger", "title": "cheatc0d3 Q", "severity_raw": "Low", "severity": "low", "description": "#### `transferSystemCollShares` function can be more optimized\n\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/ActivePool.sol#L100\n\n```solidity\nfunction transferSystemCollShares(address _account, uint256 _shares) public override {\n require(_account != address(0), \"Zero account address\");\n require(_shares > 0, \"Zero shares\");\n _requireCallerIsBOorCdpM();\n // Rest of the function code\n}\n```\n\n#### `transferSystemCollSharesAndLiquidatorReward` function can be more optimized\n\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/ActivePool.sol#L129\n\n```solidity\nfunction transferSystemCollSharesAndLiquidatorReward(\n address _account,\n uint256 _shares,\n uint256 _liquidatorRewardShares\n) external override {\n require(_account != address(0), \"Zero account address\");\n require(_shares > 0, \"Zero shares\");\n _requireCallerIsBOorCdpM();\n // Rest of the function code\n}\n```\n\n#### `allocateSystemCollSharesToFeeRecipient` function can be more optimized\n\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/ActivePool.sol#L157\n\n```solidity\nfunction allocateSystemCollSharesToFeeRecipient(uint256 _shares) external override {\n require(_shares > 0, \"Zero shares\");\n _requireCallerIsCdpManager();\n // Rest of the function code\n}\n```\n\n#### `increaseSystemDebt` function can be more optimized\n\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/ActivePool.sol#L194\n\n```solidity\nfunction increaseSystemDebt(uint256 _amount) external override {\n require(_amount > 0, \"Zero increase amount\");\n _requireCallerIsBOorCdpM();\n // Rest of the function code\n}\n```\n\n#### `decreaseSystemDebt` function can be more optimized\n\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/ActivePool.sol#L207\n\n```solidity\nfunction decreaseSystemDebt(uint256 _amount) external override {\n require(_amount > 0, \"Zero d", "vulnerable_code": "function transferSystemCollShares(address _account, uint256 _shares) public override {\n require(_account != address(0), \"Zero account address\");\n require(_shares > 0, \"Zero shares\");\n _requireCallerIsBOorCdpM();\n // Rest of the function code\n}", "fixed_code": "function transferSystemCollSharesAndLiquidatorReward(\n address _account,\n uint256 _shares,\n uint256 _liquidatorRewardShares\n) external override {\n require(_account != address(0), \"Zero account address\");\n require(_shares > 0, \"Zero shares\");\n _requireCallerIsBOorCdpM();\n // Rest of the function code\n}", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/cheatc0d3-Q.md", "collected_at": "2026-01-02T18:26:44.619482+00:00", "source_hash": "33363720cd56690d07304513f8fc9ed885fafca0db5b55a50e1bc6b5b0a92e96", "code_block_count": 4, "solidity_block_count": 4, "total_code_chars": 953, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function transferSystemCollShares(address _account, uint256 _shares) public override {\n require(_account != address(0), \"Zero account address\");\n require(_shares > 0, \"Zero shares\");\n _requireCallerIsBOorCdpM();\n // Rest of the function code\n}", "primary_code_language": "solidity", "primary_code_char_count": 255, "all_code_blocks": "// Code block 1 (solidity):\nfunction transferSystemCollShares(address _account, uint256 _shares) public override {\n require(_account != address(0), \"Zero account address\");\n require(_shares > 0, \"Zero shares\");\n _requireCallerIsBOorCdpM();\n // Rest of the function code\n}\n\n// Code block 2 (solidity):\nfunction transferSystemCollSharesAndLiquidatorReward(\n address _account,\n uint256 _shares,\n uint256 _liquidatorRewardShares\n) external override {\n require(_account != address(0), \"Zero account address\");\n require(_shares > 0, \"Zero shares\");\n _requireCallerIsBOorCdpM();\n // Rest of the function code\n}\n\n// Code block 3 (solidity):\nfunction allocateSystemCollSharesToFeeRecipient(uint256 _shares) external override {\n require(_shares > 0, \"Zero shares\");\n _requireCallerIsCdpManager();\n // Rest of the function code\n}\n\n// Code block 4 (solidity):\nfunction increaseSystemDebt(uint256 _amount) external override {\n require(_amount > 0, \"Zero increase amount\");\n _requireCallerIsBOorCdpM();\n // Rest of the function code\n}", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function transferSystemCollShares(address _account, uint256 _shares) public override {\n require(_account != address(0), \"Zero account address\");\n require(_shares > 0, \"Zero shares\");\n _requireCallerIsBOorCdpM();\n // Rest of the function code\n}\n\nfunction transferSystemCollSharesAndLiquidatorReward(\n address _account,\n uint256 _shares,\n uint256 _liquidatorRewardShares\n) external override {\n require(_account != address(0), \"Zero account address\");\n require(_shares > 0, \"Zero shares\");\n _requireCallerIsBOorCdpM();\n // Rest of the function code\n}\n\nfunction allocateSystemCollSharesToFeeRecipient(uint256 _shares) external override {\n require(_shares > 0, \"Zero shares\");\n _requireCallerIsCdpManager();\n // Rest of the function code\n}\n\nfunction increaseSystemDebt(uint256 _amount) external override {\n require(_amount > 0, \"Zero increase amount\");\n _requireCallerIsBOorCdpM();\n // Rest of the function code\n}", "github_refs_formatted": "ActivePool.sol#L100, ActivePool.sol#L129, ActivePool.sol#L157, ActivePool.sol#L194, ActivePool.sol#L207", "github_files_list": "ActivePool.sol", "github_refs_count": 5, "vulnerable_code_actual": "function transferSystemCollShares(address _account, uint256 _shares) public override {\n require(_account != address(0), \"Zero account address\");\n require(_shares > 0, \"Zero shares\");\n _requireCallerIsBOorCdpM();\n // Rest of the function code\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function transferSystemCollSharesAndLiquidatorReward(\n address _account,\n uint256 _shares,\n uint256 _liquidatorRewardShares\n) external override {\n require(_account != address(0), \"Zero account address\");\n require(_shares > 0, \"Zero shares\");\n _requireCallerIsBOorCdpM();\n // Rest of the function code\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "03-asymmetry", "title": "Ignite Q", "severity_raw": "Critical", "severity": "critical", "description": "# Low Issues\n\n| |\tIssues Details | Instances |\n|---|---|---|\n| [Low-1] | Loss of Precision due to rounding | 1 |\n| [Low-2] | Function Parameters Without Bounds | 1 |\n| [Low-3] | Missing deadline checks in `swapExactInputSingleHop()` function | 1 |\n| [Low-4] | Lack of zero address checks | 4 | \n| [Low-5] | Pragma Float | All Contracts |\n\n## [Low-1] Loss of Precision due to rounding\nIn the `stake` function, the ethAmount is calculated by `(msg.value * weight) / totalWeight` at line 88. Due to a potential loss of precision when rounding, there is a possibility that some wei may remain in the `SafEth` contract.\n\nFor instance, consider the following initial state:\n`msg.value` = 200;\n`weights[0]` = 10;\n`weights[1]` = 20;\n`weights[2]` = 30;\n`totalWeight` = 60;\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L84-L88\n```solidity=84\n for (uint i = 0; i < derivativeCount; i++) {\n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight == 0) continue;\n uint256 ethAmount = (msg.value * weight) / totalWeight;\n```\n\nIn this scenario, the `ethAmount` values would be `33`, `66`, and `99` for the three iterations of the loop, respectively. Therefore, there would be small wei left in the `SafETH` contract since `200 - (33 + 66 + 99) = 2` (without slippage).\n\n### Recommendation\nTransfer the remaining wei back to the sender.\n\nOtherwise, use a different mechanism to allocate funds, instead of calculating `ethAmount` based on weights, the contract could use a fixed price for each derivative or allow users to specify the exact amount of ETH they want to allocate to each derivative.\n\n## [Low-2] Function Parameters Without Bounds\nThe function can be called with any input value for those parameters, regardless of whether they are valid or reasonable. This can lead to unexpected behavior or even security vulnerabilities if the function does not properly validate or sanitize its input parameters.\nF", "vulnerable_code": "In this scenario, the `ethAmount` values would be `33`, `66`, and `99` for the three iterations of the loop, respectively. Therefore, there would be small wei left in the `SafETH` contract since `200 - (33 + 66 + 99) = 2` (without slippage).\n\n### Recommendation\nTransfer the remaining wei back to the sender.\n\nOtherwise, use a different mechanism to allocate funds, instead of calculating `ethAmount` based on weights, the contract could use a fixed price for each derivative or allow users to specify the exact amount of ETH they want to allocate to each derivative.\n\n## [Low-2] Function Parameters Without Bounds\nThe function can be called with any input value for those parameters, regardless of whether they are valid or reasonable. This can lead to unexpected behavior or even security vulnerabilities if the function does not properly validate or sanitize its input parameters.\nFor example:\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L202-L208", "fixed_code": "### Recommendation\nDefine limits or constraints on function parameters to prevent unintended consequences.\n\n## [Low-3] Missing deadline checks in `swapExactInputSingleHop()` function\n\nThe `swapExactInputSingleHop()` function lacks a deadline for its actions that execute swaps on the `deposit()` function. This missing feature can result in pending transactions being executed later, potentially leading to outdated slippage.\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L83-L89", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Ignite-Q.md", "collected_at": "2026-01-02T18:18:08.820738+00:00", "source_hash": "33a33110b5d6e579169242be1bad9671bc66d4ecd101bba4de8f143e804e62ce", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol#L84-L88, SafEth.sol#L202-L208, Reth.sol#L83-L89", "github_files_list": "Reth.sol, SafEth.sol", "github_refs_count": 3, "vulnerable_code_actual": "In this scenario, the `ethAmount` values would be `33`, `66`, and `99` for the three iterations of the loop, respectively. Therefore, there would be small wei left in the `SafETH` contract since `200 - (33 + 66 + 99) = 2` (without slippage).\n\n### Recommendation\nTransfer the remaining wei back to the sender.\n\nOtherwise, use a different mechanism to allocate funds, instead of calculating `ethAmount` based on weights, the contract could use a fixed price for each derivative or allow users to specify the exact amount of ETH they want to allocate to each derivative.\n\n## [Low-2] Function Parameters Without Bounds\nThe function can be called with any input value for those parameters, regardless of whether they are valid or reasonable. This can lead to unexpected behavior or even security vulnerabilities if the function does not properly validate or sanitize its input parameters.\nFor example:\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L202-L208", "has_vulnerable_code_snippet": true, "fixed_code_actual": "### Recommendation\nDefine limits or constraints on function parameters to prevent unintended consequences.\n\n## [Low-3] Missing deadline checks in `swapExactInputSingleHop()` function\n\nThe `swapExactInputSingleHop()` function lacks a deadline for its actions that execute swaps on the `deposit()` function. This missing feature can result in pending transactions being executed later, potentially leading to outdated slippage.\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L83-L89", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-biconomy", "title": "arialblack14 G", "severity_raw": "High", "severity": "high", "description": "# GAS OPTIMIZATION REPORT \u26fd\n\n## [G-1] `require()`/`revert()` strings longer than 32 bytes cost extras gas.\n\n### Description\nEach extra chunk of bytes past the original 32 incurs an MSTORE which costs 3 gas\n\n### \u2705 Recommendation\nConsider the following require statement:\n```Solidity\n// condition is boolean\n// str is a string\nrequire(condition, str)\n```\nThe string str is split into 32-byte sized chunks and then stored in `memory` using `mstore`, then the `memory` offsets are provided to `revert(offset, length)`. For chunks shorter than 32 bytes, and for low --optimize-runs value (usually even the default value of 200), instead of `push32 val`, where `val` is the 32 byte hexadecimal representation of the string with 0 padding on the least significant bits, the solidity compiler replaces it by `shl(value, short-value))`. Where `short-value` does not have any 0 padding. This saves the total bytes in the deploy code and therefore saves deploy time cost, at the expense of extra 6 gas during runtime. This means that shorter revert strings saves deploy time costs of the contract. Note that this kind of saving is not relevant for high values of --optimize-runs as `push32 value` will not be replaced by a `shl(..., ...)` equivalent by the Solidity compiler.\nGoing back, each 32 byte chunk of the string requires an extra `mstore`. That is, additional cost for `mstore`, `memory` expansion costs, as well as stack operations. Note that, this runtime cost is only relevant when the revert condition is met.\nOverall, shorter revert strings can save deploy time as well as runtime costs.\n\n### \ud83d\udd0d Findings:\n| | |\n|---|---|\n|2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L77|[require(msg.sender == owner, \"Smart Account:: Sender is not authorized\");](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L77 )|\n|2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L110|[r", "vulnerable_code": "// condition is boolean\n// str is a string\nrequire(condition, str)", "fixed_code": "for (uint i = 0; i < length; i++) {\n// do something that doesn't change the value of i\n}", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/arialblack14-G.md", "collected_at": "2026-01-02T18:13:30.571663+00:00", "source_hash": "33fb6fe0ccf1bd1a876f2dc24ea602a66ca54f8cd1b11a86757d040814bff628", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 66, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "// condition is boolean\n// str is a string\nrequire(condition, str)", "primary_code_language": "Solidity", "primary_code_char_count": 66, "all_code_blocks": "// Code block 1 (Solidity):\n// condition is boolean\n// str is a string\nrequire(condition, str)", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "// condition is boolean\n// str is a string\nrequire(condition, str)", "github_refs_formatted": "SmartAccount.sol#L77", "github_files_list": "SmartAccount.sol", "github_refs_count": 1, "vulnerable_code_actual": "// condition is boolean\n// str is a string\nrequire(condition, str)", "has_vulnerable_code_snippet": true, "fixed_code_actual": "for (uint i = 0; i < length; i++) {\n// do something that doesn't change the value of i\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "05-ajna", "title": "yongskiws G", "severity_raw": "High", "severity": "high", "description": "### Gas Optimizations Issues List\n| Number |Issues Details|Instance|\n|:--:|:-------|:--:|\n|[G-01]| Using unchecked blocks to save gas | 9 |\n|[G-02]| Use calldata instead of memory for function parameters | 4 |\n|[G-03]| Use hardcode address instead address(this) | 1 |\n|[G-04]| Sort Solidity operations using short-circuit mode | 8 |\n|[G-05]| Using unchecked blocks to save gas - Increments in for loop can be unchecked ( save 30-40 gas per loop iteration) | 1 |\n|[G-06]| Using storage instead of memory for structs/arrays saves gas | 10 |\n|[G-07]| screeningVote: requests[proposal_.distributionId] should be cached in local storage | 1 |\n|[G-08]| Using immutable for uint & address for save gas | - |\n|[G-09]| internal functions not called by the contract should be removed to save deployment gas | 6 |\n|[G-10]| x = x + y is cheaper than x += y; | 3 |\n|[G-11]| Usage of uints/ints smaller than 32 bytes (256 bits) incurs overhead | 7 |\n|[G-12]| Using > 0 costs more gas than != 0 when used on a uint in a require() statement | 7 |\n|[G-13]| >= costs less gas than > | 1 |\n|[G-14]| Change public function visibility to external | 1 |\n\n## [G-01] Using unchecked blocks to save gas\n\nSolidity version 0.8+ comes with implicit overflow and underflow checks on unsigned integers. When an overflow or an underflow isn\u2019t possible (as an example, when a comparison is made before the arithmetic operation), some gas can be saved by using an unchecked block\nhttps://github.com/ethereum/solidity/issues/10695\n\nGas Saved For Using unchecked blocks to save gas\n\nThe above should be modified to:\n\n9 results - 3 files:\n\n\n``` diff\n\najna\\ExtraordinaryFunding.sol\n172: return\n173: // succeeded if proposal's votes received doesn't exceed the minimum threshold required\n174: (votesReceived >= tokensRequested_ + _getSliceOfNonTreasury(minThresholdPercentage))\n175: &&\n176: // succeeded if tokens requested are available for claiming from the treasury\n177: ", "vulnerable_code": "## [G-02] Use calldata instead of memory for function parameters\n\nIn some cases, having function arguments in calldata instead of memory is more optimal.\n\nConsider the following generic example:\n", "fixed_code": "In the above example, the dynamic array arr has the storage location memory. When the function gets called externally, the array values are kept in calldata and copied to memory during ABI decoding (using the opcode calldataload and mstore). And during the for loop, arr[i] accesses the value in memory using a mload. However, for the above example this is inefficient. Consider the following snippet instead:\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/yongskiws-G.md", "collected_at": "2026-01-02T18:21:53.828504+00:00", "source_hash": "3413de07689dd69b675ca68fadb7d49bed358d2d6629e1cb1a113be7d4dc9f73", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "## [G-02] Use calldata instead of memory for function parameters\n\nIn some cases, having function arguments in calldata instead of memory is more optimal.\n\nConsider the following generic example:\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "In the above example, the dynamic array arr has the storage location memory. When the function gets called externally, the array values are kept in calldata and copied to memory during ABI decoding (using the opcode calldataload and mstore). And during the for loop, arr[i] accesses the value in memory using a mload. However, for the above example this is inefficient. Consider the following snippet instead:\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "08-dopex", "title": "0xrafaelnicolau Q", "severity_raw": "Low", "severity": "low", "description": "# [L-01] Insufficient input validation let's users mint a free bond\nIf a user calls the `bondWithDelegate` function with empty arrays for both `_amounts` and `_delegateIds`, unintendedly, a Bond with zero amount will be minted to the user.\n\n## PoC\n```solidity\ncontract Exploit is Setup {\n function testBondWithDelegateEmptyArrays() external {\n // create empty arrays to pass as arguments\n uint256[] memory _amounts = new uint256[](0);\n uint256[] memory _delegateIds = new uint256[](0);\n\n // calls bondWithDelegate\n rdpxV2Core.bondWithDelegate(address(this), _amounts, _delegateIds, 0);\n\n // assert that the user was able to mint a bond (although the bond has 0 amount).\n assertEq(rdpxV2Bond.balanceOf(address(this)), 1);\n }\n} \n```\n\n## Recommended Mitigation\nSince the function `bondWithDelegate` already checks the length of `_amounts` and `_delegateIds` arrays are the same, consider adding a check to ensure that one of the arrays has a non-zero length.\n\n```solidity\nfunction bondWithDelegate(\n address _to,\n uint256[] memory _amounts,\n uint256[] memory _delegateIds,\n uint256 rdpxBondId\n ) public returns (uint256 receiptTokenAmount, uint256[] memory) {\n _whenNotPaused();\n // Validate amount\n _validate(_amounts.length == _delegateIds.length, 3);\n+ _validate(_amounts.length != 0, 3);\n\n ...\n }\n```", "vulnerable_code": "contract Exploit is Setup {\n function testBondWithDelegateEmptyArrays() external {\n // create empty arrays to pass as arguments\n uint256[] memory _amounts = new uint256[](0);\n uint256[] memory _delegateIds = new uint256[](0);\n\n // calls bondWithDelegate\n rdpxV2Core.bondWithDelegate(address(this), _amounts, _delegateIds, 0);\n\n // assert that the user was able to mint a bond (although the bond has 0 amount).\n assertEq(rdpxV2Bond.balanceOf(address(this)), 1);\n }\n} ", "fixed_code": "function bondWithDelegate(\n address _to,\n uint256[] memory _amounts,\n uint256[] memory _delegateIds,\n uint256 rdpxBondId\n ) public returns (uint256 receiptTokenAmount, uint256[] memory) {\n _whenNotPaused();\n // Validate amount\n _validate(_amounts.length == _delegateIds.length, 3);\n+ _validate(_amounts.length != 0, 3);\n\n ...\n }", "recommendation": "", "category": "validation", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/0xrafaelnicolau-Q.md", "collected_at": "2026-01-02T18:24:26.788133+00:00", "source_hash": "34241cae45b9a5f3a1cf642874ce69009db9d312af245cd31b2ef24b189fe7ca", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 876, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "contract Exploit is Setup {\n function testBondWithDelegateEmptyArrays() external {\n // create empty arrays to pass as arguments\n uint256[] memory _amounts = new uint256[](0);\n uint256[] memory _delegateIds = new uint256[](0);\n\n // calls bondWithDelegate\n rdpxV2Core.bondWithDelegate(address(this), _amounts, _delegateIds, 0);\n\n // assert that the user was able to mint a bond (although the bond has 0 amount).\n assertEq(rdpxV2Bond.balanceOf(address(this)), 1);\n }\n}", "primary_code_language": "solidity", "primary_code_char_count": 520, "all_code_blocks": "// Code block 1 (solidity):\ncontract Exploit is Setup {\n function testBondWithDelegateEmptyArrays() external {\n // create empty arrays to pass as arguments\n uint256[] memory _amounts = new uint256[](0);\n uint256[] memory _delegateIds = new uint256[](0);\n\n // calls bondWithDelegate\n rdpxV2Core.bondWithDelegate(address(this), _amounts, _delegateIds, 0);\n\n // assert that the user was able to mint a bond (although the bond has 0 amount).\n assertEq(rdpxV2Bond.balanceOf(address(this)), 1);\n }\n}\n\n// Code block 2 (solidity):\nfunction bondWithDelegate(\n address _to,\n uint256[] memory _amounts,\n uint256[] memory _delegateIds,\n uint256 rdpxBondId\n ) public returns (uint256 receiptTokenAmount, uint256[] memory) {\n _whenNotPaused();\n // Validate amount\n _validate(_amounts.length == _delegateIds.length, 3);\n+ _validate(_amounts.length != 0, 3);\n\n ...\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "contract Exploit is Setup {\n function testBondWithDelegateEmptyArrays() external {\n // create empty arrays to pass as arguments\n uint256[] memory _amounts = new uint256[](0);\n uint256[] memory _delegateIds = new uint256[](0);\n\n // calls bondWithDelegate\n rdpxV2Core.bondWithDelegate(address(this), _amounts, _delegateIds, 0);\n\n // assert that the user was able to mint a bond (although the bond has 0 amount).\n assertEq(rdpxV2Bond.balanceOf(address(this)), 1);\n }\n}\n\nfunction bondWithDelegate(\n address _to,\n uint256[] memory _amounts,\n uint256[] memory _delegateIds,\n uint256 rdpxBondId\n ) public returns (uint256 receiptTokenAmount, uint256[] memory) {\n _whenNotPaused();\n // Validate amount\n _validate(_amounts.length == _delegateIds.length, 3);\n+ _validate(_amounts.length != 0, 3);\n\n ...\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "contract Exploit is Setup {\n function testBondWithDelegateEmptyArrays() external {\n // create empty arrays to pass as arguments\n uint256[] memory _amounts = new uint256[](0);\n uint256[] memory _delegateIds = new uint256[](0);\n\n // calls bondWithDelegate\n rdpxV2Core.bondWithDelegate(address(this), _amounts, _delegateIds, 0);\n\n // assert that the user was able to mint a bond (although the bond has 0 amount).\n assertEq(rdpxV2Bond.balanceOf(address(this)), 1);\n }\n} ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function bondWithDelegate(\n address _to,\n uint256[] memory _amounts,\n uint256[] memory _delegateIds,\n uint256 rdpxBondId\n ) public returns (uint256 receiptTokenAmount, uint256[] memory) {\n _whenNotPaused();\n // Validate amount\n _validate(_amounts.length == _delegateIds.length, 3);\n+ _validate(_amounts.length != 0, 3);\n\n ...\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6.77} {"source": "c4", "protocol": "01-ondo", "title": "CodingNameKiki Q", "severity_raw": "Critical", "severity": "critical", "description": "### Issues Template\n| Letter | Name | Description |\n|:--:|:-------:|:-------:|\n| L | Low risk | Potential risk |\n| NC | Non-critical | Non risky findings |\n| R | Refactor | Changing the code |\n| O | Ordinary | Often found issues |\n\n| Total Found Issues | 33 |\n|:--:|:--:|\n\n### Low Risk Template\n| Count | Explanation | Instances |\n|:--:|:-------|:--:|\n| [L-01] | Unnecessary KYC check on the payer | 1 |\n| [L-02] | Wrong if statement in the function `_acceptAdmin` | 1 |\n| [L-03] | Token transfer to address(0) should be avoided | 1 |\n| [L-04] | The maximum fee of 10_000 isn't allowed in the function `setMintFee` | 1 |\n| [L-05] | Giving KYC status to address(0) should be forbidden | 1 |\n| [L-06] | Redeem limit shouldn't be set below the `currentMintAmount` | 1 |\n| [L-07] | `completeRedemptions` is vulnerable to admin mistakes | 1 |\n\n| Total Low Risk Issues | 7 |\n|:--:|:--:|\n\n### Non-Critical Template\n| Count | Explanation | Instances |\n|:--:|:-------|:--:|\n| [N-01] | Mandatory checks for extra safety | 3 |\n| [N-02] | Constructor lacks address(0) check | 5 |\n| [N-03] | Unrealistic if statement | 9 |\n| [N-04] | Missing check to ensure epoch duration isn't set as zero seconds | 1 |\n| [N-05] | Upgradeable contract is missing a __gap[50] storage variable | 2 |\n| [N-06] | Create your own import names instead of using the regular ones | 19 | \n| [N-07] | Initialize function does not use the initializer modifier | 2 |\n| [N-08] | Use delete to clear variables instead of zero assignment | 2 |\n| [N-09] | Confusing function comment on `setMinimumDepositAmount` | 1 |\n| [N-10] | Unnecessary if statement in `_checkAndUpdateRedeemLimit` | 1 |\n| [N-11] | Pause/Unpause functions should emit event to notify users | 2 |\n| [N-12] | Two KYC checks made on the same redeemers | 1 |\n| [N-13] | Unused constructor | 2 |\n| [N-14] | NatSpec is incomplete in the pausing functions | 2 |\n\n| Total Non-Critical Issues | 14 |\n|:--:|:--:|\n\n### Refactor Issues Template\n| Count | Explanation | Instances |\n|", "vulnerable_code": "contracts/lending/tokens/cCash/CCash.sol\n\n121: function repayBorrowBehalf(\n122: address borrower,\n123: uint repayAmount\n124: ) external override returns (uint) {\n125: repayBorrowBehalfInternal(borrower, repayAmount);\n126: return NO_ERROR;\n127: }\n\ncontracts/lending/tokens/cCash/CTokenCash.sol\n\n767: function repayBorrowFresh(\n768: address payer,\n769: address borrower,\n770: uint repayAmount\n771: ) internal returns (uint) {\n772: /* Revert if not KYC'd */\n773: require(_getKYCStatus(payer), \"Payer not KYC'd\");\n774: require(_getKYCStatus(borrower), \"Borrower not KYC'd\");", "fixed_code": "function _acceptAdmin() external override returns (uint) {\n // Check caller is pendingAdmin and pendingAdmin \u2260 address(0)\n if (msg.sender != pendingAdmin || msg.sender == address(0)) {\n revert AcceptAdminPendingAdminCheck();\n }\n\n // Save current values for inclusion in log\n address oldAdmin = admin;\n address oldPendingAdmin = pendingAdmin;\n\n // Store admin with value pendingAdmin\n admin = pendingAdmin;\n\n // Clear the pending value\n pendingAdmin = payable(address(0));\n\n emit NewAdmin(oldAdmin, admin);\n emit NewPendingAdmin(oldPendingAdmin, pendingAdmin);\n\n return NO_ERROR;\n }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/CodingNameKiki-Q.md", "collected_at": "2026-01-02T18:14:33.770141+00:00", "source_hash": "344e5e02d6d0f832ff8ffb009dc9eaad6f2a9e96093756acf33edc58548ed70a", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "contracts/lending/tokens/cCash/CCash.sol\n\n121: function repayBorrowBehalf(\n122: address borrower,\n123: uint repayAmount\n124: ) external override returns (uint) {\n125: repayBorrowBehalfInternal(borrower, repayAmount);\n126: return NO_ERROR;\n127: }\n\ncontracts/lending/tokens/cCash/CTokenCash.sol\n\n767: function repayBorrowFresh(\n768: address payer,\n769: address borrower,\n770: uint repayAmount\n771: ) internal returns (uint) {\n772: /* Revert if not KYC'd */\n773: require(_getKYCStatus(payer), \"Payer not KYC'd\");\n774: require(_getKYCStatus(borrower), \"Borrower not KYC'd\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function _acceptAdmin() external override returns (uint) {\n // Check caller is pendingAdmin and pendingAdmin \u2260 address(0)\n if (msg.sender != pendingAdmin || msg.sender == address(0)) {\n revert AcceptAdminPendingAdminCheck();\n }\n\n // Save current values for inclusion in log\n address oldAdmin = admin;\n address oldPendingAdmin = pendingAdmin;\n\n // Store admin with value pendingAdmin\n admin = pendingAdmin;\n\n // Clear the pending value\n pendingAdmin = payable(address(0));\n\n emit NewAdmin(oldAdmin, admin);\n emit NewPendingAdmin(oldPendingAdmin, pendingAdmin);\n\n return NO_ERROR;\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "09-ondo", "title": "Breeje Q", "severity_raw": "High", "severity": "high", "description": " QA Report\n\n## Low Risk Issues\n| Count | Explanation |\n|:--:|:-------|\n| [L-01] | No checks to confirm that the gas paid by user is enough | \n| [L-02] | In case `DestinationBridge` is paused before `SourceBridge`, User can lose funds | \n| [L-03] | No incentive for approvers to approve can lead to issues in long term | \n| [L-04] | Possible Reorg situation in `rUSDYFactory` | \n\n| Total Low Risk Issues | 4 |\n|:--:|:--:|\n\n### [L-01] No checks to confirm that the gas paid by user is enough\n\n## Proof of Concept\n\nIn `SourceBridge` contract, When any user calls `burnAndCallAxelar`:\n\n1. `TOKEN`s are burned from caller.\n2. Gas Fees passed by user is paid through `payNativeGasForContractCall`.\n3. `callContract` call is made to transfer the token cross chain.\n\n```solidity\n\n function burnAndCallAxelar( \n uint256 amount,\n string calldata destinationChain\n ) external payable whenNotPaused {\n string memory destContract = destChainToContractAddr[destinationChain];\n\n if (bytes(destContract).length == 0) {\n revert DestinationNotSupported();\n }\n\n if (msg.value == 0) {\n revert GasFeeTooLow();\n }\n\n TOKEN.burnFrom(msg.sender, amount);\n\n bytes memory payload = abi.encode(VERSION, msg.sender, amount, nonce++);\n\n _payGasAndCallContract(destinationChain, destContract, payload);\n }\n\n function _payGasAndCallContract(\n string calldata destinationChain,\n string memory destContract,\n bytes memory payload\n ) private {\n GAS_RECEIVER.payNativeGasForContractCall{value: msg.value}(\n address(this),\n destinationChain,\n destContract,\n payload,\n msg.sender\n );\n\n AXELAR_GATEWAY.callContract(destinationChain, destContract, payload);\n }\n\n```\n\nHere, there is no validation that the Gas Fees paid by user is sufficient to transfer the token cross chain or not.\n\n## Impact\n\nThere are transaction won't be successful at the destination chain because of lack of gas fees paid. User might need to manually call \n\n## Recommended", "vulnerable_code": " function burnAndCallAxelar( \n uint256 amount,\n string calldata destinationChain\n ) external payable whenNotPaused {\n string memory destContract = destChainToContractAddr[destinationChain];\n\n if (bytes(destContract).length == 0) {\n revert DestinationNotSupported();\n }\n\n if (msg.value == 0) {\n revert GasFeeTooLow();\n }\n\n TOKEN.burnFrom(msg.sender, amount);\n\n bytes memory payload = abi.encode(VERSION, msg.sender, amount, nonce++);\n\n _payGasAndCallContract(destinationChain, destContract, payload);\n }\n\n function _payGasAndCallContract(\n string calldata destinationChain,\n string memory destContract,\n bytes memory payload\n ) private {\n GAS_RECEIVER.payNativeGasForContractCall{value: msg.value}(\n address(this),\n destinationChain,\n destContract,\n payload,\n msg.sender\n );\n\n AXELAR_GATEWAY.callContract(destinationChain, destContract, payload);\n }\n", "fixed_code": "File: rUSDYFactory.sol\n\n function deployrUSDY(\n address blocklist,\n address allowlist,\n address sanctionsList,\n address usdy,\n address oracle\n ) external onlyGuardian returns (address, address, address) {\n rUSDYImplementation = new rUSDY();\n rUSDYProxyAdmin = new ProxyAdmin();\n rUSDYProxy = new TokenProxy(\n address(rUSDYImplementation),\n address(rUSDYProxyAdmin),\n \"\"\n );\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/Breeje-Q.md", "collected_at": "2026-01-02T18:25:25.059404+00:00", "source_hash": "345e1d45807ab81ecb9552decc740e3567f2e56577e05122aed590cd3a67edf2", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 935, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function burnAndCallAxelar( \n uint256 amount,\n string calldata destinationChain\n ) external payable whenNotPaused {\n string memory destContract = destChainToContractAddr[destinationChain];\n\n if (bytes(destContract).length == 0) {\n revert DestinationNotSupported();\n }\n\n if (msg.value == 0) {\n revert GasFeeTooLow();\n }\n\n TOKEN.burnFrom(msg.sender, amount);\n\n bytes memory payload = abi.encode(VERSION, msg.sender, amount, nonce++);\n\n _payGasAndCallContract(destinationChain, destContract, payload);\n }\n\n function _payGasAndCallContract(\n string calldata destinationChain,\n string memory destContract,\n bytes memory payload\n ) private {\n GAS_RECEIVER.payNativeGasForContractCall{value: msg.value}(\n address(this),\n destinationChain,\n destContract,\n payload,\n msg.sender\n );\n\n AXELAR_GATEWAY.callContract(destinationChain, destContract, payload);\n }", "primary_code_language": "solidity", "primary_code_char_count": 935, "all_code_blocks": "// Code block 1 (solidity):\nfunction burnAndCallAxelar( \n uint256 amount,\n string calldata destinationChain\n ) external payable whenNotPaused {\n string memory destContract = destChainToContractAddr[destinationChain];\n\n if (bytes(destContract).length == 0) {\n revert DestinationNotSupported();\n }\n\n if (msg.value == 0) {\n revert GasFeeTooLow();\n }\n\n TOKEN.burnFrom(msg.sender, amount);\n\n bytes memory payload = abi.encode(VERSION, msg.sender, amount, nonce++);\n\n _payGasAndCallContract(destinationChain, destContract, payload);\n }\n\n function _payGasAndCallContract(\n string calldata destinationChain,\n string memory destContract,\n bytes memory payload\n ) private {\n GAS_RECEIVER.payNativeGasForContractCall{value: msg.value}(\n address(this),\n destinationChain,\n destContract,\n payload,\n msg.sender\n );\n\n AXELAR_GATEWAY.callContract(destinationChain, destContract, payload);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function burnAndCallAxelar( \n uint256 amount,\n string calldata destinationChain\n ) external payable whenNotPaused {\n string memory destContract = destChainToContractAddr[destinationChain];\n\n if (bytes(destContract).length == 0) {\n revert DestinationNotSupported();\n }\n\n if (msg.value == 0) {\n revert GasFeeTooLow();\n }\n\n TOKEN.burnFrom(msg.sender, amount);\n\n bytes memory payload = abi.encode(VERSION, msg.sender, amount, nonce++);\n\n _payGasAndCallContract(destinationChain, destContract, payload);\n }\n\n function _payGasAndCallContract(\n string calldata destinationChain,\n string memory destContract,\n bytes memory payload\n ) private {\n GAS_RECEIVER.payNativeGasForContractCall{value: msg.value}(\n address(this),\n destinationChain,\n destContract,\n payload,\n msg.sender\n );\n\n AXELAR_GATEWAY.callContract(destinationChain, destContract, payload);\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function burnAndCallAxelar( \n uint256 amount,\n string calldata destinationChain\n ) external payable whenNotPaused {\n string memory destContract = destChainToContractAddr[destinationChain];\n\n if (bytes(destContract).length == 0) {\n revert DestinationNotSupported();\n }\n\n if (msg.value == 0) {\n revert GasFeeTooLow();\n }\n\n TOKEN.burnFrom(msg.sender, amount);\n\n bytes memory payload = abi.encode(VERSION, msg.sender, amount, nonce++);\n\n _payGasAndCallContract(destinationChain, destContract, payload);\n }\n\n function _payGasAndCallContract(\n string calldata destinationChain,\n string memory destContract,\n bytes memory payload\n ) private {\n GAS_RECEIVER.payNativeGasForContractCall{value: msg.value}(\n address(this),\n destinationChain,\n destContract,\n payload,\n msg.sender\n );\n\n AXELAR_GATEWAY.callContract(destinationChain, destContract, payload);\n }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: rUSDYFactory.sol\n\n function deployrUSDY(\n address blocklist,\n address allowlist,\n address sanctionsList,\n address usdy,\n address oracle\n ) external onlyGuardian returns (address, address, address) {\n rUSDYImplementation = new rUSDY();\n rUSDYProxyAdmin = new ProxyAdmin();\n rUSDYProxy = new TokenProxy(\n address(rUSDYImplementation),\n address(rUSDYProxyAdmin),\n \"\"\n );\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "06-lybra", "title": "hunter_w3b Q", "severity_raw": "Medium", "severity": "medium", "description": "## [L-01] DO NOT PERFORM `ARITHMETIC` OPERATION INSIDE THE emit OF AN event\n\nIt is not recommended to perform arithmetic operations inside the emit of an event. The emits are placed to log the function results for the use of the off-chain tools and not to perform arithmetic operations. The arithmetic opeations should be performed outside the emit and only the result should be logged and emitted in an event for the use of off-chain tools.\n\n```solidity\nFile: lybra/pools/LybraWbETHVault.sol\n\n/// @audit balance - preBalance don't perfrom arithmetic\n31 emit DepositEther(msg.sender, address(collateralAsset), msg.value,balance - preBalance, block.timestamp);\n\n```\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/LybraWbETHVault.sol#L31\n\n```solidity\nFile: lybra/pools/LybraRETHVault.sol\n\n/// @audit balance - preBalance don't perfrom arithmetic\n38 emit DepositEther(msg.sender, address(collateralAsset), msg.value,balance - preBalance, block.timestamp);\n\n```\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/LybraRETHVault.sol#L38\n\n```solidity\nFile: lybra/miner/ProtocolRewardsPool.sol\n\n/// @audit reward - eUSDShare\n203 emit ClaimReward(msg.sender, EUSD.getMintedEUSDByShares(eUSDShare), address(peUSD), reward - eUSDShare, block.timestamp);\n\n```\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/miner/ProtocolRewardsPool.sol#L203\n\n## [L-02] CONDUCT THE `MULTIPLICATION` BEFORE `DIVISON` WHEN PERFORMING ARITHMETIC OPERATIONS TO AVOID ROUNDING ERROR.\n\nWhen arithmetic operations are performed in solidity, it is recommended to perform the multiplicatons before division. This is because the division results are rounded down to the neares interger value in solidity. which introduces rounding error. And if the multiplication is followed, it will inflate the rounding error to a much larger error which could be detrimental to the functionality of the protocol.\n\n```solidity\nFile: l", "vulnerable_code": "File: lybra/pools/LybraWbETHVault.sol\n\n/// @audit balance - preBalance don't perfrom arithmetic\n31 emit DepositEther(msg.sender, address(collateralAsset), msg.value,balance - preBalance, block.timestamp);\n", "fixed_code": "File: lybra/pools/LybraRETHVault.sol\n\n/// @audit balance - preBalance don't perfrom arithmetic\n38 emit DepositEther(msg.sender, address(collateralAsset), msg.value,balance - preBalance, block.timestamp);\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/hunter_w3b-Q.md", "collected_at": "2026-01-02T18:23:01.066226+00:00", "source_hash": "348c5feed3866873191bbeb3fefc1f6984916a4aaeeb7022fd338f9b3e571a7c", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 643, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: lybra/pools/LybraWbETHVault.sol\n\n/// @audit balance - preBalance don't perfrom arithmetic\n31 emit DepositEther(msg.sender, address(collateralAsset), msg.value,balance - preBalance, block.timestamp);", "primary_code_language": "solidity", "primary_code_char_count": 213, "all_code_blocks": "// Code block 1 (solidity):\nFile: lybra/pools/LybraWbETHVault.sol\n\n/// @audit balance - preBalance don't perfrom arithmetic\n31 emit DepositEther(msg.sender, address(collateralAsset), msg.value,balance - preBalance, block.timestamp);\n\n// Code block 2 (solidity):\nFile: lybra/pools/LybraRETHVault.sol\n\n/// @audit balance - preBalance don't perfrom arithmetic\n38 emit DepositEther(msg.sender, address(collateralAsset), msg.value,balance - preBalance, block.timestamp);\n\n// Code block 3 (solidity):\nFile: lybra/miner/ProtocolRewardsPool.sol\n\n/// @audit reward - eUSDShare\n203 emit ClaimReward(msg.sender, EUSD.getMintedEUSDByShares(eUSDShare), address(peUSD), reward - eUSDShare, block.timestamp);", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: lybra/pools/LybraWbETHVault.sol\n\n/// @audit balance - preBalance don't perfrom arithmetic\n31 emit DepositEther(msg.sender, address(collateralAsset), msg.value,balance - preBalance, block.timestamp);\n\nFile: lybra/pools/LybraRETHVault.sol\n\n/// @audit balance - preBalance don't perfrom arithmetic\n38 emit DepositEther(msg.sender, address(collateralAsset), msg.value,balance - preBalance, block.timestamp);\n\nFile: lybra/miner/ProtocolRewardsPool.sol\n\n/// @audit reward - eUSDShare\n203 emit ClaimReward(msg.sender, EUSD.getMintedEUSDByShares(eUSDShare), address(peUSD), reward - eUSDShare, block.timestamp);", "github_refs_formatted": "LybraWbETHVault.sol#L31, LybraRETHVault.sol#L38, ProtocolRewardsPool.sol#L203", "github_files_list": "ProtocolRewardsPool.sol, LybraWbETHVault.sol, LybraRETHVault.sol", "github_refs_count": 3, "vulnerable_code_actual": "File: lybra/pools/LybraWbETHVault.sol\n\n/// @audit balance - preBalance don't perfrom arithmetic\n31 emit DepositEther(msg.sender, address(collateralAsset), msg.value,balance - preBalance, block.timestamp);\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: lybra/pools/LybraRETHVault.sol\n\n/// @audit balance - preBalance don't perfrom arithmetic\n38 emit DepositEther(msg.sender, address(collateralAsset), msg.value,balance - preBalance, block.timestamp);\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "01-salty", "title": "J4X Q", "severity_raw": "Critical", "severity": "critical", "description": "# Low\n\n## [L-01] Reserves Above DUST Incorrectly Enforced\n[Pools Line 270](https://github.com/code-423n4/2024-01-salty/blob/main/src/pools/Pools.sol#L271)\n\n**Issue Description:**\n\nIn the Salty protocol's `_adjustReservesForSwap()` function, the intention, as per the accompanying comment (\"// Make sure that the reserves after swap are above DUST\"), is to ensure that the reserves always remain above a certain threshold defined by the `DUST` constant. However, the current implementation of this check uses `>=` (greater than or equal to), which leads to an off-by-one error. The actual requirement, as intended, is for the reserves to be strictly greater than `DUST`.\n\nCurrent implementation:\n```solidity\nrequire( (reserve0 >= PoolUtils.DUST) && (reserve1 >= PoolUtils.DUST), \"Insufficient reserves after swap\");\n```\n\nThis condition allows the reserves to be exactly equal to `DUST`, which contradicts the intended logic of keeping them above `DUST`.\n\n**Recommended Mitigation Steps**\n\nTo align the implementation with the intended behavior, the `require` statement should be adjusted to enforce that reserves are strictly greater than `DUST`. This change will ensure that the reserves are maintained above the minimal threshold, as originally planned.\n\nProposed change:\n```solidity\nrequire( (reserve0 > PoolUtils.DUST) && (reserve1 > PoolUtils.DUST), \"Insufficient reserves after swap\");\n```\n\nBy modifying the condition to `>` (greater than), the function will correctly enforce that the reserves are maintained above the `DUST` level, thus adhering to the protocol's intended safety and operational standards.\n\n## [L-02] Liquidity can still be below DUST after a call to `addLiquidity()`\n[Pools Line 146-147](https://github.com/code-423n4/2024-01-salty/blob/main/src/pools/Pools.sol#L146-L147)\n\n**Issue Description:**\n\nn the Salty protocol's `addLiquidity()` function, there's an enforcement to ensure the maximum liquidity added by a user is above the `PoolUtils.DUST` threshold. However, a pote", "vulnerable_code": "require( (reserve0 >= PoolUtils.DUST) && (reserve1 >= PoolUtils.DUST), \"Insufficient reserves after swap\");", "fixed_code": "require( (reserve0 > PoolUtils.DUST) && (reserve1 > PoolUtils.DUST), \"Insufficient reserves after swap\");", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/J4X-Q.md", "collected_at": "2026-01-02T19:01:19.682280+00:00", "source_hash": "34983da5651e89aacba4bafc08b57ffb32641a565fb6fde0da8504a5abdd9dc4", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 212, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "require( (reserve0 >= PoolUtils.DUST) && (reserve1 >= PoolUtils.DUST), \"Insufficient reserves after swap\");", "primary_code_language": "solidity", "primary_code_char_count": 107, "all_code_blocks": "// Code block 1 (solidity):\nrequire( (reserve0 >= PoolUtils.DUST) && (reserve1 >= PoolUtils.DUST), \"Insufficient reserves after swap\");\n\n// Code block 2 (solidity):\nrequire( (reserve0 > PoolUtils.DUST) && (reserve1 > PoolUtils.DUST), \"Insufficient reserves after swap\");", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "require( (reserve0 >= PoolUtils.DUST) && (reserve1 >= PoolUtils.DUST), \"Insufficient reserves after swap\");\n\nrequire( (reserve0 > PoolUtils.DUST) && (reserve1 > PoolUtils.DUST), \"Insufficient reserves after swap\");", "github_refs_formatted": "Pools.sol#L271, Pools.sol#L146-L147", "github_files_list": "Pools.sol", "github_refs_count": 2, "vulnerable_code_actual": "require( (reserve0 >= PoolUtils.DUST) && (reserve1 >= PoolUtils.DUST), \"Insufficient reserves after swap\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": "require( (reserve0 > PoolUtils.DUST) && (reserve1 > PoolUtils.DUST), \"Insufficient reserves after swap\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-biconomy", "title": "0x1f8b Q", "severity_raw": "Critical", "severity": "critical", "description": "- [Low](#low)\n - [**1. Use abstract for base contracts**](#1-use-abstract-for-base-contracts)\n - [**2. Mixing and Outdated compiler**](#2-mixing-and-outdated-compiler)\n - [**3. Wrong logic in paymasterContext**](#3-wrong-logic-in-paymastercontext)\n - [**4. Lack of checks**](#4-lack-of-checks)\n - [**5. Centralization risks**](#5-centralization-risks)\n - [**6. Poxy isues**](#6-poxy-isues)\n - [**7. Integer overflow**](#7-integer-overflow)\n - [**8. Loss of tokens**](#8-loss-of-tokens)\n- [Non critical](#non-critical)\n - [**9. Open TODO**](#9-open-todo)\n - [**10. Wrong comment**](#10-wrong-comment)\n - [**11. Lack of ACK during owner change**](#11-lack-of-ack-during-owner-change)\n - [**12. Unsafe low level call**](#12-unsafe-low-level-call)\n - [**13. Wong naming**](#13-wong-naming)\n - [**14. Avoid hardcoded values**](#14-avoid-hardcoded-values)\n\n# Low\n\n## **1. Use `abstract` for base contracts**\n\n`abstract` contracts are contracts that have at least one function without its implementation. **An instance of an abstract cannot be created.**\n\n**Reference:**\n\n- https://docs.soliditylang.org/en/v0.6.2/contracts.html#abstract-contracts\n\n**Affected source code:**\n\n- [Enum.sol:5](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/common/Enum.sol#L5)\n- [MultiSend.sol:9](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/libs/MultiSend.sol#L9)\n- [MultiSendCallOnly.sol:8](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/libs/MultiSendCallOnly.sol#L8)\n- [Executor.sol:7](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/base/Executor.sol#L7)\n- [FallbackManager.sol:8](https://github.com/code-423n4", "vulnerable_code": "pragma solidity 0.8.12;", "fixed_code": " /**\n * @dev Encodes the paymaster context: sender, token, rate, and fee\n */\n function paymasterContext(\n UserOperation calldata op,\n PaymasterData memory data\n ) internal pure returns (bytes memory context) {\n return abi.encode(data.paymasterId);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/0x1f8b-Q.md", "collected_at": "2026-01-02T18:12:45.418982+00:00", "source_hash": "349d29131e981c202b012d5369599d098d516335157726fcf86786ec62790664", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Enum.sol#L5, MultiSend.sol#L9, MultiSendCallOnly.sol#L8, Executor.sol#L7", "github_files_list": "Enum.sol, Executor.sol, MultiSendCallOnly.sol, MultiSend.sol", "github_refs_count": 4, "vulnerable_code_actual": "pragma solidity 0.8.12;", "has_vulnerable_code_snippet": true, "fixed_code_actual": " /**\n * @dev Encodes the paymaster context: sender, token, rate, and fee\n */\n function paymasterContext(\n UserOperation calldata op,\n PaymasterData memory data\n ) internal pure returns (bytes memory context) {\n return abi.encode(data.paymasterId);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "04-caviar", "title": "bin2chen Q", "severity_raw": "High", "severity": "high", "description": "L-01:EthRouter#buy/sell does not determine whether royaltyRecipient is address(0)\nIf `getRoyalty()` returns royaltyFee>0, but `royaltyRecipient==address(0)` this will transfer the funds to address(0)\nSuggest adding judgment:\n\n```solidity\n function buy(Buy[] calldata buys, uint256 deadline, bool payRoyalties) public payable {\n...\n if (payRoyalties) {\n uint256 salePrice = inputAmount / buys[i].tokenIds.length;\n for (uint256 j = 0; j < buys[i].tokenIds.length; j++) {\n // get the royalty fee and recipient\n (uint256 royaltyFee, address royaltyRecipient) =\n getRoyalty(buys[i].nft, buys[i].tokenIds[j], salePrice);\n\n- if (royaltyFee > 0) {\n+ if (royaltyFee > 0 && royaltyRecipient!=address(0)) {\n // transfer the royalty fee to the royalty recipient\n royaltyRecipient.safeTransferETH(royaltyFee);\n }\n }\n } \n```\n\nL-02:setProtocolFeeRate() does not limit the maximum value, there is a risk of malicious amplification of the fee\nIt is recommended that this should not exceed, for example, 5%\n\n```solidity\ncontract Factory is ERC721, Owned {\n...\n function setProtocolFeeRate(uint16 _protocolFeeRate) public onlyOwner {\n+ if (_protocolFeeRate > 5_000) revert FeeRateTooHigh(); \n protocolFeeRate = _protocolFeeRate;\n }\n```", "vulnerable_code": " function buy(Buy[] calldata buys, uint256 deadline, bool payRoyalties) public payable {\n...\n if (payRoyalties) {\n uint256 salePrice = inputAmount / buys[i].tokenIds.length;\n for (uint256 j = 0; j < buys[i].tokenIds.length; j++) {\n // get the royalty fee and recipient\n (uint256 royaltyFee, address royaltyRecipient) =\n getRoyalty(buys[i].nft, buys[i].tokenIds[j], salePrice);\n\n- if (royaltyFee > 0) {\n+ if (royaltyFee > 0 && royaltyRecipient!=address(0)) {\n // transfer the royalty fee to the royalty recipient\n royaltyRecipient.safeTransferETH(royaltyFee);\n }\n }\n } ", "fixed_code": "contract Factory is ERC721, Owned {\n...\n function setProtocolFeeRate(uint16 _protocolFeeRate) public onlyOwner {\n+ if (_protocolFeeRate > 5_000) revert FeeRateTooHigh(); \n protocolFeeRate = _protocolFeeRate;\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/bin2chen-Q.md", "collected_at": "2026-01-02T18:20:18.209858+00:00", "source_hash": "35b0cf0b068a2657231b50121076e16e978ad9d0b948206e6f6112931257dd09", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 1077, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function buy(Buy[] calldata buys, uint256 deadline, bool payRoyalties) public payable {\n...\n if (payRoyalties) {\n uint256 salePrice = inputAmount / buys[i].tokenIds.length;\n for (uint256 j = 0; j < buys[i].tokenIds.length; j++) {\n // get the royalty fee and recipient\n (uint256 royaltyFee, address royaltyRecipient) =\n getRoyalty(buys[i].nft, buys[i].tokenIds[j], salePrice);\n\n- if (royaltyFee > 0) {\n+ if (royaltyFee > 0 && royaltyRecipient!=address(0)) {\n // transfer the royalty fee to the royalty recipient\n royaltyRecipient.safeTransferETH(royaltyFee);\n }\n }\n }", "primary_code_language": "solidity", "primary_code_char_count": 847, "all_code_blocks": "// Code block 1 (solidity):\nfunction buy(Buy[] calldata buys, uint256 deadline, bool payRoyalties) public payable {\n...\n if (payRoyalties) {\n uint256 salePrice = inputAmount / buys[i].tokenIds.length;\n for (uint256 j = 0; j < buys[i].tokenIds.length; j++) {\n // get the royalty fee and recipient\n (uint256 royaltyFee, address royaltyRecipient) =\n getRoyalty(buys[i].nft, buys[i].tokenIds[j], salePrice);\n\n- if (royaltyFee > 0) {\n+ if (royaltyFee > 0 && royaltyRecipient!=address(0)) {\n // transfer the royalty fee to the royalty recipient\n royaltyRecipient.safeTransferETH(royaltyFee);\n }\n }\n }\n\n// Code block 2 (solidity):\ncontract Factory is ERC721, Owned {\n...\n function setProtocolFeeRate(uint16 _protocolFeeRate) public onlyOwner {\n+ if (_protocolFeeRate > 5_000) revert FeeRateTooHigh(); \n protocolFeeRate = _protocolFeeRate;\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function buy(Buy[] calldata buys, uint256 deadline, bool payRoyalties) public payable {\n...\n if (payRoyalties) {\n uint256 salePrice = inputAmount / buys[i].tokenIds.length;\n for (uint256 j = 0; j < buys[i].tokenIds.length; j++) {\n // get the royalty fee and recipient\n (uint256 royaltyFee, address royaltyRecipient) =\n getRoyalty(buys[i].nft, buys[i].tokenIds[j], salePrice);\n\n- if (royaltyFee > 0) {\n+ if (royaltyFee > 0 && royaltyRecipient!=address(0)) {\n // transfer the royalty fee to the royalty recipient\n royaltyRecipient.safeTransferETH(royaltyFee);\n }\n }\n }\n\ncontract Factory is ERC721, Owned {\n...\n function setProtocolFeeRate(uint16 _protocolFeeRate) public onlyOwner {\n+ if (_protocolFeeRate > 5_000) revert FeeRateTooHigh(); \n protocolFeeRate = _protocolFeeRate;\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function buy(Buy[] calldata buys, uint256 deadline, bool payRoyalties) public payable {\n...\n if (payRoyalties) {\n uint256 salePrice = inputAmount / buys[i].tokenIds.length;\n for (uint256 j = 0; j < buys[i].tokenIds.length; j++) {\n // get the royalty fee and recipient\n (uint256 royaltyFee, address royaltyRecipient) =\n getRoyalty(buys[i].nft, buys[i].tokenIds[j], salePrice);\n\n- if (royaltyFee > 0) {\n+ if (royaltyFee > 0 && royaltyRecipient!=address(0)) {\n // transfer the royalty fee to the royalty recipient\n royaltyRecipient.safeTransferETH(royaltyFee);\n }\n }\n } ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "contract Factory is ERC721, Owned {\n...\n function setProtocolFeeRate(uint16 _protocolFeeRate) public onlyOwner {\n+ if (_protocolFeeRate > 5_000) revert FeeRateTooHigh(); \n protocolFeeRate = _protocolFeeRate;\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-asymmetry", "title": "catellatech Q", "severity_raw": "Critical", "severity": "critical", "description": "### Issues \n| Letter | Name | Description |\n|:--:|:-------:|:-------:|\n| L | Low risk | Potential risk |\n| NC | Non-critical | Non risky findings |\n| R | Refactor | Changing the code |\n| O | Ordinary | Often found issues |\n\n| Total Found Issues | 21 |\n|:--:|:--:|\n\n### Low Risk\n| Count | Explanation | Instances |\n|:--:|:-------|:--:| \n| [L-01] | NO USE OF UPGRADEABLE IERC20 | 3 |\n| [L-02] | CRITICAL CHANGES SHOULD USE TWO-STEP PROCEDURE | 4 |\n| [L-03] | MISSING EVENTS FOR ONLY FUNCTIONS THAT CHANGE CRITICAL PARAMETERS | 6 |\n| [L-04] | THE FUNCTIONS OF THE PROTOCOL ARE SERIOUSLY COMPROMISED | 4 |\n| [L-05] | IN THE EMITS, INCLUDE THE OLD AND NEW VALUES OF THE UPDATED PARAMETERS TO TRACK THE CHANGES MADE | 3 |\n\n| Total Low Risk Issues | 5 | Total Instances | 19 |\n|:--:|:--:|:--:|--:|\n\n### Non-Critical\n| Count | Explanation | Instances |\n|:--:|:-------|:--:|\n| [N-01] | FUNCTION WRITING THAT DOES NOT COMPLY WITH THE SOLIDITY STYLE GUIDE | All contracts |\n| [N-02] | USE A SINGLE FILE FOR ALL SYSTEM-WIDE CONSTANTS | 3 |\n| [N-03] | NON-LIBRARY/INTERFACE FILES SHOULD USE FIXED COMPILER VERSIONS, NOT FLOATING ONES | all contracts |\n| [N-04] | USE A MORE RECENT VERSION OF SOLIDITY | All contracts |\n| [N-05] | CREATE YOUR OWN IMPORT NAMES INSTEAD OF USING THE REGULAR ONES | All contracts |\n| [N-06] | USE SCIENTIFIC NOTATION (E.G. 1E18) RATHER THAN EXPONENTIATION (E.G. 10**18) | 11 |\n| [N-07] | USE OF BYTES.CONCAT() INSTEAD OF ABI.ENCODEPACKED() | 6 |\n| [N-08] | NEED FUZZING TEST | |\n| [N-09] | NATSPEC IS INCOMPLETE | 6 |\n\n| Total Non-Critical Issues | 9 | Total Instances | 17 |\n|:--:|:--:|:--:|--:|\n\n### Refactor Issues \n| Count | Explanation | Instances |\n|:--:|:-------|:--:|\n| [R-01] | USE CUSTOM ERRORS INSTEAD OF REVERT STRINGS TO SAVE GAS | All contracts |\n| [R-02] | DO NOT PRE-DECLARE VARIABLE WITH DEFAULT VALUES | 8 |\n| [R-03] | SHORTHAND WAY TO WRITE IF/ELSE STATEMENT | 2 |\n\n| Total Refactor Issues | 3 | Total Instances | 10 |\n|:--:|:--:|:--:|--:|\n\n### Ordinary Issues\n", "vulnerable_code": "## [L-02] CRITICAL CHANGES SHOULD USE TWO-STEP PROCEDURE\nHandle ownership transfers with two steps and two transactions. First, allow the current owner to propose a new owner address. Second, allow the proposed owner (and only the proposed owner) to accept ownership, and update the contract owner internally\n\n### PROOF OF CONCEPT", "fixed_code": "### MITIGATION\nImplement zero address check and consider implementing a two step process where the owner nominates an account and the nominated account needs to call an acceptOwnership() function for the transfer of ownership to fully succeed. This ensures the nominated EOA account is a valid and active account.\n\n## [L-03] MISSING EVENTS FOR ONLY FUNCTIONS THAT CHANGE CRITICAL PARAMETERS\nThe afunctions that change critical parameters should emit events. Events allow capturing the changed parameters so that off-chain tools/interfaces can register such changes with timelocks that allow users to evaluate them and consider if they would like to engage/exit based on how they perceive the changes as affecting the trustworthiness of the protocol or profitability of the implemented financial services. The alternative of directly querying on-chain contract state for such changes is not considered practical for most users/usages.\n\nmissing events and timelocks do not promote transparency and if such changes immediately affect users' perception of fairness or trustworthiness, they could exit the protocol causing a reduction in liquidity which could negatively impact protocol TVL and reputation.\n### PROOF OF CONCEPT", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/catellatech-Q.md", "collected_at": "2026-01-02T18:18:55.327681+00:00", "source_hash": "35bd7ef850a21929bd368d1d633f5a38c086cee24d74939b17c5a45026e0c67c", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "## [L-02] CRITICAL CHANGES SHOULD USE TWO-STEP PROCEDURE\nHandle ownership transfers with two steps and two transactions. First, allow the current owner to propose a new owner address. Second, allow the proposed owner (and only the proposed owner) to accept ownership, and update the contract owner internally\n\n### PROOF OF CONCEPT", "has_vulnerable_code_snippet": true, "fixed_code_actual": "### MITIGATION\nImplement zero address check and consider implementing a two step process where the owner nominates an account and the nominated account needs to call an acceptOwnership() function for the transfer of ownership to fully succeed. This ensures the nominated EOA account is a valid and active account.\n\n## [L-03] MISSING EVENTS FOR ONLY FUNCTIONS THAT CHANGE CRITICAL PARAMETERS\nThe afunctions that change critical parameters should emit events. Events allow capturing the changed parameters so that off-chain tools/interfaces can register such changes with timelocks that allow users to evaluate them and consider if they would like to engage/exit based on how they perceive the changes as affecting the trustworthiness of the protocol or profitability of the implemented financial services. The alternative of directly querying on-chain contract state for such changes is not considered practical for most users/usages.\n\nmissing events and timelocks do not promote transparency and if such changes immediately affect users' perception of fairness or trustworthiness, they could exit the protocol causing a reduction in liquidity which could negatively impact protocol TVL and reputation.\n### PROOF OF CONCEPT", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-revert-lend", "title": "SAQ G", "severity_raw": "High", "severity": "high", "description": "## Summary\n\n### Gas Optimization\n\nno | Issue |Instances||\n|-|:-|:-:|:-:|\n| [G-01] | Can make the variable outside the loop to save gas | 1 | - |\n| [G-02] | Don't initialize variables with default value | 12 | - |\n| [G-03] | Using storage instead of memory for structs/arrays saves gas | 3 | - |\n| [G-04] | Duplicated require()/if() checks should be refactored to a modifier or function | 1 | - |\n| [G-05] | Use constants instead of type(uintx).max | 9 | - |\n| [G-06] | Use\u00a0selfbalance()\u00a0instead of\u00a0address(this).balance | 1 | - |\n| [G-07] | Using ERC721A instead of ERC721 for more gas-efficient | 3 | - |\n| [G-08] | Use hardcode address instead address(this) | 4 | - |\n| [G-09] | Avoid fetching a low-level call's return data by using assembly | 2 | - |\n| [G-10] | Using assembly to check for zero can save gas | 2 | - |\n| [G-11] | Pre-increment and pre-decrement are cheaper than + 1 ,- 1 | 2 | - |\n| [G-12] | address(this) should be cached | 10 | - |\n\n## Gas Optimizations \n\n## [G-01] Can make the variable outside the loop to save gas\n \n\n```solidity\nfile: /src/automators/Automator.sol\n\n112 uint256 balance = IERC20(tokens[i]).balanceOf(address(this));\n\n```\nhttps://github.com/code-423n4/2024-03-revert-lend/blob/main/src/automators/Automator.sol#L112C1-L112C74\n\n\n## [G-02] Don't initialize variables with default value\n \n\n```solidity\nfile: /src/V3Vault.so\n\n118 uint32 public reserveFactorX32 = 0;\n\n124 uint256 public debtSharesTotal = 0;\n\n127 uint256 public lastExchangeRateUpdate = 0;\n\n131 uint256 public globalDebtLimit = 0;\n\n132 uint256 public globalLendLimit = 0;\n\n135 uint256 public minLoanSize = 0;\n\n138 uint256 public dailyLendIncreaseLimitMin = 0;\n139 uint256 public dailyLendIncreaseLimitLeft = 0;\n140 uint256 public dailyLendIncreaseLimitLastReset = 0;\n\n143 uint256 public dailyDebtIncreaseLimitMin = 0;\n144 uint256 public dailyDebtIncreaseLimitLeft = 0;\n145 uint256 public dailyDebtIncreaseLimitLastReset = 0;\n\n\n```\nhttps://github.c", "vulnerable_code": "file: /src/automators/Automator.sol\n\n112 uint256 balance = IERC20(tokens[i]).balanceOf(address(this));\n", "fixed_code": "file: /src/V3Vault.so\n\n118 uint32 public reserveFactorX32 = 0;\n\n124 uint256 public debtSharesTotal = 0;\n\n127 uint256 public lastExchangeRateUpdate = 0;\n\n131 uint256 public globalDebtLimit = 0;\n\n132 uint256 public globalLendLimit = 0;\n\n135 uint256 public minLoanSize = 0;\n\n138 uint256 public dailyLendIncreaseLimitMin = 0;\n139 uint256 public dailyLendIncreaseLimitLeft = 0;\n140 uint256 public dailyLendIncreaseLimitLastReset = 0;\n\n143 uint256 public dailyDebtIncreaseLimitMin = 0;\n144 uint256 public dailyDebtIncreaseLimitLeft = 0;\n145 uint256 public dailyDebtIncreaseLimitLastReset = 0;\n\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/SAQ-G.md", "collected_at": "2026-01-02T19:03:03.737640+00:00", "source_hash": "36381739e7b59c539224973102dee1a6f589747f8d82754ba164a75126917987", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 735, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "file: /src/automators/Automator.sol\n\n112 uint256 balance = IERC20(tokens[i]).balanceOf(address(this));", "primary_code_language": "solidity", "primary_code_char_count": 113, "all_code_blocks": "// Code block 1 (solidity):\nfile: /src/automators/Automator.sol\n\n112 uint256 balance = IERC20(tokens[i]).balanceOf(address(this));\n\n// Code block 2 (solidity):\nfile: /src/V3Vault.so\n\n118 uint32 public reserveFactorX32 = 0;\n\n124 uint256 public debtSharesTotal = 0;\n\n127 uint256 public lastExchangeRateUpdate = 0;\n\n131 uint256 public globalDebtLimit = 0;\n\n132 uint256 public globalLendLimit = 0;\n\n135 uint256 public minLoanSize = 0;\n\n138 uint256 public dailyLendIncreaseLimitMin = 0;\n139 uint256 public dailyLendIncreaseLimitLeft = 0;\n140 uint256 public dailyLendIncreaseLimitLastReset = 0;\n\n143 uint256 public dailyDebtIncreaseLimitMin = 0;\n144 uint256 public dailyDebtIncreaseLimitLeft = 0;\n145 uint256 public dailyDebtIncreaseLimitLastReset = 0;", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "file: /src/automators/Automator.sol\n\n112 uint256 balance = IERC20(tokens[i]).balanceOf(address(this));\n\nfile: /src/V3Vault.so\n\n118 uint32 public reserveFactorX32 = 0;\n\n124 uint256 public debtSharesTotal = 0;\n\n127 uint256 public lastExchangeRateUpdate = 0;\n\n131 uint256 public globalDebtLimit = 0;\n\n132 uint256 public globalLendLimit = 0;\n\n135 uint256 public minLoanSize = 0;\n\n138 uint256 public dailyLendIncreaseLimitMin = 0;\n139 uint256 public dailyLendIncreaseLimitLeft = 0;\n140 uint256 public dailyLendIncreaseLimitLastReset = 0;\n\n143 uint256 public dailyDebtIncreaseLimitMin = 0;\n144 uint256 public dailyDebtIncreaseLimitLeft = 0;\n145 uint256 public dailyDebtIncreaseLimitLastReset = 0;", "github_refs_formatted": "Automator.sol#L112-L1", "github_files_list": "Automator.sol", "github_refs_count": 1, "vulnerable_code_actual": "file: /src/automators/Automator.sol\n\n112 uint256 balance = IERC20(tokens[i]).balanceOf(address(this));\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "file: /src/V3Vault.so\n\n118 uint32 public reserveFactorX32 = 0;\n\n124 uint256 public debtSharesTotal = 0;\n\n127 uint256 public lastExchangeRateUpdate = 0;\n\n131 uint256 public globalDebtLimit = 0;\n\n132 uint256 public globalLendLimit = 0;\n\n135 uint256 public minLoanSize = 0;\n\n138 uint256 public dailyLendIncreaseLimitMin = 0;\n139 uint256 public dailyLendIncreaseLimitLeft = 0;\n140 uint256 public dailyLendIncreaseLimitLastReset = 0;\n\n143 uint256 public dailyDebtIncreaseLimitMin = 0;\n144 uint256 public dailyDebtIncreaseLimitLeft = 0;\n145 uint256 public dailyDebtIncreaseLimitLastReset = 0;\n\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "04-caviar", "title": "Sathish9098 G", "severity_raw": "High", "severity": "high", "description": "## GAS OPTIMIZATIONS\n\n| Gas Count | Issues | Instances | Gas Saved| \n| --------------- | --------------- | --------------- | --------------- | \n| [G-1] | Structs can be packed into fewer storage slots | 2 | 40000 |\n| [G-2] | Optimize names to save gas | 38 | - |\n| [G-3] | Functions guaranteed to revert when called by normal users can be marked payable | 10 | 210 |\n| [G-4] | Setting the constructor to payable | 2 | 26 |\n| [G-5] | Use assembly to write address storage values | 8 | - |\n| [G-6] | Use nested if and, avoid multiple check combinations | 9 | 81 |\n| [G-7] | Usage of uints/ints smaller than 32 bytes (256 bits) incurs overhead | 7 | 196 |\n| [G-8] | Empty blocks should be removed or emit something | 4 | - |\n| [G-9] | Use assembly to check for address(0) | 15 | 90 |\n| [G-10] | ++i/i++ should be unchecked{++i}/unchecked{i++} when it is not possible for them to overflow, as is the case when used in for- and while-loops | 18 | 2520 |\n| [G-11] | Amounts should be checked for 0 before calling a transfer functions | 16 | - |\n| [G-12] | Use 3 indexed parameters rule for events to save gas | 11 | - |\n| [G-13] | public functions to external | 23 | 345 |\n| [G-14] | Avoid contract existence checks by using low level calls | 30 | 3000 |\n| [G-15] | Duplicated require()/if() checks should be refactored to a modifier or function | 12 | - |\n| [G-16] | += costs more gas than = + for state variables (SAME FOR -=) | 4 | 452 |\n| [G-17] | Add unchecked {} for subtractions where the operands cannot underflow because of a previous require() or if-statement | 2 | 440 |\n| [G-18] | Don't declare variables inside the loops | 3 | - |\n| [G-19] | The condition check should be top of the functions | 1 | - |\n| [G-20] | Cheaper input validations should come before expensive operations | 1 | - |\n| [G-21] | Sort Solidity operations using short-circuit mode | 8 | - |\n| [G-22] | Multiplication/division by 2 should use bit shifting | 3 | - |\n| [G-23] | abi.encode() is less ", "vulnerable_code": "FILE: 2023-04-caviar/src/EthRouter.sol\n\n/// @audit Variable ordering with 6 slots instead of the current 7 :\n/// address(20):pool,address(20):nft,bool(1):isPublicPool,uint256(dynamic):tokenIds,uint256(dynamic):tokenWeights, PrivatePool(32):proof,uint256(32):baseTokenAmount\n 48: struct Buy {\n 49: address payable pool;\n 50: address nft;\n+55: bool isPublicPool;\n 51: uint256[] tokenIds;\n 52: uint256[] tokenWeights;\n 53: PrivatePool.MerkleMultiProof proof;\n 54: uint256 baseTokenAmount;\n-55: bool isPublicPool;\n 56: }", "fixed_code": "/// @audit Variable ordering with 7 slots instead of the current 8 :\n/// \n 58: struct Sell {\n 59: address payable pool;\n 60: address nft;\n+65: bool isPublicPool;\n 61: uint256[] tokenIds;\n 62: uint256[] tokenWeights;\n 63: PrivatePool.MerkleMultiProof proof;\n 64: IStolenNftOracle.Message[] stolenNftProofs;\n-65: bool isPublicPool;\n 66: bytes32[][] publicPoolProofs;\n 67: }\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/Sathish9098-G.md", "collected_at": "2026-01-02T18:20:06.064942+00:00", "source_hash": "363aab3937be8d4cdc9003698f1490e84d36c31893266322c3bd6ee6d4cd00ce", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "FILE: 2023-04-caviar/src/EthRouter.sol\n\n/// @audit Variable ordering with 6 slots instead of the current 7 :\n/// address(20):pool,address(20):nft,bool(1):isPublicPool,uint256(dynamic):tokenIds,uint256(dynamic):tokenWeights, PrivatePool(32):proof,uint256(32):baseTokenAmount\n 48: struct Buy {\n 49: address payable pool;\n 50: address nft;\n+55: bool isPublicPool;\n 51: uint256[] tokenIds;\n 52: uint256[] tokenWeights;\n 53: PrivatePool.MerkleMultiProof proof;\n 54: uint256 baseTokenAmount;\n-55: bool isPublicPool;\n 56: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "/// @audit Variable ordering with 7 slots instead of the current 8 :\n/// \n 58: struct Sell {\n 59: address payable pool;\n 60: address nft;\n+65: bool isPublicPool;\n 61: uint256[] tokenIds;\n 62: uint256[] tokenWeights;\n 63: PrivatePool.MerkleMultiProof proof;\n 64: IStolenNftOracle.Message[] stolenNftProofs;\n-65: bool isPublicPool;\n 66: bytes32[][] publicPoolProofs;\n 67: }\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "09-ondo", "title": "mojito_auditor Q", "severity_raw": "Medium", "severity": "medium", "description": "# Summary\n\n| Id | Title |\n| --- | --- |\n| L-1 | Function `_mul()` does not work with Solidity 0.8 |\n| L-2 | Incorrect naming variable in `unwrap()` function |\n| L-3 | Pre and post rebase amount will always be equal |\n\n# L-1. Function `_mul()` does not work with Solidity 0.8\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/rwaOracles/RWADynamicOracle.sol#L405\n\n## Detail\nIn `RWADynamicOracle` contract, the function `_mul()` implemented overflow check to ensure the result of `x * y` does not overflow. However, this check does not work with Solidity 0.8 because if there is overflow, Solidity 0.8 will automatically revert when doing `z = x * y`. \n```solidity\nfunction _mul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n // @audit Solidity 0.8 will revert when doing `x * y`\n require(y == 0 || (z = x * y) / y == x); \n}\n```\nhttps://docs.soliditylang.org/en/v0.8.19/080-breaking-changes.html#silent-changes-of-the-semantics\n\n## Recommendation\nSolidity 0.8 has already checked for overflow so no need for this function. \n\n\n# L-2. Incorrect naming variable in `unwrap()` function\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L451\n\n## Detail\nIn the function `unwrap()`, it calculated the amount of shares from amount of rUSDY. But the result is named `usdyAmount` instead of `sharesAmount`. This is confusing and should be correct to make the code more readable.\n\n```solidity\nfunction unwrap(uint256 _rUSDYAmount) external whenNotPaused {\n require(_rUSDYAmount > 0, \"rUSDY: can't unwrap zero rUSDY tokens\");\n \n // @audit Should be `shareAmount` instead of `usdyAmount`\n uint256 usdyAmount = getSharesByRUSDY(_rUSDYAmount); \n if (usdyAmount < BPS_DENOMINATOR) revert UnwrapTooSmall();\n _burnShares(msg.sender, usdyAmount);\n usdy.transfer(msg.sender, usdyAmount / BPS_DENOMINATOR);\n emit TokensBurnt(msg.sender, _rUSDYAmount);\n}\n```\n\n## Recommendation\nChange th", "vulnerable_code": "function _mul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n // @audit Solidity 0.8 will revert when doing `x * y`\n require(y == 0 || (z = x * y) / y == x); \n}", "fixed_code": "function unwrap(uint256 _rUSDYAmount) external whenNotPaused {\n require(_rUSDYAmount > 0, \"rUSDY: can't unwrap zero rUSDY tokens\");\n \n // @audit Should be `shareAmount` instead of `usdyAmount`\n uint256 usdyAmount = getSharesByRUSDY(_rUSDYAmount); \n if (usdyAmount < BPS_DENOMINATOR) revert UnwrapTooSmall();\n _burnShares(msg.sender, usdyAmount);\n usdy.transfer(msg.sender, usdyAmount / BPS_DENOMINATOR);\n emit TokensBurnt(msg.sender, _rUSDYAmount);\n}", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/mojito_auditor-Q.md", "collected_at": "2026-01-02T18:26:07.258503+00:00", "source_hash": "3640227d7de858f88bf5d5957259855dd6a70573c49f8fe6e2c9706ca6478b31", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 631, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _mul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n // @audit Solidity 0.8 will revert when doing `x * y`\n require(y == 0 || (z = x * y) / y == x); \n}", "primary_code_language": "solidity", "primary_code_char_count": 173, "all_code_blocks": "// Code block 1 (solidity):\nfunction _mul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n // @audit Solidity 0.8 will revert when doing `x * y`\n require(y == 0 || (z = x * y) / y == x); \n}\n\n// Code block 2 (solidity):\nfunction unwrap(uint256 _rUSDYAmount) external whenNotPaused {\n require(_rUSDYAmount > 0, \"rUSDY: can't unwrap zero rUSDY tokens\");\n \n // @audit Should be `shareAmount` instead of `usdyAmount`\n uint256 usdyAmount = getSharesByRUSDY(_rUSDYAmount); \n if (usdyAmount < BPS_DENOMINATOR) revert UnwrapTooSmall();\n _burnShares(msg.sender, usdyAmount);\n usdy.transfer(msg.sender, usdyAmount / BPS_DENOMINATOR);\n emit TokensBurnt(msg.sender, _rUSDYAmount);\n}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function _mul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n // @audit Solidity 0.8 will revert when doing `x * y`\n require(y == 0 || (z = x * y) / y == x); \n}\n\nfunction unwrap(uint256 _rUSDYAmount) external whenNotPaused {\n require(_rUSDYAmount > 0, \"rUSDY: can't unwrap zero rUSDY tokens\");\n \n // @audit Should be `shareAmount` instead of `usdyAmount`\n uint256 usdyAmount = getSharesByRUSDY(_rUSDYAmount); \n if (usdyAmount < BPS_DENOMINATOR) revert UnwrapTooSmall();\n _burnShares(msg.sender, usdyAmount);\n usdy.transfer(msg.sender, usdyAmount / BPS_DENOMINATOR);\n emit TokensBurnt(msg.sender, _rUSDYAmount);\n}", "github_refs_formatted": "RWADynamicOracle.sol#L405, rUSDY.sol#L451", "github_files_list": "rUSDY.sol, RWADynamicOracle.sol", "github_refs_count": 2, "vulnerable_code_actual": "function _mul(uint256 x, uint256 y) internal pure returns (uint256 z) {\n // @audit Solidity 0.8 will revert when doing `x * y`\n require(y == 0 || (z = x * y) / y == x); \n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function unwrap(uint256 _rUSDYAmount) external whenNotPaused {\n require(_rUSDYAmount > 0, \"rUSDY: can't unwrap zero rUSDY tokens\");\n \n // @audit Should be `shareAmount` instead of `usdyAmount`\n uint256 usdyAmount = getSharesByRUSDY(_rUSDYAmount); \n if (usdyAmount < BPS_DENOMINATOR) revert UnwrapTooSmall();\n _burnShares(msg.sender, usdyAmount);\n usdy.transfer(msg.sender, usdyAmount / BPS_DENOMINATOR);\n emit TokensBurnt(msg.sender, _rUSDYAmount);\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "11-kelp", "title": "Stormreckson Q", "severity_raw": "Low", "severity": "low", "description": "https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/RSETH.sol#L14-L20\n\n1- contract does inherit it's own interface \n\n`RSETH.SOL` is not inheriting `IRSETH.SOL`\n\nContract implementations should inherit their interfaces. Extending an interface ensures that all function signatures are correct, and catches mistakes introduced by typos \n\n```\ncontract RSETH is\n Initializable,\n LRTConfigRoleChecker,\n ERC20Upgradeable,\n PausableUpgradeable,\n AccessControlUpgradeable\n```\n##FIX \n\n```\ncontract RSETH is IRSETH\n Initializable,\n LRTConfigRoleChecker,\n ERC20Upgradeable,\n PausableUpgradeable,\n AccessControlUpgradeable\n```\n\n2- Upgradable Tokens can break the contract behavior.\n\n\nSome tokens (e.g. USDC, USDT) are upgradable, allowing the token owners to make arbitrary modifications to the logic of the token at any point in time.\n\nA change to the token semantics can break any smart contract that depends on the past behaviour.\nConsider introducing logic that will freeze interactions with the token in question if an upgrade is detected.\n\nFor example TUSD adapter used by MakerDao ( https://github.com/makerdao/dss-deploy/blob/7394f6555daf5747686a1b29b2f46c6b2c64b061/src/join.sol#L321)\n\n3- https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTConfig.sol#L80-L81\n\nNew supported asset contract address might not be ERC20-Compatible.\n\nit is good practice to validate whether a new asset address is an ERC20-compatible contract before adding it as a supported asset. This validation helps ensure that only valid `ERC20` tokens are added to the supported asset list.\n\nTo check if an address corresponds to an `ERC20` contract, you can utilize the `ERC20` interface's `\u00a0totalSupply()\u00a0` function. If the \u00a0`totalSupply()`\u00a0 function exists and returns a value without throwing an exception, it indicates that the address is an `ERC20` contract. Here's an example of how you can perform the check:\n\n\u00a0`", "vulnerable_code": "contract RSETH is\n Initializable,\n LRTConfigRoleChecker,\n ERC20Upgradeable,\n PausableUpgradeable,\n AccessControlUpgradeable", "fixed_code": "contract RSETH is IRSETH\n Initializable,\n LRTConfigRoleChecker,\n ERC20Upgradeable,\n PausableUpgradeable,\n AccessControlUpgradeable", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/Stormreckson-Q.md", "collected_at": "2026-01-02T18:27:41.211826+00:00", "source_hash": "3646da4f7cb9dd8e452a3898b9843d4789050610ea35b27c94b0cbfbe13bd29b", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 283, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "contract RSETH is\n Initializable,\n LRTConfigRoleChecker,\n ERC20Upgradeable,\n PausableUpgradeable,\n AccessControlUpgradeable", "primary_code_language": "unknown", "primary_code_char_count": 138, "all_code_blocks": "// Code block 1 (unknown):\ncontract RSETH is\n Initializable,\n LRTConfigRoleChecker,\n ERC20Upgradeable,\n PausableUpgradeable,\n AccessControlUpgradeable\n\n// Code block 2 (unknown):\ncontract RSETH is IRSETH\n Initializable,\n LRTConfigRoleChecker,\n ERC20Upgradeable,\n PausableUpgradeable,\n AccessControlUpgradeable", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "RSETH.sol#L14-L20, join.sol#L321, LRTConfig.sol#L80-L81", "github_files_list": "LRTConfig.sol, RSETH.sol, join.sol", "github_refs_count": 3, "vulnerable_code_actual": "contract RSETH is\n Initializable,\n LRTConfigRoleChecker,\n ERC20Upgradeable,\n PausableUpgradeable,\n AccessControlUpgradeable", "has_vulnerable_code_snippet": true, "fixed_code_actual": "contract RSETH is IRSETH\n Initializable,\n LRTConfigRoleChecker,\n ERC20Upgradeable,\n PausableUpgradeable,\n AccessControlUpgradeable", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-salty", "title": "kinda_very_good Analysis", "severity_raw": "High", "severity": "high", "description": "\n\n### [H-1] The first user to deposit could set a bad ratio \n\n**Description:** Depositing and collateral addition does not rely on price returned by aggregator meaning the first depositer would determine the price ratio of the pool\n\n**Impact:** The protocol would be griefed \n\n\n\n**Recommended Mitigation:** The initial addition of liquidity especially in the important pools (weth,wbtc and dai) should be made off a price feed \n\n\n\n### [H-2] setInitialFeeds does not use cool down \n\n**Description:** PriceAggregator::setInitialFeeds allows the owner to set the priceFeeds before the cooldown period is over\n\n**Impact:** owner could set bad feed \n\n\n\n**Recommended Mitigation:** PriceAggregator::setInitialFeeds should only be callable once \n\n### [L-1] Aggregate price could revert on correct price \n\n**Description:** AggregatePrice::_aggregate would return zero if the two closest prices are exactly the same\n\n**Impact:** Users could be griefed \n\n\n```\nif ( (_absoluteDifference(priceA, priceB) * 100000) / averagePrice > maximumPriceFeedPercentDifferenceTimes1000 )\n\nif the two prices are exactly the same their absolute difference would be zero \n\n```\n\n**Recommended Mitigation:** A check should be included to check if the two prices are exactly the same and then one of the prices could be returned \n\n\n### [I-1] Named mappings should be used \n\n### Time spent:\n22 hours", "vulnerable_code": "if ( (_absoluteDifference(priceA, priceB) * 100000) / averagePrice > maximumPriceFeedPercentDifferenceTimes1000 )\n\nif the two prices are exactly the same their absolute difference would be zero \n", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/kinda_very_good-Analysis.md", "collected_at": "2026-01-02T19:01:48.923794+00:00", "source_hash": "36bc8bca8e52a544bd7c8f8f882c6d1f7f585a3b7691f3dce4cf7e8e91e9a210", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 194, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "if ( (_absoluteDifference(priceA, priceB) * 100000) / averagePrice > maximumPriceFeedPercentDifferenceTimes1000 )\n\nif the two prices are exactly the same their absolute difference would be zero", "primary_code_language": "unknown", "primary_code_char_count": 194, "all_code_blocks": "// Code block 1 (unknown):\nif ( (_absoluteDifference(priceA, priceB) * 100000) / averagePrice > maximumPriceFeedPercentDifferenceTimes1000 )\n\nif the two prices are exactly the same their absolute difference would be zero", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "if ( (_absoluteDifference(priceA, priceB) * 100000) / averagePrice > maximumPriceFeedPercentDifferenceTimes1000 )\n\nif the two prices are exactly the same their absolute difference would be zero \n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.74} {"source": "c4", "protocol": "01-biconomy", "title": "Secureverse G", "severity_raw": "Low", "severity": "low", "description": "### [Gas-01] ```onlyOwner``` functions Should make as ```payable```, Those function which reverts when called by normal user should make as payable\n*Instances(10)*\n```solidity\nFile: SmartAccount.sol\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L449-L453\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L455-L458\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L460-L463\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L465-L473\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L536-L538\n```\n```solidity\nFile: paymasters/BasePaymaster.sol\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L67\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L75\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L90\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L99\n```\n```solidity\nFile: paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol#L65\n```\n\n### [Gas-02] ``uncheck``` Arithmatic Operation that would never be ````Underflow/Overflow```\n*Instances(1)*\n```solidity\nFile: base/ModuleManager.sol\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/base/ModuleManager.sol#L124\n```\n\n\n### [Gas-", "vulnerable_code": "File: SmartAccount.sol\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L449-L453\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L455-L458\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L460-L463\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L465-L473\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L536-L538", "fixed_code": "File: paymasters/BasePaymaster.sol\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L67\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L75\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L90\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L99", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/Secureverse-G.md", "collected_at": "2026-01-02T18:13:20.181690+00:00", "source_hash": "36bfe3d8a4dd6bf1c369653ceafeeb39a32bc524e828fec12b806f9760191e79", "code_block_count": 4, "solidity_block_count": 3, "total_code_chars": 1503, "github_ref_count": 11, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: SmartAccount.sol\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L449-L453\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L455-L458\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L460-L463\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L465-L473\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L536-L538", "primary_code_language": "solidity", "primary_code_char_count": 673, "all_code_blocks": "// Code block 1 (solidity):\nFile: SmartAccount.sol\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L449-L453\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L455-L458\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L460-L463\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L465-L473\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L536-L538\n\n// Code block 2 (solidity):\nFile: paymasters/BasePaymaster.sol\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L67\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L75\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L90\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L99\n\n// Code block 3 (solidity):\nFile: paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol#L65\n\n// Code block 4 (unknown):\n*Instances(1)*", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: SmartAccount.sol\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L449-L453\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L455-L458\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L460-L463\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L465-L473\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L536-L538\n\nFile: paymasters/BasePaymaster.sol\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L67\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L75\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L90\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L99\n\nFile: paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol#L65", "github_refs_formatted": "SmartAccount.sol#L449-L453, SmartAccount.sol#L455-L458, SmartAccount.sol#L460-L463, SmartAccount.sol#L465-L473, SmartAccount.sol#L536-L538, BasePaymaster.sol#L67, BasePaymaster.sol#L75, BasePaymaster.sol#L90, BasePaymaster.sol#L99, VerifyingSingletonPaymaster.sol#L65, ModuleManager.sol#L124", "github_files_list": "ModuleManager.sol, SmartAccount.sol, VerifyingSingletonPaymaster.sol, BasePaymaster.sol", "github_refs_count": 11, "vulnerable_code_actual": "File: SmartAccount.sol\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L449-L453\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L455-L458\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L460-L463\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L465-L473\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L536-L538", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: paymasters/BasePaymaster.sol\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L67\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L75\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L90\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L99", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "07-amphora", "title": "adeolu Q", "severity_raw": "Low", "severity": "low", "description": "# no need for \"<= 0\" check on uint256 value\n\n**Explanation**\nsince value is uint256, its lowest value by default is 0, so the check should be \"== 0\" not \"<= 0\"\n\n**Proof Of Concept**\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/AmphoraProtocolToken.sol#L14\n```\n constructor(\n address _account,\n uint256 _initialSupply\n ) ERC20('Amphora Protocol', 'AMPH') ERC20Permit('Amphora Protocol') {\n if (_account == address(0)) revert AmphoraProtocolToken_InvalidAddress();\n if (_initialSupply <= 0) revert AmphoraProtocolToken_InvalidSupply();\n\n _mint(_account, _initialSupply);\n }\n```\n\n**Recommended Mitigation**\n\nchange <= to ==\n```\n constructor(\n address _account,\n uint256 _initialSupply\n ) ERC20('Amphora Protocol', 'AMPH') ERC20Permit('Amphora Protocol') {\n if (_account == address(0)) revert AmphoraProtocolToken_InvalidAddress();\n if (_initialSupply == 0) revert AmphoraProtocolToken_InvalidSupply();\n\n _mint(_account, _initialSupply);\n }\n```\n\n", "vulnerable_code": " constructor(\n address _account,\n uint256 _initialSupply\n ) ERC20('Amphora Protocol', 'AMPH') ERC20Permit('Amphora Protocol') {\n if (_account == address(0)) revert AmphoraProtocolToken_InvalidAddress();\n if (_initialSupply <= 0) revert AmphoraProtocolToken_InvalidSupply();\n\n _mint(_account, _initialSupply);\n }", "fixed_code": " constructor(\n address _account,\n uint256 _initialSupply\n ) ERC20('Amphora Protocol', 'AMPH') ERC20Permit('Amphora Protocol') {\n if (_account == address(0)) revert AmphoraProtocolToken_InvalidAddress();\n if (_initialSupply == 0) revert AmphoraProtocolToken_InvalidSupply();\n\n _mint(_account, _initialSupply);\n }", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/adeolu-Q.md", "collected_at": "2026-01-02T18:23:39.914545+00:00", "source_hash": "36ec84cba9694c1305591cd2aa4781f0367d68874fe74a312214a2a4c5c41db8", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 654, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "constructor(\n address _account,\n uint256 _initialSupply\n ) ERC20('Amphora Protocol', 'AMPH') ERC20Permit('Amphora Protocol') {\n if (_account == address(0)) revert AmphoraProtocolToken_InvalidAddress();\n if (_initialSupply <= 0) revert AmphoraProtocolToken_InvalidSupply();\n\n _mint(_account, _initialSupply);\n }", "primary_code_language": "unknown", "primary_code_char_count": 327, "all_code_blocks": "// Code block 1 (unknown):\nconstructor(\n address _account,\n uint256 _initialSupply\n ) ERC20('Amphora Protocol', 'AMPH') ERC20Permit('Amphora Protocol') {\n if (_account == address(0)) revert AmphoraProtocolToken_InvalidAddress();\n if (_initialSupply <= 0) revert AmphoraProtocolToken_InvalidSupply();\n\n _mint(_account, _initialSupply);\n }\n\n// Code block 2 (unknown):\nconstructor(\n address _account,\n uint256 _initialSupply\n ) ERC20('Amphora Protocol', 'AMPH') ERC20Permit('Amphora Protocol') {\n if (_account == address(0)) revert AmphoraProtocolToken_InvalidAddress();\n if (_initialSupply == 0) revert AmphoraProtocolToken_InvalidSupply();\n\n _mint(_account, _initialSupply);\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "AmphoraProtocolToken.sol#L14", "github_files_list": "AmphoraProtocolToken.sol", "github_refs_count": 1, "vulnerable_code_actual": " constructor(\n address _account,\n uint256 _initialSupply\n ) ERC20('Amphora Protocol', 'AMPH') ERC20Permit('Amphora Protocol') {\n if (_account == address(0)) revert AmphoraProtocolToken_InvalidAddress();\n if (_initialSupply <= 0) revert AmphoraProtocolToken_InvalidSupply();\n\n _mint(_account, _initialSupply);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " constructor(\n address _account,\n uint256 _initialSupply\n ) ERC20('Amphora Protocol', 'AMPH') ERC20Permit('Amphora Protocol') {\n if (_account == address(0)) revert AmphoraProtocolToken_InvalidAddress();\n if (_initialSupply == 0) revert AmphoraProtocolToken_InvalidSupply();\n\n _mint(_account, _initialSupply);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7.12} {"source": "c4", "protocol": "11-kelp", "title": "PENGUN Q", "severity_raw": "Low", "severity": "low", "description": "## sETH2 does not have a chainlink price feed.\n\nThe new token sETH2 supported by EigenLayer does not have a chainlink price feed and therefore cannot be used in the current implementation.\n\n> Eigenlayer supports stETH, rETH and cbETH as of today. But it intends to add more LSTs in the future through its governance. KelpDao also wants to add support for tokens that Eigenlayer will support in the future.\n\nhttps://discord.com/channels/810916927919620096/1171865604114882600/1172948255412342824\n\nAccording to the team, they are trying to support assets that Eigenlayer wants to support. To do so, it is necessary to use a price feed other than chainlink.\n\n## Contract info cannot be changed once it is set.\n\n```solidity\nfunction _setContract(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n if (contractMap[key] == val) {\n revert ValueAlreadyInUse();\n }\n contractMap[key] = val;\n emit SetContract(key, val);\n }\n\n```\n\ncontractMap is used to store contract addresses like LRTOracle.\nHowever, once set in _setContract, it cannot be updated.\n\nIt is recommended to allow updates for already set keys, so they can be used in situations where contract addresses need to be updated.\n\n## pause does nothing.\n\nLRTOracle has a pause function.\n\n```solidity\n/// @dev Triggers stopped state. Contract must not be paused.\n function pause() external onlyLRTManager { //@audit pause nothing\n _pause();\n }\n\n```\n\nHowever, it does not use modifiers like whenNotPaused that prevent certain actions during a pause, so essentially the pause does nothing.\n\nIt is recommended to take measures to prevent major functions like getRSETHPrice from being used during a pause.\n\n## The return value of depositIntoStrategy must be stored.\n\n```solidity\nfunction depositIntoStrategy(\n IStrategy strategy,\n IERC20 token,\n uint256 amount\n ) external onlyWhenNotPaused(PAUSED_DEPOSITS) nonReentrant returns (uint256 shares) {\n ", "vulnerable_code": "function _setContract(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n if (contractMap[key] == val) {\n revert ValueAlreadyInUse();\n }\n contractMap[key] = val;\n emit SetContract(key, val);\n }\n", "fixed_code": "/// @dev Triggers stopped state. Contract must not be paused.\n function pause() external onlyLRTManager { //@audit pause nothing\n _pause();\n }\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/PENGUN-Q.md", "collected_at": "2026-01-02T18:27:33.600324+00:00", "source_hash": "36fef2cb9927225d44ec46b94c8b779f4bceb105924cf6f81dd6287af4e532a5", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 417, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _setContract(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n if (contractMap[key] == val) {\n revert ValueAlreadyInUse();\n }\n contractMap[key] = val;\n emit SetContract(key, val);\n }", "primary_code_language": "solidity", "primary_code_char_count": 262, "all_code_blocks": "// Code block 1 (solidity):\nfunction _setContract(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n if (contractMap[key] == val) {\n revert ValueAlreadyInUse();\n }\n contractMap[key] = val;\n emit SetContract(key, val);\n }\n\n// Code block 2 (solidity):\n/// @dev Triggers stopped state. Contract must not be paused.\n function pause() external onlyLRTManager { //@audit pause nothing\n _pause();\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function _setContract(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n if (contractMap[key] == val) {\n revert ValueAlreadyInUse();\n }\n contractMap[key] = val;\n emit SetContract(key, val);\n }\n\n/// @dev Triggers stopped state. Contract must not be paused.\n function pause() external onlyLRTManager { //@audit pause nothing\n _pause();\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function _setContract(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n if (contractMap[key] == val) {\n revert ValueAlreadyInUse();\n }\n contractMap[key] = val;\n emit SetContract(key, val);\n }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "/// @dev Triggers stopped state. Contract must not be paused.\n function pause() external onlyLRTManager { //@audit pause nothing\n _pause();\n }\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "07-amphora", "title": "ybansal2403 G", "severity_raw": "High", "severity": "high", "description": "| Number | Optimization Details | Instances |\n| :----: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------: |\n| [G-01] | Use assembly to check for the zero address | 4 |\n| [G-02] | State variables access within a loop | 2 |\n| [G-03] | Use of memory instead of storage for struct/array state variables | 3 |\n| [G-04] | Avoid contract existence checks by using low level calls | 9 |\n| [G-05] | Using ternary operator instead of if else saves gas | 5 |\n| [G-06] | Cache state variables with stack variables | 18 |\n| [G-07] | Do not calculate constants variables | 5 |\n| [G-08] | The use of a logical AND in place of double if is slightly less gas efficient in instances where there isn't a corresponding else statement for the given if statement | 4 |\n| [G-09] | Using pre instead of post increments/decrements ", "vulnerable_code": "File: core/solidity/contracts/core/VaultController.sol\n112: if (address(_oldVaultController) != address(0)) _migrateCollateralsFrom(_oldVaultController, _tokenAddresses);", "fixed_code": "File: core/solidity/contracts/core/Vault.sol\n207: if (address(_amphClaimer) != address(0)) {\n\n269: if (address(_amphClaimer) != address(0)) {", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/ybansal2403-G.md", "collected_at": "2026-01-02T18:24:05.823328+00:00", "source_hash": "379f43baf7de330b4eba3eb598a725c98cccba38bd6dcac9f04d5f7dd0bf7c3e", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: core/solidity/contracts/core/VaultController.sol\n112: if (address(_oldVaultController) != address(0)) _migrateCollateralsFrom(_oldVaultController, _tokenAddresses);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: core/solidity/contracts/core/Vault.sol\n207: if (address(_amphClaimer) != address(0)) {\n\n269: if (address(_amphClaimer) != address(0)) {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-asymmetry", "title": "Shubham Q", "severity_raw": "Critical", "severity": "critical", "description": "## Non-Critical\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [N-1](#N-1) | 10 ** 18 can be changed to 1e18 for better readability | 20 |\n| [N-2](#N-2) | Unlocked compiler version | 4 |\n\n\n## [N-1] 10 ** 18 can be changed to 1e18 for better readability \n\n10 ** 18 can be changed to 1e18 to avoid unnecessary arithmetic operation, better readability and might save gas.\n\n```solidity\nFile: 2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol\n\n173: uint256 minOut = ((((rethPerEth * msg.value) / 10 ** 18) *\n174: ((10 ** 18 - maxSlippage))) / 10 ** 18);\n\n214: RocketTokenRETHInterface(rethAddress()).getEthValue(10 ** 18);\n215: else return (poolPrice() * 10 ** 18) / (10 ** 18);\n```\n\n```solidity\nFile: 2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol\n\n74: uint256 minOut = (((ethPerDerivative(_amount) * _amount) / 10 ** 18) *\n75: (10 ** 18 - maxSlippage)) / 10 ** 18;\n\n113: 10 ** 18\n115: return ((10 ** 18 * frxAmount) /\n```\n\n```solidity\nFile: 2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol\n\n60: uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n\n87: return IWStETH(WST_ETH).getStETHByWstETH(10 ** 18);\n```\n\n```solidity\nFile: 2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol\n\n55: maxAmount = 200 * 10 ** 18;\n75: 10 ** 18;\n80: preDepositPrice = 10 ** 18;\n81: else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n94: ) * depositAmount) / 10 ** 18;\n98: uint256 mintAmount = (totalStakeValueEth * 10 ** 18) / preDepositPrice;\n```\n## [N-02] Unlocked compiler version\n\nPragma version for most contracts is ^0.7.5. Keep the pragma compiler version locked to a specific version as a best practice. \nPreferably the one everything has been tested most with.\n\nThere are 4 instances of this case.\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L2\nhttps://github.co", "vulnerable_code": "File: 2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol\n\n173: uint256 minOut = ((((rethPerEth * msg.value) / 10 ** 18) *\n174: ((10 ** 18 - maxSlippage))) / 10 ** 18);\n\n214: RocketTokenRETHInterface(rethAddress()).getEthValue(10 ** 18);\n215: else return (poolPrice() * 10 ** 18) / (10 ** 18);", "fixed_code": "File: 2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol\n\n74: uint256 minOut = (((ethPerDerivative(_amount) * _amount) / 10 ** 18) *\n75: (10 ** 18 - maxSlippage)) / 10 ** 18;\n\n113: 10 ** 18\n115: return ((10 ** 18 * frxAmount) /", "recommendation": "", "category": "slippage", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Shubham-Q.md", "collected_at": "2026-01-02T18:18:34.621892+00:00", "source_hash": "38189b2037bab721916ef2a8eb5612574ad226a9a8276d8411d862c159a7646e", "code_block_count": 4, "solidity_block_count": 4, "total_code_chars": 1194, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: 2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol\n\n173: uint256 minOut = ((((rethPerEth * msg.value) / 10 ** 18) *\n174: ((10 ** 18 - maxSlippage))) / 10 ** 18);\n\n214: RocketTokenRETHInterface(rethAddress()).getEthValue(10 ** 18);\n215: else return (poolPrice() * 10 ** 18) / (10 ** 18);", "primary_code_language": "solidity", "primary_code_char_count": 339, "all_code_blocks": "// Code block 1 (solidity):\nFile: 2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol\n\n173: uint256 minOut = ((((rethPerEth * msg.value) / 10 ** 18) *\n174: ((10 ** 18 - maxSlippage))) / 10 ** 18);\n\n214: RocketTokenRETHInterface(rethAddress()).getEthValue(10 ** 18);\n215: else return (poolPrice() * 10 ** 18) / (10 ** 18);\n\n// Code block 2 (solidity):\nFile: 2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol\n\n74: uint256 minOut = (((ethPerDerivative(_amount) * _amount) / 10 ** 18) *\n75: (10 ** 18 - maxSlippage)) / 10 ** 18;\n\n113: 10 ** 18\n115: return ((10 ** 18 * frxAmount) /\n\n// Code block 3 (solidity):\nFile: 2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol\n\n60: uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n\n87: return IWStETH(WST_ETH).getStETHByWstETH(10 ** 18);\n\n// Code block 4 (solidity):\nFile: 2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol\n\n55: maxAmount = 200 * 10 ** 18;\n75: 10 ** 18;\n80: preDepositPrice = 10 ** 18;\n81: else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n94: ) * depositAmount) / 10 ** 18;\n98: uint256 mintAmount = (totalStakeValueEth * 10 ** 18) / preDepositPrice;", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: 2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol\n\n173: uint256 minOut = ((((rethPerEth * msg.value) / 10 ** 18) *\n174: ((10 ** 18 - maxSlippage))) / 10 ** 18);\n\n214: RocketTokenRETHInterface(rethAddress()).getEthValue(10 ** 18);\n215: else return (poolPrice() * 10 ** 18) / (10 ** 18);\n\nFile: 2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol\n\n74: uint256 minOut = (((ethPerDerivative(_amount) * _amount) / 10 ** 18) *\n75: (10 ** 18 - maxSlippage)) / 10 ** 18;\n\n113: 10 ** 18\n115: return ((10 ** 18 * frxAmount) /\n\nFile: 2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol\n\n60: uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n\n87: return IWStETH(WST_ETH).getStETHByWstETH(10 ** 18);\n\nFile: 2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol\n\n55: maxAmount = 200 * 10 ** 18;\n75: 10 ** 18;\n80: preDepositPrice = 10 ** 18;\n81: else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n94: ) * depositAmount) / 10 ** 18;\n98: uint256 mintAmount = (totalStakeValueEth * 10 ** 18) / preDepositPrice;", "github_refs_formatted": "Reth.sol#L2", "github_files_list": "Reth.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: 2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol\n\n173: uint256 minOut = ((((rethPerEth * msg.value) / 10 ** 18) *\n174: ((10 ** 18 - maxSlippage))) / 10 ** 18);\n\n214: RocketTokenRETHInterface(rethAddress()).getEthValue(10 ** 18);\n215: else return (poolPrice() * 10 ** 18) / (10 ** 18);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: 2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol\n\n74: uint256 minOut = (((ethPerDerivative(_amount) * _amount) / 10 ** 18) *\n75: (10 ** 18 - maxSlippage)) / 10 ** 18;\n\n113: 10 ** 18\n115: return ((10 ** 18 * frxAmount) /", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "10-badger", "title": "DavidGiladi Q", "severity_raw": "Critical", "severity": "critical", "description": "\n### Low Issues\n|Title|Issue|Instances|\n|-|:-|:-:|\n|[L-1] Require Should Used Instead of Assert | [Require Should Used Instead of Assert](#require-should-used-instead-of-assert) | 1 |\n|[L-2] Burn functions must be protected with a modifier | [Burn functions must be protected with a modifier](#burn-functions-must-be-protected-with-a-modifier) | 2 |\n|[L-3] Casting block.timestamp can reduce the lifespan of a contract | [Casting block.timestamp can reduce the lifespan of a contract](#casting-blocktimestamp-can-reduce-the-lifespan-of-a-contract) | 1 |\n|[L-4] Code does not follow the best practice of check-effects-interaction | [Code does not follow the best practice of check-effects-interaction](#code-does-not-follow-the-best-practice-of-check-effects-interaction) | 11 |\n|[L-5] Divide before multiply | [Divide before multiply](#divide-before-multiply) | 4 |\n|[L-6] Some tokens may not consider type(uint256).max as an infinite approval | [Some tokens may not consider type(uint256).max as an infinite approval](#some-tokens-may-not-consider-typeuint256max-as-an-infinite-approval) | 6 |\n|[L-7] ERC20 Approve Call is Not Safe | [ERC20 Approve Call is Not Safe](#erc20-approve-call-is-not-safe) | 6 |\n|[L-8] Empty Uncontrolled Ether Flow in receive()/payable fallback() | [Empty Uncontrolled Ether Flow in receive()/payable fallback()](#empty-uncontrolled-ether-flow-in-receivepayable-fallback) | 1 |\n|[L-9] Local variable shadowing | [Local variable shadowing](#local-variable-shadowing) | 1 |\n|[L-10] Loss of Precision in Division by Large Numbers | [Loss of Precision in Division by Large Numbers](#loss-of-precision-in-division-by-large-numbers) | 9 |\n|[L-11] Missing zero address validation in constructor | [Missing zero address validation in constructor](#missing-zero-address-validation-in-constructor) | 42 |\n|[L-12] External calls in an un-bounded for-loop may result in a DOS | [External calls in an un-bounded for-loop may result in a DOS](#external-calls-in-an-un-bounded-for-loop-", "vulnerable_code": "File: contracts/LiquidationLibrary.sol\n\n564 assert(toLiquidator < _totalColToSend)", "fixed_code": "File: contracts/EBTCToken.sol\n\n95 function burn(address _account, uint256 _amount) external override ", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/DavidGiladi-Q.md", "collected_at": "2026-01-02T18:26:31.861040+00:00", "source_hash": "3818def9dcc7193b01cbd75f7c5be8982b9ad52b791c78fc313e7ba83ba142cb", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: contracts/LiquidationLibrary.sol\n\n564 assert(toLiquidator < _totalColToSend)", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/EBTCToken.sol\n\n95 function burn(address _account, uint256 _amount) external override ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "11-kelp", "title": "Raihan Q", "severity_raw": "Low", "severity": "low", "description": "## [L-01] _safeMint() should be used rather than _mint() wherever possible\n_mint() is [discouraged](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/d4d8d2ed9798cc3383912a23b5e8d5cb602f7d4b/contracts/token/ERC721/ERC721.sol#L271) in favor of _safeMint() which ensures that the recipient is either an EOA or implements IERC721Receiver. Both open [OpenZeppelin](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/d4d8d2ed9798cc3383912a23b5e8d5cb602f7d4b/contracts/token/ERC721/ERC721.sol#L238-L250) and [solmate](https://github.com/Rari-Capital/solmate/blob/4eaf6b68202e36f67cab379768ac6be304c8ebde/src/tokens/ERC721.sol#L180) have versions of this function so that NFTs aren\u2019t lost if they\u2019re minted to contracts that cannot transfer them back out.\n\n\n```solidity\nFile: src/RSETH.sol\n48 _mint(to, amount);\n```\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/RSETH.sol#L48\n\n\n## [L-02] Use `safetransfer` Instead Of `transfer`\nIt is good to add a\u00a0require()\u00a0statement that checks the return value of token transfers or to use something like OpenZeppelin\u2019s\u00a0safeTransfer/safeTransferFrom\u00a0unless one is sure the given token reverts in case of a failure. Failure to do so will cause silent failures of transfers and affect token accounting in contract.\nFor example, Some tokens do not implement the ERC20 standard properly but are still accepted by most code that accepts ERC20 tokens. For example Tether (USDT)'s transfer() and transferFrom() functions do not return booleans as the specification requires, and instead have no return value. When these sorts of tokens are cast to IERC20, their function signatures do not match and therefore the calls made, revert.\n\n```solidity\nFile: src/LRTDepositPool.sol\n194 if (!IERC20(asset).transfer(nodeDelegator, amount)) {\n```\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L194\n\n```solidity\nFile: src/NodeDelegator.sol\n86 if (!IERC20(asset).transfer(lrtDepositPool, amount)) {\n```\nhttps://github.", "vulnerable_code": "File: src/RSETH.sol\n48 _mint(to, amount);", "fixed_code": "File: src/LRTDepositPool.sol\n194 if (!IERC20(asset).transfer(nodeDelegator, amount)) {", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/Raihan-Q.md", "collected_at": "2026-01-02T18:27:35.398005+00:00", "source_hash": "3891f5d3da73faf3bc82e12d1779189349f195e7baffc6b4679e53f48f962b71", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 223, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: src/RSETH.sol\n48 _mint(to, amount);", "primary_code_language": "solidity", "primary_code_char_count": 47, "all_code_blocks": "// Code block 1 (solidity):\nFile: src/RSETH.sol\n48 _mint(to, amount);\n\n// Code block 2 (solidity):\nFile: src/LRTDepositPool.sol\n194 if (!IERC20(asset).transfer(nodeDelegator, amount)) {\n\n// Code block 3 (solidity):\nFile: src/NodeDelegator.sol\n86 if (!IERC20(asset).transfer(lrtDepositPool, amount)) {", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: src/RSETH.sol\n48 _mint(to, amount);\n\nFile: src/LRTDepositPool.sol\n194 if (!IERC20(asset).transfer(nodeDelegator, amount)) {\n\nFile: src/NodeDelegator.sol\n86 if (!IERC20(asset).transfer(lrtDepositPool, amount)) {", "github_refs_formatted": "ERC721.sol#L271, ERC721.sol#L238-L250, ERC721.sol#L180, RSETH.sol#L48, LRTDepositPool.sol#L194", "github_files_list": "ERC721.sol, RSETH.sol, LRTDepositPool.sol", "github_refs_count": 5, "vulnerable_code_actual": "File: src/RSETH.sol\n48 _mint(to, amount);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: src/LRTDepositPool.sol\n194 if (!IERC20(asset).transfer(nodeDelegator, amount)) {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "08-dopex", "title": "ABAIKUNANBAEV Q", "severity_raw": "Low", "severity": "low", "description": "## Finding Summary \n\n| ID | Severity | Description |\n| - | - | :-: |\n| [L-01](#l-01-Missing-checks-for-zero-amount-transfers-in-univ3liquidityamo.sol) | Low | Missing checks for zero amount transfers in `UniV2LiquidityAmo.sol` and `UniV3LiquidityAmo.sol`\n| [L-02](#l-02-Typo-in-the-comments) | Low | Typo in the comments \n| [L-03](#l-03-safeerc20-and-safetransferlib-libraries-can-be-used-interchangeably) | Low | `SafeERC20` and `SafeTransferLib` libraries can be used interchangeably\n| [L-04](#l-04-there-is-no-need-for-two-slippage-variables-in-relpcontract.sol) | Low | There is no need for two slippage variables in `ReLPContract.sol`\n| [L-05](#l-05-unchecked-return-data-when-making-arbitrary-calls-to-the-to-address) | Low | Unchecked return data when making arbitrary calls to the `to` address\n| [L-06](#l-06-erc721burnable-is-initialized-but-its-functionality-is-never-used-in-rpdxdecayingbonds.sol) | Low | ERC721Burnable is initialized but its functionality is never used in RpdxDecayingBonds.sol\n| [L-07](#l-07-admin-is-a-single-point-of-failure-when-calling-emergencywithdraw-due-to-unspecified-to-address) | Low | Admin is a single point of failure when calling `emergencyWithdraw()` due to unspecified `to` address\n\n\n## [L-01] Missing checks for zero amount transfers in `UniV2LiquidityAmo.sol` and `UniV3LiquidityAmo.sol`\n\nIn `UniV2LiquidityAmo.sol` and `UniV3LiquiidtyAmo.sol`, there is no check whether `tokenABalance` and `tokenBBalance` being sent to the `RpdxV2Core` via `safeTransfer()` are not zero. Therefore, there can be a situation where there are zero amount transfers:\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/amo/UniV2LiquidityAmo.sol#L168-175\n```\n IERC20WithBurn(addresses.tokenA).safeTransfer(\n addresses.rdpxV2Core,\n tokenABalance\n );\n IERC20WithBurn(addresses.tokenB).safeTransfer(\n addresses.rdpxV2Core,\n tokenBBalance\n );\n```\n\n### Recommendation\n\nConsider adding the following checks: \n\n```\nrequire(tokenABalan", "vulnerable_code": " IERC20WithBurn(addresses.tokenA).safeTransfer(\n addresses.rdpxV2Core,\n tokenABalance\n );\n IERC20WithBurn(addresses.tokenB).safeTransfer(\n addresses.rdpxV2Core,\n tokenBBalance\n );", "fixed_code": "require(tokenABalance > 0)\nrequire(tokenBBalance > 0)", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/ABAIKUNANBAEV-Q.md", "collected_at": "2026-01-02T18:24:27.704220+00:00", "source_hash": "38b29c629334bef11651e24bc1cd42b621a1f4225ad76baae01dd55917f96962", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 207, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "IERC20WithBurn(addresses.tokenA).safeTransfer(\n addresses.rdpxV2Core,\n tokenABalance\n );\n IERC20WithBurn(addresses.tokenB).safeTransfer(\n addresses.rdpxV2Core,\n tokenBBalance\n );", "primary_code_language": "unknown", "primary_code_char_count": 207, "all_code_blocks": "// Code block 1 (unknown):\nIERC20WithBurn(addresses.tokenA).safeTransfer(\n addresses.rdpxV2Core,\n tokenABalance\n );\n IERC20WithBurn(addresses.tokenB).safeTransfer(\n addresses.rdpxV2Core,\n tokenBBalance\n );", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "UniV2LiquidityAmo.sol#L168-L175", "github_files_list": "UniV2LiquidityAmo.sol", "github_refs_count": 1, "vulnerable_code_actual": " IERC20WithBurn(addresses.tokenA).safeTransfer(\n addresses.rdpxV2Core,\n tokenABalance\n );\n IERC20WithBurn(addresses.tokenB).safeTransfer(\n addresses.rdpxV2Core,\n tokenBBalance\n );", "has_vulnerable_code_snippet": true, "fixed_code_actual": "require(tokenABalance > 0)\nrequire(tokenBBalance > 0)", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-salty", "title": "dharma09 G", "severity_raw": "High", "severity": "high", "description": "SALTY GAS OPTIMIZATIONS\n--\nINTRODUCTION\n--\nHighlighted below are optimizations exclusively targeting state-mutating functions and view/pure functions invoked by state-mutating functions. In the discussion that follows, only runtime gas is emphasized, given its inevitable dominance over deployment gas costs throughout the protocol's lifetime.\n\nPlease be aware that some code snippets may be shortened to conserve space, and certain code snippets may include `@audit` tags in comments to facilitate issue explanations.\"\n- [Gas report](#gas-report)\n - [Table Of Contents](#table-of-contents)\n - [ Only Make SLOADS when necessary](#g-01-only-make-sloads-when-necessary)\n - [Directly modifies the value in the storage location without reading the current value first](#g-02-directly-modifies-the-value-in-the-storage-location-without-reading-the-current-value-first)\n - [Cache state variable in memory before emiting event](#g-03-cache-state-variable-in-memory-before-emiting-event)\n - [Caching the length of the array can be a good optimization strategy](#g-04-caching-the-length-of-the-array-can-be-a-good-optimization-strategy)\n - [When variables are declared with the storage keyword caching any fields that need to be re-read in stack variables Saves gas](#g-05-when-variables-are-declared-with-the-storage-keyword-caching-any-fields-that-need-to-be-re-read-in-stack-variables-saves-gas)\n - [`ballot` is only used once, no need to cache `proposals.ballotForID(ballotID)`](#g-06-ballot-is-only-used-once-no-need-to-cache-proposalsballotforidballotid)\n - [Use uint8 for Constants and we can save 1 slods by pack with state variable](#g-07-use-uint8-for-constants-and-we-can-save-1-slods-by-pack-with-state-variable)\n - [Move lesser gas costing require checks to the top](#g-08-move-lesser-gas-costing-require-checks-to-the-top)\n - [Add unchecked blocks for subtractions where the operands cannot underflow](#g-09-add-unchecked-blocks-for-subtractions-where-the-operands-cannot-underflow)\n ", "vulnerable_code": "File: src/staking/StakingRewards.sol\n57: function _increaseUserShare( address wallet, bytes32 poolID, uint256 increaseShareAmount, bool useCooldown ) internal\n\t\t{\n\t\trequire( poolsConfig.isWhitelisted( poolID ), \"Invalid pool\" );\n\t\trequire( increaseShareAmount != 0, \"Cannot increase zero share\" );\n\n\t\tUserShareInfo storage user = _userShareInfo[wallet][poolID]; //@audit cache vaiable when its use write down after below cheack\n\n\t\tif ( useCooldown )\n\t\tif ( msg.sender != address(exchangeConfig.dao()) ) // DAO doesn't use the cooldown\n\t\t\t{\n\t\t\trequire( block.timestamp >= user.cooldownExpiration, \"Must wait for the cooldown to expire\" );\n\n\t\t\t// Update the cooldown expiration for future transactions\n\t\t\tuser.cooldownExpiration = block.timestamp + stakingConfig.modificationCooldown();\n\t\t\t}\n\n\t\tuint256 existingTotalShares = totalShares[poolID];\n", "fixed_code": "### [G-02] Directly modifies the value in the storage location without reading the current value first\n**Details:**\n using pre-increment `(++i)` instead of the addition assignment `(i += 1)` can sometimes result in more efficient code. By doing this we can avoid state variable read as a result we can save gas.\n**Proof of Code:**\n- [AccessManager.sol#L40](https://github.com/code-423n4/2024-01-salty/blob/main/src/AccessManager.sol#L40C1-L46C7)", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/dharma09-G.md", "collected_at": "2026-01-02T19:01:38.122870+00:00", "source_hash": "38d672b8a34cbf8da95e02e92cfa303a74f2453dff08499c9c8cb878dc415c74", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "AccessManager.sol#L40-L1", "github_files_list": "AccessManager.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: src/staking/StakingRewards.sol\n57: function _increaseUserShare( address wallet, bytes32 poolID, uint256 increaseShareAmount, bool useCooldown ) internal\n\t\t{\n\t\trequire( poolsConfig.isWhitelisted( poolID ), \"Invalid pool\" );\n\t\trequire( increaseShareAmount != 0, \"Cannot increase zero share\" );\n\n\t\tUserShareInfo storage user = _userShareInfo[wallet][poolID]; //@audit cache vaiable when its use write down after below cheack\n\n\t\tif ( useCooldown )\n\t\tif ( msg.sender != address(exchangeConfig.dao()) ) // DAO doesn't use the cooldown\n\t\t\t{\n\t\t\trequire( block.timestamp >= user.cooldownExpiration, \"Must wait for the cooldown to expire\" );\n\n\t\t\t// Update the cooldown expiration for future transactions\n\t\t\tuser.cooldownExpiration = block.timestamp + stakingConfig.modificationCooldown();\n\t\t\t}\n\n\t\tuint256 existingTotalShares = totalShares[poolID];\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "### [G-02] Directly modifies the value in the storage location without reading the current value first\n**Details:**\n using pre-increment `(++i)` instead of the addition assignment `(i += 1)` can sometimes result in more efficient code. By doing this we can avoid state variable read as a result we can save gas.\n**Proof of Code:**\n- [AccessManager.sol#L40](https://github.com/code-423n4/2024-01-salty/blob/main/src/AccessManager.sol#L40C1-L46C7)", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "06-lybra", "title": "No12Samurai Q", "severity_raw": "High", "severity": "high", "description": "# QA Report\n\n## Summary\n\nThis QA report highlights two issues related to event parameter inconsistency and incorrect order in the Lybra protocol contracts. The first issue involves the `ClaimReward` event emission in the `ProtocolRewardsPool.sol` contract, where incorrect parameters are used. The second issue is about the `WithdrawAsset` event emission in the `LybraPeUSDVaultBase.sol` contract, where the parameter order is inconsistent between the event definition and its usage. Both issues can lead to confusion and misinterpretation of the event data.\n\n\n\n## Issue 1: Incorrect Parameters in `ProtocolRewardsPool.getReward()` Function Event Emission\n\nIn the `ProtocolRewardsPool.sol` contract, the `getReward()` function at [L190-L218](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/ProtocolRewardsPool.sol#L190-L218) emits the `ClaimReward` event at [L214](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/ProtocolRewardsPool.sol#L214) with incorrect parameters. The event emission lacks essential reward information, such as the address of `token` and the `tokenAmount`. The following event is emitted at [L214](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/ProtocolRewardsPool.sol#L214):\n\n```solidity\nClaimReward(msg.sender, EUSD.getMintedEUSDByShares(eUSDShare), address(0), 0, block.timestamp);\n```\n\nThe event is defined at [L46](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/ProtocolRewardsPool.sol#L46) with the following parameters:\n\n```solidity\nevent ClaimReward(address indexed user, uint256 eUSDAmount, address token, uint256 tokenAmount, uint256 time);\n```\n\nTo resolve this issue, the event emission line in the `getReward()` function should be modified to include the correct parameters. The recommended modification is a", "vulnerable_code": "ClaimReward(msg.sender, EUSD.getMintedEUSDByShares(eUSDShare), address(0), 0, block.timestamp);", "fixed_code": "event ClaimReward(address indexed user, uint256 eUSDAmount, address token, uint256 tokenAmount, uint256 time);", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/No12Samurai-Q.md", "collected_at": "2026-01-02T18:22:31.941309+00:00", "source_hash": "38dabb919e4ee82d6f02a504c6d107b2dd90c702ff7ba33c377da466b3cf2c9e", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 205, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "ClaimReward(msg.sender, EUSD.getMintedEUSDByShares(eUSDShare), address(0), 0, block.timestamp);", "primary_code_language": "solidity", "primary_code_char_count": 95, "all_code_blocks": "// Code block 1 (solidity):\nClaimReward(msg.sender, EUSD.getMintedEUSDByShares(eUSDShare), address(0), 0, block.timestamp);\n\n// Code block 2 (solidity):\nevent ClaimReward(address indexed user, uint256 eUSDAmount, address token, uint256 tokenAmount, uint256 time);", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "ClaimReward(msg.sender, EUSD.getMintedEUSDByShares(eUSDShare), address(0), 0, block.timestamp);\n\nevent ClaimReward(address indexed user, uint256 eUSDAmount, address token, uint256 tokenAmount, uint256 time);", "github_refs_formatted": "ProtocolRewardsPool.sol#L190-L218, ProtocolRewardsPool.sol#L214, ProtocolRewardsPool.sol#L46", "github_files_list": "ProtocolRewardsPool.sol", "github_refs_count": 3, "vulnerable_code_actual": "ClaimReward(msg.sender, EUSD.getMintedEUSDByShares(eUSDShare), address(0), 0, block.timestamp);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "event ClaimReward(address indexed user, uint256 eUSDAmount, address token, uint256 tokenAmount, uint256 time);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "06-lybra", "title": "Musaka Q", "severity_raw": "Low", "severity": "low", "description": "# Table of findings\n\n| | |\n|----------|------------------------------------------------------------------------------------|\n| **L-01** | `executeFlashloan` does not check if funds are bigger or equal after the execution |\n| **L-02** | EUSD can be transferred even when paused. |\n\n# Findings\n\n**[LOW-01]** `executeFlashloan` does not check if funds are **>=** after the execution.\n\nIn [`PeUSDMainnetStableVision`](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/token/PeUSDMainnetStableVision.sol), there is an [`executeFlashloan`](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/token/PeUSDMainnetStableVision.sol#L129-L139) function that, as the name suggests, is used for users to make flash loans. However, best practices are not followed in this function. It pulls funds from the receiver and does not check if the funds are greater than or equal to the amount before the flash loan.\nAdd a check for if the funds are more or equal to the ones before the flash loan.\n```jsx\n function executeFlashloan(FlashBorrower receiver, uint256 eusdAmount, bytes calldata data) public payable {\n uint256 shareAmount = EUSD.getSharesByMintedEUSD(eusdAmount);\n+ uint sharesBefore = balanceOf(address(this); //balance of on EUSD gets the shares of an account \n EUSD.transferShares(address(receiver), shareAmount);\n receiver.onFlashLoan(shareAmount, data);//audot LOW cuz it does not check balances before and after\n bool success = EUSD.transferFrom(address(receiver), address(this), EUSD.getMintedEUSDByShares(shareAmount));\n require(success, \"TF\");\n+ uint sharesAfter = balanceOf(address(this); \n+ require(sharesBefore <= sharesAfter,\"FL failed\");\n\n uint256 burnShare = getFee(shareAmount);\n EUSD.burnShares(address(receiver), burnShare);\n emit Flashloaned", "vulnerable_code": "**[LOW-02]** EUSD can be transferred even when paused.\n\nIn the [comments](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/token/EUSD.sol#L222), the developers state that a transfers and increase or decrease on allowances should not be possible if the contract is paused. However, the [function](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/token/EUSD.sol#L226) lacks the modifier for pausing transfers. Here's an example of the code:", "fixed_code": "", "recommendation": "", "category": "flash-loan", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/Musaka-Q.md", "collected_at": "2026-01-02T18:22:31.067165+00:00", "source_hash": "39387925ea12994314ca3ba332622b3dc9848098a804e615581a2642e74fc5b7", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "PeUSDMainnetStableVision.sol, PeUSDMainnetStableVision.sol#L129-L139, EUSD.sol#L222, EUSD.sol#L226", "github_files_list": "PeUSDMainnetStableVision.sol, EUSD.sol", "github_refs_count": 4, "vulnerable_code_actual": "**[LOW-02]** EUSD can be transferred even when paused.\n\nIn the [comments](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/token/EUSD.sol#L222), the developers state that a transfers and increase or decrease on allowances should not be possible if the contract is paused. However, the [function](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/token/EUSD.sol#L226) lacks the modifier for pausing transfers. Here's an example of the code:", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "02-ethos", "title": "Breeje Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA Report\n\n## Low Risk Issues\n| Count | Explanation | Instances |\n|:--:|:-------|:--:|\n| [L-01] | `pragma experimental ABIEncoderV2` Used is deprecated | 1 |\n| [L-02] | Upgradeable contract is missing a `__gap[50]` storage variable to allow for new storage variables in later versions | 1 |\n| [L-03] | Use of `ecrecover` can lead to signature mallebility vulnerability | 1 |\n\n| Total Low Risk Issues | 3 |\n|:--:|:--:|\n\n## Non-Critical Issues\n| Count | Explanation | Instances |\n|:--:|:-------|:--:|\n| [N-01] | Function state mutability can be restricted to pure | 2 |\n| [N-02] | Variable name should be in CamelCase | 1 |\n| [N-03] | No Error Message provided for `require` | 3 |\n| [N-04] | Spelling Errors in Natspec | 1 |\n| [N-05] | Recommended to use 2 step while Updating Critical addresses | 2 |\n\n| Total Non-Critical Issues | 5 |\n|:--:|:--:|\n\n### [L-01] `pragma experimental ABIEncoderV2` Used is deprecated\n\n## Description\n\n`pragma experimental ABIEncoderV2` Used is deprecated. Should use `pragma abicoder v2` instead which supports more types than v1 and performs more sanity checks on the inputs.\n\nABI coder v2 is activated by default in Solidity Version ^0.8.0. So it is already Enabled without explictly enabling it.\n\n## Reference\n\n* [Breaking Changes in Solidity ^0.8.0](https://github.com/ethereum/solidity/blob/69411436139acf5dbcfc5828446f18b9fcfee32c/docs/080-breaking-changes.rst#silent-changes-of-the-semantics)\n\n## Recommendation Mitigation Step\n\nRemove pragma experimental ABIEncoderV2 from the following code instance.\n\n*Instance (1):*\n```solidity\nFile: DistributionTypes.sol\n\n2: pragma experimental ABIEncoderV2;\n\n```\n[Link to code](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/libraries/DistributionTypes.sol#L2)\n\n### [L-02] Upgradeable contract is missing a `__gap[50]` storage variable to allow for new storage variables in later versions\n\nSee [this](https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps) link for a descript", "vulnerable_code": "File: DistributionTypes.sol\n\n2: pragma experimental ABIEncoderV2;\n", "fixed_code": "File: ReaperBaseStrategyv4.sol\n\n14: abstract contract ReaperBaseStrategyv4 is\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/Breeje-Q.md", "collected_at": "2026-01-02T18:16:01.299591+00:00", "source_hash": "39526e1d729f8f2c3ac4be9c2310442a1dfe615465c5bf274d34e2d159799bb1", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 68, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: DistributionTypes.sol\n\n2: pragma experimental ABIEncoderV2;", "primary_code_language": "solidity", "primary_code_char_count": 68, "all_code_blocks": "// Code block 1 (solidity):\nFile: DistributionTypes.sol\n\n2: pragma experimental ABIEncoderV2;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: DistributionTypes.sol\n\n2: pragma experimental ABIEncoderV2;", "github_refs_formatted": "DistributionTypes.sol#L2", "github_files_list": "DistributionTypes.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: DistributionTypes.sol\n\n2: pragma experimental ABIEncoderV2;\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: ReaperBaseStrategyv4.sol\n\n14: abstract contract ReaperBaseStrategyv4 is\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ai-arena", "title": "0xweb3boy Q", "severity_raw": "Medium", "severity": "medium", "description": "# [L-1] - ClaimNRN will revert when everybody send their 100% points to the Merging Pool\n\n```solidity\nfunction claimNRN() external {\n require(numRoundsClaimed[msg.sender] < roundId, \"Already claimed NRNs for this period\");\n uint256 claimableNRN = 0;\n uint256 nrnDistribution;\n uint32 lowerBound = numRoundsClaimed[msg.sender];\n for (uint32 currentRound = lowerBound; currentRound < roundId; currentRound++) {\n nrnDistribution = getNrnDistribution(currentRound);\n claimableNRN += (\n accumulatedPointsPerAddress[msg.sender][currentRound] * nrnDistribution \n ) / totalAccumulatedPoints[currentRound]; \n numRoundsClaimed[msg.sender] += 1;\n }\n if (claimableNRN > 0) {\n amountClaimed[msg.sender] += claimableNRN;\n _neuronInstance.mint(msg.sender, claimableNRN);\n emit Claimed(msg.sender, claimableNRN);\n }\n }\n```\n\nThe above function will revert when everyone decide to send their 100% points to the MergingPool since `mergingPortion` matters in `_addResultPoints`\n\n```solidity\nif (battleResult == 0) {\n /// If the user won the match\n\n /// If the user has no NRNs at risk, then they can earn points\n if (stakeAtRisk == 0) {\n points = stakingFactor[tokenId] * eloFactor;\n }\n\n /// Divert a portion of the points to the merging pool\n uint256 mergingPoints = (points * mergingPortion) / 100;\n points -= mergingPoints;\n _mergingPoolInstance.addPoints(tokenId, mergingPoints);\n``` \n\nIf user won a match and his mergingPortion is 100%, all of his points are sent to mergingPool.And the line `points -= mergingPoints`, points will be 0 in that case and no points are added to the rankedBattle accounting here:\n\n```solidity\naccumulatedPointsPerFighter[tokenId][roundId] += points;\n accumulatedPointsPerAddress[fighterOwner][roundId] += points;\n ", "vulnerable_code": "function claimNRN() external {\n require(numRoundsClaimed[msg.sender] < roundId, \"Already claimed NRNs for this period\");\n uint256 claimableNRN = 0;\n uint256 nrnDistribution;\n uint32 lowerBound = numRoundsClaimed[msg.sender];\n for (uint32 currentRound = lowerBound; currentRound < roundId; currentRound++) {\n nrnDistribution = getNrnDistribution(currentRound);\n claimableNRN += (\n accumulatedPointsPerAddress[msg.sender][currentRound] * nrnDistribution \n ) / totalAccumulatedPoints[currentRound]; \n numRoundsClaimed[msg.sender] += 1;\n }\n if (claimableNRN > 0) {\n amountClaimed[msg.sender] += claimableNRN;\n _neuronInstance.mint(msg.sender, claimableNRN);\n emit Claimed(msg.sender, claimableNRN);\n }\n }", "fixed_code": "if (battleResult == 0) {\n /// If the user won the match\n\n /// If the user has no NRNs at risk, then they can earn points\n if (stakeAtRisk == 0) {\n points = stakingFactor[tokenId] * eloFactor;\n }\n\n /// Divert a portion of the points to the merging pool\n uint256 mergingPoints = (points * mergingPortion) / 100;\n points -= mergingPoints;\n _mergingPoolInstance.addPoints(tokenId, mergingPoints);", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/0xweb3boy-Q.md", "collected_at": "2026-01-02T19:02:10.993368+00:00", "source_hash": "3978a1cc51e99fbcab02f0df0e2bbb9bd5d503727b386cdff171ae6a9d1ebc39", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 1348, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function claimNRN() external {\n require(numRoundsClaimed[msg.sender] < roundId, \"Already claimed NRNs for this period\");\n uint256 claimableNRN = 0;\n uint256 nrnDistribution;\n uint32 lowerBound = numRoundsClaimed[msg.sender];\n for (uint32 currentRound = lowerBound; currentRound < roundId; currentRound++) {\n nrnDistribution = getNrnDistribution(currentRound);\n claimableNRN += (\n accumulatedPointsPerAddress[msg.sender][currentRound] * nrnDistribution \n ) / totalAccumulatedPoints[currentRound]; \n numRoundsClaimed[msg.sender] += 1;\n }\n if (claimableNRN > 0) {\n amountClaimed[msg.sender] += claimableNRN;\n _neuronInstance.mint(msg.sender, claimableNRN);\n emit Claimed(msg.sender, claimableNRN);\n }\n }", "primary_code_language": "solidity", "primary_code_char_count": 853, "all_code_blocks": "// Code block 1 (solidity):\nfunction claimNRN() external {\n require(numRoundsClaimed[msg.sender] < roundId, \"Already claimed NRNs for this period\");\n uint256 claimableNRN = 0;\n uint256 nrnDistribution;\n uint32 lowerBound = numRoundsClaimed[msg.sender];\n for (uint32 currentRound = lowerBound; currentRound < roundId; currentRound++) {\n nrnDistribution = getNrnDistribution(currentRound);\n claimableNRN += (\n accumulatedPointsPerAddress[msg.sender][currentRound] * nrnDistribution \n ) / totalAccumulatedPoints[currentRound]; \n numRoundsClaimed[msg.sender] += 1;\n }\n if (claimableNRN > 0) {\n amountClaimed[msg.sender] += claimableNRN;\n _neuronInstance.mint(msg.sender, claimableNRN);\n emit Claimed(msg.sender, claimableNRN);\n }\n }\n\n// Code block 2 (solidity):\nif (battleResult == 0) {\n /// If the user won the match\n\n /// If the user has no NRNs at risk, then they can earn points\n if (stakeAtRisk == 0) {\n points = stakingFactor[tokenId] * eloFactor;\n }\n\n /// Divert a portion of the points to the merging pool\n uint256 mergingPoints = (points * mergingPortion) / 100;\n points -= mergingPoints;\n _mergingPoolInstance.addPoints(tokenId, mergingPoints);", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function claimNRN() external {\n require(numRoundsClaimed[msg.sender] < roundId, \"Already claimed NRNs for this period\");\n uint256 claimableNRN = 0;\n uint256 nrnDistribution;\n uint32 lowerBound = numRoundsClaimed[msg.sender];\n for (uint32 currentRound = lowerBound; currentRound < roundId; currentRound++) {\n nrnDistribution = getNrnDistribution(currentRound);\n claimableNRN += (\n accumulatedPointsPerAddress[msg.sender][currentRound] * nrnDistribution \n ) / totalAccumulatedPoints[currentRound]; \n numRoundsClaimed[msg.sender] += 1;\n }\n if (claimableNRN > 0) {\n amountClaimed[msg.sender] += claimableNRN;\n _neuronInstance.mint(msg.sender, claimableNRN);\n emit Claimed(msg.sender, claimableNRN);\n }\n }\n\nif (battleResult == 0) {\n /// If the user won the match\n\n /// If the user has no NRNs at risk, then they can earn points\n if (stakeAtRisk == 0) {\n points = stakingFactor[tokenId] * eloFactor;\n }\n\n /// Divert a portion of the points to the merging pool\n uint256 mergingPoints = (points * mergingPortion) / 100;\n points -= mergingPoints;\n _mergingPoolInstance.addPoints(tokenId, mergingPoints);", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function claimNRN() external {\n require(numRoundsClaimed[msg.sender] < roundId, \"Already claimed NRNs for this period\");\n uint256 claimableNRN = 0;\n uint256 nrnDistribution;\n uint32 lowerBound = numRoundsClaimed[msg.sender];\n for (uint32 currentRound = lowerBound; currentRound < roundId; currentRound++) {\n nrnDistribution = getNrnDistribution(currentRound);\n claimableNRN += (\n accumulatedPointsPerAddress[msg.sender][currentRound] * nrnDistribution \n ) / totalAccumulatedPoints[currentRound]; \n numRoundsClaimed[msg.sender] += 1;\n }\n if (claimableNRN > 0) {\n amountClaimed[msg.sender] += claimableNRN;\n _neuronInstance.mint(msg.sender, claimableNRN);\n emit Claimed(msg.sender, claimableNRN);\n }\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "if (battleResult == 0) {\n /// If the user won the match\n\n /// If the user has no NRNs at risk, then they can earn points\n if (stakeAtRisk == 0) {\n points = stakingFactor[tokenId] * eloFactor;\n }\n\n /// Divert a portion of the points to the merging pool\n uint256 mergingPoints = (points * mergingPortion) / 100;\n points -= mergingPoints;\n _mergingPoolInstance.addPoints(tokenId, mergingPoints);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ai-arena", "title": "Lucyan99 Q", "severity_raw": "Gas", "severity": "gas", "description": "### [GAS-1] Duplicate execution of the same code\n\nYou shouldn't call `addAttributeProbabilities(0, probabilities)` in the constructor on line 45, because you add the attribute probabilities manually on line 49:\n\n*Instances (1)*:\n\n```solidity\nFile: src/AiArenaHelper.sol.sol\n\n41: constructor(uint8[][] memory probabilities) {\n42: _ownerAddress = msg.sender;\n43:\n44: // Initialize the probabilities for each attribute\n45: addAttributeProbabilities(0, probabilities);\n46:\n47: uint256 attributesLength = attributes.length;\n48: for (uint8 i = 0; i < attributesLength; i++) {\n49: attributeProbabilities[0][attributes[i]] = probabilities[i];\n50: attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n51: }\n52: }\n\n```\n```solidity\n\n131: function addAttributeProbabilities(uint256 generation, uint8[][] memory probabilities) public {\n132: require(msg.sender == _ownerAddress);\n133: require(probabilities.length == 6, \"Invalid number of attribute arrays\");\n134:\n135: uint256 attributesLength = attributes.length;\n136: for (uint8 i = 0; i < attributesLength; i++) {\n137: attributeProbabilities[generation][attributes[i]] = probabilities[i];\n138: }\n139: }\n\n```\n\n[Link to code](https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/AiArenaHelper.sol)\n\n### [NC-1] The owner of the contract can be different from the deployer.\n\nAs mention in the natspec, the `ownerAddress` parameter you send to the `constructor` function should be the address of the contract deployer. In order to make sure you don't send a wrong address when you deploy the contract, you can simply use `msg.sender` instead of the `ownerAddress` parameter.\n\n*Instances (5)*:\n\n```solidity\nFile: src/FighterFarm.sol\n\n101: /// @param ownerAddress Address of contract deployer.\n102: /// @param delegatedAddress Address of delegated signer for messages.\n103: /// @param treasuryAddress_ Community t", "vulnerable_code": "File: src/AiArenaHelper.sol.sol\n\n41: constructor(uint8[][] memory probabilities) {\n42: _ownerAddress = msg.sender;\n43:\n44: // Initialize the probabilities for each attribute\n45: addAttributeProbabilities(0, probabilities);\n46:\n47: uint256 attributesLength = attributes.length;\n48: for (uint8 i = 0; i < attributesLength; i++) {\n49: attributeProbabilities[0][attributes[i]] = probabilities[i];\n50: attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n51: }\n52: }\n", "fixed_code": "131: function addAttributeProbabilities(uint256 generation, uint8[][] memory probabilities) public {\n132: require(msg.sender == _ownerAddress);\n133: require(probabilities.length == 6, \"Invalid number of attribute arrays\");\n134:\n135: uint256 attributesLength = attributes.length;\n136: for (uint8 i = 0; i < attributesLength; i++) {\n137: attributeProbabilities[generation][attributes[i]] = probabilities[i];\n138: }\n139: }\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/Lucyan99-Q.md", "collected_at": "2026-01-02T19:02:32.263878+00:00", "source_hash": "39b855097459eb231d48d705023bed1c42acafc60aad3d730c624e14852aebc4", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 1016, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: src/AiArenaHelper.sol.sol\n\n41: constructor(uint8[][] memory probabilities) {\n42: _ownerAddress = msg.sender;\n43:\n44: // Initialize the probabilities for each attribute\n45: addAttributeProbabilities(0, probabilities);\n46:\n47: uint256 attributesLength = attributes.length;\n48: for (uint8 i = 0; i < attributesLength; i++) {\n49: attributeProbabilities[0][attributes[i]] = probabilities[i];\n50: attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n51: }\n52: }", "primary_code_language": "solidity", "primary_code_char_count": 545, "all_code_blocks": "// Code block 1 (solidity):\nFile: src/AiArenaHelper.sol.sol\n\n41: constructor(uint8[][] memory probabilities) {\n42: _ownerAddress = msg.sender;\n43:\n44: // Initialize the probabilities for each attribute\n45: addAttributeProbabilities(0, probabilities);\n46:\n47: uint256 attributesLength = attributes.length;\n48: for (uint8 i = 0; i < attributesLength; i++) {\n49: attributeProbabilities[0][attributes[i]] = probabilities[i];\n50: attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n51: }\n52: }\n\n// Code block 2 (solidity):\n131: function addAttributeProbabilities(uint256 generation, uint8[][] memory probabilities) public {\n132: require(msg.sender == _ownerAddress);\n133: require(probabilities.length == 6, \"Invalid number of attribute arrays\");\n134:\n135: uint256 attributesLength = attributes.length;\n136: for (uint8 i = 0; i < attributesLength; i++) {\n137: attributeProbabilities[generation][attributes[i]] = probabilities[i];\n138: }\n139: }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: src/AiArenaHelper.sol.sol\n\n41: constructor(uint8[][] memory probabilities) {\n42: _ownerAddress = msg.sender;\n43:\n44: // Initialize the probabilities for each attribute\n45: addAttributeProbabilities(0, probabilities);\n46:\n47: uint256 attributesLength = attributes.length;\n48: for (uint8 i = 0; i < attributesLength; i++) {\n49: attributeProbabilities[0][attributes[i]] = probabilities[i];\n50: attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n51: }\n52: }\n\n131: function addAttributeProbabilities(uint256 generation, uint8[][] memory probabilities) public {\n132: require(msg.sender == _ownerAddress);\n133: require(probabilities.length == 6, \"Invalid number of attribute arrays\");\n134:\n135: uint256 attributesLength = attributes.length;\n136: for (uint8 i = 0; i < attributesLength; i++) {\n137: attributeProbabilities[generation][attributes[i]] = probabilities[i];\n138: }\n139: }", "github_refs_formatted": "AiArenaHelper.sol", "github_files_list": "AiArenaHelper.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: src/AiArenaHelper.sol.sol\n\n41: constructor(uint8[][] memory probabilities) {\n42: _ownerAddress = msg.sender;\n43:\n44: // Initialize the probabilities for each attribute\n45: addAttributeProbabilities(0, probabilities);\n46:\n47: uint256 attributesLength = attributes.length;\n48: for (uint8 i = 0; i < attributesLength; i++) {\n49: attributeProbabilities[0][attributes[i]] = probabilities[i];\n50: attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n51: }\n52: }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "131: function addAttributeProbabilities(uint256 generation, uint8[][] memory probabilities) public {\n132: require(msg.sender == _ownerAddress);\n133: require(probabilities.length == 6, \"Invalid number of attribute arrays\");\n134:\n135: uint256 attributesLength = attributes.length;\n136: for (uint8 i = 0; i < attributesLength; i++) {\n137: attributeProbabilities[generation][attributes[i]] = probabilities[i];\n138: }\n139: }\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "02-ethos", "title": "dontonka Q", "severity_raw": "Low", "severity": "low", "description": "Some reported issues here are just added as a comment, but most have been applied the suggested corrections already, you can see all the final diffs. Take note that the code compile and all test pass with those too.\n\n```diff\ndiff --git a/Ethos-Core/contracts/ActivePool.sol b/Ethos-Core/contracts/ActivePool.sol\nindex 771da52..4e58ef4 100644\n--- a/Ethos-Core/contracts/ActivePool.sol\n+++ b/Ethos-Core/contracts/ActivePool.sol\n@@ -83,6 +83,7 @@ contract ActivePool is Ownable, CheckContract, IActivePool {\n onlyOwner\n {\n require(!addressesSet, \"Can call setAddresses only once\");\n+ require(_treasuryAddress != address(0), \"Treasury cannot be 0 address\"); //@audit (QA) moved beginning of function so its cleaner.\n \n checkContract(_collateralConfigAddress);\n checkContract(_borrowerOperationsAddress);\n@@ -90,7 +91,6 @@ contract ActivePool is Ownable, CheckContract, IActivePool {\n checkContract(_stabilityPoolAddress);\n checkContract(_defaultPoolAddress);\n checkContract(_collSurplusPoolAddress);\n- require(_treasuryAddress != address(0), \"Treasury cannot be 0 address\");\n checkContract(_lqtyStakingAddress);\n \n collateralConfigAddress = _collateralConfigAddress;\n@@ -124,19 +124,20 @@ contract ActivePool is Ownable, CheckContract, IActivePool {\n \n function setYieldingPercentage(address _collateral, uint256 _bps) external onlyOwner {\n _requireValidCollateralAddress(_collateral);\n- require(_bps <= 10_000, \"Invalid BPS value\");\n+ require(_bps <= 10_000, \"Invalid BPS value\"); //@audit (QA) no lower limit verification. A value of 0 seems to be problematic it would turn off the yield.\n yieldingPercentage[_collateral] = _bps;\n emit YieldingPercentageUpdated(_collateral, _bps);\n }\n \n function setYieldingPercentageDrift(uint256 _driftBps) external onlyOwner {\n- require(_driftBps <= 500, \"Exceeds max allowed value of 500 BPS\");\n+ require(_drif", "vulnerable_code": "```diff\ndiff --git a/Ethos-Core/contracts/BorrowerOperations.sol b/Ethos-Core/contracts/BorrowerOperations.sol\nindex 6ee5c75..ecc605b 100644\n--- a/Ethos-Core/contracts/BorrowerOperations.sol\n+++ b/Ethos-Core/contracts/BorrowerOperations.sol\n@@ -194,7 +194,7 @@ contract BorrowerOperations is LiquityBase, Ownable, CheckContract, IBorrowerOpe\n \n // ICR is based on the composite debt, i.e. the requested LUSD amount + LUSD borrowing fee + LUSD gas comp.\n vars.compositeDebt = _getCompositeDebt(vars.netDebt);\n- assert(vars.compositeDebt > 0);\n+ assert(vars.compositeDebt > 0); //@audit (QA) seems redundant, _requireAtLeastMinNetDebt already confirm this indirectly. What would be more useful is probably vars.compositeDebt > vars.netDebt. I would probably just remove this assert tbh to save gas, its dead code in the end.\n \n vars.ICR = LiquityMath._computeCR(_collAmount, vars.compositeDebt, vars.price, vars.collDecimals);\n vars.NICR = LiquityMath._computeNominalCR(_collAmount, vars.compositeDebt, vars.collDecimals);", "fixed_code": "```diff\ndiff --git a/Ethos-Core/contracts/LQTY/CommunityIssuance.sol b/Ethos-Core/contracts/LQTY/CommunityIssuance.sol\nindex c79adfe..39f7ac8 100644\n--- a/Ethos-Core/contracts/LQTY/CommunityIssuance.sol\n+++ b/Ethos-Core/contracts/LQTY/CommunityIssuance.sol\n@@ -2,17 +2,18 @@\n \n pragma solidity 0.6.11;\n \n import \"../Dependencies/IERC20.sol\";\n import \"../Interfaces/ICommunityIssuance.sol\";\n import \"../Dependencies/BaseMath.sol\";\n import \"../Dependencies/LiquityMath.sol\";\n import \"../Dependencies/Ownable.sol\";\n import \"../Dependencies/CheckContract.sol\";\n import \"../Dependencies/SafeMath.sol\";\n+import \"../Dependencies/SafeERC20.sol\";\n \n \n contract CommunityIssuance is ICommunityIssuance, Ownable, CheckContract, BaseMath {\n using SafeMath for uint;\n+ using SafeERC20 for IERC20; //@audit (QA) added the safe as other contracts, and updated the corresponding lines\n \n // --- Data ---\n \n@@ -83,6 +84,7 @@ contract CommunityIssuance is ICommunityIssuance, Ownable, CheckContract, BaseMa\n // @dev issues a set amount of Oath to the stability pool\n function issueOath() external override returns (uint issuance) {\n _requireCallerIsStabilityPool();\n+\n if (lastIssuanceTimestamp < lastDistributionTime) {\n uint256 endTimestamp = block.timestamp > lastDistributionTime ? lastDistributionTime : block.timestamp;\n uint256 timePassed = endTimestamp.sub(lastIssuanceTimestamp);\n@@ -100,7 +102,7 @@ contract CommunityIssuance is ICommunityIssuance, Ownable, CheckContract, BaseMa\n */\n function fund(uint amount) external onlyOwner {\n require(amount != 0, \"cannot fund 0\");\n- OathToken.transferFrom(msg.sender, address(this), amount);\n+ OathToken.safeTransferFrom(msg.sender, address(this), amount);\n \n // roll any unissued OATH into new distribution\n if (lastIssuanceTimestamp < lastDistributionTime) {\n@@ -109,7 +111,7 @@ contract CommunityIssuance is ICommunityIssuance, Ownable, CheckContract, BaseMa", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/dontonka-Q.md", "collected_at": "2026-01-02T18:17:06.931833+00:00", "source_hash": "39baf5c46aa866efacd82ce3fee8bc44daaa79f6daf0474b3be1fe57edcb96af", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "```diff\ndiff --git a/Ethos-Core/contracts/BorrowerOperations.sol b/Ethos-Core/contracts/BorrowerOperations.sol\nindex 6ee5c75..ecc605b 100644\n--- a/Ethos-Core/contracts/BorrowerOperations.sol\n+++ b/Ethos-Core/contracts/BorrowerOperations.sol\n@@ -194,7 +194,7 @@ contract BorrowerOperations is LiquityBase, Ownable, CheckContract, IBorrowerOpe\n \n // ICR is based on the composite debt, i.e. the requested LUSD amount + LUSD borrowing fee + LUSD gas comp.\n vars.compositeDebt = _getCompositeDebt(vars.netDebt);\n- assert(vars.compositeDebt > 0);\n+ assert(vars.compositeDebt > 0); //@audit (QA) seems redundant, _requireAtLeastMinNetDebt already confirm this indirectly. What would be more useful is probably vars.compositeDebt > vars.netDebt. I would probably just remove this assert tbh to save gas, its dead code in the end.\n \n vars.ICR = LiquityMath._computeCR(_collAmount, vars.compositeDebt, vars.price, vars.collDecimals);\n vars.NICR = LiquityMath._computeNominalCR(_collAmount, vars.compositeDebt, vars.collDecimals);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "```diff\ndiff --git a/Ethos-Core/contracts/LQTY/CommunityIssuance.sol b/Ethos-Core/contracts/LQTY/CommunityIssuance.sol\nindex c79adfe..39f7ac8 100644\n--- a/Ethos-Core/contracts/LQTY/CommunityIssuance.sol\n+++ b/Ethos-Core/contracts/LQTY/CommunityIssuance.sol\n@@ -2,17 +2,18 @@\n \n pragma solidity 0.6.11;\n \n import \"../Dependencies/IERC20.sol\";\n import \"../Interfaces/ICommunityIssuance.sol\";\n import \"../Dependencies/BaseMath.sol\";\n import \"../Dependencies/LiquityMath.sol\";\n import \"../Dependencies/Ownable.sol\";\n import \"../Dependencies/CheckContract.sol\";\n import \"../Dependencies/SafeMath.sol\";\n+import \"../Dependencies/SafeERC20.sol\";\n \n \n contract CommunityIssuance is ICommunityIssuance, Ownable, CheckContract, BaseMath {\n using SafeMath for uint;\n+ using SafeERC20 for IERC20; //@audit (QA) added the safe as other contracts, and updated the corresponding lines\n \n // --- Data ---\n \n@@ -83,6 +84,7 @@ contract CommunityIssuance is ICommunityIssuance, Ownable, CheckContract, BaseMa\n // @dev issues a set amount of Oath to the stability pool\n function issueOath() external override returns (uint issuance) {\n _requireCallerIsStabilityPool();\n+\n if (lastIssuanceTimestamp < lastDistributionTime) {\n uint256 endTimestamp = block.timestamp > lastDistributionTime ? lastDistributionTime : block.timestamp;\n uint256 timePassed = endTimestamp.sub(lastIssuanceTimestamp);\n@@ -100,7 +102,7 @@ contract CommunityIssuance is ICommunityIssuance, Ownable, CheckContract, BaseMa\n */\n function fund(uint amount) external onlyOwner {\n require(amount != 0, \"cannot fund 0\");\n- OathToken.transferFrom(msg.sender, address(this), amount);\n+ OathToken.safeTransferFrom(msg.sender, address(this), amount);\n \n // roll any unissued OATH into new distribution\n if (lastIssuanceTimestamp < lastDistributionTime) {\n@@ -109,7 +111,7 @@ contract CommunityIssuance is ICommunityIssuance, Ownable, CheckContract, BaseMa", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "02-ethos", "title": "kaden G", "severity_raw": "Medium", "severity": "medium", "description": "#### Pack Config into single storage slot\n\n##### Severity: Gas Optimization\n\n##### Context:\n\n- https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/CollateralConfig.sol#L27\n\n##### Description\n\nThe current `Config` struct in `CollateralConfig` requires 4 storage slots.\n\n```\nstruct Config {\n\tbool allowed;\n\tuint256 decimals;\n\tuint256 MCR;\n\tuint256 CCR;\n}\n```\n\nThe following will pack all the elements into a single storage slot where initializing `collateralConfig`s will only require 1 SSTORE instead of 4, similarly retrieving the config for a collateral will only require 1 SLOAD instead of 4.\n\n\n#### Redundant negation\n\n##### Severity: Gas Optimization\n\n##### Context:\n\n- https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Vault/contracts/abstract/ReaperBaseStrategyv4.sol#L128\n\n##### Description\n\nThe following line decrements `repayment` by `-roi`.\n\n```\n// ReaperBaseStrategyV4.sol:L128\nrepayment -= uint256(-roi);\n```\n\nThis double negation is redundant, and instead should be replaced by a simple increment.\n\n```\nrepayment += uint256(roi);\n```\n\n\n### Static Analysis Findings\n\n#### Mark storage variables as `immutable` if they never change after contract initialization.\n\nState variables can be declared as constant or immutable. In both cases, the variables cannot be modified after the contract has been constructed. For constant variables, the value has to be fixed at compile-time, while for immutable, it can still be assigned at construction time.\n\nThe compiler does not reserve a storage slot for these variables, and every occurrence is inlined by the respective value.\n\nCompared to regular state variables, the gas costs of constant and immutable variables are much lower. For a constant variable, the expression assigned to it is copied to all the places where it is accessed and also re-evaluated each time. This allows for local optimizations. Immutable variables are evaluated o", "vulnerable_code": "struct Config {\n\tbool allowed;\n\tuint256 decimals;\n\tuint256 MCR;\n\tuint256 CCR;\n}", "fixed_code": "// ReaperBaseStrategyV4.sol:L128\nrepayment -= uint256(-roi);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/kaden-G.md", "collected_at": "2026-01-02T18:17:19.925142+00:00", "source_hash": "39bfd1ab752b810e88ec68f2f063636a2d5022998c6e9b351719b4243d5aa78e", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 165, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "struct Config {\n\tbool allowed;\n\tuint256 decimals;\n\tuint256 MCR;\n\tuint256 CCR;\n}", "primary_code_language": "unknown", "primary_code_char_count": 79, "all_code_blocks": "// Code block 1 (unknown):\nstruct Config {\n\tbool allowed;\n\tuint256 decimals;\n\tuint256 MCR;\n\tuint256 CCR;\n}\n\n// Code block 2 (unknown):\n// ReaperBaseStrategyV4.sol:L128\nrepayment -= uint256(-roi);\n\n// Code block 3 (unknown):\nrepayment += uint256(roi);", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CollateralConfig.sol#L27, ReaperBaseStrategyv4.sol#L128", "github_files_list": "ReaperBaseStrategyv4.sol, CollateralConfig.sol", "github_refs_count": 2, "vulnerable_code_actual": "struct Config {\n\tbool allowed;\n\tuint256 decimals;\n\tuint256 MCR;\n\tuint256 CCR;\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "// ReaperBaseStrategyV4.sol:L128\nrepayment -= uint256(-roi);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "04-caviar", "title": "Bason Q", "severity_raw": "Critical", "severity": "critical", "description": "## Low and Non-Critical Issues Summary\n| Number |Issues Details |\n|:--:|:-------|\n|[NC-01]| Use stable pragma statement\n|[NC-02]| Add more indexed fields to Events for better traceability\n|[L-01]| Missing events for important parameter changes\n|[L-02]| Possible to pass address 0 in functions that pass ownership\n|[L-03]| Empty receive() function in EthRouter.sol\n|[L-04]| Function sellQuote has misleading NatSpec\n|[L-05]| flashFee function has two input variables which are not used\n\n## |[NC-01]| Use stable pragma statement\n\nUsing a floating pragma statement `^0.8.19` is discouraged as code can compile to different bytecodes with different compiler versions. Use a stable pragma statement to get a deterministic bytecode.\n\n## |[NC-02]| Add more indexed fields to events for better traceability\n\nIt is recommended events to have more than one indexed parameters if possible to make searching event logs faster.\n\nFactory.sol:\nAdd tokenIds to be indexed in the Create event definition\nBEFORE:\n```\nevent Create(address indexed privatePool, uint256[] tokenIds, uint256 baseTokenAmount);\n```\nAFTER:\n```\nevent Create(address indexed privatePool, indexed uint256[] tokenIds, uint256 baseTokenAmount);\n```\n\n## [L-01] MISSING EVENT FOR IMPORTANT PARAMETER CHANGE\n\nEmitting events allows monitoring activities with off-chain monitoring tools.\nI would suggest creating custom events and emitting them on critical parameter changes. I am giving an example for a few files. \n\n```solidity\nFactory.sol\nDefine custom events:\nevent PrivatePoolMetaDataSet(indexed address privatePoolMetadata)\nevent PrivatePoolImplementationSet(indexed address privatePoolImplementation)\nevent ProtocolFeeRateSet();\n\nfunction setPrivatePoolMetadata(address _privatePoolMetadata) public onlyOwner {\n privatePoolMetadata = _privatePoolMetadata;\n emit PrivatePoolMetadataSet(privatePoolMetadata)\n }\n\nfunction setPrivatePoolImplementation(address _privatePoolImplementation) public onlyOwner {\n privatePoolImple", "vulnerable_code": "event Create(address indexed privatePool, uint256[] tokenIds, uint256 baseTokenAmount);", "fixed_code": "event Create(address indexed privatePool, indexed uint256[] tokenIds, uint256 baseTokenAmount);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/Bason-Q.md", "collected_at": "2026-01-02T18:19:30.714686+00:00", "source_hash": "39c1289438f75d42fb61b5a270dc7962734453ab11c9024608cb3d917c273a2a", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 182, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "event Create(address indexed privatePool, uint256[] tokenIds, uint256 baseTokenAmount);", "primary_code_language": "unknown", "primary_code_char_count": 87, "all_code_blocks": "// Code block 1 (unknown):\nevent Create(address indexed privatePool, uint256[] tokenIds, uint256 baseTokenAmount);\n\n// Code block 2 (unknown):\nevent Create(address indexed privatePool, indexed uint256[] tokenIds, uint256 baseTokenAmount);", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "event Create(address indexed privatePool, uint256[] tokenIds, uint256 baseTokenAmount);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "event Create(address indexed privatePool, indexed uint256[] tokenIds, uint256 baseTokenAmount);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "06-lybra", "title": "Musaka G", "severity_raw": "Low", "severity": "low", "description": "# Table of findings\n| | |\n|----------|-----------------------------------------------|\n| **G-01** | Make a modifier to check for collateral ratio |\n\n# Findings\n\n**[G-01]** Make a modifier to check for collateral ratio \nCollateral ratio is checked in a couple of function is bolt [`LybraPeUSDVaultBase`](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/base/LybraPeUSDVaultBase.sol) and [`LybraEUSDVaultBase`](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/base/LybraEUSDVaultBase.sol), to lower the total gas, you can make it as a modifier\n**Example:**\n```jsx\nmodifier checkColl(address who, uint coll) {\n uint256 providerCollateralRatio = (depositedAsset[who] * assetPrice * 100) / borrowed[who];\n require(providerCollateralRatio >= coll, \"Inseficient collateral ration\");\n }\n```\nYou can use it in [`rigidRedemption`](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L157-L168) as:\n```jsx\n function rigidRedemption(address provider, uint256 peusdAmount) external virtual checkColl(provider,100e18){}\n```", "vulnerable_code": "You can use it in [`rigidRedemption`](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L157-L168) as:", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/Musaka-G.md", "collected_at": "2026-01-02T18:22:30.562668+00:00", "source_hash": "3a768be5dbfb73650955b9bd22c4f66d185530930b6b5c35b528b9844a839d10", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 330, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "modifier checkColl(address who, uint coll) {\n uint256 providerCollateralRatio = (depositedAsset[who] * assetPrice * 100) / borrowed[who];\n require(providerCollateralRatio >= coll, \"Inseficient collateral ration\");\n }", "primary_code_language": "jsx", "primary_code_char_count": 221, "all_code_blocks": "// Code block 1 (jsx):\nmodifier checkColl(address who, uint coll) {\n uint256 providerCollateralRatio = (depositedAsset[who] * assetPrice * 100) / borrowed[who];\n require(providerCollateralRatio >= coll, \"Inseficient collateral ration\");\n }\n\n// Code block 2 (jsx):\nfunction rigidRedemption(address provider, uint256 peusdAmount) external virtual checkColl(provider,100e18){}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LybraPeUSDVaultBase.sol, LybraEUSDVaultBase.sol, LybraPeUSDVaultBase.sol#L157-L168", "github_files_list": "LybraEUSDVaultBase.sol, LybraPeUSDVaultBase.sol", "github_refs_count": 3, "vulnerable_code_actual": "You can use it in [`rigidRedemption`](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L157-L168) as:", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6.35} {"source": "c4", "protocol": "01-salty", "title": "jokopoppo Q", "severity_raw": "Unknown", "severity": "unknown", "description": "| Number | Issues | Instances |\n| ------ | ------- | --------- |\n| [N-01] | Whitelist array can exceed maximumWhitelistedPools state | 1 |\n\n### [N-01] - Whitelist array can exceed maximumWhitelistedPools state\n\n#### Line References\n\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/pools/PoolsConfig.sol#L77-L91\n\n#### Description\n\nThe `changeMaximumWhitelistedPools()` function can be used to modify the `maximumWhitelistedPools` state, which sets the boundary for the length of the whitelist array.\n\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/pools/PoolsConfig.sol#L77-L91\n```solidity=77\nfunction changeMaximumWhitelistedPools(bool increase) external onlyOwner\n {\n if (increase)\n {\n if (maximumWhitelistedPools < 100)\n maximumWhitelistedPools += 10;\n }\n else\n {\n if (maximumWhitelistedPools > 20)\n maximumWhitelistedPools -= 10;\n }\n\n emit MaximumWhitelistedPoolsChanged(maximumWhitelistedPools);\n }\n```\n\nHowever, there is no validation check on the whitelist array length when changing the `maximumWhitelistedPools` state, resulting in a potential conflict between the `maximumWhitelistedPools` state and the whitelist array.\n\n#### Recommended Mitigation Steps\nAdding a validation check on the whitelist array length before modifying the `maximumWhitelistedPools` state, for example.\n\n```diff=77\nfunction changeMaximumWhitelistedPools(bool increase) external onlyOwner\n {\n if (increase)\n {\n if (maximumWhitelistedPools < 100)\n maximumWhitelistedPools += 10;\n }\n else\n {\n if (maximumWhitelistedPools > 20)\n maximumWhitelistedPools -= 10;\n++ require( _whitelist.length() <= maximumWhitelistedPools, \"Maximum number of whitelisted pools already reached\" );\n }\n\n emit MaximumWhitelistedPoolsChanged(maximumWhitelistedPools);\n }\n``", "vulnerable_code": "However, there is no validation check on the whitelist array length when changing the `maximumWhitelistedPools` state, resulting in a potential conflict between the `maximumWhitelistedPools` state and the whitelist array.\n\n#### Recommended Mitigation Steps\nAdding a validation check on the whitelist array length before modifying the `maximumWhitelistedPools` state, for example.\n", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/jokopoppo-Q.md", "collected_at": "2026-01-02T19:01:47.581470+00:00", "source_hash": "3a8e1d817d94e1f1859e96d683c68cdba13741e0ce91f87e6a6c93616801c4d7", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 379, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "However, there is no validation check on the whitelist array length when changing the `maximumWhitelistedPools` state, resulting in a potential conflict between the `maximumWhitelistedPools` state and the whitelist array.\n\n#### Recommended Mitigation Steps\nAdding a validation check on the whitelist array length before modifying the `maximumWhitelistedPools` state, for example.", "primary_code_language": "unknown", "primary_code_char_count": 379, "all_code_blocks": "// Code block 1 (unknown):\nHowever, there is no validation check on the whitelist array length when changing the `maximumWhitelistedPools` state, resulting in a potential conflict between the `maximumWhitelistedPools` state and the whitelist array.\n\n#### Recommended Mitigation Steps\nAdding a validation check on the whitelist array length before modifying the `maximumWhitelistedPools` state, for example.", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "PoolsConfig.sol#L77-L91", "github_files_list": "PoolsConfig.sol", "github_refs_count": 1, "vulnerable_code_actual": "However, there is no validation check on the whitelist array length when changing the `maximumWhitelistedPools` state, resulting in a potential conflict between the `maximumWhitelistedPools` state and the whitelist array.\n\n#### Recommended Mitigation Steps\nAdding a validation check on the whitelist array length before modifying the `maximumWhitelistedPools` state, for example.\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "03-revert-lend", "title": "MSaptarshi Q", "severity_raw": "Low", "severity": "low", "description": "# [L-01] Unsafe Casting\nhttps://github.com/code-423n4/2024-03-revert-lend/blob/435b054f9ad2404173f36f0f74a5096c894b12b7/src/V3Oracle.sol#L342C24-L342C30\nThere are also other instances where it is casted from uint to int \n\n## Recomendation \nUse OZ safeCasting while casting\n\n# [L-02] Natspec comment might not be giving out the exact intended behavior in`AutoCompound::execute()` \n\nThe comment->\n`Can only be called only from configured operator account, or vault via transform`\n```\n if (!operators[msg.sender] && !vaults[msg.sender]) {\n revert Unauthorized();\n }\n```\n## Recommendation \nEdit the comments telling the intended behavior\n# [NC -01] Code structure not suggested\nRefer to the solidity docs for the code structure", "vulnerable_code": " if (!operators[msg.sender] && !vaults[msg.sender]) {\n revert Unauthorized();\n }", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/MSaptarshi-Q.md", "collected_at": "2026-01-02T19:03:01.495221+00:00", "source_hash": "3a90dc560cc4bc632ee098efeb5e3220aab3da73f6425d761c83fe40c307d873", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 97, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "if (!operators[msg.sender] && !vaults[msg.sender]) {\n revert Unauthorized();\n }", "primary_code_language": "unknown", "primary_code_char_count": 97, "all_code_blocks": "// Code block 1 (unknown):\nif (!operators[msg.sender] && !vaults[msg.sender]) {\n revert Unauthorized();\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "V3Oracle.sol#L342-L24", "github_files_list": "V3Oracle.sol", "github_refs_count": 1, "vulnerable_code_actual": " if (!operators[msg.sender] && !vaults[msg.sender]) {\n revert Unauthorized();\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.48} {"source": "c4", "protocol": "03-asymmetry", "title": "Bloqarl Q", "severity_raw": "High", "severity": "high", "description": "## QA Report\n\n# [L-01] Use Ownable2StepUpgradeable instead of OwnableUpgradeable contract\nIn four contracts the `transferOwnership` is used in the `initialize()` function in order to use to change Ownership. It is, however, imported from `OwnableUpgradeable`. There is another Openzeppelin Ownable contract (Ownable2StepUpgradeable.sol) that also has `transferOwnership()` function.\n\nThere are four instances in contracts `SafEth.sol`, `Reth.sol`, `SfrxEth.sol` and `WstEth.sol`\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L18\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/Reth.sol#L19\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/SfrxEth.sol#L13\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/WstEth.sol#L12\n\n\n# [L-02] Use `_safeTransferOwnership` instead of `_transferOwnership`\nUse `_safeTransferOwnership` function instead of `_transferOwnership`. It is more secure due to 2-stage ownership transfer.\n\nThere are four instances in contracts `SafEth.sol`, `Reth.sol`, `SfrxEth.sol` and `WstEth.sol`\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/WstEth.sol#L34\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/SfrxEth.sol#L37\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/Reth.sol#L43\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L53\n\n# [L-03] Avoid magic numbers\nIn order to make the code more readable for future changes, reviews or other usages, it is always convenient to not use", "vulnerable_code": "address public constant UNISWAP_ROUTER =\n 0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45;\naddress public constant UNI_V3_FACTORY =\n 0x1F98431c8aD98523631AE4a59f267346ea31F984;", "fixed_code": " uint256 minOut = (((ethPerDerivative(_amount) * _amount) / 10 ** 18) *\n (10 ** 18 - maxSlippage)) / 10 ** 18;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Bloqarl-Q.md", "collected_at": "2026-01-02T18:17:55.265052+00:00", "source_hash": "3aa2454508f4cac9aa4106d6ff70aa57341dfe2567e53f0051bc0a1a487e8ddd", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 8, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol#L18, Reth.sol#L19, SfrxEth.sol#L13, WstEth.sol#L12, WstEth.sol#L34, SfrxEth.sol#L37, Reth.sol#L43, SafEth.sol#L53", "github_files_list": "SfrxEth.sol, Reth.sol, WstEth.sol, SafEth.sol", "github_refs_count": 8, "vulnerable_code_actual": "address public constant UNISWAP_ROUTER =\n 0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45;\naddress public constant UNI_V3_FACTORY =\n 0x1F98431c8aD98523631AE4a59f267346ea31F984;", "has_vulnerable_code_snippet": true, "fixed_code_actual": " uint256 minOut = (((ethPerDerivative(_amount) * _amount) / 10 ** 18) *\n (10 ** 18 - maxSlippage)) / 10 ** 18;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-salty", "title": "codeslide Q", "severity_raw": "Critical", "severity": "critical", "description": "## Summary\n\n### Low Risk Issues\nThere are 73 instances over 8 issues.\n| ID | Description | Count |\n| :-----------: | :-------------------------------------------------------------------------------------- | ----: |\n| [L-01](#l-01) | Setters should have input validation | 5 |\n| [L-02](#l-02) | Missing checks for `address(0x0)` when updating `address` state variables | 3 |\n| [L-03](#l-03) | Some tokens may revert when zero value transfers are made | 9 |\n| [L-04](#l-04) | External calls in an un-bounded `for`-loop may result in a DOS | 4 |\n| [L-05](#l-05) | Contracts use infinite approvals with no means to revoke | 9 |\n| [L-06](#l-06) | Functions calling contracts/addresses with transfer hooks are missing reentrancy guards | 9 |\n| [L-07](#l-07) | Large approvals may not work with some `ERC20` tokens | 12 |\n| [L-08](#l-08) | Loss of precision | 22 |\n\n### Non-Critical Issues\nThere are 17 instances over 3 issues.\n| ID | Description | Count |\n| :-------------: | :------------------------------------------------------------------------- | ----: |\n| [NC-01](#nc-01) | Missing event for critical parameter change | 1 |\n| [NC-02](#nc-02) | Consider bounding input array length | 2 |\n| [NC-03](#nc-03) | Not using the named return variables anywhere in the function is confusing | 14 |\n\n\n## Details\n\n### Low Risk Iss", "vulnerable_code": "File: src/ExchangeConfig.sol\n\n/// @audit state variables: dao, upkeep, initialDistribution, airdrop, teamVestingWallet, daoVestingWallet\n48: \tfunction setContracts( IDAO _dao, IUpkeep _upkeep, IInitialDistribution _initialDistribution, IAirdrop _airdrop, VestingWallet _teamVestingWallet, VestingWallet _daoVestingWallet ) external onlyOwner\n49: \t\t{", "fixed_code": "File: src/pools/Pools.sol\n\n/// @audit state variables: dao, collateralAndLiquidity\n60: \tfunction setContracts( IDAO _dao, ICollateralAndLiquidity _collateralAndLiquidity ) external onlyOwner\n61: \t\t{", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/codeslide-Q.md", "collected_at": "2026-01-02T19:01:36.783948+00:00", "source_hash": "3adc433fd6880060588ef9e04f33c3f6bcd691392fcffadf324f03d1f81aab0d", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: src/ExchangeConfig.sol\n\n/// @audit state variables: dao, upkeep, initialDistribution, airdrop, teamVestingWallet, daoVestingWallet\n48: \tfunction setContracts( IDAO _dao, IUpkeep _upkeep, IInitialDistribution _initialDistribution, IAirdrop _airdrop, VestingWallet _teamVestingWallet, VestingWallet _daoVestingWallet ) external onlyOwner\n49: \t\t{", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: src/pools/Pools.sol\n\n/// @audit state variables: dao, collateralAndLiquidity\n60: \tfunction setContracts( IDAO _dao, ICollateralAndLiquidity _collateralAndLiquidity ) external onlyOwner\n61: \t\t{", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-asymmetry", "title": "0x6020c0 Q", "severity_raw": "Low", "severity": "low", "description": "[N-01] In `SafEthStorage.sol` line 17. Misspelling in the comment should be `bool public pauseUnstaking; // true if unstaking is paused`\n\n[N-02] In `Reth.sol` lines 197-201. To be consistent with naming convention in `SafEth.sol` change to\n```\n uint256 rethBalanceBefore = rocketTokenRETH.balanceOf(address(this));\n rocketDepositPool.deposit{value: msg.value}();\n uint256 rethBalanceAfter = rocketTokenRETH.balanceOf(address(this));\n require(rethBalanceAfter > rethBalanceBefore, \"No rETH was minted\");\n uint256 rethMinted = rethBalanceAfter - rethBalanceBefore;\n```\n\n[L-01] In `SafEth.sol` line 158. Misleading function description. This function does not add new derivative to the index fund, it changes the weight of existing one. Fix: change `@notice` to `Adjust weight of derivative at index`\n\n\n", "vulnerable_code": " uint256 rethBalanceBefore = rocketTokenRETH.balanceOf(address(this));\n rocketDepositPool.deposit{value: msg.value}();\n uint256 rethBalanceAfter = rocketTokenRETH.balanceOf(address(this));\n require(rethBalanceAfter > rethBalanceBefore, \"No rETH was minted\");\n uint256 rethMinted = rethBalanceAfter - rethBalanceBefore;", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/0x6020c0-Q.md", "collected_at": "2026-01-02T18:17:32.792697+00:00", "source_hash": "3ae6fdf17a1326054efb789ebcab1d3f76bb989c51e9119131cdccc016b04b18", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 333, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "uint256 rethBalanceBefore = rocketTokenRETH.balanceOf(address(this));\n rocketDepositPool.deposit{value: msg.value}();\n uint256 rethBalanceAfter = rocketTokenRETH.balanceOf(address(this));\n require(rethBalanceAfter > rethBalanceBefore, \"No rETH was minted\");\n uint256 rethMinted = rethBalanceAfter - rethBalanceBefore;", "primary_code_language": "unknown", "primary_code_char_count": 333, "all_code_blocks": "// Code block 1 (unknown):\nuint256 rethBalanceBefore = rocketTokenRETH.balanceOf(address(this));\n rocketDepositPool.deposit{value: msg.value}();\n uint256 rethBalanceAfter = rocketTokenRETH.balanceOf(address(this));\n require(rethBalanceAfter > rethBalanceBefore, \"No rETH was minted\");\n uint256 rethMinted = rethBalanceAfter - rethBalanceBefore;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " uint256 rethBalanceBefore = rocketTokenRETH.balanceOf(address(this));\n rocketDepositPool.deposit{value: msg.value}();\n uint256 rethBalanceAfter = rocketTokenRETH.balanceOf(address(this));\n require(rethBalanceAfter > rethBalanceBefore, \"No rETH was minted\");\n uint256 rethMinted = rethBalanceAfter - rethBalanceBefore;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 3.64} {"source": "c4", "protocol": "06-lybra", "title": "Arz Q", "severity_raw": "High", "severity": "high", "description": "## Issue 1 - getExchangeRatio() function does not exist\n\nContract: LybraRETHVault.sol\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/pools/LybraRETHVault.sol#L47\n\nIn LybraRETHVault.sol getExchangeRatio() function is used when calculating the asset price.\n\nHowever the Rocket pool contract(0xae78736Cd615f374D3085123A210448E74Fc6393) doesnt have a function that is called getExchangeRatio(). It only has a function that is called getExchangeRate(). If getExchangeRatio() would get called then the call would revert.\n\n## Recommended Mitigation Steps\nUse getExchangeRate()\n```solidity\nfunction getAssetPrice() public override returns (uint256) {\n return (_etherPrice() * IRETH(address(collateralAsset)).getExchangeRate()) / 1e18;\n}\n\n```\n\n\n## Issue 2 - A user is allowed to burn 0 EUSD in the EUSD Vault\nContract: LybraEUSDVaultBase.sol\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/pools/base/LybraEUSDVaultBase.sol#L140\n\nThe burn() function in LybraEUSDVaultBase.sol doesnt check if the amount that the user is burning is 0. \nAbove the function is written a requirement: `amount` Must be higher than 0 however this isnt checked in the fuction\n\n## Recommended Mitigation Steps\nCheck if the amount that the user is burning is 0\n\n```solidity\n\nfunction burn(address onBehalfOf, uint256 amount) external {\n require(amount > 0, \"ZERO_BURN\");\n require(onBehalfOf != address(0), \"BURN_TO_THE_ZERO_ADDRESS\");\n _repay(msg.sender, onBehalfOf, amount);\n }\n```", "vulnerable_code": "function getAssetPrice() public override returns (uint256) {\n return (_etherPrice() * IRETH(address(collateralAsset)).getExchangeRate()) / 1e18;\n}\n", "fixed_code": "function burn(address onBehalfOf, uint256 amount) external {\n require(amount > 0, \"ZERO_BURN\");\n require(onBehalfOf != address(0), \"BURN_TO_THE_ZERO_ADDRESS\");\n _repay(msg.sender, onBehalfOf, amount);\n }", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/Arz-Q.md", "collected_at": "2026-01-02T18:22:11.723652+00:00", "source_hash": "3aefd12d73be7298a1da429a1b3cb4b2dbb9938b27a7c37f47ab615d480f993f", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 377, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function getAssetPrice() public override returns (uint256) {\n return (_etherPrice() * IRETH(address(collateralAsset)).getExchangeRate()) / 1e18;\n}", "primary_code_language": "solidity", "primary_code_char_count": 150, "all_code_blocks": "// Code block 1 (solidity):\nfunction getAssetPrice() public override returns (uint256) {\n return (_etherPrice() * IRETH(address(collateralAsset)).getExchangeRate()) / 1e18;\n}\n\n// Code block 2 (solidity):\nfunction burn(address onBehalfOf, uint256 amount) external {\n require(amount > 0, \"ZERO_BURN\");\n require(onBehalfOf != address(0), \"BURN_TO_THE_ZERO_ADDRESS\");\n _repay(msg.sender, onBehalfOf, amount);\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function getAssetPrice() public override returns (uint256) {\n return (_etherPrice() * IRETH(address(collateralAsset)).getExchangeRate()) / 1e18;\n}\n\nfunction burn(address onBehalfOf, uint256 amount) external {\n require(amount > 0, \"ZERO_BURN\");\n require(onBehalfOf != address(0), \"BURN_TO_THE_ZERO_ADDRESS\");\n _repay(msg.sender, onBehalfOf, amount);\n }", "github_refs_formatted": "LybraRETHVault.sol#L47, LybraEUSDVaultBase.sol#L140", "github_files_list": "LybraEUSDVaultBase.sol, LybraRETHVault.sol", "github_refs_count": 2, "vulnerable_code_actual": "function getAssetPrice() public override returns (uint256) {\n return (_etherPrice() * IRETH(address(collateralAsset)).getExchangeRate()) / 1e18;\n}\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function burn(address onBehalfOf, uint256 amount) external {\n require(amount > 0, \"ZERO_BURN\");\n require(onBehalfOf != address(0), \"BURN_TO_THE_ZERO_ADDRESS\");\n _repay(msg.sender, onBehalfOf, amount);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "02-ethos", "title": "cyberinn G", "severity_raw": "Gas", "severity": "gas", "description": "## [G-1] Use elementary types or a user-defined type instead of a struct that has only one member\n\n### Impact\n\nUse elementary types or a user-defined type instead of a struct that has only one member.\n\n### Findings\n\nTotal:1\n\n[Ethos-Core/contracts/StabilityPool.sol#L174-L176](https://github.com/code-423n4/2023-02-ethos/blob/main//Ethos-Core/contracts/StabilityPool.sol#L174-L176)\n\n```solidity\n174: struct Deposit {\n175: uint initialValue;\n176: }\n```\n\n## [G-2] Splitting require() statements that use `&&` saves gas\n\n### Impact\n\nWhen using `&&` in a `require()` statement, the entire statement will be evaluated before the transaction reverts. If the first condition is false, the second condition will not be evaluated. This means that if the first condition is false, the second condition will not be evaluated, which is a waste of gas. Splitting the `require()` statement into two separate statements will save gas.\n\n### Findings\n\nTotal:3\n\n[Ethos-Core/contracts/LUSDToken.sol#L352-L357](https://github.com/code-423n4/2023-02-ethos/blob/main//Ethos-Core/contracts/LUSDToken.sol#L352-L357)\n\n```solidity\n352: require(\n353: !stabilityPools[_recipient] &&\n354: !troveManagers[_recipient] &&\n355: !borrowerOperations[_recipient],\n356: \"LUSD: Cannot transfer tokens directly to the StabilityPool, TroveManager or BorrowerOps\"\n357: );\n```\n\n[Ethos-Core/contracts/LUSDToken.sol#L347-L351](https://github.com/code-423n4/2023-02-ethos/blob/main//Ethos-Core/contracts/LUSDToken.sol#L347-L351)\n\n```solidity\n347: require(\n348: _recipient != address(0) &&\n349: _recipient != address(this),\n350: \"LUSD: Cannot transfer tokens directly to the LUSD token contract or the zero address\"\n351: );\n```\n[Ethos-Core/contracts/BorrowerOperations.sol#L653-L654](https://github.com/code-423n4/2023-02-ethos/blob/main//Ethos-Core/contracts/BorrowerOperations.sol#L653-L654)\n\n```solidity\n653: require(_maxFeePercentage >= BORROWING_FEE_FLOOR &&", "vulnerable_code": "174: struct Deposit {\n175: uint initialValue;\n176: }", "fixed_code": "352: require(\n353: !stabilityPools[_recipient] &&\n354: !troveManagers[_recipient] &&\n355: !borrowerOperations[_recipient],\n356: \"LUSD: Cannot transfer tokens directly to the StabilityPool, TroveManager or BorrowerOps\"\n357: );", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/cyberinn-G.md", "collected_at": "2026-01-02T18:17:01.999710+00:00", "source_hash": "3af487fde5e10924373fbe89ac8988c70145540cd270070f7ae4360d6df3d82e", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 538, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "174: struct Deposit {\n175: uint initialValue;\n176: }", "primary_code_language": "solidity", "primary_code_char_count": 65, "all_code_blocks": "// Code block 1 (solidity):\n174: struct Deposit {\n175: uint initialValue;\n176: }\n\n// Code block 2 (solidity):\n352: require(\n353: !stabilityPools[_recipient] &&\n354: !troveManagers[_recipient] &&\n355: !borrowerOperations[_recipient],\n356: \"LUSD: Cannot transfer tokens directly to the StabilityPool, TroveManager or BorrowerOps\"\n357: );\n\n// Code block 3 (solidity):\n347: require(\n348: _recipient != address(0) &&\n349: _recipient != address(this),\n350: \"LUSD: Cannot transfer tokens directly to the LUSD token contract or the zero address\"\n351: );", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "174: struct Deposit {\n175: uint initialValue;\n176: }\n\n352: require(\n353: !stabilityPools[_recipient] &&\n354: !troveManagers[_recipient] &&\n355: !borrowerOperations[_recipient],\n356: \"LUSD: Cannot transfer tokens directly to the StabilityPool, TroveManager or BorrowerOps\"\n357: );\n\n347: require(\n348: _recipient != address(0) &&\n349: _recipient != address(this),\n350: \"LUSD: Cannot transfer tokens directly to the LUSD token contract or the zero address\"\n351: );", "github_refs_formatted": "StabilityPool.sol#L174-L176, LUSDToken.sol#L352-L357, LUSDToken.sol#L347-L351, BorrowerOperations.sol#L653-L654", "github_files_list": "LUSDToken.sol, BorrowerOperations.sol, StabilityPool.sol", "github_refs_count": 4, "vulnerable_code_actual": "174: struct Deposit {\n175: uint initialValue;\n176: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "352: require(\n353: !stabilityPools[_recipient] &&\n354: !troveManagers[_recipient] &&\n355: !borrowerOperations[_recipient],\n356: \"LUSD: Cannot transfer tokens directly to the StabilityPool, TroveManager or BorrowerOps\"\n357: );", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "11-kelp", "title": "orion Q", "severity_raw": "Low", "severity": "low", "description": "NodeDelegator.depositAssetIntoStrategy does not check if strategy address (lrtConfig.assetStrategy(asset)) is not address(0), since user when calling this function will transfer his funds via \n\n```\nIEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);\n```\n\nwhich transfers from NodeDelegator to strategy on the given token address \n\n\n```\n function depositIntoStrategy(IStrategy strategy, IERC20 token, uint256 amount) external returns (uint256 shares) {\n token.transferFrom(msg.sender, address(strategy), amount);\n```\n\nSince the function does not check if strategy address (lrtConfig.assetStrategy(asset)) is not address(0), if `lrtConfig.assetStrategy(asset);` returns address(0) then NodeDelegator assets of `token` will be sent to address(0) (if token does not follows OZ pattern) and will be lost", "vulnerable_code": "IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);", "fixed_code": " function depositIntoStrategy(IStrategy strategy, IERC20 token, uint256 amount) external returns (uint256 shares) {\n token.transferFrom(msg.sender, address(strategy), amount);", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/orion-Q.md", "collected_at": "2026-01-02T18:28:20.065610+00:00", "source_hash": "3b1a468ca995d52b7fabb9e6ccb50f64109749d1b570932961f429fba54aa3ed", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 294, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);", "primary_code_language": "unknown", "primary_code_char_count": 113, "all_code_blocks": "// Code block 1 (unknown):\nIEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);\n\n// Code block 2 (unknown):\nfunction depositIntoStrategy(IStrategy strategy, IERC20 token, uint256 amount) external returns (uint256 shares) {\n token.transferFrom(msg.sender, address(strategy), amount);", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function depositIntoStrategy(IStrategy strategy, IERC20 token, uint256 amount) external returns (uint256 shares) {\n token.transferFrom(msg.sender, address(strategy), amount);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5.74} {"source": "c4", "protocol": "02-ethos", "title": "Madalad G", "severity_raw": "High", "severity": "high", "description": "# Gas Report\n\n## `abi.encodePacked` is more gas efficient than `abi.encode`\n\n`abi.encode` pads all elementary types to 32 bytes, whereas `abi.encodePacked` will only use the minimal required memory to encode the data. See [here](https://docs.soliditylang.org/en/v0.8.11/abi-spec.html?highlight=encodepacked#non-standard-packed-mode) for more info.\n\nInstances: 2\n- [Ethos-Core/contracts/LUSDToken.sol#L284](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L284)\n- [Ethos-Core/contracts/LUSDToken.sol#L305](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L305)\n\n
\n\n## Functions guaranteed to revert when called by normal users can be marked `payable`\n\nIf a function modifier such as `onlyOwner` is used, the function will revert if a normal user tries to pay the function. Marking the function as payable will lower the gas cost for legitimate callers because the compiler will not include checks for whether a payment was provided.\n\nThe extra opcodes avoided are CALLVALUE(2), DUP1(3), ISZERO(3), PUSH2(3), JUMPI(10), PUSH1(3), DUP1(3), REVERT(0), JUMPDEST(1), POP(2), which costs an average of about 21 gas per call to the function, in addition to the extra deployment cost (2400 per instance).\n\nInstances: 14\n- [Ethos-Core/contracts/CollateralConfig.sol#L47](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol#L47)\n- [Ethos-Core/contracts/CollateralConfig.sol#L86](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol#L86)\n- [Ethos-Core/contracts/BorrowerOperations.sol#L110](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L110)\n- [Ethos-Core/contracts/ActivePool.sol#L71](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol#L71)\n- [Ethos-Core/contracts/ActivePool.sol#L125](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Cor", "vulnerable_code": "assembly {\n if iszero(_addr) {\n mstore(0x00, \"zero address\")\n revert(0x00, 0x20)\n }\n}", "fixed_code": "function solidityHash(uint256 a, uint256 b) public view {\n\t//unoptimized\n\tkeccak256(abi.encodePacked(a, b));\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/Madalad-G.md", "collected_at": "2026-01-02T18:16:20.257489+00:00", "source_hash": "3b67ad2f3e7ffbab98b2b316b4ffd022160fae232d155671b79f1239dee5d76a", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LUSDToken.sol#L284, LUSDToken.sol#L305, CollateralConfig.sol#L47, CollateralConfig.sol#L86, BorrowerOperations.sol#L110, ActivePool.sol#L71", "github_files_list": "LUSDToken.sol, BorrowerOperations.sol, CollateralConfig.sol, ActivePool.sol", "github_refs_count": 6, "vulnerable_code_actual": "assembly {\n if iszero(_addr) {\n mstore(0x00, \"zero address\")\n revert(0x00, 0x20)\n }\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function solidityHash(uint256 a, uint256 b) public view {\n\t//unoptimized\n\tkeccak256(abi.encodePacked(a, b));\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "04-caviar", "title": "Proxy G", "severity_raw": "Low", "severity": "low", "description": "### Gas Optimizations List\n\n| Number | Optimization Details | Instances |\n| :----: | :--------------------------------------------------------------------------------- | :-------: |\n| [G-01] | Mark functions as payable (with discretion) | 28 |\n| [G-02] | Use assembly to check for address(0) | 21 |\n| [G-03] | Right shift or Left shift instead of dividing or multiplying by powers of two | 2 |\n| [G-04] | Use `calldata` instead of `memory` for function arguments that do not get mutated. | 12 |\n| [G-05] | Use assembly to write storage values | 19 |\n| [G-06] | Use assembly when getting a contract's balance of ETH. | 8 |\n| [G-07] | Pack structs | 2 |\n| [G-08] | Use assembly to hash instead of Solidity | 2 |\n| [G-09] | Use assembly for math (add, sub, mul, div) | 24 |\n\nTotal 9 issues\n\n## [G-01] Mark functions as payable (with discretion)\n\nYou can mark public or external functions as payable to save gas. Functions that are not payable have additional logic to check if there was a value sent with a call, however, making a function payable eliminates this check. This optimization should be carefully considered due to potentially unwanted behavior when a function does not need to accept ether.\n\n### Lines\n\n- [PrivatePool.sol:157](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L157)\n- [PrivatePool.sol:301](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L301)\n- [PrivatePool.sol:514](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L514)\n- [PrivatePool.sol:538](htt", "vulnerable_code": "function assemblyOwnerNotZero(address _addr) public pure {\n assembly {\n if iszero(_addr) {\n mstore(0x00, \"zero address\")\n revert(0x00, 0x20)\n }\n }\n}", "fixed_code": "contract ExampleContract {\n address owner = 0xb4c79daB8f259C7Aee6E5b2Aa729821864227e84;\n\n function assemblyUpdateOwner(address newOwner) public {\n assembly {\n sstore(owner.slot, newOwner)\n }\n }\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/Proxy-G.md", "collected_at": "2026-01-02T18:19:58.777659+00:00", "source_hash": "3b6c84f07464d8d5e5a58cb7489ed2584151a231519f02e1e6e1fff61749fc34", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "PrivatePool.sol#L157, PrivatePool.sol#L301, PrivatePool.sol#L514", "github_files_list": "PrivatePool.sol", "github_refs_count": 3, "vulnerable_code_actual": "function assemblyOwnerNotZero(address _addr) public pure {\n assembly {\n if iszero(_addr) {\n mstore(0x00, \"zero address\")\n revert(0x00, 0x20)\n }\n }\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "contract ExampleContract {\n address owner = 0xb4c79daB8f259C7Aee6E5b2Aa729821864227e84;\n\n function assemblyUpdateOwner(address newOwner) public {\n assembly {\n sstore(owner.slot, newOwner)\n }\n }\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-ondo", "title": "rbserver Q", "severity_raw": "Critical", "severity": "critical", "description": "## [01] USERS ARE UNABLE TO CALL `KYCRegistry.addKYCAddressViaSignature` FUNCTION WITH VALID SIGNATURES, WHICH HAVE `v` BEING 0 OR 1, THAT ARE SIGNED BY USING `web3.eth.sign`\nThe following `KYCRegistry.addKYCAddressViaSignature` function checks if the `v` input is 27 or 28; if not, calling it will revert. However, a valid signature's `v` can be 0 or 1 when it is signed by using `web3.eth.sign`, which can be confirmed by the notes and examples in https://github.com/web3/web3.js/blob/0.20.7/DOCUMENTATION.md#web3ethsign and https://web3js.readthedocs.io/en/v1.8.1/web3-eth.html#sign. Because of the current `v` requirement in the `KYCRegistry.addKYCAddressViaSignature` function, users are unable to use these valid signatures, which have `v` being 0 or 1, that are signed by using `web3.eth.sign`. This limits the protocol's usability and degrades the user experience.\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistry.sol#L79-L112\n```solidity\n function addKYCAddressViaSignature(\n uint256 kycRequirementGroup,\n address user,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external {\n require(v == 27 || v == 28, \"KYCRegistry: invalid v value in signature\");\n ...\n }\n```\n\nAs a mitigation, https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistry.sol#L87 can be updated to the following code.\n```solidity\n if (v <= 1) {\n v += 27;\n }\n require(v == 27 || v == 28, \"KYCRegistry: invalid v value in signature\");\n```\n\n## [02] USER WORKFLOW IN DOCUMENTATION DOES NOT MATCH `CashManager.requestMint` FUNCTION CODE\nThe documentation in https://github.com/code-423n4/2023-01-ondo#cashmanager says that \"to mint Cash tokens, a user must send USDC to the contract and call requestMint.\" However, as shown by the following `CashManager.requestMint` function, USDC are actually transferred from `msg.sender`, who is the user, to the `feeRecipient` and `assetRecipient` addresses directly. If the d", "vulnerable_code": " function addKYCAddressViaSignature(\n uint256 kycRequirementGroup,\n address user,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external {\n require(v == 27 || v == 28, \"KYCRegistry: invalid v value in signature\");\n ...\n }", "fixed_code": " if (v <= 1) {\n v += 27;\n }\n require(v == 27 || v == 28, \"KYCRegistry: invalid v value in signature\");", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/rbserver-Q.md", "collected_at": "2026-01-02T18:15:30.017112+00:00", "source_hash": "3b9543947b51173da5131fbbc0529c1c8dbe51775eaf6f92aa44fd5911ad9208", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 369, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function addKYCAddressViaSignature(\n uint256 kycRequirementGroup,\n address user,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external {\n require(v == 27 || v == 28, \"KYCRegistry: invalid v value in signature\");\n ...\n }", "primary_code_language": "solidity", "primary_code_char_count": 255, "all_code_blocks": "// Code block 1 (solidity):\nfunction addKYCAddressViaSignature(\n uint256 kycRequirementGroup,\n address user,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external {\n require(v == 27 || v == 28, \"KYCRegistry: invalid v value in signature\");\n ...\n }\n\n// Code block 2 (solidity):\nif (v <= 1) {\n v += 27;\n }\n require(v == 27 || v == 28, \"KYCRegistry: invalid v value in signature\");", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function addKYCAddressViaSignature(\n uint256 kycRequirementGroup,\n address user,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external {\n require(v == 27 || v == 28, \"KYCRegistry: invalid v value in signature\");\n ...\n }\n\nif (v <= 1) {\n v += 27;\n }\n require(v == 27 || v == 28, \"KYCRegistry: invalid v value in signature\");", "github_refs_formatted": "KYCRegistry.sol#L79-L112, KYCRegistry.sol#L87", "github_files_list": "KYCRegistry.sol", "github_refs_count": 2, "vulnerable_code_actual": " function addKYCAddressViaSignature(\n uint256 kycRequirementGroup,\n address user,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external {\n require(v == 27 || v == 28, \"KYCRegistry: invalid v value in signature\");\n ...\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " if (v <= 1) {\n v += 27;\n }\n require(v == 27 || v == 28, \"KYCRegistry: invalid v value in signature\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-salty", "title": "lsaudit G", "severity_raw": "High", "severity": "high", "description": "# [G-01] Claiming airdrops in `Airdrop.sol` can be fully rewritten and optimized\n\n`Airdrop.sol` utilizes mapping `claimed` to check if user has already claimed some token:\n\n[File: Airdrop.sol](https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/launch/Airdrop.sol#L29)\n```\n\t// Those users who have already claimed\n\tmapping(address=>bool) public claimed;\n```\n\nNow, in function `claimAirdrop()`, we're checking this mapping (and update it):\n\n[File: Airdrop.sol](https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/launch/Airdrop.sol#L74)\n```\nfunction claimAirdrop() external nonReentrant\n \t{\n \trequire( claimingAllowed, \"Claiming is not allowed yet\" );\n \trequire( isAuthorized(msg.sender), \"Wallet is not authorized for airdrop\" );\n \trequire( ! claimed[msg.sender], \"Wallet already claimed the airdrop\" );\n\n\t\t// Have the Airdrop contract stake a specified amount of SALT and then transfer it to the user\n\t\tstaking.stakeSALT( saltAmountForEachUser );\n\t\tstaking.transferStakedSaltFromAirdropToUser( msg.sender, saltAmountForEachUser );\n\n \tclaimed[msg.sender] = true;\n \t}\n```\n\nThis is, however - redundant, since we already have a list of users who can claim airdrop in `_authorizedUsers`.\nWhen claiming is allowed, no other users can be added to `_authorizedUsers` (function `authorizeWallet()` does not allow to add new wallets when claiming is allowed).\nThis constitutes a very simple and elegant solution. Whenever we call `claimAirdrop()` - we can just remove user from `_authorizedUsers`.\n\nPlease notice, that we already check if user is on `_authorizedUsers`: (line 77) `require( isAuthorized(msg.sender), \"Wallet is not authorized for airdrop\" );`.\nIf after claiming an airdrop, we would remove it from `_authorizedUsers`, he won't be able to call `claimAirdrop()` again.\nMoreover, since `_authorizedUsers` is Open Zeppelin's enumerable set, removing element from that set costs O(1).\n\nTo sum up", "vulnerable_code": "\t// Those users who have already claimed\n\tmapping(address=>bool) public claimed;", "fixed_code": "function claimAirdrop() external nonReentrant\n \t{\n \trequire( claimingAllowed, \"Claiming is not allowed yet\" );\n \trequire( isAuthorized(msg.sender), \"Wallet is not authorized for airdrop\" );\n \trequire( ! claimed[msg.sender], \"Wallet already claimed the airdrop\" );\n\n\t\t// Have the Airdrop contract stake a specified amount of SALT and then transfer it to the user\n\t\tstaking.stakeSALT( saltAmountForEachUser );\n\t\tstaking.transferStakedSaltFromAirdropToUser( msg.sender, saltAmountForEachUser );\n\n \tclaimed[msg.sender] = true;\n \t}", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/lsaudit-G.md", "collected_at": "2026-01-02T19:01:51.625109+00:00", "source_hash": "3c4ac9f99262e4e611a0d55a33af600fad35689a99903f714b093e729f417964", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 623, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "// Those users who have already claimed\n\tmapping(address=>bool) public claimed;", "primary_code_language": "unknown", "primary_code_char_count": 79, "all_code_blocks": "// Code block 1 (unknown):\n// Those users who have already claimed\n\tmapping(address=>bool) public claimed;\n\n// Code block 2 (unknown):\nfunction claimAirdrop() external nonReentrant\n \t{\n \trequire( claimingAllowed, \"Claiming is not allowed yet\" );\n \trequire( isAuthorized(msg.sender), \"Wallet is not authorized for airdrop\" );\n \trequire( ! claimed[msg.sender], \"Wallet already claimed the airdrop\" );\n\n\t\t// Have the Airdrop contract stake a specified amount of SALT and then transfer it to the user\n\t\tstaking.stakeSALT( saltAmountForEachUser );\n\t\tstaking.transferStakedSaltFromAirdropToUser( msg.sender, saltAmountForEachUser );\n\n \tclaimed[msg.sender] = true;\n \t}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Airdrop.sol#L29, Airdrop.sol#L74", "github_files_list": "Airdrop.sol", "github_refs_count": 2, "vulnerable_code_actual": "\t// Those users who have already claimed\n\tmapping(address=>bool) public claimed;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function claimAirdrop() external nonReentrant\n \t{\n \trequire( claimingAllowed, \"Claiming is not allowed yet\" );\n \trequire( isAuthorized(msg.sender), \"Wallet is not authorized for airdrop\" );\n \trequire( ! claimed[msg.sender], \"Wallet already claimed the airdrop\" );\n\n\t\t// Have the Airdrop contract stake a specified amount of SALT and then transfer it to the user\n\t\tstaking.stakeSALT( saltAmountForEachUser );\n\t\tstaking.transferStakedSaltFromAirdropToUser( msg.sender, saltAmountForEachUser );\n\n \tclaimed[msg.sender] = true;\n \t}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "05-ajna", "title": "Sathish9098 G", "severity_raw": "Medium", "severity": "medium", "description": "## GAS OPTIMIZATIONS \n\nGas usage is determined by EVM opcodes and Remix sample tests, improving the overall user experience and reducing transaction fees for users\n\n##\n\n| Gas Count| Issues| Instances| Gas Saved|\n|-------|-----|--------|--------|\n| [G-1] | Using bools for storage incurs overhead | 3 | 60000 |\n| [G-2] | USING CALLDATA INSTEAD OF MEMORY FOR READ-ONLY ARGUMENTS IN EXTERNAL FUNCTIONS SAVES GAS | 20 | 2400 |\n| [G-3] | Structs can be packed into fewer storage slots | 1 | 2000 |\n| [G-4] | += / -= costs more gas than = + / = - for state variables| 14 |182 |\n| [G-5] | It Costs More Gas To Initialize Variables To Zero Than To Let The Default Of Zero Be Applied| 22 |1062|\n| [G-6] | Checking Non-Zero Amount Values Before Transferring to Minimize unnecessary Execution Costs|2 | - |\n| [G-7] | SUPERFLUOUS EVENT FIELDS | 2 | - |\n| [G-8] | For events use 3 indexed rule to save gas | 5 | - |\n| [G-9] | Use nested if and, avoid multiple check combinations | 6 | 54 |\n| [G-10] | Unnecessary look up in if condition | 10 | - |\n| [G-11] | Use assembly to check for address(0) |1| 6 |\n| [G-12] | Shorthand way to write if / else statement can reduce the deployment cost | 2 | - |\n| [G-13] | internal functions not called by the contract should be removed to save deployment gas | 2 | - |\n| [G-14] | private functions only called once can be inlined to save gas | 1 | 50 |\n| [G-15] | Use solidity version 0.8.19 to gain some gas boost | - | - |\n| [G-16] | Shorten the array rather than copying to a new one | 4 | - |\n| [G-17] | abi.encode() is less efficient than abi.encodepacked() | 9 | - |\n| [G-18] | Duplicated require()/revert()/IF Checks Should Be Refactored To A Modifier Or Function | 2 | - |\n| [G-19] | Public Functions To External | 1 | - |\n| [G-20] | Do not calculate constant variables | 7 | - |\n| [G-21] | Convert the .call recursive calls to batch operations to save large volume of gas | - | - |\n| [G-22] | EnumerableSet.UintSet can", "vulnerable_code": " // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n", "fixed_code": "FILE: 2023-05-ajna/ajna-core/src/RewardsManager.sol\n\n70: mapping(uint256 => mapping(uint256 => bool)) public override isEpochClaimed;\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/Sathish9098-G.md", "collected_at": "2026-01-02T18:21:12.380767+00:00", "source_hash": "3c51364b598a710d1a9dc147aaa9686a7ea850840511edee2c8b9a14f70fc7d1", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "FILE: 2023-05-ajna/ajna-core/src/RewardsManager.sol\n\n70: mapping(uint256 => mapping(uint256 => bool)) public override isEpochClaimed;\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-revert-lend", "title": "0xepley Analysis", "severity_raw": "Critical", "severity": "critical", "description": "# \ud83d\udee0\ufe0f Revert Lend\n**A lending protocol specifically designed for liquidity providers on Uniswap v3.**\n\n## Conceptual overview of the project:\n\nThe Revert Lend project is a sophisticated DeFi ecosystem designed to optimize and automate liquidity management on Uniswap V3, provide innovative borrowing and lending solutions, and enable strategic leverage adjustments, all while integrating advanced features like auto-compounding, range adjustments, and flash loan-based liquidations. At its core, the project facilitates more efficient capital utilization and enhanced earning potential for liquidity providers and borrowers alike.\n\nUsers begin their interaction with the Revert Lend project by providing liquidity to Uniswap V3 pools, potentially leveraging the platform's automated features like `AutoCompound` to reinvest earned fees and `AutoRange` to dynamically adjust their positions within the most lucrative price ranges, maximizing their return on investment. These automated strategies not only save time but also optimize the position's performance in response to market movements.\n\nBorrowers, on the other hand, can take advantage of the platform's borrowing facilities, which are directly tied to the liquidity positions, allowing for leverage adjustments. This is where the `LeverageTransformer` comes into play, enabling users to either increase their leverage through `leverageUp` operations or decrease it via `leverageDown`, with all actions executed in a manner that aims to preserve capital efficiency and minimize slippage.\n\nFurthermore, the Revert Lend project incorporates a unique mechanism for managing underperforming positions through `FlashloanLiquidator`, utilizing flash loans for immediate liquidation while ensuring that liquidators can execute these operations profitably and efficiently. This not only maintains the health of the lending pool but also provides an additional layer of security and stability for the platform.\n\nThe user journey through the Revert Lend ", "vulnerable_code": "function setValues(\n uint256 baseRatePerYearX96,\n uint256 multiplierPerYearX96,\n uint256 jumpMultiplierPerYearX96,\n uint256 _kinkX96\n) public onlyOwner {\n ...\n}", "fixed_code": "mapping(address => bool) public operators;\n\nfunction setOperator(address _operator, bool _active) public onlyOwner {\n ...\n}", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/0xepley-Analysis.md", "collected_at": "2026-01-02T19:02:55.228395+00:00", "source_hash": "3cae353daa4469b7824a940f32f547da466adc6ef6f4141463774eb30a52a244", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function setValues(\n uint256 baseRatePerYearX96,\n uint256 multiplierPerYearX96,\n uint256 jumpMultiplierPerYearX96,\n uint256 _kinkX96\n) public onlyOwner {\n ...\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "mapping(address => bool) public operators;\n\nfunction setOperator(address _operator, bool _active) public onlyOwner {\n ...\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "04-caviar", "title": "fs0c Q", "severity_raw": "QA", "severity": "qa", "description": "## [QA-01] `msg.value` in loop\n\nThe change function in EthRouter is using `msg.value` in loop. Which means user has to send msg.value once and if there are ETHs in the contract they would be used instead.\n\n```solidity\nfor (uint256 i = 0; i < changes.length; i++) {\n\n //...\n PrivatePool(_change.pool).change{value: msg.value}(\n _change.inputTokenIds,\n _change.inputTokenWeights,\n _change.inputProof,\n _change.stolenNftProofs,\n _change.outputTokenIds,\n _change.outputTokenWeights,\n _change.outputProof\n );\n\n // transfer NFTs to caller\n for (uint256 j = 0; j < changes[i].outputTokenIds.length; j++) {\n ERC721(_change.nft).safeTransferFrom(\n address(this),\n msg.sender,\n _change.outputTokenIds[j]\n );\n }\n}\n```", "vulnerable_code": "for (uint256 i = 0; i < changes.length; i++) {\n\n //...\n PrivatePool(_change.pool).change{value: msg.value}(\n _change.inputTokenIds,\n _change.inputTokenWeights,\n _change.inputProof,\n _change.stolenNftProofs,\n _change.outputTokenIds,\n _change.outputTokenWeights,\n _change.outputProof\n );\n\n // transfer NFTs to caller\n for (uint256 j = 0; j < changes[i].outputTokenIds.length; j++) {\n ERC721(_change.nft).safeTransferFrom(\n address(this),\n msg.sender,\n _change.outputTokenIds[j]\n );\n }\n}", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/fs0c-Q.md", "collected_at": "2026-01-02T18:20:31.883586+00:00", "source_hash": "3cbc631528e3b04cef2eccd3982c452ac977d7880f130d23d00a812580330550", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 742, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "for (uint256 i = 0; i < changes.length; i++) {\n\n //...\n PrivatePool(_change.pool).change{value: msg.value}(\n _change.inputTokenIds,\n _change.inputTokenWeights,\n _change.inputProof,\n _change.stolenNftProofs,\n _change.outputTokenIds,\n _change.outputTokenWeights,\n _change.outputProof\n );\n\n // transfer NFTs to caller\n for (uint256 j = 0; j < changes[i].outputTokenIds.length; j++) {\n ERC721(_change.nft).safeTransferFrom(\n address(this),\n msg.sender,\n _change.outputTokenIds[j]\n );\n }\n}", "primary_code_language": "solidity", "primary_code_char_count": 742, "all_code_blocks": "// Code block 1 (solidity):\nfor (uint256 i = 0; i < changes.length; i++) {\n\n //...\n PrivatePool(_change.pool).change{value: msg.value}(\n _change.inputTokenIds,\n _change.inputTokenWeights,\n _change.inputProof,\n _change.stolenNftProofs,\n _change.outputTokenIds,\n _change.outputTokenWeights,\n _change.outputProof\n );\n\n // transfer NFTs to caller\n for (uint256 j = 0; j < changes[i].outputTokenIds.length; j++) {\n ERC721(_change.nft).safeTransferFrom(\n address(this),\n msg.sender,\n _change.outputTokenIds[j]\n );\n }\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "for (uint256 i = 0; i < changes.length; i++) {\n\n //...\n PrivatePool(_change.pool).change{value: msg.value}(\n _change.inputTokenIds,\n _change.inputTokenWeights,\n _change.inputProof,\n _change.stolenNftProofs,\n _change.outputTokenIds,\n _change.outputTokenWeights,\n _change.outputProof\n );\n\n // transfer NFTs to caller\n for (uint256 j = 0; j < changes[i].outputTokenIds.length; j++) {\n ERC721(_change.nft).safeTransferFrom(\n address(this),\n msg.sender,\n _change.outputTokenIds[j]\n );\n }\n}", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "for (uint256 i = 0; i < changes.length; i++) {\n\n //...\n PrivatePool(_change.pool).change{value: msg.value}(\n _change.inputTokenIds,\n _change.inputTokenWeights,\n _change.inputProof,\n _change.stolenNftProofs,\n _change.outputTokenIds,\n _change.outputTokenWeights,\n _change.outputProof\n );\n\n // transfer NFTs to caller\n for (uint256 j = 0; j < changes[i].outputTokenIds.length; j++) {\n ERC721(_change.nft).safeTransferFrom(\n address(this),\n msg.sender,\n _change.outputTokenIds[j]\n );\n }\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 3.93} {"source": "c4", "protocol": "08-dopex", "title": "0x6980 G", "severity_raw": "High", "severity": "high", "description": "# Report\n\n## Gas Optimizations\n\n\n| |Issue|Instances|Gas Saved|\n|-|:-|:-:|-|\n| [G-01](#G-01) | Use `assembly` to check for `address(0)` | 8 | 48\n| [G-02](#G-02) | `++i`/`i++` should be `unchecked{++i}`/`unchecked{i++}` when it is not possible for them to overflow, as is the case when used in `for`- and `while`-loops | 8 | 480\n| [G-03](#G-03) | `array[index] += amount` is cheaper than `array[index] = array[index] + amount` (or related variants) | 2 | -\n| [G-04](#G-04) | The result of function calls should be cached rather than re-calling the function | 3 | 63\n| [G-05](#G-05) | State variables should be cached in stack variables rather than re-reading them from storage | 3 | -\n| [G-06](#G-06) | Help The Optimizer By Saving A Storage Variable's Reference Instead Of Repeatedly Fetching It | 2 | -\n| [G-07](#G-07) | Pre-increments and pre-decrements are cheaper than post-increments and post-decrements | 1 | -\n| [G-08](#G-08) | Remove or replace unused state variables | 1 | -\n| [G-09](#G-09) | `require()` or `revert()` statements that check input arguments should be at the top of the function | 2 | -\n| [G-10](#G-10) | Shorten the array rather than copying to a new one | 4 | -\n| [G-11](#G-11) | State variables which are not modified within functions should be set as `constant` or `immutable` for values set at deployment | 2 | 40,000\n| [G-12](#G-12) | Unnecessary look up in `if` condition | 1 | -\n| [G-13](#G-13) | Use hardcoded address instead `address(this)` | 3 | -\n| [G-14](#G-14) | Use upcoming OpenZeppelin contracts | 1 | -\n\n## Gas Optimizations\n\n### [G-01] Use `assembly` to check for `address(0)`\n*Saves 6 gas per instance*\n\n*Instances (8)*:\n
\nsee instances\n\n\n```solidity\nFile: contracts/usdy/rUSDY.sol\n\n490: require(_owner != address(0), \"APPROVE_FROM_ZERO_ADDRESS\");\n\n491: require(_spender != address(0), \"APPROVE_TO_ZERO_ADDRESS\");\n\n519: require(_sender != address(0), \"TRANSFER_FROM_THE_ZERO_ADDRESS\");\n\n520: req", "vulnerable_code": "File: contracts/usdy/rUSDY.sol\n\n490: require(_owner != address(0), \"APPROVE_FROM_ZERO_ADDRESS\");\n\n491: require(_spender != address(0), \"APPROVE_TO_ZERO_ADDRESS\");\n\n519: require(_sender != address(0), \"TRANSFER_FROM_THE_ZERO_ADDRESS\");\n\n520: require(_recipient != address(0), \"TRANSFER_TO_THE_ZERO_ADDRESS\");\n\n547: require(_recipient != address(0), \"MINT_TO_THE_ZERO_ADDRESS\");\n\n579: require(_account != address(0), \"BURN_FROM_THE_ZERO_ADDRESS\");\n\n642: if (from != address(0)) {\n\n649: if (to != address(0)) {\n", "fixed_code": "File: contracts/bridge/DestinationBridge.sol\n\n134: for (uint256 i = 0; i < thresholds.length; ++i) {\n\n160: for (uint256 i = 0; i < t.approvers.length; ++i) {\n\n264: for (uint256 i = 0; i < amounts.length; ++i) {\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/0x6980-G.md", "collected_at": "2026-01-02T18:24:12.338362+00:00", "source_hash": "3cda9aa3204317c06f50541356c1f5b33d1bad4de98a5046439f688f36d8a378", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: contracts/usdy/rUSDY.sol\n\n490: require(_owner != address(0), \"APPROVE_FROM_ZERO_ADDRESS\");\n\n491: require(_spender != address(0), \"APPROVE_TO_ZERO_ADDRESS\");\n\n519: require(_sender != address(0), \"TRANSFER_FROM_THE_ZERO_ADDRESS\");\n\n520: require(_recipient != address(0), \"TRANSFER_TO_THE_ZERO_ADDRESS\");\n\n547: require(_recipient != address(0), \"MINT_TO_THE_ZERO_ADDRESS\");\n\n579: require(_account != address(0), \"BURN_FROM_THE_ZERO_ADDRESS\");\n\n642: if (from != address(0)) {\n\n649: if (to != address(0)) {\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/bridge/DestinationBridge.sol\n\n134: for (uint256 i = 0; i < thresholds.length; ++i) {\n\n160: for (uint256 i = 0; i < t.approvers.length; ++i) {\n\n264: for (uint256 i = 0; i < amounts.length; ++i) {\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "09-ondo", "title": "jeffy G", "severity_raw": "Low", "severity": "low", "description": "## [G-01] use if + revert instead of require/assert to save gas\nConsider using custom errors instead of revert strings. Can save gas when the revert condition has been met during runtime.\nHere are some examples of where this optimization could be used:\n```solidity\nFile: contracts/bridge/SourceBridge.sol\n168: require(success, \"Call Failed\");\n\nFile: contracts/rwaOracles/RWADynamicOracle.sol\n405: require(y == 0 || (z = x * y) / y == x);\n\nFile: contracts/usdy/rUSDYFactory.sol\n100: assert(rUSDYProxyAdmin.owner() == guardian);\n134: require(success, \"Call Failed\");\n155: require(msg.sender == guardian, \"rUSDYFactory: You are not the Guardian\");\n\nFile: contracts/usdy/rUSDY.sol\n307: require(currentAllowance >= _amount, \"TRANSFER_AMOUNT_EXCEEDS_ALLOWANCE\");\n358: require(\n currentAllowance >= _subtractedValue,\n \"DECREASED_ALLOWANCE_BELOW_ZERO\"\n );\n435: require(_USDYAmount > 0, \"rUSDY: can't wrap zero USDY tokens\");\n450: require(_rUSDYAmount > 0, \"rUSDY: can't unwrap zero rUSDY tokens\");\n490: require(_owner != address(0), \"APPROVE_FROM_ZERO_ADDRESS\");\n491: require(_spender != address(0), \"APPROVE_TO_ZERO_ADDRESS\");\n519: require(_sender != address(0), \"TRANSFER_FROM_THE_ZERO_ADDRESS\");\n520: require(_recipient != address(0), \"TRANSFER_TO_THE_ZERO_ADDRESS\");\n525: require(\n _sharesAmount <= currentSenderShares,\n \"TRANSFER_AMOUNT_EXCEEDS_BALANCE\"\n );\n547: require(_recipient != address(0), \"MINT_TO_THE_ZERO_ADDRESS\");\n579: require(_account != address(0), \"BURN_FROM_THE_ZERO_ADDRESS\");\n584: require(_sharesAmount <= accountShares, \"BURN_AMOUNT_EXCEEDS_BALANCE\");\n634: require(!_isBlocked(msg.sender), \"rUSDY: 'sender' address blocked\");\n635: require(!_isSanctioned(msg.sender), \"rUSDY: 'sender' address sanctioned\");\n636: require(\n _isAllowed(msg.sender),\n \"rUSDY: 'sender' address not on allowlist\"\n );\n644: require(!_isBlocked(from), \"rUSDY: 'from' add", "vulnerable_code": "File: contracts/bridge/SourceBridge.sol\n168: require(success, \"Call Failed\");\n\nFile: contracts/rwaOracles/RWADynamicOracle.sol\n405: require(y == 0 || (z = x * y) / y == x);\n\nFile: contracts/usdy/rUSDYFactory.sol\n100: assert(rUSDYProxyAdmin.owner() == guardian);\n134: require(success, \"Call Failed\");\n155: require(msg.sender == guardian, \"rUSDYFactory: You are not the Guardian\");\n\nFile: contracts/usdy/rUSDY.sol\n307: require(currentAllowance >= _amount, \"TRANSFER_AMOUNT_EXCEEDS_ALLOWANCE\");\n358: require(\n currentAllowance >= _subtractedValue,\n \"DECREASED_ALLOWANCE_BELOW_ZERO\"\n );\n435: require(_USDYAmount > 0, \"rUSDY: can't wrap zero USDY tokens\");\n450: require(_rUSDYAmount > 0, \"rUSDY: can't unwrap zero rUSDY tokens\");\n490: require(_owner != address(0), \"APPROVE_FROM_ZERO_ADDRESS\");\n491: require(_spender != address(0), \"APPROVE_TO_ZERO_ADDRESS\");\n519: require(_sender != address(0), \"TRANSFER_FROM_THE_ZERO_ADDRESS\");\n520: require(_recipient != address(0), \"TRANSFER_TO_THE_ZERO_ADDRESS\");\n525: require(\n _sharesAmount <= currentSenderShares,\n \"TRANSFER_AMOUNT_EXCEEDS_BALANCE\"\n );\n547: require(_recipient != address(0), \"MINT_TO_THE_ZERO_ADDRESS\");\n579: require(_account != address(0), \"BURN_FROM_THE_ZERO_ADDRESS\");\n584: require(_sharesAmount <= accountShares, \"BURN_AMOUNT_EXCEEDS_BALANCE\");\n634: require(!_isBlocked(msg.sender), \"rUSDY: 'sender' address blocked\");\n635: require(!_isSanctioned(msg.sender), \"rUSDY: 'sender' address sanctioned\");\n636: require(\n _isAllowed(msg.sender),\n \"rUSDY: 'sender' address not on allowlist\"\n );\n644: require(!_isBlocked(from), \"rUSDY: 'from' address blocked\");\n645: require(!_isSanctioned(from), \"rUSDY: 'from' address sanctioned\");\n646: require(_isAllowed(from), \"rUSDY: 'from' address not on allowlist\");\n651: require(!_isBlocked(to), \"rUSDY: 'to' address blocked\");\n652: require(!_is", "fixed_code": "File: contracts/bridge/DestinationBridge.sol\n134: for (uint256 i = 0; i < thresholds.length; ++i) {\n160: for (uint256 i = 0; i < t.approvers.length; ++i) {\n264: for (uint256 i = 0; i < amounts.length; ++i) {\n\nFile: contracts/bridge/SourceBridge.sol\n79: bytes memory payload = abi.encode(VERSION, msg.sender, amount, nonce++);\n164: for (uint256 i = 0; i < exCallData.length; ++i) {\n\nFile: contracts/rwaOracles/RWADynamicOracle.sol\n77: for (uint256 i = 0; i < length; ++i) {\n113: for (uint256 i = 0; i < length; ++i) {\n129: for (uint256 i = 0; i < length + 1; ++i) {\n\nFile: contracts/usdy/rUSDYFactory.sol\n130: for (uint256 i = 0; i < exCallData.length; ++i) {\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/jeffy-G.md", "collected_at": "2026-01-02T18:26:00.089905+00:00", "source_hash": "3ce7d48aafac4ec8f19ac10cffe70a83cf459d7f0ba1f23484493a57cb59ec79", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: contracts/bridge/SourceBridge.sol\n168: require(success, \"Call Failed\");\n\nFile: contracts/rwaOracles/RWADynamicOracle.sol\n405: require(y == 0 || (z = x * y) / y == x);\n\nFile: contracts/usdy/rUSDYFactory.sol\n100: assert(rUSDYProxyAdmin.owner() == guardian);\n134: require(success, \"Call Failed\");\n155: require(msg.sender == guardian, \"rUSDYFactory: You are not the Guardian\");\n\nFile: contracts/usdy/rUSDY.sol\n307: require(currentAllowance >= _amount, \"TRANSFER_AMOUNT_EXCEEDS_ALLOWANCE\");\n358: require(\n currentAllowance >= _subtractedValue,\n \"DECREASED_ALLOWANCE_BELOW_ZERO\"\n );\n435: require(_USDYAmount > 0, \"rUSDY: can't wrap zero USDY tokens\");\n450: require(_rUSDYAmount > 0, \"rUSDY: can't unwrap zero rUSDY tokens\");\n490: require(_owner != address(0), \"APPROVE_FROM_ZERO_ADDRESS\");\n491: require(_spender != address(0), \"APPROVE_TO_ZERO_ADDRESS\");\n519: require(_sender != address(0), \"TRANSFER_FROM_THE_ZERO_ADDRESS\");\n520: require(_recipient != address(0), \"TRANSFER_TO_THE_ZERO_ADDRESS\");\n525: require(\n _sharesAmount <= currentSenderShares,\n \"TRANSFER_AMOUNT_EXCEEDS_BALANCE\"\n );\n547: require(_recipient != address(0), \"MINT_TO_THE_ZERO_ADDRESS\");\n579: require(_account != address(0), \"BURN_FROM_THE_ZERO_ADDRESS\");\n584: require(_sharesAmount <= accountShares, \"BURN_AMOUNT_EXCEEDS_BALANCE\");\n634: require(!_isBlocked(msg.sender), \"rUSDY: 'sender' address blocked\");\n635: require(!_isSanctioned(msg.sender), \"rUSDY: 'sender' address sanctioned\");\n636: require(\n _isAllowed(msg.sender),\n \"rUSDY: 'sender' address not on allowlist\"\n );\n644: require(!_isBlocked(from), \"rUSDY: 'from' address blocked\");\n645: require(!_isSanctioned(from), \"rUSDY: 'from' address sanctioned\");\n646: require(_isAllowed(from), \"rUSDY: 'from' address not on allowlist\");\n651: require(!_isBlocked(to), \"rUSDY: 'to' address blocked\");\n652: require(!_is", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/bridge/DestinationBridge.sol\n134: for (uint256 i = 0; i < thresholds.length; ++i) {\n160: for (uint256 i = 0; i < t.approvers.length; ++i) {\n264: for (uint256 i = 0; i < amounts.length; ++i) {\n\nFile: contracts/bridge/SourceBridge.sol\n79: bytes memory payload = abi.encode(VERSION, msg.sender, amount, nonce++);\n164: for (uint256 i = 0; i < exCallData.length; ++i) {\n\nFile: contracts/rwaOracles/RWADynamicOracle.sol\n77: for (uint256 i = 0; i < length; ++i) {\n113: for (uint256 i = 0; i < length; ++i) {\n129: for (uint256 i = 0; i < length + 1; ++i) {\n\nFile: contracts/usdy/rUSDYFactory.sol\n130: for (uint256 i = 0; i < exCallData.length; ++i) {\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "04-caviar", "title": "MiniGlome G", "severity_raw": "High", "severity": "high", "description": "## Gas Optimizations\n| |Issue|Instances|\n|-|:-|:-:|\n| [GAS-01] | Structs can be packed into fewer storage slots | 2 |\n| [GAS-02] | Functions guaranteed to revert when called by normal users can be marked `payable` | 11 | \n| [GAS-03] | Setting the `constructor` to `payable` | 3 | \n| [GAS-04] | Usage of uint/int smaller than 32 bytes | 9 | \n| [GAS-05] | ` += ` Costs More Gas Than ` = + ` For State Variables | 4 | \n\n### [GAS-01] Structs can be packed into fewer storage slots\nStructs can be packed in slot of 32 bytes like state variables to reduce storage usage.\nSee more: https://docs.soliditylang.org/en/v0.8.17/internals/layout_in_storage.html\n\n*Instances (2)*:\n```solidity\nFile: src/EthRouter.sol\n48: struct Buy {\n address payable pool;\n address nft;\n uint256[] tokenIds;\n uint256[] tokenWeights;\n PrivatePool.MerkleMultiProof proof;\n uint256 baseTokenAmount;\n bool isPublicPool;\n }\n\n58: struct Sell {\n address payable pool;\n address nft;\n uint256[] tokenIds;\n uint256[] tokenWeights;\n PrivatePool.MerkleMultiProof proof;\n IStolenNftOracle.Message[] stolenNftProofs;\n bool isPublicPool;\n bytes32[][] publicPoolProofs;\n }\n\n```\nCan be packed like this:\n```solidity\n struct Buy {\n address payable pool;\n address nft;\n bool isPublicPool;\n uint256[] tokenIds;\n uint256[] tokenWeights;\n PrivatePool.MerkleMultiProof proof;\n uint256 baseTokenAmount; \n }\n\n struct Sell {\n address payable pool;\n address nft;\n bool isPublicPool;\n uint256[] tokenIds;\n uint256[] tokenWeights;\n PrivatePool.MerkleMultiProof proof;\n IStolenNftOracle.Message[] stolenNftProofs; \n bytes32[][] publicPoolProofs;\n }\n\n```\n\n### [GAS-02] Functions guaranteed to revert when called by normal users can be marked `payable`\nIf a function modifier or require such as onl", "vulnerable_code": "File: src/EthRouter.sol\n48: struct Buy {\n address payable pool;\n address nft;\n uint256[] tokenIds;\n uint256[] tokenWeights;\n PrivatePool.MerkleMultiProof proof;\n uint256 baseTokenAmount;\n bool isPublicPool;\n }\n\n58: struct Sell {\n address payable pool;\n address nft;\n uint256[] tokenIds;\n uint256[] tokenWeights;\n PrivatePool.MerkleMultiProof proof;\n IStolenNftOracle.Message[] stolenNftProofs;\n bool isPublicPool;\n bytes32[][] publicPoolProofs;\n }\n", "fixed_code": " struct Buy {\n address payable pool;\n address nft;\n bool isPublicPool;\n uint256[] tokenIds;\n uint256[] tokenWeights;\n PrivatePool.MerkleMultiProof proof;\n uint256 baseTokenAmount; \n }\n\n struct Sell {\n address payable pool;\n address nft;\n bool isPublicPool;\n uint256[] tokenIds;\n uint256[] tokenWeights;\n PrivatePool.MerkleMultiProof proof;\n IStolenNftOracle.Message[] stolenNftProofs; \n bytes32[][] publicPoolProofs;\n }\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/MiniGlome-G.md", "collected_at": "2026-01-02T18:19:52.732797+00:00", "source_hash": "3d124710d42d9f5e93a87ed71ca663fa982fe39fff467cfc13d9f4dda16f5ca0", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 1110, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: src/EthRouter.sol\n48: struct Buy {\n address payable pool;\n address nft;\n uint256[] tokenIds;\n uint256[] tokenWeights;\n PrivatePool.MerkleMultiProof proof;\n uint256 baseTokenAmount;\n bool isPublicPool;\n }\n\n58: struct Sell {\n address payable pool;\n address nft;\n uint256[] tokenIds;\n uint256[] tokenWeights;\n PrivatePool.MerkleMultiProof proof;\n IStolenNftOracle.Message[] stolenNftProofs;\n bool isPublicPool;\n bytes32[][] publicPoolProofs;\n }", "primary_code_language": "solidity", "primary_code_char_count": 564, "all_code_blocks": "// Code block 1 (solidity):\nFile: src/EthRouter.sol\n48: struct Buy {\n address payable pool;\n address nft;\n uint256[] tokenIds;\n uint256[] tokenWeights;\n PrivatePool.MerkleMultiProof proof;\n uint256 baseTokenAmount;\n bool isPublicPool;\n }\n\n58: struct Sell {\n address payable pool;\n address nft;\n uint256[] tokenIds;\n uint256[] tokenWeights;\n PrivatePool.MerkleMultiProof proof;\n IStolenNftOracle.Message[] stolenNftProofs;\n bool isPublicPool;\n bytes32[][] publicPoolProofs;\n }\n\n// Code block 2 (solidity):\nstruct Buy {\n address payable pool;\n address nft;\n bool isPublicPool;\n uint256[] tokenIds;\n uint256[] tokenWeights;\n PrivatePool.MerkleMultiProof proof;\n uint256 baseTokenAmount; \n }\n\n struct Sell {\n address payable pool;\n address nft;\n bool isPublicPool;\n uint256[] tokenIds;\n uint256[] tokenWeights;\n PrivatePool.MerkleMultiProof proof;\n IStolenNftOracle.Message[] stolenNftProofs; \n bytes32[][] publicPoolProofs;\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: src/EthRouter.sol\n48: struct Buy {\n address payable pool;\n address nft;\n uint256[] tokenIds;\n uint256[] tokenWeights;\n PrivatePool.MerkleMultiProof proof;\n uint256 baseTokenAmount;\n bool isPublicPool;\n }\n\n58: struct Sell {\n address payable pool;\n address nft;\n uint256[] tokenIds;\n uint256[] tokenWeights;\n PrivatePool.MerkleMultiProof proof;\n IStolenNftOracle.Message[] stolenNftProofs;\n bool isPublicPool;\n bytes32[][] publicPoolProofs;\n }\n\nstruct Buy {\n address payable pool;\n address nft;\n bool isPublicPool;\n uint256[] tokenIds;\n uint256[] tokenWeights;\n PrivatePool.MerkleMultiProof proof;\n uint256 baseTokenAmount; \n }\n\n struct Sell {\n address payable pool;\n address nft;\n bool isPublicPool;\n uint256[] tokenIds;\n uint256[] tokenWeights;\n PrivatePool.MerkleMultiProof proof;\n IStolenNftOracle.Message[] stolenNftProofs; \n bytes32[][] publicPoolProofs;\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: src/EthRouter.sol\n48: struct Buy {\n address payable pool;\n address nft;\n uint256[] tokenIds;\n uint256[] tokenWeights;\n PrivatePool.MerkleMultiProof proof;\n uint256 baseTokenAmount;\n bool isPublicPool;\n }\n\n58: struct Sell {\n address payable pool;\n address nft;\n uint256[] tokenIds;\n uint256[] tokenWeights;\n PrivatePool.MerkleMultiProof proof;\n IStolenNftOracle.Message[] stolenNftProofs;\n bool isPublicPool;\n bytes32[][] publicPoolProofs;\n }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": " struct Buy {\n address payable pool;\n address nft;\n bool isPublicPool;\n uint256[] tokenIds;\n uint256[] tokenWeights;\n PrivatePool.MerkleMultiProof proof;\n uint256 baseTokenAmount; \n }\n\n struct Sell {\n address payable pool;\n address nft;\n bool isPublicPool;\n uint256[] tokenIds;\n uint256[] tokenWeights;\n PrivatePool.MerkleMultiProof proof;\n IStolenNftOracle.Message[] stolenNftProofs; \n bytes32[][] publicPoolProofs;\n }\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ai-arena", "title": "0xCiphky Q", "severity_raw": "High", "severity": "high", "description": "# NRN total supply can never equal the max\n\n# Relevant GitHub Links:\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/Neuron.sol#L155\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/Neuron.sol#L43\n\n\n# Vulnerability details\n\nThe Neuron token is used for various functions within the platform, including staking, governance, and rewards. The contract sets a maximum supply of NRN tokens during contract creation.\n\n```solidity\n/// @notice Maximum supply of NRN tokens.\nuint256 public constant MAX_SUPPLY = 10**18 * 10**9;\n```\n\nThis cap is enforced within the [mint](https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/Neuron.sol#L155) function to prevent the issuance of tokens beyond the predetermined maximum supply. However, the validation logic used to enforce this cap requiring the sum of the current total supply and the amount to be minted to be less than the maximum supply, effectively prohibits the total supply from ever achieving the maximum threshold.\n\n```solidity\nfunction mint(address to, uint256 amount) public virtual {\n require(totalSupply() + amount < MAX_SUPPLY, \"Trying to mint more than the max supply\");\n require(hasRole(MINTER_ROLE, msg.sender), \"ERC20: must have minter role to mint\");\n _mint(to, amount);\n }\n```\n\n## **Impact:**\n\nThis discrepancy means the platform cannot fully utilize the token supply as intended, creating a deviation from the protocol documentation.\n\n## **Tools Used:**\n\n- Manual analysis\n\n## **Recommendation:**\n\nAdjust the mint function to allow minting up to the maximum supply by changing the condition to totalSupply() + amount <= MAX_SUPPLY.\n\n```solidity\nfunction mint(address to, uint256 amount) public virtual {\n require(totalSupply() + amount <= MAX_SUPPLY, \"Trying to mint more than the max supply\");\n require(hasRole(MINTER_ROLE, msg.sender), \"ERC20: must have mi", "vulnerable_code": "/// @notice Maximum supply of NRN tokens.\nuint256 public constant MAX_SUPPLY = 10**18 * 10**9;", "fixed_code": "function mint(address to, uint256 amount) public virtual {\n require(totalSupply() + amount < MAX_SUPPLY, \"Trying to mint more than the max supply\");\n require(hasRole(MINTER_ROLE, msg.sender), \"ERC20: must have minter role to mint\");\n _mint(to, amount);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/0xCiphky-Q.md", "collected_at": "2026-01-02T19:02:00.626944+00:00", "source_hash": "3d1d71fc9aa33b3e76464bfb59a0f325e8b848c09d2983c46ab7be07fd123be4", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 373, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "/// @notice Maximum supply of NRN tokens.\nuint256 public constant MAX_SUPPLY = 10**18 * 10**9;", "primary_code_language": "solidity", "primary_code_char_count": 94, "all_code_blocks": "// Code block 1 (solidity):\n/// @notice Maximum supply of NRN tokens.\nuint256 public constant MAX_SUPPLY = 10**18 * 10**9;\n\n// Code block 2 (solidity):\nfunction mint(address to, uint256 amount) public virtual {\n require(totalSupply() + amount < MAX_SUPPLY, \"Trying to mint more than the max supply\");\n require(hasRole(MINTER_ROLE, msg.sender), \"ERC20: must have minter role to mint\");\n _mint(to, amount);\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "/// @notice Maximum supply of NRN tokens.\nuint256 public constant MAX_SUPPLY = 10**18 * 10**9;\n\nfunction mint(address to, uint256 amount) public virtual {\n require(totalSupply() + amount < MAX_SUPPLY, \"Trying to mint more than the max supply\");\n require(hasRole(MINTER_ROLE, msg.sender), \"ERC20: must have minter role to mint\");\n _mint(to, amount);\n }", "github_refs_formatted": "Neuron.sol#L155, Neuron.sol#L43", "github_files_list": "Neuron.sol", "github_refs_count": 2, "vulnerable_code_actual": "/// @notice Maximum supply of NRN tokens.\nuint256 public constant MAX_SUPPLY = 10**18 * 10**9;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function mint(address to, uint256 amount) public virtual {\n require(totalSupply() + amount < MAX_SUPPLY, \"Trying to mint more than the max supply\");\n require(hasRole(MINTER_ROLE, msg.sender), \"ERC20: must have minter role to mint\");\n _mint(to, amount);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "08-dopex", "title": "Inspex G", "severity_raw": "Low", "severity": "low", "description": "## Gas Issues\n\n| Number | Issues | Instances |\n| ------ | ------- | --------- |\n| [G-01] | Calculate strike and timetoExpiry only if putOptionsRequired value is true | 1 |\n\n### [G-01] Calculate strike and timetoExpiry only if putOptionsRequired value is true\n\n#### Line References\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L1189-L1198\n\n#### Description\nThe `strike` and `timeToExpiry` are local variables in the `calculateBondCost()` function. These variables are only used when `putOptionsRequired` is `true`. So if the `putOptionsRequired` is `false` this function call would be wasting gas to compute the value of `strike` and `timeToExpiry`.\n\n**RdpxV2Core.sol**\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L1156-L1199\n\n```solidity=1156\nfunction calculateBondCost(\n uint256 _amount,\n uint256 _rdpxBondId\n) public view returns (uint256 rdpxRequired, uint256 wethRequired) {\n uint256 rdpxPrice = getRdpxPrice();\n\n if (_rdpxBondId == 0) {\n uint256 bondDiscount = (bondDiscountFactor *\n Math.sqrt(IRdpxReserve(addresses.rdpxReserve).rdpxReserve()) *\n 1e2) / (Math.sqrt(1e18)); // 1e8 precision\n\n _validate(bondDiscount < 100e8, 14);\n\n rdpxRequired =\n ((RDPX_RATIO_PERCENTAGE - (bondDiscount / 2)) *\n _amount *\n DEFAULT_PRECISION) /\n (DEFAULT_PRECISION * rdpxPrice * 1e2);\n\n wethRequired =\n ((ETH_RATIO_PERCENTAGE - (bondDiscount / 2)) * _amount) /\n (DEFAULT_PRECISION * 1e2);\n } else {\n // if rdpx decaying bonds are being used there is no discount\n rdpxRequired =\n (RDPX_RATIO_PERCENTAGE * _amount * DEFAULT_PRECISION) /\n (DEFAULT_PRECISION * rdpxPrice * 1e2);\n\n wethRequired =\n (ETH_RATIO_PERCENTAGE * _amount) /\n (DEFAULT_PRECISION * 1e2);\n }\n\n uint256 strike = IPerpetualAtlanticVault(addresses.perpetualAtlanticVault)\n .roundUp(rdpxPrice - (rdpxPrice / 4)); // 25% below the current price\n\n uint256 timeToE", "vulnerable_code": "#### Recommended Mitigation Steps\nWe suggest computing the `strike` and `timeToExpiry` only if `putOptionsRequired` value is `true`. For example:\n\n**RdpxV2Core.sol**\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L1189-L1198\n", "fixed_code": "", "recommendation": "", "category": "rounding", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/Inspex-G.md", "collected_at": "2026-01-02T18:24:40.227811+00:00", "source_hash": "3d400fb291344576f5b71dea950bc8b65fe54522c4478bbeb8fc9c37c885e930", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "RdpxV2Core.sol#L1189-L1198, RdpxV2Core.sol#L1156-L1199", "github_files_list": "RdpxV2Core.sol", "github_refs_count": 2, "vulnerable_code_actual": "#### Recommended Mitigation Steps\nWe suggest computing the `strike` and `timeToExpiry` only if `putOptionsRequired` value is `true`. For example:\n\n**RdpxV2Core.sol**\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L1189-L1198\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "04-caviar", "title": "Shubham Q", "severity_raw": "Critical", "severity": "critical", "description": "## Low Risk Issues\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [L-01](#L-01) | Update codes to avoid Compile Errors | 8 |\n| [L-02](#L-02) | In the constructor, there is no return of incorrect address identification | 8 |\n\n*Total 2 issues.*\n\n## Non-Critical Issues\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [NC-1](#NC-1) | Lines too long | 4 |\n| [NC-2](#NC-2) | Events are missing `indexed` field | 13 |\n| [NC-3](#NC-3) | Missing NatSpec | 1 |\n| [NC-4](#NC-4) | Spell check | 1 |\n| [NC-5](#NC-5) | Floating pragma | 5 |\n| [NC-6](#NC-6) | Assembly Codes Specific \u2013 Should Have Comments | 1 |\n| [NC-7](#NC-7) | Pragma version^0.8.19 version too recent to be trusted | 5 |\n\n*Total 7 issues.*\n\n## [L-01] Update codes to avoid Compile Errors\n\n*There are 8 instances of this issue.*\n\n```solidity\nwarning[2519]: Warning: This declaration shadows an existing declaration.\n --> test/EthRouter/Change.t.sol:36:9:\n |\n36 | EthRouter.Change[] memory changes = new EthRouter.Change[](1);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nNote: The shadowed declaration is here:\n --> test/EthRouter/Change.t.sol:9:5:\n |\n9 | EthRouter.Change[] public changes;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n\n\nwarning[2519]: Warning: This declaration shadows an existing declaration.\n --> test/EthRouter/Change.t.sol:70:9:\n |\n70 | EthRouter.Change[] memory changes = new EthRouter.Change[](1);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nNote: The shadowed declaration is here:\n --> test/EthRouter/Change.t.sol:9:5:\n |\n9 | EthRouter.Change[] public changes;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n\n\nwarning[2519]: Warning: This declaration shadows an existing declaration.\n --> test/EthRouter/Change.t.sol:109:9:\n |\n109 | EthRouter.Change[] memory changes = new EthRouter.Change[](1);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nNote: The shadowed declaration is here:\n --> test/EthRouter/Change.t.sol:9:5:\n |\n9 | EthRouter.Change[] public changes;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^", "vulnerable_code": "warning[2519]: Warning: This declaration shadows an existing declaration.\n --> test/EthRouter/Change.t.sol:36:9:\n |\n36 | EthRouter.Change[] memory changes = new EthRouter.Change[](1);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nNote: The shadowed declaration is here:\n --> test/EthRouter/Change.t.sol:9:5:\n |\n9 | EthRouter.Change[] public changes;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n\n\nwarning[2519]: Warning: This declaration shadows an existing declaration.\n --> test/EthRouter/Change.t.sol:70:9:\n |\n70 | EthRouter.Change[] memory changes = new EthRouter.Change[](1);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nNote: The shadowed declaration is here:\n --> test/EthRouter/Change.t.sol:9:5:\n |\n9 | EthRouter.Change[] public changes;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n\n\nwarning[2519]: Warning: This declaration shadows an existing declaration.\n --> test/EthRouter/Change.t.sol:109:9:\n |\n109 | EthRouter.Change[] memory changes = new EthRouter.Change[](1);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nNote: The shadowed declaration is here:\n --> test/EthRouter/Change.t.sol:9:5:\n |\n9 | EthRouter.Change[] public changes;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n\n\nwarning[2072]: Warning: Unused local variable.\n --> test/Factory/Nft.t.sol:39:9:\n |\n39 | string memory tokenURI = factory.tokenURI(tokenId);\n | ^^^^^^^^^^^^^^^^^^^^^^\n\n\n\nwarning[2072]: Warning: Unused local variable.\n --> test/PrivatePool/Quotes.t.sol:115:37:\n |\n115 | (uint256 returnedFeeAmount, uint256 protocolFeeAmount) = privatePool.changeFeeQuote(inputAmount);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^\n", "fixed_code": "File: main/src/EthRouter.sol\n\nL:90 constructor(address _royaltyRegistry) {\nL:91 royaltyRegistry = _royaltyRegistry;\nL:92 }", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/Shubham-Q.md", "collected_at": "2026-01-02T18:20:07.639217+00:00", "source_hash": "3d550667a50c008f9e512d661c6a1dfe141a86d00f2b53756dc7d81007210643", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "warning[2519]: Warning: This declaration shadows an existing declaration.\n --> test/EthRouter/Change.t.sol:36:9:\n |\n36 | EthRouter.Change[] memory changes = new EthRouter.Change[](1);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nNote: The shadowed declaration is here:\n --> test/EthRouter/Change.t.sol:9:5:\n |\n9 | EthRouter.Change[] public changes;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n\n\nwarning[2519]: Warning: This declaration shadows an existing declaration.\n --> test/EthRouter/Change.t.sol:70:9:\n |\n70 | EthRouter.Change[] memory changes = new EthRouter.Change[](1);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nNote: The shadowed declaration is here:\n --> test/EthRouter/Change.t.sol:9:5:\n |\n9 | EthRouter.Change[] public changes;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n\n\nwarning[2519]: Warning: This declaration shadows an existing declaration.\n --> test/EthRouter/Change.t.sol:109:9:\n |\n109 | EthRouter.Change[] memory changes = new EthRouter.Change[](1);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nNote: The shadowed declaration is here:\n --> test/EthRouter/Change.t.sol:9:5:\n |\n9 | EthRouter.Change[] public changes;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n\n\nwarning[2072]: Warning: Unused local variable.\n --> test/Factory/Nft.t.sol:39:9:\n |\n39 | string memory tokenURI = factory.tokenURI(tokenId);\n | ^^^^^^^^^^^^^^^^^^^^^^\n\n\n\nwarning[2072]: Warning: Unused local variable.\n --> test/PrivatePool/Quotes.t.sol:115:37:\n |\n115 | (uint256 returnedFeeAmount, uint256 protocolFeeAmount) = privatePool.changeFeeQuote(inputAmount);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: main/src/EthRouter.sol\n\nL:90 constructor(address _royaltyRegistry) {\nL:91 royaltyRegistry = _royaltyRegistry;\nL:92 }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "02-ethos", "title": "0xnev Q", "severity_raw": "Critical", "severity": "critical", "description": "### Issues Template\n| Letter | Name | Description |\n|:--:|:-------:|:-------:|\n| L | Low risk | Potential risk |\n| NC | Non-critical | Non risky findings |\n| R | Refactor | Code changes |\n| O | Ordinary | Commonly found issues |\n\n| Total Found Issues | 19 |\n|:--:|:--:|\n\n### Non-Critical Template\n| Count | Title | Instances |\n|:--:|:-------|:--:|\n| [N-01] | NatSpec comments should be increased in contracts | All |\n| [N-02] | Add `return` parameters in NatSpec comments | All |\n| [N-03] | Unnecessary return statements in functions that do not return anything | 4 |\n| [N-04] | Unnecessary return statements in functions that have already define named return variable(s) | 4 |\n| [N-05] | Solidity compiler optimizations can be problematic| All |\n| [N-06] | For mordern and more readable code, update import usages | 109 |\n| [N-07] | Omission of important parameters in events emitted | 51 |\n| [N-08] | Add timelock to critical functions | 5 |\n| [N-09] | Missing checks in `set` and `update` functions | 5 |\n| [N-10] | Interchangeable usage of `uint` and `uint256` | 6 |\n| [N-11] | Constant values such as a call to `keccak256()`, should use `immutable` rather than constant | 8 |\n\n\n| Total Non-Critical Issues | 11 |\n|:--:|:--:|\n\n### Refactor Issues Template\n| Count | Title | Instances |\n|:--:|:-------|:--:|\n| [R-01] | Use `revert` with a descriptive string instead of using `return` | 6 |\n| [R-02] | Use `require` instead of `assert` | 12 |\n| [R-03] | Use `delete` instead of zero assignment to clear storage variables | 4 |\n| [R-04] | Use Time units directly | 1 |\n| [R-05] | Use scientific notation (e.g. 1e18) rather than exponentiation (e.g. 10**18) | 2 |\n| [R-06] | Inconsistent declaration of `constant` and `immutable` state variables | 16 |\n| [R-07] | Number values can be refactored to use _ | 1 |\n\n| Total Refactor Issues | 7 |\n|:--:|:--:|\n\n### Ordinary Issues Template\n| Count | Explanation | Instances |\n|:--:|:-------|:--:|\n| [O-01] | Commented out code | 7 |\n| [O-02] | Comply ", "vulnerable_code": "4 results - 1 file\n\n/TroveManager.sol\n1076: function applyPendingRewards(address _borrower, address _collateral) external override {\n1077: _requireCallerIsBorrowerOperationsOrRedemptionHelper();\n1078: return _applyPendingRewards(activePool, defaultPool, _borrower, _collateral);\n1079: }\n\n1111: function updateTroveRewardSnapshots(address _borrower, address _collateral) external override {\n1112: _requireCallerIsBorrowerOperations();\n1113: return _updateTroveRewardSnapshots(_borrower, _collateral);\n1114: }\n\n1183: function removeStake(address _borrower, address _collateral) external override {\n1184: _requireCallerIsBorrowerOperationsOrRedemptionHelper();\n1185: return _removeStake(_borrower, _collateral);\n1186: }\n\n1273: function closeTrove(address _borrower, address _collateral, uint256 _closedStatusNum) external override {\n1274: _requireCallerIsBorrowerOperationsOrRedemptionHelper();\n1275: return _closeTrove(_borrower, _collateral, Status(_closedStatusNum));\n1276: }", "fixed_code": "4 results - 2 files\n\n/TroveManager.sol\n357: function _liquidateRecoveryMode(\n358: IActivePool _activePool,\n359: IDefaultPool _defaultPool,\n360: address _collateral,\n361: address _borrower,\n362: uint _ICR,\n363: uint _LUSDInStabPool,\n364: uint _TCR,\n365: uint _price,\n366: uint256 _MCR\n367: )\n368: internal\n369: returns (LiquidationValues memory singleLiquidation)\n\n432: LiquidationValues memory zeroVals;\n433: return zeroVals;\n434: }\n435:\n436: return singleLiquidation;\n437: }\n\n1321: function _addTroveOwnerToArray(address _borrower, address _collateral) internal returns (uint128 index) {\n1329: index = uint128(TroveOwners[_collateral].length.sub(1));\n1330: Troves[_borrower][_collateral].arrayIndex = index;\n1331:\n1332: return index;\n1333: }\n\n/StabilityPool.sol\n504: function _computeRewardsPerUnitStaked(\n505: address _collateral,\n506: uint _collToAdd,\n507: uint _debtToOffset,\n508: uint _totalLUSDDeposits\n509: )\n510: internal\n511: returns (uint collGainPerUnitStaked, uint LUSDLossPerUnitStaked)\n\n543: return (collGainPerUnitStaked, LUSDLossPerUnitStaked);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/0xnev-Q.md", "collected_at": "2026-01-02T18:15:53.210096+00:00", "source_hash": "3d5e26a04bd66d23ba45e5209dc457d54c04012990f663385d99750acc6a9377", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "4 results - 1 file\n\n/TroveManager.sol\n1076: function applyPendingRewards(address _borrower, address _collateral) external override {\n1077: _requireCallerIsBorrowerOperationsOrRedemptionHelper();\n1078: return _applyPendingRewards(activePool, defaultPool, _borrower, _collateral);\n1079: }\n\n1111: function updateTroveRewardSnapshots(address _borrower, address _collateral) external override {\n1112: _requireCallerIsBorrowerOperations();\n1113: return _updateTroveRewardSnapshots(_borrower, _collateral);\n1114: }\n\n1183: function removeStake(address _borrower, address _collateral) external override {\n1184: _requireCallerIsBorrowerOperationsOrRedemptionHelper();\n1185: return _removeStake(_borrower, _collateral);\n1186: }\n\n1273: function closeTrove(address _borrower, address _collateral, uint256 _closedStatusNum) external override {\n1274: _requireCallerIsBorrowerOperationsOrRedemptionHelper();\n1275: return _closeTrove(_borrower, _collateral, Status(_closedStatusNum));\n1276: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "4 results - 2 files\n\n/TroveManager.sol\n357: function _liquidateRecoveryMode(\n358: IActivePool _activePool,\n359: IDefaultPool _defaultPool,\n360: address _collateral,\n361: address _borrower,\n362: uint _ICR,\n363: uint _LUSDInStabPool,\n364: uint _TCR,\n365: uint _price,\n366: uint256 _MCR\n367: )\n368: internal\n369: returns (LiquidationValues memory singleLiquidation)\n\n432: LiquidationValues memory zeroVals;\n433: return zeroVals;\n434: }\n435:\n436: return singleLiquidation;\n437: }\n\n1321: function _addTroveOwnerToArray(address _borrower, address _collateral) internal returns (uint128 index) {\n1329: index = uint128(TroveOwners[_collateral].length.sub(1));\n1330: Troves[_borrower][_collateral].arrayIndex = index;\n1331:\n1332: return index;\n1333: }\n\n/StabilityPool.sol\n504: function _computeRewardsPerUnitStaked(\n505: address _collateral,\n506: uint _collToAdd,\n507: uint _debtToOffset,\n508: uint _totalLUSDDeposits\n509: )\n510: internal\n511: returns (uint collGainPerUnitStaked, uint LUSDLossPerUnitStaked)\n\n543: return (collGainPerUnitStaked, LUSDLossPerUnitStaked);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "04-caviar", "title": "0xnev G", "severity_raw": "Low", "severity": "low", "description": "### Gas Optimizations\n| |Issue|Instances|Total Gas Saved|\n|:-:|:-|:-:|:-:|\n| [G-01] | ` += ` costs more gas than ` = + ` for state variables (same for -=) | 4 | 452 |\n| [G-02] | Use nested `if` statements to avoid multiple check combinations using `&&` | 9 | 54 |\n| [G-03] | Structs can be packed in to fewer storage slots | 2 | 40000 |\n| [G-04] | Public functions not called by contract can be declared external instead | 6 | - |\n| [G-05] | Functions guaranteed to revert when called by normal users can be marked payable | 10 | 210 |\n| [G-06] | Refactor `PrivatePool.availableForFlashLoan()` | 1 | 2236 |\n| [G-07] | `PrivatePool.flashFee()` function not required since it simply returns `changeFee` | 1 | 88510 |\n| [G-08] | `PrivatePool.flashFeeToken()` function not required | 1 | 46871 |\n\n| Total Found Issues | 8 |\n|:--:|:--:|\n| Total Gas Savings | Estimated >= 178333 |\n\n\n### [G-01] ` += ` costs more gas than ` = + ` for state variables (same for -=)\n[PrivatePool.sol#L230-L231](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L230-L231)\n[PrivatePool.sol#L323-L324](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L323-L324)\n```solidity\n4 result - 1 file\n\n/PrivatePool.sol\n230: virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n\n231: virtualNftReserves -= uint128(weightSum);\n\n323: virtualBaseTokenReserves -= uint128(netOutputAmount + protocolFeeAmount + feeAmount);\n\n324: virtualNftReserves += uint128(weightSum);\n```\nUsing the addition operator instead of plus-equals saves 113 gas. This applies to `-=` too.\n\n### [G-02] Use nested `if` statements to avoid multiple check combinations using `&&`\n[EthRouter.sol#L101](https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L101)\n[EthRouter.sol#L154](https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L154)\n[EthRouter.sol#L228](https://github.co", "vulnerable_code": "4 result - 1 file\n\n/PrivatePool.sol\n230: virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n\n231: virtualNftReserves -= uint128(weightSum);\n\n323: virtualBaseTokenReserves -= uint128(netOutputAmount + protocolFeeAmount + feeAmount);\n\n324: virtualNftReserves += uint128(weightSum);", "fixed_code": "9 results - 2 files\n\n/EthRouter.sol\n101: if (block.timestamp > deadline && deadline != 0)\n\n154: if (block.timestamp > deadline && deadline != 0)\n\n228: if (block.timestamp > deadline && deadline != 0)\n\n256: if (block.timestamp > deadline && deadline != 0) ", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/0xnev-G.md", "collected_at": "2026-01-02T18:19:24.850250+00:00", "source_hash": "3d942e8ab357bdf632c4a2c93d2face05f3b909f85d07d8bbf277e7d75212923", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 341, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "4 result - 1 file\n\n/PrivatePool.sol\n230: virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n\n231: virtualNftReserves -= uint128(weightSum);\n\n323: virtualBaseTokenReserves -= uint128(netOutputAmount + protocolFeeAmount + feeAmount);\n\n324: virtualNftReserves += uint128(weightSum);", "primary_code_language": "solidity", "primary_code_char_count": 341, "all_code_blocks": "// Code block 1 (solidity):\n4 result - 1 file\n\n/PrivatePool.sol\n230: virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n\n231: virtualNftReserves -= uint128(weightSum);\n\n323: virtualBaseTokenReserves -= uint128(netOutputAmount + protocolFeeAmount + feeAmount);\n\n324: virtualNftReserves += uint128(weightSum);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "4 result - 1 file\n\n/PrivatePool.sol\n230: virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n\n231: virtualNftReserves -= uint128(weightSum);\n\n323: virtualBaseTokenReserves -= uint128(netOutputAmount + protocolFeeAmount + feeAmount);\n\n324: virtualNftReserves += uint128(weightSum);", "github_refs_formatted": "PrivatePool.sol#L230-L231, PrivatePool.sol#L323-L324, EthRouter.sol#L101, EthRouter.sol#L154", "github_files_list": "EthRouter.sol, PrivatePool.sol", "github_refs_count": 4, "vulnerable_code_actual": "4 result - 1 file\n\n/PrivatePool.sol\n230: virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n\n231: virtualNftReserves -= uint128(weightSum);\n\n323: virtualBaseTokenReserves -= uint128(netOutputAmount + protocolFeeAmount + feeAmount);\n\n324: virtualNftReserves += uint128(weightSum);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "9 results - 2 files\n\n/EthRouter.sol\n101: if (block.timestamp > deadline && deadline != 0)\n\n154: if (block.timestamp > deadline && deadline != 0)\n\n228: if (block.timestamp > deadline && deadline != 0)\n\n256: if (block.timestamp > deadline && deadline != 0) ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-asymmetry", "title": "inmarelibero Q", "severity_raw": "Low", "severity": "low", "description": "\\==============================================================================================================\n\\# 1\n\\==============================================================================================================\n\n# Abstract\nAt line #194 the wrong `index` is included in the event.\n\n```\nFile: contracts/SafEth/SafEth.sol\n182: function addDerivative(\n183: address _contractAddress,\n184: uint256 _weight\n185: ) external onlyOwner {\n186: derivatives[derivativeCount] = IDerivative(_contractAddress);\n187: weights[derivativeCount] = _weight;\n188: derivativeCount++;\n189:\n190: uint256 localTotalWeight = 0;\n191: for (uint256 i = 0; i < derivativeCount; i++)\n192: localTotalWeight += weights[i];\n193: totalWeight = localTotalWeight;\n194: emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n195: }\n\n```\n\nFor instance, when adding the first `derivative`, the third parameter `index` to be passed to the `DerivativeAdded` event should be 0.\n\n```\nevent DerivativeAdded(\n address indexed contractAddress,\n uint weight,\n uint index\n);\n```\n\nWhen `188: derivativeCount++; ` is called before `194: emit DerivativeAdded(_contractAddress, _weight, derivativeCount);`, the count is incremented and then `index` will be 1 instead of 0.\n\n\n# Patch\n\nIncrement `derivativeCount` after emitting event.\n\n```\nemit DerivativeAdded(_contractAddress, _weight, derivativeCount);\nderivativeCount++;\n```\n\n\\==============================================================================================================\n\\# 2\n\\==============================================================================================================\n\n# Abstract\n\nAvoid duplicated fragment of code when updating `totalWeight`\n\nSame logic is repeated here https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L170 and here https://github.com/code-423n4/2023-03-asymmetry/blob/main/c", "vulnerable_code": "File: contracts/SafEth/SafEth.sol\n182: function addDerivative(\n183: address _contractAddress,\n184: uint256 _weight\n185: ) external onlyOwner {\n186: derivatives[derivativeCount] = IDerivative(_contractAddress);\n187: weights[derivativeCount] = _weight;\n188: derivativeCount++;\n189:\n190: uint256 localTotalWeight = 0;\n191: for (uint256 i = 0; i < derivativeCount; i++)\n192: localTotalWeight += weights[i];\n193: totalWeight = localTotalWeight;\n194: emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n195: }\n", "fixed_code": "event DerivativeAdded(\n address indexed contractAddress,\n uint weight,\n uint index\n);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/inmarelibero-Q.md", "collected_at": "2026-01-02T18:19:13.341631+00:00", "source_hash": "3da2096f8bb74f210bfd07f6a39c998e2b782989051fcbb3d3ec4dfc5e5f0d93", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 791, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/SafEth/SafEth.sol\n182: function addDerivative(\n183: address _contractAddress,\n184: uint256 _weight\n185: ) external onlyOwner {\n186: derivatives[derivativeCount] = IDerivative(_contractAddress);\n187: weights[derivativeCount] = _weight;\n188: derivativeCount++;\n189:\n190: uint256 localTotalWeight = 0;\n191: for (uint256 i = 0; i < derivativeCount; i++)\n192: localTotalWeight += weights[i];\n193: totalWeight = localTotalWeight;\n194: emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n195: }", "primary_code_language": "unknown", "primary_code_char_count": 613, "all_code_blocks": "// Code block 1 (unknown):\nFile: contracts/SafEth/SafEth.sol\n182: function addDerivative(\n183: address _contractAddress,\n184: uint256 _weight\n185: ) external onlyOwner {\n186: derivatives[derivativeCount] = IDerivative(_contractAddress);\n187: weights[derivativeCount] = _weight;\n188: derivativeCount++;\n189:\n190: uint256 localTotalWeight = 0;\n191: for (uint256 i = 0; i < derivativeCount; i++)\n192: localTotalWeight += weights[i];\n193: totalWeight = localTotalWeight;\n194: emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n195: }\n\n// Code block 2 (unknown):\nevent DerivativeAdded(\n address indexed contractAddress,\n uint weight,\n uint index\n);\n\n// Code block 3 (unknown):\nemit DerivativeAdded(_contractAddress, _weight, derivativeCount);\nderivativeCount++;", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol#L170", "github_files_list": "SafEth.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: contracts/SafEth/SafEth.sol\n182: function addDerivative(\n183: address _contractAddress,\n184: uint256 _weight\n185: ) external onlyOwner {\n186: derivatives[derivativeCount] = IDerivative(_contractAddress);\n187: weights[derivativeCount] = _weight;\n188: derivativeCount++;\n189:\n190: uint256 localTotalWeight = 0;\n191: for (uint256 i = 0; i < derivativeCount; i++)\n192: localTotalWeight += weights[i];\n193: totalWeight = localTotalWeight;\n194: emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n195: }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "event DerivativeAdded(\n address indexed contractAddress,\n uint weight,\n uint index\n);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "03-asymmetry", "title": "PNS G", "severity_raw": "Low", "severity": "low", "description": "[G-1] Don\u2019t compare boolean expressions to boolean literals\n====================\n`if ( == true) => if (), if ( == false) => if (!).`\n\n```solidity\nFile: contracts/SafEth/SafEth.sol\n64: require(pauseStaking == false, \"staking is paused\");\n```\n\n```solidity\nFile: contracts/SafEth/SafEth.sol\n109: require(pauseUnstaking == false, \"unstaking is paused\");\n```\n\n[G-2] `++i/i++` should be `unchecked{++i}/unchecked{i++}` when it is not possible for them to overflow, as is the case when used in `for` loops\n===\n[The increment in for loop post condition can be made unchecked](https://gist.github.com/hrkrshnn/ee8fabd532058307229d65dcd5836ddc#the-increment-in-for-loop-post-condition-can-be-made-unchecked)\n```solidity\nFile: contracts/SafEth/SafEth.sol\n71: for (uint i = 0; i < derivativeCount; i++)\n```\n```solidity\nFile: contracts/SafEth/SafEth.sol\n84: for (uint i = 0; i < derivativeCount; i++) {\n```\n```solidity\nFile: contracts/SafEth/SafEth.sol\n113: for (uint256 i = 0; i < derivativeCount; i++) {\n```\n```solidity\nFile: contracts/SafEth/SafEth.sol\n140: for (uint i = 0; i < derivativeCount; i++) {\n```\n```solidity\nFile: contracts/SafEth/SafEth.sol\n147: for (uint i = 0; i < derivativeCount; i++) {\n```\n```solidity\nFile: contracts/SafEth/SafEth.sol\n171: for (uint256 i = 0; i < derivativeCount; i++)\n```\n```solidity\nFile: contracts/SafEth/SafEth.sol\n191: for (uint256 i = 0; i < derivativeCount; i++)\n```\n[G-3] Multiple accesses of a mapping should use a local variable cache\n===\n`derivatives` mapping\n---\n```solidity\nFile: contracts/SafEth/SafEth.sol\n71: for (uint i = 0; i < derivativeCount; i++)\n72: underlyingValue +=\n73: (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n74: derivatives[i].balance()) /\n75: 10 ** 18;\n```\n[G-4] State variables should be cached in local variables\n===\n`derivativeCount` variable in `stake()` function\n--", "vulnerable_code": "File: contracts/SafEth/SafEth.sol\n64: require(pauseStaking == false, \"staking is paused\");", "fixed_code": "File: contracts/SafEth/SafEth.sol\n109: require(pauseUnstaking == false, \"unstaking is paused\");", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/PNS-G.md", "collected_at": "2026-01-02T18:18:23.845918+00:00", "source_hash": "3dbb801b4b5be62ab942bca5f384f8b93e444422b6df394be1f2937c9021cd1a", "code_block_count": 10, "solidity_block_count": 10, "total_code_chars": 1125, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/SafEth/SafEth.sol\n64: require(pauseStaking == false, \"staking is paused\");", "primary_code_language": "solidity", "primary_code_char_count": 98, "all_code_blocks": "// Code block 1 (solidity):\nFile: contracts/SafEth/SafEth.sol\n64: require(pauseStaking == false, \"staking is paused\");\n\n// Code block 2 (solidity):\nFile: contracts/SafEth/SafEth.sol\n109: require(pauseUnstaking == false, \"unstaking is paused\");\n\n// Code block 3 (solidity):\nFile: contracts/SafEth/SafEth.sol\n71: for (uint i = 0; i < derivativeCount; i++)\n\n// Code block 4 (solidity):\nFile: contracts/SafEth/SafEth.sol\n84: for (uint i = 0; i < derivativeCount; i++) {\n\n// Code block 5 (solidity):\nFile: contracts/SafEth/SafEth.sol\n113: for (uint256 i = 0; i < derivativeCount; i++) {\n\n// Code block 6 (solidity):\nFile: contracts/SafEth/SafEth.sol\n140: for (uint i = 0; i < derivativeCount; i++) {\n\n// Code block 7 (solidity):\nFile: contracts/SafEth/SafEth.sol\n147: for (uint i = 0; i < derivativeCount; i++) {\n\n// Code block 8 (solidity):\nFile: contracts/SafEth/SafEth.sol\n171: for (uint256 i = 0; i < derivativeCount; i++)\n\n// Code block 9 (solidity):\nFile: contracts/SafEth/SafEth.sol\n191: for (uint256 i = 0; i < derivativeCount; i++)\n\n// Code block 10 (solidity):\nFile: contracts/SafEth/SafEth.sol\n71: for (uint i = 0; i < derivativeCount; i++)\n72: underlyingValue +=\n73: (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n74: derivatives[i].balance()) /\n75: 10 ** 18;", "all_code_blocks_count": 10, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: contracts/SafEth/SafEth.sol\n64: require(pauseStaking == false, \"staking is paused\");\n\nFile: contracts/SafEth/SafEth.sol\n109: require(pauseUnstaking == false, \"unstaking is paused\");\n\nFile: contracts/SafEth/SafEth.sol\n71: for (uint i = 0; i < derivativeCount; i++)\n\nFile: contracts/SafEth/SafEth.sol\n84: for (uint i = 0; i < derivativeCount; i++) {\n\nFile: contracts/SafEth/SafEth.sol\n113: for (uint256 i = 0; i < derivativeCount; i++) {\n\nFile: contracts/SafEth/SafEth.sol\n140: for (uint i = 0; i < derivativeCount; i++) {\n\nFile: contracts/SafEth/SafEth.sol\n147: for (uint i = 0; i < derivativeCount; i++) {\n\nFile: contracts/SafEth/SafEth.sol\n171: for (uint256 i = 0; i < derivativeCount; i++)\n\nFile: contracts/SafEth/SafEth.sol\n191: for (uint256 i = 0; i < derivativeCount; i++)\n\nFile: contracts/SafEth/SafEth.sol\n71: for (uint i = 0; i < derivativeCount; i++)\n72: underlyingValue +=\n73: (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n74: derivatives[i].balance()) /\n75: 10 ** 18;", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: contracts/SafEth/SafEth.sol\n64: require(pauseStaking == false, \"staking is paused\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/SafEth/SafEth.sol\n109: require(pauseUnstaking == false, \"unstaking is paused\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 15} {"source": "c4", "protocol": "02-ethos", "title": "Bough G", "severity_raw": "High", "severity": "high", "description": "# [G-01] ++i costs less gas than i++, especially when it\u2019s used in for-loops (--i/i-- too)\n##description \n++i costs less gas compared to i++ or i += 1 (same for --i vs i-- or i -= 1).\nit Saves 5 gas per loop\n## Codes \nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol#L108 \n``` for(uint256 i = 0; i < numCollaterals; i++) { ```\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L608\n```for (vars.i = 0; vars.i < _n && vars.user != firstUser; vars.i++) {```\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L690\n```for (vars.i = 0; vars.i < _n; vars.i++) ```\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L808\n```for (vars.i = 0; vars.i < _troveArray.length; vars.i++) {```\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L882\n\n```for (vars.i = 0; vars.i < _troveArray.length; vars.i++) {```\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol#L56\n\n```for(uint256 i = 0; i < _collaterals.length; i++) {```\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/HintHelpers.sol#L191\n\n```i++``\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/PriceFeed.sol#L113\n``` for (uint256 i = 0; i < numCollaterals; i++) {```\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/RedemptionHelper.sol#L154\n```for (uint256 i = 0; i < numCollaterals; i++) {```\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/HintHelpers.sol#L120\n\n```while (vars.currentTroveuser != address(0) && vars.remainingLUSD > 0 && _maxIterations-- > 0)```\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultERC4626.sol#L273\n``` if (x % y != 0) q++;```\n\n# [G\u201102] Structs can be packed into fewer storage slots.\n\nhttps://github.com/code-", "vulnerable_code": "https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L608", "fixed_code": "https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L690", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/Bough-G.md", "collected_at": "2026-01-02T18:16:00.384391+00:00", "source_hash": "3dc63e649fcb01ed306288f05a1605d3cf0bc5838c737b61cb43fc48c5cd93ca", "code_block_count": 9, "solidity_block_count": 0, "total_code_chars": 876, "github_ref_count": 11, "vulnerable_code_is_url": true, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L608", "primary_code_language": "unknown", "primary_code_char_count": 96, "all_code_blocks": "// Code block 1 (unknown):\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L608\n\n// Code block 2 (unknown):\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L690\n\n// Code block 3 (unknown):\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L808\n\n// Code block 4 (unknown):\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L882\n\n// Code block 5 (unknown):\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol#L56\n\n// Code block 6 (unknown):\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/HintHelpers.sol#L191\n\n// Code block 7 (unknown):\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/RedemptionHelper.sol#L154\n\n// Code block 8 (unknown):\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/HintHelpers.sol#L120\n\n// Code block 9 (unknown):\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultERC4626.sol#L273", "all_code_blocks_count": 9, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ActivePool.sol#L108, TroveManager.sol#L608, TroveManager.sol#L690, TroveManager.sol#L808, TroveManager.sol#L882, CollateralConfig.sol#L56, HintHelpers.sol#L191, PriceFeed.sol#L113, RedemptionHelper.sol#L154, HintHelpers.sol#L120, ReaperVaultERC4626.sol#L273", "github_files_list": "TroveManager.sol, PriceFeed.sol, ActivePool.sol, ReaperVaultERC4626.sol, RedemptionHelper.sol, CollateralConfig.sol, HintHelpers.sol", "github_refs_count": 11, "vulnerable_code_actual": "", "has_vulnerable_code_snippet": false, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 13} {"source": "c4", "protocol": "02-ai-arena", "title": "Blank_Space G", "severity_raw": "Gas", "severity": "gas", "description": "#[G-01] The `transferOwnership` function does not make the owner an admin\n\nThe `transferOwnership` function updates the owner of the contract, but does not give the owner admin functionality, even though the owner is only address that can call `adjustAdminAccess`. This means that there is no reason for an owner to not be an admin, thus the address would have to make a second function call to `adjustAdminAccess` at a gas cost. If there was an incentive for an owner to not be an admin, the current implementation does not stop an owner from making themselves an admin. \n\n```diff\nfunction transferOwnership(address newOwnerAddress) external {\n require(msg.sender == _ownerAddress);\n++ isAdmin[newOwnerAddress] = true;\n _ownerAddress = newOwnerAddress;\n }\n```\n\n#[G-02] The `attributeProbabilities` mapping gets overridden in the constructor\n\nThe constructor calls `addAttributeProbabilities` which \u201cInitializes the probabilities for each attribute\u201d via a for loop in `addAttributeProbabilities`, but then overwrites those probabilities and adds them as part of the for loop in the constructor itself. It is, thus not necessary to call `addAttributeProbabilities` in the constructor, thus saving gas. \n\nLocation: https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/AiArenaHelper.sol#L45\n\nLocation: https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/Neuron.sol#L85-L88\n\n#[G-03] The `defaultAttributeDivisor` can be passed as a parameter in the constructor\n\nThe `defaultAttributeDivisor` is only used once in the constructor to populate the initial `attributeToDnaDivisor` .It is not necessary to store an array in storage for a single use during the construction of the contract. Consider passing the array as a constructor parameter. \n\nLocation: https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/AiArenaHelper.sol#L50", "vulnerable_code": "", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/Blank_Space-G.md", "collected_at": "2026-01-02T19:02:18.877415+00:00", "source_hash": "3dd75d4d7f39bd7f957068a0b94384d8dab1e09c0d8aa82fce082f75d98d1bfe", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 191, "github_ref_count": 3, "vulnerable_code_is_url": true, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function transferOwnership(address newOwnerAddress) external {\n require(msg.sender == _ownerAddress);\n++ isAdmin[newOwnerAddress] = true;\n _ownerAddress = newOwnerAddress;\n }", "primary_code_language": "diff", "primary_code_char_count": 191, "all_code_blocks": "// Code block 1 (diff):\nfunction transferOwnership(address newOwnerAddress) external {\n require(msg.sender == _ownerAddress);\n++ isAdmin[newOwnerAddress] = true;\n _ownerAddress = newOwnerAddress;\n }", "all_code_blocks_count": 1, "has_diff_blocks": true, "diff_code": "function transferOwnership(address newOwnerAddress) external {\n require(msg.sender == _ownerAddress);\n++ isAdmin[newOwnerAddress] = true;\n _ownerAddress = newOwnerAddress;\n }", "solidity_code": "", "github_refs_formatted": "AiArenaHelper.sol#L45, Neuron.sol#L85-L88, AiArenaHelper.sol#L50", "github_files_list": "Neuron.sol, AiArenaHelper.sol", "github_refs_count": 3, "vulnerable_code_actual": "", "has_vulnerable_code_snippet": false, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 7} {"source": "c4", "protocol": "09-ondo", "title": "SovaSlava Q", "severity_raw": "Unknown", "severity": "unknown", "description": "Q1 - Different token name.\nFactory emit event with wrong token name, when deploy new token contract.\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDYFactory.sol#L105\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L195\n\nQ2 - Event has wrong amount of transfered shares. \nFunction wrap() mint shares with amount - _USDYAmount * BPS_DENOMINATOR. But emit event TransferShares with value of _USDYAmount. Without multiplying by BPS_DENOMINATOR. Correct code:\n```\n emit TransferShares(address(0), msg.sender, _USDYAmount * BPS_DENOMINATOR);\n```\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L439\n\nQ3 - Function dont round derived price to the 8th decimal.\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/rwaOracles/RWADynamicOracle.sol#L282C18-L282C18\n\nQ4 - User cant see own token balance, when oracle now has pause mode enabled.\nFunction balanceOf() call oracle.getPrice(). Function getPrice() has modifier whenNotPaused. \nIt is normal that in pause mode the user cannot move their tokens, but viewing the balance should be available. For example, you can display the last price in pause mode\u044e \nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L227\n\nQ5 - Approver can't revoke his vote\nThere is not opportunity revoke vote for tx in DestinationBridge.sol \nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/bridge/DestinationBridge.sol#L197\n\nQ6 - Insufficient verification of threshold amount in setThresholds().\nFunction dont checks, that chainToThresholds[srcChain][i - 1].amount is equal to amounts[i]. If these values are equal, should be revert error - ThresholdsNotInAscendingOrder().\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34", "vulnerable_code": " emit TransferShares(address(0), msg.sender, _USDYAmount * BPS_DENOMINATOR);", "fixed_code": "", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/SovaSlava-Q.md", "collected_at": "2026-01-02T18:25:41.273651+00:00", "source_hash": "3de5cc6c570203925ad92ad3cccd1e68923e7dfe755884ae1d6e01432909b51c", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 75, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "emit TransferShares(address(0), msg.sender, _USDYAmount * BPS_DENOMINATOR);", "primary_code_language": "unknown", "primary_code_char_count": 75, "all_code_blocks": "// Code block 1 (unknown):\nemit TransferShares(address(0), msg.sender, _USDYAmount * BPS_DENOMINATOR);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "rUSDYFactory.sol#L105, rUSDY.sol#L195, rUSDY.sol#L439, RWADynamicOracle.sol#L282-L18, rUSDY.sol#L227, DestinationBridge.sol#L197", "github_files_list": "rUSDYFactory.sol, rUSDY.sol, RWADynamicOracle.sol, DestinationBridge.sol", "github_refs_count": 6, "vulnerable_code_actual": " emit TransferShares(address(0), msg.sender, _USDYAmount * BPS_DENOMINATOR);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "10-badger", "title": "alexzoid Q", "severity_raw": "Low", "severity": "low", "description": "## Summary\n\n### Low Issues\n\nTotal of **1 issue**:\n\n|ID|Issue|\n|:--:|:---|\n| [L-01] | Missing Zero Address Check for `_authorityAddress` in `EBTCToken` Constructor |\n\n---\n\n## Low Issues\n### [L-01] - Missing Zero Address Check for `_authorityAddress` in `EBTCToken` Constructor\n\n- https://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/EBTCToken.sol#L66\n- https://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/Dependencies/AuthNoOwner.sol#L55-L63\n\nThe lack of a zero address check for the `_authorityAddress` parameter in the `EBTCToken` constructor was identified as a vulnerability through a formal verification contest using the `authNoOwnerInitializedAndAddressSetInConstructor()` rule. This rule is designed to ensure that `_authorityInitialized` is `true` only when `_authority` is set to a non-zero address in `AuthNoOwner` contract.\n\n```\ninvariant authNoOwnerInitializedAndAddressSetInConstructor() ghostAuthorityInitialized == (ghostAuthority != 0) \n filtered { f -> f.selector == 0 } {\n preserved {\n require(false);\n }\n}\n```\nIn the initial `EBTCToken` contract, this rule was violated, suggesting that `_authority` could be set to the zero address while `_authorityInitialized` was `true`. This issue was not found in other contracts such as `ActivePool.sol` and `CollSurplusPool.sol`. \n\nAn additional point of concern is the `setAuthority()` function in the `AuthNoOwner` contract. This function is intended to set a new `_authority` address. However, if `_authority` is initially set to the zero address due to the absence of a zero address check in the constructor, it would be impossible to change the `_authority` later, as the `setAuthority()` function requires the current `_authority` to authorize the change. This limitation poses a significant risk to the contract's flexibility and security.\n\n***Recommendation***: It is advised to implement a zero address check for `_authorityAddress` in the `EBTCToken` ", "vulnerable_code": "invariant authNoOwnerInitializedAndAddressSetInConstructor() ghostAuthorityInitialized == (ghostAuthority != 0) \n filtered { f -> f.selector == 0 } {\n preserved {\n require(false);\n }\n}", "fixed_code": "require(_authorityAddress != address(0), \"EBTCToken: zero authority!\");\n_initializeAuthority(_authorityAddress);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/alexzoid-Q.md", "collected_at": "2026-01-02T18:26:41.494368+00:00", "source_hash": "3dfff656b108c887a488717822cac51c26d19c1a6bd9161cab534d3c9309808c", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 200, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "invariant authNoOwnerInitializedAndAddressSetInConstructor() ghostAuthorityInitialized == (ghostAuthority != 0) \n filtered { f -> f.selector == 0 } {\n preserved {\n require(false);\n }\n}", "primary_code_language": "unknown", "primary_code_char_count": 200, "all_code_blocks": "// Code block 1 (unknown):\ninvariant authNoOwnerInitializedAndAddressSetInConstructor() ghostAuthorityInitialized == (ghostAuthority != 0) \n filtered { f -> f.selector == 0 } {\n preserved {\n require(false);\n }\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "EBTCToken.sol#L66, AuthNoOwner.sol#L55-L63", "github_files_list": "EBTCToken.sol, AuthNoOwner.sol", "github_refs_count": 2, "vulnerable_code_actual": "invariant authNoOwnerInitializedAndAddressSetInConstructor() ghostAuthorityInitialized == (ghostAuthority != 0) \n filtered { f -> f.selector == 0 } {\n preserved {\n require(false);\n }\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "require(_authorityAddress != address(0), \"EBTCToken: zero authority!\");\n_initializeAuthority(_authorityAddress);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ai-arena", "title": "DeFiHackLabs Q", "severity_raw": "Critical", "severity": "critical", "description": "## [L-01] Lack of access control\n\nfighterCreatedEmitter() is public, allowing anyone to arbitrarily modify the data storing the new Fighter NFT.\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/FighterOps.sol#L53\n```\n /// @notice Emits a FighterCreated event.\n function fighterCreatedEmitter(\n uint256 id,\n uint256 weight,\n uint256 element,\n uint8 generation\n ) \n public \n {\n emit FighterCreated(id, weight, element, generation);\n }\n```\n\n\n## [L-02]Potential Voltage loss\nThere are some senarios:\n1. Users can replenish Voltage every day, but _replenishVoltage is executed within spendVoltage().\n The spendVoltage() function takes the voltageSpent parameter as input. \nUsers who only want to replenish Voltage but lack of awareness or accidental input of voltageSpent will lose Voltage.\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/VoltageManager.sol#L110\n```\nownerVoltage[spender] -= voltageSpent;\n```\nIt is recommended to separate replenishVoltage into a standalone function.\n\n2. The useVoltageBattery() only checks if the user's voltage is less than 100. Users with non-zero voltage will lose their remaining Voltage.\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/VoltageManager.sol#L94\n```\nrequire(ownerVoltage[msg.sender] < 100);\n```\n\n## [L-03] URI returns false data.\n\nThe owner can add admin access for a user through adjustAdminAccess().\nMultiple users may have admin access.\nsetTokenURI() and createGameItem() are called by a user with admin access.\nAfter createGameItem(), other users with admin access can freely modify the tokenURI using setTokenURI.\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/GameItems.sol#L194\n```\nfunction setTokenURI(uint256 tokenId, string memory _tokenURI) public {\n require(isAdmin[msg.sender]);\n _tokenURIs[tokenId] = _tokenURI;\n }\n```\nThe value of the NFTs depends on their metadata which includes critical information such a", "vulnerable_code": " /// @notice Emits a FighterCreated event.\n function fighterCreatedEmitter(\n uint256 id,\n uint256 weight,\n uint256 element,\n uint8 generation\n ) \n public \n {\n emit FighterCreated(id, weight, element, generation);\n }", "fixed_code": "ownerVoltage[spender] -= voltageSpent;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/DeFiHackLabs-Q.md", "collected_at": "2026-01-02T19:02:23.194519+00:00", "source_hash": "3e1bee034a6a4b3fdd1ca3095a1dcb90c8927c16d77639d3e2f214884e92659a", "code_block_count": 4, "solidity_block_count": 0, "total_code_chars": 502, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "/// @notice Emits a FighterCreated event.\n function fighterCreatedEmitter(\n uint256 id,\n uint256 weight,\n uint256 element,\n uint8 generation\n ) \n public \n {\n emit FighterCreated(id, weight, element, generation);\n }", "primary_code_language": "unknown", "primary_code_char_count": 268, "all_code_blocks": "// Code block 1 (unknown):\n/// @notice Emits a FighterCreated event.\n function fighterCreatedEmitter(\n uint256 id,\n uint256 weight,\n uint256 element,\n uint8 generation\n ) \n public \n {\n emit FighterCreated(id, weight, element, generation);\n }\n\n// Code block 2 (unknown):\nownerVoltage[spender] -= voltageSpent;\n\n// Code block 3 (unknown):\nrequire(ownerVoltage[msg.sender] < 100);\n\n// Code block 4 (unknown):\nfunction setTokenURI(uint256 tokenId, string memory _tokenURI) public {\n require(isAdmin[msg.sender]);\n _tokenURIs[tokenId] = _tokenURI;\n }", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "FighterOps.sol#L53, VoltageManager.sol#L110, VoltageManager.sol#L94, GameItems.sol#L194", "github_files_list": "VoltageManager.sol, GameItems.sol, FighterOps.sol", "github_refs_count": 4, "vulnerable_code_actual": " /// @notice Emits a FighterCreated event.\n function fighterCreatedEmitter(\n uint256 id,\n uint256 weight,\n uint256 element,\n uint8 generation\n ) \n public \n {\n emit FighterCreated(id, weight, element, generation);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "ownerVoltage[spender] -= voltageSpent;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "01-salty", "title": "klau5 Q", "severity_raw": "Unknown", "severity": "unknown", "description": "# proposeCallContract: Incorrectly stores the description\n\n## Links to affected code\n\n[https://github.com/code-423n4/2024-01-salty/blob/aab6bbc6fe49d4dd37becc7bbd0c847ec4a7c1e6/src/dao/Proposals.sol#L218](https://github.com/code-423n4/2024-01-salty/blob/aab6bbc6fe49d4dd37becc7bbd0c847ec4a7c1e6/src/dao/Proposals.sol#L218)\n\n## Impact\n\nIt incorrectly stores the description. This may prevent the description from being retrieved offchain.\n\n## Proof of Concept\n\n```solidity\nfunction proposeCallContract( address contractAddress, uint256 number, string calldata description ) external nonReentrant returns (uint256 ballotID)\n{\n require( contractAddress != address(0), \"Contract address cannot be address(0)\" );\n\n string memory ballotName = string.concat(\"callContract:\", Strings.toHexString(address(contractAddress)) );\n@> return _possiblyCreateProposal( ballotName, BallotType.CALL_CONTRACT, contractAddress, number, description, \"\" );\n}\n```\n\nWhen calling `_possiblyCreateProposal`, it passes the `description` as the `string1` parameter. An empty string is stored as description. Therefore, the description may not appear when retrieved offchain.\n\n## Tools Used\n\nManual Review\n\n## Recommended Mitigation Steps\n\nPass the `description` as the `string2` parameter.\n\n```diff\nfunction proposeCallContract( address contractAddress, uint256 number, string calldata description ) external nonReentrant returns (uint256 ballotID)\n{\n require( contractAddress != address(0), \"Contract address cannot be address(0)\" );\n\n string memory ballotName = string.concat(\"callContract:\", Strings.toHexString(address(contractAddress)) );\n- return _possiblyCreateProposal( ballotName, BallotType.CALL_CONTRACT, contractAddress, number, description, \"\" );\n+ return _possiblyCreateProposal( ballotName, BallotType.CALL_CONTRACT, contractAddress, number, \"\", description );\n}\n```\n\n# withdraw - Can leave less than DUST\n\n## Links to affected code\n\n[https://github.com/code-423n4/2024-01-salty/blob/aab6bbc6fe49d", "vulnerable_code": "function proposeCallContract( address contractAddress, uint256 number, string calldata description ) external nonReentrant returns (uint256 ballotID)\n{\n require( contractAddress != address(0), \"Contract address cannot be address(0)\" );\n\n string memory ballotName = string.concat(\"callContract:\", Strings.toHexString(address(contractAddress)) );\n@> return _possiblyCreateProposal( ballotName, BallotType.CALL_CONTRACT, contractAddress, number, description, \"\" );\n}", "fixed_code": "# withdraw - Can leave less than DUST\n\n## Links to affected code\n\n[https://github.com/code-423n4/2024-01-salty/blob/aab6bbc6fe49d4dd37becc7bbd0c847ec4a7c1e6/src/pools/Pools.sol#L222-L224](https://github.com/code-423n4/2024-01-salty/blob/aab6bbc6fe49d4dd37becc7bbd0c847ec4a7c1e6/src/pools/Pools.sol#L222-L224)\n\n## Impact\n\nIt can leave a deposit amount smaller than DUST.\n\n## Proof of Concept\n\nIt does not check whether the remaining `_userDeposits` after withdrawal is more than DUST. You should avoid depositing less than DUST because you won't be able to get it out later unless you deposit it.\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/klau5-Q.md", "collected_at": "2026-01-02T19:01:49.823387+00:00", "source_hash": "3e2b3c6b97a1614fc58e2a7ca45ac0ea4bd96211fc29c2c0f929fbecae578e81", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 1058, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function proposeCallContract( address contractAddress, uint256 number, string calldata description ) external nonReentrant returns (uint256 ballotID)\n{\n require( contractAddress != address(0), \"Contract address cannot be address(0)\" );\n\n string memory ballotName = string.concat(\"callContract:\", Strings.toHexString(address(contractAddress)) );\n@> return _possiblyCreateProposal( ballotName, BallotType.CALL_CONTRACT, contractAddress, number, description, \"\" );\n}", "primary_code_language": "solidity", "primary_code_char_count": 470, "all_code_blocks": "// Code block 1 (solidity):\nfunction proposeCallContract( address contractAddress, uint256 number, string calldata description ) external nonReentrant returns (uint256 ballotID)\n{\n require( contractAddress != address(0), \"Contract address cannot be address(0)\" );\n\n string memory ballotName = string.concat(\"callContract:\", Strings.toHexString(address(contractAddress)) );\n@> return _possiblyCreateProposal( ballotName, BallotType.CALL_CONTRACT, contractAddress, number, description, \"\" );\n}\n\n// Code block 2 (diff):\nfunction proposeCallContract( address contractAddress, uint256 number, string calldata description ) external nonReentrant returns (uint256 ballotID)\n{\n require( contractAddress != address(0), \"Contract address cannot be address(0)\" );\n\n string memory ballotName = string.concat(\"callContract:\", Strings.toHexString(address(contractAddress)) );\n- return _possiblyCreateProposal( ballotName, BallotType.CALL_CONTRACT, contractAddress, number, description, \"\" );\n+ return _possiblyCreateProposal( ballotName, BallotType.CALL_CONTRACT, contractAddress, number, \"\", description );\n}", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "function proposeCallContract( address contractAddress, uint256 number, string calldata description ) external nonReentrant returns (uint256 ballotID)\n{\n require( contractAddress != address(0), \"Contract address cannot be address(0)\" );\n\n string memory ballotName = string.concat(\"callContract:\", Strings.toHexString(address(contractAddress)) );\n- return _possiblyCreateProposal( ballotName, BallotType.CALL_CONTRACT, contractAddress, number, description, \"\" );\n+ return _possiblyCreateProposal( ballotName, BallotType.CALL_CONTRACT, contractAddress, number, \"\", description );\n}", "solidity_code": "function proposeCallContract( address contractAddress, uint256 number, string calldata description ) external nonReentrant returns (uint256 ballotID)\n{\n require( contractAddress != address(0), \"Contract address cannot be address(0)\" );\n\n string memory ballotName = string.concat(\"callContract:\", Strings.toHexString(address(contractAddress)) );\n@> return _possiblyCreateProposal( ballotName, BallotType.CALL_CONTRACT, contractAddress, number, description, \"\" );\n}", "github_refs_formatted": "Proposals.sol#L218, Pools.sol#L222-L224", "github_files_list": "Proposals.sol, Pools.sol", "github_refs_count": 2, "vulnerable_code_actual": "function proposeCallContract( address contractAddress, uint256 number, string calldata description ) external nonReentrant returns (uint256 ballotID)\n{\n require( contractAddress != address(0), \"Contract address cannot be address(0)\" );\n\n string memory ballotName = string.concat(\"callContract:\", Strings.toHexString(address(contractAddress)) );\n@> return _possiblyCreateProposal( ballotName, BallotType.CALL_CONTRACT, contractAddress, number, description, \"\" );\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "# withdraw - Can leave less than DUST\n\n## Links to affected code\n\n[https://github.com/code-423n4/2024-01-salty/blob/aab6bbc6fe49d4dd37becc7bbd0c847ec4a7c1e6/src/pools/Pools.sol#L222-L224](https://github.com/code-423n4/2024-01-salty/blob/aab6bbc6fe49d4dd37becc7bbd0c847ec4a7c1e6/src/pools/Pools.sol#L222-L224)\n\n## Impact\n\nIt can leave a deposit amount smaller than DUST.\n\n## Proof of Concept\n\nIt does not check whether the remaining `_userDeposits` after withdrawal is more than DUST. You should avoid depositing less than DUST because you won't be able to get it out later unless you deposit it.\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "08-dopex", "title": "0xMango Q", "severity_raw": "Unknown", "severity": "unknown", "description": "## Removing the last element of ```reserveAsset``` via the ```addAssetTotokenReserves()``` function does not properly update the ```reserveIndex``` mapping.\n\nAs mentioned in the #dopex-aug21 chat, further assets will be added to this array. (\"BTC\", \"CRV\")\nThe core contract makes much use of reserveIndes[\"TOKEN_NAME\"] as a reliable way to interact with \nthe correct element. Normaly removing an element will set the value of reserveIndex[\"Said symbol\"]\nto 0. But removing the last element, does not update this, possibly making the contract think,\nthe element is still there if substituted with another token.\n\nExample: Say we have ```[ZERO, WETH, RDPX, DPXETH, CRV]```.\nThe indexs:\n```\nreserveIndex[\"RDPX\"] will be 2\nreserveIndex[\"CRV\"] will be 4.\n```\nRemoving RDPX, will update the reserveIndex[\"RDPX\"] to 0.\nRemoving CRV. The reserveIndex[\"CRV\"] remains 4.\nFurthermore having removed CRV & adding BTC to the array will mess with accounting.\nNew Array having removed CRV, added BTC: \n```\n[ZERO, WETH, RDPX, DPXETH, BTC]\n```\nIf any contracts now read from reserveIndex[\"CRV\"], they will be directed to the BTC block,\npossibly transfering or burning the wrong token.\n\nPOC: Works as child of ```Setup.t.sol```\n```\n function testAddReserve() public {\n // Using Setup.t.sol from sponsor as environment.\n // Adding Crv as the last asset:\n rdpxV2Core.addAssetTotokenReserves(\n address(0x82938347),\n \"Crv\"\n );\n \n (address crvAddress, uint256 crvBal, string memory crvSymb) = rdpxV2Core.reserveAsset(4);\n \n // Removes rdpx from reserveAssets array:\n rdpxV2Core.removeAssetFromtokenReserves(crvSymb);\n // Adds rdpx back as last element:\n rdpxV2Core.addAssetTotokenReserves(\n address(0xb1b1b1bb1),\n \"BTC\"\n );\n console.log(\"Ideally; rdpxV2Core.reserveIndex(crvSymbol) = 0 since it was removed.\");\n\n console.log(\"State of array after removing Crv:\");\n for(ui", "vulnerable_code": "reserveIndex[\"RDPX\"] will be 2\nreserveIndex[\"CRV\"] will be 4.", "fixed_code": "[ZERO, WETH, RDPX, DPXETH, BTC]", "recommendation": "", "category": "slippage", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/0xMango-Q.md", "collected_at": "2026-01-02T18:24:17.720748+00:00", "source_hash": "3e50e25d601091e344391dfff081c77e4da3e89a7700b91c7986d8b90af73390", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 92, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "reserveIndex[\"RDPX\"] will be 2\nreserveIndex[\"CRV\"] will be 4.", "primary_code_language": "unknown", "primary_code_char_count": 61, "all_code_blocks": "// Code block 1 (unknown):\nreserveIndex[\"RDPX\"] will be 2\nreserveIndex[\"CRV\"] will be 4.\n\n// Code block 2 (unknown):\n[ZERO, WETH, RDPX, DPXETH, BTC]", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "reserveIndex[\"RDPX\"] will be 2\nreserveIndex[\"CRV\"] will be 4.", "has_vulnerable_code_snippet": true, "fixed_code_actual": "[ZERO, WETH, RDPX, DPXETH, BTC]", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "05-ajna", "title": "T1MOH Q", "severity_raw": "High", "severity": "high", "description": "# [L-01] Keep maximum length line at 120 according to solidity style guide\n\nDescription\nMaximum line length is 120. Described in docs https://docs.soliditylang.org/en/v0.8.19/style-guide.html#maximum-line-length\n\nYou exceed this limit here:\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/GrantFund.sol#L50\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/ExtraordinaryFunding.sol#L62\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/ExtraordinaryFunding.sol#L70\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/ExtraordinaryFunding.sol#L92\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/ExtraordinaryFunding.sol#L105\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/Funding.sol#L110\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L310\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L349\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L355\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L372\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L421\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L438\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L541\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L556\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L578\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L706\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/m", "vulnerable_code": " function _getMinimumThresholdPercentage() internal view returns (uint256) {\n // default minimum threshold is 50\n if (_fundedExtraordinaryProposals.length == 0) {\n return 0.5 * 1e18;\n }\n // minimum threshold increases according to the number of funded EFM proposals\n else {\n return 0.5 * 1e18 + (_fundedExtraordinaryProposals.length * (0.05 * 1e18));\n }\n }", "fixed_code": " function _getMinimumThresholdPercentage() internal view returns (uint256) {\n // default minimum threshold is 50\n // minimum threshold increases according to the number of funded EFM proposals\n return 0.5 * 1e18 + (_fundedExtraordinaryProposals.length * (0.05 * 1e18));\n }", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/T1MOH-Q.md", "collected_at": "2026-01-02T18:21:15.372561+00:00", "source_hash": "3e71d937b09caa432ed6fc3c711b590cc8affa81ec510d7aef6e1c5700b68def", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 16, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "GrantFund.sol#L50, ExtraordinaryFunding.sol#L62, ExtraordinaryFunding.sol#L70, ExtraordinaryFunding.sol#L92, ExtraordinaryFunding.sol#L105, Funding.sol#L110, StandardFunding.sol#L310, StandardFunding.sol#L349, StandardFunding.sol#L355, StandardFunding.sol#L372, StandardFunding.sol#L421, StandardFunding.sol#L438, StandardFunding.sol#L541, StandardFunding.sol#L556, StandardFunding.sol#L578, StandardFunding.sol#L706", "github_files_list": "StandardFunding.sol, Funding.sol, ExtraordinaryFunding.sol, GrantFund.sol", "github_refs_count": 16, "vulnerable_code_actual": " function _getMinimumThresholdPercentage() internal view returns (uint256) {\n // default minimum threshold is 50\n if (_fundedExtraordinaryProposals.length == 0) {\n return 0.5 * 1e18;\n }\n // minimum threshold increases according to the number of funded EFM proposals\n else {\n return 0.5 * 1e18 + (_fundedExtraordinaryProposals.length * (0.05 * 1e18));\n }\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function _getMinimumThresholdPercentage() internal view returns (uint256) {\n // default minimum threshold is 50\n // minimum threshold increases according to the number of funded EFM proposals\n return 0.5 * 1e18 + (_fundedExtraordinaryProposals.length * (0.05 * 1e18));\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "04-caviar", "title": "catellatech Q", "severity_raw": "Critical", "severity": "critical", "description": "`Dear Caviar Team, as we have gone through each contract within the scope, we have noticed good practices that have been implemented. However, we have identified some inconsistencies that we recommend addressing. We understand that every team has a different level of good practices, but we believe that at least 90% of the recommendations in the following report should be applied for better gas efficiency, readability, and most importantly, safety.`\n\n`Note: We have provided a description of the situation and recommendations to follow, including articles and resources we have created to help identify the problem and address it quickly, and to implement them in future projects.`\n\n### Issues\n| Letter | Name | Description |\n|:--:|:-------:|:-------:|\n| L | Low risk | Potential risk |\n| NC | Non-critical | Non risky findings |\n| R | Refactor | Changing the code |\n\n| Total Found Issues | 20 |\n|:--:|:--:|\n\n### Low Risk\n| Count | Explanation | Instances |\n|:--:|:-------|:--:|\n| [L-01] | ADD A TIMELOCK TO CRITICAL FUNCTIONS | 1 |\n| [L-02] | IN THE EVENTS, INCLUDE THE OLD AND NEW VALUES OF THE UPDATED PARAMETERS TO TRACK THE CHANGES MADE | 3 |\n| [L-03] | MISSING EVENTS FOR ONLY FUNCTIONS THAT CHANGE CRITICAL PARAMETERS | 3 |\n| [L-04] | USE THE OPENZEPPELIN SAFECAST LIBRARY FOR CRITICAL FUNCTIONS | 2 |\n\n| Total Low Issues | 4 | Total Instances | 9 |\n|:--:|:--:|:--:|--:|\n\n### Non-Critical\n| Count | Explanation | Instances |\n|:--:|:-------|:--:|\n| [N-01] | USE OF FLOATING PRAGMA | all contracts |\n| [N-02] | MANDATORY CHECKS FOR EXTRA SAFETY IN THE SETTERS | 2 |\n| [N-03] | FUNCTION WRITING THAT DOES NOT COMPLY WITH THE SOLIDITY STYLE GUIDE | 1 |\n| [N-04] | MISSING EMERGENCY STOP (CIRCUIT BREAKER) PATTERN | 4 |\n| [N-05] | TAKE ADVANTAGE OF CUSTOM ERROR'S RETURN VALUE PROPERTY | all the contracts |\n| [N-06] | USE THE LATEST UPDATED VERSION OF OPENZEPPELIN DEPENDENCIES | |\n| [N-07] | NEED FUZZING TEST | all contracts |\n| [N-08] | USE OF BYTES.CONCAT() INSTEAD OF ABI.ENCODEPACKED", "vulnerable_code": "main/src/Factory.sol\n\n141: function setProtocolFeeRate(uint16 _protocolFeeRate) public onlyOwner", "fixed_code": "## [L-03] MISSING EVENTS FOR ONLY FUNCTIONS THAT CHANGE CRITICAL PARAMETERS\nThe afunctions that change critical parameters should emit events. Events allow capturing the changed parameters so that off-chain tools/interfaces can register such changes with timelocks that allow users to evaluate them and consider if they would like to engage/exit based on how they perceive the changes as affecting the trustworthiness of the protocol or profitability of the implemented financial services. The alternative of directly querying on-chain contract state for such changes is not considered practical for most users/usages.\n\nmissing events and timelocks do not promote transparency and if such changes immediately affect users' perception of fairness or trustworthiness, they could exit the protocol causing a reduction in liquidity which could negatively impact protocol TVL and reputation.\n\n\n### PROOF OF CONCEPT", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/catellatech-Q.md", "collected_at": "2026-01-02T18:20:21.197454+00:00", "source_hash": "3e7f274061adf136c25dbe40a594a119520bf1ab7c0cfb50dfefe22665bf46c5", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "main/src/Factory.sol\n\n141: function setProtocolFeeRate(uint16 _protocolFeeRate) public onlyOwner", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## [L-03] MISSING EVENTS FOR ONLY FUNCTIONS THAT CHANGE CRITICAL PARAMETERS\nThe afunctions that change critical parameters should emit events. Events allow capturing the changed parameters so that off-chain tools/interfaces can register such changes with timelocks that allow users to evaluate them and consider if they would like to engage/exit based on how they perceive the changes as affecting the trustworthiness of the protocol or profitability of the implemented financial services. The alternative of directly querying on-chain contract state for such changes is not considered practical for most users/usages.\n\nmissing events and timelocks do not promote transparency and if such changes immediately affect users' perception of fairness or trustworthiness, they could exit the protocol causing a reduction in liquidity which could negatively impact protocol TVL and reputation.\n\n\n### PROOF OF CONCEPT", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "10-badger", "title": "leegh Q", "severity_raw": "High", "severity": "high", "description": "## [N-01] Function names should be camelCase.\n```solidity\nFile: packages/contracts/contracts/BorrowerOperations.sol\n\n824: function _requireCdpisActive(ICdpManager _cdpManager, bytes32 _cdpId) internal view {\n```\n[[L824](https://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/BorrowerOperations.sol#L824)]\n\n## [N-02] Use enum values instead of numerics.\nCDP status are defined in an enum. Use the enum values instead of numerics when using CDP status.\n```solidity\nFile: packages/contracts/contracts/BorrowerOperations.sol\n\n826: require(status == 1, \"BorrowerOperations: Cdp does not exist or is closed\");\n\n831: require(status == 0, \"BorrowerOperations: Cdp is active or has been previously closed\");\n```\n[[L826](https://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/BorrowerOperations.sol#L826), [L831](https://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/BorrowerOperations.sol#L831)]", "vulnerable_code": "File: packages/contracts/contracts/BorrowerOperations.sol\n\n824: function _requireCdpisActive(ICdpManager _cdpManager, bytes32 _cdpId) internal view {", "fixed_code": "File: packages/contracts/contracts/BorrowerOperations.sol\n\n826: require(status == 1, \"BorrowerOperations: Cdp does not exist or is closed\");\n\n831: require(status == 0, \"BorrowerOperations: Cdp is active or has been previously closed\");", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/leegh-Q.md", "collected_at": "2026-01-02T18:26:54.713581+00:00", "source_hash": "3ef0009d5c0cd92091a64d5bbbb56f317588d96b65a02d70323657322a6098f3", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 401, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: packages/contracts/contracts/BorrowerOperations.sol\n\n824: function _requireCdpisActive(ICdpManager _cdpManager, bytes32 _cdpId) internal view {", "primary_code_language": "solidity", "primary_code_char_count": 152, "all_code_blocks": "// Code block 1 (solidity):\nFile: packages/contracts/contracts/BorrowerOperations.sol\n\n824: function _requireCdpisActive(ICdpManager _cdpManager, bytes32 _cdpId) internal view {\n\n// Code block 2 (solidity):\nFile: packages/contracts/contracts/BorrowerOperations.sol\n\n826: require(status == 1, \"BorrowerOperations: Cdp does not exist or is closed\");\n\n831: require(status == 0, \"BorrowerOperations: Cdp is active or has been previously closed\");", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: packages/contracts/contracts/BorrowerOperations.sol\n\n824: function _requireCdpisActive(ICdpManager _cdpManager, bytes32 _cdpId) internal view {\n\nFile: packages/contracts/contracts/BorrowerOperations.sol\n\n826: require(status == 1, \"BorrowerOperations: Cdp does not exist or is closed\");\n\n831: require(status == 0, \"BorrowerOperations: Cdp is active or has been previously closed\");", "github_refs_formatted": "BorrowerOperations.sol#L824, BorrowerOperations.sol#L826, BorrowerOperations.sol#L831", "github_files_list": "BorrowerOperations.sol", "github_refs_count": 3, "vulnerable_code_actual": "File: packages/contracts/contracts/BorrowerOperations.sol\n\n824: function _requireCdpisActive(ICdpManager _cdpManager, bytes32 _cdpId) internal view {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: packages/contracts/contracts/BorrowerOperations.sol\n\n826: require(status == 1, \"BorrowerOperations: Cdp does not exist or is closed\");\n\n831: require(status == 0, \"BorrowerOperations: Cdp is active or has been previously closed\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6.98} {"source": "c4", "protocol": "01-salty", "title": "JCK G", "severity_raw": "High", "severity": "high", "description": "\n| Number | \tIssue | Instances |\n|--------|--------|-----------|\n|[G-01]| Cache external calls outside of loop to avoid re-calling function on each iteration | 1 |\n|[G-02]| Use assembly to validate msg.sender | 43 |\n|[G-03]| State variables should be cached in stack variables rather than re-reading them from storage | 30 |\n|[G-04]| Use assembly to reuse memory space when making more than one external call | 15 |\n|[G-05]| Using delete statement can save gas | 2 |\n|[G-06]| Use hardcoded address instead of address(this) | 20 |\n|[G-07]| Emit local variables instead of state variable (Save ~100 Gas) | 14 |\n|[G-08]| Avoid calling the same internal function multiple times | 1 |\n|[G-09]| Using assembly to revert with an error message | 131 |\n|[G-10]| Shorten arrays with inline assembly | 19 |\n|[G-11]| Don\u2019t make variables public unless necessary | 50 |\n|[G-12]| When using storage instead of memory, we should cache any fields that need to be re-read in stack variables | 7 |\n|[G-13]| Use constants for variables that don\u2019t change (Save a storage SLOT: 2200 Gas) | 2 |\n|[G-14]| Validate all parameters first before performing any other operations if there\u2019s no side effects | 6 |\n|[G-15]| Use the already cached variable instead of reading from storage (Save 1 SLOAD: 100 Gas) | 2 |\n|[G-16]| Use uint256(1)/uint256(2) instead for true and false boolean states | 12 |\n|[G-17]| Add unchecked {} for subtractions where the operands can\u2019t underflow because of previous checks | 31 |\n|[G-18]| Avoid contract existence checks by using low level calls | 7 |\n\n## [G-01] Cache external calls outside of loop to avoid re-calling function on each iteration\n\nPerforming STATICCALLs that do not depend on variables incremented in loops should always try to be avoided within the loop. In the following instances, we are able to cache the external calls outside of the loop to save a STATICCALL (100 gas) per loop iteration.\n\nCache minimumCollateralRatioPercent() external funct", "vulnerable_code": "file: blob/main/src/stable/CollateralAndLiquidity.sol\n\n321 for ( uint256 i = startIndex; i <= endIndex; i++ )\n\t\t\t\t{\n\t\t\t\taddress wallet = _walletsWithBorrowedUSDS.at(i);\n\n\t\t\t\t// Determine the minCollateralValue a user needs to have based on their borrowedUSDS\n\t\t\t\tuint256 minCollateralValue = (usdsBorrowedByUsers[wallet] * stableConfig.minimumCollateralRatioPercent()) / 100;\n\n\t\t\t\t// Determine minCollateral in terms of minCollateralValue\n\t\t\t\tuint256 minCollateral = (minCollateralValue * totalCollateralShares) / totalCollateralValue;\n\n\t\t\t\t// Make sure the user has at least minCollateral\n\t\t\t\tif ( userShareForPool( wallet, collateralPoolID ) < minCollateral )\n\t\t\t\t\tliquidatableUsers[count++] = wallet;\n\t\t\t\t}\n", "fixed_code": "file: blob/main/src/dao/Proposals.sol\n\n86 if ( msg.sender != address(exchangeConfig.dao() ) )\n\n98 require( ! _userHasActiveProposal[msg.sender], \"Users can only have one active proposal at a time\" );\n\n124 require( msg.sender == address(exchangeConfig.dao()), \"Only the DAO can create a confirmation proposal\" );\n\n132 require( msg.sender == address(exchangeConfig.dao()), \"Only the DAO can mark a ballot as finalized\" );\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/JCK-G.md", "collected_at": "2026-01-02T19:01:20.143058+00:00", "source_hash": "3f64099654582ba47fa5e5581d83fb1106948572abbf795f08b564b432e6467a", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "file: blob/main/src/stable/CollateralAndLiquidity.sol\n\n321 for ( uint256 i = startIndex; i <= endIndex; i++ )\n\t\t\t\t{\n\t\t\t\taddress wallet = _walletsWithBorrowedUSDS.at(i);\n\n\t\t\t\t// Determine the minCollateralValue a user needs to have based on their borrowedUSDS\n\t\t\t\tuint256 minCollateralValue = (usdsBorrowedByUsers[wallet] * stableConfig.minimumCollateralRatioPercent()) / 100;\n\n\t\t\t\t// Determine minCollateral in terms of minCollateralValue\n\t\t\t\tuint256 minCollateral = (minCollateralValue * totalCollateralShares) / totalCollateralValue;\n\n\t\t\t\t// Make sure the user has at least minCollateral\n\t\t\t\tif ( userShareForPool( wallet, collateralPoolID ) < minCollateral )\n\t\t\t\t\tliquidatableUsers[count++] = wallet;\n\t\t\t\t}\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "file: blob/main/src/dao/Proposals.sol\n\n86 if ( msg.sender != address(exchangeConfig.dao() ) )\n\n98 require( ! _userHasActiveProposal[msg.sender], \"Users can only have one active proposal at a time\" );\n\n124 require( msg.sender == address(exchangeConfig.dao()), \"Only the DAO can create a confirmation proposal\" );\n\n132 require( msg.sender == address(exchangeConfig.dao()), \"Only the DAO can mark a ballot as finalized\" );\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "11-kelp", "title": "Aamir Q", "severity_raw": "Medium", "severity": "medium", "description": "## Summary\n\n| severity | Issues | Instances |\n| -------------- | ----------------------------------------------------------------------------------------------------------------- | --------- |\n| [[L-0](#low0)] | Updating `maxNodeDelegatorCount` less than `nodeDelegatorQueue` should not be allowed. | 1 |\n| [[L-1](#low1)] | `LRTConfig::updateAssetDepositLimit()` should not let asset deposit limit to set below the current deposit amount | 1 |\n\n---\n\n## Low\n\n### [L-0] Updating `maxNodeDelegatorCount` less than `nodeDelegatorQueue` should not be allowed. \n\n`LRTDepositPool::updateMaxNodeDelegatorCount(...)` does not check if the new max value is more than `nodeDelegatorQueue` length or not. If a value less than `nodeDelegatorQueue` length(or we can current number of active delegator) is used to call this function then it will not revert and will set that as `maxNodeDelegatorCount`. Now this will cause DoS in `addNodeDelegatorContractToQueue` due to below condition:\n\n```Javascript\nFile: 2023-11-kelp/src/LRTDepositPool.sol\n\n if (nodeDelegatorQueue.length + length > maxNodeDelegatorCount) {\n revert MaximumNodeDelegatorCountReached();\n }\n```\n\nGithub: [164-166](https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTDepositPool.sol#L164C1-L166C10)\n\nThis condition will always met as the `maxNodeDelegatorCount` will always be less than `nodeDelegatorQueue.length + length`. In order for this to work again, the admin will have to call `LRTDepositPool::updateMaxNodeDelegatorCount(...)` again to update the max count.\n\n#### PoC:\n\nTest that proves that: [Test](https://github.com/Aamirusmani1552/kelp-audit/blob/a5566a18a540eaa34dd1c03e9c9a5c5df62a977e/test/LRTDepositPoolTest.t.sol#L530)\n\n#### Recommendation:\n\nIt is recommended to add the following check", "vulnerable_code": "File: 2023-11-kelp/src/LRTDepositPool.sol\n\n if (nodeDelegatorQueue.length + length > maxNodeDelegatorCount) {\n revert MaximumNodeDelegatorCountReached();\n }", "fixed_code": "---\n\n### [L-1] `LRTConfig::updateAssetDepositLimit(...)` should not let asset deposit limit to set below the current deposit amount \n\n`LRTConfig::updateAssetDepositLimit(...)` does not check if the current asset Deposit limit is less than the current deposits for the asset. Because of this, the new limit will be set below current deposits and it will cause `LRTConfig::getAssetCurrentLimit(...)` to always revert due to underflow.\n\n#### PoC:\n\nHere is a test that proves that: [Test](https://github.com/Aamirusmani1552/kelp-audit/blob/a5566a18a540eaa34dd1c03e9c9a5c5df62a977e/test/LRTDepositPoolTest.t.sol#L228C5-L248C2)\n\n#### Recommendation:\n\nIt is recommended to add the following check\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/Aamir-Q.md", "collected_at": "2026-01-02T18:27:19.604253+00:00", "source_hash": "3f6af30af36743faed6b86516f46ce1187e54a75433ef43bf3e88e47ab7588bf", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 181, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: 2023-11-kelp/src/LRTDepositPool.sol\n\n if (nodeDelegatorQueue.length + length > maxNodeDelegatorCount) {\n revert MaximumNodeDelegatorCountReached();\n }", "primary_code_language": "Javascript", "primary_code_char_count": 181, "all_code_blocks": "// Code block 1 (Javascript):\nFile: 2023-11-kelp/src/LRTDepositPool.sol\n\n if (nodeDelegatorQueue.length + length > maxNodeDelegatorCount) {\n revert MaximumNodeDelegatorCountReached();\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LRTDepositPool.sol#L164-L1, LRTDepositPoolTest.t.sol#L530, LRTDepositPoolTest.t.sol#L228-L5", "github_files_list": "LRTDepositPoolTest.t.sol, LRTDepositPool.sol", "github_refs_count": 3, "vulnerable_code_actual": "File: 2023-11-kelp/src/LRTDepositPool.sol\n\n if (nodeDelegatorQueue.length + length > maxNodeDelegatorCount) {\n revert MaximumNodeDelegatorCountReached();\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "---\n\n### [L-1] `LRTConfig::updateAssetDepositLimit(...)` should not let asset deposit limit to set below the current deposit amount \n\n`LRTConfig::updateAssetDepositLimit(...)` does not check if the current asset Deposit limit is less than the current deposits for the asset. Because of this, the new limit will be set below current deposits and it will cause `LRTConfig::getAssetCurrentLimit(...)` to always revert due to underflow.\n\n#### PoC:\n\nHere is a test that proves that: [Test](https://github.com/Aamirusmani1552/kelp-audit/blob/a5566a18a540eaa34dd1c03e9c9a5c5df62a977e/test/LRTDepositPoolTest.t.sol#L228C5-L248C2)\n\n#### Recommendation:\n\nIt is recommended to add the following check\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "11-kelp", "title": "foxb868 Analysis", "severity_raw": "Critical", "severity": "critical", "description": "## Overview\n\nKelp is a DAO-governed protocol that allows restaking of liquid staked assets like Lido's stETH to further compound yields. The key components are:\n\n- **LRTConfig** - stores protocol configuration and contract addresses\n- **LRTDepositPool** - allows users to deposit assets \n- **NodeDelegator** - delegates assets to strategies\n- **LRTOracle** - provides asset price feeds \n- **RSETH** - receipt token representing deposited assets \n\n**LRTConfig**\n\nThis contract stores critical protocol configuration like supported assets and contract addresses. It is the source of truth for integrations.\n\n**Risks**:\n- The admin can arbitrarily set any contract address, like LRTDepositPool. This could redirect user funds.\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTConfig.sol#L165-L167\n\n```solidity\n function setContract(bytes32 contractKey, address contractAddress) external onlyRole(DEFAULT_ADMIN_ROLE) {\n _setContract(contractKey, contractAddress);\n }\n```\n\n- Assets could be added to the supported list without proper preparations. User funds could become stuck.\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTConfig.sol#L73-L75\n\n```solidity \n function addNewSupportedAsset(address asset, uint256 depositLimit) external onlyRole(LRTConstants.MANAGER) {\n _addNewSupportedAsset(asset, depositLimit);\n }\n```\n\n- No validation that set strategies match expected asset types. Could set a ETH strategy for DAI.\n\n**Mitigations**:\n- Use code hash checks before trusting contractMap addresses.\n- Require assets have a non-zero strategy before accepting deposits.\n- Make config immutable once stable.\n\n**LRTDepositPool**\n\nThis is the user entry point to make deposits. It controls pool balances.\n\n**Risks**:\n- Arbitrary tokens can be transfered to NodeDelegators without input validation.\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e4", "vulnerable_code": " function setContract(bytes32 contractKey, address contractAddress) external onlyRole(DEFAULT_ADMIN_ROLE) {\n _setContract(contractKey, contractAddress);\n }", "fixed_code": " function addNewSupportedAsset(address asset, uint256 depositLimit) external onlyRole(LRTConstants.MANAGER) {\n _addNewSupportedAsset(asset, depositLimit);\n }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/foxb868-Analysis.md", "collected_at": "2026-01-02T18:28:02.342478+00:00", "source_hash": "3f8134be5a1eb008dbb56a239bbf89b6194c8e3ce98dc51445b4aab394cda65e", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 164, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function setContract(bytes32 contractKey, address contractAddress) external onlyRole(DEFAULT_ADMIN_ROLE) {\n _setContract(contractKey, contractAddress);\n }", "primary_code_language": "solidity", "primary_code_char_count": 164, "all_code_blocks": "// Code block 1 (solidity):\nfunction setContract(bytes32 contractKey, address contractAddress) external onlyRole(DEFAULT_ADMIN_ROLE) {\n _setContract(contractKey, contractAddress);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function setContract(bytes32 contractKey, address contractAddress) external onlyRole(DEFAULT_ADMIN_ROLE) {\n _setContract(contractKey, contractAddress);\n }", "github_refs_formatted": "LRTConfig.sol#L165-L167, LRTConfig.sol#L73-L75", "github_files_list": "LRTConfig.sol", "github_refs_count": 2, "vulnerable_code_actual": " function setContract(bytes32 contractKey, address contractAddress) external onlyRole(DEFAULT_ADMIN_ROLE) {\n _setContract(contractKey, contractAddress);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function addNewSupportedAsset(address asset, uint256 depositLimit) external onlyRole(LRTConstants.MANAGER) {\n _addNewSupportedAsset(asset, depositLimit);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-revert-lend", "title": "Giorgio Q", "severity_raw": "Unknown", "severity": "unknown", "description": "## Ineffective deadline on decreaseLiquidity() \n\n##Links\n\nhttps://github.com/code-423n4/2024-03-revert-lend/blob/435b054f9ad2404173f36f0f74a5096c894b12b7/src/V3Vault.sol#L1072-L1076\n\n## Vulnerability details\n\nUsing block.timestamp as the deadline argument when interacting with the Uniswap NFT Position Manager renders the deadline ineffective and defeats its intended purpose.\n\n\n## Impact \n\nTransaction may remain pending in the mempool, transactions can be maliciously executed at a later point, optmizing arbitrage on the MEV side.\n\n## POC\n\n[Here](https://github.com/code-423n4/2024-03-revert-lend/blob/435b054f9ad2404173f36f0f74a5096c894b12b7/src/V3Vault.sol#L1072-L1076)\n\n```solidity\n if (liquidity > 0) {\n nonfungiblePositionManager.decreaseLiquidity(\n INonfungiblePositionManager.DecreaseLiquidityParams(tokenId, liquidity, 0, 0, block.timestamp) \n );\n }\n```\n\nWe can see that block.timestamp is used as an argument, which will result in no deadline for the liquidity \"swap\".\n\n## Mitigation route\n\nConsider adding a parameter for the swap deadline.\n\n## Use answer <= 0 instead answer < 0\n\n## Link\n\nhttps://github.com/code-423n4/2024-03-revert-lend/blob/435b054f9ad2404173f36f0f74a5096c894b12b7/src/V3Oracle.sol#L338\n\n## Description\n\nUnder uncommon circumstances price feeds may return 0 which isn't desirable behavior, so it is best to add checks to avoid such conditions.\n\n## Impact\n\nThe usage of 0 price is devastating to the protocol \n\n## POC\n\n```\n if (updatedAt + feedConfig.maxFeedAge < block.timestamp || answer < 0) {\n```\n\nAs we can see above, if 0 is returned it will be accepted, this is not desirable behavior\n\n## Mitigation route\n\nDo use `answer <= 0` instead", "vulnerable_code": " if (liquidity > 0) {\n nonfungiblePositionManager.decreaseLiquidity(\n INonfungiblePositionManager.DecreaseLiquidityParams(tokenId, liquidity, 0, 0, block.timestamp) \n );\n }", "fixed_code": " if (updatedAt + feedConfig.maxFeedAge < block.timestamp || answer < 0) {", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/Giorgio-Q.md", "collected_at": "2026-01-02T19:02:58.801114+00:00", "source_hash": "3faa364f48a234f35b447bbb2066b7f2e0e739eb4b48998ba17e621c17ec81be", "code_block_count": 2, "solidity_block_count": 1, "total_code_chars": 287, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "if (liquidity > 0) {\n nonfungiblePositionManager.decreaseLiquidity(\n INonfungiblePositionManager.DecreaseLiquidityParams(tokenId, liquidity, 0, 0, block.timestamp) \n );\n }", "primary_code_language": "solidity", "primary_code_char_count": 215, "all_code_blocks": "// Code block 1 (solidity):\nif (liquidity > 0) {\n nonfungiblePositionManager.decreaseLiquidity(\n INonfungiblePositionManager.DecreaseLiquidityParams(tokenId, liquidity, 0, 0, block.timestamp) \n );\n }\n\n// Code block 2 (unknown):\nif (updatedAt + feedConfig.maxFeedAge < block.timestamp || answer < 0) {", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "if (liquidity > 0) {\n nonfungiblePositionManager.decreaseLiquidity(\n INonfungiblePositionManager.DecreaseLiquidityParams(tokenId, liquidity, 0, 0, block.timestamp) \n );\n }", "github_refs_formatted": "V3Vault.sol#L1072-L1076, V3Oracle.sol#L338", "github_files_list": "V3Vault.sol, V3Oracle.sol", "github_refs_count": 2, "vulnerable_code_actual": " if (liquidity > 0) {\n nonfungiblePositionManager.decreaseLiquidity(\n INonfungiblePositionManager.DecreaseLiquidityParams(tokenId, liquidity, 0, 0, block.timestamp) \n );\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " if (updatedAt + feedConfig.maxFeedAge < block.timestamp || answer < 0) {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-ondo", "title": "arialblack14 Q", "severity_raw": "Medium", "severity": "medium", "description": "# QA REPORT\n\n## [L-1] Use of `block.timestamp`\n\n### Description\nBlock timestamps have historically been used for a variety of applications, such as entropy for random numbers (see the *[Entropy Illusion](https://hacken.io/discover/most-common-smart-contract-vulnerabilities/#Entropy_Illusion)* for further details), locking funds for periods of time, and various state-changing conditional statements that are time-dependent. Miners have the ability to adjust timestamps slightly, which can prove to be dangerous if block timestamps are used incorrectly in smart contracts.\n\n### \u2705 Recommendation\nUse oracle instead of `block.timestamp`\n\n#### *Instances(7):*\nFile: [2023-01-ondo/contracts/cash/CashManager.sol](https://github.com/code-423n4/2023-01-ondo/tree/main/contracts/cash/CashManager.sol#L175 )\n```solidity\n175: block.timestamp -\n176: (block.timestamp % epochDuration);\n577: uint256 epochDifference = (block.timestamp - currentEpochStartTimestamp) /\n584: block.timestamp -\n585: (block.timestamp % epochDuration);\n```\nFile: [2023-01-ondo/contracts/cash/kyc/KYCRegistry.sol](https://github.com/code-423n4/2023-01-ondo/tree/main/contracts/cash/kyc/KYCRegistry.sol#L92 )\n```solidity\n92: require(block.timestamp <= deadline, \"KYCRegistry: signature expired\");\n```\nFile: [2023-01-ondo/contracts/lending/OndoPriceOracleV2.sol](https://github.com/code-423n4/2023-01-ondo/tree/main/contracts/lending/OndoPriceOracleV2.sol#L294 )\n```solidity\n294: (updatedAt >= block.timestamp - maxChainlinkOracleTimeDelay),\n```\n\n## [L-2] Use `call()` instead of `transfer()`\n\n### Description\nThe `transfer()` function only allows the recipient to use 2300 gas. If the recipient uses more than that, transfers will fail. In the future gas costs might change increasing the likelihood of that happening.\nKeep in mind that `call()` introduces the risk of reentrancy, but as the code follows the CEI pattern it should be fine.\n\n### \u2705 Recommendation\nReplace `transfer()` calls with `call()`, keep in mind to check whether th", "vulnerable_code": "175: block.timestamp -\n176: (block.timestamp % epochDuration);\n577: uint256 epochDifference = (block.timestamp - currentEpochStartTimestamp) /\n584: block.timestamp -\n585: (block.timestamp % epochDuration);", "fixed_code": "92: require(block.timestamp <= deadline, \"KYCRegistry: signature expired\");", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/arialblack14-Q.md", "collected_at": "2026-01-02T18:14:55.145519+00:00", "source_hash": "3fb352c68bc95353d9545087b3fc2f061e98ea520986c7552118a6e827377769", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 346, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "175: block.timestamp -\n176: (block.timestamp % epochDuration);\n577: uint256 epochDifference = (block.timestamp - currentEpochStartTimestamp) /\n584: block.timestamp -\n585: (block.timestamp % epochDuration);", "primary_code_language": "solidity", "primary_code_char_count": 205, "all_code_blocks": "// Code block 1 (solidity):\n175: block.timestamp -\n176: (block.timestamp % epochDuration);\n577: uint256 epochDifference = (block.timestamp - currentEpochStartTimestamp) /\n584: block.timestamp -\n585: (block.timestamp % epochDuration);\n\n// Code block 2 (solidity):\n92: require(block.timestamp <= deadline, \"KYCRegistry: signature expired\");\n\n// Code block 3 (solidity):\n294: (updatedAt >= block.timestamp - maxChainlinkOracleTimeDelay),", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "175: block.timestamp -\n176: (block.timestamp % epochDuration);\n577: uint256 epochDifference = (block.timestamp - currentEpochStartTimestamp) /\n584: block.timestamp -\n585: (block.timestamp % epochDuration);\n\n92: require(block.timestamp <= deadline, \"KYCRegistry: signature expired\");\n\n294: (updatedAt >= block.timestamp - maxChainlinkOracleTimeDelay),", "github_refs_formatted": "CashManager.sol#L175, KYCRegistry.sol#L92, OndoPriceOracleV2.sol#L294", "github_files_list": "CashManager.sol, OndoPriceOracleV2.sol, KYCRegistry.sol", "github_refs_count": 3, "vulnerable_code_actual": "175: block.timestamp -\n176: (block.timestamp % epochDuration);\n577: uint256 epochDifference = (block.timestamp - currentEpochStartTimestamp) /\n584: block.timestamp -\n585: (block.timestamp % epochDuration);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "92: require(block.timestamp <= deadline, \"KYCRegistry: signature expired\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "01-ondo", "title": "tnevler G", "severity_raw": "Low", "severity": "low", "description": "# Report\n## Gas Optimizations ##\n### [G-1]: The increment in for loop post condition can be made unchecked\n**Context:**\n\n1. ```for (uint256 i = 0; i < exCallData.length; ++i) {``` [L127](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashFactory.sol#L127) \n1. ```for (uint256 i = 0; i < exCallData.length; ++i) {``` [L137](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashKYCSenderFactory.sol#L137) \n1. ```for (uint256 i = 0; i < exCallData.length; ++i) {``` [L137](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashKYCSenderReceiverFactory.sol#L137) \n1. ```for (uint256 i = 0; i < length; i++) {``` [L163](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistry.sol#L163) \n1. ```for (uint256 i = 0; i < length; i++) {``` [L180](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistry.sol#L180) \n1. ```for (uint256 i = 0; i < size; ++i) {``` [L750](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L750) \n1. ```for (uint256 i = 0; i < size; ++i) {``` [L786](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L786) \n1. ```for (uint256 i = 0; i < size; ++i) {``` [L933](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L933) \n1. ```for (uint256 i = 0; i < exCallData.length; ++i) {``` [L961](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L961) \n\n**Description:**\n\n[This](https://gist.github.com/hrkrshnn/ee8fabd532058307229d65dcd5836ddc#the-increment-in-for-loop-post-condition-can-be-made-unchecked) can save 30-40 gas per loop iteration.\n\n**Recommendation:**\n\nExample how to fix. Change:\n```\nfor (uint256 i = 0; i < orders.length; ++i) {\n // Do the thing\n}\n```\n\nTo:\n```\nfor (uint256 i = 0; i < orders.length;) {\n // Do the thing\n unchecked { ++i; }\n}\n```\n\n### [G-2]: Place subtractions where the operands c", "vulnerable_code": "for (uint256 i = 0; i < orders.length; ++i) {\n // Do the thing\n}", "fixed_code": "for (uint256 i = 0; i < orders.length;) {\n // Do the thing\n unchecked { ++i; }\n}", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/tnevler-G.md", "collected_at": "2026-01-02T18:15:36.273567+00:00", "source_hash": "3fc921f521e384881b92a044283a16e381548744578ec8a800066f56a06dac7f", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 150, "github_ref_count": 9, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "for (uint256 i = 0; i < orders.length; ++i) {\n // Do the thing\n}", "primary_code_language": "unknown", "primary_code_char_count": 66, "all_code_blocks": "// Code block 1 (unknown):\nfor (uint256 i = 0; i < orders.length; ++i) {\n // Do the thing\n}\n\n// Code block 2 (unknown):\nfor (uint256 i = 0; i < orders.length;) {\n // Do the thing\n unchecked { ++i; }\n}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CashFactory.sol#L127, CashKYCSenderFactory.sol#L137, CashKYCSenderReceiverFactory.sol#L137, KYCRegistry.sol#L163, KYCRegistry.sol#L180, CashManager.sol#L750, CashManager.sol#L786, CashManager.sol#L933, CashManager.sol#L961", "github_files_list": "CashManager.sol, CashKYCSenderFactory.sol, CashFactory.sol, KYCRegistry.sol, CashKYCSenderReceiverFactory.sol", "github_refs_count": 9, "vulnerable_code_actual": "for (uint256 i = 0; i < orders.length; ++i) {\n // Do the thing\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "for (uint256 i = 0; i < orders.length;) {\n // Do the thing\n unchecked { ++i; }\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "08-dopex", "title": "0xmystery Q", "severity_raw": "High", "severity": "high", "description": "## Unusable native transfer logic in RdpxDecayingBonds.emergencyWithdraw\nThe `RdpxDecayingBonds` contract is not inherently designed to accept native tokens, highlighted by the absence of a `receive` or `fallback` function. This makes the native transfer logic of `emergencyWithdraw` function unusable unless in the rare and unconventional event that another contract sends native tokens to `RdpxDecayingBonds.sol` using the `selfDestruct` method. This would allow native tokens to accrue in a manner that's unexpected and not immediately apparent. The presence of such funds can be perplexing, especially given the contract's design which suggests it shouldn't typically handle native tokens. Fortunately, the embedded `emergencyWithdraw` function can be invoked by administrators to reclaim these inadvertently received tokens, mitigating the risk of irretrievable funds.\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/decaying-bonds/RdpxDecayingBonds.sol#L80-L107\n\n```solidity\n /**\n * @notice Transfers all funds to msg.sender\n * @dev Can only be called by the owner\n * @param tokens The list of erc20 tokens to withdraw\n * @param transferNative Whether should transfer the native currency\n * @param to The address to transfer the funds to\n * @param amount The amount to transfer\n * @param gas The gas to use for the transfer\n **/\n function emergencyWithdraw(\n address[] calldata tokens,\n bool transferNative,\n address payable to,\n uint256 amount,\n uint256 gas\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n _whenPaused();\n if (transferNative) {\n (bool success, ) = to.call{ value: amount, gas: gas }(\"\");\n require(success, \"RdpxReserve: transfer failed\");\n }\n IERC20WithBurn token;\n\n for (uint256 i = 0; i < tokens.length; i++) {\n token = IERC20WithBurn(tokens[i]);\n token.safeTransfer(msg.sender, token.balanceOf(address(this)));\n }\n }\n```\nThe protocol should decide with clarity if the contract sho", "vulnerable_code": " /**\n * @notice Transfers all funds to msg.sender\n * @dev Can only be called by the owner\n * @param tokens The list of erc20 tokens to withdraw\n * @param transferNative Whether should transfer the native currency\n * @param to The address to transfer the funds to\n * @param amount The amount to transfer\n * @param gas The gas to use for the transfer\n **/\n function emergencyWithdraw(\n address[] calldata tokens,\n bool transferNative,\n address payable to,\n uint256 amount,\n uint256 gas\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n _whenPaused();\n if (transferNative) {\n (bool success, ) = to.call{ value: amount, gas: gas }(\"\");\n require(success, \"RdpxReserve: transfer failed\");\n }\n IERC20WithBurn token;\n\n for (uint256 i = 0; i < tokens.length; i++) {\n token = IERC20WithBurn(tokens[i]);\n token.safeTransfer(msg.sender, token.balanceOf(address(this)));\n }\n }", "fixed_code": " /// @notice Precision used for prices, percentages and other calculations\n uint256 public constant DEFAULT_PRECISION = 1e8;\n\n /// @notice rDPX Ratio required when bonding\n uint256 public constant RDPX_RATIO_PERCENTAGE = 25 * DEFAULT_PRECISION;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/0xmystery-Q.md", "collected_at": "2026-01-02T18:24:25.868451+00:00", "source_hash": "3fe33a4c61cb87b42b5286c4c61d352e1451e3ea8736d48d85f9839bd8f9c934", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 936, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "/**\n * @notice Transfers all funds to msg.sender\n * @dev Can only be called by the owner\n * @param tokens The list of erc20 tokens to withdraw\n * @param transferNative Whether should transfer the native currency\n * @param to The address to transfer the funds to\n * @param amount The amount to transfer\n * @param gas The gas to use for the transfer\n **/\n function emergencyWithdraw(\n address[] calldata tokens,\n bool transferNative,\n address payable to,\n uint256 amount,\n uint256 gas\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n _whenPaused();\n if (transferNative) {\n (bool success, ) = to.call{ value: amount, gas: gas }(\"\");\n require(success, \"RdpxReserve: transfer failed\");\n }\n IERC20WithBurn token;\n\n for (uint256 i = 0; i < tokens.length; i++) {\n token = IERC20WithBurn(tokens[i]);\n token.safeTransfer(msg.sender, token.balanceOf(address(this)));\n }\n }", "primary_code_language": "solidity", "primary_code_char_count": 936, "all_code_blocks": "// Code block 1 (solidity):\n/**\n * @notice Transfers all funds to msg.sender\n * @dev Can only be called by the owner\n * @param tokens The list of erc20 tokens to withdraw\n * @param transferNative Whether should transfer the native currency\n * @param to The address to transfer the funds to\n * @param amount The amount to transfer\n * @param gas The gas to use for the transfer\n **/\n function emergencyWithdraw(\n address[] calldata tokens,\n bool transferNative,\n address payable to,\n uint256 amount,\n uint256 gas\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n _whenPaused();\n if (transferNative) {\n (bool success, ) = to.call{ value: amount, gas: gas }(\"\");\n require(success, \"RdpxReserve: transfer failed\");\n }\n IERC20WithBurn token;\n\n for (uint256 i = 0; i < tokens.length; i++) {\n token = IERC20WithBurn(tokens[i]);\n token.safeTransfer(msg.sender, token.balanceOf(address(this)));\n }\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "/**\n * @notice Transfers all funds to msg.sender\n * @dev Can only be called by the owner\n * @param tokens The list of erc20 tokens to withdraw\n * @param transferNative Whether should transfer the native currency\n * @param to The address to transfer the funds to\n * @param amount The amount to transfer\n * @param gas The gas to use for the transfer\n **/\n function emergencyWithdraw(\n address[] calldata tokens,\n bool transferNative,\n address payable to,\n uint256 amount,\n uint256 gas\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n _whenPaused();\n if (transferNative) {\n (bool success, ) = to.call{ value: amount, gas: gas }(\"\");\n require(success, \"RdpxReserve: transfer failed\");\n }\n IERC20WithBurn token;\n\n for (uint256 i = 0; i < tokens.length; i++) {\n token = IERC20WithBurn(tokens[i]);\n token.safeTransfer(msg.sender, token.balanceOf(address(this)));\n }\n }", "github_refs_formatted": "RdpxDecayingBonds.sol#L80-L107", "github_files_list": "RdpxDecayingBonds.sol", "github_refs_count": 1, "vulnerable_code_actual": " /**\n * @notice Transfers all funds to msg.sender\n * @dev Can only be called by the owner\n * @param tokens The list of erc20 tokens to withdraw\n * @param transferNative Whether should transfer the native currency\n * @param to The address to transfer the funds to\n * @param amount The amount to transfer\n * @param gas The gas to use for the transfer\n **/\n function emergencyWithdraw(\n address[] calldata tokens,\n bool transferNative,\n address payable to,\n uint256 amount,\n uint256 gas\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n _whenPaused();\n if (transferNative) {\n (bool success, ) = to.call{ value: amount, gas: gas }(\"\");\n require(success, \"RdpxReserve: transfer failed\");\n }\n IERC20WithBurn token;\n\n for (uint256 i = 0; i < tokens.length; i++) {\n token = IERC20WithBurn(tokens[i]);\n token.safeTransfer(msg.sender, token.balanceOf(address(this)));\n }\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " /// @notice Precision used for prices, percentages and other calculations\n uint256 public constant DEFAULT_PRECISION = 1e8;\n\n /// @notice rDPX Ratio required when bonding\n uint256 public constant RDPX_RATIO_PERCENTAGE = 25 * DEFAULT_PRECISION;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-biconomy", "title": "tsvetanovv Q", "severity_raw": "Medium", "severity": "medium", "description": "## [QA-01] Use latest Solidity version\n\nSolidity pragma versioning should be upgraded to latest available version. Currently the solidity version in contracts is 0.8.12 which was found to possess some bugs.\n\n***\n\n## [QA-02] Use stable pragma statement\n\nUsing a floating pragma `^0.8.12` statement is discouraged as code can compile to different bytecodes with different compiler versions. Use a stable pragma statement to get a deterministic bytecode.\n\n***\n\n## [QA-03] USE NAMED IMPORTS INSTEAD OF PLAIN `IMPORT \u2018FILE.SOL\u2019\n\n`BaseSmartAccount.sol`:\n\n```\nimport \"@account-abstraction/contracts/interfaces/IAccount.sol\";\nimport \"@account-abstraction/contracts/interfaces/IEntryPoint.sol\";\nimport \"./common/Enum.sol\";\n```\n`SmartAccount.sol`:\n\n```\nimport \"./libs/LibAddress.sol\";\nimport \"./BaseSmartAccount.sol\";\nimport \"./common/Singleton.sol\";\nimport \"./base/ModuleManager.sol\";\nimport \"./base/FallbackManager.sol\";\nimport \"./common/SignatureDecoder.sol\";\nimport \"./common/SecuredTokenTransfer.sol\";\nimport \"./interfaces/ISignatureValidator.sol\";\nimport \"./interfaces/IERC165.sol\";\n\n```\n`EntryPoint.sol`:\n\n```\nimport \"../interfaces/IAccount.sol\";\nimport \"../interfaces/IPaymaster.sol\";\nimport \"../interfaces/IAggregatedAccount.sol\";\nimport \"../interfaces/IEntryPoint.sol\";\nimport \"../utils/Exec.sol\";\nimport \"./StakeManager.sol\";\nimport \"./SenderCreator.sol\";\n```\n\n`StakeManager.sol`:\n```\nimport \"../interfaces/IStakeManager.sol\";\n```\n`Executor.sol`:\n```\nimport \"../common/Enum.sol\";\n```\n`FallbackManager.sol`:\n```\nimport \"../common/SelfAuthorized.sol\";\n```\n`ModuleManager.sol `:\n```\nimport \"../common/Enum.sol\";\nimport \"../common/SelfAuthorized.sol\";\nimport \"./Executor.sol\";\n```\n`DefaultCallbackHandler.sol`:\n```\nimport \"../interfaces/ERC1155TokenReceiver.sol\";\nimport \"../interfaces/ERC721TokenReceiver.sol\";\nimport \"../interfaces/ERC777TokensRecipient.sol\";\nimport \"../interfaces/IERC165.sol\";\n```\n`VerifyingSingletonPaymaster.sol`:\n```\nimport \"../../BasePaymaster.sol\";\nimport \"../../PaymasterHelpe", "vulnerable_code": "import \"@account-abstraction/contracts/interfaces/IAccount.sol\";\nimport \"@account-abstraction/contracts/interfaces/IEntryPoint.sol\";\nimport \"./common/Enum.sol\";", "fixed_code": "import \"./libs/LibAddress.sol\";\nimport \"./BaseSmartAccount.sol\";\nimport \"./common/Singleton.sol\";\nimport \"./base/ModuleManager.sol\";\nimport \"./base/FallbackManager.sol\";\nimport \"./common/SignatureDecoder.sol\";\nimport \"./common/SecuredTokenTransfer.sol\";\nimport \"./interfaces/ISignatureValidator.sol\";\nimport \"./interfaces/IERC165.sol\";\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/tsvetanovv-Q.md", "collected_at": "2026-01-02T18:14:14.564906+00:00", "source_hash": "3fed306ee19118bbdc2ee17c23e8d51b01e4d2453ec6a06f63663f17c3ebad6d", "code_block_count": 8, "solidity_block_count": 0, "total_code_chars": 1125, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "import \"@account-abstraction/contracts/interfaces/IAccount.sol\";\nimport \"@account-abstraction/contracts/interfaces/IEntryPoint.sol\";\nimport \"./common/Enum.sol\";", "primary_code_language": "unknown", "primary_code_char_count": 160, "all_code_blocks": "// Code block 1 (unknown):\nimport \"@account-abstraction/contracts/interfaces/IAccount.sol\";\nimport \"@account-abstraction/contracts/interfaces/IEntryPoint.sol\";\nimport \"./common/Enum.sol\";\n\n// Code block 2 (unknown):\nimport \"./libs/LibAddress.sol\";\nimport \"./BaseSmartAccount.sol\";\nimport \"./common/Singleton.sol\";\nimport \"./base/ModuleManager.sol\";\nimport \"./base/FallbackManager.sol\";\nimport \"./common/SignatureDecoder.sol\";\nimport \"./common/SecuredTokenTransfer.sol\";\nimport \"./interfaces/ISignatureValidator.sol\";\nimport \"./interfaces/IERC165.sol\";\n\n// Code block 3 (unknown):\nimport \"../interfaces/IAccount.sol\";\nimport \"../interfaces/IPaymaster.sol\";\nimport \"../interfaces/IAggregatedAccount.sol\";\nimport \"../interfaces/IEntryPoint.sol\";\nimport \"../utils/Exec.sol\";\nimport \"./StakeManager.sol\";\nimport \"./SenderCreator.sol\";\n\n// Code block 4 (unknown):\nimport \"../interfaces/IStakeManager.sol\";\n\n// Code block 5 (unknown):\nimport \"../common/Enum.sol\";\n\n// Code block 6 (unknown):\nimport \"../common/SelfAuthorized.sol\";\n\n// Code block 7 (unknown):\nimport \"../common/Enum.sol\";\nimport \"../common/SelfAuthorized.sol\";\nimport \"./Executor.sol\";\n\n// Code block 8 (unknown):\nimport \"../interfaces/ERC1155TokenReceiver.sol\";\nimport \"../interfaces/ERC721TokenReceiver.sol\";\nimport \"../interfaces/ERC777TokensRecipient.sol\";\nimport \"../interfaces/IERC165.sol\";", "all_code_blocks_count": 8, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "import \"@account-abstraction/contracts/interfaces/IAccount.sol\";\nimport \"@account-abstraction/contracts/interfaces/IEntryPoint.sol\";\nimport \"./common/Enum.sol\";", "has_vulnerable_code_snippet": true, "fixed_code_actual": "import \"./libs/LibAddress.sol\";\nimport \"./BaseSmartAccount.sol\";\nimport \"./common/Singleton.sol\";\nimport \"./base/ModuleManager.sol\";\nimport \"./base/FallbackManager.sol\";\nimport \"./common/SignatureDecoder.sol\";\nimport \"./common/SecuredTokenTransfer.sol\";\nimport \"./interfaces/ISignatureValidator.sol\";\nimport \"./interfaces/IERC165.sol\";\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 13} {"source": "c4", "protocol": "02-ethos", "title": "LethL G", "severity_raw": "Medium", "severity": "medium", "description": "## Findings Summary\n\n| | Issue | Instances |\n|---|---|---|\n| Gas-1 | ` += ` costs more gas than ` = + ` for state variables | 9 |\n| Gas-2 | Use of Named Returns for Local Variables Saves Gas | 35 |\n| Gas-3 | Using a ternary operator instead of an \"if-else\" statement | 5 |\n| Gas-4 | Expressions for constant values such as a call to `keccak256()`, should use immutable rather than constant | 8 |\n| Gas-5 | Pre-calculate the hardcoded hash with `keccak256()` before and only use the result to save gas | 10 |\n| Gas-6 | Using require instead of assert | 20 |\n\n### [Gas-1] ` += ` costs more gas than ` = + ` for state variables\n\nUsing `x = x+y` instead of `x += y` can help to save gas.\nSimilarly, using ` -= ` costs more gas than ` = - `.\n\nInstances(9):\n\n```\nFile: Ethos-Vault/contracts/ReaperVaultV2.sol\n\n168: totalAllocBPS += _allocBPS;\n\n194: totalAllocBPS -= strategies[_strategy].allocBPS;\n\n196: totalAllocBPS += _allocBPS;\n\n214: totalAllocBPS -= strategies[_strategy].allocBPS;\n\n396: totalAllocated -= actualWithdrawn;\n\n445: totalAllocBPS -= bpsChange;\n\n452: totalAllocated -= loss;\n\n515: totalAllocated -= vars.debtPayment;\n\n521: totalAllocated += vars.credit;\n```\n[Link to Code](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol)\n\n### [Gas-2] Use of Named Returns for Local Variables Saves Gas\n\nUsing named return values as temporary local variables can help you conserve gas.\n\nFor example, the following code block can be refactored as follows:\n```\nFile: Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol\n\n230: function balanceOfPool() public view returns (uint256 supply) {\n231: (supply, , , , , , , , ) = IAaveProtocolDataProvider(DATA_PROVIDER).getUserReserveData(\n232: address(want),\n233: address(this)\n234: );\n235: }\n```\n[Link to Code](https://github.com/code-423n4/", "vulnerable_code": "File: Ethos-Vault/contracts/ReaperVaultV2.sol\n\n168: totalAllocBPS += _allocBPS;\n\n194: totalAllocBPS -= strategies[_strategy].allocBPS;\n\n196: totalAllocBPS += _allocBPS;\n\n214: totalAllocBPS -= strategies[_strategy].allocBPS;\n\n396: totalAllocated -= actualWithdrawn;\n\n445: totalAllocBPS -= bpsChange;\n\n452: totalAllocated -= loss;\n\n515: totalAllocated -= vars.debtPayment;\n\n521: totalAllocated += vars.credit;", "fixed_code": "File: Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol\n\n230: function balanceOfPool() public view returns (uint256 supply) {\n231: (supply, , , , , , , , ) = IAaveProtocolDataProvider(DATA_PROVIDER).getUserReserveData(\n232: address(want),\n233: address(this)\n234: );\n235: }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/LethL-G.md", "collected_at": "2026-01-02T18:16:19.348395+00:00", "source_hash": "405b892bb2d80cee3524c8755a4499f10a2ea1c4c396069153a64c05cbaf7491", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 808, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: Ethos-Vault/contracts/ReaperVaultV2.sol\n\n168: totalAllocBPS += _allocBPS;\n\n194: totalAllocBPS -= strategies[_strategy].allocBPS;\n\n196: totalAllocBPS += _allocBPS;\n\n214: totalAllocBPS -= strategies[_strategy].allocBPS;\n\n396: totalAllocated -= actualWithdrawn;\n\n445: totalAllocBPS -= bpsChange;\n\n452: totalAllocated -= loss;\n\n515: totalAllocated -= vars.debtPayment;\n\n521: totalAllocated += vars.credit;", "primary_code_language": "unknown", "primary_code_char_count": 494, "all_code_blocks": "// Code block 1 (unknown):\nFile: Ethos-Vault/contracts/ReaperVaultV2.sol\n\n168: totalAllocBPS += _allocBPS;\n\n194: totalAllocBPS -= strategies[_strategy].allocBPS;\n\n196: totalAllocBPS += _allocBPS;\n\n214: totalAllocBPS -= strategies[_strategy].allocBPS;\n\n396: totalAllocated -= actualWithdrawn;\n\n445: totalAllocBPS -= bpsChange;\n\n452: totalAllocated -= loss;\n\n515: totalAllocated -= vars.debtPayment;\n\n521: totalAllocated += vars.credit;\n\n// Code block 2 (unknown):\nFile: Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol\n\n230: function balanceOfPool() public view returns (uint256 supply) {\n231: (supply, , , , , , , , ) = IAaveProtocolDataProvider(DATA_PROVIDER).getUserReserveData(\n232: address(want),\n233: address(this)\n234: );\n235: }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ReaperVaultV2.sol", "github_files_list": "ReaperVaultV2.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: Ethos-Vault/contracts/ReaperVaultV2.sol\n\n168: totalAllocBPS += _allocBPS;\n\n194: totalAllocBPS -= strategies[_strategy].allocBPS;\n\n196: totalAllocBPS += _allocBPS;\n\n214: totalAllocBPS -= strategies[_strategy].allocBPS;\n\n396: totalAllocated -= actualWithdrawn;\n\n445: totalAllocBPS -= bpsChange;\n\n452: totalAllocated -= loss;\n\n515: totalAllocated -= vars.debtPayment;\n\n521: totalAllocated += vars.credit;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol\n\n230: function balanceOfPool() public view returns (uint256 supply) {\n231: (supply, , , , , , , , ) = IAaveProtocolDataProvider(DATA_PROVIDER).getUserReserveData(\n232: address(want),\n233: address(this)\n234: );\n235: }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-salty", "title": "Jean_Pierre_Polnaref G", "severity_raw": "High", "severity": "high", "description": "# c4udit Report\n\n## Files analyzed\n- 2024-01-salty/src/AccessManager.sol\n- 2024-01-salty/src/ExchangeConfig.sol\n- 2024-01-salty/src/ManagedWallet.sol\n- 2024-01-salty/src/Salt.sol\n- 2024-01-salty/src/SigningTools.sol\n- 2024-01-salty/src/Upkeep.sol\n- 2024-01-salty/src/arbitrage/ArbitrageSearch.sol\n- 2024-01-salty/src/dao/DAO.sol\n- 2024-01-salty/src/dao/DAOConfig.sol\n- 2024-01-salty/src/dao/Parameters.sol\n- 2024-01-salty/src/dao/Proposals.sol\n- 2024-01-salty/src/dao/interfaces/ICalledContract.sol\n- 2024-01-salty/src/dao/interfaces/IDAO.sol\n- 2024-01-salty/src/dao/interfaces/IDAOConfig.sol\n- 2024-01-salty/src/dao/interfaces/IProposals.sol\n- 2024-01-salty/src/interfaces/IAccessManager.sol\n- 2024-01-salty/src/interfaces/IExchangeConfig.sol\n- 2024-01-salty/src/interfaces/IManagedWallet.sol\n- 2024-01-salty/src/interfaces/ISalt.sol\n- 2024-01-salty/src/interfaces/IUpkeep.sol\n- 2024-01-salty/src/launch/Airdrop.sol\n- 2024-01-salty/src/launch/BootstrapBallot.sol\n- 2024-01-salty/src/launch/InitialDistribution.sol\n- 2024-01-salty/src/launch/interfaces/IAirdrop.sol\n- 2024-01-salty/src/launch/interfaces/IBootstrapBallot.sol\n- 2024-01-salty/src/launch/interfaces/IInitialDistribution.sol\n- 2024-01-salty/src/pools/PoolMath.sol\n- 2024-01-salty/src/pools/PoolStats.sol\n- 2024-01-salty/src/pools/PoolUtils.sol\n- 2024-01-salty/src/pools/Pools.sol\n- 2024-01-salty/src/pools/PoolsConfig.sol\n- 2024-01-salty/src/pools/interfaces/IPoolStats.sol\n- 2024-01-salty/src/pools/interfaces/IPools.sol\n- 2024-01-salty/src/pools/interfaces/IPoolsConfig.sol\n- 2024-01-salty/src/price_feed/CoreChainlinkFeed.sol\n- 2024-01-salty/src/price_feed/CoreSaltyFeed.sol\n- 2024-01-salty/src/price_feed/CoreUniswapFeed.sol\n- 2024-01-salty/src/price_feed/PriceAggregator.sol\n- 2024-01-salty/src/price_feed/interfaces/IPriceAggregator.sol\n- 2024-01-salty/src/price_feed/interfaces/IPriceFeed.sol\n- 2024-01-salty/src/rewards/Emissions.sol\n- 2024-01-salty/src/rewards/RewardsConfig.sol\n- 2024-01-salty/src/rewards/RewardsEmitter.sol\n- ", "vulnerable_code": "2024-01-salty/src/arbitrage/ArbitrageSearch.sol::115 => for( uint256 i = 0; i < 8; i++ )\n2024-01-salty/src/dao/Proposals.sol::421 => uint256 bestID = 0;\n2024-01-salty/src/dao/Proposals.sol::422 => uint256 mostYes = 0;\n2024-01-salty/src/dao/Proposals.sol::423 => for( uint256 i = 0; i < _openBallotsForTokenWhitelisting.length(); i++ )\n2024-01-salty/src/pools/PoolMath.sol::156 => uint256 shift = 0;\n2024-01-salty/src/pools/PoolStats.sol::53 => for( uint256 i = 0; i < poolIDs.length; i++ )\n2024-01-salty/src/pools/PoolStats.sol::65 => for( uint256 i = 0; i < poolIDs.length; i++ )\n2024-01-salty/src/pools/PoolStats.sol::81 => for( uint256 i = 0; i < poolIDs.length; i++ )\n2024-01-salty/src/pools/PoolStats.sol::106 => for( uint256 i = 0; i < poolIDs.length; i++ )\n2024-01-salty/src/price_feed/CoreUniswapFeed.sol::82 => uint256 twap = 0;\n2024-01-salty/src/rewards/RewardsEmitter.sol::59 => uint256 sum = 0;\n2024-01-salty/src/rewards/RewardsEmitter.sol::60 => for( uint256 i = 0; i < addedRewards.length; i++ )\n2024-01-salty/src/rewards/RewardsEmitter.sol::115 => uint256 sum = 0;\n2024-01-salty/src/rewards/RewardsEmitter.sol::116 => for( uint256 i = 0; i < poolIDs.length; i++ )\n2024-01-salty/src/rewards/RewardsEmitter.sol::146 => for( uint256 i = 0; i < rewards.length; i++ )\n2024-01-salty/src/rewards/SaltRewards.sol::64 => for( uint256 i = 0; i < addedRewards.length; i++ )\n2024-01-salty/src/rewards/SaltRewards.sol::87 => for( uint256 i = 0; i < addedRewards.length; i++ )\n2024-01-salty/src/rewards/SaltRewards.sol::128 => uint256 totalProfits = 0;\n2024-01-salty/src/rewards/SaltRewards.sol::129 => for( uint256 i = 0; i < poolIDs.length; i++ )\n2024-01-salty/src/stable/CollateralAndLiquidity.sol::314 => uint256 count = 0;\n2024-01-salty/src/stable/CollateralAndLiquidity.sol::338 => for ( uint256 i = 0; i < count; i++ )\n2024-01-salty/src/staking/StakingRewards.sol::128 => uint256 claimableRewards = 0;\n2024-01-salty/src/staking/StakingRewards.sol::152 => for( uint256 i = 0; i < poolIDs.lengt", "fixed_code": "2024-01-salty/src/SigningTools.sol::13 => require( signature.length == 65, \"Invalid signature length\" );\n2024-01-salty/src/dao/Proposals.sol::167 => require( _openBallotsForTokenWhitelisting.length() < daoConfig.maxPendingTokensForWhitelisting(), \"The maximum number of token whitelisting proposals are already pending\" );\n2024-01-salty/src/dao/Proposals.sol::224 => require( bytes(country).length == 2, \"Country must be an ISO 3166 Alpha-2 Code\" );\n2024-01-salty/src/dao/Proposals.sol::233 => require( bytes(country).length == 2, \"Country must be an ISO 3166 Alpha-2 Code\" );\n2024-01-salty/src/dao/Proposals.sol::423 => for( uint256 i = 0; i < _openBallotsForTokenWhitelisting.length(); i++ )\n2024-01-salty/src/launch/Airdrop.sol::99 => return _authorizedUsers.length();\n2024-01-salty/src/pools/PoolStats.sol::53 => for( uint256 i = 0; i < poolIDs.length; i++ )\n2024-01-salty/src/pools/PoolStats.sol::65 => for( uint256 i = 0; i < poolIDs.length; i++ )\n2024-01-salty/src/pools/PoolStats.sol::81 => for( uint256 i = 0; i < poolIDs.length; i++ )\n2024-01-salty/src/pools/PoolStats.sol::106 => for( uint256 i = 0; i < poolIDs.length; i++ )\n2024-01-salty/src/pools/PoolStats.sol::138 => _calculatedProfits = new uint256[](poolIDs.length);\n2024-01-salty/src/pools/PoolsConfig.sol::47 => require( _whitelist.length() < maximumWhitelistedPools, \"Maximum number of whitelisted pools already reached\" );\n2024-01-salty/src/pools/PoolsConfig.sol::115 => return _whitelist.length();\n2024-01-salty/src/rewards/RewardsEmitter.sol::60 => for( uint256 i = 0; i < addedRewards.length; i++ )\n2024-01-salty/src/rewards/RewardsEmitter.sol::109 => AddedReward[] memory addedRewards = new AddedReward[]( poolIDs.length );\n2024-01-salty/src/rewards/RewardsEmitter.sol::116 => for( uint256 i = 0; i < poolIDs.length; i++ )\n2024-01-salty/src/rewards/RewardsEmitter.sol::144 => uint256[] memory rewards = new uint256[]( pools.length );\n2024-01-salty/src/rewards/RewardsEmitter.sol::146 => for( uint256 i = 0; i < rewards.lengt", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/Jean_Pierre_Polnaref-G.md", "collected_at": "2026-01-02T19:01:21.027507+00:00", "source_hash": "40c765f877ff1efd6bc1384bb145fbdc595d4dc8b47f1d22a1ff2ccdbe21949e", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "2024-01-salty/src/arbitrage/ArbitrageSearch.sol::115 => for( uint256 i = 0; i < 8; i++ )\n2024-01-salty/src/dao/Proposals.sol::421 => uint256 bestID = 0;\n2024-01-salty/src/dao/Proposals.sol::422 => uint256 mostYes = 0;\n2024-01-salty/src/dao/Proposals.sol::423 => for( uint256 i = 0; i < _openBallotsForTokenWhitelisting.length(); i++ )\n2024-01-salty/src/pools/PoolMath.sol::156 => uint256 shift = 0;\n2024-01-salty/src/pools/PoolStats.sol::53 => for( uint256 i = 0; i < poolIDs.length; i++ )\n2024-01-salty/src/pools/PoolStats.sol::65 => for( uint256 i = 0; i < poolIDs.length; i++ )\n2024-01-salty/src/pools/PoolStats.sol::81 => for( uint256 i = 0; i < poolIDs.length; i++ )\n2024-01-salty/src/pools/PoolStats.sol::106 => for( uint256 i = 0; i < poolIDs.length; i++ )\n2024-01-salty/src/price_feed/CoreUniswapFeed.sol::82 => uint256 twap = 0;\n2024-01-salty/src/rewards/RewardsEmitter.sol::59 => uint256 sum = 0;\n2024-01-salty/src/rewards/RewardsEmitter.sol::60 => for( uint256 i = 0; i < addedRewards.length; i++ )\n2024-01-salty/src/rewards/RewardsEmitter.sol::115 => uint256 sum = 0;\n2024-01-salty/src/rewards/RewardsEmitter.sol::116 => for( uint256 i = 0; i < poolIDs.length; i++ )\n2024-01-salty/src/rewards/RewardsEmitter.sol::146 => for( uint256 i = 0; i < rewards.length; i++ )\n2024-01-salty/src/rewards/SaltRewards.sol::64 => for( uint256 i = 0; i < addedRewards.length; i++ )\n2024-01-salty/src/rewards/SaltRewards.sol::87 => for( uint256 i = 0; i < addedRewards.length; i++ )\n2024-01-salty/src/rewards/SaltRewards.sol::128 => uint256 totalProfits = 0;\n2024-01-salty/src/rewards/SaltRewards.sol::129 => for( uint256 i = 0; i < poolIDs.length; i++ )\n2024-01-salty/src/stable/CollateralAndLiquidity.sol::314 => uint256 count = 0;\n2024-01-salty/src/stable/CollateralAndLiquidity.sol::338 => for ( uint256 i = 0; i < count; i++ )\n2024-01-salty/src/staking/StakingRewards.sol::128 => uint256 claimableRewards = 0;\n2024-01-salty/src/staking/StakingRewards.sol::152 => for( uint256 i = 0; i < poolIDs.lengt", "has_vulnerable_code_snippet": true, "fixed_code_actual": "2024-01-salty/src/SigningTools.sol::13 => require( signature.length == 65, \"Invalid signature length\" );\n2024-01-salty/src/dao/Proposals.sol::167 => require( _openBallotsForTokenWhitelisting.length() < daoConfig.maxPendingTokensForWhitelisting(), \"The maximum number of token whitelisting proposals are already pending\" );\n2024-01-salty/src/dao/Proposals.sol::224 => require( bytes(country).length == 2, \"Country must be an ISO 3166 Alpha-2 Code\" );\n2024-01-salty/src/dao/Proposals.sol::233 => require( bytes(country).length == 2, \"Country must be an ISO 3166 Alpha-2 Code\" );\n2024-01-salty/src/dao/Proposals.sol::423 => for( uint256 i = 0; i < _openBallotsForTokenWhitelisting.length(); i++ )\n2024-01-salty/src/launch/Airdrop.sol::99 => return _authorizedUsers.length();\n2024-01-salty/src/pools/PoolStats.sol::53 => for( uint256 i = 0; i < poolIDs.length; i++ )\n2024-01-salty/src/pools/PoolStats.sol::65 => for( uint256 i = 0; i < poolIDs.length; i++ )\n2024-01-salty/src/pools/PoolStats.sol::81 => for( uint256 i = 0; i < poolIDs.length; i++ )\n2024-01-salty/src/pools/PoolStats.sol::106 => for( uint256 i = 0; i < poolIDs.length; i++ )\n2024-01-salty/src/pools/PoolStats.sol::138 => _calculatedProfits = new uint256[](poolIDs.length);\n2024-01-salty/src/pools/PoolsConfig.sol::47 => require( _whitelist.length() < maximumWhitelistedPools, \"Maximum number of whitelisted pools already reached\" );\n2024-01-salty/src/pools/PoolsConfig.sol::115 => return _whitelist.length();\n2024-01-salty/src/rewards/RewardsEmitter.sol::60 => for( uint256 i = 0; i < addedRewards.length; i++ )\n2024-01-salty/src/rewards/RewardsEmitter.sol::109 => AddedReward[] memory addedRewards = new AddedReward[]( poolIDs.length );\n2024-01-salty/src/rewards/RewardsEmitter.sol::116 => for( uint256 i = 0; i < poolIDs.length; i++ )\n2024-01-salty/src/rewards/RewardsEmitter.sol::144 => uint256[] memory rewards = new uint256[]( pools.length );\n2024-01-salty/src/rewards/RewardsEmitter.sol::146 => for( uint256 i = 0; i < rewards.lengt", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "11-kelp", "title": "desaperh Q", "severity_raw": "Critical", "severity": "critical", "description": "\nAudit report markdown format\n============================\n\n# Report\nAudit report for REPO_GITHUB generated by *Dowsers*
\n\n## Summary\n\n### Low issues\nTotal **32 instances** over **3 issues**
\n \n\n|ID|Issue|Instances|\n| :---: | :---: | :---: |\n|SWC-107|Reentrancy|13|\n|SWC-120|Weak sources of randomness from chain attributes|18|\n|SWC-127|Arbitrary jump with function type variable|1|\n\n### Non-Critical/Quality issues\nTotal **214 instances** over **4 issues**
\n \n\n|ID|Issue|Instances|\n| :---: | :---: | :---: |\n|SWC-XX1|Insufficient coverage|80|\n|SWC-111|Use of deprecated functions, aliases and keywords|48|\n|SWC-XX2|Incorrect comparison implementation|80|\n|SWC-110|*require()* should be used instead of *assert()*|6|\n\n## Low issues\n\n### [SWC-107] Reentrancy\n**Description:**
\nReduce the attack surface for malicious contracts trying to hijack control flow after an external call.
\nhttps://swcregistry.io/docs/SWC-107
\nhttps://fravoll.github.io/solidity-patterns/checks_effects_interactions.html\n
**Recommendation:**
\nThe pattern of Checks Effects Interactions should be **checked and analysed** in order to prevent re-entrancy attacks.
\n

\n*There are 13 instances of this issue:*\n
see instances\n\n```solidity\nFile: /packages/contracts/contracts/BorrowerOperations.sol\nrange(211, 225): withdraws `_stEthBalanceDecrease` amount of collateral from the specified Cdp\n /// @dev If caller is different from Cdp owner, it will need approval from Cdp owner for this call\n /// @notice Successful execution is conditional on whether the withdrawal would bring down the ICR or TCR to the minimum requirement, e.g., MCR or CCR\n /// @param _cdpId The CdpId on which this operation is operated\n /// @param _stEthBalanceDecrease The total stETH collateral amount withdrawn (reduced) for the specified Cdp\n /// @param _upperHint The expected CdpId of neighboring higher ICR within SortedCdps, could be simply bytes32(0)\n /// @param _l", "vulnerable_code": "File: /packages/contracts/contracts/BorrowerOperations.sol\nrange(211, 225): withdraws `_stEthBalanceDecrease` amount of collateral from the specified Cdp\n /// @dev If caller is different from Cdp owner, it will need approval from Cdp owner for this call\n /// @notice Successful execution is conditional on whether the withdrawal would bring down the ICR or TCR to the minimum requirement, e.g., MCR or CCR\n /// @param _cdpId The CdpId on which this operation is operated\n /// @param _stEthBalanceDecrease The total stETH collateral amount withdrawn (reduced) for the specified Cdp\n /// @param _upperHint The expected CdpId of neighboring higher ICR within SortedCdps, could be simply bytes32(0)\n /// @param _lowerHint The expected CdpId of neighboring lower ICR within SortedCdps, could be simply bytes32(0)\n function withdrawColl(\n bytes32 _cdpId,\n uint256 _stEthBalanceDecrease,\n bytes32 _upperHint,\n bytes32 _lowerHint\n ) external override nonReentrantSelfAndCdpM {\n _adjustCdpInternal(_cdpId, _stEthBalanceDecrease, 0, false, _upperHint, _lowerHint, 0);\nrange(227, 241): withdraws `_debt` amount of eBTC token from the specified Cdp, thus increasing its debt accounting\n /// @dev If caller is different from Cdp owner, it will need approval from Cdp owner for this call\n /// @notice Successful execution is conditional on whether the withdrawal would bring down the ICR or TCR to the minimum requirement, e.g., MCR or CCR\n /// @param _cdpId The CdpId on which this operation is operated\n /// @param _debt The total debt collateral amount increased for the specified Cdp\n /// @param _upperHint The expected CdpId of neighboring higher ICR within SortedCdps, could be simply bytes32(0)\n /// @param _lowerHint The expected CdpId of neighboring lower ICR within SortedCdps, could be simply bytes32(0)\n function withdrawDebt(\n bytes32 _cdpId,\n uint256 _debt,\n bytes32 _upperHint,\n bytes32 _low", "fixed_code": "File: /packages/contracts/contracts/Interfaces/IBorrowerOperations.sol\nrange(41, 86): withdrawColl(\n bytes32 _cdpId,\n uint256 _stEthBalanceDecrease,\n bytes32 _upperHint,\n bytes32 _lowerHint\n ) external;\n\n function withdrawDebt(\n bytes32 _cdpId,\n uint256 _amount,\n bytes32 _upperHint,\n bytes32 _lowerHint\n ) external;\n\n function repayDebt(\n bytes32 _cdpId,\n uint256 _amount,\n bytes32 _upperHint,\n bytes32 _lowerHint\n ) external;\n\n function closeCdp(bytes32 _cdpId) external;\n\n function adjustCdp(\n bytes32 _cdpId,\n uint256 _stEthBalanceDecrease,\n uint256 _debtChange,\n bool isDebtIncrease,\n bytes32 _upperHint,\n bytes32 _lowerHint\n ) external;\n\n function adjustCdpWithColl(\n bytes32 _cdpId,\n uint256 _stEthBalanceDecrease,\n uint256 _debtChange,\n bool isDebtIncrease,\n bytes32 _upperHint,\n bytes32 _lowerHint,\n uint256 _stEthBalanceIncrease\n ) external;\n\n function claimSurplusCollShares() external;\n\n function feeRecipientAddress() external view returns (address);\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/desaperh-Q.md", "collected_at": "2026-01-02T18:27:58.744996+00:00", "source_hash": "41374db5e861a6269135b71c21091cbe00fa7c0f40e139b3fe102789c8abd7b7", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: /packages/contracts/contracts/BorrowerOperations.sol\nrange(211, 225): withdraws `_stEthBalanceDecrease` amount of collateral from the specified Cdp\n /// @dev If caller is different from Cdp owner, it will need approval from Cdp owner for this call\n /// @notice Successful execution is conditional on whether the withdrawal would bring down the ICR or TCR to the minimum requirement, e.g., MCR or CCR\n /// @param _cdpId The CdpId on which this operation is operated\n /// @param _stEthBalanceDecrease The total stETH collateral amount withdrawn (reduced) for the specified Cdp\n /// @param _upperHint The expected CdpId of neighboring higher ICR within SortedCdps, could be simply bytes32(0)\n /// @param _lowerHint The expected CdpId of neighboring lower ICR within SortedCdps, could be simply bytes32(0)\n function withdrawColl(\n bytes32 _cdpId,\n uint256 _stEthBalanceDecrease,\n bytes32 _upperHint,\n bytes32 _lowerHint\n ) external override nonReentrantSelfAndCdpM {\n _adjustCdpInternal(_cdpId, _stEthBalanceDecrease, 0, false, _upperHint, _lowerHint, 0);\nrange(227, 241): withdraws `_debt` amount of eBTC token from the specified Cdp, thus increasing its debt accounting\n /// @dev If caller is different from Cdp owner, it will need approval from Cdp owner for this call\n /// @notice Successful execution is conditional on whether the withdrawal would bring down the ICR or TCR to the minimum requirement, e.g., MCR or CCR\n /// @param _cdpId The CdpId on which this operation is operated\n /// @param _debt The total debt collateral amount increased for the specified Cdp\n /// @param _upperHint The expected CdpId of neighboring higher ICR within SortedCdps, could be simply bytes32(0)\n /// @param _lowerHint The expected CdpId of neighboring lower ICR within SortedCdps, could be simply bytes32(0)\n function withdrawDebt(\n bytes32 _cdpId,\n uint256 _debt,\n bytes32 _upperHint,\n bytes32 _low", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: /packages/contracts/contracts/Interfaces/IBorrowerOperations.sol\nrange(41, 86): withdrawColl(\n bytes32 _cdpId,\n uint256 _stEthBalanceDecrease,\n bytes32 _upperHint,\n bytes32 _lowerHint\n ) external;\n\n function withdrawDebt(\n bytes32 _cdpId,\n uint256 _amount,\n bytes32 _upperHint,\n bytes32 _lowerHint\n ) external;\n\n function repayDebt(\n bytes32 _cdpId,\n uint256 _amount,\n bytes32 _upperHint,\n bytes32 _lowerHint\n ) external;\n\n function closeCdp(bytes32 _cdpId) external;\n\n function adjustCdp(\n bytes32 _cdpId,\n uint256 _stEthBalanceDecrease,\n uint256 _debtChange,\n bool isDebtIncrease,\n bytes32 _upperHint,\n bytes32 _lowerHint\n ) external;\n\n function adjustCdpWithColl(\n bytes32 _cdpId,\n uint256 _stEthBalanceDecrease,\n uint256 _debtChange,\n bool isDebtIncrease,\n bytes32 _upperHint,\n bytes32 _lowerHint,\n uint256 _stEthBalanceIncrease\n ) external;\n\n function claimSurplusCollShares() external;\n\n function feeRecipientAddress() external view returns (address);\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "02-ai-arena", "title": "MSaptarshi G", "severity_raw": "Low", "severity": "low", "description": "## G-01 Loading from the memory cost less gas than loading from the storage \n\n1.https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/Neuron.sol#L130\n2.https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/Neuron.sol#L196\n\n### Recommendation: Load from the memory \n1.\n```\n+ uint256 recipientsLength = recipients.length; \n - require(recipients.length == amounts.length);\n + require(recipientsLength == amounts.length);\n- uint256 recipientsLength = recipients.length;\n for (uint32 i = 0; i < recipientsLength; i++) \n```\n\n2.\n```\n+ uint256 getAllowance = allowance(account, msg.sender) ;\n+ require(getAllowance >= amount, \"ERC20: burn amount exceeds allowance\");\n- require( allowance(account, msg.sender) >= amount, \n \"ERC20: burn amount exceeds allowance\");\n+ uint256 decreasedAllowance = getAllowance - amount;\n- uint256 decreasedAllowance = allowance(account, msg.sender) - amount;\n```\n", "vulnerable_code": "+ uint256 recipientsLength = recipients.length; \n - require(recipients.length == amounts.length);\n + require(recipientsLength == amounts.length);\n- uint256 recipientsLength = recipients.length;\n for (uint32 i = 0; i < recipientsLength; i++) ", "fixed_code": "+ uint256 getAllowance = allowance(account, msg.sender) ;\n+ require(getAllowance >= amount, \"ERC20: burn amount exceeds allowance\");\n- require( allowance(account, msg.sender) >= amount, \n \"ERC20: burn amount exceeds allowance\");\n+ uint256 decreasedAllowance = getAllowance - amount;\n- uint256 decreasedAllowance = allowance(account, msg.sender) - amount;", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/MSaptarshi-G.md", "collected_at": "2026-01-02T19:02:32.725427+00:00", "source_hash": "414496404193eadf2206791f982c17677ce7805d3c61f4f95bd19a2390109440", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 646, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "+ uint256 recipientsLength = recipients.length; \n - require(recipients.length == amounts.length);\n + require(recipientsLength == amounts.length);\n- uint256 recipientsLength = recipients.length;\n for (uint32 i = 0; i < recipientsLength; i++)", "primary_code_language": "unknown", "primary_code_char_count": 244, "all_code_blocks": "// Code block 1 (unknown):\n+ uint256 recipientsLength = recipients.length; \n - require(recipients.length == amounts.length);\n + require(recipientsLength == amounts.length);\n- uint256 recipientsLength = recipients.length;\n for (uint32 i = 0; i < recipientsLength; i++)\n\n// Code block 2 (unknown):\n+ uint256 getAllowance = allowance(account, msg.sender) ;\n+ require(getAllowance >= amount, \"ERC20: burn amount exceeds allowance\");\n- require( allowance(account, msg.sender) >= amount, \n \"ERC20: burn amount exceeds allowance\");\n+ uint256 decreasedAllowance = getAllowance - amount;\n- uint256 decreasedAllowance = allowance(account, msg.sender) - amount;", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Neuron.sol#L130, Neuron.sol#L196", "github_files_list": "Neuron.sol", "github_refs_count": 2, "vulnerable_code_actual": "+ uint256 recipientsLength = recipients.length; \n - require(recipients.length == amounts.length);\n + require(recipientsLength == amounts.length);\n- uint256 recipientsLength = recipients.length;\n for (uint32 i = 0; i < recipientsLength; i++) ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "+ uint256 getAllowance = allowance(account, msg.sender) ;\n+ require(getAllowance >= amount, \"ERC20: burn amount exceeds allowance\");\n- require( allowance(account, msg.sender) >= amount, \n \"ERC20: burn amount exceeds allowance\");\n+ uint256 decreasedAllowance = getAllowance - amount;\n- uint256 decreasedAllowance = allowance(account, msg.sender) - amount;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7.05} {"source": "c4", "protocol": "02-ethos", "title": "mgf15 Q", "severity_raw": "Critical", "severity": "critical", "description": "\nLow Risk and Non-Critical Issues .\n\n[L-01] Using vulnerable dependency of OpenZeppelin\nThe package.json configuration file says that the project is using 3.3.0 of OZ which has a not last update version.\n\n```\n\"devDependencies\": {\n \"@openzeppelin/contracts\": \"^3.3.0\",\n```\nref\nhttps://security.snyk.io/package/npm/@openzeppelin%2Fcontracts\n\nRecommendation:\nUse patched versions\nLatest non vulnerable version 4.8.0\n\nNon-Critical Issues \n\n[N-01] Stop using transferFrom() ! \n\nIt is recommended to use safeTransferFrom() instead of transferFrom()\n```\n function fund(uint amount) external onlyOwner {\n require(amount != 0, \"cannot fund 0\");\n OathToken.transferFrom(msg.sender, address(this), amount);\n```\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LQTY/CommunityIssuance.sol#L103\n\n[N-02] Stop using transfer() ! \n\nit seems that the contract is using transfer to send tokens/ether . \n\n```\n OathToken.transfer(_account, _OathAmount);\n```\nCode \nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LQTY/CommunityIssuance.sol#L127\n\nref\nhttps://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/\n\n\n\n\n[N-03] Use require instead of assert !\n\nThe Solidity assert() function is meant to assert invariants. Properly functioning code should never reach a failing assert statement.\n```\nassert(MIN_NET_DEBT > 0);\n\nassert(vars.compositeDebt > 0);\n\nassert(msg.sender == _borrower || (msg.sender == stabilityPoolAddress && _collTopUp > 0 && _LUSDChange == 0));\n\nassert(_collWithdrawal <= vars.coll); \n```\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol\n\n```\nassert(totalStakesSnapshot[_collateral] > 0);\n\nassert(closedStatus != Status.nonExistent && closedStatus != Status.active);\n\nassert(newBaseRate > 0); // Base rate is always non-zero after redemption\n\nassert(decayedBaseRate <= DECIMAL_PRECISION); // The baseRate can decay to 0\n```\nhttps://github.com/code-423", "vulnerable_code": "\"devDependencies\": {\n \"@openzeppelin/contracts\": \"^3.3.0\",", "fixed_code": " function fund(uint amount) external onlyOwner {\n require(amount != 0, \"cannot fund 0\");\n OathToken.transferFrom(msg.sender, address(this), amount);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/mgf15-Q.md", "collected_at": "2026-01-02T18:17:24.432492+00:00", "source_hash": "417888a320ceaf422c11b9579053ef08edb80f71e41f501894a9776aa2f99bf8", "code_block_count": 5, "solidity_block_count": 0, "total_code_chars": 750, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "\"devDependencies\": {\n \"@openzeppelin/contracts\": \"^3.3.0\",", "primary_code_language": "unknown", "primary_code_char_count": 61, "all_code_blocks": "// Code block 1 (unknown):\n\"devDependencies\": {\n \"@openzeppelin/contracts\": \"^3.3.0\",\n\n// Code block 2 (unknown):\nfunction fund(uint amount) external onlyOwner {\n require(amount != 0, \"cannot fund 0\");\n OathToken.transferFrom(msg.sender, address(this), amount);\n\n// Code block 3 (unknown):\nOathToken.transfer(_account, _OathAmount);\n\n// Code block 4 (unknown):\nassert(MIN_NET_DEBT > 0);\n\nassert(vars.compositeDebt > 0);\n\nassert(msg.sender == _borrower || (msg.sender == stabilityPoolAddress && _collTopUp > 0 && _LUSDChange == 0));\n\nassert(_collWithdrawal <= vars.coll);\n\n// Code block 5 (unknown):\nassert(totalStakesSnapshot[_collateral] > 0);\n\nassert(closedStatus != Status.nonExistent && closedStatus != Status.active);\n\nassert(newBaseRate > 0); // Base rate is always non-zero after redemption\n\nassert(decayedBaseRate <= DECIMAL_PRECISION); // The baseRate can decay to 0", "all_code_blocks_count": 5, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CommunityIssuance.sol#L103, CommunityIssuance.sol#L127, BorrowerOperations.sol", "github_files_list": "BorrowerOperations.sol, CommunityIssuance.sol", "github_refs_count": 3, "vulnerable_code_actual": "\"devDependencies\": {\n \"@openzeppelin/contracts\": \"^3.3.0\",", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function fund(uint amount) external onlyOwner {\n require(amount != 0, \"cannot fund 0\");\n OathToken.transferFrom(msg.sender, address(this), amount);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 11} {"source": "c4", "protocol": "11-kelp", "title": "ak1 Q", "severity_raw": "Low", "severity": "low", "description": "Low - 1\n\nIncorrect check for `_setToken` and `_setContract` which overwrite the existing key's value\n\n`LRTConfig` contract has the following logic to check and update the new token and contract.\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTConfig.sol#L156-L163\n\n```solidity\n function _setToken(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n if (tokenMap[key] == val) { --------------->>>audit - not sufficient. lead to overwriting existing key\n revert ValueAlreadyInUse();\n }\n tokenMap[key] = val;\n emit SetToken(key, val);\n }\n```\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTConfig.sol#L172-L179\n\n```solidity\n\n function _setContract(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n if (contractMap[key] == val) { --------------------->> audit - not sufficient. lead to overwriting existing key\n revert ValueAlreadyInUse();\n }\n contractMap[key] = val;\n emit SetContract(key, val);\n }\n```\n\nRecommendation:\n\nUpdate the code as shown below\n\n```solidity\n function _setToken(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n\n require(tokenMap[key] == address(0)); ----------->>> fix \n\n if (tokenMap[key] == val) { ------------->>>remove this check\n revert ValueAlreadyInUse();\n }\n tokenMap[key] = val;\n emit SetToken(key, val);\n }\n```\n\n\n\n\n", "vulnerable_code": " function _setToken(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n if (tokenMap[key] == val) { --------------->>>audit - not sufficient. lead to overwriting existing key\n revert ValueAlreadyInUse();\n }\n tokenMap[key] = val;\n emit SetToken(key, val);\n }", "fixed_code": " function _setContract(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n if (contractMap[key] == val) { --------------------->> audit - not sufficient. lead to overwriting existing key\n revert ValueAlreadyInUse();\n }\n contractMap[key] = val;\n emit SetContract(key, val);\n }", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/ak1-Q.md", "collected_at": "2026-01-02T18:27:47.960707+00:00", "source_hash": "41b69a17a517c8d955731f861d5127e2518b4074d3a2dc2ac369657376d5bdbd", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 1027, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _setToken(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n if (tokenMap[key] == val) { --------------->>>audit - not sufficient. lead to overwriting existing key\n revert ValueAlreadyInUse();\n }\n tokenMap[key] = val;\n emit SetToken(key, val);\n }", "primary_code_language": "solidity", "primary_code_char_count": 325, "all_code_blocks": "// Code block 1 (solidity):\nfunction _setToken(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n if (tokenMap[key] == val) { --------------->>>audit - not sufficient. lead to overwriting existing key\n revert ValueAlreadyInUse();\n }\n tokenMap[key] = val;\n emit SetToken(key, val);\n }\n\n// Code block 2 (solidity):\nfunction _setContract(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n if (contractMap[key] == val) { --------------------->> audit - not sufficient. lead to overwriting existing key\n revert ValueAlreadyInUse();\n }\n contractMap[key] = val;\n emit SetContract(key, val);\n }\n\n// Code block 3 (solidity):\nfunction _setToken(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n\n require(tokenMap[key] == address(0)); ----------->>> fix \n\n if (tokenMap[key] == val) { ------------->>>remove this check\n revert ValueAlreadyInUse();\n }\n tokenMap[key] = val;\n emit SetToken(key, val);\n }", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function _setToken(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n if (tokenMap[key] == val) { --------------->>>audit - not sufficient. lead to overwriting existing key\n revert ValueAlreadyInUse();\n }\n tokenMap[key] = val;\n emit SetToken(key, val);\n }\n\nfunction _setContract(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n if (contractMap[key] == val) { --------------------->> audit - not sufficient. lead to overwriting existing key\n revert ValueAlreadyInUse();\n }\n contractMap[key] = val;\n emit SetContract(key, val);\n }\n\nfunction _setToken(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n\n require(tokenMap[key] == address(0)); ----------->>> fix \n\n if (tokenMap[key] == val) { ------------->>>remove this check\n revert ValueAlreadyInUse();\n }\n tokenMap[key] = val;\n emit SetToken(key, val);\n }", "github_refs_formatted": "LRTConfig.sol#L156-L163, LRTConfig.sol#L172-L179", "github_files_list": "LRTConfig.sol", "github_refs_count": 2, "vulnerable_code_actual": " function _setToken(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n if (tokenMap[key] == val) { --------------->>>audit - not sufficient. lead to overwriting existing key\n revert ValueAlreadyInUse();\n }\n tokenMap[key] = val;\n emit SetToken(key, val);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function _setContract(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n if (contractMap[key] == val) { --------------------->> audit - not sufficient. lead to overwriting existing key\n revert ValueAlreadyInUse();\n }\n contractMap[key] = val;\n emit SetContract(key, val);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "11-kelp", "title": "Cryptor Q", "severity_raw": "Low", "severity": "low", "description": "## L-01 No check on whether existing strategy has funds before changing them \n\nhttps://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTConfig.sol#L109-L122\n\nProtocol does not check whether a strategy has funds in them before changing it. This could present some issues when withdrawing funds.\n\n\n\n## L-02 No check on whether a strategy has been whitelisted in Eigen Layer \nhttps://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTConfig.sol#L109-L122\nIn Eigen Layer's deposit function, there is a check to make sure that a certain strategy is whitelisted. Kelp does not make that same check when it calls Eigen's deposit function. Therefore, there can be situations where a strategy is approved on Kelp but removed from Eigen Layer's whitelist, causing unexpected reverts \n\n\n\n## L-03 Library is not needed\n\nThe Library in this function does not add much utility especially when it come to asset management as the constants are fixed and the admin can add new assets without using the library\n\n\n## L-04 LRTOracle contracts are not pauseable \n\nhttps://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTOracle.sol#L31\n\n\nNone of the oracle functions in LRTOracle.sol are pauseable even though the contract inherits pauseable_init. \n\n## L-05 Admin can renounce ownership \n\nhttps://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/3d4c0d5741b131c231e558d7a6213392ab3672a5/contracts/access/AccessControlUpgradeable.sol#L186-L190\n\nAdmin should not be able to renounce ownership as it would break several core contract functions\n\n\n## L-06 Malicious Actor can make a donation attack to cause deposits to fail\n\n```\n if (depositAmount > getAssetCurrentLimit(asset)) {\n revert MaximumDepositLimitReached();\n }\n```\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTDepositPool.sol#L132-L133\n\n The deposit function wi", "vulnerable_code": " if (depositAmount > getAssetCurrentLimit(asset)) {\n revert MaximumDepositLimitReached();\n }", "fixed_code": "lrtConfig.depositLimitByAsset(asset) - getTotalAssetDeposits(asset)", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/Cryptor-Q.md", "collected_at": "2026-01-02T18:27:24.190915+00:00", "source_hash": "41e7e95fff0bb8ca52df199bb33b66d0c2de6263ac46fab06a22ee6e986f6a73", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 109, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "if (depositAmount > getAssetCurrentLimit(asset)) {\n revert MaximumDepositLimitReached();\n }", "primary_code_language": "unknown", "primary_code_char_count": 109, "all_code_blocks": "// Code block 1 (unknown):\nif (depositAmount > getAssetCurrentLimit(asset)) {\n revert MaximumDepositLimitReached();\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LRTConfig.sol#L109-L122, LRTOracle.sol#L31, AccessControlUpgradeable.sol#L186-L190, LRTDepositPool.sol#L132-L133", "github_files_list": "LRTConfig.sol, LRTOracle.sol, LRTDepositPool.sol, AccessControlUpgradeable.sol", "github_refs_count": 4, "vulnerable_code_actual": " if (depositAmount > getAssetCurrentLimit(asset)) {\n revert MaximumDepositLimitReached();\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "lrtConfig.depositLimitByAsset(asset) - getTotalAssetDeposits(asset)", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "11-kelp", "title": "GREY HAWK REACH Q", "severity_raw": "High", "severity": "high", "description": "# [L-01] The max amount for a single deposit into EigenLayer strategy can't be reached.\n# Lines of code\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L132-L134\n\n## Impact\nBefore users can deposit funds into the ```LRTDepositPool.sol``` contract via the ```depositAsset()``` function, a check is performed to see if the current amount doesn't exceed the maxPerDeposit set by the EigenLyaer strategy.\nThe EigenLayer strategy contract [StrategyBaseTVLLimits.sol](https://github.com/Layr-Labs/eigenlayer-contracts/blob/master/src/contracts/strategies/StrategyBaseTVLLimits.sol) where funds will be deposited has two important checks \n```\n/// The maximum deposit (in underlyingToken) that this strategy will accept per deposit\n uint256 public maxPerDeposit;\n```\nand\n\n```\n/// The maximum deposits (in underlyingToken) that this strategy will hold\n uint256 public maxTotalDeposits;\n```\nThe ```depositLimitByAsset``` set in the ```LRTConfig.sol``` contract is there to check if the ```maxPerDeposit``` set in the Eigenlayer protocol is not exceeded. Problem arises in how this value is checked. As can be seen in the POC ```getAssetBalance()``` returns deposited tokens + accrued rewards. Depending on how often deposits on EigenLayer strategies are not paused Kelp may not gather all of the allowed amount for a deposit. Which results in loosing possible rewards. As each deposit is performed there will be more accrued rewards resulting in a smaller pot gathered by depositors for a stake in EigenLayer strategies.\n\n## Proof of Concept\n **1.** When kelp first start gathering deposit the hardcoded limit is 100_000e18, if this funds are collected and deposited now kelp have a deposit into EigenLayer which is generating yield\n **2.** Then kelp will increase the ```depositLimitByAsset``` to 200_000e18 in order to gather new deposits from users, and deposit in a for example a month when eigen unpauses their deposit function.\n **3.** During this time kelp has alr", "vulnerable_code": "/// The maximum deposit (in underlyingToken) that this strategy will accept per deposit\n uint256 public maxPerDeposit;", "fixed_code": "/// The maximum deposits (in underlyingToken) that this strategy will hold\n uint256 public maxTotalDeposits;", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/GREY-HAWK-REACH-Q.md", "collected_at": "2026-01-02T18:27:28.212065+00:00", "source_hash": "420b91fc2bfa28ca1783944cf8b393040f3d06df05bb6ca301960a78dea23a2c", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 232, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "/// The maximum deposit (in underlyingToken) that this strategy will accept per deposit\n uint256 public maxPerDeposit;", "primary_code_language": "unknown", "primary_code_char_count": 121, "all_code_blocks": "// Code block 1 (unknown):\n/// The maximum deposit (in underlyingToken) that this strategy will accept per deposit\n uint256 public maxPerDeposit;\n\n// Code block 2 (unknown):\n/// The maximum deposits (in underlyingToken) that this strategy will hold\n uint256 public maxTotalDeposits;", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LRTDepositPool.sol#L132-L134, StrategyBaseTVLLimits.sol", "github_files_list": "LRTDepositPool.sol, StrategyBaseTVLLimits.sol", "github_refs_count": 2, "vulnerable_code_actual": "/// The maximum deposit (in underlyingToken) that this strategy will accept per deposit\n uint256 public maxPerDeposit;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "/// The maximum deposits (in underlyingToken) that this strategy will hold\n uint256 public maxTotalDeposits;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-ondo", "title": "lukris02 G", "severity_raw": "Low", "severity": "low", "description": "# Gas Optimizations Report for Ondo Finance contest\n## Overview\nDuring the audit, 2 gas issues were found. \nTotal savings ~525.\n\u2116 | Title | Instance Count | Saved\n--- | --- | --- | ---\nG-1 | Use unchecked blocks for incrementing i | 9 | 315\nG-2 | Use unchecked blocks for subtractions where underflow is impossible | 6 | 210\n\n## Gas Optimizations Findings(2)\n### G-1. Use unchecked blocks for incrementing i\n##### Description\nIn Solidity 0.8+, there\u2019s a default overflow and underflow check on unsigned integers. In the loops, \"i\" will not overflow because the loop will run out of gas before that.\n##### Instances\n- https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashFactory.sol#L127\n- https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashKYCSenderFactory.sol#L137\n- https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashKYCSenderReceiverFactory.sol#L137\n- https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistry.sol#L163\n- https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistry.sol#L180\n- https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L750\n- https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L786\n- https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L933\n- https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L961\n\n##### Recommendation\nChange:\n```\nfor (uint256 i; i < n; ++i) {\n // ...\n}\n```\nto:\n```\nfor (uint256 i; i < n;) { \n // ...\n unchecked { ++i; }\n}\n```\n\n##### Saved\nThis saves ~30-40 gas per iteration. \nSo, ~35*9 = 315\n#\n### G-2. Use unchecked blocks for subtractions where underflow is impossible\n##### Description\nIn Solidity 0.8+, there\u2019s a default overflow and underflow check on unsigned integers. When an overflow or underflow isn\u2019t possible (after require or if-statement), some gas can be saved by using", "vulnerable_code": "for (uint256 i; i < n; ++i) {\n // ...\n}", "fixed_code": "for (uint256 i; i < n;) { \n // ...\n unchecked { ++i; }\n}", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/lukris02-G.md", "collected_at": "2026-01-02T18:15:16.549634+00:00", "source_hash": "422882470e64ca888e92a36f4f7f3ac84c3b8284c466becd46a74503719e4f39", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 95, "github_ref_count": 9, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "for (uint256 i; i < n; ++i) {\n // ...\n}", "primary_code_language": "unknown", "primary_code_char_count": 39, "all_code_blocks": "// Code block 1 (unknown):\nfor (uint256 i; i < n; ++i) {\n // ...\n}\n\n// Code block 2 (unknown):\nfor (uint256 i; i < n;) { \n // ...\n unchecked { ++i; }\n}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CashFactory.sol#L127, CashKYCSenderFactory.sol#L137, CashKYCSenderReceiverFactory.sol#L137, KYCRegistry.sol#L163, KYCRegistry.sol#L180, CashManager.sol#L750, CashManager.sol#L786, CashManager.sol#L933, CashManager.sol#L961", "github_files_list": "CashManager.sol, CashKYCSenderFactory.sol, CashFactory.sol, KYCRegistry.sol, CashKYCSenderReceiverFactory.sol", "github_refs_count": 9, "vulnerable_code_actual": "for (uint256 i; i < n; ++i) {\n // ...\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "for (uint256 i; i < n;) { \n // ...\n unchecked { ++i; }\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "06-lybra", "title": "niser93 G", "severity_raw": "Low", "severity": "low", "description": "## Gas Optimizations\n| |Issue |Instances|Total Gas Saved|\n|:-----:|:-----:|:-------:|:-------------:|\n|GO-01|```>=``` is cheaper than ```>``` (and ```<=``` is cheaper than ```<```)|2|6|\n|GO-02|Use alternative formulation in order to avoid NOT using AND instead of OR or vice versa|3|9|\n|GO-03|Multiplication/division by 2 should use bit shifting|2|4|\n|GO-04|Using ```private``` rather than ```public``` for constants, saves gas|16|-|\n|GO-05|```require()``` or ```revert()``` statements that check input arguments should be at the top of the function|1|-|\n\n### Comment\nDue to the lack of test, we aren't be able to report gas saving tables.\nSome report titles are same of [winning bot](https://gist.github.com/liveactionllama/27513952718ec3cbcf9de0fda7fef49c), but we report instances whose are't already found.\n\n## GO-01\n### ```>=``` is cheaper than ```>``` (and ```<=``` is cheaper than ```<```)\n#### Description\nNon-strict inequalities (>=) are cheaper than strict ones (>). This is due to some supplementary checks (ISZERO, 3 gas)).\n n>i is equivalent to n>=i-1 when n and i are integer\n\n\n```diff\n- for (uint256 i = 0; i < count + 10; i++) {\n+ for (uint256 i = 0; i <= count + 9; i++) {\n``` \n\n```diff\n- for (uint256 i = 100; i > count + 10; i--) {\n+ for (uint256 i = 100; i >= count + 11; i--) {\n``` \n\n```\nFile: EUSDMiningIncentives.sol\n\n \n 189 return (stakedLBRLpValue(user) * 10000) / stakedOf(user) < 500;\n\n```\n[https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/miner/EUSDMiningIncentives.sol#L189](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/miner/EUSDMiningIncentives.sol#L189)\n\n```\nFile: LybraConfigurator.sol\n\n \n 254 if (fee > 10_000) revert('EL');\n\n```\n[https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/configuration/LybraConfigurator.sol#L254](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/configuration/LybraConfigurator.sol#L254)\n\n#### Mitigation", "vulnerable_code": "```diff\n- for (uint256 i = 100; i > count + 10; i--) {\n+ for (uint256 i = 100; i >= count + 11; i--) {", "fixed_code": "File: EUSDMiningIncentives.sol\n\n \n 189 return (stakedLBRLpValue(user) * 10000) / stakedOf(user) < 500;\n", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/niser93-G.md", "collected_at": "2026-01-02T18:23:13.139475+00:00", "source_hash": "4265e80f7fbb27526a77bbcbd4f9ced51a9b0e47103d71f90f8499640c649b5c", "code_block_count": 4, "solidity_block_count": 2, "total_code_chars": 372, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "- for (uint256 i = 0; i < count + 10; i++) {\n+ for (uint256 i = 0; i <= count + 9; i++) {", "primary_code_language": "diff", "primary_code_char_count": 89, "all_code_blocks": "// Code block 1 (diff):\n- for (uint256 i = 0; i < count + 10; i++) {\n+ for (uint256 i = 0; i <= count + 9; i++) {\n\n// Code block 2 (diff):\n- for (uint256 i = 100; i > count + 10; i--) {\n+ for (uint256 i = 100; i >= count + 11; i--) {\n\n// Code block 3 (unknown):\nFile: EUSDMiningIncentives.sol\n\n \n 189 return (stakedLBRLpValue(user) * 10000) / stakedOf(user) < 500;\n\n// Code block 4 (unknown):\nFile: LybraConfigurator.sol\n\n \n 254 if (fee > 10_000) revert('EL');", "all_code_blocks_count": 4, "has_diff_blocks": true, "diff_code": "- for (uint256 i = 0; i < count + 10; i++) {\n+ for (uint256 i = 0; i <= count + 9; i++) {\n\n- for (uint256 i = 100; i > count + 10; i--) {\n+ for (uint256 i = 100; i >= count + 11; i--) {", "solidity_code": "", "github_refs_formatted": "EUSDMiningIncentives.sol#L189, LybraConfigurator.sol#L254", "github_files_list": "EUSDMiningIncentives.sol, LybraConfigurator.sol", "github_refs_count": 2, "vulnerable_code_actual": "```diff\n- for (uint256 i = 100; i > count + 10; i--) {\n+ for (uint256 i = 100; i >= count + 11; i--) {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: EUSDMiningIncentives.sol\n\n \n 189 return (stakedLBRLpValue(user) * 10000) / stakedOf(user) < 500;\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 12} {"source": "c4", "protocol": "03-asymmetry", "title": "MiksuJak G", "severity_raw": "High", "severity": "high", "description": "# Report by MiksuJak\n\n## Gas Optimizations\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [GAS-1](#GAS-1) | Store balance calls return values in `memory` instead of calling them multiple times in one function | 2 |\n| [GAS-2](#GAS-2) | Store derivative address in `memory` whenever it is read from storage more than once | 3 |\n| [GAS-3](#GAS-3) | Do not recalculate `localTotalWeights` when a `weight` is adjusted or added | 2 |\n\n### [GAS-1] Store balance calls return values in `memory` instead of calling them multiple times in one function\n\nStore `
.balance()` in a `memory` variable to save gas on addresses balance calls.\n\n#### Instance 1:\n__File: contracts/SafEth/SafEth.sol | stake | Lines: 71-75__\n\n```solidity\nfor (uint i = 0; i < derivativeCount; i++)\n\tunderlyingValue +=\n\t\t(derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n\t\t\tderivatives[i].balance()) /\n\t\t10 ** 18;\n```\nCould be changed to:\n```solidity\nfor (uint i = 0; i < derivativeCount; i++) {\n\tuint256 derivativeBalance = derivatives[i].balance();\n\tunderlyingValue +=\n\t\t(derivatives[i].ethPerDerivative(derivativeBalance) *\n\t\t\tderivativeBalance) /\n\t\t10 ** 18;\n}\n```\nSaves _8145 gas_ per call for __SafEth-Integration.test.ts:78__ test.\n\n#### Instance 2:\n__File: contracts/SafEth/SafEth.sol | rebalanceToWeights | Lines: 140-143__\n\n```solidity\nfor (uint i = 0; i < derivativeCount; i++) {\n\tif (derivatives[i].balance() > 0)\n\t\tderivatives[i].withdraw(derivatives[i].balance());\n}\n```\nCould be changed to:\n```solidity\nfor (uint i = 0; i < derivativeCount; i++) {\n\tuint256 derivativeBalance = derivatives[i].balance();\n\tif (derivativeBalance > 0)\n\t\tderivatives[i].withdraw(derivativeBalance);\n}\n```\nSaves _8154 gas_ for __SafEth-Integration.test.ts:94__ test.\nSaves _4760 gas_ for __SafEth-Integration.test.ts:123__ test.\n\n### [GAS-2] Store derivative address in `memory` whenever it is read from storage more than once\n\nThere are `for` loops iterating over `derivatives` and performing multiple calls on each `derivative` i", "vulnerable_code": "for (uint i = 0; i < derivativeCount; i++)\n\tunderlyingValue +=\n\t\t(derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n\t\t\tderivatives[i].balance()) /\n\t\t10 ** 18;", "fixed_code": "for (uint i = 0; i < derivativeCount; i++) {\n\tuint256 derivativeBalance = derivatives[i].balance();\n\tunderlyingValue +=\n\t\t(derivatives[i].ethPerDerivative(derivativeBalance) *\n\t\t\tderivativeBalance) /\n\t\t10 ** 18;\n}", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/MiksuJak-G.md", "collected_at": "2026-01-02T18:18:20.711851+00:00", "source_hash": "428dd0c89de9f0459864cc99ae090f684b4cc04500ba286556aa0f7bc917ce45", "code_block_count": 4, "solidity_block_count": 4, "total_code_chars": 690, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "for (uint i = 0; i < derivativeCount; i++)\n\tunderlyingValue +=\n\t\t(derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n\t\t\tderivatives[i].balance()) /\n\t\t10 ** 18;", "primary_code_language": "solidity", "primary_code_char_count": 168, "all_code_blocks": "// Code block 1 (solidity):\nfor (uint i = 0; i < derivativeCount; i++)\n\tunderlyingValue +=\n\t\t(derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n\t\t\tderivatives[i].balance()) /\n\t\t10 ** 18;\n\n// Code block 2 (solidity):\nfor (uint i = 0; i < derivativeCount; i++) {\n\tuint256 derivativeBalance = derivatives[i].balance();\n\tunderlyingValue +=\n\t\t(derivatives[i].ethPerDerivative(derivativeBalance) *\n\t\t\tderivativeBalance) /\n\t\t10 ** 18;\n}\n\n// Code block 3 (solidity):\nfor (uint i = 0; i < derivativeCount; i++) {\n\tif (derivatives[i].balance() > 0)\n\t\tderivatives[i].withdraw(derivatives[i].balance());\n}\n\n// Code block 4 (solidity):\nfor (uint i = 0; i < derivativeCount; i++) {\n\tuint256 derivativeBalance = derivatives[i].balance();\n\tif (derivativeBalance > 0)\n\t\tderivatives[i].withdraw(derivativeBalance);\n}", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "for (uint i = 0; i < derivativeCount; i++)\n\tunderlyingValue +=\n\t\t(derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n\t\t\tderivatives[i].balance()) /\n\t\t10 ** 18;\n\nfor (uint i = 0; i < derivativeCount; i++) {\n\tuint256 derivativeBalance = derivatives[i].balance();\n\tunderlyingValue +=\n\t\t(derivatives[i].ethPerDerivative(derivativeBalance) *\n\t\t\tderivativeBalance) /\n\t\t10 ** 18;\n}\n\nfor (uint i = 0; i < derivativeCount; i++) {\n\tif (derivatives[i].balance() > 0)\n\t\tderivatives[i].withdraw(derivatives[i].balance());\n}\n\nfor (uint i = 0; i < derivativeCount; i++) {\n\tuint256 derivativeBalance = derivatives[i].balance();\n\tif (derivativeBalance > 0)\n\t\tderivatives[i].withdraw(derivativeBalance);\n}", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "for (uint i = 0; i < derivativeCount; i++)\n\tunderlyingValue +=\n\t\t(derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n\t\t\tderivatives[i].balance()) /\n\t\t10 ** 18;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "for (uint i = 0; i < derivativeCount; i++) {\n\tuint256 derivativeBalance = derivatives[i].balance();\n\tunderlyingValue +=\n\t\t(derivatives[i].ethPerDerivative(derivativeBalance) *\n\t\t\tderivativeBalance) /\n\t\t10 ** 18;\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "01-biconomy", "title": "Kaysoft Q", "severity_raw": "Critical", "severity": "critical", "description": "## [L-01] Remove unused input/unnamed parameter \nFile: VerifyingSingletonPaymaster, line: 97\n- [VerifyingSingletonPaymaster.sol#L97](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol#L97)\n\nThe `/*userOpHash*/` is commented and not used. Remove unused parameter.\n\n```\nfunction validatePaymasterUserOp(UserOperation calldata userOp, bytes32 /*userOpHash*/, uint256 requiredPreFund)\n external view override returns (bytes memory context, uint256 deadline) {\n (requiredPreFund);\n bytes32 hash = getHash(userOp);\n\n PaymasterData memory paymasterData = userOp.decodePaymasterData();\n uint256 sigLength = paymasterData.signatureLength;\n\n //ECDSA library supports both 64 and 65-byte long signatures.\n // we only \"require\" it here so that the revert reason on invalid signature will be of \"VerifyingPaymaster\", and not \"ECDSA\"\n require(sigLength == 64 || sigLength == 65, \"VerifyingPaymaster: invalid signature length in paymasterAndData\");\n require(verifyingSigner == hash.toEthSignedMessageHash().recover(paymasterData.signature), \"VerifyingPaymaster: wrong signature\");\n require(requiredPreFund <= paymasterIdBalances[paymasterData.paymasterId], \"Insufficient balance for paymaster id\");\n return (userOp.paymasterContext(paymasterData), 0);\n }\n```\n\n### Recommended Mitigation Steps\n- Remove the unused/commented `/*userOpHash*/` parameter in `validatePaymasterUser` function.\n\n## [L-02] Use latest stable pragma version 0.8.17 \nFiles: All files. \nLow level calls with solidity versions 0.8.14 and BELOW can result in optimizer bugs.\nhttps://medium.com/certora/overly-optimistic-optimizer-certora-bug-disclosure-2101e3f7994d\n\nsee: https://swcregistry.io/docs/SWC-102\nSimliar findings in Code4rena contests for reference:\nhttps://code4rena.com/reports/2022-06-illuminate/#5-low-level-calls-with-solidity-version-0", "vulnerable_code": "function validatePaymasterUserOp(UserOperation calldata userOp, bytes32 /*userOpHash*/, uint256 requiredPreFund)\n external view override returns (bytes memory context, uint256 deadline) {\n (requiredPreFund);\n bytes32 hash = getHash(userOp);\n\n PaymasterData memory paymasterData = userOp.decodePaymasterData();\n uint256 sigLength = paymasterData.signatureLength;\n\n //ECDSA library supports both 64 and 65-byte long signatures.\n // we only \"require\" it here so that the revert reason on invalid signature will be of \"VerifyingPaymaster\", and not \"ECDSA\"\n require(sigLength == 64 || sigLength == 65, \"VerifyingPaymaster: invalid signature length in paymasterAndData\");\n require(verifyingSigner == hash.toEthSignedMessageHash().recover(paymasterData.signature), \"VerifyingPaymaster: wrong signature\");\n require(requiredPreFund <= paymasterIdBalances[paymasterData.paymasterId], \"Insufficient balance for paymaster id\");\n return (userOp.paymasterContext(paymasterData), 0);\n }", "fixed_code": "const config: HardhatUserConfig = {\n // defaultNetwork: \"ganache\",\n solidity: {\n compilers: [\n {\n version: \"0.8.12\",\n settings: {\n optimizer: { enabled: true, runs: 200 },\n },\n },\n {\n version: \"0.8.4\",\n settings: {\n optimizer: { enabled: true, runs: 200 },\n },\n },\n {\n version: \"0.8.9\",\n settings: {\n optimizer: { enabled: true, runs: 200 },\n },\n },\n ],\n },\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/Kaysoft-Q.md", "collected_at": "2026-01-02T18:13:08.922906+00:00", "source_hash": "42f56c37905a0f6cc8cffbf5f16b6bac73066827153a97b56bc1cc3c50157d70", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 1047, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function validatePaymasterUserOp(UserOperation calldata userOp, bytes32 /*userOpHash*/, uint256 requiredPreFund)\n external view override returns (bytes memory context, uint256 deadline) {\n (requiredPreFund);\n bytes32 hash = getHash(userOp);\n\n PaymasterData memory paymasterData = userOp.decodePaymasterData();\n uint256 sigLength = paymasterData.signatureLength;\n\n //ECDSA library supports both 64 and 65-byte long signatures.\n // we only \"require\" it here so that the revert reason on invalid signature will be of \"VerifyingPaymaster\", and not \"ECDSA\"\n require(sigLength == 64 || sigLength == 65, \"VerifyingPaymaster: invalid signature length in paymasterAndData\");\n require(verifyingSigner == hash.toEthSignedMessageHash().recover(paymasterData.signature), \"VerifyingPaymaster: wrong signature\");\n require(requiredPreFund <= paymasterIdBalances[paymasterData.paymasterId], \"Insufficient balance for paymaster id\");\n return (userOp.paymasterContext(paymasterData), 0);\n }", "primary_code_language": "unknown", "primary_code_char_count": 1047, "all_code_blocks": "// Code block 1 (unknown):\nfunction validatePaymasterUserOp(UserOperation calldata userOp, bytes32 /*userOpHash*/, uint256 requiredPreFund)\n external view override returns (bytes memory context, uint256 deadline) {\n (requiredPreFund);\n bytes32 hash = getHash(userOp);\n\n PaymasterData memory paymasterData = userOp.decodePaymasterData();\n uint256 sigLength = paymasterData.signatureLength;\n\n //ECDSA library supports both 64 and 65-byte long signatures.\n // we only \"require\" it here so that the revert reason on invalid signature will be of \"VerifyingPaymaster\", and not \"ECDSA\"\n require(sigLength == 64 || sigLength == 65, \"VerifyingPaymaster: invalid signature length in paymasterAndData\");\n require(verifyingSigner == hash.toEthSignedMessageHash().recover(paymasterData.signature), \"VerifyingPaymaster: wrong signature\");\n require(requiredPreFund <= paymasterIdBalances[paymasterData.paymasterId], \"Insufficient balance for paymaster id\");\n return (userOp.paymasterContext(paymasterData), 0);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "VerifyingSingletonPaymaster.sol#L97", "github_files_list": "VerifyingSingletonPaymaster.sol", "github_refs_count": 1, "vulnerable_code_actual": "function validatePaymasterUserOp(UserOperation calldata userOp, bytes32 /*userOpHash*/, uint256 requiredPreFund)\n external view override returns (bytes memory context, uint256 deadline) {\n (requiredPreFund);\n bytes32 hash = getHash(userOp);\n\n PaymasterData memory paymasterData = userOp.decodePaymasterData();\n uint256 sigLength = paymasterData.signatureLength;\n\n //ECDSA library supports both 64 and 65-byte long signatures.\n // we only \"require\" it here so that the revert reason on invalid signature will be of \"VerifyingPaymaster\", and not \"ECDSA\"\n require(sigLength == 64 || sigLength == 65, \"VerifyingPaymaster: invalid signature length in paymasterAndData\");\n require(verifyingSigner == hash.toEthSignedMessageHash().recover(paymasterData.signature), \"VerifyingPaymaster: wrong signature\");\n require(requiredPreFund <= paymasterIdBalances[paymasterData.paymasterId], \"Insufficient balance for paymaster id\");\n return (userOp.paymasterContext(paymasterData), 0);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "const config: HardhatUserConfig = {\n // defaultNetwork: \"ganache\",\n solidity: {\n compilers: [\n {\n version: \"0.8.12\",\n settings: {\n optimizer: { enabled: true, runs: 200 },\n },\n },\n {\n version: \"0.8.4\",\n settings: {\n optimizer: { enabled: true, runs: 200 },\n },\n },\n {\n version: \"0.8.9\",\n settings: {\n optimizer: { enabled: true, runs: 200 },\n },\n },\n ],\n },\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "05-ajna", "title": "Audit_Avengers Q", "severity_raw": "Critical", "severity": "critical", "description": "A. LOW/MEDIUM RISK: Large(r) loan based griefing attack:\nAlthough the protocol already protects against griefing attacks using dust loans, there is currently no protection in place for when larger loans are used to execute griefing attacks.\n\nImpact:\nAn attacker could take out one or more large loans from depositors and keep the loan very close to the liquidation threshold, thereby artificially inflating the HTP. This potential griefing attack could disrupt the system by sustainably preventing other lenders from withdrawing their deposits.\n\nThe absence of a mitigation mechanism for this variant of the attack is concerning because it could lead to the locking of users' funds within the system, undermining the protocol's credibility and causing a possible loss of users. Additionally, this attack could prevent lenders from correctly adjusting the Liquidity Utilization Price (LUP), thereby manipulating market dynamics.\n\nProof of Concept:\nThe griefing attack could be executed as follows:\n\nThe attacker borrows a large amount from the system, choosing depositors who have a significant amount of funds.\nThe attacker ensures that the loan size remains very close to the liquidation threshold, thereby artificially inflating the HTP.\n\nRecommended Mitigation Steps\nConsider implementing additional checks or limits on borrowing activities. For instance, a limit on the loan-to-value (LTV) ratio could be introduced to prevent borrowers from taking out loans that are too close to the liquidation threshold, preventing an attacker from artificially inflating the HTP.\n\nIn addition, a mechanism could be implemented that adjusts the HTP calculation in response to large loans. This would reduce the impact that any single loan can have on the overall HTP.\n\nMonitoring for suspicious borrowing patterns could also be beneficial. Patterns such as a user borrowing large amounts close to the liquidation threshold could trigger manual reviews or automated responses to protect the system and its user", "vulnerable_code": "File: /ajna-grants/src/grants/base/ExtraordinaryFunding.sol\n78: treasury -= tokensRequested;\n\n // execute proposal's calldata\n _execute(proposalId_, targets_, values_, calldatas_);\n", "fixed_code": "File: /ajna-core/src/PositionManager.sol\n120: erc20PoolFactory = erc20Factory_;\n erc721PoolFactory = erc721Factory_;\n }\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/Audit_Avengers-Q.md", "collected_at": "2026-01-02T18:20:53.674365+00:00", "source_hash": "42f6cf20e8e662317921e9767083469b034bc5026ddea4ef57d9650e3d017b26", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: /ajna-grants/src/grants/base/ExtraordinaryFunding.sol\n78: treasury -= tokensRequested;\n\n // execute proposal's calldata\n _execute(proposalId_, targets_, values_, calldatas_);\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: /ajna-core/src/PositionManager.sol\n120: erc20PoolFactory = erc20Factory_;\n erc721PoolFactory = erc721Factory_;\n }\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "02-ethos", "title": "0xAgro Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA Report\n## Finding Summary\n\n[**Low Severity**](#Low-Severity)\n1. [**Unchecked Cast May Overflow**](#1-Unchecked-Cast-May-Overflow)\n2. [**Consider a More Recent Solidity Version**](#2-Consider-a-More-Recent-Solidity-Version)\n3. [**Code Function Does Not Match Comment**](#3-Code-Function-Does-Not-Match-Comment)\n4. [**Low Coverage**](#4-Low-Coverage)\n5. [**assert Used Over require**](#5-assert-Used-Over-require)\n6. [**Drastic Compiler Version Variation**](#6-Drastic-Compiler-Version-Variation)\n7. [**ERC20 Decimals Assumption**](#7-ERC20-Decimals-Assumption)\n8. [**batchLiquidateTroves Ignores Checks In liquidate**](#8-batchLiquidateTroves-Ignores-Checks-In-liquidate)\n9. [**LUSD Minting To Restricted Address**](#9-LUSD-Minting-To-Restricted-Address)\n10. [**No Rebasing Token Support**](#10-No-Rebasing-Token-Support)\n\n[**Non-Critical**](#Non-Critical)\n1. [**Use of ecrecover**](#1-Use-of-ecrecover)\n2. [**Consider Avoiding Sensitive Terms**](#2-Consider-Avoiding-Sensitive-Terms)\n3. [**Explicit Variable Not Used**](#3-Explicit-Variable-Not-Used)\n4. [**Variable Scopes Not Explicit**](#4-Variable-Scopes-Not-Explicit)\n5. [**chainid Non-Assembly Function Available**](#5-chainid-Non-Assembly-Function-Available)\n6. [**Use of deprecated now**](#6-Use-of-deprecated-now)\n7. [**bytes.concat() Can Be Used Over abi.encodePacked()**](#7-bytesconcat-can-be-used-over-abiencodepacked)\n8. [**Contracts Lacking NatSpec Headers**](#8-Contracts-Lacking-NatSpec-Headers)\n9. [**Odd Name State**](#9-Odd-Name-State)\n10. [**Be Explicitly Honest About Risk**](#10-Be-Explicitly-Honest-About-Risk)\n\n[**General Style**](#General-Style)\n1. [**Underscore Notation Not Used or Not Used Consistently**](#1-Underscore-Notation-Not-Used-or-Not-Used-Consistently)\n2. [**Power of Ten Literal Not In Scientific Notation**](#2-Power-of-Ten-Literal-Not-In-Scientific-Notation)\n3. [**Use of Exponentiation Over Scientific Notation**](#3-Use-of-Exponentiation-Over-Scientific-Notation)\n4. [**Inconsistent Named Returns**](#", "vulnerable_code": "1329:\tindex = uint128(TroveOwners[_collateral].length.sub(1));", "fixed_code": "277:\tvars.netAssetMovement = int256(vars.toDeposit) - int256(vars.toWithdraw) - int256(vars.profit);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/0xAgro-Q.md", "collected_at": "2026-01-02T18:15:44.221810+00:00", "source_hash": "4375e28673039b44fdcc2765ba33337aac84c16f22180a3bdadb4d9fe54de6e5", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "1329:\tindex = uint128(TroveOwners[_collateral].length.sub(1));", "has_vulnerable_code_snippet": true, "fixed_code_actual": "277:\tvars.netAssetMovement = int256(vars.toDeposit) - int256(vars.toWithdraw) - int256(vars.profit);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "11-kelp", "title": "dharma09 G", "severity_raw": "Gas", "severity": "gas", "description": "### [G-01] Cache multiple accesses of a mapping/array\n\nConsider using a local\u00a0`storage`\u00a0or\u00a0`calldata`\u00a0variable when accessing a mapping/array value multiple times.\n\nThis can be useful to avoid recalculating the mapping hash and/or the array offsets.\n\n- https://github.com/code-423n4/2023-11-kelp/blob/main/src/NodeDelegator.sol#L109\n\n```solidity\nFile: src/NodeDelegator.sol\n109: for (uint256 i = 0; i < strategiesLength;) {\n assets[i] = address(IStrategy(strategies[i]).underlyingToken()); //@audit cache variable\n assetBalances[i] = IStrategy(strategies[i]).userUnderlyingView(address(this));\n unchecked {\n ++i;\n }\n }\n```\n\n### [G-02] Move the declaration of user outside the loop to reduce SLOAD (storage load) operations, as storage reads can be expensive in terms of gas.\n\nOptimize gas usage by avoiding variable declarations inside loops\n\n- https://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTOracle.sol#L66\n\n```solidity\nFile: src/LRTOracle.sol\n66: for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n address asset = supportedAssets[asset_idx]; //@audit make variable outside loop\n uint256 assetER = getAssetPrice(asset);\n\n uint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);\n totalETHInPool += totalAssetAmt * assetER;\n\n unchecked {\n ++asset_idx;\n }\n }\n```\n\n```diff\nFile: src/LRTOracle.sol\n+ address asset;\n+ uint256 assetER;\n66: for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n- address asset = supportedAssets[asset_idx];\n- uint256 assetER = getAssetPrice(asset);\n+ asset = supportedAssets[asset_idx];\n+ assetER = getAssetPrice(asset);\n\n uint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);\n totalETHInPool += totalAssetAmt * assetER;\n\n ", "vulnerable_code": "File: src/NodeDelegator.sol\n109: for (uint256 i = 0; i < strategiesLength;) {\n assets[i] = address(IStrategy(strategies[i]).underlyingToken()); //@audit cache variable\n assetBalances[i] = IStrategy(strategies[i]).userUnderlyingView(address(this));\n unchecked {\n ++i;\n }\n }", "fixed_code": "File: src/LRTOracle.sol\n66: for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n address asset = supportedAssets[asset_idx]; //@audit make variable outside loop\n uint256 assetER = getAssetPrice(asset);\n\n uint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);\n totalETHInPool += totalAssetAmt * assetER;\n\n unchecked {\n ++asset_idx;\n }\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/dharma09-G.md", "collected_at": "2026-01-02T18:28:00.098381+00:00", "source_hash": "437ec2a6208af53c44ecad0772b04009ee4782b7573d87d1ed046ef7930e6b76", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 804, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: src/NodeDelegator.sol\n109: for (uint256 i = 0; i < strategiesLength;) {\n assets[i] = address(IStrategy(strategies[i]).underlyingToken()); //@audit cache variable\n assetBalances[i] = IStrategy(strategies[i]).userUnderlyingView(address(this));\n unchecked {\n ++i;\n }\n }", "primary_code_language": "solidity", "primary_code_char_count": 338, "all_code_blocks": "// Code block 1 (solidity):\nFile: src/NodeDelegator.sol\n109: for (uint256 i = 0; i < strategiesLength;) {\n assets[i] = address(IStrategy(strategies[i]).underlyingToken()); //@audit cache variable\n assetBalances[i] = IStrategy(strategies[i]).userUnderlyingView(address(this));\n unchecked {\n ++i;\n }\n }\n\n// Code block 2 (solidity):\nFile: src/LRTOracle.sol\n66: for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n address asset = supportedAssets[asset_idx]; //@audit make variable outside loop\n uint256 assetER = getAssetPrice(asset);\n\n uint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);\n totalETHInPool += totalAssetAmt * assetER;\n\n unchecked {\n ++asset_idx;\n }\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: src/NodeDelegator.sol\n109: for (uint256 i = 0; i < strategiesLength;) {\n assets[i] = address(IStrategy(strategies[i]).underlyingToken()); //@audit cache variable\n assetBalances[i] = IStrategy(strategies[i]).userUnderlyingView(address(this));\n unchecked {\n ++i;\n }\n }\n\nFile: src/LRTOracle.sol\n66: for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n address asset = supportedAssets[asset_idx]; //@audit make variable outside loop\n uint256 assetER = getAssetPrice(asset);\n\n uint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);\n totalETHInPool += totalAssetAmt * assetER;\n\n unchecked {\n ++asset_idx;\n }\n }", "github_refs_formatted": "NodeDelegator.sol#L109, LRTOracle.sol#L66", "github_files_list": "NodeDelegator.sol, LRTOracle.sol", "github_refs_count": 2, "vulnerable_code_actual": "File: src/NodeDelegator.sol\n109: for (uint256 i = 0; i < strategiesLength;) {\n assets[i] = address(IStrategy(strategies[i]).underlyingToken()); //@audit cache variable\n assetBalances[i] = IStrategy(strategies[i]).userUnderlyingView(address(this));\n unchecked {\n ++i;\n }\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: src/LRTOracle.sol\n66: for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n address asset = supportedAssets[asset_idx]; //@audit make variable outside loop\n uint256 assetER = getAssetPrice(asset);\n\n uint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);\n totalETHInPool += totalAssetAmt * assetER;\n\n unchecked {\n ++asset_idx;\n }\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "06-lybra", "title": "koo Analysis", "severity_raw": "Low", "severity": "low", "description": "I think the EUSD and PEUSD are too centralization.\n```solidity\n function transferFrom(address from, address to, uint256 amount) public returns (bool) {\n address spender = _msgSender();\n if (!configurator.mintVault(spender)) {\n _spendAllowance(from, spender, amount);\n }\n _transfer(from, to, amount);\n return true;\n }\n```\nAdmin has the power to transfer the EUSD and PEUSD owned by anybody, which will violation of decentralization blockchain. And also, once a private key of the address which have mintVault permision and isRedemptionProvider permission leak and is controled bt a attacker. Attacker can stole everbody's EUSD and PEUSD. Further more, see the following code:\n```solidity\n function rigidRedemption(address provider, uint256 peusdAmount) external virtual {\n require(configurator.isRedemptionProvider(provider), \"provider is not a RedemptionProvider\");\n require(borrowed[provider] >= peusdAmount, \"peusdAmount cannot surpass providers debt\");\n uint256 assetPrice = getAssetPrice();\n uint256 providerCollateralRatio = (depositedAsset[provider] * assetPrice * 100) / borrowed[provider];\n require(providerCollateralRatio >= 100 * 1e18, \"provider's collateral ratio should more than 100%\");\n _repay(msg.sender, provider, peusdAmount);\n uint256 collateralAmount = (((peusdAmount * 1e18) / assetPrice) * (10000 - configurator.redemptionFee())) / 10000;\n depositedAsset[provider] -= collateralAmount;\n collateralAsset.transfer(msg.sender, collateralAmount);\n emit RigidRedemption(msg.sender, provider, peusdAmount, collateralAmount, block.timestamp);\n }\n```\nUsing stolen money, attacker then can use the rigidRedemption call to get all collateralAsset in the pool. It will cause serious damage to the user's money.\n\n### Time spent:\n20 hours", "vulnerable_code": " function transferFrom(address from, address to, uint256 amount) public returns (bool) {\n address spender = _msgSender();\n if (!configurator.mintVault(spender)) {\n _spendAllowance(from, spender, amount);\n }\n _transfer(from, to, amount);\n return true;\n }", "fixed_code": " function rigidRedemption(address provider, uint256 peusdAmount) external virtual {\n require(configurator.isRedemptionProvider(provider), \"provider is not a RedemptionProvider\");\n require(borrowed[provider] >= peusdAmount, \"peusdAmount cannot surpass providers debt\");\n uint256 assetPrice = getAssetPrice();\n uint256 providerCollateralRatio = (depositedAsset[provider] * assetPrice * 100) / borrowed[provider];\n require(providerCollateralRatio >= 100 * 1e18, \"provider's collateral ratio should more than 100%\");\n _repay(msg.sender, provider, peusdAmount);\n uint256 collateralAmount = (((peusdAmount * 1e18) / assetPrice) * (10000 - configurator.redemptionFee())) / 10000;\n depositedAsset[provider] -= collateralAmount;\n collateralAsset.transfer(msg.sender, collateralAmount);\n emit RigidRedemption(msg.sender, provider, peusdAmount, collateralAmount, block.timestamp);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/koo-Analysis.md", "collected_at": "2026-01-02T18:23:03.769967+00:00", "source_hash": "43a266f2ff6c908bc27a6ff9a47d6fe8a9a229fbe5b4ee5676831c8075326eda", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 1245, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function transferFrom(address from, address to, uint256 amount) public returns (bool) {\n address spender = _msgSender();\n if (!configurator.mintVault(spender)) {\n _spendAllowance(from, spender, amount);\n }\n _transfer(from, to, amount);\n return true;\n }", "primary_code_language": "solidity", "primary_code_char_count": 301, "all_code_blocks": "// Code block 1 (solidity):\nfunction transferFrom(address from, address to, uint256 amount) public returns (bool) {\n address spender = _msgSender();\n if (!configurator.mintVault(spender)) {\n _spendAllowance(from, spender, amount);\n }\n _transfer(from, to, amount);\n return true;\n }\n\n// Code block 2 (solidity):\nfunction rigidRedemption(address provider, uint256 peusdAmount) external virtual {\n require(configurator.isRedemptionProvider(provider), \"provider is not a RedemptionProvider\");\n require(borrowed[provider] >= peusdAmount, \"peusdAmount cannot surpass providers debt\");\n uint256 assetPrice = getAssetPrice();\n uint256 providerCollateralRatio = (depositedAsset[provider] * assetPrice * 100) / borrowed[provider];\n require(providerCollateralRatio >= 100 * 1e18, \"provider's collateral ratio should more than 100%\");\n _repay(msg.sender, provider, peusdAmount);\n uint256 collateralAmount = (((peusdAmount * 1e18) / assetPrice) * (10000 - configurator.redemptionFee())) / 10000;\n depositedAsset[provider] -= collateralAmount;\n collateralAsset.transfer(msg.sender, collateralAmount);\n emit RigidRedemption(msg.sender, provider, peusdAmount, collateralAmount, block.timestamp);\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function transferFrom(address from, address to, uint256 amount) public returns (bool) {\n address spender = _msgSender();\n if (!configurator.mintVault(spender)) {\n _spendAllowance(from, spender, amount);\n }\n _transfer(from, to, amount);\n return true;\n }\n\nfunction rigidRedemption(address provider, uint256 peusdAmount) external virtual {\n require(configurator.isRedemptionProvider(provider), \"provider is not a RedemptionProvider\");\n require(borrowed[provider] >= peusdAmount, \"peusdAmount cannot surpass providers debt\");\n uint256 assetPrice = getAssetPrice();\n uint256 providerCollateralRatio = (depositedAsset[provider] * assetPrice * 100) / borrowed[provider];\n require(providerCollateralRatio >= 100 * 1e18, \"provider's collateral ratio should more than 100%\");\n _repay(msg.sender, provider, peusdAmount);\n uint256 collateralAmount = (((peusdAmount * 1e18) / assetPrice) * (10000 - configurator.redemptionFee())) / 10000;\n depositedAsset[provider] -= collateralAmount;\n collateralAsset.transfer(msg.sender, collateralAmount);\n emit RigidRedemption(msg.sender, provider, peusdAmount, collateralAmount, block.timestamp);\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function transferFrom(address from, address to, uint256 amount) public returns (bool) {\n address spender = _msgSender();\n if (!configurator.mintVault(spender)) {\n _spendAllowance(from, spender, amount);\n }\n _transfer(from, to, amount);\n return true;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function rigidRedemption(address provider, uint256 peusdAmount) external virtual {\n require(configurator.isRedemptionProvider(provider), \"provider is not a RedemptionProvider\");\n require(borrowed[provider] >= peusdAmount, \"peusdAmount cannot surpass providers debt\");\n uint256 assetPrice = getAssetPrice();\n uint256 providerCollateralRatio = (depositedAsset[provider] * assetPrice * 100) / borrowed[provider];\n require(providerCollateralRatio >= 100 * 1e18, \"provider's collateral ratio should more than 100%\");\n _repay(msg.sender, provider, peusdAmount);\n uint256 collateralAmount = (((peusdAmount * 1e18) / assetPrice) * (10000 - configurator.redemptionFee())) / 10000;\n depositedAsset[provider] -= collateralAmount;\n collateralAsset.transfer(msg.sender, collateralAmount);\n emit RigidRedemption(msg.sender, provider, peusdAmount, collateralAmount, block.timestamp);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "06-lybra", "title": "XDZIBECX Q", "severity_raw": "Unknown", "severity": "unknown", "description": "The `stakingToken.transferFrom` and `stakingToken.transfer` calls in the `stake` and `withdraw` functions, and the `rewardsToken.mint` call in the `getReward` function are not checked for their return value. Although it's not mandatory in ERC20 standard to return a boolean for these functions, some tokens do.\n\n\n- here is the code of contract : https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/stakerewardV2pool.sol#L1C1-L150C2\n\n- to fix this, added to the stake, withdraw, and getReward functions:\n\n```solidity\nif (stakingToken.transferFrom(msg.sender, address(this), _amount) == false) {\n revert(\"Transfer failed\");\n}\n\nif (stakingToken.transfer(msg.sender, _amount) == false) {\n revert(\"Transfer failed\");\n}\n\nif (rewardsToken.mint(msg.sender, _amount) == false) {\n revert(\"Mint failed\");\n}\n```\n", "vulnerable_code": "if (stakingToken.transferFrom(msg.sender, address(this), _amount) == false) {\n revert(\"Transfer failed\");\n}\n\nif (stakingToken.transfer(msg.sender, _amount) == false) {\n revert(\"Transfer failed\");\n}\n\nif (rewardsToken.mint(msg.sender, _amount) == false) {\n revert(\"Mint failed\");\n}", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/XDZIBECX-Q.md", "collected_at": "2026-01-02T18:22:49.845874+00:00", "source_hash": "43fa3af7a2d863ff8626c32da19c03cfc52a6147993518cd45984b3d48f2eaca", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 288, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "if (stakingToken.transferFrom(msg.sender, address(this), _amount) == false) {\n revert(\"Transfer failed\");\n}\n\nif (stakingToken.transfer(msg.sender, _amount) == false) {\n revert(\"Transfer failed\");\n}\n\nif (rewardsToken.mint(msg.sender, _amount) == false) {\n revert(\"Mint failed\");\n}", "primary_code_language": "solidity", "primary_code_char_count": 288, "all_code_blocks": "// Code block 1 (solidity):\nif (stakingToken.transferFrom(msg.sender, address(this), _amount) == false) {\n revert(\"Transfer failed\");\n}\n\nif (stakingToken.transfer(msg.sender, _amount) == false) {\n revert(\"Transfer failed\");\n}\n\nif (rewardsToken.mint(msg.sender, _amount) == false) {\n revert(\"Mint failed\");\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "if (stakingToken.transferFrom(msg.sender, address(this), _amount) == false) {\n revert(\"Transfer failed\");\n}\n\nif (stakingToken.transfer(msg.sender, _amount) == false) {\n revert(\"Transfer failed\");\n}\n\nif (rewardsToken.mint(msg.sender, _amount) == false) {\n revert(\"Mint failed\");\n}", "github_refs_formatted": "stakerewardV2pool.sol#L1", "github_files_list": "stakerewardV2pool.sol", "github_refs_count": 1, "vulnerable_code_actual": "if (stakingToken.transferFrom(msg.sender, address(this), _amount) == false) {\n revert(\"Transfer failed\");\n}\n\nif (stakingToken.transfer(msg.sender, _amount) == false) {\n revert(\"Transfer failed\");\n}\n\nif (rewardsToken.mint(msg.sender, _amount) == false) {\n revert(\"Mint failed\");\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.74} {"source": "c4", "protocol": "01-biconomy", "title": "seeu Q", "severity_raw": "High", "severity": "high", "description": "## Compiler version Pragma is non-specific\n\n### Description\n\nFor non-library contracts, floating pragmas may be a security risk for application implementations, since a known vulnerable compiler version may accidentally be selected or security tools might fallback to an older compiler version ending up checking a different EVM compilation that is ultimately deployed on the blockchain.\n\n### Findings\n\n```\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L2 => pragma solidity ^0.8.12;\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L6 => pragma solidity ^0.8.12;\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IAccount.sol#L2 => pragma solidity ^0.8.12;\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IAggregatedAccount.sol#L2 => pragma solidity ^0.8.12;\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IEntryPoint.sol#L6 => pragma solidity ^0.8.12;\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IPaymaster.sol#L2 => pragma solidity ^0.8.12;\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IStakeManager.sol#L2 => pragma solidity ^0.8.12;\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/SenderCreator.sol#L2 => pragma solidity ^0.8.12;\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/StakeManager.sol#L2 => pragma solidity ^0.8.12;\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-co", "vulnerable_code": "https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L2 => pragma solidity ^0.8.12;\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L6 => pragma solidity ^0.8.12;\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IAccount.sol#L2 => pragma solidity ^0.8.12;\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IAggregatedAccount.sol#L2 => pragma solidity ^0.8.12;\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IEntryPoint.sol#L6 => pragma solidity ^0.8.12;\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IPaymaster.sol#L2 => pragma solidity ^0.8.12;\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IStakeManager.sol#L2 => pragma solidity ^0.8.12;\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/SenderCreator.sol#L2 => pragma solidity ^0.8.12;\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/StakeManager.sol#L2 => pragma solidity ^0.8.12;\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/UserOperation.sol#L2 => pragma solidity ^0.8.12;", "fixed_code": "", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/seeu-Q.md", "collected_at": "2026-01-02T18:14:09.184451+00:00", "source_hash": "44b624d95d66ba432cad37cb244047c74907156e89fad3ae12e6ee7f74428f38", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 10, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "BasePaymaster.sol#L2, EntryPoint.sol#L6, IAccount.sol#L2, IAggregatedAccount.sol#L2, IEntryPoint.sol#L6, IPaymaster.sol#L2, IStakeManager.sol#L2, SenderCreator.sol#L2, StakeManager.sol#L2, UserOperation.sol#L2", "github_files_list": "SenderCreator.sol, IEntryPoint.sol, IAggregatedAccount.sol, IStakeManager.sol, BasePaymaster.sol, IPaymaster.sol, IAccount.sol, EntryPoint.sol, UserOperation.sol, StakeManager.sol", "github_refs_count": 10, "vulnerable_code_actual": "https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L2 => pragma solidity ^0.8.12;\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L6 => pragma solidity ^0.8.12;\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IAccount.sol#L2 => pragma solidity ^0.8.12;\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IAggregatedAccount.sol#L2 => pragma solidity ^0.8.12;\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IEntryPoint.sol#L6 => pragma solidity ^0.8.12;\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IPaymaster.sol#L2 => pragma solidity ^0.8.12;\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IStakeManager.sol#L2 => pragma solidity ^0.8.12;\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/SenderCreator.sol#L2 => pragma solidity ^0.8.12;\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/StakeManager.sol#L2 => pragma solidity ^0.8.12;\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/UserOperation.sol#L2 => pragma solidity ^0.8.12;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "05-ajna", "title": "wonjun Q", "severity_raw": "Low", "severity": "low", "description": "[L-1] events are missing an important parameter\nThe callers of these important functions are not published in emits.\n\nInstances (3):\n```\nemit FundTreasury(fundingAmount\\_, treasury);\n```\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/GrantFund.sol#L64\n```\nemit QuarterlyDistributionStarted(\n newDistributionId\\_,\n startBlock,\n endBlock\n);\n```\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L159\n```\nemit MoveStakedLiquidity(tokenId*, fromBuckets*, toBuckets\\_);\n```\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/RewardsManager.sol#L187\n\n\nAdd caller to events. Add msg.sender parameter in event-emits.\n\n\n[N-1] Invalid comments\n\nInstances (2):\n\n@notice User attempted to execute a proposal before the distribution period ended\n->\n@notice User attempted to start a new distribution period before the distribution period ended\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/interfaces/IStandardFunding.sol#L16\n\n@dev Mapping of `token id => ajna pool address` for which token was minted.\n->\n@dev A nested mapping of `token id => bucket index => Position` for each token's associated position in a bucket.\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/PositionManager.sol#L54\n\n[N-2] Spellcheck\n\nInstances (4):\n\nThe to -> The distributionId to\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/interfaces/IStandardFunding.sol#L263\n\nchallengephase -> challenge phase\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L30\n\nit's -> its\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/interfaces/IStandardFunding.sol#L325\n\nit's -> its\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/interfaces/IStandardFunding.sol#L327\n\nConsider using tools like the VSCode extension 'Code Spell Checker' or similar to help catc", "vulnerable_code": "emit FundTreasury(fundingAmount\\_, treasury);", "fixed_code": "emit QuarterlyDistributionStarted(\n newDistributionId\\_,\n startBlock,\n endBlock\n);", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/wonjun-Q.md", "collected_at": "2026-01-02T18:21:52.115444+00:00", "source_hash": "44c2609a4e99761417cf411532245e7536e4cd7efc82ba49e87a71a2fa5da2c5", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 198, "github_ref_count": 9, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "emit FundTreasury(fundingAmount\\_, treasury);", "primary_code_language": "unknown", "primary_code_char_count": 45, "all_code_blocks": "// Code block 1 (unknown):\nemit FundTreasury(fundingAmount\\_, treasury);\n\n// Code block 2 (unknown):\nemit QuarterlyDistributionStarted(\n newDistributionId\\_,\n startBlock,\n endBlock\n);\n\n// Code block 3 (unknown):\nemit MoveStakedLiquidity(tokenId*, fromBuckets*, toBuckets\\_);", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "GrantFund.sol#L64, StandardFunding.sol#L159, RewardsManager.sol#L187, IStandardFunding.sol#L16, PositionManager.sol#L54, IStandardFunding.sol#L263, StandardFunding.sol#L30, IStandardFunding.sol#L325, IStandardFunding.sol#L327", "github_files_list": "GrantFund.sol, IStandardFunding.sol, PositionManager.sol, StandardFunding.sol, RewardsManager.sol", "github_refs_count": 9, "vulnerable_code_actual": "emit FundTreasury(fundingAmount\\_, treasury);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "emit QuarterlyDistributionStarted(\n newDistributionId\\_,\n startBlock,\n endBlock\n);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "02-ai-arena", "title": "Raihan G", "severity_raw": "Critical", "severity": "critical", "description": "# GAS OPTIMIZATION\n\n# SUMMARY\n| | issue | instance |\n|------|---------|------------|\n|[G\u201101]|Most important: avoid zero to one storage writes where possible|10|\n|[G\u201102]|Using mappings instead of arrays to avoid length checks|2|\n|[G\u201103]|Use storage pointers instead of memory where appropriate|1|\n|[G\u201104]|Use assembly to perform efficient back-to-back calls|5|\n|[G\u201105]|Avoid emitting storage values|3|\n|[G\u201106]|Structs can be modified to fit in fewer storage slots|1|\n|[G\u201107]|Pre-increment and pre-decrement are cheaper than\u00a0+1 ,-1|11|\n|[G\u201108]|Gas Optimization: Favor Ternary Operation Over If-Else Statement|2|\n|[G\u201109]|Consider using OZ EnumerateSet in place of nested mappings|8|\n|[G\u201110]|Don\u2019t make variables public unless it is necessary to do so|2|\n|[G\u201111]|It is sometimes cheaper to cache calldata|1|\n|[G\u201112]|Gas Optimization: Use Assembly for Writing Address Storage Values|9|\n|[G\u201113]|Sort Solidity operations using short-circuit mode|1|\n|[G\u201114]|Expressions for constant values such as a call to keccak256(), should use immutable rather than constant|3|\n|[G\u201115]|Do not calculate constants|3|\n|[G\u201116]|Avoid having ERC20 token balances go to zero, always keep a small amount|3|\n|[G\u201117]|ERC1155 is a cheaper non-fungible token than ERC721|2|\n|[G\u201118]|Use one ERC1155 or ERC6909 token instead of several ERC20 tokens|1|\n|[G\u201119]|Consider using alternatives to OpenZeppelin|7|\n|[G\u201120]|Using assembly to revert with an error message|17|\n|[G\u201121]|Common math operations, like min and max have gas efficient alternatives|1|\n\n## [G-01] Most important: avoid zero to one storage writes where possible\nInitializing a storage variable is one of the most expensive operations a contract can do.\nWhen a storage variable goes from zero to non-zero, the user must pay 22,100 gas total (20,000 gas for a zero to non-zero write and 2,100 for a cold storage access).\nThis is why the Openzeppelin reentrancy guard registers functions as active or not with 1 and 2 rather than 0 and 1. It only costs 5,000 gas t", "vulnerable_code": "File: src/GameItems.sol\n64 uint256 _itemCount = 0; ", "fixed_code": "File: src/MergingPool.sol\n29 uint256 public roundId = 0;\n\n32 uint256 public totalPoints = 0; ", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/Raihan-G.md", "collected_at": "2026-01-02T19:02:40.254491+00:00", "source_hash": "4516d9ae18ed13bc5b6a2d2cf35a3a5f8bd27cd9b97cb03971a5327bd80318a6", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: src/GameItems.sol\n64 uint256 _itemCount = 0; ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: src/MergingPool.sol\n29 uint256 public roundId = 0;\n\n32 uint256 public totalPoints = 0; ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "02-ethos", "title": "eye Q", "severity_raw": "Low", "severity": "low", "description": "# Summary\n\nThe **setCollateralParams** function in the **CollateralConfig** contract in the **Ethos-Core** repository lacks input validation, which could allow an attacker to manipulate collateral parameters for a given asset.\n\n# Description\n\nThe **CollateralConfig** contract in the **Ethos-Core** repository is used to manage **collateral** parameters for different assets in the protocol. The **setCollateralParams** function in this contract is responsible for setting the collateral parameters for a given asset, including the **liquidationDiscount**, **liquidationRatio**, and **borrowingEnabled** parameters.\nHowever, the **setCollateralParams** function does not perform any input validation on the values passed as parameters. This means that an attacker could potentially pass in invalid or unexpected values for these parameters, which could allow them to manipulate the market for a given asset and potentially profit from their actions.\n\n# Snippet\n\n```\nfunction setCollateralParams(\n address collateralType,\n uint256 liquidationDiscount,\n uint256 liquidationRatio,\n bool borrowingEnabled\n) external onlyOwner {\n require(collateralType != address(0), \"CollateralConfig: invalid collateral type\");\n \n collateralTypes[collateralType].liquidationDiscount = liquidationDiscount;\n collateralTypes[collateralType].liquidationRatio = liquidationRatio;\n collateralTypes[collateralType].borrowingEnabled = borrowingEnabled;\n}\n\n```\n\n# Fix\n\nTo address this issue, input validation should be added to the setCollateralParams function to ensure that the values passed as parameters are valid and within acceptable ranges. This could include range checks, type checks, and other forms of input validation to ensure that the values passed as parameters are safe and secure.\n\nIn this example, a check has been added to ensure that the **liquidationDiscount** value is not greater than 100, which is the maximum value that this parameter can have. This check ensures that the in", "vulnerable_code": "function setCollateralParams(\n address collateralType,\n uint256 liquidationDiscount,\n uint256 liquidationRatio,\n bool borrowingEnabled\n) external onlyOwner {\n require(collateralType != address(0), \"CollateralConfig: invalid collateral type\");\n \n collateralTypes[collateralType].liquidationDiscount = liquidationDiscount;\n collateralTypes[collateralType].liquidationRatio = liquidationRatio;\n collateralTypes[collateralType].borrowingEnabled = borrowingEnabled;\n}\n", "fixed_code": "function setCollateralParams(\n address collateralType,\n uint256 liquidationDiscount,\n uint256 liquidationRatio,\n bool borrowingEnabled\n) external onlyOwner {\n require(collateralType != address(0), \"CollateralConfig: invalid collateral type\");\n\n // Validate the liquidation discount value\n require(liquidationDiscount <= 100, \"CollateralConfig: liquidation discount cannot exceed 100\");\n\n collateralTypes[collateralType].liquidationDiscount = liquidationDiscount;\n collateralTypes[collateralType].liquidationRatio = liquidationRatio;\n collateralTypes[collateralType].borrowingEnabled = borrowingEnabled;\n}\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/eye-Q.md", "collected_at": "2026-01-02T18:17:09.627682+00:00", "source_hash": "452a7cb0fc3dc7d366723ac8c97978c62ba00a1e1f1aeb66cfae83bc84e530b1", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 489, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function setCollateralParams(\n address collateralType,\n uint256 liquidationDiscount,\n uint256 liquidationRatio,\n bool borrowingEnabled\n) external onlyOwner {\n require(collateralType != address(0), \"CollateralConfig: invalid collateral type\");\n \n collateralTypes[collateralType].liquidationDiscount = liquidationDiscount;\n collateralTypes[collateralType].liquidationRatio = liquidationRatio;\n collateralTypes[collateralType].borrowingEnabled = borrowingEnabled;\n}", "primary_code_language": "unknown", "primary_code_char_count": 489, "all_code_blocks": "// Code block 1 (unknown):\nfunction setCollateralParams(\n address collateralType,\n uint256 liquidationDiscount,\n uint256 liquidationRatio,\n bool borrowingEnabled\n) external onlyOwner {\n require(collateralType != address(0), \"CollateralConfig: invalid collateral type\");\n \n collateralTypes[collateralType].liquidationDiscount = liquidationDiscount;\n collateralTypes[collateralType].liquidationRatio = liquidationRatio;\n collateralTypes[collateralType].borrowingEnabled = borrowingEnabled;\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function setCollateralParams(\n address collateralType,\n uint256 liquidationDiscount,\n uint256 liquidationRatio,\n bool borrowingEnabled\n) external onlyOwner {\n require(collateralType != address(0), \"CollateralConfig: invalid collateral type\");\n \n collateralTypes[collateralType].liquidationDiscount = liquidationDiscount;\n collateralTypes[collateralType].liquidationRatio = liquidationRatio;\n collateralTypes[collateralType].borrowingEnabled = borrowingEnabled;\n}\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function setCollateralParams(\n address collateralType,\n uint256 liquidationDiscount,\n uint256 liquidationRatio,\n bool borrowingEnabled\n) external onlyOwner {\n require(collateralType != address(0), \"CollateralConfig: invalid collateral type\");\n\n // Validate the liquidation discount value\n require(liquidationDiscount <= 100, \"CollateralConfig: liquidation discount cannot exceed 100\");\n\n collateralTypes[collateralType].liquidationDiscount = liquidationDiscount;\n collateralTypes[collateralType].liquidationRatio = liquidationRatio;\n collateralTypes[collateralType].borrowingEnabled = borrowingEnabled;\n}\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "09-ondo", "title": "peanuts Analysis", "severity_raw": "Medium", "severity": "medium", "description": "### 1. Any comments for the judge to contextualize your findings\n- Focused on the rUSDY and Destination Bridge contract, and followed through with all the test files for those contracts\n\n### 2. Approach taken in evaluating the codebase\n- Understood the relation between USDY,rUSDY and shares first, then check all the functions in rUSDY to make sure that they are working as intended and cannot be exploited easily\n- Run the test files of rUSDY and run some fuzz testing to make sure that wrap() and unwrap() works as intended with different time stamp and oracle price\n- Moved on to the source and destination bridge and ran the tests \n- Made sure that the test are properly written and focused on the setThresholds() function in Destination contract\n- Zoomed out and looked at all the contracts as a whole to check whether all contracts and imports are written correctly, and all contracts have the pause function as well as being protected by the modifier.\n\n### 3. Mechanism review\n- I don't think that rUSDY can be called a rebasing token because it is not pegged to USDY but rather to the dollar. Also, the price of rUSDY is taken from the oracle of USDY, so it's more like a vault token than a rebasing token\n- There is a part in the rUSDY contract that has a truncation to zero issue. If the shares passed into getRUSDYByShares() is less than 10,000 and the oracle returns the price of 1e18, then the price of RUSDYByShares will be zero. Minimal loss as only dust amounts will be lost \n\n```\n function getRUSDYByShares(uint256 _shares) public view returns (uint256) {\n return (_shares * oracle.getPrice()) / (1e18 * BPS_DENOMINATOR);\n }\n```\n- In the Destination contract, there is a heavy emphasis on restricting users from minting the token on the destination chain. The restriction includes having the need to have approvals and having a rate limiter with a maxTokenlimit \n```\n _checkAndUpdateInstantMintLimit(txn.amount);\n```\n\n### 4. Centralization Risk\n\n- The owner can burn the r", "vulnerable_code": " function getRUSDYByShares(uint256 _shares) public view returns (uint256) {\n return (_shares * oracle.getPrice()) / (1e18 * BPS_DENOMINATOR);\n }", "fixed_code": " _checkAndUpdateInstantMintLimit(txn.amount);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/peanuts-Analysis.md", "collected_at": "2026-01-02T18:26:12.209390+00:00", "source_hash": "45537265694106f7140ea24a426223d9ec844d19932b73e7fdfea7edcfc73b03", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 191, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function getRUSDYByShares(uint256 _shares) public view returns (uint256) {\n return (_shares * oracle.getPrice()) / (1e18 * BPS_DENOMINATOR);\n }", "primary_code_language": "unknown", "primary_code_char_count": 147, "all_code_blocks": "// Code block 1 (unknown):\nfunction getRUSDYByShares(uint256 _shares) public view returns (uint256) {\n return (_shares * oracle.getPrice()) / (1e18 * BPS_DENOMINATOR);\n }\n\n// Code block 2 (unknown):\n_checkAndUpdateInstantMintLimit(txn.amount);", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function getRUSDYByShares(uint256 _shares) public view returns (uint256) {\n return (_shares * oracle.getPrice()) / (1e18 * BPS_DENOMINATOR);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " _checkAndUpdateInstantMintLimit(txn.amount);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ethos", "title": "Rolezn G", "severity_raw": "High", "severity": "high", "description": "## Summary\n\n### Gas Optimizations\n| |Issue|Contexts|Estimated Gas Saved|\n|-|:-|:-|:-:|\n| [GAS‑1](#GAS‑1) | `abi.encode()` is less efficient than `abi.encodepacked()` | 2 | 200 |\n| [GAS‑2](#GAS‑2) | Setting the `constructor` to `payable` | 4 | 52 |\n| [GAS‑3](#GAS‑3) | Do not calculate constants | 2 | - |\n| [GAS‑4](#GAS‑4) | Duplicated `require()`/`revert()` Checks Should Be Refactored To A Modifier Or Function | 6 | 168 |\n| [GAS‑5](#GAS‑5) | Using fixed bytes is cheaper than using `string` | 9 | - |\n| [GAS‑6](#GAS‑6) | Using `delete` statement can save gas | 19 | - |\n| [GAS‑7](#GAS‑7) | Use `assembly` to write address storage values | 2 | - |\n| [GAS‑8](#GAS‑8) | Use hardcoded address instead `address(this)` | 34 | - |\n| [GAS‑9](#GAS‑9) | `internal` functions only called once can be inlined to save gas | 4 | 88 |\n| [GAS‑10](#GAS‑10) | Optimize names to save gas | 11 | 242 |\n| [GAS‑11](#GAS‑11) | ` += ` Costs More Gas Than ` = + ` For State Variables | 21 | - |\n| [GAS‑12](#GAS‑12) | Structs can be packed into fewer storage slots by editing time variables and uint variables | 1 | 8000 |\n| [GAS‑13](#GAS‑13) | Public Functions To External | 28 | - |\n| [GAS‑14](#GAS‑14) | `require()` Should Be Used Instead Of `assert()` | 20 | - |\n| [GAS‑15](#GAS‑15) | Save gas with the use of specific import statements | 96 | - |\n| [GAS‑16](#GAS‑16) | Shorten the array rather than copying to a new one | 4 | - |\n| [GAS‑17](#GAS‑17) | State variables can be packed into fewer storage slots | 1 | 2000 |\n| [GAS‑18](#GAS‑18) | Help The Optimizer By Saving A Storage Variable\u2019s Reference Instead Of Repeatedly Fetching It | 9 | - |\n| [GAS‑19](#GAS‑19) | Superfluous event fields | 1 | - |\n| [GAS‑2", "vulnerable_code": "284: domainSeparator(), keccak256(abi.encode(", "fixed_code": "305: return keccak256(abi.encode(typeHash, name, version, _chainID(), address(this)));", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/Rolezn-G.md", "collected_at": "2026-01-02T18:16:35.096743+00:00", "source_hash": "4597f047cd94c3a9b8ed958b9794a2dd7c9e08138d754b7c01d4bea13b4ee671", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "284: domainSeparator(), keccak256(abi.encode(", "has_vulnerable_code_snippet": true, "fixed_code_actual": "305: return keccak256(abi.encode(typeHash, name, version, _chainID(), address(this)));", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "04-caviar", "title": "ABA Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA Report for Caviar Private Pools contest\n\n## Overview\nDuring the audit, 3 low, 6 refactoring and 1 non-critical issues were found.\n\n### Low Risk Issues\n\nTotal: 10 instances over 3 issues\n\n|#|Issue|Instances|\n|-|:-|:-:|\n| [L-01] | Input is not checked when setting sensitive addresses across protocol | 4 |\n| [L-02] | Any leftover ETH on `EthRouter` can be taken with empty buy/change orders | 2 |\n| [L-03] | Precision loss on royalties payments | 4 |\n\n### Refactoring Issues\n\nTotal: 10 instances over 6 issues\n\n|#|Issue|Instances|\n|-|:-|:-:|\n| [R-01]| Events missing key information | 3 |\n| [R-02]| Inconsistent checks for `royaltyRecipient` | 2 |\n| [R-03]| Reuse `getRoyalty` implementation | 2 |\n| [R-04]| Use a constant for the flashLoan callback keccak256 | 1 |\n| [R-05]| Combine royalty transfer logic and ERC721 transfer logic in `PrivatePool`'s `buy` function | 1 |\n| [R-06]| `buyQuote` reverts with arithmetic underflow instead of meaningful message | 1 |\n\n### Non-critical Issues\n\nTotal: 2 instances over 1 issues\n\n|#|Issue|Instances|\n|-|:-|:-:|\n| [NC-01]| misleading or incorrect documentation | 2 |\n\n#\n## Low Risk Issues (3)\n#\n\n### [L-01] Input is not checked when setting sensitive addresses across protocol\n##### Description\n\n- in `Factory`, when setting the `privatePoolMetadata` or `privatePoolImplementation` addresses, there is no check if the new address is 0 or that it is actually a contract.\n- in `EthRouter` when deploying the contract, the `royaltyRegistry` variable is set, but not checked if the provided address is 0 or that it is actually a contract.\n- in `PrivatePool` when deploying the contract, the factory, royaltyRegistry and stolenNftOracle are set but not checked if the provided address is 0 or that it is actually a contract.\n\n##### Instances (4)\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/Factory.sol#L127-L137\n```Solidity\n /// @notice Sets private pool metadata contract.\n /// @param _privatePoolMetadata The private pool metadata con", "vulnerable_code": " /// @notice Sets private pool metadata contract.\n /// @param _privatePoolMetadata The private pool metadata contract.\n function setPrivatePoolMetadata(address _privatePoolMetadata) public onlyOwner {\n privatePoolMetadata = _privatePoolMetadata;\n }", "fixed_code": " function buy(Buy[] calldata buys, uint256 deadline, bool payRoyalties) public payable {\n // check that the deadline has not passed (if any)\n if (block.timestamp > deadline && deadline != 0) {\n revert DeadlinePassed();\n }\n\n\n // loop through and execute the the buys\n for (uint256 i = 0; i < buys.length; i++) {\n // as buys ca be empty this code block is skipped\n }\n\n // refund any surplus ETH to the caller\n if (address(this).balance > 0) {\n msg.sender.safeTransferETH(address(this).balance);\n }\n } ", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/ABA-Q.md", "collected_at": "2026-01-02T18:19:25.769874+00:00", "source_hash": "465eb3283ee04b12e3e3392e356e80ba86264aac4943d215fc82a914327e1b9d", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Factory.sol#L127-L137", "github_files_list": "Factory.sol", "github_refs_count": 1, "vulnerable_code_actual": " /// @notice Sets private pool metadata contract.\n /// @param _privatePoolMetadata The private pool metadata contract.\n function setPrivatePoolMetadata(address _privatePoolMetadata) public onlyOwner {\n privatePoolMetadata = _privatePoolMetadata;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function buy(Buy[] calldata buys, uint256 deadline, bool payRoyalties) public payable {\n // check that the deadline has not passed (if any)\n if (block.timestamp > deadline && deadline != 0) {\n revert DeadlinePassed();\n }\n\n\n // loop through and execute the the buys\n for (uint256 i = 0; i < buys.length; i++) {\n // as buys ca be empty this code block is skipped\n }\n\n // refund any surplus ETH to the caller\n if (address(this).balance > 0) {\n msg.sender.safeTransferETH(address(this).balance);\n }\n } ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "03-asymmetry", "title": "Rickard Q", "severity_raw": "Critical", "severity": "critical", "description": "# [L-01] Use `safeTransferOwnership` instead of `_transferOwnership` function\n## Lines of code\n[https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol#L34](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol#L34) \n[https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L53](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L53) \n[https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L43](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L43) \n[https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol#L37](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol#L37)\n## Vulnerability details\n`_transferOwnership` function is used to change Ownership from `OwnableUpgradeable.sol`. \n \nUse a 2 structure `_transferOwnership` which is safer. `safeTransferOwnership`, use is more secure due to 2-stage ownership transfer.\n### Recommended Mitigation Steps\nUse [Ownable2Step.sol](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable2Step.sol).\n\n# [L-02] Lack of checks `address(0)`\n## Lines of code\n[https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L93-L94](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L93-L94)\n## Vulnerability details\nThe following methods have a lack of checks if the received argument is an address, it\u2019s good practice in order to reduce human error to check that the address specified in the constructor or initialize is different than `address(0)`.\n\n# [L-03] Missing ReEntrancy Guard to withdraw function\n## Lines of code\n[https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts", "vulnerable_code": "contracts/SafEth/derivatives/Reth.sol\n function withdraw(uint256 amount) external onlyOwner {\n RocketTokenRETHInterface(rethAddress()).burn(amount);\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n }\n\ncontracts/SafEth/derivatives/SfrxEth.sol\n function withdraw(uint256 _amount) external onlyOwner {\n IsFrxEth(SFRX_ETH_ADDRESS).redeem(\n _amount,\n address(this),\n address(this)\n );\n uint256 frxEthBalance = IERC20(FRX_ETH_ADDRESS).balanceOf(\n address(this)\n );\n IsFrxEth(FRX_ETH_ADDRESS).approve(\n FRX_ETH_CRV_POOL_ADDRESS,\n frxEthBalance\n );\n\n\n uint256 minOut = (((ethPerDerivative(_amount) * _amount) / 10 ** 18) *\n (10 ** 18 - maxSlippage)) / 10 ** 18;\n\n\n IFrxEthEthPool(FRX_ETH_CRV_POOL_ADDRESS).exchange(\n 1,\n 0,\n frxEthBalance,\n minOut\n );\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n }\n \ncontracts/SafEth/derivatives/WstEth.sol\n function withdraw(uint256 _amount) external onlyOwner {\n IWStETH(WST_ETH).unwrap(_amount);\n uint256 stEthBal = IERC20(STETH_TOKEN).balanceOf(address(this));\n IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);\n uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n }", "fixed_code": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\ncontract ReEntrancyGuard {\n bool internal locked;\n modifier noReentrant() {\n require(!locked, \"No re-entrancy\");\n locked = true;\n _;\n locked = false;\n }\n}", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Rickard-Q.md", "collected_at": "2026-01-02T18:18:29.223782+00:00", "source_hash": "467d62f847f672990781b9d5fab6993d6e12f9fd92831a74b7b31e38df29ecc2", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "WstEth.sol#L34, SafEth.sol#L53, Reth.sol#L43, SfrxEth.sol#L37, Ownable2Step.sol, Reth.sol#L93-L94", "github_files_list": "SfrxEth.sol, Reth.sol, WstEth.sol, SafEth.sol, Ownable2Step.sol", "github_refs_count": 6, "vulnerable_code_actual": "contracts/SafEth/derivatives/Reth.sol\n function withdraw(uint256 amount) external onlyOwner {\n RocketTokenRETHInterface(rethAddress()).burn(amount);\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n }\n\ncontracts/SafEth/derivatives/SfrxEth.sol\n function withdraw(uint256 _amount) external onlyOwner {\n IsFrxEth(SFRX_ETH_ADDRESS).redeem(\n _amount,\n address(this),\n address(this)\n );\n uint256 frxEthBalance = IERC20(FRX_ETH_ADDRESS).balanceOf(\n address(this)\n );\n IsFrxEth(FRX_ETH_ADDRESS).approve(\n FRX_ETH_CRV_POOL_ADDRESS,\n frxEthBalance\n );\n\n\n uint256 minOut = (((ethPerDerivative(_amount) * _amount) / 10 ** 18) *\n (10 ** 18 - maxSlippage)) / 10 ** 18;\n\n\n IFrxEthEthPool(FRX_ETH_CRV_POOL_ADDRESS).exchange(\n 1,\n 0,\n frxEthBalance,\n minOut\n );\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n }\n \ncontracts/SafEth/derivatives/WstEth.sol\n function withdraw(uint256 _amount) external onlyOwner {\n IWStETH(WST_ETH).unwrap(_amount);\n uint256 stEthBal = IERC20(STETH_TOKEN).balanceOf(address(this));\n IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);\n uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\ncontract ReEntrancyGuard {\n bool internal locked;\n modifier noReentrant() {\n require(!locked, \"No re-entrancy\");\n locked = true;\n _;\n locked = false;\n }\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "02-ethos", "title": "2997ms G", "severity_raw": "Gas", "severity": "gas", "description": "## [G-01] Remove the `initializer` modifier\n\nIf we can just ensure that the `initialize()` function could only be called from within the constructor, we shouldn\u2019t need to worry about it getting called again.\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/34ba1e7dd2d259f06f9d5fa13f5d96be7829ff34/Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol#L63\n\nIn the EVM, the constructor\u2019s job is actually to return the bytecode that will live at the contract\u2019s address. So, while inside a constructor, your address `(address(this))` will be the deployment address, but there will be no bytecode at that address. So if we check `address(this).code.length` before the constructor has finished, even from within a delegatecall, we will get 0. So now let\u2019s update our `initialize()` function to only run if we are inside a constructor:\n\n```\n function initialize(\n address _vault,\n address[] memory _strategists,\n address[] memory _multisigRoles,\n IAToken _gWant\n ) public initializer { \n+ require(address(this).code.length == 0, 'not in constructor');\n```\n\nNow the Proxy contract\u2019s constructor can still delegatecall initialize(), but if anyone attempts to call it again (after deployment) through the Proxy instance, or tries to call it directly on the above instance, it will revert because address(this).code.length will be nonzero.\n\nAlso, because we no longer need to write to any state to track whether initialize() has been called, we can avoid the 20k storage gas cost. In fact, the cost for checking our own code size is only 2 gas, which means we have a 10,000x gas savings over the standard version. Pretty neat.\n\n\n\n## [G-02] Reduce the size of error messages (Long revert Strings)\n\nShortening revert strings to fit in 32 bytes will decrease deployment time gas and will decrease runtime gas when the revert condition is met.\n\nRevert strings that are longer than 32 bytes require at least one additional mstore, along with additional overhead for com", "vulnerable_code": " function initialize(\n address _vault,\n address[] memory _strategists,\n address[] memory _multisigRoles,\n IAToken _gWant\n ) public initializer { \n+ require(address(this).code.length == 0, 'not in constructor');", "fixed_code": "", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/2997ms-G.md", "collected_at": "2026-01-02T18:15:54.563574+00:00", "source_hash": "468bfd1aeae3fe184d460e9e0f1d5f37e3a52f645c626e4285e5459af6e89693", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 250, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function initialize(\n address _vault,\n address[] memory _strategists,\n address[] memory _multisigRoles,\n IAToken _gWant\n ) public initializer { \n+ require(address(this).code.length == 0, 'not in constructor');", "primary_code_language": "unknown", "primary_code_char_count": 250, "all_code_blocks": "// Code block 1 (unknown):\nfunction initialize(\n address _vault,\n address[] memory _strategists,\n address[] memory _multisigRoles,\n IAToken _gWant\n ) public initializer { \n+ require(address(this).code.length == 0, 'not in constructor');", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ReaperStrategyGranarySupplyOnly.sol#L63", "github_files_list": "ReaperStrategyGranarySupplyOnly.sol", "github_refs_count": 1, "vulnerable_code_actual": " function initialize(\n address _vault,\n address[] memory _strategists,\n address[] memory _multisigRoles,\n IAToken _gWant\n ) public initializer { \n+ require(address(this).code.length == 0, 'not in constructor');", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "02-ethos", "title": "favelanky G", "severity_raw": "High", "severity": "high", "description": "## Summary\n\n### Gas Optimizations\n| | Issue | Instances | Total Gas Saved |\n| ------------- |:-------------------------------------------------------------------------------------------- |:---------:|:---------------:|\n| [G-01] | `require()`\u00a0\u00a0statements that check input arguments should be at the top of the function | 11 | >2100 |\n| [G-02] | Use \u00a0`require`\u00a0instead of\u00a0`assert` | 20 | - |\n| [G-03] | `internal`\u00a0functions only called once can be inlined to save gas | 28 | 560 |\n| [G-04] | Structs can be packed into fewer storage slots | 6 | 12000 |\n| [G-05] | Using fixed `bytes` is cheaper than using\u00a0`string` | 6 | - |\n| [G-06] | State variables should be cached in stack variables rather than re-reading them from storage | 12 | ~1200 |\n| [G-07] | Splitting require() statements that use && saves gas | 7 | 21 |\n| [G-08] | Multiple address mappings can be combined into a single mapping of an address to a struct, where appropriate | 3 | - |\n\nTotal: 93 instances over 8 issues with >15881 **gas** saved.\n\n## Gas Optimizations:\n\n### [G-01] `require()`\u00a0\u00a0statements that check input arguments should be at the top of the function\n\nChecks that involve constants should come before checks that involve state variables, function calls, and calculations. By doing these checks first, the function is able to revert before wasting a Gcoldsload (**2100 gas**) in a function that may ultimately revert in the unhappy case.\n\n_There are 11 instance of this issue:_\n\n```Solidity\nFile: contracts/CollateralConfig.sol\n\n66: require(_MCRs[i] >= MIN_ALLOWED_MCR, \"MCR", "vulnerable_code": "File: contracts/CollateralConfig.sol\n\n66: require(_MCRs[i] >= MIN_ALLOWED_MCR, \"MCR below allowed minimum\");\n\n69: require(_CCRs[i] >= MIN_ALLOWED_CCR, \"CCR below allowed minimum\");\n\n94: require(_MCR >= MIN_ALLOWED_MCR, \"MCR below allowed minimum\");\n\n97: require(_CCR >= MIN_ALLOWED_CCR, \"CCR below allowed minimum\");", "fixed_code": "File: contracts/ActivePool.sol\n\n93: require(_treasuryAddress != address(0), \"Treasury cannot be 0 address\");\n\n107: require(numCollaterals == _erc4626vaults.length, \"Vaults array length must match number of collaterals\");\n\n111: require(IERC4626(vault).asset() == collateral, \"Vault asset must be collateral\");\n\n127: require(_bps <= 10_000, \"Invalid BPS value\");\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/favelanky-G.md", "collected_at": "2026-01-02T18:17:11.414959+00:00", "source_hash": "469e3e55d43d514359b957524b6fadb751c167c822dae3f5b8ba6f62ae454b3d", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: contracts/CollateralConfig.sol\n\n66: require(_MCRs[i] >= MIN_ALLOWED_MCR, \"MCR below allowed minimum\");\n\n69: require(_CCRs[i] >= MIN_ALLOWED_CCR, \"CCR below allowed minimum\");\n\n94: require(_MCR >= MIN_ALLOWED_MCR, \"MCR below allowed minimum\");\n\n97: require(_CCR >= MIN_ALLOWED_CCR, \"CCR below allowed minimum\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/ActivePool.sol\n\n93: require(_treasuryAddress != address(0), \"Treasury cannot be 0 address\");\n\n107: require(numCollaterals == _erc4626vaults.length, \"Vaults array length must match number of collaterals\");\n\n111: require(IERC4626(vault).asset() == collateral, \"Vault asset must be collateral\");\n\n127: require(_bps <= 10_000, \"Invalid BPS value\");\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-biconomy", "title": "debo Q", "severity_raw": "Medium", "severity": "medium", "description": "## [L-01]\nSWC-115 Authorization through tx.origin\n\n\nFile\n```\n/contracts/smart-contract-wallet/SmartAccount.sol\n```\n\nURL\n```\nhttps://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L257\n```\n\nTransaction origin\n```\nUse of tx.origin: \"tx.origin\" is useful only in very exceptional cases. \nIf you use it for authentication, you usually want to replace it by \"msg.sender\", because otherwise any contract you call can act on your behalf.\nUsing \"tx.origin\" as a security control can lead to authorization bypass vulnerabilities. Consider using \"msg.sender\" unless you really know what you are doing.\n```\n\nPoC\nCurrent code\n```\naddress payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\n```\n\nRemediation\ntx.origin should not be used for authorization. Use msg.sender instead.\n```\naddress payable receiver = refundReceiver == address(0) ? payable(msg.sender) : refundReceiver;\n```\n\n\n## [L-02]\nSWC-115 Authorization through tx.origin\n\n\nFile\n```\n/contracts/smart-contract-wallet/SmartAccount.sol\n```\n\nURL\n```\nhttps://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L281\n```\n\nTransaction origin\n```\nUse of tx.origin: \"tx.origin\" is useful only in very exceptional cases. \nIf you use it for authentication, you usually want to replace it by \"msg.sender\", because otherwise any contract you call can act on your behalf.\nUsing \"tx.origin\" as a security control can lead to authorization bypass vulnerabilities. Consider using \"msg.sender\" unless you really know what you are doing.\n```\n\nPoC\nCurrent code\n```\naddress payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\n```\n\nRemediation\ntx.origin should not be used for authorization. Use msg.sender instead.\n```\naddress payable receiver = refundReceiver == address(0) ? payable(msg.sender) : refu", "vulnerable_code": "/contracts/smart-contract-wallet/SmartAccount.sol", "fixed_code": "https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L257", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/debo-Q.md", "collected_at": "2026-01-02T18:13:41.861379+00:00", "source_hash": "46e23736b1095a357c6a4b76d5ae8bfb1a386f468e7abc468341d29c22700d8a", "code_block_count": 9, "solidity_block_count": 0, "total_code_chars": 1459, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "/contracts/smart-contract-wallet/SmartAccount.sol", "primary_code_language": "unknown", "primary_code_char_count": 49, "all_code_blocks": "// Code block 1 (unknown):\n/contracts/smart-contract-wallet/SmartAccount.sol\n\n// Code block 2 (unknown):\nhttps://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L257\n\n// Code block 3 (unknown):\nUse of tx.origin: \"tx.origin\" is useful only in very exceptional cases. \nIf you use it for authentication, you usually want to replace it by \"msg.sender\", because otherwise any contract you call can act on your behalf.\nUsing \"tx.origin\" as a security control can lead to authorization bypass vulnerabilities. Consider using \"msg.sender\" unless you really know what you are doing.\n\n// Code block 4 (unknown):\naddress payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\n\n// Code block 5 (unknown):\naddress payable receiver = refundReceiver == address(0) ? payable(msg.sender) : refundReceiver;\n\n// Code block 6 (unknown):\n/contracts/smart-contract-wallet/SmartAccount.sol\n\n// Code block 7 (unknown):\nhttps://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L281\n\n// Code block 8 (unknown):\nUse of tx.origin: \"tx.origin\" is useful only in very exceptional cases. \nIf you use it for authentication, you usually want to replace it by \"msg.sender\", because otherwise any contract you call can act on your behalf.\nUsing \"tx.origin\" as a security control can lead to authorization bypass vulnerabilities. Consider using \"msg.sender\" unless you really know what you are doing.\n\n// Code block 9 (unknown):\naddress payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;", "all_code_blocks_count": 9, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SmartAccount.sol#L257, SmartAccount.sol#L281", "github_files_list": "SmartAccount.sol", "github_refs_count": 2, "vulnerable_code_actual": "/contracts/smart-contract-wallet/SmartAccount.sol", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 14} {"source": "c4", "protocol": "04-caviar", "title": "MatricksDeCoder G", "severity_raw": "Low", "severity": "low", "description": "#### Gas-1 Make constructor payable to save on deployment costs \n\nGas savings can be achieved by making constructors payable can cut out about 10 opcodes which allow for the check if(msg.value != 0) revert();\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L90\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/Factory.sol#L53\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L143\n\n#### Gas-2 Use private for constants or immutable variables \n\nMaking such variables avoids the overhead cost of compiler creating getter functions for these variables\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L86\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L119\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L122\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L125\n\n#### Gas-3 Public functions not called in contract should be declared as external \n\nExternal functions can read directly from calldata avoiding copying arguments from memory \n\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L99\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L152\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L219\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L254\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L301\n\n#### Gas-4 Use more efficient abi.encodePacked vs abi.encode\n\n", "vulnerable_code": "virtualBaseTokenReserves = virtualBaseTokenReserves + uint128(netInputAmount - feeAmount - protocolFeeAmount);", "fixed_code": "virtualBaseTokenReserves = virtualBaseTokenReserves + uint128(netInputAmount - feeAmount - protocolFeeAmount);\nvirtualNftReserves = virtualNftReserves - uint128(weightSum);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/MatricksDeCoder-G.md", "collected_at": "2026-01-02T18:19:51.645307+00:00", "source_hash": "46f3f1004cd5e7cd26a40be1d904efcf992bf7fcf5c0db61565833b3a8f864b8", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 12, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "EthRouter.sol#L90, Factory.sol#L53, PrivatePool.sol#L143, EthRouter.sol#L86, PrivatePool.sol#L119, PrivatePool.sol#L122, PrivatePool.sol#L125, EthRouter.sol#L99, EthRouter.sol#L152, EthRouter.sol#L219, EthRouter.sol#L254, EthRouter.sol#L301", "github_files_list": "EthRouter.sol, Factory.sol, PrivatePool.sol", "github_refs_count": 12, "vulnerable_code_actual": "virtualBaseTokenReserves = virtualBaseTokenReserves + uint128(netInputAmount - feeAmount - protocolFeeAmount);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "virtualBaseTokenReserves = virtualBaseTokenReserves + uint128(netInputAmount - feeAmount - protocolFeeAmount);\nvirtualNftReserves = virtualNftReserves - uint128(weightSum);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "09-ondo", "title": "debo Q", "severity_raw": "Medium", "severity": "medium", "description": "## [L-01] Block values as a proxy for time\nDescription\nContracts often need access to time values to perform certain types of functionality. Values such as block.timestamp, and block.number can give you a sense of the current time or a time delta, however, they are not safe to use for most purposes.\n\nIn the case of block.timestamp, developers often attempt to use it to trigger time-dependent events. As Ethereum is decentralized, nodes can synchronize time only to some degree. Moreover, malicious miners can alter the timestamp of their blocks, especially if they can gain advantages by doing so. However, miners can't set a timestamp smaller than the previous one (otherwise the block will be rejected), nor can they set the timestamp too far ahead in the future. Taking all of the above into consideration, developers can't rely on the preciseness of the provided timestamp.\n\n```txt\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/rwaOracles/RWADynamicOracle.sol#L64\n timestamp = block.timestamp;\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/rwaOracles/RWADynamicOracle.sol#L79-L83\n if (range.start <= block.timestamp) {\n if (range.end <= block.timestamp) {\n return derivePrice(range, range.end - 1);\n } else {\n return derivePrice(range, block.timestamp);\n```\n\nRemediation\nDevelopers should write smart contracts with the notion that block values are not precise, and the use of them can lead to unexpected effects. Alternatively, they may make use oracles.\n\n## [L-02] Unsafe erc20 operations\nDescription\nERC20 operations can be unsafe due to different implementations and vulnerabilities in the standard.\n\nIt is therefore recommended to always either use OpenZeppelin's SafeERC20 library or at least to wrap each operation in a require statement.\n\nTo circumvent ERC20's approve functions race-condition vulnerability use OpenZeppelin's SafeERC20 l", "vulnerable_code": "Remediation\nDevelopers should write smart contracts with the notion that block values are not precise, and the use of them can lead to unexpected effects. Alternatively, they may make use oracles.\n\n## [L-02] Unsafe erc20 operations\nDescription\nERC20 operations can be unsafe due to different implementations and vulnerabilities in the standard.\n\nIt is therefore recommended to always either use OpenZeppelin's SafeERC20 library or at least to wrap each operation in a require statement.\n\nTo circumvent ERC20's approve functions race-condition vulnerability use OpenZeppelin's SafeERC20 library's safe{Increase|Decrease}Allowance functions.\n\nIn case the vulnerability is of no danger for your implementation, provide enough documentation explaining the reasonings.", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/debo-Q.md", "collected_at": "2026-01-02T18:25:53.818868+00:00", "source_hash": "46f7e1c58b9ce3dbb7ad2d6b804c0375430d73ad696f257dd8fa036b92bf16d1", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 518, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "https://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/rwaOracles/RWADynamicOracle.sol#L64\n timestamp = block.timestamp;\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/rwaOracles/RWADynamicOracle.sol#L79-L83\n if (range.start <= block.timestamp) {\n if (range.end <= block.timestamp) {\n return derivePrice(range, range.end - 1);\n } else {\n return derivePrice(range, block.timestamp);", "primary_code_language": "txt", "primary_code_char_count": 518, "all_code_blocks": "// Code block 1 (txt):\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/rwaOracles/RWADynamicOracle.sol#L64\n timestamp = block.timestamp;\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/rwaOracles/RWADynamicOracle.sol#L79-L83\n if (range.start <= block.timestamp) {\n if (range.end <= block.timestamp) {\n return derivePrice(range, range.end - 1);\n } else {\n return derivePrice(range, block.timestamp);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "RWADynamicOracle.sol#L64, RWADynamicOracle.sol#L79-L83", "github_files_list": "RWADynamicOracle.sol", "github_refs_count": 2, "vulnerable_code_actual": "Remediation\nDevelopers should write smart contracts with the notion that block values are not precise, and the use of them can lead to unexpected effects. Alternatively, they may make use oracles.\n\n## [L-02] Unsafe erc20 operations\nDescription\nERC20 operations can be unsafe due to different implementations and vulnerabilities in the standard.\n\nIt is therefore recommended to always either use OpenZeppelin's SafeERC20 library or at least to wrap each operation in a require statement.\n\nTo circumvent ERC20's approve functions race-condition vulnerability use OpenZeppelin's SafeERC20 library's safe{Increase|Decrease}Allowance functions.\n\nIn case the vulnerability is of no danger for your implementation, provide enough documentation explaining the reasonings.", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "09-ondo", "title": "zhaojie Q", "severity_raw": "Low", "severity": "low", "description": "## DestinationBridge.approve without checking txnHash exists\n\n\nDestinationBridge.approve without checking txnHash exists leads to skip _checkThresholdMet permission check.\n\nThis does not cause any problems at present, but errors may be introduced during the subsequent upgrade. Therefore, advised to check whether txnHash exists.\n\n```\n function _approve(bytes32 txnHash) internal {\n // Check that the approver has not already approved\n TxnThreshold storage t = txnToThresholdSet[txnHash];\n if (t.approvers.length > 0) {\n for (uint256 i = 0; i < t.approvers.length; ++i) {\n if (t.approvers[i] == msg.sender) {\n revert AlreadyApproved();\n }\n }\n }\n //@audit when txnHash not exists t.approvers was added\n t.approvers.push(msg.sender);\n }\n```\n```\n\n function _checkThresholdMet(bytes32 txnHash) internal view returns (bool) {\n TxnThreshold memory t = txnToThresholdSet[txnHash];\n //@audit t.numberOfApprovalsNeeded = 0 _checkThresholdMet return true\n if (t.numberOfApprovalsNeeded <= t.approvers.length) {\n return true;\n } else {\n return false;\n }\n }\n\n ```\n\n But the approver does not mint the token when it approves a non-existent txnHash because _checkAndUpdateInstantMintLimit will check whether the amount is greater than zero, but it is still has risk, suggest check whether txnHash exist when the approve.\n\n ```\n\n function approve(bytes32 txnHash) external {\n if (!approvers[msg.sender]) {\n revert NotApprover();\n }\n _approve(txnHash);\n _mintIfThresholdMet(txnHash);\n }\n \n function _mintIfThresholdMet(bytes32 txnHash) internal {\n bool thresholdMet = _checkThresholdMet(txnHash);\n Transaction memory txn = txnHashToTransaction[txnHash];\n if (thresholdMet) {\n _checkAndUpdateInstantMintLimit(txn.amount);\n if (!ALLOWLIST.isAllowed(txn.sender)) {\n ALLOWLIST.setAccountStatus(\n txn.sender,\n ALLOWLIST.getValidTermIndexes()[0],\n true\n );\n ", "vulnerable_code": " function _approve(bytes32 txnHash) internal {\n // Check that the approver has not already approved\n TxnThreshold storage t = txnToThresholdSet[txnHash];\n if (t.approvers.length > 0) {\n for (uint256 i = 0; i < t.approvers.length; ++i) {\n if (t.approvers[i] == msg.sender) {\n revert AlreadyApproved();\n }\n }\n }\n //@audit when txnHash not exists t.approvers was added\n t.approvers.push(msg.sender);\n }", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/zhaojie-Q.md", "collected_at": "2026-01-02T18:26:22.950080+00:00", "source_hash": "4730116ab4821c2efcb6b91250e6609519dee296ee6fb458c4d54d2899d76fcc", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 776, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function _approve(bytes32 txnHash) internal {\n // Check that the approver has not already approved\n TxnThreshold storage t = txnToThresholdSet[txnHash];\n if (t.approvers.length > 0) {\n for (uint256 i = 0; i < t.approvers.length; ++i) {\n if (t.approvers[i] == msg.sender) {\n revert AlreadyApproved();\n }\n }\n }\n //@audit when txnHash not exists t.approvers was added\n t.approvers.push(msg.sender);\n }", "primary_code_language": "unknown", "primary_code_char_count": 450, "all_code_blocks": "// Code block 1 (unknown):\nfunction _approve(bytes32 txnHash) internal {\n // Check that the approver has not already approved\n TxnThreshold storage t = txnToThresholdSet[txnHash];\n if (t.approvers.length > 0) {\n for (uint256 i = 0; i < t.approvers.length; ++i) {\n if (t.approvers[i] == msg.sender) {\n revert AlreadyApproved();\n }\n }\n }\n //@audit when txnHash not exists t.approvers was added\n t.approvers.push(msg.sender);\n }\n\n// Code block 2 (unknown):\nfunction _checkThresholdMet(bytes32 txnHash) internal view returns (bool) {\n TxnThreshold memory t = txnToThresholdSet[txnHash];\n //@audit t.numberOfApprovalsNeeded = 0 _checkThresholdMet return true\n if (t.numberOfApprovalsNeeded <= t.approvers.length) {\n return true;\n } else {\n return false;\n }\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function _approve(bytes32 txnHash) internal {\n // Check that the approver has not already approved\n TxnThreshold storage t = txnToThresholdSet[txnHash];\n if (t.approvers.length > 0) {\n for (uint256 i = 0; i < t.approvers.length; ++i) {\n if (t.approvers[i] == msg.sender) {\n revert AlreadyApproved();\n }\n }\n }\n //@audit when txnHash not exists t.approvers was added\n t.approvers.push(msg.sender);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "03-revert-lend", "title": "befree3x Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA reports\n\n## Low\n\n### [L-1] Missing checks on `V3Vault::setEmergencyAdmin` allowing owner to set the emergency admin as himself\n\n\n**Vulnerability Details**\n\n\nAn emergency is defined by the protocol to be able to execute certain critical operations without timelock, for example:\n- Set an oracle mode\n- Set different protocol limit factors, e.g. the global limit of lent or deb amounts\n\n\nHowever, it's possible for the owner to accidentally (or not) make himself as an emergency admin.\n\n\n```javascript\n\n\nfunction setEmergencyAdmin(address admin) external onlyOwner {\n@> emergencyAdmin = admin; // missing check here\n emit SetEmergencyAdmin(admin);\n }\n\n\n```\n\n\n**Impact**\n\nIf the emergency admin is also the owner, the protocol becomes entirely centralized. Although the current implementation allows all administrative actions to be done by the owner, an emergency admin can help to execute certain administrative actions in the absence of the owner.\n\n\n**Tools Used**\n\nManual review.\n\n**Recommended Mitigation Steps**\n\nThe following change can be used to update the `setEmergencyAdmin` function in both files `V3Vault.sol` and `V3Oracle.sol`\n\n```diff\n\nfunction setEmergencyAdmin(address admin) external onlyOwner {\n+ if(admin == owner()) {\n+ revert Unauthorized();\n+ }\n emergencyAdmin = admin;\n emit SetEmergencyAdmin(admin);\n}\n\n```\n\nThe following test case can be added to the files `V3Vault.t.sol` and `V3Oracle.t.sol` as well:\n\n- On `V3Vault.t.sol`, add this test:\n \n```javascript\n\nfunction testEmergencyAdminCanNotBeOwner() external {\n vm.expectRevert(IErrors.Unauthorized.selector);\n vault.setEmergencyAdmin(address(this));\n}\n\n```\n\n- On `V3Oracle.t.sol`, add this test:\n\n```javascript\n\nfunction testEmergencyAdminCanNotBeOwner() external {\n vm.expectRevert(IErrors.Unauthorized.selector);\n oracle.setEmergencyAdmin(address(this));\n}\n\n```", "vulnerable_code": "function setEmergencyAdmin(address admin) external onlyOwner {\n@> emergencyAdmin = admin; // missing check here\n emit SetEmergencyAdmin(admin);\n }\n\n", "fixed_code": "The following test case can be added to the files `V3Vault.t.sol` and `V3Oracle.t.sol` as well:\n\n- On `V3Vault.t.sol`, add this test:\n ", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/befree3x-Q.md", "collected_at": "2026-01-02T19:03:07.316187+00:00", "source_hash": "4733778b9a9c696c0ef963edb3b122823d450f9fb86bb05841ebea0163aa377e", "code_block_count": 4, "solidity_block_count": 1, "total_code_chars": 683, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function setEmergencyAdmin(address admin) external onlyOwner {\n@> emergencyAdmin = admin; // missing check here\n emit SetEmergencyAdmin(admin);\n }", "primary_code_language": "javascript", "primary_code_char_count": 159, "all_code_blocks": "// Code block 1 (javascript):\nfunction setEmergencyAdmin(address admin) external onlyOwner {\n@> emergencyAdmin = admin; // missing check here\n emit SetEmergencyAdmin(admin);\n }\n\n// Code block 2 (diff):\nfunction setEmergencyAdmin(address admin) external onlyOwner {\n+ if(admin == owner()) {\n+ revert Unauthorized();\n+ }\n emergencyAdmin = admin;\n emit SetEmergencyAdmin(admin);\n}\n\n// Code block 3 (javascript):\nfunction testEmergencyAdminCanNotBeOwner() external {\n vm.expectRevert(IErrors.Unauthorized.selector);\n vault.setEmergencyAdmin(address(this));\n}\n\n// Code block 4 (javascript):\nfunction testEmergencyAdminCanNotBeOwner() external {\n vm.expectRevert(IErrors.Unauthorized.selector);\n oracle.setEmergencyAdmin(address(this));\n}", "all_code_blocks_count": 4, "has_diff_blocks": true, "diff_code": "function setEmergencyAdmin(address admin) external onlyOwner {\n+ if(admin == owner()) {\n+ revert Unauthorized();\n+ }\n emergencyAdmin = admin;\n emit SetEmergencyAdmin(admin);\n}", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function setEmergencyAdmin(address admin) external onlyOwner {\n@> emergencyAdmin = admin; // missing check here\n emit SetEmergencyAdmin(admin);\n }\n\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "The following test case can be added to the files `V3Vault.t.sol` and `V3Oracle.t.sol` as well:\n\n- On `V3Vault.t.sol`, add this test:\n ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 11} {"source": "c4", "protocol": "09-ondo", "title": "matrix_0wl G", "severity_raw": "High", "severity": "high", "description": "## Gas Optimizations\n\n| | Issue |\n| ------ | :--------------------------------------------------------------------------------------------------------------------- |\n| GAS-1 | `ABI.ENCODE()` IS LESS EFFICIENT THAN `ABI.ENCODEPACKED()` |\n| GAS-2 | Use assembly to check for `address(0)` |\n| GAS-3 | Setting the constructor to payable |\n| GAS-4 | DUPLICATED REQUIRE()/REVERT() CHECKS SHOULD BE REFACTORED TO A MODIFIER OR FUNCTION |\n| GAS-5 | USE FUNCTION INSTEAD OF MODIFIERS |\n| GAS-6 | CONSTANT VALUES SUCH AS A CALL TO KECCAK256(), SHOULD USE IMMUTABLE RATHER THAN CONSTANT |\n| GAS-7 | KECCAK256() SHOULD ONLY NEED TO BE CALLED ON A SPECIFIC STRING LITERAL ONCE |\n| GAS-8 | MAKING CONSTANT VARIABLES PRIVATE WILL SAVE GAS DURING DEPLOYMENT |\n| GAS-9 | Functions guaranteed to revert when called by normal users can be marked payable |\n| GAS-10 | `++i` costs less gas than `i++`, especially when it's used in `for`-loops (`--i`/`i--` too) = for-loop and while-loops |\n| GAS-11 | The increment in for loop postcondition can be made unchecked |\n| GAS-12 | Using `private` rather than `public` for constants, saves gas |\n| GAS-13 | TERNARY OPERATION IS CHEAPER THAN IF-ELSE STATEMENT ", "vulnerable_code": "File: contracts/bridge/DestinationBridge.sol\n\n99: if (chainToApprovedSender[srcChain] != keccak256(abi.encode(srcAddr))) {\n\n238: chainToApprovedSender[srcChain] = keccak256(abi.encode(srcContractAddress));\n", "fixed_code": "File: contracts/bridge/SourceBridge.sol\n\n79: bytes memory payload = abi.encode(VERSION, msg.sender, amount, nonce++);\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/matrix_0wl-G.md", "collected_at": "2026-01-02T18:26:05.467657+00:00", "source_hash": "4778e0a416c28b69b79daa86f2798ad448ca9f3e39c384a05e06134c4adbe08e", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: contracts/bridge/DestinationBridge.sol\n\n99: if (chainToApprovedSender[srcChain] != keccak256(abi.encode(srcAddr))) {\n\n238: chainToApprovedSender[srcChain] = keccak256(abi.encode(srcContractAddress));\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/bridge/SourceBridge.sol\n\n79: bytes memory payload = abi.encode(VERSION, msg.sender, amount, nonce++);\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-ondo", "title": "mahdirostami G", "severity_raw": "Low", "severity": "low", "description": "1. COMPOUND ASSIGNMENT OPERATOR COSTS EXTRA GAS FOR STATE VARIABLES\n\n uses more gas than \n uses more gas than \n\nAffected source code:\n- [CashManager.sol#L221](https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/cash/CashManager.sol#L221)\n- [CashManager.sol#L582](https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/cash/CashManager.sol#L582)\n- [CashManager.sol#L630](https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/cash/CashManager.sol#L630)\n- [CashManager.sol#L649](https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/cash/CashManager.sol#L649)\n- [CashManager.sol#L792](https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/cash/CashManager.sol#L792)\n\n2. IN SOLIDITY 0.8+ AND <++I> SHOULD BE UNCHECKED{I++} AND UNCHECKED{++I}\n\nBecause, there\u2019s a default overflow check on unsigned integers. \nIt\u2019s possible to uncheck this in for-loops and save some gas at each iteration.\n\nAffected source code:\n- [CashManager.sol#L750](https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/cash/CashManager.sol#L750)\n- [CashManager.sol#L786](https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/cash/CashManager.sol#L786)\n- [CashManager.sol#L933](https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/cash/CashManager.sol#L933)\n- [CashManager.sol#L961](https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/cash/CashManager.sol#L961)\n- [CashFactory.sol#L127](https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/cash/factory/CashFactory.sol#L127)\n- [KYCRegistry.sol#L180](https://github.com/code-423n4/202", "vulnerable_code": " modifier onlyGuardian() {\n require(msg.sender == guardian, \"CashFactory: You are not the Guardian\");\n _;\n }", "fixed_code": "", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/mahdirostami-G.md", "collected_at": "2026-01-02T18:15:18.777868+00:00", "source_hash": "47df370155b7148ef0e294045e88048d94ba38402a0dffc11edc5d21a5db4666", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 10, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CashManager.sol#L221, CashManager.sol#L582, CashManager.sol#L630, CashManager.sol#L649, CashManager.sol#L792, CashManager.sol#L750, CashManager.sol#L786, CashManager.sol#L933, CashManager.sol#L961, CashFactory.sol#L127", "github_files_list": "CashManager.sol, CashFactory.sol", "github_refs_count": 10, "vulnerable_code_actual": " modifier onlyGuardian() {\n require(msg.sender == guardian, \"CashFactory: You are not the Guardian\");\n _;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "03-asymmetry", "title": "ernestognw G", "severity_raw": "Low", "severity": "low", "description": "## Reorder `SafEthStorage` variables for lesser storage accesses\n\nConsidering that `stake()` is reasonably expected to be the most-called function, it currently accesses 5 storage slots while reading the following variables:\n\n* `pauseStaking`\n* `derivativeCount`\n* `totalWeight`\n* `minAmount`\n* `maxAmount`\n\nHowever, both `derivativeCount` and `totalWeight` are not expected to grow much, so they can be packed along with `pauseStaking`, and for the case of `minAmount` and `maxAmount` both current values hardcoded in the contract can fit in `uin128` to be packed together.\n\nConcretely, the arrangement proposed is the following:\n\n```solidity\ncontract SafEthStorage {\n bool public pauseStaking; // true if staking is paused\n bool public pauseUnstaking; // true if unstaking is pause\n uint120 public derivativeCount; // amount of derivatives added to contract\n uint120 public totalWeight; // total weight of all derivatives (used to calculate percentage of derivative)\n uint128 public minAmount; // minimum amount to stake\n uint128 public maxAmount; // maximum amount to stake\n ...\n}\n```", "vulnerable_code": "contract SafEthStorage {\n bool public pauseStaking; // true if staking is paused\n bool public pauseUnstaking; // true if unstaking is pause\n uint120 public derivativeCount; // amount of derivatives added to contract\n uint120 public totalWeight; // total weight of all derivatives (used to calculate percentage of derivative)\n uint128 public minAmount; // minimum amount to stake\n uint128 public maxAmount; // maximum amount to stake\n ...\n}", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/ernestognw-G.md", "collected_at": "2026-01-02T18:19:05.684009+00:00", "source_hash": "481a9687240deb7edacd990e4ef24fcefd3ff824b57aae905bbdc9c8161888a6", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 460, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "contract SafEthStorage {\n bool public pauseStaking; // true if staking is paused\n bool public pauseUnstaking; // true if unstaking is pause\n uint120 public derivativeCount; // amount of derivatives added to contract\n uint120 public totalWeight; // total weight of all derivatives (used to calculate percentage of derivative)\n uint128 public minAmount; // minimum amount to stake\n uint128 public maxAmount; // maximum amount to stake\n ...\n}", "primary_code_language": "solidity", "primary_code_char_count": 460, "all_code_blocks": "// Code block 1 (solidity):\ncontract SafEthStorage {\n bool public pauseStaking; // true if staking is paused\n bool public pauseUnstaking; // true if unstaking is pause\n uint120 public derivativeCount; // amount of derivatives added to contract\n uint120 public totalWeight; // total weight of all derivatives (used to calculate percentage of derivative)\n uint128 public minAmount; // minimum amount to stake\n uint128 public maxAmount; // maximum amount to stake\n ...\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "contract SafEthStorage {\n bool public pauseStaking; // true if staking is paused\n bool public pauseUnstaking; // true if unstaking is pause\n uint120 public derivativeCount; // amount of derivatives added to contract\n uint120 public totalWeight; // total weight of all derivatives (used to calculate percentage of derivative)\n uint128 public minAmount; // minimum amount to stake\n uint128 public maxAmount; // maximum amount to stake\n ...\n}", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "contract SafEthStorage {\n bool public pauseStaking; // true if staking is paused\n bool public pauseUnstaking; // true if unstaking is pause\n uint120 public derivativeCount; // amount of derivatives added to contract\n uint120 public totalWeight; // total weight of all derivatives (used to calculate percentage of derivative)\n uint128 public minAmount; // minimum amount to stake\n uint128 public maxAmount; // maximum amount to stake\n ...\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.22} {"source": "c4", "protocol": "02-ethos", "title": "matrix_0wl G", "severity_raw": "High", "severity": "high", "description": "# Summary\n\n## Gas Optimizations\n\n| | Issue |\n| ------ | :-------------------------------------------------------------------------------------------------------------------------------------------------- |\n| GAS-1 | `ABI.ENCODE()` IS LESS EFFICIENT THAN `ABI.ENCODEPACKED()` |\n| GAS-2 | MAKING CONSTANT VARIABLES PRIVATE WILL SAVE GAS DURING DEPLOYMENT |\n| GAS-3 | ` += `/` -= ` COSTS MORE GAS THAN ` = + `/` = - ` FOR STATE VARIABLES |\n| GAS-4 | AVOID CONTRACT EXISTENCE CHECKS BY USING LOW LEVEL CALLS |\n| GAS-6 | SETTING THE CONSTRUCTOR TO PAYABLE |\n| GAS-7 | DUPLICATED REQUIRE()/REVERT() CHECKS SHOULD BE REFACTORED TO A MODIFIER OR FUNCTION (INSTANCES) |\n| GAS-8 | DOS WITH BLOCK GAS LIMIT |\n| GAS-9 | INSTEAD OF CALCULATING A STATEVAR WITH KECCAK256() EVERY TIME THE CONTRACT IS MADE PRE CALCULATE THEM BEFORE AND ONLY GIVE THE RESULT TO A CONSTANT |\n| GAS-10 | CONSTANT VALUES SUCH AS A CALL TO KECCAK256(), SHOULD USE IMMUTABLE RATHER THAN CONSTANT |\n| GAS-11 | KECCAK256() SHOULD ONLY NEED TO BE CALLED ON A SPECIFIC STRING LITERAL ONCE |\n| GAS-12 | MAKING CONSTANT VARIABLE", "vulnerable_code": "File: Ethos-Core/contracts/LUSDToken.sol\n\n305: return keccak256(abi.encode(typeHash, name, version, _chainID(), address(this)));\n", "fixed_code": "File: Ethos-Core/contracts/StabilityPool.sol\n\n197: uint public constant SCALE_FACTOR = 1e9;\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/matrix_0wl-G.md", "collected_at": "2026-01-02T18:17:23.514732+00:00", "source_hash": "48287a309acb49b24a0044db09dabb5fa5626f3bd2d230f6b7182bec588d89b0", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: Ethos-Core/contracts/LUSDToken.sol\n\n305: return keccak256(abi.encode(typeHash, name, version, _chainID(), address(this)));\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: Ethos-Core/contracts/StabilityPool.sol\n\n197: uint public constant SCALE_FACTOR = 1e9;\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-biconomy", "title": "BClabs Q", "severity_raw": "Unknown", "severity": "unknown", "description": "1. **Function duplicate**:\n\nThere are 2 functions that implmenet the same logic- They both accept batchId and return nonces[batchId].\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L155-L159\nhttps://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L97-L99\n\n2. **Wrong error message**:\n\nShould be invalid _handler not Invalid Entrypoint.\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L171\n\n3. **Address.isContract does not work as expected when called from constructor**: \n\nAddress.isContract(paymasterId) can be fooled when calling a function from the contract's constructor. Since isContract checks contract size, which is at the time of constructor 0, it will return that the address is not contract.\n\n```\ncontract Attack {\n constructor(address contractAddress) {\n VerifyingSingletonPaymaster(contractAddress).depositFor{value: 1}(address(this));\n }\n}\n```\n\nTo be sure paymasterId is not a contract add require tx.origin == msg.sender.\nhttps://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol#L49\n\n\n4. **Abstract contracts should have some functions unimplemented**\n\nSince StakeManager is a complete contract, it should not be marked as abstract.\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/StakeManager.sol#L13", "vulnerable_code": "contract Attack {\n constructor(address contractAddress) {\n VerifyingSingletonPaymaster(contractAddress).depositFor{value: 1}(address(this));\n }\n}", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/BClabs-Q.md", "collected_at": "2026-01-02T18:12:55.821928+00:00", "source_hash": "482fd115ec09d596d3a348a36fc65c10a62a0b74b98a6fa45ea38dc0d434d562", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 158, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "contract Attack {\n constructor(address contractAddress) {\n VerifyingSingletonPaymaster(contractAddress).depositFor{value: 1}(address(this));\n }\n}", "primary_code_language": "unknown", "primary_code_char_count": 158, "all_code_blocks": "// Code block 1 (unknown):\ncontract Attack {\n constructor(address contractAddress) {\n VerifyingSingletonPaymaster(contractAddress).depositFor{value: 1}(address(this));\n }\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SmartAccount.sol#L155-L159, SmartAccount.sol#L97-L99, SmartAccount.sol#L171, VerifyingSingletonPaymaster.sol#L49, StakeManager.sol#L13", "github_files_list": "SmartAccount.sol, StakeManager.sol, VerifyingSingletonPaymaster.sol", "github_refs_count": 5, "vulnerable_code_actual": "contract Attack {\n constructor(address contractAddress) {\n VerifyingSingletonPaymaster(contractAddress).depositFor{value: 1}(address(this));\n }\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "05-ajna", "title": "Bason Q", "severity_raw": "Medium", "severity": "medium", "description": "## QA Findings\n| Number | Issues Details |\n|:-------:|:---------------------------------------------------------------------------------------------------|\n| [QA-01] | Emit event after proposal is executed and not before |\n| [QA-02] | Create a more specific custom error in StandardFunding.sol in the executeStandard function |\n| [QA-03] | Rename function findMechanismOfProposal to getProposalMechanism |\n| [QA-04] | Remove the underscore from the name of the parameter in GrantFund.sol in the fundTreasury function |\n| [L-01] | Not verifying that params_.pool is valid pool address |\n| [L-02] | Creating two variables when we need only one |\n\n***\n\n## |[QA-01]| Emit event after proposal is executed and not before\n\nFunding.sol function _execute\n\n```solidity\n function _execute(\n uint256 proposalId_,\n address[] memory targets_,\n uint256[] memory values_,\n bytes[] memory calldatas_\n ) internal {\n // use common event name to maintain consistency with tally\n emit ProposalExecuted(proposalId_);\n\n string memory errorMessage = \"Governor: call reverted without message\";\n for (uint256 i = 0; i < targets_.length; ++i) {\n (bool success, bytes memory returndata) = targets_[i].call{value: values_[i]}(calldatas_[i]);\n Address.verifyCallResult(success, returndata, errorMessage);\n }\n }\n```\nThe ProposalExecuted event should be emitted after the for loop and all call results have been verified.\nOtherwise we might emit the event and then revert which is misleading.\n*** \n\n## |[QA-02]| Create a more specific custom error in StandardFunding.sol in the executeStandard function\n\nStandardFunding.sol function executeStandard\n\n```solidity\nfun", "vulnerable_code": " function _execute(\n uint256 proposalId_,\n address[] memory targets_,\n uint256[] memory values_,\n bytes[] memory calldatas_\n ) internal {\n // use common event name to maintain consistency with tally\n emit ProposalExecuted(proposalId_);\n\n string memory errorMessage = \"Governor: call reverted without message\";\n for (uint256 i = 0; i < targets_.length; ++i) {\n (bool success, bytes memory returndata) = targets_[i].call{value: values_[i]}(calldatas_[i]);\n Address.verifyCallResult(success, returndata, errorMessage);\n }\n }", "fixed_code": "function executeStandard(\n address[] memory targets_,\n uint256[] memory values_,\n bytes[] memory calldatas_,\n bytes32 descriptionHash_\n ) external nonReentrant override returns (uint256 proposalId_) {\n //Hash proposal generates a uint256 based on the values\n ...\n if (block.number <= _getChallengeStageEndBlock(_distributions[distributionId].endBlock)) revert ExecuteProposalInvalid();", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/Bason-Q.md", "collected_at": "2026-01-02T18:20:56.550579+00:00", "source_hash": "4963a949d7f82d82d8b8b201ca77e538921589e2fe1a26fdaed2c207356a8c52", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 611, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _execute(\n uint256 proposalId_,\n address[] memory targets_,\n uint256[] memory values_,\n bytes[] memory calldatas_\n ) internal {\n // use common event name to maintain consistency with tally\n emit ProposalExecuted(proposalId_);\n\n string memory errorMessage = \"Governor: call reverted without message\";\n for (uint256 i = 0; i < targets_.length; ++i) {\n (bool success, bytes memory returndata) = targets_[i].call{value: values_[i]}(calldatas_[i]);\n Address.verifyCallResult(success, returndata, errorMessage);\n }\n }", "primary_code_language": "solidity", "primary_code_char_count": 611, "all_code_blocks": "// Code block 1 (solidity):\nfunction _execute(\n uint256 proposalId_,\n address[] memory targets_,\n uint256[] memory values_,\n bytes[] memory calldatas_\n ) internal {\n // use common event name to maintain consistency with tally\n emit ProposalExecuted(proposalId_);\n\n string memory errorMessage = \"Governor: call reverted without message\";\n for (uint256 i = 0; i < targets_.length; ++i) {\n (bool success, bytes memory returndata) = targets_[i].call{value: values_[i]}(calldatas_[i]);\n Address.verifyCallResult(success, returndata, errorMessage);\n }\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function _execute(\n uint256 proposalId_,\n address[] memory targets_,\n uint256[] memory values_,\n bytes[] memory calldatas_\n ) internal {\n // use common event name to maintain consistency with tally\n emit ProposalExecuted(proposalId_);\n\n string memory errorMessage = \"Governor: call reverted without message\";\n for (uint256 i = 0; i < targets_.length; ++i) {\n (bool success, bytes memory returndata) = targets_[i].call{value: values_[i]}(calldatas_[i]);\n Address.verifyCallResult(success, returndata, errorMessage);\n }\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function _execute(\n uint256 proposalId_,\n address[] memory targets_,\n uint256[] memory values_,\n bytes[] memory calldatas_\n ) internal {\n // use common event name to maintain consistency with tally\n emit ProposalExecuted(proposalId_);\n\n string memory errorMessage = \"Governor: call reverted without message\";\n for (uint256 i = 0; i < targets_.length; ++i) {\n (bool success, bytes memory returndata) = targets_[i].call{value: values_[i]}(calldatas_[i]);\n Address.verifyCallResult(success, returndata, errorMessage);\n }\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function executeStandard(\n address[] memory targets_,\n uint256[] memory values_,\n bytes[] memory calldatas_,\n bytes32 descriptionHash_\n ) external nonReentrant override returns (uint256 proposalId_) {\n //Hash proposal generates a uint256 based on the values\n ...\n if (block.number <= _getChallengeStageEndBlock(_distributions[distributionId].endBlock)) revert ExecuteProposalInvalid();", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "02-ethos", "title": "Go Langer G", "severity_raw": "Low", "severity": "low", "description": "## Consider optimizing sendCollateral for batch operations in ActivePool.sol\n\n```solidity \n function sendCollateral(address _collateral, address _account, uint _amount) external override {\n _requireValidCollateralAddress(_collateral);\n _requireCallerIsBOorTroveMorSP();\n _rebalance(_collateral, _amount);\n collAmount[_collateral] = collAmount[_collateral].sub(_amount);\n emit ActivePoolCollateralBalanceUpdated(_collateral, collAmount[_collateral]);\n emit CollateralSent(_collateral, _account, _amount);\n\n if (_account == defaultPoolAddress) {\n IERC20(_collateral).safeIncreaseAllowance(defaultPoolAddress, _amount);\n IDefaultPool(defaultPoolAddress).pullCollateralFromActivePool(_collateral, _amount);\n } else if (_account == collSurplusPoolAddress) {\n IERC20(_collateral).safeIncreaseAllowance(collSurplusPoolAddress, _amount);\n ICollSurplusPool(collSurplusPoolAddress).pullCollateralFromActivePool(_collateral, _amount);\n } else {\n IERC20(_collateral).safeTransfer(_account, _amount);\n }\n }\n\n```\n\nRefactored code:\n\n```\n function batchSendCollateral(address[] calldata _collateral, address[] calldata _account, uint[] calldata _amount) external override {\n _requireCallerIsBOorTroveMorSP();\n uint256 length = _collateral.length;\n for (uint256 i = 0; i < length; i++) {\n _requireValidCollateralAddress(_collateral[i]);\n _rebalance(_collateral[i], _amount[i]);\n collAmount[_collateral[i]] = collAmount[_collateral[i]].sub(_amount[i]);\n emit ActivePoolCollateralBalanceUpdated(_collateral[i], collAmount[_collateral[i]]);\n emit CollateralSent(_collateral[i], _account[i], _amount[i]);\n }\n }\n```\n\n### There are 65 instances of this:\n\n171: Ethos-Core/contracts/ActivePool.sol function sendCollaterall\n\n172: Ethos-Core/contracts/BorrowerOperations.sol function openTrove\n\n242: Ethos-Core/co", "vulnerable_code": " function sendCollateral(address _collateral, address _account, uint _amount) external override {\n _requireValidCollateralAddress(_collateral);\n _requireCallerIsBOorTroveMorSP();\n _rebalance(_collateral, _amount);\n collAmount[_collateral] = collAmount[_collateral].sub(_amount);\n emit ActivePoolCollateralBalanceUpdated(_collateral, collAmount[_collateral]);\n emit CollateralSent(_collateral, _account, _amount);\n\n if (_account == defaultPoolAddress) {\n IERC20(_collateral).safeIncreaseAllowance(defaultPoolAddress, _amount);\n IDefaultPool(defaultPoolAddress).pullCollateralFromActivePool(_collateral, _amount);\n } else if (_account == collSurplusPoolAddress) {\n IERC20(_collateral).safeIncreaseAllowance(collSurplusPoolAddress, _amount);\n ICollSurplusPool(collSurplusPoolAddress).pullCollateralFromActivePool(_collateral, _amount);\n } else {\n IERC20(_collateral).safeTransfer(_account, _amount);\n }\n }\n", "fixed_code": " function batchSendCollateral(address[] calldata _collateral, address[] calldata _account, uint[] calldata _amount) external override {\n _requireCallerIsBOorTroveMorSP();\n uint256 length = _collateral.length;\n for (uint256 i = 0; i < length; i++) {\n _requireValidCollateralAddress(_collateral[i]);\n _rebalance(_collateral[i], _amount[i]);\n collAmount[_collateral[i]] = collAmount[_collateral[i]].sub(_amount[i]);\n emit ActivePoolCollateralBalanceUpdated(_collateral[i], collAmount[_collateral[i]]);\n emit CollateralSent(_collateral[i], _account[i], _amount[i]);\n }\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/Go-Langer-G.md", "collected_at": "2026-01-02T18:16:12.984835+00:00", "source_hash": "499c0abe9b7de3e1e73266fe988695f776d9f8a08bfc0e4a88e664d75eb75fd5", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 16, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "Refactored code:", "primary_code_language": "unknown", "primary_code_char_count": 16, "all_code_blocks": "// Code block 1 (unknown):\nRefactored code:", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function sendCollateral(address _collateral, address _account, uint _amount) external override {\n _requireValidCollateralAddress(_collateral);\n _requireCallerIsBOorTroveMorSP();\n _rebalance(_collateral, _amount);\n collAmount[_collateral] = collAmount[_collateral].sub(_amount);\n emit ActivePoolCollateralBalanceUpdated(_collateral, collAmount[_collateral]);\n emit CollateralSent(_collateral, _account, _amount);\n\n if (_account == defaultPoolAddress) {\n IERC20(_collateral).safeIncreaseAllowance(defaultPoolAddress, _amount);\n IDefaultPool(defaultPoolAddress).pullCollateralFromActivePool(_collateral, _amount);\n } else if (_account == collSurplusPoolAddress) {\n IERC20(_collateral).safeIncreaseAllowance(collSurplusPoolAddress, _amount);\n ICollSurplusPool(collSurplusPoolAddress).pullCollateralFromActivePool(_collateral, _amount);\n } else {\n IERC20(_collateral).safeTransfer(_account, _amount);\n }\n }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function batchSendCollateral(address[] calldata _collateral, address[] calldata _account, uint[] calldata _amount) external override {\n _requireCallerIsBOorTroveMorSP();\n uint256 length = _collateral.length;\n for (uint256 i = 0; i < length; i++) {\n _requireValidCollateralAddress(_collateral[i]);\n _rebalance(_collateral[i], _amount[i]);\n collAmount[_collateral[i]] = collAmount[_collateral[i]].sub(_amount[i]);\n emit ActivePoolCollateralBalanceUpdated(_collateral[i], collAmount[_collateral[i]]);\n emit CollateralSent(_collateral[i], _account[i], _amount[i]);\n }\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-ondo", "title": "Dinesh11G G", "severity_raw": "High", "severity": "high", "description": "### 1st BUG\nDon't Initialize Variables with Default Value\n\n#### Impact\nIssue Information: \nUninitialized variables are assigned with the types default value.\n\nExplicitly initializing a variable with it's default value costs unnecessary gas.\n\nExample\n\ud83e\udd26 Bad:\n\nuint256 x = 0;\nbool y = false;\n\ud83d\ude80 Good:\n\nuint256 x;\nbool y;\n\n#### Findings:\n```\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/utils/Strings.sol::45 => uint256 length = 0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol::46 => uint256 length = 0;\n2023-01-ondo/contracts/lending/CompoundLens.sol::85 => for (uint i = 0; i < cTokenCount; i++) {\n2023-01-ondo/contracts/lending/CompoundLens.sol::135 => for (uint i = 0; i < cTokenCount; i++) {\n2023-01-ondo/contracts/lending/CompoundLens.sol::167 => for (uint i = 0; i < cTokenCount; i++) {\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::168 => for (uint i = 0; i < len; i++) {\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::258 => for (uint i = 0; i < len; i++) {\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::873 => for (uint i = 0; i < assets.length; i++) {\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::1183 => for (uint i = 0; i < allMarkets.length; i++) {\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::1237 => for (uint i = 0; i < numMarkets; i++) {\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::1363 => for (uint i = 0; i < affectedUsers.length; ++i) {\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::1656 => for (uint i = 0; i < cTokens.length; i++) {\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::1662 => for (uint j = 0; j < holders.length; j++) {\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::1668 => for (uint j = 0; j < holders.length; j++) {\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::1673 => for (uint j = 0; j < holders.length; j++) {\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::1735 => for (u", "vulnerable_code": "2023-01-ondo/contracts/cash/external/openzeppelin/contracts/utils/Strings.sol::45 => uint256 length = 0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol::46 => uint256 length = 0;\n2023-01-ondo/contracts/lending/CompoundLens.sol::85 => for (uint i = 0; i < cTokenCount; i++) {\n2023-01-ondo/contracts/lending/CompoundLens.sol::135 => for (uint i = 0; i < cTokenCount; i++) {\n2023-01-ondo/contracts/lending/CompoundLens.sol::167 => for (uint i = 0; i < cTokenCount; i++) {\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::168 => for (uint i = 0; i < len; i++) {\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::258 => for (uint i = 0; i < len; i++) {\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::873 => for (uint i = 0; i < assets.length; i++) {\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::1183 => for (uint i = 0; i < allMarkets.length; i++) {\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::1237 => for (uint i = 0; i < numMarkets; i++) {\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::1363 => for (uint i = 0; i < affectedUsers.length; ++i) {\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::1656 => for (uint i = 0; i < cTokens.length; i++) {\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::1662 => for (uint j = 0; j < holders.length; j++) {\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::1668 => for (uint j = 0; j < holders.length; j++) {\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::1673 => for (uint j = 0; j < holders.length; j++) {\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::1735 => for (uint i = 0; i < numTokens; ++i) {\n2023-01-ondo/contracts/lending/compound/governance/Comp.sol::258 => uint32 lower = 0;\n2023-01-ondo/contracts/lending/compound/governance/GovernorBravoDelegate.sol::201 => for (uint i = 0; i < proposal.targets.length; i++) {\n2023-01-ondo/contracts/lending/compound/governance/GovernorBravoDelegate.sol::24", "fixed_code": "2023-01-ondo/contracts/cash/CashManager.sol::749 => uint256 size = redeemers.length;\n2023-01-ondo/contracts/cash/CashManager.sol::785 => uint256 size = refundees.length;\n2023-01-ondo/contracts/cash/CashManager.sol::932 => uint256 size = accounts.length;\n2023-01-ondo/contracts/cash/CashManager.sol::960 => results = new bytes[](exCallData.length);\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/access/AccessControlEnumerable.sol::69 => return _roleMembers[role].length();\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/proxy/ERC1967Upgrade.sol::76 => if (data.length > 0 || forceCall) {\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/proxy/ERC1967Upgrade.sol::196 => if (data.length > 0 || forceCall) {\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/token/SafeERC20.sol::113 => if (returndata.length > 0) {\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/utils/Address.sol::41 => return account.code.length > 0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/utils/Address.sol::238 => if (returndata.length > 0) {\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/utils/EnumerableSet.sol::59 => set._indexes[value] = set._values.length;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/utils/EnumerableSet.sol::83 => uint256 lastIndex = set._values.length - 1;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/utils/EnumerableSet.sol::120 => function _length(Set storage set) private view returns (uint256) {\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/utils/EnumerableSet.sol::121 => return set._values.length;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/utils/EnumerableSet.sol::193 => function length(Bytes32Set storage set) internal view returns (uint256) {\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/utils/EnumerableSet.sol::194 => return _length(set._inner);\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/utils/Enumerable", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/Dinesh11G-G.md", "collected_at": "2026-01-02T18:14:36.466309+00:00", "source_hash": "49a035a0e60d01deaa1d40a0cf299baf0637c3c6a0dec333e188ab05db1e61cb", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "2023-01-ondo/contracts/cash/external/openzeppelin/contracts/utils/Strings.sol::45 => uint256 length = 0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol::46 => uint256 length = 0;\n2023-01-ondo/contracts/lending/CompoundLens.sol::85 => for (uint i = 0; i < cTokenCount; i++) {\n2023-01-ondo/contracts/lending/CompoundLens.sol::135 => for (uint i = 0; i < cTokenCount; i++) {\n2023-01-ondo/contracts/lending/CompoundLens.sol::167 => for (uint i = 0; i < cTokenCount; i++) {\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::168 => for (uint i = 0; i < len; i++) {\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::258 => for (uint i = 0; i < len; i++) {\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::873 => for (uint i = 0; i < assets.length; i++) {\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::1183 => for (uint i = 0; i < allMarkets.length; i++) {\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::1237 => for (uint i = 0; i < numMarkets; i++) {\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::1363 => for (uint i = 0; i < affectedUsers.length; ++i) {\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::1656 => for (uint i = 0; i < cTokens.length; i++) {\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::1662 => for (uint j = 0; j < holders.length; j++) {\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::1668 => for (uint j = 0; j < holders.length; j++) {\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::1673 => for (uint j = 0; j < holders.length; j++) {\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::1735 => for (uint i = 0; i < numTokens; ++i) {\n2023-01-ondo/contracts/lending/compound/governance/Comp.sol::258 => uint32 lower = 0;\n2023-01-ondo/contracts/lending/compound/governance/GovernorBravoDelegate.sol::201 => for (uint i = 0; i < proposal.targets.length; i++) {\n2023-01-ondo/contracts/lending/compound/governance/GovernorBravoDelegate.sol::24", "has_vulnerable_code_snippet": true, "fixed_code_actual": "2023-01-ondo/contracts/cash/CashManager.sol::749 => uint256 size = redeemers.length;\n2023-01-ondo/contracts/cash/CashManager.sol::785 => uint256 size = refundees.length;\n2023-01-ondo/contracts/cash/CashManager.sol::932 => uint256 size = accounts.length;\n2023-01-ondo/contracts/cash/CashManager.sol::960 => results = new bytes[](exCallData.length);\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/access/AccessControlEnumerable.sol::69 => return _roleMembers[role].length();\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/proxy/ERC1967Upgrade.sol::76 => if (data.length > 0 || forceCall) {\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/proxy/ERC1967Upgrade.sol::196 => if (data.length > 0 || forceCall) {\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/token/SafeERC20.sol::113 => if (returndata.length > 0) {\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/utils/Address.sol::41 => return account.code.length > 0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/utils/Address.sol::238 => if (returndata.length > 0) {\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/utils/EnumerableSet.sol::59 => set._indexes[value] = set._values.length;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/utils/EnumerableSet.sol::83 => uint256 lastIndex = set._values.length - 1;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/utils/EnumerableSet.sol::120 => function _length(Set storage set) private view returns (uint256) {\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/utils/EnumerableSet.sol::121 => return set._values.length;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/utils/EnumerableSet.sol::193 => function length(Bytes32Set storage set) internal view returns (uint256) {\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/utils/EnumerableSet.sol::194 => return _length(set._inner);\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/utils/Enumerable", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-biconomy", "title": "descharre G", "severity_raw": "Low", "severity": "low", "description": "## Summary\n|ID | Syntax | Gas saved| Instances |\n|:----: | :--- | :----: | :----: |\n|1 | Make nonces private| 22 | 1 |\n| 2 | refundInfo.gasPrice is redundant| 18| 1 |\n| 3 |Unchecked for loop| 611 | 1 |\n\n## Details\n### 1 Make nonces private\nSaves on average 22 gas\n\n`mapping(uint256 => uint256) public nonces;`\n\n[SmartAccount.sol#L55](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L55)\n\n### 2 refundInfo.gasPrice is redundant\nSaves on average 18 gas\n\nremove the !=0 in the require statement because it's also checked in the if statement below\n\nadditionally you can put the variable initialization of payment inside the if statement so it only initializes when the statement true. This is an extra 5 gas saving\n\n- [SmartAccount.sol#L232](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L232)\n- [SmartAccount.sol#L234](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L234)\n\n### 3 Unchecked for loop\n[EntryPoint.sol](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol)\n- [EntryPoint.sol#L93-L142](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L93-L142) handleAggregatedOps: make all for loops unchecked: on average 611 gas saved\n```\nfunction increment_unchecked(uint256 x) private pure returns (uint256) {\n unchecked {\n return x + 1;\n }\n }\n\nfor (uint256 i = 0; i < opasLen; i =increment_unchecked(i++) ) {\n totalOps += opsPerAggregator[i].userOps.length;\n }\n```", "vulnerable_code": "function increment_unchecked(uint256 x) private pure returns (uint256) {\n unchecked {\n return x + 1;\n }\n }\n\nfor (uint256 i = 0; i < opasLen; i =increment_unchecked(i++) ) {\n totalOps += opsPerAggregator[i].userOps.length;\n }", "fixed_code": "", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/descharre-G.md", "collected_at": "2026-01-02T18:13:42.310990+00:00", "source_hash": "49c0af40d3053bcf2cf37baa470436a9934501a9da31a95b2e469178b4cd6f67", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 270, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function increment_unchecked(uint256 x) private pure returns (uint256) {\n unchecked {\n return x + 1;\n }\n }\n\nfor (uint256 i = 0; i < opasLen; i =increment_unchecked(i++) ) {\n totalOps += opsPerAggregator[i].userOps.length;\n }", "primary_code_language": "unknown", "primary_code_char_count": 270, "all_code_blocks": "// Code block 1 (unknown):\nfunction increment_unchecked(uint256 x) private pure returns (uint256) {\n unchecked {\n return x + 1;\n }\n }\n\nfor (uint256 i = 0; i < opasLen; i =increment_unchecked(i++) ) {\n totalOps += opsPerAggregator[i].userOps.length;\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SmartAccount.sol#L55, SmartAccount.sol#L232, SmartAccount.sol#L234, EntryPoint.sol, EntryPoint.sol#L93-L142", "github_files_list": "SmartAccount.sol, EntryPoint.sol", "github_refs_count": 5, "vulnerable_code_actual": "function increment_unchecked(uint256 x) private pure returns (uint256) {\n unchecked {\n return x + 1;\n }\n }\n\nfor (uint256 i = 0; i < opasLen; i =increment_unchecked(i++) ) {\n totalOps += opsPerAggregator[i].userOps.length;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "07-amphora", "title": "alymurtazamemon G", "severity_raw": "High", "severity": "high", "description": "# Amphora Protocol - Gas Optimization Report\n\n## Table Of Content\n\n| Number | Issue | Instances |\n| :----------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------- | --------: |\n| [G-01](#g-01---functions-guaranteed-to-revert-when-called-by-normal-users-can-be-marked-payable) | Functions guaranteed to revert when called by normal users can be marked payable | 50 |\n| [G-02](#g-02---multiple-reads-of-storage-variable-which-can-be-cached-to-save-users-gas-cost) | Multiple reads of `storage` variable which can be cached to save users gas cost | 4 |\n| [G-03](#g-03---variables-contains-keccak256-expression-should-be-immutable) | variables contains `keccak256` expression should be `immutable` | 1 |\n| [G-04](#g-04---variables-only-write-on-deployment-should-be-immutable-to-save-users-gas) | Variables only write on deployment should be `immutable` to save users gas | 1 |\n| [G-05](#g-05---re-order-the-modifiers-to-save-users-gas-cost) | Re-order the modifiers to save users gas cost | 5 |\n| [G-06](#g-06---check-conditions-should-be-at-the-top-of-the-functions) | `check` conditions should be at the top of the functions | 1 |\n| [G-07](#g-07---use-unchecked-where-possible-to-save-users-gas) | Use unchecked where possible to save users gas | 1 |\n\n### [G-01] - Functions guaranteed to revert when called by normal users can be marked payable.\n\n**Details**\n\nIt is advisable to always use payable keyword with function", "vulnerable_code": "Similarly for all these functions, users will save 24 gas per call just adding `payable` keyword.\n\n[AMPHClaimer.sol - Line 128](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/AMPHClaimer.sol#L128)\n\n[AMPHClaimer.sol - Line 136](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/AMPHClaimer.sol#L136)\n\n[AMPHClaimer.sol - Line 144](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/AMPHClaimer.sol#L144)\n\n[USDA.sol - Line 63](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/USDA.sol#L63)\n\n[USDA.sol - Line 161](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/USDA.sol#L161)\n\n[USDA.sol - Line 182](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/USDA.sol#L182)\n\n[USDA.sol - Line 212](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/USDA.sol#L212)\n\n[USDA.sol - Line 224](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/USDA.sol#L224)\n\n[USDA.sol - Line 231](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/USDA.sol#L231)\n\n[USDA.sol - Line 239](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/USDA.sol#L239)\n\n[USDA.sol - Line 253](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/USDA.sol#L253)\n\n[USDA.sol - Line 278](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/USDA.sol#L278)\n\n[USDA.sol - Line 287](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/USDA.sol#L287)\n\n[USDA.sol - Line 297](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/USDA.sol#L297)\n\n[Vault.sol - Line 89](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/Vault.sol#L89)\n\n[Vault.sol - Lin", "fixed_code": "[USDA.sol - Line 132](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/USDA.sol#L132)\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/alymurtazamemon-G.md", "collected_at": "2026-01-02T18:23:40.796140+00:00", "source_hash": "49c93fa4b410f7a17ce340e8bf3759b8f6fc2f72a317c82fe8a5bbd4cc4bd84e", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 16, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "AMPHClaimer.sol#L128, AMPHClaimer.sol#L136, AMPHClaimer.sol#L144, USDA.sol#L63, USDA.sol#L161, USDA.sol#L182, USDA.sol#L212, USDA.sol#L224, USDA.sol#L231, USDA.sol#L239, USDA.sol#L253, USDA.sol#L278, USDA.sol#L287, USDA.sol#L297, Vault.sol#L89, USDA.sol#L132", "github_files_list": "AMPHClaimer.sol, USDA.sol, Vault.sol", "github_refs_count": 16, "vulnerable_code_actual": "Similarly for all these functions, users will save 24 gas per call just adding `payable` keyword.\n\n[AMPHClaimer.sol - Line 128](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/AMPHClaimer.sol#L128)\n\n[AMPHClaimer.sol - Line 136](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/AMPHClaimer.sol#L136)\n\n[AMPHClaimer.sol - Line 144](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/AMPHClaimer.sol#L144)\n\n[USDA.sol - Line 63](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/USDA.sol#L63)\n\n[USDA.sol - Line 161](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/USDA.sol#L161)\n\n[USDA.sol - Line 182](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/USDA.sol#L182)\n\n[USDA.sol - Line 212](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/USDA.sol#L212)\n\n[USDA.sol - Line 224](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/USDA.sol#L224)\n\n[USDA.sol - Line 231](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/USDA.sol#L231)\n\n[USDA.sol - Line 239](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/USDA.sol#L239)\n\n[USDA.sol - Line 253](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/USDA.sol#L253)\n\n[USDA.sol - Line 278](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/USDA.sol#L278)\n\n[USDA.sol - Line 287](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/USDA.sol#L287)\n\n[USDA.sol - Line 297](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/USDA.sol#L297)\n\n[Vault.sol - Line 89](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/Vault.sol#L89)\n\n[Vault.sol - Lin", "has_vulnerable_code_snippet": true, "fixed_code_actual": "[USDA.sol - Line 132](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/USDA.sol#L132)\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "11-kelp", "title": "peanuts Q", "severity_raw": "Low", "severity": "low", "description": "### [L-01] Supported Assets cannot be removed in LRTConfig.sol\n\nThe asset and deposit limit can be added to the `isSupportedAsset` mapping and is pushed to the `supportedAssetList` address array, but cannot be popped nor set to false. It would be great if the asset can be popped from the array if the supported token is not in use, or simply set to false. A way to make sure that the supported asset is not in use is to set the deposit limit to zero.\n\n```\n /// @dev Adds a new supported asset\n /// @param asset Asset address\n /// @param depositLimit Deposit limit for the asset\n function _addNewSupportedAsset(address asset, uint256 depositLimit) private {\n UtilLib.checkNonZeroAddress(asset);\n if (isSupportedAsset[asset]) {\n revert AssetAlreadySupported();\n }\n isSupportedAsset[asset] = true;\n supportedAssetList.push(asset);\n depositLimitByAsset[asset] = depositLimit;\n emit AddedNewSupportedAsset(asset, depositLimit);\n```\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTConfig.sol\n\n### [L-02] NodeDelegator cannot be removed from the nodeDelegatorQueue array\n\nThere is a `maxNodeDelegatorCount` of 10 set in the initializer, and this number can be changed. Node delegators are added to the `nodeDelegatorQueue`, but they cannot be removed. Consider allowing the removal of node delegators. This is quite important as the `nodeDelegatorQueue` is used in a loop, and if every node delegator has some assets present, the `getAssetDistributionData()` might run into a out of gas error when calculating the amount of assets in the NDCs\n\n```\n function addNodeDelegatorContractToQueue(address[] calldata nodeDelegatorContracts) external onlyLRTAdmin {\n uint256 length = nodeDelegatorContracts.length;\n if (nodeDelegatorQueue.length + length > maxNodeDelegatorCount) {\n revert MaximumNodeDelegatorCountReached();\n }\n\n for (uint256 i; i < length;) {\n UtilLib.checkN", "vulnerable_code": " /// @dev Adds a new supported asset\n /// @param asset Asset address\n /// @param depositLimit Deposit limit for the asset\n function _addNewSupportedAsset(address asset, uint256 depositLimit) private {\n UtilLib.checkNonZeroAddress(asset);\n if (isSupportedAsset[asset]) {\n revert AssetAlreadySupported();\n }\n isSupportedAsset[asset] = true;\n supportedAssetList.push(asset);\n depositLimitByAsset[asset] = depositLimit;\n emit AddedNewSupportedAsset(asset, depositLimit);", "fixed_code": " function addNodeDelegatorContractToQueue(address[] calldata nodeDelegatorContracts) external onlyLRTAdmin {\n uint256 length = nodeDelegatorContracts.length;\n if (nodeDelegatorQueue.length + length > maxNodeDelegatorCount) {\n revert MaximumNodeDelegatorCountReached();\n }\n\n for (uint256 i; i < length;) {\n UtilLib.checkNonZeroAddress(nodeDelegatorContracts[i]);\n nodeDelegatorQueue.push(nodeDelegatorContracts[i]);\n emit NodeDelegatorAddedinQueue(nodeDelegatorContracts[i]);\n unchecked {\n ++i;\n }\n }\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/peanuts-Q.md", "collected_at": "2026-01-02T18:28:22.289430+00:00", "source_hash": "49dfd5386d1bcaec422a453476e773b1e36d1644368aebee2586d3e8a92ca61b", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 534, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "/// @dev Adds a new supported asset\n /// @param asset Asset address\n /// @param depositLimit Deposit limit for the asset\n function _addNewSupportedAsset(address asset, uint256 depositLimit) private {\n UtilLib.checkNonZeroAddress(asset);\n if (isSupportedAsset[asset]) {\n revert AssetAlreadySupported();\n }\n isSupportedAsset[asset] = true;\n supportedAssetList.push(asset);\n depositLimitByAsset[asset] = depositLimit;\n emit AddedNewSupportedAsset(asset, depositLimit);", "primary_code_language": "unknown", "primary_code_char_count": 534, "all_code_blocks": "// Code block 1 (unknown):\n/// @dev Adds a new supported asset\n /// @param asset Asset address\n /// @param depositLimit Deposit limit for the asset\n function _addNewSupportedAsset(address asset, uint256 depositLimit) private {\n UtilLib.checkNonZeroAddress(asset);\n if (isSupportedAsset[asset]) {\n revert AssetAlreadySupported();\n }\n isSupportedAsset[asset] = true;\n supportedAssetList.push(asset);\n depositLimitByAsset[asset] = depositLimit;\n emit AddedNewSupportedAsset(asset, depositLimit);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LRTConfig.sol", "github_files_list": "LRTConfig.sol", "github_refs_count": 1, "vulnerable_code_actual": " /// @dev Adds a new supported asset\n /// @param asset Asset address\n /// @param depositLimit Deposit limit for the asset\n function _addNewSupportedAsset(address asset, uint256 depositLimit) private {\n UtilLib.checkNonZeroAddress(asset);\n if (isSupportedAsset[asset]) {\n revert AssetAlreadySupported();\n }\n isSupportedAsset[asset] = true;\n supportedAssetList.push(asset);\n depositLimitByAsset[asset] = depositLimit;\n emit AddedNewSupportedAsset(asset, depositLimit);", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function addNodeDelegatorContractToQueue(address[] calldata nodeDelegatorContracts) external onlyLRTAdmin {\n uint256 length = nodeDelegatorContracts.length;\n if (nodeDelegatorQueue.length + length > maxNodeDelegatorCount) {\n revert MaximumNodeDelegatorCountReached();\n }\n\n for (uint256 i; i < length;) {\n UtilLib.checkNonZeroAddress(nodeDelegatorContracts[i]);\n nodeDelegatorQueue.push(nodeDelegatorContracts[i]);\n emit NodeDelegatorAddedinQueue(nodeDelegatorContracts[i]);\n unchecked {\n ++i;\n }\n }\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "10-badger", "title": "Rickard G", "severity_raw": "Medium", "severity": "medium", "description": "## [G-01] Use named imports instead of plain `import file.sol\n## Summary\nUsing import declarations of the form `import {} from 'some/file.sol'` avoids polluting the symbol namespace making flattened files smaller, and speeds up compilation.\n## Vulnerability Details\n\n## Impact\nInstances (95):\n````solidity\npackages\\contracts\\contracts\\Dependencies\\EbtcBase.sol\n\n5: import \"./BaseMath.sol\";\n6: import \"./EbtcMath.sol\";\n7: import \"../Interfaces/IActivePool.sol\";\n8: import \"../Interfaces/IPriceFeed.sol\";\n9: import \"../Interfaces/IEbtcBase.sol\";\n10: import \"../Dependencies/ICollateralToken.sol\";\n````\n````solidity\npackages\\contracts\\contracts\\Dependencies\\ERC3156FlashLender.sol\n\n5: import \"../Interfaces/IERC3156FlashLender.sol\";\n6: import \"../Interfaces/IWETH.sol\";\n````\n````solidity\npackages\\contracts\\contracts\\Dependencies\\RolesAuthority.sol\n\n6: import \"./EnumerableSet.sol\";\n````\n````solidity\npackages\\contracts\\contracts\\Interfaces\\IActivePool.sol\n\n5: import \"./IPool.sol\";\n````\n````solidity\npackages\\contracts\\contracts\\Interfaces\\IBorrowerOperations.sol\n\n4: import \"./IPositionManagers.sol\";\n````\n````solidity\npackages\\contracts\\contracts\\Interfaces\\ICdpManager.sol\n\n5: import \"./IEbtcBase.sol\";\n6: import \"./ICdpManagerData.sol\";\n````\n````solidity\npackages\\contracts\\contracts\\Interfaces\\ICdpManagerData.sol\n\n5: import \"./ICollSurplusPool.sol\";\n6: import \"./IEBTCToken.sol\";\n7: import \"./ISortedCdps.sol\";\n8: import \"./IActivePool.sol\";\n9: import \"./IRecoveryModeGracePeriod.sol\";\n10: import \"../Dependencies/ICollateralTokenOracle.sol\";\n````\n````solidity\npackages\\contracts\\contracts\\Interfaces\\IEbtcBase.sol\n\n5: import \"./IPriceFeed.sol\";\n````\n````solidity\npackages\\contracts\\contracts\\Interfaces\\IEBTCToken.sol\n\n5: import \"../Dependencies/IERC20.sol\";\n6: import \"../Dependencies/IERC2612.sol\";\n````\n````solidity\npackages\\contracts\\contracts\\Interfaces\\IERC3156FlashLender.sol\n\n5: import \"./IERC3156FlashBorrower.sol\";\n````\n````solidity\npackages\\contracts\\contracts\\Active", "vulnerable_code": "packages\\contracts\\contracts\\Dependencies\\EbtcBase.sol\n\n5: import \"./BaseMath.sol\";\n6: import \"./EbtcMath.sol\";\n7: import \"../Interfaces/IActivePool.sol\";\n8: import \"../Interfaces/IPriceFeed.sol\";\n9: import \"../Interfaces/IEbtcBase.sol\";\n10: import \"../Dependencies/ICollateralToken.sol\";", "fixed_code": "packages\\contracts\\contracts\\Dependencies\\ERC3156FlashLender.sol\n\n5: import \"../Interfaces/IERC3156FlashLender.sol\";\n6: import \"../Interfaces/IWETH.sol\";", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/Rickard-G.md", "collected_at": "2026-01-02T18:26:35.641939+00:00", "source_hash": "49e85f205e89f1c43f95746e9f8a30233bd71935b7f57728f49e6c49ba60a7ef", "code_block_count": 10, "solidity_block_count": 10, "total_code_chars": 1452, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "packages\\contracts\\contracts\\Dependencies\\EbtcBase.sol\n\n5: import \"./BaseMath.sol\";\n6: import \"./EbtcMath.sol\";\n7: import \"../Interfaces/IActivePool.sol\";\n8: import \"../Interfaces/IPriceFeed.sol\";\n9: import \"../Interfaces/IEbtcBase.sol\";\n10: import \"../Dependencies/ICollateralToken.sol\";", "primary_code_language": "solidity", "primary_code_char_count": 288, "all_code_blocks": "// Code block 1 (solidity):\npackages\\contracts\\contracts\\Dependencies\\EbtcBase.sol\n\n5: import \"./BaseMath.sol\";\n6: import \"./EbtcMath.sol\";\n7: import \"../Interfaces/IActivePool.sol\";\n8: import \"../Interfaces/IPriceFeed.sol\";\n9: import \"../Interfaces/IEbtcBase.sol\";\n10: import \"../Dependencies/ICollateralToken.sol\";\n\n// Code block 2 (solidity):\npackages\\contracts\\contracts\\Dependencies\\ERC3156FlashLender.sol\n\n5: import \"../Interfaces/IERC3156FlashLender.sol\";\n6: import \"../Interfaces/IWETH.sol\";\n\n// Code block 3 (solidity):\npackages\\contracts\\contracts\\Dependencies\\RolesAuthority.sol\n\n6: import \"./EnumerableSet.sol\";\n\n// Code block 4 (solidity):\npackages\\contracts\\contracts\\Interfaces\\IActivePool.sol\n\n5: import \"./IPool.sol\";\n\n// Code block 5 (solidity):\npackages\\contracts\\contracts\\Interfaces\\IBorrowerOperations.sol\n\n4: import \"./IPositionManagers.sol\";\n\n// Code block 6 (solidity):\npackages\\contracts\\contracts\\Interfaces\\ICdpManager.sol\n\n5: import \"./IEbtcBase.sol\";\n6: import \"./ICdpManagerData.sol\";\n\n// Code block 7 (solidity):\npackages\\contracts\\contracts\\Interfaces\\ICdpManagerData.sol\n\n5: import \"./ICollSurplusPool.sol\";\n6: import \"./IEBTCToken.sol\";\n7: import \"./ISortedCdps.sol\";\n8: import \"./IActivePool.sol\";\n9: import \"./IRecoveryModeGracePeriod.sol\";\n10: import \"../Dependencies/ICollateralTokenOracle.sol\";\n\n// Code block 8 (solidity):\npackages\\contracts\\contracts\\Interfaces\\IEbtcBase.sol\n\n5: import \"./IPriceFeed.sol\";\n\n// Code block 9 (solidity):\npackages\\contracts\\contracts\\Interfaces\\IEBTCToken.sol\n\n5: import \"../Dependencies/IERC20.sol\";\n6: import \"../Dependencies/IERC2612.sol\";\n\n// Code block 10 (solidity):\npackages\\contracts\\contracts\\Interfaces\\IERC3156FlashLender.sol\n\n5: import \"./IERC3156FlashBorrower.sol\";", "all_code_blocks_count": 10, "has_diff_blocks": false, "diff_code": "", "solidity_code": "packages\\contracts\\contracts\\Dependencies\\EbtcBase.sol\n\n5: import \"./BaseMath.sol\";\n6: import \"./EbtcMath.sol\";\n7: import \"../Interfaces/IActivePool.sol\";\n8: import \"../Interfaces/IPriceFeed.sol\";\n9: import \"../Interfaces/IEbtcBase.sol\";\n10: import \"../Dependencies/ICollateralToken.sol\";\n\npackages\\contracts\\contracts\\Dependencies\\ERC3156FlashLender.sol\n\n5: import \"../Interfaces/IERC3156FlashLender.sol\";\n6: import \"../Interfaces/IWETH.sol\";\n\npackages\\contracts\\contracts\\Dependencies\\RolesAuthority.sol\n\n6: import \"./EnumerableSet.sol\";\n\npackages\\contracts\\contracts\\Interfaces\\IActivePool.sol\n\n5: import \"./IPool.sol\";\n\npackages\\contracts\\contracts\\Interfaces\\IBorrowerOperations.sol\n\n4: import \"./IPositionManagers.sol\";\n\npackages\\contracts\\contracts\\Interfaces\\ICdpManager.sol\n\n5: import \"./IEbtcBase.sol\";\n6: import \"./ICdpManagerData.sol\";\n\npackages\\contracts\\contracts\\Interfaces\\ICdpManagerData.sol\n\n5: import \"./ICollSurplusPool.sol\";\n6: import \"./IEBTCToken.sol\";\n7: import \"./ISortedCdps.sol\";\n8: import \"./IActivePool.sol\";\n9: import \"./IRecoveryModeGracePeriod.sol\";\n10: import \"../Dependencies/ICollateralTokenOracle.sol\";\n\npackages\\contracts\\contracts\\Interfaces\\IEbtcBase.sol\n\n5: import \"./IPriceFeed.sol\";\n\npackages\\contracts\\contracts\\Interfaces\\IEBTCToken.sol\n\n5: import \"../Dependencies/IERC20.sol\";\n6: import \"../Dependencies/IERC2612.sol\";\n\npackages\\contracts\\contracts\\Interfaces\\IERC3156FlashLender.sol\n\n5: import \"./IERC3156FlashBorrower.sol\";", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "packages\\contracts\\contracts\\Dependencies\\EbtcBase.sol\n\n5: import \"./BaseMath.sol\";\n6: import \"./EbtcMath.sol\";\n7: import \"../Interfaces/IActivePool.sol\";\n8: import \"../Interfaces/IPriceFeed.sol\";\n9: import \"../Interfaces/IEbtcBase.sol\";\n10: import \"../Dependencies/ICollateralToken.sol\";", "has_vulnerable_code_snippet": true, "fixed_code_actual": "packages\\contracts\\contracts\\Dependencies\\ERC3156FlashLender.sol\n\n5: import \"../Interfaces/IERC3156FlashLender.sol\";\n6: import \"../Interfaces/IWETH.sol\";", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 15} {"source": "c4", "protocol": "06-lybra", "title": "0xRobocop Q", "severity_raw": "Critical", "severity": "critical", "description": "The following criteria are used for suggested severity:\n\n- L - Low Severity -> Some risk\n\n- NC - Non-Critical / Informational -> Minor suggestions\n\n# L-01 Normal liquidations at the EUSD and PeUSD vaults do not take into account providers preferences over their funds.\n\nThe `liquidation` function in the EUSD and PeUSD vault contracts only validates that the provider has granted an allowance to the vault greater than zero, which may impact the liquidation provider's preferences since they cannot specify how much eUSD they are willing to spend to participate as liquidations providers. This behavior is also inconsistent with super liquidations, which validate that the provider has approved at least the amount of eUSD that will be repaid with their funds.\n\n# L-02 setvaultMintPaused at the configurator cannot be called by the TIMELOCK\n\nThe comments above `setvaultMintPaused` says:\n\n```solidity\n@dev This function can only be called by accounts with ADMIN or higher privilege.\n```\n\nThe function is implemented as:\n\n```solidity\nfunction setvaultMintPaused(address pool, bool isActive) external checkRole(ADMIN) {\n vaultMintPaused[pool] = isActive;\n}\n```\n\nThe `checkRole` modifier is implemented as:\n\n```solidity\nmodifier checkRole(bytes32 role) {\n GovernanceTimelock.checkRole(role, msg.sender);\n _;\n}\n```\n\nThe `checkRole` at the governance timelock is implemented as:\n\n```solidity\nfunction checkRole(bytes32 role, address _sender) public view returns(bool){\n return hasRole(role, _sender) || hasRole(DAO, _sender);\n}\n```\n\nIt means that only admin or dao can call it, althoug timelock is a role greater than admin.\n\n\n# L-03 getClaimableUSD view function at the ProtocolRewardsPool contract returns an incorrect value.\n\nThe function is coded as follows:\n\n```solidity\nfunction getClaimAbleUSD(address user) external view returns (uint256 amount) {\n amount = IEUSD(configurator.getEUSDAddress()).getMintedEUSDByShares(earned(user));\n}\n```\n\nThe function treats all the tokens a user", "vulnerable_code": "@dev This function can only be called by accounts with ADMIN or higher privilege.", "fixed_code": "function setvaultMintPaused(address pool, bool isActive) external checkRole(ADMIN) {\n vaultMintPaused[pool] = isActive;\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/0xRobocop-Q.md", "collected_at": "2026-01-02T18:22:01.916892+00:00", "source_hash": "4a15cd5fdca9722e0857a82ed0b55f02d90e75426ac12053f7c37d5bd808143e", "code_block_count": 5, "solidity_block_count": 5, "total_code_chars": 608, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "@dev This function can only be called by accounts with ADMIN or higher privilege.", "primary_code_language": "solidity", "primary_code_char_count": 81, "all_code_blocks": "// Code block 1 (solidity):\n@dev This function can only be called by accounts with ADMIN or higher privilege.\n\n// Code block 2 (solidity):\nfunction setvaultMintPaused(address pool, bool isActive) external checkRole(ADMIN) {\n vaultMintPaused[pool] = isActive;\n}\n\n// Code block 3 (solidity):\nmodifier checkRole(bytes32 role) {\n GovernanceTimelock.checkRole(role, msg.sender);\n _;\n}\n\n// Code block 4 (solidity):\nfunction checkRole(bytes32 role, address _sender) public view returns(bool){\n return hasRole(role, _sender) || hasRole(DAO, _sender);\n}\n\n// Code block 5 (solidity):\nfunction getClaimAbleUSD(address user) external view returns (uint256 amount) {\n amount = IEUSD(configurator.getEUSDAddress()).getMintedEUSDByShares(earned(user));\n}", "all_code_blocks_count": 5, "has_diff_blocks": false, "diff_code": "", "solidity_code": "@dev This function can only be called by accounts with ADMIN or higher privilege.\n\nfunction setvaultMintPaused(address pool, bool isActive) external checkRole(ADMIN) {\n vaultMintPaused[pool] = isActive;\n}\n\nmodifier checkRole(bytes32 role) {\n GovernanceTimelock.checkRole(role, msg.sender);\n _;\n}\n\nfunction checkRole(bytes32 role, address _sender) public view returns(bool){\n return hasRole(role, _sender) || hasRole(DAO, _sender);\n}\n\nfunction getClaimAbleUSD(address user) external view returns (uint256 amount) {\n amount = IEUSD(configurator.getEUSDAddress()).getMintedEUSDByShares(earned(user));\n}", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "@dev This function can only be called by accounts with ADMIN or higher privilege.", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function setvaultMintPaused(address pool, bool isActive) external checkRole(ADMIN) {\n vaultMintPaused[pool] = isActive;\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "08-dopex", "title": "JP_Courses G", "severity_raw": "Gas", "severity": "gas", "description": "0. RdpxV2Core::settle() - Gas optimization possible in `for loop`.\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/e96aaa5ea21f11b29d828dbe2d0745974cd046ed/contracts/core/RdpxV2Core.sol#L775-L777\n\nCurrent code:\n```solidity\n for (uint256 i = 0; i < optionIds.length; i++) { /// @audit-issue GAS\n optionsOwned[optionIds[i]] = false;\n }\n```\n\nRecommended gas optimizations:\n```solidity\n ++ uint256 optionIdsLength = optionIds.length;\n ++ for (uint256 i; i < optionIdsLength;) {\n optionsOwned[optionIds[i]] = false;\n \n ++ unchecked {\n ++ \ti++;\n ++ }\n }\n```\n\n\n1. RdpxV2Core::bondWithDelegate() - Gas optimization possible in `for loop`.\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/e96aaa5ea21f11b29d828dbe2d0745974cd046ed/contracts/core/RdpxV2Core.sol#L836-L867\n\nRecommendation:\n\n```solidity\n ++ uint256 _amountsLength = _amounts.length;\n ++ for (uint256 i; i < _amountsLength;) {\n \n /// `for loop` logic\n \n ++ unchecked {\n ++ i++;\n ++ }\n }\n```\n\n2. \n\nhttps://github.com/code-423n4/2023-08-dopex/blob/e96aaa5ea21f11b29d828dbe2d0745974cd046ed/contracts/core/RdpxV2Core.sol#L167-L170\n\nExisting code/`for loop`:\n```solidity\n for (uint256 i = 0; i < tokens.length; i++) {\n token = IERC20WithBurn(tokens[i]);\n token.safeTransfer(msg.sender, token.balanceOf(address(this)));\n }\n```\n\nRecommendation:\n```solidity\n ++ uint256 tokensLength = tokens.length;\n ++ for (uint256 i; i < tokensLength;) {\n token = IERC20WithBurn(tokens[i]);\n token.safeTransfer(msg.sender, token.balanceOf(address(this)));\n ++ unchecked {\n ++ i++;\n ++ }\n }\n```\n", "vulnerable_code": " for (uint256 i = 0; i < optionIds.length; i++) { /// @audit-issue GAS\n optionsOwned[optionIds[i]] = false;\n }", "fixed_code": " ++ uint256 optionIdsLength = optionIds.length;\n ++ for (uint256 i; i < optionIdsLength;) {\n optionsOwned[optionIds[i]] = false;\n \n ++ unchecked {\n ++ \ti++;\n ++ }\n }", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/JP_Courses-G.md", "collected_at": "2026-01-02T18:24:42.498539+00:00", "source_hash": "4a625d90aa06f2f6abb32c28140a61bb9723aa40039d15a4d44ad594dfaaaff6", "code_block_count": 5, "solidity_block_count": 5, "total_code_chars": 881, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "for (uint256 i = 0; i < optionIds.length; i++) { /// @audit-issue GAS\n optionsOwned[optionIds[i]] = false;\n }", "primary_code_language": "solidity", "primary_code_char_count": 118, "all_code_blocks": "// Code block 1 (solidity):\nfor (uint256 i = 0; i < optionIds.length; i++) { /// @audit-issue GAS\n optionsOwned[optionIds[i]] = false;\n }\n\n// Code block 2 (solidity):\n++ uint256 optionIdsLength = optionIds.length;\n ++ for (uint256 i; i < optionIdsLength;) {\n optionsOwned[optionIds[i]] = false;\n \n ++ unchecked {\n ++ \ti++;\n ++ }\n }\n\n// Code block 3 (solidity):\n++ uint256 _amountsLength = _amounts.length;\n ++ for (uint256 i; i < _amountsLength;) {\n \n /// `for loop` logic\n \n ++ unchecked {\n ++ i++;\n ++ }\n }\n\n// Code block 4 (solidity):\nfor (uint256 i = 0; i < tokens.length; i++) {\n token = IERC20WithBurn(tokens[i]);\n token.safeTransfer(msg.sender, token.balanceOf(address(this)));\n }\n\n// Code block 5 (solidity):\n++ uint256 tokensLength = tokens.length;\n ++ for (uint256 i; i < tokensLength;) {\n token = IERC20WithBurn(tokens[i]);\n token.safeTransfer(msg.sender, token.balanceOf(address(this)));\n ++ unchecked {\n ++ i++;\n ++ }\n }", "all_code_blocks_count": 5, "has_diff_blocks": false, "diff_code": "", "solidity_code": "for (uint256 i = 0; i < optionIds.length; i++) { /// @audit-issue GAS\n optionsOwned[optionIds[i]] = false;\n }\n\n++ uint256 optionIdsLength = optionIds.length;\n ++ for (uint256 i; i < optionIdsLength;) {\n optionsOwned[optionIds[i]] = false;\n \n ++ unchecked {\n ++ \ti++;\n ++ }\n }\n\n++ uint256 _amountsLength = _amounts.length;\n ++ for (uint256 i; i < _amountsLength;) {\n \n /// `for loop` logic\n \n ++ unchecked {\n ++ i++;\n ++ }\n }\n\nfor (uint256 i = 0; i < tokens.length; i++) {\n token = IERC20WithBurn(tokens[i]);\n token.safeTransfer(msg.sender, token.balanceOf(address(this)));\n }\n\n++ uint256 tokensLength = tokens.length;\n ++ for (uint256 i; i < tokensLength;) {\n token = IERC20WithBurn(tokens[i]);\n token.safeTransfer(msg.sender, token.balanceOf(address(this)));\n ++ unchecked {\n ++ i++;\n ++ }\n }", "github_refs_formatted": "RdpxV2Core.sol#L775-L777, RdpxV2Core.sol#L836-L867, RdpxV2Core.sol#L167-L170", "github_files_list": "RdpxV2Core.sol", "github_refs_count": 3, "vulnerable_code_actual": " for (uint256 i = 0; i < optionIds.length; i++) { /// @audit-issue GAS\n optionsOwned[optionIds[i]] = false;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " ++ uint256 optionIdsLength = optionIds.length;\n ++ for (uint256 i; i < optionIdsLength;) {\n optionsOwned[optionIds[i]] = false;\n \n ++ unchecked {\n ++ \ti++;\n ++ }\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 11} {"source": "c4", "protocol": "02-ethos", "title": "RaymondFam Q", "severity_raw": "High", "severity": "high", "description": "## Impractical upper bound limit in `_requireValidMaxFeePercentage()`\nIn `_requireValidMaxFeePercentage()` of BorrowerOperations.sol, the upper bound of `_maxFeePercentage` is `DECIMAL_PRECISION`, i.e. 1e18 (or 100%). However, when [`getBorrowingFee()`](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L1471-L1473) is eventually invoked by [`_triggerBorrowingFee()`](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L421), the output returned will at most be equal to [`MAX_BORROWING_FEE`](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L1467), which is [5%](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L55). As such, `_requireValidMaxFeePercentage()` should be refactored as follows, regardless of the minimal impact this has on [`_requireUserAcceptsFee()`](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/Dependencies/LiquityBase.sol#L90), to be more expediently in line with the logic flow entailed:\n\n[File: BorrowerOperations.sol#L648-L656](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L648-L656) \n\n```diff\n function _requireValidMaxFeePercentage(uint _maxFeePercentage, bool _isRecoveryMode) internal pure {\n if (_isRecoveryMode) {\n- require(_maxFeePercentage <= DECIMAL_PRECISION,\n \"Max fee percentage must less than or equal to 100%\");\n+ require(_maxFeePercentage <= 5e15,\n \"Max fee percentage must less than or equal to 5%\");\n } else {\n- require(_maxFeePercentage >= BORROWING_FEE_FLOOR && _maxFeePercentage <= DECIMAL_PRECISION,\n \"Max fee percentage must be between 0.5% and 100%\");\n+ require(_maxFeePercentage >= BORROWING_FEE_FLOOR && _maxFeePercentage <= 5e15,\n \"Max fee percentage must be betwe", "vulnerable_code": "## Uninitialized `baseRate` till the first call on `redeemCollateral()`\nThe impact, though low, is twofold. First off, the output of `getBorrowingFee()` is always going to be `BORROWING_FEE_FLOOR`, i.e. [0.5%](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/Dependencies/LiquityBase.sol#L30) because `_baseRate == 0`:\n\n[File: TroveManager.sol#L1464-L1469](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L1464-L1469)\n", "fixed_code": "Next, when `baseRate` finally gets assigned via [`updateBaseRateFromRedemption()`](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L1408-L1417), increasing the `baseRate` based on the amount redeemed, as a proportion of total supply, is going to be minimally negligible unless the redemption amount is significantly sizable. And, if subsequently LUSD borrowing operations exceed redemptions, `baseRate` is as good as zero comparatively in [5e15, 5e16].\n\nIn another words, this makes the complexity of introducing a decaying factor pegged to a half-life of 720 minutes pretty much obsolete considering the borrowing rate stays always at 0.5%. \n\nConsider having `_calcDecayedBaseRate()` refactored as follows if it is going to take a while before the first redemption is made. Better yet, return `0` if `baseRate` falls below a reasonable dust value:\n\n[File: TroveManager.sol#L1509-L1514](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L1509-L1514)\n ", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/RaymondFam-Q.md", "collected_at": "2026-01-02T18:16:33.279053+00:00", "source_hash": "4a86cb98ee5c82e76e0c85b15bceecc22bad3794ddbbdb0c2daf5561311580f0", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 10, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "TroveManager.sol#L1471-L1473, BorrowerOperations.sol#L421, TroveManager.sol#L1467, TroveManager.sol#L55, LiquityBase.sol#L90, BorrowerOperations.sol#L648-L656, LiquityBase.sol#L30, TroveManager.sol#L1464-L1469, TroveManager.sol#L1408-L1417, TroveManager.sol#L1509-L1514", "github_files_list": "TroveManager.sol, BorrowerOperations.sol, LiquityBase.sol", "github_refs_count": 10, "vulnerable_code_actual": "## Uninitialized `baseRate` till the first call on `redeemCollateral()`\nThe impact, though low, is twofold. First off, the output of `getBorrowingFee()` is always going to be `BORROWING_FEE_FLOOR`, i.e. [0.5%](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/Dependencies/LiquityBase.sol#L30) because `_baseRate == 0`:\n\n[File: TroveManager.sol#L1464-L1469](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L1464-L1469)\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "Next, when `baseRate` finally gets assigned via [`updateBaseRateFromRedemption()`](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L1408-L1417), increasing the `baseRate` based on the amount redeemed, as a proportion of total supply, is going to be minimally negligible unless the redemption amount is significantly sizable. And, if subsequently LUSD borrowing operations exceed redemptions, `baseRate` is as good as zero comparatively in [5e15, 5e16].\n\nIn another words, this makes the complexity of introducing a decaying factor pegged to a half-life of 720 minutes pretty much obsolete considering the borrowing rate stays always at 0.5%. \n\nConsider having `_calcDecayedBaseRate()` refactored as follows if it is going to take a while before the first redemption is made. Better yet, return `0` if `baseRate` falls below a reasonable dust value:\n\n[File: TroveManager.sol#L1509-L1514](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L1509-L1514)\n ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-biconomy", "title": "Breeje Q", "severity_raw": "Low", "severity": "low", "description": "\n## QA Report\n\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [L-1](#L-1) | USE OF FLOATING PRAGMA | 13 |\n| [L-2](#L-2) | MISSING CONTRACT-EXISTENCE CHECKS BEFORE LOW-LEVEL CALLS | 6 |\n| [L-3](#L-3) | CONSIDER USING A TWO-STEP-TRANSFER OF OWNERSHIP | 2 |\n| [L-4](#L-4) | POSSIBLE REENTRACY ATTACK | 2 |\n| [NC-1](#NC-1) | USE REQUIRE INSTEAD OF ASSERT | 2 |\n| [NC-2](#NC-2) | UNUSED FUNCTIONAL PARAMETER | 1 |\n| [NC-3](#NC-3) | INSTEAD OF JUST REVERTING, FUNCTION CAN BE OMITTED | 1 |\n\n\n### [L-1] USE OF FLOATING PRAGMA\n\nImpact: [swcregistry](https://swcregistry.io/docs/SWC-103)\n\n*Instances (13)*:\n* [BasePaymaster.sol](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L2)\n* [BaseAccount.sol](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/BaseAccount.sol#L2)\n* [BasePaymaster.sol](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/BasePaymaster.sol#L2)\n* [EntryPoint.sol](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L6)\n* [SenderCreator.sol](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/SenderCreator.sol#L2)\n* [StakeManager.sol](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/StakeManager.sol#L2)\n* [IAccount.sol](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IAccount.sol#L2)\n* [IAggregatedAccount.sol](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IAggregatedAccount.sol#L2)\n* [IEntryPoint.sol](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/inter", "vulnerable_code": "File: Proxy.sol\n\n28: let result := delegatecall(gas(), target, 0, calldatasize(), 0, 0)", "fixed_code": "File: aa-4337/utils/Exec.sol\n\n35: success := delegatecall(txGas, to, add(data, 0x20), mload(data), 0, 0)\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/Breeje-Q.md", "collected_at": "2026-01-02T18:12:59.926040+00:00", "source_hash": "4adb40f2ba7b8682e7526502f4be2f73a04cdf5d5da8f27676870d430f0983bb", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 7, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "BasePaymaster.sol#L2, BaseAccount.sol#L2, EntryPoint.sol#L6, SenderCreator.sol#L2, StakeManager.sol#L2, IAccount.sol#L2, IAggregatedAccount.sol#L2", "github_files_list": "SenderCreator.sol, IAggregatedAccount.sol, BasePaymaster.sol, BaseAccount.sol, IAccount.sol, EntryPoint.sol, StakeManager.sol", "github_refs_count": 7, "vulnerable_code_actual": "File: Proxy.sol\n\n28: let result := delegatecall(gas(), target, 0, calldatasize(), 0, 0)", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: aa-4337/utils/Exec.sol\n\n35: success := delegatecall(txGas, to, add(data, 0x20), mload(data), 0, 0)\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "03-asymmetry", "title": "Sathish9098 G", "severity_raw": "Critical", "severity": "critical", "description": "# GAS OPTIMIZATIONS\n\n| | Issues| Instances|\n|:--------:|-------|----------|\n| [G-1] | Use a more recent version of solidity |4 |\n| [G-2] | Setting the constructor to payable |4 |\n| [G-3] | OPTIMIZE NAMES TO SAVE GAS | 37|\n| [G-4] | Don't declare the variables inside the loops costs more gas |11 |\n| [G-5] | Avoid contract existence checks by using low level calls | 19|\n| [G-6] | ADD UNCHECKED {} FOR SUBTRACTIONS WHERE THE OPERANDS CANNOT UNDERFLOW BECAUSE OF A PREVIOUS REQUIRE() OR IF-STATEMENT |1 |\n| [G-7] | Public function not called by contract declare external to save gas | 2|\n| [G-8] | With assembly, .call (bool success) transfer can be done gas-optimized |3 |\n| [G-9] | Empty blocks should be removed or emit something | 4|\n| [G-10] | Usage of uints/ints smaller than 32 bytes (256 bits) incurs overhead | 2|\n| [G-11] | Private functions only called once can be inlined to save gas |1 |\n| [G-12] | Make 3 event parameters indexed when possible | 5|\n| [G-13] | Save gas with address(0) checks before transfer ownership | 4|\n| [G-14] | Gas overflow during iteration (DoS) | 4|\n| [G-15] | Sort Solidity operations using short-circuit mode | 1|\n| [G-16] | Save gas with the use of the specific import statement | 4|\n| [G-17] | Instead of calculating the value with keccak256() every time the contract is made pre calculate them before and only give the result to a constant | 3|\n\n### [G-1] Use a more recent version of solidity\n\nINSTANCES (4):\n\nIn 0.8.15 the conditions necessary for inlining are relaxed. Benchmarks show that the change significantly decreases the bytecode size (which impacts the deployment cost) while the effect on the runtime gas usage is smaller.\n\nIn 0.8.17 prevent the incorrect removal of storage writes before calls to Yul functions that conditionally terminate the external EVM call; Simplify the starting offset of zero-length ope", "vulnerable_code": "2: pragma solidity ^0.8.13;", "fixed_code": "2: pragma solidity ^0.8.13;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Sathish9098-G.md", "collected_at": "2026-01-02T18:18:33.269005+00:00", "source_hash": "4b36d7e0b23fe3b49d0f909f39aaf95c36982b03bf35025e8d4fd5ff7feaadc4", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "2: pragma solidity ^0.8.13;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "2: pragma solidity ^0.8.13;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "05-ajna", "title": "niki Q", "severity_raw": "Unknown", "severity": "unknown", "description": "### Unsafe ERC20 Operation(s)\n\n#### Findings:\n```\nanja\\RewardsManager.sol::250 => IERC721(address(positionManager)).transferFrom(msg.sender, address(this), tokenId_);\nanja\\RewardsManager.sol::302 => IERC721(address(positionManager)).transferFrom(address(this), msg.sender, tokenId_);\n```", "vulnerable_code": "anja\\RewardsManager.sol::250 => IERC721(address(positionManager)).transferFrom(msg.sender, address(this), tokenId_);\nanja\\RewardsManager.sol::302 => IERC721(address(positionManager)).transferFrom(address(this), msg.sender, tokenId_);", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/niki-Q.md", "collected_at": "2026-01-02T18:21:40.023188+00:00", "source_hash": "4b4ae24260ca1ef91013250c1b7893691eab9dade881be82e5ef7f40160ca5e4", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 233, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "anja\\RewardsManager.sol::250 => IERC721(address(positionManager)).transferFrom(msg.sender, address(this), tokenId_);\nanja\\RewardsManager.sol::302 => IERC721(address(positionManager)).transferFrom(address(this), msg.sender, tokenId_);", "primary_code_language": "unknown", "primary_code_char_count": 233, "all_code_blocks": "// Code block 1 (unknown):\nanja\\RewardsManager.sol::250 => IERC721(address(positionManager)).transferFrom(msg.sender, address(this), tokenId_);\nanja\\RewardsManager.sol::302 => IERC721(address(positionManager)).transferFrom(address(this), msg.sender, tokenId_);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "anja\\RewardsManager.sol::250 => IERC721(address(positionManager)).transferFrom(msg.sender, address(this), tokenId_);\nanja\\RewardsManager.sol::302 => IERC721(address(positionManager)).transferFrom(address(this), msg.sender, tokenId_);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 2.57} {"source": "c4", "protocol": "06-lybra", "title": "Silvermist Q", "severity_raw": "High", "severity": "high", "description": "## Emitting event before it happens\n```\nfunction setFlashloanFee(uint256 fee) external checkRole(TIMELOCK) {\n if (fee > 10_000) revert('EL');\n emit FlashloanFeeUpdated(fee);\n flashloanFee = fee;\n }\n```\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/configuration/LybraConfigurator.sol#L253-L257\n\n## Not implemented function logic\n```\n /**\n * @notice Update user's claimable reward data and record the timestamp.\n */\n function refreshReward(address _account) external updateReward(_account) {}\n```\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/EUSDMiningIncentives.sol#L171-L174\n\n## Isn't check if _contracts and _bools arrays are equal\nIt is assumed that the two arrays will be equal and this is not checked. But if the _contracts array has more values than _bools, the pools that have no corresponding values from _bools will be set as default to false.\n\n```\n function setTokenMiner(address[] calldata _contracts, bool[] calldata _bools) external checkRole(TIMELOCK) {\n for (uint256 i = 0; i < _contracts.length; i++) {\n tokenMiner[_contracts[i]] = _bools[i];\n emit tokenMinerChanges(_contracts[i], _bools[i]);\n }\n }\n```\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/configuration/LybraConfigurator.sol#L235-L240\n\n## Missing require check\nIt is written in the comments that 'amount' must me higher than 0 but that isn't checked. \nAdd require(amount > 0, \"ZERO_MINT\");\n```\n * Requirements:\n * - `onBehalfOf` cannot be the zero address.\n * - `amount` Must be higher than 0.\n * @dev Calling the internal`_repay`function.\n */\n function burn(address onBehalfOf, uint256 amount) external {\n require(onBehalfOf != address(0), \"BURN_TO_THE_ZERO_ADDRESS\");\n _repay(msg.sender, onBehalfOf, amount);\n }\n", "vulnerable_code": "function setFlashloanFee(uint256 fee) external checkRole(TIMELOCK) {\n if (fee > 10_000) revert('EL');\n emit FlashloanFeeUpdated(fee);\n flashloanFee = fee;\n }", "fixed_code": " /**\n * @notice Update user's claimable reward data and record the timestamp.\n */\n function refreshReward(address _account) external updateReward(_account) {}", "recommendation": "", "category": "flash-loan", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/Silvermist-Q.md", "collected_at": "2026-01-02T18:22:44.928931+00:00", "source_hash": "4b652fbeac5ee3232504a4428041dcd0cbcdd585f83c0650de2a169c4e3c4b20", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 644, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function setFlashloanFee(uint256 fee) external checkRole(TIMELOCK) {\n if (fee > 10_000) revert('EL');\n emit FlashloanFeeUpdated(fee);\n flashloanFee = fee;\n }", "primary_code_language": "unknown", "primary_code_char_count": 181, "all_code_blocks": "// Code block 1 (unknown):\nfunction setFlashloanFee(uint256 fee) external checkRole(TIMELOCK) {\n if (fee > 10_000) revert('EL');\n emit FlashloanFeeUpdated(fee);\n flashloanFee = fee;\n }\n\n// Code block 2 (unknown):\n/**\n * @notice Update user's claimable reward data and record the timestamp.\n */\n function refreshReward(address _account) external updateReward(_account) {}\n\n// Code block 3 (unknown):\nfunction setTokenMiner(address[] calldata _contracts, bool[] calldata _bools) external checkRole(TIMELOCK) {\n for (uint256 i = 0; i < _contracts.length; i++) {\n tokenMiner[_contracts[i]] = _bools[i];\n emit tokenMinerChanges(_contracts[i], _bools[i]);\n }\n }", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LybraConfigurator.sol#L253-L257, EUSDMiningIncentives.sol#L171-L174, LybraConfigurator.sol#L235-L240", "github_files_list": "EUSDMiningIncentives.sol, LybraConfigurator.sol", "github_refs_count": 3, "vulnerable_code_actual": "function setFlashloanFee(uint256 fee) external checkRole(TIMELOCK) {\n if (fee > 10_000) revert('EL');\n emit FlashloanFeeUpdated(fee);\n flashloanFee = fee;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " /**\n * @notice Update user's claimable reward data and record the timestamp.\n */\n function refreshReward(address _account) external updateReward(_account) {}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "04-caviar", "title": "0x6980 G", "severity_raw": "Medium", "severity": "medium", "description": "# 1. Use assembly to write address storage values\n- [EthRouter.sol#L91](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L91)\n```js\nFile: src/EthRouter.sol\n\n90: constructor(address _royaltyRegistry) {\n91: royaltyRegistry = _royaltyRegistry;\n90: }\n```\n- [Factory.sol#L130](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/Factory.sol#L130)\n- [Factory.sol#L136](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/Factory.sol#L136)\n```js\nFile: src/Factory.sol\n\n129: function setPrivatePoolMetadata(address _privatePoolMetadata) public onlyOwner {\n130: privatePoolMetadata = _privatePoolMetadata;\n131: }\n\n135: function setPrivatePoolImplementation(address _privatePoolImplementation) public onlyOwner {\n136: privatePoolImplementation = _privatePoolImplementation;\n137: }\n```\nRecommendation Code:\n```js\n+ assembly { \n+ sstore(owner.slot, _owner)\n+ } \n```\n# 2. Use nested ```if``` and, avoid multiple check combinations\nUsing nested is cheaper than using && multiple check combinations. There are more advantages, such as easier to read code and better coverage reports.\n- [EthRouter.sol#L101](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L101)\n- [EthRouter.sol#L154](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L154)\n- [EthRouter.sol#L228](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L228)\n- [EthRouter.sol#L256](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L256)\n```js\nFile: src/EthRouter.sol\n\n101: if (block.timestamp > deadline && deadline != 0) {\n102: rever", "vulnerable_code": "File: src/EthRouter.sol\n\n90: constructor(address _royaltyRegistry) {\n91: royaltyRegistry = _royaltyRegistry;\n90: }", "fixed_code": "File: src/Factory.sol\n\n129: function setPrivatePoolMetadata(address _privatePoolMetadata) public onlyOwner {\n130: privatePoolMetadata = _privatePoolMetadata;\n131: }\n\n135: function setPrivatePoolImplementation(address _privatePoolImplementation) public onlyOwner {\n136: privatePoolImplementation = _privatePoolImplementation;\n137: }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/0x6980-G.md", "collected_at": "2026-01-02T18:19:17.172264+00:00", "source_hash": "4ba4eb2de8d94c96bb0d31b1206019a1e888eafe4a092fb1c0929444bff788d5", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 606, "github_ref_count": 7, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: src/EthRouter.sol\n\n90: constructor(address _royaltyRegistry) {\n91: royaltyRegistry = _royaltyRegistry;\n90: }", "primary_code_language": "js", "primary_code_char_count": 127, "all_code_blocks": "// Code block 1 (js):\nFile: src/EthRouter.sol\n\n90: constructor(address _royaltyRegistry) {\n91: royaltyRegistry = _royaltyRegistry;\n90: }\n\n// Code block 2 (js):\nFile: src/Factory.sol\n\n129: function setPrivatePoolMetadata(address _privatePoolMetadata) public onlyOwner {\n130: privatePoolMetadata = _privatePoolMetadata;\n131: }\n\n135: function setPrivatePoolImplementation(address _privatePoolImplementation) public onlyOwner {\n136: privatePoolImplementation = _privatePoolImplementation;\n137: }\n\n// Code block 3 (js):\n+ assembly { \n+ sstore(owner.slot, _owner)\n+ }", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "EthRouter.sol#L91, Factory.sol#L130, Factory.sol#L136, EthRouter.sol#L101, EthRouter.sol#L154, EthRouter.sol#L228, EthRouter.sol#L256", "github_files_list": "EthRouter.sol, Factory.sol", "github_refs_count": 7, "vulnerable_code_actual": "File: src/EthRouter.sol\n\n90: constructor(address _royaltyRegistry) {\n91: royaltyRegistry = _royaltyRegistry;\n90: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: src/Factory.sol\n\n129: function setPrivatePoolMetadata(address _privatePoolMetadata) public onlyOwner {\n130: privatePoolMetadata = _privatePoolMetadata;\n131: }\n\n135: function setPrivatePoolImplementation(address _privatePoolImplementation) public onlyOwner {\n136: privatePoolImplementation = _privatePoolImplementation;\n137: }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "05-ajna", "title": "nzm_ G", "severity_raw": "Low", "severity": "low", "description": "### += costs more gas than = + for state variables\n\nUsing the addition (or subtraction) operator instead of plus-equals (minus-equals) saves 13 gas for state variables and 7 gas for `mapping` to `struct` per iteration.\n\n9 Instances found:\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/GrantFund.sol#L62\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/ExtraordinaryFunding.sol#L78\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/ExtraordinaryFunding.sol#L145\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L217\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L648\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L673\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L676\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/PositionManager.sol#L320\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/PositionManager.sol#L321\n\n### Some of `memory` input arguments can be changed to `calldata`\n\nIf function's dynamic arguments are not modified it is cheaper to use `calldata` than `memory`.\n\n9 Instances found:\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/Funding.sol#L54-L56\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/Funding.sol#L153-L155\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/ExtraordinaryFunding.sol#L57-L59\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/ExtraordinaryFunding.sol#L87-L89\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L344-L346\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFu", "vulnerable_code": " newId_ = ++_currentDistributionId", "fixed_code": " // check that the voter has enough voting power remaining to cast the vote\n if (cumulativeVotePowerUsed > votingPower) revert InsufficientVotingPower();\n\n // update voter voting power accumulator\n voter_.remainingVotingPower = votingPower - cumulativeVotePowerUsed;", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/nzm_-G.md", "collected_at": "2026-01-02T18:21:40.521964+00:00", "source_hash": "4bb595ac6c5d3c0dc23f1e0e56f636dbedbee4432fce0997f0ee60894f04455b", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 14, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "GrantFund.sol#L62, ExtraordinaryFunding.sol#L78, ExtraordinaryFunding.sol#L145, StandardFunding.sol#L217, StandardFunding.sol#L648, StandardFunding.sol#L673, StandardFunding.sol#L676, PositionManager.sol#L320, PositionManager.sol#L321, Funding.sol#L54-L56, Funding.sol#L153-L155, ExtraordinaryFunding.sol#L57-L59, ExtraordinaryFunding.sol#L87-L89, StandardFunding.sol#L344-L346", "github_files_list": "GrantFund.sol, PositionManager.sol, StandardFunding.sol, Funding.sol, ExtraordinaryFunding.sol", "github_refs_count": 14, "vulnerable_code_actual": " newId_ = ++_currentDistributionId", "has_vulnerable_code_snippet": true, "fixed_code_actual": " // check that the voter has enough voting power remaining to cast the vote\n if (cumulativeVotePowerUsed > votingPower) revert InsufficientVotingPower();\n\n // update voter voting power accumulator\n voter_.remainingVotingPower = votingPower - cumulativeVotePowerUsed;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-biconomy", "title": "0xAgro G", "severity_raw": "High", "severity": "high", "description": "# Gas Report\n## Finding Summary\n||Issue|Instances|\n|-|-|-|\n|[G-01]|Bit Shift(s) Not Used For MUL/DIV/MOD of Powers of 2|9|\n|[G-02]|`uint256` Iterator Checked Each Iteration|7|\n|[G-03]|&& In If Statement(s)|5|\n|[G-04]|`i++`/`i+=1` Used Over `++i`|[+4](https://gist.github.com/Picodes/0a53b4abfc71e0b9998e8b09aa283fb3)|\n|[G-05]|`unchecked` Not Used on Overflow / Underflow Proof Arithmetic|4|\n|[G-06]|&& In Require Statement(s)|3|\n\n### [G-01] Bit Shift(s) Not Used For MUL/DIV/MOD of Powers of 2\n\nBitwise operations usually save on gas. Expressions that deal with unsigned integers, a power of 2 and the operations MUL/DIV/MOD can often be re-written with bitwise shifts.\n\n#### Findings:\n\n*/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol*\nLinks: [200](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L200), [224](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L224).\n```solidity\n200:\tuint256 startGas = gasleft() + 21000 + msg.data.length * 8;\n224:\trequire(gasleft() >= max((_tx.targetTxGas * 64) / 63,_tx.targetTxGas + 2500) + 500, \"BSA010\");\n```\n\n*/scw-contracts/contracts/smart-contract-wallet/libs/Math.sol*\nLinks: [36](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/libs/Math.sol#L36).\n```solidity\n36:\treturn (a & b) + (a ^ b) / 2;\n```\n\n### [G-02] `uint256` Iterator Checked Each Iteration\n\nA `uint256` iterator will not overflow before the check variable overflows. Unchecking the iterator increment saves gas.\n**Example**\n```solidity\n//From\nfor (uint256 i; i < len; ++i) {\n\t//Do Something\n}\n//To\nfor (uint256 i; i < len;) {\n\t//Do Something\n\tunchecked { ++i; }\n}\n```\n\n#### Findings:\n\n*/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol*\nLinks: [74](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-", "vulnerable_code": "200:\tuint256 startGas = gasleft() + 21000 + msg.data.length * 8;\n224:\trequire(gasleft() >= max((_tx.targetTxGas * 64) / 63,_tx.targetTxGas + 2500) + 500, \"BSA010\");", "fixed_code": "36:\treturn (a & b) + (a ^ b) / 2;", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/0xAgro-G.md", "collected_at": "2026-01-02T18:12:46.314381+00:00", "source_hash": "4bd415f07cc7977efbc8d4e4e2849421fb5570f9adaadbb1819f3d55034fd4ad", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 324, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "200:\tuint256 startGas = gasleft() + 21000 + msg.data.length * 8;\n224:\trequire(gasleft() >= max((_tx.targetTxGas * 64) / 63,_tx.targetTxGas + 2500) + 500, \"BSA010\");", "primary_code_language": "solidity", "primary_code_char_count": 164, "all_code_blocks": "// Code block 1 (solidity):\n200:\tuint256 startGas = gasleft() + 21000 + msg.data.length * 8;\n224:\trequire(gasleft() >= max((_tx.targetTxGas * 64) / 63,_tx.targetTxGas + 2500) + 500, \"BSA010\");\n\n// Code block 2 (solidity):\n36:\treturn (a & b) + (a ^ b) / 2;\n\n// Code block 3 (solidity):\n//From\nfor (uint256 i; i < len; ++i) {\n\t//Do Something\n}\n//To\nfor (uint256 i; i < len;) {\n\t//Do Something\n\tunchecked { ++i; }\n}", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "200:\tuint256 startGas = gasleft() + 21000 + msg.data.length * 8;\n224:\trequire(gasleft() >= max((_tx.targetTxGas * 64) / 63,_tx.targetTxGas + 2500) + 500, \"BSA010\");\n\n36:\treturn (a & b) + (a ^ b) / 2;\n\n//From\nfor (uint256 i; i < len; ++i) {\n\t//Do Something\n}\n//To\nfor (uint256 i; i < len;) {\n\t//Do Something\n\tunchecked { ++i; }\n}", "github_refs_formatted": "SmartAccount.sol#L200, SmartAccount.sol#L224, Math.sol#L36", "github_files_list": "Math.sol, SmartAccount.sol", "github_refs_count": 3, "vulnerable_code_actual": "200:\tuint256 startGas = gasleft() + 21000 + msg.data.length * 8;\n224:\trequire(gasleft() >= max((_tx.targetTxGas * 64) / 63,_tx.targetTxGas + 2500) + 500, \"BSA010\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": "36:\treturn (a & b) + (a ^ b) / 2;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "11-kelp", "title": "Madalad Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA Report\n\n## Chainlink price feed `decimals` not checked\n\nThe price value returned by a Chainlink price feed will have a different\n`decimals` value depending on the price feed used. While currently **most** ETH pairs use\n18 decimals and USD pairs use 8 decimals (see the price feeds for\n[LINK/ETH](https://etherscan.io/address/0xDC530D9457755926550b59e8ECcdaE7624181557#readContract)\nand\n[LINK/USD](https://etherscan.io/address/0x2c1d072e956AFFC0D435Cb7AC38EF18d24d9127c#readContract)\nfor example), there is no guarantee that this will be the case for price feeds deployed\nin the future. If the decimals are not checked when querying a price feed, \nincorrect decimals may be assumed which can lead to significant accounting errors. Specifically,\nin `LRTDepositPool#getRsETHAmountToMint`, the decimals of `getAssetPrice()` is assumed to be\nexactly 18, otherwise the returned value could be far smaller than expected, leading to users\nbeing minted far fewer rsETH tokens than intended.\n\nTo access a price feeds decimals, simply call `priceFeed.decimals()`.\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/oracles/ChainlinkPriceOracle.sol#L38\n\n## Chainlink's `latestAnswer` can return stale or incorrect results\n\nChainlink's `latestAnswer` is used here to retrieve price feed data,\nhowever there is insufficient protection against price staleness. Only the\nprice is returned, and it is possible for an outdated price\nto be received. See\n[here](https://ethereum.stackexchange.com/questions/133242/how-future-resilient-is-a-chainlink-price-feed/133843#133843)\nfor reasons why a price feed might stop updating.\n\nInaccurate price data can lead to functions not working as expected and/or\nlost funds. For example, if the price of a supported asset drops suddenly but the\noracle is returning an outdated higher price, users can take advantage of this by\ncalling `LRTDepositPool#depositAsset` to mint themselves more rsETH than their\ntransferred assets are worth, stealing value from the protocol.", "vulnerable_code": "https://github.com/code-423n4/2023-11-kelp/blob/main/src/oracles/ChainlinkPriceOracle.sol#L38\n\n## Chainlink aggregators return the incorrect price if it drops below `minAnswer`\n\nChainlink aggregators have a built in circuit breaker if the price of an asset\ngoes outside of a predetermined price band. The result is that if an asset\nexperiences a huge drop in value (i.e. LUNA crash) the price of the oracle will\ncontinue to return the `minAnswer` instead of the actual price of the asset. See\n[Chainlink's docs](https://docs.chain.link/data-feeds#check-the-latest-answer-against-reasonable-limits)\nfor more info.\n\nThis discrepency could allow users to `deposit` supported assets that the protocol\nperceives as worth more than they actually are, minting them more rsETH than intended\nand causing bad debt in the protocol. A similar attack occurred to \n[Venus on BSC when LUNA imploded](https://rekt.news/venus-blizz-rekt/).\n\nConsider adding a check to revert if the price received from the oracle is\nout of bounds.\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/oracles/ChainlinkPriceOracle.sol#L38\n\n## `DEFAULT_ADMIN_ROLE` can renounce role\n\n`LRTConfig` inherits OpenZeppelin's `AccessControlUpgradeable` which allows callers to renounce roles via the\n`renounceRole` function. This includes the `DEFAULT_ADMIN_ROLE`, which is\nthe admin for every other role, as well as the role responsible for many critical functions\nin the protocol, including `updateAssetStrategy`, `unpause`, etc. If this role is renounced, then calling\nany of those functions, as well as management of\nall other roles is impossible.\n\nRenouncing this role should be explicitly prevented by overriding `renounceRole` and throwing\nif `DEFAULT_ADMIN_ROLE` is passed.\n\n## `LRTConfig#setToken` should require the asset to be supported\n\nIf `setToken()` is called on an `assetAddress` that is not supported, it may mislead those who would call `getLSTToken()` and receive a non-zero address.\n", "fixed_code": "https://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTConfig.sol#L149-L163\n\n## LRTManager can transfer asset tokens to `NodeDelegator` while contract is paused\n\n`LRTDepositPool` uses `Pausable` to allow the manager/admin to pause the contract and prevent any sensitive actions, however `transferAssetToNodeDelegator()` is missing the `whenNotPaused` modifier, meaning it is callable even if the contract is in a paused state. The transfer of funds should not be permitted while the contract is paused (in `NodeDelegator`, functions that transfer funds use the `whenNotPaused` modifier even if they are admin protected).\n\nAdd the `whenNotPaused` modifier to `transferAssetToNodeDelegator()`.\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTDepositPool.sol#L183-L192\n\n## `LRTConfig#updateAssetDepositLimit()` can cause DoS\n\n`LRTConfig#updateAssetDepositLimit()` is used by the LTR manager to change the `depositLimit` for a particular asset after initialization.\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/Madalad-Q.md", "collected_at": "2026-01-02T18:27:32.262748+00:00", "source_hash": "4bf972851ecb422c41238c74277396203df47417c23750cd1dfb90f7ec71ef3a", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ChainlinkPriceOracle.sol#L38, LRTConfig.sol#L149-L163, LRTDepositPool.sol#L183-L192", "github_files_list": "LRTConfig.sol, ChainlinkPriceOracle.sol, LRTDepositPool.sol", "github_refs_count": 3, "vulnerable_code_actual": "https://github.com/code-423n4/2023-11-kelp/blob/main/src/oracles/ChainlinkPriceOracle.sol#L38\n\n## Chainlink aggregators return the incorrect price if it drops below `minAnswer`\n\nChainlink aggregators have a built in circuit breaker if the price of an asset\ngoes outside of a predetermined price band. The result is that if an asset\nexperiences a huge drop in value (i.e. LUNA crash) the price of the oracle will\ncontinue to return the `minAnswer` instead of the actual price of the asset. See\n[Chainlink's docs](https://docs.chain.link/data-feeds#check-the-latest-answer-against-reasonable-limits)\nfor more info.\n\nThis discrepency could allow users to `deposit` supported assets that the protocol\nperceives as worth more than they actually are, minting them more rsETH than intended\nand causing bad debt in the protocol. A similar attack occurred to \n[Venus on BSC when LUNA imploded](https://rekt.news/venus-blizz-rekt/).\n\nConsider adding a check to revert if the price received from the oracle is\nout of bounds.\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/oracles/ChainlinkPriceOracle.sol#L38\n\n## `DEFAULT_ADMIN_ROLE` can renounce role\n\n`LRTConfig` inherits OpenZeppelin's `AccessControlUpgradeable` which allows callers to renounce roles via the\n`renounceRole` function. This includes the `DEFAULT_ADMIN_ROLE`, which is\nthe admin for every other role, as well as the role responsible for many critical functions\nin the protocol, including `updateAssetStrategy`, `unpause`, etc. If this role is renounced, then calling\nany of those functions, as well as management of\nall other roles is impossible.\n\nRenouncing this role should be explicitly prevented by overriding `renounceRole` and throwing\nif `DEFAULT_ADMIN_ROLE` is passed.\n\n## `LRTConfig#setToken` should require the asset to be supported\n\nIf `setToken()` is called on an `assetAddress` that is not supported, it may mislead those who would call `getLSTToken()` and receive a non-zero address.\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "https://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTConfig.sol#L149-L163\n\n## LRTManager can transfer asset tokens to `NodeDelegator` while contract is paused\n\n`LRTDepositPool` uses `Pausable` to allow the manager/admin to pause the contract and prevent any sensitive actions, however `transferAssetToNodeDelegator()` is missing the `whenNotPaused` modifier, meaning it is callable even if the contract is in a paused state. The transfer of funds should not be permitted while the contract is paused (in `NodeDelegator`, functions that transfer funds use the `whenNotPaused` modifier even if they are admin protected).\n\nAdd the `whenNotPaused` modifier to `transferAssetToNodeDelegator()`.\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTDepositPool.sol#L183-L192\n\n## `LRTConfig#updateAssetDepositLimit()` can cause DoS\n\n`LRTConfig#updateAssetDepositLimit()` is used by the LTR manager to change the `depositLimit` for a particular asset after initialization.\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "03-asymmetry", "title": "Diana Q", "severity_raw": "Critical", "severity": "critical", "description": "-------\n\n| S No. | Issue | Instances |\n|-----|-----|-----|\n| [01] | Unused receive() function will lock ether in contract | 3\n| [02] | Upgradeable contract is missing a_\\_gap[50] storage variable to allow for new storage variables in later versions | 4\n| [03] | Use scientific notation rather than exponentiation | 21\n| [04] | Missing events for functions that change critical parameters | 3\n| [05] | Non-library or interface files should use fixed compiler versions, not floating ones | 4\n| [06] | Use named imports instead of plain 'import file.sol' | 31\n| [07] | Use a more recent version of solidity | 4\n\n-------------\n\n## 01 Unused receive() function will lock ether in contract\n\nReceive() function exists in this contract, so it is possible to send ETH. If someone sends ETH by mistake for instance `msg.value = 3`, then this will be stuck in the contract as there is no functionality to refund the ETH back.\n\nIf the intention is for the Ether to be used, the function should call another function, otherwise it should revert\n\n_There are 3 instances of this issue:_\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol\n\n```\nFile: SafEth/derivatives/Reth.sol\n\n244: receive() external payable {}\n```\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol\n\n```\nFile: SafEth/derivatives/SfrxEth.sol\n\n126: receive() external payable {}\n```\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol\n\n```\nFile: SafEth/derivatives/WstEth.sol\n\n97: receive() external payable {}\n```\n\n### Recommended Mitigation Steps\n\nRemove these functions, or include a call to rescueETH in receive(), so that a user that mistakenly sends ETH, is able to retrieve it immediately.\n\n--------\n\n## 02 Upgradeable contract is missing a __gap[50] storage variable to allow for new storage variables in later versions\n\nSee\u00a0[this](https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_ga", "vulnerable_code": "File: SafEth/derivatives/Reth.sol\n\n244: receive() external payable {}", "fixed_code": "File: SafEth/derivatives/SfrxEth.sol\n\n126: receive() external payable {}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Diana-Q.md", "collected_at": "2026-01-02T18:18:02.460718+00:00", "source_hash": "4c1c731e39ae55deede3520e3789379e6627133bbf9f92c33831c5f05258f051", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 211, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: SafEth/derivatives/Reth.sol\n\n244: receive() external payable {}", "primary_code_language": "unknown", "primary_code_char_count": 69, "all_code_blocks": "// Code block 1 (unknown):\nFile: SafEth/derivatives/Reth.sol\n\n244: receive() external payable {}\n\n// Code block 2 (unknown):\nFile: SafEth/derivatives/SfrxEth.sol\n\n126: receive() external payable {}\n\n// Code block 3 (unknown):\nFile: SafEth/derivatives/WstEth.sol\n\n97: receive() external payable {}", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Reth.sol, SfrxEth.sol, WstEth.sol", "github_files_list": "SfrxEth.sol, Reth.sol, WstEth.sol", "github_refs_count": 3, "vulnerable_code_actual": "File: SafEth/derivatives/Reth.sol\n\n244: receive() external payable {}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: SafEth/derivatives/SfrxEth.sol\n\n126: receive() external payable {}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "05-ajna", "title": "c3phas G", "severity_raw": "High", "severity": "high", "description": "### Table Of Contents\n- [FINDINGS](#findings)\n- [IF's/require() statements that check input arguments should be at the top of the function](#ifsrequire-statements-that-check-input-arguments-should-be-at-the-top-of-the-function)\n - [Don't read from storage if we might revert on a check that involves a function arguments.](#dont-read-from-storage-if-we-might-revert-on-a-check-that-involves-a-function-arguments)\n - [Reorder the checks here to have the cheaper one first](#reorder-the-checks-here-to-have-the-cheaper-one-first)\n - [Checks involving constants or local variables should be done before those reading from storage](#checks-involving-constants-or-local-variables-should-be-done-before-those-reading-from-storage)\n - [Incase of a revert here, we can save 2 SSTOREs here](#incase-of-a-revert-here-we-can-save-2-sstores-here)\n - [Some checks being performed at the bottom should be checked earlier](#some-checks-being-performed-at-the-bottom-should-be-checked-earlier)\n- [x += y costs more gas than x = x + y for state variables](#x--y-costs-more-gas-than-x--x--y-for-state-variables)\n- [Using unchecked blocks to save gas](#using-unchecked-blocks-to-save-gas)\n- [Cache storage values in memory to minimize SLOADs](#cache-storage-values-in-memory-to-minimize-sloads)\n - [GrantFund.sol.fundTreasury(): treasury can be cached in memory](#grantfundsolfundtreasury-treasury-can-be-cached-in-memory)\n- [Nested if is cheaper than single statement using \\&\\&](#nested-if-is-cheaper-than-single-statement-using-)\n- [StandardFunding.sol.\\_validateSlate(): No need to cache a function parameter](#standardfundingsol_validateslate-no-need-to-cache-a-function-parameter)\n- [Declare a constant variable instead of repeatedly doing the same calculation](#declare-a-constant-variable-instead-of-repeatedly-doing-the-same-calculation)\n- [Don't cache variables that are used only once](#dont-cache-variables-that-are-used-only-once)\n- [Unnecessary assignement](#unnecessary-assignement)\n\n## FINDINGS\nNB", "vulnerable_code": "File: /ajna-core/src/RewardsManager.sol\n135: function moveStakedLiquidity(\n136: uint256 tokenId_,\n137: uint256[] memory fromBuckets_,\n138: uint256[] memory toBuckets_,\n139: uint256 expiry_\n140: ) external nonReentrant override {\n141: StakeInfo storage stakeInfo = stakes[tokenId_];\n\n143: if (msg.sender != stakeInfo.owner) revert NotOwnerOfDeposit();\n\n145: // check move array sizes match to be able to match on index\n146: uint256 fromBucketLength = fromBuckets_.length;\n147: if (fromBucketLength != toBuckets_.length) revert MoveStakedLiquidityInvalid();", "fixed_code": "https://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-core/src/RewardsManager.sol#L207-L213\n### Reorder the checks here to have the cheaper one first", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/c3phas-G.md", "collected_at": "2026-01-02T18:21:23.474205+00:00", "source_hash": "4c2cfedb01549cfb5a03b0e766c4bb0fb166a31a0ae82579fbb718868259e37e", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "RewardsManager.sol#L207-L213", "github_files_list": "RewardsManager.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: /ajna-core/src/RewardsManager.sol\n135: function moveStakedLiquidity(\n136: uint256 tokenId_,\n137: uint256[] memory fromBuckets_,\n138: uint256[] memory toBuckets_,\n139: uint256 expiry_\n140: ) external nonReentrant override {\n141: StakeInfo storage stakeInfo = stakes[tokenId_];\n\n143: if (msg.sender != stakeInfo.owner) revert NotOwnerOfDeposit();\n\n145: // check move array sizes match to be able to match on index\n146: uint256 fromBucketLength = fromBuckets_.length;\n147: if (fromBucketLength != toBuckets_.length) revert MoveStakedLiquidityInvalid();", "has_vulnerable_code_snippet": true, "fixed_code_actual": "https://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-core/src/RewardsManager.sol#L207-L213\n### Reorder the checks here to have the cheaper one first", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "09-ondo", "title": "djanerch Q", "severity_raw": "High", "severity": "high", "description": "**Summary**\n\nThe `setOracle` function in the `rUSDY.sol` contract doesn't check if the `_oracle` address is valid. This oversight can lead to problems if the contract owner mistakenly sets the address to `address(0)`.\n\n**Details:**\n\nThe `setOracle` function in the `rUSDY.sol` contract allows the contract owner to update the Oracle address. However, it doesn't verify the validity of the `_oracle` address provided as input. This could create issues within the contract, particularly if the owner accidentally sets `_oracle` to the Ethereum zero address, `address(0)`.\n\n**Suggested Fix:**\n\nTo improve the contract's security and reliability, it's advisable to include a simple check. Before updating the Oracle address, ensure that `_oracle` is not equal to `address(0)`. You can implement this fix as shown below:\n\n```solidity\nfunction setOracle(address _oracle) external onlyRole(USDY_MANAGER_ROLE) {\n require(_oracle != address(0), \"Invalid oracle address\");\n oracle = IRWADynamicOracle(_oracle); \n}\n```\n\n**Benefits of the Fix:**\n\n- Increases the security of the `rUSDY.sol` contract by verifying input data.\n- Prevents unintended issues and potential disruptions caused by mistakenly setting the Oracle address to `address(0)`.", "vulnerable_code": "function setOracle(address _oracle) external onlyRole(USDY_MANAGER_ROLE) {\n require(_oracle != address(0), \"Invalid oracle address\");\n oracle = IRWADynamicOracle(_oracle); \n}", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/djanerch-Q.md", "collected_at": "2026-01-02T18:25:54.704442+00:00", "source_hash": "4c857004b4b81481e047f5e7bc091ecbae306cf6f75f9727f0be12c148d5e053", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 180, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function setOracle(address _oracle) external onlyRole(USDY_MANAGER_ROLE) {\n require(_oracle != address(0), \"Invalid oracle address\");\n oracle = IRWADynamicOracle(_oracle); \n}", "primary_code_language": "solidity", "primary_code_char_count": 180, "all_code_blocks": "// Code block 1 (solidity):\nfunction setOracle(address _oracle) external onlyRole(USDY_MANAGER_ROLE) {\n require(_oracle != address(0), \"Invalid oracle address\");\n oracle = IRWADynamicOracle(_oracle); \n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function setOracle(address _oracle) external onlyRole(USDY_MANAGER_ROLE) {\n require(_oracle != address(0), \"Invalid oracle address\");\n oracle = IRWADynamicOracle(_oracle); \n}", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function setOracle(address _oracle) external onlyRole(USDY_MANAGER_ROLE) {\n require(_oracle != address(0), \"Invalid oracle address\");\n oracle = IRWADynamicOracle(_oracle); \n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.48} {"source": "c4", "protocol": "03-asymmetry", "title": "ernestognw Q", "severity_raw": "Low", "severity": "low", "description": "## ETH sent to the contract will be unlocked\n\nThe `SafEth.sol` contract contains a `receive() external payable` function that allows depositing into the contract directly. However, there's no sweeping mechanism for ETH in the contract and the only way to get withdraw ETH from the contract is by calling `unstake()` which only sends the difference in ETH after exchanging the derivatives.\n\nWith the current configuration, any excedent ETH on the contract will be locked.\n\n### PoC\n\nConsider the following test using Foundry:\n\n```solidity\n// @notice Test\nfunction test_alterBalance() public {\n _deploy();\n (bool success, ) = address(safEth).call{value: 1 ether}(\"\");\n require(success);\n assertEq(safEth.totalSupply(), 0);\n assertEq(address(safEth).balance, 1 ether);\n}\n\nfunction _deploy() internal {\n // Implementations of these omitted for clarity\n _deploySafETH();\n _deployDerivatives();\n _addDerivatives();\n}\n```\n\n### Recommendation\n\nWhitelist the allowed callers of the `receive()` function, so compatibility with derivatives is not broken. Also, consider calling `stake()` on every `receive()` execution for every non-whitelisted caller.\n\nOpenZeppelin's [EnumerableSet](https://docs.openzeppelin.com/contracts/4.x/api/utils#EnumerableSet) is recommended for the whitelisting mechanism.\n\n## Calling `stake()` can lock ETH up to `derivativeCount` wei\n\nWhile computing `ethAmount` inside the `stake()` function in line 87 of the `SafEth.sol` contract, there's a rounding error of 1 wei before depositing on each derivative, leaving small amounts of ETH in the contract.\n\n```solidity\nuint256 ethAmount = (msg.value * weight) / totalWeight;\n```\n\nAlthough this can be considered negligible since the minimum deposit is `0.5 ether`, it's recommended to have a mechanism of sweeping the loss funds if they become relevant enough. Otherwise, these can be carried in the same line by adding the current contract balance (although it may increase gas costs and be potentially danger", "vulnerable_code": "// @notice Test\nfunction test_alterBalance() public {\n _deploy();\n (bool success, ) = address(safEth).call{value: 1 ether}(\"\");\n require(success);\n assertEq(safEth.totalSupply(), 0);\n assertEq(address(safEth).balance, 1 ether);\n}\n\nfunction _deploy() internal {\n // Implementations of these omitted for clarity\n _deploySafETH();\n _deployDerivatives();\n _addDerivatives();\n}", "fixed_code": "uint256 ethAmount = (msg.value * weight) / totalWeight;", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/ernestognw-Q.md", "collected_at": "2026-01-02T18:19:06.140992+00:00", "source_hash": "4cae117ab13e871aa8b43a5bdc6e6ea5e0be098703a436db4f0c15e83501a48d", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 453, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "// @notice Test\nfunction test_alterBalance() public {\n _deploy();\n (bool success, ) = address(safEth).call{value: 1 ether}(\"\");\n require(success);\n assertEq(safEth.totalSupply(), 0);\n assertEq(address(safEth).balance, 1 ether);\n}\n\nfunction _deploy() internal {\n // Implementations of these omitted for clarity\n _deploySafETH();\n _deployDerivatives();\n _addDerivatives();\n}", "primary_code_language": "solidity", "primary_code_char_count": 398, "all_code_blocks": "// Code block 1 (solidity):\n// @notice Test\nfunction test_alterBalance() public {\n _deploy();\n (bool success, ) = address(safEth).call{value: 1 ether}(\"\");\n require(success);\n assertEq(safEth.totalSupply(), 0);\n assertEq(address(safEth).balance, 1 ether);\n}\n\nfunction _deploy() internal {\n // Implementations of these omitted for clarity\n _deploySafETH();\n _deployDerivatives();\n _addDerivatives();\n}\n\n// Code block 2 (solidity):\nuint256 ethAmount = (msg.value * weight) / totalWeight;", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "// @notice Test\nfunction test_alterBalance() public {\n _deploy();\n (bool success, ) = address(safEth).call{value: 1 ether}(\"\");\n require(success);\n assertEq(safEth.totalSupply(), 0);\n assertEq(address(safEth).balance, 1 ether);\n}\n\nfunction _deploy() internal {\n // Implementations of these omitted for clarity\n _deploySafETH();\n _deployDerivatives();\n _addDerivatives();\n}\n\nuint256 ethAmount = (msg.value * weight) / totalWeight;", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "// @notice Test\nfunction test_alterBalance() public {\n _deploy();\n (bool success, ) = address(safEth).call{value: 1 ether}(\"\");\n require(success);\n assertEq(safEth.totalSupply(), 0);\n assertEq(address(safEth).balance, 1 ether);\n}\n\nfunction _deploy() internal {\n // Implementations of these omitted for clarity\n _deploySafETH();\n _deployDerivatives();\n _addDerivatives();\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "uint256 ethAmount = (msg.value * weight) / totalWeight;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-asymmetry", "title": "Sabit G", "severity_raw": "Gas", "severity": "gas", "description": "Here are some gas optimization issues:\n\nRedundant ERC20 balance check in withdraw() function.\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/WstEth.sol#L56\n\n```\nfunction withdraw(uint256 _amount) external onlyOwner {\n IWStETH(WST_ETH).unwrap(_amount);\n uint256 stEthBal = IERC20(STETH_TOKEN).balanceOf(address(this)); // Redundant\n IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);\n uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n}\n```\n\nThe stEthBal variable is not used.\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/WstEth.sol#L56\n\n```\nfunction withdraw(uint256 _amount) external onlyOwner {\n IWStETH(WST_ETH).unwrap(_amount);\n uint256 minOut = (_amount * (10 ** 18 - maxSlippage)) / 10 ** 18;\n IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, _amount);\n IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, _amount, minOut);\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n}\n\n```\n\nbalanceOf() not used. \nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/WstEth.sol#L93\n\nfunction balance() public view returns (uint256) {\n return IERC20(WST_ETH).balanceOf(address(this)); // Redundant\n}\n```\nThe code assigns wstEthBalancePre and wstEthBalancePost variables the same value as the WST_ETH balance of the contract. It's not needed because the wstETH amount is equal to the value of msg.value. The variables and the subtraction are redundant.\n\nhttps://github.com/code-423n4/2023-", "vulnerable_code": "function withdraw(uint256 _amount) external onlyOwner {\n IWStETH(WST_ETH).unwrap(_amount);\n uint256 stEthBal = IERC20(STETH_TOKEN).balanceOf(address(this)); // Redundant\n IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);\n uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n}", "fixed_code": "function withdraw(uint256 _amount) external onlyOwner {\n IWStETH(WST_ETH).unwrap(_amount);\n uint256 minOut = (_amount * (10 ** 18 - maxSlippage)) / 10 ** 18;\n IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, _amount);\n IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, _amount, minOut);\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n}\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Sabit-G.md", "collected_at": "2026-01-02T18:18:31.464873+00:00", "source_hash": "4d39447627ccd4f591fbdd56e70e8a13bc754b4f14d4803f56bca3dfe7de28e5", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 1001, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function withdraw(uint256 _amount) external onlyOwner {\n IWStETH(WST_ETH).unwrap(_amount);\n uint256 stEthBal = IERC20(STETH_TOKEN).balanceOf(address(this)); // Redundant\n IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);\n uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n}", "primary_code_language": "unknown", "primary_code_char_count": 543, "all_code_blocks": "// Code block 1 (unknown):\nfunction withdraw(uint256 _amount) external onlyOwner {\n IWStETH(WST_ETH).unwrap(_amount);\n uint256 stEthBal = IERC20(STETH_TOKEN).balanceOf(address(this)); // Redundant\n IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);\n uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n}\n\n// Code block 2 (unknown):\nfunction withdraw(uint256 _amount) external onlyOwner {\n IWStETH(WST_ETH).unwrap(_amount);\n uint256 minOut = (_amount * (10 ** 18 - maxSlippage)) / 10 ** 18;\n IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, _amount);\n IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, _amount, minOut);\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "WstEth.sol#L56, WstEth.sol#L93", "github_files_list": "WstEth.sol", "github_refs_count": 2, "vulnerable_code_actual": "function withdraw(uint256 _amount) external onlyOwner {\n IWStETH(WST_ETH).unwrap(_amount);\n uint256 stEthBal = IERC20(STETH_TOKEN).balanceOf(address(this)); // Redundant\n IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);\n uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function withdraw(uint256 _amount) external onlyOwner {\n IWStETH(WST_ETH).unwrap(_amount);\n uint256 minOut = (_amount * (10 ** 18 - maxSlippage)) / 10 ** 18;\n IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, _amount);\n IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, _amount, minOut);\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n}\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "08-dopex", "title": "Rolezn G", "severity_raw": "High", "severity": "high", "description": "## GAS Summary\n\n### Gas Optimizations\n| |Issue|Contexts|Estimated Gas Saved|\n|-|:-|:-|:-:|\n| [GAS‑1](#GAS‑1) | Activate the optimizer | 1 | - |\n| [GAS‑2](#GAS‑2) | `address(this)` can be stored in `state variable` that will ultimately cost less, than every time calculating this, specifically when it used multiple times in a `contract` | 1 | - |\n| [GAS‑3](#GAS‑3) | Use assembly to emit events | 11 | 418 |\n| [GAS‑4](#GAS‑4) | Avoid emitting event on every iteration | 1 | 375 |\n| [GAS‑5](#GAS‑5) | Avoid repeating computations | 20 | - |\n| [GAS‑6](#GAS‑6) | Gas savings can be achieved by changing the model for assigning value to the structure | 7 | 910 |\n| [GAS‑7](#GAS‑7) | Combine events to save `Glogtopic (375 gas)` for each instance | 2 | 750 |\n| [GAS‑8](#GAS‑8) | Counting down in `for` statements is more gas efficient | 12 | 3084 |\n| [GAS‑9](#GAS‑9) | Hash using `assembly` instead of solidity | 2 | 160 |\n| [GAS‑10](#GAS‑10) | Using `unchecked` blocks to save gas | 3 | 120 |\n| [GAS‑11](#GAS‑11) | Add `unchecked {}` for subtractions where the operands cannot underflow | 14 | 560 |\n| [GAS‑12](#GAS‑12) | Use do while loops instead of for loops | 12 | 48 |\n| [GAS‑13](#GAS‑13) | Using XOR (^) and AND (&) bitwise equivalents | 14 | 182 |\n\nTotal: 172 contexts over 13 issues\n\n### Experimental Gas Optimizations\n\nThe following gas optimization include snapshots and the code snippet that was used. The issues may also include invalid instances that were detected to either increase gas usage or not provide any improvements.\n\n| |Issue|\n|-|:-|\n| [EXPGAS‑1](#EXPGAS‑1) | Use do while loops instead of for loops |\n| [EXPGAS‑2](#EXPGAS‑2) | `unchecked {}` can be used on the division of two `uints` in order to save gas |\n| [EXPGAS‑3](#EXPGAS‑3) |", "vulnerable_code": "module.exports = {\n\tsolidity: {\n\t\tversion: \"0.8.19\",\n\t\tsettings: {\n\t\t\toptimizer: {\n\t\t\t\tenabled: true,\n\t\t\t\truns: 1000,\n\t\t\t},\n\t\t},\n\t},\n};", "fixed_code": "for !=0 before optimization\nPUSH1 0x00\nDUP2\nEQ\nISZERO\nPUSH1 [cont offset]\nJUMPI\n\nafter optimization\nDUP1\nPUSH1 [revert offset]\nJUMPI", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/Rolezn-G.md", "collected_at": "2026-01-02T18:24:59.577070+00:00", "source_hash": "4d4163ed4ef841af7c4909f90dab45a8e2a3fc30f1843351d63a2643673ea4e8", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "module.exports = {\n\tsolidity: {\n\t\tversion: \"0.8.19\",\n\t\tsettings: {\n\t\t\toptimizer: {\n\t\t\t\tenabled: true,\n\t\t\t\truns: 1000,\n\t\t\t},\n\t\t},\n\t},\n};", "has_vulnerable_code_snippet": true, "fixed_code_actual": "for !=0 before optimization\nPUSH1 0x00\nDUP2\nEQ\nISZERO\nPUSH1 [cont offset]\nJUMPI\n\nafter optimization\nDUP1\nPUSH1 [revert offset]\nJUMPI", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "06-lybra", "title": "SAQ G", "severity_raw": "High", "severity": "high", "description": "## Summary\n\n### Gas Optimization\n\nno | Issue |Instances||\n|-|:-|:-:|:-:|\n| [G-01] | Using fixed bytes is cheaper than using string | 1 | - |\n| [G-02] | Can make the variable outside the loop to save gas | 1 | - |\n| [G-03] | Using calldata instead of memory for read-only arguments in external functions saves gas | 2 | - |\n| [G-04] | Use assembly to check for address(0) | 5 | - |\n| [G-05] | Before transfer of some functions, we should check some variables for possible gas save | 5 | - |\n| [G-06] | State variables can be packed to use fewer storage slots | 1 | - |\n| [G-07] | Use constants instead of type(uintx).max | 1 | - |\n| [G-08] | Use nested if and, avoid multiple check combinations | 3 | - |\n| [G-09] | Use\u00a0assembly\u00a0to write\u00a0address storage values | 9 | - |\n| [G-10] | Sort Solidity operations using short-circuit mode | 3 | - |\n| [G-11] | Use hardcode address instead address(this) | 8 | - |\n| [G-12] | Use assembly for math (add, sub, mul, div) | 2 | - |\n| [G-13] | Don't apply the same value to state variables | 4 | - |\n| [G-14] | Minimize external calls if possible | more files | - |\n\n\n\n\n## Gas Optimizations \n\n## [G-1] Using fixed bytes is cheaper than using string\n\n### Details\n\nAs a rule of thumb, use\u00a0bytes for arbitrary-length raw byte data and string for arbitrary-length\u00a0string\u00a0(UTF-8) data.\nIf you can limit the length to a certain number of bytes, always use one of\u00a0bytes1\u00a0to\u00a0bytes32\u00a0because they are much cheaper\n\n```solidity\nfile: /contracts/lybra/token/EUSD.sol\n\n107 function symbol() public pure returns (string memory) {\n108 return \"eUSD\";\n\n```\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/token/EUSD.sol#L107\n\n\n## [G-2] Can make the variable outside the loop to save gas\n\nConsider making the stack variables before the loop which gonna save gas \n\n```solidity\nfile: /contracts/lybra/miner/EUSDMiningIncentives.sol\n\n140 uint borrowed = pool.getBorrowedOf(user);\n\n```\nhttps://github.com/code-423n4/2023-06-lybra/blob/main", "vulnerable_code": "file: /contracts/lybra/token/EUSD.sol\n\n107 function symbol() public pure returns (string memory) {\n108 return \"eUSD\";\n", "fixed_code": "file: /contracts/lybra/miner/EUSDMiningIncentives.sol\n\n140 uint borrowed = pool.getBorrowedOf(user);\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/SAQ-G.md", "collected_at": "2026-01-02T18:22:42.189609+00:00", "source_hash": "4d4f806ae7ab0f5a4e04d8c5c4605eeaae2a69900075dd913a65854a8992d7e8", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 236, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "file: /contracts/lybra/token/EUSD.sol\n\n107 function symbol() public pure returns (string memory) {\n108 return \"eUSD\";", "primary_code_language": "solidity", "primary_code_char_count": 133, "all_code_blocks": "// Code block 1 (solidity):\nfile: /contracts/lybra/token/EUSD.sol\n\n107 function symbol() public pure returns (string memory) {\n108 return \"eUSD\";\n\n// Code block 2 (solidity):\nfile: /contracts/lybra/miner/EUSDMiningIncentives.sol\n\n140 uint borrowed = pool.getBorrowedOf(user);", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "file: /contracts/lybra/token/EUSD.sol\n\n107 function symbol() public pure returns (string memory) {\n108 return \"eUSD\";\n\nfile: /contracts/lybra/miner/EUSDMiningIncentives.sol\n\n140 uint borrowed = pool.getBorrowedOf(user);", "github_refs_formatted": "EUSD.sol#L107", "github_files_list": "EUSD.sol", "github_refs_count": 1, "vulnerable_code_actual": "file: /contracts/lybra/token/EUSD.sol\n\n107 function symbol() public pure returns (string memory) {\n108 return \"eUSD\";\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "file: /contracts/lybra/miner/EUSDMiningIncentives.sol\n\n140 uint borrowed = pool.getBorrowedOf(user);\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "05-ajna", "title": "0xnev G", "severity_raw": "High", "severity": "high", "description": "| Count | Title | Instances | Gas Savings |\n|:--:|:-------|:--:|:--:|\n| [G-01] | Usage of uints/ints smaller than 32 bytes (256 bits) incurs overhead | 1 | 16511 |\n| [G-03] | Do not need to use `+=` operator, `=` can be used instead | 1 | 62631 |\n| [G-03] | `else if` block in `Maths.wsqrt()` can be removed | 1 | 11 |\n| [G-04] | Implement `StandardFunding._setNewDistributionId()` in `StandardFunding.startNewDistributionPeriod()` directly | 1 | 3222 |\n| [G-05] | Use constant instead of immutable for `ajnaTokenAddress` in `Funding.sol` | 1 | 16919 |\n| [G-06] | ` += ` costs more gas than ` = + ` for state variables | 3 | 339 |\n| [G-07] | RMultiple accesses of a mapping/array should use a local variable cache | 5 | 210 |\n\n| Total Gas-Optimization Issues | 7 |\n|:--:|:--:|\n\n| Total Estimated Gas Savings | 99843 |\n|:--:|:--:|\n\nAll gas savings benchmark are retrieved from comparisons from unit tests\n\n### [G-01] Usage of uints/ints smaller than 32 bytes (256 bits) incurs overhead\n[PositionManager.sol#L62](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/PositionManager.sol#L62)\n```solidity\n62: uint176 private _nextId = 1;\n```\nhttps://docs.soliditylang.org/en/v0.8.11/internals/layout_in_storage.html Each operation involving a uint8 costs extra as compared to ones involving uint256, due to the compiler having to clear the higher bits of the memory word before operating on the uint8, as well as the associated stack operations of doing so. Use a larger size then downcast where needed\n\nSaves ~16255 gas on deployment and on average 256 gas for `PositionManager.mint()` function that uses the `_nextId` variable.\n\n`PositionManager.sol` Deployment Cost:\n| | Deployment Cost | \n| ------ | --- |\n| Before | 3922538 | \n| After | 3906283 | \n\n`PositionManager.mint()` gas savings:\n| | Min | Average | Median | Max |\n| ------ | --- | ------- | ----- | ----- |\n| Before ", "vulnerable_code": "62: uint176 private _nextId = 1;", "fixed_code": "rewards_ += Maths.wmul(UPDATE_CLAIM_REWARD, Maths.wmul(burnFactor, interestFactor));", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/0xnev-G.md", "collected_at": "2026-01-02T18:20:51.186863+00:00", "source_hash": "4d77711fe3188afa1036747365e463ed314d3bc7d186b32163cb779fa94a0b0a", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 35, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "62: uint176 private _nextId = 1;", "primary_code_language": "solidity", "primary_code_char_count": 35, "all_code_blocks": "// Code block 1 (solidity):\n62: uint176 private _nextId = 1;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "62: uint176 private _nextId = 1;", "github_refs_formatted": "PositionManager.sol#L62", "github_files_list": "PositionManager.sol", "github_refs_count": 1, "vulnerable_code_actual": "62: uint176 private _nextId = 1;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "rewards_ += Maths.wmul(UPDATE_CLAIM_REWARD, Maths.wmul(burnFactor, interestFactor));", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-biconomy", "title": "Fahrul G", "severity_raw": "Low", "severity": "low", "description": "# Replace `getChainId()` with `block.chainid`\nWe can get the chainId using `block.chainid` instead of using `getChainId()`.\n\n*Instances (2)*:\n```solidity\nFile: contracts/smart-contract-wallet/SmartAccount.sol\nLine 135-147\n\n function domainSeparator() public view returns (bytes32) {\n return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\n }\n\n /// @dev Returns the chain id used by this contract.\n function getChainId() public view returns (uint256) {\n uint256 id;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n id := chainid()\n }\n return id;\n }\n```\n[Link to code](https://github.com/code-423n4/2023-01-biconomy/tree/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol)\n\n```solidity\nFile: contracts/smart-contract-wallet/SmartAccountNoAuth.sol\nLine 135-147\n\n function domainSeparator() public view returns (bytes32) {\n return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\n }\n\n /// @dev Returns the chain id used by this contract.\n function getChainId() public view returns (uint256) {\n uint256 id;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n id := chainid()\n }\n return id;\n }\n\n```\n[Link to code](https://github.com/code-423n4/2023-01-biconomy/tree/main/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol)\n\nWe also could delete the `getChainId` function to reduce the deployment cost, since it will never get used.", "vulnerable_code": "File: contracts/smart-contract-wallet/SmartAccount.sol\nLine 135-147\n\n function domainSeparator() public view returns (bytes32) {\n return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\n }\n\n /// @dev Returns the chain id used by this contract.\n function getChainId() public view returns (uint256) {\n uint256 id;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n id := chainid()\n }\n return id;\n }", "fixed_code": "File: contracts/smart-contract-wallet/SmartAccountNoAuth.sol\nLine 135-147\n\n function domainSeparator() public view returns (bytes32) {\n return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\n }\n\n /// @dev Returns the chain id used by this contract.\n function getChainId() public view returns (uint256) {\n uint256 id;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n id := chainid()\n }\n return id;\n }\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/Fahrul-G.md", "collected_at": "2026-01-02T18:13:04.438303+00:00", "source_hash": "4da68d0ba301603934d7a208864f07ac8a0d209a9e070d4ecc1fd21f1d925ad7", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 998, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/smart-contract-wallet/SmartAccount.sol\nLine 135-147\n\n function domainSeparator() public view returns (bytes32) {\n return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\n }\n\n /// @dev Returns the chain id used by this contract.\n function getChainId() public view returns (uint256) {\n uint256 id;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n id := chainid()\n }\n return id;\n }", "primary_code_language": "solidity", "primary_code_char_count": 496, "all_code_blocks": "// Code block 1 (solidity):\nFile: contracts/smart-contract-wallet/SmartAccount.sol\nLine 135-147\n\n function domainSeparator() public view returns (bytes32) {\n return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\n }\n\n /// @dev Returns the chain id used by this contract.\n function getChainId() public view returns (uint256) {\n uint256 id;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n id := chainid()\n }\n return id;\n }\n\n// Code block 2 (solidity):\nFile: contracts/smart-contract-wallet/SmartAccountNoAuth.sol\nLine 135-147\n\n function domainSeparator() public view returns (bytes32) {\n return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\n }\n\n /// @dev Returns the chain id used by this contract.\n function getChainId() public view returns (uint256) {\n uint256 id;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n id := chainid()\n }\n return id;\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: contracts/smart-contract-wallet/SmartAccount.sol\nLine 135-147\n\n function domainSeparator() public view returns (bytes32) {\n return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\n }\n\n /// @dev Returns the chain id used by this contract.\n function getChainId() public view returns (uint256) {\n uint256 id;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n id := chainid()\n }\n return id;\n }\n\nFile: contracts/smart-contract-wallet/SmartAccountNoAuth.sol\nLine 135-147\n\n function domainSeparator() public view returns (bytes32) {\n return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\n }\n\n /// @dev Returns the chain id used by this contract.\n function getChainId() public view returns (uint256) {\n uint256 id;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n id := chainid()\n }\n return id;\n }", "github_refs_formatted": "SmartAccount.sol, SmartAccountNoAuth.sol", "github_files_list": "SmartAccount.sol, SmartAccountNoAuth.sol", "github_refs_count": 2, "vulnerable_code_actual": "File: contracts/smart-contract-wallet/SmartAccount.sol\nLine 135-147\n\n function domainSeparator() public view returns (bytes32) {\n return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\n }\n\n /// @dev Returns the chain id used by this contract.\n function getChainId() public view returns (uint256) {\n uint256 id;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n id := chainid()\n }\n return id;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/smart-contract-wallet/SmartAccountNoAuth.sol\nLine 135-147\n\n function domainSeparator() public view returns (bytes32) {\n return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\n }\n\n /// @dev Returns the chain id used by this contract.\n function getChainId() public view returns (uint256) {\n uint256 id;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n id := chainid()\n }\n return id;\n }\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "05-ajna", "title": "Blckhv G", "severity_raw": "Gas", "severity": "gas", "description": "# Gas report\n\n## Globally available variables such as block.number can be cached in variable when used multiple times in one function\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/StandardFunding.sol#L119-L164 \n\nWhen it's necessary to use globally available vars such as `block.number` in current scenario, consider caching it.\n\ne.g apply these modifications:\n\n`uint256 blockNumber = block.number;`\n\nand change it in all the places where used\n\n## Nested if statements can be combined into one to reduce code nesting\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-core/src/PositionManager.sol#L193-L199 \n\nWhen there is no logic between 2 or more if statements it is recommended to merge them into one with the help of conditional statements\n\ne.g \n```\nif (position.depositTime != 0) {\n // check that bucket didn't go bankrupt after prior memorialization\n if (_bucketBankruptAfterDeposit(pool, index, position.depositTime)) {\n // if bucket did go bankrupt, zero out the LP tracked by position manager\n position.lps = 0;\n }\n }\n```\nto \n```\nif (position.depositTime != 0 && _bucketBankruptAfterDeposit(pool, index, position.depositTime) {\n // if bucket did go bankrupt, zero out the LP tracked by position manager\n position.lps = 0;\n }\n```\n\n## Declare all the variables as `constants` when their value is known at the time of development and is not intended to change in the future\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/Funding.sol#L21 \nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/Funding.sol#L61 \n\nDeclaring constant for variables which value is hardcoded can result in a lot of saved gas if ", "vulnerable_code": "if (position.depositTime != 0) {\n // check that bucket didn't go bankrupt after prior memorialization\n if (_bucketBankruptAfterDeposit(pool, index, position.depositTime)) {\n // if bucket did go bankrupt, zero out the LP tracked by position manager\n position.lps = 0;\n }\n }", "fixed_code": "if (position.depositTime != 0 && _bucketBankruptAfterDeposit(pool, index, position.depositTime) {\n // if bucket did go bankrupt, zero out the LP tracked by position manager\n position.lps = 0;\n }", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/Blckhv-G.md", "collected_at": "2026-01-02T18:20:57.021680+00:00", "source_hash": "4dc87e88c8e7249fbc341a0cc3f00b3ac659618bd900da0511f89482110d494f", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 606, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "if (position.depositTime != 0) {\n // check that bucket didn't go bankrupt after prior memorialization\n if (_bucketBankruptAfterDeposit(pool, index, position.depositTime)) {\n // if bucket did go bankrupt, zero out the LP tracked by position manager\n position.lps = 0;\n }\n }", "primary_code_language": "unknown", "primary_code_char_count": 366, "all_code_blocks": "// Code block 1 (unknown):\nif (position.depositTime != 0) {\n // check that bucket didn't go bankrupt after prior memorialization\n if (_bucketBankruptAfterDeposit(pool, index, position.depositTime)) {\n // if bucket did go bankrupt, zero out the LP tracked by position manager\n position.lps = 0;\n }\n }\n\n// Code block 2 (unknown):\nif (position.depositTime != 0 && _bucketBankruptAfterDeposit(pool, index, position.depositTime) {\n // if bucket did go bankrupt, zero out the LP tracked by position manager\n position.lps = 0;\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "StandardFunding.sol#L119-L164, PositionManager.sol#L193-L199, Funding.sol#L21, Funding.sol#L61", "github_files_list": "Funding.sol, StandardFunding.sol, PositionManager.sol", "github_refs_count": 4, "vulnerable_code_actual": "if (position.depositTime != 0) {\n // check that bucket didn't go bankrupt after prior memorialization\n if (_bucketBankruptAfterDeposit(pool, index, position.depositTime)) {\n // if bucket did go bankrupt, zero out the LP tracked by position manager\n position.lps = 0;\n }\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "if (position.depositTime != 0 && _bucketBankruptAfterDeposit(pool, index, position.depositTime) {\n // if bucket did go bankrupt, zero out the LP tracked by position manager\n position.lps = 0;\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "04-caviar", "title": "martin Q", "severity_raw": "Critical", "severity": "critical", "description": "## Introduction\n\nCaviar Private Pools QA report was done by martin, with a main focus on the low severity and non-critical security aspects of the implementaion and logic of the project.\n\n## Findings Summary\n\nThe following issues were found, categorized by their severity:\n\n## Findings Summary\n\n| ID | Title | Severity |\n| ------- | ----------------------------------------------------- | ------------ |\n| [L-01] | Missing `nonReentrant` modifier | Low |\n| [L-02] | User is unable to withdraw mis-sent funds | Low |\n| [L-03] | No upper limit validation on user-supplied parameters | Low |\n| [NC-01] | Use a safe pragma statement | Non-Critical |\n| [NC-02] | Incomplete NatSpec | Non-Critical |\n| [NC-03] | Follow best practices when concatenating strings | Non-Critical |\n| [NC-04] | Typos | Non-Critical |\n\n### [L-01] Missing `nonReentrant` modifier\n\n`_safeMint` performs external function call that creates a security loophole. Specifically, the attacker can perform a reentrant call inside the onERC721Received callback. More detailed information why a reeentrancy can occur - https://blocksecteam.medium.com/when-safemint-becomes-unsafe-lessons-from-the-hypebears-security-incident-2965209bda2a.\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/Factory.sol#L71\n\n### [L-02] User is unable to withdraw mis-sent funds\n\nIf the intention is for the Ether to be used, the function should call another function, otherwise it should revert. Having no access control on the function means that someone may send Ether to the contract, and have no way to get anything back out, which is a loss of funds. There is `withdraw` function which allows only the admin to withdraw the earned protocol fees (Ether or Tokens)\n\nhttps://github.com/code-423n4/2023-04-caviar", "vulnerable_code": "File: /src/Factory.sol\n\nFile: /src/PrivatePoolMetadata.sol\n\nFile: /src/EthRouter.sol\n\nFile: /src/PrivatePool.sol\n\nFile: /src/interfaces/IStolenNftOracle.sol", "fixed_code": "251: // add the royalty fee amount to the net input aount", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/martin-Q.md", "collected_at": "2026-01-02T18:20:40.145373+00:00", "source_hash": "4df99fcf3a292aa164fa996fcd7350d0569b51c08273dc4915567e5fd4784cd3", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Factory.sol#L71", "github_files_list": "Factory.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: /src/Factory.sol\n\nFile: /src/PrivatePoolMetadata.sol\n\nFile: /src/EthRouter.sol\n\nFile: /src/PrivatePool.sol\n\nFile: /src/interfaces/IStolenNftOracle.sol", "has_vulnerable_code_snippet": true, "fixed_code_actual": "251: // add the royalty fee amount to the net input aount", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-salty", "title": "lilizhu Q", "severity_raw": "Low", "severity": "low", "description": "## [L-01] **Missing address(0) checks in** ManagedWallet contract\n\n### Impact\n\nIn the constructor of the ManagedWallet contract in the src/ManagedWallet.sol file, there is no verification of non-zero addresses for the input parameters. If the product team specifies _mainWallet or _confirmationWallet as address(0) during initialization, it will cause the entire system's mainWallet mechanism to completely fail.\n\n- If _mainWallet is mistakenly specified as address(0) during initialization, no one can propose a new main wallet and confirmation wallet, causing the mainWallet mechanism to fail.\n- If _confirmationWallet is mistakenly specified as address(0) during initialization, no one can confirm or reject the confirmation wallet, causing the mainWallet mechanism to fail.\n\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/ManagedWallet.sol#L31\n\nps: I don't agree with the reasons described \u201c**The absence of checks for the zero address ('0x0') in the code is an intentional gas-saving measure.\u201d**,because the construct function is more import than proposeWallets() function, the proposeWallets() function also has the address(0) check, so the construct function more necessary set the address(0) checker.\n\n## Tools Used\n\nvs code, forge\n\n## Recommended Mitigation Steps\n\n```solidity\n\nconstructor( address _mainWallet, address _confirmationWallet)\n\t\t{\n\t\trequire( _mainWallet != address(0), \"_mainWallet cannot be the zero address\" );\n\t\trequire( _confirmationWallet != address(0), \"_confirmationWallet cannot be the zero address\" );\n\n\t\tmainWallet = _mainWallet;\n\t\tconfirmationWallet = _confirmationWallet;\n\n // Write a value so subsequent writes take less gas\n\t\tactiveTimelock = type(uint256).max;\n }\n```", "vulnerable_code": "constructor( address _mainWallet, address _confirmationWallet)\n\t\t{\n\t\trequire( _mainWallet != address(0), \"_mainWallet cannot be the zero address\" );\n\t\trequire( _confirmationWallet != address(0), \"_confirmationWallet cannot be the zero address\" );\n\n\t\tmainWallet = _mainWallet;\n\t\tconfirmationWallet = _confirmationWallet;\n\n // Write a value so subsequent writes take less gas\n\t\tactiveTimelock = type(uint256).max;\n }", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/lilizhu-Q.md", "collected_at": "2026-01-02T19:01:51.162841+00:00", "source_hash": "4dfcc9c61d1f17058c83eb87f53432c1bbcb0712eb425077a97c9976507d64c8", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 436, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "constructor( address _mainWallet, address _confirmationWallet)\n\t\t{\n\t\trequire( _mainWallet != address(0), \"_mainWallet cannot be the zero address\" );\n\t\trequire( _confirmationWallet != address(0), \"_confirmationWallet cannot be the zero address\" );\n\n\t\tmainWallet = _mainWallet;\n\t\tconfirmationWallet = _confirmationWallet;\n\n // Write a value so subsequent writes take less gas\n\t\tactiveTimelock = type(uint256).max;\n }", "primary_code_language": "solidity", "primary_code_char_count": 436, "all_code_blocks": "// Code block 1 (solidity):\nconstructor( address _mainWallet, address _confirmationWallet)\n\t\t{\n\t\trequire( _mainWallet != address(0), \"_mainWallet cannot be the zero address\" );\n\t\trequire( _confirmationWallet != address(0), \"_confirmationWallet cannot be the zero address\" );\n\n\t\tmainWallet = _mainWallet;\n\t\tconfirmationWallet = _confirmationWallet;\n\n // Write a value so subsequent writes take less gas\n\t\tactiveTimelock = type(uint256).max;\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "constructor( address _mainWallet, address _confirmationWallet)\n\t\t{\n\t\trequire( _mainWallet != address(0), \"_mainWallet cannot be the zero address\" );\n\t\trequire( _confirmationWallet != address(0), \"_confirmationWallet cannot be the zero address\" );\n\n\t\tmainWallet = _mainWallet;\n\t\tconfirmationWallet = _confirmationWallet;\n\n // Write a value so subsequent writes take less gas\n\t\tactiveTimelock = type(uint256).max;\n }", "github_refs_formatted": "ManagedWallet.sol#L31", "github_files_list": "ManagedWallet.sol", "github_refs_count": 1, "vulnerable_code_actual": "constructor( address _mainWallet, address _confirmationWallet)\n\t\t{\n\t\trequire( _mainWallet != address(0), \"_mainWallet cannot be the zero address\" );\n\t\trequire( _confirmationWallet != address(0), \"_confirmationWallet cannot be the zero address\" );\n\n\t\tmainWallet = _mainWallet;\n\t\tconfirmationWallet = _confirmationWallet;\n\n // Write a value so subsequent writes take less gas\n\t\tactiveTimelock = type(uint256).max;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "06-lybra", "title": "0x11singh99 Q", "severity_raw": "Critical", "severity": "critical", "description": "# Non Critical \n1. Function params name in all over the protocol doesn't follow one convention, sometimes it is prepended with _ sometimes not. Which is confusing.\n2. named return is confusing\n3. In many places natspec comments not written, which is really confusing to understand the intention of function or contract.\n4. Prepend internal/private functions and variables with _ to make clear. Sometimes it is done sometimes not.\n5. Use constant variables instead of direct numeric value it not good practice. It is used all over the protocol.\n## 6. Use proper solidity style guide layout it is not followed all over the protocol\n### Order of Solidity Layout :\n### Layout contract elements in the following order:\nImport statements\nInterfaces\nLibraries\nContracts\n\n## Inside each contract, library or interface, use the following order:\n\nType declarations\nState variables\nEvents\nErrors\nModifiers\nFunctions\n\n### Functions should be grouped according to their visibility and ordered:\n\nconstructor\nreceive function (if exists)\nfallback function (if exists)\nexternal\npublic\ninternal\nprivate\n\n#### Within a grouping, place the view and pure functions last.\n\n# Low level\n## L-01 Function input not verified, which can be vulnerable and gas consuming verify to fail early\n### user can withdraw more than he staked . or unexpected underflow will occur which is not desired response\nTo get it check the balance before tranfser\n\n```solidity\nFile : contracts/lybra/miner/stakerewardV2pool.sol\n //@audit low check balance before transfer to prevent unexpected under flow\n balanceOf[msg.sender] -= _amount;\n```\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/miner/stakerewardV2pool.sol#L95\n### it is on many places in protocol check it and improve it.\n## L-02 Transfer return value not checked, if transfer fails it will not report which is a issue\n### transfer retrun not checked\n```solidity\n```\n\n", "vulnerable_code": "File : contracts/lybra/miner/stakerewardV2pool.sol\n //@audit low check balance before transfer to prevent unexpected under flow\n balanceOf[msg.sender] -= _amount;", "fixed_code": "", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/0x11singh99-Q.md", "collected_at": "2026-01-02T18:21:59.446429+00:00", "source_hash": "4e4bb47984b515c5125bda256c1558512d2c3973eab10186bd55c23ea11ab5c8", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 172, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File : contracts/lybra/miner/stakerewardV2pool.sol\n //@audit low check balance before transfer to prevent unexpected under flow\n balanceOf[msg.sender] -= _amount;", "primary_code_language": "solidity", "primary_code_char_count": 172, "all_code_blocks": "// Code block 1 (solidity):\nFile : contracts/lybra/miner/stakerewardV2pool.sol\n //@audit low check balance before transfer to prevent unexpected under flow\n balanceOf[msg.sender] -= _amount;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File : contracts/lybra/miner/stakerewardV2pool.sol\n //@audit low check balance before transfer to prevent unexpected under flow\n balanceOf[msg.sender] -= _amount;", "github_refs_formatted": "stakerewardV2pool.sol#L95", "github_files_list": "stakerewardV2pool.sol", "github_refs_count": 1, "vulnerable_code_actual": "File : contracts/lybra/miner/stakerewardV2pool.sol\n //@audit low check balance before transfer to prevent unexpected under flow\n balanceOf[msg.sender] -= _amount;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "03-asymmetry", "title": "report", "severity_raw": "Critical", "severity": "critical", "description": "---\nsponsor: \"Asymmetry Finance\"\nslug: \"2023-03-asymmetry\"\ndate: \"2023-07-28\"\ntitle: \"Asymmetry contest\"\nfindings: \"https://github.com/code-423n4/2023-03-asymmetry-findings/issues\"\ncontest: 226\n---\n\n# Overview\n\n## About C4\n\nCode4rena (C4) is an open organization consisting of security researchers, auditors, developers, and individuals with domain expertise in smart contracts.\n\nA C4 audit is an event in which community participants, referred to as Wardens, review, audit, or analyze smart contract logic in exchange for a bounty provided by sponsoring projects.\n\nDuring the audit outlined in this document, C4 conducted an analysis of the Asymmetry audit smart contract system written in Solidity. The audit took place between March 24\u2014March 30 2023.\n\nFollowing the C4 audit, 3 wardens ([0x52](https://twitter.com/IAm0x52), [adriro](https://twitter.com/adrianromero), and d3e4) reviewed the mitigations for all identified issues; the [Mitigation Review](#mitigation-review) report is appended below the audit report.\n\n## Wardens\n\n271 Wardens contributed reports to the Asymmetry audit:\n\n 1. 019EC6E2\n 2. [0Kage](https://twitter.com/0kage_eth)\n 3. 0x3b\n 4. [0x52](https://twitter.com/IAm0x52)\n 5. [0xAgro](https://twitter.com/0xAgro)\n 6. 0xGordita\n 7. 0xGusMcCrae\n 8. 0xMirce\n 9. 0xNorman\n 10. [0xRajkumar](https://twitter.com/0xRajkumar)\n 11. 0xRobocop\n 12. [0xSmartContract](https://twitter.com/0xSmartContract)\n 13. 0xTraub\n 14. 0xWagmi\n 15. 0xWaitress\n 16. [0xadrii](https://twitter.com/0xadrii)\n 17. 0xbepresent\n 18. 0xc0ffEE\n 19. [0xd1r4cde17a](https://twitter.com/0xd1r4cde17a)\n 20. 0xepley\n 21. 0xffchain\n 22. [0xfusion](https://twitter.com/sstrenev)\n 23. 0xhacksmithh\n 24. 0xkazim\n 25. 0xl51\n 26. 0xmuxyz\n 27. [0xnev](https://twitter.com/0xnevi)\n 28. [0xpanicError](https://twitter.com/0xpanicError)\n 29. 3dgeville\n 30. 4lulz\n 31. 7siech\n 32. [AkshaySrivastav](https://twitter.com/akshaysrivastv)\n 33. [Angry\\_Mustache\\_Man](https://twitter.com/AdityaK0010", "vulnerable_code": "if (totalSupply == 0)\n preDepositPrice = 10 ** 18; // initializes with a price of 1\n else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;", "fixed_code": "uint256 mintAmount = (totalStakeValueEth * 10 ** 18) / preDepositPrice;", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/report.md", "collected_at": "2026-01-02T18:19:13.802042+00:00", "source_hash": "4e764774df8407e8aaf5912b67ff33922cc9ef08537629cd89be061ac23213d0", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "if (totalSupply == 0)\n preDepositPrice = 10 ** 18; // initializes with a price of 1\n else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "uint256 mintAmount = (totalStakeValueEth * 10 ** 18) / preDepositPrice;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "04-caviar", "title": "Rolezn G", "severity_raw": "High", "severity": "high", "description": "## Summary\n\n### Gas Optimizations\n| |Issue|Contexts|Estimated Gas Saved|\n|-|:-|:-|:-:|\n| [GAS‑1](#GAS‑1) | `abi.encode()` is less efficient than `abi.encodepacked()` | 2 | 200 |\n| [GAS‑2](#GAS‑2) | Use calldata instead of memory for function parameters | 4 | 1200 |\n| [GAS‑3](#GAS‑3) | Setting the `constructor` to `payable` | 3 | 39 |\n| [GAS‑4](#GAS‑4) | Using `delete` statement can save gas | 2 | - |\n| [GAS‑5](#GAS‑5) | Functions guaranteed to revert when called by normal users can be marked `payable` | 11 | 231 |\n| [GAS‑6](#GAS‑6) | Use hardcoded address instead `address(this)` | 25 | - |\n| [GAS‑7](#GAS‑7) | Optimize names to save gas | 4 | 88 |\n| [GAS‑8](#GAS‑8) | ` += ` Costs More Gas Than ` = + ` For State Variables | 9 | - |\n| [GAS‑9](#GAS‑9) | Public Functions To External | 32 | - |\n| [GAS‑10](#GAS‑10) | Shorten the array rather than copying to a new one | 1 | - |\n| [GAS‑11](#GAS‑11) | String literals passed to `abi.encode()`/`abi.encodePacked()` should not be split by commas | 58 | 1218 |\n| [GAS‑12](#GAS‑12) | Structs can be packed into fewer storage slots | 2 | 4000 |\n| [GAS‑13](#GAS‑13) | Usage of `uints`/`ints` smaller than 32 bytes (256 bits) incurs overhead | 5 | - |\n\nTotal: 158 contexts over 13 issues\n\n## Gas Optimizations\n\n### [GAS‑1] `abi.encode()` is less efficient than `abi.encodepacked()`\n\nSee for more information: https://github.com/ConnorBlockchain/Solidity-Encode-Gas-Comparison \n\n#### Proof Of Concept\n\n\n```solidity\n177: abi.decode(abi.encode(sells[i].stolenNftProofs), (ReservoirOracle.Message[]))\n```\n\nhttps://github.com/code-423n4/2023-04-caviar/tree/main/src/EthRouter.sol#L177\n\n```solidity\n675: leafs[i] = keccak256(bytes.concat(keccak256(abi.encode(tokenIds[i], tokenWei", "vulnerable_code": "177: abi.decode(abi.encode(sells[i].stolenNftProofs), (ReservoirOracle.Message[]))", "fixed_code": "675: leafs[i] = keccak256(bytes.concat(keccak256(abi.encode(tokenIds[i], tokenWeights[i]))));", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/Rolezn-G.md", "collected_at": "2026-01-02T18:20:02.665949+00:00", "source_hash": "4e82356509c28cac75e581f1341f4d638ac4bf4399dad1e30a72271a08c9175e", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 82, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "177: abi.decode(abi.encode(sells[i].stolenNftProofs), (ReservoirOracle.Message[]))", "primary_code_language": "solidity", "primary_code_char_count": 82, "all_code_blocks": "// Code block 1 (solidity):\n177: abi.decode(abi.encode(sells[i].stolenNftProofs), (ReservoirOracle.Message[]))", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "177: abi.decode(abi.encode(sells[i].stolenNftProofs), (ReservoirOracle.Message[]))", "github_refs_formatted": "EthRouter.sol#L177", "github_files_list": "EthRouter.sol", "github_refs_count": 1, "vulnerable_code_actual": "177: abi.decode(abi.encode(sells[i].stolenNftProofs), (ReservoirOracle.Message[]))", "has_vulnerable_code_snippet": true, "fixed_code_actual": "675: leafs[i] = keccak256(bytes.concat(keccak256(abi.encode(tokenIds[i], tokenWeights[i]))));", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ai-arena", "title": "0xDetermination Q", "severity_raw": "Medium", "severity": "medium", "description": "# QA report by 0xDetermination\n\n|Issue number|Description|\n|:-|:-|\n|Low issues|\n|[L-1](#l-1)|Discrepancy between docs and code- false `initiatorBool` argument for `RankedBattle.updateBattleRecord()` should not change a fighter's points according to docs |\n|[L-2](#l-2)|Small stake amounts can't be lost to `StakeAtRisk` due to precision loss|\n|[L-3](#l-3)|`RankedBattle.claimNRN()` provides extra attack surface in case of an attacker inflating `claimableNRN` value|\n|[L-4](#l-4)|New users to the protocol joining a significant amount of time after project launch will incur huge gas fees when calling `RankedBattle.claimNRN()`|\n|[L-5](#l-5)|`FighterFarm.IncrementGeneration()` should enforce a `fighterType` of 0 or 1|\n|[L-6](#l-6)|`MergingPool.claimRewards()` can mint an NFT with out-of-range fighter weight|\n|[L-7](#l-7)|Ensure off-chain validation is performed to check player voltage and prevent the game server from being gas griefed|\n|Info issues|\n|[I-1](#i-1)|Comments for win/lose case can be put on the same line as the conditional statement for clarity|\n|[I-2](#i-2)|Consider calling `GameItems.instantiateNeuronContract()` in the constructor|\n|[I-3](#i-3)|`success` bool checks on NRN transfers are not necessary because the OZ implementation will not silently fail|\n|[I-4](#i-4)|Explicitly declare state variable visibility for code clarity|\n|[I-5](#i-5)|Ambiguous NatSpec for `MergingPool.claimRewards()`|\n|[I-6](#i-6)|Consider adding a `minId` param to `MergingPool.getFighterPoints()`|\n|[I-7](#i-7)|`Neuron.burnFrom()` is not used in the protocol and can be removed to reduce attack surface area|\n|[I-8](#i-8)|`FighterFarm.reRoll()` NatSpec should specify pseudo-randomness|\n|[I-9](#i-9)|Fighter generations can't increase past 255; `FighterFarm.incrementGeneration()` will fail with overflow|\n|[I-10](#i-10)|Consider using interfaces instead of importing contracts directly|\n|[I-11](#i-11)|`FighterFarm.sol` doesn't need to inherit `ERC721` since it already inherits `ERC721Enumerab", "vulnerable_code": " function _addResultPoints(\n ...\n if (_calculatedStakingFactor[tokenId][roundId] == false) {\n stakingFactor[tokenId] = _getStakingFactor(tokenId, stakeAtRisk);\n _calculatedStakingFactor[tokenId][roundId] = true;\n }\n\n curStakeAtRisk = (bpsLostPerLoss * (amountStaked[tokenId] + stakeAtRisk)) / 10**4; //Precision loss in stakeAtRisk calculation\n ...\n points = stakingFactor[tokenId] * eloFactor; //Points are calculated based on stakingFactor\n\n ...\n function _getStakingFactor(\n uint256 tokenId, \n uint256 stakeAtRisk\n ) \n private \n view \n returns (uint256) \n {\n uint256 stakingFactor_ = FixedPointMathLib.sqrt(\n (amountStaked[tokenId] + stakeAtRisk) / 10**18\n );\n if (stakingFactor_ == 0) { //stakingFactor is set to 1 if it was calculated as zero\n stakingFactor_ = 1;\n }\n return stakingFactor_;\n } ", "fixed_code": " if (claimableNRN > 0) {\n amountClaimed[msg.sender] += claimableNRN;\n _neuronInstance.mint(msg.sender, claimableNRN);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/0xDetermination-Q.md", "collected_at": "2026-01-02T19:02:01.985833+00:00", "source_hash": "4e892566e0f5e1d33f7fcef8aae694f0d23a5ee50abc31957e1ff6432ea20051", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function _addResultPoints(\n ...\n if (_calculatedStakingFactor[tokenId][roundId] == false) {\n stakingFactor[tokenId] = _getStakingFactor(tokenId, stakeAtRisk);\n _calculatedStakingFactor[tokenId][roundId] = true;\n }\n\n curStakeAtRisk = (bpsLostPerLoss * (amountStaked[tokenId] + stakeAtRisk)) / 10**4; //Precision loss in stakeAtRisk calculation\n ...\n points = stakingFactor[tokenId] * eloFactor; //Points are calculated based on stakingFactor\n\n ...\n function _getStakingFactor(\n uint256 tokenId, \n uint256 stakeAtRisk\n ) \n private \n view \n returns (uint256) \n {\n uint256 stakingFactor_ = FixedPointMathLib.sqrt(\n (amountStaked[tokenId] + stakeAtRisk) / 10**18\n );\n if (stakingFactor_ == 0) { //stakingFactor is set to 1 if it was calculated as zero\n stakingFactor_ = 1;\n }\n return stakingFactor_;\n } ", "has_vulnerable_code_snippet": true, "fixed_code_actual": " if (claimableNRN > 0) {\n amountClaimed[msg.sender] += claimableNRN;\n _neuronInstance.mint(msg.sender, claimableNRN);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-asymmetry", "title": "chriszhou Q", "severity_raw": "Low", "severity": "low", "description": "## Event is missing indexed fields\n\nIndex event fields make the field more quickly accessible to off-chain tools that parse events. However, note that each index field costs extra gas during emission, so it\u2019s not necessarily best to index the maximum allowed per event (three fields). Each event should use three indexed fields if there are three or more fields, and gas usage is not particularly of concern for the events in question. If there are fewer than three fields, all of the fields should be indexed.\n\nThere are 4 instances of this issue.\n```\nFile: contracts/SafEth/SafEth.sol\n26: \tevent Staked(address indexed recipient, uint ethIn, uint safEthOut);\n27: event Unstaked(address indexed recipient, uint ethOut, uint safEthIn);\n28: event WeightChange(uint indexed index, uint weight);\n29-31: event DerivativeAdded(\n address indexed contractAddress,\n uint weight,\n uint index\n );\n```\n", "vulnerable_code": "File: contracts/SafEth/SafEth.sol\n26: \tevent Staked(address indexed recipient, uint ethIn, uint safEthOut);\n27: event Unstaked(address indexed recipient, uint ethOut, uint safEthIn);\n28: event WeightChange(uint indexed index, uint weight);\n29-31: event DerivativeAdded(\n address indexed contractAddress,\n uint weight,\n uint index\n );", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/chriszhou-Q.md", "collected_at": "2026-01-02T18:18:58.932238+00:00", "source_hash": "4ec17de5c7cb63895ecd04770db1fdf0f7acbe4dc5d47a87a75a4e6dc4d22737", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 372, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "File: contracts/SafEth/SafEth.sol\n26: \tevent Staked(address indexed recipient, uint ethIn, uint safEthOut);\n27: event Unstaked(address indexed recipient, uint ethOut, uint safEthIn);\n28: event WeightChange(uint indexed index, uint weight);\n29-31: event DerivativeAdded(\n address indexed contractAddress,\n uint weight,\n uint index\n );", "primary_code_language": "unknown", "primary_code_char_count": 372, "all_code_blocks": "// Code block 1 (unknown):\nFile: contracts/SafEth/SafEth.sol\n26: \tevent Staked(address indexed recipient, uint ethIn, uint safEthOut);\n27: event Unstaked(address indexed recipient, uint ethOut, uint safEthIn);\n28: event WeightChange(uint indexed index, uint weight);\n29-31: event DerivativeAdded(\n address indexed contractAddress,\n uint weight,\n uint index\n );", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: contracts/SafEth/SafEth.sol\n26: \tevent Staked(address indexed recipient, uint ethIn, uint safEthOut);\n27: event Unstaked(address indexed recipient, uint ethOut, uint safEthIn);\n28: event WeightChange(uint indexed index, uint weight);\n29-31: event DerivativeAdded(\n address indexed contractAddress,\n uint weight,\n uint index\n );", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 3.86} {"source": "c4", "protocol": "03-asymmetry", "title": "HollaDieWaldfee Q", "severity_raw": "Critical", "severity": "critical", "description": "# Asymmetry Low Risk and Non-Critical Issues\n## Summary\n| Risk | Title | File | Instances\n| ----------- | ----------- | ----------- | ----------- |\n| L-01 | Use fixed compiler version | - | 4 |\n| L-02 | Wrong index emitted in `DerivativeAdded` event | SafEth.sol | 1 |\n| L-03 | OwnableUpgradeable: Does not implement 2-Step-Process for transferring ownership | SafEth.sol | 1 |\n| L-04 | `SafEth.stake`: check `ethAmount` for zero instead of `weight` | SafEth.sol | 1 |\n| L-05 | Fixed slippage setting is inefficient because traded amounts can vary | - | 3 |\n| L-06 | `Reth.ethPerDerivative` function should always use ETH value from Rocketpool instead of pool price | Reth.sol | 1 |\n| N-01 | Remove unnecessary imports | - | 5 | \n| N-02 | `SafEth` contract `receive` function can be dangerous for users | SafEth.sol | 1 | \n| N-03 | `SafEth`: Use `address(this).balance` instead of calculating difference | SafEth.sol | 2 | \n| N-04 | `Reth.ethPerDerivative` calculation can be simplified | Reth.sol | 1 | \n\n\n## [L-01] Use fixed compiler version\nAll in scope contracts use `^0.8.13` as compiler version. \nThey should use a fixed version, i.e. `0.8.13`, to make sure the contracts are always compiled with\nthe intended version. \n\n## [L-02] Wrong index emitted in `DerivativeAdded` event\nThe `DerivativeAdded` event is defined as this: \n[Link](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L29-L33) \n```solidity\nevent DerivativeAdded(\n address indexed contractAddress,\n uint weight,\n uint index\n);\n```\n\nSo the third parameter is the index of the new derivative in the `derivatives` mapping.\n\nThe `addDerivative` function that emits this event does it like this: \n[Link](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L182-L195) \n```solidity\nfunction addDerivative(\n address _c", "vulnerable_code": "event DerivativeAdded(\n address indexed contractAddress,\n uint weight,\n uint index\n);", "fixed_code": "function addDerivative(\n address _contractAddress,\n uint256 _weight\n) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n // @audit increment happens\n derivativeCount++;\n\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n // @audit should be derivativeCount - 1\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/HollaDieWaldfee-Q.md", "collected_at": "2026-01-02T18:18:07.436075+00:00", "source_hash": "4ec54962e77764689c2c89733ac51517a9c6034cc7641d5a8d3ce6cb2f6ea4e6", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 94, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "event DerivativeAdded(\n address indexed contractAddress,\n uint weight,\n uint index\n);", "primary_code_language": "solidity", "primary_code_char_count": 94, "all_code_blocks": "// Code block 1 (solidity):\nevent DerivativeAdded(\n address indexed contractAddress,\n uint weight,\n uint index\n);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "event DerivativeAdded(\n address indexed contractAddress,\n uint weight,\n uint index\n);", "github_refs_formatted": "SafEth.sol#L29-L33, SafEth.sol#L182-L195", "github_files_list": "SafEth.sol", "github_refs_count": 2, "vulnerable_code_actual": "event DerivativeAdded(\n address indexed contractAddress,\n uint weight,\n uint index\n);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function addDerivative(\n address _contractAddress,\n uint256 _weight\n) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n // @audit increment happens\n derivativeCount++;\n\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n // @audit should be derivativeCount - 1\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "09-ondo", "title": "NentoR G", "severity_raw": "Gas", "severity": "gas", "description": "File: contracts/bridge/DestinationBridge.sol, line 159.\n\nUnnecessary \"if\" check for the length of the \"approvers\" array.\n```\n function _approve(bytes32 txnHash) internal {\n // Check that the approver has not already approved\n TxnThreshold storage t = txnToThresholdSet[txnHash];\n if (t.approvers.length > 0) {\n for (uint256 i = 0; i < t.approvers.length; ++i) {\n if (t.approvers[i] == msg.sender) {\n revert AlreadyApproved();\n }\n }\n }\n t.approvers.push(msg.sender);\n }\n```\n\nSome gas could be saved by removing the \"if\" check, like so:\n```\n function _approve(bytes32 txnHash) internal {\n // Check that the approver has not already approved\n TxnThreshold storage t = txnToThresholdSet[txnHash];\n for (uint256 i = 0; i < t.approvers.length; ++i) {\n if (t.approvers[i] == msg.sender) {\n revert AlreadyApproved();\n }\n }\n t.approvers.push(msg.sender);\n }\n```", "vulnerable_code": " function _approve(bytes32 txnHash) internal {\n // Check that the approver has not already approved\n TxnThreshold storage t = txnToThresholdSet[txnHash];\n if (t.approvers.length > 0) {\n for (uint256 i = 0; i < t.approvers.length; ++i) {\n if (t.approvers[i] == msg.sender) {\n revert AlreadyApproved();\n }\n }\n }\n t.approvers.push(msg.sender);\n }", "fixed_code": " function _approve(bytes32 txnHash) internal {\n // Check that the approver has not already approved\n TxnThreshold storage t = txnToThresholdSet[txnHash];\n for (uint256 i = 0; i < t.approvers.length; ++i) {\n if (t.approvers[i] == msg.sender) {\n revert AlreadyApproved();\n }\n }\n t.approvers.push(msg.sender);\n }", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/NentoR-G.md", "collected_at": "2026-01-02T18:25:38.098022+00:00", "source_hash": "4ef20e2e99d175b7a197ba73d86f4da0978501d7685c25caf6bbb6d761a4d94f", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 732, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _approve(bytes32 txnHash) internal {\n // Check that the approver has not already approved\n TxnThreshold storage t = txnToThresholdSet[txnHash];\n if (t.approvers.length > 0) {\n for (uint256 i = 0; i < t.approvers.length; ++i) {\n if (t.approvers[i] == msg.sender) {\n revert AlreadyApproved();\n }\n }\n }\n t.approvers.push(msg.sender);\n }", "primary_code_language": "unknown", "primary_code_char_count": 391, "all_code_blocks": "// Code block 1 (unknown):\nfunction _approve(bytes32 txnHash) internal {\n // Check that the approver has not already approved\n TxnThreshold storage t = txnToThresholdSet[txnHash];\n if (t.approvers.length > 0) {\n for (uint256 i = 0; i < t.approvers.length; ++i) {\n if (t.approvers[i] == msg.sender) {\n revert AlreadyApproved();\n }\n }\n }\n t.approvers.push(msg.sender);\n }\n\n// Code block 2 (unknown):\nfunction _approve(bytes32 txnHash) internal {\n // Check that the approver has not already approved\n TxnThreshold storage t = txnToThresholdSet[txnHash];\n for (uint256 i = 0; i < t.approvers.length; ++i) {\n if (t.approvers[i] == msg.sender) {\n revert AlreadyApproved();\n }\n }\n t.approvers.push(msg.sender);\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function _approve(bytes32 txnHash) internal {\n // Check that the approver has not already approved\n TxnThreshold storage t = txnToThresholdSet[txnHash];\n if (t.approvers.length > 0) {\n for (uint256 i = 0; i < t.approvers.length; ++i) {\n if (t.approvers[i] == msg.sender) {\n revert AlreadyApproved();\n }\n }\n }\n t.approvers.push(msg.sender);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function _approve(bytes32 txnHash) internal {\n // Check that the approver has not already approved\n TxnThreshold storage t = txnToThresholdSet[txnHash];\n for (uint256 i = 0; i < t.approvers.length; ++i) {\n if (t.approvers[i] == msg.sender) {\n revert AlreadyApproved();\n }\n }\n t.approvers.push(msg.sender);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5.87} {"source": "c4", "protocol": "04-caviar", "title": "Bnke0x0 Q", "severity_raw": "Critical", "severity": "critical", "description": "\n\n### [L01] Missing checks for `address(0x0)` when assigning values to `address` state variables\n\n\n#### Findings:\n```\n2023-04-caviar/src/EthRouter.sol::91 => royaltyRegistry = _royaltyRegistry;\n2023-04-caviar/src/Factory.sol::130 => privatePoolMetadata = _privatePoolMetadata;\n2023-04-caviar/src/Factory.sol::136 => privatePoolImplementation = _privatePoolImplementation;\n2023-04-caviar/src/Factory.sol::142 => protocolFeeRate = _protocolFeeRate;\n2023-04-caviar/src/PrivatePool.sol::145 => royaltyRegistry = _royaltyRegistry;\n2023-04-caviar/src/PrivatePool.sol::146 => stolenNftOracle = _stolenNftOracle;\n2023-04-caviar/src/PrivatePool.sol::175 => baseToken = _baseToken;\n2023-04-caviar/src/PrivatePool.sol::176 => nft = _nft;\n2023-04-caviar/src/PrivatePool.sol::177 => virtualBaseTokenReserves = _virtualBaseTokenReserves;\n2023-04-caviar/src/PrivatePool.sol::178 => virtualNftReserves = _virtualNftReserves;\n2023-04-caviar/src/PrivatePool.sol::179 => changeFee = _changeFee;\n2023-04-caviar/src/PrivatePool.sol::180 => feeRate = _feeRate;\n2023-04-caviar/src/PrivatePool.sol::181 => merkleRoot = _merkleRoot;\n2023-04-caviar/src/PrivatePool.sol::182 => useStolenNftOracle = _useStolenNftOracle;\n2023-04-caviar/src/PrivatePool.sol::183 => payRoyalties = _payRoyalties;\n```\n\n\n### [L02] Unused `receive()` function will lock Ether in contract\n\n#### Impact\nIf the intention is for the Ether to be used, the function should call another function, otherwise, it should revert\n#### Findings:\n```\n2023-04-caviar/src/EthRouter.sol::88 => receive() external payable {}\n2023-04-caviar/src/Factory.sol::55 => receive() external payable {}\n2023-04-caviar/src/PrivatePool.sol::134 => receive() external payable {}\n```\n\n\n\n\n\n### [L03] Unspecific Compiler Version Pragma\n\n#### Impact\nFor most source-units the compiler version pragma is very unspecific `^0.8.19`. While this often makes sense for libraries to allow them to be included with multiple different versions of an application, it may be a security risk for t", "vulnerable_code": "2023-04-caviar/src/EthRouter.sol::91 => royaltyRegistry = _royaltyRegistry;\n2023-04-caviar/src/Factory.sol::130 => privatePoolMetadata = _privatePoolMetadata;\n2023-04-caviar/src/Factory.sol::136 => privatePoolImplementation = _privatePoolImplementation;\n2023-04-caviar/src/Factory.sol::142 => protocolFeeRate = _protocolFeeRate;\n2023-04-caviar/src/PrivatePool.sol::145 => royaltyRegistry = _royaltyRegistry;\n2023-04-caviar/src/PrivatePool.sol::146 => stolenNftOracle = _stolenNftOracle;\n2023-04-caviar/src/PrivatePool.sol::175 => baseToken = _baseToken;\n2023-04-caviar/src/PrivatePool.sol::176 => nft = _nft;\n2023-04-caviar/src/PrivatePool.sol::177 => virtualBaseTokenReserves = _virtualBaseTokenReserves;\n2023-04-caviar/src/PrivatePool.sol::178 => virtualNftReserves = _virtualNftReserves;\n2023-04-caviar/src/PrivatePool.sol::179 => changeFee = _changeFee;\n2023-04-caviar/src/PrivatePool.sol::180 => feeRate = _feeRate;\n2023-04-caviar/src/PrivatePool.sol::181 => merkleRoot = _merkleRoot;\n2023-04-caviar/src/PrivatePool.sol::182 => useStolenNftOracle = _useStolenNftOracle;\n2023-04-caviar/src/PrivatePool.sol::183 => payRoyalties = _payRoyalties;", "fixed_code": "2023-04-caviar/src/EthRouter.sol::88 => receive() external payable {}\n2023-04-caviar/src/Factory.sol::55 => receive() external payable {}\n2023-04-caviar/src/PrivatePool.sol::134 => receive() external payable {}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/Bnke0x0-Q.md", "collected_at": "2026-01-02T18:19:33.187622+00:00", "source_hash": "4f04b529bec88410a304c7b8718b173fa41f7c77e56ad9a1c8c0208202e51f5f", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 1357, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "2023-04-caviar/src/EthRouter.sol::91 => royaltyRegistry = _royaltyRegistry;\n2023-04-caviar/src/Factory.sol::130 => privatePoolMetadata = _privatePoolMetadata;\n2023-04-caviar/src/Factory.sol::136 => privatePoolImplementation = _privatePoolImplementation;\n2023-04-caviar/src/Factory.sol::142 => protocolFeeRate = _protocolFeeRate;\n2023-04-caviar/src/PrivatePool.sol::145 => royaltyRegistry = _royaltyRegistry;\n2023-04-caviar/src/PrivatePool.sol::146 => stolenNftOracle = _stolenNftOracle;\n2023-04-caviar/src/PrivatePool.sol::175 => baseToken = _baseToken;\n2023-04-caviar/src/PrivatePool.sol::176 => nft = _nft;\n2023-04-caviar/src/PrivatePool.sol::177 => virtualBaseTokenReserves = _virtualBaseTokenReserves;\n2023-04-caviar/src/PrivatePool.sol::178 => virtualNftReserves = _virtualNftReserves;\n2023-04-caviar/src/PrivatePool.sol::179 => changeFee = _changeFee;\n2023-04-caviar/src/PrivatePool.sol::180 => feeRate = _feeRate;\n2023-04-caviar/src/PrivatePool.sol::181 => merkleRoot = _merkleRoot;\n2023-04-caviar/src/PrivatePool.sol::182 => useStolenNftOracle = _useStolenNftOracle;\n2023-04-caviar/src/PrivatePool.sol::183 => payRoyalties = _payRoyalties;", "primary_code_language": "unknown", "primary_code_char_count": 1147, "all_code_blocks": "// Code block 1 (unknown):\n2023-04-caviar/src/EthRouter.sol::91 => royaltyRegistry = _royaltyRegistry;\n2023-04-caviar/src/Factory.sol::130 => privatePoolMetadata = _privatePoolMetadata;\n2023-04-caviar/src/Factory.sol::136 => privatePoolImplementation = _privatePoolImplementation;\n2023-04-caviar/src/Factory.sol::142 => protocolFeeRate = _protocolFeeRate;\n2023-04-caviar/src/PrivatePool.sol::145 => royaltyRegistry = _royaltyRegistry;\n2023-04-caviar/src/PrivatePool.sol::146 => stolenNftOracle = _stolenNftOracle;\n2023-04-caviar/src/PrivatePool.sol::175 => baseToken = _baseToken;\n2023-04-caviar/src/PrivatePool.sol::176 => nft = _nft;\n2023-04-caviar/src/PrivatePool.sol::177 => virtualBaseTokenReserves = _virtualBaseTokenReserves;\n2023-04-caviar/src/PrivatePool.sol::178 => virtualNftReserves = _virtualNftReserves;\n2023-04-caviar/src/PrivatePool.sol::179 => changeFee = _changeFee;\n2023-04-caviar/src/PrivatePool.sol::180 => feeRate = _feeRate;\n2023-04-caviar/src/PrivatePool.sol::181 => merkleRoot = _merkleRoot;\n2023-04-caviar/src/PrivatePool.sol::182 => useStolenNftOracle = _useStolenNftOracle;\n2023-04-caviar/src/PrivatePool.sol::183 => payRoyalties = _payRoyalties;\n\n// Code block 2 (unknown):\n2023-04-caviar/src/EthRouter.sol::88 => receive() external payable {}\n2023-04-caviar/src/Factory.sol::55 => receive() external payable {}\n2023-04-caviar/src/PrivatePool.sol::134 => receive() external payable {}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "2023-04-caviar/src/EthRouter.sol::91 => royaltyRegistry = _royaltyRegistry;\n2023-04-caviar/src/Factory.sol::130 => privatePoolMetadata = _privatePoolMetadata;\n2023-04-caviar/src/Factory.sol::136 => privatePoolImplementation = _privatePoolImplementation;\n2023-04-caviar/src/Factory.sol::142 => protocolFeeRate = _protocolFeeRate;\n2023-04-caviar/src/PrivatePool.sol::145 => royaltyRegistry = _royaltyRegistry;\n2023-04-caviar/src/PrivatePool.sol::146 => stolenNftOracle = _stolenNftOracle;\n2023-04-caviar/src/PrivatePool.sol::175 => baseToken = _baseToken;\n2023-04-caviar/src/PrivatePool.sol::176 => nft = _nft;\n2023-04-caviar/src/PrivatePool.sol::177 => virtualBaseTokenReserves = _virtualBaseTokenReserves;\n2023-04-caviar/src/PrivatePool.sol::178 => virtualNftReserves = _virtualNftReserves;\n2023-04-caviar/src/PrivatePool.sol::179 => changeFee = _changeFee;\n2023-04-caviar/src/PrivatePool.sol::180 => feeRate = _feeRate;\n2023-04-caviar/src/PrivatePool.sol::181 => merkleRoot = _merkleRoot;\n2023-04-caviar/src/PrivatePool.sol::182 => useStolenNftOracle = _useStolenNftOracle;\n2023-04-caviar/src/PrivatePool.sol::183 => payRoyalties = _payRoyalties;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "2023-04-caviar/src/EthRouter.sol::88 => receive() external payable {}\n2023-04-caviar/src/Factory.sol::55 => receive() external payable {}\n2023-04-caviar/src/PrivatePool.sol::134 => receive() external payable {}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-salty", "title": "0xSmartContract Analysis", "severity_raw": "Critical", "severity": "critical", "description": "# \ud83d\udee0\ufe0f Analysis - Salty.IO Audit\n### Summary\n| List |Head |Details|\n|:--|:----------------|:------|\n|a) |The approach I followed when reviewing the code | Stages in my code review and analysis |\n|b) |Analysis of the code base | What is unique? How are the existing patterns used? \"Solidity-metrics\" was used |\n|c) |Test analysis | Test scope of the project and quality of tests |\n|d) |Security Approach of the Project | Audit approach of the Project |\n|e) |Other Audit Reports and Automated Findings | What are the previous Audit reports and their analysis |\n|f) |Packages and Dependencies Analysis | Details about the project Packages |\n|g) |Other recommendations | What is unique? How are the existing patterns used? |\n|h) |Gas Optimizations | Gas usage approach of the project and alternative solutions |\n\n\n## a) The approach I followed when reviewing the code\n\nFirst, by examining the scope of the code, I determined my code review and analysis strategy.\nhttps://github.com/code-423n4/2024-01-salty\n\nAccordingly, I analyzed and audited the subject in the following steps;\n\n| Number |Stage |Details|Information|\n|:--|:----------------|:------|:------|\n|1|Compile and Run Test|[Installation](https://github.com/code-423n4/2024-01-salty?tab=readme-ov-file#build--test-instructions)|Test and installation structure is simple, cleanly designed|\n|2|Architecture Review| [SaltyIO](https://tech.salty.io/) |Provides a basic architectural teaching for General Architecture|\n|3|Graphical Analysis |Graphical Analysis with [Solidity-metrics](https://github.com/ConsenSys/solidity-metrics)|A visual view has been made to dominate the general structure of the codes of the project.|\n|4|Slither Analysis | [Slither Report](https://github.com/crytic/slither)| The project does not currently have a slither result, a slither control was created from initial|\n|5|Test Suits|[Tests](https://github.com/code-423n4/2024-01-salty?tab=readme-ov-file#build--test-instructions)|In this section, the scope and content of", "vulnerable_code": "## h) Gas Optimization\nThe project is generally efficient in terms of gas optimizations, many generally accepted gas optimizations have been implemented, gas optimizations with minor effects are already mentioned in automatic finding, but gas optimizations will not be a priority considering code readability and code base size\n\n\nWhen the project is analyzed in terms of Gas Optimization, there is a very important gas optimization; \"Using Mapping instead of Openzeppelin's EnumerableSet library provides high gas optimization\"\n", "fixed_code": "", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/0xSmartContract-Analysis.md", "collected_at": "2026-01-02T19:01:06.085055+00:00", "source_hash": "4f42054a2a9bd3a4a8a79af755bb432e4796a89ee7a85798401bc67d37df1c56", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "## h) Gas Optimization\nThe project is generally efficient in terms of gas optimizations, many generally accepted gas optimizations have been implemented, gas optimizations with minor effects are already mentioned in automatic finding, but gas optimizations will not be a priority considering code readability and code base size\n\n\nWhen the project is analyzed in terms of Gas Optimization, there is a very important gas optimization; \"Using Mapping instead of Openzeppelin's EnumerableSet library provides high gas optimization\"\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4} {"source": "c4", "protocol": "09-ondo", "title": "jnrlouis Q", "severity_raw": "Low", "severity": "low", "description": "## Low Risk Issues\n\n### [L-01] Wrong Parameter emitted in the `wrap` function\n\nIn the `wrap` function from `rUSDY.sol`, the `_USDYAmount` is a parameter for the function, and the `_USDYAmount` parameter is converted to shares by multiplying the amount by the `BPS_DENOMINATOR`. The issue is from the parameters of the event emitted:\n\n```javascript\nFile: usdy/rUSDY.sol\n\n438 emit Transfer(address(0), msg.sender, getRUSDYByShares(_USDYAmount));\n439 emit TransferShares(address(0), msg.sender, _USDYAmount);\n```\n\nThe `Transfer` event uses `getRUSDYByShares(_USDYAmount)`. The function `getRUSDYByShares` takes in the amount in shares and converts it to the equivalent balance of `rUSDY` tokens.\n\nThe issue is that `_USDYAmount` is NOT the shares amount and would produce an inaccurate equivalent balance, instead, it should be `getRUSDYByShares(_USDYAmount * BPS_DENOMINATOR)`. Similarly, the `TransferShares` event emits `_USDYAmount` as the shares, which also should be `emit TransferShares(address(0), msg.sender, _USDYAmount * BPS_DENOMINATOR)`.\n\n```javascript\nFile: usdy/rUSDY.sol\n\n436 _mintShares(msg.sender, _USDYAmount * BPS_DENOMINATOR);\n437 usdy.transferFrom(msg.sender, address(this), _USDYAmount);\n```\nThe `_mintShares` and `transferFrom` uses the correct parameters.\n\nIf the results of the events emitted are used, this can lead to unintended behaviors.\n\n", "vulnerable_code": "File: usdy/rUSDY.sol\n\n438 emit Transfer(address(0), msg.sender, getRUSDYByShares(_USDYAmount));\n439 emit TransferShares(address(0), msg.sender, _USDYAmount);", "fixed_code": "File: usdy/rUSDY.sol\n\n436 _mintShares(msg.sender, _USDYAmount * BPS_DENOMINATOR);\n437 usdy.transferFrom(msg.sender, address(this), _USDYAmount);", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/jnrlouis-Q.md", "collected_at": "2026-01-02T18:26:00.984840+00:00", "source_hash": "4f80ba34c5e15afa7d501d4d0c320dee97cc115e3bb7d846736d4b7fa28050fb", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 313, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: usdy/rUSDY.sol\n\n438 emit Transfer(address(0), msg.sender, getRUSDYByShares(_USDYAmount));\n439 emit TransferShares(address(0), msg.sender, _USDYAmount);", "primary_code_language": "javascript", "primary_code_char_count": 163, "all_code_blocks": "// Code block 1 (javascript):\nFile: usdy/rUSDY.sol\n\n438 emit Transfer(address(0), msg.sender, getRUSDYByShares(_USDYAmount));\n439 emit TransferShares(address(0), msg.sender, _USDYAmount);\n\n// Code block 2 (javascript):\nFile: usdy/rUSDY.sol\n\n436 _mintShares(msg.sender, _USDYAmount * BPS_DENOMINATOR);\n437 usdy.transferFrom(msg.sender, address(this), _USDYAmount);", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: usdy/rUSDY.sol\n\n438 emit Transfer(address(0), msg.sender, getRUSDYByShares(_USDYAmount));\n439 emit TransferShares(address(0), msg.sender, _USDYAmount);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: usdy/rUSDY.sol\n\n436 _mintShares(msg.sender, _USDYAmount * BPS_DENOMINATOR);\n437 usdy.transferFrom(msg.sender, address(this), _USDYAmount);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6.76} {"source": "c4", "protocol": "11-kelp", "title": "fr33rh Q", "severity_raw": "High", "severity": "high", "description": "## The function `burn` in `src/interfaces/IRSETH.sol` not implement\nIn `src/interfaces/IRSETH.sol`\n```\nfunction burn(address account, uint256 amount) external;\n```\nwhile in `src/RSETH.sol`,there is only a similar function named `burnFrom`\n```\n function burnFrom(address account, uint256 amount) external onlyRole(BURNER_ROLE) whenNotPaused {\n _burn(account, amount);\n }\n```", "vulnerable_code": "function burn(address account, uint256 amount) external;", "fixed_code": " function burnFrom(address account, uint256 amount) external onlyRole(BURNER_ROLE) whenNotPaused {\n _burn(account, amount);\n }", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/fr33rh-Q.md", "collected_at": "2026-01-02T18:28:03.217326+00:00", "source_hash": "4fa857d86c934c04b28c67987b9e61750e640a27d010ddc80ef71e668380f8ba", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 191, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function burn(address account, uint256 amount) external;", "primary_code_language": "unknown", "primary_code_char_count": 56, "all_code_blocks": "// Code block 1 (unknown):\nfunction burn(address account, uint256 amount) external;\n\n// Code block 2 (unknown):\nfunction burnFrom(address account, uint256 amount) external onlyRole(BURNER_ROLE) whenNotPaused {\n _burn(account, amount);\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function burn(address account, uint256 amount) external;", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function burnFrom(address account, uint256 amount) external onlyRole(BURNER_ROLE) whenNotPaused {\n _burn(account, amount);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 4.77} {"source": "c4", "protocol": "10-badger", "title": "dharma09 G", "severity_raw": "High", "severity": "high", "description": "## Summary\n\nThe findings from the bot should be reviewed as they contain some solid issues The following findings were missed by the bot(in some cases,bot has identified some instances but missed others, I try to explain whenever this happens)\n\nGas estimates are done using the opcodes involved since most of this functions were not covered by tests\n\n\n## Gas Optimizations\n\n\n| |Issue|Instances||\n|-|:-|:-:|:-:|\n|[GAS-01](#GAS-01)|Use uint256(1)/uint256(2) instead for true and false boolean states|4|\n|[GAS-02](#GAS-02)|Structs can be packed into fewer storage slots|1|\n|[GAS-03](#GAS-03)|State variables only set in the constructor should be declared\u00a0immutable|3|\n|[GAS-04](#GAS-04)|Cache state variables with stack variables|2|\n|[GAS-05](#GAS-05)|Use assembly for back to back external call|3|\n|[GAS-06](#GAS-06)|mark constant for enum variable|1|\n|[GAS-07](#GAS-07)|Do not emit block.timestamp in event|1|\n|[GAS-08](#GAS-08)|if function check Use only once then its better to use inline |2|\n|[GAS-09](#GAS-09)|Move the declaration of user outside the loop to reduce SLOAD (storage load) operations, as storage reads can be expensive in terms of gas.|1|\n|[GAS-10](#GAS-10)|Consider activating\u00a0via-ir\u00a0for deploying||\n| [GAS-11](#GAS-11) | Reduce gas usage by moving to Solidity 0.8.19 or later | 39 |\n| [GAS-12](#GAS-12) | `abi.encode` is more efficient than `abi.encodePacked` | 3 |\n| [GAS-13](#GAS-3) | Use assembly to check for `address(0)` | 29 |\n| [GAS-14](#GAS-4) | With assembly, .call (bool success) transfer can be done gas-optimized | 5 |\n| [GAS-15](#GAS-5) | Use assembly to emit events | 88 |\n| [GAS-16](#GAS-6) | `array[index] += amount` is cheaper than `array[index] = array[index] + amount` (or related variants) | 2 |\n| [GAS-17](#GAS-7) | Redundant event fields can be removed | 3 |\n| [GAS-18](#GAS-9) | .length should not be looked up in every loop of a for-loop | 5 |\n| [GAS-19](#GAS-10) | State variables should be cached in stack variables rather than re-reading them fro", "vulnerable_code": "File: packages/contracts/contracts/CdpManagerStorage.sol\n\n143: bool public redemptionsPaused;\n", "fixed_code": "File: packages/contracts/contracts/Dependencies/AuthNoOwner.sol\n\n14: bool private _authorityInitialized;\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/dharma09-G.md", "collected_at": "2026-01-02T18:26:47.412729+00:00", "source_hash": "4fb5147230648dde39ad1d34ab04d534c07a8f6451c9650d72dacfefefafeac1", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: packages/contracts/contracts/CdpManagerStorage.sol\n\n143: bool public redemptionsPaused;\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: packages/contracts/contracts/Dependencies/AuthNoOwner.sol\n\n14: bool private _authorityInitialized;\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-biconomy", "title": "Praise Q", "severity_raw": "Gas", "severity": "gas", "description": "## in function deployWallet() in SmartAccountFactory.sol Lc 53, there are no zero-address checks for this parameters. address _owner, address _entryPoint, address _handler, invalid wallet addresses can be inputed and deployed.\n```\n\n function deployWallet(address _owner, address _entryPoint, address _handler) public returns(address proxy){ \n bytes memory deploymentData = abi.encodePacked(type(Proxy).creationCode, uint(uint160(_defaultImpl)));\n // solhint-disable-next-line no-inline-assembly\n assembly {\n proxy := create(0x0, add(0x20, deploymentData), mload(deploymentData))\n }\n BaseSmartAccount(proxy).init(_owner, _entryPoint, _handler);\n isAccountExist[proxy] = true;\n }\n```\n## Also, \niIn BasePayMaster.sol, Lc 67 the public function withdrawTo() has no Zero-address check. funds can be withdrawn to an invalid address.\n\n```\n function withdrawTo(address payable withdrawAddress, uint256 amount) public virtual onlyOwner {\n entryPoint.withdrawTo(withdrawAddress, amount);\n }\n```\n\n## In Lc 9, The external function withdrawStake() has no zero- Address check also.\n\n```\n function withdrawStake(address payable withdrawAddress) external onlyOwner {\n entryPoint.withdrawStake(withdrawAddress);\n}\n```\n## In Executor.sol, Lc 14, the internal function execute() has no zero-address check for \"address to\" parameter \n\n```\n function execute(\n address to,\n uint256 value,\n bytes memory data,\n Enum.Operation operation,\n uint256 txGas\n ) internal returns (bool success) {\n if (operation == Enum.Operation.DelegateCall) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := delegatecall(txGas, to, add(data, 0x20), mload(data), 0, 0)\n }\n } else {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := call(txGas, to, value, add(data, 0x20), mloa", "vulnerable_code": " function deployWallet(address _owner, address _entryPoint, address _handler) public returns(address proxy){ \n bytes memory deploymentData = abi.encodePacked(type(Proxy).creationCode, uint(uint160(_defaultImpl)));\n // solhint-disable-next-line no-inline-assembly\n assembly {\n proxy := create(0x0, add(0x20, deploymentData), mload(deploymentData))\n }\n BaseSmartAccount(proxy).init(_owner, _entryPoint, _handler);\n isAccountExist[proxy] = true;\n }", "fixed_code": " function withdrawTo(address payable withdrawAddress, uint256 amount) public virtual onlyOwner {\n entryPoint.withdrawTo(withdrawAddress, amount);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/Praise-Q.md", "collected_at": "2026-01-02T18:13:13.432028+00:00", "source_hash": "4fce53b168910c3cbe33d1b31f37d96e8ed535e2764e29e0bbbf4df46b216dfa", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 786, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function deployWallet(address _owner, address _entryPoint, address _handler) public returns(address proxy){ \n bytes memory deploymentData = abi.encodePacked(type(Proxy).creationCode, uint(uint160(_defaultImpl)));\n // solhint-disable-next-line no-inline-assembly\n assembly {\n proxy := create(0x0, add(0x20, deploymentData), mload(deploymentData))\n }\n BaseSmartAccount(proxy).init(_owner, _entryPoint, _handler);\n isAccountExist[proxy] = true;\n }", "primary_code_language": "unknown", "primary_code_char_count": 500, "all_code_blocks": "// Code block 1 (unknown):\nfunction deployWallet(address _owner, address _entryPoint, address _handler) public returns(address proxy){ \n bytes memory deploymentData = abi.encodePacked(type(Proxy).creationCode, uint(uint160(_defaultImpl)));\n // solhint-disable-next-line no-inline-assembly\n assembly {\n proxy := create(0x0, add(0x20, deploymentData), mload(deploymentData))\n }\n BaseSmartAccount(proxy).init(_owner, _entryPoint, _handler);\n isAccountExist[proxy] = true;\n }\n\n// Code block 2 (unknown):\nfunction withdrawTo(address payable withdrawAddress, uint256 amount) public virtual onlyOwner {\n entryPoint.withdrawTo(withdrawAddress, amount);\n }\n\n// Code block 3 (unknown):\nfunction withdrawStake(address payable withdrawAddress) external onlyOwner {\n entryPoint.withdrawStake(withdrawAddress);\n}", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function deployWallet(address _owner, address _entryPoint, address _handler) public returns(address proxy){ \n bytes memory deploymentData = abi.encodePacked(type(Proxy).creationCode, uint(uint160(_defaultImpl)));\n // solhint-disable-next-line no-inline-assembly\n assembly {\n proxy := create(0x0, add(0x20, deploymentData), mload(deploymentData))\n }\n BaseSmartAccount(proxy).init(_owner, _entryPoint, _handler);\n isAccountExist[proxy] = true;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function withdrawTo(address payable withdrawAddress, uint256 amount) public virtual onlyOwner {\n entryPoint.withdrawTo(withdrawAddress, amount);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-ondo", "title": "0x1f8b G", "severity_raw": "High", "severity": "high", "description": "- [Gas](#gas)\n - [**1. Optimize sanction List**](#1-optimize-sanction-list)\n - [**2. Remove return**](#2-remove-return)\n - [**3. Use a recent solidity version**](#3-use-a-recent-solidity-version)\n - [**4. Use require instead of assert**](#4-use-require-instead-of-assert)\n - [**5. Avoid compound assignment operator in state variables**](#5-avoid-compound-assignment-operator-in-state-variables)\n - [Total gas saved: **13 * 8 = 104**](#total-gas-saved-13--8--104)\n - [**6. delete optimization**](#6-delete-optimization)\n - [Total gas saved: **5 * 4 = 20**](#total-gas-saved-5--4--20)\n - [**7. Remove natspec complaints**](#7-remove-natspec-complaints)\n - [**8. Optimize CErc20.initialize and CCash.initialize**](#8-optimize-cerc20initialize-and-ccashinitialize)\n - [**9. Remove SafeMath from JumpRateModelV2**](#9-remove-safemath-from-jumpratemodelv2)\n\n# Gas\n\n## **1. Optimize sanction List**\n\nIf the `ISanctionsList` interface had an `isSanctionedAny` method, you could check multiple addresses at once without jumping into the contract multiple times.\n\n```js\n require(!sanctionsList.isSanctioned(spender), \"Spender is sanctioned\");\n require(!sanctionsList.isSanctioned(src), \"Source is sanctioned\");\n require(!sanctionsList.isSanctioned(dst), \"Destination is sanctioned\");\n```\n\n**Affected source code:**\n\n- [CTokenModified.sol:97-99](https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/lending/tokens/cToken/CTokenModified.sol#L97-L99)\n\n## **2. Remove return**\n\nIt always returns `NO_ERROR`, it is better not to return or check the value.\n\n**Affected source code:**\n\n- [CTokenModified.sol:143](https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/lending/tokens/cToken/CTokenModified.sol#L143)\n- [CTokenModified.sol:401](https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/lending/tokens/cToken/CTokenModifie", "vulnerable_code": " require(!sanctionsList.isSanctioned(spender), \"Spender is sanctioned\");\n require(!sanctionsList.isSanctioned(src), \"Source is sanctioned\");\n require(!sanctionsList.isSanctioned(dst), \"Destination is sanctioned\");", "fixed_code": "pragma solidity 0.8.15;\n\ncontract TesterA {\nuint256 private _a;\nfunction testShort() public {\n_a += 1;\n}\n}\n\ncontract TesterB {\nUint256 private _a;\nfunction testLong() public {\n_a = _a + 1;\n}\n}", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/0x1f8b-G.md", "collected_at": "2026-01-02T18:14:18.885796+00:00", "source_hash": "506d4fd82a22a6a9e4d7a93efd6f683d422b81fbfc4f9411a5887355cf21e779", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 218, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "require(!sanctionsList.isSanctioned(spender), \"Spender is sanctioned\");\n require(!sanctionsList.isSanctioned(src), \"Source is sanctioned\");\n require(!sanctionsList.isSanctioned(dst), \"Destination is sanctioned\");", "primary_code_language": "js", "primary_code_char_count": 218, "all_code_blocks": "// Code block 1 (js):\nrequire(!sanctionsList.isSanctioned(spender), \"Spender is sanctioned\");\n require(!sanctionsList.isSanctioned(src), \"Source is sanctioned\");\n require(!sanctionsList.isSanctioned(dst), \"Destination is sanctioned\");", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CTokenModified.sol#L97-L99, CTokenModified.sol#L143", "github_files_list": "CTokenModified.sol", "github_refs_count": 2, "vulnerable_code_actual": " require(!sanctionsList.isSanctioned(spender), \"Spender is sanctioned\");\n require(!sanctionsList.isSanctioned(src), \"Source is sanctioned\");\n require(!sanctionsList.isSanctioned(dst), \"Destination is sanctioned\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": "pragma solidity 0.8.15;\n\ncontract TesterA {\nuint256 private _a;\nfunction testShort() public {\n_a += 1;\n}\n}\n\ncontract TesterB {\nUint256 private _a;\nfunction testLong() public {\n_a = _a + 1;\n}\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ethos", "title": "Phantasmagoria Q", "severity_raw": "Critical", "severity": "critical", "description": "# Low Risk Issues\n| | Issue | Instances |\n| :--- | :---- | :----: |\n| 1 | Deprecated safeApprove() function | 1 |\n| 2 | _safeMint() should be used rather than _mint() wherever possible | 2 |\n\nTotal: 3 instances\n\n# Non-Critical Issues\n| | Issue | Instances |\n| :--- | :---- | :----: |\n| 1 | Imports can be grouped together | 3 |\n| 2 | Constant redefined elsewhere | 2 |\n| 3 | Named imports can be used | 3 |\n| 4 | Remove console.log import | 5 |\n| 5 | Interchangeable usage of uint and uint256 | 3 |\n| 6 | Add a limit for the maximum number of characters per line | 1 |\n| 7 | Can be rewritten in many lines | 2 |\n| 8 | NatSpec comments should be increased in contracts | 2 |\n| 9 | Commented code | 1 |\n| 10 | Unused events | 2 |\n| 11 | Proper use of _ as a function name prefix | 1 |\n| 12 | Use named returns for local variables where it is possible | 22 |\n| 13 | No need to use return | 4 |\n| 14 | Code is not properly formatted | 5 |\n| 15 | Use _ with big numbers | 1 |\n\nTotal: 57 instances\n\n### [L-01] Deprecated safeApprove() function\nDeprecated in favor of safeIncreaseAllowance() and safeDecreaseAllowance(). If only setting the initial allowance to the value that means infinite, safeIncreaseAllowance() can be used instead\n```\nEthos-Vault/contracts/abstract/ReaperBaseStrategyv4.sol\n\n74: IERC20Upgradeable(want).safeApprove(vault, type(uint256).max);\n```\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/abstract/ReaperBaseStrategyv4.sol#L74\n\n### [L-02] _safeMint() should be used rather than _mint() wherever possible\n_mint() is [discouraged](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/d4d8d2ed9798cc3383912a23b5e8d5cb602f7d4b/contracts/token/ERC721/ERC721.sol#L271) ", "vulnerable_code": "Ethos-Vault/contracts/abstract/ReaperBaseStrategyv4.sol\n\n74: IERC20Upgradeable(want).safeApprove(vault, type(uint256).max);", "fixed_code": "Ethos-Vault/contracts/ReaperVaultV2.sol\n\n336: _mint(_receiver, shares);", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/Phantasmagoria-Q.md", "collected_at": "2026-01-02T18:16:27.915289+00:00", "source_hash": "506df4314ad615323ea563f90432bca8d4524a0fb80d12415cde83d5e60d4aa0", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 123, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "Ethos-Vault/contracts/abstract/ReaperBaseStrategyv4.sol\n\n74: IERC20Upgradeable(want).safeApprove(vault, type(uint256).max);", "primary_code_language": "unknown", "primary_code_char_count": 123, "all_code_blocks": "// Code block 1 (unknown):\nEthos-Vault/contracts/abstract/ReaperBaseStrategyv4.sol\n\n74: IERC20Upgradeable(want).safeApprove(vault, type(uint256).max);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ReaperBaseStrategyv4.sol#L74, ERC721.sol#L271", "github_files_list": "ERC721.sol, ReaperBaseStrategyv4.sol", "github_refs_count": 2, "vulnerable_code_actual": "Ethos-Vault/contracts/abstract/ReaperBaseStrategyv4.sol\n\n74: IERC20Upgradeable(want).safeApprove(vault, type(uint256).max);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "Ethos-Vault/contracts/ReaperVaultV2.sol\n\n336: _mint(_receiver, shares);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "07-amphora", "title": "petrichor G", "severity_raw": "Medium", "severity": "medium", "description": "| No | Issue | Instance |\n|------|---------|----------| \n|[G-01]|Can Make The Variable Outside The Loop To Save Gas |12|\n|[G-02]|Expressions for constant values such as a call to\u00a0keccak256(), should use immutable rather than constant|5|\n|[G-03]|internal functions not called by the contract should be removed to save deployment gas|3|\n|[G-04]|Use nested if statements instead of &&|7|\n|[G-05]|Make 3 event parameters indexed when possible|31|\n|[G-06]|Do not calculate constants|8|\n|[G-07]|Use\u00a0!= 0\u00a0instead of\u00a0> 0\u00a0for unsigned integer comparison|8|\n|[G-08]|Use hardcode address instead address(this)|8|\n|[G-09]|Using XOR (^) and OR (pipe line) bitwise equivalents|7|\n|[G-10]|Shuold use arguments instead of state varible |16|\n|[G-11]|keccak256() should only need to be called on a specific string literal once|4|\n|[G-12]|Not using the named return variables when a function returns, wastes deployment gas|6|\n|[G-13]|public\u00a0functions to external|9|\n|[G-14]|Amounts should be checked for\u00a00\u00a0before calling a transfer|7|\n|[G-15]|Duplicated require()/if() checks should be refactored to a modifier or function|5|\n|[G-16]|Use assembly to write address storage values|10|\n\n\n## [G-01] Can Make The Variable Outside The Loop To Save Gas \n\ncreating a variable outside a loop can help save gas in Ethereum smart contracts if the variable is used multiple times inside the loop. This is because creating a new variable inside the loop for each iteration would incur additional gas costs due to the cost of initializing a new variable every time.\n\n```solidity\n177 uint256 _crvReward = _rewardsContract.earned(address(this));\n\n187 uint256 _extraRewards = _rewardsContract.extraRewardsLength();\n\n209 (uint256 _takenCVX, uint256 _takenCRV, uint256 _claimableAmph) =\n _amphClaimer.claimable(address(this), this.id(), _totalCvxReward, _totalCrvReward);\n\n257 uint256 _earnedReward = _virtualReward.earned(address(this)); \n```\nhttps://github.com/code-423n4/2023-07-amphora/blob/41cf810b02", "vulnerable_code": "177 uint256 _crvReward = _rewardsContract.earned(address(this));\n\n187 uint256 _extraRewards = _rewardsContract.extraRewardsLength();\n\n209 (uint256 _takenCVX, uint256 _takenCRV, uint256 _claimableAmph) =\n _amphClaimer.claimable(address(this), this.id(), _totalCvxReward, _totalCrvReward);\n\n257 uint256 _earnedReward = _virtualReward.earned(address(this)); ", "fixed_code": "874 address _tokenAddress = enabledTokens[_i];\n\n876 uint256 _balance = _vault.balances(_tokenAddress);\n\n879 uint192 _rawPrice = _safeu192(_collateral.oracle.currentValue());\n\n882 uint192 _tokenValue = _safeu192(\n\n902 address _tokenAddress = enabledTokens[_i];\n\n904 uint256 _balance = _vault.balances(_tokenAddress); \n\n907 uint192 _rawPrice = _safeu192(_collateral.oracle.peekValue());\n\n910 uint192 _tokenValue = _safeu192(\n\n996 uint256[] memory _tokenBalances = new uint256[](enabledTokens.length); ", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/petrichor-G.md", "collected_at": "2026-01-02T18:23:58.633578+00:00", "source_hash": "50844a67e13b1e09cb6cdc3f2d34d26ce6cf6647a32df75abe66b3947862f945", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 371, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "177 uint256 _crvReward = _rewardsContract.earned(address(this));\n\n187 uint256 _extraRewards = _rewardsContract.extraRewardsLength();\n\n209 (uint256 _takenCVX, uint256 _takenCRV, uint256 _claimableAmph) =\n _amphClaimer.claimable(address(this), this.id(), _totalCvxReward, _totalCrvReward);\n\n257 uint256 _earnedReward = _virtualReward.earned(address(this));", "primary_code_language": "solidity", "primary_code_char_count": 371, "all_code_blocks": "// Code block 1 (solidity):\n177 uint256 _crvReward = _rewardsContract.earned(address(this));\n\n187 uint256 _extraRewards = _rewardsContract.extraRewardsLength();\n\n209 (uint256 _takenCVX, uint256 _takenCRV, uint256 _claimableAmph) =\n _amphClaimer.claimable(address(this), this.id(), _totalCvxReward, _totalCrvReward);\n\n257 uint256 _earnedReward = _virtualReward.earned(address(this));", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "177 uint256 _crvReward = _rewardsContract.earned(address(this));\n\n187 uint256 _extraRewards = _rewardsContract.extraRewardsLength();\n\n209 (uint256 _takenCVX, uint256 _takenCRV, uint256 _claimableAmph) =\n _amphClaimer.claimable(address(this), this.id(), _totalCvxReward, _totalCrvReward);\n\n257 uint256 _earnedReward = _virtualReward.earned(address(this));", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "177 uint256 _crvReward = _rewardsContract.earned(address(this));\n\n187 uint256 _extraRewards = _rewardsContract.extraRewardsLength();\n\n209 (uint256 _takenCVX, uint256 _takenCRV, uint256 _claimableAmph) =\n _amphClaimer.claimable(address(this), this.id(), _totalCvxReward, _totalCrvReward);\n\n257 uint256 _earnedReward = _virtualReward.earned(address(this)); ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "874 address _tokenAddress = enabledTokens[_i];\n\n876 uint256 _balance = _vault.balances(_tokenAddress);\n\n879 uint192 _rawPrice = _safeu192(_collateral.oracle.currentValue());\n\n882 uint192 _tokenValue = _safeu192(\n\n902 address _tokenAddress = enabledTokens[_i];\n\n904 uint256 _balance = _vault.balances(_tokenAddress); \n\n907 uint192 _rawPrice = _safeu192(_collateral.oracle.peekValue());\n\n910 uint192 _tokenValue = _safeu192(\n\n996 uint256[] memory _tokenBalances = new uint256[](enabledTokens.length); ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "08-dopex", "title": "0xhex G", "severity_raw": "High", "severity": "high", "description": "# Gas Optimization\n\n# Summary\n\n| Number | Gas Optimization Details | Context |\n| :----: | :--------------------------------------------------------------------------------------- | :-----: |\n| [G-01] | Use solidity version 0.8.20 to gain some gas boost | 10 |\n| [G-02] | use solmate for erc721 instead of openzeppelin | 1 |\n| [G-03] | Zero value check posiible Gas Save | 3 |\n| [G-04] | Using > 0 costs more gas than != 0 when used on a uint in a require() statement | 7 |\n| [G-05] | Do not calculate constants | 2 |\n| [G-06] | Pre-increment and pre-decrement are cheaper than +1,-1 | 4 |\n| [G-07] | Use hardcode address instead `address(this)` | 36 |\n| [G-08] | Using storage instead of memory for structs/arrays saves gas | 3 |\n| [G-09] | USING CALLDATA INSTEAD OF MEMORY FOR READ-ONLY ARGUMENTS IN EXTERNAL FUNCTIONS SAVES GAS | 5 |\n| [G-10] | Shorten the array rather than copying to a new one | 8 |\n| [G-11] | Duplicated if() checks should be refactored to a modifier or function | 3 |\n| [G-12] | Empty blocks should be removed or emit something to save some amount of Gas | 1 |\n| [G-13] | CAN MAKE THE VARIABLE OUTSIDE THE LOOP | 3 |\n| [G-14] | Use assembly for math (add, sub, mul, div) | 10 |\n| [G-15] | Ternary operation is cheaper than if-else statement | 3 |\n| [G-16] | Avoid emitting storage values ", "vulnerable_code": "pragma solidity 0.8.19;", "fixed_code": "pragma solidity 0.8.19;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/0xhex-G.md", "collected_at": "2026-01-02T18:24:25.418212+00:00", "source_hash": "5094ed09f9d416906fb6a9c8cc0e8ca89ae57e33bad1df6deffe2fc4aa260b59", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "pragma solidity 0.8.19;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "pragma solidity 0.8.19;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-ondo", "title": "DijkstraDev G", "severity_raw": "Informational", "severity": "informational", "description": "# Gas Findings\n\n## GAS-01\n\nCaching `lastSetMintExchangeRate` (6 readings are removed)\n\n```markdown\ncontracts/cash/CashManager.sol | setMintExchangeRate(\u2026)\n```\n\nBefore:\n\n```solidity\nuint256 rateDifference;\nif (exchangeRate > lastSetMintExchangeRate) {\n rateDifference = exchangeRate - lastSetMintExchangeRate;\n} else if (exchangeRate < lastSetMintExchangeRate) {\n rateDifference = lastSetMintExchangeRate - exchangeRate;\n}\n\nuint256 maxDifferenceThisEpoch = (lastSetMintExchangeRate *\n exchangeRateDeltaLimit) / BPS_DENOMINATOR;\n\nif (rateDifference > maxDifferenceThisEpoch) {\n epochToExchangeRate[epochToSet] = exchangeRate;\n _pause();\n emit MintExchangeRateCheckFailed(\n epochToSet,\n lastSetMintExchangeRate,\n exchangeRate\n );\n} else {\n uint256 oldExchangeRate = lastSetMintExchangeRate;\n epochToExchangeRate[epochToSet] = exchangeRate;\n lastSetMintExchangeRate = exchangeRate;\n emit MintExchangeRateSet(epochToSet, oldExchangeRate, exchangeRate);\n}\n```\n\nAfter:\n\n```solidity\nuint256 rateDifference;\nuint256 lastSetMintExchangeRate_ = lastSetMintExchangeRate;\n\nif (exchangeRate > lastSetMintExchangeRate_) {\n rateDifference = exchangeRate - lastSetMintExchangeRate_;\n} else if (exchangeRate < lastSetMintExchangeRate_) {\n rateDifference = lastSetMintExchangeRate_ - exchangeRate;\n}\n\nuint256 maxDifferenceThisEpoch = (lastSetMintExchangeRate_ *\n exchangeRateDeltaLimit) / BPS_DENOMINATOR;\n\nif (rateDifference > maxDifferenceThisEpoch) {\n epochToExchangeRate[epochToSet] = exchangeRate;\n _pause();\n emit MintExchangeRateCheckFailed(\n epochToSet,\n lastSetMintExchangeRate_,\n exchangeRate\n );\n} else {\n epochToExchangeRate[epochToSet] = exchangeRate;\n lastSetMintExchangeRate = exchangeRate;\n emit MintExchangeRateSet(epochToSet, lastSetMintExchangeRate_, exchangeRate);\n}\n```\n\n## GAS-02\n\nDo not repeat code. Move out of the IF statement the common code between both branches. (Savings of 5 gas units per call)\n\n```markdown\ncontracts", "vulnerable_code": "Before:\n", "fixed_code": "After:\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/DijkstraDev-G.md", "collected_at": "2026-01-02T18:14:36.014317+00:00", "source_hash": "51289340be014c05dce37680c982b56c7e7c635d949d6bcb50eb7df883ce3b63", "code_block_count": 3, "solidity_block_count": 2, "total_code_chars": 1686, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "contracts/cash/CashManager.sol | setMintExchangeRate(\u2026)", "primary_code_language": "markdown", "primary_code_char_count": 55, "all_code_blocks": "// Code block 1 (markdown):\ncontracts/cash/CashManager.sol | setMintExchangeRate(\u2026)\n\n// Code block 2 (solidity):\nuint256 rateDifference;\nif (exchangeRate > lastSetMintExchangeRate) {\n rateDifference = exchangeRate - lastSetMintExchangeRate;\n} else if (exchangeRate < lastSetMintExchangeRate) {\n rateDifference = lastSetMintExchangeRate - exchangeRate;\n}\n\nuint256 maxDifferenceThisEpoch = (lastSetMintExchangeRate *\n exchangeRateDeltaLimit) / BPS_DENOMINATOR;\n\nif (rateDifference > maxDifferenceThisEpoch) {\n epochToExchangeRate[epochToSet] = exchangeRate;\n _pause();\n emit MintExchangeRateCheckFailed(\n epochToSet,\n lastSetMintExchangeRate,\n exchangeRate\n );\n} else {\n uint256 oldExchangeRate = lastSetMintExchangeRate;\n epochToExchangeRate[epochToSet] = exchangeRate;\n lastSetMintExchangeRate = exchangeRate;\n emit MintExchangeRateSet(epochToSet, oldExchangeRate, exchangeRate);\n}\n\n// Code block 3 (solidity):\nuint256 rateDifference;\nuint256 lastSetMintExchangeRate_ = lastSetMintExchangeRate;\n\nif (exchangeRate > lastSetMintExchangeRate_) {\n rateDifference = exchangeRate - lastSetMintExchangeRate_;\n} else if (exchangeRate < lastSetMintExchangeRate_) {\n rateDifference = lastSetMintExchangeRate_ - exchangeRate;\n}\n\nuint256 maxDifferenceThisEpoch = (lastSetMintExchangeRate_ *\n exchangeRateDeltaLimit) / BPS_DENOMINATOR;\n\nif (rateDifference > maxDifferenceThisEpoch) {\n epochToExchangeRate[epochToSet] = exchangeRate;\n _pause();\n emit MintExchangeRateCheckFailed(\n epochToSet,\n lastSetMintExchangeRate_,\n exchangeRate\n );\n} else {\n epochToExchangeRate[epochToSet] = exchangeRate;\n lastSetMintExchangeRate = exchangeRate;\n emit MintExchangeRateSet(epochToSet, lastSetMintExchangeRate_, exchangeRate);\n}", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "uint256 rateDifference;\nif (exchangeRate > lastSetMintExchangeRate) {\n rateDifference = exchangeRate - lastSetMintExchangeRate;\n} else if (exchangeRate < lastSetMintExchangeRate) {\n rateDifference = lastSetMintExchangeRate - exchangeRate;\n}\n\nuint256 maxDifferenceThisEpoch = (lastSetMintExchangeRate *\n exchangeRateDeltaLimit) / BPS_DENOMINATOR;\n\nif (rateDifference > maxDifferenceThisEpoch) {\n epochToExchangeRate[epochToSet] = exchangeRate;\n _pause();\n emit MintExchangeRateCheckFailed(\n epochToSet,\n lastSetMintExchangeRate,\n exchangeRate\n );\n} else {\n uint256 oldExchangeRate = lastSetMintExchangeRate;\n epochToExchangeRate[epochToSet] = exchangeRate;\n lastSetMintExchangeRate = exchangeRate;\n emit MintExchangeRateSet(epochToSet, oldExchangeRate, exchangeRate);\n}\n\nuint256 rateDifference;\nuint256 lastSetMintExchangeRate_ = lastSetMintExchangeRate;\n\nif (exchangeRate > lastSetMintExchangeRate_) {\n rateDifference = exchangeRate - lastSetMintExchangeRate_;\n} else if (exchangeRate < lastSetMintExchangeRate_) {\n rateDifference = lastSetMintExchangeRate_ - exchangeRate;\n}\n\nuint256 maxDifferenceThisEpoch = (lastSetMintExchangeRate_ *\n exchangeRateDeltaLimit) / BPS_DENOMINATOR;\n\nif (rateDifference > maxDifferenceThisEpoch) {\n epochToExchangeRate[epochToSet] = exchangeRate;\n _pause();\n emit MintExchangeRateCheckFailed(\n epochToSet,\n lastSetMintExchangeRate_,\n exchangeRate\n );\n} else {\n epochToExchangeRate[epochToSet] = exchangeRate;\n lastSetMintExchangeRate = exchangeRate;\n emit MintExchangeRateSet(epochToSet, lastSetMintExchangeRate_, exchangeRate);\n}", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "Before:\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "After:\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "10-badger", "title": "debo Q", "severity_raw": "Medium", "severity": "medium", "description": "## [L-01] Lengthy numerals\nUtilising big numerals that have a lot of precisions is within the file and this can be bettered by utilising scientific numerals.\n\n**Locations**\n```sol\n// The number 525600000 is seen on line 60.\n// contracts/Dependencies/EbtcMath.sol#L60-L60\nif (_minutes > 525600000) {\n\n// The number 525600000 is seen on line 61.\n// contracts/Dependencies/EbtcMath.sol#L61-L61\n_minutes = 525600000;\n\n// The number 1030000000000000000 is seen on line 19.\n// contracts/Dependencies/EbtcBase.sol#L19-L19\n uint256 public constant LICR = 1030000000000000000; // 103%\n\n// The number 1100000000000000000 is seen on line 22.\n// contracts/Dependencies/EbtcBase.sol#L22-L22\n uint256 public constant MCR = 1100000000000000000; // 110%\n\n// The number 1250000000000000000 is seen on line 25.\n// contracts/Dependencies/EbtcBase.sol#L25-L25\n uint256 public constant CCR = 1250000000000000000; // 125%\n```\n**Remediation**\nChange the number 525600000 to scientific notation of `5256e5`.\nChange the number 1030000000000000000 to scientific notation of `103e16`.\nChange the number 1100000000000000000 to scientific notation of `11e17`.\nChange the number 1250000000000000000 to scientific notation of `125e16`.\n## [L-02] Unchecked Transfer\n## Impact\nIf the transferFrom does not go through or responds with 0 then sometimes the transfer does not roll back.\nSo when calling the transferFrom method one should check it in the code.\n\n## Proof of Concept\n**Vulnerable flash loan function**\n```sol\n// line 261-310\n function flashLoan(\n IERC3156FlashBorrower receiver,\n address token,\n uint256 amount,\n bytes calldata data\n ) external override returns (bool) {\n require(amount > 0, \"ActivePool: 0 Amount\");\n uint256 fee = flashFee(token, amount); // NOTE: Check for `token` is implicit in the requires above // also checks for paused\n require(amount <= maxFlashLoan(token), \"ActivePool: Too much\");\n\n\n uint256 amountWithFee = amount + fee;\n ", "vulnerable_code": "// The number 525600000 is seen on line 60.\n// contracts/Dependencies/EbtcMath.sol#L60-L60\nif (_minutes > 525600000) {\n\n// The number 525600000 is seen on line 61.\n// contracts/Dependencies/EbtcMath.sol#L61-L61\n_minutes = 525600000;\n\n// The number 1030000000000000000 is seen on line 19.\n// contracts/Dependencies/EbtcBase.sol#L19-L19\n uint256 public constant LICR = 1030000000000000000; // 103%\n\n// The number 1100000000000000000 is seen on line 22.\n// contracts/Dependencies/EbtcBase.sol#L22-L22\n uint256 public constant MCR = 1100000000000000000; // 110%\n\n// The number 1250000000000000000 is seen on line 25.\n// contracts/Dependencies/EbtcBase.sol#L25-L25\n uint256 public constant CCR = 1250000000000000000; // 125%", "fixed_code": "// line 261-310\n function flashLoan(\n IERC3156FlashBorrower receiver,\n address token,\n uint256 amount,\n bytes calldata data\n ) external override returns (bool) {\n require(amount > 0, \"ActivePool: 0 Amount\");\n uint256 fee = flashFee(token, amount); // NOTE: Check for `token` is implicit in the requires above // also checks for paused\n require(amount <= maxFlashLoan(token), \"ActivePool: Too much\");\n\n\n uint256 amountWithFee = amount + fee;\n uint256 oldRate = collateral.getPooledEthByShares(DECIMAL_PRECISION);\n\n\n collateral.transfer(address(receiver), amount);\n\n\n // Callback\n require(\n receiver.onFlashLoan(msg.sender, token, amount, fee, data) == FLASH_SUCCESS_VALUE,\n \"ActivePool: IERC3156: Callback failed\"\n );\n\n\n // Transfer of (principal + Fee) from flashloan receiver\n collateral.transferFrom(address(receiver), address(this), amountWithFee);\n\n\n // Send earned fee to designated recipient\n collateral.transfer(feeRecipientAddress, fee);\n\n\n // Check new balance\n // NOTE: Invariant Check, technically breaks CEI but I think we must use it\n // NOTE: This means any balance > systemCollShares is stuck, this is also present in LUSD as is\n\n\n // NOTE: This check effectively prevents running 2 FL at the same time\n // You technically could, but you'd be having to repay any amount below systemCollShares to get Fl2 to not revert\n require(\n collateral.balanceOf(address(this)) >= collateral.getPooledEthByShares(systemCollShares),\n \"ActivePool: Must repay Balance\"\n );\n require(\n collateral.sharesOf(address(this)) >= systemCollShares,\n \"ActivePool: Must repay Share\"\n );\n require(\n collateral.getPooledEthByShares(DECIMAL_PRECISION) == oldRate,\n \"ActivePool: Should keep same collateral share rate\"\n );\n\n\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/debo-Q.md", "collected_at": "2026-01-02T18:26:46.946070+00:00", "source_hash": "5195138c77e2777dbdf7f1e8d34bc30e9e40b4b0b668a55786b87e8abe565d48", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 728, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "// The number 525600000 is seen on line 60.\n// contracts/Dependencies/EbtcMath.sol#L60-L60\nif (_minutes > 525600000) {\n\n// The number 525600000 is seen on line 61.\n// contracts/Dependencies/EbtcMath.sol#L61-L61\n_minutes = 525600000;\n\n// The number 1030000000000000000 is seen on line 19.\n// contracts/Dependencies/EbtcBase.sol#L19-L19\n uint256 public constant LICR = 1030000000000000000; // 103%\n\n// The number 1100000000000000000 is seen on line 22.\n// contracts/Dependencies/EbtcBase.sol#L22-L22\n uint256 public constant MCR = 1100000000000000000; // 110%\n\n// The number 1250000000000000000 is seen on line 25.\n// contracts/Dependencies/EbtcBase.sol#L25-L25\n uint256 public constant CCR = 1250000000000000000; // 125%", "primary_code_language": "sol", "primary_code_char_count": 728, "all_code_blocks": "// Code block 1 (sol):\n// The number 525600000 is seen on line 60.\n// contracts/Dependencies/EbtcMath.sol#L60-L60\nif (_minutes > 525600000) {\n\n// The number 525600000 is seen on line 61.\n// contracts/Dependencies/EbtcMath.sol#L61-L61\n_minutes = 525600000;\n\n// The number 1030000000000000000 is seen on line 19.\n// contracts/Dependencies/EbtcBase.sol#L19-L19\n uint256 public constant LICR = 1030000000000000000; // 103%\n\n// The number 1100000000000000000 is seen on line 22.\n// contracts/Dependencies/EbtcBase.sol#L22-L22\n uint256 public constant MCR = 1100000000000000000; // 110%\n\n// The number 1250000000000000000 is seen on line 25.\n// contracts/Dependencies/EbtcBase.sol#L25-L25\n uint256 public constant CCR = 1250000000000000000; // 125%", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "// The number 525600000 is seen on line 60.\n// contracts/Dependencies/EbtcMath.sol#L60-L60\nif (_minutes > 525600000) {\n\n// The number 525600000 is seen on line 61.\n// contracts/Dependencies/EbtcMath.sol#L61-L61\n_minutes = 525600000;\n\n// The number 1030000000000000000 is seen on line 19.\n// contracts/Dependencies/EbtcBase.sol#L19-L19\n uint256 public constant LICR = 1030000000000000000; // 103%\n\n// The number 1100000000000000000 is seen on line 22.\n// contracts/Dependencies/EbtcBase.sol#L22-L22\n uint256 public constant MCR = 1100000000000000000; // 110%\n\n// The number 1250000000000000000 is seen on line 25.\n// contracts/Dependencies/EbtcBase.sol#L25-L25\n uint256 public constant CCR = 1250000000000000000; // 125%", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "// The number 525600000 is seen on line 60.\n// contracts/Dependencies/EbtcMath.sol#L60-L60\nif (_minutes > 525600000) {\n\n// The number 525600000 is seen on line 61.\n// contracts/Dependencies/EbtcMath.sol#L61-L61\n_minutes = 525600000;\n\n// The number 1030000000000000000 is seen on line 19.\n// contracts/Dependencies/EbtcBase.sol#L19-L19\n uint256 public constant LICR = 1030000000000000000; // 103%\n\n// The number 1100000000000000000 is seen on line 22.\n// contracts/Dependencies/EbtcBase.sol#L22-L22\n uint256 public constant MCR = 1100000000000000000; // 110%\n\n// The number 1250000000000000000 is seen on line 25.\n// contracts/Dependencies/EbtcBase.sol#L25-L25\n uint256 public constant CCR = 1250000000000000000; // 125%", "has_vulnerable_code_snippet": true, "fixed_code_actual": "// line 261-310\n function flashLoan(\n IERC3156FlashBorrower receiver,\n address token,\n uint256 amount,\n bytes calldata data\n ) external override returns (bool) {\n require(amount > 0, \"ActivePool: 0 Amount\");\n uint256 fee = flashFee(token, amount); // NOTE: Check for `token` is implicit in the requires above // also checks for paused\n require(amount <= maxFlashLoan(token), \"ActivePool: Too much\");\n\n\n uint256 amountWithFee = amount + fee;\n uint256 oldRate = collateral.getPooledEthByShares(DECIMAL_PRECISION);\n\n\n collateral.transfer(address(receiver), amount);\n\n\n // Callback\n require(\n receiver.onFlashLoan(msg.sender, token, amount, fee, data) == FLASH_SUCCESS_VALUE,\n \"ActivePool: IERC3156: Callback failed\"\n );\n\n\n // Transfer of (principal + Fee) from flashloan receiver\n collateral.transferFrom(address(receiver), address(this), amountWithFee);\n\n\n // Send earned fee to designated recipient\n collateral.transfer(feeRecipientAddress, fee);\n\n\n // Check new balance\n // NOTE: Invariant Check, technically breaks CEI but I think we must use it\n // NOTE: This means any balance > systemCollShares is stuck, this is also present in LUSD as is\n\n\n // NOTE: This check effectively prevents running 2 FL at the same time\n // You technically could, but you'd be having to repay any amount below systemCollShares to get Fl2 to not revert\n require(\n collateral.balanceOf(address(this)) >= collateral.getPooledEthByShares(systemCollShares),\n \"ActivePool: Must repay Balance\"\n );\n require(\n collateral.sharesOf(address(this)) >= systemCollShares,\n \"ActivePool: Must repay Share\"\n );\n require(\n collateral.getPooledEthByShares(DECIMAL_PRECISION) == oldRate,\n \"ActivePool: Should keep same collateral share rate\"\n );\n\n\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-salty", "title": "0xAnah G", "severity_raw": "High", "severity": "high", "description": "# SALTY GAS OPTIMIZATIONS\n\n\n## INTRODUCTION\nHighlighted below are optimizations exclusively targeting state-mutating functions and view/pure functions invoked by state-mutating functions. In the discussion that follows, only runtime gas is emphasized, given its inevitable dominance over deployment gas costs throughout the protocol's lifetime. \n\nPlease be aware that some code snippets may be shortened to conserve space, and certain code snippets may include @audit tags in comments to facilitate issue explanations.\"\n\n\n\n\n## [G-01] Refactor `Staking.unstakesForUser()` to avoid coping storage array to memory\n- https://github.com/code-423n4/2024-01-salty/blob/main/src/staking/Staking.sol#L174\n\nIn the `Staking.unstakesForUser()` function as shown below a uint256 array is copied from storage to memory but this array is not used in the function only the length of the array is required in the function so rather than coping the uint256 array from storage to memory just to get the length we can access and cache the length of the uint256 array directly from storage. The diff below shows how the code should be refactored:\n\n```solidity\nfile: src/staking/Staking.sols\n\n171:\tfunction unstakesForUser( address user ) external view returns (Unstake[] memory)\n172:\t\t{\n173:\t\t// Check to see how many unstakes the user has\n174:\t\tuint256[] memory unstakeIDs = _userUnstakeIDs[user];\n175:\t\tif ( unstakeIDs.length == 0 )\n176:\t\t\treturn new Unstake[](0);\n177:\n178:\t\t// Return them all\n179:\t\treturn unstakesForUser( user, 0, unstakeIDs.length - 1 );\n180:\t\t}\n```\n\n```diff\ndiff --git a/src/staking/Staking.sol b/src/staking/Staking.sol\nindex 22e5970..aa6632d 100644\n--- a/src/staking/Staking.sol\n+++ b/src/staking/Staking.sol\n@@ -171,12 +171,12 @@ contract Staking is IStaking, StakingRewards\n function unstakesForUser( address user ) external view returns (Unstake[] memory)\n {\n // Check to see how many unstakes the user has\n- uint256[] memory unstakeIDs = _u", "vulnerable_code": "file: src/staking/Staking.sols\n\n171:\tfunction unstakesForUser( address user ) external view returns (Unstake[] memory)\n172:\t\t{\n173:\t\t// Check to see how many unstakes the user has\n174:\t\tuint256[] memory unstakeIDs = _userUnstakeIDs[user];\n175:\t\tif ( unstakeIDs.length == 0 )\n176:\t\t\treturn new Unstake[](0);\n177:\n178:\t\t// Return them all\n179:\t\treturn unstakesForUser( user, 0, unstakeIDs.length - 1 );\n180:\t\t}", "fixed_code": "## [G-02] Pre-calculate equations or computations which contain only constant values in constructor\nFor equations or computations that only involve constants or immutable values they could be computed in the contract's constructor and saved to an immutable variable. Using the immutable variable would be cheaper than re-computing the value every time the function is called.\n\n\n### 1 Instance\n1. #### Compute `keccak256(abi.encodePacked(\"\"))` in the constructor and save value to an immutable variable\n- https://github.com/code-423n4/2024-01-salty/blob/main/src/dao/Proposals.sol#\n\nSince `abi.encodePacked(\"\")` is a constant value, the value of `keccak256(abi.encodePacked(\"\"))` can be calculated in the constructor. Calling `keccak256(abi.encodePacked(\"\"))` on a known, constant value is a waste of gas rather the calcualtion should be done in the constructor then saved to an immutable variable so that everytime the `proposeWebsiteUpdate()` function is we would not have to re-compute the value of `keccak256(abi.encodePacked(\"\"))` rather it would be replaced with cheaper stack read. The code could be refactored as shown in the diff below:\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/0xAnah-G.md", "collected_at": "2026-01-02T19:01:01.842061+00:00", "source_hash": "524539c8c441fdc012b9ee07bb852092d5c232cce3f45cf7349e27db7c741dc5", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 408, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "file: src/staking/Staking.sols\n\n171:\tfunction unstakesForUser( address user ) external view returns (Unstake[] memory)\n172:\t\t{\n173:\t\t// Check to see how many unstakes the user has\n174:\t\tuint256[] memory unstakeIDs = _userUnstakeIDs[user];\n175:\t\tif ( unstakeIDs.length == 0 )\n176:\t\t\treturn new Unstake[](0);\n177:\n178:\t\t// Return them all\n179:\t\treturn unstakesForUser( user, 0, unstakeIDs.length - 1 );\n180:\t\t}", "primary_code_language": "solidity", "primary_code_char_count": 408, "all_code_blocks": "// Code block 1 (solidity):\nfile: src/staking/Staking.sols\n\n171:\tfunction unstakesForUser( address user ) external view returns (Unstake[] memory)\n172:\t\t{\n173:\t\t// Check to see how many unstakes the user has\n174:\t\tuint256[] memory unstakeIDs = _userUnstakeIDs[user];\n175:\t\tif ( unstakeIDs.length == 0 )\n176:\t\t\treturn new Unstake[](0);\n177:\n178:\t\t// Return them all\n179:\t\treturn unstakesForUser( user, 0, unstakeIDs.length - 1 );\n180:\t\t}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "file: src/staking/Staking.sols\n\n171:\tfunction unstakesForUser( address user ) external view returns (Unstake[] memory)\n172:\t\t{\n173:\t\t// Check to see how many unstakes the user has\n174:\t\tuint256[] memory unstakeIDs = _userUnstakeIDs[user];\n175:\t\tif ( unstakeIDs.length == 0 )\n176:\t\t\treturn new Unstake[](0);\n177:\n178:\t\t// Return them all\n179:\t\treturn unstakesForUser( user, 0, unstakeIDs.length - 1 );\n180:\t\t}", "github_refs_formatted": "Staking.sol#L174, Proposals.sol", "github_files_list": "Staking.sol, Proposals.sol", "github_refs_count": 2, "vulnerable_code_actual": "file: src/staking/Staking.sols\n\n171:\tfunction unstakesForUser( address user ) external view returns (Unstake[] memory)\n172:\t\t{\n173:\t\t// Check to see how many unstakes the user has\n174:\t\tuint256[] memory unstakeIDs = _userUnstakeIDs[user];\n175:\t\tif ( unstakeIDs.length == 0 )\n176:\t\t\treturn new Unstake[](0);\n177:\n178:\t\t// Return them all\n179:\t\treturn unstakesForUser( user, 0, unstakeIDs.length - 1 );\n180:\t\t}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## [G-02] Pre-calculate equations or computations which contain only constant values in constructor\nFor equations or computations that only involve constants or immutable values they could be computed in the contract's constructor and saved to an immutable variable. Using the immutable variable would be cheaper than re-computing the value every time the function is called.\n\n\n### 1 Instance\n1. #### Compute `keccak256(abi.encodePacked(\"\"))` in the constructor and save value to an immutable variable\n- https://github.com/code-423n4/2024-01-salty/blob/main/src/dao/Proposals.sol#\n\nSince `abi.encodePacked(\"\")` is a constant value, the value of `keccak256(abi.encodePacked(\"\"))` can be calculated in the constructor. Calling `keccak256(abi.encodePacked(\"\"))` on a known, constant value is a waste of gas rather the calcualtion should be done in the constructor then saved to an immutable variable so that everytime the `proposeWebsiteUpdate()` function is we would not have to re-compute the value of `keccak256(abi.encodePacked(\"\"))` rather it would be replaced with cheaper stack read. The code could be refactored as shown in the diff below:\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "06-lybra", "title": "TheSavageTeddy G", "severity_raw": "High", "severity": "high", "description": "## Gas Optimizations List\n\n| Number | Optimization Details | Instances |\n|:------:|:--------------------|:---------:|\n| [G-01] | Expressions for constant values such as calling `keccak256()` should use `immutable` rather than `constant` | 7 |\n| [G-02] | `keccak256()` should only need to be called on a specific string literal once | 3 |\n| [G-03] | Check `Require()` / `Revert()` statements that use less gas first | 1 |\n| [G-04] | Hardcode address instead of using `address(this)` | 40 |\n| [G-05] | Structs can be packed into fewer storage slots | 2 |\n| [G-06] | Change `public` function visibility to `external` when appropriate | 32 |\n| [G-07] | Avoid multiple check combinations by using nested `if` statements | 4 |\n| [G-08] | Using `uint`/`int`s smaller than 32 bytes incurs overhead | 7 |\n| [G-09] | Use assembly to check for `address(0)` | 5 |\n| [G-10] | Use constants instead of `type(uintx).max` | 1 |\n\n\n### [G-01] Expressions for constant values such as calling `keccak256()` should use `immutable` rather than `constant`\nConstant values for function calls result in increased gas costs as `immutable`s are evaluated at deployment time, in contrast to `constants` which are executed at runtime for each invocation.\n\n*There are 7 instances of this issue:*\n```solidity\nFile: LybraConfigurator.sol\n76: bytes32 public constant DAO = keccak256(\"DAO\");\n77: bytes32 public constant TIMELOCK = keccak256(\"TIMELOCK\");\n78: bytes32 public constant ADMIN = keccak256(\"ADMIN\");\n```\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/configuration/LybraConfigurator.sol#L76-L78\n\n```solidity\nFile: GovernanceTimelock.sol\n10: bytes32 public constant DAO = keccak256(\"DAO\");\n11: bytes32 public constant TIMELOCK = keccak256(\"TIMELOCK\");\n12: bytes32 public constant ADMIN = keccak256(\"ADMIN\");\n13: bytes32 public constant GOV = keccak256(\"GOV\");\n```\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/governance/GovernanceTimelock.sol#L10-L1", "vulnerable_code": "File: LybraConfigurator.sol\n76: bytes32 public constant DAO = keccak256(\"DAO\");\n77: bytes32 public constant TIMELOCK = keccak256(\"TIMELOCK\");\n78: bytes32 public constant ADMIN = keccak256(\"ADMIN\");", "fixed_code": "File: GovernanceTimelock.sol\n10: bytes32 public constant DAO = keccak256(\"DAO\");\n11: bytes32 public constant TIMELOCK = keccak256(\"TIMELOCK\");\n12: bytes32 public constant ADMIN = keccak256(\"ADMIN\");\n13: bytes32 public constant GOV = keccak256(\"GOV\");", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/TheSavageTeddy-G.md", "collected_at": "2026-01-02T18:22:47.191148+00:00", "source_hash": "5252886db94c5c47b47b09b661fbcd4b4484d81fa1af82e97ba2598bb3562ecd", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 475, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: LybraConfigurator.sol\n76: bytes32 public constant DAO = keccak256(\"DAO\");\n77: bytes32 public constant TIMELOCK = keccak256(\"TIMELOCK\");\n78: bytes32 public constant ADMIN = keccak256(\"ADMIN\");", "primary_code_language": "solidity", "primary_code_char_count": 209, "all_code_blocks": "// Code block 1 (solidity):\nFile: LybraConfigurator.sol\n76: bytes32 public constant DAO = keccak256(\"DAO\");\n77: bytes32 public constant TIMELOCK = keccak256(\"TIMELOCK\");\n78: bytes32 public constant ADMIN = keccak256(\"ADMIN\");\n\n// Code block 2 (solidity):\nFile: GovernanceTimelock.sol\n10: bytes32 public constant DAO = keccak256(\"DAO\");\n11: bytes32 public constant TIMELOCK = keccak256(\"TIMELOCK\");\n12: bytes32 public constant ADMIN = keccak256(\"ADMIN\");\n13: bytes32 public constant GOV = keccak256(\"GOV\");", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: LybraConfigurator.sol\n76: bytes32 public constant DAO = keccak256(\"DAO\");\n77: bytes32 public constant TIMELOCK = keccak256(\"TIMELOCK\");\n78: bytes32 public constant ADMIN = keccak256(\"ADMIN\");\n\nFile: GovernanceTimelock.sol\n10: bytes32 public constant DAO = keccak256(\"DAO\");\n11: bytes32 public constant TIMELOCK = keccak256(\"TIMELOCK\");\n12: bytes32 public constant ADMIN = keccak256(\"ADMIN\");\n13: bytes32 public constant GOV = keccak256(\"GOV\");", "github_refs_formatted": "LybraConfigurator.sol#L76-L78, GovernanceTimelock.sol#L10-L1", "github_files_list": "GovernanceTimelock.sol, LybraConfigurator.sol", "github_refs_count": 2, "vulnerable_code_actual": "File: LybraConfigurator.sol\n76: bytes32 public constant DAO = keccak256(\"DAO\");\n77: bytes32 public constant TIMELOCK = keccak256(\"TIMELOCK\");\n78: bytes32 public constant ADMIN = keccak256(\"ADMIN\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: GovernanceTimelock.sol\n10: bytes32 public constant DAO = keccak256(\"DAO\");\n11: bytes32 public constant TIMELOCK = keccak256(\"TIMELOCK\");\n12: bytes32 public constant ADMIN = keccak256(\"ADMIN\");\n13: bytes32 public constant GOV = keccak256(\"GOV\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "05-ajna", "title": "report", "severity_raw": "Critical", "severity": "critical", "description": "---\nsponsor: \"Ajna Protocol\"\nslug: \"2023-05-ajna\"\ndate: \"2023-06-29\"\ntitle: \"Ajna Protocol\"\nfindings: \"https://github.com/code-423n4/2023-05-ajna-findings/issues\"\ncontest: 234\n---\n\n# Overview\n\n## About C4\n\nCode4rena (C4) is an open organization consisting of security researchers, auditors, developers, and individuals with domain expertise in smart contracts.\n\nA C4 audit is an event in which community participants, referred to as Wardens, review, audit, or analyze smart contract logic in exchange for a bounty provided by sponsoring projects.\n\nDuring the audit outlined in this document, C4 conducted an analysis of the Ajna Protocol smart contract system written in Solidity. The audit took place between May 3\u2014May 11 2023.\n\n## Wardens\n\n123 Wardens contributed reports to the Ajna Protocol:\n\n 1. [0x73696d616f](https://twitter.com/3xJanx2009)\n 2. 0xRobocop\n 3. [0xSmartContract](https://twitter.com/0xSmartContract)\n 4. [0xStalin](https://twitter.com/Stalin_eth)\n 5. [0xTheC0der](https://twitter.com/MarioPoneder)\n 6. 0xWaitress\n 7. 0xcm\n 8. [0xnev](https://twitter.com/0xnevi)\n 9. 7siech\n 10. [ABAIKUNANBAEV](https://twitter.com/_onlyowner)\n 11. [Audinarey](https://twitter.com/Audinarey)\n 12. [Audit\\_Avengers](https://twitter.com/JP_Courses) ([JP\\_Courses](https://twitter.com/JP_Courses), [pxng0lin](https://www.twitter.com/pxng0lin), [zzebra83](https://www.linkedin.com/in/hamid-abubakr-732901ab/), Aon\\_8, and ravikiranweb3)\n 13. [Aymen0909](https://github.com/Aymen1001)\n 14. BGSecurity ([anonresercher](https://twitter.com/anonresercher) and [martin](https://github.com/martin-petrov03))\n 15. BPZ (Bitcoinfever244, PrasadLak, and zinc42)\n 16. BRONZEDISC\n 17. Bason\n 18. [Bauchibred](https://twitter.com/bauchibred?s=21&t=7sv-1qcnwtkdTA81Iog0yQ )\n 19. [Blckhv](https://twitter.com/Aydoanbalakchie)\n 20. Brenzee\n 21. [DadeKuma](https://twitter.com/DadeKuma)\n 22. Dug\n 23. Eurovickk\n 24. Evo\n 25. GG\\_Security ([georgits](https://twitter.com/georgits_", "vulnerable_code": " function moveLiquidity(\n MoveLiquidityParams calldata params_\n ) external override mayInteract(params_.pool, params_.tokenId) nonReentrant {\n Position storage fromPosition = positions[params_.tokenId][params_.fromIndex];\n\n MoveLiquidityLocalVars memory vars;\n vars.depositTime = fromPosition.depositTime;\n\n // handle the case where owner attempts to move liquidity after they've already done so\n if (vars.depositTime == 0) revert RemovePositionFailed();\n\n // ensure bucketDeposit accounts for accrued interest\n IPool(params_.pool).updateInterest();\n\n // retrieve info of bucket from which liquidity is moved \n (\n vars.bucketLP,\n vars.bucketCollateral,\n vars.bankruptcyTime,\n vars.bucketDeposit,\n ) = IPool(params_.pool).bucketInfo(params_.fromIndex);\n\n // check that bucket hasn't gone bankrupt since memorialization\n if (vars.depositTime <= vars.bankruptcyTime) revert BucketBankrupt();\n\n // calculate the max amount of quote tokens that can be moved, given the tracked LP\n vars.maxQuote = _lpToQuoteToken(\n vars.bucketLP,\n vars.bucketCollateral,\n vars.bucketDeposit,\n fromPosition.lps,\n vars.bucketDeposit,\n _priceAt(params_.fromIndex)\n );\n\n EnumerableSet.UintSet storage positionIndex = positionIndexes[params_.tokenId];\n\n // remove bucket index from which liquidity is moved from tracked positions\n>> if (!positionIndex.remove(params_.fromIndex)) revert RemovePositionFailed();\n\n // update bucket set at which a position has liquidity\n // slither-disable-next-line unused-return\n positionIndex.add(params_.toIndex);\n\n // move quote tokens in pool\n (\n vars.lpbAmountFrom,\n vars.lpbAmountTo,\n ) = IPool(params_.pool).moveQuoteToken(\n vars.maxQuote,\n params_.fromI", "fixed_code": " function _lpToQuoteToken(\n uint256 bucketLP_,\n uint256 bucketCollateral_,\n uint256 deposit_,\n uint256 lenderLPBalance_,\n uint256 maxQuoteToken_,\n uint256 bucketPrice_\n ) pure returns (uint256 quoteTokenAmount_) {\n uint256 rate = Buckets.getExchangeRate(bucketCollateral_, bucketLP_, deposit_, bucketPrice_);\n\n quoteTokenAmount_ = Maths.wmul(lenderLPBalance_, rate);\n\n if (quoteTokenAmount_ > deposit_) quoteTokenAmount_ = deposit_;\n if (quoteTokenAmount_ > maxQuoteToken_) quoteTokenAmount_ = maxQuoteToken_;\n }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/report.md", "collected_at": "2026-01-02T18:21:54.539008+00:00", "source_hash": "52693aec929454234f3123280021ef3389288a2e206686c427f8d09d7efeb1fd", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function moveLiquidity(\n MoveLiquidityParams calldata params_\n ) external override mayInteract(params_.pool, params_.tokenId) nonReentrant {\n Position storage fromPosition = positions[params_.tokenId][params_.fromIndex];\n\n MoveLiquidityLocalVars memory vars;\n vars.depositTime = fromPosition.depositTime;\n\n // handle the case where owner attempts to move liquidity after they've already done so\n if (vars.depositTime == 0) revert RemovePositionFailed();\n\n // ensure bucketDeposit accounts for accrued interest\n IPool(params_.pool).updateInterest();\n\n // retrieve info of bucket from which liquidity is moved \n (\n vars.bucketLP,\n vars.bucketCollateral,\n vars.bankruptcyTime,\n vars.bucketDeposit,\n ) = IPool(params_.pool).bucketInfo(params_.fromIndex);\n\n // check that bucket hasn't gone bankrupt since memorialization\n if (vars.depositTime <= vars.bankruptcyTime) revert BucketBankrupt();\n\n // calculate the max amount of quote tokens that can be moved, given the tracked LP\n vars.maxQuote = _lpToQuoteToken(\n vars.bucketLP,\n vars.bucketCollateral,\n vars.bucketDeposit,\n fromPosition.lps,\n vars.bucketDeposit,\n _priceAt(params_.fromIndex)\n );\n\n EnumerableSet.UintSet storage positionIndex = positionIndexes[params_.tokenId];\n\n // remove bucket index from which liquidity is moved from tracked positions\n>> if (!positionIndex.remove(params_.fromIndex)) revert RemovePositionFailed();\n\n // update bucket set at which a position has liquidity\n // slither-disable-next-line unused-return\n positionIndex.add(params_.toIndex);\n\n // move quote tokens in pool\n (\n vars.lpbAmountFrom,\n vars.lpbAmountTo,\n ) = IPool(params_.pool).moveQuoteToken(\n vars.maxQuote,\n params_.fromI", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function _lpToQuoteToken(\n uint256 bucketLP_,\n uint256 bucketCollateral_,\n uint256 deposit_,\n uint256 lenderLPBalance_,\n uint256 maxQuoteToken_,\n uint256 bucketPrice_\n ) pure returns (uint256 quoteTokenAmount_) {\n uint256 rate = Buckets.getExchangeRate(bucketCollateral_, bucketLP_, deposit_, bucketPrice_);\n\n quoteTokenAmount_ = Maths.wmul(lenderLPBalance_, rate);\n\n if (quoteTokenAmount_ > deposit_) quoteTokenAmount_ = deposit_;\n if (quoteTokenAmount_ > maxQuoteToken_) quoteTokenAmount_ = maxQuoteToken_;\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "02-ethos", "title": "Lavishq Q", "severity_raw": "Medium", "severity": "medium", "description": "## 1. Use a more recent version of solidity if possible\n Version 0.6.11 is too old consider upgrading it that is possible to a newer solidity version as it will give `custom Error` benefits from `v0.8.4` and reduce gas usage for the users by a significant margin and has `safe math` check for under and overflow so there will be no need to use SafeMath library and reducing code size along with saving in the gas from `v0.8.0`\n\nAll the contracts in `Ethos-Vault` use floating pragma which in not recommended so using a version that is above v0.8.4 and using custom errors is recommended, as well as it is recommended using more recent version of solidity will be a better practice in general.\n\n\n## 2. No need to inherits self interface and override it: \nThe following contracts inherit themselves and override themselves that results in increase of bytecode\nremoving the interface from below contracts and removing override will optimize them to a significant extent\n1. `Ethos-Core/contracts/CollateralConfig.sol`\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol#L8\n2. `Ethos-Core/contracts/BorrowerOperations.sol`\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L5\n`removing \"override\" of the below functions so that they are not taking a significant chunk in bytecode`\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol#L46\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol#L102\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol#L106\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol#L110\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol#L116\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol#L122\n\nhttps://github.com/code-42", "vulnerable_code": "require(IERC20(_collateral).balanceOf(_user) >= _collAmount, \"BorrowerOperations: Insufficient user collateral balance\");\nrequire(IERC20(_collateral).allowance(_user, address(this)) >= _collAmount, \"BorrowerOperations: Insufficient collateral allowance\");", "fixed_code": "eg: 2`https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol#L91` and 92 \nrequire(_MCR <= config.MCR && _CCR <= config.CCR, \"Can only walk down the MCR\");\nand followed by the same pattern in line 94 and 97 can use \nrequire(_MCRs[i] >= MIN_ALLOWED_MCR && _CCRs[i] >= MIN_ALLOWED_CCR, \"MCR and CCR below allowed min\"); to save gas\n### e.g. 2, implementation", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/Lavishq-Q.md", "collected_at": "2026-01-02T18:16:18.901972+00:00", "source_hash": "526de9474a95ae21705b6a421ee363729cd563326a00685ece95050c8858769a", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 9, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CollateralConfig.sol#L8, BorrowerOperations.sol#L5, CollateralConfig.sol#L46, CollateralConfig.sol#L102, CollateralConfig.sol#L106, CollateralConfig.sol#L110, CollateralConfig.sol#L116, CollateralConfig.sol#L122, CollateralConfig.sol#L91", "github_files_list": "BorrowerOperations.sol, CollateralConfig.sol", "github_refs_count": 9, "vulnerable_code_actual": "require(IERC20(_collateral).balanceOf(_user) >= _collAmount, \"BorrowerOperations: Insufficient user collateral balance\");\nrequire(IERC20(_collateral).allowance(_user, address(this)) >= _collAmount, \"BorrowerOperations: Insufficient collateral allowance\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": "eg: 2`https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol#L91` and 92 \nrequire(_MCR <= config.MCR && _CCR <= config.CCR, \"Can only walk down the MCR\");\nand followed by the same pattern in line 94 and 97 can use \nrequire(_MCRs[i] >= MIN_ALLOWED_MCR && _CCRs[i] >= MIN_ALLOWED_CCR, \"MCR and CCR below allowed min\"); to save gas\n### e.g. 2, implementation", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "02-ethos", "title": "codeislight Q", "severity_raw": "Low", "severity": "low", "description": "# Summary\n## Quality Assurance Findings List:\n| Number |Issues Details|Instances|\n|:--:|:-------|:--:|\n|[QA-1]| internal functions used only once | 4 |\n|[QA-2]| Unnecessary return statement | 64 |\n|[QA-3]| Using a consistent data type, instead of rounding up to uint256 | 1 |\n|[QA-4]| The recovery mode is exclusive for CCR value | 1 |\n|[QA-5]| Lack of sanity check for parameters being contracts | 45 |\n|[QA-6]| Explicitly define the array size limit in the parameter | 1 |\n\n### [QA-1] internal functions used only once \n\nOne of the main benefits of using internal function is the reusability aspect of it, but in the case being used in 1 function only, it would be better to move the logic to the function that is using it, Unless the purpose is to breakdown a long/complex logic into multiple parts.\n\n3 instances - 3 files\n\ninstances:\n- LUSDToken._requireCallerIsStabilityPool()\n- LUSDToken._requireCallerIsTroveMorSP()\n- LUSDToken._requireMintingNotPaused()\n- ActivePool._requireCallerIsBorrowerOperationsOrDefaultPool()\n- BorrowerOperations._getCollChange()\n- BorrowerOperations._updateTroveFromAdjustment()\n- BorrowerOperations._moveTokensAndCollateralfromAdjustment()\n- BorrowerOperations._requireValidCollateralAddress()\n- StabilityPool._updateG()\n...\n\n### [QA-2] Unnecessary return statement\n\nin the ITroveManager interface, we have updateTroveRewardSnapshots() function prototype doesn't return any value, but in the implementaion in TroveManager.updateTroveRewardSnapshots(), it does have a return statmenet, despite that _updateTroveRewardSnapshots() doesn't return any value.\n\n```solidity\n function updateTroveRewardSnapshots(address _borrower, address _collateral)\n external\n override\n {\n _requireCallerIsBorrowerOperations();\n \n return _updateTroveRewardSnapshots(_borrower, _collateral);\n }\n\n function _updateTroveRewardSnapshots(address _borrower, address _collateral)\n internal\n {\n rewardSnapshots[_borrower][_collater", "vulnerable_code": " function updateTroveRewardSnapshots(address _borrower, address _collateral)\n external\n override\n {\n _requireCallerIsBorrowerOperations();\n \n return _updateTroveRewardSnapshots(_borrower, _collateral);\n }\n\n function _updateTroveRewardSnapshots(address _borrower, address _collateral)\n internal\n {\n rewardSnapshots[_borrower][_collateral].collAmount = L_Collateral[\n _collateral\n ];\n rewardSnapshots[_borrower][_collateral].LUSDDebt = L_LUSDDebt[\n _collateral\n ];\n emit TroveSnapshotsUpdated(\n _collateral,\n L_Collateral[_collateral],\n L_LUSDDebt[_collateral]\n );\n }", "fixed_code": " function getTroveStatus(address _borrower, address _collateral)\n external\n view\n override\n returns (uint256)\n {\n // tbd QA return uint8 instead of uint256, to maintain a consistency since enum are uint8 based\n return uint256(Troves[_borrower][_collateral].status);\n }", "recommendation": "", "category": "rounding", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/codeislight-Q.md", "collected_at": "2026-01-02T18:16:57.999862+00:00", "source_hash": "5291b8d50dc2b1fd4ab3e9e9d7ed571dd48adde2a21723630c3d63e5eb4cf802", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function updateTroveRewardSnapshots(address _borrower, address _collateral)\n external\n override\n {\n _requireCallerIsBorrowerOperations();\n \n return _updateTroveRewardSnapshots(_borrower, _collateral);\n }\n\n function _updateTroveRewardSnapshots(address _borrower, address _collateral)\n internal\n {\n rewardSnapshots[_borrower][_collateral].collAmount = L_Collateral[\n _collateral\n ];\n rewardSnapshots[_borrower][_collateral].LUSDDebt = L_LUSDDebt[\n _collateral\n ];\n emit TroveSnapshotsUpdated(\n _collateral,\n L_Collateral[_collateral],\n L_LUSDDebt[_collateral]\n );\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function getTroveStatus(address _borrower, address _collateral)\n external\n view\n override\n returns (uint256)\n {\n // tbd QA return uint8 instead of uint256, to maintain a consistency since enum are uint8 based\n return uint256(Troves[_borrower][_collateral].status);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-ondo", "title": "halden G", "severity_raw": "Low", "severity": "low", "description": "## [G-01] Use assembly to check for address(0). Missed in the C4udit output\nFile CashManager.sol: [141](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L141), [144](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L144), [147](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L147), [150](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L150), [150](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L150)\n\nFile KYCRegistryClient.sol: [40](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistryClient.sol#L40)\n\nFile CashKYCSender.sol: [68](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/token/CashKYCSender.sol#L68)\n\nFile CashKYCSenderReceiver.sol: [68](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/token/CashKYCSenderReceiver.sol#L68), [76](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/token/CashKYCSenderReceiver.sol#L76)\n\nFile KYCRegistryClient.sol: [40](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistryClient.sol#L40)\n\n\n## [G-02] Cache storage values in memory to minimize SLOADs\nThe code can be optimized by minimising the number of SLOADs. Storage value should get cached in memory if they occur more than once.\n\n1) Use `_epochDuration` instead of `epochDuration` [176](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L176)\nRecommended:\n```\n(block.timestamp % _epochDuration);\n```\n2) Cache `epochToExchangeRate[epochToClaim] ` in memory. If the check for equal to zero is false we can save 2 SLOAD. One in line 266 and another in 492. [249](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L249)\nRecommended:\n``` \nuint256 rate = epochToExchangeRate[epochToClaim];\nif (rate == 0) { // line 249\n revert ExchangeRa", "vulnerable_code": "(block.timestamp % _epochDuration);", "fixed_code": "uint256 rate = epochToExchangeRate[epochToClaim];\nif (rate == 0) { // line 249\n revert ExchangeRateNotSet();\n}\n\nemit MintCompleted(\n user,\n cashOwed,\n collateralDeposited,\n rate // line 266\n epochToClaim\n);\n\nfunction _getMintAmountForEpoch(\n uint256 collateralAmountIn,\n uint256 rate // line 489\n ) private view returns (uint256 cashAmountOut) {\n uint256 amountE24 = _scaleUp(collateralAmountIn) * 1e6;\n cashAmountOut = amountE24 / rate; // line 492\n}", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/halden-G.md", "collected_at": "2026-01-02T18:15:12.488449+00:00", "source_hash": "53204c656746d487acc5ca5f31c6683bca7d30c697cefc3117e760e0087bdaf1", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 35, "github_ref_count": 10, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "(block.timestamp % _epochDuration);", "primary_code_language": "unknown", "primary_code_char_count": 35, "all_code_blocks": "// Code block 1 (unknown):\n(block.timestamp % _epochDuration);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CashManager.sol#L141, CashManager.sol#L144, CashManager.sol#L147, CashManager.sol#L150, KYCRegistryClient.sol#L40, CashKYCSender.sol#L68, CashKYCSenderReceiver.sol#L68, CashKYCSenderReceiver.sol#L76, CashManager.sol#L176, CashManager.sol#L249", "github_files_list": "CashManager.sol, CashKYCSenderReceiver.sol, CashKYCSender.sol, KYCRegistryClient.sol", "github_refs_count": 10, "vulnerable_code_actual": "(block.timestamp % _epochDuration);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "uint256 rate = epochToExchangeRate[epochToClaim];\nif (rate == 0) { // line 249\n revert ExchangeRateNotSet();\n}\n\nemit MintCompleted(\n user,\n cashOwed,\n collateralDeposited,\n rate // line 266\n epochToClaim\n);\n\nfunction _getMintAmountForEpoch(\n uint256 collateralAmountIn,\n uint256 rate // line 489\n ) private view returns (uint256 cashAmountOut) {\n uint256 amountE24 = _scaleUp(collateralAmountIn) * 1e6;\n cashAmountOut = amountE24 / rate; // line 492\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ethos", "title": "ansoncrypto007 G", "severity_raw": "Unknown", "severity": "unknown", "description": "### Emitting a storage value instead of memory one.\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L581\n\n```\n578 function updateTvlCap(uint256 _newTvlCap) public {\n579 _atLeastRole(ADMIN);\n580 tvlCap = _newTvlCap;\n581 emit TvlCapUpdated(tvlCap);\n582 }\n```\n\n### Reading a storage variable twice. Instead, a local variable could be used.\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L395\n##### ReaperVaultV2.sol._withdraw(): strategyBal should be used when updating strategies[stratAddr].allocated.\n```\n379 uint256 strategyBal = strategies[stratAddr].allocated;\n380 if (strategyBal == 0) {\n381 continue;\n382 }\n383\n384 uint256 remaining = value - vaultBalance;\n385 uint256 loss = IStrategy(stratAddr).withdraw(Math.min(remaining, strategyBal));\n386 uint256 actualWithdrawn = token.balanceOf(address(this)) - vaultBalance;\n387\n388 // Withdrawer incurs any losses from withdrawing as reported by strat\n389 if (loss != 0) {\n390 value -= loss;\n391 totalLoss += loss;\n392 _reportLoss(stratAddr, loss);\n393 }\n394\n395 strategies[stratAddr].allocated -= actualWithdrawn;\n```\n'-=' reads `strategies[stratAddr].allocated` one more time. Instead, `strategyBal` could be used.\n`strategies[stratAddr].allocated = strategyBal - actualWithdrawn;`\n\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L156\n##### ReaperVaultV2.sol.addStrategy(): totalAllocBPS should be cached in memory.\n```\n156 require(_allocBPS + totalAllocBPS <= PERCENT_DIVISOR, \"Invalid allocBPS value\");\n156\n158 strategies[_strategy] = StrategyParams({\n159 activation: block.timestamp,\n160 feeBPS: _feeBPS,\n161 ", "vulnerable_code": "578 function updateTvlCap(uint256 _newTvlCap) public {\n579 _atLeastRole(ADMIN);\n580 tvlCap = _newTvlCap;\n581 emit TvlCapUpdated(tvlCap);\n582 }", "fixed_code": "379 uint256 strategyBal = strategies[stratAddr].allocated;\n380 if (strategyBal == 0) {\n381 continue;\n382 }\n383\n384 uint256 remaining = value - vaultBalance;\n385 uint256 loss = IStrategy(stratAddr).withdraw(Math.min(remaining, strategyBal));\n386 uint256 actualWithdrawn = token.balanceOf(address(this)) - vaultBalance;\n387\n388 // Withdrawer incurs any losses from withdrawing as reported by strat\n389 if (loss != 0) {\n390 value -= loss;\n391 totalLoss += loss;\n392 _reportLoss(stratAddr, loss);\n393 }\n394\n395 strategies[stratAddr].allocated -= actualWithdrawn;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/ansoncrypto007-G.md", "collected_at": "2026-01-02T18:16:46.786382+00:00", "source_hash": "535f951086917fa7a50adfa061412985ea40fda44e9fbd5f059e95bef5f6016d", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 950, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "578 function updateTvlCap(uint256 _newTvlCap) public {\n579 _atLeastRole(ADMIN);\n580 tvlCap = _newTvlCap;\n581 emit TvlCapUpdated(tvlCap);\n582 }", "primary_code_language": "unknown", "primary_code_char_count": 169, "all_code_blocks": "// Code block 1 (unknown):\n578 function updateTvlCap(uint256 _newTvlCap) public {\n579 _atLeastRole(ADMIN);\n580 tvlCap = _newTvlCap;\n581 emit TvlCapUpdated(tvlCap);\n582 }\n\n// Code block 2 (unknown):\n379 uint256 strategyBal = strategies[stratAddr].allocated;\n380 if (strategyBal == 0) {\n381 continue;\n382 }\n383\n384 uint256 remaining = value - vaultBalance;\n385 uint256 loss = IStrategy(stratAddr).withdraw(Math.min(remaining, strategyBal));\n386 uint256 actualWithdrawn = token.balanceOf(address(this)) - vaultBalance;\n387\n388 // Withdrawer incurs any losses from withdrawing as reported by strat\n389 if (loss != 0) {\n390 value -= loss;\n391 totalLoss += loss;\n392 _reportLoss(stratAddr, loss);\n393 }\n394\n395 strategies[stratAddr].allocated -= actualWithdrawn;", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ReaperVaultV2.sol#L581, ReaperVaultV2.sol#L395, ReaperVaultV2.sol#L156", "github_files_list": "ReaperVaultV2.sol", "github_refs_count": 3, "vulnerable_code_actual": "578 function updateTvlCap(uint256 _newTvlCap) public {\n579 _atLeastRole(ADMIN);\n580 tvlCap = _newTvlCap;\n581 emit TvlCapUpdated(tvlCap);\n582 }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "379 uint256 strategyBal = strategies[stratAddr].allocated;\n380 if (strategyBal == 0) {\n381 continue;\n382 }\n383\n384 uint256 remaining = value - vaultBalance;\n385 uint256 loss = IStrategy(stratAddr).withdraw(Math.min(remaining, strategyBal));\n386 uint256 actualWithdrawn = token.balanceOf(address(this)) - vaultBalance;\n387\n388 // Withdrawer incurs any losses from withdrawing as reported by strat\n389 if (loss != 0) {\n390 value -= loss;\n391 totalLoss += loss;\n392 _reportLoss(stratAddr, loss);\n393 }\n394\n395 strategies[stratAddr].allocated -= actualWithdrawn;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "02-ethos", "title": "hl_ G", "severity_raw": "High", "severity": "high", "description": "# Table of contents\n\n- [G-01] Use a more recent version of solidity\n- [G-02] x += y costs more gas than x = x + y for state variables\n- [G-03] Duplicated require() / revert() checks should be refactored to a modifier or function\n- [G-04] Structs can be packed into fewer storage slots\n- [G-05] Use Shift Right/Left instead of Division/Multiplication\n- [G-06] Use constants instead of type(uintx).max\n- [G-07] Usage of uints/ints smaller than 32 bytes (256 bits) incurs overhead\n- [G-08] Use double require instead of using &&\n- [G-09] Use nested if and avoid multiple check combinations\n- [G-10] Sort Solidity operations using short-circuit mode\n- [G-11] Optimize names to save gas\n\n## [G-01] Use a more recent version of solidity\n\nUse a solidity version of at least 0.8.2 to get simple compiler automatic inlining. \nUse a solidity version of at least 0.8.3 to get better struct packing and cheaper multiple storage reads. \nUse a solidity version of at least 0.8.4 to get custom errors, which are cheaper at deployment than\u00a0revert()/require() strings and get bytes.concat() instead of abi.encodePacked(,. \nUse a solidity version of at least 0.8.10 to have external calls skip contract existence checks if the external call has a return value. \nUse a solidity version of at least 0.8.12 to get string.concat() instead of abi.encodePacked (,)\n\n```\nLUSDToken.sol\n3: pragma solidity 0.6.11;\n```\n\n```\nReaperVaultERC4626.sol\n3: pragma solidity ^0.8.0;\n```\n\n## [G-02] x += y costs more gas than x = x + y for state variables\n\nUsing the addition operator instead of plus-equals saves\u00a0113 gas.\n\nFor example: \n```\nFile: 2023-02-ethos/Ethos-Vault/contracts/ReaperVaultV2.sol \n168: totalAllocBPS += _allocBPS;\n196: totalAllocBPS += _allocBPS;\n```\n\n## [G-03] Duplicated require() / revert() checks should be refactored to a modifier or function\n\nSaves deployment costs\n\n```\nFile: 2023-02-ethos/Ethos-Vault/contracts/ReaperVaultV2.sol \n180: require(strategies[_strategy].ac", "vulnerable_code": "LUSDToken.sol\n3: pragma solidity 0.6.11;", "fixed_code": "ReaperVaultERC4626.sol\n3: pragma solidity ^0.8.0;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/hl_-G.md", "collected_at": "2026-01-02T18:17:16.789014+00:00", "source_hash": "539b6626da2514fe235a720e3aad7be991b8b37e960a6f5daa5553dd91b238ac", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 226, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "LUSDToken.sol\n3: pragma solidity 0.6.11;", "primary_code_language": "unknown", "primary_code_char_count": 43, "all_code_blocks": "// Code block 1 (unknown):\nLUSDToken.sol\n3: pragma solidity 0.6.11;\n\n// Code block 2 (unknown):\nReaperVaultERC4626.sol\n3: pragma solidity ^0.8.0;\n\n// Code block 3 (unknown):\nFile: 2023-02-ethos/Ethos-Vault/contracts/ReaperVaultV2.sol \n168: totalAllocBPS += _allocBPS;\n196: totalAllocBPS += _allocBPS;", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "LUSDToken.sol\n3: pragma solidity 0.6.11;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "ReaperVaultERC4626.sol\n3: pragma solidity ^0.8.0;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "07-amphora", "title": "bigtone G", "severity_raw": "Medium", "severity": "medium", "description": "\n## Gas Optimizations\n\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [GAS-1](#GAS-1) | Use the returns variable directly instead of declaring the variables | 3 |\n\n### [GAS-1] Use the returns variable directly instead of declaring the variables\n\n*Instances (3)*:\n```diff\nFile: https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/AMPHClaimer.sol\n\n-171: uint256 _cvxRewardsFeeToExchange = _totalToFraction(_cvxTotalRewards, cvxRewardFee);\n+171: _cvxAmountToSend = _totalToFraction(_cvxTotalRewards, cvxRewardFee);\n\n\n-172: uint256 _crvRewardsFeeToExchange = _totalToFraction(_crvTotalRewards, crvRewardFee);\n+172: _crvAmountToSend = _totalToFraction(_crvTotalRewards, crvRewardFee);\n\n-174: uint256 _amphByCrv = _calculate(_crvRewardsFeeToExchange);\n+174: _claimableAmph = _calculate(_crvAmountToSend);\n\n176: // Check if all cliffs consumed\n177: if (_getCliff((_claimableAmph / 1e12) + distributedAmph) >= TOTAL_CLIFFS) return (0, 0, 0);\n178:\n179: // check for rounding errors\n180: if (_claimableAmph == 0) return (0, 0, 0);\n181:\n182: if (_amphBalance >= _claimableAmph) {\n-184: _cvxAmountToSend = _cvxRewardsFeeToExchange;\n-185: _crvAmountToSend = _crvRewardsFeeToExchange;\n-186: _claimableAmph = _amphByCrv;\n```", "vulnerable_code": "", "fixed_code": "", "recommendation": "", "category": "rounding", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/bigtone-G.md", "collected_at": "2026-01-02T18:23:42.121823+00:00", "source_hash": "5409da4d0f9f59cf3cd496cc1a14a923655d113b59419df9529a75cd504d0e61", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 1085, "github_ref_count": 1, "vulnerable_code_is_url": true, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "File: https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/AMPHClaimer.sol\n\n-171: uint256 _cvxRewardsFeeToExchange = _totalToFraction(_cvxTotalRewards, cvxRewardFee);\n+171: _cvxAmountToSend = _totalToFraction(_cvxTotalRewards, cvxRewardFee);\n\n\n-172: uint256 _crvRewardsFeeToExchange = _totalToFraction(_crvTotalRewards, crvRewardFee);\n+172: _crvAmountToSend = _totalToFraction(_crvTotalRewards, crvRewardFee);\n\n-174: uint256 _amphByCrv = _calculate(_crvRewardsFeeToExchange);\n+174: _claimableAmph = _calculate(_crvAmountToSend);\n\n176: // Check if all cliffs consumed\n177: if (_getCliff((_claimableAmph / 1e12) + distributedAmph) >= TOTAL_CLIFFS) return (0, 0, 0);\n178:\n179: // check for rounding errors\n180: if (_claimableAmph == 0) return (0, 0, 0);\n181:\n182: if (_amphBalance >= _claimableAmph) {\n-184: _cvxAmountToSend = _cvxRewardsFeeToExchange;\n-185: _crvAmountToSend = _crvRewardsFeeToExchange;\n-186: _claimableAmph = _amphByCrv;", "primary_code_language": "diff", "primary_code_char_count": 1085, "all_code_blocks": "// Code block 1 (diff):\nFile: https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/AMPHClaimer.sol\n\n-171: uint256 _cvxRewardsFeeToExchange = _totalToFraction(_cvxTotalRewards, cvxRewardFee);\n+171: _cvxAmountToSend = _totalToFraction(_cvxTotalRewards, cvxRewardFee);\n\n\n-172: uint256 _crvRewardsFeeToExchange = _totalToFraction(_crvTotalRewards, crvRewardFee);\n+172: _crvAmountToSend = _totalToFraction(_crvTotalRewards, crvRewardFee);\n\n-174: uint256 _amphByCrv = _calculate(_crvRewardsFeeToExchange);\n+174: _claimableAmph = _calculate(_crvAmountToSend);\n\n176: // Check if all cliffs consumed\n177: if (_getCliff((_claimableAmph / 1e12) + distributedAmph) >= TOTAL_CLIFFS) return (0, 0, 0);\n178:\n179: // check for rounding errors\n180: if (_claimableAmph == 0) return (0, 0, 0);\n181:\n182: if (_amphBalance >= _claimableAmph) {\n-184: _cvxAmountToSend = _cvxRewardsFeeToExchange;\n-185: _crvAmountToSend = _crvRewardsFeeToExchange;\n-186: _claimableAmph = _amphByCrv;", "all_code_blocks_count": 1, "has_diff_blocks": true, "diff_code": "File: https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/AMPHClaimer.sol\n\n-171: uint256 _cvxRewardsFeeToExchange = _totalToFraction(_cvxTotalRewards, cvxRewardFee);\n+171: _cvxAmountToSend = _totalToFraction(_cvxTotalRewards, cvxRewardFee);\n\n\n-172: uint256 _crvRewardsFeeToExchange = _totalToFraction(_crvTotalRewards, crvRewardFee);\n+172: _crvAmountToSend = _totalToFraction(_crvTotalRewards, crvRewardFee);\n\n-174: uint256 _amphByCrv = _calculate(_crvRewardsFeeToExchange);\n+174: _claimableAmph = _calculate(_crvAmountToSend);\n\n176: // Check if all cliffs consumed\n177: if (_getCliff((_claimableAmph / 1e12) + distributedAmph) >= TOTAL_CLIFFS) return (0, 0, 0);\n178:\n179: // check for rounding errors\n180: if (_claimableAmph == 0) return (0, 0, 0);\n181:\n182: if (_amphBalance >= _claimableAmph) {\n-184: _cvxAmountToSend = _cvxRewardsFeeToExchange;\n-185: _crvAmountToSend = _crvRewardsFeeToExchange;\n-186: _claimableAmph = _amphByCrv;", "solidity_code": "", "github_refs_formatted": "AMPHClaimer.sol", "github_files_list": "AMPHClaimer.sol", "github_refs_count": 1, "vulnerable_code_actual": "", "has_vulnerable_code_snippet": false, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6.73} {"source": "c4", "protocol": "02-ai-arena", "title": "Myrault G", "severity_raw": "Medium", "severity": "medium", "description": "## There is duplicate code in the constructor of AiArenaHelper.sol, resulting in unnecessary gas consumption\n\n## POC\n\nThe following code exists in the constructor of the AiArenaHelper contract:\n```\n//AiArenaHelper.sol\nconstructor(uint8[][] memory probabilities) {\n _ownerAddress = msg.sender;\n\n // Initialize the probabilities for each attribute\n addAttributeProbabilities(0, probabilities);// @audit\uff1ainit\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n attributeProbabilities[0][attributes[i]] = probabilities[i]; // Unnecessary gas consumption\n attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n }\n }\n```\n\nThe addAttributeProbabilities function is called for initialization, but this sentence duplicates the function of the first sentence in the for loop, resulting in unnecessary gas consumption. The implementation of the addAttributeProbabilities function is as follows:\n\n```\n/// @notice Add attribute probabilities for a given generation.\n /// @dev Only the owner can call this function.\n /// @param generation The generation number.\n /// @param probabilities An array of attribute probabilities for the generation.\n function addAttributeProbabilities(uint256 generation, uint8[][] memory probabilities) public {\n require(msg.sender == _ownerAddress);\n require(probabilities.length == 6, \"Invalid number of attribute arrays\");\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n attributeProbabilities[generation][attributes[i]] = probabilities[i];\n }\n }\n```\n\n## Recommended Mitigation Steps\n\n```\ndiff --git a/src/AiArenaHelper.sol b/src/AiArenaHelper.sol\nindex b93dde8..14527fd 100644\n--- a/src/AiArenaHelper.sol\n+++ b/src/AiArenaHelper.sol\n@@ -42,7 +42,8 @@ contract AiArenaHelper {\n _ownerAddress = msg.sender;\n \n // Initialize the p", "vulnerable_code": "//AiArenaHelper.sol\nconstructor(uint8[][] memory probabilities) {\n _ownerAddress = msg.sender;\n\n // Initialize the probabilities for each attribute\n addAttributeProbabilities(0, probabilities);// @audit\uff1ainit\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n attributeProbabilities[0][attributes[i]] = probabilities[i]; // Unnecessary gas consumption\n attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n }\n }", "fixed_code": "/// @notice Add attribute probabilities for a given generation.\n /// @dev Only the owner can call this function.\n /// @param generation The generation number.\n /// @param probabilities An array of attribute probabilities for the generation.\n function addAttributeProbabilities(uint256 generation, uint8[][] memory probabilities) public {\n require(msg.sender == _ownerAddress);\n require(probabilities.length == 6, \"Invalid number of attribute arrays\");\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n attributeProbabilities[generation][attributes[i]] = probabilities[i];\n }\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/Myrault-G.md", "collected_at": "2026-01-02T19:02:36.274739+00:00", "source_hash": "5418d4713d55a607192412b5b1d57df9e6ac9eb0e82ed46675bc01c2cbc004f8", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 1225, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "//AiArenaHelper.sol\nconstructor(uint8[][] memory probabilities) {\n _ownerAddress = msg.sender;\n\n // Initialize the probabilities for each attribute\n addAttributeProbabilities(0, probabilities);// @audit\uff1ainit\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n attributeProbabilities[0][attributes[i]] = probabilities[i]; // Unnecessary gas consumption\n attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n }\n }", "primary_code_language": "unknown", "primary_code_char_count": 537, "all_code_blocks": "// Code block 1 (unknown):\n//AiArenaHelper.sol\nconstructor(uint8[][] memory probabilities) {\n _ownerAddress = msg.sender;\n\n // Initialize the probabilities for each attribute\n addAttributeProbabilities(0, probabilities);// @audit\uff1ainit\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n attributeProbabilities[0][attributes[i]] = probabilities[i]; // Unnecessary gas consumption\n attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n }\n }\n\n// Code block 2 (unknown):\n/// @notice Add attribute probabilities for a given generation.\n /// @dev Only the owner can call this function.\n /// @param generation The generation number.\n /// @param probabilities An array of attribute probabilities for the generation.\n function addAttributeProbabilities(uint256 generation, uint8[][] memory probabilities) public {\n require(msg.sender == _ownerAddress);\n require(probabilities.length == 6, \"Invalid number of attribute arrays\");\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n attributeProbabilities[generation][attributes[i]] = probabilities[i];\n }\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "//AiArenaHelper.sol\nconstructor(uint8[][] memory probabilities) {\n _ownerAddress = msg.sender;\n\n // Initialize the probabilities for each attribute\n addAttributeProbabilities(0, probabilities);// @audit\uff1ainit\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n attributeProbabilities[0][attributes[i]] = probabilities[i]; // Unnecessary gas consumption\n attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n }\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "/// @notice Add attribute probabilities for a given generation.\n /// @dev Only the owner can call this function.\n /// @param generation The generation number.\n /// @param probabilities An array of attribute probabilities for the generation.\n function addAttributeProbabilities(uint256 generation, uint8[][] memory probabilities) public {\n require(msg.sender == _ownerAddress);\n require(probabilities.length == 6, \"Invalid number of attribute arrays\");\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n attributeProbabilities[generation][attributes[i]] = probabilities[i];\n }\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ai-arena", "title": "0x11singh99 G", "severity_raw": "High", "severity": "high", "description": "# Gas Optimizations\n\n**Note : _G-08_ and _G-09_ contains only those instances which were missed by bot. Since they are major gas savings so I included those missed instances**\n| Number | Issue |\n| ---------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------- |\n| [[G-01](#g-01-pack-structs-by-reducing-variable-sizes-to-save-storage-slots-saves-12000-gas)] | Pack structs by reducing variable sizes to save storage slots (saves ~12000 Gas) |\n| [[G-02](#g-02-state-variables-can-be-packed-into-fewer-storage-slot-saves-8000-gas)] | State variables can be packed into fewer storage slot (saves ~8000 Gas) |\n| [[G-03](#g-03-restructure-nftsclaimed-mapping-elements-and-make-struct-elementsaves-2000-gas)] | Restructure `nftsClaimed` mapping elements and make struct element(saves ~2000 Gas) |\n| [[G-04](#g-04-remove-unnecessary-isselectioncomplete-mapping-from-mergingpool-contractsaves-22100-gas)] |Remove unnecessary `isSelectionComplete` mapping from `MergingPool` contract(saves ~22100 Gas) |\n| [[G-05](#g-05-remove-unnecessary-addattributeprobabilities-function-call-in-constructor)] | Remove unnecessary `addAttributeProbabilities` function call in `constructor` |\n| [[G-06](#g-06-refactor-code-to-save-gassaves-100-gas)] | `Refactor` code to save gas(saves ~100 Gas) |\n| [[G-07](#g-07-external-calls-should-be-cached-instead-of-re-calling-the-same-function-in-the-same-transaction)] | `External` calls should be `cached` instead of re-calling the same `function` in the same transaction |\n| [[G-08](#g-08-dont-read-state-variable-in-loopinstances-missed-by-bot-report)] | Don't read `state` variable in `loop`(_Instances missed by bot report_) |\n| [[G-09](#g-09-update-state-variable-outside-of-the-loop-after-accumulating-results-in-stack-variableinstance", "vulnerable_code": "File : src/FighterOps.sol\n\n26: struct FighterPhysicalAttributes {\n27: uint256 head;\n28: uint256 eyes;\n29: uint256 mouth;\n30: uint256 body;\n31: uint256 hands;\n32: uint256 feet;\n33: }\n", "fixed_code": "### `dailyAllowance` and `transferable` can be packed in single storage slot `SAVES: 2000 GAS, 1 SLOT`\n\n`dailyAllowance` can easily reduced to `uint16` since in [GameItems::createGameItem](https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/GameItems.sol#L208C5-L229C11) function the input parameter type for `dailyAllowance` is uint16. And after assigning it this variable never updated. So `uint16` is more than sufficient to hold it.\n\n[GameItems::createGameItem](https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/GameItems.sol#L208C5-L229C11) function\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/0x11singh99-G.md", "collected_at": "2026-01-02T19:01:57.472148+00:00", "source_hash": "5425659cda9eacce5d10652e6b1317ea374b1e270c8b5bc6a70c8297f04b73dc", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "GameItems.sol#L208-L5", "github_files_list": "GameItems.sol", "github_refs_count": 1, "vulnerable_code_actual": "File : src/FighterOps.sol\n\n26: struct FighterPhysicalAttributes {\n27: uint256 head;\n28: uint256 eyes;\n29: uint256 mouth;\n30: uint256 body;\n31: uint256 hands;\n32: uint256 feet;\n33: }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "### `dailyAllowance` and `transferable` can be packed in single storage slot `SAVES: 2000 GAS, 1 SLOT`\n\n`dailyAllowance` can easily reduced to `uint16` since in [GameItems::createGameItem](https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/GameItems.sol#L208C5-L229C11) function the input parameter type for `dailyAllowance` is uint16. And after assigning it this variable never updated. So `uint16` is more than sufficient to hold it.\n\n[GameItems::createGameItem](https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/GameItems.sol#L208C5-L229C11) function\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "04-caviar", "title": "chaduke Q", "severity_raw": "Low", "severity": "low", "description": "QA1. Zero address check is recommended for the input: \n\n[https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/Factory.sol#L129-L131](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/Factory.sol#L129-L131)\n\n[https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/Factory.sol#L135-L137](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/Factory.sol#L135-L137)\n\nQA2.A range check is recommended for the input:\n[https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/Factory.sol#L141-L143](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/Factory.sol#L141-L143)\n\nQA3. One should check whether tokenIds.length == tokenWeights.length.\n\n[https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L661-L687](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L661-L687)\n\nQA4. Maybe ``bytes.concat`` is not needed here and the calculation can be simplified:\n\n```diff\n- leafs[i] = keccak256(bytes.concat(keccak256(abi.encode(tokenIds[i], tokenWeights[i]))));\n+ leafs[i] = keccak256(abi.encode(tokenIds[i], tokenWeights[i]));\n\n```\n\nQA5. There is an error in the NatSpec of ``change()``:\n\n[https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L375-L377](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L375-L377)\n\nMitigation: the correction should be \n```diff\n- The sum of the caller's NFT weights must be less than or equal to the sum of the\n /// output pool NFTs weights.\n\n+ The sum of the caller's NFT weights must be greater than or equal to the sum of the\n /// output pool NFTs weights.\n```\n\nQA6. The ``buy()", "vulnerable_code": "QA5. There is an error in the NatSpec of ``change()``:\n\n[https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L375-L377](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L375-L377)\n\nMitigation: the correction should be ", "fixed_code": "QA6. The ``buy()`` function fails to verify that a private pool only supports ETH as base tokens.\nSimilarly, the ``deposit()`` function does not check this either.\n\n[https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L129](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L129)\n\n[https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L247](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L247)\n\nMitigation: check whether the private pool only supports ETH as base tokens:", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/chaduke-Q.md", "collected_at": "2026-01-02T18:20:21.720033+00:00", "source_hash": "5427cf89fc5c9f8cf94e3429c118b02a57db55ceb0006a6663cebc29217e110b", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 393, "github_ref_count": 7, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "- leafs[i] = keccak256(bytes.concat(keccak256(abi.encode(tokenIds[i], tokenWeights[i]))));\n+ leafs[i] = keccak256(abi.encode(tokenIds[i], tokenWeights[i]));", "primary_code_language": "diff", "primary_code_char_count": 156, "all_code_blocks": "// Code block 1 (diff):\n- leafs[i] = keccak256(bytes.concat(keccak256(abi.encode(tokenIds[i], tokenWeights[i]))));\n+ leafs[i] = keccak256(abi.encode(tokenIds[i], tokenWeights[i]));\n\n// Code block 2 (diff):\n- The sum of the caller's NFT weights must be less than or equal to the sum of the\n /// output pool NFTs weights.\n\n+ The sum of the caller's NFT weights must be greater than or equal to the sum of the\n /// output pool NFTs weights.", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "- leafs[i] = keccak256(bytes.concat(keccak256(abi.encode(tokenIds[i], tokenWeights[i]))));\n+ leafs[i] = keccak256(abi.encode(tokenIds[i], tokenWeights[i]));\n\n- The sum of the caller's NFT weights must be less than or equal to the sum of the\n /// output pool NFTs weights.\n\n+ The sum of the caller's NFT weights must be greater than or equal to the sum of the\n /// output pool NFTs weights.", "solidity_code": "", "github_refs_formatted": "Factory.sol#L129-L131, Factory.sol#L135-L137, Factory.sol#L141-L143, PrivatePool.sol#L661-L687, PrivatePool.sol#L375-L377, EthRouter.sol#L129, EthRouter.sol#L247", "github_files_list": "PrivatePool.sol, Factory.sol, EthRouter.sol", "github_refs_count": 7, "vulnerable_code_actual": "QA5. There is an error in the NatSpec of ``change()``:\n\n[https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L375-L377](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L375-L377)\n\nMitigation: the correction should be ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "QA6. The ``buy()`` function fails to verify that a private pool only supports ETH as base tokens.\nSimilarly, the ``deposit()`` function does not check this either.\n\n[https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L129](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L129)\n\n[https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L247](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L247)\n\nMitigation: check whether the private pool only supports ETH as base tokens:", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "10-badger", "title": "0xta G", "severity_raw": "Low", "severity": "low", "description": "# Gas Optimization\n\n# Summary\n\n| Number | Gas Optimization | Context |\n| :----: | :----------------------------------------------------------------------------------------------------------------- | :-----: |\n| [G-01] | Use hardcode address instead address(this) | 23 |\n| [G-02] | Do not calculate constants | 1 |\n| [G-03] | Shorten the array rather than copying to a new one | 6 |\n| [G-04] | Internal functions only called once can be inlined to save gas | 76 |\n| [G-05] | Splitting require() statements that use && saves gas | 9 |\n| [G-06] | MULTIPLE ADDRESS/ID MAPPINGS CAN BE COMBINED INTO A SINGLE MAPPING OF AN ADDRESS/ID TO A STRUCT, WHERE APPROPRIATE | 4 |\n| [G-07] | BEFORE SOME FUNCTIONS, WE SHOULD CHECK SOME VARIABLES FOR POSSIBLE GAS SAVE | 7 |\n| [G-08] | Use Assembly to write Address Storage Value | 25 |\n| [G-09] | A modifier used only once and not being inherited should be inlined to save gas | 1 |\n| [G-10] | Using storage instead of memory for Structs/Arrays Save Gas | 10 |\n| [G-11] | Use constants instead of type(uintx).max | 12 |\n| [G-12] | Using delete statement can save gas | 9 |\n| [G-13] | Using fixed bytes is cheap", "vulnerable_code": "File: contracts/contracts/LeverageMacroBase.sol\n\n131 address(this),\n\n143 initialCdpIndex = sortedCdps.cdpCountOf(address(this));\n\n149 IERC3156FlashBorrower(address(this)),\n\n156 IERC3156FlashBorrower(address(this)),\n\n173 bytes32 cdpId = sortedCdps.cdpOfOwnerByIndex(address(this), initialCdpIndex);\n\n220 uint256 ebtcBal = ebtcToken.balanceOf(address(this));\n\n221 uint256 collateralBal = stETH.sharesOf(address(this));\n\n352 require(initiator == address(this), \"LeverageMacroReference: wrong initiator for flashloan\");\n\n441 IERC20(swapChecks[i].tokenToCheck).balanceOf(address(this)) >\n\n456 require(addy != address(this)); // If it could call this it could fake the forwarded caller", "fixed_code": "File: contracts/contracts/ActivePool.sol\n\n283 collateral.transferFrom(address(receiver), address(this), amountWithFee);\n\n295 collateral.balanceOf(address(this)) >= collateral.getPooledEthByShares(systemCollShares),\n\n299 collateral.sharesOf(address(this)) >= systemCollShares,\n\n337 return collateral.balanceOf(address(this));\n\n376 uint256 balance = IERC20(token).balanceOf(address(this));", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/0xta-G.md", "collected_at": "2026-01-02T18:26:27.707338+00:00", "source_hash": "545120c003fa87cd36666221ab4ad3cc5615c37bc99bbfcd7323b409c680ad1c", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: contracts/contracts/LeverageMacroBase.sol\n\n131 address(this),\n\n143 initialCdpIndex = sortedCdps.cdpCountOf(address(this));\n\n149 IERC3156FlashBorrower(address(this)),\n\n156 IERC3156FlashBorrower(address(this)),\n\n173 bytes32 cdpId = sortedCdps.cdpOfOwnerByIndex(address(this), initialCdpIndex);\n\n220 uint256 ebtcBal = ebtcToken.balanceOf(address(this));\n\n221 uint256 collateralBal = stETH.sharesOf(address(this));\n\n352 require(initiator == address(this), \"LeverageMacroReference: wrong initiator for flashloan\");\n\n441 IERC20(swapChecks[i].tokenToCheck).balanceOf(address(this)) >\n\n456 require(addy != address(this)); // If it could call this it could fake the forwarded caller", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/contracts/ActivePool.sol\n\n283 collateral.transferFrom(address(receiver), address(this), amountWithFee);\n\n295 collateral.balanceOf(address(this)) >= collateral.getPooledEthByShares(systemCollShares),\n\n299 collateral.sharesOf(address(this)) >= systemCollShares,\n\n337 return collateral.balanceOf(address(this));\n\n376 uint256 balance = IERC20(token).balanceOf(address(this));", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "04-caviar", "title": "0xSmartContract Q", "severity_raw": "Critical", "severity": "critical", "description": "## Summary\n### Issues List\n| Number |Issues Details|Context|\n|:--:|:-------|:--:|\n|[L-01]|Calculation of flash loan fee should be rounded up\u00a0| 1 |\n|[L-02]|Even if there is a fee of `msg.value`, the transaction will be reverted | 1 |\n|[L-03]|Missing ReEntrancy Guard to ` safeTransferFrom `in functions | 6 |\n|[L-04]|Prevent division by `0`|2|\n|[L-05]|`PrivatePoolMetadata.tokenURI` is not compliant with EIP721 |1|\n|[L-06]|Use ```safeTransferOwnership``` instead of ```transferOwnership``` function | 1 |\n|[L-07]|Use Fuzzing Test for math code bases | All Contracts |\n|[L-08]|Project Upgrade and Stop Scenario should be | All Contracts |\n|[L-09]|Insufficient coverage| All Contracts |\n|[L-10]|Add a timelock to critical functions| 1 |\n|[L-11] |Loss of precision due to rounding|1|\n|[L-12] |Should an airdrop token arrive on the `private.sol` contract, it will be stuck| 1|\n|[L-13] |Add to _blacklist function_| 1|\n|[L-14]|Function Calls in Loop Could Lead to Denial of Service due to Array length not being checked| 1 |\n|[NC-15] |Constants on the left are better| 8 |\n|[NC-16] |`Function writing` that does not comply with the `Solidity Style Guide`| All Contracts |\n|[NC-17] |Include return parameters in NatSpec comments| All Contracts |\n|[NC-18] |Tokens accidentally sent to the contract cannot be recovered | 1 |\n|[NC-19] |` sell ` event is missing parameters| 1 |\n|[NC-20] |Assembly Codes Specific \u2013 Should Have Comments | 1|\n|[NC-21] |For functions, follow Solidity standard naming conventions (internal function style rule)| 1 |\n|[NC-22] |Floating pragma| 5 |\n|[NC-23] |Use SMTChecker| All Contract |\n|[NC-24] |Lines are too long| 3 |\n|[NC-25] |Omissions in Events| 8 |\n|[NC-26] |Missing Event for initialize|3|\n\nTotal 26 issues\n\n### [L-01] Calculation of flash loan fee should be rounded up\u00a0\n\nMath rounding should never favor the user, the calculation of flash load fee should be rounded up..\n\n\n\n```solidity\n uint56 public changeFee;\n\nsrc/PrivatePool.sol:\n 632: uint256 fee = fla", "vulnerable_code": " uint56 public changeFee;\n\nsrc/PrivatePool.sol:\n 632: uint256 fee = flashFee(token, tokenId);\n\n function flashFee(address, uint256) public view returns (uint256) {\n return changeFee;\n }\n", "fixed_code": "import \"@openzeppelin/contracts/utils/math/Math.sol\";\n\nuint256 public changeFee;\n\nfunction flashFee(address token, uint256 tokenId) public view returns (uint256) {\n uint256 fee = changeFee;\n uint256 amount = getFlashLoanAmount(token, tokenId);\n uint256 feeAmount = amount * fee / 1e18;\n return Math.ceil(feeAmount); // Round up the fee calculation\n}", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/0xSmartContract-Q.md", "collected_at": "2026-01-02T18:19:19.445295+00:00", "source_hash": "54804e4d0b02cd77ccf4219a29295ceceee1888230d6bae1280de241f6950363", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " uint56 public changeFee;\n\nsrc/PrivatePool.sol:\n 632: uint256 fee = flashFee(token, tokenId);\n\n function flashFee(address, uint256) public view returns (uint256) {\n return changeFee;\n }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "import \"@openzeppelin/contracts/utils/math/Math.sol\";\n\nuint256 public changeFee;\n\nfunction flashFee(address token, uint256 tokenId) public view returns (uint256) {\n uint256 fee = changeFee;\n uint256 amount = getFlashLoanAmount(token, tokenId);\n uint256 feeAmount = amount * fee / 1e18;\n return Math.ceil(feeAmount); // Round up the fee calculation\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-revert-lend", "title": "ktg Q", "severity_raw": "Low", "severity": "low", "description": "### L-01: AutoRange incorrect maxAmountAdd calculation\nFunction `AutoRange.execute` currently calculates maxAmountAdd as follows:\n```solidity\n// max amount to add - removing max potential fees (if config.onlyFees - the have been removed already)\n state.maxAddAmount0 = config.onlyFees ? state.amount0 : state.amount0 * Q64 / (params.rewardX64 + Q64);\n state.maxAddAmount1 = config.onlyFees ? state.amount1 : state.amount1 * Q64 / (params.rewardX64 + Q64);\n```\nIn case `onlyFees = False`, the maxAddAmount is calculated as `state.amount * (Q64)/ (rewardX64 + Q64)`, this is for `removing max potentials fees` (to keep enough token as fee for operator). However, this calculation is wrong for large `rewardX64`, since `rewardX64` reflect the percentage at which the reward is calculated, then the formula must be `1 - (rewardX64)/Q64`\n\nSo if `rewardX64` = 20%, then `maxAddAmount` should be 80%, but in fact, it's calculated as `1/(1+0.2)` = 83.3%.\n\n### L-02: AutoExit does not work with Revert Lend position\n`AutoExit` does not work with Revert Lend position, function `configToken` will revert if `msg.sender` is not the owner:\n```solidity\naddress owner = nonfungiblePositionManager.ownerOf(tokenId);\n if (owner != msg.sender) {\n revert Unauthorized();\n }\n```\nSo after transferring NFT to Revert Lend Vault, `AutoExit` cannot be used.\nFunction `execute` also allow only `operator` to call, not `vault`:\n```solidity\nfunction execute(ExecuteParams calldata params) external {\n if (!operators[msg.sender]) {\n revert Unauthorized();\n }\n...\n``` \n\n\n### L-03: `Automator.setVault` should check if the vault has the same NonfungiblePositionManager with the automator\n```solidity\nfunction setVault(address _vault, bool _active) public onlyOwner {\n emit VaultChanged(_vault, _active);\n vaults[_vault] = _active;\n }\n```\nFunction `setVault` does not check if `_vault` having the same `nonfungiblePositionManager` with the ", "vulnerable_code": "// max amount to add - removing max potential fees (if config.onlyFees - the have been removed already)\n state.maxAddAmount0 = config.onlyFees ? state.amount0 : state.amount0 * Q64 / (params.rewardX64 + Q64);\n state.maxAddAmount1 = config.onlyFees ? state.amount1 : state.amount1 * Q64 / (params.rewardX64 + Q64);", "fixed_code": "address owner = nonfungiblePositionManager.ownerOf(tokenId);\n if (owner != msg.sender) {\n revert Unauthorized();\n }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/ktg-Q.md", "collected_at": "2026-01-02T19:03:14.124568+00:00", "source_hash": "54ff08a19d1a10b1e127fb9be97afaf3505fbddec6f0e11ff7530b050066d530", "code_block_count": 4, "solidity_block_count": 4, "total_code_chars": 770, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "// max amount to add - removing max potential fees (if config.onlyFees - the have been removed already)\n state.maxAddAmount0 = config.onlyFees ? state.amount0 : state.amount0 * Q64 / (params.rewardX64 + Q64);\n state.maxAddAmount1 = config.onlyFees ? state.amount1 : state.amount1 * Q64 / (params.rewardX64 + Q64);", "primary_code_language": "solidity", "primary_code_char_count": 335, "all_code_blocks": "// Code block 1 (solidity):\n// max amount to add - removing max potential fees (if config.onlyFees - the have been removed already)\n state.maxAddAmount0 = config.onlyFees ? state.amount0 : state.amount0 * Q64 / (params.rewardX64 + Q64);\n state.maxAddAmount1 = config.onlyFees ? state.amount1 : state.amount1 * Q64 / (params.rewardX64 + Q64);\n\n// Code block 2 (solidity):\naddress owner = nonfungiblePositionManager.ownerOf(tokenId);\n if (owner != msg.sender) {\n revert Unauthorized();\n }\n\n// Code block 3 (solidity):\nfunction execute(ExecuteParams calldata params) external {\n if (!operators[msg.sender]) {\n revert Unauthorized();\n }\n...\n\n// Code block 4 (solidity):\nfunction setVault(address _vault, bool _active) public onlyOwner {\n emit VaultChanged(_vault, _active);\n vaults[_vault] = _active;\n }", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "// max amount to add - removing max potential fees (if config.onlyFees - the have been removed already)\n state.maxAddAmount0 = config.onlyFees ? state.amount0 : state.amount0 * Q64 / (params.rewardX64 + Q64);\n state.maxAddAmount1 = config.onlyFees ? state.amount1 : state.amount1 * Q64 / (params.rewardX64 + Q64);\n\naddress owner = nonfungiblePositionManager.ownerOf(tokenId);\n if (owner != msg.sender) {\n revert Unauthorized();\n }\n\nfunction execute(ExecuteParams calldata params) external {\n if (!operators[msg.sender]) {\n revert Unauthorized();\n }\n...\n\nfunction setVault(address _vault, bool _active) public onlyOwner {\n emit VaultChanged(_vault, _active);\n vaults[_vault] = _active;\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "// max amount to add - removing max potential fees (if config.onlyFees - the have been removed already)\n state.maxAddAmount0 = config.onlyFees ? state.amount0 : state.amount0 * Q64 / (params.rewardX64 + Q64);\n state.maxAddAmount1 = config.onlyFees ? state.amount1 : state.amount1 * Q64 / (params.rewardX64 + Q64);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "address owner = nonfungiblePositionManager.ownerOf(tokenId);\n if (owner != msg.sender) {\n revert Unauthorized();\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "09-ondo", "title": "K42 G", "severity_raw": "Low", "severity": "low", "description": "## Gas Optimization Report for [Ondo](https://github.com/code-423n4/2023-09-ondo) by K42\n\n### Possible Optimization in [SourceBridge.sol](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/SourceBridge.sol)\n\nPossible Optimization 1 = \n- Use ``immutable`` for [destChainToContractAddr mapping](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/SourceBridge.sol#L15) if the ``mapping`` is not expected to change after contract deployment.\n\nHere is the optimized code snippet: \n\n\n\n\n```solidity\nmapping(string => string) public immutable destChainToContractAddr;\n```\n\n\n\n\n- Estimated gas saved = Around ~100 gas for ``SLOAD`` opcode savings per access.\n\nPossible Optimization 2 = \n- In [burnAndCallAxelar()](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/SourceBridge.sol#L61C1-L82C4) you could batch multiple state variable updates into a single external function call, to reduce the gas cost of multiple ``SSTORE`` operations.\n\nHere is the optimized code: \n\n\n\n\n```solidity\nfunction burnAndCallAxelar(\n uint256 amount,\n string calldata destinationChain,\n uint256 newNonce\n) external payable whenNotPaused {\n // ... existing logic\n nonce = newNonce;\n}\n```\n\n\n\n\n- Estimated gas saved = Around ~5000 gas for reduced ``SSTORE`` operations.\n\nPossible Optimization 3 = \n- You could batch ``msg.sender`` and ``msg.value`` into a single ``struct`` to reduce stack depth.\n\nAfter Optimization:\n\n\n\n\n```solidity\nstruct MsgData {\n address sender;\n uint256 value;\n}\n\nfunction burnAndCallAxelar(\n uint256 amount,\n string calldata destinationChain,\n MsgData calldata msgData\n) external payable whenNotPaused {\n // Then use msgData.sender and msgData.value instead of msg.sender and msg.value here\n}\n```\n\n\n\n\n\n- Estimated gas saved = ~1000-2000 gas (stack operations usually cost around 3 gas for PUSH and 3 gas for POP).\n\nPossible Optimization 4 = \n- Use ``bytes32`` for [destinationChain](https://github.com/code-423n4/2023-09", "vulnerable_code": "mapping(string => string) public immutable destChainToContractAddr;", "fixed_code": "function burnAndCallAxelar(\n uint256 amount,\n string calldata destinationChain,\n uint256 newNonce\n) external payable whenNotPaused {\n // ... existing logic\n nonce = newNonce;\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/K42-G.md", "collected_at": "2026-01-02T18:25:33.576658+00:00", "source_hash": "55886fd1aedd7bae274f5dc64ce047c2ad91fd058550262f563367de1d50ad7d", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 558, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "mapping(string => string) public immutable destChainToContractAddr;", "primary_code_language": "solidity", "primary_code_char_count": 67, "all_code_blocks": "// Code block 1 (solidity):\nmapping(string => string) public immutable destChainToContractAddr;\n\n// Code block 2 (solidity):\nfunction burnAndCallAxelar(\n uint256 amount,\n string calldata destinationChain,\n uint256 newNonce\n) external payable whenNotPaused {\n // ... existing logic\n nonce = newNonce;\n}\n\n// Code block 3 (solidity):\nstruct MsgData {\n address sender;\n uint256 value;\n}\n\nfunction burnAndCallAxelar(\n uint256 amount,\n string calldata destinationChain,\n MsgData calldata msgData\n) external payable whenNotPaused {\n // Then use msgData.sender and msgData.value instead of msg.sender and msg.value here\n}", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "mapping(string => string) public immutable destChainToContractAddr;\n\nfunction burnAndCallAxelar(\n uint256 amount,\n string calldata destinationChain,\n uint256 newNonce\n) external payable whenNotPaused {\n // ... existing logic\n nonce = newNonce;\n}\n\nstruct MsgData {\n address sender;\n uint256 value;\n}\n\nfunction burnAndCallAxelar(\n uint256 amount,\n string calldata destinationChain,\n MsgData calldata msgData\n) external payable whenNotPaused {\n // Then use msgData.sender and msgData.value instead of msg.sender and msg.value here\n}", "github_refs_formatted": "SourceBridge.sol, SourceBridge.sol#L15, SourceBridge.sol#L61-L1", "github_files_list": "SourceBridge.sol", "github_refs_count": 3, "vulnerable_code_actual": "mapping(string => string) public immutable destChainToContractAddr;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function burnAndCallAxelar(\n uint256 amount,\n string calldata destinationChain,\n uint256 newNonce\n) external payable whenNotPaused {\n // ... existing logic\n nonce = newNonce;\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "03-revert-lend", "title": "report", "severity_raw": "Critical", "severity": "critical", "description": "---\nsponsor: \"Revert Lend\"\nslug: \"2024-03-revert-lend\"\ndate: \"2024-05-22\"\ntitle: \"Revert Lend\"\nfindings: \"https://github.com/code-423n4/2024-03-revert-lend-findings/issues\"\ncontest: 342\n---\n\n# Overview\n\n## About C4\n\nCode4rena (C4) is an open organization consisting of security researchers, auditors, developers, and individuals with domain expertise in smart contracts.\n\nA C4 audit is an event in which community participants, referred to as Wardens, review, audit, or analyze smart contract logic in exchange for a bounty provided by sponsoring projects.\n\nDuring the audit outlined in this document, C4 conducted an analysis of the Revert Lend smart contract system written in Solidity. The audit took place between March 4 \u2014 March 15, 2024.\n\nFollowing the C4 audit, 3 wardens ([b0g0](https://code4rena.com/@b0g0), [ktg](https://code4rena.com/@ktg) and [thank\\_you](https://code4rena.com/@thank_you)) reviewed the mitigations for all identified issues; the [mitigation review report](#mitigation-review) is appended below the audit report.\n\n## Wardens\n\n105 Wardens contributed reports to the Revert Lend:\n\n 1. [b0g0](https://code4rena.com/@b0g0)\n 2. [0xjuan](https://code4rena.com/@0xjuan)\n 3. [ktg](https://code4rena.com/@ktg)\n 4. [thank\\_you](https://code4rena.com/@thank_you)\n 5. [Aymen0909](https://code4rena.com/@Aymen0909)\n 6. [grearlake](https://code4rena.com/@grearlake)\n 7. [cryptphi](https://code4rena.com/@cryptphi)\n 8. [Giorgio](https://code4rena.com/@Giorgio)\n 9. [lanrebayode77](https://code4rena.com/@lanrebayode77)\n 10. [Bauchibred](https://code4rena.com/@Bauchibred)\n 11. [falconhoof](https://code4rena.com/@falconhoof)\n 12. [0xAlix2](https://code4rena.com/@0xAlix2) ([a\\_kalout](https://code4rena.com/@a_kalout) and [ali\\_shehab](https://code4rena.com/@ali_shehab))\n 13. [santiellena](https://code4rena.com/@santiellena)\n 14. [FastChecker](https://code4rena.com/@FastChecker)\n 15. [Arz](https://code4rena.com/@Arz)\n 16. [14si2o\\_Flint](https://code4rena.com/@14si2", "vulnerable_code": " if (params.permitData.length > 0) {\n (ISignatureTransfer.PermitTransferFrom memory permit, bytes memory signature) =\n abi.decode(params.permitData, (ISignatureTransfer.PermitTransferFrom, bytes));\n permit2.permitTransferFrom(\n permit,\n ISignatureTransfer.SignatureTransferDetails(address(this), state.liquidatorCost),\n msg.sender,\n signature\n );\n } else {\n // take value from liquidator\n SafeERC20.safeTransferFrom(IERC20(asset), msg.sender, address(this), state.liquidatorCost);\n }", "fixed_code": "interface ISignatureTransfer is IEIP712 {\n /// @notice The token and amount details for a transfer signed in the permit transfer signature\n struct TokenPermissions {\n // ERC20 token address\n address token;\n // the maximum amount that can be spent\n uint256 amount;\n }\n\n /// @notice The signed permit message for a single token transfer\n struct PermitTransferFrom {\n TokenPermissions permitted;\n // a unique value for every token owner's signature to prevent signature replays\n uint256 nonce;\n // deadline on the permit signature\n uint256 deadline;\n }\n}", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/report.md", "collected_at": "2026-01-02T19:03:20.499501+00:00", "source_hash": "5589ff93f21a16501308c9c443ceee3fe5f5915e9ac613645ab3b5acd3b73e57", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " if (params.permitData.length > 0) {\n (ISignatureTransfer.PermitTransferFrom memory permit, bytes memory signature) =\n abi.decode(params.permitData, (ISignatureTransfer.PermitTransferFrom, bytes));\n permit2.permitTransferFrom(\n permit,\n ISignatureTransfer.SignatureTransferDetails(address(this), state.liquidatorCost),\n msg.sender,\n signature\n );\n } else {\n // take value from liquidator\n SafeERC20.safeTransferFrom(IERC20(asset), msg.sender, address(this), state.liquidatorCost);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "interface ISignatureTransfer is IEIP712 {\n /// @notice The token and amount details for a transfer signed in the permit transfer signature\n struct TokenPermissions {\n // ERC20 token address\n address token;\n // the maximum amount that can be spent\n uint256 amount;\n }\n\n /// @notice The signed permit message for a single token transfer\n struct PermitTransferFrom {\n TokenPermissions permitted;\n // a unique value for every token owner's signature to prevent signature replays\n uint256 nonce;\n // deadline on the permit signature\n uint256 deadline;\n }\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-asymmetry", "title": "0xkeesmark G", "severity_raw": "Low", "severity": "low", "description": "# [G-01]++i costs less gas than i++\n## Lines of code\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L71 \nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L84\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L113\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L140\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L147\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L171\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L191\n\n## Proof of Concept\nSaves 6 gas per loop.\n\n\n## Recommended Mitigation Steps\n```\n- i++\n+ ++i\n```\n\n\n# [G-02]Using unchecked\n## Lines of code\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L71 \nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L84\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L113\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L140\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L147\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L171\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L191\n\n## Proof of Concept\nUse unchecked for arithmetic where you are sure it won't over or underflow, saving gas costs for checks added from solidity v0.8.0.\n\nthe variable i cannot overflow because of the condition i < length.\n\n## Recommended Mitigation Steps\nConsider to use below.\n```\n- for (uint i = 0; i < derivativeCount; i++)\n+ for (uint i = 0; i < derivativeCount;)\n // something...\n+ unchecked {\n+\t i++;\n+\t }\n }\n```\n\n\n# [G-03] It costs more gas to initialize variables to zero than to let the default of zero be applied\n\n## L", "vulnerable_code": "- i++\n+ ++i", "fixed_code": "- for (uint i = 0; i < derivativeCount; i++)\n+ for (uint i = 0; i < derivativeCount;)\n // something...\n+ unchecked {\n+\t i++;\n+\t }\n }", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/0xkeesmark-G.md", "collected_at": "2026-01-02T18:17:44.057126+00:00", "source_hash": "558c9df7a81e6d37f4efff005c47e64c8bf5a7bc1082fa54206c0e52c771558a", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 148, "github_ref_count": 7, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "- i++\n+ ++i", "primary_code_language": "unknown", "primary_code_char_count": 11, "all_code_blocks": "// Code block 1 (unknown):\n- i++\n+ ++i\n\n// Code block 2 (unknown):\n- for (uint i = 0; i < derivativeCount; i++)\n+ for (uint i = 0; i < derivativeCount;)\n // something...\n+ unchecked {\n+\t i++;\n+\t }\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol#L71, SafEth.sol#L84, SafEth.sol#L113, SafEth.sol#L140, SafEth.sol#L147, SafEth.sol#L171, SafEth.sol#L191", "github_files_list": "SafEth.sol", "github_refs_count": 7, "vulnerable_code_actual": "- i++\n+ ++i", "has_vulnerable_code_snippet": true, "fixed_code_actual": "- for (uint i = 0; i < derivativeCount; i++)\n+ for (uint i = 0; i < derivativeCount;)\n // something...\n+ unchecked {\n+\t i++;\n+\t }\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "10-badger", "title": "tabriz Q", "severity_raw": "Critical", "severity": "critical", "description": "## [L-01] Stop Using Solidity's transfer() Now\n**Proof Of Concept**\nhttps://consensys.io/diligence/blog/2019/09/stop-using-soliditys-transfer-now/\n```\n collateral.transfer(address(receiver), amount);\n```\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/ActivePool.sol#L274C7-L274C56\n\n```\n collateral.transfer(feeRecipientAddress, fee);\n```\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/ActivePool.sol#L286C7-L286C55\n\n```\n function transfer(address recipient, uint256 amount) external override returns (bool) {\n```\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/EBTCToken.sol#L119C4-L119C92\n\n```\n emit Transfer(account, address(0), amount);\n```\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/EBTCToken.sol#L282C7-L282C52\n\n```\n ebtcToken.transfer(msg.sender, ebtcBal);\n }\n```\n\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/LeverageMacroBase.sol#L224C12-L225C10\n\n## [L-02] Keccak Constant values should used to immutable rather than constant\nThere is a difference between constant variables and immutable variables, and they should each be used in their appropriate contexts.\n\nWhile it doesn\u2019t save any gas because the compiler knows that developers often make this mistake, it\u2019s still best to use the right tool for the task at hand.\n\n```\n bytes32 constant FLASH_LOAN_SUCCESS = keccak256(\"ERC3156FlashBorrower.onFlashLoan\");\n```\n\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/LeverageMacroBase.sol#L37C3-L37C89\n\n```\n bytes32 constant DIAMOND_STORAGE_POSITION = keccak256(\"diamond.standard.diamond.storage\");\n```\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/SimplifiedDiamondLike.sol#L39C4-L39C95\n\n```\n bytes32 public constant FLASH_SUCCESS_VALUE = keccak256(\"ERC3156FlashBorrower.onFlashLoan\");\n```\n\nhttps://github.com/code-423n4", "vulnerable_code": " collateral.transfer(address(receiver), amount);", "fixed_code": " collateral.transfer(feeRecipientAddress, fee);", "recommendation": "", "category": "flash-loan", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/tabriz-Q.md", "collected_at": "2026-01-02T18:27:03.719004+00:00", "source_hash": "55a7f53608da02bd7a4a43f83b82c1d359103fde693bd5e933f5fd13eb2cbfcb", "code_block_count": 8, "solidity_block_count": 0, "total_code_chars": 539, "github_ref_count": 7, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "collateral.transfer(address(receiver), amount);", "primary_code_language": "unknown", "primary_code_char_count": 47, "all_code_blocks": "// Code block 1 (unknown):\ncollateral.transfer(address(receiver), amount);\n\n// Code block 2 (unknown):\ncollateral.transfer(feeRecipientAddress, fee);\n\n// Code block 3 (unknown):\nfunction transfer(address recipient, uint256 amount) external override returns (bool) {\n\n// Code block 4 (unknown):\nemit Transfer(account, address(0), amount);\n\n// Code block 5 (unknown):\nebtcToken.transfer(msg.sender, ebtcBal);\n }\n\n// Code block 6 (unknown):\nbytes32 constant FLASH_LOAN_SUCCESS = keccak256(\"ERC3156FlashBorrower.onFlashLoan\");\n\n// Code block 7 (unknown):\nbytes32 constant DIAMOND_STORAGE_POSITION = keccak256(\"diamond.standard.diamond.storage\");\n\n// Code block 8 (unknown):\nbytes32 public constant FLASH_SUCCESS_VALUE = keccak256(\"ERC3156FlashBorrower.onFlashLoan\");", "all_code_blocks_count": 8, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ActivePool.sol#L274-L7, ActivePool.sol#L286-L7, EBTCToken.sol#L119-L4, EBTCToken.sol#L282-L7, LeverageMacroBase.sol#L224-L12, LeverageMacroBase.sol#L37-L3, SimplifiedDiamondLike.sol#L39-L4", "github_files_list": "EBTCToken.sol, ActivePool.sol, LeverageMacroBase.sol, SimplifiedDiamondLike.sol", "github_refs_count": 7, "vulnerable_code_actual": " collateral.transfer(address(receiver), amount);", "has_vulnerable_code_snippet": true, "fixed_code_actual": " collateral.transfer(feeRecipientAddress, fee);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 14} {"source": "c4", "protocol": "09-ondo", "title": "JCK G", "severity_raw": "High", "severity": "high", "description": "\n# Gas Optimizations\n\n| Number | Issue | Instances | Gas |\n|--------|-------|-----------|-----|\n|[G-01]| Don\u2019t cache value if it is only used once | 5 | 450 |\n|[G-02]| Use assembly to check for address(0) | 12 | 72 |\n|[G-03]| Use hardcode address instead address(this) | 3 | |\n|[G-04]| Make 3 event parameters indexed when possible | 7 | 3500 |\n|[G-05]| Use assembly to write address storage values | 3 | 600 |\n|[G-06]| Assigning keccak operations to constant variables results in extra gas costs | 7 | |\n|[G-07]| A mapping is more efficient than an array | 1 | 248 |\n|[G-08]| Public Functions not called by they contract should be declear External | 10 | |\n|[G-09]| Save loop calls | 3 | |\n|[G-10]| Create immutable variable to avoid redundant external calls | 2 | |\n|[G-11]| Use assembly to validate msg.sender | 6 | 18 |\n|[G-12]| Cache calldata/memory pointers for complex types to avoid offset calculations | 2 | |\n|[G-13]| Combine events to save 2 Glogtopic (375 gas) | 3 | 1125 |\n|[G-14]| Internal/Private functions only called once can be inlined to save gas Gas saved: 40 | 1 | 40 |\n|[G-15]| bytes constants are more eficient than string constans | 19 | |\n|[G-16]| Amounts should be checked for 0 before calling a transfer | 6 | |\n|[G-17]| abi.encode() is less efficient than abi.encodePacked() | 3 | |\n|[G-18]| Do not calculate constants | 1 | |\n|[G-19]| Use assembly for loops | 6 | |\n|[G-20]| Avoid emitting storage values | 1 | |\n|[G-21]| Use assembly to make more efficient back-to-back calls | 1 | |\n|[G-22]| Use a do while loop instead of a for loop | 4 | |\n|[G-23]| State variables can be packed into fewer storage slots | 1 | 2100 |\n|[G-24]| Cache state variables outside of loop to avoid reading storage on every iteration | 1 | |\n|[G-25]| Use calldata instead of memory for function parameters that don\u2019t change | 3 | 900 |\n|[G-26]| Don\u2019t initialize variables with default value | 8 | 46 |\n|[G-27]| Use uint256(1)/uint256(2) instead for", "vulnerable_code": "file: contracts/bridge/DestinationBridge.sol\n\n322 function rescueTokens(address _token) external onlyOwner {\n uint256 balance = IRWALike(_token).balanceOf(address(this));\n IRWALike(_token).transfer(owner(), balance);\n }\n", "fixed_code": "file: contracts/bridge/DestinationBridge.sol\n \n337 function _mintIfThresholdMet(bytes32 txnHash) internal {\n bool thresholdMet = _checkThresholdMet(txnHash);\n Transaction memory txn = txnHashToTransaction[txnHash];\n if (thresholdMet) {\n _checkAndUpdateInstantMintLimit(txn.amount);\n if (!ALLOWLIST.isAllowed(txn.sender)) {\n ALLOWLIST.setAccountStatus(\n txn.sender,\n ALLOWLIST.getValidTermIndexes()[0],\n true\n );\n }\n TOKEN.mint(txn.sender, txn.amount);\n delete txnHashToTransaction[txnHash];\n emit BridgeCompleted(txn.sender, txn.amount);\n }\n }\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/JCK-G.md", "collected_at": "2026-01-02T18:25:30.408284+00:00", "source_hash": "55c069d5dee90ce7fe36b92b0a242b901cd6ea6981b56c6954f53abab1dfe574", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "file: contracts/bridge/DestinationBridge.sol\n\n322 function rescueTokens(address _token) external onlyOwner {\n uint256 balance = IRWALike(_token).balanceOf(address(this));\n IRWALike(_token).transfer(owner(), balance);\n }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "file: contracts/bridge/DestinationBridge.sol\n \n337 function _mintIfThresholdMet(bytes32 txnHash) internal {\n bool thresholdMet = _checkThresholdMet(txnHash);\n Transaction memory txn = txnHashToTransaction[txnHash];\n if (thresholdMet) {\n _checkAndUpdateInstantMintLimit(txn.amount);\n if (!ALLOWLIST.isAllowed(txn.sender)) {\n ALLOWLIST.setAccountStatus(\n txn.sender,\n ALLOWLIST.getValidTermIndexes()[0],\n true\n );\n }\n TOKEN.mint(txn.sender, txn.amount);\n delete txnHashToTransaction[txnHash];\n emit BridgeCompleted(txn.sender, txn.amount);\n }\n }\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-asymmetry", "title": "T1MOH Q", "severity_raw": "High", "severity": "high", "description": "## Mark SafEthStorage as abstract\nThis contract is dependent on SafEth.sol and provides read-only functionality, there is know sense in deploying it\n\n## Upgradeable contract is missing a __gap[50] storage variable to allow for new storage variables in later versions\nSee this link for a description of this storage variable. While some contracts may not currently be sub-classed, adding the variable now protects against forgetting to add it in the future.\n1 instance: SafEthStorage\n\n## Use Ownable2StepUpgradeable instead of OwnableUpgradeable contract for SafEth\nThere is another Openzeppelin Ownable contract (Ownable2StepUpgradeable.sol) has transferOwnership function, use is more secure due to 2-stage ownership transfer.\n\n## Lack of functions for sending randomly received ETH and ERC-20 (apart from the derivatives themselves)\nIn [WstEth.sol](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol#L56-L63) send balanceAfter - balanceBefore, but not all balance\n```solidity\n uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n uint256 balanceBefore = address(this).balance;\n IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);\n uint256 balanceAfter = address(this).balance;\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: balanceAfter - balanceBefore}(\n \"\"\n );\n```\nFor resque ERC-20 add\n```solidity\n uint256 balancePre = IERC20(STETH_TOKEN).balanceOf(address(this));\n IWStETH(WST_ETH).unwrap(_amount);\n uint256 balancePost = IERC20(STETH_TOKEN).balanceOf(address(this));\n uint256 stEthBal = balancePost - balancePre\n IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);\n```\n\nAnd by analogy provide resque for all derivatives\n\n## Unnecessary operation\n[Reth](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L215)\n```solidity\n else return (po", "vulnerable_code": " uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n uint256 balanceBefore = address(this).balance;\n IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);\n uint256 balanceAfter = address(this).balance;\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: balanceAfter - balanceBefore}(\n \"\"\n );", "fixed_code": " uint256 balancePre = IERC20(STETH_TOKEN).balanceOf(address(this));\n IWStETH(WST_ETH).unwrap(_amount);\n uint256 balancePost = IERC20(STETH_TOKEN).balanceOf(address(this));\n uint256 stEthBal = balancePost - balancePre\n IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/T1MOH-Q.md", "collected_at": "2026-01-02T18:18:36.441340+00:00", "source_hash": "55dac932099b4611071299cf8cc964a3faaee3fb173f2d4dc118622ee85e8026", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 694, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n uint256 balanceBefore = address(this).balance;\n IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);\n uint256 balanceAfter = address(this).balance;\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: balanceAfter - balanceBefore}(\n \"\"\n );", "primary_code_language": "solidity", "primary_code_char_count": 396, "all_code_blocks": "// Code block 1 (solidity):\nuint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n uint256 balanceBefore = address(this).balance;\n IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);\n uint256 balanceAfter = address(this).balance;\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: balanceAfter - balanceBefore}(\n \"\"\n );\n\n// Code block 2 (solidity):\nuint256 balancePre = IERC20(STETH_TOKEN).balanceOf(address(this));\n IWStETH(WST_ETH).unwrap(_amount);\n uint256 balancePost = IERC20(STETH_TOKEN).balanceOf(address(this));\n uint256 stEthBal = balancePost - balancePre\n IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n uint256 balanceBefore = address(this).balance;\n IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);\n uint256 balanceAfter = address(this).balance;\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: balanceAfter - balanceBefore}(\n \"\"\n );\n\nuint256 balancePre = IERC20(STETH_TOKEN).balanceOf(address(this));\n IWStETH(WST_ETH).unwrap(_amount);\n uint256 balancePost = IERC20(STETH_TOKEN).balanceOf(address(this));\n uint256 stEthBal = balancePost - balancePre\n IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);", "github_refs_formatted": "WstEth.sol#L56-L63, Reth.sol#L215", "github_files_list": "Reth.sol, WstEth.sol", "github_refs_count": 2, "vulnerable_code_actual": " uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n uint256 balanceBefore = address(this).balance;\n IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);\n uint256 balanceAfter = address(this).balance;\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: balanceAfter - balanceBefore}(\n \"\"\n );", "has_vulnerable_code_snippet": true, "fixed_code_actual": " uint256 balancePre = IERC20(STETH_TOKEN).balanceOf(address(this));\n IWStETH(WST_ETH).unwrap(_amount);\n uint256 balancePost = IERC20(STETH_TOKEN).balanceOf(address(this));\n uint256 stEthBal = balancePost - balancePre\n IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "07-amphora", "title": "0xSmartContract Q", "severity_raw": "Critical", "severity": "critical", "description": "### QA Report Issues List\n\n- [x] **Low 01** \u2192 The `execute()` function is payable and has no control of the `msg.value` value, this may cause the user to lose Money\n- [x] **Low 02** \u2192 Lack of price oracle output validation can result in wrong or stale price being used in UniswapV3OracleRelay.sol\n- [x] **Low 03** \u2192 There is a risk that a user with a high governance power will not be able to bid with `propose()`\n- [x] **Low 04** \u2192 Project Upgrade and Stop Scenario should be\n- [x] **Low 05** \u2192 Project has security risk from DAO attack using proposal\n- [x] **Low 06** \u2192 Migrating with \"_migrateCollateralsFrom()\"may result in loss of user funds\n- [x] **Low 07** \u2192 Missing Event for initialize\n- [x] **Low 08**\u2192 If onlyOwner runs `renounceOwnership()` in the `AMPHClaimer` contract, the contract may become unavailable\n- [x] **Non-Critical 09**\u2192 Unused Import\n\n### [Low-01] The `execute()` function is payable and has no control of the `msg.value` value, this may cause the user to lose Money\n\nThe `msg.value` value is sent to the contact with the `execute()` function.\n\nbut the following code is used to find the msg.value ;\n`this.executeTransaction{value: _proposal.values[_i]}(`\n\nAlso in the for loop the msg.value is sent too many times, it has no control over it\n\n\n```solidity\ncore/solidity/contracts/governance/GovernorCharlie.sol:\n 308 */\n 309: function execute(uint256 _proposalId) external payable override {\n 310: if (state(_proposalId) != ProposalState.Queued) revert GovernorCharlie_ProposalNotQueued();\n 311: Proposal storage _proposal = proposals[_proposalId];\n 312: _proposal.executed = true;\n 313: for (uint256 _i = 0; _i < _proposal.targets.length; _i++) {\n 314: this.executeTransaction{value: _proposal.values[_i]}(\n 315: _proposal.targets[_i], _proposal.values[_i], _proposal.signatures[_i], _proposal.calldatas[_i], _proposal.eta\n 316: );\n 317: }\n 318: emit ProposalExecutedIndexed(_proposalId);\n 319: emit Prop", "vulnerable_code": "core/solidity/contracts/governance/GovernorCharlie.sol:\n 308 */\n 309: function execute(uint256 _proposalId) external payable override {\n 310: if (state(_proposalId) != ProposalState.Queued) revert GovernorCharlie_ProposalNotQueued();\n 311: Proposal storage _proposal = proposals[_proposalId];\n 312: _proposal.executed = true;\n 313: for (uint256 _i = 0; _i < _proposal.targets.length; _i++) {\n 314: this.executeTransaction{value: _proposal.values[_i]}(\n 315: _proposal.targets[_i], _proposal.values[_i], _proposal.signatures[_i], _proposal.calldatas[_i], _proposal.eta\n 316: );\n 317: }\n 318: emit ProposalExecutedIndexed(_proposalId);\n 319: emit ProposalExecuted(_proposalId);\n 320: }\n", "fixed_code": "core/solidity/contracts/periphery/oracles/UniswapV3OracleRelay.sol:\n 78 \n 79: function _getPriceFromUniswap(uint32 _seconds, uint128 _amount) internal view virtual returns (uint256 _price) {\n 80: (int24 _arithmeticMeanTick,) = OracleLibrary.consult(address(POOL), _seconds);\n 81: _price = OracleLibrary.getQuoteAtTick(_arithmeticMeanTick, _amount, BASE_TOKEN, QUOTE_TOKEN);\n 82: }\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/0xSmartContract-Q.md", "collected_at": "2026-01-02T18:23:19.257471+00:00", "source_hash": "55ef1f92ab119b0a20bd36c3db5d4baaa1f30022b07587bb1e0f83d561b64a0d", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "core/solidity/contracts/governance/GovernorCharlie.sol:\n 308 */\n 309: function execute(uint256 _proposalId) external payable override {\n 310: if (state(_proposalId) != ProposalState.Queued) revert GovernorCharlie_ProposalNotQueued();\n 311: Proposal storage _proposal = proposals[_proposalId];\n 312: _proposal.executed = true;\n 313: for (uint256 _i = 0; _i < _proposal.targets.length; _i++) {\n 314: this.executeTransaction{value: _proposal.values[_i]}(\n 315: _proposal.targets[_i], _proposal.values[_i], _proposal.signatures[_i], _proposal.calldatas[_i], _proposal.eta\n 316: );\n 317: }\n 318: emit ProposalExecutedIndexed(_proposalId);\n 319: emit ProposalExecuted(_proposalId);\n 320: }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "core/solidity/contracts/periphery/oracles/UniswapV3OracleRelay.sol:\n 78 \n 79: function _getPriceFromUniswap(uint32 _seconds, uint128 _amount) internal view virtual returns (uint256 _price) {\n 80: (int24 _arithmeticMeanTick,) = OracleLibrary.consult(address(POOL), _seconds);\n 81: _price = OracleLibrary.getQuoteAtTick(_arithmeticMeanTick, _amount, BASE_TOKEN, QUOTE_TOKEN);\n 82: }\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "07-amphora", "title": "0xComfyCat Q", "severity_raw": "Medium", "severity": "medium", "description": "# [L-01] USDA `withdrawAll` doesn\u2019t take pending interest into account leaving user's interest unclaimed\n\nUSDA `withdrawAll` and `withdrawAllTo` doesn't really withdraw all of user balance. Since it calculate withdrawal balance before doing interest accrual, accrued interest won't be reflected in the calculated balance, leaving interest unclaimed.\n```\n function withdrawAll() external override returns (uint256 _susdWithdrawn) {\n uint256 _balance = this.balanceOf(_msgSender());\n _susdWithdrawn = _balance > reserveAmount ? reserveAmount : _balance; // @audit calculate withdrawal balance\n _withdraw(_susdWithdrawn, _msgSender()); // @audit accrue interest after balance is calculated\n }\n\n // @audit interest is accrued here after `_susdAmount` calculation\n function _withdraw(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n // ...\n }\n```\nhttps://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/USDA.sol#L126-L144\nhttps://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/USDA.sol#L147\n\n## Proof of Concept\nBased on project's e2e test. The setup is that someone was borrowing USDA and there is enough sUSD reserve to withdraw. `testWithdrawAllDustLeft` test demonstrated that `withdrawAll` isn't able to withdraw accrued interest, leaving it unclaimed.\n```\nimport {CommonE2EBase, IVault, console} from '@test/e2e/Common.sol';\n\ncontract WithdrawInterestPoC is CommonE2EBase {\n function setUp() public override {\n super.setUp();\n\n // Someone borrows\n bobVaultId = _mintVault(bob);\n vm.startPrank(bob);\n bobVault = IVault(vaultController.vaultIdVaultAddress(bobVaultId));\n weth.approve(address(bobVault), bobWETH);\n IVault(address(bobVault)).depositERC20(address(weth), bobWETH);\n uint256 _toBorrow = vaultController.vaultBorrowingPower(bobVaultId);\n vaultController.borrowUSDA(bobVaultId, uint192(_toBorrow / 2));\n vm.stopPrank();\n\n // Increase sUSD reserve\n vm", "vulnerable_code": " function withdrawAll() external override returns (uint256 _susdWithdrawn) {\n uint256 _balance = this.balanceOf(_msgSender());\n _susdWithdrawn = _balance > reserveAmount ? reserveAmount : _balance; // @audit calculate withdrawal balance\n _withdraw(_susdWithdrawn, _msgSender()); // @audit accrue interest after balance is calculated\n }\n\n // @audit interest is accrued here after `_susdAmount` calculation\n function _withdraw(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n // ...\n }", "fixed_code": "import {CommonE2EBase, IVault, console} from '@test/e2e/Common.sol';\n\ncontract WithdrawInterestPoC is CommonE2EBase {\n function setUp() public override {\n super.setUp();\n\n // Someone borrows\n bobVaultId = _mintVault(bob);\n vm.startPrank(bob);\n bobVault = IVault(vaultController.vaultIdVaultAddress(bobVaultId));\n weth.approve(address(bobVault), bobWETH);\n IVault(address(bobVault)).depositERC20(address(weth), bobWETH);\n uint256 _toBorrow = vaultController.vaultBorrowingPower(bobVaultId);\n vaultController.borrowUSDA(bobVaultId, uint192(_toBorrow / 2));\n vm.stopPrank();\n\n // Increase sUSD reserve\n vm.startPrank(andy);\n susd.approve(address(usdaToken), 100 ether);\n usdaToken.donate(100 ether);\n vm.stopPrank();\n }\n\n function testWithdrawAllDustLeft() public {\n uint256 _daveSUSDBefore = susd.balanceOf(dave);\n\n // User deposit sUSD, receive USDA\n _depositSUSD(dave, 100 ether);\n\n assertEq(susd.balanceOf(dave), _daveSUSDBefore - 100 ether);\n assertEq(usdaToken.balanceOf(dave), 100 ether);\n\n // Time travel\n vm.warp(block.timestamp + 1 days);\n\n // Withdraw\n vm.prank(dave);\n usdaToken.withdrawAll();\n // `withdrawAll` failed to account for pending interest thus user only received what they deposited\n assertEq(susd.balanceOf(dave), _daveSUSDBefore);\n // There is dust amount left unclaimed for user\n assertGt(usdaToken.balanceOf(dave), 0);\n }\n\n function testWithdrawAllNoDust() public {\n uint256 _daveSUSDBefore = susd.balanceOf(dave);\n\n // User deposit sUSD, receive USDA\n _depositSUSD(dave, 100 ether);\n\n assertEq(susd.balanceOf(dave), _daveSUSDBefore - 100 ether);\n assertEq(usdaToken.balanceOf(dave), 100 ether);\n\n // Time travel\n vm.warp(block.timestamp + 1 days);\n\n // This time we accrue interest before withdrawing\n vaultController.calculateInterest();\n\n // Withdraw\n vm.prank(dave);\n usdaToken.withdrawAll();\n // `withdrawAll` take pending interest into ac", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/0xComfyCat-Q.md", "collected_at": "2026-01-02T18:23:17.918316+00:00", "source_hash": "55f672aec9f402cc09b276e4fcb9aad988c5e402bef01d5b6ccf80c367f8397e", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 526, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function withdrawAll() external override returns (uint256 _susdWithdrawn) {\n uint256 _balance = this.balanceOf(_msgSender());\n _susdWithdrawn = _balance > reserveAmount ? reserveAmount : _balance; // @audit calculate withdrawal balance\n _withdraw(_susdWithdrawn, _msgSender()); // @audit accrue interest after balance is calculated\n }\n\n // @audit interest is accrued here after `_susdAmount` calculation\n function _withdraw(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n // ...\n }", "primary_code_language": "unknown", "primary_code_char_count": 526, "all_code_blocks": "// Code block 1 (unknown):\nfunction withdrawAll() external override returns (uint256 _susdWithdrawn) {\n uint256 _balance = this.balanceOf(_msgSender());\n _susdWithdrawn = _balance > reserveAmount ? reserveAmount : _balance; // @audit calculate withdrawal balance\n _withdraw(_susdWithdrawn, _msgSender()); // @audit accrue interest after balance is calculated\n }\n\n // @audit interest is accrued here after `_susdAmount` calculation\n function _withdraw(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n // ...\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "USDA.sol#L126-L144, USDA.sol#L147", "github_files_list": "USDA.sol", "github_refs_count": 2, "vulnerable_code_actual": " function withdrawAll() external override returns (uint256 _susdWithdrawn) {\n uint256 _balance = this.balanceOf(_msgSender());\n _susdWithdrawn = _balance > reserveAmount ? reserveAmount : _balance; // @audit calculate withdrawal balance\n _withdraw(_susdWithdrawn, _msgSender()); // @audit accrue interest after balance is calculated\n }\n\n // @audit interest is accrued here after `_susdAmount` calculation\n function _withdraw(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n // ...\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "import {CommonE2EBase, IVault, console} from '@test/e2e/Common.sol';\n\ncontract WithdrawInterestPoC is CommonE2EBase {\n function setUp() public override {\n super.setUp();\n\n // Someone borrows\n bobVaultId = _mintVault(bob);\n vm.startPrank(bob);\n bobVault = IVault(vaultController.vaultIdVaultAddress(bobVaultId));\n weth.approve(address(bobVault), bobWETH);\n IVault(address(bobVault)).depositERC20(address(weth), bobWETH);\n uint256 _toBorrow = vaultController.vaultBorrowingPower(bobVaultId);\n vaultController.borrowUSDA(bobVaultId, uint192(_toBorrow / 2));\n vm.stopPrank();\n\n // Increase sUSD reserve\n vm.startPrank(andy);\n susd.approve(address(usdaToken), 100 ether);\n usdaToken.donate(100 ether);\n vm.stopPrank();\n }\n\n function testWithdrawAllDustLeft() public {\n uint256 _daveSUSDBefore = susd.balanceOf(dave);\n\n // User deposit sUSD, receive USDA\n _depositSUSD(dave, 100 ether);\n\n assertEq(susd.balanceOf(dave), _daveSUSDBefore - 100 ether);\n assertEq(usdaToken.balanceOf(dave), 100 ether);\n\n // Time travel\n vm.warp(block.timestamp + 1 days);\n\n // Withdraw\n vm.prank(dave);\n usdaToken.withdrawAll();\n // `withdrawAll` failed to account for pending interest thus user only received what they deposited\n assertEq(susd.balanceOf(dave), _daveSUSDBefore);\n // There is dust amount left unclaimed for user\n assertGt(usdaToken.balanceOf(dave), 0);\n }\n\n function testWithdrawAllNoDust() public {\n uint256 _daveSUSDBefore = susd.balanceOf(dave);\n\n // User deposit sUSD, receive USDA\n _depositSUSD(dave, 100 ether);\n\n assertEq(susd.balanceOf(dave), _daveSUSDBefore - 100 ether);\n assertEq(usdaToken.balanceOf(dave), 100 ether);\n\n // Time travel\n vm.warp(block.timestamp + 1 days);\n\n // This time we accrue interest before withdrawing\n vaultController.calculateInterest();\n\n // Withdraw\n vm.prank(dave);\n usdaToken.withdrawAll();\n // `withdrawAll` take pending interest into ac", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "09-ondo", "title": "dd0x7e8 Q", "severity_raw": "Unknown", "severity": "unknown", "description": "The issue in the `wrap()` function of `rUSDY` contract lies in the event logs for the `Transfer` and `TransferShares` events. Currently, the USDY amount (`_USDYAmount`) is being used as the value for the shares in the event logs, which is incorrect. The accurate number of shares should be `_USDYAmount * BPS_DENOMINATOR`.\n\n```solidity=434\n function wrap(uint256 _USDYAmount) external whenNotPaused {\n require(_USDYAmount > 0, \"rUSDY: can't wrap zero USDY tokens\");\n _mintShares(msg.sender, _USDYAmount * BPS_DENOMINATOR);\n usdy.transferFrom(msg.sender, address(this), _USDYAmount);\n emit Transfer(address(0), msg.sender, getRUSDYByShares(_USDYAmount));\n emit TransferShares(address(0), msg.sender, _USDYAmount);\n }\n```\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L438\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L439\n\nTo address this issue, it's recommended to update the event logs to reflect the correct number of shares minted. Here's the corrected code:\n```solidity\nfunction wrap(uint256 _USDYAmount) external whenNotPaused {\n require(_USDYAmount > 0, \"rUSDY: can't wrap zero USDY tokens\");\n uint256 sharesToMint = _USDYAmount * BPS_DENOMINATOR; // Calculate the correct number of shares\n _mintShares(msg.sender, sharesToMint);\n usdy.transferFrom(msg.sender, address(this), _USDYAmount);\n emit Transfer(address(0), msg.sender, getRUSDYByShares(sharesToMint)); // Use sharesToMint instead of _USDYAmount\n emit TransferShares(address(0), msg.sender, sharesToMint); // Use sharesToMint instead of _USDYAmount\n}\n```", "vulnerable_code": "https://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L438\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L439\n\nTo address this issue, it's recommended to update the event logs to reflect the correct number of shares minted. Here's the corrected code:", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/dd0x7e8-Q.md", "collected_at": "2026-01-02T18:25:52.945780+00:00", "source_hash": "5628b376bd4be5230642a087a0a946b775ac95d1d03d8a9ee50175e5b8d363f5", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 378, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "https://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L438\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L439\n\nTo address this issue, it's recommended to update the event logs to reflect the correct number of shares minted. Here's the corrected code:", "primary_code_language": "unknown", "primary_code_char_count": 378, "all_code_blocks": "// Code block 1 (unknown):\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L438\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L439\n\nTo address this issue, it's recommended to update the event logs to reflect the correct number of shares minted. Here's the corrected code:", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "rUSDY.sol#L438, rUSDY.sol#L439", "github_files_list": "rUSDY.sol", "github_refs_count": 2, "vulnerable_code_actual": "https://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L438\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L439\n\nTo address this issue, it's recommended to update the event logs to reflect the correct number of shares minted. Here's the corrected code:", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "03-asymmetry", "title": "climber2002 Q", "severity_raw": "Unknown", "severity": "unknown", "description": "# Add require(_derivativeIndex < derivativeCount) validation in SafETH.adjustWeight\n\nIn [SafETH.adjustWeight](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L177) it doesn't make sense if _derivativeIndex >= derivativeCount. It's better to add such check in case of contract owner call this function with wrong params accidentally.\n\n```solidity\nfunction adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n ) external onlyOwner {\n require(_derivativeIndex < derivativeCount, \"Invalid _derivativeIndex\");\n ...\n}\n```\n\n# When unstake user can lose funds if _safEthAmount is extremely small\nIn [unstake](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L115-L116) it calculates `derivativeAmount`\n\n```solidity\nuint256 derivativeAmount = (derivatives[i].balance() *\n _safEthAmount) / safEthTotalSupply;\n```\n\nif `_safEthAmount` is extremely small, then derivativeAmount could be 0 for all derivatives. For example, for 3 derivatives with equal weights, if _safETHAmount is 2wei, then derivativeAmount is `1 * 2 / 3 = 0` for all derivatives.\n\n## Recommendation\nRevert if `ethAmountToWithdraw` is 0\n\n# Add a function previewUnstake\nCurrently `unstake` doesn't return the ETH amount that it's actually unstaked. It's better to have a `function previewUnstake(uint256 _safEthAmount) external view returns (uint256)` which can let the user know how much ETH he will receive for a given `_safEthAmount` before doing `unstake`", "vulnerable_code": "function adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n ) external onlyOwner {\n require(_derivativeIndex < derivativeCount, \"Invalid _derivativeIndex\");\n ...\n}", "fixed_code": "uint256 derivativeAmount = (derivatives[i].balance() *\n _safEthAmount) / safEthTotalSupply;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/climber2002-Q.md", "collected_at": "2026-01-02T18:19:00.264943+00:00", "source_hash": "565ac524e3cb75c0dbd77bdd321f73f294d6c1b8293bfeb4d2e9d52f282529df", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 296, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n ) external onlyOwner {\n require(_derivativeIndex < derivativeCount, \"Invalid _derivativeIndex\");\n ...\n}", "primary_code_language": "solidity", "primary_code_char_count": 190, "all_code_blocks": "// Code block 1 (solidity):\nfunction adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n ) external onlyOwner {\n require(_derivativeIndex < derivativeCount, \"Invalid _derivativeIndex\");\n ...\n}\n\n// Code block 2 (solidity):\nuint256 derivativeAmount = (derivatives[i].balance() *\n _safEthAmount) / safEthTotalSupply;", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n ) external onlyOwner {\n require(_derivativeIndex < derivativeCount, \"Invalid _derivativeIndex\");\n ...\n}\n\nuint256 derivativeAmount = (derivatives[i].balance() *\n _safEthAmount) / safEthTotalSupply;", "github_refs_formatted": "SafEth.sol#L177, SafEth.sol#L115-L116", "github_files_list": "SafEth.sol", "github_refs_count": 2, "vulnerable_code_actual": "function adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n ) external onlyOwner {\n require(_derivativeIndex < derivativeCount, \"Invalid _derivativeIndex\");\n ...\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "uint256 derivativeAmount = (derivatives[i].balance() *\n _safEthAmount) / safEthTotalSupply;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "02-ethos", "title": "Saintcode_ G", "severity_raw": "Medium", "severity": "medium", "description": "# Gas Optimizations\n\n## Consider marking constants as private\n\nConsider marking constant variables in storage as private to save gas (unless a constant variable should be easily accessible by another protocol or offchain logic).\n\n```js\ncontract GasTest is DSTest {\n Contract0 c0;\n Contract1 c1;\n \n function setUp() public {\n c0 = new Contract0();\n c1 = new Contract1();\n \n }\n function testGas() public view {\n uint256 a = 100;\n c0.addPublicConstant(a);\n c1.addPrivateConstant(a);\n \n }\n}\ncontract Contract0 {\n\n uint256 constant public x = 100;\n\n function addPublicConstant(uint256 a) external pure returns (uint256) {\n return a + x;\n }\n}\n\ncontract Contract1 {\n\n uint256 constant private x = 100;\n\n function addPrivateConstant(uint256 a) external pure returns (uint256) {\n return a +x;\n }\n}\n```\n\n### Gas Report\n\n```js\n\u256d\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n\u2502 src/test/GasTest.t.sol:Contract0 contract \u2506 \u2506 \u2506 \u2506 \u2506 \u2502\n\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561\n\u2502 Deployment Cost \u2506 Deployment Size \u2506 \u2506 \u2506 \u2506 \u2502\n\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n\u2502 92741 \u2506 495 \u2506 \u2506 \u2506 \u2506 \u2502\n\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n\u2502 Function Name \u2506 min \u2506 avg \u2506 median \u2506 max \u2506 # calls \u2502\n\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n\u2502 addPublicConstant \u2506 790 \u2506 790 \u2506 790 \u2506 790 \u2506 1 \u2502\n\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n\u256d\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500", "vulnerable_code": "contract GasTest is DSTest {\n Contract0 c0;\n Contract1 c1;\n \n function setUp() public {\n c0 = new Contract0();\n c1 = new Contract1();\n \n }\n function testGas() public view {\n uint256 a = 100;\n c0.addPublicConstant(a);\n c1.addPrivateConstant(a);\n \n }\n}\ncontract Contract0 {\n\n uint256 constant public x = 100;\n\n function addPublicConstant(uint256 a) external pure returns (uint256) {\n return a + x;\n }\n}\n\ncontract Contract1 {\n\n uint256 constant private x = 100;\n\n function addPrivateConstant(uint256 a) external pure returns (uint256) {\n return a +x;\n }\n}", "fixed_code": "\u256d\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n\u2502 src/test/GasTest.t.sol:Contract0 contract \u2506 \u2506 \u2506 \u2506 \u2506 \u2502\n\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561\n\u2502 Deployment Cost \u2506 Deployment Size \u2506 \u2506 \u2506 \u2506 \u2502\n\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n\u2502 92741 \u2506 495 \u2506 \u2506 \u2506 \u2506 \u2502\n\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n\u2502 Function Name \u2506 min \u2506 avg \u2506 median \u2506 max \u2506 # calls \u2502\n\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n\u2502 addPublicConstant \u2506 790 \u2506 790 \u2506 790 \u2506 790 \u2506 1 \u2502\n\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n\u256d\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n\u2502 src/test/GasTest.t.sol:Contract1 contract \u2506 \u2506 \u2506 \u2506 \u2506 \u2502\n\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561\n\u2502 Deployment Cost \u2506 Deployment Size \u2506 \u2506 \u2506 \u2506 \u2502\n\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n\u2502 83535 \u2506 449 \u2506 \u2506 \u2506 \u2506 \u2502\n\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n\u2502 Function Name \u2506 min \u2506 avg \u2506 median \u2506 max \u2506 # calls \u2502\n\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n\u2502 addPrivateConstant \u2506 768 \u2506 768 \u2506 768 \u2506 768 \u2506 1 \u2502\n\u2570\u2500\u2500\u2500\u2500", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/Saintcode_-G.md", "collected_at": "2026-01-02T18:16:37.812457+00:00", "source_hash": "5666ce524bf34c837f5229e6ebe87f225dd8f4ebf82190eef48476aabe470965", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 658, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "contract GasTest is DSTest {\n Contract0 c0;\n Contract1 c1;\n \n function setUp() public {\n c0 = new Contract0();\n c1 = new Contract1();\n \n }\n function testGas() public view {\n uint256 a = 100;\n c0.addPublicConstant(a);\n c1.addPrivateConstant(a);\n \n }\n}\ncontract Contract0 {\n\n uint256 constant public x = 100;\n\n function addPublicConstant(uint256 a) external pure returns (uint256) {\n return a + x;\n }\n}\n\ncontract Contract1 {\n\n uint256 constant private x = 100;\n\n function addPrivateConstant(uint256 a) external pure returns (uint256) {\n return a +x;\n }\n}", "primary_code_language": "js", "primary_code_char_count": 658, "all_code_blocks": "// Code block 1 (js):\ncontract GasTest is DSTest {\n Contract0 c0;\n Contract1 c1;\n \n function setUp() public {\n c0 = new Contract0();\n c1 = new Contract1();\n \n }\n function testGas() public view {\n uint256 a = 100;\n c0.addPublicConstant(a);\n c1.addPrivateConstant(a);\n \n }\n}\ncontract Contract0 {\n\n uint256 constant public x = 100;\n\n function addPublicConstant(uint256 a) external pure returns (uint256) {\n return a + x;\n }\n}\n\ncontract Contract1 {\n\n uint256 constant private x = 100;\n\n function addPrivateConstant(uint256 a) external pure returns (uint256) {\n return a +x;\n }\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "contract GasTest is DSTest {\n Contract0 c0;\n Contract1 c1;\n \n function setUp() public {\n c0 = new Contract0();\n c1 = new Contract1();\n \n }\n function testGas() public view {\n uint256 a = 100;\n c0.addPublicConstant(a);\n c1.addPrivateConstant(a);\n \n }\n}\ncontract Contract0 {\n\n uint256 constant public x = 100;\n\n function addPublicConstant(uint256 a) external pure returns (uint256) {\n return a + x;\n }\n}\n\ncontract Contract1 {\n\n uint256 constant private x = 100;\n\n function addPrivateConstant(uint256 a) external pure returns (uint256) {\n return a +x;\n }\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "\u256d\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n\u2502 src/test/GasTest.t.sol:Contract0 contract \u2506 \u2506 \u2506 \u2506 \u2506 \u2502\n\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561\n\u2502 Deployment Cost \u2506 Deployment Size \u2506 \u2506 \u2506 \u2506 \u2502\n\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n\u2502 92741 \u2506 495 \u2506 \u2506 \u2506 \u2506 \u2502\n\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n\u2502 Function Name \u2506 min \u2506 avg \u2506 median \u2506 max \u2506 # calls \u2502\n\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n\u2502 addPublicConstant \u2506 790 \u2506 790 \u2506 790 \u2506 790 \u2506 1 \u2502\n\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n\u256d\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n\u2502 src/test/GasTest.t.sol:Contract1 contract \u2506 \u2506 \u2506 \u2506 \u2506 \u2502\n\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561\n\u2502 Deployment Cost \u2506 Deployment Size \u2506 \u2506 \u2506 \u2506 \u2502\n\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n\u2502 83535 \u2506 449 \u2506 \u2506 \u2506 \u2506 \u2502\n\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n\u2502 Function Name \u2506 min \u2506 avg \u2506 median \u2506 max \u2506 # calls \u2502\n\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n\u2502 addPrivateConstant \u2506 768 \u2506 768 \u2506 768 \u2506 768 \u2506 1 \u2502\n\u2570\u2500\u2500\u2500\u2500", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "05-ajna", "title": "Bason G", "severity_raw": "Gas", "severity": "gas", "description": "## Gas Findings\n| Number |Issues Details |\n|:--------:|:-------|\n| [GAS-01] | Hash keccak256 variables off-chain to save gas\n\n***\n\n## |[GAS-01]| Hash keccak256 variables off-chain to save gas\n\nExtraordinaryFunding.sol\n```solidity\nbytes32 internal constant DESCRIPTION_PREFIX_HASH_EXTRAORDINARY = keccak256(bytes(\"Extraordinary Funding: \"));\n```\nStandardFunding.sol\n```solidity\nbytes32 internal constant DESCRIPTION_PREFIX_HASH_STANDARD = keccak256(bytes(\"Standard Funding: \"));\n```\nBoth of these values can be calculated off-chain and the values can be passed directly into the constructor to save gas\nfrom executing the keccak256 hashing function.\n\n*** ", "vulnerable_code": "bytes32 internal constant DESCRIPTION_PREFIX_HASH_EXTRAORDINARY = keccak256(bytes(\"Extraordinary Funding: \"));", "fixed_code": "bytes32 internal constant DESCRIPTION_PREFIX_HASH_STANDARD = keccak256(bytes(\"Standard Funding: \"));", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/Bason-G.md", "collected_at": "2026-01-02T18:20:56.059659+00:00", "source_hash": "5669f4215c8db762b19da10fb5ccd4cef537f5dbbdc678a60a218e8d92069e55", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 210, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "bytes32 internal constant DESCRIPTION_PREFIX_HASH_EXTRAORDINARY = keccak256(bytes(\"Extraordinary Funding: \"));", "primary_code_language": "solidity", "primary_code_char_count": 110, "all_code_blocks": "// Code block 1 (solidity):\nbytes32 internal constant DESCRIPTION_PREFIX_HASH_EXTRAORDINARY = keccak256(bytes(\"Extraordinary Funding: \"));\n\n// Code block 2 (solidity):\nbytes32 internal constant DESCRIPTION_PREFIX_HASH_STANDARD = keccak256(bytes(\"Standard Funding: \"));", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "bytes32 internal constant DESCRIPTION_PREFIX_HASH_EXTRAORDINARY = keccak256(bytes(\"Extraordinary Funding: \"));\n\nbytes32 internal constant DESCRIPTION_PREFIX_HASH_STANDARD = keccak256(bytes(\"Standard Funding: \"));", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "bytes32 internal constant DESCRIPTION_PREFIX_HASH_EXTRAORDINARY = keccak256(bytes(\"Extraordinary Funding: \"));", "has_vulnerable_code_snippet": true, "fixed_code_actual": "bytes32 internal constant DESCRIPTION_PREFIX_HASH_STANDARD = keccak256(bytes(\"Standard Funding: \"));", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5.31} {"source": "c4", "protocol": "09-ondo", "title": "turvy_fuzz Q", "severity_raw": "Medium", "severity": "medium", "description": "## Low - Conflicting specification to code implementation\n```solidity\nif (newStart < ranges[indexToModify - 1].end) revert InvalidRange();\n```\nThis above checks that newStart goes below the end time of the previous range therefore it ensures newStart is greater than it and not less than it. However, it conflicts with the statement [here](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/rwaOracles/RWADynamicOracle.sol#L211).\n\nRecommendation:\nEnsure the code implementation is compliant with the statement or vice versa\n\n## Low - Doesn't revert if numOfApprovers[i] == 0\n\nIt is assumed that all numOfApprovers of the set thresholds are > 0 and even uses this invariant to determine threshold was found in some function\n```\nif (txnToThresholdSet[txnHash].numberOfApprovalsNeeded == 0) {\n revert NoThresholdMatch();\n }\n```\nBut doesn't check this when setting thresholds\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/DestinationBridge.sol#L273\n\nRecommendation:\nAdd a revert check if numOfApprovers[i] == 0 when setting thresholds\n", "vulnerable_code": "if (newStart < ranges[indexToModify - 1].end) revert InvalidRange();", "fixed_code": "if (txnToThresholdSet[txnHash].numberOfApprovalsNeeded == 0) {\n revert NoThresholdMatch();\n }", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/turvy_fuzz-Q.md", "collected_at": "2026-01-02T18:26:19.375945+00:00", "source_hash": "567d91e84739b0b4eae492b7868824a5940273cd715856ed9599ed3c156ab8f7", "code_block_count": 2, "solidity_block_count": 1, "total_code_chars": 169, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "if (newStart < ranges[indexToModify - 1].end) revert InvalidRange();", "primary_code_language": "solidity", "primary_code_char_count": 68, "all_code_blocks": "// Code block 1 (solidity):\nif (newStart < ranges[indexToModify - 1].end) revert InvalidRange();\n\n// Code block 2 (unknown):\nif (txnToThresholdSet[txnHash].numberOfApprovalsNeeded == 0) {\n revert NoThresholdMatch();\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "if (newStart < ranges[indexToModify - 1].end) revert InvalidRange();", "github_refs_formatted": "RWADynamicOracle.sol#L211, DestinationBridge.sol#L273", "github_files_list": "RWADynamicOracle.sol, DestinationBridge.sol", "github_refs_count": 2, "vulnerable_code_actual": "if (newStart < ranges[indexToModify - 1].end) revert InvalidRange();", "has_vulnerable_code_snippet": true, "fixed_code_actual": "if (txnToThresholdSet[txnHash].numberOfApprovalsNeeded == 0) {\n revert NoThresholdMatch();\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7.15} {"source": "c4", "protocol": "01-biconomy", "title": "yosuke G", "severity_raw": "Medium", "severity": "medium", "description": "## [YO GAS-1] USE CUSTOM ERRORS RATHER THAN\u00a0REVERT()/REQUIRE()\u00a0STRINGS TO SAVE GAS\n\n### Handle\nyosuke\n\n## Vulnerability details\n### Impact\nCustom errors are available from solidity version 0.8.4. Custom errors save\u00a0~50 gas\u00a0each time they\u2019re hit by\u00a0avoiding having to allocate and store the revert string. Not defining the strings also save deployment gas.\n\n### Proof of Concept\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/BaseSmartAccount.sol#L74\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L77\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L83\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L89\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L110\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L121\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L128\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L167-L171\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L224\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L232\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L262\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L265\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.s", "vulnerable_code": "after", "fixed_code": "## [YO GAS-3] USING\u00a0BOOLS FOR STORAGE INCURS OVERHEAD\n\n### Handle\nyosuke\n\n## Vulnerability details\n### Impact\nBooleans are more expensive than uint256 or any type that takes up a full word because each write operation emits an extra SLOAD to first read the slot's contents, replace the bits taken up by the boolean, and then write back. This is the compiler's defense against contract upgrades and pointer aliasing, and it cannot be disabled.\n\n### Proof of Concept\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/BaseSmartAccount.sol#L120\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L197\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L322\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L489\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L545\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/interfaces/IERC165.sol#L14\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/base/ModuleManager.sol#L66\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/base/ModuleManager.sol#L85\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/base/ModuleManager.sol#L105\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/common/SecuredTokenTransfer.sol#L14\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccountFactory.sol#L15\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/base/Execut", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/yosuke-G.md", "collected_at": "2026-01-02T18:14:15.937255+00:00", "source_hash": "56877a3bd322130fab7cb5f3a4c316fa6c6bd48d4a689ce2e67ecdb71e42bb6e", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 23, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "BaseSmartAccount.sol#L74, SmartAccount.sol#L77, SmartAccount.sol#L83, SmartAccount.sol#L89, SmartAccount.sol#L110, SmartAccount.sol#L121, SmartAccount.sol#L128, SmartAccount.sol#L167-L171, SmartAccount.sol#L224, SmartAccount.sol#L232, SmartAccount.sol#L262, SmartAccount.sol#L265, BaseSmartAccount.sol#L120, SmartAccount.sol#L197, SmartAccount.sol#L322, SmartAccount.sol#L489, SmartAccount.sol#L545, IERC165.sol#L14, ModuleManager.sol#L66, ModuleManager.sol#L85, ModuleManager.sol#L105, SecuredTokenTransfer.sol#L14, SmartAccountFactory.sol#L15", "github_files_list": "IERC165.sol, BaseSmartAccount.sol, SmartAccountFactory.sol, ModuleManager.sol, SmartAccount.sol, SecuredTokenTransfer.sol", "github_refs_count": 23, "vulnerable_code_actual": "after", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## [YO GAS-3] USING\u00a0BOOLS FOR STORAGE INCURS OVERHEAD\n\n### Handle\nyosuke\n\n## Vulnerability details\n### Impact\nBooleans are more expensive than uint256 or any type that takes up a full word because each write operation emits an extra SLOAD to first read the slot's contents, replace the bits taken up by the boolean, and then write back. This is the compiler's defense against contract upgrades and pointer aliasing, and it cannot be disabled.\n\n### Proof of Concept\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/BaseSmartAccount.sol#L120\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L197\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L322\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L489\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L545\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/interfaces/IERC165.sol#L14\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/base/ModuleManager.sol#L66\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/base/ModuleManager.sol#L85\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/base/ModuleManager.sol#L105\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/common/SecuredTokenTransfer.sol#L14\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccountFactory.sol#L15\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/base/Execut", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "02-ai-arena", "title": "report", "severity_raw": "Critical", "severity": "critical", "description": "---\nsponsor: \"AI Arena\"\nslug: \"2024-02-ai-arena\"\ndate: \"2024-05-14\"\ntitle: \"AI Arena\"\nfindings: \"https://github.com/code-423n4/2024-02-ai-arena-findings/issues\"\ncontest: 328\n---\n\n# Overview\n\n## About C4\n\nCode4rena (C4) is an open organization consisting of security researchers, auditors, developers, and individuals with domain expertise in smart contracts.\n\nA C4 audit is an event in which community participants, referred to as Wardens, review, audit, or analyze smart contract logic in exchange for a bounty provided by sponsoring projects.\n\nDuring the audit outlined in this document, C4 conducted an analysis of the AI Arena smart contract system written in Solidity. The audit took place between February 9\u2014February 21 2024.\n\nFollowing the C4 audit, 3 wardens ([d3e4](https://code4rena.com/@d3e4), [fnanni](https://code4rena.com/@fnanni), and [niser93](https://code4rena.com/@niser93)) reviewed the mitigations for all identified issues; the [mitigation review report](#mitigation-review) is appended below the audit report.\n\n## Wardens\n\n299 Wardens contributed reports to AI Arena:\n\n 1. [fnanni](https://code4rena.com/@fnanni)\n 2. [d3e4](https://code4rena.com/@d3e4)\n 3. [niser93](https://code4rena.com/@niser93)\n 4. [haxatron](https://code4rena.com/@haxatron)\n 5. [BARW](https://code4rena.com/@BARW) ([BenRai](https://code4rena.com/@BenRai) and [albertwh1te](https://code4rena.com/@albertwh1te))\n 6. [juancito](https://code4rena.com/@juancito)\n 7. [DanielArmstrong](https://code4rena.com/@DanielArmstrong)\n 8. [0xDetermination](https://code4rena.com/@0xDetermination)\n 9. [merlinboii](https://code4rena.com/@merlinboii)\n 10. [0x11singh99](https://code4rena.com/@0x11singh99)\n 11. [MrPotatoMagic](https://code4rena.com/@MrPotatoMagic)\n 12. [klau5](https://code4rena.com/@klau5)\n 13. [MidgarAudits](https://code4rena.com/@MidgarAudits) ([vangrim](https://code4rena.com/@vangrim) and [EVDoc](https://code4rena.com/@EVDoc))\n 14. [Timenov](https://code4rena.com/@Timenov)\n 15. [lil", "vulnerable_code": "Place the PoC into `test/RankedBattle.t.sol`, and execute with\n\n forge test --match-test testExploitTransferStakedFighterAndPlay\n\n
\n\n### Impact 2: Another fighter can't win, game server unable to commit\n\n
\n", "fixed_code": "Place the PoC into `test/RankedBattle.t.sol`, and execute with\n\n forge test --match-test testExploitTransferStakeAtRiskFighterAndSpoilOtherPlayer\n\n
\n\n### Recommended Mitigation Steps\n\nRemove the incomplete checks in the inherited functions `transferFrom()` and `safeTransferFrom()` of `FighterFarm` contract, and instead to enforce the transferability restriction via the `_beforeTokenTransfer()` hook, which applies equally to all token transfers, as illustrated below.\n\n
\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/report.md", "collected_at": "2026-01-02T19:02:49.233787+00:00", "source_hash": "568b9c0691fde7ab6f3077685f9e58176e9120d265439c5777e69cc246bb28db", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "Place the PoC into `test/RankedBattle.t.sol`, and execute with\n\n forge test --match-test testExploitTransferStakedFighterAndPlay\n\n
\n\n### Impact 2: Another fighter can't win, game server unable to commit\n\n
\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "Place the PoC into `test/RankedBattle.t.sol`, and execute with\n\n forge test --match-test testExploitTransferStakeAtRiskFighterAndSpoilOtherPlayer\n\n
\n\n### Recommended Mitigation Steps\n\nRemove the incomplete checks in the inherited functions `transferFrom()` and `safeTransferFrom()` of `FighterFarm` contract, and instead to enforce the transferability restriction via the `_beforeTokenTransfer()` hook, which applies equally to all token transfers, as illustrated below.\n\n
\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "04-caviar", "title": "jnrlouis Q", "severity_raw": "Critical", "severity": "critical", "description": "\n## Summary\n\n## Non Critical Issues\n\n\n| | Issue | Instances |\n| --- | --- | ---|\n| 1 | Functions not called internally should be marked `external` | 6 |\n| 2 | Return value from `transfer` is ignored | 3 |\n| 3 | Input Validation not done | 2 |\n\n## Non Critical Issues\n\n# [NC-01] Functions not called internally should be marked `external`\n\n*There are 6 instances of this issue:*\n\n```javascript\nFile: src/Factory.sol\n\n129 function setPrivatePoolMetadata(address _privatePoolMetadata) public onlyOwner\n\n135 function setPrivatePoolImplementation(address _privatePoolImplementation) public onlyOwner \n\n141 function setProtocolFeeRate(uint16 _protocolFeeRate) public onlyOwner\n \n148 function withdraw(address token, uint256 amount) public onlyOwner\n\n```\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/Factory.sol#L129\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/Factory.sol#L135\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/Factory.sol#L141\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/Factory.sol#L148\n\n```javascript\nFile: src/PrivatePool.sol\n\n514 function withdraw(address _nft, uint256[] calldata tokenIds, address token, uint256 tokenAmount) public onlyOwner\n\n742 function price() public view returns (uint256)\n\n```\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L514\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L742\n\n# [NC-02] Return value from `transfer` is ignored\n\nNot all IERC20 implementations revert() when there\u2019s a failure in the `transfer()`. The function signature has a boolean return value and they indicate errors that way instead. By not checking the return value, operations that should have marked as failed, may potentiall", "vulnerable_code": "File: src/Factory.sol\n\n129 function setPrivatePoolMetadata(address _privatePoolMetadata) public onlyOwner\n\n135 function setPrivatePoolImplementation(address _privatePoolImplementation) public onlyOwner \n\n141 function setProtocolFeeRate(uint16 _protocolFeeRate) public onlyOwner\n \n148 function withdraw(address token, uint256 amount) public onlyOwner\n", "fixed_code": "File: src/PrivatePool.sol\n\n514 function withdraw(address _nft, uint256[] calldata tokenIds, address token, uint256 tokenAmount) public onlyOwner\n\n742 function price() public view returns (uint256)\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/jnrlouis-Q.md", "collected_at": "2026-01-02T18:20:37.263149+00:00", "source_hash": "56e2c03f601e2b325ba3bdbe8c14b1f6aadff3bfbd376c027e5b6b45fccecd3c", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 570, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: src/Factory.sol\n\n129 function setPrivatePoolMetadata(address _privatePoolMetadata) public onlyOwner\n\n135 function setPrivatePoolImplementation(address _privatePoolImplementation) public onlyOwner \n\n141 function setProtocolFeeRate(uint16 _protocolFeeRate) public onlyOwner\n \n148 function withdraw(address token, uint256 amount) public onlyOwner", "primary_code_language": "javascript", "primary_code_char_count": 368, "all_code_blocks": "// Code block 1 (javascript):\nFile: src/Factory.sol\n\n129 function setPrivatePoolMetadata(address _privatePoolMetadata) public onlyOwner\n\n135 function setPrivatePoolImplementation(address _privatePoolImplementation) public onlyOwner \n\n141 function setProtocolFeeRate(uint16 _protocolFeeRate) public onlyOwner\n \n148 function withdraw(address token, uint256 amount) public onlyOwner\n\n// Code block 2 (javascript):\nFile: src/PrivatePool.sol\n\n514 function withdraw(address _nft, uint256[] calldata tokenIds, address token, uint256 tokenAmount) public onlyOwner\n\n742 function price() public view returns (uint256)", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Factory.sol#L129, Factory.sol#L135, Factory.sol#L141, Factory.sol#L148, PrivatePool.sol#L514, PrivatePool.sol#L742", "github_files_list": "PrivatePool.sol, Factory.sol", "github_refs_count": 6, "vulnerable_code_actual": "File: src/Factory.sol\n\n129 function setPrivatePoolMetadata(address _privatePoolMetadata) public onlyOwner\n\n135 function setPrivatePoolImplementation(address _privatePoolImplementation) public onlyOwner \n\n141 function setProtocolFeeRate(uint16 _protocolFeeRate) public onlyOwner\n \n148 function withdraw(address token, uint256 amount) public onlyOwner\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: src/PrivatePool.sol\n\n514 function withdraw(address _nft, uint256[] calldata tokenIds, address token, uint256 tokenAmount) public onlyOwner\n\n742 function price() public view returns (uint256)\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "02-ai-arena", "title": "ADM Q", "severity_raw": "Medium", "severity": "medium", "description": "#### [L01] addAttributeProbabilities should be called when generation is incremented. (otherwise reroll may have no stats)\n###### Summary:\nWhen FighterFarm#incrementGeneration() is called both the generation and the maxRerollsAllowed are incremented. However if a user decides to utilise this reroll before an admin has the chance to call addAttributeProbabilities for the new generation then the call to AiArenaHelper#getAttributeProbabilities will return the default values of 0.\n###### LoC:\n[FighterFarm.sol#L129-L134](https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L129-L134) \n[FighterFarm.sol#L383-L388](https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L383-L388) \n[AiArenaHelper.sol#L131-L139](https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/AiArenaHelper.sol#L131-L139)\n###### Recommendation:\nI recommend adding a call to AiArenaHelper#addAttributeProbabilities in FighterFarm#incrementGeneration to update the attribute the probabilities for the new generation at the same time it is created.\n```solidity\nfunction incrementGeneration(uint8 fighterType, uint8[][] memory probabilities)) external returns (uint8) {\n\trequire(msg.sender == _ownerAddress);\n\tgeneration[fighterType] += 1; \n\t_aiArenaHelperInstance.addAttributeProbabilities(generation[fighterType], probabilities)\n\tmaxRerollsAllowed[fighterType] += 1;\n\treturn generation[fighterType];\n}\n```\n\n#### [L02] claimFighters is vulnerable to cross chain replay attacks due to no chain.id in the msgHash.\n###### Summary:\nIf AI Arena is only ever deployed on Arbitrum this is a non issue, however if the protocol team ever decides to deploy on other networks as well users will be able to user the Arbitrum signatures to claim a bunch of fighters instantly.\n###### LoC:\n[FighterFarm.sol#L199-L205](https://github.com/code-423n4/2024-02-ai-arena/blob/f2952187a8afc", "vulnerable_code": "function incrementGeneration(uint8 fighterType, uint8[][] memory probabilities)) external returns (uint8) {\n\trequire(msg.sender == _ownerAddress);\n\tgeneration[fighterType] += 1; \n\t_aiArenaHelperInstance.addAttributeProbabilities(generation[fighterType], probabilities)\n\tmaxRerollsAllowed[fighterType] += 1;\n\treturn generation[fighterType];\n}", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/ADM-Q.md", "collected_at": "2026-01-02T19:02:12.912902+00:00", "source_hash": "56fb47f578fba5ad44d1b74756ab5e27de9345fbe3629cb766f22dbc8a44923f", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 341, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function incrementGeneration(uint8 fighterType, uint8[][] memory probabilities)) external returns (uint8) {\n\trequire(msg.sender == _ownerAddress);\n\tgeneration[fighterType] += 1; \n\t_aiArenaHelperInstance.addAttributeProbabilities(generation[fighterType], probabilities)\n\tmaxRerollsAllowed[fighterType] += 1;\n\treturn generation[fighterType];\n}", "primary_code_language": "solidity", "primary_code_char_count": 341, "all_code_blocks": "// Code block 1 (solidity):\nfunction incrementGeneration(uint8 fighterType, uint8[][] memory probabilities)) external returns (uint8) {\n\trequire(msg.sender == _ownerAddress);\n\tgeneration[fighterType] += 1; \n\t_aiArenaHelperInstance.addAttributeProbabilities(generation[fighterType], probabilities)\n\tmaxRerollsAllowed[fighterType] += 1;\n\treturn generation[fighterType];\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function incrementGeneration(uint8 fighterType, uint8[][] memory probabilities)) external returns (uint8) {\n\trequire(msg.sender == _ownerAddress);\n\tgeneration[fighterType] += 1; \n\t_aiArenaHelperInstance.addAttributeProbabilities(generation[fighterType], probabilities)\n\tmaxRerollsAllowed[fighterType] += 1;\n\treturn generation[fighterType];\n}", "github_refs_formatted": "FighterFarm.sol#L129-L134, FighterFarm.sol#L383-L388, AiArenaHelper.sol#L131-L139", "github_files_list": "FighterFarm.sol, AiArenaHelper.sol", "github_refs_count": 3, "vulnerable_code_actual": "function incrementGeneration(uint8 fighterType, uint8[][] memory probabilities)) external returns (uint8) {\n\trequire(msg.sender == _ownerAddress);\n\tgeneration[fighterType] += 1; \n\t_aiArenaHelperInstance.addAttributeProbabilities(generation[fighterType], probabilities)\n\tmaxRerollsAllowed[fighterType] += 1;\n\treturn generation[fighterType];\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "08-dopex", "title": "Shubham G", "severity_raw": "Medium", "severity": "medium", "description": "## Gas Optimization\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [G-01](#G-01) | Successive sorting of token addresses wastes gas | 1 |\n| [G-02](#G-02) | Checking the value of `supply` early on can prevent execution of external calls & calculations | 1 |\n\n\n## [G-01] Successive sorting of token addresses wastes gas\n\nIn 'reLP()', first the token addresses are sorted by calling 'UniswapV2Library.sortTokens()' & then the reserves are calculated by calling 'UniswapV2Library.getReserves()'.\n\n```solidity\nFile: contracts/reLP/ReLPContract\n\n function reLP(uint256 _amount) external onlyRole(RDPXV2CORE_ROLE) {\n // get the pool reserves\n (address tokenASorted, address tokenBSorted) = UniswapV2Library.sortTokens(\n addresses.tokenA,\n addresses.tokenB\n );\n (uint256 reserveA, uint256 reserveB) = UniswapV2Library.getReserves(\n addresses.ammFactory,\n tokenASorted,\n tokenBSorted\n );\n .................\n```\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/reLP/ReLPContract.sol#L202-L212\n\nBut in the 'UniswapV2Library' we can see that the 'getReserves()' already calls the 'sortTokens' function.\n\n```solidity\nFile: UniswapV2Library.sol\n\n function getReserves(\n address factory,\n address tokenA,\n address tokenB\n ) internal view returns (uint256 reserveA, uint256 reserveB) {\n (address token0, ) = sortTokens(tokenA, tokenB); --------> Sorting already happens here\n (uint256 reserve0, uint256 reserve1, ) = IUniswapV2Pair(\n pairFor(factory, tokenA, tokenB)\n ).getReserves();\n (reserveA, reserveB) = tokenA == token0\n ? (reserve0, reserve1)\n : (reserve1, reserve0);\n }\n```\n\nThus sorting of the same token addresses occur twice inside the same function wasting gas.\n\n## [G-02] Checking the value of `supply` early on can prevent execution of external calls & calculations\n\nThe value of 'supply' is checked at the end of the function after performing the necessary calculations. But instead if we c", "vulnerable_code": "File: contracts/reLP/ReLPContract\n\n function reLP(uint256 _amount) external onlyRole(RDPXV2CORE_ROLE) {\n // get the pool reserves\n (address tokenASorted, address tokenBSorted) = UniswapV2Library.sortTokens(\n addresses.tokenA,\n addresses.tokenB\n );\n (uint256 reserveA, uint256 reserveB) = UniswapV2Library.getReserves(\n addresses.ammFactory,\n tokenASorted,\n tokenBSorted\n );\n .................", "fixed_code": "File: UniswapV2Library.sol\n\n function getReserves(\n address factory,\n address tokenA,\n address tokenB\n ) internal view returns (uint256 reserveA, uint256 reserveB) {\n (address token0, ) = sortTokens(tokenA, tokenB); --------> Sorting already happens here\n (uint256 reserve0, uint256 reserve1, ) = IUniswapV2Pair(\n pairFor(factory, tokenA, tokenB)\n ).getReserves();\n (reserveA, reserveB) = tokenA == token0\n ? (reserve0, reserve1)\n : (reserve1, reserve0);\n }", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/Shubham-G.md", "collected_at": "2026-01-02T18:25:05.848256+00:00", "source_hash": "56fd4311de8eae0bce02552df9ecc7cdc698f16ccbe908c163ddeab5d5090cd2", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 958, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/reLP/ReLPContract\n\n function reLP(uint256 _amount) external onlyRole(RDPXV2CORE_ROLE) {\n // get the pool reserves\n (address tokenASorted, address tokenBSorted) = UniswapV2Library.sortTokens(\n addresses.tokenA,\n addresses.tokenB\n );\n (uint256 reserveA, uint256 reserveB) = UniswapV2Library.getReserves(\n addresses.ammFactory,\n tokenASorted,\n tokenBSorted\n );\n .................", "primary_code_language": "solidity", "primary_code_char_count": 438, "all_code_blocks": "// Code block 1 (solidity):\nFile: contracts/reLP/ReLPContract\n\n function reLP(uint256 _amount) external onlyRole(RDPXV2CORE_ROLE) {\n // get the pool reserves\n (address tokenASorted, address tokenBSorted) = UniswapV2Library.sortTokens(\n addresses.tokenA,\n addresses.tokenB\n );\n (uint256 reserveA, uint256 reserveB) = UniswapV2Library.getReserves(\n addresses.ammFactory,\n tokenASorted,\n tokenBSorted\n );\n .................\n\n// Code block 2 (solidity):\nFile: UniswapV2Library.sol\n\n function getReserves(\n address factory,\n address tokenA,\n address tokenB\n ) internal view returns (uint256 reserveA, uint256 reserveB) {\n (address token0, ) = sortTokens(tokenA, tokenB); --------> Sorting already happens here\n (uint256 reserve0, uint256 reserve1, ) = IUniswapV2Pair(\n pairFor(factory, tokenA, tokenB)\n ).getReserves();\n (reserveA, reserveB) = tokenA == token0\n ? (reserve0, reserve1)\n : (reserve1, reserve0);\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: contracts/reLP/ReLPContract\n\n function reLP(uint256 _amount) external onlyRole(RDPXV2CORE_ROLE) {\n // get the pool reserves\n (address tokenASorted, address tokenBSorted) = UniswapV2Library.sortTokens(\n addresses.tokenA,\n addresses.tokenB\n );\n (uint256 reserveA, uint256 reserveB) = UniswapV2Library.getReserves(\n addresses.ammFactory,\n tokenASorted,\n tokenBSorted\n );\n .................\n\nFile: UniswapV2Library.sol\n\n function getReserves(\n address factory,\n address tokenA,\n address tokenB\n ) internal view returns (uint256 reserveA, uint256 reserveB) {\n (address token0, ) = sortTokens(tokenA, tokenB); --------> Sorting already happens here\n (uint256 reserve0, uint256 reserve1, ) = IUniswapV2Pair(\n pairFor(factory, tokenA, tokenB)\n ).getReserves();\n (reserveA, reserveB) = tokenA == token0\n ? (reserve0, reserve1)\n : (reserve1, reserve0);\n }", "github_refs_formatted": "ReLPContract.sol#L202-L212", "github_files_list": "ReLPContract.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: contracts/reLP/ReLPContract\n\n function reLP(uint256 _amount) external onlyRole(RDPXV2CORE_ROLE) {\n // get the pool reserves\n (address tokenASorted, address tokenBSorted) = UniswapV2Library.sortTokens(\n addresses.tokenA,\n addresses.tokenB\n );\n (uint256 reserveA, uint256 reserveB) = UniswapV2Library.getReserves(\n addresses.ammFactory,\n tokenASorted,\n tokenBSorted\n );\n .................", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: UniswapV2Library.sol\n\n function getReserves(\n address factory,\n address tokenA,\n address tokenB\n ) internal view returns (uint256 reserveA, uint256 reserveB) {\n (address token0, ) = sortTokens(tokenA, tokenB); --------> Sorting already happens here\n (uint256 reserve0, uint256 reserve1, ) = IUniswapV2Pair(\n pairFor(factory, tokenA, tokenB)\n ).getReserves();\n (reserveA, reserveB) = tokenA == token0\n ? (reserve0, reserve1)\n : (reserve1, reserve0);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "03-asymmetry", "title": "alejandrocovrr Q", "severity_raw": "Low", "severity": "low", "description": "# Withdraw function on WstEth can be improved \n\nOn [/contracts/SafEth/derivatives/WstEth.sol#L56](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol#L56) there are some refactors that can be applied to improve both code quality and security. \n\nThe current code is: \n\n```\nfunction withdraw(uint256 _amount) external onlyOwner {\n IWStETH(WST_ETH).unwrap(_amount);\n uint256 stEthBal = IERC20(STETH_TOKEN).balanceOf(address(this));\n IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);\n uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n}\n```\n\nHas some points that could be improved, the following refactored code shows it: \n\n```\nfunction withdraw(uint256 _amount) external onlyOwner {\n require(_amount > 0 && _amount <= address(this).balance, \"Invalid amount\");\n IWStETH(WST_ETH).unwrap(_amount);\n uint256 stEthBal = IERC20(STETH_TOKEN).balanceOf(address(this));\n IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);\n uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);\n // solhint-disable-next-line\n payable(msg.sender).transfer(address(this).balance);\n}\n```\n\n**1. Use require() for input validation:** Currently, there is no validation on the _amount parameter. It would be better to use a require() statement to validate that the _amount parameter is greater than 0 and less than the balance of the contract.\n**2. Use transfer() instead of call():** The current code uses call() to send Ether to the owner of the contract. However, transfer() is a more secure and gas-efficient way to transfer Ether.", "vulnerable_code": "function withdraw(uint256 _amount) external onlyOwner {\n IWStETH(WST_ETH).unwrap(_amount);\n uint256 stEthBal = IERC20(STETH_TOKEN).balanceOf(address(this));\n IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);\n uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n}", "fixed_code": "function withdraw(uint256 _amount) external onlyOwner {\n require(_amount > 0 && _amount <= address(this).balance, \"Invalid amount\");\n IWStETH(WST_ETH).unwrap(_amount);\n uint256 stEthBal = IERC20(STETH_TOKEN).balanceOf(address(this));\n IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);\n uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);\n // solhint-disable-next-line\n payable(msg.sender).transfer(address(this).balance);\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/alejandrocovrr-Q.md", "collected_at": "2026-01-02T18:18:45.888499+00:00", "source_hash": "57409842db257f33eb6c42a58f3ea16624afcd6a73ec1b96817f8b66d4566775", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 1058, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function withdraw(uint256 _amount) external onlyOwner {\n IWStETH(WST_ETH).unwrap(_amount);\n uint256 stEthBal = IERC20(STETH_TOKEN).balanceOf(address(this));\n IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);\n uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n}", "primary_code_language": "unknown", "primary_code_char_count": 528, "all_code_blocks": "// Code block 1 (unknown):\nfunction withdraw(uint256 _amount) external onlyOwner {\n IWStETH(WST_ETH).unwrap(_amount);\n uint256 stEthBal = IERC20(STETH_TOKEN).balanceOf(address(this));\n IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);\n uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n}\n\n// Code block 2 (unknown):\nfunction withdraw(uint256 _amount) external onlyOwner {\n require(_amount > 0 && _amount <= address(this).balance, \"Invalid amount\");\n IWStETH(WST_ETH).unwrap(_amount);\n uint256 stEthBal = IERC20(STETH_TOKEN).balanceOf(address(this));\n IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);\n uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);\n // solhint-disable-next-line\n payable(msg.sender).transfer(address(this).balance);\n}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "WstEth.sol#L56", "github_files_list": "WstEth.sol", "github_refs_count": 1, "vulnerable_code_actual": "function withdraw(uint256 _amount) external onlyOwner {\n IWStETH(WST_ETH).unwrap(_amount);\n uint256 stEthBal = IERC20(STETH_TOKEN).balanceOf(address(this));\n IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);\n uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function withdraw(uint256 _amount) external onlyOwner {\n require(_amount > 0 && _amount <= address(this).balance, \"Invalid amount\");\n IWStETH(WST_ETH).unwrap(_amount);\n uint256 stEthBal = IERC20(STETH_TOKEN).balanceOf(address(this));\n IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);\n uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);\n // solhint-disable-next-line\n payable(msg.sender).transfer(address(this).balance);\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-salty", "title": "LinKenji Analysis", "severity_raw": "Critical", "severity": "critical", "description": "## Project Summary\n\nSalty.IO is building a decentralized exchange that aims to offer zero fee swaps, yield generation from automatic arbitrage, and a native stablecoin called USDS collateralized by WBTC/WETH.\n\nThe system is governed by a DAO where SALT token holders vote on parameters and upgrades. No special admin access exists. Pools.sol implements the AMM DEX logic with arbitrage done atomically at swap time to yield profits. USDS.sol manages stablecoin collateral ratios, liquidations, and redemptions.\n\nIncentives focus on distributing arbitrage yields to liquidity providers and SALT stakers to drive adoption. The goal is ultimately a self-sustaining platform lacking centralized points of failure.\n\n**Key Risks**\n\n**Liquidity Bootstrapping:** As an AMM, Salty.IO requires external liquidity to function efficiently. Without incentives attracting liquidity in a circular way, high swap costs could prevent profitability.\n\n**Technical:** The smart contract system is complex. Subtle logical errors or bugs could disrupt core functionality around swaps, yields, or the USDS peg. Rigorous testing is critical.\n\n**Price Manipulation:** Asset valuations originate from external Chainlink and Uniswap price oracles. Market volatility could be amplified by manipulated oracles. \n\n**Governance:** The DAO introduces risks around proposal attacks, improper parameter changes, and funds mismanagement. Timelocks and process controls are important.\n\n**Summary**\n\nSalty.IO brings innovative architecture but has complexity risks. Prioritizing liquidity incentives and strong technical audit practices will help mitigate issues in core areas like AMM swaps, price oracles, and governance.\n\nThe core price feed contracts are `PriceAggregator.sol` and its associated `IPriceFeed` implementations (`CoreUniswapFeed`, `CoreChainlinkFeed` etc.) The main vulnerabilities stem from:\n\n**Centralized Price Feeds**\n\nIf an attacker compromises the private keys of the admin or DAO governing the price feed contrac", "vulnerable_code": "function setPriceFeed(uint id, IPriceFeed feed) onlyOwner external {\n // Set manipulated feed \n}", "fixed_code": "function swap(\n IERC20 tokenIn, \n IERC20 tokenOut,\n uint amountIn\n) external {\n\n // Place user swap\n\n uint arbitrageProfit = _attemptArbitrage(\n tokenIn, \n tokenOut,\n amountIn \n );\n\n}\n\nfunction _attemptArbitrage(\n IERC20 tokenIn,\n IERC20 tokenOut,\n uint amountIn \n) internal returns (uint profit) {\n\n // Calculate and perform arbitrage\n}", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/LinKenji-Analysis.md", "collected_at": "2026-01-02T19:01:24.647048+00:00", "source_hash": "574df277a74b69b6f590d54af6a572b29b9bfb8e83d1237777c27dbd1fc4a38d", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function setPriceFeed(uint id, IPriceFeed feed) onlyOwner external {\n // Set manipulated feed \n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function swap(\n IERC20 tokenIn, \n IERC20 tokenOut,\n uint amountIn\n) external {\n\n // Place user swap\n\n uint arbitrageProfit = _attemptArbitrage(\n tokenIn, \n tokenOut,\n amountIn \n );\n\n}\n\nfunction _attemptArbitrage(\n IERC20 tokenIn,\n IERC20 tokenOut,\n uint amountIn \n) internal returns (uint profit) {\n\n // Calculate and perform arbitrage\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "10-badger", "title": "niroh Q", "severity_raw": "High", "severity": "high", "description": "# _fallbackIsFrozen makes a call to fallbackCaller.fallbackTimeout() without checking that fallbackCaller is non-zero\n\n\n## Github Links\nhttps://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/PriceFeed.sol#L490\n\n## Description\nif the PriceFeed contract function _fallbackIsFrozen, a call is made to [fallbackCaller.fallbackTimeout()](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/PriceFeed.sol#L490) without checking that fallbackCaller is non-zero. This is unsafe since a zero address fallback is an acceptable state in the system (and is checked for in other places in the code, such as [here](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/PriceFeed.sol#L224)). Currently all calls to _fallbackIsFrozen are preceded by a check that fallback is not broken (which eliminates the zero value fallback case), however relying on an external check is unsafe and may be overlooked in future development. \n\n\n## Impact\nIf _fallbackIsFrozen is called when fallbackCaller is zero, if will revert, potentially reverting many of the main protocol operations that indirectly use _fallbackIsFrozen.\n\n## Tools Used\nFoundry\n\n## Recommended Mitigation Steps\nAt a minimum the documentation for _fallbackIsFrozen should mention that it should not be called without a prior check that _fallbackIsBroken is false. For an even safer approach,\nadd a check at the start of the function to return true is fallbackCaller is zero (The logic being that if you reach _fallbackIsFrozen when fallbackCaller is zero it's better to consider the fallback frozen than to fail the entire transaction).\n```\nif (address(fallbackCaller) == address(0)) {\n return true;\n}\nreturn\n _fallbackResponse.timestamp > 0 &&\n _responseTimeout(_fallbackResponse.timestamp, fallbackCaller.fallbackTimeout()); \n`", "vulnerable_code": "if (address(fallbackCaller) == address(0)) {\n return true;\n}\nreturn\n _fallbackResponse.timestamp > 0 &&\n _responseTimeout(_fallbackResponse.timestamp, fallbackCaller.fallbackTimeout()); ", "fixed_code": " function closeCdp(bytes32 _cdpId) external override nonReentrantSelfAndCdpM {", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/niroh-Q.md", "collected_at": "2026-01-02T18:26:57.381529+00:00", "source_hash": "5753df0711da03f69af4b380968eec3725b71ed8865226f2af97adc5c799ef6e", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "PriceFeed.sol#L490, PriceFeed.sol#L224", "github_files_list": "PriceFeed.sol", "github_refs_count": 2, "vulnerable_code_actual": "if (address(fallbackCaller) == address(0)) {\n return true;\n}\nreturn\n _fallbackResponse.timestamp > 0 &&\n _responseTimeout(_fallbackResponse.timestamp, fallbackCaller.fallbackTimeout()); ", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function closeCdp(bytes32 _cdpId) external override nonReentrantSelfAndCdpM {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-biconomy", "title": "report", "severity_raw": "Critical", "severity": "critical", "description": "---\nsponsor: \"Biconomy\"\nslug: \"2023-01-biconomy\"\ndate: \"2023-03-03\"\ntitle: \"Biconomy - Smart Contract Wallet contest\"\nfindings: \"https://github.com/code-423n4/2023-01-biconomy-findings/issues\"\ncontest: 200\n---\n\n# Overview\n\n## About C4\n\nCode4rena (C4) is an open organization consisting of security researchers, auditors, developers, and individuals with domain expertise in smart contracts.\n\nA C4 audit contest is an event in which community participants, referred to as Wardens, review, audit, or analyze smart contract logic in exchange for a bounty provided by sponsoring projects.\n\nDuring the audit contest outlined in this document, C4 conducted an analysis of the Biconomy Smart Contract Wallet system written in Solidity. The audit contest took place between January 4\u2014January 9 2023.\n\n## Wardens\n\n115 Wardens contributed reports to the Biconomy Smart Contract Wallet contest:\n\n 1. 0x1f8b\n 2. 0x52\n 3. [0x73696d616f](https://twitter.com/3xJanx2009)\n 4. [0xAgro](https://twitter.com/0xAgro)\n 5. [0xDave](https://twitter.com/nl__park)\n 6. [0xSmartContract](https://twitter.com/0xSmartContract)\n 7. 0xbepresent\n 8. 0xdeadbeef0x\n 9. 0xhacksmithh\n 10. 2997ms\n 11. Atarpara\n 12. [Aymen0909](https://github.com/Aymen1001)\n 13. BClabs (nalus and Reptilia)\n 14. Bnke0x0\n 15. [Deivitto](https://twitter.com/Deivitto)\n 16. DevTimSch\n 17. Diana\n 18. Fon\n 19. [Franfran](https://franfran.dev/)\n 20. HE1M\n 21. Haipls\n 22. IllIllI\n 23. Jayus\n 24. Josiah\n 25. [Kalzak](https://twitter.com/kalzak)\n 26. Koolex\n 27. [Kutu](https://twitter.com/0xKutu)\n 28. Lirios\n 29. MalfurionWhitehat\n 30. [Manboy](https://twitter.com/manboy_eth)\n 31. Matin\n 32. MyFDsYours\n 33. [PwnedNoMore](https://twitter.com/pwnednomore) ([izhuer](https://www.cs.purdue.edu/homes/zhan3299/index.html), ItsNio, [wen](https://twitter.com/0xtarafans), h5n8514, and hashminer0725)\n 34. [Qeew](https://twitter.com/adigunq_adigun)\n 35. Rageur\n 36. [Raiders](https://raiders0786.github.io/Portfolio/)\n 37. Ra", "vulnerable_code": "contract Destructor {\n fallback() external {\n selfdestruct(payable(0));\n }\n}", "fixed_code": "So, in the deploy script there is no enforce that the `SmartAccount` contract implementation was initialized.\n\nThe same situation in `scw-contracts/scripts/wallet-factory.deploy.ts` script.\n\nPlease note, that in case only the possibility of initialization of the `SmartAccount` implementation will be banned it will be possible to use this attack. This is so because in such a case `owner` variable will be equal to zero and it will be easy to pass a check inside of `checkSignatures` function using the fact that for incorrect input parameters `ecrecover` returns a zero address.\n\n### Impact\n\nComplete freezing of all functionality of all wallets (including complete funds freezing).\n\n### Recommended Mitigation Steps\n\nAdd to the deploy script initialization of the `SmartAccount` implementation, or add to the `SmartAccount` contract the following constructor that will prevent implementation contract from the initialization:\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/report.md", "collected_at": "2026-01-02T18:14:17.356014+00:00", "source_hash": "575bcc1e981e80af73921c46f79f8a568355d4c7e8f9c8c77a3416ebcc4e9ec0", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "contract Destructor {\n fallback() external {\n selfdestruct(payable(0));\n }\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "So, in the deploy script there is no enforce that the `SmartAccount` contract implementation was initialized.\n\nThe same situation in `scw-contracts/scripts/wallet-factory.deploy.ts` script.\n\nPlease note, that in case only the possibility of initialization of the `SmartAccount` implementation will be banned it will be possible to use this attack. This is so because in such a case `owner` variable will be equal to zero and it will be easy to pass a check inside of `checkSignatures` function using the fact that for incorrect input parameters `ecrecover` returns a zero address.\n\n### Impact\n\nComplete freezing of all functionality of all wallets (including complete funds freezing).\n\n### Recommended Mitigation Steps\n\nAdd to the deploy script initialization of the `SmartAccount` implementation, or add to the `SmartAccount` contract the following constructor that will prevent implementation contract from the initialization:\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-salty", "title": "memforvik Q", "severity_raw": "Medium", "severity": "medium", "description": "The function _withdrawLiquidityAndClaim not followed Checks effects interactions, may lead to a read-only reentrancy attacks\n\n```\nsrc/staking/Liquidity.sol\n\n\t// Withdraw specified liquidity, decrease the user's liquidity share and claim any pending rewards.\n function _withdrawLiquidityAndClaim( IERC20 tokenA, IERC20 tokenB, uint256 liquidityToWithdraw, uint256 minReclaimedA, uint256 minReclaimedB ) internal returns (uint256 reclaimedA, uint256 reclaimedB)\n\t\t{\n\t\tbytes32 poolID = PoolUtils._poolID( tokenA, tokenB );\n\t\trequire( userShareForPool(msg.sender, poolID) >= liquidityToWithdraw, \"Cannot withdraw more than existing user share\" );\n\n\t\t// Remove the amount of liquidity specified by the user.\n\t\t// The liquidity in the pool is currently owned by this contract. (external call)\n\t\t(reclaimedA, reclaimedB) = pools.removeLiquidity( tokenA, tokenB, liquidityToWithdraw, minReclaimedA, minReclaimedB, totalShares[poolID] );\n\n\t\t// Transfer the reclaimed tokens to the user\n\t\ttokenA.safeTransfer( msg.sender, reclaimedA );\n\t\ttokenB.safeTransfer( msg.sender, reclaimedB );\n\n\t\t// Reduce the user's liquidity share for the specified pool so that they receive less rewards.\n\t\t// Cooldown is specified to prevent reward hunting (ie - quickly depositing and withdrawing large amounts of liquidity to snipe rewards)\n\t\t// This call will send any pending SALT rewards to msg.sender as well.\n\t\t_decreaseUserShare( msg.sender, poolID, liquidityToWithdraw, true );\n\n\t\temit LiquidityWithdrawn(msg.sender, address(tokenA), address(tokenB), reclaimedA, reclaimedB, liquidityToWithdraw);\n\t\t}\n \n```\n\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/staking/Liquidity.sol#L137\n\nThe code logic does not meet CEI, Since erc777 is fully compatible with erc20, if finalized an erc777 token to whitelist token, Malicious users can potentially profit from read-only reentrancy attacks", "vulnerable_code": "src/staking/Liquidity.sol\n\n\t// Withdraw specified liquidity, decrease the user's liquidity share and claim any pending rewards.\n function _withdrawLiquidityAndClaim( IERC20 tokenA, IERC20 tokenB, uint256 liquidityToWithdraw, uint256 minReclaimedA, uint256 minReclaimedB ) internal returns (uint256 reclaimedA, uint256 reclaimedB)\n\t\t{\n\t\tbytes32 poolID = PoolUtils._poolID( tokenA, tokenB );\n\t\trequire( userShareForPool(msg.sender, poolID) >= liquidityToWithdraw, \"Cannot withdraw more than existing user share\" );\n\n\t\t// Remove the amount of liquidity specified by the user.\n\t\t// The liquidity in the pool is currently owned by this contract. (external call)\n\t\t(reclaimedA, reclaimedB) = pools.removeLiquidity( tokenA, tokenB, liquidityToWithdraw, minReclaimedA, minReclaimedB, totalShares[poolID] );\n\n\t\t// Transfer the reclaimed tokens to the user\n\t\ttokenA.safeTransfer( msg.sender, reclaimedA );\n\t\ttokenB.safeTransfer( msg.sender, reclaimedB );\n\n\t\t// Reduce the user's liquidity share for the specified pool so that they receive less rewards.\n\t\t// Cooldown is specified to prevent reward hunting (ie - quickly depositing and withdrawing large amounts of liquidity to snipe rewards)\n\t\t// This call will send any pending SALT rewards to msg.sender as well.\n\t\t_decreaseUserShare( msg.sender, poolID, liquidityToWithdraw, true );\n\n\t\temit LiquidityWithdrawn(msg.sender, address(tokenA), address(tokenB), reclaimedA, reclaimedB, liquidityToWithdraw);\n\t\t}\n ", "fixed_code": "", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/memforvik-Q.md", "collected_at": "2026-01-02T19:01:52.517719+00:00", "source_hash": "57d4f4aa2c9b305e762b24dc22478c71d32041c544b5051cedf2b7ca730f8477", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 1451, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "src/staking/Liquidity.sol\n\n\t// Withdraw specified liquidity, decrease the user's liquidity share and claim any pending rewards.\n function _withdrawLiquidityAndClaim( IERC20 tokenA, IERC20 tokenB, uint256 liquidityToWithdraw, uint256 minReclaimedA, uint256 minReclaimedB ) internal returns (uint256 reclaimedA, uint256 reclaimedB)\n\t\t{\n\t\tbytes32 poolID = PoolUtils._poolID( tokenA, tokenB );\n\t\trequire( userShareForPool(msg.sender, poolID) >= liquidityToWithdraw, \"Cannot withdraw more than existing user share\" );\n\n\t\t// Remove the amount of liquidity specified by the user.\n\t\t// The liquidity in the pool is currently owned by this contract. (external call)\n\t\t(reclaimedA, reclaimedB) = pools.removeLiquidity( tokenA, tokenB, liquidityToWithdraw, minReclaimedA, minReclaimedB, totalShares[poolID] );\n\n\t\t// Transfer the reclaimed tokens to the user\n\t\ttokenA.safeTransfer( msg.sender, reclaimedA );\n\t\ttokenB.safeTransfer( msg.sender, reclaimedB );\n\n\t\t// Reduce the user's liquidity share for the specified pool so that they receive less rewards.\n\t\t// Cooldown is specified to prevent reward hunting (ie - quickly depositing and withdrawing large amounts of liquidity to snipe rewards)\n\t\t// This call will send any pending SALT rewards to msg.sender as well.\n\t\t_decreaseUserShare( msg.sender, poolID, liquidityToWithdraw, true );\n\n\t\temit LiquidityWithdrawn(msg.sender, address(tokenA), address(tokenB), reclaimedA, reclaimedB, liquidityToWithdraw);\n\t\t}", "primary_code_language": "unknown", "primary_code_char_count": 1451, "all_code_blocks": "// Code block 1 (unknown):\nsrc/staking/Liquidity.sol\n\n\t// Withdraw specified liquidity, decrease the user's liquidity share and claim any pending rewards.\n function _withdrawLiquidityAndClaim( IERC20 tokenA, IERC20 tokenB, uint256 liquidityToWithdraw, uint256 minReclaimedA, uint256 minReclaimedB ) internal returns (uint256 reclaimedA, uint256 reclaimedB)\n\t\t{\n\t\tbytes32 poolID = PoolUtils._poolID( tokenA, tokenB );\n\t\trequire( userShareForPool(msg.sender, poolID) >= liquidityToWithdraw, \"Cannot withdraw more than existing user share\" );\n\n\t\t// Remove the amount of liquidity specified by the user.\n\t\t// The liquidity in the pool is currently owned by this contract. (external call)\n\t\t(reclaimedA, reclaimedB) = pools.removeLiquidity( tokenA, tokenB, liquidityToWithdraw, minReclaimedA, minReclaimedB, totalShares[poolID] );\n\n\t\t// Transfer the reclaimed tokens to the user\n\t\ttokenA.safeTransfer( msg.sender, reclaimedA );\n\t\ttokenB.safeTransfer( msg.sender, reclaimedB );\n\n\t\t// Reduce the user's liquidity share for the specified pool so that they receive less rewards.\n\t\t// Cooldown is specified to prevent reward hunting (ie - quickly depositing and withdrawing large amounts of liquidity to snipe rewards)\n\t\t// This call will send any pending SALT rewards to msg.sender as well.\n\t\t_decreaseUserShare( msg.sender, poolID, liquidityToWithdraw, true );\n\n\t\temit LiquidityWithdrawn(msg.sender, address(tokenA), address(tokenB), reclaimedA, reclaimedB, liquidityToWithdraw);\n\t\t}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Liquidity.sol#L137", "github_files_list": "Liquidity.sol", "github_refs_count": 1, "vulnerable_code_actual": "src/staking/Liquidity.sol\n\n\t// Withdraw specified liquidity, decrease the user's liquidity share and claim any pending rewards.\n function _withdrawLiquidityAndClaim( IERC20 tokenA, IERC20 tokenB, uint256 liquidityToWithdraw, uint256 minReclaimedA, uint256 minReclaimedB ) internal returns (uint256 reclaimedA, uint256 reclaimedB)\n\t\t{\n\t\tbytes32 poolID = PoolUtils._poolID( tokenA, tokenB );\n\t\trequire( userShareForPool(msg.sender, poolID) >= liquidityToWithdraw, \"Cannot withdraw more than existing user share\" );\n\n\t\t// Remove the amount of liquidity specified by the user.\n\t\t// The liquidity in the pool is currently owned by this contract. (external call)\n\t\t(reclaimedA, reclaimedB) = pools.removeLiquidity( tokenA, tokenB, liquidityToWithdraw, minReclaimedA, minReclaimedB, totalShares[poolID] );\n\n\t\t// Transfer the reclaimed tokens to the user\n\t\ttokenA.safeTransfer( msg.sender, reclaimedA );\n\t\ttokenB.safeTransfer( msg.sender, reclaimedB );\n\n\t\t// Reduce the user's liquidity share for the specified pool so that they receive less rewards.\n\t\t// Cooldown is specified to prevent reward hunting (ie - quickly depositing and withdrawing large amounts of liquidity to snipe rewards)\n\t\t// This call will send any pending SALT rewards to msg.sender as well.\n\t\t_decreaseUserShare( msg.sender, poolID, liquidityToWithdraw, true );\n\n\t\temit LiquidityWithdrawn(msg.sender, address(tokenA), address(tokenB), reclaimedA, reclaimedB, liquidityToWithdraw);\n\t\t}\n ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "03-asymmetry", "title": "0xkazim Q", "severity_raw": "Medium", "severity": "medium", "description": "# Findings Summary\n\n| ID | Title | Severity |\n| ------ | ---------------------------------------------------------------- | -------- |\n| [L-01] | Gas griefing/theft is possible on unsafe external call | low |\n| [L-02] | event missed in `setMaxSlippage()` function may cause fund loose | low |\n\n# [L-01] contracts should inherit their interfacese\n\n## Description\n\nreturn data (bool success,) has to be stored due to EVM architecture, if in a usage like below, \u2018out\u2019 and \u2018outsize\u2019 values are given (0,0) . Thus, this storage disappears and may come from external contracts a possible Gas griefing/theft problem is avoided\n\n## context\n\nThere are 5 instances of the topic.\n\n```solidity\n\nfile: contracts/SafEth/SafEth.sol\n\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: ethAmountToWithdraw}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n```\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L123-L127\n\n```solidity\nfile: contracts/SafEth/derivatives/Reth.sol\n\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n```\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/Reth.sol#L110-L112\n\n```solidity\nfile: contracts/SafEth/derivatives/SfrxEth.sol\n\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n```\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/SfrxEth.sol#L84-L87\n\n```solidity\nfile: contracts/SafEth/derivatives/WstEth.sol\n\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n ", "vulnerable_code": "file: contracts/SafEth/SafEth.sol\n\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: ethAmountToWithdraw}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");", "fixed_code": "file: contracts/SafEth/derivatives/Reth.sol\n\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/0xkazim-Q.md", "collected_at": "2026-01-02T18:17:43.598345+00:00", "source_hash": "57fd685fce8fce1ab2be8eb329d27e1761e7008f06878842ff1a6796a06550fd", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 631, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "file: contracts/SafEth/SafEth.sol\n\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: ethAmountToWithdraw}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");", "primary_code_language": "solidity", "primary_code_char_count": 215, "all_code_blocks": "// Code block 1 (solidity):\nfile: contracts/SafEth/SafEth.sol\n\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: ethAmountToWithdraw}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n\n// Code block 2 (solidity):\nfile: contracts/SafEth/derivatives/Reth.sol\n\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n\n// Code block 3 (solidity):\nfile: contracts/SafEth/derivatives/SfrxEth.sol\n\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "file: contracts/SafEth/SafEth.sol\n\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: ethAmountToWithdraw}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n\nfile: contracts/SafEth/derivatives/Reth.sol\n\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n\nfile: contracts/SafEth/derivatives/SfrxEth.sol\n\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");", "github_refs_formatted": "SafEth.sol#L123-L127, Reth.sol#L110-L112, SfrxEth.sol#L84-L87", "github_files_list": "SfrxEth.sol, Reth.sol, SafEth.sol", "github_refs_count": 3, "vulnerable_code_actual": "file: contracts/SafEth/SafEth.sol\n\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: ethAmountToWithdraw}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": "file: contracts/SafEth/derivatives/Reth.sol\n\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "01-biconomy", "title": "Tomio G", "severity_raw": "Informational", "severity": "informational", "description": "1.\nTitle: Using bytes constant is more gas efficient\n\nReference: [Here](https://ethereum.stackexchange.com/questions/3795/why-do-solidity-examples-use-bytes32-type-instead-of-string)\n\nProof of Concept:\n[DefaultCallbackHandler.sol#L12-L13](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/handler/DefaultCallbackHandler.sol#L12-L13)\n[SmartAccountFactory.sol#L11](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccountFactory.sol#L11)\n[SmartAccount.sol#L36](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L36)\n\nRecommended Mitigation Steps:\nChange it to `bytes(1..32) constant`\n________________________________________________________________________\n\n2. \nTitle: Struct optimization\n\nProof of Concept:\n[PaymasterHelpers.sol#L13-L16](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/PaymasterHelpers.sol#L13-L16)\n\nRecommended Mitigation Steps:\nUse elementary types or a user-defined type instead can save gas\n________________________________________________________________________\n\n3.\nTitle: Reduce the size of error messages (Long revert Strings)\n\nImpact:\nShortening revert strings to fit in 32 bytes will decrease deployment time gas and will decrease runtime gas when the revert condition is met.\nRevert strings that are longer than 32 bytes require at least one additional mstore, along with additional overhead for computing memory offset, etc.\n\nProof of Concept:\n[SmartAccount.sol#L77](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L77)\n[SmartAccount.sol#L110](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L110)\n[SmartAccount.sol#L128](https://github.com/code-423n4/2023-01-biconomy/blob/main/s", "vulnerable_code": "function getChainId() public view returns (uint256 id) { //@audit-info: set here", "fixed_code": "\trequire(module != address(0), \"BSA101\");\n\trequire(module != SENTINEL_MODULES, \"BSA101\");", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/Tomio-G.md", "collected_at": "2026-01-02T18:13:23.312362+00:00", "source_hash": "585ae434a7d040767448fdf4ae5ecd53d1b5bc40082b3a6312c516c67405f044", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "DefaultCallbackHandler.sol#L12-L13, SmartAccountFactory.sol#L11, SmartAccount.sol#L36, PaymasterHelpers.sol#L13-L16, SmartAccount.sol#L77, SmartAccount.sol#L110", "github_files_list": "DefaultCallbackHandler.sol, SmartAccount.sol, PaymasterHelpers.sol, SmartAccountFactory.sol", "github_refs_count": 6, "vulnerable_code_actual": "function getChainId() public view returns (uint256 id) { //@audit-info: set here", "has_vulnerable_code_snippet": true, "fixed_code_actual": "\trequire(module != address(0), \"BSA101\");\n\trequire(module != SENTINEL_MODULES, \"BSA101\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "02-ethos", "title": "2997ms Q", "severity_raw": "Critical", "severity": "critical", "description": "## Summary\n\n\n## Low Risk Issues\n\n## [LOW-01] Better to set a up limit for ```totalLQTYStaked```\n\n```\nif (totalLQTYStaked > 0) {LUSDFeePerLQTYStaked = _LUSDFee.mul(DECIMAL_PRECISION).div(totalLQTYStaked);}\n```\n\ntotalLQTYStaked is divided in multiple places but there is no up limit for this value. If this value becomes really large one day, all the divisions will become meaningless because all the results will be 0.\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/891252b407033489140de63ea502b053d5dc860c/Ethos-Core/contracts/LQTY/LQTYStaking.sol#L191\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/891252b407033489140de63ea502b053d5dc860c/Ethos-Core/contracts/LQTY/LQTYStaking.sol#L181\n\n## Non Critical Issues\n\n\n### [NC-01]Open TODOs\n\nAn open TODO is present. It is recommended to avoid open TODOs as they may indicate programming errors that still need to be fixed.\n\n**Proof Of Concept**\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/891252b407033489140de63ea502b053d5dc860c/Ethos-Core/contracts/StabilityPool.sol#L335\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/891252b407033489140de63ea502b053d5dc860c/Ethos-Core/contracts/StabilityPool.sol#L380\n\n**Recommended Mitigation Steps**\nResolve these TODOs\n\n### [NC-02]Solidity versions should be consistent\n\nMost of solidity versions in the files are ```pragma solidity 0.6.11;```, but in ReaperStrategyGranarySupplyOnly.sol and ReaperVaultERC4626.sol\n, the value is ```pragma solidity ^0.8.0;```\n\n**Proof Of Concept**\n```\npragma solidity ^0.8.0\n```\nhttps://github.com/code-423n4/2023-02-ethos/blob/34ba1e7dd2d259f06f9d5fa13f5d96be7829ff34/Ethos-Vault/contracts/ReaperVaultERC4626.sol#L3\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/891252b407033489140de63ea502b053d5dc860c/Ethos-Core/contracts/ActivePool.sol#L3\n\n\n\n**Recommended Mitigation Steps**\nMake the versions consistent\n\n\n\n\n\u200b\n\n\n\n", "vulnerable_code": "```\nif (totalLQTYStaked > 0) {LUSDFeePerLQTYStaked = _LUSDFee.mul(DECIMAL_PRECISION).div(totalLQTYStaked);}", "fixed_code": "**Proof Of Concept**", "recommendation": "", "category": "dos", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/2997ms-Q.md", "collected_at": "2026-01-02T18:15:54.998839+00:00", "source_hash": "586cee458d5dcf2ce5836e34424c5a3de1dc1ab730293e24dbe87167f4cf7d93", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 1126, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "totalLQTYStaked is divided in multiple places but there is no up limit for this value. If this value becomes really large one day, all the divisions will become meaningless because all the results will be 0.\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/891252b407033489140de63ea502b053d5dc860c/Ethos-Core/contracts/LQTY/LQTYStaking.sol#L191\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/891252b407033489140de63ea502b053d5dc860c/Ethos-Core/contracts/LQTY/LQTYStaking.sol#L181\n\n## Non Critical Issues\n\n\n### [NC-01]Open TODOs\n\nAn open TODO is present. It is recommended to avoid open TODOs as they may indicate programming errors that still need to be fixed.\n\n**Proof Of Concept**\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/891252b407033489140de63ea502b053d5dc860c/Ethos-Core/contracts/StabilityPool.sol#L335\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/891252b407033489140de63ea502b053d5dc860c/Ethos-Core/contracts/StabilityPool.sol#L380\n\n**Recommended Mitigation Steps**\nResolve these TODOs\n\n### [NC-02]Solidity versions should be consistent\n\nMost of solidity versions in the files are", "primary_code_language": "unknown", "primary_code_char_count": 1106, "all_code_blocks": "// Code block 1 (unknown):\ntotalLQTYStaked is divided in multiple places but there is no up limit for this value. If this value becomes really large one day, all the divisions will become meaningless because all the results will be 0.\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/891252b407033489140de63ea502b053d5dc860c/Ethos-Core/contracts/LQTY/LQTYStaking.sol#L191\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/891252b407033489140de63ea502b053d5dc860c/Ethos-Core/contracts/LQTY/LQTYStaking.sol#L181\n\n## Non Critical Issues\n\n\n### [NC-01]Open TODOs\n\nAn open TODO is present. It is recommended to avoid open TODOs as they may indicate programming errors that still need to be fixed.\n\n**Proof Of Concept**\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/891252b407033489140de63ea502b053d5dc860c/Ethos-Core/contracts/StabilityPool.sol#L335\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/891252b407033489140de63ea502b053d5dc860c/Ethos-Core/contracts/StabilityPool.sol#L380\n\n**Recommended Mitigation Steps**\nResolve these TODOs\n\n### [NC-02]Solidity versions should be consistent\n\nMost of solidity versions in the files are\n\n// Code block 2 (unknown):\n**Proof Of Concept**", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LQTYStaking.sol#L191, LQTYStaking.sol#L181, StabilityPool.sol#L335, StabilityPool.sol#L380, ReaperVaultERC4626.sol#L3, ActivePool.sol#L3", "github_files_list": "LQTYStaking.sol, ActivePool.sol, ReaperVaultERC4626.sol, StabilityPool.sol", "github_refs_count": 6, "vulnerable_code_actual": "```\nif (totalLQTYStaked > 0) {LUSDFeePerLQTYStaked = _LUSDFee.mul(DECIMAL_PRECISION).div(totalLQTYStaked);}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "**Proof Of Concept**", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-biconomy", "title": "juancito Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA Report\n\n## Summary\n\n### Low Issues\n\n| | Issue | Instances |\n| ----- | :-------------------------------------------------- | :-------: |\n| [L-1] | Missing checks for `address(0)` in withdraw methods | 7 |\n| [L-2] | Unresolved `TODO` and `review` comments | 12 |\n| [L-3] | Unspecific compiler version pragma | 11 |\n| [L-4] | Missing event emit on `deployWallet` | 1 |\n\n### Non Critical Issues\n\n| | Issue | Instances |\n| ------ | :---------------------------------------------------------- | :-------: |\n| [NC-1] | Commented code lines | 12 |\n| [NC-2] | Test coverage improvement | 18 |\n| [NC-3] | Misleading error messages | 2 |\n| [NC-4] | Typos | 4 |\n| [NC-5] | Constants should be defined rather than using magic numbers | 1 |\n\n## Low Issues\n\n### [L-1] Missing checks for `address(0)` in withdraw methods\n\nConsider checking for `address(0)` to prevent any loss of funds.\n\n_Instances 7_:\n\n```solidity\nFile: contracts/smart-contract-wallet/SmartAccount.sol\n\n537: entryPoint().withdrawTo(withdrawAddress, amount);\n\n```\n\n[Link to code](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol)\n\n```solidity\nFile: contracts/smart-contract-wallet/paymasters/BasePaymaster.sol\n\n68: entryPoint.withdrawTo(withdrawAddress, amount);\n\n100: entryPoint.withdrawStake(withdrawAddress);\n\n```\n\n[Link to code](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol)\n\n```solidity\nFile: contracts/smart-contract-wallet/aa-4337/core/StakeManager.sol\n\n106: (bool success,) = wi", "vulnerable_code": "File: contracts/smart-contract-wallet/SmartAccount.sol\n\n537: entryPoint().withdrawTo(withdrawAddress, amount);\n", "fixed_code": "File: contracts/smart-contract-wallet/paymasters/BasePaymaster.sol\n\n68: entryPoint.withdrawTo(withdrawAddress, amount);\n\n100: entryPoint.withdrawStake(withdrawAddress);\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/juancito-Q.md", "collected_at": "2026-01-02T18:13:52.192014+00:00", "source_hash": "588618f1e30d25b382975a423dc7d88b56336df2d509eb7aab7ef19ecdd85a68", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 288, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/smart-contract-wallet/SmartAccount.sol\n\n537: entryPoint().withdrawTo(withdrawAddress, amount);", "primary_code_language": "solidity", "primary_code_char_count": 113, "all_code_blocks": "// Code block 1 (solidity):\nFile: contracts/smart-contract-wallet/SmartAccount.sol\n\n537: entryPoint().withdrawTo(withdrawAddress, amount);\n\n// Code block 2 (solidity):\nFile: contracts/smart-contract-wallet/paymasters/BasePaymaster.sol\n\n68: entryPoint.withdrawTo(withdrawAddress, amount);\n\n100: entryPoint.withdrawStake(withdrawAddress);", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: contracts/smart-contract-wallet/SmartAccount.sol\n\n537: entryPoint().withdrawTo(withdrawAddress, amount);\n\nFile: contracts/smart-contract-wallet/paymasters/BasePaymaster.sol\n\n68: entryPoint.withdrawTo(withdrawAddress, amount);\n\n100: entryPoint.withdrawStake(withdrawAddress);", "github_refs_formatted": "SmartAccount.sol, BasePaymaster.sol", "github_files_list": "SmartAccount.sol, BasePaymaster.sol", "github_refs_count": 2, "vulnerable_code_actual": "File: contracts/smart-contract-wallet/SmartAccount.sol\n\n537: entryPoint().withdrawTo(withdrawAddress, amount);\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/smart-contract-wallet/paymasters/BasePaymaster.sol\n\n68: entryPoint.withdrawTo(withdrawAddress, amount);\n\n100: entryPoint.withdrawStake(withdrawAddress);\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-biconomy", "title": "MalfurionWhitehat G", "severity_raw": "Unknown", "severity": "unknown", "description": "# 1. Remove duplicate validation of address zero in `SmartAccount.init`\n\n```diff\ndiff --git a/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol b/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\nindex c4f69a8..cc30425 100644\n--- a/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n+++ b/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n@@ -168,10 +168,10 @@ contract SmartAccount is\n require(address(_entryPoint) == address(0), \"Already initialized\");\n require(_owner != address(0),\"Invalid owner\");\n require(_entryPointAddress != address(0), \"Invalid Entrypoint\");\n- require(_handler != address(0), \"Invalid Entrypoint\");\n+ require(_handler != address(0), \"Invalid Fallback Handler\");\n owner = _owner;\n _entryPoint = IEntryPoint(payable(_entryPointAddress));\n- if (_handler != address(0)) internalSetFallbackHandler(_handler);\n+ internalSetFallbackHandler(_handler);\n setupModules(address(0), bytes(\"\"));\n }\n \n\n```\n\n# 2. Remove unnecessary owner validation on `SmartAccount.execute` and `SmartAccount.executeBatch` as these functions are already behind an `onlyOwner` modifier\n\n```diff\ndiff --git a/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol b/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\nindex c4f69a8..67a2d5f 100644\n--- a/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n+++ b/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n@@ -458,12 +458,10 @@ contract SmartAccount is\n }\n \n function execute(address dest, uint value, bytes calldata func) external onlyOwner{\n- _requireFromEntryPointOrOwner();\n _call(dest, value, func);\n }\n \n function executeBatch(address[] calldata dest, bytes[] calldata func) external onlyOwner{\n- _requireFromEntryPointOrOwner();\n require(dest.length == func.length, \"wrong array lengths\");\n for (uint i = 0; i < de", "vulnerable_code": "# 2. Remove unnecessary owner validation on `SmartAccount.execute` and `SmartAccount.executeBatch` as these functions are already behind an `onlyOwner` modifier\n", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/MalfurionWhitehat-G.md", "collected_at": "2026-01-02T18:13:10.725624+00:00", "source_hash": "58bb80ffb36a21b6d202d38897c9fa69be32ecc40a7194876fafc4f5bbdcb7d7", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 962, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "diff --git a/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol b/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\nindex c4f69a8..cc30425 100644\n--- a/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n+++ b/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n@@ -168,10 +168,10 @@ contract SmartAccount is\n require(address(_entryPoint) == address(0), \"Already initialized\");\n require(_owner != address(0),\"Invalid owner\");\n require(_entryPointAddress != address(0), \"Invalid Entrypoint\");\n- require(_handler != address(0), \"Invalid Entrypoint\");\n+ require(_handler != address(0), \"Invalid Fallback Handler\");\n owner = _owner;\n _entryPoint = IEntryPoint(payable(_entryPointAddress));\n- if (_handler != address(0)) internalSetFallbackHandler(_handler);\n+ internalSetFallbackHandler(_handler);\n setupModules(address(0), bytes(\"\"));\n }", "primary_code_language": "diff", "primary_code_char_count": 962, "all_code_blocks": "// Code block 1 (diff):\ndiff --git a/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol b/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\nindex c4f69a8..cc30425 100644\n--- a/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n+++ b/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n@@ -168,10 +168,10 @@ contract SmartAccount is\n require(address(_entryPoint) == address(0), \"Already initialized\");\n require(_owner != address(0),\"Invalid owner\");\n require(_entryPointAddress != address(0), \"Invalid Entrypoint\");\n- require(_handler != address(0), \"Invalid Entrypoint\");\n+ require(_handler != address(0), \"Invalid Fallback Handler\");\n owner = _owner;\n _entryPoint = IEntryPoint(payable(_entryPointAddress));\n- if (_handler != address(0)) internalSetFallbackHandler(_handler);\n+ internalSetFallbackHandler(_handler);\n setupModules(address(0), bytes(\"\"));\n }", "all_code_blocks_count": 1, "has_diff_blocks": true, "diff_code": "diff --git a/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol b/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\nindex c4f69a8..cc30425 100644\n--- a/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n+++ b/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n@@ -168,10 +168,10 @@ contract SmartAccount is\n require(address(_entryPoint) == address(0), \"Already initialized\");\n require(_owner != address(0),\"Invalid owner\");\n require(_entryPointAddress != address(0), \"Invalid Entrypoint\");\n- require(_handler != address(0), \"Invalid Entrypoint\");\n+ require(_handler != address(0), \"Invalid Fallback Handler\");\n owner = _owner;\n _entryPoint = IEntryPoint(payable(_entryPointAddress));\n- if (_handler != address(0)) internalSetFallbackHandler(_handler);\n+ internalSetFallbackHandler(_handler);\n setupModules(address(0), bytes(\"\"));\n }", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "# 2. Remove unnecessary owner validation on `SmartAccount.execute` and `SmartAccount.executeBatch` as these functions are already behind an `onlyOwner` modifier\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 7} {"source": "c4", "protocol": "09-ondo", "title": "debo G", "severity_raw": "Low", "severity": "low", "description": "## [G-01] Do not initialize variables with default value\nDescription\nUninitialized variables are assigned with the types default value.\n\nExplicitly initializing a variable with it's default value costs unnecessary gas.\n```txt\n2023-09-ondo/contracts/bridge/DestinationBridge.sol::134 => for (uint256 i = 0; i < thresholds.length; ++i) {\n2023-09-ondo/contracts/bridge/DestinationBridge.sol::160 => for (uint256 i = 0; i < t.approvers.length; ++i) {\n2023-09-ondo/contracts/bridge/DestinationBridge.sol::264 => for (uint256 i = 0; i < amounts.length; ++i) {\n2023-09-ondo/contracts/bridge/SourceBridge.sol::166 => for (uint256 i = 0; i < exCallData.length; ++i) {\n2023-09-ondo/contracts/rwaOracles/RWADynamicOracle.sol::77 => for (uint256 i = 0; i < length; ++i) {\n2023-09-ondo/contracts/rwaOracles/RWADynamicOracle.sol::113 => for (uint256 i = 0; i < length; ++i) {\n2023-09-ondo/contracts/rwaOracles/RWADynamicOracle.sol::129 => for (uint256 i = 0; i < length + 1; ++i) {\n2023-09-ondo/contracts/usdy/rUSDYFactory.sol::130 => for (uint256 i = 0; i < exCallData.length; ++i) {\n```\n## [G-02] Cache array length outside of loop\nDescription\nCaching the array length outside a loop saves reading it on each iteration, as long as the array's length is not changed during the loop.\n```txt\n2023-09-ondo/contracts/bridge/DestinationBridge.sol::134 => for (uint256 i = 0; i < thresholds.length; ++i) {\n2023-09-ondo/contracts/bridge/DestinationBridge.sol::159 => if (t.approvers.length > 0) {\n2023-09-ondo/contracts/bridge/DestinationBridge.sol::160 => for (uint256 i = 0; i < t.approvers.length; ++i) {\n2023-09-ondo/contracts/bridge/DestinationBridge.sol::179 => if (t.numberOfApprovalsNeeded <= t.approvers.length) {\n2023-09-ondo/contracts/bridge/DestinationBridge.sol::260 => if (amounts.length != numOfApprovers.length) {\n2023-09-ondo/contracts/bridge/DestinationBridge.sol::264 => for (uint256 i = 0; i < amounts.length; ++i) {\n2023-09-ondo/contracts/bridge/DestinationBridge.sol::362 => return txnToThresholdSe", "vulnerable_code": "## [G-02] Cache array length outside of loop\nDescription\nCaching the array length outside a loop saves reading it on each iteration, as long as the array's length is not changed during the loop.", "fixed_code": "## [G-03] Use not equal to 0 instead of Greater than 0 for unsigned integer comparison\nDescription\nWhen dealing with unsigned integer types, comparisons with != 0 are cheaper than with > 0.", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/debo-G.md", "collected_at": "2026-01-02T18:25:53.380464+00:00", "source_hash": "590f169f48e76901fb827c493a7dec6f9b4de3d58319cd1084d1795b659bafda", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 844, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "2023-09-ondo/contracts/bridge/DestinationBridge.sol::134 => for (uint256 i = 0; i < thresholds.length; ++i) {\n2023-09-ondo/contracts/bridge/DestinationBridge.sol::160 => for (uint256 i = 0; i < t.approvers.length; ++i) {\n2023-09-ondo/contracts/bridge/DestinationBridge.sol::264 => for (uint256 i = 0; i < amounts.length; ++i) {\n2023-09-ondo/contracts/bridge/SourceBridge.sol::166 => for (uint256 i = 0; i < exCallData.length; ++i) {\n2023-09-ondo/contracts/rwaOracles/RWADynamicOracle.sol::77 => for (uint256 i = 0; i < length; ++i) {\n2023-09-ondo/contracts/rwaOracles/RWADynamicOracle.sol::113 => for (uint256 i = 0; i < length; ++i) {\n2023-09-ondo/contracts/rwaOracles/RWADynamicOracle.sol::129 => for (uint256 i = 0; i < length + 1; ++i) {\n2023-09-ondo/contracts/usdy/rUSDYFactory.sol::130 => for (uint256 i = 0; i < exCallData.length; ++i) {", "primary_code_language": "txt", "primary_code_char_count": 844, "all_code_blocks": "// Code block 1 (txt):\n2023-09-ondo/contracts/bridge/DestinationBridge.sol::134 => for (uint256 i = 0; i < thresholds.length; ++i) {\n2023-09-ondo/contracts/bridge/DestinationBridge.sol::160 => for (uint256 i = 0; i < t.approvers.length; ++i) {\n2023-09-ondo/contracts/bridge/DestinationBridge.sol::264 => for (uint256 i = 0; i < amounts.length; ++i) {\n2023-09-ondo/contracts/bridge/SourceBridge.sol::166 => for (uint256 i = 0; i < exCallData.length; ++i) {\n2023-09-ondo/contracts/rwaOracles/RWADynamicOracle.sol::77 => for (uint256 i = 0; i < length; ++i) {\n2023-09-ondo/contracts/rwaOracles/RWADynamicOracle.sol::113 => for (uint256 i = 0; i < length; ++i) {\n2023-09-ondo/contracts/rwaOracles/RWADynamicOracle.sol::129 => for (uint256 i = 0; i < length + 1; ++i) {\n2023-09-ondo/contracts/usdy/rUSDYFactory.sol::130 => for (uint256 i = 0; i < exCallData.length; ++i) {", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "## [G-02] Cache array length outside of loop\nDescription\nCaching the array length outside a loop saves reading it on each iteration, as long as the array's length is not changed during the loop.", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## [G-03] Use not equal to 0 instead of Greater than 0 for unsigned integer comparison\nDescription\nWhen dealing with unsigned integer types, comparisons with != 0 are cheaper than with > 0.", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-ondo", "title": "dharma09 G", "severity_raw": "Medium", "severity": "medium", "description": "### [G-01] Use Immutable instead of constant for `keccak256`\n\nConstant expressions are [re-calculated each time it is in use]([https://github.com/ethereum/solidity/issues/9232](https://github.com/ethereum/solidity/issues/9232)), costing an extra `97` gas than a constant every time they are called.\n\nInstances include:\n\nMark these as\u00a0 `immutable`\u00a0 instead of\u00a0 `constant`\n\n*There are 14 instances of this issue:*\n\n**Affected source code:**\n\n```solidity\n/CashManager.sol \n122: bytes32 public constant MANAGER_ADMIN = keccak256(\"MANAGER_ADMIN\");\n123: bytes32 public constant PAUSER_ADMIN = keccak256(\"PAUSER_ADMIN\");\n124: bytes32 public constant SETTER_ADMIN = keccak256(\"SETTER_ADMIN\");\n\n/[KYCRegistry.sol](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistry.sol#L31)\n31: bytes32 public constant _APPROVAL_TYPEHASH =keccak256(\"KYCApproval(uint256 kycRequirementGroup,address user,uint256 deadline)\");\n36: bytes32 public constant REGISTRY_ADMIN = keccak256(\"REGISTRY_ADMIN\");\n\n/Cash.sol\n22: bytes32 public constant TRANSFER_ROLE = keccak256(\"TRANSFER_ROLE\");\n\n/CashKYCSender.sol\n25: bytes32 public constant KYC_CONFIGURER_ROLE = keccak256(\"KYC_CONFIGURER_ROLE\");\n\n/CashKYCSenderReceiver.sol\n26: bytes32 public constant KYC_CONFIGURER_ROLE = keccak256(\"KYC_CONFIGURER_ROLE\");\n\n/CashFactory.sol\n44: bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n45: bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n\n/CashKYCSenderFactory.sol\n44: bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n45: bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n\n/CashKYCSenderReceiverFactory.sol\n44: bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n45: bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n```\n\n### [G-02] Use constants if you already know the permanent value\n\nUse constants if you already know the permanent value. it get directly embedded in bytecode, saving\u00a0`SLOAD`\n\n*There are 3 instances of t", "vulnerable_code": "/CashManager.sol \n122: bytes32 public constant MANAGER_ADMIN = keccak256(\"MANAGER_ADMIN\");\n123: bytes32 public constant PAUSER_ADMIN = keccak256(\"PAUSER_ADMIN\");\n124: bytes32 public constant SETTER_ADMIN = keccak256(\"SETTER_ADMIN\");\n\n/[KYCRegistry.sol](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistry.sol#L31)\n31: bytes32 public constant _APPROVAL_TYPEHASH =keccak256(\"KYCApproval(uint256 kycRequirementGroup,address user,uint256 deadline)\");\n36: bytes32 public constant REGISTRY_ADMIN = keccak256(\"REGISTRY_ADMIN\");\n\n/Cash.sol\n22: bytes32 public constant TRANSFER_ROLE = keccak256(\"TRANSFER_ROLE\");\n\n/CashKYCSender.sol\n25: bytes32 public constant KYC_CONFIGURER_ROLE = keccak256(\"KYC_CONFIGURER_ROLE\");\n\n/CashKYCSenderReceiver.sol\n26: bytes32 public constant KYC_CONFIGURER_ROLE = keccak256(\"KYC_CONFIGURER_ROLE\");\n\n/CashFactory.sol\n44: bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n45: bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n\n/CashKYCSenderFactory.sol\n44: bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n45: bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n\n/CashKYCSenderReceiverFactory.sol\n44: bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n45: bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");", "fixed_code": "/CashManager.sol\n58: uint256 public minimumDepositAmount = 10_000;\n68: uint256 public exchangeRateDeltaLimit = 100;\n\n/OndoPriceOracleV2.sol\n77: uint256 public maxChainlinkOracleTimeDelay = 90000;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/dharma09-G.md", "collected_at": "2026-01-02T18:15:06.527749+00:00", "source_hash": "5919bd2418a6983724e92c95c21030c03a26bff8e69b329811877b690c74e402", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 1340, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "/CashManager.sol \n122: bytes32 public constant MANAGER_ADMIN = keccak256(\"MANAGER_ADMIN\");\n123: bytes32 public constant PAUSER_ADMIN = keccak256(\"PAUSER_ADMIN\");\n124: bytes32 public constant SETTER_ADMIN = keccak256(\"SETTER_ADMIN\");\n\n/[KYCRegistry.sol](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistry.sol#L31)\n31: bytes32 public constant _APPROVAL_TYPEHASH =keccak256(\"KYCApproval(uint256 kycRequirementGroup,address user,uint256 deadline)\");\n36: bytes32 public constant REGISTRY_ADMIN = keccak256(\"REGISTRY_ADMIN\");\n\n/Cash.sol\n22: bytes32 public constant TRANSFER_ROLE = keccak256(\"TRANSFER_ROLE\");\n\n/CashKYCSender.sol\n25: bytes32 public constant KYC_CONFIGURER_ROLE = keccak256(\"KYC_CONFIGURER_ROLE\");\n\n/CashKYCSenderReceiver.sol\n26: bytes32 public constant KYC_CONFIGURER_ROLE = keccak256(\"KYC_CONFIGURER_ROLE\");\n\n/CashFactory.sol\n44: bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n45: bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n\n/CashKYCSenderFactory.sol\n44: bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n45: bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n\n/CashKYCSenderReceiverFactory.sol\n44: bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n45: bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");", "primary_code_language": "solidity", "primary_code_char_count": 1340, "all_code_blocks": "// Code block 1 (solidity):\n/CashManager.sol \n122: bytes32 public constant MANAGER_ADMIN = keccak256(\"MANAGER_ADMIN\");\n123: bytes32 public constant PAUSER_ADMIN = keccak256(\"PAUSER_ADMIN\");\n124: bytes32 public constant SETTER_ADMIN = keccak256(\"SETTER_ADMIN\");\n\n/[KYCRegistry.sol](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistry.sol#L31)\n31: bytes32 public constant _APPROVAL_TYPEHASH =keccak256(\"KYCApproval(uint256 kycRequirementGroup,address user,uint256 deadline)\");\n36: bytes32 public constant REGISTRY_ADMIN = keccak256(\"REGISTRY_ADMIN\");\n\n/Cash.sol\n22: bytes32 public constant TRANSFER_ROLE = keccak256(\"TRANSFER_ROLE\");\n\n/CashKYCSender.sol\n25: bytes32 public constant KYC_CONFIGURER_ROLE = keccak256(\"KYC_CONFIGURER_ROLE\");\n\n/CashKYCSenderReceiver.sol\n26: bytes32 public constant KYC_CONFIGURER_ROLE = keccak256(\"KYC_CONFIGURER_ROLE\");\n\n/CashFactory.sol\n44: bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n45: bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n\n/CashKYCSenderFactory.sol\n44: bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n45: bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n\n/CashKYCSenderReceiverFactory.sol\n44: bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n45: bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "/CashManager.sol \n122: bytes32 public constant MANAGER_ADMIN = keccak256(\"MANAGER_ADMIN\");\n123: bytes32 public constant PAUSER_ADMIN = keccak256(\"PAUSER_ADMIN\");\n124: bytes32 public constant SETTER_ADMIN = keccak256(\"SETTER_ADMIN\");\n\n/[KYCRegistry.sol](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistry.sol#L31)\n31: bytes32 public constant _APPROVAL_TYPEHASH =keccak256(\"KYCApproval(uint256 kycRequirementGroup,address user,uint256 deadline)\");\n36: bytes32 public constant REGISTRY_ADMIN = keccak256(\"REGISTRY_ADMIN\");\n\n/Cash.sol\n22: bytes32 public constant TRANSFER_ROLE = keccak256(\"TRANSFER_ROLE\");\n\n/CashKYCSender.sol\n25: bytes32 public constant KYC_CONFIGURER_ROLE = keccak256(\"KYC_CONFIGURER_ROLE\");\n\n/CashKYCSenderReceiver.sol\n26: bytes32 public constant KYC_CONFIGURER_ROLE = keccak256(\"KYC_CONFIGURER_ROLE\");\n\n/CashFactory.sol\n44: bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n45: bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n\n/CashKYCSenderFactory.sol\n44: bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n45: bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n\n/CashKYCSenderReceiverFactory.sol\n44: bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n45: bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");", "github_refs_formatted": "KYCRegistry.sol#L31", "github_files_list": "KYCRegistry.sol", "github_refs_count": 1, "vulnerable_code_actual": "/CashManager.sol \n122: bytes32 public constant MANAGER_ADMIN = keccak256(\"MANAGER_ADMIN\");\n123: bytes32 public constant PAUSER_ADMIN = keccak256(\"PAUSER_ADMIN\");\n124: bytes32 public constant SETTER_ADMIN = keccak256(\"SETTER_ADMIN\");\n\n/[KYCRegistry.sol](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistry.sol#L31)\n31: bytes32 public constant _APPROVAL_TYPEHASH =keccak256(\"KYCApproval(uint256 kycRequirementGroup,address user,uint256 deadline)\");\n36: bytes32 public constant REGISTRY_ADMIN = keccak256(\"REGISTRY_ADMIN\");\n\n/Cash.sol\n22: bytes32 public constant TRANSFER_ROLE = keccak256(\"TRANSFER_ROLE\");\n\n/CashKYCSender.sol\n25: bytes32 public constant KYC_CONFIGURER_ROLE = keccak256(\"KYC_CONFIGURER_ROLE\");\n\n/CashKYCSenderReceiver.sol\n26: bytes32 public constant KYC_CONFIGURER_ROLE = keccak256(\"KYC_CONFIGURER_ROLE\");\n\n/CashFactory.sol\n44: bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n45: bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n\n/CashKYCSenderFactory.sol\n44: bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n45: bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n\n/CashKYCSenderReceiverFactory.sol\n44: bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n45: bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": "/CashManager.sol\n58: uint256 public minimumDepositAmount = 10_000;\n68: uint256 public exchangeRateDeltaLimit = 100;\n\n/OndoPriceOracleV2.sol\n77: uint256 public maxChainlinkOracleTimeDelay = 90000;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-ondo", "title": "descharre Q", "severity_raw": "Critical", "severity": "critical", "description": "# Summary\n## Low Risk\n|ID | Finding| Instances |\n|:----: | :--- | :----: |\n|1 | Other contract addresses can only be set once | 1 |\n|2 | Everyone can call initialize() function| 4 |\n|3 | type(uint).max is not equal to -1 | 1 |\n\n## Non critical\n|ID | Finding| Instances |\n|:----: | :--- | :----: |\n|1 | Don't use keccack256 in constants | 8 |\n| 2 | Require() or revert() statement that check input arguments should be at the top of the function| 5 |\n| 3 | Similar contracts| 4 |\n| 4 |Use modifier instead of duplicate require| 5 |\n| 5 |Multiple address mappings can be combined into a single mapping of an address to a struct| 1 |\n| 6 |Miscellaneous| 1 |\n\n\n# Details\n## Low Risk\n## 1 Other contract addresses can only be set once\nOther contract addresses are immutable so they can only be set once in the constructor. There is no other setter method for this. \n\nThis makes it so there is no room for error and can lead to contract reverts and redeployment.\n\nA solution for this is to make a setter method which only the owner can call. So if the contract address is wrong it can always be reset.\n\n[CashManager.sol](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L163-L164)\n```solidity\nL163: collateral = IERC20(_collateral);\nL164: cash = Cash(_cash);\n```\n## 2 Everyone can call initialize() function\nWhen the contract is not initialized, the initialize() function can be called by anybody. This can be an issue because roles will be set in the __ERC20PresetMinterPauser_init function.\n- [CashKYCSender](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/token/CashKYCSender.sol)\n- [CashKYCSenderReceiver](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/token/CashKYCSenderReceiver.sol)\n- [CCash.sol](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cCash/CCash.sol)\n- [CErc20.sol](https://github.com", "vulnerable_code": "L163: collateral = IERC20(_collateral);\nL164: cash = Cash(_cash);", "fixed_code": " /* Fail if repayAmount = -1 */\n if (repayAmount == type(uint).max) {\n revert LiquidateCloseAmountIsUintMax();\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/descharre-Q.md", "collected_at": "2026-01-02T18:15:06.054555+00:00", "source_hash": "594b1260755e54ce9aed18bfc90be94959802be768deb1004bd88c85072ceae2", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 69, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "L163: collateral = IERC20(_collateral);\nL164: cash = Cash(_cash);", "primary_code_language": "solidity", "primary_code_char_count": 69, "all_code_blocks": "// Code block 1 (solidity):\nL163: collateral = IERC20(_collateral);\nL164: cash = Cash(_cash);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "L163: collateral = IERC20(_collateral);\nL164: cash = Cash(_cash);", "github_refs_formatted": "CashManager.sol#L163-L164, CashKYCSender.sol, CashKYCSenderReceiver.sol, CCash.sol", "github_files_list": "CashManager.sol, CashKYCSenderReceiver.sol, CCash.sol, CashKYCSender.sol", "github_refs_count": 4, "vulnerable_code_actual": "L163: collateral = IERC20(_collateral);\nL164: cash = Cash(_cash);", "has_vulnerable_code_snippet": true, "fixed_code_actual": " /* Fail if repayAmount = -1 */\n if (repayAmount == type(uint).max) {\n revert LiquidateCloseAmountIsUintMax();\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "07-amphora", "title": "sm stack G", "severity_raw": "Medium", "severity": "medium", "description": "\n## Gas Optimizations\n### [G-1] Expand the range of unchecked in `VaultController::getCollateralInfo`\n\nApply the following git diff:\n\n```diff\ndiff --git a/core/solidity/contracts/core/VaultController.sol b/core/solidity/contracts/core/VaultController.sol\nindex 95e3009..be6fa2b 100644\n--- a/core/solidity/contracts/core/VaultController.sol\n+++ b/core/solidity/contracts/core/VaultController.sol\n@@ -235,12 +235,13 @@ contract VaultController is Pausable, IVaultController, ExponentialNoError, Owna\n uint256 _enabledTokensLength = enabledTokens.length;\n _end = _enabledTokensLength < _end ? _enabledTokensLength : _end;\n \n- _collateralsInfo = new CollateralInfo[](_end - _start);\n-\n+ unchecked {\n+ _collateralsInfo = new CollateralInfo[](_end - _start);\n+ }\n+ \n for (uint256 _i = _start; _i < _end;) {\n- _collateralsInfo[_i - _start] = tokenAddressCollateralInfo[enabledTokens[_i]];\n-\n unchecked {\n+ _collateralsInfo[_i - _start] = tokenAddressCollateralInfo[enabledTokens[_i]];\n ++_i;\n }\n }\n\n```\n\n### [G-2] Add unchecked to `Vault::modifyLiability`\n\nApply the following git diff:\n\n```diff\ndiff --git a/core/solidity/contracts/core/Vault.sol b/core/solidity/contracts/core/Vault.sol\nindex 62bc9ad..5e76e89 100644\n--- a/core/solidity/contracts/core/Vault.sol\n+++ b/core/solidity/contracts/core/Vault.sol\n@@ -311,7 +311,9 @@ contract Vault is IVault, Context {\n } else {\n // require statement only valid for repayment\n if (baseLiability < _baseAmount) revert Vault_RepayTooMuch();\n- baseLiability -= _baseAmount;\n+ unchecked {\n+ baseLiability -= _baseAmount;\n+ }\n }\n _newLiability = baseLiability;\n }\n\n```\n\n", "vulnerable_code": "### [G-2] Add unchecked to `Vault::modifyLiability`\n\nApply the following git diff:\n", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/sm-stack-G.md", "collected_at": "2026-01-02T18:24:02.664880+00:00", "source_hash": "595f15cd700ef98a575fff0d0c303489e37535ce06c862fbc8b3975c5e0cbf3b", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 1469, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "diff --git a/core/solidity/contracts/core/VaultController.sol b/core/solidity/contracts/core/VaultController.sol\nindex 95e3009..be6fa2b 100644\n--- a/core/solidity/contracts/core/VaultController.sol\n+++ b/core/solidity/contracts/core/VaultController.sol\n@@ -235,12 +235,13 @@ contract VaultController is Pausable, IVaultController, ExponentialNoError, Owna\n uint256 _enabledTokensLength = enabledTokens.length;\n _end = _enabledTokensLength < _end ? _enabledTokensLength : _end;\n \n- _collateralsInfo = new CollateralInfo[](_end - _start);\n-\n+ unchecked {\n+ _collateralsInfo = new CollateralInfo[](_end - _start);\n+ }\n+ \n for (uint256 _i = _start; _i < _end;) {\n- _collateralsInfo[_i - _start] = tokenAddressCollateralInfo[enabledTokens[_i]];\n-\n unchecked {\n+ _collateralsInfo[_i - _start] = tokenAddressCollateralInfo[enabledTokens[_i]];\n ++_i;\n }\n }", "primary_code_language": "diff", "primary_code_char_count": 913, "all_code_blocks": "// Code block 1 (diff):\ndiff --git a/core/solidity/contracts/core/VaultController.sol b/core/solidity/contracts/core/VaultController.sol\nindex 95e3009..be6fa2b 100644\n--- a/core/solidity/contracts/core/VaultController.sol\n+++ b/core/solidity/contracts/core/VaultController.sol\n@@ -235,12 +235,13 @@ contract VaultController is Pausable, IVaultController, ExponentialNoError, Owna\n uint256 _enabledTokensLength = enabledTokens.length;\n _end = _enabledTokensLength < _end ? _enabledTokensLength : _end;\n \n- _collateralsInfo = new CollateralInfo[](_end - _start);\n-\n+ unchecked {\n+ _collateralsInfo = new CollateralInfo[](_end - _start);\n+ }\n+ \n for (uint256 _i = _start; _i < _end;) {\n- _collateralsInfo[_i - _start] = tokenAddressCollateralInfo[enabledTokens[_i]];\n-\n unchecked {\n+ _collateralsInfo[_i - _start] = tokenAddressCollateralInfo[enabledTokens[_i]];\n ++_i;\n }\n }\n\n// Code block 2 (diff):\ndiff --git a/core/solidity/contracts/core/Vault.sol b/core/solidity/contracts/core/Vault.sol\nindex 62bc9ad..5e76e89 100644\n--- a/core/solidity/contracts/core/Vault.sol\n+++ b/core/solidity/contracts/core/Vault.sol\n@@ -311,7 +311,9 @@ contract Vault is IVault, Context {\n } else {\n // require statement only valid for repayment\n if (baseLiability < _baseAmount) revert Vault_RepayTooMuch();\n- baseLiability -= _baseAmount;\n+ unchecked {\n+ baseLiability -= _baseAmount;\n+ }\n }\n _newLiability = baseLiability;\n }", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "diff --git a/core/solidity/contracts/core/VaultController.sol b/core/solidity/contracts/core/VaultController.sol\nindex 95e3009..be6fa2b 100644\n--- a/core/solidity/contracts/core/VaultController.sol\n+++ b/core/solidity/contracts/core/VaultController.sol\n@@ -235,12 +235,13 @@ contract VaultController is Pausable, IVaultController, ExponentialNoError, Owna\n uint256 _enabledTokensLength = enabledTokens.length;\n _end = _enabledTokensLength < _end ? _enabledTokensLength : _end;\n \n- _collateralsInfo = new CollateralInfo[](_end - _start);\n-\n+ unchecked {\n+ _collateralsInfo = new CollateralInfo[](_end - _start);\n+ }\n+ \n for (uint256 _i = _start; _i < _end;) {\n- _collateralsInfo[_i - _start] = tokenAddressCollateralInfo[enabledTokens[_i]];\n-\n unchecked {\n+ _collateralsInfo[_i - _start] = tokenAddressCollateralInfo[enabledTokens[_i]];\n ++_i;\n }\n }\n\ndiff --git a/core/solidity/contracts/core/Vault.sol b/core/solidity/contracts/core/Vault.sol\nindex 62bc9ad..5e76e89 100644\n--- a/core/solidity/contracts/core/Vault.sol\n+++ b/core/solidity/contracts/core/Vault.sol\n@@ -311,7 +311,9 @@ contract Vault is IVault, Context {\n } else {\n // require statement only valid for repayment\n if (baseLiability < _baseAmount) revert Vault_RepayTooMuch();\n- baseLiability -= _baseAmount;\n+ unchecked {\n+ baseLiability -= _baseAmount;\n+ }\n }\n _newLiability = baseLiability;\n }", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "### [G-2] Add unchecked to `Vault::modifyLiability`\n\nApply the following git diff:\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 8} {"source": "c4", "protocol": "04-caviar", "title": "btk Q", "severity_raw": "Critical", "severity": "critical", "description": "# Protocol Overview\n\nThe Caviar Private Pools protocol is a decentralized platform on Ethereum that allows users to create and join private investment pools. The smart contract manages the funds within the pool, ensures compliance with the specified rules, and distributes rewards to members. The protocol democratizes investment opportunities, promotes decentralization, and fosters innovation in the investment industry.\n\n| Total Low issues |\n|------------------|\n\n| Risk | Issues Details | Number |\n|--------|-----------------------------------------------------------------------------------------------------------|---------------|\n| [L-01] | Critical changes should use-two step procedure | 1 |\n| [L-02] | No Storage Gap for Upgradeable contracts | 1 |\n| [L-03] | Loss of precision due to rounding | 1 |\n| [L-04] | Lack of `nonReentrant` modifier | 4 |\n| [L-05] | Integer overflow by unsafe casting | 4 |\n| [L-06] | Add `address(0)` check for the critical changes | 2 |\n| [L-07] | Array lengths not checked | 4 |\n| [L-08] | Unused `receive()` Function Will Lock Ether In Contract | 1 |\n| [L-09] | Misleading comment | 1 |\n| [L-10] | Fees are not capped ", "vulnerable_code": " function transferOwnership(address newOwner) public virtual onlyOwner {\n owner = newOwner;\n\n emit OwnershipTransferred(msg.sender, newOwner);\n }", "fixed_code": " /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/btk-Q.md", "collected_at": "2026-01-02T18:20:19.686906+00:00", "source_hash": "5967f13f5809a6ed87cb0fdade08ecaef3db28647929fc8e64dd23ca2a411fc2", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function transferOwnership(address newOwner) public virtual onlyOwner {\n owner = newOwner;\n\n emit OwnershipTransferred(msg.sender, newOwner);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "07-amphora", "title": "erebus G", "severity_raw": "Low", "severity": "low", "description": "# First\n[Here](https://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/core/USDA.sol#L259) the function `donation` makes the math to share the donation between all the `USDA` holders. However, if it get to be more than `MAX_SUPPLY`, the `_totalSupply` is set to `MAX_SUPPLY` and it will be doing unnecessary instructions in the `_gonsPerFragment` calculation for the following calls to donation from within the contract (if `_totalSupply` is not reduced). The optimization lies lies in adding an `if (_totalSupply == MAX_SUPPLY) return;` so that it does not spend gas doing redundant instructions when the supply has reached the limit. \n\n# Second\nIt is more efficient, for `++X` and `X++` to do `X += 1`. See the next test in foundry to show that it saves 8 gas and 2 gas respectively:\n\n```\npragma solidity ^0.8.13;\n\nimport \"forge-std/Test.sol\";\n\ncontract POC is Test {\n uint256 private a;\n\n function setUp() public {\n a = 0;\n }\n\n function testA() public {\n a++;\n }\n\n function testB() public {\n a += 1;\n }\n\n function testC() public {\n ++a;\n }\n}\n```\n\nResults:\n\n- testA -> 22397\n- testB -> 22389\n- testC -> 22391\n\nConsider using the `X += 1` version everywhere. The RE can be `[^ \\+]*\\+\\+` for the occurrences of `X++` and `\\+\\+[^ \\)]*` for the occurrences of `++X`. The same applies to other arithmetic operations.\n\n# Third \nConsider making [MAX_SUPPLY](https://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/utils/UFragments.sol#L70C18-L70C28) constant, which saves storage read/writes (ssread/sstore costs A LOT of gas) from being done within the contract's logic (and saves more opcodes, which reduces its size). The same goes to many others like [name](https://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/utils/UFragments.sol#L76) and [symbol](https://githu", "vulnerable_code": "pragma solidity ^0.8.13;\n\nimport \"forge-std/Test.sol\";\n\ncontract POC is Test {\n uint256 private a;\n\n function setUp() public {\n a = 0;\n }\n\n function testA() public {\n a++;\n }\n\n function testB() public {\n a += 1;\n }\n\n function testC() public {\n ++a;\n }\n}", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/erebus-G.md", "collected_at": "2026-01-02T18:23:45.248788+00:00", "source_hash": "596e25b2b2a83135ff1e518adc294d936f7c925d859e02430e3c8f419fe43005", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 308, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "pragma solidity ^0.8.13;\n\nimport \"forge-std/Test.sol\";\n\ncontract POC is Test {\n uint256 private a;\n\n function setUp() public {\n a = 0;\n }\n\n function testA() public {\n a++;\n }\n\n function testB() public {\n a += 1;\n }\n\n function testC() public {\n ++a;\n }\n}", "primary_code_language": "unknown", "primary_code_char_count": 308, "all_code_blocks": "// Code block 1 (unknown):\npragma solidity ^0.8.13;\n\nimport \"forge-std/Test.sol\";\n\ncontract POC is Test {\n uint256 private a;\n\n function setUp() public {\n a = 0;\n }\n\n function testA() public {\n a++;\n }\n\n function testB() public {\n a += 1;\n }\n\n function testC() public {\n ++a;\n }\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "USDA.sol#L259, UFragments.sol#L70-L18, UFragments.sol#L76", "github_files_list": "UFragments.sol, USDA.sol", "github_refs_count": 3, "vulnerable_code_actual": "pragma solidity ^0.8.13;\n\nimport \"forge-std/Test.sol\";\n\ncontract POC is Test {\n uint256 private a;\n\n function setUp() public {\n a = 0;\n }\n\n function testA() public {\n a++;\n }\n\n function testB() public {\n a += 1;\n }\n\n function testC() public {\n ++a;\n }\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "01-ondo", "title": "IllIllI Q", "severity_raw": "Critical", "severity": "critical", "description": "\n## Summary\n\n### Low Risk Issues\n| |Issue|Instances|\n|-|:-|:-:|\n| [L‑01] | Upgradeable contract not initialized | 1 | \n| [L‑02] | Loss of precision | 1 | \n| [L‑03] | Owner can renounce while system is paused | 1 | \n| [L‑04] | `require()` should be used instead of `assert()` | 3 | \n\nTotal: 6 instances over 4 issues\n\n\n### Non-critical Issues\n| |Issue|Instances|\n|-|:-|:-:|\n| [N‑01] | Upgradeable contract is missing a `__gap[50]` storage variable to allow for new storage variables in later versions | 4 | \n| [N‑02] | Import declarations should import specific identifiers, rather than the whole file | 45 | \n| [N‑03] | Duplicate import statements | 1 | \n| [N‑04] | The `nonReentrant` `modifier` should occur before all other modifiers | 3 | \n| [N‑05] | Adding a `return` statement when the function defines a named return variable, is redundant | 1 | \n| [N‑06] | `constant`s should be defined rather than using magic numbers | 3 | \n| [N‑07] | Numeric values having to do with time should use time units for readability | 1 | \n| [N‑08] | Events that mark critical parameter changes should contain both the old and the new value | 2 | \n| [N‑09] | Expressions for constant values such as a call to `keccak256()`, should use `immutable` rather than `constant` | 14 | \n| [N‑10] | Constant redefined elsewhere | 7 | \n| [N‑11] | Typos | 5 | \n| [N‑12] | Constructor visibility is ignored | 3 | \n| [N‑13] | File is missing NatSpec | 1 | \n| [N‑14] | NatSpec is incomplete | 16 | \n| [N‑15] | Consider using `delete` rather than assigning zero to clear values | 3 | \n| [N‑16] | Contracts should have full test coverage | 1 | \n| [N‑17] | Large or complicated code bases should implement fuzzing tests | 1 | \n| [N‑18] | Function ordering does not follow the Solidity style guide | 8 | \n| [N‑19] | Contract does not follow the Solidity style guide's sug", "vulnerable_code": "File: contracts/cash/token/Cash.sol\n\n/// @audit missing __ERC20PresetMinterPauser_init()\n21: contract Cash is ERC20PresetMinterPauserUpgradeable {\n", "fixed_code": "File: contracts/cash/CashManager.sol\n\n755 uint256 collateralAmountDue = (amountToDist * cashAmountReturned) /\n756: quantityBurned;\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/IllIllI-Q.md", "collected_at": "2026-01-02T18:14:38.688697+00:00", "source_hash": "596fa13e3119206f20db51bdf016621b63262ab35d50a56c7574f962da416d0d", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: contracts/cash/token/Cash.sol\n\n/// @audit missing __ERC20PresetMinterPauser_init()\n21: contract Cash is ERC20PresetMinterPauserUpgradeable {\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/cash/CashManager.sol\n\n755 uint256 collateralAmountDue = (amountToDist * cashAmountReturned) /\n756: quantityBurned;\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-revert-lend", "title": "0xbrett8571 Analysis", "severity_raw": "Critical", "severity": "critical", "description": "Executive Summary\n-----------------\n\nThis report presents the findings from an in-depth security review of the Revert Lend smart contracts. The goal was to evaluate the codebase for potential vulnerabilities, centralization risks, architecture issues, and overall code quality that could negatively impact the protocol and its users.\n\nThe review uncovered several areas of concern, including centralization risks, potential reentrancy issues, signature replay vulnerabilities, and risks around unchecked user input and admin configuration abilities. While the codebase is generally well-structured, architectural improvements around access control and input validation are recommended. \n\nOverall, the identified vulnerabilities pose a material risk to protocol and user funds if not addressed. Detailed descriptions of the findings along with code snippets and recommendations are provided in the following sections.\n\nScope and Approach\n------------------\n\nThe security review covered the entire smart contract codebase for the Revert Lend protocol, consisting of the core contracts (V3Vault, V3Oracle, InterestRateModel), transformer contracts (AutoCompound, AutoRange, LeverageTransformer, V3Utils), and supporting utility contracts (Swapper, FlashloanLiquidator).\n\nThe approach taken was a combination of automated scanning using static analysis tools and manual code inspection. Particular focus was given to evaluating the codebase for common smart contract pitfalls, correctness of the implementation against the specified logic, proper access controls, and centralization/admin risks. \n\nArchitecture Review\n-------------------\n\nRevert Lend follows a typical design pattern for lending protocols, with the core V3Vault contract holding user deposits and collateral, while interacting with various transformer contracts to enable LP position management. \n\nSome key architectural observations and risks:\n\n### Vault and Transformer Interaction\n\nThe protocol allows \"transformer\" contracts to be wh", "vulnerable_code": "function transform(uint256 tokenId, address transformer, bytes calldata data)\n external\n override\n returns (uint256 newTokenId)\n{\n if (tokenId == 0 || !transformerAllowList[transformer]) {\n revert TransformNotAllowed();\n }\n // ...\n (bool success,) = transformer.call(data);\n // ...\n}", "fixed_code": "function setTokenConfig(\n address token,\n AggregatorV3Interface feed,\n uint32 maxFeedAge,\n IUniswapV3Pool pool,\n uint32 twapSeconds,\n Mode mode,\n uint16 maxDifference\n) external onlyOwner {\n // ...\n feedConfigs[token] = config;\n // ...\n}", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/0xbrett8571-Analysis.md", "collected_at": "2026-01-02T19:02:54.794442+00:00", "source_hash": "5974f2ef457008dbe9b279e41020abb8a95fd7a04ec2cce02eb1864b94ff0e35", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function transform(uint256 tokenId, address transformer, bytes calldata data)\n external\n override\n returns (uint256 newTokenId)\n{\n if (tokenId == 0 || !transformerAllowList[transformer]) {\n revert TransformNotAllowed();\n }\n // ...\n (bool success,) = transformer.call(data);\n // ...\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function setTokenConfig(\n address token,\n AggregatorV3Interface feed,\n uint32 maxFeedAge,\n IUniswapV3Pool pool,\n uint32 twapSeconds,\n Mode mode,\n uint16 maxDifference\n) external onlyOwner {\n // ...\n feedConfigs[token] = config;\n // ...\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "04-caviar", "title": "0xWagmi Q", "severity_raw": "Critical", "severity": "critical", "description": "\n| Letter | Name | Description |\n|:--:|:-------:|:-------:|\n| L | Low risk | Potential risk |\n| NC | Non-critical | Non risky findings |\n| R | Refactor | Changing the code |\n| O | Ordinary | Often found issues |\n\n\n### Low Risk \n\n| Count | Explanation | Instances |\n|:--:|:-------|:--:|\n| [L-01] | If a user sends ETH direcly to ETH router it could be stolen by another user | 1 |\n| [L-02] | Allowing anyOne to reenter the `function create` in factory.sol may be problamatic | 1 |\n| [L-03] | Use openzeppelin re-entrancyGuard | 8 |\n| [L-04] | Use openzeppelin upgradable proxy contracts | 1 |\n| [L-05] | execute function in privatePool is a risky implementation | 1 |\n\n### Non-Critical \n| Count | Explanation | Instances |\n|:--:|:-------|:--:|\n| [N-01] | Floating Pragma | 5 |\n\n| Total Found Issues | 17 |\n|:--:|:--:|\n\n\n\n\n### [L-01] \u00a0 If a user send ETH directly to ETH router it could be stolen by another user\n---\n\ncopy the below code to test folder run `forge test --match-contract TestUser -vvvv`\nLets say,\n1 .Deloyer creates a private Pool ; \n2 . Alice sends ETH to router contract directly it triggers the receive function now 1 ETH is in router contract \n3 . Bob create a nft called fake just mint a 1 fake nft token id 0 to address(privatePool)\n4 . Bob just call sell function with 0 ether ; \nThen bobs contract will recieve alice's 1 ether ;\nThis could be a medium sevierity but I think users are not supposed to directly send ether to \nthe router address but a user can accidently send eth to the ETH router via receive() ; \n\n\n```js\n// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.19;\n\n \n\nimport \"./Fixture.sol\";\n\n \ncontract Fake is ERC721 {\n\u00a0 \u00a0 constructor() ERC721(\"FAKE\", \"FK\") {}\n\u00a0 \u00a0 function mint(address to, uint256 id) public {\n\u00a0 \u00a0 \u00a0 \u00a0 _mint(to, id);\n\u00a0 \u00a0 }\n\n\u00a0 \u00a0 function tokenURI(\n\u00a0 \u00a0 \u00a0 \u00a0 uint256\n\u00a0 \u00a0 ) public view virtual override returns (string memory) {\n\u00a0 \u00a0 \u00a0 \u00a0 return \"\";\n\u00a0 \u00a0 }\n}\n\n \n\ncontract TestUser is Fixture {\n\u00a0 \u00a0 //users\n\u00a0", "vulnerable_code": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.19;\n\n \n\nimport \"./Fixture.sol\";\n\n \ncontract Fake is ERC721 {\n\u00a0 \u00a0 constructor() ERC721(\"FAKE\", \"FK\") {}\n\u00a0 \u00a0 function mint(address to, uint256 id) public {\n\u00a0 \u00a0 \u00a0 \u00a0 _mint(to, id);\n\u00a0 \u00a0 }\n\n\u00a0 \u00a0 function tokenURI(\n\u00a0 \u00a0 \u00a0 \u00a0 uint256\n\u00a0 \u00a0 ) public view virtual override returns (string memory) {\n\u00a0 \u00a0 \u00a0 \u00a0 return \"\";\n\u00a0 \u00a0 }\n}\n\n \n\ncontract TestUser is Fixture {\n\u00a0 \u00a0 //users\n\u00a0 \u00a0 address alice;\n\u00a0 \u00a0 address bob;\n\u00a0 \u00a0 address deployer;\n\u00a0 \u00a0 ///pool\n\u00a0 \u00a0 Fake fake;\n\u00a0 \u00a0 PrivatePool public privatePool;\n\u00a0 \u00a0 EthRouter.Buy[] public buys;\n\u00a0 \u00a0 uint256 public totalTokens = 0;\n\u00a0 \u00a0 uint256 public maxInputAmount = 0;\n\n\u00a0 \u00a0 function setUp() public {\n\u00a0 \u00a0 \u00a0 \u00a0 alice = makeAddr(\"Alice\");\n\u00a0 \u00a0 \u00a0 \u00a0 bob = makeAddr(\"Bob\");\n\u00a0 \u00a0 \u00a0 \u00a0 deployer = makeAddr(\"Deployer\");\n\u00a0 \u00a0 \u00a0 \u00a0 fake = new Fake();\n\u00a0 \u00a0 \u00a0 \u00a0 vm.deal(address(this), 0 ether);\n\u00a0 \u00a0 \u00a0 \u00a0 vm.deal(address(alice), 1 ether);\n\u00a0 \u00a0 \u00a0 \u00a0 vm.deal(address(bob), 0 ether);\n\u00a0 \u00a0 \u00a0 \u00a0 vm.deal(address(deployer), 1 ether);\n\u00a0 \u00a0 \u00a0 \u00a0 vm.label(address(this), \"ThisContract\");\n\u00a0 \u00a0 \u00a0 \u00a0 vm.startPrank(deployer);\n\u00a0 \u00a0 \u00a0 \u00a0 _addBuy();\n\u00a0 \u00a0 \u00a0 \u00a0 vm.stopPrank();\n\u00a0 \u00a0 \u00a0 \u00a0 for (uint256 i = 0; i < buys.length; i++) {\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 maxInputAmount += buys[i].baseTokenAmount;\n\u00a0 \u00a0 \u00a0 \u00a0 }\n\u00a0 \u00a0 }\n\n\u00a0 \u00a0 function _addBuy() internal {\n\u00a0 \u00a0 \u00a0 \u00a0 uint256[] memory empty = new uint256[](0);\n\u00a0 \u00a0 \u00a0 \u00a0 privatePool = factory.create{value: 1e18}(\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 address(0),\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 address(milady),\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 10e18,\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 10e18,\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 200,\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 100,\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 bytes32(0),\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 true,\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 false,\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 bytes32(address(this).balance), // random between each call to _addBuy\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 empty,\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 1e18\n\u00a0 \u00a0 \u00a0 \u00a0 );\n\n\u00a0 \u00a0 \u00a0 \u00a0 uint256[] memory tokenIds = new uint256[](1);\n\u00a0 \u00a0 \u00a0 \u00a0 for (uint256 i = 0; i < 1; i++) {\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 milady.mint(address(privatePool), i + totalTokens);\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 tokenIds[i] = i + totalTokens;\n\u00a0 \u00a0 \u00a0 \u00a0 }\n\n \n\n\u00a0 \u00a0 \u00a0 \u00a0 totalTokens += 1;\n\u00a0 \u00a0 \u00a0 \u00a0 (uint256 baseTokenAmount, , ) = privatePool.buyQuote(\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 tok", "fixed_code": "### [L-2] \u00a0 Allowing anyOne to reenter the `function create` in factory.sol may be problamatic \n\nIn function create we have ,", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/0xWagmi-Q.md", "collected_at": "2026-01-02T18:19:20.783337+00:00", "source_hash": "5987a60451c1af9242ee7cc7db04a63a226706bc34c159fe7778c5431d4f405b", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.19;\n\n \n\nimport \"./Fixture.sol\";\n\n \ncontract Fake is ERC721 {\n\u00a0 \u00a0 constructor() ERC721(\"FAKE\", \"FK\") {}\n\u00a0 \u00a0 function mint(address to, uint256 id) public {\n\u00a0 \u00a0 \u00a0 \u00a0 _mint(to, id);\n\u00a0 \u00a0 }\n\n\u00a0 \u00a0 function tokenURI(\n\u00a0 \u00a0 \u00a0 \u00a0 uint256\n\u00a0 \u00a0 ) public view virtual override returns (string memory) {\n\u00a0 \u00a0 \u00a0 \u00a0 return \"\";\n\u00a0 \u00a0 }\n}\n\n \n\ncontract TestUser is Fixture {\n\u00a0 \u00a0 //users\n\u00a0 \u00a0 address alice;\n\u00a0 \u00a0 address bob;\n\u00a0 \u00a0 address deployer;\n\u00a0 \u00a0 ///pool\n\u00a0 \u00a0 Fake fake;\n\u00a0 \u00a0 PrivatePool public privatePool;\n\u00a0 \u00a0 EthRouter.Buy[] public buys;\n\u00a0 \u00a0 uint256 public totalTokens = 0;\n\u00a0 \u00a0 uint256 public maxInputAmount = 0;\n\n\u00a0 \u00a0 function setUp() public {\n\u00a0 \u00a0 \u00a0 \u00a0 alice = makeAddr(\"Alice\");\n\u00a0 \u00a0 \u00a0 \u00a0 bob = makeAddr(\"Bob\");\n\u00a0 \u00a0 \u00a0 \u00a0 deployer = makeAddr(\"Deployer\");\n\u00a0 \u00a0 \u00a0 \u00a0 fake = new Fake();\n\u00a0 \u00a0 \u00a0 \u00a0 vm.deal(address(this), 0 ether);\n\u00a0 \u00a0 \u00a0 \u00a0 vm.deal(address(alice), 1 ether);\n\u00a0 \u00a0 \u00a0 \u00a0 vm.deal(address(bob), 0 ether);\n\u00a0 \u00a0 \u00a0 \u00a0 vm.deal(address(deployer), 1 ether);\n\u00a0 \u00a0 \u00a0 \u00a0 vm.label(address(this), \"ThisContract\");\n\u00a0 \u00a0 \u00a0 \u00a0 vm.startPrank(deployer);\n\u00a0 \u00a0 \u00a0 \u00a0 _addBuy();\n\u00a0 \u00a0 \u00a0 \u00a0 vm.stopPrank();\n\u00a0 \u00a0 \u00a0 \u00a0 for (uint256 i = 0; i < buys.length; i++) {\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 maxInputAmount += buys[i].baseTokenAmount;\n\u00a0 \u00a0 \u00a0 \u00a0 }\n\u00a0 \u00a0 }\n\n\u00a0 \u00a0 function _addBuy() internal {\n\u00a0 \u00a0 \u00a0 \u00a0 uint256[] memory empty = new uint256[](0);\n\u00a0 \u00a0 \u00a0 \u00a0 privatePool = factory.create{value: 1e18}(\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 address(0),\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 address(milady),\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 10e18,\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 10e18,\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 200,\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 100,\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 bytes32(0),\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 true,\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 false,\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 bytes32(address(this).balance), // random between each call to _addBuy\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 empty,\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 1e18\n\u00a0 \u00a0 \u00a0 \u00a0 );\n\n\u00a0 \u00a0 \u00a0 \u00a0 uint256[] memory tokenIds = new uint256[](1);\n\u00a0 \u00a0 \u00a0 \u00a0 for (uint256 i = 0; i < 1; i++) {\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 milady.mint(address(privatePool), i + totalTokens);\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 tokenIds[i] = i + totalTokens;\n\u00a0 \u00a0 \u00a0 \u00a0 }\n\n \n\n\u00a0 \u00a0 \u00a0 \u00a0 totalTokens += 1;\n\u00a0 \u00a0 \u00a0 \u00a0 (uint256 baseTokenAmount, , ) = privatePool.buyQuote(\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 tok", "has_vulnerable_code_snippet": true, "fixed_code_actual": "### [L-2] \u00a0 Allowing anyOne to reenter the `function create` in factory.sol may be problamatic \n\nIn function create we have ,", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-revert-lend", "title": "cryptothemex Q", "severity_raw": "Critical", "severity": "critical", "description": "### [L-01] Local variable shadowing\n\nShadowing of other variables using local variables. **Recom** Rename the local variables that shadow another component.\n\n*There are 21 instance(s) of this issue:*\n\n```solidity\nFile: src/V3Vault.sol\n\n/// @audit ******************* Issue Detail *******************\nV3Vault._repay(uint256,uint256,bool,bytes).owner (L#1001) shadows:\n\t- Ownable.owner() (L#43-45) (function)\n\n/// @audit ****************** Affected Code *******************\n1001: address owner = tokenOwner[tokenId];\n```\n\n*GitHub* : [1001-1001](https://github.com/code-423n4/2024-03-revert-lend/src/V3Vault.sol#L1001-L1001)\n\n```solidity\nFile: src/V3Vault.sol\n\n/// @audit ******************* Issue Detail *******************\nV3Vault._cleanupLoan(uint256,uint256,uint256,address).owner (L#1077) shadows:\n\t- Ownable.owner() (L#43-45) (function)\n\n/// @audit ****************** Affected Code *******************\n1077: function _cleanupLoan(uint256 tokenId, uint256 debtExchangeRateX96, uint256 lendExchangeRateX96, address owner)\n```\n\n*GitHub* : [1077-1077](https://github.com/code-423n4/2024-03-revert-lend/src/V3Vault.sol#L1077-L1077)\n\n```solidity\nFile: src/V3Vault.sol\n\n/// @audit ******************* Issue Detail *******************\nV3Vault.transform(uint256,address,bytes).owner (L#531) shadows:\n\t- Ownable.owner() (L#43-45) (function)\n\n/// @audit ****************** Affected Code *******************\n 531: address owner = nonfungiblePositionManager.ownerOf(tokenId);\n```\n\n*GitHub* : [531-531](https://github.com/code-423n4/2024-03-revert-lend/src/V3Vault.sol#L531-L531)\n\n```solidity\nFile: src/V3Vault.sol\n\n/// @audit ******************* Issue Detail *******************\nV3Vault.loanCount(address).owner (L#264) shadows:\n\t- Ownable.owner() (L#43-45) (function)\n\n/// @audit ****************** Affected Code *******************\n 264: function loanCount(address owner) external view override returns (uint256) {\n```\n\n*GitHub* : [264-264](https://github.com/code", "vulnerable_code": "File: src/V3Vault.sol\n\n/// @audit ******************* Issue Detail *******************\nV3Vault._repay(uint256,uint256,bool,bytes).owner (L#1001) shadows:\n\t- Ownable.owner() (L#43-45) (function)\n\n/// @audit ****************** Affected Code *******************\n1001: address owner = tokenOwner[tokenId];", "fixed_code": "File: src/V3Vault.sol\n\n/// @audit ******************* Issue Detail *******************\nV3Vault._cleanupLoan(uint256,uint256,uint256,address).owner (L#1077) shadows:\n\t- Ownable.owner() (L#43-45) (function)\n\n/// @audit ****************** Affected Code *******************\n1077: function _cleanupLoan(uint256 tokenId, uint256 debtExchangeRateX96, uint256 lendExchangeRateX96, address owner)", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/cryptothemex-Q.md", "collected_at": "2026-01-02T19:03:10.038809+00:00", "source_hash": "59ae18f0632203b5eeb4d7ddded495b09776eaf2f1ae3125a039991eaa9b6e16", "code_block_count": 4, "solidity_block_count": 4, "total_code_chars": 1358, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: src/V3Vault.sol\n\n/// @audit ******************* Issue Detail *******************\nV3Vault._repay(uint256,uint256,bool,bytes).owner (L#1001) shadows:\n\t- Ownable.owner() (L#43-45) (function)\n\n/// @audit ****************** Affected Code *******************\n1001: address owner = tokenOwner[tokenId];", "primary_code_language": "solidity", "primary_code_char_count": 309, "all_code_blocks": "// Code block 1 (solidity):\nFile: src/V3Vault.sol\n\n/// @audit ******************* Issue Detail *******************\nV3Vault._repay(uint256,uint256,bool,bytes).owner (L#1001) shadows:\n\t- Ownable.owner() (L#43-45) (function)\n\n/// @audit ****************** Affected Code *******************\n1001: address owner = tokenOwner[tokenId];\n\n// Code block 2 (solidity):\nFile: src/V3Vault.sol\n\n/// @audit ******************* Issue Detail *******************\nV3Vault._cleanupLoan(uint256,uint256,uint256,address).owner (L#1077) shadows:\n\t- Ownable.owner() (L#43-45) (function)\n\n/// @audit ****************** Affected Code *******************\n1077: function _cleanupLoan(uint256 tokenId, uint256 debtExchangeRateX96, uint256 lendExchangeRateX96, address owner)\n\n// Code block 3 (solidity):\nFile: src/V3Vault.sol\n\n/// @audit ******************* Issue Detail *******************\nV3Vault.transform(uint256,address,bytes).owner (L#531) shadows:\n\t- Ownable.owner() (L#43-45) (function)\n\n/// @audit ****************** Affected Code *******************\n 531: address owner = nonfungiblePositionManager.ownerOf(tokenId);\n\n// Code block 4 (solidity):\nFile: src/V3Vault.sol\n\n/// @audit ******************* Issue Detail *******************\nV3Vault.loanCount(address).owner (L#264) shadows:\n\t- Ownable.owner() (L#43-45) (function)\n\n/// @audit ****************** Affected Code *******************\n 264: function loanCount(address owner) external view override returns (uint256) {", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: src/V3Vault.sol\n\n/// @audit ******************* Issue Detail *******************\nV3Vault._repay(uint256,uint256,bool,bytes).owner (L#1001) shadows:\n\t- Ownable.owner() (L#43-45) (function)\n\n/// @audit ****************** Affected Code *******************\n1001: address owner = tokenOwner[tokenId];\n\nFile: src/V3Vault.sol\n\n/// @audit ******************* Issue Detail *******************\nV3Vault._cleanupLoan(uint256,uint256,uint256,address).owner (L#1077) shadows:\n\t- Ownable.owner() (L#43-45) (function)\n\n/// @audit ****************** Affected Code *******************\n1077: function _cleanupLoan(uint256 tokenId, uint256 debtExchangeRateX96, uint256 lendExchangeRateX96, address owner)\n\nFile: src/V3Vault.sol\n\n/// @audit ******************* Issue Detail *******************\nV3Vault.transform(uint256,address,bytes).owner (L#531) shadows:\n\t- Ownable.owner() (L#43-45) (function)\n\n/// @audit ****************** Affected Code *******************\n 531: address owner = nonfungiblePositionManager.ownerOf(tokenId);\n\nFile: src/V3Vault.sol\n\n/// @audit ******************* Issue Detail *******************\nV3Vault.loanCount(address).owner (L#264) shadows:\n\t- Ownable.owner() (L#43-45) (function)\n\n/// @audit ****************** Affected Code *******************\n 264: function loanCount(address owner) external view override returns (uint256) {", "github_refs_formatted": "V3Vault.sol#L1001, V3Vault.sol#L1077, V3Vault.sol#L531", "github_files_list": "V3Vault.sol", "github_refs_count": 3, "vulnerable_code_actual": "File: src/V3Vault.sol\n\n/// @audit ******************* Issue Detail *******************\nV3Vault._repay(uint256,uint256,bool,bytes).owner (L#1001) shadows:\n\t- Ownable.owner() (L#43-45) (function)\n\n/// @audit ****************** Affected Code *******************\n1001: address owner = tokenOwner[tokenId];", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: src/V3Vault.sol\n\n/// @audit ******************* Issue Detail *******************\nV3Vault._cleanupLoan(uint256,uint256,uint256,address).owner (L#1077) shadows:\n\t- Ownable.owner() (L#43-45) (function)\n\n/// @audit ****************** Affected Code *******************\n1077: function _cleanupLoan(uint256 tokenId, uint256 debtExchangeRateX96, uint256 lendExchangeRateX96, address owner)", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "03-asymmetry", "title": "Lavishq Q", "severity_raw": "High", "severity": "high", "description": "## G1 - require statement can be chained using && operator\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L65 and L66 can be chained in a single require() statement as such `require(msg.value >= minAmount && msg.value <= maxAmount, \"invalid amount\");` (error could be a custom error or even something other than `invalid amount`) so that when the line executes most of the times it saves gas and does not check second case.\nThe reason for adding minAmount first is because assuming the maxAmount is 200 ETH and there will be only rare cases that a person exceeds the maxAmount threashold but there is high possibility that many people will send less value.\n\nAlso, it is recommended to have the check and perform the interaction of this specific case of front end side in case the amount is entered by the user is less than minAmount then ask him to enter more and vice versa.\n\n## G2 - for loop can be chained in one for loop\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L63\nfor loop can be chained in a single for loop saving loads of gas\nthe only things i changed is optimized variables which store default values again and merged both the for loop in one\n\nCode :\n\n```solidity\nfunction stake() external payable {\n require(pauseStaking == false, \"staking is paused\");\n require(msg.value >= minAmount && msg.value <= maxAmount, \"invalid amount\"); // This is taken from G1 of my report\n\n uint256 underlyingValue;\n uint256 totalStakeValueEth; // total amount of derivatives worth of ETH in system\n\n // Getting underlying value in terms of ETH for each derivative\n for (uint i; i < derivativeCount; i++) {\n underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;\n\n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight == 0) continue;\n uint256 ethAmount = (msg.value * weight) / totalWeight", "vulnerable_code": "function stake() external payable {\n require(pauseStaking == false, \"staking is paused\");\n require(msg.value >= minAmount && msg.value <= maxAmount, \"invalid amount\"); // This is taken from G1 of my report\n\n uint256 underlyingValue;\n uint256 totalStakeValueEth; // total amount of derivatives worth of ETH in system\n\n // Getting underlying value in terms of ETH for each derivative\n for (uint i; i < derivativeCount; i++) {\n underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;\n\n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight == 0) continue;\n uint256 ethAmount = (msg.value * weight) / totalWeight;\n\n // This is slightly less than ethAmount because slippage\n uint256 depositAmount = derivative.deposit{ value: ethAmount }();\n uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n depositAmount\n ) * depositAmount) / 10 ** 18;\n totalStakeValueEth += derivativeReceivedEthValue;\n }\n\n uint256 totalSupply = totalSupply();\n uint256 preDepositPrice; // Price of safETH in regards to ETH\n if (totalSupply == 0)\n preDepositPrice = 10 ** 18; // initializes with a price of 1\n else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n\n // mintAmount represents a percentage of the total assets in the system\n uint256 mintAmount = (totalStakeValueEth * 10 ** 18) / preDepositPrice;\n _mint(msg.sender, mintAmount);\n emit Staked(msg.sender, msg.value, mintAmount);\n}\n", "fixed_code": "", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Lavishq-Q.md", "collected_at": "2026-01-02T18:18:16.618495+00:00", "source_hash": "59ba6ccc8f5fedb064ab1b4c3173675b6893674a7f9bd5be811135f3fc584b2c", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol#L65, SafEth.sol#L63", "github_files_list": "SafEth.sol", "github_refs_count": 2, "vulnerable_code_actual": "function stake() external payable {\n require(pauseStaking == false, \"staking is paused\");\n require(msg.value >= minAmount && msg.value <= maxAmount, \"invalid amount\"); // This is taken from G1 of my report\n\n uint256 underlyingValue;\n uint256 totalStakeValueEth; // total amount of derivatives worth of ETH in system\n\n // Getting underlying value in terms of ETH for each derivative\n for (uint i; i < derivativeCount; i++) {\n underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;\n\n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight == 0) continue;\n uint256 ethAmount = (msg.value * weight) / totalWeight;\n\n // This is slightly less than ethAmount because slippage\n uint256 depositAmount = derivative.deposit{ value: ethAmount }();\n uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n depositAmount\n ) * depositAmount) / 10 ** 18;\n totalStakeValueEth += derivativeReceivedEthValue;\n }\n\n uint256 totalSupply = totalSupply();\n uint256 preDepositPrice; // Price of safETH in regards to ETH\n if (totalSupply == 0)\n preDepositPrice = 10 ** 18; // initializes with a price of 1\n else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n\n // mintAmount represents a percentage of the total assets in the system\n uint256 mintAmount = (totalStakeValueEth * 10 ** 18) / preDepositPrice;\n _mint(msg.sender, mintAmount);\n emit Staked(msg.sender, msg.value, mintAmount);\n}\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "05-ajna", "title": "0xnev Q", "severity_raw": "Critical", "severity": "critical", "description": "### Issues Template\n| Letter | Name | Description |\n|:--:|:-------:|:-------:|\n| L | Low risk | Potential risk |\n| NC | Non-critical | Non risky findings |\n| R | Refactor | Code changes |\n\n| Total Found Issues | 14 |\n|:--:|:--:|\n\n### Low Risk Template\n| Count | Title | Instances |\n|:--:|:-------|:--:|\n| [L-01] | `getPositionInfo` may return wrong information for positions not deleted after calling `moveLiquidity` | 1 |\n| [L-02] | Lack of access control for `PositionManager.mint` | 4 |\n\n| Total Low Risk Issues | 2 |\n|:--:|:--:|\n\n### Non-Critical Template\n| Count | Title | Instances |\n|:--:|:-------|:--:|\n| [N-01] | Users may not receive deserved reward when `RewardsManager.sol` contract has low AJNA balance | 1 |\n| [N-02] | Lender can unexpectedly claim rewards from all existing positions in buckets when `RewardsManager.movingStakedLiquidity ` is called instead of just specified buckets where postions is moved | 1 |\n| [N-03] | User can still memorialize and stake positions to NFT at buckets after they have already move position | 1 |\n| [N-04] | Consider using `block.timestamp` instead of `block.number` | 1 |\n\n| Total Non-Critical Issues | 4 |\n|:--:|:--:|\n\n### Refactor Issues Template\n| Count | Title | Instances |\n|:--:|:-------|:--:|\n| [R-01] | Confusing mapping name | 1 |\n| [R-02] | Repeated owner checks can be refactored into a modifer | 2 |\n| [R-03] | Use `WAD` constant declared | |\n| [R-04] | Do not need to use `+=` operator, `=` can be used instead | 1 |\n| [R-05] | `else if` block in `Maths.wsqrt()` can be removed | 1 |\n| [R-06] | `RewardsManager._getBurnEpochsClaimed` can be refactored | 1 |\n| [R-07] | Use constant instead of immutable for `ajnaTokenAddress` in `Funding.sol` | 1 |\n| [R-08] | Implement `StandardFunding._setNewDistributionId()` in `StandardFunding.startNewDistributionPeriod()` directly | 1 |\n\n| Total Refactor Issues | 8 |\n|:--:|:--:|\n\n\n### [L-01] `PostionManager.getPositionInfo` may return wrong information for positions not deleted after cal", "vulnerable_code": "function getPositionInfo(\n uint256 tokenId_,\n uint256 index_\n) external view override returns (uint256, uint256) {\n return (\n positions[tokenId_][index_].lps,\n positions[tokenId_][index_].depositTime\n );\n}", "fixed_code": "function mint(\n MintParams calldata params_\n) external override nonReentrant returns (uint256 tokenId_) {\n tokenId_ = _nextId++;\n\n // revert if the address is not a valid Ajna pool\n if (!_isAjnaPool(params_.pool, params_.poolSubsetHash)) revert NotAjnaPool();\n\n // record which pool the tokenId was minted in\n poolKey[tokenId_] = params_.pool;\n\n _mint(params_.recipient, tokenId_);\n\n emit Mint(params_.recipient, params_.pool, tokenId_);\n}", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/0xnev-Q.md", "collected_at": "2026-01-02T18:20:51.687549+00:00", "source_hash": "59c104f7862c3fc5403be98ae287f97207cd7c7bed5b92b97e27a5eca7277bea", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function getPositionInfo(\n uint256 tokenId_,\n uint256 index_\n) external view override returns (uint256, uint256) {\n return (\n positions[tokenId_][index_].lps,\n positions[tokenId_][index_].depositTime\n );\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function mint(\n MintParams calldata params_\n) external override nonReentrant returns (uint256 tokenId_) {\n tokenId_ = _nextId++;\n\n // revert if the address is not a valid Ajna pool\n if (!_isAjnaPool(params_.pool, params_.poolSubsetHash)) revert NotAjnaPool();\n\n // record which pool the tokenId was minted in\n poolKey[tokenId_] = params_.pool;\n\n _mint(params_.recipient, tokenId_);\n\n emit Mint(params_.recipient, params_.pool, tokenId_);\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "10-badger", "title": "Sathish9098 G", "severity_raw": "Medium", "severity": "medium", "description": "# GAS OPTIMIZATIONS\n\n##\n\n## [G-1] Optimizing storage usage with packed structs\n\n### Saves ``8000 GAS`` , ``4 SLOT``\n\nEach slot saved can avoid an extra Gsset (20000 gas) for the first setting of the struct.\n\nSubsequent reads as well as writes have smaller gas savings.\n\n### [G-1.1] user,isCollIncrease,isDebtIncrease can be packed with same slot : Saves ``2 SLOT`` , ``4000 GAS``\n\nhttps://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/BorrowerOperations.sol#L97-L104\n\n```diff\nFILE: Breadcrumbs2023-10-badger/packages/contracts/contracts/BorrowerOperations.sol\n\n struct MoveTokensParams {\n address user;\n+ bool isCollIncrease;\n+ bool isDebtIncrease;\n uint256 collSharesChange;\n uint256 collAddUnderlying; // ONLY for isCollIncrease=true\n- bool isCollIncrease;\n uint256 netDebtChange;\n- bool isDebtIncrease;\n }\n\n```\n\n### [G-1.2] roundEthBtcId , roundStEthEthId , success can be packed with same slot : Saves 1 SLOT , 2000 GAS\n\nhttps://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/Interfaces/IPriceFeed.sol#L17-L24\n\n```diff\nFILE: 2023-10-badger/packages/contracts/contracts/Interfaces/IPriceFeed.sol\n\n struct ChainlinkResponse {\n uint80 roundEthBtcId;\n uint80 roundStEthEthId;\n+ bool success;\n uint256 answer;\n uint256 timestampEthBtc;\n uint256 timestampStEthEth;\n- bool success;\n }\n\n\n```\n\n### [G-1.3] timestamp , success can be packed with same slot : Saves ``1 SLOT`` , ``2000 GAS``\n\nhttps://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/Interfaces/IPriceFeed.sol#L26-L30\n\n```diff\nFILE: 2023-10-badger/packages/contracts/contracts/Interfaces/IPriceFeed.sol\n\n struct FallbackResponse {\n uint256 answer;\n- uint256 timestamp;\n+ uint248 timestamp;\n bool success;\n ", "vulnerable_code": "### [G-1.2] roundEthBtcId , roundStEthEthId , success can be packed with same slot : Saves 1 SLOT , 2000 GAS\n\nhttps://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/Interfaces/IPriceFeed.sol#L17-L24\n", "fixed_code": "### [G-1.3] timestamp , success can be packed with same slot : Saves ``1 SLOT`` , ``2000 GAS``\n\nhttps://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/Interfaces/IPriceFeed.sol#L26-L30\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/Sathish9098-G.md", "collected_at": "2026-01-02T18:26:37.448138+00:00", "source_hash": "5a1845cb2150173925378a4f09004af5942bfd14c6418848276cd09f726de454", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 701, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "FILE: Breadcrumbs2023-10-badger/packages/contracts/contracts/BorrowerOperations.sol\n\n struct MoveTokensParams {\n address user;\n+ bool isCollIncrease;\n+ bool isDebtIncrease;\n uint256 collSharesChange;\n uint256 collAddUnderlying; // ONLY for isCollIncrease=true\n- bool isCollIncrease;\n uint256 netDebtChange;\n- bool isDebtIncrease;\n }", "primary_code_language": "diff", "primary_code_char_count": 391, "all_code_blocks": "// Code block 1 (diff):\nFILE: Breadcrumbs2023-10-badger/packages/contracts/contracts/BorrowerOperations.sol\n\n struct MoveTokensParams {\n address user;\n+ bool isCollIncrease;\n+ bool isDebtIncrease;\n uint256 collSharesChange;\n uint256 collAddUnderlying; // ONLY for isCollIncrease=true\n- bool isCollIncrease;\n uint256 netDebtChange;\n- bool isDebtIncrease;\n }\n\n// Code block 2 (diff):\nFILE: 2023-10-badger/packages/contracts/contracts/Interfaces/IPriceFeed.sol\n\n struct ChainlinkResponse {\n uint80 roundEthBtcId;\n uint80 roundStEthEthId;\n+ bool success;\n uint256 answer;\n uint256 timestampEthBtc;\n uint256 timestampStEthEth;\n- bool success;\n }", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "FILE: Breadcrumbs2023-10-badger/packages/contracts/contracts/BorrowerOperations.sol\n\n struct MoveTokensParams {\n address user;\n+ bool isCollIncrease;\n+ bool isDebtIncrease;\n uint256 collSharesChange;\n uint256 collAddUnderlying; // ONLY for isCollIncrease=true\n- bool isCollIncrease;\n uint256 netDebtChange;\n- bool isDebtIncrease;\n }\n\nFILE: 2023-10-badger/packages/contracts/contracts/Interfaces/IPriceFeed.sol\n\n struct ChainlinkResponse {\n uint80 roundEthBtcId;\n uint80 roundStEthEthId;\n+ bool success;\n uint256 answer;\n uint256 timestampEthBtc;\n uint256 timestampStEthEth;\n- bool success;\n }", "solidity_code": "", "github_refs_formatted": "BorrowerOperations.sol#L97-L104, IPriceFeed.sol#L17-L24, IPriceFeed.sol#L26-L30", "github_files_list": "BorrowerOperations.sol, IPriceFeed.sol", "github_refs_count": 3, "vulnerable_code_actual": "### [G-1.2] roundEthBtcId , roundStEthEthId , success can be packed with same slot : Saves 1 SLOT , 2000 GAS\n\nhttps://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/Interfaces/IPriceFeed.sol#L17-L24\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "### [G-1.3] timestamp , success can be packed with same slot : Saves ``1 SLOT`` , ``2000 GAS``\n\nhttps://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/Interfaces/IPriceFeed.sol#L26-L30\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "03-asymmetry", "title": "atharvasama G", "severity_raw": "Medium", "severity": "medium", "description": "# Gas Optimizations list\n\n| Number | Details | Instances |\n| ------ | ------------------------------------------------------------------------------------------------- | --------- |\n| 1 | ```x += y```/```x -= y``` COSTS MORE GAS THAN ```x = x + y```/```x = x - y``` FOR STATE VARIABLES | 3 |\n| 2 | CAN DECLARE VARIABLE OUTSIDE LOOP TO SAVE GAS | 7 |\n| 3 | PUBLIC FUNCTIONS NOT CALLED BY THE CONTRACT SHOULD BE DECLARED EXTERNAL INSTEAD | 8 |\n| 4 | USE ```bytes32``` INSTEAD OF ```string``` WHEREVER POSSIBLE | 1 |\n| 5 | OPTIMIZE NAMES TO SAVE GAS | 4 |\n| 6 | BEFORE SOME FUNCTIONS, WE SHOULD CHECK SOME VARIABLES FOR POSSIBLE GAS SAVE | 9 |\n| 7 | CACHE STORAGE VALUES IN MEMORY TO MINIMIZE SLOADS | 8 |\n| 8 | SHOULD USE LOCAL ARGUMENTS INSTEAD OF STATE VARIABLE | 4 |\n| 9 | CACHE ARRAY LENGTH OUTSIDE OF LOOP | 7 |\n\n# Gas Optimizations\n## [G-01] ```x += y```/```x -= y``` COSTS MORE GAS THAN ```x = x + y```/```x = x - y``` FOR STATE VARIABLES\nUsing the addition operator instead of plus-equals saves some gas for state variables.\n\n[contracts/SafEth/SafEth.sol](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol)\n```js\n72: underlyingValue +=\n73: (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n74: derivatives[i].balance()) /\n75: 10 ** 18;\n\n172: localTotalWeight += weights[i];\n\n192: localTotalWeig", "vulnerable_code": "72: underlyingValue +=\n73: (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n74: derivatives[i].balance()) /\n75: 10 ** 18;\n\n172: localTotalWeight += weights[i];\n\n192: localTotalWeight += weights[i];", "fixed_code": "85: uint256 weight = weights[i];\n\n86: IDerivative derivative = derivatives[i];\n\n88: uint256 ethAmount = (msg.value * weight) / totalWeight;\n\n91: uint256 depositAmount = derivative.deposit{value: ethAmount}();\n92: uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n93: depositAmount\n94: ) * depositAmount) / 10 ** 18;\n95: totalStakeValueEth += derivativeReceivedEthValue;\n\n115: uint256 derivativeAmount = (derivatives[i].balance() *\n\n149: uint256 ethAmount = (ethAmountToRebalance * weights[i]) /", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/atharvasama-G.md", "collected_at": "2026-01-02T18:18:49.479635+00:00", "source_hash": "5a2535aec50d6895580d167f2a1210db7ae86ecc6bb8cdc00d690f92cf5e2385", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol", "github_files_list": "SafEth.sol", "github_refs_count": 1, "vulnerable_code_actual": "72: underlyingValue +=\n73: (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n74: derivatives[i].balance()) /\n75: 10 ** 18;\n\n172: localTotalWeight += weights[i];\n\n192: localTotalWeight += weights[i];", "has_vulnerable_code_snippet": true, "fixed_code_actual": "85: uint256 weight = weights[i];\n\n86: IDerivative derivative = derivatives[i];\n\n88: uint256 ethAmount = (msg.value * weight) / totalWeight;\n\n91: uint256 depositAmount = derivative.deposit{value: ethAmount}();\n92: uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n93: depositAmount\n94: ) * depositAmount) / 10 ** 18;\n95: totalStakeValueEth += derivativeReceivedEthValue;\n\n115: uint256 derivativeAmount = (derivatives[i].balance() *\n\n149: uint256 ethAmount = (ethAmountToRebalance * weights[i]) /", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "02-ethos", "title": "MohammedRizwan G", "severity_raw": "High", "severity": "high", "description": "## Summary\n\n### Gas Optimizations\n| |Issue|Instances| |\n|-|:-|:-:|:-:| \n| [G‑01] | require() or revert() statements that check input arguments should be at the top of the function | 2 |\n| [G‑02] | Splitting require() statements that use && saves gas | 4 |\n| [G‑03] | [Ethos-Core contracts] ++i/i++ should be unchecked{++i}/unchecked{i++} when it is not possible for them to overflow | 11 |\n| [G‑04] | Avoid compound assignment operator in state variables | 21 |\n| [G‑05] | Use require instead of assert | 17 |\n| [G‑06] | Use mapping instead of arrays | - |\n| [G‑07] | Use a safe and secure smart contract libraries | - |\n| [G‑08] | Use a more recent version of solidity | 8 |\n\n## Gas Optimizations\n### [G‑01] require() or revert() statements that check input arguments should be at the top of the function\nChecks that involve constants should come before checks that involve state variables, function calls, and calculations. By doing these checks first, the function is able to revert before wasting a Gcoldsload (2100 gas*) in a function that may ultimately revert in the unhappy case.\n\nIn CollateralConfig.initialize( ) function, below checks should be at top which will check and verify the conditions and prevent any gas wastage and function failue.\nThere are 2 instances of this issue.\n\n```solidity\nFile: Ethos-Core/contracts/CollateralConfig.sol\n\n66 require(_MCRs[i] >= MIN_ALLOWED_MCR, \"MCR below allowed minimum\");\n\n---\n\n69 require(_CCRs[i] >= MIN_ALLOWED_CCR, \"CCR below allowed minimum\");\n\n```\nhttps://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/CollateralConfig.sol#L66\nhttps://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/CollateralConfig.sol#L69\n\n### [G‑02] Splitting require() statements that use && saves gas\n&& Operator takes more gas, by splitting it in require() it Sav", "vulnerable_code": "File: Ethos-Core/contracts/CollateralConfig.sol\n\n66 require(_MCRs[i] >= MIN_ALLOWED_MCR, \"MCR below allowed minimum\");\n\n---\n\n69 require(_CCRs[i] >= MIN_ALLOWED_CCR, \"CCR below allowed minimum\");\n", "fixed_code": "File: Ethos-Core/contracts/BorrowerOperations.sol\n\n653 require(_maxFeePercentage >= BORROWING_FEE_FLOOR && _maxFeePercentage <= DECIMAL_PRECISION,", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/MohammedRizwan-G.md", "collected_at": "2026-01-02T18:16:22.060175+00:00", "source_hash": "5a4d38d152286922dab01717ff5f3e87ffab349d723d4cfe17a8a9a720a6834b", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 216, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: Ethos-Core/contracts/CollateralConfig.sol\n\n66 require(_MCRs[i] >= MIN_ALLOWED_MCR, \"MCR below allowed minimum\");\n\n---\n\n69 require(_CCRs[i] >= MIN_ALLOWED_CCR, \"CCR below allowed minimum\");", "primary_code_language": "solidity", "primary_code_char_count": 216, "all_code_blocks": "// Code block 1 (solidity):\nFile: Ethos-Core/contracts/CollateralConfig.sol\n\n66 require(_MCRs[i] >= MIN_ALLOWED_MCR, \"MCR below allowed minimum\");\n\n---\n\n69 require(_CCRs[i] >= MIN_ALLOWED_CCR, \"CCR below allowed minimum\");", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: Ethos-Core/contracts/CollateralConfig.sol\n\n66 require(_MCRs[i] >= MIN_ALLOWED_MCR, \"MCR below allowed minimum\");\n\n---\n\n69 require(_CCRs[i] >= MIN_ALLOWED_CCR, \"CCR below allowed minimum\");", "github_refs_formatted": "CollateralConfig.sol#L66, CollateralConfig.sol#L69", "github_files_list": "CollateralConfig.sol", "github_refs_count": 2, "vulnerable_code_actual": "File: Ethos-Core/contracts/CollateralConfig.sol\n\n66 require(_MCRs[i] >= MIN_ALLOWED_MCR, \"MCR below allowed minimum\");\n\n---\n\n69 require(_CCRs[i] >= MIN_ALLOWED_CCR, \"CCR below allowed minimum\");\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: Ethos-Core/contracts/BorrowerOperations.sol\n\n653 require(_maxFeePercentage >= BORROWING_FEE_FLOOR && _maxFeePercentage <= DECIMAL_PRECISION,", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ethos", "title": "joss G", "severity_raw": "Gas", "severity": "gas", "description": "Use custom solidity errors instead of require statements to save gas on string allocation.\n\nEx: Instead of this\n`require(someBool, \"Error Message\");`\n\nuse this\n```\nerror ErrorMessage(); // declare error\n\n// logically same as require. Reverts state to before function was called.\n// Saves gas on string allocation.\nif(!someBool){\n revert ErrorMessage();\n}\n```\n\nSaves ~50 gas each time the error triggers (https://gist.github.com/IllIllI000/ad1bd0d29a0101b25e57c293b4b0c746)\nAlso saves gas on deployment.\n\nSome examples of `require` statements that can be gas optimized:\n - Ethos-Vault/contracts/ReaperVaultERC4626.sol line 270\n - Ethos-Vault/contracts/ReaperVaultV2.sol lines 150-156, 180, 181, 193, 197, 261, 267, 321, 322, 324, 364, 404, 436, 497, 568, 619, 629, 639\n - Ethos-Vault/contracts/ReaperBaseStrategyv4.sol lines 81, 96-98, 191\n\n", "vulnerable_code": "error ErrorMessage(); // declare error\n\n// logically same as require. Reverts state to before function was called.\n// Saves gas on string allocation.\nif(!someBool){\n revert ErrorMessage();\n}", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/joss-G.md", "collected_at": "2026-01-02T18:17:19.471004+00:00", "source_hash": "5a6c8e58ca56ccca34610f0e2a0766bf8dbf1bb9c393fb77179c1765211d5272", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 192, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "error ErrorMessage(); // declare error\n\n// logically same as require. Reverts state to before function was called.\n// Saves gas on string allocation.\nif(!someBool){\n revert ErrorMessage();\n}", "primary_code_language": "unknown", "primary_code_char_count": 192, "all_code_blocks": "// Code block 1 (unknown):\nerror ErrorMessage(); // declare error\n\n// logically same as require. Reverts state to before function was called.\n// Saves gas on string allocation.\nif(!someBool){\n revert ErrorMessage();\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "error ErrorMessage(); // declare error\n\n// logically same as require. Reverts state to before function was called.\n// Saves gas on string allocation.\nif(!someBool){\n revert ErrorMessage();\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 3.69} {"source": "c4", "protocol": "10-badger", "title": "report", "severity_raw": "Critical", "severity": "critical", "description": "---\nsponsor: \"eBTC Protocol\"\nslug: \"2023-10-badger\"\ndate: \"2024-02-13\"\ntitle: \"Badger eBTC Audit + Certora Formal Verification Competition\"\nfindings: \"https://github.com/code-423n4/2023-10-badger-findings/issues\"\ncontest: 300\n---\n\n# Overview\n\n## About C4\n\nCode4rena (C4) is an open organization consisting of security researchers, auditors, developers, and individuals with domain expertise in smart contracts.\n\nA C4 audit is an event in which community participants, referred to as Wardens, review, audit, or analyze smart contract logic in exchange for a bounty provided by sponsoring projects.\n\nDuring the audit outlined in this document, C4 conducted an analysis of the Badger eBTC smart contract system written in Solidity. The audit took place between October 24\u2014November 14 2023.\n\nAlongside the C4 audit, a formal verification competition was held in partnership with Certora. The summary of the [formal verification competition](#formal-verification-competition) is appended below the audit report.\n\n## Wardens\n\n95 Wardens contributed reports to the Badger eBTC Audit + Certora Formal Verification Competition:\n\n 1. [Stormy](https://code4rena.com/@Stormy)\n 2. [TrungOre](https://code4rena.com/@TrungOre)\n 3. [0xBeirao](https://code4rena.com/@0xBeirao)\n 4. [ether\\_sky](https://code4rena.com/@ether_sky)\n 5. [shaka](https://code4rena.com/@shaka)\n 6. [0xRobocop](https://code4rena.com/@0xRobocop)\n 7. [SpicyMeatball](https://code4rena.com/@SpicyMeatball)\n 8. [rvierdiiev](https://code4rena.com/@rvierdiiev)\n 9. [Nyx](https://code4rena.com/@Nyx)\n 10. [nobody2018](https://code4rena.com/@nobody2018)\n 11. [BARW](https://code4rena.com/@BARW) ([BenRai](https://code4rena.com/@BenRai) and [albertwh1te](https://code4rena.com/@albertwh1te))\n 12. [DavidGiladi](https://code4rena.com/@DavidGiladi)\n 13. [hunter\\_w3b](https://code4rena.com/@hunter_w3b)\n 14. [hihen](https://code4rena.com/@hihen)\n 15. [cheatc0d3](https://code4rena.com/@cheatc0d3)\n 16. [zabihullahazadzoi](https://code4re", "vulnerable_code": " /// @notice Deploys a new macro for you\n function deployNewMacro() external returns (address) {\n return deployNewMacro(msg.sender);\n }", "fixed_code": " /// @notice Deploys a new macro for an owner, only they can operate the macro\n function deployNewMacro(address _owner) public returns (address) {\n address addy = address(\n new LeverageMacroReference(\n borrowerOperations,\n activePool,\n cdpManager,\n ebtcToken,\n stETH,\n sortedCdps,\n _owner\n )\n );\n\n emit DeployNewMacro(_owner, addy);\n\n return addy;\n }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/report.md", "collected_at": "2026-01-02T18:27:07.045365+00:00", "source_hash": "5ac68c03d9b0e6531e71eb02e468f880b538f886054628f7af30166ed17cd723", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " /// @notice Deploys a new macro for you\n function deployNewMacro() external returns (address) {\n return deployNewMacro(msg.sender);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " /// @notice Deploys a new macro for an owner, only they can operate the macro\n function deployNewMacro(address _owner) public returns (address) {\n address addy = address(\n new LeverageMacroReference(\n borrowerOperations,\n activePool,\n cdpManager,\n ebtcToken,\n stETH,\n sortedCdps,\n _owner\n )\n );\n\n emit DeployNewMacro(_owner, addy);\n\n return addy;\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "10-badger", "title": "lsaudit G", "severity_raw": "High", "severity": "high", "description": "# [G-01] Using bools for storage incurs overhead\nBooleans are more expensive than uint256 or any type that takes up a full word because each write operation emits an extra SLOAD to first read the slot's contents, replace the bits taken up by the boolean, and then write back. This is the compiler's defense against contract upgrades and pointer aliasing, and it cannot be disabled. Use uint256(0) and uint256(1) for true/false to avoid a Gwarmaccess (100 gas) for the extra SLOAD.\n\n\n```\n./CdpManagerStorage.sol:143: bool public redemptionsPaused;\n./ERC3156FlashLender.sol:15: bool public flashLoansPaused;\n./LeverageMacroBase.sol:35: bool internal immutable willSweep;\n./AuthNoOwner.sol:14: bool private _authorityInitialized;\n```\n\n# [G\u201102] Constructors can be marked as payable to save deployment gas\nPayable functions cost less gas to execute, because the compiler does not have to add extra checks to ensure that no payment is provided. A constructor can be safely marked as payable, because only the deployer would be able to pass funds, and the project itself would not pass any funds.\n\n```\n./Auth.sol:18: constructor(address _owner, Authority _authority) {\n./RolesAuthority.sol:20: constructor(address _owner, Authority _authority) Auth(_owner, _authority) {}\n./Governor.sol:36: constructor(address _owner) RolesAuthority(_owner, Authority(address(this))) {}\n./EbtcBase.sol:52: constructor(address _activePoolAddress, address _priceFeedAddress, address _collateralAddress) {\n./SortedCdps.sol:88: constructor(uint256 _size, address _cdpManagerAddress, address _borrowerOperationsAddress) {\n./SimplifiedDiamondLike.sol:44: constructor(address _owner) {\n\n```\n\n# [G\u201103] Functions that revert when called by normal users can be marked payable\n\nIf a function modifier such as onlyOwner is used, the function will revert if a normal user tries to pay the function. Marking the function as payable will lower the gas cost for legitimate callers because the compiler will n", "vulnerable_code": "./CdpManagerStorage.sol:143: bool public redemptionsPaused;\n./ERC3156FlashLender.sol:15: bool public flashLoansPaused;\n./LeverageMacroBase.sol:35: bool internal immutable willSweep;\n./AuthNoOwner.sol:14: bool private _authorityInitialized;", "fixed_code": "./Auth.sol:18: constructor(address _owner, Authority _authority) {\n./RolesAuthority.sol:20: constructor(address _owner, Authority _authority) Auth(_owner, _authority) {}\n./Governor.sol:36: constructor(address _owner) RolesAuthority(_owner, Authority(address(this))) {}\n./EbtcBase.sol:52: constructor(address _activePoolAddress, address _priceFeedAddress, address _collateralAddress) {\n./SortedCdps.sol:88: constructor(uint256 _size, address _cdpManagerAddress, address _borrowerOperationsAddress) {\n./SimplifiedDiamondLike.sol:44: constructor(address _owner) {\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/lsaudit-G.md", "collected_at": "2026-01-02T18:26:55.154263+00:00", "source_hash": "5acc684967018e5749642c07cd02c0c833257e6dfda871e89ad65f1772841ed4", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 829, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "./CdpManagerStorage.sol:143: bool public redemptionsPaused;\n./ERC3156FlashLender.sol:15: bool public flashLoansPaused;\n./LeverageMacroBase.sol:35: bool internal immutable willSweep;\n./AuthNoOwner.sol:14: bool private _authorityInitialized;", "primary_code_language": "unknown", "primary_code_char_count": 251, "all_code_blocks": "// Code block 1 (unknown):\n./CdpManagerStorage.sol:143: bool public redemptionsPaused;\n./ERC3156FlashLender.sol:15: bool public flashLoansPaused;\n./LeverageMacroBase.sol:35: bool internal immutable willSweep;\n./AuthNoOwner.sol:14: bool private _authorityInitialized;\n\n// Code block 2 (unknown):\n./Auth.sol:18: constructor(address _owner, Authority _authority) {\n./RolesAuthority.sol:20: constructor(address _owner, Authority _authority) Auth(_owner, _authority) {}\n./Governor.sol:36: constructor(address _owner) RolesAuthority(_owner, Authority(address(this))) {}\n./EbtcBase.sol:52: constructor(address _activePoolAddress, address _priceFeedAddress, address _collateralAddress) {\n./SortedCdps.sol:88: constructor(uint256 _size, address _cdpManagerAddress, address _borrowerOperationsAddress) {\n./SimplifiedDiamondLike.sol:44: constructor(address _owner) {", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "./CdpManagerStorage.sol:143: bool public redemptionsPaused;\n./ERC3156FlashLender.sol:15: bool public flashLoansPaused;\n./LeverageMacroBase.sol:35: bool internal immutable willSweep;\n./AuthNoOwner.sol:14: bool private _authorityInitialized;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "./Auth.sol:18: constructor(address _owner, Authority _authority) {\n./RolesAuthority.sol:20: constructor(address _owner, Authority _authority) Auth(_owner, _authority) {}\n./Governor.sol:36: constructor(address _owner) RolesAuthority(_owner, Authority(address(this))) {}\n./EbtcBase.sol:52: constructor(address _activePoolAddress, address _priceFeedAddress, address _collateralAddress) {\n./SortedCdps.sol:88: constructor(uint256 _size, address _cdpManagerAddress, address _borrowerOperationsAddress) {\n./SimplifiedDiamondLike.sol:44: constructor(address _owner) {\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-asymmetry", "title": "Breeje Q", "severity_raw": "High", "severity": "high", "description": "# QA Report\n\n## Low Risk Issues\n| Count | Explanation | Instances |\n|:--:|:-------|:--:|\n| [L-01] | Possible DOS in `stake` in future | 1 |\n| [L-02] | `receive` function can be removed to prevent accidental sending of Eth | 3 |\n\n| Total Low Risk Issues | 2 |\n|:--:|:--:|\n\n### [L-01] Possible DOS in `stake` in future\n\n`stake` method in `SafEth` uses couple of for loops bounded by the derivative count. As of now there are only 3 Derivatives, so it is fine. But in future when more derivatives will be added by owner, it can possibly lead to DOS by crossing the Block limit.\n\n*Instance:*\n```solidity\nFile: SafEth.sol\n\n function stake() external payable {\n require(pauseStaking == false, \"staking is paused\");\n require(msg.value >= minAmount, \"amount too low\");\n require(msg.value <= maxAmount, \"amount too high\");\n\n uint256 underlyingValue = 0;\n\n // Getting underlying value in terms of ETH for each derivative\n for (uint i = 0; i < derivativeCount; i++)\n underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) * // @audit checkout for the Precision in Derivatives\nderivatives[i].balance()) / // @audit Gas Optimization Possible\n 10 ** 18;\n\n uint256 totalSupply = totalSupply();\n uint256 preDepositPrice; // Price of safETH in regards to ETH\n if (totalSupply == 0)\n preDepositPrice = 10 ** 18; // initializes with a price of 1\n else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n\n uint256 totalStakeValueEth = 0; // total amount of derivatives worth of ETH in system\n for (uint i = 0; i < derivativeCount; i++) {\n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight == 0) continue;\n uint256 ethAmount = (msg.value * weight) / totalWeight;\n\n // This is slightly less than ethAmount becau", "vulnerable_code": "File: SafEth.sol\n\n function stake() external payable {\n require(pauseStaking == false, \"staking is paused\");\n require(msg.value >= minAmount, \"amount too low\");\n require(msg.value <= maxAmount, \"amount too high\");\n\n uint256 underlyingValue = 0;\n\n // Getting underlying value in terms of ETH for each derivative\n for (uint i = 0; i < derivativeCount; i++)\n underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) * // @audit checkout for the Precision in Derivatives\nderivatives[i].balance()) / // @audit Gas Optimization Possible\n 10 ** 18;\n\n uint256 totalSupply = totalSupply();\n uint256 preDepositPrice; // Price of safETH in regards to ETH\n if (totalSupply == 0)\n preDepositPrice = 10 ** 18; // initializes with a price of 1\n else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n\n uint256 totalStakeValueEth = 0; // total amount of derivatives worth of ETH in system\n for (uint i = 0; i < derivativeCount; i++) {\n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight == 0) continue;\n uint256 ethAmount = (msg.value * weight) / totalWeight;\n\n // This is slightly less than ethAmount because slippage\n uint256 depositAmount = derivative.deposit{value: ethAmount}();\n uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n depositAmount\n ) * depositAmount) / 10 ** 18;\n totalStakeValueEth += derivativeReceivedEthValue;\n }\n // mintAmount represents a percentage of the total assets in the system\n uint256 mintAmount = (totalStakeValueEth * 10 ** 18) / preDepositPrice;\n _mint(msg.sender, mintAmount);\n emit Staked(msg.sender, msg.value, mintAmount);\n }\n", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Breeje-Q.md", "collected_at": "2026-01-02T18:17:56.595409+00:00", "source_hash": "5b0f0af217bfa9254bd155021f521cc9cea2fbdfb5ec8a79ddfecb9a4e93a4f3", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: SafEth.sol\n\n function stake() external payable {\n require(pauseStaking == false, \"staking is paused\");\n require(msg.value >= minAmount, \"amount too low\");\n require(msg.value <= maxAmount, \"amount too high\");\n\n uint256 underlyingValue = 0;\n\n // Getting underlying value in terms of ETH for each derivative\n for (uint i = 0; i < derivativeCount; i++)\n underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) * // @audit checkout for the Precision in Derivatives\nderivatives[i].balance()) / // @audit Gas Optimization Possible\n 10 ** 18;\n\n uint256 totalSupply = totalSupply();\n uint256 preDepositPrice; // Price of safETH in regards to ETH\n if (totalSupply == 0)\n preDepositPrice = 10 ** 18; // initializes with a price of 1\n else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n\n uint256 totalStakeValueEth = 0; // total amount of derivatives worth of ETH in system\n for (uint i = 0; i < derivativeCount; i++) {\n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight == 0) continue;\n uint256 ethAmount = (msg.value * weight) / totalWeight;\n\n // This is slightly less than ethAmount because slippage\n uint256 depositAmount = derivative.deposit{value: ethAmount}();\n uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n depositAmount\n ) * depositAmount) / 10 ** 18;\n totalStakeValueEth += derivativeReceivedEthValue;\n }\n // mintAmount represents a percentage of the total assets in the system\n uint256 mintAmount = (totalStakeValueEth * 10 ** 18) / preDepositPrice;\n _mint(msg.sender, mintAmount);\n emit Staked(msg.sender, msg.value, mintAmount);\n }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4} {"source": "c4", "protocol": "04-caviar", "title": "jnrlouis G", "severity_raw": "Low", "severity": "low", "description": "### Gas Optimization Report\n\n## Summary\n\n## Gas Optimizations\n\n\n| | Issue | Instances |\n| --- | --- | ---|\n| 1 | Setting the `constructor` to `payable` | 3 |\n| 2 | Functions guaranteed to revert when normal users call can be marked `payable` | 11 |\n| 3 | Use Assembly to check for `address(0)` | 21 |\n| 4 | Splitting `require` and `if` statements that use `&&` saves gas | 12 |\n| 5 | ` += ` Costs More Gas Than ` = + ` For State Variables | 4 |\n\n\n## Gas Optimizations\n\n# [G-01] Setting the `constructor` to `payable`\n\nSetting the `constructor` to `payable` saves about 13 gas per instance\n\n*There are 3 instances of this issue:*\n\n```javascript\nFile: src/PrivatePool.sol\n\n143 constructor(address _factory, address _royaltyRegistry, address _stolenNftOracle)\n```\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L143\n\n\n```javascript\nFile: src/Factory.sol\n\n53 constructor() ERC721(\"Caviar Private Pools\", \"POOL\") Owned(msg.sender) {}\n\n```\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/Factory.sol#L53\n\n```javascript\nFile: src/EthRouter.sol\n\n90 constructor(address _royaltyRegistry)\n\n```\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L90\n\n# [G-02] Functions guaranteed to revert when normal users call can be marked `payable`\n\nIf a function modifier such as onlyOwner is used, the function will revert if a normal user tries to pay the function. Marking the function as payable will lower the gas cost for legitimate callers because the compiler will not include checks for whether a payment was provided. The extra opcodes avoided are\nCALLVALUE(2),DUP1(3),ISZERO(3),PUSH2(3),JUMPI(10),PUSH1(3),DUP1(3),REVERT(0),JUMPDEST(1),POP(2), which costs an average of about 21 gas per call to the function, in addition to the extra deployment cost.\n\n*There are 11 instances of this issue:*\n\n```javascript\nFile:", "vulnerable_code": "File: src/PrivatePool.sol\n\n143 constructor(address _factory, address _royaltyRegistry, address _stolenNftOracle)", "fixed_code": "File: src/Factory.sol\n\n53 constructor() ERC721(\"Caviar Private Pools\", \"POOL\") Owned(msg.sender) {}\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/jnrlouis-G.md", "collected_at": "2026-01-02T18:20:36.807612+00:00", "source_hash": "5b11d0fead3b926ed4c8811a2e79ec4bfab79401bb136f3e1a9c34a8e5cc0069", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 285, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: src/PrivatePool.sol\n\n143 constructor(address _factory, address _royaltyRegistry, address _stolenNftOracle)", "primary_code_language": "javascript", "primary_code_char_count": 115, "all_code_blocks": "// Code block 1 (javascript):\nFile: src/PrivatePool.sol\n\n143 constructor(address _factory, address _royaltyRegistry, address _stolenNftOracle)\n\n// Code block 2 (javascript):\nFile: src/Factory.sol\n\n53 constructor() ERC721(\"Caviar Private Pools\", \"POOL\") Owned(msg.sender) {}\n\n// Code block 3 (javascript):\nFile: src/EthRouter.sol\n\n90 constructor(address _royaltyRegistry)", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "PrivatePool.sol#L143, Factory.sol#L53, EthRouter.sol#L90", "github_files_list": "EthRouter.sol, PrivatePool.sol, Factory.sol", "github_refs_count": 3, "vulnerable_code_actual": "File: src/PrivatePool.sol\n\n143 constructor(address _factory, address _royaltyRegistry, address _stolenNftOracle)", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: src/Factory.sol\n\n53 constructor() ERC721(\"Caviar Private Pools\", \"POOL\") Owned(msg.sender) {}\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "02-ethos", "title": "descharre Q", "severity_raw": "Critical", "severity": "critical", "description": "# Summary\n## Low Risk\n|ID | Finding| Instances |\n|:----: | :--- | :----: |\n|L-01 |Missing 0 checks in constructor|4|\n|L-02 |Unspecific compiler version pragma|-|\n|L-03 |Not every year equals 365 days|1|\n|L-04 | Not enough checks on withdraw and deposit function | 2 |\n\n\n## Non critical\n|ID | Finding| Instances |\n|:----: | :--- | :----: |\n|N-01 | Use a newer solidity version | - |\n|N-02 | Use a modifier instead of a function for prerequisites | 5 |\n|N-03 | Event is missing indexed fields | 7 |\n|N-04 | Make consistent use of comments in the contracts | - |\n|N-05 | Use uint256 instead of uint | 1 |\n|N-06 | Use scientific notation (1E18) rather than exponentation (10**18) | 2 |\n|N-07 | Unused named return variables | 11 |\n|N-08 | Formatting is not always correct | 3 |\n|N-09 | Wrong comments | 1 |\n|N-10 | Constant values such as a call to keccak256(), should be immutable rather than constant | 2 |\n|N-11 | Only use assert when you check code that never should be false | 3 |\n|N-12 | Functions should be grouped according to their visibility and ordered | 1 |\n\n# Details\n## Low Risk\n## [L-01] Missing 0 checks in constructor\nWhen you set addresses, it's a best practice to check for 0 addresses. This way a variable can't be accidently set to the 0 address. Roles are set in the constructor of ReaperVaultV2, without a check, ADMIN can be the 0 address.\n- [ReaperVaultV2.sol#L111-L136](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L111-L136)\n- [ReaperBaseStrategyv4.sol#L72-L73](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/abstract/ReaperBaseStrategyv4.sol#L72-L73)\n- [ReaperBaseStrategyv4.sol#L82-L85](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/abstract/ReaperBaseStrategyv4.sol#L82-L85)\n- [ReaperStrategyGranarySupplyOnly.sol#L68-L71]", "vulnerable_code": "- [ActivePool.sol#L313-L342](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol#L313-L342)\n- [BorrowerOperations.sol#L524-L656](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L524-L656)\n- [LUSDToken.sol#L346-L395](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L346-L395)\n- [StabilityPool.sol#L848-L875](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/StabilityPool.sol#L848-L875)\n- [TroveManager.sol#L1522-L1540](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L1522-L1540)\n## [N-03] Event is missing indexed fields\nWhen an event is missing indexed fields it can be hard for off-chain scripts to efficiently filter those events.\n- [ActivePool.sol#L58-L67](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol#L58-L67)\n- [ReaperVaultV2.sol#L80-L100](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L80-L100)\n- [ActivePool.sol#L58-L67](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol#L58-L67)\n- [CollateralConfig.sol#L37-L38](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol#L37-L38)\n- [StabilityPool.sol#L232-L234](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/StabilityPool.sol#L232-L234)\n- [StabilityPool.sol#L246-L250](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/StabilityPool.sol#L246-L250)\n- [TroveManager.sol#L203-L216](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L203-L216)\n## [N-04] Make consistent use of comments in the contracts \nThere are only a few functions that have comments. It is a good practice to use natspec comments. \nIn complex projects such as Defi, the interpretation of all functions and the", "fixed_code": "- [ActivePool.sol#L269](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol#L269): wrong spacing\n- [BorrowerOperations.sol#L633](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L633)\n- [TroveManager.sol#L1539](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L1539)\n\nOne click on format document should fix this\n## [N-09] Wrong comments\nThe comment says it returns a uint256 with 18 decimals. However the function uses the decimal function which returns the correct amount of decimals of a token. Not every token has 18 decimals, BTC is used in the tests and only has 8 decimals. So the function `getPricePerFullShare()` returns a uint256 with 8 decimals during testing.\n[ReaperVaultV2.sol#L293](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L293)", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/descharre-Q.md", "collected_at": "2026-01-02T18:17:05.603431+00:00", "source_hash": "5b2d47f309effc6f8184a1f2149cf58aa49481f8def9afa7b75cbbd3cfa99da5", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 18, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ReaperVaultV2.sol#L111-L136, ReaperBaseStrategyv4.sol#L72-L73, ReaperBaseStrategyv4.sol#L82-L85, ActivePool.sol#L313-L342, BorrowerOperations.sol#L524-L656, LUSDToken.sol#L346-L395, StabilityPool.sol#L848-L875, TroveManager.sol#L1522-L1540, ActivePool.sol#L58-L67, ReaperVaultV2.sol#L80-L100, CollateralConfig.sol#L37-L38, StabilityPool.sol#L232-L234, StabilityPool.sol#L246-L250, TroveManager.sol#L203-L216, ActivePool.sol#L269, BorrowerOperations.sol#L633, TroveManager.sol#L1539, ReaperVaultV2.sol#L293", "github_files_list": "StabilityPool.sol, TroveManager.sol, BorrowerOperations.sol, ReaperBaseStrategyv4.sol, ReaperVaultV2.sol, LUSDToken.sol, ActivePool.sol, CollateralConfig.sol", "github_refs_count": 18, "vulnerable_code_actual": "- [ActivePool.sol#L313-L342](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol#L313-L342)\n- [BorrowerOperations.sol#L524-L656](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L524-L656)\n- [LUSDToken.sol#L346-L395](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L346-L395)\n- [StabilityPool.sol#L848-L875](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/StabilityPool.sol#L848-L875)\n- [TroveManager.sol#L1522-L1540](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L1522-L1540)\n## [N-03] Event is missing indexed fields\nWhen an event is missing indexed fields it can be hard for off-chain scripts to efficiently filter those events.\n- [ActivePool.sol#L58-L67](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol#L58-L67)\n- [ReaperVaultV2.sol#L80-L100](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L80-L100)\n- [ActivePool.sol#L58-L67](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol#L58-L67)\n- [CollateralConfig.sol#L37-L38](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol#L37-L38)\n- [StabilityPool.sol#L232-L234](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/StabilityPool.sol#L232-L234)\n- [StabilityPool.sol#L246-L250](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/StabilityPool.sol#L246-L250)\n- [TroveManager.sol#L203-L216](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L203-L216)\n## [N-04] Make consistent use of comments in the contracts \nThere are only a few functions that have comments. It is a good practice to use natspec comments. \nIn complex projects such as Defi, the interpretation of all functions and the", "has_vulnerable_code_snippet": true, "fixed_code_actual": "- [ActivePool.sol#L269](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol#L269): wrong spacing\n- [BorrowerOperations.sol#L633](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L633)\n- [TroveManager.sol#L1539](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L1539)\n\nOne click on format document should fix this\n## [N-09] Wrong comments\nThe comment says it returns a uint256 with 18 decimals. However the function uses the decimal function which returns the correct amount of decimals of a token. Not every token has 18 decimals, BTC is used in the tests and only has 8 decimals. So the function `getPricePerFullShare()` returns a uint256 with 8 decimals during testing.\n[ReaperVaultV2.sol#L293](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L293)", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-ondo", "title": "Rolezn G", "severity_raw": "High", "severity": "high", "description": "## Summary\n\n### Gas Optimizations\n| |Issue|Contexts|Estimated Gas Saved|\n|-|:-|:-|:-:|\n| [GAS‑1](#GAS‑1) | `abi.encode()` is less efficient than `abi.encodepacked()` | 1 | 100 |\n| [GAS‑2](#GAS‑2) | State variables only set in the `constructor` should be declared immutable | 1 | - |\n| [GAS‑3](#GAS‑3) | Setting the `constructor` to `payable` | 13 | 169 |\n| [GAS‑4](#GAS‑4) | Do not calculate constants | 2 | - |\n| [GAS‑5](#GAS‑5) | Duplicated `require()`/`revert()` Checks Should Be Refactored To A Modifier Or Function | 5 | 140 |\n| [GAS‑6](#GAS‑6) | Using `delete` statement can save gas | 7 | - |\n| [GAS‑7](#GAS‑7) | Use `assembly` to write address storage values | 10 | - |\n| [GAS‑8](#GAS‑8) | `internal` functions only called once can be inlined to save gas | 47 | - |\n| [GAS‑9](#GAS‑9) | Multiple Address Mappings Can Be Combined Into A Single Mapping Of An Address To A Struct, Where Appropriate | 18 | - |\n| [GAS‑10](#GAS‑10) | Optimize names to save gas | 18 | 396 |\n| [GAS‑11](#GAS‑11) | ` += ` Costs More Gas Than ` = + ` For State Variables | 9 | - |\n| [GAS‑12](#GAS‑12) | Public Functions To External | 36 | - |\n| [GAS‑13](#GAS‑13) | `require()` Should Be Used Instead Of `assert()` | 3 | - |\n| [GAS‑14](#GAS‑14) | Usage of `uints`/`ints` smaller than 32 bytes (256 bits) incurs overhead | 5 | - |\n| [GAS‑15](#GAS‑15) | `++i`/`i++` Should Be `unchecked{++i}`/`unchecked{i++}` When It Is Not Possible For Them To Overflow, As Is The Case When Used In For- And While-loops | 9 | 315 |\n| [GAS‑16](#GAS‑16) | Using `unchecked` blocks to save gas | 16 | 2176 |\n| [GAS‑17](#GAS‑17) | Use solidity version 0.8.17 to gain some gas boost | 31 | 2728 |\n| [GAS‑18](#GAS‑18) | Using `storage` instead of `memory` ", "vulnerable_code": "94: abi.encode(_APPROVAL_TYPEHASH, kycRequirementGroup, user, deadline)", "fixed_code": "66: owner = owner_", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/Rolezn-G.md", "collected_at": "2026-01-02T18:14:45.303218+00:00", "source_hash": "5bacf61088fbd678df0a4564985cf5f2afc58cc209e02654c32615e9e3403b73", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "94: abi.encode(_APPROVAL_TYPEHASH, kycRequirementGroup, user, deadline)", "has_vulnerable_code_snippet": true, "fixed_code_actual": "66: owner = owner_", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "08-dopex", "title": "Rolezn Q", "severity_raw": "Critical", "severity": "critical", "description": "## QA Summary\nLow Severity Risks\n\n### Low Risk Issues\n| |Issue|Contexts|\n|-|:-|:-:|\n| [LOW‑1](#LOW‑1) | Consider checking that `mint` to `address(this)` is disabled | 4 |\n| [LOW‑2](#LOW‑2) | Consider implementing two-step procedure for updating protocol addresses | 6 |\n| [LOW‑3](#LOW‑3) | Constant decimal values | 16 |\n| [LOW‑4](#LOW‑4) | Large transfers may not work with some `ERC20` tokens | 34 |\n| [LOW‑5](#LOW‑5) | Minting tokens to the zero address should be avoided | 1 |\n| [LOW‑6](#LOW‑6) | OpenZeppelin's `Counters.sol` is deprecated | 3 |\n| [LOW‑7](#LOW‑7) | Privileged roles can change critical parameter even though `contract` is in `paused` mode | 1 |\n| [LOW‑8](#LOW‑8) | Solmate's SafeTransferLib doesn't check whether the ERC20 contract exists | 1 |\n\nTotal: 66 contexts over 8 issues\n\n### Non-critical Issues\n| |Issue|Contexts|\n|-|:-|:-:|\n| [NC‑1](#NC‑1) | Empty `bytes` check is missing | 4 |\n| [NC‑2](#NC‑2) | Overly complicated arithmetic | 1 |\n\nTotal: 5 contexts over 2 issues\n\n## Low Risk Issues\n\n### [LOW‑1] Consider checking that `mint` to `address(this)` is disabled\n\nFunctions allowing users to specify the receiving address should check whether the referenced address is not `address(this)`. This would prevent tokens to remain lock inside the contract. An example of the potential for loss by leaving this open is the EOS token smart contract where more than 90,000 tokens are stuck at the contract address.\n\n#### Proof Of Concept\n\n
\n\n```solidity\nFile: RdpxV2Bond.sol\n\n37: function mint(\n address to\n ) public onlyRole(MINTER_ROLE) returns (uint256 tokenId) {\n tokenId = _tokenIdCounter.current();\n _tokenIdCounter.increment();\n _mint(to, tokenId);\n }\n\n```\n\nhttps://github.com/code-423n4/2023-08-dopex/tree/main/contracts", "vulnerable_code": "File: RdpxV2Bond.sol\n\n37: function mint(\n address to\n ) public onlyRole(MINTER_ROLE) returns (uint256 tokenId) {\n tokenId = _tokenIdCounter.current();\n _tokenIdCounter.increment();\n _mint(to, tokenId);\n }\n", "fixed_code": "File: RdpxDecayingBonds.sol\n\n114: function mint(\n address to,\n uint256 expiry,\n uint256 rdpxAmount\n ) external onlyRole(MINTER_ROLE) {\n _whenNotPaused();\n require(hasRole(MINTER_ROLE, msg.sender), \"Caller is not a minter\");\n uint256 bondId = _mintToken(to);\n bonds[bondId] = Bond(to, expiry, rdpxAmount);\n\n emit BondMinted(to, bondId, expiry, rdpxAmount);\n }\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/Rolezn-Q.md", "collected_at": "2026-01-02T18:25:00.031791+00:00", "source_hash": "5bc88d3d3b88c188e9f9a7e125fabfe54dbe6c06ef8599a7d792562b949457f2", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 218, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: RdpxV2Bond.sol\n\n37: function mint(\n address to\n ) public onlyRole(MINTER_ROLE) returns (uint256 tokenId) {\n tokenId = _tokenIdCounter.current();\n _tokenIdCounter.increment();\n _mint(to, tokenId);\n }", "primary_code_language": "solidity", "primary_code_char_count": 218, "all_code_blocks": "// Code block 1 (solidity):\nFile: RdpxV2Bond.sol\n\n37: function mint(\n address to\n ) public onlyRole(MINTER_ROLE) returns (uint256 tokenId) {\n tokenId = _tokenIdCounter.current();\n _tokenIdCounter.increment();\n _mint(to, tokenId);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: RdpxV2Bond.sol\n\n37: function mint(\n address to\n ) public onlyRole(MINTER_ROLE) returns (uint256 tokenId) {\n tokenId = _tokenIdCounter.current();\n _tokenIdCounter.increment();\n _mint(to, tokenId);\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: RdpxV2Bond.sol\n\n37: function mint(\n address to\n ) public onlyRole(MINTER_ROLE) returns (uint256 tokenId) {\n tokenId = _tokenIdCounter.current();\n _tokenIdCounter.increment();\n _mint(to, tokenId);\n }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: RdpxDecayingBonds.sol\n\n114: function mint(\n address to,\n uint256 expiry,\n uint256 rdpxAmount\n ) external onlyRole(MINTER_ROLE) {\n _whenNotPaused();\n require(hasRole(MINTER_ROLE, msg.sender), \"Caller is not a minter\");\n uint256 bondId = _mintToken(to);\n bonds[bondId] = Bond(to, expiry, rdpxAmount);\n\n emit BondMinted(to, bondId, expiry, rdpxAmount);\n }\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "10-badger", "title": "SAQ Q", "severity_raw": "Low", "severity": "low", "description": "\n## Summary\n\n### Low Risk Issues\n\nno | Issue |Instances|\n|-|:-|:-:|\n| [L-01] | Loss of precision | 3 | \n| [L-02] | Consider implementing two-step procedure for updating protocol addresses | 1 | \n| [L-03] | Missing checks for address(0x0) in the constructor | 15 | \n| [L-04] | receive()/payable fallback() function does not authorize requests | 1 | \n| [L-05] | Empty receive() function | 1 | \n\n\n## Low Risk Issues\n\n### [L-1] Loss of precision\n\nDivision by large numbers may result in the result being zero, due to solidity not supporting fractions. Consider requiring a minimum amount for the numerator to ensure that it is always larger than the denominator\n\n```solidity\nfile: /contracts/contracts/LiquidationLibrary.sol\n \n882 uint256 EBTCDebtRewardPerUnitStaked = EBTCDebtNumerator / _totalStakes;\n\n```\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/LiquidationLibrary.sol#L882\n\n\n```solidity\nfile: contracts/contracts/CdpManagerStorage.sol\n\n564 uint256 _feeTaken = collateral.getSharesByPooledEth(_deltaFeeSplit) / DECIMAL_PRECISION;\n\n567 uint256 _deltaFeePerUnit = _deltaFeeSplitShare / _cachedAllStakes;\n\n```\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/CdpManagerStorage.sol#L564\n\n\n```solidity\nfile: /contracts/contracts/PriceFeed.sol\n\n801 (_scaledDecimal *\n uint256(_ethBtcAnswer) *\n uint256(_stEthEthAnswer) *\n EbtcMath.DECIMAL_PRECISION) / 10 ** (_decimalDenominator * 2);\n\n```\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/PriceFeed.sol#L801-L804\n\n\n### [L-2] Consider implementing two-step procedure for updating protocol addresses\n\nA copy-paste error or a typo may end up bricking protocol functionality, or sending tokens to an address with no known private key. Consider implementing a two-step procedure for updating protocol addresses, where the recipient is set as pending, and must 'accept' the", "vulnerable_code": "file: /contracts/contracts/LiquidationLibrary.sol\n \n882 uint256 EBTCDebtRewardPerUnitStaked = EBTCDebtNumerator / _totalStakes;\n", "fixed_code": "file: contracts/contracts/CdpManagerStorage.sol\n\n564 uint256 _feeTaken = collateral.getSharesByPooledEth(_deltaFeeSplit) / DECIMAL_PRECISION;\n\n567 uint256 _deltaFeePerUnit = _deltaFeeSplitShare / _cachedAllStakes;\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/SAQ-Q.md", "collected_at": "2026-01-02T18:26:36.548894+00:00", "source_hash": "5bd5e6d99b20bcf201e8511e41f24c3713645592d90061aefb8621da670b7cee", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 598, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "file: /contracts/contracts/LiquidationLibrary.sol\n \n882 uint256 EBTCDebtRewardPerUnitStaked = EBTCDebtNumerator / _totalStakes;", "primary_code_language": "solidity", "primary_code_char_count": 134, "all_code_blocks": "// Code block 1 (solidity):\nfile: /contracts/contracts/LiquidationLibrary.sol\n \n882 uint256 EBTCDebtRewardPerUnitStaked = EBTCDebtNumerator / _totalStakes;\n\n// Code block 2 (solidity):\nfile: contracts/contracts/CdpManagerStorage.sol\n\n564 uint256 _feeTaken = collateral.getSharesByPooledEth(_deltaFeeSplit) / DECIMAL_PRECISION;\n\n567 uint256 _deltaFeePerUnit = _deltaFeeSplitShare / _cachedAllStakes;\n\n// Code block 3 (solidity):\nfile: /contracts/contracts/PriceFeed.sol\n\n801 (_scaledDecimal *\n uint256(_ethBtcAnswer) *\n uint256(_stEthEthAnswer) *\n EbtcMath.DECIMAL_PRECISION) / 10 ** (_decimalDenominator * 2);", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "file: /contracts/contracts/LiquidationLibrary.sol\n \n882 uint256 EBTCDebtRewardPerUnitStaked = EBTCDebtNumerator / _totalStakes;\n\nfile: contracts/contracts/CdpManagerStorage.sol\n\n564 uint256 _feeTaken = collateral.getSharesByPooledEth(_deltaFeeSplit) / DECIMAL_PRECISION;\n\n567 uint256 _deltaFeePerUnit = _deltaFeeSplitShare / _cachedAllStakes;\n\nfile: /contracts/contracts/PriceFeed.sol\n\n801 (_scaledDecimal *\n uint256(_ethBtcAnswer) *\n uint256(_stEthEthAnswer) *\n EbtcMath.DECIMAL_PRECISION) / 10 ** (_decimalDenominator * 2);", "github_refs_formatted": "LiquidationLibrary.sol#L882, CdpManagerStorage.sol#L564, PriceFeed.sol#L801-L804", "github_files_list": "PriceFeed.sol, LiquidationLibrary.sol, CdpManagerStorage.sol", "github_refs_count": 3, "vulnerable_code_actual": "file: /contracts/contracts/LiquidationLibrary.sol\n \n882 uint256 EBTCDebtRewardPerUnitStaked = EBTCDebtNumerator / _totalStakes;\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "file: contracts/contracts/CdpManagerStorage.sol\n\n564 uint256 _feeTaken = collateral.getSharesByPooledEth(_deltaFeeSplit) / DECIMAL_PRECISION;\n\n567 uint256 _deltaFeePerUnit = _deltaFeeSplitShare / _cachedAllStakes;\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "01-biconomy", "title": "Fon Q", "severity_raw": "Unknown", "severity": "unknown", "description": "function nonce\n```solidity\nfunction nonce(uint256 _batchId) public view virtual override returns (uint256) {\n return nonces[_batchId];\n }\n```\nand function getNonce\n```solidity\nfunction getNonce(uint256 batchId)\n public view\n returns (uint256) {\n return nonces[batchId];\n }\n```\ndo exactly the same thing, consider removing getNonce\n\n", "vulnerable_code": "function nonce(uint256 _batchId) public view virtual override returns (uint256) {\n return nonces[_batchId];\n }", "fixed_code": "function getNonce(uint256 batchId)\n public view\n returns (uint256) {\n return nonces[batchId];\n }", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/Fon-Q.md", "collected_at": "2026-01-02T18:13:05.329638+00:00", "source_hash": "5bf0865353ffcef6c6fdfec5df6acc1f78c7305eef3932b49722320754b5b0b4", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 232, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function nonce(uint256 _batchId) public view virtual override returns (uint256) {\n return nonces[_batchId];\n }", "primary_code_language": "solidity", "primary_code_char_count": 120, "all_code_blocks": "// Code block 1 (solidity):\nfunction nonce(uint256 _batchId) public view virtual override returns (uint256) {\n return nonces[_batchId];\n }\n\n// Code block 2 (solidity):\nfunction getNonce(uint256 batchId)\n public view\n returns (uint256) {\n return nonces[batchId];\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function nonce(uint256 _batchId) public view virtual override returns (uint256) {\n return nonces[_batchId];\n }\n\nfunction getNonce(uint256 batchId)\n public view\n returns (uint256) {\n return nonces[batchId];\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function nonce(uint256 _batchId) public view virtual override returns (uint256) {\n return nonces[_batchId];\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function getNonce(uint256 batchId)\n public view\n returns (uint256) {\n return nonces[batchId];\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 4.72} {"source": "c4", "protocol": "09-ondo", "title": "Krace Q", "severity_raw": "Low", "severity": "low", "description": "## [Low] dailyInterestRate maybe wrongly set, causing zero price\n`dailyInterestRate` is used to calculate the current price of USDY. Once it is set to zero, the price will become zero.\nWhen admin sets the Range, `dailyInterestRate` should be checked to ensure it's not zero.\n\n```\nroundUpTo8(\n _rmul(\n _rpow(currentRange.dailyInterestRate, elapsedDays + 1, ONE),\n currentRange.prevRangeClosePrice\n )\n );\n```\n\n## [Info] Wrong comment in DestinationBridge.sol\n`_mintIfThresholdMet` is not a public function, maybe you should update your comment.\n\n```\n /*//////////////////////////////////////////////////////////////\n Public Functions\n //////////////////////////////////////////////////////////////*/\n\n /**\n * @notice internal function to mint a transaction if it has passed the threshold\n * for the number of approvers\n *\n * @param txnHash The hash of the transaction we wish to mint\n */\n function _mintIfThresholdMet(bytes32 txnHash) internal {\n bool thresholdMet = _checkThresholdMet(txnHash);\n Transaction memory txn = txnHashToTransaction[txnHash];\n if (thresholdMet) {\n _checkAndUpdateInstantMintLimit(txn.amount);\n if (!ALLOWLIST.isAllowed(txn.sender)) {\n ALLOWLIST.setAccountStatus(\n txn.sender,\n ALLOWLIST.getValidTermIndexes()[0],\n true\n );\n }\n TOKEN.mint(txn.sender, txn.amount);\n delete txnHashToTransaction[txnHash];\n emit BridgeCompleted(txn.sender, txn.amount);\n }\n }\n```\n", "vulnerable_code": "roundUpTo8(\n _rmul(\n _rpow(currentRange.dailyInterestRate, elapsedDays + 1, ONE),\n currentRange.prevRangeClosePrice\n )\n );", "fixed_code": " /*//////////////////////////////////////////////////////////////\n Public Functions\n //////////////////////////////////////////////////////////////*/\n\n /**\n * @notice internal function to mint a transaction if it has passed the threshold\n * for the number of approvers\n *\n * @param txnHash The hash of the transaction we wish to mint\n */\n function _mintIfThresholdMet(bytes32 txnHash) internal {\n bool thresholdMet = _checkThresholdMet(txnHash);\n Transaction memory txn = txnHashToTransaction[txnHash];\n if (thresholdMet) {\n _checkAndUpdateInstantMintLimit(txn.amount);\n if (!ALLOWLIST.isAllowed(txn.sender)) {\n ALLOWLIST.setAccountStatus(\n txn.sender,\n ALLOWLIST.getValidTermIndexes()[0],\n true\n );\n }\n TOKEN.mint(txn.sender, txn.amount);\n delete txnHashToTransaction[txnHash];\n emit BridgeCompleted(txn.sender, txn.amount);\n }\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/Krace-Q.md", "collected_at": "2026-01-02T18:25:34.945876+00:00", "source_hash": "5c06d48b47b628c79a2b1774a207c00bd0dc187539480b0d4fdaad0bc9198b2f", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 1117, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "roundUpTo8(\n _rmul(\n _rpow(currentRange.dailyInterestRate, elapsedDays + 1, ONE),\n currentRange.prevRangeClosePrice\n )\n );", "primary_code_language": "unknown", "primary_code_char_count": 159, "all_code_blocks": "// Code block 1 (unknown):\nroundUpTo8(\n _rmul(\n _rpow(currentRange.dailyInterestRate, elapsedDays + 1, ONE),\n currentRange.prevRangeClosePrice\n )\n );\n\n// Code block 2 (unknown):\n/*//////////////////////////////////////////////////////////////\n Public Functions\n //////////////////////////////////////////////////////////////*/\n\n /**\n * @notice internal function to mint a transaction if it has passed the threshold\n * for the number of approvers\n *\n * @param txnHash The hash of the transaction we wish to mint\n */\n function _mintIfThresholdMet(bytes32 txnHash) internal {\n bool thresholdMet = _checkThresholdMet(txnHash);\n Transaction memory txn = txnHashToTransaction[txnHash];\n if (thresholdMet) {\n _checkAndUpdateInstantMintLimit(txn.amount);\n if (!ALLOWLIST.isAllowed(txn.sender)) {\n ALLOWLIST.setAccountStatus(\n txn.sender,\n ALLOWLIST.getValidTermIndexes()[0],\n true\n );\n }\n TOKEN.mint(txn.sender, txn.amount);\n delete txnHashToTransaction[txnHash];\n emit BridgeCompleted(txn.sender, txn.amount);\n }\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "roundUpTo8(\n _rmul(\n _rpow(currentRange.dailyInterestRate, elapsedDays + 1, ONE),\n currentRange.prevRangeClosePrice\n )\n );", "has_vulnerable_code_snippet": true, "fixed_code_actual": " /*//////////////////////////////////////////////////////////////\n Public Functions\n //////////////////////////////////////////////////////////////*/\n\n /**\n * @notice internal function to mint a transaction if it has passed the threshold\n * for the number of approvers\n *\n * @param txnHash The hash of the transaction we wish to mint\n */\n function _mintIfThresholdMet(bytes32 txnHash) internal {\n bool thresholdMet = _checkThresholdMet(txnHash);\n Transaction memory txn = txnHashToTransaction[txnHash];\n if (thresholdMet) {\n _checkAndUpdateInstantMintLimit(txn.amount);\n if (!ALLOWLIST.isAllowed(txn.sender)) {\n ALLOWLIST.setAccountStatus(\n txn.sender,\n ALLOWLIST.getValidTermIndexes()[0],\n true\n );\n }\n TOKEN.mint(txn.sender, txn.amount);\n delete txnHashToTransaction[txnHash];\n emit BridgeCompleted(txn.sender, txn.amount);\n }\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "09-ondo", "title": "0xpanicError Q", "severity_raw": "Critical", "severity": "critical", "description": "# Low Issues\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [L-1](#L-1) | There should be a cap on `dailyInterestRate` | 2 |\n| [L-2](#L-2) | `getPrice` can return 0 if startTime is set more than block.timestamp | 1 |\n### [L-1] There should be a cap on `dailyInterestRate` \n`dailyInterestRate` is a value set in range by the admin. Since it is being exponentiated by number of days, if \nfor any reason that value is not scaled appropriately, or interest is passed for a monthly or yearly rates instead\nof daily, the resulting price would be way off the expected value.\n

\nConsider adding a `MIN_INTEREST` and `MAX_INTEREST` values to make sure the interest rate is not accidently passed\nincorrectly. \n``` solidity\nrequire( dailyInterestRate <= MAX_INTEREST );\nrequire( dailyInterestRate >= MIN_INTEREST );\n```\n\nContracts in scope: https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/rwaOracles/RWADynamicOracle.sol\n\n*Instances (2)*:
\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/rwaOracles/RWADynamicOracle.sol#L151\n```solidity\n function setRange(\n uint256 endTimestamp,\n uint256 dailyInterestRate\n ) external onlyRole(SETTER_ROLE) {}\n```\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/rwaOracles/RWADynamicOracle.sol#L186\n``` solidity\nfunction overrideRange(\n uint256 indexToModify,\n uint256 newStart,\n uint256 newEnd,\n uint256 newDailyIR,\n uint256 newPrevRangeClosePrice\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {}\n```\n### [L-2] `getPrice` can return 0 if startTime is set more than block.timestamp\nThe first rage is set in the constructor, but there is no limit as to how long in the future the range can start. This\nmeans that if `firstRangeStart` is more than block.timestamp (during deployment) then anyone can call the public function\n`getPrice` which would return 0 unless `firstRangeStart > block.timestamp` .\n

\nSince this function is crucial in determining the amount of rUSDY tokens of the user, there must be checks ", "vulnerable_code": "Contracts in scope: https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/rwaOracles/RWADynamicOracle.sol\n\n*Instances (2)*:
\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/rwaOracles/RWADynamicOracle.sol#L151", "fixed_code": "https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/rwaOracles/RWADynamicOracle.sol#L186", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/0xpanicError-Q.md", "collected_at": "2026-01-02T18:25:18.257345+00:00", "source_hash": "5c338a659bbd3b5507bb2bffe2e680c18eeeee47c80f4b46c66acde498b91aa8", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 336, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "Contracts in scope: https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/rwaOracles/RWADynamicOracle.sol\n\n*Instances (2)*:
\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/rwaOracles/RWADynamicOracle.sol#L151", "primary_code_language": "unknown", "primary_code_char_count": 237, "all_code_blocks": "// Code block 1 (unknown):\nContracts in scope: https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/rwaOracles/RWADynamicOracle.sol\n\n*Instances (2)*:
\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/rwaOracles/RWADynamicOracle.sol#L151\n\n// Code block 2 (unknown):\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/rwaOracles/RWADynamicOracle.sol#L186", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "RWADynamicOracle.sol, RWADynamicOracle.sol#L151, RWADynamicOracle.sol#L186", "github_files_list": "RWADynamicOracle.sol", "github_refs_count": 3, "vulnerable_code_actual": "Contracts in scope: https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/rwaOracles/RWADynamicOracle.sol\n\n*Instances (2)*:
\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/rwaOracles/RWADynamicOracle.sol#L151", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 7} {"source": "c4", "protocol": "11-kelp", "title": "catellatech Q", "severity_raw": "High", "severity": "high", "description": "# QA report for Kelp DAO contest by Catellatech\n\n## [QA-01] onlyLRTManager can approve the max asset in NodeDelegator::maxApproveToEigenStrategyManager even when the contract is paused \nConsider add the `whenNotPaused` modifier to the function `NodeDelegator::maxApproveToEigenStrategyManager` as well.\n\n- https://github.com/code-423n4/2023-11-kelp/blob/main/src/NodeDelegator.sol#L38C1-L46C6\n\n```solidity\n function maxApproveToEigenStrategyManager(address asset)\n external\n override\n onlySupportedAsset(asset)\n onlyLRTManager\n {\n address eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);\n IERC20(asset).approve(eigenlayerStrategyManagerAddress, type(uint256).max);\n }\n```\n## [QA-02] Remove/resolve the comments like the following\nin `LRTDepositPool::getAssetDistributionData` in line [78](https://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L78) the following comment it was not remove ` // Question: is here the right place to have this? Could it be in LRTConfig?`. Please remove or resolve that comment.\n\n## [QA-03] in the `LRTConfig.sol` contract the team did not consider adding a function to remove assets\nContext: The contract handles `addNewSupportedAsset` and `updateAssetStrategy` but does not account for a scenario where they have to remove an asset from the LRTConfig; in that case, it won't be possible.\n\n## [QA-04] Inconsistent Use of NatSpec\nNatSpec is a boon to all Solidity developers. Not only does it provide a structure for developers to document their code within the code itself, it encourages the practice of documenting code. When future developers read code documented with NatSpec, they are able to increase their capacity to understand, upgrade, and fix code. Without code documented with NatSpec, that capacity is hindered.\n\nThe Centrifuge codebase does have a high level of documentation with NatSpec. However there are numerous instances of function", "vulnerable_code": " function maxApproveToEigenStrategyManager(address asset)\n external\n override\n onlySupportedAsset(asset)\n onlyLRTManager\n {\n address eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);\n IERC20(asset).approve(eigenlayerStrategyManagerAddress, type(uint256).max);\n }", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/catellatech-Q.md", "collected_at": "2026-01-02T18:27:52.438605+00:00", "source_hash": "5c3e897af29a7edf87385859570ef90aae93c1f258c5559e83e4238500d3cb4f", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 354, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function maxApproveToEigenStrategyManager(address asset)\n external\n override\n onlySupportedAsset(asset)\n onlyLRTManager\n {\n address eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);\n IERC20(asset).approve(eigenlayerStrategyManagerAddress, type(uint256).max);\n }", "primary_code_language": "solidity", "primary_code_char_count": 354, "all_code_blocks": "// Code block 1 (solidity):\nfunction maxApproveToEigenStrategyManager(address asset)\n external\n override\n onlySupportedAsset(asset)\n onlyLRTManager\n {\n address eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);\n IERC20(asset).approve(eigenlayerStrategyManagerAddress, type(uint256).max);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function maxApproveToEigenStrategyManager(address asset)\n external\n override\n onlySupportedAsset(asset)\n onlyLRTManager\n {\n address eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);\n IERC20(asset).approve(eigenlayerStrategyManagerAddress, type(uint256).max);\n }", "github_refs_formatted": "NodeDelegator.sol#L38-L1, LRTDepositPool.sol#L78", "github_files_list": "NodeDelegator.sol, LRTDepositPool.sol", "github_refs_count": 2, "vulnerable_code_actual": " function maxApproveToEigenStrategyManager(address asset)\n external\n override\n onlySupportedAsset(asset)\n onlyLRTManager\n {\n address eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);\n IERC20(asset).approve(eigenlayerStrategyManagerAddress, type(uint256).max);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "01-ondo", "title": "chaduke Q", "severity_raw": "High", "severity": "high", "description": "GA1. https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/lending/tokens/cToken/CTokenModified.sol#L576-L587\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/lending/tokens/cToken/CTokenModified.sol#L584-L587\nWe need to check that only one of ``redeemTokensIn`` and ``redeemAmountIn`` is greater than zero, and the other is equal to zero.\n```\nrequire(\n (redeemTokensIn >0 && redeemAmountIn == 0) || (redeemTokensIn == 0 && redeemAmountIn > 0),\n \"Only one of redeemTokensIn and redeemAmountIn must be zero\"\n );\n```\n\nGA2. https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/lending/tokens/cToken/CTokenModified.sol#L650\nWe need to track the actual doTransferOut() since their might be a discrepancy, either we revert when there is a discrepancy, or we need to let the caller know the slippage and let the caller decides what to do. \n\n```\nactualRedeemAmount = doTransferOut(redeemer, redeemAmount);\n\n```\nGA3. https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/lending/tokens/cToken/CTokenModified.sol#L795\nThe documentation should be \"/* If repayAmount == max, repayAmount = accountBorrows */\n\nGA4: https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/lending/tokens/cToken/CTokenModified.sol#L94\nZero amount check for ``tokens`` is needed.\n\n\nGA5. https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/lending/tokens/cToken/CTokenModified.sol#L479\nZero amount check for ``mintAmount`` is needed.\n\nGA6. https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/lending/tokens/cCash/CTokenInterfacesModifiedCash.sol#L2\nLock all contracts at the most recent version of solidity 0.8.17.\n\nGA7. https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/", "vulnerable_code": "require(\n (redeemTokensIn >0 && redeemAmountIn == 0) || (redeemTokensIn == 0 && redeemAmountIn > 0),\n \"Only one of redeemTokensIn and redeemAmountIn must be zero\"\n );", "fixed_code": "actualRedeemAmount = doTransferOut(redeemer, redeemAmount);\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/chaduke-Q.md", "collected_at": "2026-01-02T18:15:00.086008+00:00", "source_hash": "5c7600a395249ba004f7b39e5ceba038c0e902f6aeb63542b6338f295b07d5b5", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 238, "github_ref_count": 7, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "require(\n (redeemTokensIn >0 && redeemAmountIn == 0) || (redeemTokensIn == 0 && redeemAmountIn > 0),\n \"Only one of redeemTokensIn and redeemAmountIn must be zero\"\n );", "primary_code_language": "unknown", "primary_code_char_count": 179, "all_code_blocks": "// Code block 1 (unknown):\nrequire(\n (redeemTokensIn >0 && redeemAmountIn == 0) || (redeemTokensIn == 0 && redeemAmountIn > 0),\n \"Only one of redeemTokensIn and redeemAmountIn must be zero\"\n );\n\n// Code block 2 (unknown):\nactualRedeemAmount = doTransferOut(redeemer, redeemAmount);", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CTokenModified.sol#L576-L587, CTokenModified.sol#L584-L587, CTokenModified.sol#L650, CTokenModified.sol#L795, CTokenModified.sol#L94, CTokenModified.sol#L479, CTokenInterfacesModifiedCash.sol#L2", "github_files_list": "CTokenInterfacesModifiedCash.sol, CTokenModified.sol", "github_refs_count": 7, "vulnerable_code_actual": "require(\n (redeemTokensIn >0 && redeemAmountIn == 0) || (redeemTokensIn == 0 && redeemAmountIn > 0),\n \"Only one of redeemTokensIn and redeemAmountIn must be zero\"\n );", "has_vulnerable_code_snippet": true, "fixed_code_actual": "actualRedeemAmount = doTransferOut(redeemer, redeemAmount);\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "02-ai-arena", "title": "14si2o_Flint Q", "severity_raw": "Medium", "severity": "medium", "description": "## [L-01] globalStakedAmount is greater than actual staked amount\n\nThe `globalStakedAmount` state variable in `RankedBattle.sol` keeps track of the overall staked amount in the protocol. It is increased by staking and decreased by unstaking.\nHowever, it does not take into account the stake moved to the `StakeAtRisk` contract, a part of which will be sent to the treasury. \n\nAs such, every round the `globalStakedAmount` becomes a fraction larger than the actual staked amount and this discrepancy will only increase over time. \n\nThis is currently only a Low since the variable is not used in any calculations.\n\n## [L-02] Incomplete require check in redeemMintPass\n\nThe require statement in `redeemMintPass` checks that all the arrays have the same length, but does not include `iconsTypes`. \n\nAs a result, it is possible to input an `iconTypes` array with a shorter length, which will case een Out-Of-Bounds error and revert the function. \n\n\n``` diff \n function redeemMintPass(\n uint256[] calldata mintpassIdsToBurn,\n uint8[] calldata fighterTypes,\n uint8[] calldata iconsTypes,\n string[] calldata mintPassDnas,\n string[] calldata modelHashes,\n string[] calldata modelTypes\n ) \n external \n {\n require(\n mintpassIdsToBurn.length == mintPassDnas.length && \n mintPassDnas.length == fighterTypes.length &&\n+ fighterTypes.length == iconsTypes.length && \n fighterTypes.length == modelHashes.length &&\n modelHashes.length == modelTypes.length\n );\n for (uint16 i = 0; i < mintpassIdsToBurn.length; i++) {\n require(msg.sender == _mintpassInstance.ownerOf(mintpassIdsToBurn[i]));\n _mintpassInstance.burn(mintpassIdsToBurn[i]);\n _createNewFighter(\n msg.sender, \n uint256(keccak256(abi.encode(mintPassDnas[i]))), \n modelHashes[i], \n modelTypes[i], \n fighterTypes[i],\n", "vulnerable_code": "## [L-03] Incomplete require check in GameItems.mint\n\nThe 4th require statement in `GameItems.mint` checks that the `quantity` demanded does not exceed the dailyAllowance or the allowanceRemaining. \nYet the first part of the require only checks if the user can replenish his allowance, **not** that the `quantity` is equal or lower than the dailyAllowance. \n\nAs a consequence, if `quantity` = 100, `dailyAllowance` = 10 and `dailyAllowanceReplenishTime[msg.sender][tokenId] <= block.timestamp` == true, then it will pass the require statement. \n\nThis will cause an underflow and revert on `allowanceRemaining[msg.sender][tokenId] -= quantity;`\n", "fixed_code": "## [L-04] GameItems.remainingSupply will return 0 for a game item with infinite supply\n\nWhen a game item is created, if `finiteSupply == true` then the `itemsRemaining` is set to a specific number. \nHowever, when `finiteSupply == false` then the `itemsRemaining` is set to 0. This is confirmed in the `Deployer` script for the battery game item. \n\nAs such, when a player calls `remainingSupply` on a game item with infinite supply, he will get 0 as return. Which is obviously an error. \nI would suggest changing the `remainingSupply` to avoid confusion.\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/14si2o_Flint-Q.md", "collected_at": "2026-01-02T19:02:11.999981+00:00", "source_hash": "5ccd3d144cf534713210fef903cf02a856d816ec9fa1b549c4163c01c26dffb0", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "## [L-03] Incomplete require check in GameItems.mint\n\nThe 4th require statement in `GameItems.mint` checks that the `quantity` demanded does not exceed the dailyAllowance or the allowanceRemaining. \nYet the first part of the require only checks if the user can replenish his allowance, **not** that the `quantity` is equal or lower than the dailyAllowance. \n\nAs a consequence, if `quantity` = 100, `dailyAllowance` = 10 and `dailyAllowanceReplenishTime[msg.sender][tokenId] <= block.timestamp` == true, then it will pass the require statement. \n\nThis will cause an underflow and revert on `allowanceRemaining[msg.sender][tokenId] -= quantity;`\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## [L-04] GameItems.remainingSupply will return 0 for a game item with infinite supply\n\nWhen a game item is created, if `finiteSupply == true` then the `itemsRemaining` is set to a specific number. \nHowever, when `finiteSupply == false` then the `itemsRemaining` is set to 0. This is confirmed in the `Deployer` script for the battery game item. \n\nAs such, when a player calls `remainingSupply` on a game item with infinite supply, he will get 0 as return. Which is obviously an error. \nI would suggest changing the `remainingSupply` to avoid confusion.\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "10-badger", "title": "TrungOre Q", "severity_raw": "Medium", "severity": "medium", "description": "# Low Risk Issues\n\n| Number | Issue |\n|--------|--------|\n|[L-01]| Redundant requirement `require(vars.netStEthBalance > 0, \"BorrowerOperations: zero collateral for openCdp()!\");` in function `_openCdp()` |\n|[L-02]| Unused array `_liqFlags` |\n|[L-03]| Function `LiquidationLibrary._redistributeDebt()` shouldn't return if `_debt == 0` |\n|[L-04]| Typo in comments |\n|[L-05]| Inappropriate check in function `ActivePool.flashLoan()` |\n\n### [L-01] Redundant requirement `require(vars.netStEthBalance > 0, \"BorrowerOperations: zero collateral for openCdp()!\");` in function `_openCdp()`\n\nIn the function `BorrowerOperations._openCdp()`, the requirement `vars.netStEthBalance > 0` in line 463 is redundant due to the check in [line 454](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/BorrowerOperations.sol#L454):\n\n```solidity\n454 _requireAtLeastMinNetStEthBalance(vars.netStEthBalance);\n```\n\nTherefore, the requirement `vars.netStEthBalance > 0` in [line 463](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/BorrowerOperations.sol#L463C17-L463C37) is redundant.\n\n### [L-02] Unused array `_liqFlags`\n\nIn the function `LiquidationLibrary._getTotalFromBatchLiquidate_RecoveryMode()`, the array `_liqFlags` is created to denote which iterations are liquidated successfully. However, this array is neither used to return a value nor utilized for event emission, resulting in unnecessary gas consumption for users.\n\nhttps://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/LiquidationLibrary.sol#L751\n```solidity\n751 bool[] memory _liqFlags = new bool[](_cnt);\n```\n\n### [L-03] Function `LiquidationLibrary._redistributeDebt()` shouldn't return if `_debt == 0`\n\nIn the function `LiquidationLibrary._redistributeDebt()`, when `_debt == 0`, the function immediately returns, assuming th", "vulnerable_code": "454 _requireAtLeastMinNetStEthBalance(vars.netStEthBalance);", "fixed_code": "751 bool[] memory _liqFlags = new bool[](_cnt);", "recommendation": "", "category": "flash-loan", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/TrungOre-Q.md", "collected_at": "2026-01-02T18:26:39.674422+00:00", "source_hash": "5dd2c216f6e28fa21821833c7fc892049059623d9ebb7fd2fca8e81858d4a13b", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 121, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "454 _requireAtLeastMinNetStEthBalance(vars.netStEthBalance);", "primary_code_language": "solidity", "primary_code_char_count": 67, "all_code_blocks": "// Code block 1 (solidity):\n454 _requireAtLeastMinNetStEthBalance(vars.netStEthBalance);\n\n// Code block 2 (solidity):\n751 bool[] memory _liqFlags = new bool[](_cnt);", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "454 _requireAtLeastMinNetStEthBalance(vars.netStEthBalance);\n\n751 bool[] memory _liqFlags = new bool[](_cnt);", "github_refs_formatted": "BorrowerOperations.sol#L454, BorrowerOperations.sol#L463-L17, LiquidationLibrary.sol#L751", "github_files_list": "BorrowerOperations.sol, LiquidationLibrary.sol", "github_refs_count": 3, "vulnerable_code_actual": "454 _requireAtLeastMinNetStEthBalance(vars.netStEthBalance);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "751 bool[] memory _liqFlags = new bool[](_cnt);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "09-ondo", "title": "kutugu Q", "severity_raw": "Critical", "severity": "critical", "description": "# Findings Summary\n\n| ID | Title | Severity |\n| ------ | ---------------------------------------------------------------------------------------- | ------------- |\n| [L-01] | setThresholds should prohibit equal amount | Low |\n| [L-02] | SourceBridge cannot share the same address on different chains | Low |\n| [L-03] | DestinationBridge.execute does not check whether msg.sender is a legal approver | Low |\n| [N-01] | Upgradeable contracts should explicitly call the init function of the inherited contract | Non-Critical |\n\n# Detailed Findings\n\n# [L-01] setThresholds should prohibit equal amount\n\n## Description\n\n```solidity\n function setThresholds(\n string calldata srcChain,\n uint256[] calldata amounts,\n uint256[] calldata numOfApprovers\n ) external onlyOwner {\n if (amounts.length != numOfApprovers.length) {\n revert ArrayLengthMismatch();\n }\n delete chainToThresholds[srcChain];\n for (uint256 i = 0; i < amounts.length; ++i) {\n if (i == 0) {\n chainToThresholds[srcChain].push(\n Threshold(amounts[i], numOfApprovers[i])\n );\n } else {\n if (chainToThresholds[srcChain][i - 1].amount > amounts[i]) {\n revert ThresholdsNotInAscendingOrder();\n }\n chainToThresholds[srcChain].push(\n Threshold(amounts[i], numOfApprovers[i])\n );\n }\n }\n emit ThresholdSet(srcChain, amounts, numOfApprovers);\n }\n\n function _attachThreshold(\n uint256 amount,\n bytes32 txnHash,\n string memory srcChain\n ) internal {\n Threshold[] memory thresholds = chainToThresholds[srcChain];\n for (uint256 i = 0; i < thresholds.length; ++i) {\n Threshold memory t = thresholds[i];\n if (amount <= t.amount) {\n txnToThresholdSet[txnHash] = TxnThreshold(\n t.numberOfApproval", "vulnerable_code": " function setThresholds(\n string calldata srcChain,\n uint256[] calldata amounts,\n uint256[] calldata numOfApprovers\n ) external onlyOwner {\n if (amounts.length != numOfApprovers.length) {\n revert ArrayLengthMismatch();\n }\n delete chainToThresholds[srcChain];\n for (uint256 i = 0; i < amounts.length; ++i) {\n if (i == 0) {\n chainToThresholds[srcChain].push(\n Threshold(amounts[i], numOfApprovers[i])\n );\n } else {\n if (chainToThresholds[srcChain][i - 1].amount > amounts[i]) {\n revert ThresholdsNotInAscendingOrder();\n }\n chainToThresholds[srcChain].push(\n Threshold(amounts[i], numOfApprovers[i])\n );\n }\n }\n emit ThresholdSet(srcChain, amounts, numOfApprovers);\n }\n\n function _attachThreshold(\n uint256 amount,\n bytes32 txnHash,\n string memory srcChain\n ) internal {\n Threshold[] memory thresholds = chainToThresholds[srcChain];\n for (uint256 i = 0; i < thresholds.length; ++i) {\n Threshold memory t = thresholds[i];\n if (amount <= t.amount) {\n txnToThresholdSet[txnHash] = TxnThreshold(\n t.numberOfApprovalsNeeded,\n new address[](0)\n );\n break;\n }\n }\n if (txnToThresholdSet[txnHash].numberOfApprovalsNeeded == 0) {\n revert NoThresholdMatch();\n }\n }", "fixed_code": " function addChainSupport(\n string calldata srcChain,\n string calldata srcContractAddress\n ) external onlyOwner {\n chainToApprovedSender[srcChain] = keccak256(abi.encode(srcContractAddress));\n emit ChainIdSupported(srcChain, srcContractAddress);\n }\n\n // @audit may revert here\n if (isSpentNonce[chainToApprovedSender[srcChain]][nonce]) {\n revert NonceSpent();\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/kutugu-Q.md", "collected_at": "2026-01-02T18:26:02.781113+00:00", "source_hash": "5dd6b708d1332b7915e984883bb4a4a02c5c61701d7d8e3d2ef05fd0d413888d", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function setThresholds(\n string calldata srcChain,\n uint256[] calldata amounts,\n uint256[] calldata numOfApprovers\n ) external onlyOwner {\n if (amounts.length != numOfApprovers.length) {\n revert ArrayLengthMismatch();\n }\n delete chainToThresholds[srcChain];\n for (uint256 i = 0; i < amounts.length; ++i) {\n if (i == 0) {\n chainToThresholds[srcChain].push(\n Threshold(amounts[i], numOfApprovers[i])\n );\n } else {\n if (chainToThresholds[srcChain][i - 1].amount > amounts[i]) {\n revert ThresholdsNotInAscendingOrder();\n }\n chainToThresholds[srcChain].push(\n Threshold(amounts[i], numOfApprovers[i])\n );\n }\n }\n emit ThresholdSet(srcChain, amounts, numOfApprovers);\n }\n\n function _attachThreshold(\n uint256 amount,\n bytes32 txnHash,\n string memory srcChain\n ) internal {\n Threshold[] memory thresholds = chainToThresholds[srcChain];\n for (uint256 i = 0; i < thresholds.length; ++i) {\n Threshold memory t = thresholds[i];\n if (amount <= t.amount) {\n txnToThresholdSet[txnHash] = TxnThreshold(\n t.numberOfApprovalsNeeded,\n new address[](0)\n );\n break;\n }\n }\n if (txnToThresholdSet[txnHash].numberOfApprovalsNeeded == 0) {\n revert NoThresholdMatch();\n }\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function addChainSupport(\n string calldata srcChain,\n string calldata srcContractAddress\n ) external onlyOwner {\n chainToApprovedSender[srcChain] = keccak256(abi.encode(srcContractAddress));\n emit ChainIdSupported(srcChain, srcContractAddress);\n }\n\n // @audit may revert here\n if (isSpentNonce[chainToApprovedSender[srcChain]][nonce]) {\n revert NonceSpent();\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "04-caviar", "title": "latt1ce Q", "severity_raw": "Low", "severity": "low", "description": "## Solmate\u2019s SafeTransferLib doesn\u2019t check whether the ERC20 contract exists\nSolmate\u2019s SafeTransferLib, which is often used to interact with non-compliant/unsafe ERC20 tokens, does not check whether the ERC20 contract exists. The following code will not revert in case the token doesn\u2019t exist.\n\nCode snippet : https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol#L9\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L256\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L346\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L423\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L502\n\n## Recommended Mitigation Steps\nAdd a contract exist control in functions;\n```solidity\npragma solidity >=0.8.0;\nfunction isContract(address _addr) private returns (bool isContract) {\n isContract = _addr.code.length > 0;\n}\n```", "vulnerable_code": "pragma solidity >=0.8.0;\nfunction isContract(address _addr) private returns (bool isContract) {\n isContract = _addr.code.length > 0;\n}", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/latt1ce-Q.md", "collected_at": "2026-01-02T18:20:38.217342+00:00", "source_hash": "5dd792acc3cbac7f8f42044d60219e28ba399a3583cedb1b4124439d6b042fcd", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 137, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "pragma solidity >=0.8.0;\nfunction isContract(address _addr) private returns (bool isContract) {\n isContract = _addr.code.length > 0;\n}", "primary_code_language": "solidity", "primary_code_char_count": 137, "all_code_blocks": "// Code block 1 (solidity):\npragma solidity >=0.8.0;\nfunction isContract(address _addr) private returns (bool isContract) {\n isContract = _addr.code.length > 0;\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "pragma solidity >=0.8.0;\nfunction isContract(address _addr) private returns (bool isContract) {\n isContract = _addr.code.length > 0;\n}", "github_refs_formatted": "SafeTransferLib.sol#L9, PrivatePool.sol#L256, PrivatePool.sol#L346, PrivatePool.sol#L423, PrivatePool.sol#L502", "github_files_list": "PrivatePool.sol, SafeTransferLib.sol", "github_refs_count": 5, "vulnerable_code_actual": "pragma solidity >=0.8.0;\nfunction isContract(address _addr) private returns (bool isContract) {\n isContract = _addr.code.length > 0;\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.89} {"source": "c4", "protocol": "02-ethos", "title": "flacko Q", "severity_raw": "Unknown", "severity": "unknown", "description": "# Lock pragma version\n\n## Proof of Concept\n\nA few of the contracts within the scope of the contest have a floating pragma:\n- Ethos-Vault/contracts/ReaperVaultV2.sol\n- Ethos-Vault/contracts/ReaperVaultERC4626.sol\n- Ethos-Vault/contracts/ReparerBaseStrategyv4.sol\n\n```\npragma solidity ^0.8.0;\n```\n\nCWE: https://swcregistry.io/docs/SWC-103\n\n## Impact\n\nWith a floating pragma, contracts might be compiled with a compiler version that has not been tested and might introduce unexpected bugs.\n\n## Mitigation suggestion\n\nLock pragma to a specific version, e.g. `pragma solidity 0.8.17;`.", "vulnerable_code": "pragma solidity ^0.8.0;", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/flacko-Q.md", "collected_at": "2026-01-02T18:17:11.859025+00:00", "source_hash": "5df4cdc91f2e94a341e3fd1d48870ce22aca48f9d6848ae40512ab340ae544f1", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 23, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "pragma solidity ^0.8.0;", "primary_code_language": "unknown", "primary_code_char_count": 23, "all_code_blocks": "// Code block 1 (unknown):\npragma solidity ^0.8.0;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "pragma solidity ^0.8.0;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 3.16} {"source": "c4", "protocol": "01-biconomy", "title": "cthulhu_cult G", "severity_raw": "High", "severity": "high", "description": "## GAS-1: Consider using IR Cogen compiler pipeline for gas optimization\n- Description: The IR-based code generator was introduced with an aim to not only allow code generation to be more transparent and auditable but also to enable more powerful optimization passes that span across functions.\n- Location: Project Wide\n- Proof of Gas savings: Enabling {viaIR: true} in the compiler settings will enable the IR-based code generator. This will allow the compiler to use more powerful optimization passes that span across functions. The gas savings will be in the range of 5-10%.\n\n```bash\n$ npx hardhat test\n127181000000000000\n \u2713 can send transactions and charge wallet for fees in erc20 tokens\n\n\u00b7----------------------------------------------------------|---------------------------|-------------|-----------------------------\u00b7\n| Solc version: 0.8.12 \u00b7 Optimizer enabled: true \u00b7 Runs: 200 \u00b7 Block limit: 30000000 gas \u2502\n\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\n| Methods \u2502\n\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\n| Contract \u00b7 Method \u00b7 Min \u00b7 Max \u00b7 Avg \u00b7 # calls \u00b7 usd (avg) \u2502\n\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\n| DepositPaymaster \u00b7 addDepositFor \u00b7 66363 \u00b7 83415 \u00b7 72051 \u00b7 3 \u00b7 - \u2502\n\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\n| DepositPaymaster \u00b7 addStake \u00b7 - \u00b7 - \u00b7 82651 \u00b7 ", "vulnerable_code": "```bash\n$ npx hardhat test --ir\n\n127771000000000000\n \u2713 can send transactions and charge wallet for fees in erc20 tokens\n\n\u00b7----------------------------------------------------------|---------------------------|-------------|-----------------------------\u00b7\n| Solc version: 0.8.12 \u00b7 Optimizer enabled: true \u00b7 Runs: 200 \u00b7 Block limit: 30000000 gas \u2502\n\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\n| Methods \u2502\n\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\n| Contract \u00b7 Method \u00b7 Min \u00b7 Max \u00b7 Avg \u00b7 # calls \u00b7 usd (avg) \u2502\n\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\n| DepositPaymaster \u00b7 addDepositFor \u00b7 65556 \u00b7 82596 \u00b7 71236 \u00b7 3 \u00b7 - \u2502\n\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\n| DepositPaymaster \u00b7 addStake \u00b7 - \u00b7 - \u00b7 83106 \u00b7 1 \u00b7 - \u2502\n\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\n| DepositPaymaster \u00b7 addToken \u00b7 - \u00b7 - \u00b7 46818 \u00b7 1 \u00b7 - \u2502\n\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\n| EntryPoint \u00b7 addStake \u00b7 31943 \u00b7 68943 \u00b7 45210 \u00b7 3 \u00b7 - \u2502\n\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7", "fixed_code": "// Before\n\n modifier onlyOwner {\n require(msg.sender == owner, \"Smart Account:: Sender is not authorized\");\n _;\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/cthulhu_cult-G.md", "collected_at": "2026-01-02T18:13:39.586294+00:00", "source_hash": "5e2243ae249175741ba8a5fb5a4993c9b6825f7f495169d52d1a2ff75ad965b5", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "```bash\n$ npx hardhat test --ir\n\n127771000000000000\n \u2713 can send transactions and charge wallet for fees in erc20 tokens\n\n\u00b7----------------------------------------------------------|---------------------------|-------------|-----------------------------\u00b7\n| Solc version: 0.8.12 \u00b7 Optimizer enabled: true \u00b7 Runs: 200 \u00b7 Block limit: 30000000 gas \u2502\n\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\n| Methods \u2502\n\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\n| Contract \u00b7 Method \u00b7 Min \u00b7 Max \u00b7 Avg \u00b7 # calls \u00b7 usd (avg) \u2502\n\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\n| DepositPaymaster \u00b7 addDepositFor \u00b7 65556 \u00b7 82596 \u00b7 71236 \u00b7 3 \u00b7 - \u2502\n\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\n| DepositPaymaster \u00b7 addStake \u00b7 - \u00b7 - \u00b7 83106 \u00b7 1 \u00b7 - \u2502\n\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\n| DepositPaymaster \u00b7 addToken \u00b7 - \u00b7 - \u00b7 46818 \u00b7 1 \u00b7 - \u2502\n\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\n| EntryPoint \u00b7 addStake \u00b7 31943 \u00b7 68943 \u00b7 45210 \u00b7 3 \u00b7 - \u2502\n\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7", "has_vulnerable_code_snippet": true, "fixed_code_actual": "// Before\n\n modifier onlyOwner {\n require(msg.sender == owner, \"Smart Account:: Sender is not authorized\");\n _;\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "11-kelp", "title": "0xAadi Q", "severity_raw": "Critical", "severity": "critical", "description": "## Summary\n\n### Low Risk Issues\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [[L‑01](#l01-tokenMap-mapping)] | The `tokenMap` mapping in the `LRTConfig` contract serves no significant purpose in the protocol, and its presence does not impact the current implementation. | 1 |\n| [[L‑02](#l02-three-mappings)] | The three mappings in the `LRTConfig` contract can be consolidated into a single mapping using a struct. | 1 |\n| [[L‑03](#l03-missing-events)] | The `tokenMap` mapping in the `LRTConfig` contract serves no significant purpose in the protocol, and its presence does not impact the current implementation. | 1 |\n| [[L‑04](#l04-missing-events)] | Missing Event for critical functions or parameters change | 2 |\n| [[L‑05](#l05-restricting-updating-rsETH)] | Consider restricting updating rsETH contract address after the initial deployment in `LRTConfig` contract | 1 |\n| [[L‑06](#l06-prevent-underflow-errors)] | Prevent underflow errors when depositing assets after reducing the deposit limit for assets. | 1 |\n| [[L‑07](#l07-verify-the-value )] | Verify the value of the `amount` parameter to prevent unnecessary gas losses. | 2 |\n| [[L‑08](#l08-including-the-depositor)] | Consider including the depositor's (msg.sender) address in the `AssetDeposit` event. | 1 |\n| [[L‑09](#l09-functionality-is-not-utilized)] | The `Pause/Unpause` functionality is not utilized in `src/LRTOracle.sol`. | 1 |\n\n### Non-critical Issues\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [[N‑01](#n01-relocating-the-definition)] | Consider relocating the definition of `DEFAULT_ADMIN_ROLE` to `LRTConstants.sol` for better adherence to coding standards. | 1 |\n| [[N‑02](#n02-verify-the-current-value)] | Verify the current value before assigning the new value to prevent unnecessary gas consumption in the event of setting the same value. | 4 |\n| [[N‑03](#n03-renaming-the-function)] | Consider renaming the function `updateAssetStrategy()` to `setAsset", "vulnerable_code": "File: src/LRTConfig.sol\n\n13: mapping(bytes32 tokenKey => address tokenAddress) public tokenMap;\n\n58: _setToken(LRTConstants.ST_ETH_TOKEN, stETH);\n59: _setToken(LRTConstants.R_ETH_TOKEN, rETH);\n60: _setToken(LRTConstants.CB_ETH_TOKEN, cbETH);\n\n127: function getLSTToken(bytes32 tokenKey) external view override returns (address) {\n128: return tokenMap[tokenKey];\n\n149: function setToken(bytes32 tokenKey, address assetAddress) external onlyRole(DEFAULT_ADMIN_ROLE) {\n150: _setToken(tokenKey, assetAddress);\n\n156: function _setToken(bytes32 key, address val) private {\n157: UtilLib.checkNonZeroAddress(val);\n158: if (tokenMap[key] == val) {\n159: revert ValueAlreadyInUse();\n160: }\n161: tokenMap[key] = val;\n", "fixed_code": "File: src/LRTConfig.sol\n\n15: mapping(address token => bool isSupported) public isSupportedAsset;\n16: mapping(address token => uint256 amount) public depositLimitByAsset;\n17: mapping(address token => address strategy) public override assetStrategy;", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/0xAadi-Q.md", "collected_at": "2026-01-02T18:27:09.153198+00:00", "source_hash": "5e336c6ba5866a6bb4e70a20efe0486a607465ccdca60da2e0e4663642ad63b3", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: src/LRTConfig.sol\n\n13: mapping(bytes32 tokenKey => address tokenAddress) public tokenMap;\n\n58: _setToken(LRTConstants.ST_ETH_TOKEN, stETH);\n59: _setToken(LRTConstants.R_ETH_TOKEN, rETH);\n60: _setToken(LRTConstants.CB_ETH_TOKEN, cbETH);\n\n127: function getLSTToken(bytes32 tokenKey) external view override returns (address) {\n128: return tokenMap[tokenKey];\n\n149: function setToken(bytes32 tokenKey, address assetAddress) external onlyRole(DEFAULT_ADMIN_ROLE) {\n150: _setToken(tokenKey, assetAddress);\n\n156: function _setToken(bytes32 key, address val) private {\n157: UtilLib.checkNonZeroAddress(val);\n158: if (tokenMap[key] == val) {\n159: revert ValueAlreadyInUse();\n160: }\n161: tokenMap[key] = val;\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: src/LRTConfig.sol\n\n15: mapping(address token => bool isSupported) public isSupportedAsset;\n16: mapping(address token => uint256 amount) public depositLimitByAsset;\n17: mapping(address token => address strategy) public override assetStrategy;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "06-lybra", "title": "8olidity Q", "severity_raw": "Unknown", "severity": "unknown", "description": "## `depositEtherToMint()` code redundancy\nSince the `depositEtherToMint()` function stores eth, the value of `collateralAsset.balanceOf(address(this))` will not change, but the code judges the balance of collateralAsset before and after the deposit operation, which is redundant code\n\n```solidity\nfunction depositEtherToMint(uint256 mintAmount) external payable override {\n require(msg.value >= 1 ether, \"DNL\");\n uint256 preBalance = collateralAsset.balanceOf(address(this));\n rkPool.deposit{value: msg.value}();\n uint256 balance = collateralAsset.balanceOf(address(this));\n depositedAsset[msg.sender] += balance - preBalance;//@audit \n\n if (mintAmount > 0) {\n _mintPeUSD(msg.sender, msg.sender, mintAmount, getAssetPrice());\n }\n\n emit DepositEther(msg.sender, address(collateralAsset), msg.value,balance - preBalance, block.timestamp);\n}\n```\n### Recommended\n\n```diff\nfunction depositEtherToMint(uint256 mintAmount) external payable override {\n require(msg.value >= 1 ether, \"DNL\");\n- uint256 preBalance = collateralAsset.balanceOf(address(this));\n rkPool.deposit{value: msg.value}();\n- uint256 balance = collateralAsset.balanceOf(address(this));\n- depositedAsset[msg.sender] += balance - preBalance;//@audit \n\n if (mintAmount > 0) {\n _mintPeUSD(msg.sender, msg.sender, mintAmount, getAssetPrice());\n }\n\n emit DepositEther(msg.sender, address(collateralAsset), msg.value,balance - preBalance, block.timestamp);\n}\n```\n\n## The function does not exist in the WBETH interface\nThe LybraWBETHVault contract comment wrote that the WBETH address is 0xae78736Cd615f374D3085123A210448E74Fc6393 , but in the https://etherscan.io/address/0xae78736cd615f374d3085123a210448e74fc6393#readContract , the contract does not have the `deposit` and `exchangeRatio` functions written in the interface.\n\n```solidity\ninterface IWBETH {\n function exchangeRatio() external view returns (uint256);\n\n function deposit(address referral) external payable;\n}\n\nco", "vulnerable_code": "function depositEtherToMint(uint256 mintAmount) external payable override {\n require(msg.value >= 1 ether, \"DNL\");\n uint256 preBalance = collateralAsset.balanceOf(address(this));\n rkPool.deposit{value: msg.value}();\n uint256 balance = collateralAsset.balanceOf(address(this));\n depositedAsset[msg.sender] += balance - preBalance;//@audit \n\n if (mintAmount > 0) {\n _mintPeUSD(msg.sender, msg.sender, mintAmount, getAssetPrice());\n }\n\n emit DepositEther(msg.sender, address(collateralAsset), msg.value,balance - preBalance, block.timestamp);\n}", "fixed_code": "## The function does not exist in the WBETH interface\nThe LybraWBETHVault contract comment wrote that the WBETH address is 0xae78736Cd615f374D3085123A210448E74Fc6393 , but in the https://etherscan.io/address/0xae78736cd615f374d3085123a210448e74fc6393#readContract , the contract does not have the `deposit` and `exchangeRatio` functions written in the interface.\n", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/8olidity-Q.md", "collected_at": "2026-01-02T18:22:07.890649+00:00", "source_hash": "5e8458e132b85b2d4c6ed997c38a6a3e7c70b204767dc7a095da094798ba21d8", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 1146, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function depositEtherToMint(uint256 mintAmount) external payable override {\n require(msg.value >= 1 ether, \"DNL\");\n uint256 preBalance = collateralAsset.balanceOf(address(this));\n rkPool.deposit{value: msg.value}();\n uint256 balance = collateralAsset.balanceOf(address(this));\n depositedAsset[msg.sender] += balance - preBalance;//@audit \n\n if (mintAmount > 0) {\n _mintPeUSD(msg.sender, msg.sender, mintAmount, getAssetPrice());\n }\n\n emit DepositEther(msg.sender, address(collateralAsset), msg.value,balance - preBalance, block.timestamp);\n}", "primary_code_language": "solidity", "primary_code_char_count": 572, "all_code_blocks": "// Code block 1 (solidity):\nfunction depositEtherToMint(uint256 mintAmount) external payable override {\n require(msg.value >= 1 ether, \"DNL\");\n uint256 preBalance = collateralAsset.balanceOf(address(this));\n rkPool.deposit{value: msg.value}();\n uint256 balance = collateralAsset.balanceOf(address(this));\n depositedAsset[msg.sender] += balance - preBalance;//@audit \n\n if (mintAmount > 0) {\n _mintPeUSD(msg.sender, msg.sender, mintAmount, getAssetPrice());\n }\n\n emit DepositEther(msg.sender, address(collateralAsset), msg.value,balance - preBalance, block.timestamp);\n}\n\n// Code block 2 (diff):\nfunction depositEtherToMint(uint256 mintAmount) external payable override {\n require(msg.value >= 1 ether, \"DNL\");\n- uint256 preBalance = collateralAsset.balanceOf(address(this));\n rkPool.deposit{value: msg.value}();\n- uint256 balance = collateralAsset.balanceOf(address(this));\n- depositedAsset[msg.sender] += balance - preBalance;//@audit \n\n if (mintAmount > 0) {\n _mintPeUSD(msg.sender, msg.sender, mintAmount, getAssetPrice());\n }\n\n emit DepositEther(msg.sender, address(collateralAsset), msg.value,balance - preBalance, block.timestamp);\n}", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "function depositEtherToMint(uint256 mintAmount) external payable override {\n require(msg.value >= 1 ether, \"DNL\");\n- uint256 preBalance = collateralAsset.balanceOf(address(this));\n rkPool.deposit{value: msg.value}();\n- uint256 balance = collateralAsset.balanceOf(address(this));\n- depositedAsset[msg.sender] += balance - preBalance;//@audit \n\n if (mintAmount > 0) {\n _mintPeUSD(msg.sender, msg.sender, mintAmount, getAssetPrice());\n }\n\n emit DepositEther(msg.sender, address(collateralAsset), msg.value,balance - preBalance, block.timestamp);\n}", "solidity_code": "function depositEtherToMint(uint256 mintAmount) external payable override {\n require(msg.value >= 1 ether, \"DNL\");\n uint256 preBalance = collateralAsset.balanceOf(address(this));\n rkPool.deposit{value: msg.value}();\n uint256 balance = collateralAsset.balanceOf(address(this));\n depositedAsset[msg.sender] += balance - preBalance;//@audit \n\n if (mintAmount > 0) {\n _mintPeUSD(msg.sender, msg.sender, mintAmount, getAssetPrice());\n }\n\n emit DepositEther(msg.sender, address(collateralAsset), msg.value,balance - preBalance, block.timestamp);\n}", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function depositEtherToMint(uint256 mintAmount) external payable override {\n require(msg.value >= 1 ether, \"DNL\");\n uint256 preBalance = collateralAsset.balanceOf(address(this));\n rkPool.deposit{value: msg.value}();\n uint256 balance = collateralAsset.balanceOf(address(this));\n depositedAsset[msg.sender] += balance - preBalance;//@audit \n\n if (mintAmount > 0) {\n _mintPeUSD(msg.sender, msg.sender, mintAmount, getAssetPrice());\n }\n\n emit DepositEther(msg.sender, address(collateralAsset), msg.value,balance - preBalance, block.timestamp);\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## The function does not exist in the WBETH interface\nThe LybraWBETHVault contract comment wrote that the WBETH address is 0xae78736Cd615f374D3085123A210448E74Fc6393 , but in the https://etherscan.io/address/0xae78736cd615f374d3085123a210448e74fc6393#readContract , the contract does not have the `deposit` and `exchangeRatio` functions written in the interface.\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "01-salty", "title": "Beepidibop G", "severity_raw": "High", "severity": "high", "description": "# Gas Findings\n\n## [GAS-1] `Airdrop`: Use Merkle Roots for Airdrops Instead of Adding Addresses One-by-one\n\nYou can save gas for the deployer by using a Merkle Root to determine eligibility for airdrops. The current way of adding `_authorizedUsers` one by one with `authorizeWallet(address)` is gas extensive. Or at least include a batched version of `authorizeWallet(address[])`.\n\n### Link To Affected Code\n\nhttps://github.com/code-423n4/2024-01-salty/blob/f742b554e18ae1a07cb8d4617ec8aa50db037c1c/src/launch/Airdrop.sol#L46-L52\n\n## [GAS-2] `ManagedWallet`: Do not Burn 0.05ETH Just to Confirm a Change in Ownership\n\nThe ETH sent to `ManagedWallet` is effectively lost since there's no functions implemented to retrieve it. This basically makes the gas cost of changing ownership 0.05ETH more than it's needed.\n\nInstead, you can just send the ETH back to the confirmation wallet, even if the `confirmationWallet` is \"custodial\". However, it is highly advised the team to not ever use a wallet that cannot submit calls as a `confirmationWallet` for anything. If this limitation is relaxed it's best to redo the implementation so no ETH needs to be sent at all.\n\n### Improved Function:\n\n```\n\u00a0 \u00a0 // The confirmation wallet confirms or rejects wallet proposals by sending a specific amount of ETH to this contract\n\n\u00a0 \u00a0 receive() external payable\n\n\u00a0 \u00a0 \u00a0 \u00a0 {\n\n\u00a0 \u00a0 \u00a0 \u00a0 require( msg.sender == confirmationWallet, \"Invalid sender\" );\n\n \n\n\u00a0 \u00a0 \u00a0 \u00a0 // Confirm if .05 or more ether is sent and otherwise reject.\n\n\u00a0 \u00a0 \u00a0 \u00a0 // Done this way in case custodial wallets are used as the confirmationWallet - which sometimes won't allow for smart contract calls.\n\n\u00a0 \u00a0 \u00a0 \u00a0 if ( msg.value >= .05 ether )\n\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 activeTimelock = block.timestamp + TIMELOCK_DURATION; // establish the timelock\n\n\u00a0 \u00a0 \u00a0 \u00a0 else\n\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 activeTimelock = type(uint256).max; // effectively never\n\n \n\n\u00a0 \u00a0 \u00a0 \u00a0 payable(msg.sender).transfer(msg.value);\n\n\u00a0 \u00a0 \u00a0 \u00a0 }\n```\n\n### Link To Affected Code\n\nhttps://github.com/code-423n4/2024-01-salty", "vulnerable_code": "\u00a0 \u00a0 // The confirmation wallet confirms or rejects wallet proposals by sending a specific amount of ETH to this contract\n\n\u00a0 \u00a0 receive() external payable\n\n\u00a0 \u00a0 \u00a0 \u00a0 {\n\n\u00a0 \u00a0 \u00a0 \u00a0 require( msg.sender == confirmationWallet, \"Invalid sender\" );\n\n \n\n\u00a0 \u00a0 \u00a0 \u00a0 // Confirm if .05 or more ether is sent and otherwise reject.\n\n\u00a0 \u00a0 \u00a0 \u00a0 // Done this way in case custodial wallets are used as the confirmationWallet - which sometimes won't allow for smart contract calls.\n\n\u00a0 \u00a0 \u00a0 \u00a0 if ( msg.value >= .05 ether )\n\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 activeTimelock = block.timestamp + TIMELOCK_DURATION; // establish the timelock\n\n\u00a0 \u00a0 \u00a0 \u00a0 else\n\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 activeTimelock = type(uint256).max; // effectively never\n\n \n\n\u00a0 \u00a0 \u00a0 \u00a0 payable(msg.sender).transfer(msg.value);\n\n\u00a0 \u00a0 \u00a0 \u00a0 }", "fixed_code": "\u00a0 \u00a0 // The confirmation wallet confirms or rejects wallet proposals by sending a specific amount of ETH to this contract\n\n\u00a0 \u00a0 receive() external payable\n\n\u00a0 \u00a0 \u00a0 \u00a0 {\n\n\u00a0 \u00a0 \u00a0 \u00a0 require( msg.sender == confirmationWallet, \"Invalid sender\" );\n\n \n\n\u00a0 \u00a0 \u00a0 \u00a0 // Confirm if .05 or more ether is sent and otherwise reject.\n\n\u00a0 \u00a0 \u00a0 \u00a0 // Done this way in case custodial wallets are used as the confirmationWallet - which sometimes won't allow for smart contract calls.\n\n\u00a0 \u00a0 \u00a0 \u00a0 if ( msg.value >= .05 ether )\n\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 activeTimelock = block.timestamp + TIMELOCK_DURATION; // establish the timelock\n\n\u00a0 \u00a0 \u00a0 \u00a0 else\n\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 activeTimelock = type(uint256).max; // effectively never\n\n \n\n\u00a0 \u00a0 \u00a0 \u00a0 payable(msg.sender).transfer(msg.value);\n\n\u00a0 \u00a0 \u00a0 \u00a0 }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/Beepidibop-G.md", "collected_at": "2026-01-02T19:01:13.646685+00:00", "source_hash": "5ea93cf06df49a3e8a811f3abf2fac2a8b6e3fa62fdea1d0c70ffb3ae12a7a4f", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 730, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "// The confirmation wallet confirms or rejects wallet proposals by sending a specific amount of ETH to this contract\n\n\u00a0 \u00a0 receive() external payable\n\n\u00a0 \u00a0 \u00a0 \u00a0 {\n\n\u00a0 \u00a0 \u00a0 \u00a0 require( msg.sender == confirmationWallet, \"Invalid sender\" );\n\n \n\n\u00a0 \u00a0 \u00a0 \u00a0 // Confirm if .05 or more ether is sent and otherwise reject.\n\n\u00a0 \u00a0 \u00a0 \u00a0 // Done this way in case custodial wallets are used as the confirmationWallet - which sometimes won't allow for smart contract calls.\n\n\u00a0 \u00a0 \u00a0 \u00a0 if ( msg.value >= .05 ether )\n\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 activeTimelock = block.timestamp + TIMELOCK_DURATION; // establish the timelock\n\n\u00a0 \u00a0 \u00a0 \u00a0 else\n\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 activeTimelock = type(uint256).max; // effectively never\n\n \n\n\u00a0 \u00a0 \u00a0 \u00a0 payable(msg.sender).transfer(msg.value);\n\n\u00a0 \u00a0 \u00a0 \u00a0 }", "primary_code_language": "unknown", "primary_code_char_count": 730, "all_code_blocks": "// Code block 1 (unknown):\n// The confirmation wallet confirms or rejects wallet proposals by sending a specific amount of ETH to this contract\n\n\u00a0 \u00a0 receive() external payable\n\n\u00a0 \u00a0 \u00a0 \u00a0 {\n\n\u00a0 \u00a0 \u00a0 \u00a0 require( msg.sender == confirmationWallet, \"Invalid sender\" );\n\n \n\n\u00a0 \u00a0 \u00a0 \u00a0 // Confirm if .05 or more ether is sent and otherwise reject.\n\n\u00a0 \u00a0 \u00a0 \u00a0 // Done this way in case custodial wallets are used as the confirmationWallet - which sometimes won't allow for smart contract calls.\n\n\u00a0 \u00a0 \u00a0 \u00a0 if ( msg.value >= .05 ether )\n\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 activeTimelock = block.timestamp + TIMELOCK_DURATION; // establish the timelock\n\n\u00a0 \u00a0 \u00a0 \u00a0 else\n\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 activeTimelock = type(uint256).max; // effectively never\n\n \n\n\u00a0 \u00a0 \u00a0 \u00a0 payable(msg.sender).transfer(msg.value);\n\n\u00a0 \u00a0 \u00a0 \u00a0 }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Airdrop.sol#L46-L52", "github_files_list": "Airdrop.sol", "github_refs_count": 1, "vulnerable_code_actual": "\u00a0 \u00a0 // The confirmation wallet confirms or rejects wallet proposals by sending a specific amount of ETH to this contract\n\n\u00a0 \u00a0 receive() external payable\n\n\u00a0 \u00a0 \u00a0 \u00a0 {\n\n\u00a0 \u00a0 \u00a0 \u00a0 require( msg.sender == confirmationWallet, \"Invalid sender\" );\n\n \n\n\u00a0 \u00a0 \u00a0 \u00a0 // Confirm if .05 or more ether is sent and otherwise reject.\n\n\u00a0 \u00a0 \u00a0 \u00a0 // Done this way in case custodial wallets are used as the confirmationWallet - which sometimes won't allow for smart contract calls.\n\n\u00a0 \u00a0 \u00a0 \u00a0 if ( msg.value >= .05 ether )\n\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 activeTimelock = block.timestamp + TIMELOCK_DURATION; // establish the timelock\n\n\u00a0 \u00a0 \u00a0 \u00a0 else\n\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 activeTimelock = type(uint256).max; // effectively never\n\n \n\n\u00a0 \u00a0 \u00a0 \u00a0 payable(msg.sender).transfer(msg.value);\n\n\u00a0 \u00a0 \u00a0 \u00a0 }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "\u00a0 \u00a0 // The confirmation wallet confirms or rejects wallet proposals by sending a specific amount of ETH to this contract\n\n\u00a0 \u00a0 receive() external payable\n\n\u00a0 \u00a0 \u00a0 \u00a0 {\n\n\u00a0 \u00a0 \u00a0 \u00a0 require( msg.sender == confirmationWallet, \"Invalid sender\" );\n\n \n\n\u00a0 \u00a0 \u00a0 \u00a0 // Confirm if .05 or more ether is sent and otherwise reject.\n\n\u00a0 \u00a0 \u00a0 \u00a0 // Done this way in case custodial wallets are used as the confirmationWallet - which sometimes won't allow for smart contract calls.\n\n\u00a0 \u00a0 \u00a0 \u00a0 if ( msg.value >= .05 ether )\n\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 activeTimelock = block.timestamp + TIMELOCK_DURATION; // establish the timelock\n\n\u00a0 \u00a0 \u00a0 \u00a0 else\n\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 activeTimelock = type(uint256).max; // effectively never\n\n \n\n\u00a0 \u00a0 \u00a0 \u00a0 payable(msg.sender).transfer(msg.value);\n\n\u00a0 \u00a0 \u00a0 \u00a0 }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-asymmetry", "title": "UdarTeam Q", "severity_raw": "Critical", "severity": "critical", "description": "### Issues Template\n| Letter | Name | Description |\n|:--:|:-------:|:-------:|\n| L | Low risk | Potential risk |\n| NC | Non-critical | Non risky findings |\n| R | Refactor | Changing the code |\n| O | Ordinary | Often found issues |\n\n| Total Found Issues | 16 |\n|:--:|:--:|\n\n### Low Risk Issues Template\n| Count | Explanation | Instances |\n|:--:|:-------|:--:|\n| [L-01] | Owner can renounce ownership | 4 |\n| [L-02] | Use two-step ownership trasnfer | 4 |\n| [L-03] | Validate weight parameter | 2 |\n\n\n| Total Low Risk Issues | 3 |\n|:--:|:--:|\n\n### Non-Critical Issues Template\n| Count | Explanation | Instances |\n|:--:|:-------|:--:|\n| [N-01] | Create your own import names instead of using the regular ones | 31 |\n| [N-02] | Remove unused imports | 5 |\n| [N-03] | Use latest OpenZeppelin libraries | 2 |\n| [N-04] | Explicitly mark uint type size | 21 |\n| [N-05] | Insufficient code coverage | - |\n\n\n| Total Non-Critical Issues | 5 |\n|:--:|:--:|\n\n### Refactor Issues Template\n| Count | Explanation | Instances |\n|:--:|:-------|:--:|\n| [R-01] | Fix wrong NatSpec comment | 1 |\n| [R-02] | Always include curly brackets | 7 |\n| [R-03] | Follow Solidity style guide order of functions | 4 |\n| [R-04] | Non-external functions should have underscore prefix | 4 |\n| [R-05] | Remove unnecessary round brackets | 2 |\n\n\n| Total Refactor Issues | 5 |\n|:--:|:--:|\n\n### Ordinary Issues Template\n| Count | Explanation | Instances |\n|:--:|:-------|:--:|\n| [O-01] | Use a more recent pragma version | 4 |\n| [O-02] | Locking pragma | 4 |\n| [O-03] | Increase NatSpec comments | 19 |\n\n\n| Total Ordinary Issues | 3 |\n|:--:|:--:|\n\n### [L-01] Owner can renounce ownership\n\nAll contracts inherits ```OwnableUpgradeable``` which has a public onlyOwner ```renounceOwnership``` function.\n\n```solidity\ncontracts/SafEth/SafEth.sol\n\n15: contract SafEth is\n16: Initializable,\n17: ERC20Upgradeable,\n18: OwnableUpgradeable,\n19: SafEthStorage\n20: {\n```\n\n```solidity\ncontracts/SafEth/derivatives/Ret", "vulnerable_code": "contracts/SafEth/SafEth.sol\n\n15: contract SafEth is\n16: Initializable,\n17: ERC20Upgradeable,\n18: OwnableUpgradeable,\n19: SafEthStorage\n20: {", "fixed_code": "contracts/SafEth/derivatives/Reth.sol\n\n19: contract Reth is IDerivative, Initializable, OwnableUpgradeable {", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/UdarTeam-Q.md", "collected_at": "2026-01-02T18:18:37.385246+00:00", "source_hash": "5f1497055a62d5744cd654e0a8c81bcff70ee62ea6c909aba93677edc461b645", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 174, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "contracts/SafEth/SafEth.sol\n\n15: contract SafEth is\n16: Initializable,\n17: ERC20Upgradeable,\n18: OwnableUpgradeable,\n19: SafEthStorage\n20: {", "primary_code_language": "solidity", "primary_code_char_count": 174, "all_code_blocks": "// Code block 1 (solidity):\ncontracts/SafEth/SafEth.sol\n\n15: contract SafEth is\n16: Initializable,\n17: ERC20Upgradeable,\n18: OwnableUpgradeable,\n19: SafEthStorage\n20: {", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "contracts/SafEth/SafEth.sol\n\n15: contract SafEth is\n16: Initializable,\n17: ERC20Upgradeable,\n18: OwnableUpgradeable,\n19: SafEthStorage\n20: {", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "contracts/SafEth/SafEth.sol\n\n15: contract SafEth is\n16: Initializable,\n17: ERC20Upgradeable,\n18: OwnableUpgradeable,\n19: SafEthStorage\n20: {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "contracts/SafEth/derivatives/Reth.sol\n\n19: contract Reth is IDerivative, Initializable, OwnableUpgradeable {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "09-ondo", "title": "AISec Q", "severity_raw": "Low", "severity": "low", "description": "## Impact\nMissing constructor sanity checks\n\nThe implementation of constructor() functions are missing some sanity checks.\n\n\n## Proof of Concept\n\nMissing sanity check for != address(0)\n\nThere're no sanity checks for the constructor argument _guardian.\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDYFactory.sol?plain=1#L51-L53\n```\n constructor(address _guardian) {\n guardian = _guardian;\n }\n```\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/rwaOracles/RWADynamicOracle.sol?plain=1#L30-L46\n```\n constructor(\n address admin,\n address setter,\n address pauser,\n uint256 firstRangeStart,\n uint256 firstRangeEnd,\n uint256 dailyIR,\n uint256 startPrice\n ) {\n _grantRole(DEFAULT_ADMIN_ROLE, admin);\n _grantRole(PAUSER_ROLE, pauser);\n _grantRole(SETTER_ROLE, setter);\n\n if (firstRangeStart >= firstRangeEnd) revert InvalidRange();\n uint256 trueStart = (startPrice * ONE) / dailyIR;\n ranges.push(Range(firstRangeStart, firstRangeEnd, dailyIR, trueStart));\n }\n```\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/SourceBridge.sol?plain=1#L40-L50\n```\n constructor(\n address _token,\n address _axelarGateway,\n address _gasService,\n address owner\n ) {\n TOKEN = IRWALike(_token);\n AXELAR_GATEWAY = IAxelarGateway(_axelarGateway);\n GAS_RECEIVER = IAxelarGasService(_gasService);\n _transferOwnership(owner);\n }\n```\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/DestinationBridge.sol?plain=1#L55-L72\n```\n constructor(\n address _token,\n address _axelarGateway,\n address _allowlist,\n address _ondoApprover,\n address _owner,\n uint256 _mintLimit,\n uint256 _mintDuration\n )\n AxelarExecutable(_axelarGateway)\n MintTimeBasedRateLimiter(_mintDuration, _mintLimit)\n {\n TOKEN = IRWALike(_token);\n AXELAR_GATEWAY = IAxelarGateway(_axelarGateway);\n ALLOWLIST = IAllowlist(_allowlist);\n approvers[_ondoApprover] = true;\n _", "vulnerable_code": " constructor(address _guardian) {\n guardian = _guardian;\n }", "fixed_code": " constructor(\n address admin,\n address setter,\n address pauser,\n uint256 firstRangeStart,\n uint256 firstRangeEnd,\n uint256 dailyIR,\n uint256 startPrice\n ) {\n _grantRole(DEFAULT_ADMIN_ROLE, admin);\n _grantRole(PAUSER_ROLE, pauser);\n _grantRole(SETTER_ROLE, setter);\n\n if (firstRangeStart >= firstRangeEnd) revert InvalidRange();\n uint256 trueStart = (startPrice * ONE) / dailyIR;\n ranges.push(Range(firstRangeStart, firstRangeEnd, dailyIR, trueStart));\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/AISec-Q.md", "collected_at": "2026-01-02T18:25:22.370903+00:00", "source_hash": "5f1d7af86bf35d931ef1812e885cd78ee2eb64ee4bd837965690edff0562f813", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 834, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "constructor(address _guardian) {\n guardian = _guardian;\n }", "primary_code_language": "unknown", "primary_code_char_count": 62, "all_code_blocks": "// Code block 1 (unknown):\nconstructor(address _guardian) {\n guardian = _guardian;\n }\n\n// Code block 2 (unknown):\nconstructor(\n address admin,\n address setter,\n address pauser,\n uint256 firstRangeStart,\n uint256 firstRangeEnd,\n uint256 dailyIR,\n uint256 startPrice\n ) {\n _grantRole(DEFAULT_ADMIN_ROLE, admin);\n _grantRole(PAUSER_ROLE, pauser);\n _grantRole(SETTER_ROLE, setter);\n\n if (firstRangeStart >= firstRangeEnd) revert InvalidRange();\n uint256 trueStart = (startPrice * ONE) / dailyIR;\n ranges.push(Range(firstRangeStart, firstRangeEnd, dailyIR, trueStart));\n }\n\n// Code block 3 (unknown):\nconstructor(\n address _token,\n address _axelarGateway,\n address _gasService,\n address owner\n ) {\n TOKEN = IRWALike(_token);\n AXELAR_GATEWAY = IAxelarGateway(_axelarGateway);\n GAS_RECEIVER = IAxelarGasService(_gasService);\n _transferOwnership(owner);\n }", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "rUSDYFactory.sol, RWADynamicOracle.sol, SourceBridge.sol, DestinationBridge.sol", "github_files_list": "DestinationBridge.sol, rUSDYFactory.sol, RWADynamicOracle.sol, SourceBridge.sol", "github_refs_count": 4, "vulnerable_code_actual": " constructor(address _guardian) {\n guardian = _guardian;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " constructor(\n address admin,\n address setter,\n address pauser,\n uint256 firstRangeStart,\n uint256 firstRangeEnd,\n uint256 dailyIR,\n uint256 startPrice\n ) {\n _grantRole(DEFAULT_ADMIN_ROLE, admin);\n _grantRole(PAUSER_ROLE, pauser);\n _grantRole(SETTER_ROLE, setter);\n\n if (firstRangeStart >= firstRangeEnd) revert InvalidRange();\n uint256 trueStart = (startPrice * ONE) / dailyIR;\n ranges.push(Range(firstRangeStart, firstRangeEnd, dailyIR, trueStart));\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "01-ondo", "title": "Mukund G", "severity_raw": "High", "severity": "high", "description": "| Index | Issue |\n|-------|------------------------------------------------------------------------------------------|\n| 1 | USE UNCHECK BLOCK FOR OPERATION THAT CAN NOT OVERFLOW/UNDERFLOW |\n| 2 | Using calldata instead of memory for read-only arguments in external functions saves gas |\n| 3 | Functions guaranteed to revert when called by normal users can be marked payable |\n| 4 | Usage of uints/ints smaller than 32 bytes (256 bits) incurs overhead |\n| 5 | Use functions instead of modifiers |\n| 6 | splitting && statement in require function and writing them separately saves gas |\n\n## 1.USE UNCHECK BLOCK FOR OPERATION THAT CAN NOT OVERFLOW/UNDERFLOW\nFor example use uncheck block for i++ in for loop because it won't overflow/underflow\n```solidity\nfor (uint256 i = 0; i < length; i++) {\n```\n[KYCRegistry.sol#L163](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistry.sol#L163)\n[KYCRegistry.sol#L180](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistry.sol#L180)\n\n## 2.Using calldata instead of memory for read-only arguments in external functions saves gas\n```solidity\nfunction multiexcall(\n ExCallData[] calldata exCallData\n )\n external\n payable\n override\n nonReentrant\n onlyRole(MANAGER_ADMIN)\n whenPaused\n returns (bytes[] memory results)\n```\nWhen a function with a memory array is called externally, the abi.decode() step has to use a for-loop to copy each index of the calldata to the memory index. Each iteration of this for-loop costs at least 60 gas (i.e. 60 * .length). Using calldata directly, obliviates the need for such a loop in the contract code and runtime execution. Note that even if an interface defines a function as having memory arguments, it's still ", "vulnerable_code": "for (uint256 i = 0; i < length; i++) {", "fixed_code": "function multiexcall(\n ExCallData[] calldata exCallData\n )\n external\n payable\n override\n nonReentrant\n onlyRole(MANAGER_ADMIN)\n whenPaused\n returns (bytes[] memory results)", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/Mukund-G.md", "collected_at": "2026-01-02T18:14:41.331283+00:00", "source_hash": "5f43d4b538861589e9a37e51648512f234cc7ad3e445e4e6ea654959a2e93876", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 235, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "for (uint256 i = 0; i < length; i++) {", "primary_code_language": "solidity", "primary_code_char_count": 38, "all_code_blocks": "// Code block 1 (solidity):\nfor (uint256 i = 0; i < length; i++) {\n\n// Code block 2 (solidity):\nfunction multiexcall(\n ExCallData[] calldata exCallData\n )\n external\n payable\n override\n nonReentrant\n onlyRole(MANAGER_ADMIN)\n whenPaused\n returns (bytes[] memory results)", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "for (uint256 i = 0; i < length; i++) {\n\nfunction multiexcall(\n ExCallData[] calldata exCallData\n )\n external\n payable\n override\n nonReentrant\n onlyRole(MANAGER_ADMIN)\n whenPaused\n returns (bytes[] memory results)", "github_refs_formatted": "KYCRegistry.sol#L163, KYCRegistry.sol#L180", "github_files_list": "KYCRegistry.sol", "github_refs_count": 2, "vulnerable_code_actual": "for (uint256 i = 0; i < length; i++) {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function multiexcall(\n ExCallData[] calldata exCallData\n )\n external\n payable\n override\n nonReentrant\n onlyRole(MANAGER_ADMIN)\n whenPaused\n returns (bytes[] memory results)", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-biconomy", "title": "horsefacts Q", "severity_raw": "Critical", "severity": "critical", "description": "## Low\n\n### `SmartAccount`: Initialize implementation contract\n\n`SmartAccount` has an unprotected intializer that can be called by anyone to claim ownership of the contract.\n\n```solidity\n // init\n // Initialize / Setup\n // Used to setup\n // i. owner ii. entry point address iii. handler\n function init(address _owner, address _entryPointAddress, address _handler) public override initializer {\n require(owner == address(0), \"Already initialized\");\n require(address(_entryPoint) == address(0), \"Already initialized\");\n require(_owner != address(0),\"Invalid owner\");\n require(_entryPointAddress != address(0), \"Invalid Entrypoint\");\n require(_handler != address(0), \"Invalid Entrypoint\");\n owner = _owner;\n _entryPoint = IEntryPoint(payable(_entryPointAddress));\n if (_handler != address(0)) internalSetFallbackHandler(_handler);\n setupModules(address(0), bytes(\"\"));\n }\n```\n\nSince clones are deployed and initialized atomically through `SmartAccountFactory`, this is not an issue, but it's important to initialize the implementation contract itself. If the implementation is left unitialized, anyone can claim ownership and [destroy the contract](https://blog.openzeppelin.com/parity-wallet-hack-reloaded/), destroying any deployed smart accounts.\n\nOne simple way to prevent intialization of an implementation using OpenZeppelin `Initializable` is to call `_disableInitializers()` in the constructor:\n\n```solidity\nconstructor() {\n _disableInitializers();\n}\n```\n\nAlternatively, initialize the implementation contract yourself as part of deployment. Ideally, do so atomically in a single transaction using a multicall or deployer contract. (Otherwise, there's still a risk that the initialization transaction could be frontrun). Note that the current Hardhat [deployment scripts](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/scripts/wallet-factory.deploy.t", "vulnerable_code": " // init\n // Initialize / Setup\n // Used to setup\n // i. owner ii. entry point address iii. handler\n function init(address _owner, address _entryPointAddress, address _handler) public override initializer {\n require(owner == address(0), \"Already initialized\");\n require(address(_entryPoint) == address(0), \"Already initialized\");\n require(_owner != address(0),\"Invalid owner\");\n require(_entryPointAddress != address(0), \"Invalid Entrypoint\");\n require(_handler != address(0), \"Invalid Entrypoint\");\n owner = _owner;\n _entryPoint = IEntryPoint(payable(_entryPointAddress));\n if (_handler != address(0)) internalSetFallbackHandler(_handler);\n setupModules(address(0), bytes(\"\"));\n }", "fixed_code": "constructor() {\n _disableInitializers();\n}", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/horsefacts-Q.md", "collected_at": "2026-01-02T18:13:49.969480+00:00", "source_hash": "5f878d0385fc498adcb8d217ba6cafded0d6a9d5166155b87666df824cc2f328", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 804, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "// init\n // Initialize / Setup\n // Used to setup\n // i. owner ii. entry point address iii. handler\n function init(address _owner, address _entryPointAddress, address _handler) public override initializer {\n require(owner == address(0), \"Already initialized\");\n require(address(_entryPoint) == address(0), \"Already initialized\");\n require(_owner != address(0),\"Invalid owner\");\n require(_entryPointAddress != address(0), \"Invalid Entrypoint\");\n require(_handler != address(0), \"Invalid Entrypoint\");\n owner = _owner;\n _entryPoint = IEntryPoint(payable(_entryPointAddress));\n if (_handler != address(0)) internalSetFallbackHandler(_handler);\n setupModules(address(0), bytes(\"\"));\n }", "primary_code_language": "solidity", "primary_code_char_count": 759, "all_code_blocks": "// Code block 1 (solidity):\n// init\n // Initialize / Setup\n // Used to setup\n // i. owner ii. entry point address iii. handler\n function init(address _owner, address _entryPointAddress, address _handler) public override initializer {\n require(owner == address(0), \"Already initialized\");\n require(address(_entryPoint) == address(0), \"Already initialized\");\n require(_owner != address(0),\"Invalid owner\");\n require(_entryPointAddress != address(0), \"Invalid Entrypoint\");\n require(_handler != address(0), \"Invalid Entrypoint\");\n owner = _owner;\n _entryPoint = IEntryPoint(payable(_entryPointAddress));\n if (_handler != address(0)) internalSetFallbackHandler(_handler);\n setupModules(address(0), bytes(\"\"));\n }\n\n// Code block 2 (solidity):\nconstructor() {\n _disableInitializers();\n}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "// init\n // Initialize / Setup\n // Used to setup\n // i. owner ii. entry point address iii. handler\n function init(address _owner, address _entryPointAddress, address _handler) public override initializer {\n require(owner == address(0), \"Already initialized\");\n require(address(_entryPoint) == address(0), \"Already initialized\");\n require(_owner != address(0),\"Invalid owner\");\n require(_entryPointAddress != address(0), \"Invalid Entrypoint\");\n require(_handler != address(0), \"Invalid Entrypoint\");\n owner = _owner;\n _entryPoint = IEntryPoint(payable(_entryPointAddress));\n if (_handler != address(0)) internalSetFallbackHandler(_handler);\n setupModules(address(0), bytes(\"\"));\n }\n\nconstructor() {\n _disableInitializers();\n}", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " // init\n // Initialize / Setup\n // Used to setup\n // i. owner ii. entry point address iii. handler\n function init(address _owner, address _entryPointAddress, address _handler) public override initializer {\n require(owner == address(0), \"Already initialized\");\n require(address(_entryPoint) == address(0), \"Already initialized\");\n require(_owner != address(0),\"Invalid owner\");\n require(_entryPointAddress != address(0), \"Invalid Entrypoint\");\n require(_handler != address(0), \"Invalid Entrypoint\");\n owner = _owner;\n _entryPoint = IEntryPoint(payable(_entryPointAddress));\n if (_handler != address(0)) internalSetFallbackHandler(_handler);\n setupModules(address(0), bytes(\"\"));\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "constructor() {\n _disableInitializers();\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-biconomy", "title": "2997ms Q", "severity_raw": "Critical", "severity": "critical", "description": "## Summary\n\n### Low Risk Issues\n\n| | Issue | Contexts |\n| ----- | :----------------------- | :------: |\n| LOW-1 | Change the order of emit | 1 |\n| LOW-2 | Avoid to create a sender with address 0 | 1 |\n| LOW-3 | Initilize() function can be called by anybody | 1 | \n| LOW-4 |Lack the validation that the divisor should not be 0.| 1 |\n\n### Non-critical Issues\n\n| | Issue | Contexts |\n| ---- | :------------------------------------- | :------: |\n| NC-1 | Solidity versions should be consistent | 1 |\n| NC-2 | Change some functions into modifiers | 4 |\n| NC-3 | Some enum values are never used | 1 |\n| NC-4 | Open TODOs | 2 |\n| NC-5 | Add the validation of start address | 1 |\n| NC-6 | Rename the function of getDeposit | 1 |\n\n\n\n### [LOW-01]Change the order of emit\n\nIt should be build the IEntryPoint first, then emit the event. This is to prevent from issues when building IEntryPoint failed.\n\n**Proof Of Concept**\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L129-L130\n\n**Recommended Mitigation Steps**\n\nChange it to:\n\n```\nentryPoint = IEntryPoint(payable(_newEntryPoint));\nemit EntryPointChanged(address(_entryPoint), _newEntryPoint);\n```\n\n\n### [LOW-02]Avoid to create a sender with address 0 \nIn createSender function, if we finally failed to create a sender, we return an address 0. And we validate outside when invoking this function, this behaviour is very dangerous and doesn't follow \"minimum exposure\" principle. We'd better to handle this situation inside the function itself.\n\n\n**Proof Of Concept**\nhttps://github.com/code-423n4/2023-01-biconomy/blob/5df2e8f8c0fd3393b9ecdad9ef356955f07fbbdd/scw-contracts/contracts/smart-contract-wallet/aa-4337", "vulnerable_code": "entryPoint = IEntryPoint(payable(_newEntryPoint));\nemit EntryPointChanged(address(_entryPoint), _newEntryPoint);", "fixed_code": "### [LOW-04] Lack the validation that the divisor should not be 0.\n\nIf b is 0, the transaction will be reverted because there is no validation that b != 0.\n\nAs it is a very basic function in math.sol, so we need to add a message to tell the customers why the transaction being reverted. \n**Proof Of Concept**\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/libs/Math.sol#L45-L47\n\n**Recommended Mitigation Steps**\nAdd ```require(b!=0, \"divisor should not be 0\");```\n\n### [NC-01]Solidity versions should be consistent\n\nMost of solidity versions in the files are ```pragma solidity ^0.8.12;```Other files are ```pragma solidity 0.8.12```, it's better to make them consisten.\n\n**Proof Of Concept**\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/2997ms-Q.md", "collected_at": "2026-01-02T18:12:52.656625+00:00", "source_hash": "5f8a66b7c96e362c8d8289fb3f095929dbb9c7123fa53a61d74688953a408633", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 112, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "entryPoint = IEntryPoint(payable(_newEntryPoint));\nemit EntryPointChanged(address(_entryPoint), _newEntryPoint);", "primary_code_language": "unknown", "primary_code_char_count": 112, "all_code_blocks": "// Code block 1 (unknown):\nentryPoint = IEntryPoint(payable(_newEntryPoint));\nemit EntryPointChanged(address(_entryPoint), _newEntryPoint);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SmartAccount.sol#L129-L130, Math.sol#L45-L47", "github_files_list": "Math.sol, SmartAccount.sol", "github_refs_count": 2, "vulnerable_code_actual": "entryPoint = IEntryPoint(payable(_newEntryPoint));\nemit EntryPointChanged(address(_entryPoint), _newEntryPoint);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "### [LOW-04] Lack the validation that the divisor should not be 0.\n\nIf b is 0, the transaction will be reverted because there is no validation that b != 0.\n\nAs it is a very basic function in math.sol, so we need to add a message to tell the customers why the transaction being reverted. \n**Proof Of Concept**\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/libs/Math.sol#L45-L47\n\n**Recommended Mitigation Steps**\nAdd ```require(b!=0, \"divisor should not be 0\");```\n\n### [NC-01]Solidity versions should be consistent\n\nMost of solidity versions in the files are ```pragma solidity ^0.8.12;```Other files are ```pragma solidity 0.8.12```, it's better to make them consisten.\n\n**Proof Of Concept**\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-biconomy", "title": "ro G", "severity_raw": "Low", "severity": "low", "description": "1. The initializer modifier in the init function is not needed: \n```solidity\nfunction init(\n address _owner,\n address _entryPointAddress,\n address _handler\n ) public override initializer \n```\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L166\n\nThe following check is more than enough to prevent the \"init\" function from being called after initialization: \n```solidity\nrequire(owner == address(0), \"Already initialized\");\n```\nRecommendation: Remove the initializer modifier. \n\n2. The following check is not needed: \n```solidity\nrequire(address(_entryPoint) == address(0), \"Already initialized\");\n``` \nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L168\nThe following check does already the job:\n```solidity\nrequire(owner == address(0), \"Already initialized\");\n```\nRecommendation: Remove this require statement\n\n3. Uncessary use of \"nonReentrant\" \n The transfer function uses the \"nonReentrant\" modifier: \n ```solidity\n function transfer(address payable dest, uint amount) external nonReentrant onlyOwner\n````\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L449\nThis causes an \"sload\" every time the function gets called, and it is not necessary because only the owner is allowed to call this function, therefore a malicious contract cannot re-enter.\n\n4. Uncessary use of \"nonReentrant\" \n The handlePayment function uses the \"nonReentrant\" modifier: \n ```solidity\n function handlePayment(\n uint256 gasUsed,\n uint256 baseGas,\n uint256 gasPrice,\n uint256 tokenGasPriceFactor,\n address gasToken,\n address payable refundReceiver\n ) private nonReentrant\n````\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L247\nThis causes an \"sload\" every t", "vulnerable_code": "function init(\n address _owner,\n address _entryPointAddress,\n address _handler\n ) public override initializer ", "fixed_code": "require(owner == address(0), \"Already initialized\");", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/ro-G.md", "collected_at": "2026-01-02T18:14:05.189173+00:00", "source_hash": "5fa6fd3a3cf4a0ee858a2e5ef50f0fc283324b1279005ea1949bf40de7d03146", "code_block_count": 6, "solidity_block_count": 6, "total_code_chars": 616, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function init(\n address _owner,\n address _entryPointAddress,\n address _handler\n ) public override initializer", "primary_code_language": "solidity", "primary_code_char_count": 133, "all_code_blocks": "// Code block 1 (solidity):\nfunction init(\n address _owner,\n address _entryPointAddress,\n address _handler\n ) public override initializer\n\n// Code block 2 (solidity):\nrequire(owner == address(0), \"Already initialized\");\n\n// Code block 3 (solidity):\nrequire(address(_entryPoint) == address(0), \"Already initialized\");\n\n// Code block 4 (solidity):\nrequire(owner == address(0), \"Already initialized\");\n\n// Code block 5 (solidity):\nfunction transfer(address payable dest, uint amount) external nonReentrant onlyOwner\n\n// Code block 6 (solidity):\nfunction handlePayment(\n uint256 gasUsed,\n uint256 baseGas,\n uint256 gasPrice,\n uint256 tokenGasPriceFactor,\n address gasToken,\n address payable refundReceiver\n ) private nonReentrant", "all_code_blocks_count": 6, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function init(\n address _owner,\n address _entryPointAddress,\n address _handler\n ) public override initializer\n\nrequire(owner == address(0), \"Already initialized\");\n\nrequire(address(_entryPoint) == address(0), \"Already initialized\");\n\nrequire(owner == address(0), \"Already initialized\");\n\nfunction transfer(address payable dest, uint amount) external nonReentrant onlyOwner\n\nfunction handlePayment(\n uint256 gasUsed,\n uint256 baseGas,\n uint256 gasPrice,\n uint256 tokenGasPriceFactor,\n address gasToken,\n address payable refundReceiver\n ) private nonReentrant", "github_refs_formatted": "SmartAccount.sol#L166, SmartAccount.sol#L168, SmartAccount.sol#L449, SmartAccount.sol#L247", "github_files_list": "SmartAccount.sol", "github_refs_count": 4, "vulnerable_code_actual": "function init(\n address _owner,\n address _entryPointAddress,\n address _handler\n ) public override initializer ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "require(owner == address(0), \"Already initialized\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 12} {"source": "c4", "protocol": "01-biconomy", "title": "Aymen0909 G", "severity_raw": "Medium", "severity": "medium", "description": "# Gas Optimizations\n\n## Summary\n\n| | Issue | Instances |\n| :-------------: |:-------------|:-------------:|\n| 1 | Use `unchecked` blocks to save gas | 2 |\n| 2 | Redundant check in `init` function should be removed | 1 |\n| 3 | `x += y/x -= y` costs more gas than `x = x + y/x = x - y` for state variables | 3 |\n| 4 | `require()` strings longer than 32 bytes cost extra gas | 16 |\n| 5 | Splitting `require()` statements that uses && saves gas | 3 |\n| 6 | `public` functions not called by the contract should be declared `external` instead | 17 |\n| 7 | `++i/i++` should be `unchecked{++i}`/`unchecked{i++}` when it is not possible for them to overflow, as in the case when used in for & while loops | 5 |\n\n\n## Findings\n\n### 1- Use `unchecked` blocks to save gas :\n\nSolidity version 0.8+ comes with implicit overflow and underflow checks on unsigned integers. When an overflow or an underflow isn\u2019t possible (as an example, when a comparison is made before the arithmetic operation), some gas can be saved by using an unchecked block.\n\nThere are 2 instances of this issue :\n\nFile: StakeManager.sol [Line 118](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/StakeManager.sol#L118)\n```\ninfo.deposit = uint112(info.deposit - withdrawAmount);\n```\n\nThe above operation cannot underflow due to the check :\n\n[require(withdrawAmount <= info.deposit, \"Withdraw amount too large\");](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/StakeManager.sol#L117) \n\nIt should be marked as `unchecked`. \n\nFile: VerifyingSingletonPaymaster.sol [Line 58](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol#L58)\n```\npaymasterIdBalances[msg.sender] -= amount;\n```\n\nThe above operation cannot underflow due to the check :\n\n[require(a", "vulnerable_code": "info.deposit = uint112(info.deposit - withdrawAmount);", "fixed_code": "paymasterIdBalances[msg.sender] -= amount;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/Aymen0909-G.md", "collected_at": "2026-01-02T18:12:54.910840+00:00", "source_hash": "5face008d856002630859ba60a8053be3dcbc1207e9e2f490ae5668405238453", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 96, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "info.deposit = uint112(info.deposit - withdrawAmount);", "primary_code_language": "unknown", "primary_code_char_count": 54, "all_code_blocks": "// Code block 1 (unknown):\ninfo.deposit = uint112(info.deposit - withdrawAmount);\n\n// Code block 2 (unknown):\npaymasterIdBalances[msg.sender] -= amount;", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "StakeManager.sol#L118, StakeManager.sol#L117, VerifyingSingletonPaymaster.sol#L58", "github_files_list": "VerifyingSingletonPaymaster.sol, StakeManager.sol", "github_refs_count": 3, "vulnerable_code_actual": "info.deposit = uint112(info.deposit - withdrawAmount);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "paymasterIdBalances[msg.sender] -= amount;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "11-kelp", "title": "Giorgio Q", "severity_raw": "Unknown", "severity": "unknown", "description": "## Misleading comment in `LTRDepositPool::addNodeDelegatorContractToQueue()`\n\n## Issue\n\nThe comment above the `addNodeDelegatorContractToQueue()` function indicate that the `manager` should call this function, but the modifier used is for `admin`. This is confusing.\n\n## Link\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTDepositPool.sol#L160-L162\n\n## Fix\n\nTo fix this we should change the comments accordingly so that they can be in line with the code.\n\n```\n /// @dev only callable by LRT admin\n```\n", "vulnerable_code": " /// @dev only callable by LRT admin", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/Giorgio-Q.md", "collected_at": "2026-01-02T18:27:28.656752+00:00", "source_hash": "5ff66088ad255407dfc22d609fb155cd588b57d8a82ff5f7deec8455447821e4", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 35, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "/// @dev only callable by LRT admin", "primary_code_language": "unknown", "primary_code_char_count": 35, "all_code_blocks": "// Code block 1 (unknown):\n/// @dev only callable by LRT admin", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LRTDepositPool.sol#L160-L162", "github_files_list": "LRTDepositPool.sol", "github_refs_count": 1, "vulnerable_code_actual": " /// @dev only callable by LRT admin", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.1} {"source": "c4", "protocol": "01-biconomy", "title": "siddhpurakaran G", "severity_raw": "High", "severity": "high", "description": "## [G-01] USE FUNCTION INSTEAD OF MODIFIERS (3 INSTANCES)\nFunctions saves gas as compared to modifiers.\nExample : \n```\n-----------------------Before-----------------------------------\n modifier onlyMinters() {\n require(minters[msg.sender] == true, \"Only minters\");\n _;\n }\n \n function minter_mint(address m_address, uint256 m_amount) public onlyMinters {\n onlyMinters();\n super._mint(m_address, m_amount);\n }\n\n---------------------------After---------------------------------\n function onlyMinters() private {\n require(minters[msg.sender] == true, \"Only minters\");\n _;\n }\n\n function minter_mint(address m_address, uint256 m_amount) public {\n onlyMinters();\n super._mint(m_address, m_amount);\n }\n\n-------------------------------------------------------------------------\n```\n\n# 1. contracts/smart-contract-wallet/SmartAccount.sol \n```\n L76 modifier onlyOwner {\n L82 modifier mixedAuth {\n L88 modifier onlyEntryPoint {\n```\n\n\n## [G-02] STORAGE POINTER TO A STRUCTURE IS CHEAPER THAN COPYING EACH VALUE OF THE STRUCTURE INTO MEMORY, SAME FOR ARRAY AND MAPPING (16 INSTANCE)\nWhen fetching data from a storage location, assigning the data to a memory variable causes all fields of the struct/array to be read from storage, which incurs a Gcoldsload (2100 gas) for each field of the struct/array. If the fields are read from the new memory variable, they incur an additional MLOAD rather than a cheap stack read.\n\nInstead of declearing the variable with the memory keyword, declaring the variable with the storage keyword and caching any fields that need to be re-read in stack variables, will be much cheaper, only incuring the Gcoldsload for the fields actually read. The only time it makes sense to read the whole struct/array into a memory variable, is if the full struct/array is being returned by the function, is being passed to a function that requires memory, or if the array/struct is being read from ano", "vulnerable_code": "-----------------------Before-----------------------------------\n modifier onlyMinters() {\n require(minters[msg.sender] == true, \"Only minters\");\n _;\n }\n \n function minter_mint(address m_address, uint256 m_amount) public onlyMinters {\n onlyMinters();\n super._mint(m_address, m_amount);\n }\n\n---------------------------After---------------------------------\n function onlyMinters() private {\n require(minters[msg.sender] == true, \"Only minters\");\n _;\n }\n\n function minter_mint(address m_address, uint256 m_amount) public {\n onlyMinters();\n super._mint(m_address, m_amount);\n }\n\n-------------------------------------------------------------------------", "fixed_code": " L76 modifier onlyOwner {\n L82 modifier mixedAuth {\n L88 modifier onlyEntryPoint {", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/siddhpurakaran-G.md", "collected_at": "2026-01-02T18:14:10.536026+00:00", "source_hash": "5ffa09e4ae9759773b60417bade8552ea2664d62d2bf14a6b5d20226933a62c2", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 820, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "-----------------------Before-----------------------------------\n modifier onlyMinters() {\n require(minters[msg.sender] == true, \"Only minters\");\n _;\n }\n \n function minter_mint(address m_address, uint256 m_amount) public onlyMinters {\n onlyMinters();\n super._mint(m_address, m_amount);\n }\n\n---------------------------After---------------------------------\n function onlyMinters() private {\n require(minters[msg.sender] == true, \"Only minters\");\n _;\n }\n\n function minter_mint(address m_address, uint256 m_amount) public {\n onlyMinters();\n super._mint(m_address, m_amount);\n }\n\n-------------------------------------------------------------------------", "primary_code_language": "unknown", "primary_code_char_count": 714, "all_code_blocks": "// Code block 1 (unknown):\n-----------------------Before-----------------------------------\n modifier onlyMinters() {\n require(minters[msg.sender] == true, \"Only minters\");\n _;\n }\n \n function minter_mint(address m_address, uint256 m_amount) public onlyMinters {\n onlyMinters();\n super._mint(m_address, m_amount);\n }\n\n---------------------------After---------------------------------\n function onlyMinters() private {\n require(minters[msg.sender] == true, \"Only minters\");\n _;\n }\n\n function minter_mint(address m_address, uint256 m_amount) public {\n onlyMinters();\n super._mint(m_address, m_amount);\n }\n\n-------------------------------------------------------------------------\n\n// Code block 2 (unknown):\nL76 modifier onlyOwner {\n L82 modifier mixedAuth {\n L88 modifier onlyEntryPoint {", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "-----------------------Before-----------------------------------\n modifier onlyMinters() {\n require(minters[msg.sender] == true, \"Only minters\");\n _;\n }\n \n function minter_mint(address m_address, uint256 m_amount) public onlyMinters {\n onlyMinters();\n super._mint(m_address, m_amount);\n }\n\n---------------------------After---------------------------------\n function onlyMinters() private {\n require(minters[msg.sender] == true, \"Only minters\");\n _;\n }\n\n function minter_mint(address m_address, uint256 m_amount) public {\n onlyMinters();\n super._mint(m_address, m_amount);\n }\n\n-------------------------------------------------------------------------", "has_vulnerable_code_snippet": true, "fixed_code_actual": " L76 modifier onlyOwner {\n L82 modifier mixedAuth {\n L88 modifier onlyEntryPoint {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-asymmetry", "title": "Bloqarl G", "severity_raw": "Medium", "severity": "medium", "description": "## Gas Optimization report\n\n# [G-01] Avoid comparing a bool to true/false\nIt is not necessary to compare `pauseUnstaking` and `pausestaking` to true or false in the require(). Since they are booleans it is enough to write `require(!pauseUnstaking)`. \n\nThere are two instances in SafEth.sol. \n\nGas saved per instance: 18 gas\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L64\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L109\n\n\n# [G-02] += Costs More Gas Than = + \nInside `stage()` function that it's going to be used very often we can save some gas by using `x = x + y` instead of `x += y`.\n\nThere are four instances in `SafEth.sol` and two of those instances are inside a for loop. Which means that it can be saved an important amount of gas.\n```\nfor (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n```\n\nGas saved per instance: 13 gas\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L72\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L95\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L172\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L192\n\n\n# [G-03] Not using the named return variables in a function returns, wastes gas\nIn the `deposit()` function it is returned a `uint256`. If we use a named parameter instead of using the return keyword, some extra gas can be saved. Considering that it is a function that will be used a lot, it will be important change.\n\nThere are three instances. In the `deposit()` method of `Reth.sol`, `SfrxEth.sol` and `WstEth.sol`\n\nGas saved per instance: 13", "vulnerable_code": "for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Bloqarl-G.md", "collected_at": "2026-01-02T18:17:54.808462+00:00", "source_hash": "5fff0342714277c3ce06a42a25c8c76dfa3057f91375e2b9ab4146a3cc54c098", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 89, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];", "primary_code_language": "unknown", "primary_code_char_count": 89, "all_code_blocks": "// Code block 1 (unknown):\nfor (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol#L64, SafEth.sol#L109, SafEth.sol#L72, SafEth.sol#L95, SafEth.sol#L172, SafEth.sol#L192", "github_files_list": "SafEth.sol", "github_refs_count": 6, "vulnerable_code_actual": "for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "01-ondo", "title": "Bauer G", "severity_raw": "Gas", "severity": "gas", "description": "## 1.addKYCAddresses() and removeKYCAddresses() can be combined into one to save gas\nKYCRegister.sol\nFunction call addKYCAddresses() and removeKYCAddresses() can be combined into one to save gas\n\n```\n function addKYCAddresses(\n uint256 kycRequirementGroup,\n address[] calldata addresses\n ) external onlyRole(kycGroupRoles[kycRequirementGroup]) {\n uint256 length = addresses.length;\n for (uint256 i = 0; i < length; i++) {\n kycState[kycRequirementGroup][addresses[i]] = true;\n }\n emit KYCAddressesAdded(msg.sender, kycRequirementGroup, addresses);\n }\n\n function removeKYCAddresses(\n uint256 kycRequirementGroup,\n address[] calldata addresses\n ) external onlyRole(kycGroupRoles[kycRequirementGroup]) {\n uint256 length = addresses.length;\n for (uint256 i = 0; i < length; i++) {\n kycState[kycRequirementGroup][addresses[i]] = false;\n }\n emit KYCAddressesRemoved(msg.sender, kycRequirementGroup, addresses);\n }\n\n```\n## Recommended Mitigation Steps\uff1a\n```\nfunction updateKYCAddresses(\n uint256 kycRequirementGroup,\n address[] calldata addresses,\n bool v,\n ) external onlyRole(kycGroupRoles[kycRequirementGroup]) {\n uint256 length = addresses.length;\n for (uint256 i = 0; i < length; i++) {\n kycState[kycRequirementGroup][addresses[i]] = v;\n }\n emit KYCAddressesAdded(msg.sender, kycRequirementGroup, addresses);\n }\n\n```", "vulnerable_code": " function addKYCAddresses(\n uint256 kycRequirementGroup,\n address[] calldata addresses\n ) external onlyRole(kycGroupRoles[kycRequirementGroup]) {\n uint256 length = addresses.length;\n for (uint256 i = 0; i < length; i++) {\n kycState[kycRequirementGroup][addresses[i]] = true;\n }\n emit KYCAddressesAdded(msg.sender, kycRequirementGroup, addresses);\n }\n\n function removeKYCAddresses(\n uint256 kycRequirementGroup,\n address[] calldata addresses\n ) external onlyRole(kycGroupRoles[kycRequirementGroup]) {\n uint256 length = addresses.length;\n for (uint256 i = 0; i < length; i++) {\n kycState[kycRequirementGroup][addresses[i]] = false;\n }\n emit KYCAddressesRemoved(msg.sender, kycRequirementGroup, addresses);\n }\n", "fixed_code": "function updateKYCAddresses(\n uint256 kycRequirementGroup,\n address[] calldata addresses,\n bool v,\n ) external onlyRole(kycGroupRoles[kycRequirementGroup]) {\n uint256 length = addresses.length;\n for (uint256 i = 0; i < length; i++) {\n kycState[kycRequirementGroup][addresses[i]] = v;\n }\n emit KYCAddressesAdded(msg.sender, kycRequirementGroup, addresses);\n }\n", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/Bauer-G.md", "collected_at": "2026-01-02T18:14:31.073650+00:00", "source_hash": "601ba39695b3ecc17c51a2da75ae2a822d461187d87f83f174a102610208f910", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 1140, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function addKYCAddresses(\n uint256 kycRequirementGroup,\n address[] calldata addresses\n ) external onlyRole(kycGroupRoles[kycRequirementGroup]) {\n uint256 length = addresses.length;\n for (uint256 i = 0; i < length; i++) {\n kycState[kycRequirementGroup][addresses[i]] = true;\n }\n emit KYCAddressesAdded(msg.sender, kycRequirementGroup, addresses);\n }\n\n function removeKYCAddresses(\n uint256 kycRequirementGroup,\n address[] calldata addresses\n ) external onlyRole(kycGroupRoles[kycRequirementGroup]) {\n uint256 length = addresses.length;\n for (uint256 i = 0; i < length; i++) {\n kycState[kycRequirementGroup][addresses[i]] = false;\n }\n emit KYCAddressesRemoved(msg.sender, kycRequirementGroup, addresses);\n }", "primary_code_language": "unknown", "primary_code_char_count": 755, "all_code_blocks": "// Code block 1 (unknown):\nfunction addKYCAddresses(\n uint256 kycRequirementGroup,\n address[] calldata addresses\n ) external onlyRole(kycGroupRoles[kycRequirementGroup]) {\n uint256 length = addresses.length;\n for (uint256 i = 0; i < length; i++) {\n kycState[kycRequirementGroup][addresses[i]] = true;\n }\n emit KYCAddressesAdded(msg.sender, kycRequirementGroup, addresses);\n }\n\n function removeKYCAddresses(\n uint256 kycRequirementGroup,\n address[] calldata addresses\n ) external onlyRole(kycGroupRoles[kycRequirementGroup]) {\n uint256 length = addresses.length;\n for (uint256 i = 0; i < length; i++) {\n kycState[kycRequirementGroup][addresses[i]] = false;\n }\n emit KYCAddressesRemoved(msg.sender, kycRequirementGroup, addresses);\n }\n\n// Code block 2 (unknown):\nfunction updateKYCAddresses(\n uint256 kycRequirementGroup,\n address[] calldata addresses,\n bool v,\n ) external onlyRole(kycGroupRoles[kycRequirementGroup]) {\n uint256 length = addresses.length;\n for (uint256 i = 0; i < length; i++) {\n kycState[kycRequirementGroup][addresses[i]] = v;\n }\n emit KYCAddressesAdded(msg.sender, kycRequirementGroup, addresses);\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function addKYCAddresses(\n uint256 kycRequirementGroup,\n address[] calldata addresses\n ) external onlyRole(kycGroupRoles[kycRequirementGroup]) {\n uint256 length = addresses.length;\n for (uint256 i = 0; i < length; i++) {\n kycState[kycRequirementGroup][addresses[i]] = true;\n }\n emit KYCAddressesAdded(msg.sender, kycRequirementGroup, addresses);\n }\n\n function removeKYCAddresses(\n uint256 kycRequirementGroup,\n address[] calldata addresses\n ) external onlyRole(kycGroupRoles[kycRequirementGroup]) {\n uint256 length = addresses.length;\n for (uint256 i = 0; i < length; i++) {\n kycState[kycRequirementGroup][addresses[i]] = false;\n }\n emit KYCAddressesRemoved(msg.sender, kycRequirementGroup, addresses);\n }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function updateKYCAddresses(\n uint256 kycRequirementGroup,\n address[] calldata addresses,\n bool v,\n ) external onlyRole(kycGroupRoles[kycRequirementGroup]) {\n uint256 length = addresses.length;\n for (uint256 i = 0; i < length; i++) {\n kycState[kycRequirementGroup][addresses[i]] = v;\n }\n emit KYCAddressesAdded(msg.sender, kycRequirementGroup, addresses);\n }\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6.78} {"source": "c4", "protocol": "01-biconomy", "title": "Rolezn G", "severity_raw": "High", "severity": "high", "description": "## Summary
\n\n### Gas Optimizations\n| |Issue|Contexts|Estimated Gas Saved|\n|-|:-|:-|:-:|\n| [GAS‑1](#GAS‑1) | `abi.encode()` is less efficient than `abi.encodepacked()` | 5 | 500 |\n| [GAS‑2](#GAS‑2) | State variables only set in the `constructor` should be declared immutable | 1 | - |\n| [GAS‑3](#GAS‑3) | Setting the `constructor` to `payable` | 6 | 78 |\n| [GAS‑4](#GAS‑4) | Duplicated `require()`/`revert()` Checks Should Be Refactored To A Modifier Or Function | 8 | 532 |\n| [GAS‑5](#GAS‑5) | Empty Blocks Should Be Removed Or Emit Something | 3 | - |\n| [GAS‑6](#GAS‑6) | Using fixed bytes is cheaper than using `string` | 4 | - |\n| [GAS‑7](#GAS‑7) | Functions guaranteed to revert when called by normal users can be marked `payable` | 18 | 378 |\n| [GAS‑8](#GAS‑8) | `internal` functions only called once can be inlined to save gas | 44 | - |\n| [GAS‑9](#GAS‑9) | Multiplication/division By Two Should Use Bit Shifting | 3 | - |\n| [GAS‑10](#GAS‑10) | Optimize names to save gas | 20 | 440 |\n| [GAS‑11](#GAS‑11) | ` += ` Costs More Gas Than ` = + ` For State Variables | 6 | - |\n| [GAS‑12](#GAS‑12) | Public Functions To External | 45 | - |\n| [GAS‑13](#GAS‑13) | `require()` Should Be Used Instead Of `assert()` | 1 | - |\n| [GAS‑14](#GAS‑14) | `require()`/`revert()` Strings Longer Than 32 Bytes Cost Extra Gas | 19 | - |\n| [GAS‑15](#GAS‑15) | Splitting `require()` Statements That Use `&&` Saves Gas | 3 | 27 |\n| [GAS‑16](#GAS‑16) | Help The Optimizer By Saving A Storage Variable\u2019s Reference Instead Of Repeatedly Fetching It | 2 | - |\n| [GAS‑17](#GAS‑17) | Usage of `uints`/`ints` smaller than 32 bytes (256 bits) incurs overhead | 11 | - |\n| [GAS‑18](#GAS‑18) | `++i`/`i++` Should Be `unchecked{++i}`/`unchecked{", "vulnerable_code": "136: return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));", "fixed_code": "431: abi.encode(", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/Rolezn-G.md", "collected_at": "2026-01-02T18:13:17.004532+00:00", "source_hash": "602d85521af9a896443bcf5621f0f6672b04f1f2e0d3b1d7d5e3324890b8a7e3", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "136: return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));", "has_vulnerable_code_snippet": true, "fixed_code_actual": "431: abi.encode(", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "06-lybra", "title": "Sathish9098 G", "severity_raw": "High", "severity": "high", "description": "# GAS OPTIMIZATION\n\n## TABLE OF CONTENTS\n\nTotal Gas saved from all findings - ``68800 GAS``\n\n### FINDINGS\n\n- [Optimizing gas consumption with tight variable packing- Saves ``20000 GAS , 10 SLOTS``](#g-1-optimizing-gas-consumption-with-tight-variable-packing)\n\n - [ ``EUSDMiningIncentives.sol``: ``duration ,finishAt, updatedAt, rewardRatio, extraRatio ,peUSDExtraRatio `` Variables can be uint128 instead of uint256.``biddingFeeRatio`` can be uint94 instead of uint256 : Saves ``8000 GAS , 4 SLOT`` ](#eusdminingincentivessol-duration-finishat-updatedat-rewardratio-extraratio-peusdextraratio--variables-can-be-uint128-instead-of-uint256biddingfeeratio-can-be-uint94-instead-of-uint256------saves-8000-gas--4-slot)\n \n - [ ``LybraConfigurator.sol``: ``redemptionFee ,flashloanFee ,maxStableRatio `` can be uint94 instead of uint256. Saves ``6000 GAS, 3 SLOT``](#lybraconfiguratorsol-redemptionfee-flashloanfee-maxstableratio--can-be-uint94-instead-of-uint256-saves-6000-gas-3-slot)\n\n - [``ProtocolRewardsPool.sol``: ``grabFeeRatio`` can be uint94 instead of uint256 since the value not exceeds ``8000 `` as per this check ``require(_ratio <= 8000, \"BCE\");`` : Saves ``2000 GAS, 1 SLOD``](#protocolrewardspoolsol-grabfeeratio-can-be-uint94-instead-of-uint256-since-the-value-not-exceeds-8000--as-per-this-check-require_ratio--8000-bce--saves-2000-gas-1-slod)\n \n - [``stakerewardV2pool.sol``: ``duration ,finishAt, updatedAt, rewardRatio `` Variables can be uint128 instead of uint256: Saves ``4000 Gas , 2 SLOT``](#stakerewardv2poolsol-duration-finishat-updatedat-rewardratio---variables-can-be-uint128-instead-of-uint256-saves-4000-gas--2-slot)\n \n- [Structs can be packed into fewer storage slots- Saves ``2000 GAS, 1 SLOT``](#g-2-structs-can-be-packed-into-fewer-storage-slots)\n\n - [``esLBRBoost.sol``: ``unlockTime,duration`` can be uint128 instead of uint256 : Saves ``2000 GAS, 1 SLOT``](#eslbrboostsol-unlocktimeduration-can-be-uint128-instead-of-uint256--saves-2000-gas-1-slot)\n\n- [`", "vulnerable_code": "### ``LybraConfigurator.sol``: ``redemptionFee ,flashloanFee ,maxStableRatio `` can be uint94 instead of uint256. Saves ``6000 GAS, 3 SLOT``\n\n- ``redemptionFee`` is not exceeds`` 500`` because of this check ``require(newFee <= 500, \"Max Redemption Fee is 5%\");``\n\n- ``flashloanFee `` is not exceeds ``10_000`` because of this check ``if (fee > 10_000) revert('EL');``\n\n- ``maxStableRatio `` is not exceeds ``10_000`` because of this check ``require(_ratio <= 10_000, \"The maximum value is 10000\");``\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/configuration/LybraConfigurator.sol#L49-L61\n\n", "fixed_code": "### ``ProtocolRewardsPool.sol``: ``grabFeeRatio`` can be uint94 instead of uint256 since the value not exceeds ``8000 `` as per this check ``require(_ratio <= 8000, \"BCE\");`` : Saves ``2000 GAS, 1 SLOD``\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/ProtocolRewardsPool.sol#L27-L41\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/Sathish9098-G.md", "collected_at": "2026-01-02T18:22:44.019554+00:00", "source_hash": "608c17617956b9f004dbe0ef38224bd6b7c14e1caabac9e5a86006b3e51d152a", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LybraConfigurator.sol#L49-L61, ProtocolRewardsPool.sol#L27-L41", "github_files_list": "LybraConfigurator.sol, ProtocolRewardsPool.sol", "github_refs_count": 2, "vulnerable_code_actual": "### ``LybraConfigurator.sol``: ``redemptionFee ,flashloanFee ,maxStableRatio `` can be uint94 instead of uint256. Saves ``6000 GAS, 3 SLOT``\n\n- ``redemptionFee`` is not exceeds`` 500`` because of this check ``require(newFee <= 500, \"Max Redemption Fee is 5%\");``\n\n- ``flashloanFee `` is not exceeds ``10_000`` because of this check ``if (fee > 10_000) revert('EL');``\n\n- ``maxStableRatio `` is not exceeds ``10_000`` because of this check ``require(_ratio <= 10_000, \"The maximum value is 10000\");``\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/configuration/LybraConfigurator.sol#L49-L61\n\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "### ``ProtocolRewardsPool.sol``: ``grabFeeRatio`` can be uint94 instead of uint256 since the value not exceeds ``8000 `` as per this check ``require(_ratio <= 8000, \"BCE\");`` : Saves ``2000 GAS, 1 SLOD``\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/ProtocolRewardsPool.sol#L27-L41\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-ondo", "title": "saneryee G", "severity_raw": "Medium", "severity": "medium", "description": "# Gas Optimizations Report\n\n| | Issue | Instances |\n| ------- | :----------------------------------------------------------------------------------------------------------------- | :-------: |\n| [G-001] | x += y or x -= y costs more gas than x = x + y or x = x - y for state variables | 4 |\n| [G-002] | Splitting require() statements that use `&&` saves gas | 3 |\n| [G-003] | Don't use `_msgSender()` if not supporting EIP-2771 | 2 |\n| [G-004] | Multiple address/ID mappings can be combined into a single mapping of an address/ID to a struct, where appropriate | 5 |\n| [G-005] | Multiple accesses of a `mapping/array` should use a local variable cache | 26 |\n| [G-006] | internal functions only called once can be inlined to save gas | 7 |\n| [G-007] | Use a more recent version of solidity | 10 |\n| [G-008] | Replace modifier with function | 6 |\n\n## [G-001] x += y or x -= y costs more gas than x = x + y or x = x - y for state variables\n\n### Impact\n\nUsing the addition operator instead of plus-equals saves 113 gas. Usually does not work with struct and mappings.\n\n### Findings\n\nTotal:4\n\n[contracts/cash/CashManager.sol#L792](https://github.com/code-423n4/2023-01-ondo/tree/main//contracts/cash/CashManager.sol#L792)\n\n```solidity\n792: totalCashAmountRefunded += cashAmountBurned;\n```\n\n[contracts/cash/CashManager.sol#L649](https://github.com/code-423n4/2023-01-ondo/tree/main//contracts/cash/CashManager.", "vulnerable_code": "792: totalCashAmountRefunded += cashAmountBurned;", "fixed_code": "649: currentRedeemAmount += amount;", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/saneryee-G.md", "collected_at": "2026-01-02T18:15:30.454551+00:00", "source_hash": "60a090e882f41996ae0c4e10271f7a7078eaae602af2f2c1211ee751e77fdf89", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 52, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "792: totalCashAmountRefunded += cashAmountBurned;", "primary_code_language": "solidity", "primary_code_char_count": 52, "all_code_blocks": "// Code block 1 (solidity):\n792: totalCashAmountRefunded += cashAmountBurned;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "792: totalCashAmountRefunded += cashAmountBurned;", "github_refs_formatted": "CashManager.sol#L792", "github_files_list": "CashManager.sol", "github_refs_count": 1, "vulnerable_code_actual": "792: totalCashAmountRefunded += cashAmountBurned;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "649: currentRedeemAmount += amount;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-asymmetry", "title": "0xWagmi Q", "severity_raw": "Critical", "severity": "critical", "description": "\n\n| Letter | Name | Description |\n|:--:|:-------:|:-------:|\n| L | Low risk | Potential risk |\n| NC | Non-critical | Non risky findings |\n| R | Refactor | Changing the code |\n| O | Ordinary | Often found issues |\n\n| Total Found Issues | 10 |\n|:--:|:--:|\n\n### Non-Critical \n\n| Count | Explanation | Instances |\n|:--:|:-------|:--:|\n| [N-01] | Floating Pragma | 5 |\n| [N-02] | Same user can stake more than 200 ETH | 1 |\n| [N-03] | \u00a0derivatives[i].withdraw(derivativeAmount); sending Ether to safETH contract if anyone call the unstake function then it might burn the tokens in derivative contracts | 1 |\n\n\n### Refactor Issues \n\n| Count | Explanation | Instances |\n|:--:|:-------|:--:|\n| [R-01] | Use uint instead of boolean in pauseUnstaking and pauseStaking | 1 |\n| [R-02] | If user doen't have sufficient safETH revert if unstake() function is called | 1 |\n\n\n### Low Risk \n| Count | Explanation | Instances |\n|:--:|:-------|:--:|\n| [L-01] | No nonreentrant modifier used in the functions stake and unstake | 1 |\n\n### [R-0] Use uint instead of boolean in pauseUnstaking and pauseStaking;\n\nIt's better to use uint instead of bool , a really good example is openzeppelin re-entrancy guard , Also\nboolean is way more expensive than using uint ;\n```js\n\u00a0 - bool public pauseStaking; // true if staking is paused\n\u00a0 \u00a0- bool public pauseUnstaking; // true if unstaking is pause\n```\n\neg: \n```js\n\u00a0uint256 private constant notpaused = 1 ;\n\u00a0 \u00a0 uint256 private constant paused = 2;\n\u00a0 \u00a0 uint256 private stakelock ;\n\u00a0 \u00a0 uint256 private unstakelock ;\n```\n\n```js\n// inside inizialer we innitialize it to paused \nstakelock = notpaused ;\n\u00a0unstakelock = notpaused;\n```\n\neg:\n```js\n\u00a0function setPauseUnstaking() external onlyOwner {\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 if (unstakelock == paused){\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 unstakelock = notpaused;\n\u00a0 \u00a0 \u00a0 \u00a0 }\n\u00a0 \u00a0 \u00a0 \u00a0 else {\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0unstakelock = paused;\n\u00a0 \u00a0 \u00a0 \u00a0 }\n\n```\n\n\n### [R-1] If user doen't have sufficient safETH revert if unstake() function is called \n\nunstake funtion do", "vulnerable_code": "\u00a0 - bool public pauseStaking; // true if staking is paused\n\u00a0 \u00a0- bool public pauseUnstaking; // true if unstaking is pause", "fixed_code": "\u00a0uint256 private constant notpaused = 1 ;\n\u00a0 \u00a0 uint256 private constant paused = 2;\n\u00a0 \u00a0 uint256 private stakelock ;\n\u00a0 \u00a0 uint256 private unstakelock ;", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/0xWagmi-Q.md", "collected_at": "2026-01-02T18:17:38.241366+00:00", "source_hash": "60e466df92a8e6d03d1544aa6ba8beb5d31fad60ae182348761b936ec7d7ba8b", "code_block_count": 4, "solidity_block_count": 0, "total_code_chars": 562, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "- bool public pauseStaking; // true if staking is paused\n\u00a0 \u00a0- bool public pauseUnstaking; // true if unstaking is pause", "primary_code_language": "js", "primary_code_char_count": 123, "all_code_blocks": "// Code block 1 (js):\n- bool public pauseStaking; // true if staking is paused\n\u00a0 \u00a0- bool public pauseUnstaking; // true if unstaking is pause\n\n// Code block 2 (js):\nuint256 private constant notpaused = 1 ;\n\u00a0 \u00a0 uint256 private constant paused = 2;\n\u00a0 \u00a0 uint256 private stakelock ;\n\u00a0 \u00a0 uint256 private unstakelock ;\n\n// Code block 3 (js):\n// inside inizialer we innitialize it to paused \nstakelock = notpaused ;\n\u00a0unstakelock = notpaused;\n\n// Code block 4 (js):\nfunction setPauseUnstaking() external onlyOwner {\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 if (unstakelock == paused){\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 unstakelock = notpaused;\n\u00a0 \u00a0 \u00a0 \u00a0 }\n\u00a0 \u00a0 \u00a0 \u00a0 else {\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0unstakelock = paused;\n\u00a0 \u00a0 \u00a0 \u00a0 }", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "\u00a0 - bool public pauseStaking; // true if staking is paused\n\u00a0 \u00a0- bool public pauseUnstaking; // true if unstaking is pause", "has_vulnerable_code_snippet": true, "fixed_code_actual": "\u00a0uint256 private constant notpaused = 1 ;\n\u00a0 \u00a0 uint256 private constant paused = 2;\n\u00a0 \u00a0 uint256 private stakelock ;\n\u00a0 \u00a0 uint256 private unstakelock ;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "01-biconomy", "title": "Bnke0x0 Q", "severity_raw": "Critical", "severity": "critical", "description": "\n\n### [L01] require() should be used instead of assert()\n\n\n#### Findings:\n```\n2023-01-biconomy-main/contracts/smart-contract-wallet/Proxy.sol::16 => assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));\n2023-01-biconomy-main/contracts/smart-contract-wallet/common/Singleton.sol::13 => assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));\n```\n\n\n### [L02] Missing checks for `address(0x0)` when assigning values to `address` state variables\n\n\n#### Findings:\n```\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccount.sol::112 => owner = _newOwner;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccount.sol::172 => owner = _owner;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccountFactory.sol::19 => _defaultImpl = _baseImpl;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::112 => owner = _newOwner;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::172 => owner = _owner;\n```\n\n\n\n### [L03] `initialize` functions can be front-run\n\n#### Impact\nSee [this](https://github.com/code-423n4/2021-10-badgerdao-findings/issues/40) finding from a prior badger-dao contest for details\n#### Findings:\n```\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccount.sol::166 => function init(address _owner, address _entryPointAddress, address _handler) public override initializer {\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::166 => function init(address _owner, address _entryPointAddress, address _handler) public override initializer {\n```\n\n\n\n\n### [L04] Unused `receive()` function will lock Ether in contract\n\n#### Impact\nIf the intention is for the Ether to be used, the function should call another function, otherwise, it should revert\n#### Findings:\n```\n2023-01-biconomy-main/contracts/smart-contract-wallet/Proxy.sol::36 => receive() external payable {}\n2023-01-bicono", "vulnerable_code": "2023-01-biconomy-main/contracts/smart-contract-wallet/Proxy.sol::16 => assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));\n2023-01-biconomy-main/contracts/smart-contract-wallet/common/Singleton.sol::13 => assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));", "fixed_code": "2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccount.sol::112 => owner = _newOwner;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccount.sol::172 => owner = _owner;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccountFactory.sol::19 => _defaultImpl = _baseImpl;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::112 => owner = _newOwner;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::172 => owner = _owner;", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/Bnke0x0-Q.md", "collected_at": "2026-01-02T18:12:59.027900+00:00", "source_hash": "610162e9bc861900865a59fa7b682d24b4efe74d809820fe8a28dcfdcc88f714", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 1239, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "2023-01-biconomy-main/contracts/smart-contract-wallet/Proxy.sol::16 => assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));\n2023-01-biconomy-main/contracts/smart-contract-wallet/common/Singleton.sol::13 => assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));", "primary_code_language": "unknown", "primary_code_char_count": 356, "all_code_blocks": "// Code block 1 (unknown):\n2023-01-biconomy-main/contracts/smart-contract-wallet/Proxy.sol::16 => assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));\n2023-01-biconomy-main/contracts/smart-contract-wallet/common/Singleton.sol::13 => assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));\n\n// Code block 2 (unknown):\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccount.sol::112 => owner = _newOwner;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccount.sol::172 => owner = _owner;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccountFactory.sol::19 => _defaultImpl = _baseImpl;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::112 => owner = _newOwner;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::172 => owner = _owner;\n\n// Code block 3 (unknown):\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccount.sol::166 => function init(address _owner, address _entryPointAddress, address _handler) public override initializer {\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::166 => function init(address _owner, address _entryPointAddress, address _handler) public override initializer {", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "2023-01-biconomy-main/contracts/smart-contract-wallet/Proxy.sol::16 => assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));\n2023-01-biconomy-main/contracts/smart-contract-wallet/common/Singleton.sol::13 => assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));", "has_vulnerable_code_snippet": true, "fixed_code_actual": "2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccount.sol::112 => owner = _newOwner;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccount.sol::172 => owner = _owner;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccountFactory.sol::19 => _defaultImpl = _baseImpl;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::112 => owner = _newOwner;\n2023-01-biconomy-main/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::172 => owner = _owner;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "11-kelp", "title": "JCK G", "severity_raw": "Low", "severity": "low", "description": "\n## Gas Optimizations\n\n| Number | Issue | Instances |\n|--------|-------|-----------|\n|[G-01]| Use a do while loop instead of a for loop | 4 | |\n|[G-02]| Don\u2019t cache calls that are only used once | 8 | |\n|[G-03]| Possible Optimizations in LRTConfig.sol | 4 | |\n|[G-04]| Do not cache immutable values | 1 | |\n|[G-05]| Counting down in for statements is more gas efficient | 4 | |\n|[G-06]| Avoid Unnecessary Public Variables | 5 | |\n|[G-07]| Cache external calls outside of loop to avoid re-calling function on each iteration | 3 | |\n|[G-08]| Use hardcoded address instead of address(this) | 6 | |\n|[G-09]| Use assembly for loops | 3 | |\n|[G-10]| Declare the variables outside the loop | 3 | | \n|[G-11]| Immutable over constant | 9 | |\n\n## [G-01] Use a do while loop instead of a for loop\n\nA do while loop will cost less gas since the condition is not being checked for the first iteration.\n\n```solidity\nfile: blob/main/src/NodeDelegator.sol\n\n109 for (uint256 i = 0; i < strategiesLength;) {\n\n```\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/NodeDelegator.sol#L109\n\n### foundry test only used for NodeDelegator.sol\n\nBefore gas value:\n[PASS] test_GetAssetBalances() (gas: 277672)\n\nAfter gas vlue;\n[PASS] test_GetAssetBalances() (gas: 277617)\n\n```solidity\nfile: blob/main/src/LRTDepositPool.sol\n\n82 for (uint256 i; i < ndcsCount;) {\n\n168 for (uint256 i; i < length;) {\n\n```\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L82\n\n\n```solidity\nfile: blob/main/src/LRTOracle.sol\n\n66 for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n\n```\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTOracle.sol#L66\n\n\n## [G-02] Don\u2019t cache calls that are only used once\n\n\n```solidity\nfile: blob/main/src/NodeDelegator.sol\n\n100 address eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);\n\n```\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/NodeDelegat", "vulnerable_code": "file: blob/main/src/NodeDelegator.sol\n\n109 for (uint256 i = 0; i < strategiesLength;) {\n", "fixed_code": "file: blob/main/src/LRTDepositPool.sol\n\n82 for (uint256 i; i < ndcsCount;) {\n\n168 for (uint256 i; i < length;) {\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/JCK-G.md", "collected_at": "2026-01-02T18:27:29.564591+00:00", "source_hash": "6184559ec93d68057534e35ce73de6221ecd9fffba422d54c047db3461ed9478", "code_block_count": 4, "solidity_block_count": 4, "total_code_chars": 448, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "file: blob/main/src/NodeDelegator.sol\n\n109 for (uint256 i = 0; i < strategiesLength;) {", "primary_code_language": "solidity", "primary_code_char_count": 89, "all_code_blocks": "// Code block 1 (solidity):\nfile: blob/main/src/NodeDelegator.sol\n\n109 for (uint256 i = 0; i < strategiesLength;) {\n\n// Code block 2 (solidity):\nfile: blob/main/src/LRTDepositPool.sol\n\n82 for (uint256 i; i < ndcsCount;) {\n\n168 for (uint256 i; i < length;) {\n\n// Code block 3 (solidity):\nfile: blob/main/src/LRTOracle.sol\n\n66 for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n\n// Code block 4 (solidity):\nfile: blob/main/src/NodeDelegator.sol\n\n100 address eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "file: blob/main/src/NodeDelegator.sol\n\n109 for (uint256 i = 0; i < strategiesLength;) {\n\nfile: blob/main/src/LRTDepositPool.sol\n\n82 for (uint256 i; i < ndcsCount;) {\n\n168 for (uint256 i; i < length;) {\n\nfile: blob/main/src/LRTOracle.sol\n\n66 for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n\nfile: blob/main/src/NodeDelegator.sol\n\n100 address eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);", "github_refs_formatted": "NodeDelegator.sol#L109, LRTDepositPool.sol#L82, LRTOracle.sol#L66", "github_files_list": "NodeDelegator.sol, LRTDepositPool.sol, LRTOracle.sol", "github_refs_count": 3, "vulnerable_code_actual": "file: blob/main/src/NodeDelegator.sol\n\n109 for (uint256 i = 0; i < strategiesLength;) {\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "file: blob/main/src/LRTDepositPool.sol\n\n82 for (uint256 i; i < ndcsCount;) {\n\n168 for (uint256 i; i < length;) {\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "01-biconomy", "title": "Dinesh11G Q", "severity_raw": "Low", "severity": "low", "description": "### Unspecific Compiler Version Pragma\n\n#### Impact\nIssue Information: \nAvoid floating pragmas for non-library contracts.\n\nWhile floating pragmas make sense for libraries to allow them to be included with multiple different versions of applications, it may be a security risk for application implementations.\n\nA known vulnerable compiler version may accidentally be selected or security tools might fall-back to an older compiler version ending up checking a different EVM compilation that is ultimately deployed on the blockchain.\n\nIt is recommended to pin to a concrete compiler version.\n\nExample\n\ud83e\udd26 Bad:\n\npragma solidity ^0.8.0;\n\ud83d\ude80 Good:\n\npragma solidity 0.8.4;\n\n#### Findings:\n```\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/BaseAccount.sol::2 => pragma solidity ^0.8.12;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/BasePaymaster.sol::2 => pragma solidity ^0.8.12;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol::6 => pragma solidity ^0.8.12;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/SenderCreator.sol::2 => pragma solidity ^0.8.12;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/StakeManager.sol::2 => pragma solidity ^0.8.12;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IAccount.sol::2 => pragma solidity ^0.8.12;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IAggregatedAccount.sol::2 => pragma solidity ^0.8.12;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IEntryPoint.sol::6 => pragma solidity ^0.8.12;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IPaymaster.sol::2 => pragma solidity ^0.8.12;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IStakeManager.sol::2 => pragma solidity ^0.8.12;\n2023-01-biconomy/scw-contracts/contracts/smart-c", "vulnerable_code": "2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/BaseAccount.sol::2 => pragma solidity ^0.8.12;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/BasePaymaster.sol::2 => pragma solidity ^0.8.12;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol::6 => pragma solidity ^0.8.12;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/SenderCreator.sol::2 => pragma solidity ^0.8.12;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/StakeManager.sol::2 => pragma solidity ^0.8.12;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IAccount.sol::2 => pragma solidity ^0.8.12;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IAggregatedAccount.sol::2 => pragma solidity ^0.8.12;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IEntryPoint.sol::6 => pragma solidity ^0.8.12;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IPaymaster.sol::2 => pragma solidity ^0.8.12;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IStakeManager.sol::2 => pragma solidity ^0.8.12;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/UserOperation.sol::2 => pragma solidity ^0.8.12;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol::2 => pragma solidity ^0.8.12;", "fixed_code": "", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/Dinesh11G-Q.md", "collected_at": "2026-01-02T18:13:04.001501+00:00", "source_hash": "6187a5398c9a35fc108cfe477b993e284db602eaa49716ffba7b5edb37dcab6c", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/BaseAccount.sol::2 => pragma solidity ^0.8.12;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/BasePaymaster.sol::2 => pragma solidity ^0.8.12;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol::6 => pragma solidity ^0.8.12;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/SenderCreator.sol::2 => pragma solidity ^0.8.12;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/StakeManager.sol::2 => pragma solidity ^0.8.12;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IAccount.sol::2 => pragma solidity ^0.8.12;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IAggregatedAccount.sol::2 => pragma solidity ^0.8.12;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IEntryPoint.sol::6 => pragma solidity ^0.8.12;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IPaymaster.sol::2 => pragma solidity ^0.8.12;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IStakeManager.sol::2 => pragma solidity ^0.8.12;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/UserOperation.sol::2 => pragma solidity ^0.8.12;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol::2 => pragma solidity ^0.8.12;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4} {"source": "c4", "protocol": "03-revert-lend", "title": "0xGreyWolf Q", "severity_raw": "Unknown", "severity": "unknown", "description": "# Custom errors and revert statement was only introduced in Solidity version 0.8.4 but contracts use ^0.8.0\n\n## Description\nThe `revert-error` pattern cannot be implemented until the introduction of custom error and revert statements in Solidity version `0.8.4`. These contracts will not compile in Solidity versions 0.8.0, 0.8.1, 0.8.2, and 0.8.3.\n\nHere's an example of `revert-error` pattern.\n```solidity\nif(msg.sender != owner) revert Unauthorized;\n```\nReference: https://soliditylang.org/blog/2021/04/21/solidity-0.8.4-release-announcement/\n\n## Mitigation\nFixate to a newer version of not older than 0.8.4 but be mindful of the newer versions' issues as well.", "vulnerable_code": "if(msg.sender != owner) revert Unauthorized;", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/0xGreyWolf-Q.md", "collected_at": "2026-01-02T19:02:52.588448+00:00", "source_hash": "61979e9cdfa5d74310f6127b771a6a9727b7c243db7666163fbfb8455f7b3ce1", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 44, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "if(msg.sender != owner) revert Unauthorized;", "primary_code_language": "solidity", "primary_code_char_count": 44, "all_code_blocks": "// Code block 1 (solidity):\nif(msg.sender != owner) revert Unauthorized;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "if(msg.sender != owner) revert Unauthorized;", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "if(msg.sender != owner) revert Unauthorized;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 3.33} {"source": "c4", "protocol": "05-ajna", "title": "GG_Security Q", "severity_raw": "Medium", "severity": "medium", "description": "## [L-01] Hardcoded Ajna token address is a bad practice\n[https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/Funding.sol#L21](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/Funding.sol#L21)\n\n```\naddress public immutable ajnaTokenAddress = 0x9a96ec9B57Fb64FbC60B423d1f4da7691Bd35079;\n```\n\n## [L-02] Limits should be inclusive\n[https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L245](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L245)\n\n```\nif(block.number < _getChallengeStageEndBlock(currentDistribution.endBlock))`\n```\n`_getChallengeStageEndBlock` should be included as it is everywhere else\n\n## [L-03] Unsafe downcasting\n[https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/RewardsManager.sol#L179-L180](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/RewardsManager.sol#L179-L180)\n\n```\ntoBucket.lpsAtStakeTime = uint128(positionManager.getLP(tokenId_, toIndex));\ntoBucket.rateAtStakeTime = uint128(IPool(ajnaPool).bucketExchangeRate(toIndex));\n```\n\n[https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/RewardsManager.sol#L235-L241](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/RewardsManager.sol#L235-L241)\n\n```\n// record the number of lps in bucket at the time of staking\nbucketState.lpsAtStakeTime = uint128(positionManager.getLP(\n tokenId_,\n bucketId\n));\n// record the bucket exchange rate at the time of staking\nbucketState.rateAtStakeTime = uint128(IPool(ajnaPool).bucketExchangeRate(bucketId));\n```\n\n## [L-04] Deposit time not cleared\n[https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/PositionManager.sol#L262-L333](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/PositionManager.sol#L262-L333)\n\nIn `moveLiquidity` there is a check if the owner attempts to move liquidity after they've already done so\n```\n", "vulnerable_code": "address public immutable ajnaTokenAddress = 0x9a96ec9B57Fb64FbC60B423d1f4da7691Bd35079;", "fixed_code": "if(block.number < _getChallengeStageEndBlock(currentDistribution.endBlock))`", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/GG_Security-Q.md", "collected_at": "2026-01-02T18:20:58.886147+00:00", "source_hash": "61b9ebd85128bf3c332152eee022a38319d6aa0f8987a53aae514b10ac8383a7", "code_block_count": 4, "solidity_block_count": 0, "total_code_chars": 615, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "address public immutable ajnaTokenAddress = 0x9a96ec9B57Fb64FbC60B423d1f4da7691Bd35079;", "primary_code_language": "unknown", "primary_code_char_count": 87, "all_code_blocks": "// Code block 1 (unknown):\naddress public immutable ajnaTokenAddress = 0x9a96ec9B57Fb64FbC60B423d1f4da7691Bd35079;\n\n// Code block 2 (unknown):\nif(block.number < _getChallengeStageEndBlock(currentDistribution.endBlock))`\n\n// Code block 3 (unknown):\ntoBucket.lpsAtStakeTime = uint128(positionManager.getLP(tokenId_, toIndex));\ntoBucket.rateAtStakeTime = uint128(IPool(ajnaPool).bucketExchangeRate(toIndex));\n\n// Code block 4 (unknown):\n// record the number of lps in bucket at the time of staking\nbucketState.lpsAtStakeTime = uint128(positionManager.getLP(\n tokenId_,\n bucketId\n));\n// record the bucket exchange rate at the time of staking\nbucketState.rateAtStakeTime = uint128(IPool(ajnaPool).bucketExchangeRate(bucketId));", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Funding.sol#L21, StandardFunding.sol#L245, RewardsManager.sol#L179-L180, RewardsManager.sol#L235-L241, PositionManager.sol#L262-L333", "github_files_list": "RewardsManager.sol, Funding.sol, StandardFunding.sol, PositionManager.sol", "github_refs_count": 5, "vulnerable_code_actual": "address public immutable ajnaTokenAddress = 0x9a96ec9B57Fb64FbC60B423d1f4da7691Bd35079;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "if(block.number < _getChallengeStageEndBlock(currentDistribution.endBlock))`", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "05-ajna", "title": "hals Q", "severity_raw": "Low", "severity": "low", "description": "# Low/QA\n\n## [QA-01]\n\nDifferent solidity versions and different license were spotted in the smart contracts.\n\n## Proof of Concept\n\nInstances: 2\n\n```solidity\nFile: ajna-core/src/RewardsManager.sol\nFile: ajna-core/src/PositionManager.sol.sol\n\n// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.14;\n```\n\n```solidity\nFile: ajna-grants/src/grants/GrantFund.sol\nFile: ajna-grants/src/grants/base/ExtraordinaryFunding.sol\nFile: ajna-grants/src/grants/base/StandardFunding.sol\n\n// SPDX-License-Identifier: MIT\npragma solidity 0.8.16;\n```\n\n## Tools Used\n\nManual Testing.\n\n## Recommended Mitigation Steps\n\nUnify solidity version and license among the contracts.\n\n#\n\n## [QA-02]\n\nUsing require statements without error string\n\n## Details\n\ntokenURI function uses require statement without error string.\n\n## Proof of Concept\n\nInstances: 1\n\n```solidity\nFile: ajna-core/src/PositionManager.sol\nLine 520: require(_exists(tokenId_));\n```\n\n## Tools Used\n\nManual Testing.\n\n## Recommended Mitigation Steps\n\nUse if statement with custom errors instead for a better error case user experience or add message to the require statement.\n", "vulnerable_code": "File: ajna-core/src/RewardsManager.sol\nFile: ajna-core/src/PositionManager.sol.sol\n\n// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.14;", "fixed_code": "File: ajna-grants/src/grants/GrantFund.sol\nFile: ajna-grants/src/grants/base/ExtraordinaryFunding.sol\nFile: ajna-grants/src/grants/base/StandardFunding.sol\n\n// SPDX-License-Identifier: MIT\npragma solidity 0.8.16;", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/hals-Q.md", "collected_at": "2026-01-02T18:21:28.842944+00:00", "source_hash": "61ba5d8b6007f977a62cd21f05a23153226ecfa07eb95cc5bfe7ccac797cac2b", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 434, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: ajna-core/src/RewardsManager.sol\nFile: ajna-core/src/PositionManager.sol.sol\n\n// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.14;", "primary_code_language": "solidity", "primary_code_char_count": 144, "all_code_blocks": "// Code block 1 (solidity):\nFile: ajna-core/src/RewardsManager.sol\nFile: ajna-core/src/PositionManager.sol.sol\n\n// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.14;\n\n// Code block 2 (solidity):\nFile: ajna-grants/src/grants/GrantFund.sol\nFile: ajna-grants/src/grants/base/ExtraordinaryFunding.sol\nFile: ajna-grants/src/grants/base/StandardFunding.sol\n\n// SPDX-License-Identifier: MIT\npragma solidity 0.8.16;\n\n// Code block 3 (solidity):\nFile: ajna-core/src/PositionManager.sol\nLine 520: require(_exists(tokenId_));", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: ajna-core/src/RewardsManager.sol\nFile: ajna-core/src/PositionManager.sol.sol\n\n// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.14;\n\nFile: ajna-grants/src/grants/GrantFund.sol\nFile: ajna-grants/src/grants/base/ExtraordinaryFunding.sol\nFile: ajna-grants/src/grants/base/StandardFunding.sol\n\n// SPDX-License-Identifier: MIT\npragma solidity 0.8.16;\n\nFile: ajna-core/src/PositionManager.sol\nLine 520: require(_exists(tokenId_));", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: ajna-core/src/RewardsManager.sol\nFile: ajna-core/src/PositionManager.sol.sol\n\n// SPDX-License-Identifier: BUSL-1.1\npragma solidity 0.8.14;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: ajna-grants/src/grants/GrantFund.sol\nFile: ajna-grants/src/grants/base/ExtraordinaryFunding.sol\nFile: ajna-grants/src/grants/base/StandardFunding.sol\n\n// SPDX-License-Identifier: MIT\npragma solidity 0.8.16;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7.24} {"source": "c4", "protocol": "01-ondo", "title": "joestakey Q", "severity_raw": "Critical", "severity": "critical", "description": "## Summary\n### Low Risk\n| | Issue |\n|------|----------------------------------------------------------------------------------|\n| L-01 | CashManager.cash should not be immutable |\n| L-02 | Additional sanity checks |\n| L-03 | Use `require` instead of `assert` |\n| L-04 | Avoid leftover ETH in `CashFactory` |\n| L-05 | Immutable addresses should have appropriate checks in constructor |\n| L-06 | Avoid static year variables |\n| L-07 | static prices should not be used in oracles |\n| L-08 | `CTokenModified.repayBorrowFresh` can be DOSed |\n\n### Non-Critical\n| | Issue |\n|------|----------------------------------------------------------------------------------|\n| N-01 | Use the same Solidity version across the protocol |\n| N-02 | Scientific notation can be used |\n| N-03 | Redundant cast |\n| N-04 | Order of functions |\n| N-05 | Comments consistency |\n| N-06 | Native time should be used |\n| N-07 | Avoid floating pragmas |\n\n\n## Low\n### [L\u201101] CashManager.cash should not be immutable \n\n`Cash` is upgradeable. `CashManager` should not have `cash` has an immutable variable,\nas it will not be able to work if `Cash` gets upgraded.\n\nhtt", "vulnerable_code": "43: Cash public immutable cash", "fixed_code": "375: epochToExchangeRate[epochToSet] = correctExchangeRate;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/joestakey-Q.md", "collected_at": "2026-01-02T18:15:15.220397+00:00", "source_hash": "61c5dc5ed740ac0f4b12fc87deea329e50c7da7c5023dde63b7a91e5e0f77e4f", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "43: Cash public immutable cash", "has_vulnerable_code_snippet": true, "fixed_code_actual": "375: epochToExchangeRate[epochToSet] = correctExchangeRate;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "02-ethos", "title": "cryptonue Q", "severity_raw": "Critical", "severity": "critical", "description": "# Tellor delay period of suggested to be 15 minutes instead of 20 minutes\n\nIn a case where Chainlink is unable to respond price query, Tellor will be use as an alternative. Due to recent issue of Liquity on Tellor response is possible to be disputed resulting in bad price return, the Tellor provide a failsafe of immutable Liquity by adding a time delay on fetching the price to last 15 minutes in order to prevent abuse of Tellor by disputing a price.\n\nThe 15 minutes delay period has been used by Liquity so far, and on their report it's a sweet spot, as the longer delay will result in not fresh / updated price, while to short might tends to 'corrupted' by Tellor disputes.\n\nI'm not sure why Ethos use the 20 minutes, have they did some analytic of the time variance, but shorter delay of latest price is better than lagging in terms of price feeds. \n\nThus we recommend to Ethos to keep delay to be 15 minutes instead of 20 minutes.\n\n# Collateral config didn't check duplicate (or if collateral alread exist in list) when `collaterals.push(collateral);`\n\nIn `CollateralConfig.sol` the `initialize` function doesn't really check if collateral which currently being pushed to array is not duplicates.\n\nEventhough the project owner mention currently only two collateral asset token which is planned as the collateral, WBTC and WETH, it's best to include the check to minimize the duplicate of collateral\n\n# Critical function like `updateChainlinkAggregator()` is recommend to have timelock to prevent any abuse / mistakes\n\n`updateChainlinkAggregator()` can be a potential issue when it's mistakenly or unauthorized changes by the owner. Currently if the `owner` is compromized, and attacker can change this price aggregator, this would be a major issue. So, giving a timelock on this function can help atleast prevent it.\n\n```js\nFile: PriceFeed.sol\n140: // Admin function to update the Chainlink aggregator address for a particular collateral.\n141: //\n142: // !!!PLEASE USE EXTREME CARE", "vulnerable_code": "File: PriceFeed.sol\n140: // Admin function to update the Chainlink aggregator address for a particular collateral.\n141: //\n142: // !!!PLEASE USE EXTREME CARE AND CAUTION!!!\n143: function updateChainlinkAggregator(\n144: address _collateral,\n145: address _priceAggregatorAddress\n146: ) external onlyOwner {\n147: _requireValidCollateralAddress(_collateral);\n148: checkContract(_priceAggregatorAddress);\n149: priceAggregator[_collateral] = AggregatorV3Interface(_priceAggregatorAddress);\n150:\n151: // Explicitly set initial system status\n152: status[_collateral] = Status.chainlinkWorking;\n153:\n154: // Get an initial price from Chainlink to serve as first reference for lastGoodPrice\n155: ChainlinkResponse memory chainlinkResponse = _getCurrentChainlinkResponse(_collateral);\n156: ChainlinkResponse memory prevChainlinkResponse = _getPrevChainlinkResponse(_collateral, chainlinkResponse.roundId, chainlinkResponse.decimals);\n157:\n158: require(!_chainlinkIsBroken(chainlinkResponse, prevChainlinkResponse) && !_chainlinkIsFrozen(chainlinkResponse),\n159: \"PriceFeed: Chainlink must be working and current\");\n160:\n161: _storeChainlinkPrice(_collateral, chainlinkResponse);\n162: }", "fixed_code": "File: CommunityIssuance.sol\n120: function updateDistributionPeriod(uint256 _newDistributionPeriod) external onlyOwner {\n121: distributionPeriod = _newDistributionPeriod;\n122: }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/cryptonue-Q.md", "collected_at": "2026-01-02T18:17:00.234327+00:00", "source_hash": "61c847f069bf97ff6a6af6ca2eeb8ce78a5841c655ce3992eabbe75b084d6993", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: PriceFeed.sol\n140: // Admin function to update the Chainlink aggregator address for a particular collateral.\n141: //\n142: // !!!PLEASE USE EXTREME CARE AND CAUTION!!!\n143: function updateChainlinkAggregator(\n144: address _collateral,\n145: address _priceAggregatorAddress\n146: ) external onlyOwner {\n147: _requireValidCollateralAddress(_collateral);\n148: checkContract(_priceAggregatorAddress);\n149: priceAggregator[_collateral] = AggregatorV3Interface(_priceAggregatorAddress);\n150:\n151: // Explicitly set initial system status\n152: status[_collateral] = Status.chainlinkWorking;\n153:\n154: // Get an initial price from Chainlink to serve as first reference for lastGoodPrice\n155: ChainlinkResponse memory chainlinkResponse = _getCurrentChainlinkResponse(_collateral);\n156: ChainlinkResponse memory prevChainlinkResponse = _getPrevChainlinkResponse(_collateral, chainlinkResponse.roundId, chainlinkResponse.decimals);\n157:\n158: require(!_chainlinkIsBroken(chainlinkResponse, prevChainlinkResponse) && !_chainlinkIsFrozen(chainlinkResponse),\n159: \"PriceFeed: Chainlink must be working and current\");\n160:\n161: _storeChainlinkPrice(_collateral, chainlinkResponse);\n162: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: CommunityIssuance.sol\n120: function updateDistributionPeriod(uint256 _newDistributionPeriod) external onlyOwner {\n121: distributionPeriod = _newDistributionPeriod;\n122: }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "08-dopex", "title": "Rickard Q", "severity_raw": "Low", "severity": "low", "description": "# [L-01] Redundant Usage of `SafeMath` Library in Solidity 0.8.19\n## Lines of code\n[https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/amo/UniV3LiquidityAmo.sol#L29](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/amo/UniV3LiquidityAmo.sol#L29) \n[https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/amo/UniV2LiquidityAmo.sol#L24](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/amo/UniV2LiquidityAmo.sol#L24) \n[https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/reLP/ReLPContract.sol#L27](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/reLP/ReLPContract.sol#L27) \n## Impact\nThe `UniV3LiquidityAmo`/`UniV2LiquidityAmo`/`ReLPContract` contracts currently import and utilize the `SafeMath` library for arithmetic operations. However, starting from Solidity version 0.8.0, the language has introduced built-in overflow and underflow protection for arithmetic operations, making the `SafeMath` library redundant and unnecessary. This unnecessary use of SafeMath in a contract targeting Solidity version 0.8.19 can result in increased gas costs, added complexity, and potential confusion among developers who are already acquainted with the improved Solidity features.\n## Tools Used\nManual Review\n## Recommended Mitigation Steps\nTo address this issue and optimize the contract, it is strongly advised to:\n1. Remove `SafeMath` Import: Eliminate the import statement for the `SafeMath` library from the `UniV3LiquidityAmo`/`UniV2LiquidityAmo`/`ReLPContract` contracts.\n2. Remove `SafeMath` Usage: Remove any usage of `SafeMath` functions for arithmetic operations within the contract, relying on Solidity's native arithmetic checks.\n# [L-02] Missing Check for Zero Address in `sortTokens` Function\n## Lines of code\n[https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/uniswap_V2/libraries/UniswapV2Library.sol#L16-L23](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/unisw", "vulnerable_code": "function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) {\n require(tokenA != tokenB, \"IDENTICAL_ADDRESSES\");\n (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);\n require(token0 != address(0), \"ZERO_ADDRESS\");\n //@audit-issue M:should we not 'require(token1 != address(0), \"ZERO_ADDRESS\");'?\n}", "fixed_code": "function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) {\n require(tokenA != tokenB, \"IDENTICAL_ADDRESSES\");\n (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);\n require(token0 != address(0), \"ZERO_ADDRESS\");\n require(token1 != address(0), \"ZERO_ADDRESS\");\n}", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/Rickard-Q.md", "collected_at": "2026-01-02T18:24:59.131472+00:00", "source_hash": "61e343768d3fc9570d5185bb2a3f27302e706befbcea3b86f70b28350dc1a0ed", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "UniV3LiquidityAmo.sol#L29, UniV2LiquidityAmo.sol#L24, ReLPContract.sol#L27, UniswapV2Library.sol#L16-L23", "github_files_list": "ReLPContract.sol, UniV2LiquidityAmo.sol, UniV3LiquidityAmo.sol, UniswapV2Library.sol", "github_refs_count": 4, "vulnerable_code_actual": "function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) {\n require(tokenA != tokenB, \"IDENTICAL_ADDRESSES\");\n (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);\n require(token0 != address(0), \"ZERO_ADDRESS\");\n //@audit-issue M:should we not 'require(token1 != address(0), \"ZERO_ADDRESS\");'?\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) {\n require(tokenA != tokenB, \"IDENTICAL_ADDRESSES\");\n (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);\n require(token0 != address(0), \"ZERO_ADDRESS\");\n require(token1 != address(0), \"ZERO_ADDRESS\");\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-ondo", "title": "2997ms Q", "severity_raw": "Critical", "severity": "critical", "description": "## Summary\n\n### Low Risk Issues\n\n| | Issue | \n| ----- | :--------------------------------------- | \n| LOW-01 | The divisor may be 0 | \n| LOW-02| Validate the ```cash decimals >= collateral decimals.``` | \n\n\n\n### Non-critical Issues\n\n| | Issue | \n| ---- | :--------------------------------------- | \n| NC-1 | Stop using V == 27 || V == 28 |\n| NC-2 | Lines are too long |\n| NC-3 | Solidity versions should be consistent |\n| NC-4 | No same value input control | \n| NC-5 | Check the Address 0 | \n\n\n## Low Risk Issues\n\n### [LOW-01] The divisor may be 0\n\nWe don't have the validtion of epochDuration value. If epochDuration is 0, the flow will be reverted without a valid error message.\n\n\n**Proof Of Concept**\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L176\n\n**Recommended Mitigation Steps**\nAdd a validation of this value to make sure it is not 0.\n\n\n### [LOW-02] Validate the ```cash decimals >= collateral decimals.```\n\nIn the annotation, we assume ````cash decimals >= collateral decimals```, but actually we need one line to validate it.\n\n**Proof Of Concept**\n\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L178-L182\n\n**Recommended Mitigation Steps**\n\nValidate the cash decimals >= collateral decimals.\n\n\n\n\n## Non Critical Issues\n\n### [NC-01]Stop using V == 27 || V == 28\n**Proof Of Concept**\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistry.sol#L87\n\n**Recommended Mitigation Steps**\nSee this reference: \nhttps://twitter.com/alexberegszaszi/status/1534461421454606336?s=20&t=H0Dv3ZT2bicx00hLWJk7Fg\n\n\n\n### [NC-02]Lines are too long\n\nUsually lines in source code are limited to 80 characters. Today\u2019s screens are much larger so it\u2019s reasonable to stretch this in some cases. Since the files will most lik", "vulnerable_code": "In the annotation, we assume ````cash decimals >= collateral decimals```, but actually we need one line to validate it.\n\n**Proof Of Concept**\n\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L178-L182\n\n**Recommended Mitigation Steps**\n\nValidate the cash decimals >= collateral decimals.\n\n\n\n\n## Non Critical Issues\n\n### [NC-01]Stop using V == 27 || V == 28\n**Proof Of Concept**\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistry.sol#L87\n\n**Recommended Mitigation Steps**\nSee this reference: \nhttps://twitter.com/alexberegszaszi/status/1534461421454606336?s=20&t=H0Dv3ZT2bicx00hLWJk7Fg\n\n\n\n### [NC-02]Lines are too long\n\nUsually lines in source code are limited to 80 characters. Today\u2019s screens are much larger so it\u2019s reasonable to stretch this in some cases. Since the files will most likely reside in GitHub, and GitHub starts using a scroll bar in all cases when the length is over 164 characters, the lines below should be split when they reach that length.\n\nReference:\n[https://docs.soliditylang.org/en/v0.8.10/style-guide.html#maximum-line-length](https://docs.soliditylang.org/en/v0.8.10/style-guide.html#maximum-line-length)\n\n**Proof Of Concept**\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cToken/CTokenModified.sol#L573-L574\n\n\n**Recommended Mitigation Steps**\nFollow the recommended solidity doc and reduce the lengths of codes.\n\n\n\n### [NC-03]Solidity versions should be consistent\n\nMost of solidity versions in the files are ```pragma solidity 0.8.16;```, but in \ncErc20ModifiedDelegator.sol, the value is ```pragma solidity ^0.5.12;```\n\n**Proof Of Concept**\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cErc20ModifiedDelegator.sol\n**Recommended Mitigation Steps**\nMake the versions consistent\n\n\n\n### [NC-04]No same value input control", "fixed_code": "**Recommended Mitigation Steps**\nAdd code like this; if (mintFee ==_mintFee);\n\n\n### [NC-05] Check the Address 0", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/2997ms-Q.md", "collected_at": "2026-01-02T18:14:25.226653+00:00", "source_hash": "61f3d5174f1f653ac8573f9e192d557af66b930b8c3f3176f6119ac0b2193b82", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 28, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "In the annotation, we assume", "primary_code_language": "unknown", "primary_code_char_count": 28, "all_code_blocks": "// Code block 1 (unknown):\nIn the annotation, we assume", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CashManager.sol#L176, CashManager.sol#L178-L182, KYCRegistry.sol#L87, CTokenModified.sol#L573-L574, cErc20ModifiedDelegator.sol", "github_files_list": "CashManager.sol, cErc20ModifiedDelegator.sol, KYCRegistry.sol, CTokenModified.sol", "github_refs_count": 5, "vulnerable_code_actual": "In the annotation, we assume ````cash decimals >= collateral decimals```, but actually we need one line to validate it.\n\n**Proof Of Concept**\n\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L178-L182\n\n**Recommended Mitigation Steps**\n\nValidate the cash decimals >= collateral decimals.\n\n\n\n\n## Non Critical Issues\n\n### [NC-01]Stop using V == 27 || V == 28\n**Proof Of Concept**\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistry.sol#L87\n\n**Recommended Mitigation Steps**\nSee this reference: \nhttps://twitter.com/alexberegszaszi/status/1534461421454606336?s=20&t=H0Dv3ZT2bicx00hLWJk7Fg\n\n\n\n### [NC-02]Lines are too long\n\nUsually lines in source code are limited to 80 characters. Today\u2019s screens are much larger so it\u2019s reasonable to stretch this in some cases. Since the files will most likely reside in GitHub, and GitHub starts using a scroll bar in all cases when the length is over 164 characters, the lines below should be split when they reach that length.\n\nReference:\n[https://docs.soliditylang.org/en/v0.8.10/style-guide.html#maximum-line-length](https://docs.soliditylang.org/en/v0.8.10/style-guide.html#maximum-line-length)\n\n**Proof Of Concept**\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cToken/CTokenModified.sol#L573-L574\n\n\n**Recommended Mitigation Steps**\nFollow the recommended solidity doc and reduce the lengths of codes.\n\n\n\n### [NC-03]Solidity versions should be consistent\n\nMost of solidity versions in the files are ```pragma solidity 0.8.16;```, but in \ncErc20ModifiedDelegator.sol, the value is ```pragma solidity ^0.5.12;```\n\n**Proof Of Concept**\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cErc20ModifiedDelegator.sol\n**Recommended Mitigation Steps**\nMake the versions consistent\n\n\n\n### [NC-04]No same value input control", "has_vulnerable_code_snippet": true, "fixed_code_actual": "**Recommended Mitigation Steps**\nAdd code like this; if (mintFee ==_mintFee);\n\n\n### [NC-05] Check the Address 0", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ai-arena", "title": "Logesh_N Q", "severity_raw": "Medium", "severity": "medium", "description": "## The code which does not follow the best practice of `Check-Effects-Interaction`\n\n\n\nThe code should adhere to the best practice known as *check-effects-interaction*, ensuring that state variables are modified before any *external calls* are executed. This approach effectively mitigates a wide range of *reentrancy vulnerabilities*.\n\n```javascript\nFile: src/AiArenaHelper.sol\n\n/// @audit The cumulative probability is updated within a loop, following the check-effects-interaction pattern.\n179: cumProb += attrProbabilities[i];\n```\n***GitHub***: https://github.com/code-423n4/2024-02-ai-arena/blob/f2952187a8afc44ee6adc28769657717b498b7d4/src/AiArenaHelper.sol#L179\n\n\n\n```javascript\nFile: src/FighterFarm.sol\n\n/// @audit The 'generation' array is incremented for the specified 'fighterType' in 'incrementGeneration()' before certain assignments.\n131: generation[fighterType] += 1;\n\n/// @audit The 'maxRerollsAllowed' array is incremented for the specified 'fighterType' in 'incrementGeneration()' before certain assignments.\n132: maxRerollsAllowed[fighterType] += 1;\n\n/// @audit The 'nftsClaimed' mapping is updated for the current sender address in 'claimFighters()' before certain assignments.\n209: nftsClaimed[msg.sender][0] += numToMint[0];\n\n/// @audit The 'nftsClaimed' mapping is updated for the current sender address in 'claimFighters()' before certain assignments.\n210: nftsClaimed[msg.sender][1] += numToMint[1];\n\n/// @audit The 'numTrained' mapping is updated for the specified 'tokenId' in 'updateModel()' before certain assignments.\n293: numTrained[tokenId] += 1;\n\n/// @audit The 'totalNumTrained' variable is incremented in 'updateModel()' before certain assignments.\n294: totalNumTrained += 1;\n\n```\n\n***GitHub***: https://github.com/code-423n4/2024-02-ai-arena/blob/f2952187a8afc44ee6adc28769657717b498b7d4/src/FighterFarm.sol#L131,\nhttps://github.com/code-423n4/2024-02-ai-ar", "vulnerable_code": "File: src/AiArenaHelper.sol\n\n/// @audit The cumulative probability is updated within a loop, following the check-effects-interaction pattern.\n179: cumProb += attrProbabilities[i];", "fixed_code": "File: src/FighterFarm.sol\n\n/// @audit The 'generation' array is incremented for the specified 'fighterType' in 'incrementGeneration()' before certain assignments.\n131: generation[fighterType] += 1;\n\n/// @audit The 'maxRerollsAllowed' array is incremented for the specified 'fighterType' in 'incrementGeneration()' before certain assignments.\n132: maxRerollsAllowed[fighterType] += 1;\n\n/// @audit The 'nftsClaimed' mapping is updated for the current sender address in 'claimFighters()' before certain assignments.\n209: nftsClaimed[msg.sender][0] += numToMint[0];\n\n/// @audit The 'nftsClaimed' mapping is updated for the current sender address in 'claimFighters()' before certain assignments.\n210: nftsClaimed[msg.sender][1] += numToMint[1];\n\n/// @audit The 'numTrained' mapping is updated for the specified 'tokenId' in 'updateModel()' before certain assignments.\n293: numTrained[tokenId] += 1;\n\n/// @audit The 'totalNumTrained' variable is incremented in 'updateModel()' before certain assignments.\n294: totalNumTrained += 1;\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/Logesh_N-Q.md", "collected_at": "2026-01-02T19:02:31.806524+00:00", "source_hash": "620ba9af714ade33d6a18a5e5745ac136b09231c68eff47f42be8b07adc1b7ce", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 1311, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: src/AiArenaHelper.sol\n\n/// @audit The cumulative probability is updated within a loop, following the check-effects-interaction pattern.\n179: cumProb += attrProbabilities[i];", "primary_code_language": "javascript", "primary_code_char_count": 196, "all_code_blocks": "// Code block 1 (javascript):\nFile: src/AiArenaHelper.sol\n\n/// @audit The cumulative probability is updated within a loop, following the check-effects-interaction pattern.\n179: cumProb += attrProbabilities[i];\n\n// Code block 2 (javascript):\nFile: src/FighterFarm.sol\n\n/// @audit The 'generation' array is incremented for the specified 'fighterType' in 'incrementGeneration()' before certain assignments.\n131: generation[fighterType] += 1;\n\n/// @audit The 'maxRerollsAllowed' array is incremented for the specified 'fighterType' in 'incrementGeneration()' before certain assignments.\n132: maxRerollsAllowed[fighterType] += 1;\n\n/// @audit The 'nftsClaimed' mapping is updated for the current sender address in 'claimFighters()' before certain assignments.\n209: nftsClaimed[msg.sender][0] += numToMint[0];\n\n/// @audit The 'nftsClaimed' mapping is updated for the current sender address in 'claimFighters()' before certain assignments.\n210: nftsClaimed[msg.sender][1] += numToMint[1];\n\n/// @audit The 'numTrained' mapping is updated for the specified 'tokenId' in 'updateModel()' before certain assignments.\n293: numTrained[tokenId] += 1;\n\n/// @audit The 'totalNumTrained' variable is incremented in 'updateModel()' before certain assignments.\n294: totalNumTrained += 1;", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "AiArenaHelper.sol#L179, FighterFarm.sol#L131", "github_files_list": "AiArenaHelper.sol, FighterFarm.sol", "github_refs_count": 2, "vulnerable_code_actual": "File: src/AiArenaHelper.sol\n\n/// @audit The cumulative probability is updated within a loop, following the check-effects-interaction pattern.\n179: cumProb += attrProbabilities[i];", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: src/FighterFarm.sol\n\n/// @audit The 'generation' array is incremented for the specified 'fighterType' in 'incrementGeneration()' before certain assignments.\n131: generation[fighterType] += 1;\n\n/// @audit The 'maxRerollsAllowed' array is incremented for the specified 'fighterType' in 'incrementGeneration()' before certain assignments.\n132: maxRerollsAllowed[fighterType] += 1;\n\n/// @audit The 'nftsClaimed' mapping is updated for the current sender address in 'claimFighters()' before certain assignments.\n209: nftsClaimed[msg.sender][0] += numToMint[0];\n\n/// @audit The 'nftsClaimed' mapping is updated for the current sender address in 'claimFighters()' before certain assignments.\n210: nftsClaimed[msg.sender][1] += numToMint[1];\n\n/// @audit The 'numTrained' mapping is updated for the specified 'tokenId' in 'updateModel()' before certain assignments.\n293: numTrained[tokenId] += 1;\n\n/// @audit The 'totalNumTrained' variable is incremented in 'updateModel()' before certain assignments.\n294: totalNumTrained += 1;\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "06-lybra", "title": "mgf15 Q", "severity_raw": "Critical", "severity": "critical", "description": "## Summary\nLow Issues , Non Critical\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [Low-1](#Low-1) | Unsafe ERC20 operation(s) | 32 |\n| [Low-2](#Low-2) | The `owner` is a single point of failure and a centralization risk | 16 |\n| [Low-4](#Low-4) | Void constructor | 2 |\n| [Low-5](#Low-5) | `Keccak` Constant values should used to `immutable` rather than `constant` | 7 |\n| [Low-6](#Low-6) | Unbounded loop | 3 |\n| [Low-8](#Low-8) | Use `safetransfer` Instead Of `transfer` | 20 |\n| [Low-9](#Low-9) | Use `_safeMint` instead of `_mint` | 7 |\n| [Low-10](#Low-10) | Division before multiplication causing significant loss of precision | 6 |\n| [Low-11](#Low-11) | Use Ownable2Step's transfer function rather than Ownable's for transfers of ownership | 4 |\n| [Low-12](#Low-12) | UNSAFE `decimals()` CALL FOR ASSET TOKENS THAT DO NOT IMPLEMENT `decimals()` | 2 |\n| [Low-13](#Low-13) | Minting tokens to the zero address should be avoided | 19 |\n| [Low-14](#Low-14) | Functions return bool true but cannot return false | 12 |\n| [Low-15](#Low-15) | PREVENT DIV BY 0 | 25 |\n| [Low-16](#Low-16) | AVOID TRANSFER()/SEND() AS REENTRANCY MITIGATIONS | 20 |\n| [Low-17](#Low-17) | Use `safeERC20.safeApprove()` instead of `approve()` | 2 |\n| [Low-18](#Low-18) | Use of immutable variables | 1 |\n\n\n\n### **[Low-1]** Unsafe ERC20 operation(s)\n\nERC20 operations can be unsafe due to different implementations and vulnerabilities in the standard. It is therefore recommended to always either use OpenZeppelin's SafeERC20 library or at least to wrap each operation in a require statement.\n#### Proof Of Concept\n\n```solidity\nFile:2023-06-lybra/blob/main/contracts/lybra/pools/LybraWstETHVault.sol\n35: lido.approve(address(collateralAsset), msg.value);\n```\n\n#### Code Snippet\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/LybraWstETHVault.sol#L35\n```solidity\nFile:2023-06-lybra/blob/main/contracts/lybra/pools/LybraStETHVault.sol\n70: bool success = EUSD.transferFr", "vulnerable_code": "File:2023-06-lybra/blob/main/contracts/lybra/pools/LybraWstETHVault.sol\n35: lido.approve(address(collateralAsset), msg.value);", "fixed_code": "File:2023-06-lybra/blob/main/contracts/lybra/pools/LybraStETHVault.sol\n70: bool success = EUSD.transferFrom(msg.sender, address(configurator), income);\n85: bool success = EUSD.transferFrom(msg.sender, address(configurator), payAmount);\n93: collateralAsset.transfer(msg.sender, realAmount);", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/mgf15-Q.md", "collected_at": "2026-01-02T18:23:10.008245+00:00", "source_hash": "62822293b375228511a220d8dec166597b1fef60a85e03295917a6f5c9f35687", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 133, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File:2023-06-lybra/blob/main/contracts/lybra/pools/LybraWstETHVault.sol\n35: lido.approve(address(collateralAsset), msg.value);", "primary_code_language": "solidity", "primary_code_char_count": 133, "all_code_blocks": "// Code block 1 (solidity):\nFile:2023-06-lybra/blob/main/contracts/lybra/pools/LybraWstETHVault.sol\n35: lido.approve(address(collateralAsset), msg.value);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File:2023-06-lybra/blob/main/contracts/lybra/pools/LybraWstETHVault.sol\n35: lido.approve(address(collateralAsset), msg.value);", "github_refs_formatted": "LybraWstETHVault.sol#L35", "github_files_list": "LybraWstETHVault.sol", "github_refs_count": 1, "vulnerable_code_actual": "File:2023-06-lybra/blob/main/contracts/lybra/pools/LybraWstETHVault.sol\n35: lido.approve(address(collateralAsset), msg.value);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File:2023-06-lybra/blob/main/contracts/lybra/pools/LybraStETHVault.sol\n70: bool success = EUSD.transferFrom(msg.sender, address(configurator), income);\n85: bool success = EUSD.transferFrom(msg.sender, address(configurator), payAmount);\n93: collateralAsset.transfer(msg.sender, realAmount);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-asymmetry", "title": "BRONZEDISC Q", "severity_raw": "Medium", "severity": "medium", "description": "## QA\n---\n\n### Function Visibility [1]\n\n- Order of Functions: Ordering helps readers identify which functions they can call and to find the constructor and fallback definitions easier. Functions should be grouped according to their visibility and ordered: constructor, receive function (if exists), fallback function (if exists), public, external, internal, private. Within a grouping, place the view and pure functions last.\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol\n\n```solidity\n// receive function should come before all the other functions\n246: receive() external payable {}\n```\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol\n\n```solidity\n// public functions coming after external ones\n44: function name() public pure returns (string memory) {\n111: function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n122: function balance() public view returns (uint256) {\n\n// receive function should come before all the other functions\n126: receive() external payable {}\n```\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol\n\n```solidity\n// public functions coming after external ones\n50: function name() public pure returns (string memory) {\n211: function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n221: function balance() public view returns (uint256) {\n\n\n// external functions coming after private functions\n107: function withdraw(uint256 amount) external onlyOwner {\n156: function deposit() external payable onlyOwner returns (uint256) {\n\n\n// receive function should come before all the other functions\n244: receive() external payable {}\n```\n\n---\n\n### natSpec missing [2]\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol\n\n```solidity\n21: event ChangeMinAmount(uint256 indexed minAmount);\n22: event ChangeMaxAmount(uint256 indexed maxAmount", "vulnerable_code": "// receive function should come before all the other functions\n246: receive() external payable {}", "fixed_code": "// public functions coming after external ones\n44: function name() public pure returns (string memory) {\n111: function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n122: function balance() public view returns (uint256) {\n\n// receive function should come before all the other functions\n126: receive() external payable {}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/BRONZEDISC-Q.md", "collected_at": "2026-01-02T18:17:52.592376+00:00", "source_hash": "62aeead7e574bb4a41007971d0b5acd39765eefdc64d0cfef87290bbc82954d2", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 995, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "// receive function should come before all the other functions\n246: receive() external payable {}", "primary_code_language": "solidity", "primary_code_char_count": 100, "all_code_blocks": "// Code block 1 (solidity):\n// receive function should come before all the other functions\n246: receive() external payable {}\n\n// Code block 2 (solidity):\n// public functions coming after external ones\n44: function name() public pure returns (string memory) {\n111: function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n122: function balance() public view returns (uint256) {\n\n// receive function should come before all the other functions\n126: receive() external payable {}\n\n// Code block 3 (solidity):\n// public functions coming after external ones\n50: function name() public pure returns (string memory) {\n211: function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n221: function balance() public view returns (uint256) {\n\n\n// external functions coming after private functions\n107: function withdraw(uint256 amount) external onlyOwner {\n156: function deposit() external payable onlyOwner returns (uint256) {\n\n\n// receive function should come before all the other functions\n244: receive() external payable {}", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "// receive function should come before all the other functions\n246: receive() external payable {}\n\n// public functions coming after external ones\n44: function name() public pure returns (string memory) {\n111: function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n122: function balance() public view returns (uint256) {\n\n// receive function should come before all the other functions\n126: receive() external payable {}\n\n// public functions coming after external ones\n50: function name() public pure returns (string memory) {\n211: function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n221: function balance() public view returns (uint256) {\n\n\n// external functions coming after private functions\n107: function withdraw(uint256 amount) external onlyOwner {\n156: function deposit() external payable onlyOwner returns (uint256) {\n\n\n// receive function should come before all the other functions\n244: receive() external payable {}", "github_refs_formatted": "SafEth.sol, SfrxEth.sol, Reth.sol", "github_files_list": "SfrxEth.sol, Reth.sol, SafEth.sol", "github_refs_count": 3, "vulnerable_code_actual": "// receive function should come before all the other functions\n246: receive() external payable {}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "// public functions coming after external ones\n44: function name() public pure returns (string memory) {\n111: function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n122: function balance() public view returns (uint256) {\n\n// receive function should come before all the other functions\n126: receive() external payable {}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "01-biconomy", "title": "0x73696d616f Q", "severity_raw": "Low", "severity": "low", "description": "# [L-01] Ownership transferral should be implemented in 2 steps\n## SmartAccount.sol\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L109\n\n## Description\n\nThe function `setOwner(args...)` should be done in a 2 step process. \n\n```\n function setOwner(address _newOwner) external mixedAuth {\n require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n address oldOwner = owner;\n owner = _newOwner;\n emit EOAChanged(address(this), oldOwner, _newOwner);\n }\n```\n\n## Recommended Mitigation Steps\nImplement the 2 step process, something like this:\n```\n function setPendingOwner(address _newOwner) external mixedAuth {\n require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n pendingOwner = _newOwner;\n }\n\n function acceptOwnership() external {\n require(msg.sender == pendingOwner, \"not pending owner\");\n address oldOwner = owner;\n owner = pendingOwner;\n pendingOwner = address(0);\n emit EOAChanged(address(this), oldOwner, owner);\n }\n```\n\n# [N-01] SmartAccountCreated event not emitted when using deployWallet\n## SmartAccountFactory\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccountFactory.sol#L53\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccountFactory.sol#L33\n\n## Description\nThe event is missing in deployWallet\n\n```\n function deployWallet(address _owner, address _entryPoint, address _handler) public returns(address proxy){ \n bytes memory deploymentData = abi.encodePacked(type(Proxy).creationCode, uint(uint160(_defaultImpl)));\n // solhint-disable-next-line no-inline-assembly\n assembly {\n proxy := create(0x0, add(0x20, deploymentData), mload(deploymentData))\n }\n BaseSmartAccount(prox", "vulnerable_code": " function setOwner(address _newOwner) external mixedAuth {\n require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n address oldOwner = owner;\n owner = _newOwner;\n emit EOAChanged(address(this), oldOwner, _newOwner);\n }", "fixed_code": " function setPendingOwner(address _newOwner) external mixedAuth {\n require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n pendingOwner = _newOwner;\n }\n\n function acceptOwnership() external {\n require(msg.sender == pendingOwner, \"not pending owner\");\n address oldOwner = owner;\n owner = pendingOwner;\n pendingOwner = address(0);\n emit EOAChanged(address(this), oldOwner, owner);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/0x73696d616f-Q.md", "collected_at": "2026-01-02T18:12:45.858642+00:00", "source_hash": "62bb259027d1675a8e5e996ab1ac2b734aafe741df339252a9205cdb78d0477c", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 756, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function setOwner(address _newOwner) external mixedAuth {\n require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n address oldOwner = owner;\n owner = _newOwner;\n emit EOAChanged(address(this), oldOwner, _newOwner);\n }", "primary_code_language": "unknown", "primary_code_char_count": 283, "all_code_blocks": "// Code block 1 (unknown):\nfunction setOwner(address _newOwner) external mixedAuth {\n require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n address oldOwner = owner;\n owner = _newOwner;\n emit EOAChanged(address(this), oldOwner, _newOwner);\n }\n\n// Code block 2 (unknown):\nfunction setPendingOwner(address _newOwner) external mixedAuth {\n require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n pendingOwner = _newOwner;\n }\n\n function acceptOwnership() external {\n require(msg.sender == pendingOwner, \"not pending owner\");\n address oldOwner = owner;\n owner = pendingOwner;\n pendingOwner = address(0);\n emit EOAChanged(address(this), oldOwner, owner);\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SmartAccount.sol#L109, SmartAccountFactory.sol#L53, SmartAccountFactory.sol#L33", "github_files_list": "SmartAccount.sol, SmartAccountFactory.sol", "github_refs_count": 3, "vulnerable_code_actual": " function setOwner(address _newOwner) external mixedAuth {\n require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n address oldOwner = owner;\n owner = _newOwner;\n emit EOAChanged(address(this), oldOwner, _newOwner);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function setPendingOwner(address _newOwner) external mixedAuth {\n require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n pendingOwner = _newOwner;\n }\n\n function acceptOwnership() external {\n require(msg.sender == pendingOwner, \"not pending owner\");\n address oldOwner = owner;\n owner = pendingOwner;\n pendingOwner = address(0);\n emit EOAChanged(address(this), oldOwner, owner);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "02-ai-arena", "title": "AlexCzm Q", "severity_raw": "Medium", "severity": "medium", "description": "### L-01 `attributeProbabilities` are set twice in AiArenaHelper constructor;\nRemove `addAttributeProbabilities()` [function call](https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/AiArenaHelper.sol#L45) from `AiArenaHelper` constructor. \n\n```solidity\n constructor(uint8[][] memory probabilities) {\n _ownerAddress = msg.sender;\n\n // Initialize the probabilities for each attribute\n addAttributeProbabilities(0, probabilities);// @audit-qa remove this function call\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n attributeProbabilities[0][attributes[i]] = probabilities[i];// because you are setting attr prob here\n attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n }\n } \n```\n\n### L-02 `MINTER_ROLE` can mint back any burned NRN. \nNeuron contract [expose](https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/Neuron.sol#L163-L165) externally the `burn` function, allowing any NRN holder to destroy tokens they hold. The maximum total supply should be decreased by the amount of burned tokens. \nAdditionally, in `mint` function use `<=` instead `<` to better reflect what `MAX_SUPPLY` means. \n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/Neuron.sol#L156\n\n### L-03 Once staked, a fighter is considered staked even if its `amountStaked` balance == 0. \nTo allow transferring a previously staked fighter, a player must call `unstakeNRN` even if `amountStaked` for that fighter is 0. \nConsider improving the player UX and read the `stakedBalance` directly. \n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/RankedBattle.sol#L286\n\n### L-04 Create an Enum with all possible battle results\nCurrently magic numbers 0, 1, and 2 are used as battle results. \nConsider creating and u", "vulnerable_code": " constructor(uint8[][] memory probabilities) {\n _ownerAddress = msg.sender;\n\n // Initialize the probabilities for each attribute\n addAttributeProbabilities(0, probabilities);// @audit-qa remove this function call\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n attributeProbabilities[0][attributes[i]] = probabilities[i];// because you are setting attr prob here\n attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n }\n } ", "fixed_code": " enum battleResult {\n invalidResult,\n won,\n tie,\n lost\n }\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/RankedBattle.sol#L440\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/RankedBattle.sol#L505-L513\n\n### L-05 Allows only voltage spender to consume energy\nCurrently any addresses can call `spendVoltage` to reduce its energy. \nEven if unlikely, this can open the door for abuses. Consider keeping only selected addresses to spend voltage ", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/AlexCzm-Q.md", "collected_at": "2026-01-02T19:02:13.835090+00:00", "source_hash": "62c9a0359e9025b8448db15331c5e4a2f39c34a44e30d52f2ae86298c799dae4", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 551, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "constructor(uint8[][] memory probabilities) {\n _ownerAddress = msg.sender;\n\n // Initialize the probabilities for each attribute\n addAttributeProbabilities(0, probabilities);// @audit-qa remove this function call\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n attributeProbabilities[0][attributes[i]] = probabilities[i];// because you are setting attr prob here\n attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n }\n }", "primary_code_language": "solidity", "primary_code_char_count": 551, "all_code_blocks": "// Code block 1 (solidity):\nconstructor(uint8[][] memory probabilities) {\n _ownerAddress = msg.sender;\n\n // Initialize the probabilities for each attribute\n addAttributeProbabilities(0, probabilities);// @audit-qa remove this function call\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n attributeProbabilities[0][attributes[i]] = probabilities[i];// because you are setting attr prob here\n attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n }\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "constructor(uint8[][] memory probabilities) {\n _ownerAddress = msg.sender;\n\n // Initialize the probabilities for each attribute\n addAttributeProbabilities(0, probabilities);// @audit-qa remove this function call\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n attributeProbabilities[0][attributes[i]] = probabilities[i];// because you are setting attr prob here\n attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n }\n }", "github_refs_formatted": "AiArenaHelper.sol#L45, Neuron.sol#L163-L165, Neuron.sol#L156, RankedBattle.sol#L286, RankedBattle.sol#L440, RankedBattle.sol#L505-L513", "github_files_list": "Neuron.sol, AiArenaHelper.sol, RankedBattle.sol", "github_refs_count": 6, "vulnerable_code_actual": " constructor(uint8[][] memory probabilities) {\n _ownerAddress = msg.sender;\n\n // Initialize the probabilities for each attribute\n addAttributeProbabilities(0, probabilities);// @audit-qa remove this function call\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n attributeProbabilities[0][attributes[i]] = probabilities[i];// because you are setting attr prob here\n attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n }\n } ", "has_vulnerable_code_snippet": true, "fixed_code_actual": " enum battleResult {\n invalidResult,\n won,\n tie,\n lost\n }\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/RankedBattle.sol#L440\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/RankedBattle.sol#L505-L513\n\n### L-05 Allows only voltage spender to consume energy\nCurrently any addresses can call `spendVoltage` to reduce its energy. \nEven if unlikely, this can open the door for abuses. Consider keeping only selected addresses to spend voltage ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "10-badger", "title": "JCK G", "severity_raw": "Medium", "severity": "medium", "description": "## Gas Optimizations\n\n| Number | Issue | Instances | Total gas saved |\n|--------|-------|-----------|-----------------|\n|[G-01]| Pack structs by putting data types that can fit together next to each other | 8 | 16000 |\n|[G-02]| Possible Optimization 1 | 8 | |\n|[G-03]| Possible Optimization 2 | 3 | |\n|[G-04]| Possible Optimizations in ARCDVestingVault. | 3 | |\n|[G-05]| Possible Optimizations | 1 | |\n|[G-06]| Possible Optimization in ActivePool.sol | 2 | |\n|[G-07]| Possible Optimization in accept() function | 1 | |\n|[G-08]| Possible Optimizations | 12 | |\n|[G-09]| Don\u2019t cache calls that are only used once | 1 | |\n|[G-10]| public functions not called by the contract should be declared external instead | 26 | |\n|[G-11]| Do not calculate constants | 8 | |\n|[G-12]| State variables which are not modified within functions should be set as constant or immutable for values set at deployment | 11 | 110000 |\n|[G-13]| Use assembly in place of abi.decode to extract calldata values more efficiently | 4 | |\n|[G-14]| Use assembly to emit an event | 88 | 3344 |\n|[G-15]| Use hardcoded address instead of address(this) | 25 | |\n|[G-16]| Use assembly to write address storage values | 6 | 444 |\n|[G-17]| Use uint256(1)/uint256(2) instead for true and false boolean states | 22 | 376200 |\n|[G-18]| Use assembly to validate msg.sender | 19 | 228 |\n|[G-19]| Use assembly for loops | 8 | |\n|[G-20]| abi.encode() is less efficient than abi.encodepacked() | 4 | |\n|[G-21]| Using delete statement can save gas | 3 | |\n|[G-22]| Use nested if/require statements instead of && | 19 | 570 |\n|[G-23]| Counting down in for statements is more gas efficient | 13 | |\n|[G-24]| Create immutable variable to avoid an external call | 3 | |\n|[G-25]| Avoid Unnecessary Public Variables | 14 | 308000 |\n\n\n## [G-01] Pack structs by putting data types that can fit together next to each other\n\nAs the solidity EVM works with 32 bytes, ", "vulnerable_code": "file: main/packages/contracts/contracts/BorrowerOperations.sol\n\n97 struct MoveTokensParams {\n address user;\n uint256 collSharesChange;\n uint256 collAddUnderlying; // ONLY for isCollIncrease=true\n bool isCollIncrease;\n uint256 netDebtChange;\n bool isDebtIncrease;\n }\n", "fixed_code": "file: main/packages/contracts/contracts/LeverageMacroBase.sol\n\n268 struct SwapOperation {\n // Swap Data\n address tokenForSwap;\n address addressForApprove;\n uint256 exactApproveAmount;\n address addressForSwap;\n bytes calldataForSwap;\n SwapCheck[] swapChecks; // Empty to skip\n }\n\n322 struct AdjustCdpOperation {\n bytes32 _cdpId;\n uint256 _stEthBalanceDecrease;\n uint256 _EBTCChange;\n bool _isDebtIncrease;\n bytes32 _upperHint;\n bytes32 _lowerHint;\n uint256 _stEthBalanceIncrease;\n }\n\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/JCK-G.md", "collected_at": "2026-01-02T18:26:32.316425+00:00", "source_hash": "62fba8d8022a547133e71f3a12e8bc23fdf91013f4c90a4b3861d07297de1fc3", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "file: main/packages/contracts/contracts/BorrowerOperations.sol\n\n97 struct MoveTokensParams {\n address user;\n uint256 collSharesChange;\n uint256 collAddUnderlying; // ONLY for isCollIncrease=true\n bool isCollIncrease;\n uint256 netDebtChange;\n bool isDebtIncrease;\n }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "file: main/packages/contracts/contracts/LeverageMacroBase.sol\n\n268 struct SwapOperation {\n // Swap Data\n address tokenForSwap;\n address addressForApprove;\n uint256 exactApproveAmount;\n address addressForSwap;\n bytes calldataForSwap;\n SwapCheck[] swapChecks; // Empty to skip\n }\n\n322 struct AdjustCdpOperation {\n bytes32 _cdpId;\n uint256 _stEthBalanceDecrease;\n uint256 _EBTCChange;\n bool _isDebtIncrease;\n bytes32 _upperHint;\n bytes32 _lowerHint;\n uint256 _stEthBalanceIncrease;\n }\n\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "04-caviar", "title": "bshramin G", "severity_raw": "High", "severity": "high", "description": "# GR1 - Fail fast(I)\nIn the eth router contract we should change this check:\n```solidity\nif (block.timestamp > deadline && deadline != 0) {\n revert DeadlinePassed();\n}\n```\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L101\n\nto this:\n```solidity\nif (deadline != 0 && block.timestamp > deadline) {\n revert DeadlinePassed();\n}\n```\n\nWith this change we will consume the same amount of gas if the deadline is set but we will consume less gas if the deadline is equal to zero.\n\n\n# GR3 - Fail fast(II)\nIn the `buy` function of the private pool contract, we should move this check to the beginning of the function.\n```solidity\nif (baseToken != address(0) && msg.value > 0) revert InvalidEthAmount();\n```\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L225\n\n\n# GR2 - Fail fast(III)\nThere is a check in the `Initialize` function:\n```solidity\nif (_feeRate > 5_000) revert FeeRateTooHigh();\n```\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L172\n\nThis can be moved to the beginning of the `create` function in the `Factory` contract.\nThis way we will prevent spending a lot of gas for cloning the contract and calling initialize when the check fails.\n\n", "vulnerable_code": "if (block.timestamp > deadline && deadline != 0) {\n revert DeadlinePassed();\n}", "fixed_code": "if (deadline != 0 && block.timestamp > deadline) {\n revert DeadlinePassed();\n}", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/bshramin-G.md", "collected_at": "2026-01-02T18:20:18.700448+00:00", "source_hash": "63436c05ae07ffc3a6c93a48c08e5db269e4aac7296d4c4bea098a4e51f4727d", "code_block_count": 4, "solidity_block_count": 4, "total_code_chars": 280, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "if (block.timestamp > deadline && deadline != 0) {\n revert DeadlinePassed();\n}", "primary_code_language": "solidity", "primary_code_char_count": 81, "all_code_blocks": "// Code block 1 (solidity):\nif (block.timestamp > deadline && deadline != 0) {\n revert DeadlinePassed();\n}\n\n// Code block 2 (solidity):\nif (deadline != 0 && block.timestamp > deadline) {\n revert DeadlinePassed();\n}\n\n// Code block 3 (solidity):\nif (baseToken != address(0) && msg.value > 0) revert InvalidEthAmount();\n\n// Code block 4 (solidity):\nif (_feeRate > 5_000) revert FeeRateTooHigh();", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "if (block.timestamp > deadline && deadline != 0) {\n revert DeadlinePassed();\n}\n\nif (deadline != 0 && block.timestamp > deadline) {\n revert DeadlinePassed();\n}\n\nif (baseToken != address(0) && msg.value > 0) revert InvalidEthAmount();\n\nif (_feeRate > 5_000) revert FeeRateTooHigh();", "github_refs_formatted": "EthRouter.sol#L101, PrivatePool.sol#L225, PrivatePool.sol#L172", "github_files_list": "EthRouter.sol, PrivatePool.sol", "github_refs_count": 3, "vulnerable_code_actual": "if (block.timestamp > deadline && deadline != 0) {\n revert DeadlinePassed();\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "if (deadline != 0 && block.timestamp > deadline) {\n revert DeadlinePassed();\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9.46} {"source": "c4", "protocol": "01-biconomy", "title": "0xhacksmithh G", "severity_raw": "High", "severity": "high", "description": "### [Gas-01] Should Use ```require()``` Instead of ```assert()```\nwhen assert() executed, it revert all state variable change and consume all remaining gas\nwhen require() executed, it reverts all state variable change and return all remaining gas to caller\n\nFrom gas saving perspective its recommended to use require() instead of assert()\n\n*Instances(2)*\n```solidity\nFile: Proxy.sol\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/Proxy.sol#L16\n```\n```solidity\nFile: common/Singleton.sol\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/common/Singleton.sol#L13\n```\n\n### [Gas-02] ```onlyOwner``` functions could make as ```payable```\n*Instances(10)*\n```solidity\nFile: SmartAccount.sol\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L449-L453\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L455-L458\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L460-L463\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L465-L473\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L536-L538\n```\n```solidity\nFile: paymasters/BasePaymaster.sol\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L67\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L75\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L90\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract", "vulnerable_code": "when assert() executed, it revert all state variable change and consume all remaining gas\nwhen require() executed, it reverts all state variable change and return all remaining gas to caller\n\nFrom gas saving perspective its recommended to use require() instead of assert()\n\n*Instances(2)*", "fixed_code": "```solidity\nFile: common/Singleton.sol\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/common/Singleton.sol#L13", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/0xhacksmithh-G.md", "collected_at": "2026-01-02T18:12:50.403351+00:00", "source_hash": "63bbe82bcfed8e009b8b16fafd5a0af0794d28a4349e157eb4699f280a2c9f9e", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 315, "github_ref_count": 10, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "when assert() executed, it revert all state variable change and consume all remaining gas\nwhen require() executed, it reverts all state variable change and return all remaining gas to caller\n\nFrom gas saving perspective its recommended to use require() instead of assert()\n\n*Instances(2)*", "primary_code_language": "unknown", "primary_code_char_count": 288, "all_code_blocks": "// Code block 1 (unknown):\nwhen assert() executed, it revert all state variable change and consume all remaining gas\nwhen require() executed, it reverts all state variable change and return all remaining gas to caller\n\nFrom gas saving perspective its recommended to use require() instead of assert()\n\n*Instances(2)*\n\n// Code block 2 (unknown):\n### [Gas-02]\n\n// Code block 3 (unknown):\n*Instances(10)*", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Proxy.sol#L16, Singleton.sol#L13, SmartAccount.sol#L449-L453, SmartAccount.sol#L455-L458, SmartAccount.sol#L460-L463, SmartAccount.sol#L465-L473, SmartAccount.sol#L536-L538, BasePaymaster.sol#L67, BasePaymaster.sol#L75, BasePaymaster.sol#L90", "github_files_list": "SmartAccount.sol, Proxy.sol, BasePaymaster.sol, Singleton.sol", "github_refs_count": 10, "vulnerable_code_actual": "when assert() executed, it revert all state variable change and consume all remaining gas\nwhen require() executed, it reverts all state variable change and return all remaining gas to caller\n\nFrom gas saving perspective its recommended to use require() instead of assert()\n\n*Instances(2)*", "has_vulnerable_code_snippet": true, "fixed_code_actual": "```solidity\nFile: common/Singleton.sol\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/common/Singleton.sol#L13", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "02-ethos", "title": "dec3ntraliz3d Q", "severity_raw": "Low", "severity": "low", "description": "## QA Report\n\n## N-01\n\nRemove unnecessary type casting in the constructor parameters of ReaperVaultV2.sol\n\n## Summary\n\nIn ReaperVaultV2.sol, the constructor takes several input parameters, including _name and _symbol, which are of type string. In the current implementation, these parameters are being unnecessarily cast to string in the constructor declaration, which has no effect on the code's functionality and readability.\n\nTherefore, it is recommended to remove the unnecessary type casting in the constructor parameters of ReaperVaultV2.sol. \n\n[Link to the code on Github](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Vault/contracts/ReaperVaultV2.sol#L111-L119)\n\nAfter making this change, the constructor should look like this:\n\n```solidity\nconstructor(\n address _token,\n string memory _name,\n string memory _symbol,\n uint256 _tvlCap,\n address _treasury,\n address[] memory _strategists,\n address[] memory _multisigRoles\n) ERC20(_name, _symbol) {\n // rest of the constructor code\n}\n\n```\n\n## N-02\n\nUse the `emit` keyword for events to improve code clarity.\n\n## Summary\n\nIn older versions of Solidity, it was not mandatory to use the `emit` keyword when triggering events. However, this has changed in newer versions of Solidity, and it is now required. We recommend using the `emit` keyword in the following functions.\n\n[Link to the code on Github](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/ActivePool.sol#L190-L202)\n\nCurrent `increaseLUSDDebt` function:\n```\n function increaseLUSDDebt(address _collateral, uint _amount) external override {\n _requireValidCollateralAddress(_collateral);\n _requireCallerIsBOorTroveM();\n LUSDDebt[_collateral] = LUSDDebt[_collateral].add(_amount);\n ActivePoolLUSDDebtUpdated(_collateral, LUSDDebt[_collateral]);\n }\n```\nchange to :\n```solidity\n function increaseLUSDDebt(address _col", "vulnerable_code": "constructor(\n address _token,\n string memory _name,\n string memory _symbol,\n uint256 _tvlCap,\n address _treasury,\n address[] memory _strategists,\n address[] memory _multisigRoles\n) ERC20(_name, _symbol) {\n // rest of the constructor code\n}\n", "fixed_code": " function increaseLUSDDebt(address _collateral, uint _amount) external override {\n _requireValidCollateralAddress(_collateral);\n _requireCallerIsBOorTroveM();\n LUSDDebt[_collateral] = LUSDDebt[_collateral].add(_amount);\n ActivePoolLUSDDebtUpdated(_collateral, LUSDDebt[_collateral]);\n }", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/dec3ntraliz3d-Q.md", "collected_at": "2026-01-02T18:17:04.209433+00:00", "source_hash": "63fe600f52ec850168b8224a84221587550951e80021e230bb11816c32d48b19", "code_block_count": 2, "solidity_block_count": 1, "total_code_chars": 579, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "constructor(\n address _token,\n string memory _name,\n string memory _symbol,\n uint256 _tvlCap,\n address _treasury,\n address[] memory _strategists,\n address[] memory _multisigRoles\n) ERC20(_name, _symbol) {\n // rest of the constructor code\n}", "primary_code_language": "solidity", "primary_code_char_count": 263, "all_code_blocks": "// Code block 1 (solidity):\nconstructor(\n address _token,\n string memory _name,\n string memory _symbol,\n uint256 _tvlCap,\n address _treasury,\n address[] memory _strategists,\n address[] memory _multisigRoles\n) ERC20(_name, _symbol) {\n // rest of the constructor code\n}\n\n// Code block 2 (unknown):\nfunction increaseLUSDDebt(address _collateral, uint _amount) external override {\n _requireValidCollateralAddress(_collateral);\n _requireCallerIsBOorTroveM();\n LUSDDebt[_collateral] = LUSDDebt[_collateral].add(_amount);\n ActivePoolLUSDDebtUpdated(_collateral, LUSDDebt[_collateral]);\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "constructor(\n address _token,\n string memory _name,\n string memory _symbol,\n uint256 _tvlCap,\n address _treasury,\n address[] memory _strategists,\n address[] memory _multisigRoles\n) ERC20(_name, _symbol) {\n // rest of the constructor code\n}", "github_refs_formatted": "ReaperVaultV2.sol#L111-L119, ActivePool.sol#L190-L202", "github_files_list": "ReaperVaultV2.sol, ActivePool.sol", "github_refs_count": 2, "vulnerable_code_actual": "constructor(\n address _token,\n string memory _name,\n string memory _symbol,\n uint256 _tvlCap,\n address _treasury,\n address[] memory _strategists,\n address[] memory _multisigRoles\n) ERC20(_name, _symbol) {\n // rest of the constructor code\n}\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function increaseLUSDDebt(address _collateral, uint _amount) external override {\n _requireValidCollateralAddress(_collateral);\n _requireCallerIsBOorTroveM();\n LUSDDebt[_collateral] = LUSDDebt[_collateral].add(_amount);\n ActivePoolLUSDDebtUpdated(_collateral, LUSDDebt[_collateral]);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "05-ajna", "title": "petrichor G", "severity_raw": "Medium", "severity": "medium", "description": "# Summary\n\n## Gas Optimization\n\n| No | Issue | Instances |\n|------- | ------- | ------- |\n| [G-01] | Structs can be packed into fewer storage slots | 1 | - |\n| [G-02] | Use hardcode address instead address(this) | 4 | - |\n| [G-03] | Do not calculate constants | 4 | - |\n| [G-04] | Use bitmaps to save gas| 4 | - |\n| [G-05] | Using delete statement can save gas| 1 | - |\n| [G-06] | A modifier used only once and not being inherited should be inlined to save gas| 1 | - |\n| [G-07] | Access mappings directly rather than using accessor functions | 4 | - |\n| [G-08] | Use double if statements instead of && | 4 | - |\n| [G-09] | Make 3 event parameters indexed when possible | 2 | - |\n| [G-10] | public\u00a0functions to\u00a0external | 1 | - |\n| [G-11] | >=\u00a0costs less gas than\u00a0> | 3 | - |\n| [G-12] | It costs more gas to initialize non-constant/non-immutable variables to zero than to let the default of zero be applied | 22 | -|\n| [G-13] | abi.encode() is less efficient than abi.encodePacked()| 5 | - |\n| [G-14] | Use\u00a0!= 0\u00a0instead of\u00a0> 0\u00a0for unsigned integer comparison | 1 | - |\n| [G-15] | Use assembly to check for address(0)| 1 | - |\n| [G-16] | Use constants instead of type(uintx).max | 1 | - |\n| [G-17] | Usage of \"UINTS\", \"INTS\" smaller than 32 Bytes (256 bits)\u00a0results in Increased Gas Consumption.| 4 | - |\n| [G-18] | Multiple accesses of a mapping/array should use a local variable cache| 9 | - |\n| [G-19] | internal functions only called once can be inlined to save gas | 11 | - |\n| [G-20] | Multiple Address/id Mappings Can Be Combined Into A Single Mapping Of An Address/id To A Struct, Where Appropriate | 8 | - |\n| [G-21] | Avoid contract existence checks by using low level calls| 1 | - |\n| [G-22] | Use a more recent version of solidity | 1 | - |\n| [G-23] | Use Modifiers Instead of Functions To Save Gas| 6 | - |\n| [G-24] | State variables should be cached in stack variables rather than re-reading them from storage| 10 | - |\n| [G-25] | Using storage instead of mem", "vulnerable_code": "110 struct QuarterlyDistribution {\n uint24 id;\n uint48 startBlock;\n uint48 endBlock;\n uint128 fundsAvailable;\n uint256 fundingVotePowerCast;\n bytes32 fundedSlateHash;\n }", "fixed_code": "File: /ajna-core/src/RewardsManager.sol\n250 IERC721(address(positionManager)).transferFrom(msg.sender, address(this), tokenId_);\n## [G-4] Use bitmaps to save gas\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/petrichor-G.md", "collected_at": "2026-01-02T18:21:43.050148+00:00", "source_hash": "6417b0021a80adc83d15dce7184ddef7aaa5f0df1eac4ac8332022050ee45be1", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "110 struct QuarterlyDistribution {\n uint24 id;\n uint48 startBlock;\n uint48 endBlock;\n uint128 fundsAvailable;\n uint256 fundingVotePowerCast;\n bytes32 fundedSlateHash;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: /ajna-core/src/RewardsManager.sol\n250 IERC721(address(positionManager)).transferFrom(msg.sender, address(this), tokenId_);\n## [G-4] Use bitmaps to save gas\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "04-caviar", "title": "Brenzee Q", "severity_raw": "Critical", "severity": "critical", "description": "# Summary\n\n## Low Risk issues\n\n| | Issue | Instances |\n| ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | --------- |\n| [L-01](#l-01-privatepooldeposit-function-can-be-used-by-anyone-but-only-owner-can-withdraw-the-funds) | `PrivatePool.deposit` function can be used by anyone, but only owner can withdraw the funds | 1 |\n| [L-02](#l-02-array-lengths-are-not-compared-to-each-other) | Array lengths are not compared to each other | 4 |\n| [L-03](#l-03-basetoken-with-3-or-less-decimals-will-make-privatepoolchange-unusable) | ERC20 tokens with 3 or less decimals will make `PrivatePool.change` | 1 |\n| [L-04](#l-04-wrong-nft-address-can-be-passed-in-some-of-ethrouter-functions) | Wrong `nft` address can be passed in some of `EthRouter` functions | 4 |\n| [L-05](#l-05-changefee-cannot-be-updated-after-initalizing-privatepool) | `changeFee` cannot updated be after initalizing `PrivatePool` | 1 |\n| [L-06](#l-06-privatepoolflashfee-returns-changefee-value) | `PrivatePool.flashFee` returns `changeFee` value | 1 |\n| [L-07](#l-07-zero-values-are-not-checked) | Zero values are not checked | 7 |\n| [L-08](#l-08-privatepoolbuy-and-privatepoolsell-functions-a", "vulnerable_code": " function deposit(uint256[] calldata tokenIds, uint256 baseTokenAmount) public payable onlyOwner", "fixed_code": " function sumWeightsAndValidateProof(\n uint256[] memory tokenIds,\n uint256[] memory tokenWeights,\n MerkleMultiProof memory proof\n ) public view returns (uint256) {\n require(inputTokenIds.length == inputTokenWeights.length, \"Arrays are not equal length\");\n\n\n // if the merkle root is not set then set the weight of each nft to be 1e18\n if (merkleRoot == bytes32(0)) {\n return tokenIds.length * 1e18;\n }\n\n uint256 sum;\n bytes32[] memory leafs = new bytes32[](tokenIds.length);\n for (uint256 i = 0; i < tokenIds.length; i++) {\n // create the leaf for the merkle proof\n leafs[i] = keccak256(bytes.concat(keccak256(abi.encode(tokenIds[i], tokenWeights[i]))));\n\n // sum each token weight\n sum += tokenWeights[i];\n }\n\n // validate that the weights are valid against the merkle proof\n if (!MerkleProofLib.verifyMultiProof(proof.proof, merkleRoot, leafs, proof.flags)) {\n revert InvalidMerkleProof();\n }\n\n return sum;\n }\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/Brenzee-Q.md", "collected_at": "2026-01-02T18:19:33.861282+00:00", "source_hash": "64236b2e1c1c7a7f8d1a7a98da1b9ff3d1d690d42f0db57a6227430c762922ff", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function deposit(uint256[] calldata tokenIds, uint256 baseTokenAmount) public payable onlyOwner", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function sumWeightsAndValidateProof(\n uint256[] memory tokenIds,\n uint256[] memory tokenWeights,\n MerkleMultiProof memory proof\n ) public view returns (uint256) {\n require(inputTokenIds.length == inputTokenWeights.length, \"Arrays are not equal length\");\n\n\n // if the merkle root is not set then set the weight of each nft to be 1e18\n if (merkleRoot == bytes32(0)) {\n return tokenIds.length * 1e18;\n }\n\n uint256 sum;\n bytes32[] memory leafs = new bytes32[](tokenIds.length);\n for (uint256 i = 0; i < tokenIds.length; i++) {\n // create the leaf for the merkle proof\n leafs[i] = keccak256(bytes.concat(keccak256(abi.encode(tokenIds[i], tokenWeights[i]))));\n\n // sum each token weight\n sum += tokenWeights[i];\n }\n\n // validate that the weights are valid against the merkle proof\n if (!MerkleProofLib.verifyMultiProof(proof.proof, merkleRoot, leafs, proof.flags)) {\n revert InvalidMerkleProof();\n }\n\n return sum;\n }\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-asymmetry", "title": "YY Q", "severity_raw": "Low", "severity": "low", "description": "# The calculation of derivativeAmount in unstake function which could potentially lead to an integer overflow, which can cause unexpected behavior and loss of funds.\n\n## Affected Code\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L108-L129\n\n```\nuint256 derivativeAmount = (derivatives[i].balance() * _safEthAmount) / safEthTotalSupply;\n```\n\n## Description and Impact\nThe multiplication of `derivatives[i].balance()` and _safEthAmount may result in a number that exceeds the maximum or minimum value.\n\nFor example, if the user wants to `unstake` 10 token, at this time, the `_safEthAmount` should be 10. \nIf the total supply of SAFETH is 1,000,000, then the line of code \n`uint256 derivativeAmount = (derivatives[i].balance() * _safEthAmount) / safEthTotalSupply;` would result in derivativeAmount being calculated as `derivatives[i].balance() * 10 / 1,000,000`.\n\nIf `derivatives[i].balance()` is very large, such as 2^256 - 1 (the maximum value of a uint256), then the multiplication may result in an integer overflow, and then the `derivativeAmount` to become 0.\n\n### Fix\nUse SafeMath Library\nhttps://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/math/SafeMath.sol", "vulnerable_code": "uint256 derivativeAmount = (derivatives[i].balance() * _safEthAmount) / safEthTotalSupply;", "fixed_code": "", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/YY-Q.md", "collected_at": "2026-01-02T18:18:40.949717+00:00", "source_hash": "6444de7df881122f447ad67abefe29d5e537b2e3adb39587b30c9eb0282607c6", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 90, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "uint256 derivativeAmount = (derivatives[i].balance() * _safEthAmount) / safEthTotalSupply;", "primary_code_language": "unknown", "primary_code_char_count": 90, "all_code_blocks": "// Code block 1 (unknown):\nuint256 derivativeAmount = (derivatives[i].balance() * _safEthAmount) / safEthTotalSupply;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol#L108-L129, SafeMath.sol", "github_files_list": "SafeMath.sol, SafEth.sol", "github_refs_count": 2, "vulnerable_code_actual": "uint256 derivativeAmount = (derivatives[i].balance() * _safEthAmount) / safEthTotalSupply;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5.47} {"source": "c4", "protocol": "04-caviar", "title": "Kaysoft G", "severity_raw": "Gas", "severity": "gas", "description": "## [GAS-01] x += y/x -= y costs more gas than x = x + y/x = x - y for state variables\n\nFiles: https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L230L231\n\n```\nvirtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n virtualNftReserves -= uint128(weightSum);\n```\n\n## [GAS-02] USE `assembly` to write address storage values\n\nfiles: https://github.com/code-423n4/2023-04-caviar/blob/main/src/Factory.sol#L129-L131\n\n```diff\nfunction setPrivatePoolMetadata(address _privatePoolMetadata) public onlyOwner {\n- privatePoolMetadata = _privatePoolMetadata; //@audit centeralization. use timelock.\n+ assembly{\n+ sstore(privateMetadata.slot, _privatePoolMetadata);\n+ }\n }\n\n```\n\n## [GAS-03] SET CONSTRUCTORS TO `payable` to save 13 gas each on deployment.\nSetting the constructor payable removes the initial check opcodes of msg.value == 0 and saves 13 gas on deployment without security risk.\n\nFiles: https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/Factory.sol#L53\n- https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L90\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L143\n\n", "vulnerable_code": "virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n virtualNftReserves -= uint128(weightSum);", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/Kaysoft-G.md", "collected_at": "2026-01-02T18:19:45.203274+00:00", "source_hash": "647046a55242fa29d2fae7c22ad67ef66e203592cc307b7b33580a9cd5502d4f", "code_block_count": 2, "solidity_block_count": 1, "total_code_chars": 382, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n virtualNftReserves -= uint128(weightSum);", "primary_code_language": "unknown", "primary_code_char_count": 134, "all_code_blocks": "// Code block 1 (unknown):\nvirtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n virtualNftReserves -= uint128(weightSum);\n\n// Code block 2 (diff):\nfunction setPrivatePoolMetadata(address _privatePoolMetadata) public onlyOwner {\n- privatePoolMetadata = _privatePoolMetadata; //@audit centeralization. use timelock.\n+ assembly{\n+ sstore(privateMetadata.slot, _privatePoolMetadata);\n+ }\n }", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "function setPrivatePoolMetadata(address _privatePoolMetadata) public onlyOwner {\n- privatePoolMetadata = _privatePoolMetadata; //@audit centeralization. use timelock.\n+ assembly{\n+ sstore(privateMetadata.slot, _privatePoolMetadata);\n+ }\n }", "solidity_code": "", "github_refs_formatted": "PrivatePool.sol#L230, Factory.sol#L129-L131, Factory.sol#L53, EthRouter.sol#L90, PrivatePool.sol#L143", "github_files_list": "EthRouter.sol, PrivatePool.sol, Factory.sol", "github_refs_count": 5, "vulnerable_code_actual": "virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n virtualNftReserves -= uint128(weightSum);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 8.53} {"source": "c4", "protocol": "05-ajna", "title": "ro1sharkm Q", "severity_raw": "Medium", "severity": "medium", "description": "## [QA-1] Misleading comments\nComments are meant to describe the intent of the code block. However, in multiple parts of the codebase, comments are not consistent with the code that is written or do not add any value to the reader. These are some examples:\n\nIn the contract `positionManager.sol` The comment associated with the positions mapping appears to be misleading.The comment suggests that the mapping maps a token ID to an ajna pool address, in reality, the mapping actually maps a token ID to another mapping that maps an asset ID to a Position struct.\n``` \n /// @dev Mapping of `token id => ajna pool address` for which token was minted.\n mapping(uint256 => mapping(uint256 => Position)) internal positions;\n```\n\nThe comment in the `memorisePosition` function of `positionManager.sol` states that the function will revert if the position token to burn has `liquidity LiquidityNotRemoved() `. However, the function does not implement such a revert and it is unclear what the intended behavior of the comment on the functionality.\n```\n * @dev === Revert on ===\n * @dev positions token to burn has liquidity `LiquidityNotRemoved()`\n```\n\nConsider correcting the comments to not mislead users or developers \n\n## [QA-2] Publicly Callable `memorializePositions()` Function Allows Unauthorized memorization of User Positions\n`memorializePositions()` function in `positionManager.sol` allows any caller to modify position information of any user. This is because the function does not include any ownership check on the provided TokenID.Any user can guess and update a position that they should not have access to. While the downside is that the user must know both the TokenID and position indexes, it is possible for a malicious user to guess the position index and the TokenID which is a predictable value.\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-core/src/PositionManager.sol#L170-L216\n\n", "vulnerable_code": " /// @dev Mapping of `token id => ajna pool address` for which token was minted.\n mapping(uint256 => mapping(uint256 => Position)) internal positions;", "fixed_code": " * @dev === Revert on ===\n * @dev positions token to burn has liquidity `LiquidityNotRemoved()`", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/ro1sharkm-Q.md", "collected_at": "2026-01-02T18:21:45.909923+00:00", "source_hash": "65038d83e734d626c65ca9a82bf8257e8062fd633fac8b9fb84930469c76597a", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 315, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "The comment in the `memorisePosition` function of `positionManager.sol` states that the function will revert if the position token to burn has `liquidity LiquidityNotRemoved() `. However, the function does not implement such a revert and it is unclear what the intended behavior of the comment on the functionality.", "primary_code_language": "unknown", "primary_code_char_count": 315, "all_code_blocks": "// Code block 1 (unknown):\nThe comment in the `memorisePosition` function of `positionManager.sol` states that the function will revert if the position token to burn has `liquidity LiquidityNotRemoved() `. However, the function does not implement such a revert and it is unclear what the intended behavior of the comment on the functionality.", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "PositionManager.sol#L170-L216", "github_files_list": "PositionManager.sol", "github_refs_count": 1, "vulnerable_code_actual": " /// @dev Mapping of `token id => ajna pool address` for which token was minted.\n mapping(uint256 => mapping(uint256 => Position)) internal positions;", "has_vulnerable_code_snippet": true, "fixed_code_actual": " * @dev === Revert on ===\n * @dev positions token to burn has liquidity `LiquidityNotRemoved()`", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-biconomy", "title": "oyc_109 Q", "severity_raw": "Critical", "severity": "critical", "description": "\n\n## [L-01] Use of Block.timestamp\n\nBlock timestamps have historically been used for a variety of applications, such as entropy for random numbers (see the Entropy Illusion for further details), locking funds for periods of time, and various state-changing conditional statements that are time-dependent. Miners have the ability to adjust timestamps slightly, which can prove to be dangerous if block timestamps are used incorrectly in smart contracts.\n\n```\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/BaseSmartAccount.sol::83 => * @return deadline the last block timestamp this operation is valid, or zero if it is valid indefinitely.\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/BaseSmartAccount.sol::84 => * Note that the validation code cannot use block.timestamp (or block.number) directly.\n```\n\n## [L-02] Unused receive()/fallback() function\n\nIf the intention is for the Ether to be used, the function should call another function, otherwise it should revert\n\n```\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::550 => receive() external payable {}\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::540 => receive() external payable {}\n```\n\n## [L-03] abi.encodePacked() should not be used with dynamic types when passing the result to a hash function such as keccak256()\n\nUse abi.encode() instead which will pad items to 32 bytes, which will prevent hash collisions (e.g. abi.encodePacked(0x123,0x456) => 0x123456 => abi.encodePacked(0x1,0x23456), but abi.encode(0x123,0x456) => 0x0...1230...456). Unless there is a compelling reason, abi.encode should be preferred. If there is only one argument to abi.encodePacked() it can often be cast to bytes() or bytes32() instead.\n\n```\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::347 => _signer = ecrecover(keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", dataHash)), v - 4, r, s);\n2023-01", "vulnerable_code": "2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/BaseSmartAccount.sol::83 => * @return deadline the last block timestamp this operation is valid, or zero if it is valid indefinitely.\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/BaseSmartAccount.sol::84 => * Note that the validation code cannot use block.timestamp (or block.number) directly.", "fixed_code": "2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::550 => receive() external payable {}\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::540 => receive() external payable {}", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/oyc_109-Q.md", "collected_at": "2026-01-02T18:13:59.347503+00:00", "source_hash": "651eb7ba3769ff2e7d58f8a6a0aeb7bf2f8b8c1e30ff2f356837ea0017560715", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 620, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/BaseSmartAccount.sol::83 => * @return deadline the last block timestamp this operation is valid, or zero if it is valid indefinitely.\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/BaseSmartAccount.sol::84 => * Note that the validation code cannot use block.timestamp (or block.number) directly.", "primary_code_language": "unknown", "primary_code_char_count": 379, "all_code_blocks": "// Code block 1 (unknown):\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/BaseSmartAccount.sol::83 => * @return deadline the last block timestamp this operation is valid, or zero if it is valid indefinitely.\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/BaseSmartAccount.sol::84 => * Note that the validation code cannot use block.timestamp (or block.number) directly.\n\n// Code block 2 (unknown):\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::550 => receive() external payable {}\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::540 => receive() external payable {}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/BaseSmartAccount.sol::83 => * @return deadline the last block timestamp this operation is valid, or zero if it is valid indefinitely.\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/BaseSmartAccount.sol::84 => * Note that the validation code cannot use block.timestamp (or block.number) directly.", "has_vulnerable_code_snippet": true, "fixed_code_actual": "2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::550 => receive() external payable {}\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::540 => receive() external payable {}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "09-ondo", "title": "Matin Q", "severity_raw": "High", "severity": "high", "description": "### Low-Risk Issues\n\n| | Issue | Instances |\n| --- | --- | --- |\n| [L\u201101] | `indexed` keyword for reference type variables such as `string` in events may lead to data loss. | 1 |\n\nTotal: 1 instance over 1 issue\n\nNote: The above tables were created, considering the automatic findings and thus, those are not included.\n\n---\n\n## Low-Risk Issues\n\n### [L\u201101] **`indexed` keyword for reference type variables such as `string` in events may lead to data loss**\n\nSummary:\n\nwhen the ```indexed``` keyword is used for reference typed variables such as string, it will return the hash of the mentioned string.\nThus, the event which is supposed to inform all of the applications subscribed to its emitting transaction (e.g. front-end of the DApp), would get a meaningless and obscure 32 bytes that correspond to keccak256 of an encoded string. For more information about the `indexed` events, one can [check here](https://docs.soliditylang.org/en/v0.8.17/abi-spec.html?highlight=indexed#events).\n\n*There are 2 instances of this issue:*\n\n```solidity\n event DestinationChainContractAddressSet(\n string indexed destinationChain,\n address contractAddress\n );\n```\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/SourceBridge.sol#L183C1-L186C5\n", "vulnerable_code": " event DestinationChainContractAddressSet(\n string indexed destinationChain,\n address contractAddress\n );", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/Matin-Q.md", "collected_at": "2026-01-02T18:25:35.835188+00:00", "source_hash": "65357fc2373bdec95b44d1919bd47d5cbb6aeaaf260c3946d7f865220e75bee0", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 111, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "event DestinationChainContractAddressSet(\n string indexed destinationChain,\n address contractAddress\n );", "primary_code_language": "solidity", "primary_code_char_count": 111, "all_code_blocks": "// Code block 1 (solidity):\nevent DestinationChainContractAddressSet(\n string indexed destinationChain,\n address contractAddress\n );", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "event DestinationChainContractAddressSet(\n string indexed destinationChain,\n address contractAddress\n );", "github_refs_formatted": "SourceBridge.sol#L183-L1", "github_files_list": "SourceBridge.sol", "github_refs_count": 1, "vulnerable_code_actual": " event DestinationChainContractAddressSet(\n string indexed destinationChain,\n address contractAddress\n );", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5.52} {"source": "c4", "protocol": "11-kelp", "title": "lsaudit Q", "severity_raw": "Medium", "severity": "medium", "description": "# [QA-01] `updatePriceFeedFor()` emits an event even when the priceFeed has not been changed\n\n[File: ChainlinkPriceOracle.sol](https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/oracles/ChainlinkPriceOracle.sol#L45-L49)\n```\n function updatePriceFeedFor(address asset, address priceFeed) external onlyLRTManager onlySupportedAsset(asset) {\n UtilLib.checkNonZeroAddress(priceFeed);\n assetPriceFeed[asset] = priceFeed;\n emit AssetPriceFeedUpdate(asset, priceFeed);\n }\n```\n\nFunction `updatePriceFeedFor()` does not verify if provided `priceFeed` is not already set in `assetPriceFeed[asset]`.\nIf `onlyLTRManager` provides `priceFeed` which was set before (`assetPriceFeed[asset] == priceFeed`), function will still emit an event.\nEmitting this event may be very misleading to the end user - thus he/she may think that the price was updated, even though, it wasn't.\n\n\n\nThe same issue occurs in `LRTOracle.sol`:\n\n[File: LRTOracle.sol](https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTOracle.sol#L88-L99)\n```\n function updatePriceOracleFor(\n address asset,\n address priceOracle\n )\n external\n onlyLRTManager\n onlySupportedAsset(asset)\n {\n UtilLib.checkNonZeroAddress(priceOracle);\n assetPriceOracle[asset] = priceOracle;\n emit AssetPriceOracleUpdate(asset, priceOracle);\n }\n```\n\nIt's a good practice to perform additional check which verifies if the value is really being updated:\n\n```\nif (assetPriceFeed[asset] == priceFeed) revert ValueAlreadyInUse();\n```\n\nYou can verify how it's done in `LRConfig.sol`. For example here:\n\n[File: LRTConfig.sol](https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTConfig.sol#L118)\n```\n if (assetStrategy[asset] == strategy) {\n revert ValueAlreadyInUse();\n }\n```\n\n\n\n# [QA-02] Override `renounceRole()` in `RSETH.sol`\n\n`RSETH` inherit", "vulnerable_code": " function updatePriceFeedFor(address asset, address priceFeed) external onlyLRTManager onlySupportedAsset(asset) {\n UtilLib.checkNonZeroAddress(priceFeed);\n assetPriceFeed[asset] = priceFeed;\n emit AssetPriceFeedUpdate(asset, priceFeed);\n }", "fixed_code": " function updatePriceOracleFor(\n address asset,\n address priceOracle\n )\n external\n onlyLRTManager\n onlySupportedAsset(asset)\n {\n UtilLib.checkNonZeroAddress(priceOracle);\n assetPriceOracle[asset] = priceOracle;\n emit AssetPriceOracleUpdate(asset, priceOracle);\n }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/lsaudit-Q.md", "collected_at": "2026-01-02T18:28:14.047449+00:00", "source_hash": "654cd56ea6fc2b3e62548a144e9aaba30ebe8c4fb6a9a25899e3a31d86115bc5", "code_block_count": 4, "solidity_block_count": 0, "total_code_chars": 742, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function updatePriceFeedFor(address asset, address priceFeed) external onlyLRTManager onlySupportedAsset(asset) {\n UtilLib.checkNonZeroAddress(priceFeed);\n assetPriceFeed[asset] = priceFeed;\n emit AssetPriceFeedUpdate(asset, priceFeed);\n }", "primary_code_language": "unknown", "primary_code_char_count": 263, "all_code_blocks": "// Code block 1 (unknown):\nfunction updatePriceFeedFor(address asset, address priceFeed) external onlyLRTManager onlySupportedAsset(asset) {\n UtilLib.checkNonZeroAddress(priceFeed);\n assetPriceFeed[asset] = priceFeed;\n emit AssetPriceFeedUpdate(asset, priceFeed);\n }\n\n// Code block 2 (unknown):\nfunction updatePriceOracleFor(\n address asset,\n address priceOracle\n )\n external\n onlyLRTManager\n onlySupportedAsset(asset)\n {\n UtilLib.checkNonZeroAddress(priceOracle);\n assetPriceOracle[asset] = priceOracle;\n emit AssetPriceOracleUpdate(asset, priceOracle);\n }\n\n// Code block 3 (unknown):\nif (assetPriceFeed[asset] == priceFeed) revert ValueAlreadyInUse();\n\n// Code block 4 (unknown):\nif (assetStrategy[asset] == strategy) {\n revert ValueAlreadyInUse();\n }", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ChainlinkPriceOracle.sol#L45-L49, LRTOracle.sol#L88-L99, LRTConfig.sol#L118", "github_files_list": "LRTConfig.sol, ChainlinkPriceOracle.sol, LRTOracle.sol", "github_refs_count": 3, "vulnerable_code_actual": " function updatePriceFeedFor(address asset, address priceFeed) external onlyLRTManager onlySupportedAsset(asset) {\n UtilLib.checkNonZeroAddress(priceFeed);\n assetPriceFeed[asset] = priceFeed;\n emit AssetPriceFeedUpdate(asset, priceFeed);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function updatePriceOracleFor(\n address asset,\n address priceOracle\n )\n external\n onlyLRTManager\n onlySupportedAsset(asset)\n {\n UtilLib.checkNonZeroAddress(priceOracle);\n assetPriceOracle[asset] = priceOracle;\n emit AssetPriceOracleUpdate(asset, priceOracle);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "01-salty", "title": "0xVolcano G", "severity_raw": "High", "severity": "high", "description": "# Gas report\n\n## Table of contents\n\n- [Gas report](#gas-report)\n - [Table of contents](#table-of-contents)\n - [In accordance to the sponsors requirements, this report only focuses on issues that save more than 100 Gas](#in-accordance-to-the-sponsors-requirements-this-report-only-focuses-on-issues-that-save-more-than-100-gas)\n - [Pack `lastUpkeepTimeEmissions` and `lastUpkeepTimeRewardsEmitters` together by reducing their size to `uint128` (Saves 1 SLOT: 2.1K Gas)](#pack-lastupkeeptimeemissions-and-lastupkeeptimerewardsemitters-together-by-reducing-their-size-to-uint128-saves-1-slot-21k-gas)\n - [Pack the following by reducing their size(Save 3 SLOTS: 6.3K Gas)](#pack-the-following-by-reducing-their-sizesave-3-slots-63k-gas)\n - [Pack `minUnstakeWeeks,maxUnstakeWeeks,minUnstakePercent` by reducing the sizes(Save 2 SLOTs: 4.2K Gas)](#pack-minunstakeweeksmaxunstakeweeksminunstakepercent-by-reducing-the-sizessave-2-slots-42k-gas)\n - [Pack `rewardPercentForCallingLiquidation` with `maxRewardValueForCallingLiquidation` by reducing the size(Save 1 SLOT: 2.1K Gas)](#pack-rewardpercentforcallingliquidation-with-maxrewardvalueforcallingliquidation--by-reducing-the-sizesave-1-slot-21k-gas)\n - [Pack `minimumCollateralValueForBorrowing` with `initialCollateralRatioPercent`(Save 1 SLOT: 2.1K Gas)](#pack-minimumcollateralvalueforborrowing-with-initialcollateralratiopercentsave-1-slot-21k-gas)\n - [Declare immutables for `exchangeConfig.wbtc()` and `exchangeConfig.weth()`(Save 2351 Gas on average)](#declare-immutables-for-exchangeconfigwbtc-and-exchangeconfigwethsave-2351-gas-on-average)\n - [Reference the immutable variable `salt` instead of making the external call again(Save 546 Gas on average)](#reference-the-immutable-variable-salt-instead-of-making-the-external-call-againsave-546-gas-on-average)\n - [Use the already defined immutable variable(save 595 Gas on average)](#use-the-already-defined-immutable-variablesave-595-gas-on-average)\n - [Use the imutable variable de", "vulnerable_code": "File: /src/Upkeep.sol\n63: uint256 public lastUpkeepTimeEmissions;\n64: uint256 public lastUpkeepTimeRewardsEmitters;", "fixed_code": "86: lastUpkeepTimeEmissions = block.timestamp;\n87: lastUpkeepTimeRewardsEmitters = block.timestamp;", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/0xVolcano-G.md", "collected_at": "2026-01-02T19:01:07.974020+00:00", "source_hash": "65fb8a730cbb7b74bdda3374e74d75a8b2b853cf3dcf7726578480e8e9653445", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: /src/Upkeep.sol\n63: uint256 public lastUpkeepTimeEmissions;\n64: uint256 public lastUpkeepTimeRewardsEmitters;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "86: lastUpkeepTimeEmissions = block.timestamp;\n87: lastUpkeepTimeRewardsEmitters = block.timestamp;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-asymmetry", "title": "btk Q", "severity_raw": "Critical", "severity": "critical", "description": "| Total Low issues |\n|------------------|\n\n| Risk | Issues Details | Number |\n|--------|-------------------------------------------------------------------------------------------------------------|---------------|\n| [L-01] | No Storage Gap for Upgradeable contracts | 4 |\n| [L-02] | Loss of precision due to rounding | 11 |\n| [L-03] | Lack of `nonReentrant` modifier | 1 |\n| [L-04] | Missing Event for initialize | 4 |\n| [L-05] | `owner` can renounce while system is paused | 1 |\n| [L-06] | Unused `receive()` Function Will Lock Ether In Contract | 1 |\n| [L-07] | Use a more recent version of OpenZeppelin dependencies | 1 |\n| [L-08] | Value is not validated to be different than the existing one | 5 |\n| [L-09] | Add a timelock to critical functions | 8 |\n| [L-10] | Lock pragmas to specific compiler version | 4 |\n| [L-11] | Use `uint256` instead `uint` | 16 |\n| [L-12] | Inconsistent check between Reth.Deposit() and WstEth.deposit(), SfrxEth.deposit() | 2 |\n| [L-13] | Critical changes should use-", "vulnerable_code": " /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;", "fixed_code": " uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/btk-Q.md", "collected_at": "2026-01-02T18:18:52.622138+00:00", "source_hash": "661972e95f3870af809554ca99efb76e018579102932a5627cd2bc02f6d390e8", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;", "has_vulnerable_code_snippet": true, "fixed_code_actual": " uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "08-dopex", "title": "Raihan G", "severity_raw": "High", "severity": "high", "description": "# gas\n\n ### Note: last 6 types ([G-18],[G-19],[G-20],[G-21],[G-22],[G-23]) that the automated report missed.\n\n\n# summary \n| | issue | instance |\n|------|-------|----------|\n|[G-01]|Use calldata instead of memory for function arguments that do not get mutated|3|\n|[G-02]|Avoid contract existence checks by using low level calls|93|\n|[G-03]|Can Make The Variable Outside The Loop To Save Gas |7|\n|[G-04]|Make 3 event parameters indexed when possible|10|\n|[G-05]|Amounts should be checked for\u00a00\u00a0before calling a transfer|13|\n|[G-06]|Do not calculate constants|2|\n|[G-07]|Use hardcode address instead address(this)|10|\n|[G-08]|Use Assembly To Check For\u00a0address(0)|19|\n|[G-09]|Use constants instead of type(uintx).max|17|\n|[G-10]|Use ERC721A instead ERC721|3|\n|[G-11]|Add unchecked {} for subtractions where the operands cannot underflow because of a previous require() or if-statement|1|\n|[G-12]|Use assembly for math (add, sub, mul, div)|4|\n|[G-13]|Use assembly to perform efficient back-to-back calls|6|\n|[G-14]|Empty blocks should be removed to save gas|1|\n|[G-15]|Avoid emitting storage values|10|\n|[G-16]|Use Modifiers Instead of Functions To Save Gas|2|\n|[G-17]|Gas savings can be achieved by changing the model for assigning value to the structure (260 gas)|8|\n|[G-18]|Multiple address/ID mappings can be combined into a single mapping of an address/ID to a struct, where appropriate|1|\n|[G-19]|Using storage instead of memory for structs/arrays saves gas|3|\n|[G-20]|State variables should be cached in stack variables rather than re-reading them from storage|54|\n|[G-21]|internal functions only called once can be inlined to save gas|4|\n|[G-22]|Use assembly for small keccak256 hashes, in order to save gas|1|\n|[G-23]|>= costs less gas than >|5|\n\n\n\n\n## [G-01] Use calldata instead of memory for function arguments that do not get mutated\nMark data types as\u00a0calldata\u00a0instead of\u00a0memory\u00a0where possible. This makes it so that the data is not automatically loaded into memory. If the data passed ", "vulnerable_code": "File: core/RdpxV2Core.sol\n765 uint256[] memory optionIds", "fixed_code": "File: perp-vault/PerpetualAtlanticVault.sol\n316 uint256[] memory optionIds\n\n406 uint256[] memory strikes", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/Raihan-G.md", "collected_at": "2026-01-02T18:24:58.245313+00:00", "source_hash": "663500923bd2440c35b3bb35f63b3107129c4fd8bf8434f8df88c6e8a0b09ac3", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: core/RdpxV2Core.sol\n765 uint256[] memory optionIds", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: perp-vault/PerpetualAtlanticVault.sol\n316 uint256[] memory optionIds\n\n406 uint256[] memory strikes", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-asymmetry", "title": "ayden G", "severity_raw": "Gas", "severity": "gas", "description": "\n1.The way to save on gas costs with a for lop\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L71\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L84\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L113\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L140\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L147\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L171\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L191\n\n```solidity\n+ for (uint256 i = 0; i < exCallData.length;) {\n+ unchecked {\n+ ++i;\n+ }\n }\n}\n```\n\n2.Prepending zero-checking can reduce the number of checks and save more gas\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L138#L155\n```solidity\n function rebalanceToWeights() external onlyOwner {\n uint256 ethAmountBefore = address(this).balance;\n for (uint i = 0; i < derivativeCount; i++) {\n if (derivatives[i].balance() > 0)\n derivatives[i].withdraw(derivatives[i].balance());\n }\n uint256 ethAmountAfter = address(this).balance;\n uint256 ethAmountToRebalance = ethAmountAfter - ethAmountBefore;\n + if(ethAmountToRebalance == 0){\n + emit Rebalanced();\n + return;\n + }\n\n for (uint i = 0; i < derivativeCount; i++) {\n - if (weights[i] == 0 || ethAmountToRebalance == 0) continue;\n + if (weights[i] == 0) continue;\n uint256 ethAmount = (ethAmountToRebalance * weights[i]) /\n totalWeight;\n // Price will change due to slippage\n derivatives[i].deposit{value: ethAmount}();\n }\n emit Rebalanced();\n }\n```\n\n3.Delete Unused function parameter\nhttps://github.com/code-423n4/2023-03-asy", "vulnerable_code": "+ for (uint256 i = 0; i < exCallData.length;) {\n+ unchecked {\n+ ++i;\n+ }\n }\n}", "fixed_code": " function rebalanceToWeights() external onlyOwner {\n uint256 ethAmountBefore = address(this).balance;\n for (uint i = 0; i < derivativeCount; i++) {\n if (derivatives[i].balance() > 0)\n derivatives[i].withdraw(derivatives[i].balance());\n }\n uint256 ethAmountAfter = address(this).balance;\n uint256 ethAmountToRebalance = ethAmountAfter - ethAmountBefore;\n + if(ethAmountToRebalance == 0){\n + emit Rebalanced();\n + return;\n + }\n\n for (uint i = 0; i < derivativeCount; i++) {\n - if (weights[i] == 0 || ethAmountToRebalance == 0) continue;\n + if (weights[i] == 0) continue;\n uint256 ethAmount = (ethAmountToRebalance * weights[i]) /\n totalWeight;\n // Price will change due to slippage\n derivatives[i].deposit{value: ethAmount}();\n }\n emit Rebalanced();\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/ayden-G.md", "collected_at": "2026-01-02T18:18:49.932379+00:00", "source_hash": "66368ea58e10b4d015da16ad3a43c72b213b7c9b0025bd727ef3216a9be2a04c", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 1028, "github_ref_count": 8, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "+ for (uint256 i = 0; i < exCallData.length;) {\n+ unchecked {\n+ ++i;\n+ }\n }\n}", "primary_code_language": "solidity", "primary_code_char_count": 100, "all_code_blocks": "// Code block 1 (solidity):\n+ for (uint256 i = 0; i < exCallData.length;) {\n+ unchecked {\n+ ++i;\n+ }\n }\n}\n\n// Code block 2 (solidity):\nfunction rebalanceToWeights() external onlyOwner {\n uint256 ethAmountBefore = address(this).balance;\n for (uint i = 0; i < derivativeCount; i++) {\n if (derivatives[i].balance() > 0)\n derivatives[i].withdraw(derivatives[i].balance());\n }\n uint256 ethAmountAfter = address(this).balance;\n uint256 ethAmountToRebalance = ethAmountAfter - ethAmountBefore;\n + if(ethAmountToRebalance == 0){\n + emit Rebalanced();\n + return;\n + }\n\n for (uint i = 0; i < derivativeCount; i++) {\n - if (weights[i] == 0 || ethAmountToRebalance == 0) continue;\n + if (weights[i] == 0) continue;\n uint256 ethAmount = (ethAmountToRebalance * weights[i]) /\n totalWeight;\n // Price will change due to slippage\n derivatives[i].deposit{value: ethAmount}();\n }\n emit Rebalanced();\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "+ for (uint256 i = 0; i < exCallData.length;) {\n+ unchecked {\n+ ++i;\n+ }\n }\n}\n\nfunction rebalanceToWeights() external onlyOwner {\n uint256 ethAmountBefore = address(this).balance;\n for (uint i = 0; i < derivativeCount; i++) {\n if (derivatives[i].balance() > 0)\n derivatives[i].withdraw(derivatives[i].balance());\n }\n uint256 ethAmountAfter = address(this).balance;\n uint256 ethAmountToRebalance = ethAmountAfter - ethAmountBefore;\n + if(ethAmountToRebalance == 0){\n + emit Rebalanced();\n + return;\n + }\n\n for (uint i = 0; i < derivativeCount; i++) {\n - if (weights[i] == 0 || ethAmountToRebalance == 0) continue;\n + if (weights[i] == 0) continue;\n uint256 ethAmount = (ethAmountToRebalance * weights[i]) /\n totalWeight;\n // Price will change due to slippage\n derivatives[i].deposit{value: ethAmount}();\n }\n emit Rebalanced();\n }", "github_refs_formatted": "SafEth.sol#L71, SafEth.sol#L84, SafEth.sol#L113, SafEth.sol#L140, SafEth.sol#L147, SafEth.sol#L171, SafEth.sol#L191, SafEth.sol#L138", "github_files_list": "SafEth.sol", "github_refs_count": 8, "vulnerable_code_actual": "+ for (uint256 i = 0; i < exCallData.length;) {\n+ unchecked {\n+ ++i;\n+ }\n }\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function rebalanceToWeights() external onlyOwner {\n uint256 ethAmountBefore = address(this).balance;\n for (uint i = 0; i < derivativeCount; i++) {\n if (derivatives[i].balance() > 0)\n derivatives[i].withdraw(derivatives[i].balance());\n }\n uint256 ethAmountAfter = address(this).balance;\n uint256 ethAmountToRebalance = ethAmountAfter - ethAmountBefore;\n + if(ethAmountToRebalance == 0){\n + emit Rebalanced();\n + return;\n + }\n\n for (uint i = 0; i < derivativeCount; i++) {\n - if (weights[i] == 0 || ethAmountToRebalance == 0) continue;\n + if (weights[i] == 0) continue;\n uint256 ethAmount = (ethAmountToRebalance * weights[i]) /\n totalWeight;\n // Price will change due to slippage\n derivatives[i].deposit{value: ethAmount}();\n }\n emit Rebalanced();\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "03-asymmetry", "title": "adeolu Q", "severity_raw": "Unknown", "severity": "unknown", "description": "## Unused argument in ethPerDerivative function in SfrxEth and WstEth contracts\n The ethPerDerivative function in SfrxEth and WstEth contracts accepts `uint256 _amount` argument which is unused in the logic of the function. It is not needed, it can be removed. \n\n- **Proof of Concept**\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/WstEth.sol#L86\n```\n function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n return IWStETH(WST_ETH).getStETHByWstETH(10 ** 18);\n }\n```\n\nIn this snippet from the ethPerDerivative function in WstEth.sol, it can be seen that `_amount` is unused. \n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/SfrxEth.sol#L111\n\n```\n function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n uint256 frxAmount = IsFrxEth(SFRX_ETH_ADDRESS).convertToAssets(\n 10 ** 18\n );\n return ((10 ** 18 * frxAmount) /\n IFrxEthEthPool(FRX_ETH_CRV_POOL_ADDRESS).price_oracle());\n }\n```\nIn this snippet from the ethPerDerivative function in SfrxEth.sol, it can be seen that `_amount` is unused. \n\n- **Tools Used**\n VS Code \n- **Recommended Mitigation Steps**\nRemove the unused argument `_amount` from the code. ", "vulnerable_code": " function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n return IWStETH(WST_ETH).getStETHByWstETH(10 ** 18);\n }", "fixed_code": " function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n uint256 frxAmount = IsFrxEth(SFRX_ETH_ADDRESS).convertToAssets(\n 10 ** 18\n );\n return ((10 ** 18 * frxAmount) /\n IFrxEthEthPool(FRX_ETH_CRV_POOL_ADDRESS).price_oracle());\n }", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/adeolu-Q.md", "collected_at": "2026-01-02T18:18:43.637384+00:00", "source_hash": "6659707b45f57d1a4a0fbf9d2bf6e72082eb0e4b2eea287f8bab0f9e480af304", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 435, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n return IWStETH(WST_ETH).getStETHByWstETH(10 ** 18);\n }", "primary_code_language": "unknown", "primary_code_char_count": 140, "all_code_blocks": "// Code block 1 (unknown):\nfunction ethPerDerivative(uint256 _amount) public view returns (uint256) {\n return IWStETH(WST_ETH).getStETHByWstETH(10 ** 18);\n }\n\n// Code block 2 (unknown):\nfunction ethPerDerivative(uint256 _amount) public view returns (uint256) {\n uint256 frxAmount = IsFrxEth(SFRX_ETH_ADDRESS).convertToAssets(\n 10 ** 18\n );\n return ((10 ** 18 * frxAmount) /\n IFrxEthEthPool(FRX_ETH_CRV_POOL_ADDRESS).price_oracle());\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "WstEth.sol#L86, SfrxEth.sol#L111", "github_files_list": "SfrxEth.sol, WstEth.sol", "github_refs_count": 2, "vulnerable_code_actual": " function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n return IWStETH(WST_ETH).getStETHByWstETH(10 ** 18);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n uint256 frxAmount = IsFrxEth(SFRX_ETH_ADDRESS).convertToAssets(\n 10 ** 18\n );\n return ((10 ** 18 * frxAmount) /\n IFrxEthEthPool(FRX_ETH_CRV_POOL_ADDRESS).price_oracle());\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7.72} {"source": "c4", "protocol": "04-caviar", "title": "Aymen0909 Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA Report\n\n## Summary\n\n| | Issue | Risk | Instances |\n| :-------------: |:-------------|:-------------:|:-------------:|\n| 1 | Possible loss of `msg.value` when calling the `flashloan` function | Low | 1 |\n| 2 | slippage protection should be included in `sell` function | Low | 1 |\n| 3 | No zero address check on `royaltyRecipient` in EthRouter | Low | 2 |\n| 4 | `protocolFeeRate` should have a maximum upper bound | Low | 1 |\n| 5 | Immutable state variables lack zero address checks | Low | 4 |\n| 6 | Event should be emitted in setters | NC | 3 |\n| 7 | Avoid floating pragma where possible | NC | |\n| 8 | `public` functions not called by the contract should be declared `external` instead | NC | 20 |\n\n## Findings\n\n### 1- Possible loss of `msg.value` when calling the `flashloan` function :\n\n#### Risk : Low\n\nWhen the `flashloan` function is called by a user it allows both the ETH and ERC20 tokens payments, so when the `baseToken` is an ERC20 token the user will pay with ERC20 tokens but if he also sends ETH in the form of `msg.value` in the same transaction (by accident), this ETH fund will be lost as the `flashloan` function doesn't verify that `msg.value == 0` when baseToken is an ERC20 tokens.\n\nThe impact of this is that those ETH funds sent by accident will be locked in the `PrivatePool` contract and the user won't be able to get them back.\n\nThe issue occurs because the `flashloan` function just checks that `msg.value >= fee` in case `baseToken == address(0)` but does not that `msg.value == 0` when `baseToken != address(0)`, as it can be seen in the code below :\n\nFile: PrivatePool.sol [Line 635](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L635)\n```\nif (baseToken == address(0) && msg.value < fee) revert InvalidEthAmount();\n```\n\n#### Mitigation\nTo avoid this issue the check in the `flashloan` function should verify that `msg.value == 0` when `baseToken != address(0)`, thus the check [Line 635](https://github.c", "vulnerable_code": "if (baseToken == address(0) && msg.value < fee) revert InvalidEthAmount();", "fixed_code": "if ((baseToken == address(0) && msg.value < fee) || (baseToken != address(0) && msg.value > 0)) revert InvalidEthAmount();", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/Aymen0909-Q.md", "collected_at": "2026-01-02T18:19:29.387040+00:00", "source_hash": "672d1fd3c2cdc11c8e963ee451af9358e6cc4a6c0a31c76c909bf7ffc8dce4d7", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 74, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "if (baseToken == address(0) && msg.value < fee) revert InvalidEthAmount();", "primary_code_language": "unknown", "primary_code_char_count": 74, "all_code_blocks": "// Code block 1 (unknown):\nif (baseToken == address(0) && msg.value < fee) revert InvalidEthAmount();", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "PrivatePool.sol#L635", "github_files_list": "PrivatePool.sol", "github_refs_count": 1, "vulnerable_code_actual": "if (baseToken == address(0) && msg.value < fee) revert InvalidEthAmount();", "has_vulnerable_code_snippet": true, "fixed_code_actual": "if ((baseToken == address(0) && msg.value < fee) || (baseToken != address(0) && msg.value > 0)) revert InvalidEthAmount();", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-revert-lend", "title": "14si2o_Flint Q", "severity_raw": "High", "severity": "high", "description": "\n## [L-01] Valid collateralValueLimitFactorX32 value will cause a revert\n\nIn the `_updateAndCheckCollateral` function, there are 2 checks to make sure that the `collateralValueLimitFactorX32` does not exceed `type(uint32).max`. This is because this maximal value represents a collateral value limit of 100%. \n\nHowever in the actual checks, `<` is used instead of `<=`. Meaning a valid value of 100% (type(uint32).max) would cause a revert. \n\nEven though setting a value of 100% is very unlikely, it remains a valid input and thus should not cause a revert. \n\n\n```diff \n if (\n- collateralValueLimitFactorX32 < type(uint32).max\n+ collateralValueLimitFactorX32 <= type(uint32).max \n && _convertToAssets(tokenConfigs[token0].totalDebtShares, debtExchangeRateX96, Math.Rounding.Up) > lentAssets * collateralValueLimitFactorX32 / Q32\n ) {\n revert CollateralValueLimit();\n }\n collateralValueLimitFactorX32 = tokenConfigs[token1].collateralValueLimitFactorX32;\n if (\n- collateralValueLimitFactorX32 < type(uint32).max\n+ collateralValueLimitFactorX32 <= type(uint32).max \n && _convertToAssets(tokenConfigs[token1].totalDebtShares, debtExchangeRateX96, Math.Rounding.Up)\n > lentAssets * collateralValueLimitFactorX32 / Q32\n ) {\n revert CollateralValueLimit();\n }\n```\n\n## [L-02] No slippage protection in Vault:liquidate\n\nIn the `Vault` `liquidate` function, the internal function `_sendPositionValue` is called which calls `nonfungiblePositionManager.decreaseLiquidity` with 100% slippage tolerance.\nMeaning MEV bots will take advantage and the liquidity returned will be either extremely small or non-existing. \n\nThis should a High finding, but it is mitigated by another finding. The `_sendPositionValue` does no", "vulnerable_code": "## [L-02] No slippage protection in Vault:liquidate\n\nIn the `Vault` `liquidate` function, the internal function `_sendPositionValue` is called which calls `nonfungiblePositionManager.decreaseLiquidity` with 100% slippage tolerance.\nMeaning MEV bots will take advantage and the liquidity returned will be either extremely small or non-existing. \n\nThis should a High finding, but it is mitigated by another finding. The `_sendPositionValue` does not return the decreased liquidity + fees, but only the fees. \nWhich means in 90%+ of the cases, the `amount0` and `amount1` returned will be smaller than `params.amount0Min` and `params.amount1Min` and thus cause a `SlippageError` revert.\n", "fixed_code": "## [L-03] Inconsistent Lending rounding in view functions\n\nThe `vaultInfo` function calculates the total lent by Rounding Up `_convertToAssets`. \n\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/14si2o_Flint-Q.md", "collected_at": "2026-01-02T19:02:56.574592+00:00", "source_hash": "6792270437d2e5619c34b9a0d1e052a9d0e160929c04f188b0f225f57e2997d4", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "## [L-02] No slippage protection in Vault:liquidate\n\nIn the `Vault` `liquidate` function, the internal function `_sendPositionValue` is called which calls `nonfungiblePositionManager.decreaseLiquidity` with 100% slippage tolerance.\nMeaning MEV bots will take advantage and the liquidity returned will be either extremely small or non-existing. \n\nThis should a High finding, but it is mitigated by another finding. The `_sendPositionValue` does not return the decreased liquidity + fees, but only the fees. \nWhich means in 90%+ of the cases, the `amount0` and `amount1` returned will be smaller than `params.amount0Min` and `params.amount1Min` and thus cause a `SlippageError` revert.\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## [L-03] Inconsistent Lending rounding in view functions\n\nThe `vaultInfo` function calculates the total lent by Rounding Up `_convertToAssets`. \n\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "04-caviar", "title": "avik_saikat G", "severity_raw": "Medium", "severity": "medium", "description": "# array.length inside loop\n## Vulnerability details\nCaching the array length outside a loop saves reading it on each iteration, as long as the array's length is not changed during the loop.\n\nYou save `3 gas` by not reading\u00a0array.length\u00a0- `3 gas` per instance - `27 gas` saved\n\n\n## Lines of code\n### Total 23\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L106\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L115\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L116\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L134\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L159\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L161\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L182\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L183\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L239\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L261\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L265\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L284\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/Factory.sol#L119\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L236\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L238\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L272\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L329\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L335\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L441\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L446\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L49", "vulnerable_code": "# Default assignment\n## Vulnerability details\n\nUninitialized variables are assigned with the types default value.\n\nExplicitly initializing a variable with it's default value costs unnecessary gas.\n\n## Lines of code\n### Total 21\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L106\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L116\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L134\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L159\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L161\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L183\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L239\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L261\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L265\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L284\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/Factory.sol#L119\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L237\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L238\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L272\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L328\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L329\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L441\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L446\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L496\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L518\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L673\n\n## Impact\nDeclaring\u00a0`uint256 i = 0;`\u00a0means doing an `MSTORE` of the value", "fixed_code": "\ud83d\ude80 Good:", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/avik_saikat-G.md", "collected_at": "2026-01-02T18:20:15.734656+00:00", "source_hash": "679976113ab61520326bf72d6d7e4cb2d138cf284bab817598fb0a803d310b3d", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 26, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "EthRouter.sol#L106, EthRouter.sol#L115, EthRouter.sol#L116, EthRouter.sol#L134, EthRouter.sol#L159, EthRouter.sol#L161, EthRouter.sol#L182, EthRouter.sol#L183, EthRouter.sol#L239, EthRouter.sol#L261, EthRouter.sol#L265, EthRouter.sol#L284, Factory.sol#L119, PrivatePool.sol#L236, PrivatePool.sol#L238, PrivatePool.sol#L272, PrivatePool.sol#L329, PrivatePool.sol#L335, PrivatePool.sol#L441, PrivatePool.sol#L446, PrivatePool.sol#L49, PrivatePool.sol#L237, PrivatePool.sol#L328, PrivatePool.sol#L496, PrivatePool.sol#L518, PrivatePool.sol#L673", "github_files_list": "EthRouter.sol, Factory.sol, PrivatePool.sol", "github_refs_count": 26, "vulnerable_code_actual": "# Default assignment\n## Vulnerability details\n\nUninitialized variables are assigned with the types default value.\n\nExplicitly initializing a variable with it's default value costs unnecessary gas.\n\n## Lines of code\n### Total 21\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L106\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L116\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L134\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L159\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L161\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L183\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L239\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L261\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L265\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L284\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/Factory.sol#L119\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L237\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L238\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L272\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L328\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L329\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L441\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L446\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L496\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L518\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L673\n\n## Impact\nDeclaring\u00a0`uint256 i = 0;`\u00a0means doing an `MSTORE` of the value", "has_vulnerable_code_snippet": true, "fixed_code_actual": "\ud83d\ude80 Good:", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "09-ondo", "title": "albahaca G", "severity_raw": "Medium", "severity": "medium", "description": "# gas \n\n# summary\n\n| | issue | instance |\n|------|-------|----------|\n|[G-01]| Use Assembly To Check For\u00a0address(0)|6|\n|[G-02]| Avoid contract existence checks by using low level calls |2|\n|[G-03]| Use\u00a0do while\u00a0loops instead of\u00a0for\u00a0loops|2|\n|[G-04]| Functions guaranteed to revert when called by normal users can be marked\u00a0payable|35|\n|[G-05]| Avoid emitting storage values |2|\n|[G-06]| Use assembly to perform efficient back-to-back calls|2|\n\n\n## [G-01] Use Assembly To Check For\u00a0address(0)\nit's generally more gas-efficient to use assembly to check for a zero address (address(0)) than to use the == operator.\n\nThe reason for this is that the == operator generates additional instructions in the EVM bytecode, which can increase the gas cost of your contract. By using assembly, you can perform the zero address check more efficiently and reduce the overall gas cost of your contract.\n\nHere's an example of how you can use assembly to check for a zero address:\n\n```\ncontract MyContract {\n function isZeroAddress(address addr) public pure returns (bool) {\n uint256 addrInt = uint256(addr);\n \n assembly {\n // Load the zero address into memory\n let zero := mload(0x00)\n \n // Compare the address to the zero address\n let isZero := eq(addrInt, zero)\n \n // Return the result\n mstore(0x00, isZero)\n return(0, 0x20)\n }\n }\n}\n```\nIn the above example, we have a function isZeroAddress that takes an address as input and returns a boolean value indicating whether the address is equal to the zero address. Inside the function, we convert the address to an integer using uint256(addr), and then use assembly to compare the integer to the zero address.\n\nBy using assembly to perform the zero address check, we can make our code more gas-efficient and reduce the overall cost of our contract. It's important to note that assembly can be more difficult to read and maintain t", "vulnerable_code": "contract MyContract {\n function isZeroAddress(address addr) public pure returns (bool) {\n uint256 addrInt = uint256(addr);\n \n assembly {\n // Load the zero address into memory\n let zero := mload(0x00)\n \n // Compare the address to the zero address\n let isZero := eq(addrInt, zero)\n \n // Return the result\n mstore(0x00, isZero)\n return(0, 0x20)\n }\n }\n}", "fixed_code": "File: contracts/usdy/rUSDY.sol\n490 require(_owner != address(0), \"APPROVE_FROM_ZERO_ADDRESS\");\n\n491 require(_spender != address(0), \"APPROVE_TO_ZERO_ADDRESS\");\n\n519 require(_sender != address(0), \"TRANSFER_FROM_THE_ZERO_ADDRESS\");\n\n520 require(_recipient != address(0), \"TRANSFER_TO_THE_ZERO_ADDRESS\");\n\n547 require(_recipient != address(0), \"MINT_TO_THE_ZERO_ADDRESS\");\n\n579 require(_account != address(0), \"BURN_FROM_THE_ZERO_ADDRESS\");\n\n642 if (from != address(0)) {\n\n649 if (to != address(0)) {", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/albahaca-G.md", "collected_at": "2026-01-02T18:25:46.643966+00:00", "source_hash": "67aeb87ed6c4fa637d60305824287875c0e567871021311272bb207608a01dfc", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 482, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "contract MyContract {\n function isZeroAddress(address addr) public pure returns (bool) {\n uint256 addrInt = uint256(addr);\n \n assembly {\n // Load the zero address into memory\n let zero := mload(0x00)\n \n // Compare the address to the zero address\n let isZero := eq(addrInt, zero)\n \n // Return the result\n mstore(0x00, isZero)\n return(0, 0x20)\n }\n }\n}", "primary_code_language": "unknown", "primary_code_char_count": 482, "all_code_blocks": "// Code block 1 (unknown):\ncontract MyContract {\n function isZeroAddress(address addr) public pure returns (bool) {\n uint256 addrInt = uint256(addr);\n \n assembly {\n // Load the zero address into memory\n let zero := mload(0x00)\n \n // Compare the address to the zero address\n let isZero := eq(addrInt, zero)\n \n // Return the result\n mstore(0x00, isZero)\n return(0, 0x20)\n }\n }\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "contract MyContract {\n function isZeroAddress(address addr) public pure returns (bool) {\n uint256 addrInt = uint256(addr);\n \n assembly {\n // Load the zero address into memory\n let zero := mload(0x00)\n \n // Compare the address to the zero address\n let isZero := eq(addrInt, zero)\n \n // Return the result\n mstore(0x00, isZero)\n return(0, 0x20)\n }\n }\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/usdy/rUSDY.sol\n490 require(_owner != address(0), \"APPROVE_FROM_ZERO_ADDRESS\");\n\n491 require(_spender != address(0), \"APPROVE_TO_ZERO_ADDRESS\");\n\n519 require(_sender != address(0), \"TRANSFER_FROM_THE_ZERO_ADDRESS\");\n\n520 require(_recipient != address(0), \"TRANSFER_TO_THE_ZERO_ADDRESS\");\n\n547 require(_recipient != address(0), \"MINT_TO_THE_ZERO_ADDRESS\");\n\n579 require(_account != address(0), \"BURN_FROM_THE_ZERO_ADDRESS\");\n\n642 if (from != address(0)) {\n\n649 if (to != address(0)) {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "06-lybra", "title": "hunter_w3b G", "severity_raw": "High", "severity": "high", "description": "# Gas Optimization\n\n# Summary\n\n| Number | Optimization Details | Context |\n| :----: | :---------------------------------------------------------------------------------- | :-----: |\n| [G-01] | Avoid contract `existence` checks by using low level calls | 1 |\n| [G-02] | Using fixed bytes is cheaper than using `string` | 2 |\n| [G-03] | Expressions for `constant` values such as a call to keccak256(), should use immutable rather than constant | 7 |\n| [G-04] | Using `calldata` instead of `memory` for read-only arguments | 7 |\n| [G-05] | Before some functions, we should `check` some variables for possible gas save | 8 |\n| [G-06] | `LybraPeUSDVaultBase::LybraPeUSDVaultBase()` function not called by the contract should be removed to save deployment gas | 1 |\n| [G-07] | Duplicated `require()` checks should be refactored to a modifier or function | 18 |\n| [G-08] | Use constants instead of `type(uintx).max` | 1 |\n| [G-09] | Use\u00a0double `require`\u00a0instead of using\u00a0&& | 3 |\n| [G-10] | A `modifier` used only once should be inlined to save gas | 3 |\n| [G-11] | Refactor event to avoid `emitting` data that is already present in transaction data | 26 |\n| [G-12] | Use hardcode address instead `address(this)` | 38 |\n| [G-13] | Use Assembly To Check For `address(0)` | 16 |\n| [G-14] | When possible, use assembly instead of `unchecked{++i}` | 2 |\n| [G-15] | Use nested if and, ", "vulnerable_code": "File: contracts/lybra/miner/ProtocolRewardsPool.sol\n\n172 amount = IEUSD(configurator.getEUSDAddress()).getMintedEUSDByShares(earned(user));\n\n232 uint256 share = IEUSD(configurator.getEUSDAddress()).getSharesByMintedEUSD(amount);\n", "fixed_code": "file: lybra/token/EUSD.sol\n\n99 function name() public pure returns (string memory) {\n100 return \"eUSD\";\n101 }\n102\n103 /**\n104 * @return the symbol of the token, usually a shorter version of the\n105 * name.\n106 */\n107 function symbol() public pure returns (string memory) {\n108 return \"eUSD\";\n109 }\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/hunter_w3b-G.md", "collected_at": "2026-01-02T18:23:00.621060+00:00", "source_hash": "67caf5733ef1fbe3b8eeef79291c64bbfd372cbd75ba4aa3c1f123bf8c919cc4", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: contracts/lybra/miner/ProtocolRewardsPool.sol\n\n172 amount = IEUSD(configurator.getEUSDAddress()).getMintedEUSDByShares(earned(user));\n\n232 uint256 share = IEUSD(configurator.getEUSDAddress()).getSharesByMintedEUSD(amount);\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "file: lybra/token/EUSD.sol\n\n99 function name() public pure returns (string memory) {\n100 return \"eUSD\";\n101 }\n102\n103 /**\n104 * @return the symbol of the token, usually a shorter version of the\n105 * name.\n106 */\n107 function symbol() public pure returns (string memory) {\n108 return \"eUSD\";\n109 }\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "11-kelp", "title": "hunter_w3b Q", "severity_raw": "High", "severity": "high", "description": "## [L-01] Deposit limits can be updated by the manager role, but there is no check to prevent reducing limits. This could lock user assets\n\nThe addNewSupportedAsset function allows the manager role to update the deposit limit amount for any supported asset. However, there is no check to prevent reducing this limit to a value below what users have already deposited.\n\n```solidity\nFile: src/LRTConfig.sol\n\n73 function addNewSupportedAsset(address asset, uint256 depositLimit) external onlyRole(LRTConstants.MANAGER) {\n74 _addNewSupportedAsset(asset, depositLimit);\n75 }\n76\n77 /// @dev private function to add a new supported asset\n78 /// @param asset Asset address\n79 /// @param depositLimit Deposit limit for the asset\n80 function _addNewSupportedAsset(address asset, uint256 depositLimit) private {\n81 UtilLib.checkNonZeroAddress(asset);\n82 if (isSupportedAsset[asset]) {\n83 revert AssetAlreadySupported();\n84 }\n85 isSupportedAsset[asset] = true;\n86 supportedAssetList.push(asset);\n87 depositLimitByAsset[asset] = depositLimit;\n88 emit AddedNewSupportedAsset(asset, depositLimit);\n89 }\n```\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTConfig.sol#L73-L89\n\nThis could potentially lock funds if a limit is reduced after a user has deposited more than the new lower limit. An attacker with manager role privileges could maliciously lock funds in this way. The deposit limit should always be increased or maintained, never decreased, to avoid locking user funds.\n\n## [L-02] Strategies can be updated by any admin, but there is no logic to handle existing funds. Strategy changes could lose user asset\n\nThe updateAssetStrategy function allows any admin to change the strategy address for how an asset is managed. However, there is no logic defined in the contract for how existing deposited funds should be handled during a strategy change. Without proper handling, funds could be lost or inaccessibl", "vulnerable_code": "File: src/LRTConfig.sol\n\n73 function addNewSupportedAsset(address asset, uint256 depositLimit) external onlyRole(LRTConstants.MANAGER) {\n74 _addNewSupportedAsset(asset, depositLimit);\n75 }\n76\n77 /// @dev private function to add a new supported asset\n78 /// @param asset Asset address\n79 /// @param depositLimit Deposit limit for the asset\n80 function _addNewSupportedAsset(address asset, uint256 depositLimit) private {\n81 UtilLib.checkNonZeroAddress(asset);\n82 if (isSupportedAsset[asset]) {\n83 revert AssetAlreadySupported();\n84 }\n85 isSupportedAsset[asset] = true;\n86 supportedAssetList.push(asset);\n87 depositLimitByAsset[asset] = depositLimit;\n88 emit AddedNewSupportedAsset(asset, depositLimit);\n89 }", "fixed_code": "File: src/LRTConfig.sol\n\n109 function updateAssetStrategy(\n110 address asset,\n111 address strategy\n112 )\n113 external\n114 onlyRole(DEFAULT_ADMIN_ROLE)\n115 onlySupportedAsset(asset)\n116 {\n117 UtilLib.checkNonZeroAddress(strategy);\n118 if (assetStrategy[asset] == strategy) {\n119 revert ValueAlreadyInUse();\n120 }\n121 assetStrategy[asset] = strategy;\n122 }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/hunter_w3b-Q.md", "collected_at": "2026-01-02T18:28:07.747855+00:00", "source_hash": "6813ecec7dbe95b1c95812e4d2c9fe4503c178e967863fbba7718dc823044b3f", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 794, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: src/LRTConfig.sol\n\n73 function addNewSupportedAsset(address asset, uint256 depositLimit) external onlyRole(LRTConstants.MANAGER) {\n74 _addNewSupportedAsset(asset, depositLimit);\n75 }\n76\n77 /// @dev private function to add a new supported asset\n78 /// @param asset Asset address\n79 /// @param depositLimit Deposit limit for the asset\n80 function _addNewSupportedAsset(address asset, uint256 depositLimit) private {\n81 UtilLib.checkNonZeroAddress(asset);\n82 if (isSupportedAsset[asset]) {\n83 revert AssetAlreadySupported();\n84 }\n85 isSupportedAsset[asset] = true;\n86 supportedAssetList.push(asset);\n87 depositLimitByAsset[asset] = depositLimit;\n88 emit AddedNewSupportedAsset(asset, depositLimit);\n89 }", "primary_code_language": "solidity", "primary_code_char_count": 794, "all_code_blocks": "// Code block 1 (solidity):\nFile: src/LRTConfig.sol\n\n73 function addNewSupportedAsset(address asset, uint256 depositLimit) external onlyRole(LRTConstants.MANAGER) {\n74 _addNewSupportedAsset(asset, depositLimit);\n75 }\n76\n77 /// @dev private function to add a new supported asset\n78 /// @param asset Asset address\n79 /// @param depositLimit Deposit limit for the asset\n80 function _addNewSupportedAsset(address asset, uint256 depositLimit) private {\n81 UtilLib.checkNonZeroAddress(asset);\n82 if (isSupportedAsset[asset]) {\n83 revert AssetAlreadySupported();\n84 }\n85 isSupportedAsset[asset] = true;\n86 supportedAssetList.push(asset);\n87 depositLimitByAsset[asset] = depositLimit;\n88 emit AddedNewSupportedAsset(asset, depositLimit);\n89 }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: src/LRTConfig.sol\n\n73 function addNewSupportedAsset(address asset, uint256 depositLimit) external onlyRole(LRTConstants.MANAGER) {\n74 _addNewSupportedAsset(asset, depositLimit);\n75 }\n76\n77 /// @dev private function to add a new supported asset\n78 /// @param asset Asset address\n79 /// @param depositLimit Deposit limit for the asset\n80 function _addNewSupportedAsset(address asset, uint256 depositLimit) private {\n81 UtilLib.checkNonZeroAddress(asset);\n82 if (isSupportedAsset[asset]) {\n83 revert AssetAlreadySupported();\n84 }\n85 isSupportedAsset[asset] = true;\n86 supportedAssetList.push(asset);\n87 depositLimitByAsset[asset] = depositLimit;\n88 emit AddedNewSupportedAsset(asset, depositLimit);\n89 }", "github_refs_formatted": "LRTConfig.sol#L73-L89", "github_files_list": "LRTConfig.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: src/LRTConfig.sol\n\n73 function addNewSupportedAsset(address asset, uint256 depositLimit) external onlyRole(LRTConstants.MANAGER) {\n74 _addNewSupportedAsset(asset, depositLimit);\n75 }\n76\n77 /// @dev private function to add a new supported asset\n78 /// @param asset Asset address\n79 /// @param depositLimit Deposit limit for the asset\n80 function _addNewSupportedAsset(address asset, uint256 depositLimit) private {\n81 UtilLib.checkNonZeroAddress(asset);\n82 if (isSupportedAsset[asset]) {\n83 revert AssetAlreadySupported();\n84 }\n85 isSupportedAsset[asset] = true;\n86 supportedAssetList.push(asset);\n87 depositLimitByAsset[asset] = depositLimit;\n88 emit AddedNewSupportedAsset(asset, depositLimit);\n89 }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: src/LRTConfig.sol\n\n109 function updateAssetStrategy(\n110 address asset,\n111 address strategy\n112 )\n113 external\n114 onlyRole(DEFAULT_ADMIN_ROLE)\n115 onlySupportedAsset(asset)\n116 {\n117 UtilLib.checkNonZeroAddress(strategy);\n118 if (assetStrategy[asset] == strategy) {\n119 revert ValueAlreadyInUse();\n120 }\n121 assetStrategy[asset] = strategy;\n122 }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-asymmetry", "title": "alexzoid G", "severity_raw": "Gas", "severity": "gas", "description": "## [G-01] Storage Variable Accessed Multiple Times\n\nThe `derivativeCount` storage variable is accessed multiple times within for-loops, which can lead to inefficient gas usage:\n\n- https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L71\n```solidity\nfor (uint i = 0; i < derivativeCount; i++)\n```\n- https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L84\n```solidity\nfor (uint i = 0; i < derivativeCount; i++) {\n```\n- https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L113\n```solidity\nfor (uint256 i = 0; i < derivativeCount; i++) {\n```\n- https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L140\n```solidity\nfor (uint i = 0; i < derivativeCount; i++) {\n```\n- https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L147\n```solidity\nfor (uint i = 0; i < derivativeCount; i++) {\n```\n- https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L171\n```solidity\nfor (uint256 i = 0; i < derivativeCount; i++)\n```\n- https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L191\n```solidity\nfor (uint256 i = 0; i < derivativeCount; i++)\n```\n- https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L186-L188 \n```solidity\nderivatives[derivativeCount] = IDerivative(_contractAddress);\nweights[derivativeCount] = _weight;\nderivativeCount++;\n```\n\nAdditionally, the `derivatives[i]` and `weights[i]` storage variables are accessed multiple times:\n\n- https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L73-L74\n```solidity\n// Getting underlying value in terms of ETH for each derivative\nfor (uint i = 0; i < derivativeCount; i++)\n underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;\n```\n- https://github.com/code-423n4/2023-03-a", "vulnerable_code": "for (uint i = 0; i < derivativeCount; i++)", "fixed_code": "for (uint i = 0; i < derivativeCount; i++) {", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/alexzoid-G.md", "collected_at": "2026-01-02T18:18:46.332691+00:00", "source_hash": "68271f1bf842354f43254c19a8bc052266596697ad1c58ada065b5d91500366b", "code_block_count": 9, "solidity_block_count": 9, "total_code_chars": 683, "github_ref_count": 9, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "for (uint i = 0; i < derivativeCount; i++)", "primary_code_language": "solidity", "primary_code_char_count": 42, "all_code_blocks": "// Code block 1 (solidity):\nfor (uint i = 0; i < derivativeCount; i++)\n\n// Code block 2 (solidity):\nfor (uint i = 0; i < derivativeCount; i++) {\n\n// Code block 3 (solidity):\nfor (uint256 i = 0; i < derivativeCount; i++) {\n\n// Code block 4 (solidity):\nfor (uint i = 0; i < derivativeCount; i++) {\n\n// Code block 5 (solidity):\nfor (uint i = 0; i < derivativeCount; i++) {\n\n// Code block 6 (solidity):\nfor (uint256 i = 0; i < derivativeCount; i++)\n\n// Code block 7 (solidity):\nfor (uint256 i = 0; i < derivativeCount; i++)\n\n// Code block 8 (solidity):\nderivatives[derivativeCount] = IDerivative(_contractAddress);\nweights[derivativeCount] = _weight;\nderivativeCount++;\n\n// Code block 9 (solidity):\n// Getting underlying value in terms of ETH for each derivative\nfor (uint i = 0; i < derivativeCount; i++)\n underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;", "all_code_blocks_count": 9, "has_diff_blocks": false, "diff_code": "", "solidity_code": "for (uint i = 0; i < derivativeCount; i++)\n\nfor (uint i = 0; i < derivativeCount; i++) {\n\nfor (uint256 i = 0; i < derivativeCount; i++) {\n\nfor (uint i = 0; i < derivativeCount; i++) {\n\nfor (uint i = 0; i < derivativeCount; i++) {\n\nfor (uint256 i = 0; i < derivativeCount; i++)\n\nfor (uint256 i = 0; i < derivativeCount; i++)\n\nderivatives[derivativeCount] = IDerivative(_contractAddress);\nweights[derivativeCount] = _weight;\nderivativeCount++;\n\n// Getting underlying value in terms of ETH for each derivative\nfor (uint i = 0; i < derivativeCount; i++)\n underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;", "github_refs_formatted": "SafEth.sol#L71, SafEth.sol#L84, SafEth.sol#L113, SafEth.sol#L140, SafEth.sol#L147, SafEth.sol#L171, SafEth.sol#L191, SafEth.sol#L186-L188, SafEth.sol#L73-L74", "github_files_list": "SafEth.sol", "github_refs_count": 9, "vulnerable_code_actual": "for (uint i = 0; i < derivativeCount; i++)", "has_vulnerable_code_snippet": true, "fixed_code_actual": "for (uint i = 0; i < derivativeCount; i++) {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 15} {"source": "c4", "protocol": "11-kelp", "title": "digitizeworx Analysis", "severity_raw": "Critical", "severity": "critical", "description": "## Overview\n\nKelp DAO aims to provide higher yield opportunities for staked ETH assets like rETH by \"restaking\" them into liquidity strategies. The core components are:\n\n**LRTConfig** - Stores configuration and contract addresses. Controls access.\n\n**LRTDepositPool** - Receives user deposits and mints rsETH tokens.\n\n**NodeDelegator** - Receives assets from DepositPool. Deposits into EigenLayer strategies. \n\n**LRTOracle** - Fetches LST token prices from Chainlink.\n\n**RSETH** - ERC20 receipt token minted when users deposit. \n\n### Architecture \n\nKelp has a modular architecture with well-defined contract responsibilities:\n\n- LRTConfig stores all shared configuration and controls access \n\n- LRTDepositPool is the main user entry point to deposit assets\n\n- Funds flow from DepositPool into NodeDelegators\n\n- NodeDelegators deposit into yield generating EigenLayer strategies\n\n- LRTOracle provides price feeds to calculate rsETH mint amounts\n\nThis separation of concerns makes the system flexible and upgradable.\n\n## Analysis \n\n### Access Control\n\n- Access control done well with admin and manager roles in LRTConfig.\n\n- Modifiers like `onlyLRTAdmin` prevent privilege escalation.\n\n- No ways found to manipulate roles or bypass restrictions.\n\n### Funds Safety\n\n- Users can only deposit into Kelp, no withdrawals. Mitigates mismatched receipt risk.\n\n- Admin roles have no access to user funds. Prevents loss due to compromised admin keys.\n\n- Use of pausable, reentrancy guard, and deposit limits provide security.\n\n**[deposit function](https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTDepositPool.sol#L119-L144)**\n\nLRTDepositPool controls user deposits:\n\n```solidity\nfunction deposit(uint amount) external {\n\n // Transfer asset from user \n\n // Mint rsETH\n\n // Emit deposit event\n\n}\n\n// No withdraw function!\n```\n\nAdmin roles defined in LRTConfig:\n\n```solidity \n// ADMIN_ROLE \n// MANAGER_ROLE\n```\n\n**Analysis**\n\n- LRTDepositPool has no withdraw funct", "vulnerable_code": "function deposit(uint amount) external {\n\n // Transfer asset from user \n\n // Mint rsETH\n\n // Emit deposit event\n\n}\n\n// No withdraw function!", "fixed_code": "// ADMIN_ROLE \n// MANAGER_ROLE", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/digitizeworx-Analysis.md", "collected_at": "2026-01-02T18:28:00.548141+00:00", "source_hash": "689c33fa2e7203c2ff1b2e04800ada95e0b20cdb837fb31cad8815843dc9fbae", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 143, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function deposit(uint amount) external {\n\n // Transfer asset from user \n\n // Mint rsETH\n\n // Emit deposit event\n\n}\n\n// No withdraw function!", "primary_code_language": "solidity", "primary_code_char_count": 143, "all_code_blocks": "// Code block 1 (solidity):\nfunction deposit(uint amount) external {\n\n // Transfer asset from user \n\n // Mint rsETH\n\n // Emit deposit event\n\n}\n\n// No withdraw function!", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function deposit(uint amount) external {\n\n // Transfer asset from user \n\n // Mint rsETH\n\n // Emit deposit event\n\n}\n\n// No withdraw function!", "github_refs_formatted": "LRTDepositPool.sol#L119-L144", "github_files_list": "LRTDepositPool.sol", "github_refs_count": 1, "vulnerable_code_actual": "function deposit(uint amount) external {\n\n // Transfer asset from user \n\n // Mint rsETH\n\n // Emit deposit event\n\n}\n\n// No withdraw function!", "has_vulnerable_code_snippet": true, "fixed_code_actual": "// ADMIN_ROLE \n// MANAGER_ROLE", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "05-ajna", "title": "evmboi32 Q", "severity_raw": "Unknown", "severity": "unknown", "description": "# Incorrect ```GLOBAL_BUDGET_CONSTRAINT```\nIf we look at the whitepaper it states that ```GLOBAL_BUDGET_CONSTRAINT``` should be set to 2%.\n> On a quarterly basis, up to 2% of the treasury (30% of the AJNA token supply on launch) is\ndistributed to facilitate growth of the Ajna system.\n\nThe actual implementation has this value set to 3%\n\nStandardFunding.sol#27\n```solidity\n uint256 internal constant GLOBAL_BUDGET_CONSTRAINT = 0.03 * 1e18;\n```\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/StandardFunding.sol#L27", "vulnerable_code": "If we look at the whitepaper it states that ```GLOBAL_BUDGET_CONSTRAINT``` should be set to 2%.\n> On a quarterly basis, up to 2% of the treasury (30% of the AJNA token supply on launch) is\ndistributed to facilitate growth of the Ajna system.\n\nThe actual implementation has this value set to 3%\n\nStandardFunding.sol#27", "fixed_code": "", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/evmboi32-Q.md", "collected_at": "2026-01-02T18:21:26.888745+00:00", "source_hash": "68a238d0e8c651d4c1c9ecdb9a9cbb673847d0d868fc834831a0fa298412a5f9", "code_block_count": 2, "solidity_block_count": 1, "total_code_chars": 108, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "If we look at the whitepaper it states that", "primary_code_language": "unknown", "primary_code_char_count": 43, "all_code_blocks": "// Code block 1 (unknown):\nIf we look at the whitepaper it states that\n\n// Code block 2 (solidity):\nuint256 internal constant GLOBAL_BUDGET_CONSTRAINT = 0.03 * 1e18;", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "uint256 internal constant GLOBAL_BUDGET_CONSTRAINT = 0.03 * 1e18;", "github_refs_formatted": "StandardFunding.sol#L27", "github_files_list": "StandardFunding.sol", "github_refs_count": 1, "vulnerable_code_actual": "If we look at the whitepaper it states that ```GLOBAL_BUDGET_CONSTRAINT``` should be set to 2%.\n> On a quarterly basis, up to 2% of the treasury (30% of the AJNA token supply on launch) is\ndistributed to facilitate growth of the Ajna system.\n\nThe actual implementation has this value set to 3%\n\nStandardFunding.sol#27", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5.18} {"source": "c4", "protocol": "02-ai-arena", "title": "KupiaSec Q", "severity_raw": "Low", "severity": "low", "description": "## [L-01] function `MergingPool.pickWinner()` has no event\nIt is recommended to emit events on important functions\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/MergingPool.sol#L118-L132\n\n```solidity\n function pickWinner(uint256[] calldata winners) external {\n require(isAdmin[msg.sender]);\n require(winners.length == winnersPerPeriod, \"Incorrect number of winners\");\n require(!isSelectionComplete[roundId], \"Winners are already selected\");\n uint256 winnersLength = winners.length;\n address[] memory currentWinnerAddresses = new address[](winnersLength);\n for (uint256 i = 0; i < winnersLength; i++) {\n currentWinnerAddresses[i] = _fighterFarmInstance.ownerOf(winners[i]);\n totalPoints -= fighterPoints[winners[i]];\n fighterPoints[winners[i]] = 0;\n }\n winnerAddresses[roundId] = currentWinnerAddresses;\n isSelectionComplete[roundId] = true;\n roundId += 1;\n }\n```\n\n## [L-02] function `FighterFarm.redeemMintPass()` doesn't check the length of the `iconsTypes`.\n\nAll inputs must have the same length, and there is a check but the `iconTypes` is missing in the check.\n\n```solidity\n function redeemMintPass(\n uint256[] calldata mintpassIdsToBurn,\n uint8[] calldata fighterTypes,\n uint8[] calldata iconsTypes,\n string[] calldata mintPassDnas,\n string[] calldata modelHashes,\n string[] calldata modelTypes\n ) \n external \n {\n require(\n mintpassIdsToBurn.length == mintPassDnas.length && \n mintPassDnas.length == fighterTypes.length && \n fighterTypes.length == modelHashes.length &&\n modelHashes.length == modelTypes.length\n );\n for (uint16 i = 0; i < mintpassIdsToBurn.length; i++) {\n require(msg.sender == _mintpassInstance.ownerOf(mintpassIdsToBurn[i]));\n _mintpassInstance.burn(mintpassIdsToBurn[i]", "vulnerable_code": " function pickWinner(uint256[] calldata winners) external {\n require(isAdmin[msg.sender]);\n require(winners.length == winnersPerPeriod, \"Incorrect number of winners\");\n require(!isSelectionComplete[roundId], \"Winners are already selected\");\n uint256 winnersLength = winners.length;\n address[] memory currentWinnerAddresses = new address[](winnersLength);\n for (uint256 i = 0; i < winnersLength; i++) {\n currentWinnerAddresses[i] = _fighterFarmInstance.ownerOf(winners[i]);\n totalPoints -= fighterPoints[winners[i]];\n fighterPoints[winners[i]] = 0;\n }\n winnerAddresses[roundId] = currentWinnerAddresses;\n isSelectionComplete[roundId] = true;\n roundId += 1;\n }", "fixed_code": " function redeemMintPass(\n uint256[] calldata mintpassIdsToBurn,\n uint8[] calldata fighterTypes,\n uint8[] calldata iconsTypes,\n string[] calldata mintPassDnas,\n string[] calldata modelHashes,\n string[] calldata modelTypes\n ) \n external \n {\n require(\n mintpassIdsToBurn.length == mintPassDnas.length && \n mintPassDnas.length == fighterTypes.length && \n fighterTypes.length == modelHashes.length &&\n modelHashes.length == modelTypes.length\n );\n for (uint16 i = 0; i < mintpassIdsToBurn.length; i++) {\n require(msg.sender == _mintpassInstance.ownerOf(mintpassIdsToBurn[i]));\n _mintpassInstance.burn(mintpassIdsToBurn[i]);\n _createNewFighter(\n msg.sender, \n uint256(keccak256(abi.encode(mintPassDnas[i]))), \n modelHashes[i], \n modelTypes[i],\n fighterTypes[i],\n iconsTypes[i],\n [uint256(100), uint256(100)]\n );\n }\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/KupiaSec-Q.md", "collected_at": "2026-01-02T19:02:30.914715+00:00", "source_hash": "68a393688a6b932053577047740a87a7e8555ad22fe545d401db834dd388a0d2", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 763, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function pickWinner(uint256[] calldata winners) external {\n require(isAdmin[msg.sender]);\n require(winners.length == winnersPerPeriod, \"Incorrect number of winners\");\n require(!isSelectionComplete[roundId], \"Winners are already selected\");\n uint256 winnersLength = winners.length;\n address[] memory currentWinnerAddresses = new address[](winnersLength);\n for (uint256 i = 0; i < winnersLength; i++) {\n currentWinnerAddresses[i] = _fighterFarmInstance.ownerOf(winners[i]);\n totalPoints -= fighterPoints[winners[i]];\n fighterPoints[winners[i]] = 0;\n }\n winnerAddresses[roundId] = currentWinnerAddresses;\n isSelectionComplete[roundId] = true;\n roundId += 1;\n }", "primary_code_language": "solidity", "primary_code_char_count": 763, "all_code_blocks": "// Code block 1 (solidity):\nfunction pickWinner(uint256[] calldata winners) external {\n require(isAdmin[msg.sender]);\n require(winners.length == winnersPerPeriod, \"Incorrect number of winners\");\n require(!isSelectionComplete[roundId], \"Winners are already selected\");\n uint256 winnersLength = winners.length;\n address[] memory currentWinnerAddresses = new address[](winnersLength);\n for (uint256 i = 0; i < winnersLength; i++) {\n currentWinnerAddresses[i] = _fighterFarmInstance.ownerOf(winners[i]);\n totalPoints -= fighterPoints[winners[i]];\n fighterPoints[winners[i]] = 0;\n }\n winnerAddresses[roundId] = currentWinnerAddresses;\n isSelectionComplete[roundId] = true;\n roundId += 1;\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function pickWinner(uint256[] calldata winners) external {\n require(isAdmin[msg.sender]);\n require(winners.length == winnersPerPeriod, \"Incorrect number of winners\");\n require(!isSelectionComplete[roundId], \"Winners are already selected\");\n uint256 winnersLength = winners.length;\n address[] memory currentWinnerAddresses = new address[](winnersLength);\n for (uint256 i = 0; i < winnersLength; i++) {\n currentWinnerAddresses[i] = _fighterFarmInstance.ownerOf(winners[i]);\n totalPoints -= fighterPoints[winners[i]];\n fighterPoints[winners[i]] = 0;\n }\n winnerAddresses[roundId] = currentWinnerAddresses;\n isSelectionComplete[roundId] = true;\n roundId += 1;\n }", "github_refs_formatted": "MergingPool.sol#L118-L132", "github_files_list": "MergingPool.sol", "github_refs_count": 1, "vulnerable_code_actual": " function pickWinner(uint256[] calldata winners) external {\n require(isAdmin[msg.sender]);\n require(winners.length == winnersPerPeriod, \"Incorrect number of winners\");\n require(!isSelectionComplete[roundId], \"Winners are already selected\");\n uint256 winnersLength = winners.length;\n address[] memory currentWinnerAddresses = new address[](winnersLength);\n for (uint256 i = 0; i < winnersLength; i++) {\n currentWinnerAddresses[i] = _fighterFarmInstance.ownerOf(winners[i]);\n totalPoints -= fighterPoints[winners[i]];\n fighterPoints[winners[i]] = 0;\n }\n winnerAddresses[roundId] = currentWinnerAddresses;\n isSelectionComplete[roundId] = true;\n roundId += 1;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function redeemMintPass(\n uint256[] calldata mintpassIdsToBurn,\n uint8[] calldata fighterTypes,\n uint8[] calldata iconsTypes,\n string[] calldata mintPassDnas,\n string[] calldata modelHashes,\n string[] calldata modelTypes\n ) \n external \n {\n require(\n mintpassIdsToBurn.length == mintPassDnas.length && \n mintPassDnas.length == fighterTypes.length && \n fighterTypes.length == modelHashes.length &&\n modelHashes.length == modelTypes.length\n );\n for (uint16 i = 0; i < mintpassIdsToBurn.length; i++) {\n require(msg.sender == _mintpassInstance.ownerOf(mintpassIdsToBurn[i]));\n _mintpassInstance.burn(mintpassIdsToBurn[i]);\n _createNewFighter(\n msg.sender, \n uint256(keccak256(abi.encode(mintPassDnas[i]))), \n modelHashes[i], \n modelTypes[i],\n fighterTypes[i],\n iconsTypes[i],\n [uint256(100), uint256(100)]\n );\n }\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-asymmetry", "title": "c3phas Q", "severity_raw": "High", "severity": "high", "description": "### Table of Contents\n## QA Findings\n- [QA Findings](#qa-findings)\n- [Upgradeable contract missing a `__gap` storage variable](#upgradeable-contract-missing-a-__gap-storage-variable)\n- [Avoid Naming collisions, totalSupply should be renamed](#avoid-naming-collisions-totalsupply-should-be-renamed)\n- [Unused local variables should be removed](#unused-local-variables-should-be-removed)\n- [Constants should be defined rather than using magic numbers](#constants-should-be-defined-rather-than-using-magic-numbers)\n- [Lock pragmas to specific compiler version](#lock-pragmas-to-specific-compiler-version)\n- [Natspec is incomplete](#natspec-is-incomplete)\n- [Use scientific notation (e.g. 1e18) rather than exponentiation (e.g. `10**18`)](#use-scientific-notation-eg-1e18-rather-than-exponentiation-eg-1018)\n- [Lack of event emission on setters](#lack-of-event-emission-on-setters)\n- [Lack of consistenty with using uint vs uint256](#lack-of-consistenty-with-using-uint-vs-uint256)\n- [Code Structure Deviates From Best-Practice](#code-structure-deviates-from-best-practice)\n- [Import declarations should import specific identifiers, rather than the whole file](#import-declarations-should-import-specific-identifiers-rather-than-the-whole-file)\n\n\n## Upgradeable contract missing a `__gap` storage variable\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L15-L20\n```solidity\nFile: /contracts/SafEth/SafEth.sol\n15: contract SafEth is\n16: Initializable,\n17: ERC20Upgradeable,\n18: OwnableUpgradeable,\n19: SafEthStorage\n20:{\n```\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/WstEth.sol#L12\n```solidity\nFile: /contracts/SafEth/derivatives/WstEth.sol\n12: contract WstEth is IDerivative, Initializable, OwnableUpgradeable {\n```\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/deriv", "vulnerable_code": "File: /contracts/SafEth/SafEth.sol\n15: contract SafEth is\n16: Initializable,\n17: ERC20Upgradeable,\n18: OwnableUpgradeable,\n19: SafEthStorage\n20:{", "fixed_code": "File: /contracts/SafEth/derivatives/WstEth.sol\n12: contract WstEth is IDerivative, Initializable, OwnableUpgradeable {", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/c3phas-Q.md", "collected_at": "2026-01-02T18:18:53.510902+00:00", "source_hash": "68dd55cdc1f5a5632c66c69498dccfcf9e38ca0de725b1fe79535cc58e72ea9e", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 278, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: /contracts/SafEth/SafEth.sol\n15: contract SafEth is\n16: Initializable,\n17: ERC20Upgradeable,\n18: OwnableUpgradeable,\n19: SafEthStorage\n20:{", "primary_code_language": "solidity", "primary_code_char_count": 157, "all_code_blocks": "// Code block 1 (solidity):\nFile: /contracts/SafEth/SafEth.sol\n15: contract SafEth is\n16: Initializable,\n17: ERC20Upgradeable,\n18: OwnableUpgradeable,\n19: SafEthStorage\n20:{\n\n// Code block 2 (solidity):\nFile: /contracts/SafEth/derivatives/WstEth.sol\n12: contract WstEth is IDerivative, Initializable, OwnableUpgradeable {", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: /contracts/SafEth/SafEth.sol\n15: contract SafEth is\n16: Initializable,\n17: ERC20Upgradeable,\n18: OwnableUpgradeable,\n19: SafEthStorage\n20:{\n\nFile: /contracts/SafEth/derivatives/WstEth.sol\n12: contract WstEth is IDerivative, Initializable, OwnableUpgradeable {", "github_refs_formatted": "SafEth.sol#L15-L20, WstEth.sol#L12", "github_files_list": "WstEth.sol, SafEth.sol", "github_refs_count": 2, "vulnerable_code_actual": "File: /contracts/SafEth/SafEth.sol\n15: contract SafEth is\n16: Initializable,\n17: ERC20Upgradeable,\n18: OwnableUpgradeable,\n19: SafEthStorage\n20:{", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: /contracts/SafEth/derivatives/WstEth.sol\n12: contract WstEth is IDerivative, Initializable, OwnableUpgradeable {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-salty", "title": "foxb868 Analysis", "severity_raw": "High", "severity": "high", "description": " Based on reviewing the Salty.IO codebase and architecture, the main objectives of the project appear to be:\n\n1. To build a decentralized exchange (DEX) with zero swap fees and automatic yield generation. \n\nThe core Pools.sol contract implements an automated market maker (AMM) model and arbitrage functionality to generate yield from swap transactions. This aligns incentives by pairing user swaps with arbitrage profits.\n\n2. To offer a native stablecoin (USDS) collateralized by WBTC/WETH.\n\nThe USDS.sol stablecoin allows borrowing against WBTC/WETH collateral. The collateral model and incentive structure around USDS aims to maintain its 1:1 peg with USD.\n\n3. To decentralize control of the platform as much as possible.\n\nSalty.IO is governed by a DAO.sol contract where SALT holders vote on protocol changes. No special admin roles or privileges exist. This ensures the platform lacks centralized points of failure.\n\n4. To bootstrap sustainable liquidity and usage of the DEX.\n\nIncentive mechanisms focus on rewarding liquidity providers with emissions and protocol revenue share. Adoption incentives are structured to make Salty.IO self-sustaining. So in summary - zero fee swaps, yield from arbitrage, USDS stablecoin, control decentralization via the DAO, and bootstrapping sustainable platform usage appear to be the main goals behind this project.\n\n## Architecture\n\nSalty.IO divides functionality into contracts reflecting the separation of concerns\n\n```diff\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 \u2502 \n\u2502 DAO.sol \u2502\n\u2502 Governance Logic \u2502\n\u2502 \u2502 \n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u2502\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Pools.sol \u2502\n\u2502 AMM + Arbitrage \u2502 \n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u2502 \n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Rewards.sol \u2502 \u2502\n\u2502 Incentives and \u2502 \u2502\n\u2502 Distribu", "vulnerable_code": "**Trust Minimization**\n\n- DAO contract is the only privileged role in Salty - avoiding single points of compromise.\n- USDS design depends on collateral health without system ability to liquidate assets in black swan events.\n", "fixed_code": "- Failure to attract liquidity makes architecture unsustainable.\n\n**Sustainability Incentives**\n\nSalty rewards liquidity with protocol fees: \n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/foxb868-Analysis.md", "collected_at": "2026-01-02T19:01:41.711712+00:00", "source_hash": "691a3f119776c8f1d165323301056807d7b60f92b634b59412271776ced4d54d", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "**Trust Minimization**\n\n- DAO contract is the only privileged role in Salty - avoiding single points of compromise.\n- USDS design depends on collateral health without system ability to liquidate assets in black swan events.\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "- Failure to attract liquidity makes architecture unsustainable.\n\n**Sustainability Incentives**\n\nSalty rewards liquidity with protocol fees: \n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "08-dopex", "title": "MaNcHaSsS Q", "severity_raw": "Unknown", "severity": "unknown", "description": "`totalWethDelegated` is not updated when user withdraws delegated WETH from contract.\n\n\n```\nfunction withdraw(\n uint256 delegateId\n ) external returns (uint256 amountWithdrawn) {\n _whenNotPaused();\n _validate(delegateId < delegates.length, 14);\n Delegate storage delegate = delegates[delegateId];\n _validate(delegate.owner == msg.sender, 9);\n\n amountWithdrawn = delegate.amount - delegate.activeCollateral;\n _validate(amountWithdrawn > 0, 15);\n delegate.amount = delegate.activeCollateral;\n\n IERC20WithBurn(weth).safeTransfer(msg.sender, amountWithdrawn);\n\n emit LogDelegateWithdraw(delegateId, amountWithdrawn);\n }\n```", "vulnerable_code": "function withdraw(\n uint256 delegateId\n ) external returns (uint256 amountWithdrawn) {\n _whenNotPaused();\n _validate(delegateId < delegates.length, 14);\n Delegate storage delegate = delegates[delegateId];\n _validate(delegate.owner == msg.sender, 9);\n\n amountWithdrawn = delegate.amount - delegate.activeCollateral;\n _validate(amountWithdrawn > 0, 15);\n delegate.amount = delegate.activeCollateral;\n\n IERC20WithBurn(weth).safeTransfer(msg.sender, amountWithdrawn);\n\n emit LogDelegateWithdraw(delegateId, amountWithdrawn);\n }", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/MaNcHaSsS-Q.md", "collected_at": "2026-01-02T18:24:51.077835+00:00", "source_hash": "6968300822ded5805d528c7f39797552dbf1ba79559ec0bdc0223fe51ec81d61", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 555, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function withdraw(\n uint256 delegateId\n ) external returns (uint256 amountWithdrawn) {\n _whenNotPaused();\n _validate(delegateId < delegates.length, 14);\n Delegate storage delegate = delegates[delegateId];\n _validate(delegate.owner == msg.sender, 9);\n\n amountWithdrawn = delegate.amount - delegate.activeCollateral;\n _validate(amountWithdrawn > 0, 15);\n delegate.amount = delegate.activeCollateral;\n\n IERC20WithBurn(weth).safeTransfer(msg.sender, amountWithdrawn);\n\n emit LogDelegateWithdraw(delegateId, amountWithdrawn);\n }", "primary_code_language": "unknown", "primary_code_char_count": 555, "all_code_blocks": "// Code block 1 (unknown):\nfunction withdraw(\n uint256 delegateId\n ) external returns (uint256 amountWithdrawn) {\n _whenNotPaused();\n _validate(delegateId < delegates.length, 14);\n Delegate storage delegate = delegates[delegateId];\n _validate(delegate.owner == msg.sender, 9);\n\n amountWithdrawn = delegate.amount - delegate.activeCollateral;\n _validate(amountWithdrawn > 0, 15);\n delegate.amount = delegate.activeCollateral;\n\n IERC20WithBurn(weth).safeTransfer(msg.sender, amountWithdrawn);\n\n emit LogDelegateWithdraw(delegateId, amountWithdrawn);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function withdraw(\n uint256 delegateId\n ) external returns (uint256 amountWithdrawn) {\n _whenNotPaused();\n _validate(delegateId < delegates.length, 14);\n Delegate storage delegate = delegates[delegateId];\n _validate(delegate.owner == msg.sender, 9);\n\n amountWithdrawn = delegate.amount - delegate.activeCollateral;\n _validate(amountWithdrawn > 0, 15);\n delegate.amount = delegate.activeCollateral;\n\n IERC20WithBurn(weth).safeTransfer(msg.sender, amountWithdrawn);\n\n emit LogDelegateWithdraw(delegateId, amountWithdrawn);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 3.3} {"source": "c4", "protocol": "03-revert-lend", "title": "0xblackskull Q", "severity_raw": "Low", "severity": "low", "description": "### If `totalRewardX64` set to 0 then there is no way to set new value\nhttps://github.com/code-423n4/2024-03-revert-lend/blob/main/src/transformers/AutoCompound.sol#L243-L247\n```\nfunction setReward(uint64 _totalRewardX64) external onlyOwner {\n //@audit-qa \n require(_totalRewardX64 <= totalRewardX64, \">totalRewardX64\");\n totalRewardX64 = _totalRewardX64;\n emit RewardUpdated(msg.sender, _totalRewardX64);\n }\n```\nMitigation: add require statement \n```\nrequire(_totalRewardX64 != 0);\n```\n\n### Need emit event in `else` block\nhttps://github.com/code-423n4/2024-03-revert-lend/blob/main/src/V3Vault.sol#L1150-L1165\n```\nfunction _updateGlobalInterest()\n internal\n returns (uint256 newDebtExchangeRateX96, uint256 newLendExchangeRateX96)\n {\n // only needs to be updated once per block (when needed)\n if (block.timestamp > lastExchangeRateUpdate) {\n (newDebtExchangeRateX96, newLendExchangeRateX96) = _calculateGlobalInterest();\n lastDebtExchangeRateX96 = newDebtExchangeRateX96;\n lastLendExchangeRateX96 = newLendExchangeRateX96;\n lastExchangeRateUpdate = block.timestamp;\n emit ExchangeRateUpdate(newDebtExchangeRateX96, newLendExchangeRateX96);\n } else {\n newDebtExchangeRateX96 = lastDebtExchangeRateX96;\n newLendExchangeRateX96 = lastLendExchangeRateX96;\n //@audit missing event, ExchangeRateUpdate(newDebtExchangeRateX96, newLendExchangeRateX96)\n }\n }\n```\n\n### operator address is not EOA checked\nAccording to Additional Context on C4 page, `Operators (which are EOA used by bots to call actions in Automator contracts)`\nhttps://github.com/code-423n4/2024-03-revert-lend/blob/main/src/automators/Automator.sol#L69-L72\n```\nfunction setOperator(address _operator, bool _active) public onlyOwner {\n emit OperatorChanged(_operator, _active);\n operators[_operator] = _active;\n }\n```\n\n### should check tokens length must ", "vulnerable_code": "function setReward(uint64 _totalRewardX64) external onlyOwner {\n //@audit-qa \n require(_totalRewardX64 <= totalRewardX64, \">totalRewardX64\");\n totalRewardX64 = _totalRewardX64;\n emit RewardUpdated(msg.sender, _totalRewardX64);\n }", "fixed_code": "require(_totalRewardX64 != 0);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/0xblackskull-Q.md", "collected_at": "2026-01-02T19:02:54.346703+00:00", "source_hash": "69716233d7c520bc7c5949fb76e732c9ab102796f3d99bccc11c39cb4239b578", "code_block_count": 4, "solidity_block_count": 0, "total_code_chars": 1329, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function setReward(uint64 _totalRewardX64) external onlyOwner {\n //@audit-qa \n require(_totalRewardX64 <= totalRewardX64, \">totalRewardX64\");\n totalRewardX64 = _totalRewardX64;\n emit RewardUpdated(msg.sender, _totalRewardX64);\n }", "primary_code_language": "unknown", "primary_code_char_count": 260, "all_code_blocks": "// Code block 1 (unknown):\nfunction setReward(uint64 _totalRewardX64) external onlyOwner {\n //@audit-qa \n require(_totalRewardX64 <= totalRewardX64, \">totalRewardX64\");\n totalRewardX64 = _totalRewardX64;\n emit RewardUpdated(msg.sender, _totalRewardX64);\n }\n\n// Code block 2 (unknown):\nrequire(_totalRewardX64 != 0);\n\n// Code block 3 (unknown):\nfunction _updateGlobalInterest()\n internal\n returns (uint256 newDebtExchangeRateX96, uint256 newLendExchangeRateX96)\n {\n // only needs to be updated once per block (when needed)\n if (block.timestamp > lastExchangeRateUpdate) {\n (newDebtExchangeRateX96, newLendExchangeRateX96) = _calculateGlobalInterest();\n lastDebtExchangeRateX96 = newDebtExchangeRateX96;\n lastLendExchangeRateX96 = newLendExchangeRateX96;\n lastExchangeRateUpdate = block.timestamp;\n emit ExchangeRateUpdate(newDebtExchangeRateX96, newLendExchangeRateX96);\n } else {\n newDebtExchangeRateX96 = lastDebtExchangeRateX96;\n newLendExchangeRateX96 = lastLendExchangeRateX96;\n //@audit missing event, ExchangeRateUpdate(newDebtExchangeRateX96, newLendExchangeRateX96)\n }\n }\n\n// Code block 4 (unknown):\nfunction setOperator(address _operator, bool _active) public onlyOwner {\n emit OperatorChanged(_operator, _active);\n operators[_operator] = _active;\n }", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "AutoCompound.sol#L243-L247, V3Vault.sol#L1150-L1165, Automator.sol#L69-L72", "github_files_list": "AutoCompound.sol, V3Vault.sol, Automator.sol", "github_refs_count": 3, "vulnerable_code_actual": "function setReward(uint64 _totalRewardX64) external onlyOwner {\n //@audit-qa \n require(_totalRewardX64 <= totalRewardX64, \">totalRewardX64\");\n totalRewardX64 = _totalRewardX64;\n emit RewardUpdated(msg.sender, _totalRewardX64);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "require(_totalRewardX64 != 0);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "08-dopex", "title": "0xMosh Q", "severity_raw": "High", "severity": "high", "description": "# L-01 : Have a nonreentrant modifier in `emergencyWithdraw` function \nThe `emergencyWithdraw` function in RpdxDecayingBonds.sol deals with eth transfers to an externel account . Exteranal calls with may reenter to the contract before state changes properly . However , having a nonreentrant modifier is always preferred . \nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/decaying-bonds/RdpxDecayingBonds.sol#L89\n# L-02: `RDPXV2CORE_ROLE` is not set in the constructor in ` PerpetualAtlanticVault.sol ` . \n`RDPXV2CORE_ROLE` has some crucial functionality in ` PerpetualAtlanticVault.sol ` contract . Having it set in the constructor should be done while deploying the contracts . However , it is not set in the constuctor. \nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/perp-vault/PerpetualAtlanticVault.sol#L113\n\n# L-03 : `_convertToAssets ` should be public . \nThe function `_convertToAssets ` is to check the amount of assets for a number of shares . This is a view function . However , this should be Public function in my opinion cause users may have to check the return amount of assets for their corresponding shares . \nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/perp-vault/PerpetualAtlanticVaultLP.sol#L218\n\n\n\n\n\n\n# NC-01 :Lack of documentation in the code \n The whole codebase lacks documentation . This issue makes it difficult to understand the code's purpose, functionality, and usage, which can lead to confusion, errors, and challenges when maintaining or extending the codebase. Proper documentation is crucial for code readability, collaboration, and long-term maintainability.\n\n# NC-02 : Function naming is not accurate of `decreaseAmount` function in RpdxDecayingBonds.sol \nThe function is intended to decrease the amount of `rdpxAmount ` . However , the function can be used to increase the `rdpxAmount ` of a bo", "vulnerable_code": "function decreaseAmount(\n uint256 bondId,\n uint256 amount\n ) public onlyRole(RDPXV2CORE_ROLE) {\n _whenNotPaused();\n bonds[bondId].rdpxAmount = amount; \n }", "fixed_code": "", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/0xMosh-Q.md", "collected_at": "2026-01-02T18:24:18.177602+00:00", "source_hash": "697cfc90cdda795ba3697864114cf49639095b9c0ec94bd39acb6d2e12014189", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "RdpxDecayingBonds.sol#L89, PerpetualAtlanticVault.sol#L113, PerpetualAtlanticVaultLP.sol#L218", "github_files_list": "PerpetualAtlanticVault.sol, RdpxDecayingBonds.sol, PerpetualAtlanticVaultLP.sol", "github_refs_count": 3, "vulnerable_code_actual": "function decreaseAmount(\n uint256 bondId,\n uint256 amount\n ) public onlyRole(RDPXV2CORE_ROLE) {\n _whenNotPaused();\n bonds[bondId].rdpxAmount = amount; \n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "03-asymmetry", "title": "Bason Q", "severity_raw": "Critical", "severity": "critical", "description": "## Low and Non-Critical Issues Summary\n| Number |Issues Details |\n|:--:|:-------|\n|[NC-01]| Use latest Solidity version\n|[NC-02]| Use stable pragma statement\n|[NC-03]| Use named imports instead of plain `import FILE.SOL`\n|[NC-04]| Constants should be defined rather than using magic numbers\n|[NC-05]| You can use named parameters in mapping types\n|[L-01]| Missing events for critical parameter changes\n|[L-02]| Possible division by 0 if contracts are configured improperly\n|[L-03]| Possible to pass address 0 in functions that pass ownership\n\n***\n\n## [NC-01] Use latest Solidity version\n\nSolidity pragma versioning should be upgraded to latest available version - 0.8.19\n\n***\n\n## |[NC-02]| Use stable pragma statement\n\nUsing a floating pragma statement `^0.8.13` is discouraged as code can compile to different bytecodes with different compiler versions. Use a stable pragma statement to get a deterministic bytecode.\n\n## |[NC-03]| Use named imports instead of plain `import FILE.SOL`\n\n**Recommendation:**\n`import {contract1, interface1} from \"filename.sol\";\n\n## |[NC-04]| Constants should be defined rather than using magic numbers\n\nSafEth.sol\nminAmount = 5 * 10 ** 17; \nmaxAmount = 200 * 10 ** 18;\npreDepositPrice = 10 ** 18;\nunderlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;\npreDepositPrice = (10 ** 18 * underlyingValue) / totalSupply\nuint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n depositAmount\n ) * depositAmount) / 10 ** 18;\n\nReth.sol\nDefine \"RocketPool\" as a private constant and return it in the method\nfunction name() public pure returns (string memory) {\n return \"RocketPool\";\n }\n***\nuint rethPerEth = (10 ** 36) / poolPrice();\nuint256 minOut = ((((rethPerEth * msg.value) / 10 ** 18) *\n ((10 ** 18 - maxSlippage))) / 10 ** 18);\n(poolPrice() * 10 ** 18) / (10 ** 18);\nfactory.getPool(rocketTokenRETHA", "vulnerable_code": "Reth.sol\nCreate a custom event DepositSuccessful(indexed address depositor)", "fixed_code": "WstEth.sol\nCreate a custom event DepositSuccessful(indexed address depositor)\nfunction deposit(\nuint256 wstEthAmount = wstEthBalancePost - wstEthBalancePre;\nemit DepositSuccessful(WST_ETH)", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Bason-Q.md", "collected_at": "2026-01-02T18:17:53.913907+00:00", "source_hash": "69cf991bb0401e8898725ddc2dcdc418a5cc7b4cdf9cd921171ab7f92c73ff2c", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "Reth.sol\nCreate a custom event DepositSuccessful(indexed address depositor)", "has_vulnerable_code_snippet": true, "fixed_code_actual": "WstEth.sol\nCreate a custom event DepositSuccessful(indexed address depositor)\nfunction deposit(\nuint256 wstEthAmount = wstEthBalancePost - wstEthBalancePre;\nemit DepositSuccessful(WST_ETH)", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-biconomy", "title": "BRONZEDISC Q", "severity_raw": "Medium", "severity": "medium", "description": "## QA\n---\n\n### Layout Order [1]\n\n- The best-practices for layout within a contract is the following order: state variables, events, modifiers, constructor and functions.\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccountFactory.sol\n\n```solidity\n// event coming after constructor\n24: event SmartAccountCreated(address indexed _proxy, address indexed _implementation, address indexed _owner, string version, uint256 _index);\n```\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/test/TestCounter.sol\n\n```solidity\n// events is coming after functions\n17: event CalledFrom(address sender);\n\n// state vars are coming after functions\n22: mapping(uint256 => uint256) public xxx;\n23: uint256 public offset;\n```\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol\n\n```solidity\n// structs should come before functions\n145: struct MemoryUserOp {\n156: struct UserOpInfo {\n```\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/base/ModuleManager.sol\n\n```solidity\n// these state variables should come before events\n16: address internal constant SENTINEL_MODULES = address(0x1);\n18: mapping(address => address) internal modules;\n```\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/common/SelfAuthorized.sol\n\n```solidity\n// modifiers should come before functions\n10: modifier authorized() {\n```\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/test/Button.sol\n\n```solidity\n// events should come after state variables\n7: event ButtonPushed(address pusher, uint256 pushes);\n```\n\n---\n\n### Function Visibility [2]\n\n- Order of Functions: Ordering helps readers identify which functions they can call and to find the con", "vulnerable_code": "// event coming after constructor\n24: event SmartAccountCreated(address indexed _proxy, address indexed _implementation, address indexed _owner, string version, uint256 _index);", "fixed_code": "// events is coming after functions\n17: event CalledFrom(address sender);\n\n// state vars are coming after functions\n22: mapping(uint256 => uint256) public xxx;\n23: uint256 public offset;", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/BRONZEDISC-Q.md", "collected_at": "2026-01-02T18:12:57.204394+00:00", "source_hash": "6a22d30580ffe9d48caa15845a2515c6f764298ccd4dbe108e901106b0c16a39", "code_block_count": 6, "solidity_block_count": 6, "total_code_chars": 814, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "// event coming after constructor\n24: event SmartAccountCreated(address indexed _proxy, address indexed _implementation, address indexed _owner, string version, uint256 _index);", "primary_code_language": "solidity", "primary_code_char_count": 180, "all_code_blocks": "// Code block 1 (solidity):\n// event coming after constructor\n24: event SmartAccountCreated(address indexed _proxy, address indexed _implementation, address indexed _owner, string version, uint256 _index);\n\n// Code block 2 (solidity):\n// events is coming after functions\n17: event CalledFrom(address sender);\n\n// state vars are coming after functions\n22: mapping(uint256 => uint256) public xxx;\n23: uint256 public offset;\n\n// Code block 3 (solidity):\n// structs should come before functions\n145: struct MemoryUserOp {\n156: struct UserOpInfo {\n\n// Code block 4 (solidity):\n// these state variables should come before events\n16: address internal constant SENTINEL_MODULES = address(0x1);\n18: mapping(address => address) internal modules;\n\n// Code block 5 (solidity):\n// modifiers should come before functions\n10: modifier authorized() {\n\n// Code block 6 (solidity):\n// events should come after state variables\n7: event ButtonPushed(address pusher, uint256 pushes);", "all_code_blocks_count": 6, "has_diff_blocks": false, "diff_code": "", "solidity_code": "// event coming after constructor\n24: event SmartAccountCreated(address indexed _proxy, address indexed _implementation, address indexed _owner, string version, uint256 _index);\n\n// events is coming after functions\n17: event CalledFrom(address sender);\n\n// state vars are coming after functions\n22: mapping(uint256 => uint256) public xxx;\n23: uint256 public offset;\n\n// structs should come before functions\n145: struct MemoryUserOp {\n156: struct UserOpInfo {\n\n// these state variables should come before events\n16: address internal constant SENTINEL_MODULES = address(0x1);\n18: mapping(address => address) internal modules;\n\n// modifiers should come before functions\n10: modifier authorized() {\n\n// events should come after state variables\n7: event ButtonPushed(address pusher, uint256 pushes);", "github_refs_formatted": "SmartAccountFactory.sol, TestCounter.sol, EntryPoint.sol, ModuleManager.sol, SelfAuthorized.sol, Button.sol", "github_files_list": "SelfAuthorized.sol, TestCounter.sol, Button.sol, SmartAccountFactory.sol, EntryPoint.sol, ModuleManager.sol", "github_refs_count": 6, "vulnerable_code_actual": "// event coming after constructor\n24: event SmartAccountCreated(address indexed _proxy, address indexed _implementation, address indexed _owner, string version, uint256 _index);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "// events is coming after functions\n17: event CalledFrom(address sender);\n\n// state vars are coming after functions\n22: mapping(uint256 => uint256) public xxx;\n23: uint256 public offset;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 12} {"source": "c4", "protocol": "03-asymmetry", "title": "caglankaan G", "severity_raw": "Critical", "severity": "critical", "description": "# Using Prefix Operators Costs Less Gas Than Postfix Operators in Loops\n\n### Description\nIn Solidity, there are two ways to increment a variable within a loop: i++ and ++i. The difference between them is that i++ is a post-increment operator, which increments the value of i after the expression has been evaluated, while ++i is a pre-increment operator, which increments the value of i before the expression has been evaluated.\n\nWhen using these operators in a loop, it is more gas-efficient to use ++i instead of i++. The reason is that the i++ operator requires an additional SSTORE operation to store the updated value of i, which consumes more gas.\n\n### Code Location \n\nApplies for all of the for loops\n```solidity\nfor (uint i = 0; i < derivativeCount; i++)\n```\n\n\n### Recommendation\nIt is recommended to use ++i instead of i++ to increment the value of a uint variable within a loop. This is not applicable outside of loops.\n\n\n# Avoid Unnecessary Initializations Of Uint256 And Bool Variable To 0/false\nThis code optimization involves avoiding the unnecessary initialization of uint256 and bool variables to 0 or false. In some cases, the code block initializes a variable to 0 or false even though it is already initialized to the same value by default, which leads to unnecessary gas consumption. This code optimization can be applied to several for loops and conditional statements in different Solidity smart contracts.\n\n\n\n### Code Example\n\nApplies for all of the for loops\n```solidity\nfor (uint i = 0; i < derivativeCount; i++) {\nfor (uint256 i = 0; i < derivativeCount; i++) {\n```\n\n### Recommendation\nTo optimize the code and reduce gas consumption, it is recommended to avoid initializing uint and bool variables to 0 or false when they are already initialized to the same value by default. Instead, simply declare the variable without an initial value, as in for (uint256 i; i < length; ++i) or bool isDone;. This will make the code more efficient and optimize the gas usage. The develop", "vulnerable_code": "for (uint i = 0; i < derivativeCount; i++)", "fixed_code": "for (uint i = 0; i < derivativeCount; i++) {\nfor (uint256 i = 0; i < derivativeCount; i++) {", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/caglankaan-G.md", "collected_at": "2026-01-02T18:18:53.958108+00:00", "source_hash": "6a2641a8c1993d3d5f17f8afe6bcf57e07084f7b564f84d65fd72f05c6142f07", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 134, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "for (uint i = 0; i < derivativeCount; i++)", "primary_code_language": "solidity", "primary_code_char_count": 42, "all_code_blocks": "// Code block 1 (solidity):\nfor (uint i = 0; i < derivativeCount; i++)\n\n// Code block 2 (solidity):\nfor (uint i = 0; i < derivativeCount; i++) {\nfor (uint256 i = 0; i < derivativeCount; i++) {", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "for (uint i = 0; i < derivativeCount; i++)\n\nfor (uint i = 0; i < derivativeCount; i++) {\nfor (uint256 i = 0; i < derivativeCount; i++) {", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "for (uint i = 0; i < derivativeCount; i++)", "has_vulnerable_code_snippet": true, "fixed_code_actual": "for (uint i = 0; i < derivativeCount; i++) {\nfor (uint256 i = 0; i < derivativeCount; i++) {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-ondo", "title": "lukris02 Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA Report for Ondo Finance contest\n## Overview\nDuring the audit, 6 non-critical issues were found.\n\u2116 | Title | Risk Rating | Instance Count\n--- | --- | --- | ---\nNC-1 | Order of Functions | Non-Critical | 9\nNC-2 | Order of Layout | Non-Critical | 13\nNC-3 | Typos | Non-Critical | 7\nNC-4 | Unused named return variables | Non-Critical | 1\nNC-5 | Missing and extra leading underscores | Non-Critical | 3\nNC-6 | Missing NatSpec | Non-Critical | 10 \n\n## Non-Critical Risk Findings(6)\n### NC-1. Order of Functions\n##### Description\nAccording to [Style Guide](https://docs.soliditylang.org/en/v0.8.16/style-guide.html#order-of-functions), ordering helps readers identify which functions they can call and to find the constructor and fallback definitions easier. \nFunctions should be grouped according to their visibility and ordered:\n1) constructor\n2) receive function (if exists)\n3) fallback function (if exists)\n4) external\n5) public\n6) internal\n7) private\n##### Instances\nExternal functions should be placed before public:\n- https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L589-L615 \n\nExternal functions should be placed before private:\n- https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L798-L876\n- https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L938-L968\n\n##### Recommendation\nReorder functions where possible.\n#\n### NC-2. Order of Layout\n##### Description\nAccording to [Order of Layout](https://docs.soliditylang.org/en/v0.8.16/style-guide.html#order-of-layout), inside each contract, library or interface, use the following order:\n1) Type declarations\n2) State variables\n3) Events\n4) Modifiers\n5) Functions\n##### Instances\nEvents should be placed right after state variables:\n- https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashFactory.sol#L143\n- https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashKYCSenderFactory.sol#L153\n- ht", "vulnerable_code": "- [```function assignRoletoKYCGroup(```](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistry.sol#L144) => ```RoleTo```\n- (L205) [```* @param addresses Array of addresses being added as elligible```](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistry.sol#L205) => ```eligible```\n- (L236) [```* @param addresses Array of addresses being added as elligible```](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistry.sol#L236) => ```eligible```\n- [```* BPS_DENOMINAOR (say 9999) and `mintFee` = 1,```](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L429) => ```DENOMINATOR```\n- [```/// @notice Error for when caller attempts to set the KYC registry refernce```](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/interfaces/IKYCRegistryClient.sol#L38) => ```reference```\n- [```* @dev Event for when a price cap is set on an fToken's underlying assset```](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/IOndoPriceOracleV2.sol#L95) => ```asset```\n\n#\n### NC-4. Unused named return variables\n##### Description\nBoth named return variable(s) and return statement are used.\n##### Instances\n- https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L784-L795\n\n##### Recommendation\nTo improve clarity use only named return variables. \nFor example, change:", "fixed_code": "to", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/lukris02-Q.md", "collected_at": "2026-01-02T18:15:16.989690+00:00", "source_hash": "6a75fca29ac9449852fb7e62c832ece98dca6ded60755ead6235664512fd4446", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 12, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CashManager.sol#L589-L615, CashManager.sol#L798-L876, CashManager.sol#L938-L968, CashFactory.sol#L143, CashKYCSenderFactory.sol#L153, KYCRegistry.sol#L144, KYCRegistry.sol#L205, KYCRegistry.sol#L236, CashManager.sol#L429, IKYCRegistryClient.sol#L38, IOndoPriceOracleV2.sol#L95, CashManager.sol#L784-L795", "github_files_list": "CashManager.sol, CashKYCSenderFactory.sol, IKYCRegistryClient.sol, IOndoPriceOracleV2.sol, CashFactory.sol, KYCRegistry.sol", "github_refs_count": 12, "vulnerable_code_actual": "- [```function assignRoletoKYCGroup(```](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistry.sol#L144) => ```RoleTo```\n- (L205) [```* @param addresses Array of addresses being added as elligible```](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistry.sol#L205) => ```eligible```\n- (L236) [```* @param addresses Array of addresses being added as elligible```](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistry.sol#L236) => ```eligible```\n- [```* BPS_DENOMINAOR (say 9999) and `mintFee` = 1,```](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L429) => ```DENOMINATOR```\n- [```/// @notice Error for when caller attempts to set the KYC registry refernce```](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/interfaces/IKYCRegistryClient.sol#L38) => ```reference```\n- [```* @dev Event for when a price cap is set on an fToken's underlying assset```](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/IOndoPriceOracleV2.sol#L95) => ```asset```\n\n#\n### NC-4. Unused named return variables\n##### Description\nBoth named return variable(s) and return statement are used.\n##### Instances\n- https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L784-L795\n\n##### Recommendation\nTo improve clarity use only named return variables. \nFor example, change:", "has_vulnerable_code_snippet": true, "fixed_code_actual": "to", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "03-revert-lend", "title": "Topmark Q", "severity_raw": "Low", "severity": "low", "description": "### Report 1:\n#### No KinkX96 Boundary Validation\nAs noted from the code provided below in the InterestRateModel contract, it can be noted that `kinkX96` is set without any form of validation like the other variables, this would allow owner to unfairly set value that could break protocol functionality, this should be corrected by setting boundaries for this state update\nhttps://github.com/code-423n4/2024-03-revert-lend/blob/main/src/InterestRateModel.sol#L98\n```solidity\n function setValues(\n uint256 baseRatePerYearX96,\n uint256 multiplierPerYearX96,\n uint256 jumpMultiplierPerYearX96,\n uint256 _kinkX96\n ) public onlyOwner {\n if (\n baseRatePerYearX96 > MAX_BASE_RATE_X96 || multiplierPerYearX96 > MAX_MULTIPLIER_X96\n || jumpMultiplierPerYearX96 > MAX_MULTIPLIER_X96\n ) {\n revert InvalidConfig();\n }\n\n baseRatePerSecondX96 = baseRatePerYearX96 / YEAR_SECS;\n multiplierPerSecondX96 = multiplierPerYearX96 / YEAR_SECS;\n jumpMultiplierPerSecondX96 = jumpMultiplierPerYearX96 / YEAR_SECS;\n>>> kinkX96 = _kinkX96;\n\n emit SetValues(baseRatePerYearX96, multiplierPerYearX96, jumpMultiplierPerYearX96, _kinkX96);\n }\n```\n### Report 2:\n#### Contradictory Derivation of Lent in V3Vault contract\nAs noted from the pointer in the code provided below, lent was first derived using totalSupply() and Math.Rounding.Up, however on the other hand in the lendInfo() function, lend amount was derived using balanceOf(account) and Math.Rounding.Down, which is contradictory to each other\nhttps://github.com/code-423n4/2024-03-revert-lend/blob/main/src/V3Vault.sol#L213\nhttps://github.com/code-423n4/2024-03-revert-lend/blob/main/src/V3Vault.sol#L221\n```solidity\n function vaultInfo()\n external\n view\n override\n returns (\n uint256 debt,\n uint256 lent,\n uint256 balance,\n uint256 available,\n uint256 reserv", "vulnerable_code": " function setValues(\n uint256 baseRatePerYearX96,\n uint256 multiplierPerYearX96,\n uint256 jumpMultiplierPerYearX96,\n uint256 _kinkX96\n ) public onlyOwner {\n if (\n baseRatePerYearX96 > MAX_BASE_RATE_X96 || multiplierPerYearX96 > MAX_MULTIPLIER_X96\n || jumpMultiplierPerYearX96 > MAX_MULTIPLIER_X96\n ) {\n revert InvalidConfig();\n }\n\n baseRatePerSecondX96 = baseRatePerYearX96 / YEAR_SECS;\n multiplierPerSecondX96 = multiplierPerYearX96 / YEAR_SECS;\n jumpMultiplierPerSecondX96 = jumpMultiplierPerYearX96 / YEAR_SECS;\n>>> kinkX96 = _kinkX96;\n\n emit SetValues(baseRatePerYearX96, multiplierPerYearX96, jumpMultiplierPerYearX96, _kinkX96);\n }", "fixed_code": " function vaultInfo()\n external\n view\n override\n returns (\n uint256 debt,\n uint256 lent,\n uint256 balance,\n uint256 available,\n uint256 reserves,\n uint256 debtExchangeRateX96,\n uint256 lendExchangeRateX96\n )\n {\n (debtExchangeRateX96, lendExchangeRateX96) = _calculateGlobalInterest();\n (balance, available, reserves) = _getAvailableBalance(debtExchangeRateX96, lendExchangeRateX96);\n\n debt = _convertToAssets(debtSharesTotal, debtExchangeRateX96, Math.Rounding.Up);\n>>> lent = _convertToAssets(totalSupply(), lendExchangeRateX96, Math.Rounding.Up);\n }\n\n /// @notice Retrieves lending information for a specified account.\n /// @param account The address of the account for which lending info is requested.\n /// @return amount Amount of lent assets for the account\n function lendInfo(address account) external view override returns (uint256 amount) {\n (, uint256 newLendExchangeRateX96) = _calculateGlobalInterest();\n>>> amount = _convertToAssets(balanceOf(account), newLendExchangeRateX96, Math.Rounding.Down);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/Topmark-Q.md", "collected_at": "2026-01-02T19:03:05.973559+00:00", "source_hash": "6aadc0a2e8db01c465e7e6381af5b965a37851390a2549680455052c5d17b0ae", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 763, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function setValues(\n uint256 baseRatePerYearX96,\n uint256 multiplierPerYearX96,\n uint256 jumpMultiplierPerYearX96,\n uint256 _kinkX96\n ) public onlyOwner {\n if (\n baseRatePerYearX96 > MAX_BASE_RATE_X96 || multiplierPerYearX96 > MAX_MULTIPLIER_X96\n || jumpMultiplierPerYearX96 > MAX_MULTIPLIER_X96\n ) {\n revert InvalidConfig();\n }\n\n baseRatePerSecondX96 = baseRatePerYearX96 / YEAR_SECS;\n multiplierPerSecondX96 = multiplierPerYearX96 / YEAR_SECS;\n jumpMultiplierPerSecondX96 = jumpMultiplierPerYearX96 / YEAR_SECS;\n>>> kinkX96 = _kinkX96;\n\n emit SetValues(baseRatePerYearX96, multiplierPerYearX96, jumpMultiplierPerYearX96, _kinkX96);\n }", "primary_code_language": "solidity", "primary_code_char_count": 763, "all_code_blocks": "// Code block 1 (solidity):\nfunction setValues(\n uint256 baseRatePerYearX96,\n uint256 multiplierPerYearX96,\n uint256 jumpMultiplierPerYearX96,\n uint256 _kinkX96\n ) public onlyOwner {\n if (\n baseRatePerYearX96 > MAX_BASE_RATE_X96 || multiplierPerYearX96 > MAX_MULTIPLIER_X96\n || jumpMultiplierPerYearX96 > MAX_MULTIPLIER_X96\n ) {\n revert InvalidConfig();\n }\n\n baseRatePerSecondX96 = baseRatePerYearX96 / YEAR_SECS;\n multiplierPerSecondX96 = multiplierPerYearX96 / YEAR_SECS;\n jumpMultiplierPerSecondX96 = jumpMultiplierPerYearX96 / YEAR_SECS;\n>>> kinkX96 = _kinkX96;\n\n emit SetValues(baseRatePerYearX96, multiplierPerYearX96, jumpMultiplierPerYearX96, _kinkX96);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function setValues(\n uint256 baseRatePerYearX96,\n uint256 multiplierPerYearX96,\n uint256 jumpMultiplierPerYearX96,\n uint256 _kinkX96\n ) public onlyOwner {\n if (\n baseRatePerYearX96 > MAX_BASE_RATE_X96 || multiplierPerYearX96 > MAX_MULTIPLIER_X96\n || jumpMultiplierPerYearX96 > MAX_MULTIPLIER_X96\n ) {\n revert InvalidConfig();\n }\n\n baseRatePerSecondX96 = baseRatePerYearX96 / YEAR_SECS;\n multiplierPerSecondX96 = multiplierPerYearX96 / YEAR_SECS;\n jumpMultiplierPerSecondX96 = jumpMultiplierPerYearX96 / YEAR_SECS;\n>>> kinkX96 = _kinkX96;\n\n emit SetValues(baseRatePerYearX96, multiplierPerYearX96, jumpMultiplierPerYearX96, _kinkX96);\n }", "github_refs_formatted": "InterestRateModel.sol#L98, V3Vault.sol#L213, V3Vault.sol#L221", "github_files_list": "V3Vault.sol, InterestRateModel.sol", "github_refs_count": 3, "vulnerable_code_actual": " function setValues(\n uint256 baseRatePerYearX96,\n uint256 multiplierPerYearX96,\n uint256 jumpMultiplierPerYearX96,\n uint256 _kinkX96\n ) public onlyOwner {\n if (\n baseRatePerYearX96 > MAX_BASE_RATE_X96 || multiplierPerYearX96 > MAX_MULTIPLIER_X96\n || jumpMultiplierPerYearX96 > MAX_MULTIPLIER_X96\n ) {\n revert InvalidConfig();\n }\n\n baseRatePerSecondX96 = baseRatePerYearX96 / YEAR_SECS;\n multiplierPerSecondX96 = multiplierPerYearX96 / YEAR_SECS;\n jumpMultiplierPerSecondX96 = jumpMultiplierPerYearX96 / YEAR_SECS;\n>>> kinkX96 = _kinkX96;\n\n emit SetValues(baseRatePerYearX96, multiplierPerYearX96, jumpMultiplierPerYearX96, _kinkX96);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function vaultInfo()\n external\n view\n override\n returns (\n uint256 debt,\n uint256 lent,\n uint256 balance,\n uint256 available,\n uint256 reserves,\n uint256 debtExchangeRateX96,\n uint256 lendExchangeRateX96\n )\n {\n (debtExchangeRateX96, lendExchangeRateX96) = _calculateGlobalInterest();\n (balance, available, reserves) = _getAvailableBalance(debtExchangeRateX96, lendExchangeRateX96);\n\n debt = _convertToAssets(debtSharesTotal, debtExchangeRateX96, Math.Rounding.Up);\n>>> lent = _convertToAssets(totalSupply(), lendExchangeRateX96, Math.Rounding.Up);\n }\n\n /// @notice Retrieves lending information for a specified account.\n /// @param account The address of the account for which lending info is requested.\n /// @return amount Amount of lent assets for the account\n function lendInfo(address account) external view override returns (uint256 amount) {\n (, uint256 newLendExchangeRateX96) = _calculateGlobalInterest();\n>>> amount = _convertToAssets(balanceOf(account), newLendExchangeRateX96, Math.Rounding.Down);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "11-kelp", "title": "lsaudit G", "severity_raw": "High", "severity": "high", "description": "# [G-01] Redundant variable in `LRTConfigRoleChecker.sol`\n\n[File: LRTConfigRoleChecker.sol](https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/utils/LRTConfigRoleChecker.sol#L27-L33)\n```\n modifier onlyLRTAdmin() {\n bytes32 DEFAULT_ADMIN_ROLE = 0x00;\n if (!IAccessControl(address(lrtConfig)).hasRole(DEFAULT_ADMIN_ROLE, msg.sender)) {\n revert ILRTConfig.CallerNotLRTConfigAdmin();\n }\n _;\n }\n```\n\nVariable `DEFAULT_ADMIN_ROLE` is used only once, thus it does not need to be declared at all:\n\n```\n modifier onlyLRTAdmin() {\n if (!IAccessControl(address(lrtConfig)).hasRole(0x00, msg.sender)) {\n revert ILRTConfig.CallerNotLRTConfigAdmin();\n }\n _;\n }\n```\n\n\n# [G-02] Redundant variables is `LRTOracle.sol`\n\n[File: LRTOracle.sol](https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTOracle.sol#L52-L73)\n```\n function getRSETHPrice() external view returns (uint256 rsETHPrice) {\n address rsETHTokenAddress = lrtConfig.rsETH();\n uint256 rsEthSupply = IRSETH(rsETHTokenAddress).totalSupply();\n\n if (rsEthSupply == 0) {\n return 1 ether;\n }\n\n uint256 totalETHInPool;\n address lrtDepositPoolAddr = lrtConfig.getContract(LRTConstants.LRT_DEPOSIT_POOL);\n\n address[] memory supportedAssets = lrtConfig.getSupportedAssetList();\n uint256 supportedAssetCount = supportedAssets.length;\n\n for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n address asset = supportedAssets[asset_idx];\n uint256 assetER = getAssetPrice(asset);\n\n uint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);\n totalETHInPool += totalAssetAmt * assetER;\n\n unchecked {\n ++asset_idx;\n }\n }\n\n return totalETHInPool / rsEthSupply;\n }\n```\n\n\nVariables `rsETHTokenAddress", "vulnerable_code": " modifier onlyLRTAdmin() {\n bytes32 DEFAULT_ADMIN_ROLE = 0x00;\n if (!IAccessControl(address(lrtConfig)).hasRole(DEFAULT_ADMIN_ROLE, msg.sender)) {\n revert ILRTConfig.CallerNotLRTConfigAdmin();\n }\n _;\n }", "fixed_code": " modifier onlyLRTAdmin() {\n if (!IAccessControl(address(lrtConfig)).hasRole(0x00, msg.sender)) {\n revert ILRTConfig.CallerNotLRTConfigAdmin();\n }\n _;\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/lsaudit-G.md", "collected_at": "2026-01-02T18:28:13.606681+00:00", "source_hash": "6ab3d40ab932cd1cfe0c010c74c753167577afecc8617770d8ee28a9aca1dd9e", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 1424, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "modifier onlyLRTAdmin() {\n bytes32 DEFAULT_ADMIN_ROLE = 0x00;\n if (!IAccessControl(address(lrtConfig)).hasRole(DEFAULT_ADMIN_ROLE, msg.sender)) {\n revert ILRTConfig.CallerNotLRTConfigAdmin();\n }\n _;\n }", "primary_code_language": "unknown", "primary_code_char_count": 243, "all_code_blocks": "// Code block 1 (unknown):\nmodifier onlyLRTAdmin() {\n bytes32 DEFAULT_ADMIN_ROLE = 0x00;\n if (!IAccessControl(address(lrtConfig)).hasRole(DEFAULT_ADMIN_ROLE, msg.sender)) {\n revert ILRTConfig.CallerNotLRTConfigAdmin();\n }\n _;\n }\n\n// Code block 2 (unknown):\nmodifier onlyLRTAdmin() {\n if (!IAccessControl(address(lrtConfig)).hasRole(0x00, msg.sender)) {\n revert ILRTConfig.CallerNotLRTConfigAdmin();\n }\n _;\n }\n\n// Code block 3 (unknown):\nfunction getRSETHPrice() external view returns (uint256 rsETHPrice) {\n address rsETHTokenAddress = lrtConfig.rsETH();\n uint256 rsEthSupply = IRSETH(rsETHTokenAddress).totalSupply();\n\n if (rsEthSupply == 0) {\n return 1 ether;\n }\n\n uint256 totalETHInPool;\n address lrtDepositPoolAddr = lrtConfig.getContract(LRTConstants.LRT_DEPOSIT_POOL);\n\n address[] memory supportedAssets = lrtConfig.getSupportedAssetList();\n uint256 supportedAssetCount = supportedAssets.length;\n\n for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n address asset = supportedAssets[asset_idx];\n uint256 assetER = getAssetPrice(asset);\n\n uint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);\n totalETHInPool += totalAssetAmt * assetER;\n\n unchecked {\n ++asset_idx;\n }\n }\n\n return totalETHInPool / rsEthSupply;\n }", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LRTConfigRoleChecker.sol#L27-L33, LRTOracle.sol#L52-L73", "github_files_list": "LRTOracle.sol, LRTConfigRoleChecker.sol", "github_refs_count": 2, "vulnerable_code_actual": " modifier onlyLRTAdmin() {\n bytes32 DEFAULT_ADMIN_ROLE = 0x00;\n if (!IAccessControl(address(lrtConfig)).hasRole(DEFAULT_ADMIN_ROLE, msg.sender)) {\n revert ILRTConfig.CallerNotLRTConfigAdmin();\n }\n _;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " modifier onlyLRTAdmin() {\n if (!IAccessControl(address(lrtConfig)).hasRole(0x00, msg.sender)) {\n revert ILRTConfig.CallerNotLRTConfigAdmin();\n }\n _;\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "10-badger", "title": "kinggvd G", "severity_raw": "Low", "severity": "low", "description": "The code below may produce timeouts even if the response did not actually timeout and returned a valid response due to ms difference, thus wasting resources. Consider adding a small buffer when _response.success == true.\n\n```\n function _responseTimeout(uint256 _timestamp, uint256 _timeout) internal view returns (bool) {\n return block.timestamp - _timestamp > _timeout;\n }\n\nto\n\n function _responseTimeout(uint256 _timestamp, uint256 _timeout, uint256 _eps) internal view returns (bool) {\n return block.timestamp - _timestamp > _timeout + _eps;\n }\n```\n\nin e.g\n```\n function _chainlinkIsFrozen(ChainlinkResponse memory _response) internal view returns (bool) {\n return\n _responseTimeout(_response.timestampEthBtc, TIMEOUT_ETH_BTC_FEED) ||\n _responseTimeout(_response.timestampStEthEth, TIMEOUT_STETH_ETH_FEED);\n }\n\n function _fallbackIsFrozen(\n FallbackResponse memory _fallbackResponse\n ) internal view returns (bool) {\n return\n _fallbackResponse.timestamp > 0 &&\n _responseTimeout(_fallbackResponse.timestamp, fallbackCaller.fallbackTimeout());\n }\n```", "vulnerable_code": " function _responseTimeout(uint256 _timestamp, uint256 _timeout) internal view returns (bool) {\n return block.timestamp - _timestamp > _timeout;\n }\n\nto\n\n function _responseTimeout(uint256 _timestamp, uint256 _timeout, uint256 _eps) internal view returns (bool) {\n return block.timestamp - _timestamp > _timeout + _eps;\n }", "fixed_code": " function _chainlinkIsFrozen(ChainlinkResponse memory _response) internal view returns (bool) {\n return\n _responseTimeout(_response.timestampEthBtc, TIMEOUT_ETH_BTC_FEED) ||\n _responseTimeout(_response.timestampStEthEth, TIMEOUT_STETH_ETH_FEED);\n }\n\n function _fallbackIsFrozen(\n FallbackResponse memory _fallbackResponse\n ) internal view returns (bool) {\n return\n _fallbackResponse.timestamp > 0 &&\n _responseTimeout(_fallbackResponse.timestamp, fallbackCaller.fallbackTimeout());\n }", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/kinggvd-G.md", "collected_at": "2026-01-02T18:26:53.360878+00:00", "source_hash": "6aeb1fcf909ca627e3c6badb25b76aa33b770ccbdb552600b09e7bfc724e2818", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 903, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _responseTimeout(uint256 _timestamp, uint256 _timeout) internal view returns (bool) {\n return block.timestamp - _timestamp > _timeout;\n }\n\nto\n\n function _responseTimeout(uint256 _timestamp, uint256 _timeout, uint256 _eps) internal view returns (bool) {\n return block.timestamp - _timestamp > _timeout + _eps;\n }", "primary_code_language": "unknown", "primary_code_char_count": 343, "all_code_blocks": "// Code block 1 (unknown):\nfunction _responseTimeout(uint256 _timestamp, uint256 _timeout) internal view returns (bool) {\n return block.timestamp - _timestamp > _timeout;\n }\n\nto\n\n function _responseTimeout(uint256 _timestamp, uint256 _timeout, uint256 _eps) internal view returns (bool) {\n return block.timestamp - _timestamp > _timeout + _eps;\n }\n\n// Code block 2 (unknown):\nfunction _chainlinkIsFrozen(ChainlinkResponse memory _response) internal view returns (bool) {\n return\n _responseTimeout(_response.timestampEthBtc, TIMEOUT_ETH_BTC_FEED) ||\n _responseTimeout(_response.timestampStEthEth, TIMEOUT_STETH_ETH_FEED);\n }\n\n function _fallbackIsFrozen(\n FallbackResponse memory _fallbackResponse\n ) internal view returns (bool) {\n return\n _fallbackResponse.timestamp > 0 &&\n _responseTimeout(_fallbackResponse.timestamp, fallbackCaller.fallbackTimeout());\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function _responseTimeout(uint256 _timestamp, uint256 _timeout) internal view returns (bool) {\n return block.timestamp - _timestamp > _timeout;\n }\n\nto\n\n function _responseTimeout(uint256 _timestamp, uint256 _timeout, uint256 _eps) internal view returns (bool) {\n return block.timestamp - _timestamp > _timeout + _eps;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function _chainlinkIsFrozen(ChainlinkResponse memory _response) internal view returns (bool) {\n return\n _responseTimeout(_response.timestampEthBtc, TIMEOUT_ETH_BTC_FEED) ||\n _responseTimeout(_response.timestampStEthEth, TIMEOUT_STETH_ETH_FEED);\n }\n\n function _fallbackIsFrozen(\n FallbackResponse memory _fallbackResponse\n ) internal view returns (bool) {\n return\n _fallbackResponse.timestamp > 0 &&\n _responseTimeout(_fallbackResponse.timestamp, fallbackCaller.fallbackTimeout());\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6.32} {"source": "c4", "protocol": "01-salty", "title": "Rolezn Q", "severity_raw": "Critical", "severity": "critical", "description": "## QA Summary\n\n### QA Issues\n| |Issue|Contexts|\n|-|:-|:-:|\n| [QA‑1](#QA‑1) | `address wallet` in `USDS.mintTo()` can be `address(collateralAndLiquidity)` | 1 |\n| [QA‑2](#QA‑2) | `ecrecover` may return empty address | 1 |\n| [QA‑3](#QA‑3) | `forceApprove` should be used instead of `approve` | 4 |\n| [QA‑4](#QA‑4) | The Contract Should `approve(0)` First | 8 |\n| [QA‑5](#QA‑5) | `address` shouldn't be hard-coded | 1 |\n| [QA‑6](#QA‑6) | Change contract's `mint` model | 1 |\n| [QA‑7](#QA‑7) | Functions calling contracts/addresses with transfer hooks are missing reentrancy guards | 2 |\n| [QA‑8](#QA‑8) | A function which defines named returns in it's declaration doesn't need to use return | 42 |\n| [QA‑9](#QA‑9) | Use `delete` to Clear Variables | 6 |\n| [QA‑10](#QA‑10) | Incorrect withdraw declaration | 2 |\n| [QA‑11](#QA‑11) | Off-by-one timestamp error | 8 |\n| [QA‑12](#QA‑12) | Redundant Cast | 1 |\n| [QA‑13](#QA‑13) | Indexed strings should be removed | 1 |\n\nTotal: 78 contexts over 13 issues\n\n## QA Issues\n\n### [QA‑1] `address wallet` in `USDS.mintTo()` can be `address(collateralAndLiquidity)`\n\nSince the only caller can be `address(collateralAndLiquidity)` according to `require( msg.sender == address(collateralAndLiquidity), \"USDS.mintTo is only callable from the Collateral contract\" );`\nWe can see that in `CollateralAndLiquidity.borrowUSDS()` calls for `usds.mintTo( msg.sender, amountBorrowed );`\nAs a result, we can remove `address wallet` and simply call to `_mint(address(collateralAndLiquidity), amount);`\n\n#### Proof Of Concept\n\n```solidity\nFile: USDS.sol\n\n40: function mintTo( address wallet, uint256 amount ) external\n\t\t{\n\t\trequire( msg.sender == address(collateralAndLiquidity), \"USDS.mintTo is only callable f", "vulnerable_code": "File: USDS.sol\n\n40: function mintTo( address wallet, uint256 amount ) external\n\t\t{\n\t\trequire( msg.sender == address(collateralAndLiquidity), \"USDS.mintTo is only callable from the Collateral contract\" );\n\t\trequire( amount > 0, \"Cannot mint zero USDS\" );\n\n\t\t_mint( wallet, amount );\n\n\t\temit USDSMinted(wallet, amount);\n\t\t}\n", "fixed_code": "File: SigningTools.sol\n\n26: address recoveredAddress = ecrecover(messageHash, v, r, s);", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/Rolezn-Q.md", "collected_at": "2026-01-02T19:01:27.766697+00:00", "source_hash": "6af565ee3e5a93136bc8328dc76d25c3a36b24f25628406ccbd1c819df73aad3", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: USDS.sol\n\n40: function mintTo( address wallet, uint256 amount ) external\n\t\t{\n\t\trequire( msg.sender == address(collateralAndLiquidity), \"USDS.mintTo is only callable from the Collateral contract\" );\n\t\trequire( amount > 0, \"Cannot mint zero USDS\" );\n\n\t\t_mint( wallet, amount );\n\n\t\temit USDSMinted(wallet, amount);\n\t\t}\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: SigningTools.sol\n\n26: address recoveredAddress = ecrecover(messageHash, v, r, s);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "08-dopex", "title": "MiniGlome Q", "severity_raw": "Low", "severity": "low", "description": "## [LOW] Emited event is always address(0)\nIn `UniV3LiquidityAmo::removeLiquidity()` the event `log()` is emited with a mapping element that has just been deleted as parameter. This will always log `address(0)`.\n```solidity\nFile UniV3LiquidityAmo.sol\n\nL263: delete positions_mapping[pos.token_id]; //@audit delete mapping element\n\n // send tokens to rdpxV2Core\n _sendTokensToRdpxV2Core(tokenA, tokenB);\n\n emit log(positions_array.length);\n emit log(positions_mapping[pos.token_id].token_id); //@audit has just been deleted\n```\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/amo/UniV3LiquidityAmo.sol#L269\n\n## [LOW] `UniV3LiquidityAmo` will stop working in 2036\nIn `UniV3LiquidityAmo::swap()` the deadline parameter of the swap configuration is hardcoded to `2105300114` which is the unix timestamp of `17 September 2036`. That means that all swaps will revert after this date and the function will become unusable.\n```solidity\nFile UniV3LiquidityAmo.sol\n\nL289: ISwapRouter.ExactInputSingleParams memory swap_params = ISwapRouter\n .ExactInputSingleParams(\n _tokenA,\n _tokenB,\n _fee_tier,\n address(this),\n 2105300114, // Expiration: a long time from now //@audit Deadline is in 13 years (2036)\n _amountAtoB,\n _amountOutMinimum,\n _sqrtPriceLimitX96\n );\n\n // Approval\n TransferHelper.safeApprove(_tokenA, address(univ3_router), _amountAtoB);\n\n uint256 amountOut = univ3_router.exactInputSingle(swap_params);\n```\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/amo/UniV3LiquidityAmo.sol#L295\n\n## [QA] Wrong revert messages\n*Instances(6)*\n```solidity\nFile UniV2LiquidityAmo.sol\n\nL91: \"reLPContract: address cannot be 0\" //@audit should be \"UniV2LiquidityAmo: address cannot be 0\"\n\nL114: \"reLPContract: slippage tolerance must be greater than 0\" //@audit same typo\n\nL131: require(_token != address(0), \"reLPContract", "vulnerable_code": "File UniV3LiquidityAmo.sol\n\nL263: delete positions_mapping[pos.token_id]; //@audit delete mapping element\n\n // send tokens to rdpxV2Core\n _sendTokensToRdpxV2Core(tokenA, tokenB);\n\n emit log(positions_array.length);\n emit log(positions_mapping[pos.token_id].token_id); //@audit has just been deleted", "fixed_code": "File UniV3LiquidityAmo.sol\n\nL289: ISwapRouter.ExactInputSingleParams memory swap_params = ISwapRouter\n .ExactInputSingleParams(\n _tokenA,\n _tokenB,\n _fee_tier,\n address(this),\n 2105300114, // Expiration: a long time from now //@audit Deadline is in 13 years (2036)\n _amountAtoB,\n _amountOutMinimum,\n _sqrtPriceLimitX96\n );\n\n // Approval\n TransferHelper.safeApprove(_tokenA, address(univ3_router), _amountAtoB);\n\n uint256 amountOut = univ3_router.exactInputSingle(swap_params);", "recommendation": "", "category": "slippage", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/MiniGlome-Q.md", "collected_at": "2026-01-02T18:24:54.227319+00:00", "source_hash": "6afeb1f802185efca6b0fd90a0b37dfdc65c459815aaf846f754e80a751eac94", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 861, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File UniV3LiquidityAmo.sol\n\nL263: delete positions_mapping[pos.token_id]; //@audit delete mapping element\n\n // send tokens to rdpxV2Core\n _sendTokensToRdpxV2Core(tokenA, tokenB);\n\n emit log(positions_array.length);\n emit log(positions_mapping[pos.token_id].token_id); //@audit has just been deleted", "primary_code_language": "solidity", "primary_code_char_count": 310, "all_code_blocks": "// Code block 1 (solidity):\nFile UniV3LiquidityAmo.sol\n\nL263: delete positions_mapping[pos.token_id]; //@audit delete mapping element\n\n // send tokens to rdpxV2Core\n _sendTokensToRdpxV2Core(tokenA, tokenB);\n\n emit log(positions_array.length);\n emit log(positions_mapping[pos.token_id].token_id); //@audit has just been deleted\n\n// Code block 2 (solidity):\nFile UniV3LiquidityAmo.sol\n\nL289: ISwapRouter.ExactInputSingleParams memory swap_params = ISwapRouter\n .ExactInputSingleParams(\n _tokenA,\n _tokenB,\n _fee_tier,\n address(this),\n 2105300114, // Expiration: a long time from now //@audit Deadline is in 13 years (2036)\n _amountAtoB,\n _amountOutMinimum,\n _sqrtPriceLimitX96\n );\n\n // Approval\n TransferHelper.safeApprove(_tokenA, address(univ3_router), _amountAtoB);\n\n uint256 amountOut = univ3_router.exactInputSingle(swap_params);", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File UniV3LiquidityAmo.sol\n\nL263: delete positions_mapping[pos.token_id]; //@audit delete mapping element\n\n // send tokens to rdpxV2Core\n _sendTokensToRdpxV2Core(tokenA, tokenB);\n\n emit log(positions_array.length);\n emit log(positions_mapping[pos.token_id].token_id); //@audit has just been deleted\n\nFile UniV3LiquidityAmo.sol\n\nL289: ISwapRouter.ExactInputSingleParams memory swap_params = ISwapRouter\n .ExactInputSingleParams(\n _tokenA,\n _tokenB,\n _fee_tier,\n address(this),\n 2105300114, // Expiration: a long time from now //@audit Deadline is in 13 years (2036)\n _amountAtoB,\n _amountOutMinimum,\n _sqrtPriceLimitX96\n );\n\n // Approval\n TransferHelper.safeApprove(_tokenA, address(univ3_router), _amountAtoB);\n\n uint256 amountOut = univ3_router.exactInputSingle(swap_params);", "github_refs_formatted": "UniV3LiquidityAmo.sol#L269, UniV3LiquidityAmo.sol#L295", "github_files_list": "UniV3LiquidityAmo.sol", "github_refs_count": 2, "vulnerable_code_actual": "File UniV3LiquidityAmo.sol\n\nL263: delete positions_mapping[pos.token_id]; //@audit delete mapping element\n\n // send tokens to rdpxV2Core\n _sendTokensToRdpxV2Core(tokenA, tokenB);\n\n emit log(positions_array.length);\n emit log(positions_mapping[pos.token_id].token_id); //@audit has just been deleted", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File UniV3LiquidityAmo.sol\n\nL289: ISwapRouter.ExactInputSingleParams memory swap_params = ISwapRouter\n .ExactInputSingleParams(\n _tokenA,\n _tokenB,\n _fee_tier,\n address(this),\n 2105300114, // Expiration: a long time from now //@audit Deadline is in 13 years (2036)\n _amountAtoB,\n _amountOutMinimum,\n _sqrtPriceLimitX96\n );\n\n // Approval\n TransferHelper.safeApprove(_tokenA, address(univ3_router), _amountAtoB);\n\n uint256 amountOut = univ3_router.exactInputSingle(swap_params);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "02-ethos", "title": "orion Q", "severity_raw": "High", "severity": "high", "description": "Price is not checks when opening//closing trove\n\n## Impact\nContract can return unintended results if collateral price is not configured yet\n\n## Proof of Concept\nThe open/close trove functionalities takes the price of the collateral from the price feed contract :\n\n```\n vars.price = priceFeed.fetchPrice(_collateral);\n...\n\nuint price = priceFeed.fetchPrice(_collateral);\n```\n\nHowever the prices are used direcctly with the logic with no checks that these are higher than 0, when opening the trove may allows the attacker to get the collateral higher than he is supposed to be when the collateral is not registeres on chainlink or tellor, the same when closing the trove if the price is moved to 0 \n\n## Tools Used\nManual\n\n## Recommended Mitigation Steps :\nOnce the price is fetched from the priceFeed it's better to check that it's valid (higher than 0)\n\n", "vulnerable_code": " vars.price = priceFeed.fetchPrice(_collateral);\n...\n\nuint price = priceFeed.fetchPrice(_collateral);", "fixed_code": "", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/orion-Q.md", "collected_at": "2026-01-02T18:17:25.776249+00:00", "source_hash": "6b067851f4a1976602360075387c024b7d811c0b2078207e19ee8bff9d094fb7", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 100, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "vars.price = priceFeed.fetchPrice(_collateral);\n...\n\nuint price = priceFeed.fetchPrice(_collateral);", "primary_code_language": "unknown", "primary_code_char_count": 100, "all_code_blocks": "// Code block 1 (unknown):\nvars.price = priceFeed.fetchPrice(_collateral);\n...\n\nuint price = priceFeed.fetchPrice(_collateral);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " vars.price = priceFeed.fetchPrice(_collateral);\n...\n\nuint price = priceFeed.fetchPrice(_collateral);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 3.71} {"source": "c4", "protocol": "03-asymmetry", "title": "0xnev Q", "severity_raw": "Critical", "severity": "critical", "description": "### Issues Template\n| Letter | Name | Description |\n|:--:|:-------:|:-------:|\n| L | Low risk | Potential risk |\n| NC | Non-critical | Non risky findings |\n| R | Refactor | Code changes |\n| O | Ordinary | Commonly found issues |\n\n| Total Found Issues | 28 |\n|:--:|:--:|\n\n### Low Risk Template\n| Count | Title | Instances |\n|:--:|:-------|:--:|\n| [L-01] | Critical address changes should use 2 step procedure | 4 |\n| [L-02] | Remove unnecessary `receive() external payable`| 4 |\n| [L-03] | `onlyOwner` modifier not needed in `SafEth.setMaxSlippage`| 1 |\n\n| Total Low Risk Issues | 3 |\n|:--:|:--:|\n\n### Non-Critical Template\n| Count | Title | Instances |\n|:--:|:-------|:--:|\n| [N-01] | Implement checks for input validation for extra safety in setters | 7 |\n| [N-02] | Missing event for critical parameters init and change | 3 |\n| [N-03] | Omission of important parameters in events emitted | 5 |\n| [N-04] | Missing zero-address checks for `initialize` functions | 4 |\n| [N-05] |Upgradeable contract is missing a `__gap[50]` storage variable to allow for new storage variables in later versions | 4 |\n| [N-06] | Insufficient Coverage | 3 |\n| [N-07] | Add timelock to critical functions | 5 |\n\n| Total Non-Critical Issues | 7 |\n|:--:|:--:|\n\n### Refactor Issues Template\n| Count | Title | Instances |\n|:--:|:-------|:--:|\n| [R-01] | Upgradeable contract is missing a `__gap[50]` storage variable to allow for new storage variables in later versions | 1 |\n| [R-02] | Use scientific notation (e.g. 1e18) rather than exponentiation (e.g. 10**18) | 23 |\n| [R-03] | Use `string.concat() ` instead of `abi.encodePacked()` | 6 |\n| [R-04] | String constants used in multiple places should be defined as constants | 6 |\n| [R-05] | Use ternary operators to shorten if/else statements | 2 |\n| [R-06] | Indent logic in for loops in code blocks {} correctly | 2 |\n| [R-07] | Should not allow `_weight` parameter to be set as zero | 2 |\n| [R-08] | Use of `uint` and `uint256` interchangeably | 16 |\n| [R-09] | Emit", "vulnerable_code": "4 results - 4 files\n\n/WstEth.sol\n33: function initialize(address _owner) external initializer {\n34: _transferOwnership(_owner);\n35: maxSlippage = (1 * 10 ** 16); // 1%\n36: }\n\n/SfrxEth.sol\n36: function initialize(address _owner) external initializer {\n37: _transferOwnership(_owner);\n38: maxSlippage = (1 * 10 ** 16); // 1%\n39: }\n\n/SafEth.sol\n48: function initialize(\n49: string memory _tokenName,\n50: string memory _tokenSymbol\n51: ) external initializer {\n52: ERC20Upgradeable.__ERC20_init(_tokenName, _tokenSymbol);\n53: _transferOwnership(msg.sender);\n54: minAmount = 5 * 10 ** 17; // initializing with .5 ETH as minimum\n55: maxAmount = 200 * 10 ** 18; // initializing with 200 ETH as maximum\n56: }\n\n/Reth.sol\n42: function initialize(address _owner) external initializer {\n43: _transferOwnership(_owner);\n44: maxSlippage = (1 * 10 ** 16); // 1%\n45: }", "fixed_code": "4 results - 4 files\n\n/WstEth.sol\n97: receive() external payable {}\n\n/SfrxEth.sol\n126: receive() external payable {}\n\n/SafEth.sol\n246: receive() external payable {}\n\n/Reth.sol\n245: receive() external payable {}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/0xnev-Q.md", "collected_at": "2026-01-02T18:17:44.969194+00:00", "source_hash": "6b474cfcf86a7a527cec371beb58a31ea9ceccd662c1908ba596de63db96f1e1", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "4 results - 4 files\n\n/WstEth.sol\n33: function initialize(address _owner) external initializer {\n34: _transferOwnership(_owner);\n35: maxSlippage = (1 * 10 ** 16); // 1%\n36: }\n\n/SfrxEth.sol\n36: function initialize(address _owner) external initializer {\n37: _transferOwnership(_owner);\n38: maxSlippage = (1 * 10 ** 16); // 1%\n39: }\n\n/SafEth.sol\n48: function initialize(\n49: string memory _tokenName,\n50: string memory _tokenSymbol\n51: ) external initializer {\n52: ERC20Upgradeable.__ERC20_init(_tokenName, _tokenSymbol);\n53: _transferOwnership(msg.sender);\n54: minAmount = 5 * 10 ** 17; // initializing with .5 ETH as minimum\n55: maxAmount = 200 * 10 ** 18; // initializing with 200 ETH as maximum\n56: }\n\n/Reth.sol\n42: function initialize(address _owner) external initializer {\n43: _transferOwnership(_owner);\n44: maxSlippage = (1 * 10 ** 16); // 1%\n45: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "4 results - 4 files\n\n/WstEth.sol\n97: receive() external payable {}\n\n/SfrxEth.sol\n126: receive() external payable {}\n\n/SafEth.sol\n246: receive() external payable {}\n\n/Reth.sol\n245: receive() external payable {}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-revert-lend", "title": "SM3_SS G", "severity_raw": "High", "severity": "high", "description": "\n# Gas Optimizations\n\n| Number | Issue | Instances |\n|--------|-------|-----------|\n|[G-01]| Precompute Off-Chain When Possible | 6 |\n|[G-02]| Check Arguments Early | 3 |\n|[G-03]| Don\u2019t make variables public unless necessary | 19 |\n|[G-04]| Greater or Equal Comparison Costs Less Gas than Greater Comparison | 24 |\n|[G-05]| Initialize Variables With Default Value | 14 |\n|[G-06]| Avoid zero transfers | 3 |\n|[G-07]| Use named returns for local variables of pure functions where it is possible | 5 |\n|[G-08]| Refactor functions to combine events to reduce gas cost | 1 |\n|[G-09]| Use assembly in place of abi.decode to extract calldata values more efficiently | 13 |\n|[G-10]| Using calldata instead of memory for read-only arguments in external functions saves gas | 10 |\n|[G-11]| Using assembly to revert with an error message | 2 |\n|[G-12]| Shorten arrays with inline assembly | 3 |\n|[G-13]| Use hardcoded address instead of address(this) | 35 |\n|[G-14]| Do not calculate Constant | 16 |\n\n\n\n\n\n\n## [G-1] Precompute Off-Chain When Possible\n\nComputing values in advance outside the blockchain is cheaper than doing it inside smart contracts:\n\n
\n\n```solidity\n// On-chain computation\nfunction verify(uint numA, uint numB) {\n require(numA * numB < 1000);\n}\n\n// Precomputed off-chain\nfunction verify(uint result) {\n require(result < 1000); \n}\n```\n
\n\nDo computations like hashes, signatures outside.\nPass in precomputed values to save on-chain gas.s\n\n```solidity\nfile: blob/main/src/V3Oracle.sol\n\n338 if (updatedAt + feedConfig.maxFeedAge < block.timestamp || answer < 0) {\n\n```\nhttps://github.com/code-423n4/2024-03-revert-lend/blob/main/src/V3Oracle.sol#L338\n\n\n```solidity\nfile: blob/main/src/V3Vault.sol\n\n1227 if (\n collateralValueLimitFactorX32 < type(uint32).max\n && _convertToAssets(tokenConfigs[token0].totalDebtShares, debtExchangeRateX96, Math.Rounding.Up)\n > lentAssets * collateralValueLimitFact", "vulnerable_code": "// On-chain computation\nfunction verify(uint numA, uint numB) {\n require(numA * numB < 1000);\n}\n\n// Precomputed off-chain\nfunction verify(uint result) {\n require(result < 1000); \n}", "fixed_code": "file: blob/main/src/V3Oracle.sol\n\n338 if (updatedAt + feedConfig.maxFeedAge < block.timestamp || answer < 0) {\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/SM3_SS-G.md", "collected_at": "2026-01-02T19:03:04.178851+00:00", "source_hash": "6c025837296b03476ab805ecbe2cdf601f9d69f0fdce50e5eaebd241dc145170", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 295, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "// On-chain computation\nfunction verify(uint numA, uint numB) {\n require(numA * numB < 1000);\n}\n\n// Precomputed off-chain\nfunction verify(uint result) {\n require(result < 1000); \n}", "primary_code_language": "solidity", "primary_code_char_count": 182, "all_code_blocks": "// Code block 1 (solidity):\n// On-chain computation\nfunction verify(uint numA, uint numB) {\n require(numA * numB < 1000);\n}\n\n// Precomputed off-chain\nfunction verify(uint result) {\n require(result < 1000); \n}\n\n// Code block 2 (solidity):\nfile: blob/main/src/V3Oracle.sol\n\n338 if (updatedAt + feedConfig.maxFeedAge < block.timestamp || answer < 0) {", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "// On-chain computation\nfunction verify(uint numA, uint numB) {\n require(numA * numB < 1000);\n}\n\n// Precomputed off-chain\nfunction verify(uint result) {\n require(result < 1000); \n}\n\nfile: blob/main/src/V3Oracle.sol\n\n338 if (updatedAt + feedConfig.maxFeedAge < block.timestamp || answer < 0) {", "github_refs_formatted": "V3Oracle.sol#L338", "github_files_list": "V3Oracle.sol", "github_refs_count": 1, "vulnerable_code_actual": "// On-chain computation\nfunction verify(uint numA, uint numB) {\n require(numA * numB < 1000);\n}\n\n// Precomputed off-chain\nfunction verify(uint result) {\n require(result < 1000); \n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "file: blob/main/src/V3Oracle.sol\n\n338 if (updatedAt + feedConfig.maxFeedAge < block.timestamp || answer < 0) {\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-salty", "title": "chaduke G", "severity_raw": "Gas", "severity": "gas", "description": "G1. ``findLiquidatableUsers()`` resizes array ``liquidatableUsers`` into array ``resizedLiquidatableUsers`` by copying element-wise. This is a waste of gas. The resizing can be done by assembly in the original array ``liquidatableUsers`` without copying.\n\n[https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/stable/CollateralAndLiquidity.sol#L311-L342](https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/stable/CollateralAndLiquidity.sol#L311-L342)\n\nMitigation: Simply use assembly to resize array ``liquidatableUsers``\n\n```javascript\n assembly { mstore(liquidatableUsers, count) }\n return liquidatableUsers;\n```", "vulnerable_code": " assembly { mstore(liquidatableUsers, count) }\n return liquidatableUsers;", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/chaduke-G.md", "collected_at": "2026-01-02T19:01:35.425119+00:00", "source_hash": "6c177aec8e0e212916cb86647a400f2b94f41495069c36fd61c29ede44ee13c5", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 72, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "assembly { mstore(liquidatableUsers, count) }\n return liquidatableUsers;", "primary_code_language": "javascript", "primary_code_char_count": 72, "all_code_blocks": "// Code block 1 (javascript):\nassembly { mstore(liquidatableUsers, count) }\n return liquidatableUsers;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CollateralAndLiquidity.sol#L311-L342", "github_files_list": "CollateralAndLiquidity.sol", "github_refs_count": 1, "vulnerable_code_actual": " assembly { mstore(liquidatableUsers, count) }\n return liquidatableUsers;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.4} {"source": "c4", "protocol": "02-ethos", "title": "hunter_w3b G", "severity_raw": "High", "severity": "high", "description": "# Gas Optimization\n\n# Summary\n\n\n| Number | Optimization Details | Context |\n|:--:|:-------| :-----:|\n| [G-01] | internal functions only called once can be inlined to save gas | 57 |\n| [G-02] |Functions guaranteed to revert when called by normal users can be marked payable| 7 |\n| [G-03] | += \u00a0COSTS MORE GAS THAN\u00a0 = + \u00a0FOR STATE VARIABLES |9 |\n| [G-04] | USING FIXED BYTES IS CHEAPER THAN USING\u00a0STRING | 8 |\n| [G-05] | EXPRESSIONS FOR CONSTANT VALUES SUCH AS A CALL TO\u00a0KECCAK256(), SHOULD USE IMMUTABLE RATHER THAN CONSTANT |5|\n| [G-06] |NOT USING THE NAMED RETURN VARIABLES WHEN A FUNCTION RETURNS, WASTES DEPLOYMENT GAS | 42 |\n| [G-07] | CAN MAKE THE VARIABLE OUTSIDE THE LOOP TO SAVE GAS | 25 |\n| [G-08] | USING\u00a0CALLDATA\u00a0INSTEAD OF\u00a0MEMORY\u00a0FOR READ-ONLY ARGUMENTS IN EXTERNAL FUNCTIONS SAVES GAS | 1 |\n| [G-09] |PUBLIC FUNCTIONS NOT CALLED BY THE CONTRACT SHOULD BE DECLARED EXTERNAL INSTEAD | 4 |\n| [G-10] |SHOULD USE ARGUMENTS INSTEAD OF STATE VARIABLE | 5 |\n| [G-11] |BEFORE SOME FUNCTIONS, WE SHOULD CHECK SOME VARIABLES FOR POSSIBLE GAS SAVE |6 |\n| [G-12] |internal functions not called by the contract should be removed | 8 |\n| [G-13] |Usage of uints/ints smaller than 32 bytes (256 bits) incurs overhead | 2 |\n| [G-14] |SPLITTING\u00a0\u00a0REQUIRE() STATEMENTS THAT USE\u00a0\u00a0&& SAVES GAS | 4 |\n| [G-15] |Setting the constructor to payable | 6 |\n| [G-16] | Duplicated require()/if() checks should be refactored to a modifier or function | 15 |\n| [G-17] |The result of a function call should be cached rather than re-calling the function | 6 |\n| [G-18] | Use assembly to write address storage values |27 |\n| [G-19] |Using storage instead of memory for structs/arrays saves gas | 1 |\n| [G-20] |Use a more recent version of solidity | 8 |\n| [G-21] |Use nested if and, avoid multiple check combinations | 8 |\n| [G-22] |Use constants instead of type(uintx).max| 4 |\n\n\n## [G-01]\u00a0**internal** functions only called once can be **inlined** to save gas\n\n### Summary\n\nNot inlining costs 20 ", "vulnerable_code": "File: /Ethos-Core/contracts/BorrowerOperations.sol\n\n438 function _getCollChange(\n439 uint _collReceived,\n440 uint _requestedCollWithdrawal\n441 )\n442: internal\n443 pure\n444 returns(uint collChange, bool isCollIncrease)\n\n\n455 function _updateTroveFromAdjustment\n456 (\n457 ITroveManager _troveManager,\n458 address _borrower,\n459 address _collateral,\n460 uint _collChange,\n461 bool _isCollIncrease,\n462 uint _debtChange,\n463 bool _isDebtIncrease\n464 )\n465: internal\n466 returns (uint, uint)\n\n\n476 function _moveTokensAndCollateralfromAdjustment\n477 (\n478 IActivePool _activePool,\n479 ILUSDToken _lusdToken,\n480 address _borrower,\n481 address _collateral,\n482 uint _collChange,\n483 bool _isCollIncrease,\n484 uint _LUSDChange,\n485 bool _isDebtIncrease,\n486 uint _netDebtChange\n487 )\n488: internal\n\n\n524: function _requireValidCollateralAddress(address _collateral) internal view {\n525 require(collateralConfig.isCollateralAllowed(_collateral), \"BorrowerOps: Invalid collateral address\");\n526 }\n\n\n533: function _requireSingularCollChange(uint _collTopUp, uint _collWithdrawal) internal pure {\n534 require(_collTopUp == 0 || _collWithdrawal == 0, \"BorrowerOperations: Cannot withdraw and add coll\");\n535 }\n\n\n537: function _requireNonZeroAdjustment(uint _collTopUp, uint _collWithdrawal, uint _LUSDChange) internal pure {\n538 require(_collTopUp != 0 || _collWithdrawal != 0 || _LUSDChange != 0, \"BorrowerOps: There must be either a collateral change or a debt change\");\n539 }\n\n\n546: function _requireTroveisNotActive(ITroveManager _troveManager, address _borrower, address _collateral) internal view {\n547 uint status = _troveManager.getTroveStatus(_borrower, _collateral);\n548 require(status != 1, \"Borrow", "fixed_code": "File: /Ethos-Core/contracts/TroveManager.sol\n\n478 function _getCappedOffsetVals\n479 (\n480 uint _entireTroveDebt,\n481 uint _entireTroveColl,\n482 uint _price,\n483 uint256 _MCR,\n484 uint _collDecimals\n485 )\n486: internal\n487 pure\n488 returns (LiquidationValues memory singleLiquidation)\n\n\n671 function _getTotalsFromLiquidateTrovesSequence_NormalMode\n672 (\n673 IActivePool _activePool,\n674 IDefaultPool _defaultPool,\n675 address _collateral,\n676 uint _price,\n677 uint256 _MCR,\n678 uint _LUSDInStabPool,\n679 uint _n\n680 )\n681: internal\n\n785 function _getTotalFromBatchLiquidate_RecoveryMode\n786 (\n787 IActivePool _activePool,\n788 IDefaultPool _defaultPool,\n789 address _collateral,\n790 uint _price,\n791 uint _LUSDInStabPool,\n792 address[] memory _troveArray\n793 )\n794: internal\n795 returns(LiquidationTotals memory totals)\n\n\n864 function _getTotalsFromBatchLiquidate_NormalMode\n865 (\n866 IActivePool _activePool,\n867 IDefaultPool _defaultPool,\n868 address _collateral,\n869 uint _price,\n870 uint256 _MCR,\n871 uint _LUSDInStabPool,\n872 address[] memory _troveArray\n873 )\n874: internal\n875 returns(LiquidationTotals memory totals)\n\n\n1082: function _applyPendingRewards(IActivePool _activePool, IDefaultPool _defaultPool, address _borrower, address _collateral) internal {\n\n1213: function _computeNewStake(address _collateral, uint _coll) internal view returns (uint) {\n\n\n1321: function _addTroveOwnerToArray(address _borrower, address _collateral) internal returns (uint128 index) {\n\n1339: function _removeTroveOwner(address _borrower, address _collateral, uint TroveOwnersArrayLength) internal {\n\n1516: function _minutesPassedSinceLastFeeOp() internal view returns (uint) {\n\n1538: function _requireMoreThanOneTroveInSystem(uint Tro", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/hunter_w3b-G.md", "collected_at": "2026-01-02T18:17:17.669886+00:00", "source_hash": "6c5710edcaf9a252c8346ab91fff1c4811b5c25fe87041bdcf40385263b68b1e", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: /Ethos-Core/contracts/BorrowerOperations.sol\n\n438 function _getCollChange(\n439 uint _collReceived,\n440 uint _requestedCollWithdrawal\n441 )\n442: internal\n443 pure\n444 returns(uint collChange, bool isCollIncrease)\n\n\n455 function _updateTroveFromAdjustment\n456 (\n457 ITroveManager _troveManager,\n458 address _borrower,\n459 address _collateral,\n460 uint _collChange,\n461 bool _isCollIncrease,\n462 uint _debtChange,\n463 bool _isDebtIncrease\n464 )\n465: internal\n466 returns (uint, uint)\n\n\n476 function _moveTokensAndCollateralfromAdjustment\n477 (\n478 IActivePool _activePool,\n479 ILUSDToken _lusdToken,\n480 address _borrower,\n481 address _collateral,\n482 uint _collChange,\n483 bool _isCollIncrease,\n484 uint _LUSDChange,\n485 bool _isDebtIncrease,\n486 uint _netDebtChange\n487 )\n488: internal\n\n\n524: function _requireValidCollateralAddress(address _collateral) internal view {\n525 require(collateralConfig.isCollateralAllowed(_collateral), \"BorrowerOps: Invalid collateral address\");\n526 }\n\n\n533: function _requireSingularCollChange(uint _collTopUp, uint _collWithdrawal) internal pure {\n534 require(_collTopUp == 0 || _collWithdrawal == 0, \"BorrowerOperations: Cannot withdraw and add coll\");\n535 }\n\n\n537: function _requireNonZeroAdjustment(uint _collTopUp, uint _collWithdrawal, uint _LUSDChange) internal pure {\n538 require(_collTopUp != 0 || _collWithdrawal != 0 || _LUSDChange != 0, \"BorrowerOps: There must be either a collateral change or a debt change\");\n539 }\n\n\n546: function _requireTroveisNotActive(ITroveManager _troveManager, address _borrower, address _collateral) internal view {\n547 uint status = _troveManager.getTroveStatus(_borrower, _collateral);\n548 require(status != 1, \"Borrow", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: /Ethos-Core/contracts/TroveManager.sol\n\n478 function _getCappedOffsetVals\n479 (\n480 uint _entireTroveDebt,\n481 uint _entireTroveColl,\n482 uint _price,\n483 uint256 _MCR,\n484 uint _collDecimals\n485 )\n486: internal\n487 pure\n488 returns (LiquidationValues memory singleLiquidation)\n\n\n671 function _getTotalsFromLiquidateTrovesSequence_NormalMode\n672 (\n673 IActivePool _activePool,\n674 IDefaultPool _defaultPool,\n675 address _collateral,\n676 uint _price,\n677 uint256 _MCR,\n678 uint _LUSDInStabPool,\n679 uint _n\n680 )\n681: internal\n\n785 function _getTotalFromBatchLiquidate_RecoveryMode\n786 (\n787 IActivePool _activePool,\n788 IDefaultPool _defaultPool,\n789 address _collateral,\n790 uint _price,\n791 uint _LUSDInStabPool,\n792 address[] memory _troveArray\n793 )\n794: internal\n795 returns(LiquidationTotals memory totals)\n\n\n864 function _getTotalsFromBatchLiquidate_NormalMode\n865 (\n866 IActivePool _activePool,\n867 IDefaultPool _defaultPool,\n868 address _collateral,\n869 uint _price,\n870 uint256 _MCR,\n871 uint _LUSDInStabPool,\n872 address[] memory _troveArray\n873 )\n874: internal\n875 returns(LiquidationTotals memory totals)\n\n\n1082: function _applyPendingRewards(IActivePool _activePool, IDefaultPool _defaultPool, address _borrower, address _collateral) internal {\n\n1213: function _computeNewStake(address _collateral, uint _coll) internal view returns (uint) {\n\n\n1321: function _addTroveOwnerToArray(address _borrower, address _collateral) internal returns (uint128 index) {\n\n1339: function _removeTroveOwner(address _borrower, address _collateral, uint TroveOwnersArrayLength) internal {\n\n1516: function _minutesPassedSinceLastFeeOp() internal view returns (uint) {\n\n1538: function _requireMoreThanOneTroveInSystem(uint Tro", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-salty", "title": "7ashraf Q", "severity_raw": "Critical", "severity": "critical", "description": "\n# Quality Assurance Report\n\n## Summary\n\n\nThe QA report highlights several issues in the codebase. One critical issue ([L-01]) involves the addition of a cooldown period even when the price is not changed, leading to false emissions. Additionally, the report identifies issues such as checking ballot existence before removal ([L-02]), verifying the existence of a country before proposing exclusion ([L-03]), and checking for the existence of a ballotId before counting votes ([L-04]). Other issues include ensuring values are not smaller than a specified threshold ([L-05]), checking for pool whitelisting ([L-06]), and addressing various non-critical concerns ([N-01] to [N-06]). Remedial actions and mitigations are provided for each issue.\n\n### Summary Table:\n\n| Issue Number | Title | Number of Instances |\n|--------------|-------------------------------------------------|---------------------|\n| L-01 | Cooldown period added without price change | 1 |\n| L-02 | Check if ballot exists before removal | 1 |\n| L-03 | Check if country already exists | 1 |\n| L-04 | Check if ballotId exists before counting votes | 3 |\n| L-05 | Check if values are smaller than `pool.dust` | 3 |\n| L-06 | Check if pool already whitelisted | 1 |\n| N-01 | Revert with an error message | 3 |\n| N-02 | Add else and revert on else | 1 |\n| N-03 | Require increment amount to be > 0 | 1 |\n| N-04 | Emit vote updated and vote casted events | 1 |\n| N-05 | Check for token decimals under 18 | 1 |\n| N-06 | Function requires more comments | 1 ", "vulnerable_code": "else if ( priceFeedNum == 3 )\n\t\t\tpriceFeed3 = newPriceFeed;\n\n\t\tpriceFeedModificationCooldownExpiration = block.timestamp + priceFeedModificationCooldown;\n\t\temit PriceFeedSet(priceFeedNum, newPriceFeed);", "fixed_code": "\tfunction markBallotAsFinalized( uint256 ballotID ) external nonReentrant\n\t\t{\n\t\trequire( msg.sender == address(exchangeConfig.dao()), \"Only the DAO can mark a ballot as finalized\" );\n\n\t\tBallot storage ballot = ballots[ballotID];\n\n\t\t// Remove finalized whitelist token ballots from the list of open whitelisting proposals\n\t\tif ( ballot.ballotType == BallotType.WHITELIST_TOKEN )\n\t\t\t_openBallotsForTokenWhitelisting.remove( ballotID );\n\n\t\t// Remove from the list of all open ballots\n\t\t_allOpenBallots.remove( ballotID );\n\n\t\tballot.ballotIsLive = false;\n\n\t\t// Indicate that the user who posted the proposal no longer has an active proposal\n\t\taddress userThatPostedBallot = _usersThatProposedBallots[ballotID];\n\t\t_userHasActiveProposal[userThatPostedBallot] = false;\n\n\t\tdelete openBallotsByName[ballot.ballotName];\n\n\t\temit BallotFinalized(ballotID);\n\t\t}", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/7ashraf-Q.md", "collected_at": "2026-01-02T19:01:11.780959+00:00", "source_hash": "6d4c5f60c83e95af99bfeb91c4af04e0399af96e2cfbc493b1e8e2d0d97fdd2e", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "else if ( priceFeedNum == 3 )\n\t\t\tpriceFeed3 = newPriceFeed;\n\n\t\tpriceFeedModificationCooldownExpiration = block.timestamp + priceFeedModificationCooldown;\n\t\temit PriceFeedSet(priceFeedNum, newPriceFeed);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "\tfunction markBallotAsFinalized( uint256 ballotID ) external nonReentrant\n\t\t{\n\t\trequire( msg.sender == address(exchangeConfig.dao()), \"Only the DAO can mark a ballot as finalized\" );\n\n\t\tBallot storage ballot = ballots[ballotID];\n\n\t\t// Remove finalized whitelist token ballots from the list of open whitelisting proposals\n\t\tif ( ballot.ballotType == BallotType.WHITELIST_TOKEN )\n\t\t\t_openBallotsForTokenWhitelisting.remove( ballotID );\n\n\t\t// Remove from the list of all open ballots\n\t\t_allOpenBallots.remove( ballotID );\n\n\t\tballot.ballotIsLive = false;\n\n\t\t// Indicate that the user who posted the proposal no longer has an active proposal\n\t\taddress userThatPostedBallot = _usersThatProposedBallots[ballotID];\n\t\t_userHasActiveProposal[userThatPostedBallot] = false;\n\n\t\tdelete openBallotsByName[ballot.ballotName];\n\n\t\temit BallotFinalized(ballotID);\n\t\t}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "08-dopex", "title": "0xta G", "severity_raw": "High", "severity": "high", "description": "# Gas Optimization\n\n# Summary\n\n| Number | Gas | Context |\n| :----: | :------------------------------------------------------------------------------------------------------- | :-----: |\n| [G-01] | Avoid emitting storage values | 8 |\n| [G-02] | Use constants instead of type(uintx).max | 15 |\n| [G-03] | Use mappings instead of arrays | 5 |\n| [G-04] | Use assembly to write address storage values | 4 |\n| [G-05] | Expressions for constant values such as a call to keccak256(), should use immutable rather than constant | 11 |\n| [G-06] | Zero value check posiible Gas Save | 3 |\n| [G-07] | Using > 0 costs more gas than != 0 when used on a uint in a require() statement | 5 |\n| [G-08] | Do not calculate constants | 3 |\n| [G-09] | Pre-increment and pre-decrement are cheaper than +1,-1 | 5 |\n| [G-10] | Use hardcode address instead `address(this)` | 38 |\n| [G-11] | Using storage instead of memory for structs/arrays saves gas | 3 |\n| [G-12] | USING CALLDATA INSTEAD OF MEMORY FOR READ-ONLY ARGUMENTS IN EXTERNAL FUNCTIONS SAVES GAS | 4 |\n| [G-13] | Shorten the array rather than copying to a new one | 5 |\n| [G-14] | Duplicated if()/require checks should ", "vulnerable_code": "349 emit LogSetAddresses(addresses);\n\n370 emit LogSetPricingOracleAddresses(pricingOracleAddresses);\n", "fixed_code": "211 emit AddressesSet(addresses);\n\n\n389 emit PayFunding(\n390 msg.sender,\n391 totalFundingForEpoch[latestFundingPaymentPointer],\n392 latestFundingPaymentPointer\n393 );\n\n\n\n451 emit CalculateFunding(\n452 msg.sender,\n453 amount,\n454 strike,\n455 premium,\n456: latestFundingPaymentPointer\n457 );\n\n\n\n\n485 emit FundingPaid(\n486 msg.sender,\n487 ((currentFundingRate * (nextFundingPaymentTimestamp() - startTime)) /\n488 1e18),\n489 latestFundingPaymentPointer\n480 );\n\n\n\n494 emit FundingPaymentPointerUpdated(latestFundingPaymentPointer); storage values\n\n\n\n\n519 emit FundingPaid(\n520 msg.sender,\n521 ((currentFundingRate * (block.timestamp - startTime)) / 1e18),\n522 latestFundingPaymentPointer\n523 );", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/0xta-G.md", "collected_at": "2026-01-02T18:24:27.246007+00:00", "source_hash": "6d4dd9576a7b173a6af0cb50ec9ca0ce8c4715b8737fc7dd292dd229b8425135", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "349 emit LogSetAddresses(addresses);\n\n370 emit LogSetPricingOracleAddresses(pricingOracleAddresses);\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "211 emit AddressesSet(addresses);\n\n\n389 emit PayFunding(\n390 msg.sender,\n391 totalFundingForEpoch[latestFundingPaymentPointer],\n392 latestFundingPaymentPointer\n393 );\n\n\n\n451 emit CalculateFunding(\n452 msg.sender,\n453 amount,\n454 strike,\n455 premium,\n456: latestFundingPaymentPointer\n457 );\n\n\n\n\n485 emit FundingPaid(\n486 msg.sender,\n487 ((currentFundingRate * (nextFundingPaymentTimestamp() - startTime)) /\n488 1e18),\n489 latestFundingPaymentPointer\n480 );\n\n\n\n494 emit FundingPaymentPointerUpdated(latestFundingPaymentPointer); storage values\n\n\n\n\n519 emit FundingPaid(\n520 msg.sender,\n521 ((currentFundingRate * (block.timestamp - startTime)) / 1e18),\n522 latestFundingPaymentPointer\n523 );", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "10-badger", "title": "DavidGiladi G", "severity_raw": "High", "severity": "high", "description": "\n### Gas Optimization Issues\n|Title|Issue|Instances|Total Gas Saved|\n|-|:-|:-:|:-:|\n|[G-1] Inefficient use of abi.encode() | [Inefficient use of abi.encode()](#inefficient-use-of-abiencode) | 6 | 600 |\n|[G-2] Use assembly to emit events | [Use assembly to emit events](#use-assembly-to-emit-events) | 78 | 2964 |\n|[G-3] Avoid unnecessary storage updates | [Avoid unnecessary storage updates](#avoid-unnecessary-storage-updates) | 5 | 4000 |\n|[G-4] Multiplication and Division by 2 Should use in Bit Shifting | [Multiplication and Division by 2 Should use in Bit Shifting](#multiplication-and-division-by-2-should-use-in-bit-shifting) | 1 | 20 |\n|[G-5] Using bools for storage incurs overhead | [Using bools for storage incurs overhead](#using-bools-for-storage-incurs-overhead) | 2 | 34200 |\n|[G-6] Optimizing Small Data Storage with Bytes32 | [Optimizing Small Data Storage with Bytes32](#optimizing-small-data-storage-with-bytes32) | 11 | 4158 |\n|[G-7] Check Arguments Early | [Check Arguments Early](#check-arguments-early) | 4 | - |\n|[G-8] Division operations between unsigned could be unchecked | [Division operations between unsigned could be unchecked](#division-operations-between-unsigned-could-be-unchecked) | 3 | 255 |\n|[G-9] Modulus operations that could be unchecked | [Modulus operations that could be unchecked](#modulus-operations-that-could-be-unchecked) | 1 | 85 |\n|[G-10] Potential Optimization by Combining Multiple Mappings into a Struct | [Potential Optimization by Combining Multiple Mappings into a Struct](#potential-optimization-by-combining-multiple-mappings-into-a-struct) | 2 | 1000 |\n|[G-11] Constants Variable Should Be Private for Gas Optimization | [Constants Variable Should Be Private for Gas Optimization](#constants-variable-should-be-private-for-gas-optimization) | 18 | 61200 |\n|[G-12] State variables that could be declared constant | [State variables that could be declared constant](#state-variables-that-could-be-declared-constant) | 10 | 20970 |\n|[G-13] Us", "vulnerable_code": "File: contracts/BorrowerOperations.sol\n\n682 return keccak256(abi.encode(typeHash, name, version, _chainID(), address(this)))", "fixed_code": "File: contracts/BorrowerOperations.sol\n\n717 bytes32 digest = keccak256(\n718 abi.encodePacked(\n719 \"\\x19\\x01\",\n720 domainSeparator(),\n721 keccak256(\n722 abi.encode(\n723 _PERMIT_POSITION_MANAGER_TYPEHASH,\n724 _borrower,\n725 _positionManager,\n726 _approval,\n727 _nonces[_borrower]++,\n728 _deadline\n729 )\n730 )\n731 )\n732 )", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/DavidGiladi-G.md", "collected_at": "2026-01-02T18:26:31.345886+00:00", "source_hash": "6d53f0184b0e9ea861eca05b8a664c733681007324d23d59a5b8c26cff1ea52b", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: contracts/BorrowerOperations.sol\n\n682 return keccak256(abi.encode(typeHash, name, version, _chainID(), address(this)))", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/BorrowerOperations.sol\n\n717 bytes32 digest = keccak256(\n718 abi.encodePacked(\n719 \"\\x19\\x01\",\n720 domainSeparator(),\n721 keccak256(\n722 abi.encode(\n723 _PERMIT_POSITION_MANAGER_TYPEHASH,\n724 _borrower,\n725 _positionManager,\n726 _approval,\n727 _nonces[_borrower]++,\n728 _deadline\n729 )\n730 )\n731 )\n732 )", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "05-ajna", "title": "Shubham Q", "severity_raw": "Critical", "severity": "critical", "description": "## Non-Critical Issues\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [NC-1](#NC-1) | Using while for unbounded loops isn\u2019t recommended | 3 |\n| [NC-2](#NC-2) | Immutables should be in uppercase | 5 |\n| [NC-3](#NC-3) | Use underscores for number literals | 4 |\n| [NC-4](#NC-4) | Assembly Codes Specific \u2013 Should Have Comments | 2 |\n| [NC-5](#NC-5) | Not using the named return variables anywhere in the function is confusing | 1 |\n| [NC-6](#NC-6) | Add a timelock to critical functions | 1 |\n\n## [NC-1] Using while for unbounded loops isn\u2019t recommended\n\nDon\u2019t write loops that are unbounded as this can hit the gas limit, causing your transaction to fail.\n\nFor the reason above, while and do while loops are rarely used.\n\n```solidity\nFile: main/ajna-core/src/RewardsManager.sol\n\nL:616 while (claimEpoch <= burnEpochToStartClaim_) {\n burnEpochsClaimed_[i] = claimEpoch;\n \n // iterations are bounded by array length (which is itself bounded), preventing overflow / underflow\n unchecked {\n ++i;\n ++claimEpoch;\n }\n }\n```\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/RewardsManager.sol#L616-624\n\n```solidity\nFile: main/ajna-grants/src/grants/base/StandardFunding.sol\n\nL:820 while (\n targetProposalId_ != 0\n &&\n _standardFundingProposals[proposals_[targetProposalId_]].votesReceived > \n _standardFundingProposals[proposals_[targetProposalId_ - 1]].votesReceived\n ) {\n // swap values if left item < right item\n uint256 temp = proposals_[targetProposalId_ - 1];\n\n proposals_[targetProposalId_ - 1] = proposals_[targetProposalId_];\n proposals_[targetProposalId_] = temp;\n\n unchecked { --targetProposalId_; }\n }\n```\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/Sta", "vulnerable_code": "File: main/ajna-core/src/RewardsManager.sol\n\nL:616 while (claimEpoch <= burnEpochToStartClaim_) {\n burnEpochsClaimed_[i] = claimEpoch;\n \n // iterations are bounded by array length (which is itself bounded), preventing overflow / underflow\n unchecked {\n ++i;\n ++claimEpoch;\n }\n }", "fixed_code": "File: main/ajna-grants/src/grants/base/StandardFunding.sol\n\nL:820 while (\n targetProposalId_ != 0\n &&\n _standardFundingProposals[proposals_[targetProposalId_]].votesReceived > \n _standardFundingProposals[proposals_[targetProposalId_ - 1]].votesReceived\n ) {\n // swap values if left item < right item\n uint256 temp = proposals_[targetProposalId_ - 1];\n\n proposals_[targetProposalId_ - 1] = proposals_[targetProposalId_];\n proposals_[targetProposalId_] = temp;\n\n unchecked { --targetProposalId_; }\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/Shubham-Q.md", "collected_at": "2026-01-02T18:21:14.866683+00:00", "source_hash": "6d76eb11ecd91a9c7ad65701a87b41fa1f75455a374c588654fc48e163c90e4a", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 1078, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: main/ajna-core/src/RewardsManager.sol\n\nL:616 while (claimEpoch <= burnEpochToStartClaim_) {\n burnEpochsClaimed_[i] = claimEpoch;\n \n // iterations are bounded by array length (which is itself bounded), preventing overflow / underflow\n unchecked {\n ++i;\n ++claimEpoch;\n }\n }", "primary_code_language": "solidity", "primary_code_char_count": 381, "all_code_blocks": "// Code block 1 (solidity):\nFile: main/ajna-core/src/RewardsManager.sol\n\nL:616 while (claimEpoch <= burnEpochToStartClaim_) {\n burnEpochsClaimed_[i] = claimEpoch;\n \n // iterations are bounded by array length (which is itself bounded), preventing overflow / underflow\n unchecked {\n ++i;\n ++claimEpoch;\n }\n }\n\n// Code block 2 (solidity):\nFile: main/ajna-grants/src/grants/base/StandardFunding.sol\n\nL:820 while (\n targetProposalId_ != 0\n &&\n _standardFundingProposals[proposals_[targetProposalId_]].votesReceived > \n _standardFundingProposals[proposals_[targetProposalId_ - 1]].votesReceived\n ) {\n // swap values if left item < right item\n uint256 temp = proposals_[targetProposalId_ - 1];\n\n proposals_[targetProposalId_ - 1] = proposals_[targetProposalId_];\n proposals_[targetProposalId_] = temp;\n\n unchecked { --targetProposalId_; }\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: main/ajna-core/src/RewardsManager.sol\n\nL:616 while (claimEpoch <= burnEpochToStartClaim_) {\n burnEpochsClaimed_[i] = claimEpoch;\n \n // iterations are bounded by array length (which is itself bounded), preventing overflow / underflow\n unchecked {\n ++i;\n ++claimEpoch;\n }\n }\n\nFile: main/ajna-grants/src/grants/base/StandardFunding.sol\n\nL:820 while (\n targetProposalId_ != 0\n &&\n _standardFundingProposals[proposals_[targetProposalId_]].votesReceived > \n _standardFundingProposals[proposals_[targetProposalId_ - 1]].votesReceived\n ) {\n // swap values if left item < right item\n uint256 temp = proposals_[targetProposalId_ - 1];\n\n proposals_[targetProposalId_ - 1] = proposals_[targetProposalId_];\n proposals_[targetProposalId_] = temp;\n\n unchecked { --targetProposalId_; }\n }", "github_refs_formatted": "RewardsManager.sol#L616-L624", "github_files_list": "RewardsManager.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: main/ajna-core/src/RewardsManager.sol\n\nL:616 while (claimEpoch <= burnEpochToStartClaim_) {\n burnEpochsClaimed_[i] = claimEpoch;\n \n // iterations are bounded by array length (which is itself bounded), preventing overflow / underflow\n unchecked {\n ++i;\n ++claimEpoch;\n }\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: main/ajna-grants/src/grants/base/StandardFunding.sol\n\nL:820 while (\n targetProposalId_ != 0\n &&\n _standardFundingProposals[proposals_[targetProposalId_]].votesReceived > \n _standardFundingProposals[proposals_[targetProposalId_ - 1]].votesReceived\n ) {\n // swap values if left item < right item\n uint256 temp = proposals_[targetProposalId_ - 1];\n\n proposals_[targetProposalId_ - 1] = proposals_[targetProposalId_];\n proposals_[targetProposalId_] = temp;\n\n unchecked { --targetProposalId_; }\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "08-dopex", "title": "Jorgect G", "severity_raw": "Gas", "severity": "gas", "description": "# GAS REPORT\n\n## [G-01] The RpdxV2Core.sol contract is performing aditional calculation in some cases.\n\nThe _curveSwap is calculating the minOut always but this depend of minAmount input so if the minAmount is set the minOut is gonna be calculated but never used.\n\n```\nfile:contracts/core/RdpxV2Core.sol\nfunction _curveSwap(\n uint256 _amount,\n bool _ethToDpxEth,\n bool validate,\n uint256 minAmount\n ) internal returns (uint256 amountOut) {\n ...\n // calculate minimum amount out\n uint256 minOut = _ethToDpxEth\n ? (((_amount * getDpxEthPrice()) / 1e8) -\n (((_amount * getDpxEthPrice()) * slippageTolerance) / 1e16))\n : (((_amount * getEthPrice()) / 1e8) -\n (((_amount * getEthPrice()) * slippageTolerance) / 1e16));\n\n // Swap the tokens\n amountOut = dpxEthCurvePool.exchange(\n _ethToDpxEth ? int128(int256(a)) : int128(int256(b)),\n _ethToDpxEth ? int128(int256(b)) : int128(int256(a)),\n _amount,\n minAmount > 0 ? minAmount : minOut\n );\n }\n\n```\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/core/RdpxV2Core.sol#L515C3-L559C1\n\n### Recomendation\n\nCalculate minOut just when minAmount is set to 0;\n\n## [G-02] The RpdxV2Core.sol contract is performing an adittional call that is not need it.\n\nWhen the bonds function is called it is returning the owner and is no used, but then is calling ownerOf of function to get the owner\n\n```\nfunction _transfer(uint256 _rdpxAmount, uint256 _wethAmount, uint256 _bondAmount, uint256 _bondId) internal {\n if (_bondId != 0) {\n (, uint256 expiry, uint256 amount) = IRdpxDecayingBonds(addresses.rdpxDecayingBonds).bonds(_bondId); //@audit (gas) you can get the owner here and not call ownerOf\n\n _validate(amount >= _rdpxAmount, 1);\n _validate(expiry >= block.timestamp, 2);\n _validate(IRdpxDecayingBonds(addresses.rdpxDecayingBonds).ownerOf(_bondId) == msg.sender, 9);\n ...\n}\n```\n", "vulnerable_code": "file:contracts/core/RdpxV2Core.sol\nfunction _curveSwap(\n uint256 _amount,\n bool _ethToDpxEth,\n bool validate,\n uint256 minAmount\n ) internal returns (uint256 amountOut) {\n ...\n // calculate minimum amount out\n uint256 minOut = _ethToDpxEth\n ? (((_amount * getDpxEthPrice()) / 1e8) -\n (((_amount * getDpxEthPrice()) * slippageTolerance) / 1e16))\n : (((_amount * getEthPrice()) / 1e8) -\n (((_amount * getEthPrice()) * slippageTolerance) / 1e16));\n\n // Swap the tokens\n amountOut = dpxEthCurvePool.exchange(\n _ethToDpxEth ? int128(int256(a)) : int128(int256(b)),\n _ethToDpxEth ? int128(int256(b)) : int128(int256(a)),\n _amount,\n minAmount > 0 ? minAmount : minOut\n );\n }\n", "fixed_code": "function _transfer(uint256 _rdpxAmount, uint256 _wethAmount, uint256 _bondAmount, uint256 _bondId) internal {\n if (_bondId != 0) {\n (, uint256 expiry, uint256 amount) = IRdpxDecayingBonds(addresses.rdpxDecayingBonds).bonds(_bondId); //@audit (gas) you can get the owner here and not call ownerOf\n\n _validate(amount >= _rdpxAmount, 1);\n _validate(expiry >= block.timestamp, 2);\n _validate(IRdpxDecayingBonds(addresses.rdpxDecayingBonds).ownerOf(_bondId) == msg.sender, 9);\n ...\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/Jorgect-G.md", "collected_at": "2026-01-02T18:24:44.301311+00:00", "source_hash": "6d7cf0381be10934ab767b9cc4f61dac12365afd3dd018c5912c317bfc04bca2", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 1283, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "file:contracts/core/RdpxV2Core.sol\nfunction _curveSwap(\n uint256 _amount,\n bool _ethToDpxEth,\n bool validate,\n uint256 minAmount\n ) internal returns (uint256 amountOut) {\n ...\n // calculate minimum amount out\n uint256 minOut = _ethToDpxEth\n ? (((_amount * getDpxEthPrice()) / 1e8) -\n (((_amount * getDpxEthPrice()) * slippageTolerance) / 1e16))\n : (((_amount * getEthPrice()) / 1e8) -\n (((_amount * getEthPrice()) * slippageTolerance) / 1e16));\n\n // Swap the tokens\n amountOut = dpxEthCurvePool.exchange(\n _ethToDpxEth ? int128(int256(a)) : int128(int256(b)),\n _ethToDpxEth ? int128(int256(b)) : int128(int256(a)),\n _amount,\n minAmount > 0 ? minAmount : minOut\n );\n }", "primary_code_language": "unknown", "primary_code_char_count": 743, "all_code_blocks": "// Code block 1 (unknown):\nfile:contracts/core/RdpxV2Core.sol\nfunction _curveSwap(\n uint256 _amount,\n bool _ethToDpxEth,\n bool validate,\n uint256 minAmount\n ) internal returns (uint256 amountOut) {\n ...\n // calculate minimum amount out\n uint256 minOut = _ethToDpxEth\n ? (((_amount * getDpxEthPrice()) / 1e8) -\n (((_amount * getDpxEthPrice()) * slippageTolerance) / 1e16))\n : (((_amount * getEthPrice()) / 1e8) -\n (((_amount * getEthPrice()) * slippageTolerance) / 1e16));\n\n // Swap the tokens\n amountOut = dpxEthCurvePool.exchange(\n _ethToDpxEth ? int128(int256(a)) : int128(int256(b)),\n _ethToDpxEth ? int128(int256(b)) : int128(int256(a)),\n _amount,\n minAmount > 0 ? minAmount : minOut\n );\n }\n\n// Code block 2 (unknown):\nfunction _transfer(uint256 _rdpxAmount, uint256 _wethAmount, uint256 _bondAmount, uint256 _bondId) internal {\n if (_bondId != 0) {\n (, uint256 expiry, uint256 amount) = IRdpxDecayingBonds(addresses.rdpxDecayingBonds).bonds(_bondId); //@audit (gas) you can get the owner here and not call ownerOf\n\n _validate(amount >= _rdpxAmount, 1);\n _validate(expiry >= block.timestamp, 2);\n _validate(IRdpxDecayingBonds(addresses.rdpxDecayingBonds).ownerOf(_bondId) == msg.sender, 9);\n ...\n}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "RdpxV2Core.sol#L515-L3", "github_files_list": "RdpxV2Core.sol", "github_refs_count": 1, "vulnerable_code_actual": "file:contracts/core/RdpxV2Core.sol\nfunction _curveSwap(\n uint256 _amount,\n bool _ethToDpxEth,\n bool validate,\n uint256 minAmount\n ) internal returns (uint256 amountOut) {\n ...\n // calculate minimum amount out\n uint256 minOut = _ethToDpxEth\n ? (((_amount * getDpxEthPrice()) / 1e8) -\n (((_amount * getDpxEthPrice()) * slippageTolerance) / 1e16))\n : (((_amount * getEthPrice()) / 1e8) -\n (((_amount * getEthPrice()) * slippageTolerance) / 1e16));\n\n // Swap the tokens\n amountOut = dpxEthCurvePool.exchange(\n _ethToDpxEth ? int128(int256(a)) : int128(int256(b)),\n _ethToDpxEth ? int128(int256(b)) : int128(int256(a)),\n _amount,\n minAmount > 0 ? minAmount : minOut\n );\n }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function _transfer(uint256 _rdpxAmount, uint256 _wethAmount, uint256 _bondAmount, uint256 _bondId) internal {\n if (_bondId != 0) {\n (, uint256 expiry, uint256 amount) = IRdpxDecayingBonds(addresses.rdpxDecayingBonds).bonds(_bondId); //@audit (gas) you can get the owner here and not call ownerOf\n\n _validate(amount >= _rdpxAmount, 1);\n _validate(expiry >= block.timestamp, 2);\n _validate(IRdpxDecayingBonds(addresses.rdpxDecayingBonds).ownerOf(_bondId) == msg.sender, 9);\n ...\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "04-caviar", "title": "contractcops Q", "severity_raw": "Low", "severity": "low", "description": "## [L-01] changeFee can only be set once & unused parameters in flashFee(address, uint256)\nIn PrivatePool.sol:\n```\n87: /// @notice The change/flash fee to 4 decimals of precision. For example, 0.0025 ETH = 25. 500 USDC = 5_000_000.\n88: uint56 public changeFee;\n```\nThe change fee is then initialized in the initialize(...) function\n```\n function initialize(\n address _baseToken,\n address _nft,\n uint128 _virtualBaseTokenReserves,\n uint128 _virtualNftReserves,\n uint56 _changeFee,\n ...\n ...\n changeFee = _changeFee;\n```\n\nThere are no available setters or ways to change the changeFee (flashFee) after the pool is initialized. Furthermore, flashFee() function takes two parameters that are not used to alter the changeFee in any way.\n\n```\n750: function flashFee(address, uint256) public view returns (uint256) {\n return changeFee;\n }\n...\n631: // calculate the fee\n632: uint256 fee = flashFee(token, tokenId);\n```\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L632\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L750\n\n\n\n## [I-01] Comment fixes\n// add the royalty fee amount to the net input aount \n- fix the \"aount\" to \"amount\"\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L251\n\n// loop through and execute the the buys \n- remove \"the\"\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L105\n\n## [I-02] Confusing/unnecessary imports\n\nChange the import from \n`import {IERC3156FlashBorrower} from \"openzeppelin/interfaces/IERC3156FlashLender.sol\";` \nto\n```\nimport {IERC3156FlashBorrower} from \n\"openzeppelin/interfaces/IERC3156FlashBorrower.sol\";\n```\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L34\n\n\n## [I-03] Remove ReservoirOracle as it is not necessary\nThe Message struct used in `IStolenNftOracle` is copied from `ReservoirOracle`. Therefore it is not ne", "vulnerable_code": "87: /// @notice The change/flash fee to 4 decimals of precision. For example, 0.0025 ETH = 25. 500 USDC = 5_000_000.\n88: uint56 public changeFee;", "fixed_code": " function initialize(\n address _baseToken,\n address _nft,\n uint128 _virtualBaseTokenReserves,\n uint128 _virtualNftReserves,\n uint56 _changeFee,\n ...\n ...\n changeFee = _changeFee;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/contractcops-Q.md", "collected_at": "2026-01-02T18:20:23.725069+00:00", "source_hash": "6d9f1488e93f956b114fd21b43fb34cb206212a847838ddc198b1575a9fe719a", "code_block_count": 4, "solidity_block_count": 0, "total_code_chars": 673, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "87: /// @notice The change/flash fee to 4 decimals of precision. For example, 0.0025 ETH = 25. 500 USDC = 5_000_000.\n88: uint56 public changeFee;", "primary_code_language": "unknown", "primary_code_char_count": 149, "all_code_blocks": "// Code block 1 (unknown):\n87: /// @notice The change/flash fee to 4 decimals of precision. For example, 0.0025 ETH = 25. 500 USDC = 5_000_000.\n88: uint56 public changeFee;\n\n// Code block 2 (unknown):\nfunction initialize(\n address _baseToken,\n address _nft,\n uint128 _virtualBaseTokenReserves,\n uint128 _virtualNftReserves,\n uint56 _changeFee,\n ...\n ...\n changeFee = _changeFee;\n\n// Code block 3 (unknown):\n750: function flashFee(address, uint256) public view returns (uint256) {\n return changeFee;\n }\n...\n631: // calculate the fee\n632: uint256 fee = flashFee(token, tokenId);\n\n// Code block 4 (unknown):\nimport {IERC3156FlashBorrower} from \n\"openzeppelin/interfaces/IERC3156FlashBorrower.sol\";", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "PrivatePool.sol#L632, PrivatePool.sol#L750, PrivatePool.sol#L251, EthRouter.sol#L105, PrivatePool.sol#L34", "github_files_list": "EthRouter.sol, PrivatePool.sol", "github_refs_count": 5, "vulnerable_code_actual": "87: /// @notice The change/flash fee to 4 decimals of precision. For example, 0.0025 ETH = 25. 500 USDC = 5_000_000.\n88: uint56 public changeFee;", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function initialize(\n address _baseToken,\n address _nft,\n uint128 _virtualBaseTokenReserves,\n uint128 _virtualNftReserves,\n uint56 _changeFee,\n ...\n ...\n changeFee = _changeFee;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "03-asymmetry", "title": "carlitox477 G", "severity_raw": "High", "severity": "high", "description": "# `SafEth.stake()` can use `derivatives` and `weights` storage pointer to save gas in both for loop\n```diff\n function stake() external payable {\n require(pauseStaking == false, \"staking is paused\");\n require(msg.value >= minAmount, \"amount too low\");\n require(msg.value <= maxAmount, \"amount too high\");\n\n uint256 underlyingValue = 0;\n+ mapping(uint256 => IDerivative) storage _derivatives = derivatives;\n+ IDerivative _derivative;\n // Getting underlying value in terms of ETH for each derivative\n for (uint i = 0; i < derivativeCount; i++)\n underlyingValue +=\n- (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n- derivatives[i].balance()) /\n+ _derivative = _derivatives[i];\n+ (_derivative.ethPerDerivative(_derivative.balance()) *\n+ _derivative.balance()) /\n 10 ** 18;\n\n uint256 totalSupply = totalSupply();\n uint256 preDepositPrice; // Price of safETH in regards to ETH\n if (totalSupply == 0)\n preDepositPrice = 10 ** 18; // initializes with a price of 1\n else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n\n uint256 totalStakeValueEth = 0; // total amount of derivatives worth of ETH in system\n+ mapping(uint256 => uint256) storage _weights = weights;\n for (uint i = 0; i < derivativeCount; i++) {\n- uint256 weight = weights[i];\n+ uint256 weight = _weights[i];\n- IDerivative derivative = derivatives[i];\n+ _derivative = _derivatives[i];\n if (weight == 0) continue;\n uint256 ethAmount = (msg.value * weight) / totalWeight;\n\n // This is slightly less than ethAmount because slippage\n uint256 depositAmount = derivative.deposit{value: ethAmount}();\n uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n depositAmount\n )", "vulnerable_code": "# `SafEth.stake()` can cache `derivativeCount` and `totalWeight` to save gas\nThis will reduce storage access in both for loops in each iteration", "fixed_code": "# `SafEth.stake()` can cache `derivatives[i].balance()`\nIn the first for loop, 2 external calls can be reduced to one by saving the queried value:", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/carlitox477-G.md", "collected_at": "2026-01-02T18:18:54.407363+00:00", "source_hash": "6daf9d422a29094acc510906facb1b6b99540d6164c0974ac89bf0e402bd3f3a", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "# `SafEth.stake()` can cache `derivativeCount` and `totalWeight` to save gas\nThis will reduce storage access in both for loops in each iteration", "has_vulnerable_code_snippet": true, "fixed_code_actual": "# `SafEth.stake()` can cache `derivatives[i].balance()`\nIn the first for loop, 2 external calls can be reduced to one by saving the queried value:", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "04-caviar", "title": "0xSmartContract G", "severity_raw": "Medium", "severity": "medium", "description": "### Gas Optimizations List\n| Number | Optimization Details | Context |\n|:--:|:-------| :-----:|\n| [G-01] |Structs can be packed into fewer storage slots| 2 |\n| [G-02] |Function Calls in a Loop Can Cause Denial of Service (DOS) and out of gas due to not checking the Array length| 8 |\n| [G-03] |Missing `zero-address` check in `constructor`|2 |\n| [G-04] |Duplicated require()/if() checks should be refactored to a modifier or function| 7 |\n| [G-05] |if () / require() statements that check input arguments should be at the top of the functions |2|\n| [G-06] |Use ``calldata`` instead of ``memory`` for function arguments that do not get mutated|11 |\n| [G-07] |Use assembly to check for `address(0)` |12 |\n| [G-08] | `x += y (x -= y)` costs more gas than `x = x + y (x = x - y)` for state variables |4 |\n| [G-09] | Change ``public`` function visibility to ``external`` | 17 |\n| [G-10] |Use ``assembly`` to write _address storage values_ | 9 |\n| [G-11] | Setting the _constructor_ to `payable`|3 |\n| [G-12] |Empty blocks should be removed or emit something | 4 |\n| [G-13] |Functions guaranteed to _revert_ when callled by normal users can be marked `payable` | 11 |\n| [G-14] |Use nested if and, avoid multiple check combinationsd|10 |\n| [G-15] |Optimize names to save gas| |\n\nTotal 15 issues\n\n### [G-01] Structs can be packed into fewer storage slots\n\nAs the solidity EVM works with 32 bytes, variables less than 32 bytes should be packed inside a struct so that they can be stored in the same slot, this saves gas when writing to storage ~20000 gas.\n\n2 results - 2 files:\n\n|Title | Total Gas Saved | Instance|\n|:--:|:-------:|:--:|\n|Struct packed | 4k | 2 |\n\n1. The ``Buy`` structure can be packaged as suggested below (from 7 slots to 6 slots)\n\n **1 slot win: 1 * 2k = 2k gas saved**\n\n```solidity\nsrc\\EthRouter.sol:\n\n 48: struct Buy {\n 49: address payable pool;\n 50: address nft;\n 51: uint256[] tokenIds;\n 52: uint256[] tokenWeights;\n 53: Priva", "vulnerable_code": "src\\EthRouter.sol:\n\n 48: struct Buy {\n 49: address payable pool;\n 50: address nft;\n 51: uint256[] tokenIds;\n 52: uint256[] tokenWeights;\n 53: PrivatePool.MerkleMultiProof proof;\n 54: uint256 baseTokenAmount;\n 55: bool isPublicPool;\n 56: }\n", "fixed_code": "2. The ``Sell`` structure can be packaged as suggested below. (from 6 slots to 5 slots)\n\n **1 slot win: 1 * 2k = 2k gas saved**\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/0xSmartContract-G.md", "collected_at": "2026-01-02T18:19:19.004429+00:00", "source_hash": "6e1f9b90626378309d8f2c2796ff3a077dfe15ef6e2703f0fd8095de665594f1", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "src\\EthRouter.sol:\n\n 48: struct Buy {\n 49: address payable pool;\n 50: address nft;\n 51: uint256[] tokenIds;\n 52: uint256[] tokenWeights;\n 53: PrivatePool.MerkleMultiProof proof;\n 54: uint256 baseTokenAmount;\n 55: bool isPublicPool;\n 56: }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "2. The ``Sell`` structure can be packaged as suggested below. (from 6 slots to 5 slots)\n\n **1 slot win: 1 * 2k = 2k gas saved**\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-revert-lend", "title": "0xAnah G", "severity_raw": "High", "severity": "high", "description": "# REVERT LEND GAS OPTIMIZATIONS\n\n\n\n## INTRODUCTION\n\nHighlighted below are optimizations exclusively targeting state-mutating functions and view/pure functions invoked by state-mutating functions. In the discussion that follows, only runtime gas is emphasized, given its inevitable dominance over deployment gas costs throughout the protocol's lifetime. \n\nPlease be aware that some code snippets may be shortened to conserve space, and certain code snippets may include @audit tags in comments to facilitate issue explanations.\"\n\n\n\n\n\n\n## [G-01] Use the existing Local variable/global variable when equal to a state variable to avoid reading from state\n\n### 1 Instances\n1. #### Use `currentShares` in-place of `loan.debtShares` in the statement `uint256 loanDebtShares = loan.debtShares - shares`\n- https://github.com/code-423n4/2024-03-revert-lend/blob/main/src/V3Vault.sol#L990\n\nIn the `_repay()` function as shown below on [line 959](https://github.com/code-423n4/2024-03-revert-lend/blob/main/src/V3Vault.sol#L959) the state variable `loan.debtShares` is being cached in `currentShares` variable. Therefore we could use `currentShares` in place of `loan.debtShares` subsequently but this was not the case on line [line 959](https://github.com/code-423n4/2024-03-revert-lend/blob/main/src/V3Vault.sol#L959) where `loan.debtShares` was used in the statement `uint256 loanDebtShares = loan.debtShares - shares` thereby incurring an `SLOAD` Gwarmaccess `100` gas units where we could have use a stack variable. The diff below shows how the code should be refactored: \n\n```solidity\nfile: src/V3Vault.sol\n\n954: function _repay(uint256 tokenId, uint256 amount, bool isShare, bytes memory permitData) internal {\n955: (uint256 newDebtExchangeRateX96, uint256 newLendExchangeRateX96) = _updateGlobalInterest();\n956: \n957: Loan storage loan = loans[tokenId];\n958: \n959: uint256 currentShares = loan.debtShares;\n960: \n961: uint256 shares;\n962: uint256 assets;\n963: \n", "vulnerable_code": "file: src/V3Vault.sol\n\n954: function _repay(uint256 tokenId, uint256 amount, bool isShare, bytes memory permitData) internal {\n955: (uint256 newDebtExchangeRateX96, uint256 newLendExchangeRateX96) = _updateGlobalInterest();\n956: \n957: Loan storage loan = loans[tokenId];\n958: \n959: uint256 currentShares = loan.debtShares;\n960: \n961: uint256 shares;\n962: uint256 assets;\n963: \n964: if (isShare) {\n965: shares = amount;\n966: assets = _convertToAssets(amount, newDebtExchangeRateX96, Math.Rounding.Up);\n967: } else {\n968: assets = amount;\n969: shares = _convertToShares(amount, newDebtExchangeRateX96, Math.Rounding.Down);\n970: }\n971:\n972: // fails if too much repayed\n973: if (shares > currentShares) {\n974: revert RepayExceedsDebt();\n975: }\n976:\n977: if (assets > 0) {\n978: if (permitData.length > 0) {\n979: (ISignatureTransfer.PermitTransferFrom memory permit, bytes memory signature) =\n980: abi.decode(permitData, (ISignatureTransfer.PermitTransferFrom, bytes));\n981: permit2.permitTransferFrom(\n982: permit, ISignatureTransfer.SignatureTransferDetails(address(this), assets), msg.sender, signature\n983: );\n984: } else {\n985: // fails if not enough token approved\n986: SafeERC20.safeTransferFrom(IERC20(asset), msg.sender, address(this), assets);\n987: }\n988: }\n989: \n990: uint256 loanDebtShares = loan.debtShares - shares; //@audit use stack variable currentShares in place of loan.debtShares\n991: loan.debtShares = loanDebtShares;\n992: debtSharesTotal -= shares;\n993: \n994: // when amounts are repayed - they maybe borrowed again\n995: dailyDebtIncreaseLimitLeft += assets;\n.\n.\n.\n1014: }", "fixed_code": "## [G-02] Calculations should be memoized rather than re-calculating them\nIn computing, memoization or memoisation is an optimization technique used primarily to speed up computer programs by storing the results of expensive function calls to pure functions and returning the cached result when the same inputs occur again.\n\n\n### 2 Instances\n1. #### We can memoize the computations of `SafeCast.toUint192(oldShares - newShares)`\n- https://github.com/code-423n4/2024-03-revert-lend/blob/main/src/V3Vault.sol#L1217\n2. #### We can memoize the computations of `SafeCast.toUint192(newShares - oldShares)`\n- https://github.com/code-423n4/2024-03-revert-lend/blob/main/src/V3Vault.sol#L1220\n\nWe can reduce the gas usage of the `_updateAndCheckCollateral()` function by memoizing the computations of `SafeCast.toUint192(oldShares - newShares)` and `SafeCast.toUint192(newShares - oldShares)` i.e cache the results of their computation so that for subsequent computations we can use the cached values rather than having to recompute the values. The diff below shows how the code could be refactored:\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/0xAnah-G.md", "collected_at": "2026-01-02T19:02:51.701206+00:00", "source_hash": "6e3fe4f2f04ae58a69d66457338a94b9bf9c25cbd9d3f2489532bf89aa072235", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "V3Vault.sol#L990, V3Vault.sol#L959, V3Vault.sol#L1217, V3Vault.sol#L1220", "github_files_list": "V3Vault.sol", "github_refs_count": 4, "vulnerable_code_actual": "file: src/V3Vault.sol\n\n954: function _repay(uint256 tokenId, uint256 amount, bool isShare, bytes memory permitData) internal {\n955: (uint256 newDebtExchangeRateX96, uint256 newLendExchangeRateX96) = _updateGlobalInterest();\n956: \n957: Loan storage loan = loans[tokenId];\n958: \n959: uint256 currentShares = loan.debtShares;\n960: \n961: uint256 shares;\n962: uint256 assets;\n963: \n964: if (isShare) {\n965: shares = amount;\n966: assets = _convertToAssets(amount, newDebtExchangeRateX96, Math.Rounding.Up);\n967: } else {\n968: assets = amount;\n969: shares = _convertToShares(amount, newDebtExchangeRateX96, Math.Rounding.Down);\n970: }\n971:\n972: // fails if too much repayed\n973: if (shares > currentShares) {\n974: revert RepayExceedsDebt();\n975: }\n976:\n977: if (assets > 0) {\n978: if (permitData.length > 0) {\n979: (ISignatureTransfer.PermitTransferFrom memory permit, bytes memory signature) =\n980: abi.decode(permitData, (ISignatureTransfer.PermitTransferFrom, bytes));\n981: permit2.permitTransferFrom(\n982: permit, ISignatureTransfer.SignatureTransferDetails(address(this), assets), msg.sender, signature\n983: );\n984: } else {\n985: // fails if not enough token approved\n986: SafeERC20.safeTransferFrom(IERC20(asset), msg.sender, address(this), assets);\n987: }\n988: }\n989: \n990: uint256 loanDebtShares = loan.debtShares - shares; //@audit use stack variable currentShares in place of loan.debtShares\n991: loan.debtShares = loanDebtShares;\n992: debtSharesTotal -= shares;\n993: \n994: // when amounts are repayed - they maybe borrowed again\n995: dailyDebtIncreaseLimitLeft += assets;\n.\n.\n.\n1014: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## [G-02] Calculations should be memoized rather than re-calculating them\nIn computing, memoization or memoisation is an optimization technique used primarily to speed up computer programs by storing the results of expensive function calls to pure functions and returning the cached result when the same inputs occur again.\n\n\n### 2 Instances\n1. #### We can memoize the computations of `SafeCast.toUint192(oldShares - newShares)`\n- https://github.com/code-423n4/2024-03-revert-lend/blob/main/src/V3Vault.sol#L1217\n2. #### We can memoize the computations of `SafeCast.toUint192(newShares - oldShares)`\n- https://github.com/code-423n4/2024-03-revert-lend/blob/main/src/V3Vault.sol#L1220\n\nWe can reduce the gas usage of the `_updateAndCheckCollateral()` function by memoizing the computations of `SafeCast.toUint192(oldShares - newShares)` and `SafeCast.toUint192(newShares - oldShares)` i.e cache the results of their computation so that for subsequent computations we can use the cached values rather than having to recompute the values. The diff below shows how the code could be refactored:\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "02-ethos", "title": "oyc_109 G", "severity_raw": "High", "severity": "high", "description": "## [G-01] Don't Initialize Variables with Default Value\n\nUninitialized variables are assigned with the types default value. Explicitly initializing a variable with it's default value costs unnecesary gas.\n\n```\n2023-02-ethos/Ethos-Core/contracts/ActivePool.sol::108 => for(uint256 i = 0; i < numCollaterals; i++) {\n2023-02-ethos/Ethos-Core/contracts/CollateralConfig.sol::56 => for(uint256 i = 0; i < _collaterals.length; i++) {\n2023-02-ethos/Ethos-Core/contracts/LQTY/LQTYStaking.sol::206 => for (uint i = 0; i < assets.length; i++) {\n2023-02-ethos/Ethos-Core/contracts/LQTY/LQTYStaking.sol::228 => for (uint i = 0; i < collaterals.length; i++) {\n2023-02-ethos/Ethos-Core/contracts/LQTY/LQTYStaking.sol::240 => for (uint i = 0; i < numCollaterals; i++) {\n2023-02-ethos/Ethos-Core/contracts/MultiTroveGetter.sol::72 => for (uint idx = 0; idx < _startIdx; ++idx) {\n2023-02-ethos/Ethos-Core/contracts/MultiTroveGetter.sol::78 => for (uint idx = 0; idx < _count; ++idx) {\n2023-02-ethos/Ethos-Core/contracts/MultiTroveGetter.sol::101 => for (uint idx = 0; idx < _startIdx; ++idx) {\n2023-02-ethos/Ethos-Core/contracts/MultiTroveGetter.sol::107 => for (uint idx = 0; idx < _count; ++idx) {\n2023-02-ethos/Ethos-Core/contracts/PriceFeed.sol::113 => for (uint256 i = 0; i < numCollaterals; i++) {\n2023-02-ethos/Ethos-Core/contracts/StabilityPool.sol::351 => for (uint i = 0; i < numCollaterals; i++) {\n2023-02-ethos/Ethos-Core/contracts/StabilityPool.sol::397 => for (uint i = 0; i < numCollaterals; i++) {\n2023-02-ethos/Ethos-Core/contracts/StabilityPool.sol::640 => for (uint i = 0; i < assets.length; i++) {\n2023-02-ethos/Ethos-Core/contracts/StabilityPool.sol::810 => for (uint i = 0; i < collaterals.length; i++) {\n2023-02-ethos/Ethos-Core/contracts/StabilityPool.sol::831 => for (uint i = 0; i < collaterals.length; i++) {\n2023-02-ethos/Ethos-Core/contracts/StabilityPool.sol::859 => for (uint i = 0; i < numCollaterals; i++) {\n2023-02-ethos/Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol::117", "vulnerable_code": "2023-02-ethos/Ethos-Core/contracts/ActivePool.sol::108 => for(uint256 i = 0; i < numCollaterals; i++) {\n2023-02-ethos/Ethos-Core/contracts/CollateralConfig.sol::56 => for(uint256 i = 0; i < _collaterals.length; i++) {\n2023-02-ethos/Ethos-Core/contracts/LQTY/LQTYStaking.sol::206 => for (uint i = 0; i < assets.length; i++) {\n2023-02-ethos/Ethos-Core/contracts/LQTY/LQTYStaking.sol::228 => for (uint i = 0; i < collaterals.length; i++) {\n2023-02-ethos/Ethos-Core/contracts/LQTY/LQTYStaking.sol::240 => for (uint i = 0; i < numCollaterals; i++) {\n2023-02-ethos/Ethos-Core/contracts/MultiTroveGetter.sol::72 => for (uint idx = 0; idx < _startIdx; ++idx) {\n2023-02-ethos/Ethos-Core/contracts/MultiTroveGetter.sol::78 => for (uint idx = 0; idx < _count; ++idx) {\n2023-02-ethos/Ethos-Core/contracts/MultiTroveGetter.sol::101 => for (uint idx = 0; idx < _startIdx; ++idx) {\n2023-02-ethos/Ethos-Core/contracts/MultiTroveGetter.sol::107 => for (uint idx = 0; idx < _count; ++idx) {\n2023-02-ethos/Ethos-Core/contracts/PriceFeed.sol::113 => for (uint256 i = 0; i < numCollaterals; i++) {\n2023-02-ethos/Ethos-Core/contracts/StabilityPool.sol::351 => for (uint i = 0; i < numCollaterals; i++) {\n2023-02-ethos/Ethos-Core/contracts/StabilityPool.sol::397 => for (uint i = 0; i < numCollaterals; i++) {\n2023-02-ethos/Ethos-Core/contracts/StabilityPool.sol::640 => for (uint i = 0; i < assets.length; i++) {\n2023-02-ethos/Ethos-Core/contracts/StabilityPool.sol::810 => for (uint i = 0; i < collaterals.length; i++) {\n2023-02-ethos/Ethos-Core/contracts/StabilityPool.sol::831 => for (uint i = 0; i < collaterals.length; i++) {\n2023-02-ethos/Ethos-Core/contracts/StabilityPool.sol::859 => for (uint i = 0; i < numCollaterals; i++) {\n2023-02-ethos/Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol::117 => for (uint256 i = 0; i < numSteps; i = i.uncheckedInc()) {\n2023-02-ethos/Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol::165 => for (uint256 i = 0; i < numSteps; i = i.uncheckedInc()) {\n2023-02-et", "fixed_code": "2023-02-ethos/Ethos-Core/contracts/CollateralConfig.sol::56 => for(uint256 i = 0; i < _collaterals.length; i++) {\n2023-02-ethos/Ethos-Core/contracts/LQTY/LQTYStaking.sol::206 => for (uint i = 0; i < assets.length; i++) {\n2023-02-ethos/Ethos-Core/contracts/LQTY/LQTYStaking.sol::228 => for (uint i = 0; i < collaterals.length; i++) {\n2023-02-ethos/Ethos-Core/contracts/StabilityPool.sol::640 => for (uint i = 0; i < assets.length; i++) {\n2023-02-ethos/Ethos-Core/contracts/StabilityPool.sol::810 => for (uint i = 0; i < collaterals.length; i++) {\n2023-02-ethos/Ethos-Core/contracts/StabilityPool.sol::831 => for (uint i = 0; i < collaterals.length; i++) {\n2023-02-ethos/Ethos-Core/contracts/TroveManager.sol::808 => for (vars.i = 0; vars.i < _troveArray.length; vars.i++) {\n2023-02-ethos/Ethos-Core/contracts/TroveManager.sol::882 => for (vars.i = 0; vars.i < _troveArray.length; vars.i++) {", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/oyc_109-G.md", "collected_at": "2026-01-02T18:17:26.229185+00:00", "source_hash": "6e64d4125b56870c45b9a5a2a10362d4acdf371f99bf41de2e762c522526865d", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "2023-02-ethos/Ethos-Core/contracts/ActivePool.sol::108 => for(uint256 i = 0; i < numCollaterals; i++) {\n2023-02-ethos/Ethos-Core/contracts/CollateralConfig.sol::56 => for(uint256 i = 0; i < _collaterals.length; i++) {\n2023-02-ethos/Ethos-Core/contracts/LQTY/LQTYStaking.sol::206 => for (uint i = 0; i < assets.length; i++) {\n2023-02-ethos/Ethos-Core/contracts/LQTY/LQTYStaking.sol::228 => for (uint i = 0; i < collaterals.length; i++) {\n2023-02-ethos/Ethos-Core/contracts/LQTY/LQTYStaking.sol::240 => for (uint i = 0; i < numCollaterals; i++) {\n2023-02-ethos/Ethos-Core/contracts/MultiTroveGetter.sol::72 => for (uint idx = 0; idx < _startIdx; ++idx) {\n2023-02-ethos/Ethos-Core/contracts/MultiTroveGetter.sol::78 => for (uint idx = 0; idx < _count; ++idx) {\n2023-02-ethos/Ethos-Core/contracts/MultiTroveGetter.sol::101 => for (uint idx = 0; idx < _startIdx; ++idx) {\n2023-02-ethos/Ethos-Core/contracts/MultiTroveGetter.sol::107 => for (uint idx = 0; idx < _count; ++idx) {\n2023-02-ethos/Ethos-Core/contracts/PriceFeed.sol::113 => for (uint256 i = 0; i < numCollaterals; i++) {\n2023-02-ethos/Ethos-Core/contracts/StabilityPool.sol::351 => for (uint i = 0; i < numCollaterals; i++) {\n2023-02-ethos/Ethos-Core/contracts/StabilityPool.sol::397 => for (uint i = 0; i < numCollaterals; i++) {\n2023-02-ethos/Ethos-Core/contracts/StabilityPool.sol::640 => for (uint i = 0; i < assets.length; i++) {\n2023-02-ethos/Ethos-Core/contracts/StabilityPool.sol::810 => for (uint i = 0; i < collaterals.length; i++) {\n2023-02-ethos/Ethos-Core/contracts/StabilityPool.sol::831 => for (uint i = 0; i < collaterals.length; i++) {\n2023-02-ethos/Ethos-Core/contracts/StabilityPool.sol::859 => for (uint i = 0; i < numCollaterals; i++) {\n2023-02-ethos/Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol::117 => for (uint256 i = 0; i < numSteps; i = i.uncheckedInc()) {\n2023-02-ethos/Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol::165 => for (uint256 i = 0; i < numSteps; i = i.uncheckedInc()) {\n2023-02-et", "has_vulnerable_code_snippet": true, "fixed_code_actual": "2023-02-ethos/Ethos-Core/contracts/CollateralConfig.sol::56 => for(uint256 i = 0; i < _collaterals.length; i++) {\n2023-02-ethos/Ethos-Core/contracts/LQTY/LQTYStaking.sol::206 => for (uint i = 0; i < assets.length; i++) {\n2023-02-ethos/Ethos-Core/contracts/LQTY/LQTYStaking.sol::228 => for (uint i = 0; i < collaterals.length; i++) {\n2023-02-ethos/Ethos-Core/contracts/StabilityPool.sol::640 => for (uint i = 0; i < assets.length; i++) {\n2023-02-ethos/Ethos-Core/contracts/StabilityPool.sol::810 => for (uint i = 0; i < collaterals.length; i++) {\n2023-02-ethos/Ethos-Core/contracts/StabilityPool.sol::831 => for (uint i = 0; i < collaterals.length; i++) {\n2023-02-ethos/Ethos-Core/contracts/TroveManager.sol::808 => for (vars.i = 0; vars.i < _troveArray.length; vars.i++) {\n2023-02-ethos/Ethos-Core/contracts/TroveManager.sol::882 => for (vars.i = 0; vars.i < _troveArray.length; vars.i++) {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "05-ajna", "title": "codeslide G", "severity_raw": "Medium", "severity": "medium", "description": "### Gas Optimizations\n\n| Number | Issue | Instances |\n| :----: | :---------------------------------------- | :-------: |\n| [G-01] | Don\u2019t initialize integers to zero | 25 |\n| [G-02] | Cache array size before loop | 8 |\n| [G-03] | Unnecessary computation | 4 |\n| [G-04] | Addition and subtraction syntax | 15 |\n| [G-05] | Check amount before transfer | 1 |\n| [G-06] | Use short circuiting to save gas | 3 |\n| [G-07] | Use a constant instead of type(uintX).max | 1 |\n| [G-08] | Use assembly to check for address(0) | 1 |\n\n#### [G-01] Don\u2019t initialize integers to zero\n\nIt costs more gas to initialize variables to zero than to let the default of zero be applied.\n\n```solidity\nFile: ajna-core/src/PositionManager.sol\n\n181: for (uint256 i = 0; i < indexesLength; ) {\n```\n\n```solidity\nFile: ajna-core/src/PositionManager.sol\n\n181: for (uint256 i = 0; i < indexesLength; ) {\n\n364: for (uint256 i = 0; i < indexesLength; ) {\n\n474: uint256 filteredIndexesLength = 0;\n\n476: for (uint256 i = 0; i < indexesLength; ) {\n```\n\n```solidity\nFile: ajna-core/src/RewardsManager.sol\n\n163: for (uint256 i = 0; i < fromBucketLength; ) {\n\n229: for (uint256 i = 0; i < positionIndexes.length; ) {\n\n290: for (uint256 i = 0; i < positionIndexes.length; ) {\n\n440: for (uint256 i = 0; i < positionIndexes_.length; ) {\n\n680: for (uint256 i = 0; i < indexes_.length; ) {\n\n704: for (uint256 i = 0; i < indexes_.length; ) {\n```\n\n```solidity\nFile: ajna-grants/src/grants/base/Funding.sol\n\n62: for (uint256 i = 0; i < targets_.length; ++i) {\n\n112: for (uint256 i = 0; i < targets_.length;) {\n```\n\n```solidity\nFile: ajna-grants/src/grants/base/StandardFunding.sol\n\n63: uint24 internal _currentDistributionId = 0;\n\n208: for (uint i =", "vulnerable_code": "File: ajna-core/src/PositionManager.sol\n\n181: for (uint256 i = 0; i < indexesLength; ) {", "fixed_code": "File: ajna-core/src/PositionManager.sol\n\n181: for (uint256 i = 0; i < indexesLength; ) {\n\n364: for (uint256 i = 0; i < indexesLength; ) {\n\n474: uint256 filteredIndexesLength = 0;\n\n476: for (uint256 i = 0; i < indexesLength; ) {", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/codeslide-G.md", "collected_at": "2026-01-02T18:21:23.918671+00:00", "source_hash": "6e734ae5a1212ff13d387ac91512195abe412aff21eba5084299b2134409aeb6", "code_block_count": 4, "solidity_block_count": 4, "total_code_chars": 946, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: ajna-core/src/PositionManager.sol\n\n181: for (uint256 i = 0; i < indexesLength; ) {", "primary_code_language": "solidity", "primary_code_char_count": 96, "all_code_blocks": "// Code block 1 (solidity):\nFile: ajna-core/src/PositionManager.sol\n\n181: for (uint256 i = 0; i < indexesLength; ) {\n\n// Code block 2 (solidity):\nFile: ajna-core/src/PositionManager.sol\n\n181: for (uint256 i = 0; i < indexesLength; ) {\n\n364: for (uint256 i = 0; i < indexesLength; ) {\n\n474: uint256 filteredIndexesLength = 0;\n\n476: for (uint256 i = 0; i < indexesLength; ) {\n\n// Code block 3 (solidity):\nFile: ajna-core/src/RewardsManager.sol\n\n163: for (uint256 i = 0; i < fromBucketLength; ) {\n\n229: for (uint256 i = 0; i < positionIndexes.length; ) {\n\n290: for (uint256 i = 0; i < positionIndexes.length; ) {\n\n440: for (uint256 i = 0; i < positionIndexes_.length; ) {\n\n680: for (uint256 i = 0; i < indexes_.length; ) {\n\n704: for (uint256 i = 0; i < indexes_.length; ) {\n\n// Code block 4 (solidity):\nFile: ajna-grants/src/grants/base/Funding.sol\n\n62: for (uint256 i = 0; i < targets_.length; ++i) {\n\n112: for (uint256 i = 0; i < targets_.length;) {", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: ajna-core/src/PositionManager.sol\n\n181: for (uint256 i = 0; i < indexesLength; ) {\n\nFile: ajna-core/src/PositionManager.sol\n\n181: for (uint256 i = 0; i < indexesLength; ) {\n\n364: for (uint256 i = 0; i < indexesLength; ) {\n\n474: uint256 filteredIndexesLength = 0;\n\n476: for (uint256 i = 0; i < indexesLength; ) {\n\nFile: ajna-core/src/RewardsManager.sol\n\n163: for (uint256 i = 0; i < fromBucketLength; ) {\n\n229: for (uint256 i = 0; i < positionIndexes.length; ) {\n\n290: for (uint256 i = 0; i < positionIndexes.length; ) {\n\n440: for (uint256 i = 0; i < positionIndexes_.length; ) {\n\n680: for (uint256 i = 0; i < indexes_.length; ) {\n\n704: for (uint256 i = 0; i < indexes_.length; ) {\n\nFile: ajna-grants/src/grants/base/Funding.sol\n\n62: for (uint256 i = 0; i < targets_.length; ++i) {\n\n112: for (uint256 i = 0; i < targets_.length;) {", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: ajna-core/src/PositionManager.sol\n\n181: for (uint256 i = 0; i < indexesLength; ) {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: ajna-core/src/PositionManager.sol\n\n181: for (uint256 i = 0; i < indexesLength; ) {\n\n364: for (uint256 i = 0; i < indexesLength; ) {\n\n474: uint256 filteredIndexesLength = 0;\n\n476: for (uint256 i = 0; i < indexesLength; ) {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "03-asymmetry", "title": "0x_kmr_ Q", "severity_raw": "Critical", "severity": "critical", "description": "GAS OPTIMIZATIONS:\n\n### G[1] Use arithmetic operating instead using loop for calculating totalWeight adjustment \n[Link to github permalink](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L165-L175)\n```\nfunction adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n) external onlyOwner {\n+ uint256 oldWeight = weights[_derivativeIndex];\n+ weights[_derivativeIndex] = _weight;\n+ totalWeight = totalWeight - oldWeight + _weight;\n\n- weights[_derivativeIndex] = _weight;\n- uint256 localTotalWeight = 0;\n- for (uint256 i = 0; i < derivativeCount; i++)\n- localTotalWeight += weights[i];\n- totalWeight = localTotalWeight;\n emit WeightChange(_derivativeIndex, _weight);\n\n}\n```\n\nThe code above shows a function called `adjustWeight` that allows the owner to adjust the weight of a derivative. The function has been optimized to reduce gas consumption by eliminating the loop and instead, tracking the old weight, updating the new weight, and recalculating the total weight with a simple arithmetic operation.\n\nThis new code adds a variable `oldWeight` to store the original weight of the derivative before updating it. Then, the function updates the derivative's weight with the new weight provided by the owner and recalculates the total weight by subtracting the old weight and adding the new weight. This eliminates the need for a loop that calculates the total weight of all derivatives.\n\n## G[2] Use arithmetic operating instead using loop for new totalWeight calculating\n[Link to github permalink](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L182-L195)\n```\nfunction addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n // @remind\n gas/extra calcualti", "vulnerable_code": "function adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n) external onlyOwner {\n+ uint256 oldWeight = weights[_derivativeIndex];\n+ weights[_derivativeIndex] = _weight;\n+ totalWeight = totalWeight - oldWeight + _weight;\n\n- weights[_derivativeIndex] = _weight;\n- uint256 localTotalWeight = 0;\n- for (uint256 i = 0; i < derivativeCount; i++)\n- localTotalWeight += weights[i];\n- totalWeight = localTotalWeight;\n emit WeightChange(_derivativeIndex, _weight);\n\n}", "fixed_code": "function addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n // @remind\n gas/extra calcualtion\n+ totalWeight = totalWeight + _weight;\n\n- uint256 localTotalWeight = 0;\n- for (uint256 i = 0; i < derivativeCount; i++)\n- localTotalWeight += weights[i];\n- totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/0x_kmr_-Q.md", "collected_at": "2026-01-02T18:17:39.597894+00:00", "source_hash": "6e9d14430cb5fca860514924fcb9af8d8cf6f81949aacd6b25f5f2a59fda0590", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 502, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n) external onlyOwner {\n+ uint256 oldWeight = weights[_derivativeIndex];\n+ weights[_derivativeIndex] = _weight;\n+ totalWeight = totalWeight - oldWeight + _weight;\n\n- weights[_derivativeIndex] = _weight;\n- uint256 localTotalWeight = 0;\n- for (uint256 i = 0; i < derivativeCount; i++)\n- localTotalWeight += weights[i];\n- totalWeight = localTotalWeight;\n emit WeightChange(_derivativeIndex, _weight);\n\n}", "primary_code_language": "unknown", "primary_code_char_count": 502, "all_code_blocks": "// Code block 1 (unknown):\nfunction adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n) external onlyOwner {\n+ uint256 oldWeight = weights[_derivativeIndex];\n+ weights[_derivativeIndex] = _weight;\n+ totalWeight = totalWeight - oldWeight + _weight;\n\n- weights[_derivativeIndex] = _weight;\n- uint256 localTotalWeight = 0;\n- for (uint256 i = 0; i < derivativeCount; i++)\n- localTotalWeight += weights[i];\n- totalWeight = localTotalWeight;\n emit WeightChange(_derivativeIndex, _weight);\n\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol#L165-L175, SafEth.sol#L182-L195", "github_files_list": "SafEth.sol", "github_refs_count": 2, "vulnerable_code_actual": "function adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n) external onlyOwner {\n+ uint256 oldWeight = weights[_derivativeIndex];\n+ weights[_derivativeIndex] = _weight;\n+ totalWeight = totalWeight - oldWeight + _weight;\n\n- weights[_derivativeIndex] = _weight;\n- uint256 localTotalWeight = 0;\n- for (uint256 i = 0; i < derivativeCount; i++)\n- localTotalWeight += weights[i];\n- totalWeight = localTotalWeight;\n emit WeightChange(_derivativeIndex, _weight);\n\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n // @remind\n gas/extra calcualtion\n+ totalWeight = totalWeight + _weight;\n\n- uint256 localTotalWeight = 0;\n- for (uint256 i = 0; i < derivativeCount; i++)\n- localTotalWeight += weights[i];\n- totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "07-amphora", "title": "hunter_w3b G", "severity_raw": "Medium", "severity": "medium", "description": "# Gas Optimization\n\n# Summary\n\n| Number | Optimization Details | Context |\n| :----: | :--------------------------------------------------------------------------------------------------------- | :-----: |\n| [G-01] | Gas ine\ufb03cient implementation of a loop in `VaultController::_getVaultBorrowingPower()` | 1 |\n| [G-02] | Before some functions we should `check` some variables for possible gas save | 7 |\n| [G-03] | Internal functions not called by the contract should be `removed` to save deployment gas | 3 |\n| [G-04] | Make 3 `event` parameters indexed when possible | 32 |\n| [G-05] | Use assembly to write address `storage` values | 10 |\n| [G-06] | Use nested if statements instead of `&&` | 7 |\n| [G-07] | `keccak256()` should only need to be called on a specific string literal once | 4 |\n| [G-08] | Should use `arguments` instead of state variables in `emit` | 16 |\n| [G-09] | Using `XOR (^)` and `OR ` bitwise equivalents | 7 |\n| [G-10] | Duplicated `if()` checks should be refactored to a modifier or function | 17 |\n| [G-11] | Do not calculate constants | 8 |\n| [G-12] | Use hardcode address instead `address(this)` | 8 |\n| [G-13] | Not using the named return variables when a function returns, wastes deployment gas | 6 |\n| [G-14] | Can Make", "vulnerable_code": "File: contracts/core/VaultController.sol\n\n function _getVaultBorrowingPower(IVault _vault) private returns (uint192 _borrowPower) {\n // loop over each registed token, adding the indivuduals ltv to the total ltv of the vault\n for (uint192 _i; _i < enabledTokens.length; ++_i) {\n CollateralInfo memory _collateral = tokenAddressCollateralInfo[enabledTokens[_i]];\n // if the ltv is 0, continue\n if (_collateral.ltv == 0) continue;\n // get the address of the token through the array of enabled tokens\n // note that index 0 of enabledTokens corresponds to a vaultId of 1, so we must subtract 1 from i to get the correct index\n address _tokenAddress = enabledTokens[_i];\n // the balance is the vault's token balance of the current collateral token in the loop\n uint256 _balance = _vault.balances(_tokenAddress);\n if (_balance == 0) continue;\n // the raw price is simply the oracle price of the token\n uint192 _rawPrice = _safeu192(_collateral.oracle.currentValue());\n if (_rawPrice == 0) continue;\n // the token value is equal to the price * balance * tokenLTV\n uint192 _tokenValue = _safeu192(\n _truncate(_truncate(_balance * _collateral.ltv * _getPriceWithDecimals(_rawPrice, _collateral.decimals)))\n );\n // increase the ltv of the vault by the token value\n _borrowPower += _tokenValue;\n }\n }", "fixed_code": "File: core/solidity/contracts/core/AMPHClaimer.sol\n\n129 IERC20(_token).transfer(owner(), _amount);\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/hunter_w3b-G.md", "collected_at": "2026-01-02T18:23:49.716250+00:00", "source_hash": "6ef3990ca8a4a3463e77877c13139ff36381dad1f6172c97d9fd3f1b6a4377d7", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: contracts/core/VaultController.sol\n\n function _getVaultBorrowingPower(IVault _vault) private returns (uint192 _borrowPower) {\n // loop over each registed token, adding the indivuduals ltv to the total ltv of the vault\n for (uint192 _i; _i < enabledTokens.length; ++_i) {\n CollateralInfo memory _collateral = tokenAddressCollateralInfo[enabledTokens[_i]];\n // if the ltv is 0, continue\n if (_collateral.ltv == 0) continue;\n // get the address of the token through the array of enabled tokens\n // note that index 0 of enabledTokens corresponds to a vaultId of 1, so we must subtract 1 from i to get the correct index\n address _tokenAddress = enabledTokens[_i];\n // the balance is the vault's token balance of the current collateral token in the loop\n uint256 _balance = _vault.balances(_tokenAddress);\n if (_balance == 0) continue;\n // the raw price is simply the oracle price of the token\n uint192 _rawPrice = _safeu192(_collateral.oracle.currentValue());\n if (_rawPrice == 0) continue;\n // the token value is equal to the price * balance * tokenLTV\n uint192 _tokenValue = _safeu192(\n _truncate(_truncate(_balance * _collateral.ltv * _getPriceWithDecimals(_rawPrice, _collateral.decimals)))\n );\n // increase the ltv of the vault by the token value\n _borrowPower += _tokenValue;\n }\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: core/solidity/contracts/core/AMPHClaimer.sol\n\n129 IERC20(_token).transfer(owner(), _amount);\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "05-ajna", "title": "0xWaitress Q", "severity_raw": "Medium", "severity": "medium", "description": "1. Modify the moveLiquidity function in Position Manager, or add a new one `moveLiquidities` such that the RewardsManager can call moveStakedLiquidity with all indexes, instead of making repeated calls.\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/RewardsManager.sol#L163-L175\n\n```solidity\n for (uint256 i = 0; i < fromBucketLength; ) {\n fromIndex = fromBuckets_[i];\n toIndex = toBuckets_[i];\n\n // call out to position manager to move liquidity between buckets\n IPositionManagerOwnerActions.MoveLiquidityParams memory moveLiquidityParams = IPositionManagerOwnerActions.MoveLiquidityParams(\n tokenId_,\n ajnaPool,\n fromIndex,\n toIndex,\n expiry_\n );\n positionManager.moveLiquidity(moveLiquidityParams);\n```\n\n--- \\n\n\n2. EnumerableSet from Openzeppelin advises against using `values()` in a write function, however the protocol has been using it for positionIndexes in lots of places, for example `moveStakedLiquidity`, gas estimate is needed for measuring the maximal number of input given a gas limit.\n\nhttps://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/structs/EnumerableSet.sol\n\n```solidity\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n```\n\n--- \\n\n\n3. reedemPositions should be renamed to redeem", "vulnerable_code": " for (uint256 i = 0; i < fromBucketLength; ) {\n fromIndex = fromBuckets_[i];\n toIndex = toBuckets_[i];\n\n // call out to position manager to move liquidity between buckets\n IPositionManagerOwnerActions.MoveLiquidityParams memory moveLiquidityParams = IPositionManagerOwnerActions.MoveLiquidityParams(\n tokenId_,\n ajnaPool,\n fromIndex,\n toIndex,\n expiry_\n );\n positionManager.moveLiquidity(moveLiquidityParams);", "fixed_code": " /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/0xWaitress-Q.md", "collected_at": "2026-01-02T18:20:50.219470+00:00", "source_hash": "6f0811aa09304d854711951b09e92e93abd604a90ad0e8759c058f0ab20eb2da", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 1192, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "for (uint256 i = 0; i < fromBucketLength; ) {\n fromIndex = fromBuckets_[i];\n toIndex = toBuckets_[i];\n\n // call out to position manager to move liquidity between buckets\n IPositionManagerOwnerActions.MoveLiquidityParams memory moveLiquidityParams = IPositionManagerOwnerActions.MoveLiquidityParams(\n tokenId_,\n ajnaPool,\n fromIndex,\n toIndex,\n expiry_\n );\n positionManager.moveLiquidity(moveLiquidityParams);", "primary_code_language": "solidity", "primary_code_char_count": 549, "all_code_blocks": "// Code block 1 (solidity):\nfor (uint256 i = 0; i < fromBucketLength; ) {\n fromIndex = fromBuckets_[i];\n toIndex = toBuckets_[i];\n\n // call out to position manager to move liquidity between buckets\n IPositionManagerOwnerActions.MoveLiquidityParams memory moveLiquidityParams = IPositionManagerOwnerActions.MoveLiquidityParams(\n tokenId_,\n ajnaPool,\n fromIndex,\n toIndex,\n expiry_\n );\n positionManager.moveLiquidity(moveLiquidityParams);\n\n// Code block 2 (solidity):\n/**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "for (uint256 i = 0; i < fromBucketLength; ) {\n fromIndex = fromBuckets_[i];\n toIndex = toBuckets_[i];\n\n // call out to position manager to move liquidity between buckets\n IPositionManagerOwnerActions.MoveLiquidityParams memory moveLiquidityParams = IPositionManagerOwnerActions.MoveLiquidityParams(\n tokenId_,\n ajnaPool,\n fromIndex,\n toIndex,\n expiry_\n );\n positionManager.moveLiquidity(moveLiquidityParams);\n\n/**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }", "github_refs_formatted": "RewardsManager.sol#L163-L175, EnumerableSet.sol", "github_files_list": "RewardsManager.sol, EnumerableSet.sol", "github_refs_count": 2, "vulnerable_code_actual": " for (uint256 i = 0; i < fromBucketLength; ) {\n fromIndex = fromBuckets_[i];\n toIndex = toBuckets_[i];\n\n // call out to position manager to move liquidity between buckets\n IPositionManagerOwnerActions.MoveLiquidityParams memory moveLiquidityParams = IPositionManagerOwnerActions.MoveLiquidityParams(\n tokenId_,\n ajnaPool,\n fromIndex,\n toIndex,\n expiry_\n );\n positionManager.moveLiquidity(moveLiquidityParams);", "has_vulnerable_code_snippet": true, "fixed_code_actual": " /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "09-ondo", "title": "petrichor G", "severity_raw": "Low", "severity": "low", "description": "# gas \n\n# summary\n\n| | issue | instance |\n|-------|-------|----------|\n|[G-01]|Functions guaranteed to revert when called by normal users can be marked\u00a0payable|25|\n|[G-02]|Use assembly to perform efficient back-to-back calls|2|\n|[G-03]|Use assembly to perform efficient back-to-back calls|2|\n|[G-04]|Avoid emitting storage values|2|\n|[G-05]|Use Assembly To Check For\u00a0address(0)|8|\n|[G-06]|Use\u00a0do while\u00a0loops instead of\u00a0for\u00a0loops|2|\n|[G-07]|not equal to zero\" (!= 0) or the \"equal to zero\" (== 0)|1|\n\n\n## [G-01] Functions guaranteed to revert when called by normal users can be marked\u00a0payable\n\n\nIf a function modifier such as\u00a0onlyOwner\u00a0is used, the function will revert if a normal user tries to pay the function. Marking the function as\u00a0payable\u00a0will lower the gas cost for legitimate callers because the compiler will not include checks for whether a payment was provided.\n\n```solidity\nFile: contracts/bridge/DestinationBridge.sol\n210 function addApprover(address approver) external onlyOwner {\n\n220 function removeApprover(address approver) external onlyOwner {\n\n234 function addChainSupport(\n string calldata srcChain,\n string calldata srcContractAddress\n ) external onlyOwner {\n\n255 function setThresholds(\n string calldata srcChain,\n uint256[] calldata amounts,\n uint256[] calldata numOfApprovers\n ) external onlyOwner {\n\n286 function setMintLimit(uint256 mintLimit) external onlyOwner {\n\n295 function setMintLimitDuration(uint256 mintDuration) external onlyOwner {\n\n304 function pause() external onlyOwner {\n\n313 function unpause() external onlyOwner {\n\n322 function rescueTokens(address _token) external onlyOwner { \n```\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/DestinationBridge.sol#L210\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/DestinationBridge.sol#L220\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/DestinationBridge.sol#L234\nhttps://github.com", "vulnerable_code": "File: contracts/bridge/DestinationBridge.sol\n210 function addApprover(address approver) external onlyOwner {\n\n220 function removeApprover(address approver) external onlyOwner {\n\n234 function addChainSupport(\n string calldata srcChain,\n string calldata srcContractAddress\n ) external onlyOwner {\n\n255 function setThresholds(\n string calldata srcChain,\n uint256[] calldata amounts,\n uint256[] calldata numOfApprovers\n ) external onlyOwner {\n\n286 function setMintLimit(uint256 mintLimit) external onlyOwner {\n\n295 function setMintLimitDuration(uint256 mintDuration) external onlyOwner {\n\n304 function pause() external onlyOwner {\n\n313 function unpause() external onlyOwner {\n\n322 function rescueTokens(address _token) external onlyOwner { ", "fixed_code": "File: contracts/bridge/SourceBridge.sol\n121 function setDestinationChainContractAddress(\n string memory destinationChain,\n address contractAddress\n ) external onlyOwner {\n\n136 function pause() external onlyOwner {\n\n145 function unpause() external onlyOwner {", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/petrichor-G.md", "collected_at": "2026-01-02T18:26:12.660131+00:00", "source_hash": "6f2f323069830d4b8d025939588189727e2f87e537296620627f1878e78ea12b", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 770, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/bridge/DestinationBridge.sol\n210 function addApprover(address approver) external onlyOwner {\n\n220 function removeApprover(address approver) external onlyOwner {\n\n234 function addChainSupport(\n string calldata srcChain,\n string calldata srcContractAddress\n ) external onlyOwner {\n\n255 function setThresholds(\n string calldata srcChain,\n uint256[] calldata amounts,\n uint256[] calldata numOfApprovers\n ) external onlyOwner {\n\n286 function setMintLimit(uint256 mintLimit) external onlyOwner {\n\n295 function setMintLimitDuration(uint256 mintDuration) external onlyOwner {\n\n304 function pause() external onlyOwner {\n\n313 function unpause() external onlyOwner {\n\n322 function rescueTokens(address _token) external onlyOwner {", "primary_code_language": "solidity", "primary_code_char_count": 770, "all_code_blocks": "// Code block 1 (solidity):\nFile: contracts/bridge/DestinationBridge.sol\n210 function addApprover(address approver) external onlyOwner {\n\n220 function removeApprover(address approver) external onlyOwner {\n\n234 function addChainSupport(\n string calldata srcChain,\n string calldata srcContractAddress\n ) external onlyOwner {\n\n255 function setThresholds(\n string calldata srcChain,\n uint256[] calldata amounts,\n uint256[] calldata numOfApprovers\n ) external onlyOwner {\n\n286 function setMintLimit(uint256 mintLimit) external onlyOwner {\n\n295 function setMintLimitDuration(uint256 mintDuration) external onlyOwner {\n\n304 function pause() external onlyOwner {\n\n313 function unpause() external onlyOwner {\n\n322 function rescueTokens(address _token) external onlyOwner {", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: contracts/bridge/DestinationBridge.sol\n210 function addApprover(address approver) external onlyOwner {\n\n220 function removeApprover(address approver) external onlyOwner {\n\n234 function addChainSupport(\n string calldata srcChain,\n string calldata srcContractAddress\n ) external onlyOwner {\n\n255 function setThresholds(\n string calldata srcChain,\n uint256[] calldata amounts,\n uint256[] calldata numOfApprovers\n ) external onlyOwner {\n\n286 function setMintLimit(uint256 mintLimit) external onlyOwner {\n\n295 function setMintLimitDuration(uint256 mintDuration) external onlyOwner {\n\n304 function pause() external onlyOwner {\n\n313 function unpause() external onlyOwner {\n\n322 function rescueTokens(address _token) external onlyOwner {", "github_refs_formatted": "DestinationBridge.sol#L210, DestinationBridge.sol#L220, DestinationBridge.sol#L234", "github_files_list": "DestinationBridge.sol", "github_refs_count": 3, "vulnerable_code_actual": "File: contracts/bridge/DestinationBridge.sol\n210 function addApprover(address approver) external onlyOwner {\n\n220 function removeApprover(address approver) external onlyOwner {\n\n234 function addChainSupport(\n string calldata srcChain,\n string calldata srcContractAddress\n ) external onlyOwner {\n\n255 function setThresholds(\n string calldata srcChain,\n uint256[] calldata amounts,\n uint256[] calldata numOfApprovers\n ) external onlyOwner {\n\n286 function setMintLimit(uint256 mintLimit) external onlyOwner {\n\n295 function setMintLimitDuration(uint256 mintDuration) external onlyOwner {\n\n304 function pause() external onlyOwner {\n\n313 function unpause() external onlyOwner {\n\n322 function rescueTokens(address _token) external onlyOwner { ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/bridge/SourceBridge.sol\n121 function setDestinationChainContractAddress(\n string memory destinationChain,\n address contractAddress\n ) external onlyOwner {\n\n136 function pause() external onlyOwner {\n\n145 function unpause() external onlyOwner {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-ondo", "title": "minhquanym Q", "severity_raw": "Medium", "severity": "medium", "description": "# Summary\n\n| Id | Title |\n| -- | ----- |\n| 1 | No Storage Gap for Upgradeable Contracts |\n| 2 | Admin manager can steal funds approved to CashManager |\n\n# 1. No Storage Gap for Upgradeable Contracts\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/cash/kyc/KYCRegistryClient.sol#L28\n\n## Detail\nFor upgradeable contracts, there must be storage gap to \"allow developers to freely add new state variables in the future without compromising the storage compatibility with existing deployments\". Otherwise it may be very difficult to write new implementation code. Without storage gap, the variable in child contract might be overwritten by the upgraded base contract if new variables are added to the base contract. This could have unintended and very serious consequences to the child contracts.\n\nRefer to the bottom part of this article: https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable\n\n## Recommendation\nRecommend adding appropriate storage gap at the end of upgradeable contracts such as the below. Please reference OpenZeppelin upgradeable contract templates.\n```solidity\nuint256[50] private __gap;\n```\n\n\n# 2. Admin manager can steal funds approved to CashManager\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/cash/CashManager.sol#L962\n\n## Detail\nIn CashManager contract, admin has a `multiexcall()` function, allowing them to call to arbitrary contract with any calldata. It can be abused to call to ERC20 token contract, and steal all funds that users approved to CashManager contract.\n```solidity\nfunction multiexcall(\n ExCallData[] calldata exCallData\n)\n external\n payable\n override\n nonReentrant\n onlyRole(MANAGER_ADMIN)\n whenPaused\n returns (bytes[] memory results)\n{\n results = new bytes[](exCallData.length);\n for (uint256 i = 0; i < exCallData.length; ++i) {\n (bool success, bytes memory ret) = address(exCallData[i].target).call{ \n // @audit m", "vulnerable_code": "uint256[50] private __gap;", "fixed_code": "function multiexcall(\n ExCallData[] calldata exCallData\n)\n external\n payable\n override\n nonReentrant\n onlyRole(MANAGER_ADMIN)\n whenPaused\n returns (bytes[] memory results)\n{\n results = new bytes[](exCallData.length);\n for (uint256 i = 0; i < exCallData.length; ++i) {\n (bool success, bytes memory ret) = address(exCallData[i].target).call{ \n // @audit manager can steal funds approved to this contract of users\n value: exCallData[i].value\n }(exCallData[i].data);\n require(success, \"Call Failed\");\n results[i] = ret;\n }\n}", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/minhquanym-Q.md", "collected_at": "2026-01-02T18:15:21.939508+00:00", "source_hash": "6f4e7c633f0dadb3be70233856fc2fd2eb1c8282488916f2666c8b47d072a5ca", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 26, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "uint256[50] private __gap;", "primary_code_language": "solidity", "primary_code_char_count": 26, "all_code_blocks": "// Code block 1 (solidity):\nuint256[50] private __gap;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "uint256[50] private __gap;", "github_refs_formatted": "KYCRegistryClient.sol#L28, CashManager.sol#L962", "github_files_list": "CashManager.sol, KYCRegistryClient.sol", "github_refs_count": 2, "vulnerable_code_actual": "uint256[50] private __gap;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function multiexcall(\n ExCallData[] calldata exCallData\n)\n external\n payable\n override\n nonReentrant\n onlyRole(MANAGER_ADMIN)\n whenPaused\n returns (bytes[] memory results)\n{\n results = new bytes[](exCallData.length);\n for (uint256 i = 0; i < exCallData.length; ++i) {\n (bool success, bytes memory ret) = address(exCallData[i].target).call{ \n // @audit manager can steal funds approved to this contract of users\n value: exCallData[i].value\n }(exCallData[i].data);\n require(success, \"Call Failed\");\n results[i] = ret;\n }\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-ondo", "title": "Rolezn Q", "severity_raw": "Critical", "severity": "critical", "description": " ## Summary
\n\n### Low Risk Issues\n| |Issue|Contexts|\n|-|:-|:-:|\n| [LOW‑1](#LOW‑1) | Init functions are susceptible to front-running | 2 |\n| [LOW‑2](#LOW‑2) | Loss of precision due to rounding | 3 |\n| [LOW‑3](#LOW‑3) | Missing parameter validation in `constructor` | 9 |\n| [LOW‑4](#LOW‑4) | Missing Contract-existence Checks Before Low-level Calls | 4 |\n| [LOW‑5](#LOW‑5) | The `nonReentrant` modifier should occur before all other modifiers | 4 |\n| [LOW‑6](#LOW‑6) | Contracts are not using their OZ Upgradeable counterparts | 14 |\n| [LOW‑7](#LOW‑7) | Prevent division by 0 | 1 |\n| [LOW‑8](#LOW‑8) | `require()` should be used instead of `assert()` | 3 |\n| [LOW‑9](#LOW‑9) | Use `safetransfer` Instead Of `transfer` | 6 |\n| [LOW‑10](#LOW‑10) | Admin privilege - A single point of failure can allow a hacked or malicious owner use critical functions in the project | 10 |\n| [LOW‑11](#LOW‑11) | TransferOwnership Should Be Two Step | 3 |\n| [LOW‑12](#LOW‑12) | No Storage Gap For Upgradeable Contracts | 4 |\n| [LOW‑13](#LOW‑13) | Use `safeTransferOwnership` instead of `transferOwnership` function | 3 |\n| [LOW‑14](#LOW‑14) | Missing Non Reentrancy Modifiers | 1 |\n\nTotal: 67 contexts over 14 issues\n\n### Non-critical Issues\n| |Issue|Contexts|\n|-|:-|:-:|\n| [NC‑1](#NC‑1) | Add a timelock to critical functions | 36 |\n| [NC‑2](#NC‑2) | Avoid Floating Pragmas: The Version Should Be Locked | 11 |\n| [NC‑3](#NC‑3) | Compliance with Solidity Style rules in Constant expressions | 15 |\n| [NC‑4](#NC‑4) | Expressions for constant values such as a call to `keccak256()`, should use `immutable` rather than `constant` | 14 |\n| [NC‑5](#NC‑5) | Critical Changes Should Use Two-step Procedure | 36 |\n| [NC‑6](#NC‑6) ", "vulnerable_code": "function __KYCRegistryClientInitializable_init(", "fixed_code": "function __KYCRegistryClientInitializable_init_unchained(", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/Rolezn-Q.md", "collected_at": "2026-01-02T18:14:45.753140+00:00", "source_hash": "6f568c78d857e1f0129d21159efa75e661357c65070973cafa61473b615ad06e", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function __KYCRegistryClientInitializable_init(", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function __KYCRegistryClientInitializable_init_unchained(", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-biconomy", "title": "RaymondFam G", "severity_raw": "High", "severity": "high", "description": "## Private function with embedded modifier reduces contract size\nConsider having the logic of a modifier embedded through a private function to reduce contract size if need be. A private visibility that saves more gas on function calls than the internal visibility is adopted because the modifier will only be making this call inside the contract.\n\nFor instance, the modifier instance below may be refactored as follows just as it has been implemented in [SelfAuthorized.sol](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/common/SelfAuthorized.sol):\n\n[File: SmartAccount.sol#L82-L85](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L82-L85)\n\n```diff\n+ function _mixedAuth() private view {\n+ require(msg.sender == owner || msg.sender == address(this),\"Only owner or self\");\n+ }\n\n modifier mixedAuth {\n- require(msg.sender == owner || msg.sender == address(this),\"Only owner or self\");\n+ _mixedAuth();\n _;\n }\n```\n## Unneeded `uint256()` cast\nCasting an unsigned integer to `uint256()` is unnecessary. \n\nFor instance, the code line below may be refactored to save gas both on contract deployment and function call as follows:\n\n[File: SmartAccount.sol#L322](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L322)\n\n```diff\n- require(uint256(s) >= uint256(1) * 65, \"BSA021\");\n+ require(uint256(s) >= 65, \"BSA021\");\n```\nNote: Since `1 * 65 == 65`, replacing `uint256(1) * 65` with `65` instead of `1 * 65` saves even more gas.\n\n## Use of named returns for local variables saves gas\nYou can have further advantages in term of gas cost by simply using named return values as temporary local variable.\n\nFor instance, the code block below may be refactored as follows:\n\n[File: SmartAccountNoAuth.sol#L155-L159](https://github.com/code-423n4/2023-01", "vulnerable_code": "## Unneeded `uint256()` cast\nCasting an unsigned integer to `uint256()` is unnecessary. \n\nFor instance, the code line below may be refactored to save gas both on contract deployment and function call as follows:\n\n[File: SmartAccount.sol#L322](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L322)\n", "fixed_code": "Note: Since `1 * 65 == 65`, replacing `uint256(1) * 65` with `65` instead of `1 * 65` saves even more gas.\n\n## Use of named returns for local variables saves gas\nYou can have further advantages in term of gas cost by simply using named return values as temporary local variable.\n\nFor instance, the code block below may be refactored as follows:\n\n[File: SmartAccountNoAuth.sol#L155-L159](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol#L155-L159)\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/RaymondFam-G.md", "collected_at": "2026-01-02T18:13:15.212148+00:00", "source_hash": "6f679dee671320443778d4e33d360486936f14aef339fcef5f97059ea144372a", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 409, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "+ function _mixedAuth() private view {\n+ require(msg.sender == owner || msg.sender == address(this),\"Only owner or self\");\n+ }\n\n modifier mixedAuth {\n- require(msg.sender == owner || msg.sender == address(this),\"Only owner or self\");\n+ _mixedAuth();\n _;\n }", "primary_code_language": "diff", "primary_code_char_count": 293, "all_code_blocks": "// Code block 1 (diff):\n+ function _mixedAuth() private view {\n+ require(msg.sender == owner || msg.sender == address(this),\"Only owner or self\");\n+ }\n\n modifier mixedAuth {\n- require(msg.sender == owner || msg.sender == address(this),\"Only owner or self\");\n+ _mixedAuth();\n _;\n }\n\n// Code block 2 (diff):\n- require(uint256(s) >= uint256(1) * 65, \"BSA021\");\n+ require(uint256(s) >= 65, \"BSA021\");", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "+ function _mixedAuth() private view {\n+ require(msg.sender == owner || msg.sender == address(this),\"Only owner or self\");\n+ }\n\n modifier mixedAuth {\n- require(msg.sender == owner || msg.sender == address(this),\"Only owner or self\");\n+ _mixedAuth();\n _;\n }\n\n- require(uint256(s) >= uint256(1) * 65, \"BSA021\");\n+ require(uint256(s) >= 65, \"BSA021\");", "solidity_code": "", "github_refs_formatted": "SelfAuthorized.sol, SmartAccount.sol#L82-L85, SmartAccount.sol#L322, SmartAccountNoAuth.sol#L155-L159", "github_files_list": "SmartAccount.sol, SelfAuthorized.sol, SmartAccountNoAuth.sol", "github_refs_count": 4, "vulnerable_code_actual": "## Unneeded `uint256()` cast\nCasting an unsigned integer to `uint256()` is unnecessary. \n\nFor instance, the code line below may be refactored to save gas both on contract deployment and function call as follows:\n\n[File: SmartAccount.sol#L322](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L322)\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "Note: Since `1 * 65 == 65`, replacing `uint256(1) * 65` with `65` instead of `1 * 65` saves even more gas.\n\n## Use of named returns for local variables saves gas\nYou can have further advantages in term of gas cost by simply using named return values as temporary local variable.\n\nFor instance, the code block below may be refactored as follows:\n\n[File: SmartAccountNoAuth.sol#L155-L159](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol#L155-L159)\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "02-ai-arena", "title": "0xBinChook Q", "severity_raw": "Critical", "severity": "critical", "description": "# AI Arena - QA Report\n\n\n| Id | Issue |\n|---------------|---------------------------------------------------------------------------------------------------------------|\n| [L-1](#l-1) | Consider two-step confirmation for ownership transfer |\n| [L-2](#l-2) | `Verification::verify()` allows malleable (non-unique) signature |\n| [L-3](#l-3) | `Verification::verify()` can return `true` for invalid signatures |\n| [L-4](#l-4) | `FighterFarm::_delegatedAddress` cannot be updated |\n| [L-5](#l-5) | Neuron allowance spend during burn is inconsistent with OZ ERC20 being extended |\n| [L-6](#l-6) | Incrementing roundId in pickWinner allows ending rounds accidentally |\n| [L-7](#l-7) | Players are not allowed to claim only a portion of their reward |\n| [L-8](#l-8) | Inconsistent array lengths unnecessarily penalize the Player |\n| [L-9](#l-9) | Player can set invalid customAttributes which is undesirable |\n| [L-10](#l-10) | Fighter point retrieval will be unable to access higher order Fighters |\n| [L-11](#l-11) | Iterating through all rounds means Fighter NFTs created after a certain round number can never claim a reward |\n| [L-12](#l-12) | Allowing mid-round NRN Distribution alteration is unfair to Players |\n| [L-13](#l-13) | Allowing mid-round bpsLostPerLoss alteration is unfair to Players |\n| [NC-1](#nc-1) | Players", "vulnerable_code": "### L-4\n#### `FighterFarm::_delegatedAddress` cannot be updated\nUnlike the other members of `FighterFarm`, `_delegatedAddress` lacks any setter or instantiate function to update the address.\n\nThe uses for `_delegatedAddress` are setting the tokenURI and signing the messages players send in `FighterFarm::claimFighters()` to mint Fighter NFTs.\nIf control of the address is compromised, and infinite number of Fighter NFTs could be minted, and despite still controlling the owner address, nothing can be done.\n\nAs `_delegatedAddress` is not `immutable`, there's a fair chance the setter was simply overlooked.\n\n\n##### Recommended Mitigation\nAdd the setter to [FighterFarm](https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L184)", "fixed_code": "### L-5\n#### Neuron allowance spend during burn is inconsistent with OZ ERC20 being extended\nIn `Neuron::burn()` the allowance is always decremented by the amount burnt, while the Open Zeppelin ERC20 [spend allowance](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/96e5c0830a83b61197dd4e29df59cb56499600ef/contracts/token/ERC20/ERC20.sol#L305-L315) treats ` type(uint256).max` as unlimited (does not decrement).\n\nThe transfer functions of `Neuorn` will use the OZ behaviour, which is inconsistent with how the burn function will behave.\n\n##### Recommended Mitigation\nReplicate the OZ allowance behaviour in [Neuron::burn()](https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/Neuron.sol#L201-L203)", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/0xBinChook-Q.md", "collected_at": "2026-01-02T19:02:00.173618+00:00", "source_hash": "6fe3dea8f9f5b1f60001b6e60e8c2d711d6da41829ff3c1278896d95ad41d49a", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "FighterFarm.sol#L184, ERC20.sol#L305-L315, Neuron.sol#L201-L203", "github_files_list": "ERC20.sol, Neuron.sol, FighterFarm.sol", "github_refs_count": 3, "vulnerable_code_actual": "### L-4\n#### `FighterFarm::_delegatedAddress` cannot be updated\nUnlike the other members of `FighterFarm`, `_delegatedAddress` lacks any setter or instantiate function to update the address.\n\nThe uses for `_delegatedAddress` are setting the tokenURI and signing the messages players send in `FighterFarm::claimFighters()` to mint Fighter NFTs.\nIf control of the address is compromised, and infinite number of Fighter NFTs could be minted, and despite still controlling the owner address, nothing can be done.\n\nAs `_delegatedAddress` is not `immutable`, there's a fair chance the setter was simply overlooked.\n\n\n##### Recommended Mitigation\nAdd the setter to [FighterFarm](https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L184)", "has_vulnerable_code_snippet": true, "fixed_code_actual": "### L-5\n#### Neuron allowance spend during burn is inconsistent with OZ ERC20 being extended\nIn `Neuron::burn()` the allowance is always decremented by the amount burnt, while the Open Zeppelin ERC20 [spend allowance](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/96e5c0830a83b61197dd4e29df59cb56499600ef/contracts/token/ERC20/ERC20.sol#L305-L315) treats ` type(uint256).max` as unlimited (does not decrement).\n\nThe transfer functions of `Neuorn` will use the OZ behaviour, which is inconsistent with how the burn function will behave.\n\n##### Recommended Mitigation\nReplicate the OZ allowance behaviour in [Neuron::burn()](https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/Neuron.sol#L201-L203)", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "03-asymmetry", "title": "Brenzee Q", "severity_raw": "High", "severity": "high", "description": "# QA Report\n\n## [L-01] `receive()` function allows anyone to send ETH\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L246\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol#L126\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol#L97\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L244\n\nIntentional use of `receive()` in `SafEth.sol` is to receive ETH when `derivative.withdraw` is called. Since there are no checks on `msg.sender`, anyone can send ETH and it will result in a loss of funds. Suggest checking if the `msg.sender` is one of the derivative contracts.\n\nThe same goes for derivative contracts - ETH is only expected to be received from known protocol contracts. And because all of the derivative contracts transfer ETH via `withdraw` function where the whole ETH balance is sent, these funds can be stolen.\n\n```solidity\n receive() external payable {}\n```\n\n### Example\nAlice accidentally sends ETH straight to `WstEthStaking` contract instead of calling `safEthProxy.stake` .\n\nBob sees that Alice has sent ETH to `WstEthStaking` contract. He stakes and unstakes ETH and receives that 1 ETH that has been sent by Alice.\n\n```typescript \nit(\"Bob should get Alice's sent ETH \", async () => {\n const [_, alice, bob] = await ethers.getSigners();\n\n // derivatives addresses\n const WstEthStakingAddress = await safEthProxy.derivatives(2);\n\n const bobBalanceBefore = await ethers.provider.getBalance(bob.address);\n\n // Transfer ETH to WstEthStakingAddress\n await alice.sendTransaction({\n to: WstEthStakingAddress,\n value: ethers.utils.parseEther(\"1\"),\n });\n\n // Bob stakes and unstakes 1 ETH\n await safEthProxy.connect(bob).stake({\n value: ethers.utils.parseEther(\"1\"),\n });\n await safEthProxy\n .connect(bob)\n .unstake(await", "vulnerable_code": " receive() external payable {}", "fixed_code": "## [L-02] No need to check balance in `deposit()` and `withdraw()` functions in `SfrxEth.sol`\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol#L98-L104\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol#L61-L68\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol#L57-L58\n\n`SfrxEth.sol` - `frxETHMinterContract.submitAndDeposit` and `IsFrxEth(SFRX_ETH_ADDRESS).redeem` returns how many tokens have been received, there is no need to call `balanceOf`. After changing the code to the example below, all tests still succeed.\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Brenzee-Q.md", "collected_at": "2026-01-02T18:17:57.058753+00:00", "source_hash": "6ffb3b55acc03b5bdc4ff41e76f67aa83c44ca18100e310fcf73e73af6204219", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 29, "github_ref_count": 7, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "receive() external payable {}", "primary_code_language": "solidity", "primary_code_char_count": 29, "all_code_blocks": "// Code block 1 (solidity):\nreceive() external payable {}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "receive() external payable {}", "github_refs_formatted": "SafEth.sol#L246, SfrxEth.sol#L126, WstEth.sol#L97, Reth.sol#L244, SfrxEth.sol#L98-L104, SfrxEth.sol#L61-L68, WstEth.sol#L57-L58", "github_files_list": "SfrxEth.sol, Reth.sol, WstEth.sol, SafEth.sol", "github_refs_count": 7, "vulnerable_code_actual": " receive() external payable {}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## [L-02] No need to check balance in `deposit()` and `withdraw()` functions in `SfrxEth.sol`\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol#L98-L104\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol#L61-L68\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol#L57-L58\n\n`SfrxEth.sol` - `frxETHMinterContract.submitAndDeposit` and `IsFrxEth(SFRX_ETH_ADDRESS).redeem` returns how many tokens have been received, there is no need to call `balanceOf`. After changing the code to the example below, all tests still succeed.\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "09-ondo", "title": "pontifex Q", "severity_raw": "Unknown", "severity": "unknown", "description": "### Wrong amounts at the events\nThe events at the `rUSDY.wrap` function emit wrong amounts due to receiving `_USDYAmount` tokens amount instead of `_USDYAmount * BPS_DENOMINATOR`. This would affect applications utilizing event logs like subgraphs.\n```solidity\n438 emit Transfer(address(0), msg.sender, getRUSDYByShares(_USDYAmount));\n439 emit TransferShares(address(0), msg.sender, _USDYAmount);\n```\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L438-L439\n\n", "vulnerable_code": "438 emit Transfer(address(0), msg.sender, getRUSDYByShares(_USDYAmount));\n439 emit TransferShares(address(0), msg.sender, _USDYAmount);", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/pontifex-Q.md", "collected_at": "2026-01-02T18:26:13.557602+00:00", "source_hash": "705529071e1e022c4acaf43220dbf6ac4f0bd070473c23871910604c357b41d9", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 141, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "438 emit Transfer(address(0), msg.sender, getRUSDYByShares(_USDYAmount));\n439 emit TransferShares(address(0), msg.sender, _USDYAmount);", "primary_code_language": "solidity", "primary_code_char_count": 141, "all_code_blocks": "// Code block 1 (solidity):\n438 emit Transfer(address(0), msg.sender, getRUSDYByShares(_USDYAmount));\n439 emit TransferShares(address(0), msg.sender, _USDYAmount);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "438 emit Transfer(address(0), msg.sender, getRUSDYByShares(_USDYAmount));\n439 emit TransferShares(address(0), msg.sender, _USDYAmount);", "github_refs_formatted": "rUSDY.sol#L438-L439", "github_files_list": "rUSDY.sol", "github_refs_count": 1, "vulnerable_code_actual": "438 emit Transfer(address(0), msg.sender, getRUSDYByShares(_USDYAmount));\n439 emit TransferShares(address(0), msg.sender, _USDYAmount);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.06} {"source": "c4", "protocol": "08-dopex", "title": "QiuhaoLi Q", "severity_raw": "Critical", "severity": "critical", "description": "## [low] RdpxV2Core.sol _transfer should update reserveAsset[reservesIndex[\"RDPX\"]] if (rdpxBurnPercentage + rdpxFeePercentage) < 1e10, or add constraints in setRdpxBurnPercentage/setRdpxFeePercentage\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L657\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L662\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L180\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L193\n\nIn the setters of rdpxBurnPercentage and rdpxFeePercentage, we only check if the value is bigger than zero, not check if they sum up to 1e10.And in _transfer(), we didn't check if rdpxBurnPercentage + rdpxFeePercentage) == 1e10 and didn't update reserveAsset[reservesIndex[\"RDPX\"]].tokenBalance relatively. This can lead to two results if the admin changes rdpxBurnPercentage/rdpxFeePercentage wrongly:\n\n1. When (rdpxBurnPercentage + rdpxFeePercentage) < 1e10, reserveAsset[reservesIndex[\"RDPX\"]].tokenBalance will be smaller than the actual value.\n2. When (rdpxBurnPercentage + rdpxFeePercentage) > 1e10, more rdpx is spent than designed. Eventually, the function of the core can be stopped since no more rdpx is usable.\n\nTo solve this, we need to make sure (rdpxBurnPercentage + rdpxFeePercentage) == 1e10 in setters or _transfer, and update the reserveAsset[reservesIndex[\"RDPX\"]].tokenBalance if so.\n\n\n## [low] PerpetualAtlanticVault should round up when calculating requiredCollateral\n\nIn purchase(), we round down the requiredCollateral. This can lead to insufficient collateral, even zero collateral when (amount * strike) < 1e8. Rounding up is safer.\n\n\n## [low] UniV3LiquidityAmo should add setter for univ3_factory, univ3_positions, and univ3_router\n\nIn UniV3LiquidityAmo's constructor, we hardcoded the uniswap contract's address. However, these addresses are different on other blockchains like celo: https://docs.uniswap.org/cont", "vulnerable_code": " ISwapRouter.ExactInputSingleParams memory swap_params = ISwapRouter\n .ExactInputSingleParams(\n _tokenA,\n _tokenB,\n _fee_tier,\n address(this),\n 2105300114, // Expiration: a long time from now @audit-issue deadline vulnerable to MEV\n _amountAtoB,\n _amountOutMinimum,\n _sqrtPriceLimitX96\n );", "fixed_code": " ISwapRouter.ExactInputSingleParams memory swap_params = ISwapRouter\n .ExactInputSingleParams(\n _tokenA,\n _tokenB,\n _fee_tier,\n address(this),\n 2105300114, // Expiration: a long time from now @audit-issue deadline vulnerable to MEV\n _amountAtoB,\n _amountOutMinimum,\n _sqrtPriceLimitX96\n );", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/QiuhaoLi-Q.md", "collected_at": "2026-01-02T18:24:56.900829+00:00", "source_hash": "7082cb05455af2cae879bf1901c970dbcbbbdac30d3a02b6da800dbbe321cced", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "RdpxV2Core.sol#L657, RdpxV2Core.sol#L662, RdpxV2Core.sol#L180, RdpxV2Core.sol#L193", "github_files_list": "RdpxV2Core.sol", "github_refs_count": 4, "vulnerable_code_actual": " ISwapRouter.ExactInputSingleParams memory swap_params = ISwapRouter\n .ExactInputSingleParams(\n _tokenA,\n _tokenB,\n _fee_tier,\n address(this),\n 2105300114, // Expiration: a long time from now @audit-issue deadline vulnerable to MEV\n _amountAtoB,\n _amountOutMinimum,\n _sqrtPriceLimitX96\n );", "has_vulnerable_code_snippet": true, "fixed_code_actual": " ISwapRouter.ExactInputSingleParams memory swap_params = ISwapRouter\n .ExactInputSingleParams(\n _tokenA,\n _tokenB,\n _fee_tier,\n address(this),\n 2105300114, // Expiration: a long time from now @audit-issue deadline vulnerable to MEV\n _amountAtoB,\n _amountOutMinimum,\n _sqrtPriceLimitX96\n );", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "03-asymmetry", "title": "BlueAlder G", "severity_raw": "Low", "severity": "low", "description": "## [G-01] Unnecessary recalculation of total weights in `addDerivative`\n\nIn the `addDerivative` function, the total weight of all the\nderivatives is recalculated by iterating through the `weights` storage variable\nand individually adding these all up in a for loop.\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L191\n\n\nThis is not required since `addDerivative` is only adding 1 weight, and not\nadjusting the existing ones. So you can simply add the new weight to the\nexisting totalWeight with:\n\n```sol\ntotalWeight = totalWeight + _weight;\n```\n\nGas saving is 522 gas and increases with the number of derivatives.\n\n## [G-02] Unnecessary recalculation of total weights in `adjustWeight`\n\nSimilar to above, the `adjustWeight` function is only changing 1 weight and so\nwe can alter the `totalWeight` variable directly before altering the `weights`\nmapping to get the calculation.\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L165\n\n```sol\ntotalWeight = totalWeight - weights[_derivativeIndex] + _weight;\nweights[_derivativeIndex] = _weight;\n```\n\nGas saving is 154 and increases with the number of derivatives.\n\n# [G-03] **Loop variable in for loop can be unchecked**\n\n```markdown\n## [G-03] Loop variable in for loop can be unchecked \n\nOverflowing the loop variable in may for loops is very unlikely when iterating\nderivatives so we can remove the overflow check to save some gas. This is\nbecause most loops start at 0 and increment by 1 and will never reach the max\nuint256 or will run out of gas by then.\n\nThis will save about 50 gas per iteration.\n\nFor example in the `unstake()` function:\n\n```sol\nfor (uint256 i = 0; i < derivativeCount; i++) {\n // withdraw a percentage of each asset based on the amount of safETH\n uint256 derivativeAmount = (derivatives[i].balance() * _safEthAmount) / safEthTotalSupply;\n if (derivativeAmount == 0) con", "vulnerable_code": "totalWeight = totalWeight + _weight;", "fixed_code": "totalWeight = totalWeight - weights[_derivativeIndex] + _weight;\nweights[_derivativeIndex] = _weight;", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/BlueAlder-G.md", "collected_at": "2026-01-02T18:17:55.718439+00:00", "source_hash": "7098ab95cb4d12b52148fc26d6bff517b1856123fd9579c9f63a92375c96f6ff", "code_block_count": 3, "solidity_block_count": 2, "total_code_chars": 548, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "totalWeight = totalWeight + _weight;", "primary_code_language": "sol", "primary_code_char_count": 36, "all_code_blocks": "// Code block 1 (sol):\ntotalWeight = totalWeight + _weight;\n\n// Code block 2 (sol):\ntotalWeight = totalWeight - weights[_derivativeIndex] + _weight;\nweights[_derivativeIndex] = _weight;\n\n// Code block 3 (markdown):\n## [G-03] Loop variable in for loop can be unchecked \n\nOverflowing the loop variable in may for loops is very unlikely when iterating\nderivatives so we can remove the overflow check to save some gas. This is\nbecause most loops start at 0 and increment by 1 and will never reach the max\nuint256 or will run out of gas by then.\n\nThis will save about 50 gas per iteration.\n\nFor example in the `unstake()` function:", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "totalWeight = totalWeight + _weight;\n\ntotalWeight = totalWeight - weights[_derivativeIndex] + _weight;\nweights[_derivativeIndex] = _weight;", "github_refs_formatted": "SafEth.sol#L191, SafEth.sol#L165", "github_files_list": "SafEth.sol", "github_refs_count": 2, "vulnerable_code_actual": "totalWeight = totalWeight + _weight;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "totalWeight = totalWeight - weights[_derivativeIndex] + _weight;\nweights[_derivativeIndex] = _weight;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "01-ondo", "title": "chrisdior4 Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA report\n\n## Low Risk\n| L-N |Issue|Instances|\n|:------:|:----|:-------:|\n| [L‑01] | Functions that send ether with a low level `call` are missing `nonReentrant` modifier | 1 |\n| [L‑02] | Ownable uses single-step ownership transfer | 1 |\n| [L‑03] | Missing zero address check in constructor | 2 |\n| [L‑04] | Consider adding initializer modifier to _initialize** functions | 2 |\n\nTotal: 6 instances over 4 issues\n\n## Non-critical\n\n| N-C |Issue|Instances|\n|:------:|:----|:-------:|\n| [N‑01] | Missing params in NatSpec| 2 |\n| [N‑02] | Use a safe pragma statement | 1 |\n| [N‑03] | Typos in comments | 3 |\n| [N‑04] | Use solidity's native units for dealing with time | 1 |\n| [N‑05] | Constants should be defined rather than using magic numbers | 1 |\n| [N‑06] | Events are missing indexed fields | 3 |\n| [N‑07] | Constants should be capitalized | 4 |\n\nTotal: 15 instances over 7 issues\n\n## Low Risk\n\n### \\[L-01\\] Function that sends ether with a low level `call` is missing `nonReentrant` modifier\n\nFile: `CashFactory.sol`\n\nAdd a nonReentrant modifier to this external function that is making a low level call in order to be sure 100% that reentrancy can not occur:\n\n```solidity\n(bool success, bytes memory ret) = address(exCallData[i].target).call{\n value: exCallData[i].value\n}(exCallData[i].data);\n```\n\nLines of code: \n\n- https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/cash/factory/CashFactory.sol#L128\n\n### \\[L-02\\] Ownable uses single-step ownership transfer\n\nFile: `OndoPriceOracleV2.sol`\n\n```solidity\nimport \"contracts/cash/external/openzeppelin/contracts/access/Ownable.sol\";\n```\n\nThe OndoPriceOracleV2 contract inherits from Ownable and the owner is the one who can set couple of important features such as Oracle, Price of an fToken contract's underlying asset, etc.. The Ownable contract implements single-step ownership transfer, which means that if a ", "vulnerable_code": "(bool success, bytes memory ret) = address(exCallData[i].target).call{\n value: exCallData[i].value\n}(exCallData[i].data);", "fixed_code": "import \"contracts/cash/external/openzeppelin/contracts/access/Ownable.sol\";", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/chrisdior4-Q.md", "collected_at": "2026-01-02T18:15:01.000309+00:00", "source_hash": "70d497ef5166bbc163b6d976cd68267b4543597f271ec961fceae0dfdd84f6bd", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 196, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "(bool success, bytes memory ret) = address(exCallData[i].target).call{\n value: exCallData[i].value\n}(exCallData[i].data);", "primary_code_language": "solidity", "primary_code_char_count": 121, "all_code_blocks": "// Code block 1 (solidity):\n(bool success, bytes memory ret) = address(exCallData[i].target).call{\n value: exCallData[i].value\n}(exCallData[i].data);\n\n// Code block 2 (solidity):\nimport \"contracts/cash/external/openzeppelin/contracts/access/Ownable.sol\";", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "(bool success, bytes memory ret) = address(exCallData[i].target).call{\n value: exCallData[i].value\n}(exCallData[i].data);\n\nimport \"contracts/cash/external/openzeppelin/contracts/access/Ownable.sol\";", "github_refs_formatted": "CashFactory.sol#L128", "github_files_list": "CashFactory.sol", "github_refs_count": 1, "vulnerable_code_actual": "(bool success, bytes memory ret) = address(exCallData[i].target).call{\n value: exCallData[i].value\n}(exCallData[i].data);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "import \"contracts/cash/external/openzeppelin/contracts/access/Ownable.sol\";", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-salty", "title": "fouzantanveer Analysis", "severity_raw": "Critical", "severity": "critical", "description": "## Conceptual Overview\nAs an auditor of the Salty.IO project, I present a conceptual narrative overview, highlighting the user journey, interaction points, and the features of the platform.\n\nAt the heart of the Salty.IO ecosystem are two primary tokens: `Salt` and `USDS`. A user's journey often begins with acquiring these tokens. `Salt` serves as the backbone of the platform, facilitating not only staking and governance participation but also acting as a key to earning rewards. On the other hand, `USDS` offers a stablecoin option, pegging its value to a stable asset like the USD, thus providing a haven from the volatility typically associated with cryptocurrencies.\n\nOnce users have these tokens, they can engage in liquidity provision. By contributing to liquidity pools, they receive liquidity tokens in return. This is not just a passive investment; it's a crucial role in maintaining the ecosystem's health. In return, users are rewarded with a share of transaction fees, fostering a symbiotic relationship between the platform and its participants.\n\nStaking is another pivotal aspect of the user journey on Salty.IO. Users stake their `Salt` tokens to earn rewards and gain governance rights, influencing the platform's direction. The staking mechanism is designed with flexibility in mind, offering options like unstaking with a cooldown period or early unstaking at a reduced reward, accommodating various user strategies and needs.\n\nThe platform's dynamic reward structure, governed by contracts like `RewardsConfig.sol` and `Emissions.sol`, ensures that users are incentivized for their participation. Whether through staking or liquidity provision, the rewards system adapts to market conditions and participation levels, making it a responsive and attractive feature for users.\n\nA notable feature of Salty.IO is its integration of price feeds and oracles, as seen in contracts like `CoreUniswapFeed.sol` and `PriceAggregator.sol`. This integration ensures that the asset valuations", "vulnerable_code": "contract Upkeep {\n // ...\n IPriceAggregator immutable public priceAggregator;\n // ...\n function performUpkeep() public {\n // ...\n uint256 btcPrice = priceAggregator.getPriceBTC();\n uint256 ethPrice = priceAggregator.getPriceETH();\n // ...\n }\n // ...\n}", "fixed_code": "", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/fouzantanveer-Analysis.md", "collected_at": "2026-01-02T19:01:41.256245+00:00", "source_hash": "7127b51aa9e06b834be0d867c9b9c7ce111d2a5f8dfc3fb12e01f65aac12a393", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "contract Upkeep {\n // ...\n IPriceAggregator immutable public priceAggregator;\n // ...\n function performUpkeep() public {\n // ...\n uint256 btcPrice = priceAggregator.getPriceBTC();\n uint256 ethPrice = priceAggregator.getPriceETH();\n // ...\n }\n // ...\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4} {"source": "c4", "protocol": "02-ethos", "title": "0xSmartContract G", "severity_raw": "High", "severity": "high", "description": "### Gas Optimizations List\n| Number | Optimization Details | Context |\n|:--:|:-------| :-----:|\n| [G-01] | Remove the `initializer` modifier | 2 |\n| [G-02] |Use hardcode address instead ``address(this)``| 36 |\n| [G-03] |Structs can be packed into fewer storage slots |2 |\n| [G-04] |Pack state variables | 4 |\n| [G-05] | Remove or replace unused state variables |1|\n| [G-06] | ``Deposit`` struct can be removed | 1 |\n| [G-07] |Using ``delete`` instead of setting mapping/state variable ``0`` saves gas | 9 |\n| [G-08] | Using ``delete`` instead of setting ``address(0)`` saves gas | 1 |\n| [G-09] | Using ``delete`` to set ``bool`` values to their default values saves gas | 3 |\n| [G-10] |Using `storage` instead of `memory` for `structs/arrays` saves gas | 7 |\n| [G-11] | Multiple ``address``/ID mappings can be combined into a single ``mapping`` of an ``address``/ID to a ``struct``, where appropriate |7 |\n| [G-12] |Multiple accesses of a mapping/array should use a local variable cache | 30 |\n| [G-13] |The result of function calls should be cached rather than re-calling the function | 4 |\n| [G-14] |Avoid using ``state variable`` in emit |1 |\n| [G-15] |Superfluous event fields | 1 |\n| [G-16] |Avoid contract existence checks by using low level calls |97 |\n| [G-17] |``bytes`` constants are more eficient than ``string`` constans | 8 |\n| [G-18] |Change ``public`` function visibility to ``external`` |3 |\n| [G-19] |Usage of uints/ints smaller than 32 bytes (256 bits) incurs overhead |6|\n| [G-20] |``internal`` functions only called once can be inlined to save gas | 45 |\n| [G-21] |Do not calculate constants variables | 11 |\n| [G-22] |Use ``assembly`` to write _address storage values_ | 18 |\n| [G-23] |Setting the _constructor_ to `payable` | 6 |\n| [G-24] |Add ``unchecked {}`` for subtractions where the operands cannot underflow because of a previous ``require`` or ``if`` statement | 10 |\n| [G-25] |++i/i++ should be unchecked{++i}/unchecked{i++} when it is not possible for them to overf", "vulnerable_code": "Ethos-Vault\\contracts\\ReaperStrategyGranarySupplyOnly.sol:\n\n 67: ) public initializer {\n", "fixed_code": "Ethos-Vault\\contracts\\abstract\\ReaperBaseStrategyv4.sol:\n\n 61: constructor() initializer {}\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/0xSmartContract-G.md", "collected_at": "2026-01-02T18:15:46.450258+00:00", "source_hash": "717a8e1adf4cbc8b3b264a6479cda58273c391116f955bf44d7baeb3c1f66c9a", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "Ethos-Vault\\contracts\\ReaperStrategyGranarySupplyOnly.sol:\n\n 67: ) public initializer {\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "Ethos-Vault\\contracts\\abstract\\ReaperBaseStrategyv4.sol:\n\n 61: constructor() initializer {}\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-revert-lend", "title": "SY_S G", "severity_raw": "High", "severity": "high", "description": "## Summary\n\n### Gas Optimization\n\nno |Issue |Instances||\n|-|:-|:-:|:-:|\n| [G-01] | Pre-increments and pre-decrements are cheaper than post-increments and post-decrements | |3|--| \n| [G-02] | Can make the variable outside the loop to save gas | |2|--| \n| [G-03] |Before transfer of some functions, we should check some variables for possible gas save | |13|--| \n| [G-04] |Do not calculate constants | |17|--| \n| [G-05] |TERNARY UNNECESSARY | |7|--| \n| [G-06] |Empty blocks should be removed or emit something | |3|--| \n| [G-07] | Using storage instead of memory for structs/arrays saves gas | |14|--| \n| [G-08] |ith assembly,\u00a0.call (bool success) \u00a0transfer can be done gas-optimized | |2|--| \n| [G-09] |Use constants instead of type(uintx).max | |7|--| \n| [G-10] |Use hardcode address instead address(this) | |9|--| \n\n\n\n\n## Gas Optimizations \n\n## [G-1] Pre-increments and pre-decrements are cheaper than post-increments and post-decrements\n \n```solidity\nfile:/src/transformers/V3Utils.sol\n 619 transferDetails[state.i++] = ISignatureTransfer.SignatureTransferDetails(address(this), state.needed0);\n 623 transferDetails[state.i++] = ISignatureTransfer.SignatureTransferDetails(address(this), state.needed1);\n 627 transferDetails[state.i++] = ISignatureTransfer.SignatureTransferDetails(address(this), state.neededOther);\n\n```\nhttps://github.com/code-423n4/2024-03-revert-lend/blob/435b054f9ad2404173f36f0f74a5096c894b12b7/src/transformers/V3Utils.sol#L619\n\n\n\n\n## [G-2] Can make the variable outside the loop to save gas\n\nConsider making the stack variables before the loop which gonna save gas\n\n2 instances here\u00a0collection\u00a0and\u00a0collectionScore\n\n```solidity\nFile:/src/automators/Automator.sol\n112 uint256 balance = IERC20(tokens[i]).balanceOf(address(this));\n\n```\nhttps://github.com/code-423n4/2024-03-revert-lend/blob/435b054f9ad2404173f36f0f74a5096c894b12b7/src/automators/Automator.sol#L112\n\n```solidity\nfile:/src/transformers/AutoCompound.", "vulnerable_code": "file:/src/transformers/V3Utils.sol\n 619 transferDetails[state.i++] = ISignatureTransfer.SignatureTransferDetails(address(this), state.needed0);\n 623 transferDetails[state.i++] = ISignatureTransfer.SignatureTransferDetails(address(this), state.needed1);\n 627 transferDetails[state.i++] = ISignatureTransfer.SignatureTransferDetails(address(this), state.neededOther);\n", "fixed_code": "File:/src/automators/Automator.sol\n112 uint256 balance = IERC20(tokens[i]).balanceOf(address(this));\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/SY_S-G.md", "collected_at": "2026-01-02T19:03:04.620379+00:00", "source_hash": "717cdc0e8524e96cf7e01e3d77933155a5e615eb8a1e5163d8b8e55ebda43612", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 508, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "file:/src/transformers/V3Utils.sol\n 619 transferDetails[state.i++] = ISignatureTransfer.SignatureTransferDetails(address(this), state.needed0);\n 623 transferDetails[state.i++] = ISignatureTransfer.SignatureTransferDetails(address(this), state.needed1);\n 627 transferDetails[state.i++] = ISignatureTransfer.SignatureTransferDetails(address(this), state.neededOther);", "primary_code_language": "solidity", "primary_code_char_count": 397, "all_code_blocks": "// Code block 1 (solidity):\nfile:/src/transformers/V3Utils.sol\n 619 transferDetails[state.i++] = ISignatureTransfer.SignatureTransferDetails(address(this), state.needed0);\n 623 transferDetails[state.i++] = ISignatureTransfer.SignatureTransferDetails(address(this), state.needed1);\n 627 transferDetails[state.i++] = ISignatureTransfer.SignatureTransferDetails(address(this), state.neededOther);\n\n// Code block 2 (solidity):\nFile:/src/automators/Automator.sol\n112 uint256 balance = IERC20(tokens[i]).balanceOf(address(this));", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "file:/src/transformers/V3Utils.sol\n 619 transferDetails[state.i++] = ISignatureTransfer.SignatureTransferDetails(address(this), state.needed0);\n 623 transferDetails[state.i++] = ISignatureTransfer.SignatureTransferDetails(address(this), state.needed1);\n 627 transferDetails[state.i++] = ISignatureTransfer.SignatureTransferDetails(address(this), state.neededOther);\n\nFile:/src/automators/Automator.sol\n112 uint256 balance = IERC20(tokens[i]).balanceOf(address(this));", "github_refs_formatted": "V3Utils.sol#L619, Automator.sol#L112", "github_files_list": "Automator.sol, V3Utils.sol", "github_refs_count": 2, "vulnerable_code_actual": "file:/src/transformers/V3Utils.sol\n 619 transferDetails[state.i++] = ISignatureTransfer.SignatureTransferDetails(address(this), state.needed0);\n 623 transferDetails[state.i++] = ISignatureTransfer.SignatureTransferDetails(address(this), state.needed1);\n 627 transferDetails[state.i++] = ISignatureTransfer.SignatureTransferDetails(address(this), state.neededOther);\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File:/src/automators/Automator.sol\n112 uint256 balance = IERC20(tokens[i]).balanceOf(address(this));\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "07-amphora", "title": "hunter_w3b Q", "severity_raw": "Medium", "severity": "medium", "description": "## [L-01] Calls to `VaultController::updateRegisteredErc20()` could render vaults instantly insolvent\n\nupdateRegisteredErc20() has the ability to modify the LTV ratio of a token across the protocol to any arbitrary, potentially dangerously low value.\nIf this value is lowered so that the allowed loan amount for a given deposit value drops, then, in a single transaction, any vault that has borrowed an amount that is within the old LTV but above the new LTV would become instantly insolvent.\nThis would then cause them to be liquidated, damaging the protocol.\nThis is mitigated by the presumed procedure of such a change, which would work through governance and so there would be time for vault owners to react during the proposal and the timelock implementation period.\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/VaultController.sol#L383-L412\n\n```solidity\nFile: contracts/core/VaultController.sol\n\n394 if (_ltv >= (EXP_SCALE - _liquidationIncentive)) revert VaultController_LTVIncompatible();\n395 if (_poolId != 0) {\n396 (address _lpToken,,, address _crvRewards,,) = BOOSTER.poolInfo(_poolId);\n397 if (_lpToken != _tokenAddress) revert VaultController_TokenAddressDoesNotMatchLpAddress();\n398 _collateral.collateralType = CollateralType.CurveLPStakedOnConvex;\n399 _collateral.crvRewardsContract = IBaseRewardPool(_crvRewards);\n400 _collateral.poolId = _poolId;\n401 }\n402 // set the oracle of the token\n403 _collateral.oracle = IOracleRelay(_oracleAddress);\n404 // set the ltv of the token\n405 _collateral.ltv = _ltv;\n```\n\n## [L-02] Whitelisting can expire mid way through a proposal\n\nWhitelisted proposals can expire during the assessment period, making a user, and a proposal, lose its status and bene\ufb01ts.\n\nDi\ufb00erent procedures and privileges are enacted for proposers based on whether they are whitelisted or not.\n\nThe assessment of whether an account is whitelisted is based on the test performed in `isWhite", "vulnerable_code": "File: contracts/core/VaultController.sol\n\n394 if (_ltv >= (EXP_SCALE - _liquidationIncentive)) revert VaultController_LTVIncompatible();\n395 if (_poolId != 0) {\n396 (address _lpToken,,, address _crvRewards,,) = BOOSTER.poolInfo(_poolId);\n397 if (_lpToken != _tokenAddress) revert VaultController_TokenAddressDoesNotMatchLpAddress();\n398 _collateral.collateralType = CollateralType.CurveLPStakedOnConvex;\n399 _collateral.crvRewardsContract = IBaseRewardPool(_crvRewards);\n400 _collateral.poolId = _poolId;\n401 }\n402 // set the oracle of the token\n403 _collateral.oracle = IOracleRelay(_oracleAddress);\n404 // set the ltv of the token\n405 _collateral.ltv = _ltv;", "fixed_code": "File: contracts/governance/GovernorCharlie.sol\n\n559 function isWhitelisted(address _account) public view override returns (bool _isWhitelisted) {\n560 return (whitelistAccountExpirations[_account] > block.timestamp);\n561 }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/hunter_w3b-Q.md", "collected_at": "2026-01-02T18:23:50.155505+00:00", "source_hash": "71cdd82c2bac92864947919341fa718af1ade81212242e58ff9957bc77b7405e", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 705, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/core/VaultController.sol\n\n394 if (_ltv >= (EXP_SCALE - _liquidationIncentive)) revert VaultController_LTVIncompatible();\n395 if (_poolId != 0) {\n396 (address _lpToken,,, address _crvRewards,,) = BOOSTER.poolInfo(_poolId);\n397 if (_lpToken != _tokenAddress) revert VaultController_TokenAddressDoesNotMatchLpAddress();\n398 _collateral.collateralType = CollateralType.CurveLPStakedOnConvex;\n399 _collateral.crvRewardsContract = IBaseRewardPool(_crvRewards);\n400 _collateral.poolId = _poolId;\n401 }\n402 // set the oracle of the token\n403 _collateral.oracle = IOracleRelay(_oracleAddress);\n404 // set the ltv of the token\n405 _collateral.ltv = _ltv;", "primary_code_language": "solidity", "primary_code_char_count": 705, "all_code_blocks": "// Code block 1 (solidity):\nFile: contracts/core/VaultController.sol\n\n394 if (_ltv >= (EXP_SCALE - _liquidationIncentive)) revert VaultController_LTVIncompatible();\n395 if (_poolId != 0) {\n396 (address _lpToken,,, address _crvRewards,,) = BOOSTER.poolInfo(_poolId);\n397 if (_lpToken != _tokenAddress) revert VaultController_TokenAddressDoesNotMatchLpAddress();\n398 _collateral.collateralType = CollateralType.CurveLPStakedOnConvex;\n399 _collateral.crvRewardsContract = IBaseRewardPool(_crvRewards);\n400 _collateral.poolId = _poolId;\n401 }\n402 // set the oracle of the token\n403 _collateral.oracle = IOracleRelay(_oracleAddress);\n404 // set the ltv of the token\n405 _collateral.ltv = _ltv;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: contracts/core/VaultController.sol\n\n394 if (_ltv >= (EXP_SCALE - _liquidationIncentive)) revert VaultController_LTVIncompatible();\n395 if (_poolId != 0) {\n396 (address _lpToken,,, address _crvRewards,,) = BOOSTER.poolInfo(_poolId);\n397 if (_lpToken != _tokenAddress) revert VaultController_TokenAddressDoesNotMatchLpAddress();\n398 _collateral.collateralType = CollateralType.CurveLPStakedOnConvex;\n399 _collateral.crvRewardsContract = IBaseRewardPool(_crvRewards);\n400 _collateral.poolId = _poolId;\n401 }\n402 // set the oracle of the token\n403 _collateral.oracle = IOracleRelay(_oracleAddress);\n404 // set the ltv of the token\n405 _collateral.ltv = _ltv;", "github_refs_formatted": "VaultController.sol#L383-L412", "github_files_list": "VaultController.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: contracts/core/VaultController.sol\n\n394 if (_ltv >= (EXP_SCALE - _liquidationIncentive)) revert VaultController_LTVIncompatible();\n395 if (_poolId != 0) {\n396 (address _lpToken,,, address _crvRewards,,) = BOOSTER.poolInfo(_poolId);\n397 if (_lpToken != _tokenAddress) revert VaultController_TokenAddressDoesNotMatchLpAddress();\n398 _collateral.collateralType = CollateralType.CurveLPStakedOnConvex;\n399 _collateral.crvRewardsContract = IBaseRewardPool(_crvRewards);\n400 _collateral.poolId = _poolId;\n401 }\n402 // set the oracle of the token\n403 _collateral.oracle = IOracleRelay(_oracleAddress);\n404 // set the ltv of the token\n405 _collateral.ltv = _ltv;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/governance/GovernorCharlie.sol\n\n559 function isWhitelisted(address _account) public view override returns (bool _isWhitelisted) {\n560 return (whitelistAccountExpirations[_account] > block.timestamp);\n561 }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ethos", "title": "Bnke0x0 Q", "severity_raw": "Critical", "severity": "critical", "description": "\n### [L01] require() should be used instead of assert()\n\n\n#### Findings:\n```\n2023-02-ethos-main/Ethos-Core/contracts/BorrowerOperations.sol::128 => assert(MIN_NET_DEBT > 0);\n2023-02-ethos-main/Ethos-Core/contracts/BorrowerOperations.sol::197 => assert(vars.compositeDebt > 0);\n2023-02-ethos-main/Ethos-Core/contracts/BorrowerOperations.sol::301 => assert(msg.sender == _borrower || (msg.sender == stabilityPoolAddress && _collTopUp > 0 && _LUSDChange == 0));\n2023-02-ethos-main/Ethos-Core/contracts/BorrowerOperations.sol::331 => assert(_collWithdrawal <= vars.coll);\n2023-02-ethos-main/Ethos-Core/contracts/LUSDToken.sol::312 => assert(sender != address(0));\n2023-02-ethos-main/Ethos-Core/contracts/LUSDToken.sol::313 => assert(recipient != address(0));\n2023-02-ethos-main/Ethos-Core/contracts/LUSDToken.sol::321 => assert(account != address(0));\n2023-02-ethos-main/Ethos-Core/contracts/LUSDToken.sol::329 => assert(account != address(0));\n2023-02-ethos-main/Ethos-Core/contracts/LUSDToken.sol::337 => assert(owner != address(0));\n2023-02-ethos-main/Ethos-Core/contracts/LUSDToken.sol::338 => assert(spender != address(0));\n2023-02-ethos-main/Ethos-Core/contracts/StabilityPool.sol::526 => assert(_debtToOffset <= _totalLUSDDeposits);\n2023-02-ethos-main/Ethos-Core/contracts/StabilityPool.sol::551 => assert(_LUSDLossPerUnitStaked <= DECIMAL_PRECISION);\n2023-02-ethos-main/Ethos-Core/contracts/StabilityPool.sol::591 => assert(newP > 0);\n2023-02-ethos-main/Ethos-Core/contracts/TroveManager.sol::417 => assert(_LUSDInStabPool != 0);\n2023-02-ethos-main/Ethos-Core/contracts/TroveManager.sol::1224 => assert(totalStakesSnapshot[_collateral] > 0);\n2023-02-ethos-main/Ethos-Core/contracts/TroveManager.sol::1279 => assert(closedStatus != Status.nonExistent && closedStatus != Status.active);\n2023-02-ethos-main/Ethos-Core/contracts/TroveManager.sol::1342 => assert(troveStatus != Status.nonExistent && troveStatus != Status.active);\n2023-02-ethos-main/Ethos-Core/contracts/TroveManager.sol::1348 => asse", "vulnerable_code": "2023-02-ethos-main/Ethos-Core/contracts/BorrowerOperations.sol::128 => assert(MIN_NET_DEBT > 0);\n2023-02-ethos-main/Ethos-Core/contracts/BorrowerOperations.sol::197 => assert(vars.compositeDebt > 0);\n2023-02-ethos-main/Ethos-Core/contracts/BorrowerOperations.sol::301 => assert(msg.sender == _borrower || (msg.sender == stabilityPoolAddress && _collTopUp > 0 && _LUSDChange == 0));\n2023-02-ethos-main/Ethos-Core/contracts/BorrowerOperations.sol::331 => assert(_collWithdrawal <= vars.coll);\n2023-02-ethos-main/Ethos-Core/contracts/LUSDToken.sol::312 => assert(sender != address(0));\n2023-02-ethos-main/Ethos-Core/contracts/LUSDToken.sol::313 => assert(recipient != address(0));\n2023-02-ethos-main/Ethos-Core/contracts/LUSDToken.sol::321 => assert(account != address(0));\n2023-02-ethos-main/Ethos-Core/contracts/LUSDToken.sol::329 => assert(account != address(0));\n2023-02-ethos-main/Ethos-Core/contracts/LUSDToken.sol::337 => assert(owner != address(0));\n2023-02-ethos-main/Ethos-Core/contracts/LUSDToken.sol::338 => assert(spender != address(0));\n2023-02-ethos-main/Ethos-Core/contracts/StabilityPool.sol::526 => assert(_debtToOffset <= _totalLUSDDeposits);\n2023-02-ethos-main/Ethos-Core/contracts/StabilityPool.sol::551 => assert(_LUSDLossPerUnitStaked <= DECIMAL_PRECISION);\n2023-02-ethos-main/Ethos-Core/contracts/StabilityPool.sol::591 => assert(newP > 0);\n2023-02-ethos-main/Ethos-Core/contracts/TroveManager.sol::417 => assert(_LUSDInStabPool != 0);\n2023-02-ethos-main/Ethos-Core/contracts/TroveManager.sol::1224 => assert(totalStakesSnapshot[_collateral] > 0);\n2023-02-ethos-main/Ethos-Core/contracts/TroveManager.sol::1279 => assert(closedStatus != Status.nonExistent && closedStatus != Status.active);\n2023-02-ethos-main/Ethos-Core/contracts/TroveManager.sol::1342 => assert(troveStatus != Status.nonExistent && troveStatus != Status.active);\n2023-02-ethos-main/Ethos-Core/contracts/TroveManager.sol::1348 => assert(index <= idxLast);\n2023-02-ethos-main/Ethos-Core/contracts/TroveManager.so", "fixed_code": "2023-02-ethos-main/Ethos-Core/contracts/CollateralConfig.sol::46 => function initialize(\n2023-02-ethos-main/Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol::62 => function initialize(\n2023-02-ethos-main/Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol::67 => ) public initializer {", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/Bnke0x0-Q.md", "collected_at": "2026-01-02T18:15:59.925969+00:00", "source_hash": "7217c016cb1d7a36a98fd85ae810dfc21930345d24b756cd704138a5baa6a2c3", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "2023-02-ethos-main/Ethos-Core/contracts/BorrowerOperations.sol::128 => assert(MIN_NET_DEBT > 0);\n2023-02-ethos-main/Ethos-Core/contracts/BorrowerOperations.sol::197 => assert(vars.compositeDebt > 0);\n2023-02-ethos-main/Ethos-Core/contracts/BorrowerOperations.sol::301 => assert(msg.sender == _borrower || (msg.sender == stabilityPoolAddress && _collTopUp > 0 && _LUSDChange == 0));\n2023-02-ethos-main/Ethos-Core/contracts/BorrowerOperations.sol::331 => assert(_collWithdrawal <= vars.coll);\n2023-02-ethos-main/Ethos-Core/contracts/LUSDToken.sol::312 => assert(sender != address(0));\n2023-02-ethos-main/Ethos-Core/contracts/LUSDToken.sol::313 => assert(recipient != address(0));\n2023-02-ethos-main/Ethos-Core/contracts/LUSDToken.sol::321 => assert(account != address(0));\n2023-02-ethos-main/Ethos-Core/contracts/LUSDToken.sol::329 => assert(account != address(0));\n2023-02-ethos-main/Ethos-Core/contracts/LUSDToken.sol::337 => assert(owner != address(0));\n2023-02-ethos-main/Ethos-Core/contracts/LUSDToken.sol::338 => assert(spender != address(0));\n2023-02-ethos-main/Ethos-Core/contracts/StabilityPool.sol::526 => assert(_debtToOffset <= _totalLUSDDeposits);\n2023-02-ethos-main/Ethos-Core/contracts/StabilityPool.sol::551 => assert(_LUSDLossPerUnitStaked <= DECIMAL_PRECISION);\n2023-02-ethos-main/Ethos-Core/contracts/StabilityPool.sol::591 => assert(newP > 0);\n2023-02-ethos-main/Ethos-Core/contracts/TroveManager.sol::417 => assert(_LUSDInStabPool != 0);\n2023-02-ethos-main/Ethos-Core/contracts/TroveManager.sol::1224 => assert(totalStakesSnapshot[_collateral] > 0);\n2023-02-ethos-main/Ethos-Core/contracts/TroveManager.sol::1279 => assert(closedStatus != Status.nonExistent && closedStatus != Status.active);\n2023-02-ethos-main/Ethos-Core/contracts/TroveManager.sol::1342 => assert(troveStatus != Status.nonExistent && troveStatus != Status.active);\n2023-02-ethos-main/Ethos-Core/contracts/TroveManager.sol::1348 => assert(index <= idxLast);\n2023-02-ethos-main/Ethos-Core/contracts/TroveManager.so", "has_vulnerable_code_snippet": true, "fixed_code_actual": "2023-02-ethos-main/Ethos-Core/contracts/CollateralConfig.sol::46 => function initialize(\n2023-02-ethos-main/Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol::62 => function initialize(\n2023-02-ethos-main/Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol::67 => ) public initializer {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "06-lybra", "title": "MrPotatoMagic G", "severity_raw": "Gas", "severity": "gas", "description": "## [G-01] Function can be made external instead of public\nThere are 2 instances of this:\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/governance/GovernanceTimelock.sol#L25\n\n```solidity\nFile: contracts/lybra/governance/GovernanceTimelock.sol\n25: function checkRole(bytes32 role, address _sender) public view returns(bool){\n26: return hasRole(role, _sender) || hasRole(DAO, _sender);\n27: }\n```\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L257\n\n```solidity\nFile: contracts/lybra/pools/base/LybraPeUSDVaultBase.sol\n257: function getPoolTotalPeUSDCirculation() public view returns (uint256) {\n```\n\n## [G-02] Struct member can be modified to save slot\nThere are 3 instances of this:\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/governance/LybraGovernance.sol#L23\n\nuint256 votes can be made uint128 votes. This is significantly larger than the proposal threshold (1e23) as well.\n```solidity\nFile: contracts/lybra/governance/LybraGovernance.sol\n15: struct Receipt {\n16: /// @notice Whether or not a vote has been cast\n17: bool hasVoted;\n18:\n19: /// @notice Whether or not the voter supports the proposal or abstains\n20: uint8 support;\n21:\n22: /// @notice The number of votes the voter had, which were cast\n23: uint256 votes; //@audit can be made uint128 to fit in one slot instead of two\n24: }\n```\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/esLBRBoost.sol#L12\n\nuint256 duration can be made uint16, which can be good enough for 180 years and miningBoost could be made uint128. This could fit in one slot instead of two.\n```solidity\nFile: contracts/lybra/miner/esLBRBoost.sol\n12: struct esLBRLockSetting {\n13: uint256 duration; //@audit use uint16\n14: ", "vulnerable_code": "File: contracts/lybra/governance/GovernanceTimelock.sol\n25: function checkRole(bytes32 role, address _sender) public view returns(bool){\n26: return hasRole(role, _sender) || hasRole(DAO, _sender);\n27: }", "fixed_code": "File: contracts/lybra/pools/base/LybraPeUSDVaultBase.sol\n257: function getPoolTotalPeUSDCirculation() public view returns (uint256) {", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/MrPotatoMagic-G.md", "collected_at": "2026-01-02T18:22:29.575453+00:00", "source_hash": "7237df30236d824338fdf34f4a575f7ecad17223c0c2865c86cdf5f36ebc70c6", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 794, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/lybra/governance/GovernanceTimelock.sol\n25: function checkRole(bytes32 role, address _sender) public view returns(bool){\n26: return hasRole(role, _sender) || hasRole(DAO, _sender);\n27: }", "primary_code_language": "solidity", "primary_code_char_count": 215, "all_code_blocks": "// Code block 1 (solidity):\nFile: contracts/lybra/governance/GovernanceTimelock.sol\n25: function checkRole(bytes32 role, address _sender) public view returns(bool){\n26: return hasRole(role, _sender) || hasRole(DAO, _sender);\n27: }\n\n// Code block 2 (solidity):\nFile: contracts/lybra/pools/base/LybraPeUSDVaultBase.sol\n257: function getPoolTotalPeUSDCirculation() public view returns (uint256) {\n\n// Code block 3 (solidity):\nFile: contracts/lybra/governance/LybraGovernance.sol\n15: struct Receipt {\n16: /// @notice Whether or not a vote has been cast\n17: bool hasVoted;\n18:\n19: /// @notice Whether or not the voter supports the proposal or abstains\n20: uint8 support;\n21:\n22: /// @notice The number of votes the voter had, which were cast\n23: uint256 votes; //@audit can be made uint128 to fit in one slot instead of two\n24: }", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: contracts/lybra/governance/GovernanceTimelock.sol\n25: function checkRole(bytes32 role, address _sender) public view returns(bool){\n26: return hasRole(role, _sender) || hasRole(DAO, _sender);\n27: }\n\nFile: contracts/lybra/pools/base/LybraPeUSDVaultBase.sol\n257: function getPoolTotalPeUSDCirculation() public view returns (uint256) {\n\nFile: contracts/lybra/governance/LybraGovernance.sol\n15: struct Receipt {\n16: /// @notice Whether or not a vote has been cast\n17: bool hasVoted;\n18:\n19: /// @notice Whether or not the voter supports the proposal or abstains\n20: uint8 support;\n21:\n22: /// @notice The number of votes the voter had, which were cast\n23: uint256 votes; //@audit can be made uint128 to fit in one slot instead of two\n24: }", "github_refs_formatted": "GovernanceTimelock.sol#L25, LybraPeUSDVaultBase.sol#L257, LybraGovernance.sol#L23, esLBRBoost.sol#L12", "github_files_list": "GovernanceTimelock.sol, esLBRBoost.sol, LybraPeUSDVaultBase.sol, LybraGovernance.sol", "github_refs_count": 4, "vulnerable_code_actual": "File: contracts/lybra/governance/GovernanceTimelock.sol\n25: function checkRole(bytes32 role, address _sender) public view returns(bool){\n26: return hasRole(role, _sender) || hasRole(DAO, _sender);\n27: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/lybra/pools/base/LybraPeUSDVaultBase.sol\n257: function getPoolTotalPeUSDCirculation() public view returns (uint256) {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "01-ondo", "title": "IllIllI G", "severity_raw": "High", "severity": "high", "description": "\n## Summary\n\n### Gas Optimizations\n| |Issue|Instances|Total Gas Saved|\n|-|:-|:-:|:-:|\n| [G‑01] | Multiple `address`/ID mappings can be combined into a single `mapping` of an `address`/ID to a `struct`, where appropriate | 4 | - |\n| [G‑02] | Avoid contract existence checks by using low level calls | 2 | 200 |\n| [G‑03] | State variables should be cached in stack variables rather than re-reading them from storage | 15 | 1455 |\n| [G‑04] | Multiple accesses of a mapping/array should use a local variable cache | 8 | 336 |\n| [G‑05] | ` += ` costs more gas than ` = + ` for state variables | 3 | 339 |\n| [G‑06] | `internal` functions only called once can be inlined to save gas | 4 | 80 |\n| [G‑07] | Add `unchecked {}` for subtractions where the operands cannot underflow because of a previous `require()` or `if`-statement | 4 | 340 |\n| [G‑08] | `++i`/`i++` should be `unchecked{++i}`/`unchecked{i++}` when it is not possible for them to overflow, as is the case when used in `for`- and `while`-loops | 9 | 540 |\n| [G‑09] | `require()`/`revert()` strings longer than 32 bytes cost extra gas | 12 | - |\n| [G‑10] | Optimize names to save gas | 8 | 176 |\n| [G‑11] | Use a more recent version of solidity | 2 | - |\n| [G‑12] | Splitting `require()` statements that use `&&` saves gas | 1 | 3 |\n| [G‑13] | Using `private` rather than `public` for constants, saves gas | 1 | - |\n| [G‑14] | Use custom errors rather than `revert()`/`require()` strings to save gas | 16 | - |\n| [G‑15] | Functions guaranteed to revert when called by normal users can be marked `payable` | 34 | 714 |\n| [G‑16] | Don't use `_msgSender()` if not supporting EIP-2771 | 3 | 48 |\n\nTotal: 126 instances over 16 issues with **4231 gas** saved\n\nGas totals use lower bounds of ranges and count two iterations of each `for`-loop. All values above are runtime, not deployment, values; deployment", "vulnerable_code": "File: contracts/cash/CashManager.sol\n\n79 mapping(uint256 => RedemptionRequests) public redemptionInfoPerEpoch;\n80 \n81 // Mapping used for getting the exchange rate during a given epoch\n82 mapping(uint256 => uint256) public epochToExchangeRate;\n83 \n84 // Nested mapping containing mint requests for an epoch\n85 // { : { : }\n86: mapping(uint256 => mapping(address => uint256)) public mintRequestsPerEpoch;\n", "fixed_code": "File: contracts/lending/OndoPriceOracle.sol\n\n45 mapping(address => uint256) public fTokenToUnderlyingPrice;\n46 \n47 /// @notice fToken to cToken associations for piggy backing off\n48 /// of cToken oracles\n49: mapping(address => address) public fTokenToCToken;\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/IllIllI-G.md", "collected_at": "2026-01-02T18:14:38.231369+00:00", "source_hash": "726c6a515798137b005521382d2f48de03d18339cd945c4225010c8f9de8b352", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: contracts/cash/CashManager.sol\n\n79 mapping(uint256 => RedemptionRequests) public redemptionInfoPerEpoch;\n80 \n81 // Mapping used for getting the exchange rate during a given epoch\n82 mapping(uint256 => uint256) public epochToExchangeRate;\n83 \n84 // Nested mapping containing mint requests for an epoch\n85 // { : { : }\n86: mapping(uint256 => mapping(address => uint256)) public mintRequestsPerEpoch;\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/lending/OndoPriceOracle.sol\n\n45 mapping(address => uint256) public fTokenToUnderlyingPrice;\n46 \n47 /// @notice fToken to cToken associations for piggy backing off\n48 /// of cToken oracles\n49: mapping(address => address) public fTokenToCToken;\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "05-ajna", "title": "dicethedev G", "severity_raw": "Low", "severity": "low", "description": "a. Use the `abi.encodeWithSelector` function instead of `abi.encode` to encode the function selector and arguments. This can reduce the gas cost of encoding the call data by up to 10%. For example, you can replace `_hashProposal(targets_, values_, calldatas_, keccak256(abi.encode(DESCRIPTION_PREFIX_HASH_EXTRAORDINARY, keccak256(bytes(description_)))))` with `abi.encodeWithSelector(this._hashProposal.selector, targets_, values_, calldatas_, keccak256(abi.encode(DESCRIPTION_PREFIX_HASH_EXTRAORDINARY, keccak256(bytes(description_)))))`.\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/a51de1f0119a8175a5656a2ff9d48bbbcb4436e7/ajna-grants/src/grants/base/ExtraordinaryFunding.sol#L92\n\nb. Instead of using `if (address(wrappedToken) != AJNA_TOKEN_ADDRESS)`, you can use `require(wrappedToken == IERC20(AJNA_TOKEN_ADDRESS), \"InvalidWrappedToken\")`. This will result in less bytecode and lower gas costs.\n\nyou can modify the code with this example - \n\n```\nconstructor(IERC20 wrappedToken)\n ERC20(\"Burn Wrapped AJNA\", \"bwAJNA\")\n ERC20Permit(\"Burn Wrapped AJNA\") // enables wrapped token to also use permit functionality\n ERC20Wrapper(wrappedToken)\n {\n require(wrappedToken == IERC20(AJNA_TOKEN_ADDRESS), \"InvalidWrappedToken\");\n }\n```\nThis way, the contract will revert with an error message if the wrappedToken address is not equal to the `AJNA_TOKEN_ADDRESS`, rather than using an if statement that checks the condition and then reverts with an error message. This results in less bytecode and lower gas costs because the `require` statement combines both the check and revert into one step, whereas the if statement requires an additional step to check the condition before reverting.\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/token/BurnWrapper.sol#L36-L38\n\nc. Instead of checking for the `wrappedToken` address during deployment, you can use the `require` statement in the wrap function. This would ", "vulnerable_code": "constructor(IERC20 wrappedToken)\n ERC20(\"Burn Wrapped AJNA\", \"bwAJNA\")\n ERC20Permit(\"Burn Wrapped AJNA\") // enables wrapped token to also use permit functionality\n ERC20Wrapper(wrappedToken)\n {\n require(wrappedToken == IERC20(AJNA_TOKEN_ADDRESS), \"InvalidWrappedToken\");\n }", "fixed_code": "// SPDX-License-Identifier: MIT\n\n//slither-disable-next-line solc-version\npragma solidity 0.8.7;\n\n\nimport { ERC20 } from \"@oz/token/ERC20/ERC20.sol\";\nimport { IERC20 } from \"@oz/token/ERC20/IERC20.sol\";\nimport { ERC20Burnable } from \"@oz/token/ERC20/extensions/ERC20Burnable.sol\";\nimport { ERC20Permit } from \"@oz/token/ERC20/extensions/draft-ERC20Permit.sol\";\nimport { ERC20Wrapper } from \"@oz/token/ERC20/extensions/ERC20Wrapper.sol\";\nimport { IERC20Metadata } from \"@oz/token/ERC20/extensions/IERC20Metadata.sol\";\n\ncontract BurnWrappedAjna is ERC20, ERC20Burnable, ERC20Permit, ERC20Wrapper {\n\n /**\n * @notice Tokens that have been wrapped cannot be unwrapped.\n */\n error UnwrapNotAllowed();\n\n modifier onlyValidWrappedToken(IERC20 wrappedToken) {\n require(address(wrappedToken) == 0x9a96ec9B57Fb64FbC60B423d1f4da7691Bd35079, \"InvalidWrappedToken\");\n _;\n }\n\n constructor()\n ERC20(\"Burn Wrapped AJNA\", \"bwAJNA\")\n ERC20Permit(\"Burn Wrapped AJNA\") // enables wrapped token to also use permit functionality\n {\n // No need to check the wrappedToken address during deployment\n }\n\n /**\n * @notice Wrap the mainnet Ajna token into a wrapped token for use in other networks.\n * @param amount The amount of Ajna tokens to wrap.\n */\n function wrap(uint256 amount) public onlyValidWrappedToken(IERC20(_wrappedToken)) {\n ERC20Wrapper.wrap(amount);\n }\n\n /*****************/\n /*** OVERRIDES ***/\n /*****************/\n\n /**\n * @dev See {ERC20-decimals} and {ERC20Wrapper-decimals}.\n */\n function decimals() public pure override(ERC20, ERC20Wrapper) returns (uint8) {\n // since the Ajna Token has 18 decimals, we can just return 18 here.\n return 18;\n }\n\n /**\n * @notice Override unwrap method to ensure burn wrapped tokens can't be unwrapped.\n */\n function withdrawTo(address, uint256) public pure override returns (bool) {\n revert Unwrap", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/dicethedev-G.md", "collected_at": "2026-01-02T18:21:26.390146+00:00", "source_hash": "728519e64c1f7e9254223654ee40048496713fd0c14ad870fa89fdb7dc25cf8e", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 307, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "constructor(IERC20 wrappedToken)\n ERC20(\"Burn Wrapped AJNA\", \"bwAJNA\")\n ERC20Permit(\"Burn Wrapped AJNA\") // enables wrapped token to also use permit functionality\n ERC20Wrapper(wrappedToken)\n {\n require(wrappedToken == IERC20(AJNA_TOKEN_ADDRESS), \"InvalidWrappedToken\");\n }", "primary_code_language": "unknown", "primary_code_char_count": 307, "all_code_blocks": "// Code block 1 (unknown):\nconstructor(IERC20 wrappedToken)\n ERC20(\"Burn Wrapped AJNA\", \"bwAJNA\")\n ERC20Permit(\"Burn Wrapped AJNA\") // enables wrapped token to also use permit functionality\n ERC20Wrapper(wrappedToken)\n {\n require(wrappedToken == IERC20(AJNA_TOKEN_ADDRESS), \"InvalidWrappedToken\");\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ExtraordinaryFunding.sol#L92, BurnWrapper.sol#L36-L38", "github_files_list": "ExtraordinaryFunding.sol, BurnWrapper.sol", "github_refs_count": 2, "vulnerable_code_actual": "constructor(IERC20 wrappedToken)\n ERC20(\"Burn Wrapped AJNA\", \"bwAJNA\")\n ERC20Permit(\"Burn Wrapped AJNA\") // enables wrapped token to also use permit functionality\n ERC20Wrapper(wrappedToken)\n {\n require(wrappedToken == IERC20(AJNA_TOKEN_ADDRESS), \"InvalidWrappedToken\");\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "// SPDX-License-Identifier: MIT\n\n//slither-disable-next-line solc-version\npragma solidity 0.8.7;\n\n\nimport { ERC20 } from \"@oz/token/ERC20/ERC20.sol\";\nimport { IERC20 } from \"@oz/token/ERC20/IERC20.sol\";\nimport { ERC20Burnable } from \"@oz/token/ERC20/extensions/ERC20Burnable.sol\";\nimport { ERC20Permit } from \"@oz/token/ERC20/extensions/draft-ERC20Permit.sol\";\nimport { ERC20Wrapper } from \"@oz/token/ERC20/extensions/ERC20Wrapper.sol\";\nimport { IERC20Metadata } from \"@oz/token/ERC20/extensions/IERC20Metadata.sol\";\n\ncontract BurnWrappedAjna is ERC20, ERC20Burnable, ERC20Permit, ERC20Wrapper {\n\n /**\n * @notice Tokens that have been wrapped cannot be unwrapped.\n */\n error UnwrapNotAllowed();\n\n modifier onlyValidWrappedToken(IERC20 wrappedToken) {\n require(address(wrappedToken) == 0x9a96ec9B57Fb64FbC60B423d1f4da7691Bd35079, \"InvalidWrappedToken\");\n _;\n }\n\n constructor()\n ERC20(\"Burn Wrapped AJNA\", \"bwAJNA\")\n ERC20Permit(\"Burn Wrapped AJNA\") // enables wrapped token to also use permit functionality\n {\n // No need to check the wrappedToken address during deployment\n }\n\n /**\n * @notice Wrap the mainnet Ajna token into a wrapped token for use in other networks.\n * @param amount The amount of Ajna tokens to wrap.\n */\n function wrap(uint256 amount) public onlyValidWrappedToken(IERC20(_wrappedToken)) {\n ERC20Wrapper.wrap(amount);\n }\n\n /*****************/\n /*** OVERRIDES ***/\n /*****************/\n\n /**\n * @dev See {ERC20-decimals} and {ERC20Wrapper-decimals}.\n */\n function decimals() public pure override(ERC20, ERC20Wrapper) returns (uint8) {\n // since the Ajna Token has 18 decimals, we can just return 18 here.\n return 18;\n }\n\n /**\n * @notice Override unwrap method to ensure burn wrapped tokens can't be unwrapped.\n */\n function withdrawTo(address, uint256) public pure override returns (bool) {\n revert Unwrap", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "09-ondo", "title": "dev0cloo Q", "severity_raw": "Low", "severity": "low", "description": "# QA Report \n\n## Low Severity Findings\n\n### Range Start and End times must be in Unix format to prevent errors in `RWADynamicOracle`\n- The ranges set in the DynamicOracle contract must follow the Unix format since the calculations they are involved in use block.timestamp, which is also in Unix format, to prevent unexpected results. This is especially so when no visible checks exist for these ranges to be in the required format. Here are some instances:\n```\nfunction getPrice() public view whenNotPaused returns (uint256 price) {\n uint256 length = ranges.length;\n for (uint256 i = 0; i < length; ++i) {\n Range storage range = ranges[(length - 1) - i];\n if (range.start <= block.timestamp) {\n if (range.end <= block.timestamp) {\n return derivePrice(range, range.end - 1);\n } else {\n return derivePrice(range, block.timestamp); //@audit - block.timestamp returns unix values\n }\n }\n }\n }\n\n function derivePrice(\n Range memory currentRange,\n uint256 currentTime\n ) internal pure returns (uint256 price) {\n uint256 elapsedDays = (currentTime - currentRange.start) / DAY; //@audit - if range.start is not in unix format, this will lead to serious errors\n return\n roundUpTo8(\n _rmul(\n _rpow(currentRange.dailyInterestRate, elapsedDays + 1, ONE),\n currentRange.prevRangeClosePrice\n )\n );\n }\n```\nThis is marked as low severity because the `overrideRange` function easily allows a fix for this if it occurs. ", "vulnerable_code": "function getPrice() public view whenNotPaused returns (uint256 price) {\n uint256 length = ranges.length;\n for (uint256 i = 0; i < length; ++i) {\n Range storage range = ranges[(length - 1) - i];\n if (range.start <= block.timestamp) {\n if (range.end <= block.timestamp) {\n return derivePrice(range, range.end - 1);\n } else {\n return derivePrice(range, block.timestamp); //@audit - block.timestamp returns unix values\n }\n }\n }\n }\n\n function derivePrice(\n Range memory currentRange,\n uint256 currentTime\n ) internal pure returns (uint256 price) {\n uint256 elapsedDays = (currentTime - currentRange.start) / DAY; //@audit - if range.start is not in unix format, this will lead to serious errors\n return\n roundUpTo8(\n _rmul(\n _rpow(currentRange.dailyInterestRate, elapsedDays + 1, ONE),\n currentRange.prevRangeClosePrice\n )\n );\n }", "fixed_code": "", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/dev0cloo-Q.md", "collected_at": "2026-01-02T18:25:54.251463+00:00", "source_hash": "728eff17bfee70fa52ba70a3e823461850161c38276408c3fe0c13c3528f02e5", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 1091, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function getPrice() public view whenNotPaused returns (uint256 price) {\n uint256 length = ranges.length;\n for (uint256 i = 0; i < length; ++i) {\n Range storage range = ranges[(length - 1) - i];\n if (range.start <= block.timestamp) {\n if (range.end <= block.timestamp) {\n return derivePrice(range, range.end - 1);\n } else {\n return derivePrice(range, block.timestamp); //@audit - block.timestamp returns unix values\n }\n }\n }\n }\n\n function derivePrice(\n Range memory currentRange,\n uint256 currentTime\n ) internal pure returns (uint256 price) {\n uint256 elapsedDays = (currentTime - currentRange.start) / DAY; //@audit - if range.start is not in unix format, this will lead to serious errors\n return\n roundUpTo8(\n _rmul(\n _rpow(currentRange.dailyInterestRate, elapsedDays + 1, ONE),\n currentRange.prevRangeClosePrice\n )\n );\n }", "primary_code_language": "unknown", "primary_code_char_count": 1091, "all_code_blocks": "// Code block 1 (unknown):\nfunction getPrice() public view whenNotPaused returns (uint256 price) {\n uint256 length = ranges.length;\n for (uint256 i = 0; i < length; ++i) {\n Range storage range = ranges[(length - 1) - i];\n if (range.start <= block.timestamp) {\n if (range.end <= block.timestamp) {\n return derivePrice(range, range.end - 1);\n } else {\n return derivePrice(range, block.timestamp); //@audit - block.timestamp returns unix values\n }\n }\n }\n }\n\n function derivePrice(\n Range memory currentRange,\n uint256 currentTime\n ) internal pure returns (uint256 price) {\n uint256 elapsedDays = (currentTime - currentRange.start) / DAY; //@audit - if range.start is not in unix format, this will lead to serious errors\n return\n roundUpTo8(\n _rmul(\n _rpow(currentRange.dailyInterestRate, elapsedDays + 1, ONE),\n currentRange.prevRangeClosePrice\n )\n );\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function getPrice() public view whenNotPaused returns (uint256 price) {\n uint256 length = ranges.length;\n for (uint256 i = 0; i < length; ++i) {\n Range storage range = ranges[(length - 1) - i];\n if (range.start <= block.timestamp) {\n if (range.end <= block.timestamp) {\n return derivePrice(range, range.end - 1);\n } else {\n return derivePrice(range, block.timestamp); //@audit - block.timestamp returns unix values\n }\n }\n }\n }\n\n function derivePrice(\n Range memory currentRange,\n uint256 currentTime\n ) internal pure returns (uint256 price) {\n uint256 elapsedDays = (currentTime - currentRange.start) / DAY; //@audit - if range.start is not in unix format, this will lead to serious errors\n return\n roundUpTo8(\n _rmul(\n _rpow(currentRange.dailyInterestRate, elapsedDays + 1, ONE),\n currentRange.prevRangeClosePrice\n )\n );\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "01-biconomy", "title": "Secureverse Q", "severity_raw": "Low", "severity": "low", "description": "### [Low-01] Multiple Solidity version used i.e some using ```^0.8.12``` and some using ```0.8.12```\n\nTry to use Updated, stable, and most recent Solidity version to remain bug free\n\nBelow Solidity ```^0.8.12```\n```solidity \nFile: aa-4337/interfaces/IAccount.sol\nFile: aa-4337/core/EntryPoint.sol\nFile: aa-4337/core/SenderCreator.sol\nFile: aa-4337/core/StakeManager.sol\nFile: aa-4337/utils/Exec.sol\nFile: aa-4337/interfaces/IAggregator.sol\nFile: aa-4337/interfaces/UserOperation.sol\nFile: aa-4337/interfaces/IStakeManager.sol\nFile: aa-4337/interfaces/IEntryPoint.sol\nFile: aa-4337/interfaces/IAggregatedAccount.sol\nFile: aa-4337/interfaces/IPaymaster.sol\nFile: paymasters/BasePaymaster.sol\n```\n\nBelow Solidity ```0.8.12```\n```solidity \nFile: BaseSmartAccount.sol\nFile: Proxy.sol\nFile: SmartAccount.sol\nFile: SmartAccountFactory.sol\nFile: interfaces/ISignatureValidator.sol\nFile: interfaces/ERC1155TokenReceiver.sol\nFile: interfaces/ERC721TokenReceiver.sol\nFile: interfaces/ERC777TokensRecipient.sol\nFile: interfaces/IERC1271Wallet.sol\nFile: common/Singleton.sol\nFile: common/SignatureDecoder.sol\nFile: base/Executor.sol\nFile: common/SecuredTokenTransfer.sol\nFile: base/ModuleManager.sol\nFile: base/FallbackManager.sol\nFile: interfaces/IERC165.sol\nFile: libs/Math.sol\nFile: libs/LibAddress.sol\nFile: paymasters/PaymasterHelpers.sol\nFile: paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol\nFile: common/Enum.sol\nFile: libs/MultiSend.sol\nFile: MultiSendCallOnly.sol\n```\n\n\n\n### [Low-2] Changing Owner should be a 2 Step-process\n*Instances(1)*\n```solidity\nFile: SmartAccount.sol\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L109-L114\n```\n\n\n### [Low-03] ETH could remain stuck in below contracts, as there are no functionality to resuce sent ETH to those contract \n\n*Instances(4)*\n```solidity\nFile: BaseSmartAccount.sol\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-w", "vulnerable_code": "Try to use Updated, stable, and most recent Solidity version to remain bug free\n\nBelow Solidity ```^0.8.12```", "fixed_code": "Below Solidity ```0.8.12```", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/Secureverse-Q.md", "collected_at": "2026-01-02T18:13:20.635585+00:00", "source_hash": "72f32ca294d7c7b68c968cb9c2cfd647f9ff5f09e878af181ddc52073645510c", "code_block_count": 4, "solidity_block_count": 0, "total_code_chars": 317, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "Try to use Updated, stable, and most recent Solidity version to remain bug free\n\nBelow Solidity", "primary_code_language": "unknown", "primary_code_char_count": 96, "all_code_blocks": "// Code block 1 (unknown):\nTry to use Updated, stable, and most recent Solidity version to remain bug free\n\nBelow Solidity\n\n// Code block 2 (unknown):\nBelow Solidity\n\n// Code block 3 (unknown):\n### [Low-2] Changing Owner should be a 2 Step-process\n*Instances(1)*\n\n// Code block 4 (unknown):\n### [Low-03] ETH could remain stuck in below contracts, as there are no functionality to resuce sent ETH to those contract \n\n*Instances(4)*", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SmartAccount.sol#L109-L114", "github_files_list": "SmartAccount.sol", "github_refs_count": 1, "vulnerable_code_actual": "Try to use Updated, stable, and most recent Solidity version to remain bug free\n\nBelow Solidity ```^0.8.12```", "has_vulnerable_code_snippet": true, "fixed_code_actual": "Below Solidity ```0.8.12```", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "09-ondo", "title": "hunter_w3b G", "severity_raw": "High", "severity": "high", "description": "# Gas Optimization\n\n# Summary\n\n| Number | Issue | Instances |\n| :----: | :------------------------------------------------------------------------------------------------------------------------------------------------- | :-------: |\n| [G-01] | Expressions for constant values such as a call to keccak256(), should use immutable rather than constant | 5 |\n| [G-02] | ++i\u00a0COSTS LESS GAS THAN\u00a0i++ | 1 |\n| [G-03] | Stack variable used as a cheaper cache for a state variable is only used once | 2 |\n| [G-04] | Can make the variable outside the loop to save Gas | 2 |\n| [G-05] | Require() statements should be used sorted from cheapest to most expensive | 11 |\n| [G-06] | Should use arguments instead of state variable | 5 |\n| [G-07] | Instead of calculating a STATEVAR with keccak256() every time the contract is made pre calclate them before and only give the result to a constant | 6 |\n| [G-08] | Structs can be packed into fewer storage slots | 1 |\n| [G-09] | abi.encode()\u00a0is less efficient than\u00a0abi.encodePacked() | 3 |\n| [G-10] | Do not calculate constants ", "vulnerable_code": "File: contracts/usdy/rUSDY.sol\n\n bytes32 public constant USDY_MANAGER_ROLE = keccak256(\"ADMIN_ROLE\");\n bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n bytes32 public constant BURNER_ROLE = keccak256(\"BURN_ROLE\");\n bytes32 public constant LIST_CONFIGURER_ROLE =\n keccak256(\"LIST_CONFIGURER_ROLE\");", "fixed_code": "File: rwaOracles/RWADynamicOracle.sol\n\n27 bytes32 public constant SETTER_ROLE = keccak256(\"SETTER_ROLE\");\n28 bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/hunter_w3b-G.md", "collected_at": "2026-01-02T18:25:59.187070+00:00", "source_hash": "7328be05cd0b0b520b42b7fd5babe163ce028fed099bb9e68ba45081e20e7943", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: contracts/usdy/rUSDY.sol\n\n bytes32 public constant USDY_MANAGER_ROLE = keccak256(\"ADMIN_ROLE\");\n bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n bytes32 public constant BURNER_ROLE = keccak256(\"BURN_ROLE\");\n bytes32 public constant LIST_CONFIGURER_ROLE =\n keccak256(\"LIST_CONFIGURER_ROLE\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: rwaOracles/RWADynamicOracle.sol\n\n27 bytes32 public constant SETTER_ROLE = keccak256(\"SETTER_ROLE\");\n28 bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "05-ajna", "title": "Kenshin G", "severity_raw": "High", "severity": "high", "description": "# Gas Optimization Report\n## Summary\nThe benchmark used [Foundry's default optimizer setting](https://book.getfoundry.sh/reference/config/solidity-compiler#optimizer). The [`ExtraordinaryFunding.sol`](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/ExtraordinaryFunding.sol) contract was tested using all functions in the [`ExtraordinaryFunding.t.sol`](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/test/unit/ExtraordinaryFunding.t.sol) contract, excluding the `testFuzzExtraordinaryFunding()` function. The [`StandardFunding.sol`](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol) contract was tested using only the `testDistributionPeriodEndToEnd()` function.\n\nRunning command:\n- `forge test --gas-report --match-contract ExtraordinaryFundingGrantFundTest --no-match-test testFuzzExtraordinaryFunding`\n- `forge test --gas-report --match-test testDistributionPeriodEndToEnd`\n\nThe overall **average** gas savings are summarized in the table below.\n| **Contract** | **Function Name** | **Before** | **After** | **Gas Savings** |\n| :--- | :--- | :---: | :---: | :---: |\n| ExtraordinaryFunding | executeExtraordinary | 31595 | 29790 |\t1805 |\n| ExtraordinaryFunding | hashProposal | 3985 | 2256 | 1729 |\n| ExtraordinaryFunding | proposeExtraordinary | 55381 |\t51113 |\t4268 |\n| ExtraordinaryFunding | voteExtraordinary | 26705 | 26245 |\t460 |\n|||| *Subtotal:* | *8262* |\n| StandardFunding | claimDelegateReward | 33591 | 33741 | -150 |\n| StandardFunding | executeStandard | 3561 | 21737 | 1824 |\n| StandardFunding | fundingVote | 121127 | 120444 | 683 |\n| StandardFunding | proposeStandard | 83311 | 77480 | 5831 |\n| StandardFunding | screeningVote | 47128 | 46065 | 1063 |\n| ", "vulnerable_code": "File: ajna-grants/src/grants/base/Funding.sol\n\n115: if (targets_[i] != ajnaTokenAddress || values_[i] != 0) revert InvalidProposal();", "fixed_code": "```diff\nrun: diff -u before/2023-05-ajna/ajna-grants/src/grants/interfaces/IExtraordinaryFunding.sol after/2023-05-ajna/ajna-grants/src/grants/interfaces/IExtraordinaryFunding.sol\n--- before/2023-05-ajna/ajna-grants/src/grants/interfaces/IExtraordinaryFunding.sol\n+++ after/2023-05-ajna/ajna-grants/src/grants/interfaces/IExtraordinaryFunding.sol\n@@ -44,15 +44,11 @@\n \n /**\n * @notice Execute an extraordinary funding proposal if it has passed its' requisite vote threshold.\n- * @param targets_ The addresses of the contracts to call.\n- * @param values_ The amounts of ETH to send to each target.\n * @param calldatas_ The calldata to send to each target.\n * @param descriptionHash_ The hash of the proposal's description string.\n * @return proposalId_ The ID of the executed proposal.\n */\n function executeExtraordinary(\n- address[] memory targets_,\n- uint256[] memory values_,\n bytes[] memory calldatas_,\n bytes32 descriptionHash_\n ) external returns (uint256 proposalId_);\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/Kenshin-G.md", "collected_at": "2026-01-02T18:21:02.750613+00:00", "source_hash": "734091386a5c2539ae7efd508d735b490d305d3f778f146d581b607980bcc36e", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ExtraordinaryFunding.sol, ExtraordinaryFunding.t.sol, StandardFunding.sol", "github_files_list": "ExtraordinaryFunding.t.sol, ExtraordinaryFunding.sol, StandardFunding.sol", "github_refs_count": 3, "vulnerable_code_actual": "File: ajna-grants/src/grants/base/Funding.sol\n\n115: if (targets_[i] != ajnaTokenAddress || values_[i] != 0) revert InvalidProposal();", "has_vulnerable_code_snippet": true, "fixed_code_actual": "```diff\nrun: diff -u before/2023-05-ajna/ajna-grants/src/grants/interfaces/IExtraordinaryFunding.sol after/2023-05-ajna/ajna-grants/src/grants/interfaces/IExtraordinaryFunding.sol\n--- before/2023-05-ajna/ajna-grants/src/grants/interfaces/IExtraordinaryFunding.sol\n+++ after/2023-05-ajna/ajna-grants/src/grants/interfaces/IExtraordinaryFunding.sol\n@@ -44,15 +44,11 @@\n \n /**\n * @notice Execute an extraordinary funding proposal if it has passed its' requisite vote threshold.\n- * @param targets_ The addresses of the contracts to call.\n- * @param values_ The amounts of ETH to send to each target.\n * @param calldatas_ The calldata to send to each target.\n * @param descriptionHash_ The hash of the proposal's description string.\n * @return proposalId_ The ID of the executed proposal.\n */\n function executeExtraordinary(\n- address[] memory targets_,\n- uint256[] memory values_,\n bytes[] memory calldatas_,\n bytes32 descriptionHash_\n ) external returns (uint256 proposalId_);\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-ondo", "title": "RaymondFam Q", "severity_raw": "High", "severity": "high", "description": "## Missing minter role granting\nIn `deployCash()` of CashFactory.sol, `cashProxied.grantRole()` did not grant `MINTER_ROLE` to `guardian` address. Similarly, in `deployCashKYCSender()` of CashKYCSenderFactory.sol, `cashKYCSenderProxied.` did not grant `MINTER_ROLE` to `guardian` address either. (Note: The same instance also goes with `deployCashKYCSenderReceiver()` of CashKYCSenderReceiverFactory.sol). Although this can later be separately executed by the guardian who is now the default admin, consider having this specific role granting included in the atomic function call or having it commented in the NatSpec the reason for this omission.\n\n[File: CashFactory.sol#L75-L110](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashFactory.sol#L75-L110)\n\n```diff\n cashProxied.grantRole(DEFAULT_ADMIN_ROLE, guardian);\n cashProxied.grantRole(PAUSER_ROLE, guardian);\n+ cashProxied.grantRole(MINTER_ROLE, guardian);\n```\n\n[File: CashKYCSenderFactory.sol#L98-L99](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashKYCSenderFactory.sol#L98-L99)\n\n```diff\n cashKYCSenderProxied.grantRole(DEFAULT_ADMIN_ROLE, guardian);\n cashKYCSenderProxied.grantRole(PAUSER_ROLE, guardian);\n+ cashKYCSenderProxied.grantRole(MINTER_ROLE, guardian);\n```\n[File: CashKYCSenderReceiverFactory.sol#L98-L99](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashKYCSenderReceiverFactory.sol#L98-L99)\n\n```diff\n cashKYCSenderReceiverProxied.grantRole(DEFAULT_ADMIN_ROLE, guardian);\n cashKYCSenderReceiverProxied.grantRole(PAUSER_ROLE, guardian);\n+ cashKYCSenderReceiverProxied.grantRole(MINTER_ROLE, guardian);\n```\n## Use of deprecated file\nAs denoted in [OpenZeppelin's ERC20PresetMinterPauser.sol](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/presets/ERC20PresetMinterPauser.sol#L26) as well as [Ondo Finance's ERC20PresetMinterPauserUpgradeable.sol](https://github.com/code-", "vulnerable_code": "[File: CashKYCSenderFactory.sol#L98-L99](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashKYCSenderFactory.sol#L98-L99)\n", "fixed_code": "[File: CashKYCSenderReceiverFactory.sol#L98-L99](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashKYCSenderReceiverFactory.sol#L98-L99)\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/RaymondFam-Q.md", "collected_at": "2026-01-02T18:14:44.865624+00:00", "source_hash": "738043866a6e1f7331671af78bbad335fda984be4b0ab3f651a72ef86fd196c5", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 537, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "cashProxied.grantRole(DEFAULT_ADMIN_ROLE, guardian);\n cashProxied.grantRole(PAUSER_ROLE, guardian);\n+ cashProxied.grantRole(MINTER_ROLE, guardian);", "primary_code_language": "diff", "primary_code_char_count": 153, "all_code_blocks": "// Code block 1 (diff):\ncashProxied.grantRole(DEFAULT_ADMIN_ROLE, guardian);\n cashProxied.grantRole(PAUSER_ROLE, guardian);\n+ cashProxied.grantRole(MINTER_ROLE, guardian);\n\n// Code block 2 (diff):\ncashKYCSenderProxied.grantRole(DEFAULT_ADMIN_ROLE, guardian);\n cashKYCSenderProxied.grantRole(PAUSER_ROLE, guardian);\n+ cashKYCSenderProxied.grantRole(MINTER_ROLE, guardian);\n\n// Code block 3 (diff):\ncashKYCSenderReceiverProxied.grantRole(DEFAULT_ADMIN_ROLE, guardian);\n cashKYCSenderReceiverProxied.grantRole(PAUSER_ROLE, guardian);\n+ cashKYCSenderReceiverProxied.grantRole(MINTER_ROLE, guardian);", "all_code_blocks_count": 3, "has_diff_blocks": true, "diff_code": "cashProxied.grantRole(DEFAULT_ADMIN_ROLE, guardian);\n cashProxied.grantRole(PAUSER_ROLE, guardian);\n+ cashProxied.grantRole(MINTER_ROLE, guardian);\n\ncashKYCSenderProxied.grantRole(DEFAULT_ADMIN_ROLE, guardian);\n cashKYCSenderProxied.grantRole(PAUSER_ROLE, guardian);\n+ cashKYCSenderProxied.grantRole(MINTER_ROLE, guardian);\n\ncashKYCSenderReceiverProxied.grantRole(DEFAULT_ADMIN_ROLE, guardian);\n cashKYCSenderReceiverProxied.grantRole(PAUSER_ROLE, guardian);\n+ cashKYCSenderReceiverProxied.grantRole(MINTER_ROLE, guardian);", "solidity_code": "", "github_refs_formatted": "CashFactory.sol#L75-L110, CashKYCSenderFactory.sol#L98-L99, CashKYCSenderReceiverFactory.sol#L98-L99, ERC20PresetMinterPauser.sol#L26", "github_files_list": "CashFactory.sol, ERC20PresetMinterPauser.sol, CashKYCSenderFactory.sol, CashKYCSenderReceiverFactory.sol", "github_refs_count": 4, "vulnerable_code_actual": "[File: CashKYCSenderFactory.sol#L98-L99](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashKYCSenderFactory.sol#L98-L99)\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "[File: CashKYCSenderReceiverFactory.sol#L98-L99](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashKYCSenderReceiverFactory.sol#L98-L99)\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 11} {"source": "c4", "protocol": "01-biconomy", "title": "gz627 G", "severity_raw": "Medium", "severity": "medium", "description": "## Gas Optimizations\n\n| | Issue | Instances |\n| ----- |:-------------------------------------------------------------------- |:---------:|\n| GAS-1 | Applying `unchecked` operations where no overflow/underflow possible | 13 |\n| GAS-2 | Gas optimizatin for `SmartAccount.execTransaction` | 1 |\n| GAS-3 | Gas optimizatin for `SmartAccount.requiredTxGas` | 2 |\n| GAS-4 | Gas optimizatin for `SmartAccount._validateSignature` | 1 |\n| GAS-5 | Using named variable returns saves gas | 2 | \n\n### [GAS-1] Applying `unchecked` operations where no overflow/underflow possible\n\n*Instances (13)*\n\n#### Applying `unchecked` operations on the index increment in for-loops: *Instances (7)*\nIn addtion to the for-loop gas optimization in the C4audit output, a further gas optimization can be achieved to save another 63/120 gas per loop.\nFor stack variables like `uint256 index`, each `unchecked{++index;}` saves some gas compared with `++index;`. The saved gas amount varies under different situations - 120 without compiler optimization, and 63 with compiler optimization (200 runs). The `index` of a for-loop won't overflow so it is safe to apply unchecked increment. A typical optimized for-loop looks like:\n```\n...\nuint256 length = someArray.length;\nfor (uint256 index; index 1e16, 4);\n // fee greater than 1%\n //@audit\n _validate(_fee >= 1e8, 8);\n\n IERC20WithBurn(weth).safeTransferFrom(msg.sender, address(this), _amount);\n\n Delegate memory delegatePosition = Delegate({\n amount: _amount,\n fee: _fee,\n owner: msg.sender,\n activeCollateral: 0\n });\n delegates.push(delegatePosition);\n\n // add amount to total weth delegated\n totalWethDelegated += _amount;\n\n emit LogAddToDelegate(_amount, _fee, delegates.length - 1);\n return (delegates.length - 1);\n }\n", "fixed_code": "_validate(_fee >= 1e8, 20);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/Bauchibred-Q.md", "collected_at": "2026-01-02T18:24:32.174169+00:00", "source_hash": "7431049eff63f3ac5b464dcbc0d61939cf78191adf76fea56c9b5e2c2aa910d9", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "RdpxV2Core.sol#L941-L969", "github_files_list": "RdpxV2Core.sol", "github_refs_count": 1, "vulnerable_code_actual": " function addToDelegate(\n uint256 _amount,\n uint256 _fee\n ) external returns (uint256) {\n _whenNotPaused();\n // fee less than 100%\n _validate(_fee < 100e8, 8);\n // amount greater than 0.01 WETH\n _validate(_amount > 1e16, 4);\n // fee greater than 1%\n //@audit\n _validate(_fee >= 1e8, 8);\n\n IERC20WithBurn(weth).safeTransferFrom(msg.sender, address(this), _amount);\n\n Delegate memory delegatePosition = Delegate({\n amount: _amount,\n fee: _fee,\n owner: msg.sender,\n activeCollateral: 0\n });\n delegates.push(delegatePosition);\n\n // add amount to total weth delegated\n totalWethDelegated += _amount;\n\n emit LogAddToDelegate(_amount, _fee, delegates.length - 1);\n return (delegates.length - 1);\n }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "_validate(_fee >= 1e8, 20);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "08-dopex", "title": "RED LOTUS REACH Q", "severity_raw": "Critical", "severity": "critical", "description": "# Low Risk and Non-Critical Issues\n# Some values cannot be amended without deploying the contract\nCritical values may be set to nonsense values during deployment. \n\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/core/RdpxV2Core.sol#L67\n```\naddress public weth;\n```\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/core/RdpxV2Core.sol#L124-L126\n```\nconstructor(address _weth) {\n _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);\n weth = _weth;\n```\n## Risk\nBecause the audit does not include the actual final deploy scripts, there is a greater than 0 chance that there are errors there. For values that are deployed incorrectly, that would cause a need to redeploy those contracts, possibly incurring a not-insignificant financial cost.\n\n## Mitigation\nAdd a permissioned setter for critical (yet underlooked) values \n\n# Old version of OpenZeppelin Contracts used\nUsing old versions of 3rd-party libraries in the build process can introduce vulnerabilities to the protocol code. \n\n- Latest is 4.9.3 (as of August 28, 2023), version used in project is 4.9.0\n### Risks\n\n1. Older versions of OpenZeppelin contracts might not have fixes for known security vulnerabilities.\n2. Older versions might contain features or functionality that have been deprecated in recent versions.\n3. Newer versions often come with new features, optimizations, and improvements that are not available in older versions.\n\n## Recommendation\n\nReview the latest version of the OpenZeppelin contracts and upgrade.\n\n# Redundant checks for roles and whitelist\nCalls to `mint()` are already guarded against addresses lacking the `MINTER_ROLE`, but there is a redundant `require` for the same condition that can be removed\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/0ea4387a4851cd6c8811dfb61da95a677f3f63ae/contracts/decaying-bonds/RdpxDecayingBonds.sol#L120\n```\nrequire(hasRole(MINTER_ROLE, msg.sender), \"Caller is not a ", "vulnerable_code": "address public weth;", "fixed_code": "constructor(address _weth) {\n _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);\n weth = _weth;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/RED-LOTUS-REACH-Q.md", "collected_at": "2026-01-02T18:24:57.795131+00:00", "source_hash": "743890902d160ecde8b6772e026f47b0aad460b2b693dc83bb7ac35a9699f756", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 114, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "address public weth;", "primary_code_language": "unknown", "primary_code_char_count": 20, "all_code_blocks": "// Code block 1 (unknown):\naddress public weth;\n\n// Code block 2 (unknown):\nconstructor(address _weth) {\n _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);\n weth = _weth;", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "RdpxV2Core.sol#L67, RdpxV2Core.sol#L124-L126, RdpxDecayingBonds.sol#L120", "github_files_list": "RdpxV2Core.sol, RdpxDecayingBonds.sol", "github_refs_count": 3, "vulnerable_code_actual": "address public weth;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "constructor(address _weth) {\n _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);\n weth = _weth;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "07-amphora", "title": "halden Q", "severity_raw": "Low", "severity": "low", "description": "# Low/NC issues\n\n## [L-01] quorumVotes can be setted to 0\n### Impact \nIt is possible for `quorumVotes` to be set to zero by the government.\n\n```solidity\nfunction setQuorumVotes(uint256 _newQuorumVotes) external override onlyGov {\n //@audit _newQuorumVotes != 0\n uint256 _oldQuorumVotes = quorumVotes;\n quorumVotes = _newQuorumVotes;\n\n emit NewQuorum(_oldQuorumVotes, quorumVotes);\n }\n```\n \nIf this happens, it will block the creation of new proposals.\n\n```solidity\n // Reject proposals before initiating as Governor\n if (quorumVotes == 0) revert GovernorCharlie_NotActive();\n```\n\n### Recommended Mitigation Steps\nAdd additional check for that: \n\n```solidity\nfunction setQuorumVotes(uint256 _newQuorumVotes) external override onlyGov {\n if(_newQuorumVotes == 0) revert ZeroQuorumVotes();\n\n uint256 _oldQuorumVotes = quorumVotes;\n quorumVotes = _newQuorumVotes;\n\n emit NewQuorum(_oldQuorumVotes, quorumVotes);\n }\n```\n\n## [L-02] Check if msg.sender is equal to signatory\n### Impact \nFrom the provided signature by `msg.sender`, the address of the `signatory` (the user who signed this signature) is obtained. The address of the `signatory` is checked to confirm if it is equal to `address(0)`, but it is never checked whether `msg.sender == signatory`.\n\n```solidity\naddress _signatory = ecrecover(_digest, _v, _r, _s);\nif (_signatory == address(0)) revert GovernorCharlie_InvalidSignature();\n//@note check if msg.sender == signatory\n```\n\nmsg.sender can use someone else's signature to vote on a given proposal.\n\n### Recommended Mitigation Steps\nAdd additional check for that\n\n## [L-03] Missed access modifier for deployVault function\n### Impact \nThe modifier for vault controller access for the `deployVault` function is missing, and if a user calls this function, they will create a vault but will not be registered in the system (not included in VaultController). Users can create such malfunctioning vaults and get confused.\n\n### Recommended Mitigation Steps\nAdd addi", "vulnerable_code": "function setQuorumVotes(uint256 _newQuorumVotes) external override onlyGov {\n //@audit _newQuorumVotes != 0\n uint256 _oldQuorumVotes = quorumVotes;\n quorumVotes = _newQuorumVotes;\n\n emit NewQuorum(_oldQuorumVotes, quorumVotes);\n }", "fixed_code": " // Reject proposals before initiating as Governor\n if (quorumVotes == 0) revert GovernorCharlie_NotActive();", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/halden-Q.md", "collected_at": "2026-01-02T18:23:49.272372+00:00", "source_hash": "749a3688e75abe0d434ad79e2477faf1504ea4224a2b85c434c5b2adfe0bbd37", "code_block_count": 4, "solidity_block_count": 4, "total_code_chars": 785, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function setQuorumVotes(uint256 _newQuorumVotes) external override onlyGov {\n //@audit _newQuorumVotes != 0\n uint256 _oldQuorumVotes = quorumVotes;\n quorumVotes = _newQuorumVotes;\n\n emit NewQuorum(_oldQuorumVotes, quorumVotes);\n }", "primary_code_language": "solidity", "primary_code_char_count": 243, "all_code_blocks": "// Code block 1 (solidity):\nfunction setQuorumVotes(uint256 _newQuorumVotes) external override onlyGov {\n //@audit _newQuorumVotes != 0\n uint256 _oldQuorumVotes = quorumVotes;\n quorumVotes = _newQuorumVotes;\n\n emit NewQuorum(_oldQuorumVotes, quorumVotes);\n }\n\n// Code block 2 (solidity):\n// Reject proposals before initiating as Governor\n if (quorumVotes == 0) revert GovernorCharlie_NotActive();\n\n// Code block 3 (solidity):\nfunction setQuorumVotes(uint256 _newQuorumVotes) external override onlyGov {\n if(_newQuorumVotes == 0) revert ZeroQuorumVotes();\n\n uint256 _oldQuorumVotes = quorumVotes;\n quorumVotes = _newQuorumVotes;\n\n emit NewQuorum(_oldQuorumVotes, quorumVotes);\n }\n\n// Code block 4 (solidity):\naddress _signatory = ecrecover(_digest, _v, _r, _s);\nif (_signatory == address(0)) revert GovernorCharlie_InvalidSignature();\n//@note check if msg.sender == signatory", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function setQuorumVotes(uint256 _newQuorumVotes) external override onlyGov {\n //@audit _newQuorumVotes != 0\n uint256 _oldQuorumVotes = quorumVotes;\n quorumVotes = _newQuorumVotes;\n\n emit NewQuorum(_oldQuorumVotes, quorumVotes);\n }\n\n// Reject proposals before initiating as Governor\n if (quorumVotes == 0) revert GovernorCharlie_NotActive();\n\nfunction setQuorumVotes(uint256 _newQuorumVotes) external override onlyGov {\n if(_newQuorumVotes == 0) revert ZeroQuorumVotes();\n\n uint256 _oldQuorumVotes = quorumVotes;\n quorumVotes = _newQuorumVotes;\n\n emit NewQuorum(_oldQuorumVotes, quorumVotes);\n }\n\naddress _signatory = ecrecover(_digest, _v, _r, _s);\nif (_signatory == address(0)) revert GovernorCharlie_InvalidSignature();\n//@note check if msg.sender == signatory", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function setQuorumVotes(uint256 _newQuorumVotes) external override onlyGov {\n //@audit _newQuorumVotes != 0\n uint256 _oldQuorumVotes = quorumVotes;\n quorumVotes = _newQuorumVotes;\n\n emit NewQuorum(_oldQuorumVotes, quorumVotes);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " // Reject proposals before initiating as Governor\n if (quorumVotes == 0) revert GovernorCharlie_NotActive();", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "05-ajna", "title": "spark Q", "severity_raw": "Gas", "severity": "gas", "description": "In the PositionManager.sol, the function `memorializePositions` is trying to update `positions` inside the for loop based on the length of `params_.indexes`.\n\n```solidity\n uint256 indexesLength = params_.indexes.length;\n uint256 index;\n\n for (uint256 i = 0; i < indexesLength; ) {...}\n\n```\n\nHowever, the `params_` is the input value for the function, when this value is too large, the transaction may fail due to the gas outage.", "vulnerable_code": " uint256 indexesLength = params_.indexes.length;\n uint256 index;\n\n for (uint256 i = 0; i < indexesLength; ) {...}\n", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/spark-Q.md", "collected_at": "2026-01-02T18:21:48.327526+00:00", "source_hash": "74cd3e2882d4f4300577ec0403811a9610db53ab100686e5cfecb409acdcf6aa", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 126, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "uint256 indexesLength = params_.indexes.length;\n uint256 index;\n\n for (uint256 i = 0; i < indexesLength; ) {...}", "primary_code_language": "solidity", "primary_code_char_count": 126, "all_code_blocks": "// Code block 1 (solidity):\nuint256 indexesLength = params_.indexes.length;\n uint256 index;\n\n for (uint256 i = 0; i < indexesLength; ) {...}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "uint256 indexesLength = params_.indexes.length;\n uint256 index;\n\n for (uint256 i = 0; i < indexesLength; ) {...}", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " uint256 indexesLength = params_.indexes.length;\n uint256 index;\n\n for (uint256 i = 0; i < indexesLength; ) {...}\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 2.9} {"source": "c4", "protocol": "02-ethos", "title": "IceBear Q", "severity_raw": "Critical", "severity": "critical", "description": "## Non Critical Issues\n\n\n### [N-1] Use of block.timestamp\nBlock timestamps have historically been used for a variety of applications, such as entropy for random numbers (see the Entropy Illusion for further details), locking funds for periods of time, and various state-changing conditional statements that are time-dependent. Miners have the ability to adjust timestamps slightly, which can prove to be dangerous if block timestamps are used incorrectly in smart contracts.\n#### Recommended Mitigation Steps\nBlock timestamps should not be used for entropy or generating random numbers \u2014 i.e., they should not be the deciding factor (either directly or through some derivation) for winning a game or changing an important state.\n\nTime-sensitive logic is sometimes required; e.g., for unlocking contracts (time-locking), completing an ICO after a few weeks, or enforcing expiry dates. It is sometimes recommended to use block.number and an average block time to estimate times; with a 10 second block time, 1 week equates to approximately, 60480 blocks. Thus, specifying a block number at which to change a contract state can be more secure, as miners are unable to easily manipulate the block number.\n\nInstances where block.timestamp is used:\n\n*Find (24) instance(s) in contracts*:\n```solidity\nFile: Ethos-Core/contracts/LQTY/CommunityIssuance.sol\n\n87: uint256 endTimestamp = block.timestamp > lastDistributionTime ? lastDistributionTime : block.timestamp;\n\n87: uint256 endTimestamp = block.timestamp > lastDistributionTime ? lastDistributionTime : block.timestamp;\n\n93: lastIssuanceTimestamp = block.timestamp;\n\n113: lastDistributionTime = block.timestamp.add(distributionPeriod);\n\n114: lastIssuanceTimestamp = block.timestamp;\n\n```\n[Ethos-Core/contracts/LQTY/CommunityIssuance.sol](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LQTY/CommunityIssuance.sol)\n\n```solidity\nFile: Ethos-Core/contracts/LUSDToken.sol\n\n128: ", "vulnerable_code": "File: Ethos-Core/contracts/LQTY/CommunityIssuance.sol\n\n87: uint256 endTimestamp = block.timestamp > lastDistributionTime ? lastDistributionTime : block.timestamp;\n\n87: uint256 endTimestamp = block.timestamp > lastDistributionTime ? lastDistributionTime : block.timestamp;\n\n93: lastIssuanceTimestamp = block.timestamp;\n\n113: lastDistributionTime = block.timestamp.add(distributionPeriod);\n\n114: lastIssuanceTimestamp = block.timestamp;\n", "fixed_code": "File: Ethos-Core/contracts/LUSDToken.sol\n\n128: deploymentStartTime = block.timestamp;\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/IceBear-Q.md", "collected_at": "2026-01-02T18:16:14.816456+00:00", "source_hash": "750db159cd7a46a1af2f3a5df236ea0e02bc3fa441a36b450ebf8fc73226a28d", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 482, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: Ethos-Core/contracts/LQTY/CommunityIssuance.sol\n\n87: uint256 endTimestamp = block.timestamp > lastDistributionTime ? lastDistributionTime : block.timestamp;\n\n87: uint256 endTimestamp = block.timestamp > lastDistributionTime ? lastDistributionTime : block.timestamp;\n\n93: lastIssuanceTimestamp = block.timestamp;\n\n113: lastDistributionTime = block.timestamp.add(distributionPeriod);\n\n114: lastIssuanceTimestamp = block.timestamp;", "primary_code_language": "solidity", "primary_code_char_count": 482, "all_code_blocks": "// Code block 1 (solidity):\nFile: Ethos-Core/contracts/LQTY/CommunityIssuance.sol\n\n87: uint256 endTimestamp = block.timestamp > lastDistributionTime ? lastDistributionTime : block.timestamp;\n\n87: uint256 endTimestamp = block.timestamp > lastDistributionTime ? lastDistributionTime : block.timestamp;\n\n93: lastIssuanceTimestamp = block.timestamp;\n\n113: lastDistributionTime = block.timestamp.add(distributionPeriod);\n\n114: lastIssuanceTimestamp = block.timestamp;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: Ethos-Core/contracts/LQTY/CommunityIssuance.sol\n\n87: uint256 endTimestamp = block.timestamp > lastDistributionTime ? lastDistributionTime : block.timestamp;\n\n87: uint256 endTimestamp = block.timestamp > lastDistributionTime ? lastDistributionTime : block.timestamp;\n\n93: lastIssuanceTimestamp = block.timestamp;\n\n113: lastDistributionTime = block.timestamp.add(distributionPeriod);\n\n114: lastIssuanceTimestamp = block.timestamp;", "github_refs_formatted": "CommunityIssuance.sol", "github_files_list": "CommunityIssuance.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: Ethos-Core/contracts/LQTY/CommunityIssuance.sol\n\n87: uint256 endTimestamp = block.timestamp > lastDistributionTime ? lastDistributionTime : block.timestamp;\n\n87: uint256 endTimestamp = block.timestamp > lastDistributionTime ? lastDistributionTime : block.timestamp;\n\n93: lastIssuanceTimestamp = block.timestamp;\n\n113: lastDistributionTime = block.timestamp.add(distributionPeriod);\n\n114: lastIssuanceTimestamp = block.timestamp;\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: Ethos-Core/contracts/LUSDToken.sol\n\n128: deploymentStartTime = block.timestamp;\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-asymmetry", "title": "hl_ Q", "severity_raw": "High", "severity": "high", "description": "# Table of contents\n\n- [L-01] Unable to remove derivative \n- [L-02] Unstaking should not be paused\n- [L-03] Function `RebalanceToWeight` may revert\n- [L-04] Functions `stake` and `unstake` may revert\n- [L-05] Include check to ensure sufficient funds for unstaking\n- [N-01] Insufficient test coverage\n- [N-02] Import declarations should import specific identifiers, rather than the whole file\n- [N-03] Use a more recent version of Solidity \n- [N-04] Non-library/interface files should use fixed compiler versions, not floating ones\n- [N-05] NatSpec comments should be increased in contracts\n\n## [L-01] Unable to remove derivative \n\nIn `SafEth.sol`, there is no function available to remove a derivative. There should be such a function available in case a derivative should be removed.\n\n## [L-02] Unstaking should not be paused\n\nIn general, function `unstake` should not have a pause modifier. Users should always be able to withdraw their funds. \n\n```\nFile: 2023-03-asymmetry/contracts/SafEth/SafEth.sol \n\n108: function unstake(uint256 _safEthAmount) external {\n109: require(pauseUnstaking == false, \"unstaking is paused\");\n```\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L109\n\n## [L-03] Function `RebalanceToWeight` may revert\n\nFunction `RebalanceToWeight` in `SafEth.sol` withdraws all derivatives and re-deposits them to have the correct weights. When it comes to a point where there are many derivatives added and a huge number of users, the function may revert due to reaching maximum gas limit. Consider breaking up the loop into smaller loops so that each execution can be successful.\n\n\n```\nFile: 2023-03-asymmetry/contracts/SafEth/SafEth.sol (L138-155)\n\nfunction rebalanceToWeights() external onlyOwner {\n uint256 ethAmountBefore = address(this).balance;\n for (uint i = 0; i < derivativeCount; i++) {\n if (derivatives[i].balance() > 0)\n derivatives[i].withdraw(der", "vulnerable_code": "File: 2023-03-asymmetry/contracts/SafEth/SafEth.sol \n\n108: function unstake(uint256 _safEthAmount) external {\n109: require(pauseUnstaking == false, \"unstaking is paused\");", "fixed_code": "File: 2023-03-asymmetry/contracts/SafEth/SafEth.sol (L138-155)\n\nfunction rebalanceToWeights() external onlyOwner {\n uint256 ethAmountBefore = address(this).balance;\n for (uint i = 0; i < derivativeCount; i++) {\n if (derivatives[i].balance() > 0)\n derivatives[i].withdraw(derivatives[i].balance());\n }\n uint256 ethAmountAfter = address(this).balance;\n uint256 ethAmountToRebalance = ethAmountAfter - ethAmountBefore;\n\n for (uint i = 0; i < derivativeCount; i++) {\n if (weights[i] == 0 || ethAmountToRebalance == 0) continue;\n uint256 ethAmount = (ethAmountToRebalance * weights[i]) /\n totalWeight;\n // Price will change due to slippage\n derivatives[i].deposit{value: ethAmount}();\n }\n emit Rebalanced();\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/hl_-Q.md", "collected_at": "2026-01-02T18:19:11.549660+00:00", "source_hash": "752417b8fd81f2314ca053f0bada75eb8ded10f1a017f136da8f18312d2045dc", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 178, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: 2023-03-asymmetry/contracts/SafEth/SafEth.sol \n\n108: function unstake(uint256 _safEthAmount) external {\n109: require(pauseUnstaking == false, \"unstaking is paused\");", "primary_code_language": "unknown", "primary_code_char_count": 178, "all_code_blocks": "// Code block 1 (unknown):\nFile: 2023-03-asymmetry/contracts/SafEth/SafEth.sol \n\n108: function unstake(uint256 _safEthAmount) external {\n109: require(pauseUnstaking == false, \"unstaking is paused\");", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol#L109", "github_files_list": "SafEth.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: 2023-03-asymmetry/contracts/SafEth/SafEth.sol \n\n108: function unstake(uint256 _safEthAmount) external {\n109: require(pauseUnstaking == false, \"unstaking is paused\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: 2023-03-asymmetry/contracts/SafEth/SafEth.sol (L138-155)\n\nfunction rebalanceToWeights() external onlyOwner {\n uint256 ethAmountBefore = address(this).balance;\n for (uint i = 0; i < derivativeCount; i++) {\n if (derivatives[i].balance() > 0)\n derivatives[i].withdraw(derivatives[i].balance());\n }\n uint256 ethAmountAfter = address(this).balance;\n uint256 ethAmountToRebalance = ethAmountAfter - ethAmountBefore;\n\n for (uint i = 0; i < derivativeCount; i++) {\n if (weights[i] == 0 || ethAmountToRebalance == 0) continue;\n uint256 ethAmount = (ethAmountToRebalance * weights[i]) /\n totalWeight;\n // Price will change due to slippage\n derivatives[i].deposit{value: ethAmount}();\n }\n emit Rebalanced();\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-asymmetry", "title": "Bason G", "severity_raw": "High", "severity": "high", "description": "## Gas Optimization Findings\n| Number |Issues Details |\n|:--:|:-------|\n|[GAS-01]| Use if statements instead of require and revert with custom errors instead of using strings\n|[GAS-02]| Make some constants private\n|[GAS-03]| Use calldata type instead of memory\n|[GAS-04]| Compute off-chain and use directly the hashes of contract addresses if possible\n|[GAS-05]| Streamline if/else statements to save gas\n|[GAS-06]| Assign a local variable for for loops when comparing to state variables to save from SLOAD operations\n***\n\n## [GAS-01] Use if statements instead of require and revert with custom errors instead of using strings\n\nEven thought it is a public finding I would strongly advise to replace all require statements if statements and use custom errors.\nThere are many places in the contract where require is being used and that can save quite a bit of gas.\n\nSafEth.sol\n\nrequire(pauseStaking == false, \"staking is paused\");\nrequire(msg.value >= minAmount, \"amount too low\");\nrequire(msg.value <= maxAmount, \"amount too high\");\n\nrequire(pauseUnstaking == false, \"unstaking is paused\");\n\n```\nReth.sol\nrequire(sent, \"Failed to send Ether\");\nrequire(rethBalance2 > rethBalance1, \"No rETH was minted\");\n\n```\n\nSfrxEth.sol\nrequire(sent, \"Failed to send Ether\");\n\n```\n\nWstEth.sol\nrequire(sent, \"Failed to send Ether\");\n\n```\n## |[GAS-02]| Make some constants private\n\nReth.sol\nAll of these can be made private to save gas\n\naddress public constant ROCKET_STORAGE_ADDRESS =\n 0x1d8f8f00cfa6758d7bE78336684788Fb0ee0Fa46;\naddress public constant W_ETH_ADDRESS =\n 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;\naddress public constant UNISWAP_ROUTER =\n 0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45;\naddress public constant UNI_V3_FACTORY =\n 0x1F98431c8aD98523631AE4a59f267346ea31F984;\n\n```\nSfrxEth.sol\n\naddress public constant SFRX_ETH_ADDRESS =\n 0xac3E018457B222d93114458476f3E3416Abbe38F;\naddress public constant FRX_ETH_ADDRESS =\n 0x5E8422345238F34275888049021821E8E08CAa1f;\naddress public cons", "vulnerable_code": "Reth.sol\nrequire(sent, \"Failed to send Ether\");\nrequire(rethBalance2 > rethBalance1, \"No rETH was minted\");\n", "fixed_code": "WstEth.sol\nrequire(sent, \"Failed to send Ether\");\n", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Bason-G.md", "collected_at": "2026-01-02T18:17:53.472437+00:00", "source_hash": "7542d35919e49c5aca23300b553b60cdaddd36407cc1195dc8bd167f639fbe68", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 156, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "Reth.sol\nrequire(sent, \"Failed to send Ether\");\nrequire(rethBalance2 > rethBalance1, \"No rETH was minted\");", "primary_code_language": "unknown", "primary_code_char_count": 107, "all_code_blocks": "// Code block 1 (unknown):\nReth.sol\nrequire(sent, \"Failed to send Ether\");\nrequire(rethBalance2 > rethBalance1, \"No rETH was minted\");\n\n// Code block 2 (unknown):\nWstEth.sol\nrequire(sent, \"Failed to send Ether\");", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "Reth.sol\nrequire(sent, \"Failed to send Ether\");\nrequire(rethBalance2 > rethBalance1, \"No rETH was minted\");\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "WstEth.sol\nrequire(sent, \"Failed to send Ether\");\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-salty", "title": "0xSmartContractSamurai Q", "severity_raw": "Critical", "severity": "critical", "description": "0. `Proposals::proposeSendSALT()` - L202: Whenever salt balance of DAO.sol is `0 < DAO salt balance < 20`, `maxSendable` will round down to zero, therefore 0 salt will be sent even when salt balance is `19.99`.\n\nhttps://github.com/code-423n4/2024-01-salty/blob/ce719503b43ebf086f5147c0f6efc3c0890bf0f9/src/dao/Proposals.sol#L202\n\nWhenever `exchangeConfig.salt().balanceOf( address(exchangeConfig.dao()) )` is `> 0 but < 20`, `maxSendable` will round down to zero, and therefore user passed parameter `amount` (which should be > 0) will trigger a revert in `require( amount <= maxSendable, \"Cannot send more than 5% of the DAO SALT balance\" );`, therefore wont be possible to send salt to anyone whenever DAO has `salt tokens > 0 but < 20`.\n\nImpact:\n\n- should be minimal on average\n- approved proposal for sending salt reverting\n- approved multi-proposal reverting due to salt balance less than 20, this could be more serious\n\nPoC:\n\nL202:\n`maxSendable = balance * 5 / 100`\nWill round down to zero for `balance * 5 / 100 < 1`:\n`balance * 5 / 100 < 1`\n`balance < 100/5`\n`balance < 20`\n\nSo for DAO salt `balance < 20`, e.g. 19.99, `maxSendable` will round down to zero due to how solidity/evm treats non-integer numbers, especially anything less than 1.\n\nRecommendation:\n\nMight be OK if DAO salt balance will never be less than 20, otherwise:\n- maybe leverage Fixed-Point Arithmetic library\n\n=======\n=======\n\n1. `DAO::_executeApproval()` - L170: `( exchangeConfig.salt().balanceOf(address(this)) >= ballot.number1 )` should use `>` instead of `>=` because of the related check in `Proposals::proposeSendSALT()` at L203: `require( amount <= maxSendable`.\n\nhttps://github.com/code-423n4/2024-01-salty/blob/ce719503b43ebf086f5147c0f6efc3c0890bf0f9/src/dao/Proposals.sol#L203\nhttps://github.com/code-423n4/2024-01-salty/blob/ce719503b43ebf086f5147c0f6efc3c0890bf0f9/src/dao/DAO.sol#L170\n\n`_executeApproval()` L170:\n```solidity\nif ( exchangeConfig.salt().balanceOf(address(this)) >= ballot.number1 )\n```\n\nShou", "vulnerable_code": "if ( exchangeConfig.salt().balanceOf(address(this)) >= ballot.number1 )", "fixed_code": "if ( exchangeConfig.salt().balanceOf(address(this)) * 5 / 100 >= ballot.number1 )", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/0xSmartContractSamurai-Q.md", "collected_at": "2026-01-02T19:01:07.510563+00:00", "source_hash": "7553562202c74a77fb52ca4c2ab0bc0afda09d6111dc04b76f259461595e0bff", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 71, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "if ( exchangeConfig.salt().balanceOf(address(this)) >= ballot.number1 )", "primary_code_language": "solidity", "primary_code_char_count": 71, "all_code_blocks": "// Code block 1 (solidity):\nif ( exchangeConfig.salt().balanceOf(address(this)) >= ballot.number1 )", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "if ( exchangeConfig.salt().balanceOf(address(this)) >= ballot.number1 )", "github_refs_formatted": "Proposals.sol#L202, Proposals.sol#L203, DAO.sol#L170", "github_files_list": "Proposals.sol, DAO.sol", "github_refs_count": 3, "vulnerable_code_actual": "if ( exchangeConfig.salt().balanceOf(address(this)) >= ballot.number1 )", "has_vulnerable_code_snippet": true, "fixed_code_actual": "if ( exchangeConfig.salt().balanceOf(address(this)) * 5 / 100 >= ballot.number1 )", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "09-ondo", "title": "sandy Q", "severity_raw": "Critical", "severity": "critical", "description": "# Summary\n\n## Low Risk Issues\n|Id|Title| \n|:--:|:-------|\n|L-01| Manually approve allowance to 0 to reduce chance of approval front-running | \n\n\n## [L-01] Manually approve allowance to 0 to reduce chance of approval front-running.\n### Instance:\n1. https://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L485-L495\n\n### Description\nThe EIP-20 token's approve() function creates the potential for an approved spender to spend more than the intended amount. A front running attack can be used, enabling an approved spender to call transferFrom() both before and after the call to approve() is processed. \n\n### Recommendations\nThe ``_approve()`` of ``rUSDY.sol`` should manually approve allowances of spender from owner to 0 to before approving it to any other value. This will prevent approval front-running attacks.\n\nChange From:\n```\n function _approve(\n address _owner,\n address _spender,\n uint256 _amount\n ) internal whenNotPaused {\n require(_owner != address(0), \"APPROVE_FROM_ZERO_ADDRESS\");\n require(_spender != address(0), \"APPROVE_TO_ZERO_ADDRESS\");\n\n allowances[_owner][_spender] = _amount;\n emit Approval(_owner, _spender, _amount);\n }\n```\nTo:\n```diff\n function _approve(\n address _owner,\n address _spender,\n uint256 _amount\n ) internal whenNotPaused {\n require(_owner != address(0), \"APPROVE_FROM_ZERO_ADDRESS\");\n require(_spender != address(0), \"APPROVE_TO_ZERO_ADDRESS\");\n\n+ allowances[_owner][_spender] = 0; //manually approve to 0\n allowances[_owner][_spender] = _amount;\n emit Approval(_owner, _spender, _amount);\n }\n```\n\n\n## Non-Critical Issues\n|Id|Title\n|:--:|:-------|\n|NC-01| Use named imports \n|NC-02| Add more indexed parameters in events \n|NC-03| Struct and errors can use more inline documentation \n|NC-04| ``_rpow()`` lacks proper functional documentation\n\n\n## [NC-01] Use named imports\nThere are no named imports used in any of the contracts in scope. Named imports sh", "vulnerable_code": " function _approve(\n address _owner,\n address _spender,\n uint256 _amount\n ) internal whenNotPaused {\n require(_owner != address(0), \"APPROVE_FROM_ZERO_ADDRESS\");\n require(_spender != address(0), \"APPROVE_TO_ZERO_ADDRESS\");\n\n allowances[_owner][_spender] = _amount;\n emit Approval(_owner, _spender, _amount);\n }", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/sandy-Q.md", "collected_at": "2026-01-02T18:26:17.112085+00:00", "source_hash": "75e467a4a5338dd6b8e4816825f20a9227c6f862c5168c638ce55935eb50da22", "code_block_count": 2, "solidity_block_count": 1, "total_code_chars": 726, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _approve(\n address _owner,\n address _spender,\n uint256 _amount\n ) internal whenNotPaused {\n require(_owner != address(0), \"APPROVE_FROM_ZERO_ADDRESS\");\n require(_spender != address(0), \"APPROVE_TO_ZERO_ADDRESS\");\n\n allowances[_owner][_spender] = _amount;\n emit Approval(_owner, _spender, _amount);\n }", "primary_code_language": "unknown", "primary_code_char_count": 332, "all_code_blocks": "// Code block 1 (unknown):\nfunction _approve(\n address _owner,\n address _spender,\n uint256 _amount\n ) internal whenNotPaused {\n require(_owner != address(0), \"APPROVE_FROM_ZERO_ADDRESS\");\n require(_spender != address(0), \"APPROVE_TO_ZERO_ADDRESS\");\n\n allowances[_owner][_spender] = _amount;\n emit Approval(_owner, _spender, _amount);\n }\n\n// Code block 2 (diff):\nfunction _approve(\n address _owner,\n address _spender,\n uint256 _amount\n ) internal whenNotPaused {\n require(_owner != address(0), \"APPROVE_FROM_ZERO_ADDRESS\");\n require(_spender != address(0), \"APPROVE_TO_ZERO_ADDRESS\");\n\n+ allowances[_owner][_spender] = 0; //manually approve to 0\n allowances[_owner][_spender] = _amount;\n emit Approval(_owner, _spender, _amount);\n }", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "function _approve(\n address _owner,\n address _spender,\n uint256 _amount\n ) internal whenNotPaused {\n require(_owner != address(0), \"APPROVE_FROM_ZERO_ADDRESS\");\n require(_spender != address(0), \"APPROVE_TO_ZERO_ADDRESS\");\n\n+ allowances[_owner][_spender] = 0; //manually approve to 0\n allowances[_owner][_spender] = _amount;\n emit Approval(_owner, _spender, _amount);\n }", "solidity_code": "", "github_refs_formatted": "rUSDY.sol#L485-L495", "github_files_list": "rUSDY.sol", "github_refs_count": 1, "vulnerable_code_actual": " function _approve(\n address _owner,\n address _spender,\n uint256 _amount\n ) internal whenNotPaused {\n require(_owner != address(0), \"APPROVE_FROM_ZERO_ADDRESS\");\n require(_spender != address(0), \"APPROVE_TO_ZERO_ADDRESS\");\n\n allowances[_owner][_spender] = _amount;\n emit Approval(_owner, _spender, _amount);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 9} {"source": "c4", "protocol": "10-badger", "title": "0xhex G", "severity_raw": "Low", "severity": "low", "description": "## [G-01] Splitting require() statements that use && saves gas\n\n```solidity\nFile: contracts/contracts/BorrowerOperations.sol\n\n734 require(\n735 recoveredAddress != address(0) && recoveredAddress == _borrower,\n736 \"BorrowerOperations: Invalid signature\"\n737 );\n```\n\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/BorrowerOperations.sol#L734-L737\n\n```solidity\nFile: contracts/contracts/CdpManager.sol\n\n762 require(\n763 _maxFeePercentage >= redemptionFeeFloor && _maxFeePercentage <= DECIMAL_PRECISION,\n764 \"Max fee percentage must be between redemption fee floor and 100%\"\n765 );\n```\n\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/CdpManager.sol#L762\n\n```solidity\nFile: contracts/contracts/CdpManagerStorage.sol\n\n261 require(\n262 closedStatus != Status.nonExistent && closedStatus != Status.active,\n263 \"CdpManagerStorage: close non-exist or non-active CDP!\"\n264 );\n\n\n466 require(\n467 cdpStatus != Status.nonExistent && cdpStatus != Status.active,\n468 \"CdpManagerStorage: remove non-exist or non-active CDP!\"\n469 );\n\n653 require(\n654 CdpOwnersArrayLength > 1 && sortedCdps.getSize() > 1,\n655 \"CdpManager: Only one cdp in the system\"\n656 );\n```\n\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/CdpManagerStorage.sol#L261\n\n```solidity\nFile: contracts/contracts/EBTCToken.sol\n\n296 require(\n297 _recipient != address(0) && _recipient != address(this),\n298 \"EBTC: Cannot transfer tokens directly to the EBTC token contract or the zero address\"\n299 );\n\n\n300 require(\n301 _recipient != cdpManagerAddress && _recipient != borrowerOperationsAddress,\n302 \"EBTC: Cannot transfer tokens directly to the CdpManager or BorrowerOps\"\n303 );\n```\n\nhttps://github", "vulnerable_code": "File: contracts/contracts/BorrowerOperations.sol\n\n734 require(\n735 recoveredAddress != address(0) && recoveredAddress == _borrower,\n736 \"BorrowerOperations: Invalid signature\"\n737 );", "fixed_code": "File: contracts/contracts/CdpManager.sol\n\n762 require(\n763 _maxFeePercentage >= redemptionFeeFloor && _maxFeePercentage <= DECIMAL_PRECISION,\n764 \"Max fee percentage must be between redemption fee floor and 100%\"\n765 );", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/0xhex-G.md", "collected_at": "2026-01-02T18:26:27.256442+00:00", "source_hash": "75ed507bb9e1dc77450b4f3e8d05aec031e6e894fd250eccd122cc5f99cb0c53", "code_block_count": 4, "solidity_block_count": 4, "total_code_chars": 1515, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/contracts/BorrowerOperations.sol\n\n734 require(\n735 recoveredAddress != address(0) && recoveredAddress == _borrower,\n736 \"BorrowerOperations: Invalid signature\"\n737 );", "primary_code_language": "solidity", "primary_code_char_count": 217, "all_code_blocks": "// Code block 1 (solidity):\nFile: contracts/contracts/BorrowerOperations.sol\n\n734 require(\n735 recoveredAddress != address(0) && recoveredAddress == _borrower,\n736 \"BorrowerOperations: Invalid signature\"\n737 );\n\n// Code block 2 (solidity):\nFile: contracts/contracts/CdpManager.sol\n\n762 require(\n763 _maxFeePercentage >= redemptionFeeFloor && _maxFeePercentage <= DECIMAL_PRECISION,\n764 \"Max fee percentage must be between redemption fee floor and 100%\"\n765 );\n\n// Code block 3 (solidity):\nFile: contracts/contracts/CdpManagerStorage.sol\n\n261 require(\n262 closedStatus != Status.nonExistent && closedStatus != Status.active,\n263 \"CdpManagerStorage: close non-exist or non-active CDP!\"\n264 );\n\n\n466 require(\n467 cdpStatus != Status.nonExistent && cdpStatus != Status.active,\n468 \"CdpManagerStorage: remove non-exist or non-active CDP!\"\n469 );\n\n653 require(\n654 CdpOwnersArrayLength > 1 && sortedCdps.getSize() > 1,\n655 \"CdpManager: Only one cdp in the system\"\n656 );\n\n// Code block 4 (solidity):\nFile: contracts/contracts/EBTCToken.sol\n\n296 require(\n297 _recipient != address(0) && _recipient != address(this),\n298 \"EBTC: Cannot transfer tokens directly to the EBTC token contract or the zero address\"\n299 );\n\n\n300 require(\n301 _recipient != cdpManagerAddress && _recipient != borrowerOperationsAddress,\n302 \"EBTC: Cannot transfer tokens directly to the CdpManager or BorrowerOps\"\n303 );", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: contracts/contracts/BorrowerOperations.sol\n\n734 require(\n735 recoveredAddress != address(0) && recoveredAddress == _borrower,\n736 \"BorrowerOperations: Invalid signature\"\n737 );\n\nFile: contracts/contracts/CdpManager.sol\n\n762 require(\n763 _maxFeePercentage >= redemptionFeeFloor && _maxFeePercentage <= DECIMAL_PRECISION,\n764 \"Max fee percentage must be between redemption fee floor and 100%\"\n765 );\n\nFile: contracts/contracts/CdpManagerStorage.sol\n\n261 require(\n262 closedStatus != Status.nonExistent && closedStatus != Status.active,\n263 \"CdpManagerStorage: close non-exist or non-active CDP!\"\n264 );\n\n\n466 require(\n467 cdpStatus != Status.nonExistent && cdpStatus != Status.active,\n468 \"CdpManagerStorage: remove non-exist or non-active CDP!\"\n469 );\n\n653 require(\n654 CdpOwnersArrayLength > 1 && sortedCdps.getSize() > 1,\n655 \"CdpManager: Only one cdp in the system\"\n656 );\n\nFile: contracts/contracts/EBTCToken.sol\n\n296 require(\n297 _recipient != address(0) && _recipient != address(this),\n298 \"EBTC: Cannot transfer tokens directly to the EBTC token contract or the zero address\"\n299 );\n\n\n300 require(\n301 _recipient != cdpManagerAddress && _recipient != borrowerOperationsAddress,\n302 \"EBTC: Cannot transfer tokens directly to the CdpManager or BorrowerOps\"\n303 );", "github_refs_formatted": "BorrowerOperations.sol#L734-L737, CdpManager.sol#L762, CdpManagerStorage.sol#L261", "github_files_list": "BorrowerOperations.sol, CdpManager.sol, CdpManagerStorage.sol", "github_refs_count": 3, "vulnerable_code_actual": "File: contracts/contracts/BorrowerOperations.sol\n\n734 require(\n735 recoveredAddress != address(0) && recoveredAddress == _borrower,\n736 \"BorrowerOperations: Invalid signature\"\n737 );", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/contracts/CdpManager.sol\n\n762 require(\n763 _maxFeePercentage >= redemptionFeeFloor && _maxFeePercentage <= DECIMAL_PRECISION,\n764 \"Max fee percentage must be between redemption fee floor and 100%\"\n765 );", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "01-ondo", "title": "0x1f8b Q", "severity_raw": "Critical", "severity": "critical", "description": "- [Low](#low)\n - [**1. Integer overflow by unsafe casting**](#1-integer-overflow-by-unsafe-casting)\n - [**2. Mixing and Outdated compiler**](#2-mixing-and-outdated-compiler)\n- [Non critical](#non-critical)\n - [**3. Wong naming**](#3-wong-naming)\n - [**4. Lack of checks supportsInterface**](#4-lack-of-checks-supportsinterface)\n - [**5. Avoid hardcoded values**](#5-avoid-hardcoded-values)\n - [**6. Use abstract for base contracts**](#6-use-abstract-for-base-contracts)\n\n# Low\n\n## **1. Integer overflow by unsafe casting**\n\nKeep in mind that the version of solidity used, despite being greater than `0.8`, does not prevent integer overflows during casting, it only does so in mathematical operations.\n\nIt is necessary to safely convert between the different numeric types.\n\n**Recommendation:**\n\nUse a [safeCast](https://docs.openzeppelin.com/contracts/3.x/api/utils#SafeCast) from Open Zeppelin.\n\n```javascript\nreturn uint256(answer) * chainlinkInfo.scaleFactor;\n```\n\n**Affected source code:**\n\n- [OndoPriceOracleV2.sol:300](https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/lending/OndoPriceOracleV2.sol#L300)\n\n\n## **2. Mixing and Outdated compiler**\n\nThe pragma version used are:\n\n```\npragma solidity ^0.5.12;\npragma solidity ^0.5.16;\npragma solidity 0.8.16;\n```\n\nThe minimum required version must be [0.8.17](https://github.com/ethereum/solidity/releases/tag/v0.8.17); otherwise, contracts will be affected by the following **important bug fixes**:\n\n[0.8.17](https://blog.soliditylang.org/2022/09/08/solidity-0.8.17-release-announcement/)\n\n- Yul Optimizer: Prevent the incorrect removal of storage writes before calls to Yul functions that conditionally terminate the external EVM call.\n\nApart from these, there are several minor bug fixes and improvements.\n\n---\n\n# Non critical\n\n## **3. Wong naming**\n\nPublic methods should not use '`_`' before the name. We have an example in [CTokenModified.sol:1063](https://github.com/code-42", "vulnerable_code": "return uint256(answer) * chainlinkInfo.scaleFactor;", "fixed_code": "pragma solidity ^0.5.12;\npragma solidity ^0.5.16;\npragma solidity 0.8.16;", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/0x1f8b-Q.md", "collected_at": "2026-01-02T18:14:19.381529+00:00", "source_hash": "760fdf06c42db0a96773b6fd9d7d8dbf0c98e55a878bb44540452b3b6f274009", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 124, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "return uint256(answer) * chainlinkInfo.scaleFactor;", "primary_code_language": "javascript", "primary_code_char_count": 51, "all_code_blocks": "// Code block 1 (javascript):\nreturn uint256(answer) * chainlinkInfo.scaleFactor;\n\n// Code block 2 (unknown):\npragma solidity ^0.5.12;\npragma solidity ^0.5.16;\npragma solidity 0.8.16;", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "OndoPriceOracleV2.sol#L300", "github_files_list": "OndoPriceOracleV2.sol", "github_refs_count": 1, "vulnerable_code_actual": "return uint256(answer) * chainlinkInfo.scaleFactor;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "pragma solidity ^0.5.12;\npragma solidity ^0.5.16;\npragma solidity 0.8.16;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-ondo", "title": "c3phas G", "severity_raw": "High", "severity": "high", "description": "### Table of contents\n- [FINDINGS](#findings)\n- [Using immutable on variables that are only set in the constructor and never after (2.1k gas per var)](#using-immutable-on-variables-that-are-only-set-in-the-constructor-and-never-after--21k-gas-per-var)\n- [Tighly pack storage variables/optimize the order of variable declaration(Gas Savings: 6k in total)](#tighly-pack-storage-variablesoptimize-the-order-of-variable-declarationgas-savings-6k-in-total)\n - [\\_notEnteredand admin can be packed together (Saves 1 SLOT) `Gas savings: 1 * 2k = 2k`](#_notenteredand--admin-can-be-packed-together-saves-1-slot-gas-savings-1--2k--2k)\n - [\\_notEntered and admin can be packed together (Saves 1 SLOT) `Gas savings: 1 * 2k = 2k`](#_notentered-and-admin-can-be-packed-together-saves-1-slot-gas-savings-1--2k--2k)\n - [\\_notEntered can be packed with an address variable(saves 1 SLOT) `Gas savings: 1 * 2k = 2k`](#_notentered-can-be-packed-with-an-address-variablesaves-1-slot-gas-savings-1--2k--2k)\n- [Massive 15k per tx gas savings - use 1 and 2 for Reentrancy guard](#massive-15k-per-tx-gas-savings---use-1-and-2-for-reentrancy-guard)\n- [The result of a function call should be cached rather than re-calling the function](#the-result-of-a-function-call-should-be-cached-rather-than-re-calling-the-function)\n - [CTokenCash.sol.liquidateBorrowFresh(): getBlockNumber() should be cached](#ctokencashsolliquidateborrowfresh-getblocknumber-should-be-cached)\n - [CTokenModified.sol.liquidateBorrowFresh(): getBlockNumber() should be cached](#ctokenmodifiedsolliquidateborrowfresh-getblocknumber-should-be-cached)\n- [Cache the mapping values rather than fetch it every time](#cache-storage-values-in-memory-to-minimize-sloads)\n - [OndoPriceOracle.sol.getUnderlyingPrice(): fTokenToUnderlyingPrice\\[fToken\\] should be cached](#ondopriceoraclesolgetunderlyingprice-ftokentounderlyingpriceftoken-should-be-cached)\n - [OndoPriceOracleV2.sol.getUnderlyingPrice(): fTokenToUnderlyingPriceCap\\[fToken\\] should be cac", "vulnerable_code": "File: /contracts/lending/JumpRateModelV2.sol\n24: address public owner;", "fixed_code": "## Tighly pack storage variables/optimize the order of variable declaration(Gas Savings: 6k in total)\n\nHere, the storage variables can be tightly packed to save some slots\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/lending/tokens/cCash/CTokenInterfacesModifiedCash.sol#L13-L48\n### \\_notEnteredand admin can be packed together (Saves 1 SLOT) `Gas savings: 1 * 2k = 2k`\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/c3phas-G.md", "collected_at": "2026-01-02T18:14:57.838686+00:00", "source_hash": "7653c8472a27a2473fdebd6fc484e734a08b41c8276f32988e62a2bc9b04fcef", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CTokenInterfacesModifiedCash.sol#L13-L48", "github_files_list": "CTokenInterfacesModifiedCash.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: /contracts/lending/JumpRateModelV2.sol\n24: address public owner;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## Tighly pack storage variables/optimize the order of variable declaration(Gas Savings: 6k in total)\n\nHere, the storage variables can be tightly packed to save some slots\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/lending/tokens/cCash/CTokenInterfacesModifiedCash.sol#L13-L48\n### \\_notEnteredand admin can be packed together (Saves 1 SLOT) `Gas savings: 1 * 2k = 2k`\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-biconomy", "title": "SaharDevep G", "severity_raw": "High", "severity": "high", "description": "# c4udit Report\n\n\n### Summery\n[G001] Don't Initialize Variables with Default Value\n[G002] Cache Array Length Outside of Loop\n[G003] Use != 0 instead of > 0 for Unsigned Integer Comparison\n[G004] Use immutable for OpenZeppelin AccessControl's Roles Declarations\n[G005] Long Revert Strings\n[G006] Use Shift Right/Left instead of Division/Multiplication if possible\n[G007] TIGHT VARIABLE PACKING\n[G008] MULTIPLE ACCESSES OF A MAPPING/ARRAY SHOULD USE A LOCAL VARIABLE CACHE\n[G009] STATE VARIABLES ONLY SET IN THE CONSTRUCTOR SHOULD BE DECLARED IMMUTABLE\n[G010] USING PRIVATE RATHER THAN PUBLIC FOR CONSTANTS, SAVES GAS\n[G011] USE CUSTOM ERRORS RATHER THAN REVERT()/REQUIRE() STRINGS TO SAVE GAS\n[G012] ABI.ENCODE() IS LESS EFFICIENT THAN ABI.ENCODEPACKED()\n[G013] INLINE THE MODIFIER THAT IS USED ONCE\n[G014] NOT USING THE NAMED RETURN VARIABLES WHEN A FUNCTION RETURNS, WASTES DEPLOYMENT GAS\n\n## Issues found\n\n### [G001] Don't Initialize Variables with Default Value\n\n#### Impact\nIssue Information: (https://github.com/byterocket/c4-common-issues/blob/main/0-Gas-Optimizations.md#g001---dont-initialize-variables-with-default-value)\n\n#### Findings:\n```\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::234 => uint256 payment = 0;\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::310 => uint256 i = 0;\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::468 => for (uint i = 0; i < dest.length;) {\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::74 => for (uint256 i = 0; i < opslen; i++) {\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::78 => uint256 collected = 0;\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::80 => for (uint256 i = 0; i < opslen; i++) {\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::99 => uint256 totalOps = 0;\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::100 => for (uint256 i = 0; i < opasLen; i", "vulnerable_code": "scw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::234 => uint256 payment = 0;\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::310 => uint256 i = 0;\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::468 => for (uint i = 0; i < dest.length;) {\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::74 => for (uint256 i = 0; i < opslen; i++) {\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::78 => uint256 collected = 0;\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::80 => for (uint256 i = 0; i < opslen; i++) {\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::99 => uint256 totalOps = 0;\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::100 => for (uint256 i = 0; i < opasLen; i++) {\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::106 => uint256 opIndex = 0;\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::107 => for (uint256 a = 0; a < opasLen; a++) {\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::112 => for (uint256 i = 0; i < opslen; i++) {\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::126 => uint256 collected = 0;\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::128 => for (uint256 a = 0; a < opasLen; a++) {\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::134 => for (uint256 i = 0; i < opslen; i++) {\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::313 => uint256 missingAccountFunds = 0;\nscw-contracts\\contracts\\smart-contract-wallet\\base\\ModuleManager.sol::119 => uint256 moduleCount = 0;", "fixed_code": "scw-contracts\\contracts\\smart-contract-wallet\\BaseSmartAccount.sol::64 => if (userOp.initCode.length == 0) {\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::199 => // ~= 21k + calldata.length * [1/3 * 16 + 2/3 * 4]\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::200 => uint256 startGas = gasleft() + 21000 + msg.data.length * 8;\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::201 => //console.log(\"init %s\", 21000 + msg.data.length * 8);\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::324 => // Check that signature data pointer (s) is in bounds (points to the length of data -> 32 bytes)\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::325 => require(uint256(s) + 32 <= signatures.length, \"BSA022\");\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::327 => // Check if the contract signature is in bounds: start of data is s + 32 and end is start + signature length\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::333 => require(uint256(s) + 32 + contractSignatureLen <= signatures.length, \"BSA023\");\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::467 => require(dest.length == func.length, \"wrong array lengths\");\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::468 => for (uint i = 0; i < dest.length;) {\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::70 => uint256 opslen = ops.length;\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::98 => uint256 opasLen = opsPerAggregator.length;\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::101 => totalOps += opsPerAggregator[i].userOps.length;\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::111 => uint256 opslen = ops.length;\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::132 => uint256 opslen = ops.length;\nscw-contracts\\contracts\\smart-contract-wallet\\aa-", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/SaharDevep-G.md", "collected_at": "2026-01-02T18:13:17.932824+00:00", "source_hash": "7707d77f503045c44a54c21f46451e185b86c3d52c21f60fde00caed92c2aa70", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "scw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::234 => uint256 payment = 0;\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::310 => uint256 i = 0;\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::468 => for (uint i = 0; i < dest.length;) {\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::74 => for (uint256 i = 0; i < opslen; i++) {\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::78 => uint256 collected = 0;\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::80 => for (uint256 i = 0; i < opslen; i++) {\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::99 => uint256 totalOps = 0;\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::100 => for (uint256 i = 0; i < opasLen; i++) {\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::106 => uint256 opIndex = 0;\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::107 => for (uint256 a = 0; a < opasLen; a++) {\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::112 => for (uint256 i = 0; i < opslen; i++) {\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::126 => uint256 collected = 0;\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::128 => for (uint256 a = 0; a < opasLen; a++) {\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::134 => for (uint256 i = 0; i < opslen; i++) {\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::313 => uint256 missingAccountFunds = 0;\nscw-contracts\\contracts\\smart-contract-wallet\\base\\ModuleManager.sol::119 => uint256 moduleCount = 0;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "scw-contracts\\contracts\\smart-contract-wallet\\BaseSmartAccount.sol::64 => if (userOp.initCode.length == 0) {\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::199 => // ~= 21k + calldata.length * [1/3 * 16 + 2/3 * 4]\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::200 => uint256 startGas = gasleft() + 21000 + msg.data.length * 8;\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::201 => //console.log(\"init %s\", 21000 + msg.data.length * 8);\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::324 => // Check that signature data pointer (s) is in bounds (points to the length of data -> 32 bytes)\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::325 => require(uint256(s) + 32 <= signatures.length, \"BSA022\");\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::327 => // Check if the contract signature is in bounds: start of data is s + 32 and end is start + signature length\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::333 => require(uint256(s) + 32 + contractSignatureLen <= signatures.length, \"BSA023\");\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::467 => require(dest.length == func.length, \"wrong array lengths\");\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::468 => for (uint i = 0; i < dest.length;) {\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::70 => uint256 opslen = ops.length;\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::98 => uint256 opasLen = opsPerAggregator.length;\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::101 => totalOps += opsPerAggregator[i].userOps.length;\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::111 => uint256 opslen = ops.length;\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::132 => uint256 opslen = ops.length;\nscw-contracts\\contracts\\smart-contract-wallet\\aa-", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "05-ajna", "title": "hunter_w3b G", "severity_raw": "Medium", "severity": "medium", "description": "## Summary\n\n### Gas Optimizations\n\n| | Issue | Instances | Total Gas Saved |\n| ------------- | :----------------------------------------------------------------------------------------------------------- | :-------: | :-------------: |\n| [G‑01] | Avoid `contract existence` checks by using solidity version 0.8.10 or later | 27 | 2700 |\n| [G‑02] | Expressions for `constant` values such as a call to `keccak256()`, should use immutable rather than constant | 2 | - |\n| [G‑03] | Use solidity version `0.8.19` to gain some gas boost | 11 | 968 |\n| [G‑04] | \u00a0` += `\u00a0costes more gas than` = + `\u00a0for state variables | 7 | 791 |\n| [G‑05] | Not using the named return variables when a function `returns` , wastes deployment gas | 51 | |\n| [G‑06] | Can make the `variable` outside the loop to save gas | 9 | - |\n| [G‑07] | Using `calldata` instead of `memory` for read-only arguments in external functions save gas | 37 | 4440 |\n| [G‑08] | Use `assembly` to check for `address(0)` | 1 | - |\n| [G‑09] | Before some functions, we should `check` some variables for possible gas save | 7 | - |\n| [G‑10] | Using `bools` for storage incurs overhead | 4 | 68400 |\n| [G‑11] | The result of function `calls` should b", "vulnerable_code": "File: /ajna-core/src/PositionManager.sol\n\n/// @audit updateInterest()\n274 IPool(params_.pool).updateInterest();\n\n/// @audit bucketInfo()\n282 ) = IPool(params_.pool).bucketInfo(params_.fromIndex);\n\n/// @audit moveQuoteToken()\n310 ) = IPool(params_.pool).moveQuoteToken(\n\n/// @audit collateralAddress()\n420 = IPool(pool_).collateralAddress();\n\n/// @audit quoteTokenAddress()\n421 = IPool(pool_).quoteTokenAddress();\n\n/// @audit deployedPools()\n423 = erc20PoolFactory.deployedPools(subsetHash_, collateralAddress, quoteAddress);\n\n/// @audit deployedPools()\n424 = erc721PoolFactory.deployedPools(subsetHash_, collateralAddress, quoteAddress);", "fixed_code": "File: /ajna-core/src/RewardsManager.sol\n\n\n/// @audit currentBurnEpoch()\n150 = IPool(ajnaPool).currentBurnEpoch();\n\n/// @audit bucketExchangeRate()\n180 = uint128(IPool(ajnaPool).bucketExchangeRate(toIndex));\n\n/// @audit ownerOf()\n213 if (IERC721(address(positionManager)).ownerOf(tokenId_) != msg.sender)\n\n/// @audit currentBurnEpoch()\n219 = IPool(ajnaPool).currentBurnEpoch();\n\n/// @audit bucketExchangeRate()\n241 = uint128(IPool(ajnaPool).bucketExchangeRate(bucketId));\n\n/// @audit transferFrom()\n250 IERC721(address(positionManager)).transferFrom(msg.sender, address(this), tokenId_);\n\n/// @audit currentBurnEpoch()\n283 IPool(ajnaPool).currentBurnEpoch(),\n\n/// @audit transferFrom()\n302 IERC721(address(positionManager)).transferFrom(address(this), msg.sender, tokenId_);\n\n/// @audit currentBurnEpoch()\n570 if (validateEpoch_ && epochToClaim_ > IPool(ajnaPool_).currentBurnEpoch())\n\n/// @audit burnInfo()\n645 ) = IPool(pool_).burnInfo(currentBurnEventEpoch_);\n\n/// @audit burnInfo()\n651 ) = IPool(pool_).burnInfo(lastBurnEventEpoch_);\n\n/// @audit currentBurnEpoch()\n676 = IPool(pool_).currentBurnEpoch();\n\n/// @audit bucketExchangeRate()\n752 = IPool(pool_).bucketExchangeRate(bucketIndex_);\n\n/// @audit bucketExchangeRate()\n779 = IPool(pool_).bucketExchangeRate(bucketIndex_);\n\n/// @audit bucketInfo()\n792 (, , , uint256 bucketDeposit, ) = IPool(pool_).bucketInfo(bucketIndex_);\n\n/// @audit balanceOf()\n814 = IERC20(ajnaToken).balanceOf(address(this));\n\n/// @audit safeTransfer()\n819 IERC20(ajnaToken).safeTransfer(msg.sender, rewardsEarned_);", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/hunter_w3b-G.md", "collected_at": "2026-01-02T18:21:29.845261+00:00", "source_hash": "773358cf29347603a0fcbf1b7627f9ae0915ba3b063b01250114f645152ef656", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: /ajna-core/src/PositionManager.sol\n\n/// @audit updateInterest()\n274 IPool(params_.pool).updateInterest();\n\n/// @audit bucketInfo()\n282 ) = IPool(params_.pool).bucketInfo(params_.fromIndex);\n\n/// @audit moveQuoteToken()\n310 ) = IPool(params_.pool).moveQuoteToken(\n\n/// @audit collateralAddress()\n420 = IPool(pool_).collateralAddress();\n\n/// @audit quoteTokenAddress()\n421 = IPool(pool_).quoteTokenAddress();\n\n/// @audit deployedPools()\n423 = erc20PoolFactory.deployedPools(subsetHash_, collateralAddress, quoteAddress);\n\n/// @audit deployedPools()\n424 = erc721PoolFactory.deployedPools(subsetHash_, collateralAddress, quoteAddress);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: /ajna-core/src/RewardsManager.sol\n\n\n/// @audit currentBurnEpoch()\n150 = IPool(ajnaPool).currentBurnEpoch();\n\n/// @audit bucketExchangeRate()\n180 = uint128(IPool(ajnaPool).bucketExchangeRate(toIndex));\n\n/// @audit ownerOf()\n213 if (IERC721(address(positionManager)).ownerOf(tokenId_) != msg.sender)\n\n/// @audit currentBurnEpoch()\n219 = IPool(ajnaPool).currentBurnEpoch();\n\n/// @audit bucketExchangeRate()\n241 = uint128(IPool(ajnaPool).bucketExchangeRate(bucketId));\n\n/// @audit transferFrom()\n250 IERC721(address(positionManager)).transferFrom(msg.sender, address(this), tokenId_);\n\n/// @audit currentBurnEpoch()\n283 IPool(ajnaPool).currentBurnEpoch(),\n\n/// @audit transferFrom()\n302 IERC721(address(positionManager)).transferFrom(address(this), msg.sender, tokenId_);\n\n/// @audit currentBurnEpoch()\n570 if (validateEpoch_ && epochToClaim_ > IPool(ajnaPool_).currentBurnEpoch())\n\n/// @audit burnInfo()\n645 ) = IPool(pool_).burnInfo(currentBurnEventEpoch_);\n\n/// @audit burnInfo()\n651 ) = IPool(pool_).burnInfo(lastBurnEventEpoch_);\n\n/// @audit currentBurnEpoch()\n676 = IPool(pool_).currentBurnEpoch();\n\n/// @audit bucketExchangeRate()\n752 = IPool(pool_).bucketExchangeRate(bucketIndex_);\n\n/// @audit bucketExchangeRate()\n779 = IPool(pool_).bucketExchangeRate(bucketIndex_);\n\n/// @audit bucketInfo()\n792 (, , , uint256 bucketDeposit, ) = IPool(pool_).bucketInfo(bucketIndex_);\n\n/// @audit balanceOf()\n814 = IERC20(ajnaToken).balanceOf(address(this));\n\n/// @audit safeTransfer()\n819 IERC20(ajnaToken).safeTransfer(msg.sender, rewardsEarned_);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "04-caviar", "title": "LewisBroadhurst G", "severity_raw": "High", "severity": "high", "description": "## Gas Optimisations\n\n### [G-01]\n\nIf statements are made throughout the code base to perform important checks. Instead of using if statements, we can make use of the `require` function to perform the same checks. Modest gas saving that adds up over time.\n\n```\n// Example\n\n- if (initialized) revert AlreadyInitialized();\n\n+ require(!initialized, AlreadyInitialized());\n```\n\nIt will also make the code more readable for the indented code.\n\nInfractions found:\n1. PrivatePool.sol\n - ln 170: if (initialized) revert AlreadyInitialized();\n - ln 173: if (_feeRate > 5_000) revert FeeRateTooHigh();\n - ln 226: if (baseToken != address(0) && msg.value > 0) revert InvalidEthAmount();\n - ln 263: if (msg.value < netInputAmount) revert InvalidEthAmount();\n - ln 398: if (baseToken != address(0) && msg.value > 0) revert InvalidEthAmount();\n - ln 414: if (inputWeightSum < outputWeightSum) revert InsufficientInputWeight();\n - ln 565: if (newFeeRate > 5_000) revert FeeRateTooHigh();\n - ln 630: if (!availableForFlashLoan(token, tokenId)) revert NotAvailableForFlashLoan();\n - ln 636: if (baseToken == address(0) && msg.value < fee) revert InvalidEthAmount();\n - ln 646: if (!success) revert FlashLoanFailed();\n - ln 683: if (!MerkleProofLib.verifyMultiProof(proof.proof, merkleRoot, leafs, proof.flags)...\n - ln 793: if (royaltyFee > salePrice) revert InvalidRoyaltyFee();\n\n2. EthRouter.sol\n - ln 101: if (block.timestamp > deadline && deadline != 0)... \n - ln 154: if (block.timestamp > deadline && deadline != 0)...\n - ln 203: if (address(this).balance < minOutputAmount)...\n - ln 234: if (price > maxPrice || price < minPrice)...\n - ln 256: if (block.timestamp > deadline && deadline != 0)...\n - ln 314: if (royaltyFee > salePrice) revert InvalidRoyaltyFee();", "vulnerable_code": "// Example\n\n- if (initialized) revert AlreadyInitialized();\n\n+ require(!initialized, AlreadyInitialized());", "fixed_code": "", "recommendation": "", "category": "flash-loan", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/LewisBroadhurst-G.md", "collected_at": "2026-01-02T18:19:48.922309+00:00", "source_hash": "774d5538c612476895dc510dc6c5ddc9f66dab8bb534b5ec2292081e3e952a6a", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 107, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "// Example\n\n- if (initialized) revert AlreadyInitialized();\n\n+ require(!initialized, AlreadyInitialized());", "primary_code_language": "unknown", "primary_code_char_count": 107, "all_code_blocks": "// Code block 1 (unknown):\n// Example\n\n- if (initialized) revert AlreadyInitialized();\n\n+ require(!initialized, AlreadyInitialized());", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "// Example\n\n- if (initialized) revert AlreadyInitialized();\n\n+ require(!initialized, AlreadyInitialized());", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "01-biconomy", "title": "MalfurionWhitehat Q", "severity_raw": "High", "severity": "high", "description": "# 1. Use `block.chainid` on `SmartAccount.getChainId`\n\nThe use of inline assembly is unnecessary here:\n\n```diff\ndiff --git a/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol b/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\nindex c4f69a8..928c16a 100644\n--- a/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n+++ b/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n@@ -138,12 +138,7 @@ contract SmartAccount is\n \n /// @dev Returns the chain id used by this contract.\n function getChainId() public view returns (uint256) {\n- uint256 id;\n- // solhint-disable-next-line no-inline-assembly\n- assembly {\n- id := chainid()\n- }\n- return id;\n+ return block.chainid;\n }\n \n //@review getNonce specific to EntryPoint requirements\n\n```\n\n# 2. Do not use `tx.origin` for testing purposes on `SmartAccount._validateSignature`. Instead, create a mock implementation that overrides this method and bypasses any necessary signature validation.\n\nMixing testing and deployment code will unnecessarily introduce dead code on production contracts and will make hinder maintainability.\n\n```diff\ndiff --git a/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol b/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\nindex c4f69a8..78e960b 100644\n--- a/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n+++ b/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n@@ -508,7 +508,7 @@ contract SmartAccount is\n bytes32 hash = userOpHash.toEthSignedMessageHash();\n //ignore signature mismatch of from==ZERO_ADDRESS (for eth_callUserOp validation purposes)\n // solhint-disable-next-line avoid-tx-origin\n- require(owner == hash.recover(userOp.signature) || tx.origin == address(0), \"account: wrong signature\");\n+ require(owner == hash.recover(userOp.signature), \"account: wrong signature\");\n return 0;\n }\n \n``` \n", "vulnerable_code": "# 2. Do not use `tx.origin` for testing purposes on `SmartAccount._validateSignature`. Instead, create a mock implementation that overrides this method and bypasses any necessary signature validation.\n\nMixing testing and deployment code will unnecessarily introduce dead code on production contracts and will make hinder maintainability.\n", "fixed_code": "# 3. Emit events on important state variable changing operations: `VerifyingSingletonPaymaster.setSigner`\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/MalfurionWhitehat-Q.md", "collected_at": "2026-01-02T18:13:11.176839+00:00", "source_hash": "7769407c0fb25f5e955360be8d8a0a737c27a4b55ffe3ef62b77e799f1da90dc", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 1526, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "diff --git a/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol b/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\nindex c4f69a8..928c16a 100644\n--- a/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n+++ b/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n@@ -138,12 +138,7 @@ contract SmartAccount is\n \n /// @dev Returns the chain id used by this contract.\n function getChainId() public view returns (uint256) {\n- uint256 id;\n- // solhint-disable-next-line no-inline-assembly\n- assembly {\n- id := chainid()\n- }\n- return id;\n+ return block.chainid;\n }\n \n //@review getNonce specific to EntryPoint requirements", "primary_code_language": "diff", "primary_code_char_count": 731, "all_code_blocks": "// Code block 1 (diff):\ndiff --git a/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol b/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\nindex c4f69a8..928c16a 100644\n--- a/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n+++ b/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n@@ -138,12 +138,7 @@ contract SmartAccount is\n \n /// @dev Returns the chain id used by this contract.\n function getChainId() public view returns (uint256) {\n- uint256 id;\n- // solhint-disable-next-line no-inline-assembly\n- assembly {\n- id := chainid()\n- }\n- return id;\n+ return block.chainid;\n }\n \n //@review getNonce specific to EntryPoint requirements\n\n// Code block 2 (diff):\ndiff --git a/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol b/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\nindex c4f69a8..78e960b 100644\n--- a/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n+++ b/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n@@ -508,7 +508,7 @@ contract SmartAccount is\n bytes32 hash = userOpHash.toEthSignedMessageHash();\n //ignore signature mismatch of from==ZERO_ADDRESS (for eth_callUserOp validation purposes)\n // solhint-disable-next-line avoid-tx-origin\n- require(owner == hash.recover(userOp.signature) || tx.origin == address(0), \"account: wrong signature\");\n+ require(owner == hash.recover(userOp.signature), \"account: wrong signature\");\n return 0;\n }", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "diff --git a/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol b/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\nindex c4f69a8..928c16a 100644\n--- a/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n+++ b/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n@@ -138,12 +138,7 @@ contract SmartAccount is\n \n /// @dev Returns the chain id used by this contract.\n function getChainId() public view returns (uint256) {\n- uint256 id;\n- // solhint-disable-next-line no-inline-assembly\n- assembly {\n- id := chainid()\n- }\n- return id;\n+ return block.chainid;\n }\n \n //@review getNonce specific to EntryPoint requirements\n\ndiff --git a/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol b/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\nindex c4f69a8..78e960b 100644\n--- a/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n+++ b/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n@@ -508,7 +508,7 @@ contract SmartAccount is\n bytes32 hash = userOpHash.toEthSignedMessageHash();\n //ignore signature mismatch of from==ZERO_ADDRESS (for eth_callUserOp validation purposes)\n // solhint-disable-next-line avoid-tx-origin\n- require(owner == hash.recover(userOp.signature) || tx.origin == address(0), \"account: wrong signature\");\n+ require(owner == hash.recover(userOp.signature), \"account: wrong signature\");\n return 0;\n }", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "# 2. Do not use `tx.origin` for testing purposes on `SmartAccount._validateSignature`. Instead, create a mock implementation that overrides this method and bypasses any necessary signature validation.\n\nMixing testing and deployment code will unnecessarily introduce dead code on production contracts and will make hinder maintainability.\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "# 3. Emit events on important state variable changing operations: `VerifyingSingletonPaymaster.setSigner`\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "02-ai-arena", "title": "Daniel526 Q", "severity_raw": "Unknown", "severity": "unknown", "description": "A. Inconsistent State Update in pickWinner Function\n[#L118-L132](https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/MergingPool.sol#L118-L132)\n- The `pickWinner` function is designed to select winners for the current round based on the provided list of token IDs (winners array). However, it lacks proper validation to ensure that the winners array is not empty. As a result, if the function is called with an empty array of `winners`, it proceeds to update the `isSelectionComplete` flag to `true` for the current round, indicating that `winners` have been selected. This behavior occurs regardless of whether any `winners` have actually been chosen, leading to an inconsistent state in the contract.\n## Impact:\nThe impact of this vulnerability is that the contract state becomes inconsistent, as it indicates that winners have been selected for the current round even though no winners have actually been chosen. This inconsistency could confuse users and disrupt the normal operation of the merging pool.\n## Mitigation:\n```solidity\nfunction pickWinner(uint256[] calldata winners) external {\n require(isAdmin[msg.sender]);\n require(winners.length == winnersPerPeriod, \"Incorrect number of winners\");\n require(!isSelectionComplete[roundId], \"Winners are already selected\");\n require(winners.length > 0, \"Winners array cannot be empty\"); // Validation to ensure winners array is not empty\n\n isSelectionComplete[roundId] = true;\n roundId += 1;\n}\n\n```", "vulnerable_code": "function pickWinner(uint256[] calldata winners) external {\n require(isAdmin[msg.sender]);\n require(winners.length == winnersPerPeriod, \"Incorrect number of winners\");\n require(!isSelectionComplete[roundId], \"Winners are already selected\");\n require(winners.length > 0, \"Winners array cannot be empty\"); // Validation to ensure winners array is not empty\n\n isSelectionComplete[roundId] = true;\n roundId += 1;\n}\n", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/Daniel526-Q.md", "collected_at": "2026-01-02T19:02:21.697810+00:00", "source_hash": "77731b93c36c8c25b4b3e9c2638bf768a5ea83855eac4e5d7b13eecfffe8c2b6", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 427, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function pickWinner(uint256[] calldata winners) external {\n require(isAdmin[msg.sender]);\n require(winners.length == winnersPerPeriod, \"Incorrect number of winners\");\n require(!isSelectionComplete[roundId], \"Winners are already selected\");\n require(winners.length > 0, \"Winners array cannot be empty\"); // Validation to ensure winners array is not empty\n\n isSelectionComplete[roundId] = true;\n roundId += 1;\n}", "primary_code_language": "solidity", "primary_code_char_count": 427, "all_code_blocks": "// Code block 1 (solidity):\nfunction pickWinner(uint256[] calldata winners) external {\n require(isAdmin[msg.sender]);\n require(winners.length == winnersPerPeriod, \"Incorrect number of winners\");\n require(!isSelectionComplete[roundId], \"Winners are already selected\");\n require(winners.length > 0, \"Winners array cannot be empty\"); // Validation to ensure winners array is not empty\n\n isSelectionComplete[roundId] = true;\n roundId += 1;\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function pickWinner(uint256[] calldata winners) external {\n require(isAdmin[msg.sender]);\n require(winners.length == winnersPerPeriod, \"Incorrect number of winners\");\n require(!isSelectionComplete[roundId], \"Winners are already selected\");\n require(winners.length > 0, \"Winners array cannot be empty\"); // Validation to ensure winners array is not empty\n\n isSelectionComplete[roundId] = true;\n roundId += 1;\n}", "github_refs_formatted": "MergingPool.sol#L118-L132", "github_files_list": "MergingPool.sol", "github_refs_count": 1, "vulnerable_code_actual": "function pickWinner(uint256[] calldata winners) external {\n require(isAdmin[msg.sender]);\n require(winners.length == winnersPerPeriod, \"Incorrect number of winners\");\n require(!isSelectionComplete[roundId], \"Winners are already selected\");\n require(winners.length > 0, \"Winners array cannot be empty\"); // Validation to ensure winners array is not empty\n\n isSelectionComplete[roundId] = true;\n roundId += 1;\n}\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "01-biconomy", "title": "cryptostellar5 G", "severity_raw": "High", "severity": "high", "description": "\n### G-01 ++I or I++ SHOULD BE UNCHECKED{++I} or UNCHECKED{I++} WHEN IT IS NOT POSSIBLE FOR THEM TO OVERFLOW, AS IS THE CASE WHEN USED IN FOR- AND WHILE-LOOPS\n\n*Number of Instances Identified: 5*\n\nThe\u00a0`unchecked`\u00a0keyword is new in solidity version 0.8.0, so this only applies to that version or higher, which these instances are. This saves\u00a0**30-40 gas\u00a0[per loop](https://gist.github.com/hrkrshnn/ee8fabd532058307229d65dcd5836ddc#the-increment-in-for-loop-post-condition-can-be-made-unchecked)**.\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol\n\n```\n100: for (uint256 i = 0; i < opasLen; i++)\n107: for (uint256 a = 0; a < opasLen; a++)\n112: for (uint256 i = 0; i < opslen; i++)\n128: for (uint256 a = 0; a < opasLen; a++)\n134: for (uint256 i = 0; i < opslen; i++)\n```\n\n\n### G-02 SPLITTING REQUIRE() STATEMENTS THAT USE && SAVES GAS\n\n*Number of Instances Identified: 3*\n\nSee\u00a0[this issue](https://github.com/code-423n4/2022-01-xdefi-findings/issues/128)\u00a0which describes the fact that there is a larger deployment gas cost, but with enough runtime calls, the change ends up being cheaper by\u00a0**3 gas**\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/base/ModuleManager.sol\n\n```\n34: require(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");\n49: require(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");\n68: require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \"BSA104\");\n```\n\n\n### G-03 X += Y COSTS MORE GAS THAN X = X + Y FOR STATE VARIABLES\n\n*Number of Instances Identified: 28*\n\nUsing the addition operator instead of plus-equals saves **[113 gas](https://gist.github.com/IllIllI000/cbbfb267425b898e5be734d4008d4fe8)**\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol\n\n```\n81: collected += _executeUserOp(i, ops[i], opInfos[i]);\n1", "vulnerable_code": "100: for (uint256 i = 0; i < opasLen; i++)\n107: for (uint256 a = 0; a < opasLen; a++)\n112: for (uint256 i = 0; i < opslen; i++)\n128: for (uint256 a = 0; a < opasLen; a++)\n134: for (uint256 i = 0; i < opslen; i++)", "fixed_code": "34: require(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");\n49: require(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");\n68: require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \"BSA104\");", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/cryptostellar5-G.md", "collected_at": "2026-01-02T18:13:38.232714+00:00", "source_hash": "7778d89eb8ab728fd4d3865ec4491bf41d74ba971b6c4da9431aae18c27754a1", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 453, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "100: for (uint256 i = 0; i < opasLen; i++)\n107: for (uint256 a = 0; a < opasLen; a++)\n112: for (uint256 i = 0; i < opslen; i++)\n128: for (uint256 a = 0; a < opasLen; a++)\n134: for (uint256 i = 0; i < opslen; i++)", "primary_code_language": "unknown", "primary_code_char_count": 212, "all_code_blocks": "// Code block 1 (unknown):\n100: for (uint256 i = 0; i < opasLen; i++)\n107: for (uint256 a = 0; a < opasLen; a++)\n112: for (uint256 i = 0; i < opslen; i++)\n128: for (uint256 a = 0; a < opasLen; a++)\n134: for (uint256 i = 0; i < opslen; i++)\n\n// Code block 2 (unknown):\n34: require(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");\n49: require(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");\n68: require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \"BSA104\");", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "EntryPoint.sol, ModuleManager.sol", "github_files_list": "ModuleManager.sol, EntryPoint.sol", "github_refs_count": 2, "vulnerable_code_actual": "100: for (uint256 i = 0; i < opasLen; i++)\n107: for (uint256 a = 0; a < opasLen; a++)\n112: for (uint256 i = 0; i < opslen; i++)\n128: for (uint256 a = 0; a < opasLen; a++)\n134: for (uint256 i = 0; i < opslen; i++)", "has_vulnerable_code_snippet": true, "fixed_code_actual": "34: require(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");\n49: require(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");\n68: require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \"BSA104\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "03-asymmetry", "title": "hunter_w3b G", "severity_raw": "Medium", "severity": "medium", "description": "# Gas Optimization\n\n# Summary\n\n| Number | Optimization Details | Context |\n| :----: | :---------------------------------------------------------------------------------- | :-----: |\n| [G-01] | FUNCTIONS GUARANTEED TO REVERT WHEN CALLED BY NORMAL USERS CAN BE MARKED\u00a0PAYABLE | 14 |\n| [G-02] | PUBLIC FUNCTIONS NOT CALLED BY THE CONTRACT SHOULD BE DECLARED EXTERNAL INSTEAD | 8 |\n| [G-03] | SETTING THE\u00a0CONSTRUCTOR TO PAYABLE | 4 |\n| [G-04] | NOT USING THE NAMED RETURN VARIABLES WHEN A FUNCTION RETURNS, WASTES DEPLOYMENT GAS | 1 |\n| [G-05] | CAN MAKE THE VARIABLE OUTSIDE THE LOOP TO SAVE GAS | 2 |\n| [G-06] | The result of function calls should be cached rather than re-calling the function | 2 |\n| [G-07] | Duplicated require() checks should be refactored to a modifier or function | 1 |\n| [G-08] | With assembly, .call (bool success) transfer can be done gas-optimized | 5 |\n\n## [G-01]\u00a0FUNCTIONS GUARANTEED TO REVERT WHEN CALLED BY NORMAL USERS CAN BE MARKED\u00a0PAYABLE\n\n### Summary\n\nThe onlyOwner modifier\u00a0makes a function revert if not called by the address registered as the owner\n\n### Details\n\nThere are **14** instances of this issue.\n\n### Github Permalinks\n\n```solidity\nFile: /SafEth/derivatives/WstEth.sol\n\n48 function setMaxSlippage(uint256 _slippage) external onlyOwner {\n\n56 function withdraw(uint256 _amount) external onlyOwner {\n```\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol\n\n```solidity\nFile: /SafEth/derivatives/SfrxEth.sol\n\n51 function setMaxSlippage(uint256 _slippage) external onlyOwner {\n\n60 function withdraw(uint256 _amount) external onlyOwner {\n```\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol\n\n```solidity\nFile: /SafEth/SafEth.sol", "vulnerable_code": "File: /SafEth/derivatives/WstEth.sol\n\n48 function setMaxSlippage(uint256 _slippage) external onlyOwner {\n\n56 function withdraw(uint256 _amount) external onlyOwner {", "fixed_code": "File: /SafEth/derivatives/SfrxEth.sol\n\n51 function setMaxSlippage(uint256 _slippage) external onlyOwner {\n\n60 function withdraw(uint256 _amount) external onlyOwner {", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/hunter_w3b-G.md", "collected_at": "2026-01-02T18:19:12.004443+00:00", "source_hash": "778b0772843eb02d590e6e1a3e45f32439c059884e6033e647e2e45787973a1f", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 342, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: /SafEth/derivatives/WstEth.sol\n\n48 function setMaxSlippage(uint256 _slippage) external onlyOwner {\n\n56 function withdraw(uint256 _amount) external onlyOwner {", "primary_code_language": "solidity", "primary_code_char_count": 171, "all_code_blocks": "// Code block 1 (solidity):\nFile: /SafEth/derivatives/WstEth.sol\n\n48 function setMaxSlippage(uint256 _slippage) external onlyOwner {\n\n56 function withdraw(uint256 _amount) external onlyOwner {\n\n// Code block 2 (solidity):\nFile: /SafEth/derivatives/SfrxEth.sol\n\n51 function setMaxSlippage(uint256 _slippage) external onlyOwner {\n\n60 function withdraw(uint256 _amount) external onlyOwner {", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: /SafEth/derivatives/WstEth.sol\n\n48 function setMaxSlippage(uint256 _slippage) external onlyOwner {\n\n56 function withdraw(uint256 _amount) external onlyOwner {\n\nFile: /SafEth/derivatives/SfrxEth.sol\n\n51 function setMaxSlippage(uint256 _slippage) external onlyOwner {\n\n60 function withdraw(uint256 _amount) external onlyOwner {", "github_refs_formatted": "WstEth.sol, SfrxEth.sol", "github_files_list": "SfrxEth.sol, WstEth.sol", "github_refs_count": 2, "vulnerable_code_actual": "File: /SafEth/derivatives/WstEth.sol\n\n48 function setMaxSlippage(uint256 _slippage) external onlyOwner {\n\n56 function withdraw(uint256 _amount) external onlyOwner {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: /SafEth/derivatives/SfrxEth.sol\n\n51 function setMaxSlippage(uint256 _slippage) external onlyOwner {\n\n60 function withdraw(uint256 _amount) external onlyOwner {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "02-ai-arena", "title": "7ashraf Q", "severity_raw": "Low", "severity": "low", "description": "# Quality Assurance Report\n\n## Summary\nThe QA report flags important issues and offers fixes for better project performance and security. It advises against accidentally adding new fighter types and stresses the importance of checking for existing stakeholders. It also notes potential security risks like unbounded loops and missing reentrancy locks. Recommendations include avoiding hardcoded values and simplifying complex functions for clearer code. Following these suggestions will enhance the project's overall quality and security.\n\n| Issue Number | Issue Title | Number of Instances |\n|--------------|--------------------------------------------------------------------------------------------------|---------------------|\n| L-01 | More Fighter types can be added by mistake | 1 |\n| L-02 | Check if staker already exists before adding | 1 |\n| L-03 | Possible dos for unbounded loop | 1 |\n| L-04 | Require `amount` to be greater than zero | 1 |\n| L-05 | Add re-entrance lock | 2 |\n| N-01 | Empty string is passed to the function, avoid hardcoded empty strings | 1 |\n| N-02 | Save String as a constant instead of hardcoding it in the function | 3 |\n| N-03 | Function should be allowed to be called only once | 1 |\n| N-04 | Avoid on-chain computation ", "vulnerable_code": " function incrementGeneration(uint8 fighterType) external returns (uint8) {\n require(msg.sender == _ownerAddress);\n generation[fighterType] += 1;\n maxRerollsAllowed[fighterType] += 1;\n return generation[fighterType];\n }", "fixed_code": " function addStaker(address newStaker) external {\n require(msg.sender == _ownerAddress);\n hasStakerRole[newStaker] = true;\n }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/7ashraf-Q.md", "collected_at": "2026-01-02T19:02:12.447536+00:00", "source_hash": "77a0de6cbb896b2b0645017fa640633872446c04f985ab532fd3fb162c14d8c2", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function incrementGeneration(uint8 fighterType) external returns (uint8) {\n require(msg.sender == _ownerAddress);\n generation[fighterType] += 1;\n maxRerollsAllowed[fighterType] += 1;\n return generation[fighterType];\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function addStaker(address newStaker) external {\n require(msg.sender == _ownerAddress);\n hasStakerRole[newStaker] = true;\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "07-amphora", "title": "0xWaitress Q", "severity_raw": "Low", "severity": "low", "description": "### [L-1] _withdraw in USDA does not follow the check effect interaction patterns:\n\nit's better to _burn the _susdAmount first before calling sUSD.transfer which is an external call. If sUSD becomes a token that has beforeTokenTransfer then it has the potential to be subject to re-entrency.\n\n```solidity\n function _withdraw(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n if (reserveAmount == 0) revert USDA_EmptyReserve();\n if (_susdAmount == 0) revert USDA_ZeroAmount();\n if (_susdAmount > this.balanceOf(_msgSender())) revert USDA_InsufficientFunds();\n // Account for the susd withdrawn\n reserveAmount -= _susdAmount;\n sUSD.transfer(_target, _susdAmount);\n _burn(_msgSender(), _susdAmount);\n\n emit Withdraw(_target, _susdAmount);\n }\n```\n### [L-2] _withdraw in USDA call sUSD.transfer before calling _burn is not following CEI pattern.\n\n```solidity\n function _withdraw(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n if (reserveAmount == 0) revert USDA_EmptyReserve();\n if (_susdAmount == 0) revert USDA_ZeroAmount();\n if (_susdAmount > this.balanceOf(_msgSender())) revert USDA_InsufficientFunds();\n // Account for the susd withdrawn\n reserveAmount -= _susdAmount;\n sUSD.transfer(_target, _susdAmount);\n _burn(_msgSender(), _susdAmount);\n\n emit Withdraw(_target, _susdAmount);\n }\n```\nThis adds risk on potential re-entrency if sUSD.transfer allows pre-transfer hooks\n\n### [N-1] changeCvxRewardFee in AMPHClaimer does not have a cap. \n\ncvxRewardFee if mis-configured to beyond 100% would break many calculation like claimable due to overflow. Same with changeCrvRewardFee.\n\n```solidity\n function changeCvxRewardFee(uint256 _newFee) external override onlyOwner {\n cvxRewardFee = _newFee;\n\n emit ChangedCvxRewardFee(_newFee);\n }\n```\n\n### [N-2] _propose in GovernorCharlie could use a struct to represent 4 arrays which are expected to be the same size, to remove length checks\n\n```", "vulnerable_code": " function _withdraw(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n if (reserveAmount == 0) revert USDA_EmptyReserve();\n if (_susdAmount == 0) revert USDA_ZeroAmount();\n if (_susdAmount > this.balanceOf(_msgSender())) revert USDA_InsufficientFunds();\n // Account for the susd withdrawn\n reserveAmount -= _susdAmount;\n sUSD.transfer(_target, _susdAmount);\n _burn(_msgSender(), _susdAmount);\n\n emit Withdraw(_target, _susdAmount);\n }", "fixed_code": " function _withdraw(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n if (reserveAmount == 0) revert USDA_EmptyReserve();\n if (_susdAmount == 0) revert USDA_ZeroAmount();\n if (_susdAmount > this.balanceOf(_msgSender())) revert USDA_InsufficientFunds();\n // Account for the susd withdrawn\n reserveAmount -= _susdAmount;\n sUSD.transfer(_target, _susdAmount);\n _burn(_msgSender(), _susdAmount);\n\n emit Withdraw(_target, _susdAmount);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/0xWaitress-Q.md", "collected_at": "2026-01-02T18:23:20.581923+00:00", "source_hash": "77e9e253af4e44208534531d9dae24426f847186c05a740d5e7b9ad321c0bbe9", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 1114, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _withdraw(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n if (reserveAmount == 0) revert USDA_EmptyReserve();\n if (_susdAmount == 0) revert USDA_ZeroAmount();\n if (_susdAmount > this.balanceOf(_msgSender())) revert USDA_InsufficientFunds();\n // Account for the susd withdrawn\n reserveAmount -= _susdAmount;\n sUSD.transfer(_target, _susdAmount);\n _burn(_msgSender(), _susdAmount);\n\n emit Withdraw(_target, _susdAmount);\n }", "primary_code_language": "solidity", "primary_code_char_count": 484, "all_code_blocks": "// Code block 1 (solidity):\nfunction _withdraw(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n if (reserveAmount == 0) revert USDA_EmptyReserve();\n if (_susdAmount == 0) revert USDA_ZeroAmount();\n if (_susdAmount > this.balanceOf(_msgSender())) revert USDA_InsufficientFunds();\n // Account for the susd withdrawn\n reserveAmount -= _susdAmount;\n sUSD.transfer(_target, _susdAmount);\n _burn(_msgSender(), _susdAmount);\n\n emit Withdraw(_target, _susdAmount);\n }\n\n// Code block 2 (solidity):\nfunction _withdraw(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n if (reserveAmount == 0) revert USDA_EmptyReserve();\n if (_susdAmount == 0) revert USDA_ZeroAmount();\n if (_susdAmount > this.balanceOf(_msgSender())) revert USDA_InsufficientFunds();\n // Account for the susd withdrawn\n reserveAmount -= _susdAmount;\n sUSD.transfer(_target, _susdAmount);\n _burn(_msgSender(), _susdAmount);\n\n emit Withdraw(_target, _susdAmount);\n }\n\n// Code block 3 (solidity):\nfunction changeCvxRewardFee(uint256 _newFee) external override onlyOwner {\n cvxRewardFee = _newFee;\n\n emit ChangedCvxRewardFee(_newFee);\n }", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function _withdraw(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n if (reserveAmount == 0) revert USDA_EmptyReserve();\n if (_susdAmount == 0) revert USDA_ZeroAmount();\n if (_susdAmount > this.balanceOf(_msgSender())) revert USDA_InsufficientFunds();\n // Account for the susd withdrawn\n reserveAmount -= _susdAmount;\n sUSD.transfer(_target, _susdAmount);\n _burn(_msgSender(), _susdAmount);\n\n emit Withdraw(_target, _susdAmount);\n }\n\nfunction _withdraw(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n if (reserveAmount == 0) revert USDA_EmptyReserve();\n if (_susdAmount == 0) revert USDA_ZeroAmount();\n if (_susdAmount > this.balanceOf(_msgSender())) revert USDA_InsufficientFunds();\n // Account for the susd withdrawn\n reserveAmount -= _susdAmount;\n sUSD.transfer(_target, _susdAmount);\n _burn(_msgSender(), _susdAmount);\n\n emit Withdraw(_target, _susdAmount);\n }\n\nfunction changeCvxRewardFee(uint256 _newFee) external override onlyOwner {\n cvxRewardFee = _newFee;\n\n emit ChangedCvxRewardFee(_newFee);\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function _withdraw(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n if (reserveAmount == 0) revert USDA_EmptyReserve();\n if (_susdAmount == 0) revert USDA_ZeroAmount();\n if (_susdAmount > this.balanceOf(_msgSender())) revert USDA_InsufficientFunds();\n // Account for the susd withdrawn\n reserveAmount -= _susdAmount;\n sUSD.transfer(_target, _susdAmount);\n _burn(_msgSender(), _susdAmount);\n\n emit Withdraw(_target, _susdAmount);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function _withdraw(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n if (reserveAmount == 0) revert USDA_EmptyReserve();\n if (_susdAmount == 0) revert USDA_ZeroAmount();\n if (_susdAmount > this.balanceOf(_msgSender())) revert USDA_InsufficientFunds();\n // Account for the susd withdrawn\n reserveAmount -= _susdAmount;\n sUSD.transfer(_target, _susdAmount);\n _burn(_msgSender(), _susdAmount);\n\n emit Withdraw(_target, _susdAmount);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "02-ai-arena", "title": "Ignite Q", "severity_raw": "Medium", "severity": "medium", "description": "# [Low-01] - Unsigned Integer Overflow\n\n## Impact\n\nThis function calculates the total number of fighters to mint by summing up the quantities of two types of fighters specified in the `numToMint` array at line 207.\n\n```solidity=191\nfunction claimFighters(\n uint8[2] calldata numToMint,\n bytes calldata signature,\n string[] calldata modelHashes,\n string[] calldata modelTypes\n) \n external \n{\n bytes32 msgHash = bytes32(keccak256(abi.encode(\n msg.sender, \n numToMint[0], \n numToMint[1],\n nftsClaimed[msg.sender][0],\n nftsClaimed[msg.sender][1]\n )));\n require(Verification.verify(msgHash, signature, _delegatedAddress));\n uint16 totalToMint = uint16(numToMint[0] + numToMint[1]);\n require(modelHashes.length == totalToMint && modelTypes.length == totalToMint);\n nftsClaimed[msg.sender][0] += numToMint[0];\n nftsClaimed[msg.sender][1] += numToMint[1];\n for (uint16 i = 0; i < totalToMint; i++) {\n _createNewFighter(\n msg.sender, \n uint256(keccak256(abi.encode(msg.sender, fighters.length))),\n modelHashes[i], \n modelTypes[i],\n i < numToMint[0] ? 0 : 1,\n 0,\n [uint256(100), uint256(100)]\n );\n }\n}\n```\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/FighterFarm.sol#L191-L222\n\nHowever, if `numToMint[0]` and `numToMint[1]` are summed up to a value greater than 255, this function will revert due to overflow.\n\n```solidity=207\nuint16 totalToMint = uint16(numToMint[0] + numToMint[1]);\n```\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/FighterFarm.sol#L207\n\nThis line will sum up `numToMint[0]` and `numToMint[1]` before converting to `uint16`. Since both `numToMint[0]` and `numToMint[1]` are of type uint8, and the maximum value for a uint8 is 255, an overflow will occur if their sum exceeds this value.\n\n\n\n## Proof of Concept\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/FighterFarm.sol#L207", "vulnerable_code": "https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/FighterFarm.sol#L191-L222\n\nHowever, if `numToMint[0]` and `numToMint[1]` are summed up to a value greater than 255, this function will revert due to overflow.\n", "fixed_code": "https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/FighterFarm.sol#L207\n\nThis line will sum up `numToMint[0]` and `numToMint[1]` before converting to `uint16`. Since both `numToMint[0]` and `numToMint[1]` are of type uint8, and the maximum value for a uint8 is 255, an overflow will occur if their sum exceeds this value.\n\n\n\n## Proof of Concept\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/FighterFarm.sol#L207\n\n## Tools Used\n\nManual Review\n\n## Recommended Mitigation Steps\n\nConvert `numToMint` to uint16 type before summing it up.\n\nFor example:\n", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/Ignite-Q.md", "collected_at": "2026-01-02T19:02:25.994884+00:00", "source_hash": "782433c8de35482f0f0ef22edd77e5fcc43569ab419751a8dce67e2e559aa0ee", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 219, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/FighterFarm.sol#L191-L222\n\nHowever, if `numToMint[0]` and `numToMint[1]` are summed up to a value greater than 255, this function will revert due to overflow.", "primary_code_language": "unknown", "primary_code_char_count": 219, "all_code_blocks": "// Code block 1 (unknown):\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/FighterFarm.sol#L191-L222\n\nHowever, if `numToMint[0]` and `numToMint[1]` are summed up to a value greater than 255, this function will revert due to overflow.", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "FighterFarm.sol#L191-L222, FighterFarm.sol#L207", "github_files_list": "FighterFarm.sol", "github_refs_count": 2, "vulnerable_code_actual": "https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/FighterFarm.sol#L191-L222\n\nHowever, if `numToMint[0]` and `numToMint[1]` are summed up to a value greater than 255, this function will revert due to overflow.\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/FighterFarm.sol#L207\n\nThis line will sum up `numToMint[0]` and `numToMint[1]` before converting to `uint16`. Since both `numToMint[0]` and `numToMint[1]` are of type uint8, and the maximum value for a uint8 is 255, an overflow will occur if their sum exceeds this value.\n\n\n\n## Proof of Concept\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/FighterFarm.sol#L207\n\n## Tools Used\n\nManual Review\n\n## Recommended Mitigation Steps\n\nConvert `numToMint` to uint16 type before summing it up.\n\nFor example:\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-asymmetry", "title": "0xepley G", "severity_raw": "Low", "severity": "low", "description": "# 1.Use StETHPerToken() function in ethPerDerivative() function in WstEth.sol\n\n## Summary\nwstEth contract have another function `stEthPerToken()` that returns the price for exactly 1 ether instead of manually passing the amount in the `getStEthByWstEth(_amount)`\n## Vulnerability Details\nHere we can see that both the functions have same inner implementation but for the `stEthPerToken()` one ether is hardcoded so we dont need to pass it manually as in `getStEthByWstEth(_amount)`\nhttps://github.com/lidofinance/lido-dao/blob/df95e563445821988baf9869fde64d86c36be55f/contracts/0.6.12/WstETH.sol#L107\nhttps://github.com/lidofinance/lido-dao/blob/df95e563445821988baf9869fde64d86c36be55f/contracts/0.6.12/WstETH.sol#L99\n\n## Impact\nWhen argument is passed in function its gas is determined using its hex form, one non zero byte costs `16 gas` and non zero bytes cost '4 gas'.\nHere gas can be saved by just using the function that donot need the argument to be passed in it.\nSo in total saves arount `400 gas` in total\n\n## Proof of Concept\n```solidity\npragma solidity ^0.8.0;\n\ncontract test{\n uint amount = 10;\n function test1(uint _amount) public returns(uint)\n {\n return amount;\n }\n function test2() public returns(uint)\n {\n return amount;\n }\n}\n```\nDeployed the above simple code in remix, and passed the argument as 10**18 and on calling first one cosumes `400` less gas than second.\n\n## Tools Used\nManual Review and Remix\n## Recommended Mitigation Steps\nUse the `stEthPerToken()` function described here\nhttps://github.com/lidofinance/lido-dao/blob/df95e563445821988baf9869fde64d86c36be55f/contracts/0.6.12/WstETH.sol#L107\n\n## 2. Redundant check that does nothing\n## Details\nFollowing multiplication and division does nothing as we multiply and divide by same number,\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/Reth.sol#L215\nIt can be removed and some gas can be saved as this functio", "vulnerable_code": "pragma solidity ^0.8.0;\n\ncontract test{\n uint amount = 10;\n function test1(uint _amount) public returns(uint)\n {\n return amount;\n }\n function test2() public returns(uint)\n {\n return amount;\n }\n}", "fixed_code": "", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/0xepley-G.md", "collected_at": "2026-01-02T18:17:40.934645+00:00", "source_hash": "782e2982d750cc8cf344fd11b59483d21cd7833b8e64c2427f6d050e2dedbb52", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 229, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "pragma solidity ^0.8.0;\n\ncontract test{\n uint amount = 10;\n function test1(uint _amount) public returns(uint)\n {\n return amount;\n }\n function test2() public returns(uint)\n {\n return amount;\n }\n}", "primary_code_language": "solidity", "primary_code_char_count": 229, "all_code_blocks": "// Code block 1 (solidity):\npragma solidity ^0.8.0;\n\ncontract test{\n uint amount = 10;\n function test1(uint _amount) public returns(uint)\n {\n return amount;\n }\n function test2() public returns(uint)\n {\n return amount;\n }\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "pragma solidity ^0.8.0;\n\ncontract test{\n uint amount = 10;\n function test1(uint _amount) public returns(uint)\n {\n return amount;\n }\n function test2() public returns(uint)\n {\n return amount;\n }\n}", "github_refs_formatted": "WstETH.sol#L107, WstETH.sol#L99, Reth.sol#L215", "github_files_list": "Reth.sol, WstETH.sol", "github_refs_count": 3, "vulnerable_code_actual": "pragma solidity ^0.8.0;\n\ncontract test{\n uint amount = 10;\n function test1(uint _amount) public returns(uint)\n {\n return amount;\n }\n function test2() public returns(uint)\n {\n return amount;\n }\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "02-ethos", "title": "CodeFoxInc G", "severity_raw": "Gas", "severity": "gas", "description": "# Gas Optimization\n## Gas-01 Not necessary to reinitiate the default value in struct\n\nIn the function `addStrategy()`. It is not necessary to initiate the value as 0. So we can remove this part to save gas. \n\n[https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Vault/contracts/ReaperVaultV2.sol#L158-L166](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Vault/contracts/ReaperVaultV2.sol#L158-L166)\n\n```diff\n-\tstrategies[_strategy] = StrategyParams({ \n-\t activation: block.timestamp,\n- feeBPS: _feeBPS,\n- allocBPS: _allocBPS,\n- allocated: 0,\n- gains: 0,\n- losses: 0,\n- lastReport: block.timestamp\n- });\n+ strategies[_strategy].activation = block.timestamp;\n+ strategies[_strategy].feeBPS = _feeBPS;\n+ strategies[_strategy].allocBPS = _allocBPS;\n+ strategies[_strategy].lastReport = block.timestamp; \n```\n\n### Proof of Concept\n\nBefore: \n\n```\n\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\n| ReaperVaultERC4626 \u00b7 addStrategy \u00b7 170982 \u00b7 205182 \u00b7 182382 \u00b7 3 \u00b7 - \u2502\n\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\n```\n\nAfter: \n\n```\n\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\n| ReaperVaultERC4626 \u00b7 addStrategy \u00b7 164169 \u00b7 198369 \u00b7 175569 \u00b7 3 \u00b7 - \u2502\n\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\n```\n\n### Recommendation\n\nAs a result it generally save about 7,000 gas. So I recommend that you change", "vulnerable_code": "### Proof of Concept\n\nBefore: \n", "fixed_code": "After: \n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/CodeFoxInc-G.md", "collected_at": "2026-01-02T18:16:03.995547+00:00", "source_hash": "78374c2426513477450be36212c0cb6b80e38fb6ed82c4c7def511e300fcc789", "code_block_count": 3, "solidity_block_count": 1, "total_code_chars": 1334, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "-\tstrategies[_strategy] = StrategyParams({ \n-\t activation: block.timestamp,\n- feeBPS: _feeBPS,\n- allocBPS: _allocBPS,\n- allocated: 0,\n- gains: 0,\n- losses: 0,\n- lastReport: block.timestamp\n- });\n+ strategies[_strategy].activation = block.timestamp;\n+ strategies[_strategy].feeBPS = _feeBPS;\n+ strategies[_strategy].allocBPS = _allocBPS;\n+ strategies[_strategy].lastReport = block.timestamp;", "primary_code_language": "diff", "primary_code_char_count": 490, "all_code_blocks": "// Code block 1 (diff):\n-\tstrategies[_strategy] = StrategyParams({ \n-\t activation: block.timestamp,\n- feeBPS: _feeBPS,\n- allocBPS: _allocBPS,\n- allocated: 0,\n- gains: 0,\n- losses: 0,\n- lastReport: block.timestamp\n- });\n+ strategies[_strategy].activation = block.timestamp;\n+ strategies[_strategy].feeBPS = _feeBPS;\n+ strategies[_strategy].allocBPS = _allocBPS;\n+ strategies[_strategy].lastReport = block.timestamp;\n\n// Code block 2 (unknown):\n\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\n| ReaperVaultERC4626 \u00b7 addStrategy \u00b7 170982 \u00b7 205182 \u00b7 182382 \u00b7 3 \u00b7 - \u2502\n\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\n\n// Code block 3 (unknown):\n\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\n| ReaperVaultERC4626 \u00b7 addStrategy \u00b7 164169 \u00b7 198369 \u00b7 175569 \u00b7 3 \u00b7 - \u2502\n\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7|\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7\u00b7", "all_code_blocks_count": 3, "has_diff_blocks": true, "diff_code": "-\tstrategies[_strategy] = StrategyParams({ \n-\t activation: block.timestamp,\n- feeBPS: _feeBPS,\n- allocBPS: _allocBPS,\n- allocated: 0,\n- gains: 0,\n- losses: 0,\n- lastReport: block.timestamp\n- });\n+ strategies[_strategy].activation = block.timestamp;\n+ strategies[_strategy].feeBPS = _feeBPS;\n+ strategies[_strategy].allocBPS = _allocBPS;\n+ strategies[_strategy].lastReport = block.timestamp;", "solidity_code": "", "github_refs_formatted": "ReaperVaultV2.sol#L158-L166", "github_files_list": "ReaperVaultV2.sol", "github_refs_count": 1, "vulnerable_code_actual": "### Proof of Concept\n\nBefore: \n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "After: \n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 11} {"source": "c4", "protocol": "07-amphora", "title": "SAQ G", "severity_raw": "Low", "severity": "low", "description": "## Summary\n\n### Gas Optimization\n\nno | Issue |Instances||\n|-|:-|:-:|:-:|\n| [G-01] | Expressions for constant values such as a call to keccak256(), should use immutable rather than constant | 4 | - |\n| [G-02] | Should use arguments instead of state variable | 7 | - |\n| [G-03] | State variable can be packed into fewer storage slots | 1 | - |\n| [G-04] | Duplicated require()/if() checks should be refactored to a modifier or function | 6 | - |\n| [G-05] | Use nested if and, avoid multiple check combinations | 6 | - |\n| [G-06] | Use\u00a0assembly\u00a0to write\u00a0address storage values | 4 | - |\n| [G-07] | Do not calculate constant | 7 | - |\n| [G-08] | Use hardcode address instead of address(this) | 9 | - |\n| [G-09] | Non efficient zero initialization | 3 | - |\n| [G-10] | Variable names that consist of all capital letters should be reserved for constant/immutable variables | 1 | - |\n| [G-11] | array[index] += amount\u00a0is cheaper than\u00a0array[index] = array[index] + amount\u00a0(or related variants) | 5 | - |\n| [G-12] | Use\u00a0uint256(1)/uint256(2)\u00a0instead for\u00a0true\u00a0and\u00a0false\u00a0boolean states | 4 | - |\n| [G-13] | Using Bools For Storage Incurs Overhead | 2 | - |\n| [G-14] | bytes.concat() can be used in place of abi.encodePacked | 3 | - |\n| [G-15] | Use assembly for math (add, sub, mul, div) | 7 | - |\n| [G-16] | Refactor event to avoid emitting empty data | 4 | - |\n\n\n## Gas Optimizations \n\n## [G-1] Expressions for constant values such as a call to keccak256(), should use immutable rather than constant\n\nWhile it doesn't save any gas because the compiler knows that developers often make this mistake, it's still best to use theright tool for the task at hand. There is a difference between constant variables and immutable variables, and they shouldeach be used in their appropriate contexts.constants should be used for literal values written into the code, and immutablevariables should be used for expressions, or values calculated in, or passed into the constructor.\n\n```solidity\nfile: /contracts/governanc", "vulnerable_code": "file: /contracts/governance/GovernorCharlie.sol\n\n19 bytes32 public constant DOMAIN_TYPEHASH =\n20 keccak256('EIP712Domain(string name,uint256 chainId,address verifyingContract)');\n\n23 bytes32 public constant BALLOT_TYPEHASH = keccak256('Ballot(uint256 proposalId,uint8 support)');\n", "fixed_code": "File: /contracts/utils/UFragments.sol\n\n88 keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)');\n\n89 bytes32 public constant PERMIT_TYPEHASH =\n90 keccak256('Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)');\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/SAQ-G.md", "collected_at": "2026-01-02T18:23:34.501074+00:00", "source_hash": "78424278d789fae28ebd8256a9fa86c81b143e400d43567e96b02e6b7bc35dda", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "file: /contracts/governance/GovernorCharlie.sol\n\n19 bytes32 public constant DOMAIN_TYPEHASH =\n20 keccak256('EIP712Domain(string name,uint256 chainId,address verifyingContract)');\n\n23 bytes32 public constant BALLOT_TYPEHASH = keccak256('Ballot(uint256 proposalId,uint8 support)');\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: /contracts/utils/UFragments.sol\n\n88 keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)');\n\n89 bytes32 public constant PERMIT_TYPEHASH =\n90 keccak256('Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)');\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-biconomy", "title": "0xAgro Q", "severity_raw": "High", "severity": "high", "description": "# QA Report\n## Finding Summary\n||Issue|Instances|\n|-|-|-|\n|[NC-01]|Long Lines (> 120 Characters)|85|\n|[NC-02]|Contracts Missing `@title` NatSpec Tag|25|\n|[NC-03]|`TODO` Left In Production Code|11|\n|[NC-04]|Order of Functions Not Compliant With Solidity Docs|8|\n|[NC-05]|Contract Layout Voids Solidity Docs|7|\n|[NC-06]|Commented Code Left In Production Code|6|\n|[NC-07]|Order of Modifiers Not Compliant With Solidity Docs|5|\n|[NC-08]|Debug Left in Production Code|5|\n|[NC-09]|NatSpec Comments Use `//` Instead of `///`|3|\n|[NC-10]|Dead Comments|2|\n|[NC-11]|Inconsistent NatSpec Function Headers|2|\n|[NC-12]|Underscore Notation Not Used / Not Used Consistently|1|\n|[NC-13]|Power of Ten Literal > `10e3` Not In Scientific Notation|1|\n|[NC-14]|Non-Assembly Function Available (`address().code.length`)|1|\n|[NC-15]|Non-Assembly Function Available (`chainid()`)|1|\n|[NC-16]|Whitespace In `mapping`|1|\n|[NC-17]|`validate` Misspelled as `valiate`|1|\n|[NC-18]|`// Emit events here..`|1|\n|[NC-19]|Duplicate Comment|1|\n\n### [NC-01] Long Lines (> 120 Characters)\n\nLines with greater length than 120 characters are used. The [Solidity Style Guide](https://docs.soliditylang.org/en/v0.8.17/style-guide.html#maximum-line-lengthhttps://docs.soliditylang.org/en/v0.8.17/style-guide.html#maximum-line-length) suggests that all lines should be 120 characters or less in width.\n\n#### Findings:\n\n*scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IAccount.sol*\n Links: [20](https://github.com/code-423n4/2023-01-biconomy/tree/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IAccount.sol#L20), [24](https://github.com/code-423n4/2023-01-biconomy/tree/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IAccount.sol#L24). \n```solidity\n20: * In case there is a paymaster in the request (or the current deposit is high enough), this value will be zero.\n24: function validateUserOp(UserOperation calldata userOp, bytes32 userOpHash, address aggregator, uint2", "vulnerable_code": "20: * In case there is a paymaster in the request (or the current deposit is high enough), this value will be zero.\n24: function validateUserOp(UserOperation calldata userOp, bytes32 userOpHash, address aggregator, uint256 missingAccountFunds)", "fixed_code": "39: * subclass should return a nonce value that is used both by _validateAndUpdateNonce, and by the external provider (to read the current nonce)\n45: * subclass should return a nonce value that is used both by _validateAndUpdateNonce, and by the external provider (to read the current nonce)\n57: * subclass doesn't need to override this method. Instead, it should override the specific internal validation methods.\n60: function validateUserOp(UserOperation calldata userOp, bytes32 userOpHash, address aggregator, uint256 missingAccountFunds)", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/0xAgro-Q.md", "collected_at": "2026-01-02T18:12:46.777688+00:00", "source_hash": "78458f5b09587741c736d4b158079e5b16dd7ece338626b278ef5f9ce39501fe", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "IAccount.sol#L20, IAccount.sol#L24", "github_files_list": "IAccount.sol", "github_refs_count": 2, "vulnerable_code_actual": "20: * In case there is a paymaster in the request (or the current deposit is high enough), this value will be zero.\n24: function validateUserOp(UserOperation calldata userOp, bytes32 userOpHash, address aggregator, uint256 missingAccountFunds)", "has_vulnerable_code_snippet": true, "fixed_code_actual": "39: * subclass should return a nonce value that is used both by _validateAndUpdateNonce, and by the external provider (to read the current nonce)\n45: * subclass should return a nonce value that is used both by _validateAndUpdateNonce, and by the external provider (to read the current nonce)\n57: * subclass doesn't need to override this method. Instead, it should override the specific internal validation methods.\n60: function validateUserOp(UserOperation calldata userOp, bytes32 userOpHash, address aggregator, uint256 missingAccountFunds)", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "06-lybra", "title": "j4ld1na Q", "severity_raw": "Low", "severity": "low", "description": "| | Issues | Instances |\n| :-- | :---------------------------------------------------------------------------------------------------------------------- | --------: |\n| 01 | Return values of `approve()` not checked. | 2 |\n| 02 | `SafeMath` is generally not needed starting with `Solidity 0.8`, since the compiler now has built in overflow checking. | 1 |\n| 03 | Don't use `catch`-block empty. | 8 |\n\n## 01 - Return values of `approve()` not checked.\n\n_Not all `IERC20` implementations `revert()` when there's a failure in `approve()`. The function signature has a `boolean` return value and they indicate errors that way instead. By not checking the return value, operations that should have marked as failed, may potentially go through without actually approving anything_\n\nThere are 2 instances for this issue:\n\n- [contracts/lybra/configuration/LybraConfigurator.sol#L302](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/configuration/LybraConfigurator.sol#L302)\n\n```ts\nEUSD.approve(address(curvePool), balance);\n```\n\n- [contracts/lybra/pools/LybraWstETHVault.sol#L35](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/LybraWstETHVault.sol#L35)\n\n```ts\nlido.approve(address(collateralAsset), msg.value);\n```\n\nRecommended Mitigation Steps:\n\n- It is recommend to use safeApprove().\n- Consider using safeIncreaseAllowance instead of approve function. (Approve race condition)\n\n## 02 - `SafeMath` is generally not needed starting with `Solidity 0.8`, since the compiler now has built in overflow checking.\n\n_All 3(ver cuantos?) in-scope contracts use the SafMath library for simple addition, subtraction, multiplication and division._\n\n", "vulnerable_code": "- [contracts/lybra/pools/LybraWstETHVault.sol#L35](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/LybraWstETHVault.sol#L35)\n", "fixed_code": "Recommended Mitigation Steps:\n\n- It is recommend to use safeApprove().\n- Consider using safeIncreaseAllowance instead of approve function. (Approve race condition)\n\n## 02 - `SafeMath` is generally not needed starting with `Solidity 0.8`, since the compiler now has built in overflow checking.\n\n_All 3(ver cuantos?) in-scope contracts use the SafMath library for simple addition, subtraction, multiplication and division._\n\n_This causes an unnecessary overhead since beginning from Solidity version 0.8.0 arithemtic operations revert by default on overflow / underflow._\n\n_By looking into the implementation of the SafeMath library you can also see that it is just a wrapper around the basic arithmatic operations and does not add any checks (at least for the functions used in the in-scope contracts)._\n\n[Docs-Changes of the Semantics](https://docs.soliditylang.org/en/v0.8.9/080-breaking-changes.html#silent-changes-of-the-semantics)\n\nThere an instance:\n\n- [contracts/lybra/token/EUSD.sol](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/token/EUSD.sol)\n\nRecommended Mitigation Steps:\n\n- Remove `SafeMath` library.\n\n## 03 - Don't use `catch`-block empty.\n\n_Usually empty try-catch is a bad idea because you are silently swallowing an error condition and then continuing execution._\n\n_Exceptions should only be thrown if there is truly an exception - something happening beyond the norm. An empty catch block basically says \"something bad is happening, but I just don't care\"._\n\n_If you don't want to handle the exception, let it propagate upwards until it reaches some code that can handle it._\n\nThere are 8 instances:\n\n- [contracts/lybra/miner/EUSDMiningIncentives.sol#L216](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/miner/EUSDMiningIncentives.sol#L216)\n", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/j4ld1na-Q.md", "collected_at": "2026-01-02T18:23:02.429265+00:00", "source_hash": "78f58872476602ba45abbc181ecc153a601926150ba7baaea3de96409c9c05f4", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 92, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "EUSD.approve(address(curvePool), balance);", "primary_code_language": "ts", "primary_code_char_count": 42, "all_code_blocks": "// Code block 1 (ts):\nEUSD.approve(address(curvePool), balance);\n\n// Code block 2 (ts):\nlido.approve(address(collateralAsset), msg.value);", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LybraConfigurator.sol#L302, LybraWstETHVault.sol#L35, EUSD.sol, EUSDMiningIncentives.sol#L216", "github_files_list": "EUSDMiningIncentives.sol, LybraConfigurator.sol, LybraWstETHVault.sol, EUSD.sol", "github_refs_count": 4, "vulnerable_code_actual": "- [contracts/lybra/pools/LybraWstETHVault.sol#L35](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/LybraWstETHVault.sol#L35)\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "Recommended Mitigation Steps:\n\n- It is recommend to use safeApprove().\n- Consider using safeIncreaseAllowance instead of approve function. (Approve race condition)\n\n## 02 - `SafeMath` is generally not needed starting with `Solidity 0.8`, since the compiler now has built in overflow checking.\n\n_All 3(ver cuantos?) in-scope contracts use the SafMath library for simple addition, subtraction, multiplication and division._\n\n_This causes an unnecessary overhead since beginning from Solidity version 0.8.0 arithemtic operations revert by default on overflow / underflow._\n\n_By looking into the implementation of the SafeMath library you can also see that it is just a wrapper around the basic arithmatic operations and does not add any checks (at least for the functions used in the in-scope contracts)._\n\n[Docs-Changes of the Semantics](https://docs.soliditylang.org/en/v0.8.9/080-breaking-changes.html#silent-changes-of-the-semantics)\n\nThere an instance:\n\n- [contracts/lybra/token/EUSD.sol](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/token/EUSD.sol)\n\nRecommended Mitigation Steps:\n\n- Remove `SafeMath` library.\n\n## 03 - Don't use `catch`-block empty.\n\n_Usually empty try-catch is a bad idea because you are silently swallowing an error condition and then continuing execution._\n\n_Exceptions should only be thrown if there is truly an exception - something happening beyond the norm. An empty catch block basically says \"something bad is happening, but I just don't care\"._\n\n_If you don't want to handle the exception, let it propagate upwards until it reaches some code that can handle it._\n\nThere are 8 instances:\n\n- [contracts/lybra/miner/EUSDMiningIncentives.sol#L216](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/miner/EUSDMiningIncentives.sol#L216)\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-biconomy", "title": "Rolezn Q", "severity_raw": "Critical", "severity": "critical", "description": "## Summary\n\n### Low Risk Issues\n| |Issue|Contexts|\n|-|:-|:-:|\n| [LOW‑1](#LOW‑1) | Avoid using `tx.origin` | 3 |\n| [LOW‑2](#LOW‑2) | Use of `ecrecover` is susceptible to signature malleability | 2 |\n| [LOW‑3](#LOW‑3) | Init functions are susceptible to front-running | 1 |\n| [LOW‑4](#LOW‑4) | Low Level Calls With Solidity Version 0.8.14 Can Result In Optimiser Bug | 6 |\n| [LOW‑5](#LOW‑5) | Missing parameter validation in `constructor` | 1 |\n| [LOW‑6](#LOW‑6) | Missing Contract-existence Checks Before Low-level Calls | 10 |\n| [LOW‑7](#LOW‑7) | Contracts are not using their OZ Upgradeable counterparts | 9 |\n| [LOW‑8](#LOW‑8) | Remove unused code | 5 |\n| [LOW‑9](#LOW‑9) | `require()` should be used instead of `assert()` | 1 |\n| [LOW‑10](#LOW‑10) | Unused `receive()` Function Will Lock Ether In Contract | 1 |\n| [LOW‑11](#LOW‑11) | Missing Non Reentrancy Modifiers | 6\n\nTotal: 45 contexts over 11 issues\n\n### Non-critical Issues\n| |Issue|Contexts|\n|-|:-|:-:|\n| [NC‑1](#NC‑1) | Critical Changes Should Use Two-step Procedure | 6 |\n| [NC‑2](#NC‑2) | Function creates dirty bits | 7 |\n| [NC‑3](#NC‑3) | Function writing that does not comply with the Solidity Style Guide | 37 |\n| [NC‑4](#NC‑4) | Use `delete` to Clear Variables | 4 |\n| [NC‑5](#NC‑5) | No need to initialize uints to zero | 11 |\n| [NC‑6](#NC‑6) | Lines are too long | 3 |\n| [NC‑7](#NC‑7) | Missing event for critical parameter change | 4 |\n| [NC‑8](#NC‑8) | Implementation contract may not be initialized | 6 |\n| [NC‑9](#NC‑9) | Non-usage of specific imports | 43 |\n| [NC‑10](#NC‑10) | Use a more recent version of Solidity | 37 |\n| [NC‑11](#NC‑11) | Open TODOs | 1 |\n| [NC‑12](#NC‑12) | Us", "vulnerable_code": "257: address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;", "fixed_code": "281: address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/Rolezn-Q.md", "collected_at": "2026-01-02T18:13:17.486457+00:00", "source_hash": "78f844fd9daa59bf50a78907cffb19e5fe87794d40e4145ec7c715eeb939c015", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "257: address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "281: address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "11-kelp", "title": "0xepley Analysis", "severity_raw": "Critical", "severity": "critical", "description": "Upon thorough examination of the presented smart contracts constituting the decentralized finance (DeFi) project, I discerned an intricately designed system that adeptly manages assets, incorporates oracle functionalities for price feeds, and implements a secure access control mechanism. The adoption of OpenZeppelin libraries is commendable, underscoring the commitment to industry best practices and substantially contributing to the overall reliability and security of the system. Nevertheless, it is imperative to underscore the necessity of a comprehensive security audit tailored specifically to the dynamic landscape of DeFi. This is crucial given the considerable financial implications and potential risks associated with decentralized financial transactions. Furthermore, the optimization of gas usage warrants careful consideration to augment the overall efficiency of contract execution. This becomes especially pertinent in decentralized environments where transaction costs wield significant influence.\n\n- The smart contracts exhibit a sophisticated architecture tailored to the demands of the DeFi landscape, encompassing robust asset management, seamless integration of oracle functionalities for accurate price feeds, and a well-structured secure access control system.\n- The decision to leverage OpenZeppelin libraries not only underscores a commitment to industry standards but also substantially bolsters the reliability and security parameters of the entire system.\n- It is crucial to emphasize the imperative need for a specialized security audit specifically designed for the unique challenges posed by DeFi projects. This consideration is paramount, given the inherent financial nature of the transactions and the potential risks involved.\n- Gas optimization strategies should be thoroughly explored to fine-tune the efficiency of contract execution. This strategic imperative gains heightened significance within decentralized environments, where transaction costs wield con", "vulnerable_code": " import { ERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n ```\n\n2. **Security Considerations:**\n - Conducting a meticulous review of access control mechanisms, leveraging OpenZeppelin's AccessControlUpgradeable for fine-grained control over contract access.\n - Recommending a specialized DeFi security audit to further enhance overall robustness and safeguard against potential vulnerabilities.\n\n ```solidity\n import { AccessControlUpgradeable } from \"@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol\";\n ```\n\n3. **Asset Management and Strategies:**\n - Scrutinizing asset management processes, especially the logic behind depositing assets into strategies and interacting with the Eigen Strategy Manager.\n - Ensuring alignment with the project's overarching objectives and optimal utilization of deployed strategies.\n\n ```solidity\n function depositAssetIntoStrategy(address asset) external onlySupportedAsset(asset) onlyLRTManager {\n // Implementation...\n }\n ```\n\n4. **Oracle Integration:**\n - Thoroughly examining the integration of oracles, with a specific focus on the ChainlinkPriceOracle.\n - Verifying the use of Chainlink's AggregatorInterface for fetching asset prices and maintaining accurate oracle data.\n\n ```solidity\n function updatePriceFeedFor(address asset, address priceFeed) external onlyLRTManager onlySupportedAsset(asset) {\n // Implementation...\n }\n ```\n\n5. **Gas Optimization:**\n - Assessing gas optimization strategies to ensure efficient contract execution and a seamless user experience.\n - Providing recommendations for optimizing functions, promoting cost-effectiveness while maintaining optimal performance.\n\n ```solidity\n function getAssetPrice(address asset) external view onlySupportedAsset(asset) returns (uint256) {\n return AggregatorInterface(assetPriceFeed[asset]).latestAnswer();\n }\n ```\n6. **Contract Initialization and Upgrade", "fixed_code": "2. **Utilization of OpenZeppelin Libraries:**\n - Leveraging OpenZeppelin libraries, such as ERC20Upgradeable and AccessControlUpgradeable, demonstrates a commitment to industry best practices and significantly enhances the security of the codebase.\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/0xepley-Analysis.md", "collected_at": "2026-01-02T18:27:14.120026+00:00", "source_hash": "79270a656801681fefe2f4e353eda2d6dbae2bf09a9eec4a3043f42fbe9cd8a9", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " import { ERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n ```\n\n2. **Security Considerations:**\n - Conducting a meticulous review of access control mechanisms, leveraging OpenZeppelin's AccessControlUpgradeable for fine-grained control over contract access.\n - Recommending a specialized DeFi security audit to further enhance overall robustness and safeguard against potential vulnerabilities.\n\n ```solidity\n import { AccessControlUpgradeable } from \"@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol\";\n ```\n\n3. **Asset Management and Strategies:**\n - Scrutinizing asset management processes, especially the logic behind depositing assets into strategies and interacting with the Eigen Strategy Manager.\n - Ensuring alignment with the project's overarching objectives and optimal utilization of deployed strategies.\n\n ```solidity\n function depositAssetIntoStrategy(address asset) external onlySupportedAsset(asset) onlyLRTManager {\n // Implementation...\n }\n ```\n\n4. **Oracle Integration:**\n - Thoroughly examining the integration of oracles, with a specific focus on the ChainlinkPriceOracle.\n - Verifying the use of Chainlink's AggregatorInterface for fetching asset prices and maintaining accurate oracle data.\n\n ```solidity\n function updatePriceFeedFor(address asset, address priceFeed) external onlyLRTManager onlySupportedAsset(asset) {\n // Implementation...\n }\n ```\n\n5. **Gas Optimization:**\n - Assessing gas optimization strategies to ensure efficient contract execution and a seamless user experience.\n - Providing recommendations for optimizing functions, promoting cost-effectiveness while maintaining optimal performance.\n\n ```solidity\n function getAssetPrice(address asset) external view onlySupportedAsset(asset) returns (uint256) {\n return AggregatorInterface(assetPriceFeed[asset]).latestAnswer();\n }\n ```\n6. **Contract Initialization and Upgrade", "has_vulnerable_code_snippet": true, "fixed_code_actual": "2. **Utilization of OpenZeppelin Libraries:**\n - Leveraging OpenZeppelin libraries, such as ERC20Upgradeable and AccessControlUpgradeable, demonstrates a commitment to industry best practices and significantly enhances the security of the codebase.\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "07-amphora", "title": "jeffy G", "severity_raw": "High", "severity": "high", "description": "### unchecked arithmetics\n\nin which cases where arithmetic operations can\u2019t overflow (mostly incrementing loop counters after comparing them with array lengths in loops), we can mark then unchecked to save gas \n\nthere were 5 found instances of this optimizations:\n\n```jsx\n868:for (uint192 _i; _i < enabledTokens.length; ++_i) \n896:for (uint192 _i; _i < enabledTokens.length; ++_i)\n259:for (uint256 _i = 0; _i < _proposal.targets.length; _i++)\n313:for (uint256 _i = 0; _i < _proposal.targets.length; _i++)\n382:for (uint256 _i = 0; _i < _proposal.targets.length; _i++)\n```\n\n[[868](https://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/core/VaultController.sol#L868),[896](https://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/core/VaultController.sol#L896),[259](https://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L259),[313](https://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L313),[382](https://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L382C1-L382C64)]\n\n### struct optimization\n\nin [Proposal struct](https://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/utils/GovernanceStructs.sol#L4C8-L4C16) we can declare the following variables right after each others\n\n- proposer\n- canceled\n- executed\n- executed\n\ndoing so will cause the struct to use one less storage slot in the EVM (saving 20000 gas unit), it will also make future reads/writes to that slot cost less (2100 for a cold read vs 100 for a hot read, and 20000/2900 for a cold write vs 800 (TODO : change this) for a hot write), so this optimization will cause most subs", "vulnerable_code": "[[868](https://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/core/VaultController.sol#L868),[896](https://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/core/VaultController.sol#L896),[259](https://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L259),[313](https://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L313),[382](https://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L382C1-L382C64)]\n\n### struct optimization\n\nin [Proposal struct](https://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/utils/GovernanceStructs.sol#L4C8-L4C16) we can declare the following variables right after each others\n\n- proposer\n- canceled\n- executed\n- executed\n\ndoing so will cause the struct to use one less storage slot in the EVM (saving 20000 gas unit), it will also make future reads/writes to that slot cost less (2100 for a cold read vs 100 for a hot read, and 20000/2900 for a cold write vs 800 (TODO : change this) for a hot write), so this optimization will cause most subsequent writes to he same slot of be considered hot\n\n## indexed events\n\nmarking event value-variables (such as int, uint, address ..) as indexed causes them to be stored on the stack instead of memory, thus saving gas\n\ninstances:\n", "fixed_code": "### caching variables on the stack\n\n- array.length\n\nmostly array lengths in for loops, instead of reading them using `array.length` every time, one could declare a `uint` variable to the stack, and then set it to the array length.\n\n the following instances were found:\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/jeffy-G.md", "collected_at": "2026-01-02T18:23:50.609414+00:00", "source_hash": "792c6a7f287148f853ddf139a42210a75e48b30f564f2cfd708f0a0fe799403c", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 294, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "868:for (uint192 _i; _i < enabledTokens.length; ++_i) \n896:for (uint192 _i; _i < enabledTokens.length; ++_i)\n259:for (uint256 _i = 0; _i < _proposal.targets.length; _i++)\n313:for (uint256 _i = 0; _i < _proposal.targets.length; _i++)\n382:for (uint256 _i = 0; _i < _proposal.targets.length; _i++)", "primary_code_language": "jsx", "primary_code_char_count": 294, "all_code_blocks": "// Code block 1 (jsx):\n868:for (uint192 _i; _i < enabledTokens.length; ++_i) \n896:for (uint192 _i; _i < enabledTokens.length; ++_i)\n259:for (uint256 _i = 0; _i < _proposal.targets.length; _i++)\n313:for (uint256 _i = 0; _i < _proposal.targets.length; _i++)\n382:for (uint256 _i = 0; _i < _proposal.targets.length; _i++)", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "VaultController.sol#L868, VaultController.sol#L896, GovernorCharlie.sol#L259, GovernorCharlie.sol#L313, GovernorCharlie.sol#L382-L1, GovernanceStructs.sol#L4-L8", "github_files_list": "GovernorCharlie.sol, VaultController.sol, GovernanceStructs.sol", "github_refs_count": 6, "vulnerable_code_actual": "[[868](https://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/core/VaultController.sol#L868),[896](https://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/core/VaultController.sol#L896),[259](https://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L259),[313](https://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L313),[382](https://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L382C1-L382C64)]\n\n### struct optimization\n\nin [Proposal struct](https://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/utils/GovernanceStructs.sol#L4C8-L4C16) we can declare the following variables right after each others\n\n- proposer\n- canceled\n- executed\n- executed\n\ndoing so will cause the struct to use one less storage slot in the EVM (saving 20000 gas unit), it will also make future reads/writes to that slot cost less (2100 for a cold read vs 100 for a hot read, and 20000/2900 for a cold write vs 800 (TODO : change this) for a hot write), so this optimization will cause most subsequent writes to he same slot of be considered hot\n\n## indexed events\n\nmarking event value-variables (such as int, uint, address ..) as indexed causes them to be stored on the stack instead of memory, thus saving gas\n\ninstances:\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "### caching variables on the stack\n\n- array.length\n\nmostly array lengths in for loops, instead of reading them using `array.length` every time, one could declare a `uint` variable to the stack, and then set it to the array length.\n\n the following instances were found:\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-salty", "title": "falconhoof Analysis", "severity_raw": "Critical", "severity": "critical", "description": "# LOW\n\n## L-01 typo in Pools::removeLiquidity()\n\nLink: https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/pools/Pools.sol#L170-L200\n\nThere is a typo in `removeLiquidity()` which allows the `reserve1` token (tokenB) to drop below the `DUST` value which can have negative consequences for the stability of the protocol and spot prices in Pools.\nThe highlighted require statement checks whether reserve0 is below DUST twice without checking reserve 1 when it should check both.\n\n\n```\n\tfunction removeLiquidity( IERC20 tokenA, IERC20 tokenB, uint256 liquidityToRemove, uint256 minReclaimedA, uint256 minReclaimedB, uint256 totalLiquidity ) external nonReentrant returns (uint256 reclaimedA, uint256 reclaimedB)\n\t\t{\n // SOME CODE\n\n>>> require((reserves.reserve0 >= PoolUtils.DUST) && (reserves.reserve0 >= PoolUtils.DUST), \"Insufficient reserves after liquidity removal\");\n\n // SOME CODE\n\t\t}\n```\n\n### POC\nAdd test to Pools.t.sol and run:\n```\n\tfunction test_Reserve1BelowDUST() public\n \t{\n\t\tvm.startPrank(address(collateralAndLiquidity));\n\t\tIERC20 tokenA = new TestERC20(\"newToken\", 18);\n IERC20 tokenB = new TestERC20(\"newToken\", 18);\n\t\tvm.stopPrank();\n\n\t\tvm.prank(address(dao));\n\t\tpoolsConfig.whitelistPool( pools, tokenA, tokenB);\n\n\t\tuint256 transferAmountA = 100_000 ether;\n\t\tuint256 transferAmountB = 100 ether;\n\n\t\tvm.startPrank(address(collateralAndLiquidity));\n \ttokenA.transfer(alice, transferAmountA);\n \ttokenB.transfer(alice, transferAmountB);\n\t\tvm.stopPrank();\n\n\t\t// assert funds transferred correctly\n\t\tassertEq(transferAmountA, tokenA.balanceOf(alice));\n\t\tassertEq(transferAmountB, tokenB.balanceOf(alice));\n\n\t\tvm.startPrank(alice); // depositing tokens are \n\t\ttokenA.approve(address(collateralAndLiquidity),type(uint256).max);\n\t\ttokenB.approve(address(collateralAndLiquidity),type(uint256).max);\n\t\tvm.stopPrank();\n\n\t\tuint256 aliceDeposit_TokenA = 100_000 ether;\n\t\tuint256 aliceDeposit_TokenB = 10 ether;\n\n\t\t// ali", "vulnerable_code": "\tfunction removeLiquidity( IERC20 tokenA, IERC20 tokenB, uint256 liquidityToRemove, uint256 minReclaimedA, uint256 minReclaimedB, uint256 totalLiquidity ) external nonReentrant returns (uint256 reclaimedA, uint256 reclaimedB)\n\t\t{\n // SOME CODE\n\n>>> require((reserves.reserve0 >= PoolUtils.DUST) && (reserves.reserve0 >= PoolUtils.DUST), \"Insufficient reserves after liquidity removal\");\n\n // SOME CODE\n\t\t}", "fixed_code": "\tfunction test_Reserve1BelowDUST() public\n \t{\n\t\tvm.startPrank(address(collateralAndLiquidity));\n\t\tIERC20 tokenA = new TestERC20(\"newToken\", 18);\n IERC20 tokenB = new TestERC20(\"newToken\", 18);\n\t\tvm.stopPrank();\n\n\t\tvm.prank(address(dao));\n\t\tpoolsConfig.whitelistPool( pools, tokenA, tokenB);\n\n\t\tuint256 transferAmountA = 100_000 ether;\n\t\tuint256 transferAmountB = 100 ether;\n\n\t\tvm.startPrank(address(collateralAndLiquidity));\n \ttokenA.transfer(alice, transferAmountA);\n \ttokenB.transfer(alice, transferAmountB);\n\t\tvm.stopPrank();\n\n\t\t// assert funds transferred correctly\n\t\tassertEq(transferAmountA, tokenA.balanceOf(alice));\n\t\tassertEq(transferAmountB, tokenB.balanceOf(alice));\n\n\t\tvm.startPrank(alice); // depositing tokens are \n\t\ttokenA.approve(address(collateralAndLiquidity),type(uint256).max);\n\t\ttokenB.approve(address(collateralAndLiquidity),type(uint256).max);\n\t\tvm.stopPrank();\n\n\t\tuint256 aliceDeposit_TokenA = 100_000 ether;\n\t\tuint256 aliceDeposit_TokenB = 10 ether;\n\n\t\t// alice is the initial depositor\n vm.prank(alice);\n\t\tcollateralAndLiquidity.depositLiquidityAndIncreaseShare( tokenA, tokenB, aliceDeposit_TokenA, aliceDeposit_TokenB, 0, block.timestamp, false );\n\t\tuint256 aliceLiquidity = collateralAndLiquidity.userShareForPool(alice, PoolUtils._poolID(tokenA, tokenB));\n\n\t\tvm.warp( block.timestamp + 1 hours);\n\n\t\tvm.prank(alice);\n\t\tcollateralAndLiquidity.withdrawLiquidityAndClaim( tokenA, tokenB, aliceLiquidity - 100, 0, 0, block.timestamp );\n\t\taliceLiquidity = collateralAndLiquidity.userShareForPool(alice, PoolUtils._poolID(tokenA, tokenB));\n\t\t(uint256 poolA, uint256 poolB) = pools.getPoolReserves(tokenA, tokenB);\t\t\n\t\tassert(poolA == 100);\n\t\tassert(poolB < 100);\n }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/falconhoof-Analysis.md", "collected_at": "2026-01-02T19:01:40.362291+00:00", "source_hash": "792fc3afa909765ff6932fa84efa0ad5b885a5f9936966274d01c00f45c17e67", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 422, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function removeLiquidity( IERC20 tokenA, IERC20 tokenB, uint256 liquidityToRemove, uint256 minReclaimedA, uint256 minReclaimedB, uint256 totalLiquidity ) external nonReentrant returns (uint256 reclaimedA, uint256 reclaimedB)\n\t\t{\n // SOME CODE\n\n>>> require((reserves.reserve0 >= PoolUtils.DUST) && (reserves.reserve0 >= PoolUtils.DUST), \"Insufficient reserves after liquidity removal\");\n\n // SOME CODE\n\t\t}", "primary_code_language": "unknown", "primary_code_char_count": 422, "all_code_blocks": "// Code block 1 (unknown):\nfunction removeLiquidity( IERC20 tokenA, IERC20 tokenB, uint256 liquidityToRemove, uint256 minReclaimedA, uint256 minReclaimedB, uint256 totalLiquidity ) external nonReentrant returns (uint256 reclaimedA, uint256 reclaimedB)\n\t\t{\n // SOME CODE\n\n>>> require((reserves.reserve0 >= PoolUtils.DUST) && (reserves.reserve0 >= PoolUtils.DUST), \"Insufficient reserves after liquidity removal\");\n\n // SOME CODE\n\t\t}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Pools.sol#L170-L200", "github_files_list": "Pools.sol", "github_refs_count": 1, "vulnerable_code_actual": "\tfunction removeLiquidity( IERC20 tokenA, IERC20 tokenB, uint256 liquidityToRemove, uint256 minReclaimedA, uint256 minReclaimedB, uint256 totalLiquidity ) external nonReentrant returns (uint256 reclaimedA, uint256 reclaimedB)\n\t\t{\n // SOME CODE\n\n>>> require((reserves.reserve0 >= PoolUtils.DUST) && (reserves.reserve0 >= PoolUtils.DUST), \"Insufficient reserves after liquidity removal\");\n\n // SOME CODE\n\t\t}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "\tfunction test_Reserve1BelowDUST() public\n \t{\n\t\tvm.startPrank(address(collateralAndLiquidity));\n\t\tIERC20 tokenA = new TestERC20(\"newToken\", 18);\n IERC20 tokenB = new TestERC20(\"newToken\", 18);\n\t\tvm.stopPrank();\n\n\t\tvm.prank(address(dao));\n\t\tpoolsConfig.whitelistPool( pools, tokenA, tokenB);\n\n\t\tuint256 transferAmountA = 100_000 ether;\n\t\tuint256 transferAmountB = 100 ether;\n\n\t\tvm.startPrank(address(collateralAndLiquidity));\n \ttokenA.transfer(alice, transferAmountA);\n \ttokenB.transfer(alice, transferAmountB);\n\t\tvm.stopPrank();\n\n\t\t// assert funds transferred correctly\n\t\tassertEq(transferAmountA, tokenA.balanceOf(alice));\n\t\tassertEq(transferAmountB, tokenB.balanceOf(alice));\n\n\t\tvm.startPrank(alice); // depositing tokens are \n\t\ttokenA.approve(address(collateralAndLiquidity),type(uint256).max);\n\t\ttokenB.approve(address(collateralAndLiquidity),type(uint256).max);\n\t\tvm.stopPrank();\n\n\t\tuint256 aliceDeposit_TokenA = 100_000 ether;\n\t\tuint256 aliceDeposit_TokenB = 10 ether;\n\n\t\t// alice is the initial depositor\n vm.prank(alice);\n\t\tcollateralAndLiquidity.depositLiquidityAndIncreaseShare( tokenA, tokenB, aliceDeposit_TokenA, aliceDeposit_TokenB, 0, block.timestamp, false );\n\t\tuint256 aliceLiquidity = collateralAndLiquidity.userShareForPool(alice, PoolUtils._poolID(tokenA, tokenB));\n\n\t\tvm.warp( block.timestamp + 1 hours);\n\n\t\tvm.prank(alice);\n\t\tcollateralAndLiquidity.withdrawLiquidityAndClaim( tokenA, tokenB, aliceLiquidity - 100, 0, 0, block.timestamp );\n\t\taliceLiquidity = collateralAndLiquidity.userShareForPool(alice, PoolUtils._poolID(tokenA, tokenB));\n\t\t(uint256 poolA, uint256 poolB) = pools.getPoolReserves(tokenA, tokenB);\t\t\n\t\tassert(poolA == 100);\n\t\tassert(poolB < 100);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-biconomy", "title": "Awesome Q", "severity_raw": "Low", "severity": "low", "description": "# 1. Improve the Readability by following modularity principles\n\nTo make your Solidity code more modern and readable, it is recommended to update your import statements to only include the specific contracts or objects that you need.\n\nThis practice, known as modular programming, helps to keep the code cleaner and more organized.\n\nTo avoid unnecessarily polluting the source code with unused contracts or objects, it is recommended to use specific imports with curly braces. An example of this syntax is shown below:\n\n```solidity\nimport {contract1, contract2} from \"filename.sol\";\n```\n\nBy using specific imports in this way, you can ensure that your code follows the principles of modularity and is as clear and maintainable as possible.\n\nAffected lines of code:\n\n- [ModuleManager.sol#L4-L6](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/base/ModuleManager.sol#L4-L6)\n\n# 2. Use the `delete` operator to clear variables, instead of assigning a value of zero.\n\nTo clear variables, use the `delete` operator rather than assigning to zero. This conveys the intention more clearly and is more idiomatic.\n\nFor example on [line 52](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/base/ModuleManager.sol#L52) you can refactor it as such:\n\n```solidity\nLine 52: delete modules[module];\n```\n\nAffected line of code:\n\n- [ModuleManager.sol#L52](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/base/ModuleManager.sol#L52)\n\n# 3. Open TODOs\n\nOpen TODOs can point to architecture or programming issues that still need to be resolved. Consider resolving them before deploying.\n\nAffected lines of code:\n\n- [EntryPoint.sol#L255](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L255)\n\n# 4. inadequate NatSpec\n\nContracts can use the Ethereum Natural Language Specificat", "vulnerable_code": "import {contract1, contract2} from \"filename.sol\";", "fixed_code": "Line 52: delete modules[module];", "recommendation": "", "category": "dos", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/Awesome-Q.md", "collected_at": "2026-01-02T18:12:54.461241+00:00", "source_hash": "794779527930289a805c8690760fe6c4b5fed04649d2d2d9d956ceb5a63a6927", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 85, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "import {contract1, contract2} from \"filename.sol\";", "primary_code_language": "solidity", "primary_code_char_count": 50, "all_code_blocks": "// Code block 1 (solidity):\nimport {contract1, contract2} from \"filename.sol\";\n\n// Code block 2 (solidity):\nLine 52: delete modules[module];", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "import {contract1, contract2} from \"filename.sol\";\n\nLine 52: delete modules[module];", "github_refs_formatted": "ModuleManager.sol#L4-L6, ModuleManager.sol#L52, EntryPoint.sol#L255", "github_files_list": "ModuleManager.sol, EntryPoint.sol", "github_refs_count": 3, "vulnerable_code_actual": "import {contract1, contract2} from \"filename.sol\";", "has_vulnerable_code_snippet": true, "fixed_code_actual": "Line 52: delete modules[module];", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "03-asymmetry", "title": "Wander Q", "severity_raw": "Low", "severity": "low", "description": "## 1. Reduce repetition of code\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L170-L173\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L190-L193\nThe mentioned code fragments are repeated, instead put it in a method. (Don't repeat the code, Write Code Once)\n\n###### Recommended Solution\n1 . Create a new function:\n```\nfunction recalculateTotalWeight() private {\n uint256 localTotalWeight = 0;\n for (uint256 i; i < derivativeCount; ++i)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n}\n```\n2 . Call the function wherever you need, for example:\n```\nfunction addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n recalculateTotalWeight(); // <<--------- Call the function ---------------\n\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n }\n```\n\n```\nfunction adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n ) external onlyOwner {\n weights[_derivativeIndex] = _weight;\n \n recalculateTotalWeight(); // <<--------- Call the function -------------\n\n emit WeightChange(_derivativeIndex, _weight);\n }\n```\n\n## 2. There is no need to recalculate the value of `totalWeight` in `addDerivative`\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L190-L193\nThe mentioned code lines can be replaced with a single line of code.\n`addDerivative` function can be changed as follows:\n```\nfunction addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);", "vulnerable_code": "function recalculateTotalWeight() private {\n uint256 localTotalWeight = 0;\n for (uint256 i; i < derivativeCount; ++i)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n}", "fixed_code": "function addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n recalculateTotalWeight(); // <<--------- Call the function ---------------\n\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Wander-Q.md", "collected_at": "2026-01-02T18:18:40.064282+00:00", "source_hash": "796a3e04b9fdd4e4211c78524fd2ff80b875031d80eb6beaa97883f62bf134f0", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 934, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function recalculateTotalWeight() private {\n uint256 localTotalWeight = 0;\n for (uint256 i; i < derivativeCount; ++i)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n}", "primary_code_language": "unknown", "primary_code_char_count": 217, "all_code_blocks": "// Code block 1 (unknown):\nfunction recalculateTotalWeight() private {\n uint256 localTotalWeight = 0;\n for (uint256 i; i < derivativeCount; ++i)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n}\n\n// Code block 2 (unknown):\nfunction addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n recalculateTotalWeight(); // <<--------- Call the function ---------------\n\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n }\n\n// Code block 3 (unknown):\nfunction adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n ) external onlyOwner {\n weights[_derivativeIndex] = _weight;\n \n recalculateTotalWeight(); // <<--------- Call the function -------------\n\n emit WeightChange(_derivativeIndex, _weight);\n }", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol#L170-L173, SafEth.sol#L190-L193", "github_files_list": "SafEth.sol", "github_refs_count": 2, "vulnerable_code_actual": "function recalculateTotalWeight() private {\n uint256 localTotalWeight = 0;\n for (uint256 i; i < derivativeCount; ++i)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n recalculateTotalWeight(); // <<--------- Call the function ---------------\n\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "01-salty", "title": "lsaudit Q", "severity_raw": "High", "severity": "high", "description": "# [1] Percentage of rewards sent to the initial team is hardcoded in the contract, thus it's not possible to change it in the future\n\n[File: DAO.sol](https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/dao/DAO.sol#L340)\n```\n\t\t// Send 10% of the rewards to the initial team\n\t\tuint256 amountToSendToTeam = claimedSALT / 10;\n```\n\nThe percentage of rewards which will be sent to the initial team is set to 10% and hard-coded into the contract. It's not possible to change it in the future. Consider implementing a way of changing this value in the future and do not hard-code it in the protocol.\n\n\n# [2] Mixing tabs and white-space in code-formatting\n\nMultiple of contracts does not obey the best coding standard in the context of tabulations and white-spaces. Tabs and white-spaces are mixed.\nThis issue occurs basically in every contract. For the QA report readability, we've marked down only two examples of this issue. Nonetheless, this issue affects every contract in scope.\n\n[File: InitialDistribution](https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/launch/InitialDistribution.sol#L52-L53)\n```\n \trequire( msg.sender == address(bootstrapBallot), \"InitialDistribution.distributionApproved can only be called from the BootstrapBallot contract\" ); // @audit: 4 whitespaces + tab\n\t\trequire( salt.balanceOf(address(this)) == 100 * MILLION_ETHER, \"SALT has already been sent from the contract\" ); // // @audit: 2 tabs\n```\n\n[File: USDS.sol](https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/stable/USDS.sol#L22-L25)\n```\n\tconstructor()\n\tERC20( \"USDS\", \"USDS\" )\n\t\t{ // @audit: 2 tabs\n } // @audit: 8 whitespaces\n\n```\n\n[File: CollateralAndLiquidity.sol](https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/stable/CollateralAndLiquidity.sol#L30-L36)\n```\n\tusing SafeERC20 for IERC20; // @audit: 1 tab\n\tusing SafeERC20 for I", "vulnerable_code": "\t\t// Send 10% of the rewards to the initial team\n\t\tuint256 amountToSendToTeam = claimedSALT / 10;", "fixed_code": " \trequire( msg.sender == address(bootstrapBallot), \"InitialDistribution.distributionApproved can only be called from the BootstrapBallot contract\" ); // @audit: 4 whitespaces + tab\n\t\trequire( salt.balanceOf(address(this)) == 100 * MILLION_ETHER, \"SALT has already been sent from the contract\" ); // // @audit: 2 tabs", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/lsaudit-Q.md", "collected_at": "2026-01-02T19:01:52.068269+00:00", "source_hash": "796ab229d1920204ef53c6cee9fddef49b8eed01d8036cbdba7e35fc3228cfdd", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 506, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "// Send 10% of the rewards to the initial team\n\t\tuint256 amountToSendToTeam = claimedSALT / 10;", "primary_code_language": "unknown", "primary_code_char_count": 95, "all_code_blocks": "// Code block 1 (unknown):\n// Send 10% of the rewards to the initial team\n\t\tuint256 amountToSendToTeam = claimedSALT / 10;\n\n// Code block 2 (unknown):\nrequire( msg.sender == address(bootstrapBallot), \"InitialDistribution.distributionApproved can only be called from the BootstrapBallot contract\" ); // @audit: 4 whitespaces + tab\n\t\trequire( salt.balanceOf(address(this)) == 100 * MILLION_ETHER, \"SALT has already been sent from the contract\" ); // // @audit: 2 tabs\n\n// Code block 3 (unknown):\nconstructor()\n\tERC20( \"USDS\", \"USDS\" )\n\t\t{ // @audit: 2 tabs\n } // @audit: 8 whitespaces", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "DAO.sol#L340, InitialDistribution.sol#L52-L53, USDS.sol#L22-L25, CollateralAndLiquidity.sol#L30-L36", "github_files_list": "USDS.sol, CollateralAndLiquidity.sol, InitialDistribution.sol, DAO.sol", "github_refs_count": 4, "vulnerable_code_actual": "\t\t// Send 10% of the rewards to the initial team\n\t\tuint256 amountToSendToTeam = claimedSALT / 10;", "has_vulnerable_code_snippet": true, "fixed_code_actual": " \trequire( msg.sender == address(bootstrapBallot), \"InitialDistribution.distributionApproved can only be called from the BootstrapBallot contract\" ); // @audit: 4 whitespaces + tab\n\t\trequire( salt.balanceOf(address(this)) == 100 * MILLION_ETHER, \"SALT has already been sent from the contract\" ); // // @audit: 2 tabs", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "01-salty", "title": "Topmark Q", "severity_raw": "High", "severity": "high", "description": "### Report 1:\n#### Missing Validation check for PoolIds in PoolStats contract.\nWhen a pool Id is invalid it returns INVALID_POOL_ID which represents type(uint64).max, however this return value was not checked at L88-L91 in the updateArbitrageIndicies() function. This would allow invalid pool during Arbitrage and could escalate to serious problems, The return value should be checked as adjusted below.\nhttps://github.com/code-423n4/2024-01-salty/blob/main/src/pools/PoolStats.sol#L89-L91\nhttps://github.com/code-423n4/2024-01-salty/blob/main/src/pools/PoolStats.sol#L71\n```solidity\nfunction _poolIndex( IERC20 tokenA, IERC20 tokenB, bytes32[] memory poolIDs ) internal pure returns (uint64 index)\n\t{\n\tbytes32 poolID = PoolUtils._poolID( tokenA, tokenB );\n\n\tfor( uint256 i = 0; i < poolIDs.length; i++ )\n\t\t{\n\t\tif (poolID == poolIDs[i])\n\t\t\treturn uint64(i);\n\t\t}\n\n>>>\treturn INVALID_POOL_ID;\n\t}\n```\n```solidity\nfunction updateArbitrageIndicies() public\n\t{\n\tbytes32[] memory poolIDs = poolsConfig.whitelistedPools();\n\n\tfor( uint256 i = 0; i < poolIDs.length; i++ )\n\t{\n\tbytes32 poolID = poolIDs[i];\n\t(IERC20 arbToken2, IERC20 arbToken3) = poolsConfig.underlyingTokenPair(poolID);\n\n\t// The middle two tokens can never be WETH in a valid arbitrage path as the path is WETH->arbToken2->arbToken3->WETH.\n\tif ( (arbToken2 != _weth) && (arbToken3 != _weth) )\n\t\t\t\t{\n>>>\tuint64 poolIndex1 = _poolIndex( _weth, arbToken2, poolIDs );\n>>>\tuint64 poolIndex2 = _poolIndex( arbToken2, arbToken3, poolIDs );\n>>>\tuint64 poolIndex3 = _poolIndex( arbToken3, _weth, poolIDs );\n+++ require ( poolIndex1 != INVALID_POOL_ID && poolIndex2 != INVALID_POOL_ID && poolIndex3 != INVALID_POOL_ID , \"INVALID_POOL_ID\" );\n\t\t\t\t...\n\t\t}\n```\n### Report 2:\n#### Unused Variable\nPossible Incomplete implementation in the performUpkeep(...) function of the RewardsEmitter.sol contracr. As noted in the code provided below, uint256 sum was declared and was continuously assigned a value of amountToAddForPool at every loop cycle, but `su", "vulnerable_code": "function _poolIndex( IERC20 tokenA, IERC20 tokenB, bytes32[] memory poolIDs ) internal pure returns (uint64 index)\n\t{\n\tbytes32 poolID = PoolUtils._poolID( tokenA, tokenB );\n\n\tfor( uint256 i = 0; i < poolIDs.length; i++ )\n\t\t{\n\t\tif (poolID == poolIDs[i])\n\t\t\treturn uint64(i);\n\t\t}\n\n>>>\treturn INVALID_POOL_ID;\n\t}", "fixed_code": "function updateArbitrageIndicies() public\n\t{\n\tbytes32[] memory poolIDs = poolsConfig.whitelistedPools();\n\n\tfor( uint256 i = 0; i < poolIDs.length; i++ )\n\t{\n\tbytes32 poolID = poolIDs[i];\n\t(IERC20 arbToken2, IERC20 arbToken3) = poolsConfig.underlyingTokenPair(poolID);\n\n\t// The middle two tokens can never be WETH in a valid arbitrage path as the path is WETH->arbToken2->arbToken3->WETH.\n\tif ( (arbToken2 != _weth) && (arbToken3 != _weth) )\n\t\t\t\t{\n>>>\tuint64 poolIndex1 = _poolIndex( _weth, arbToken2, poolIDs );\n>>>\tuint64 poolIndex2 = _poolIndex( arbToken2, arbToken3, poolIDs );\n>>>\tuint64 poolIndex3 = _poolIndex( arbToken3, _weth, poolIDs );\n+++ require ( poolIndex1 != INVALID_POOL_ID && poolIndex2 != INVALID_POOL_ID && poolIndex3 != INVALID_POOL_ID , \"INVALID_POOL_ID\" );\n\t\t\t\t...\n\t\t}", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/Topmark-Q.md", "collected_at": "2026-01-02T19:01:31.356426+00:00", "source_hash": "79b4411b8a9afc2c60e2ab8bc05516984b5c77df2dcdd578970910d0be8b5252", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 1102, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _poolIndex( IERC20 tokenA, IERC20 tokenB, bytes32[] memory poolIDs ) internal pure returns (uint64 index)\n\t{\n\tbytes32 poolID = PoolUtils._poolID( tokenA, tokenB );\n\n\tfor( uint256 i = 0; i < poolIDs.length; i++ )\n\t\t{\n\t\tif (poolID == poolIDs[i])\n\t\t\treturn uint64(i);\n\t\t}\n\n>>>\treturn INVALID_POOL_ID;\n\t}", "primary_code_language": "solidity", "primary_code_char_count": 309, "all_code_blocks": "// Code block 1 (solidity):\nfunction _poolIndex( IERC20 tokenA, IERC20 tokenB, bytes32[] memory poolIDs ) internal pure returns (uint64 index)\n\t{\n\tbytes32 poolID = PoolUtils._poolID( tokenA, tokenB );\n\n\tfor( uint256 i = 0; i < poolIDs.length; i++ )\n\t\t{\n\t\tif (poolID == poolIDs[i])\n\t\t\treturn uint64(i);\n\t\t}\n\n>>>\treturn INVALID_POOL_ID;\n\t}\n\n// Code block 2 (solidity):\nfunction updateArbitrageIndicies() public\n\t{\n\tbytes32[] memory poolIDs = poolsConfig.whitelistedPools();\n\n\tfor( uint256 i = 0; i < poolIDs.length; i++ )\n\t{\n\tbytes32 poolID = poolIDs[i];\n\t(IERC20 arbToken2, IERC20 arbToken3) = poolsConfig.underlyingTokenPair(poolID);\n\n\t// The middle two tokens can never be WETH in a valid arbitrage path as the path is WETH->arbToken2->arbToken3->WETH.\n\tif ( (arbToken2 != _weth) && (arbToken3 != _weth) )\n\t\t\t\t{\n>>>\tuint64 poolIndex1 = _poolIndex( _weth, arbToken2, poolIDs );\n>>>\tuint64 poolIndex2 = _poolIndex( arbToken2, arbToken3, poolIDs );\n>>>\tuint64 poolIndex3 = _poolIndex( arbToken3, _weth, poolIDs );\n+++ require ( poolIndex1 != INVALID_POOL_ID && poolIndex2 != INVALID_POOL_ID && poolIndex3 != INVALID_POOL_ID , \"INVALID_POOL_ID\" );\n\t\t\t\t...\n\t\t}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function _poolIndex( IERC20 tokenA, IERC20 tokenB, bytes32[] memory poolIDs ) internal pure returns (uint64 index)\n\t{\n\tbytes32 poolID = PoolUtils._poolID( tokenA, tokenB );\n\n\tfor( uint256 i = 0; i < poolIDs.length; i++ )\n\t\t{\n\t\tif (poolID == poolIDs[i])\n\t\t\treturn uint64(i);\n\t\t}\n\n>>>\treturn INVALID_POOL_ID;\n\t}\n\nfunction updateArbitrageIndicies() public\n\t{\n\tbytes32[] memory poolIDs = poolsConfig.whitelistedPools();\n\n\tfor( uint256 i = 0; i < poolIDs.length; i++ )\n\t{\n\tbytes32 poolID = poolIDs[i];\n\t(IERC20 arbToken2, IERC20 arbToken3) = poolsConfig.underlyingTokenPair(poolID);\n\n\t// The middle two tokens can never be WETH in a valid arbitrage path as the path is WETH->arbToken2->arbToken3->WETH.\n\tif ( (arbToken2 != _weth) && (arbToken3 != _weth) )\n\t\t\t\t{\n>>>\tuint64 poolIndex1 = _poolIndex( _weth, arbToken2, poolIDs );\n>>>\tuint64 poolIndex2 = _poolIndex( arbToken2, arbToken3, poolIDs );\n>>>\tuint64 poolIndex3 = _poolIndex( arbToken3, _weth, poolIDs );\n+++ require ( poolIndex1 != INVALID_POOL_ID && poolIndex2 != INVALID_POOL_ID && poolIndex3 != INVALID_POOL_ID , \"INVALID_POOL_ID\" );\n\t\t\t\t...\n\t\t}", "github_refs_formatted": "PoolStats.sol#L89-L91, PoolStats.sol#L71", "github_files_list": "PoolStats.sol", "github_refs_count": 2, "vulnerable_code_actual": "function _poolIndex( IERC20 tokenA, IERC20 tokenB, bytes32[] memory poolIDs ) internal pure returns (uint64 index)\n\t{\n\tbytes32 poolID = PoolUtils._poolID( tokenA, tokenB );\n\n\tfor( uint256 i = 0; i < poolIDs.length; i++ )\n\t\t{\n\t\tif (poolID == poolIDs[i])\n\t\t\treturn uint64(i);\n\t\t}\n\n>>>\treturn INVALID_POOL_ID;\n\t}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function updateArbitrageIndicies() public\n\t{\n\tbytes32[] memory poolIDs = poolsConfig.whitelistedPools();\n\n\tfor( uint256 i = 0; i < poolIDs.length; i++ )\n\t{\n\tbytes32 poolID = poolIDs[i];\n\t(IERC20 arbToken2, IERC20 arbToken3) = poolsConfig.underlyingTokenPair(poolID);\n\n\t// The middle two tokens can never be WETH in a valid arbitrage path as the path is WETH->arbToken2->arbToken3->WETH.\n\tif ( (arbToken2 != _weth) && (arbToken3 != _weth) )\n\t\t\t\t{\n>>>\tuint64 poolIndex1 = _poolIndex( _weth, arbToken2, poolIDs );\n>>>\tuint64 poolIndex2 = _poolIndex( arbToken2, arbToken3, poolIDs );\n>>>\tuint64 poolIndex3 = _poolIndex( arbToken3, _weth, poolIDs );\n+++ require ( poolIndex1 != INVALID_POOL_ID && poolIndex2 != INVALID_POOL_ID && poolIndex3 != INVALID_POOL_ID , \"INVALID_POOL_ID\" );\n\t\t\t\t...\n\t\t}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "06-lybra", "title": "koo G", "severity_raw": "Low", "severity": "low", "description": "From the implementation of EUSD.transferFrom.\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/token/EUSD.sol#L226\n```solidity\n function transferFrom(address from, address to, uint256 amount) public returns (bool) {\n address spender = _msgSender();\n if (!configurator.mintVault(spender)) {\n _spendAllowance(from, spender, amount);\n }\n _transfer(from, to, amount);\n return true;\n }\n```\nWe can see it will always return true or revert the transaction. Thus We don't need to check the return value of EUSD.transferFrom. \n\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/EUSDMiningIncentives.sol#L215\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/pools/LybraStETHVault.sol#L70\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/pools/LybraStETHVault.sol#L85\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/token/PeUSDMainnetStableVision.sol#L82\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/token/PeUSDMainnetStableVision.sol#L133\n", "vulnerable_code": " function transferFrom(address from, address to, uint256 amount) public returns (bool) {\n address spender = _msgSender();\n if (!configurator.mintVault(spender)) {\n _spendAllowance(from, spender, amount);\n }\n _transfer(from, to, amount);\n return true;\n }", "fixed_code": "", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/koo-G.md", "collected_at": "2026-01-02T18:23:04.209972+00:00", "source_hash": "79ddad3937cbe15dae242aa118226b69a20d32e3afb926036d701458440468e8", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 301, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function transferFrom(address from, address to, uint256 amount) public returns (bool) {\n address spender = _msgSender();\n if (!configurator.mintVault(spender)) {\n _spendAllowance(from, spender, amount);\n }\n _transfer(from, to, amount);\n return true;\n }", "primary_code_language": "solidity", "primary_code_char_count": 301, "all_code_blocks": "// Code block 1 (solidity):\nfunction transferFrom(address from, address to, uint256 amount) public returns (bool) {\n address spender = _msgSender();\n if (!configurator.mintVault(spender)) {\n _spendAllowance(from, spender, amount);\n }\n _transfer(from, to, amount);\n return true;\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function transferFrom(address from, address to, uint256 amount) public returns (bool) {\n address spender = _msgSender();\n if (!configurator.mintVault(spender)) {\n _spendAllowance(from, spender, amount);\n }\n _transfer(from, to, amount);\n return true;\n }", "github_refs_formatted": "EUSD.sol#L226, EUSDMiningIncentives.sol#L215, LybraStETHVault.sol#L70, LybraStETHVault.sol#L85, PeUSDMainnetStableVision.sol#L82, PeUSDMainnetStableVision.sol#L133", "github_files_list": "EUSDMiningIncentives.sol, LybraStETHVault.sol, EUSD.sol, PeUSDMainnetStableVision.sol", "github_refs_count": 6, "vulnerable_code_actual": " function transferFrom(address from, address to, uint256 amount) public returns (bool) {\n address spender = _msgSender();\n if (!configurator.mintVault(spender)) {\n _spendAllowance(from, spender, amount);\n }\n _transfer(from, to, amount);\n return true;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5.67} {"source": "c4", "protocol": "01-ondo", "title": "Diana G", "severity_raw": "Medium", "severity": "medium", "description": "\n## G-01 Increments can be unchecked\n\nIn Solidity 0.8+, there\u2019s a default overflow check on unsigned integers. It\u2019s possible to uncheck this in for-loops and save some gas at each iteration, but at the cost of some code readability, as this uncheck cannot be made inline\n\nPrior to Solidity 0.8.0, arithmetic operations would always wrap in case of under- or overflow leading to widespread use of libraries that introduce additional checks.\n\nSince Solidity 0.8.0, all arithmetic operations revert on over- and underflow by default, thus making the use of these libraries unnecessary.\n\nTo obtain the previous behaviour, an unchecked block can be used. It saves **30-40 gas** per loop.\n\n_There are 9 instances of this issue_\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol\n\n```\nFile: contracts/cash/CashManager.sol\n\n750: for (uint256 i = 0; i < size; ++i) {\n786: for (uint256 i = 0; i < size; ++i) {\n933: for (uint256 i = 0; i < size; ++i) {\n961: for (uint256 i = 0; i < exCallData.length; ++i) {\n```\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashFactory.sol\n\n```\nFile: contracts/cash/factory/CashFactory.sol\n\n127: for (uint256 i = 0; i < exCallData.length; ++i) {\n```\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashKYCSenderFactory.sol\n\n```\nFile: contracts/cash/factory/CashKYCSenderFactory.sol\n\n137: for (uint256 i = 0; i < exCallData.length; ++i) {\n```\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashKYCSenderReceiverFactory.sol\n\n```\nFile: contracts/cash/factory/CashKYCSenderReceiverFactory.sol\n\n137: for (uint256 i = 0; i < exCallData.length; ++i) {\n```\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistry.sol\n\n```\nFile: contracts/cash/kyc/KYCRegistry.sol\n\n163: for (uint256 i = 0; i < length; i++) {\n180: for (uint256 i = 0; i < length; i++) {\n```\n\n---------------\n\n## G-02 x += y costs more gas than x = x + y for state var", "vulnerable_code": "File: contracts/cash/CashManager.sol\n\n750: for (uint256 i = 0; i < size; ++i) {\n786: for (uint256 i = 0; i < size; ++i) {\n933: for (uint256 i = 0; i < size; ++i) {\n961: for (uint256 i = 0; i < exCallData.length; ++i) {", "fixed_code": "File: contracts/cash/factory/CashFactory.sol\n\n127: for (uint256 i = 0; i < exCallData.length; ++i) {", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/Diana-G.md", "collected_at": "2026-01-02T18:14:35.124808+00:00", "source_hash": "79ef42f06a47669cb078d8cf52fea7157dc118f7da59c375ab40cb7fe46dbbf5", "code_block_count": 5, "solidity_block_count": 0, "total_code_chars": 673, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/cash/CashManager.sol\n\n750: for (uint256 i = 0; i < size; ++i) {\n786: for (uint256 i = 0; i < size; ++i) {\n933: for (uint256 i = 0; i < size; ++i) {\n961: for (uint256 i = 0; i < exCallData.length; ++i) {", "primary_code_language": "unknown", "primary_code_char_count": 218, "all_code_blocks": "// Code block 1 (unknown):\nFile: contracts/cash/CashManager.sol\n\n750: for (uint256 i = 0; i < size; ++i) {\n786: for (uint256 i = 0; i < size; ++i) {\n933: for (uint256 i = 0; i < size; ++i) {\n961: for (uint256 i = 0; i < exCallData.length; ++i) {\n\n// Code block 2 (unknown):\nFile: contracts/cash/factory/CashFactory.sol\n\n127: for (uint256 i = 0; i < exCallData.length; ++i) {\n\n// Code block 3 (unknown):\nFile: contracts/cash/factory/CashKYCSenderFactory.sol\n\n137: for (uint256 i = 0; i < exCallData.length; ++i) {\n\n// Code block 4 (unknown):\nFile: contracts/cash/factory/CashKYCSenderReceiverFactory.sol\n\n137: for (uint256 i = 0; i < exCallData.length; ++i) {\n\n// Code block 5 (unknown):\nFile: contracts/cash/kyc/KYCRegistry.sol\n\n163: for (uint256 i = 0; i < length; i++) {\n180: for (uint256 i = 0; i < length; i++) {", "all_code_blocks_count": 5, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CashManager.sol, CashFactory.sol, CashKYCSenderFactory.sol, CashKYCSenderReceiverFactory.sol, KYCRegistry.sol", "github_files_list": "CashManager.sol, CashKYCSenderFactory.sol, CashFactory.sol, KYCRegistry.sol, CashKYCSenderReceiverFactory.sol", "github_refs_count": 5, "vulnerable_code_actual": "File: contracts/cash/CashManager.sol\n\n750: for (uint256 i = 0; i < size; ++i) {\n786: for (uint256 i = 0; i < size; ++i) {\n933: for (uint256 i = 0; i < size; ++i) {\n961: for (uint256 i = 0; i < exCallData.length; ++i) {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/cash/factory/CashFactory.sol\n\n127: for (uint256 i = 0; i < exCallData.length; ++i) {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 11} {"source": "c4", "protocol": "04-caviar", "title": "Sathish9098 Q", "severity_raw": "Critical", "severity": "critical", "description": "## LOW FINDINGS \n\n| Low Count | Issues | Instances |\n| -------- | --------| -------- |\n| [L-1] | Lack of address(0) check when assigning address to state variables | 4 |\n| [L-2] | A single point of failure | 8 |\n| [L-3] | Front running attacks by the onlyOwner | 8 |\n| [L-4] | Prevent division by 0 | 5 |\n| [L-5] | Sanity/Threshold/Limit Checks | 10 |\n| [L-6] | Consider using OpenZeppelin\u2019s SafeCast library to prevent unexpected errors | 3 |\n| [L-7] | Function may run out of gas | 7 |\n| [L-8] | Gas griefing/theft is possible on unsafe external call | 1 |\n| [L-9] | Loss of precision due to rounding | 11 |\n| [L-10] | Use latest @openzeppelin/merkle-tree version | 1 |\n| [L-11] | abi.encodePacked() should not be used with dynamic types when passing the result to a hash function such as keccak256() | 7 |\n\n# NON CRITICAL FINDINGS\n\n| NC Count | Issues | Instances |\n| -------- | --------| -------- |\n| [NC-1] | Add a timelock to critical functions | 8 |\n| [NC-2] | No same value control | 8 |\n| [NC-3] | Critical changes should use two-step procedure | 8 |\n| [NC-4] | Events that mark critical parameter changes should contain both the old and the new value | 8 |\n| [NC-5] | NATSPEC COMMENTS SHOULD BE INCREASED IN CONTRACTS | - |\n| [NC-6] | NOT USING THE NAMED RETURN VARIABLES ANYWHERE IN THE FUNCTION IS CONFUSING | 11 |\n| [NC-7] | Mark visibility of initialize(\u2026) functions as external | 1 |\n| [NC-8] | Contract layout and order of functions | 8 |\n| [NC-9] | Pragma float | - |\n| [NC-10] | immutable should be uppercase | 3 |\n| [NC-11] | Public functions not called by contract can declare as external | 11 |\n| [NC-12] | Include return parameters in NatSpec comments | 6 |\n| [NC-13] | Use of bytes.concat() instead of abi.encodePacked() | 7 |\n| [NC-14] | For functions, follow Solidity standard naming conventions (internal function style rule) | 1 |\n| [NC-15] | Typos | 1 |\n| [NC-16] | NatSpec is incomplete | 3 |\n| [N", "vulnerable_code": "FILE: 2023-04-caviar/src/EthRouter.sol\n\n constructor(address _royaltyRegistry) {\n royaltyRegistry = _royaltyRegistry;\n }", "fixed_code": "FILE: 2023-04-caviar/src/PrivatePool.sol\n\n143: constructor(address _factory, address _royaltyRegistry, address _stolenNftOracle) {\n144: factory = payable(_factory);\n145: royaltyRegistry = _royaltyRegistry;\n146: stolenNftOracle = _stolenNftOracle;\n147: }\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/Sathish9098-Q.md", "collected_at": "2026-01-02T18:20:06.615827+00:00", "source_hash": "7a03e96bbd1d66f5598ea5e430eaf59dce4843a787925bf68266e06536194453", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "FILE: 2023-04-caviar/src/EthRouter.sol\n\n constructor(address _royaltyRegistry) {\n royaltyRegistry = _royaltyRegistry;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "FILE: 2023-04-caviar/src/PrivatePool.sol\n\n143: constructor(address _factory, address _royaltyRegistry, address _stolenNftOracle) {\n144: factory = payable(_factory);\n145: royaltyRegistry = _royaltyRegistry;\n146: stolenNftOracle = _stolenNftOracle;\n147: }\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "06-lybra", "title": "Pechenite G", "severity_raw": "Low", "severity": "low", "description": "### [G\u201101] Use calldata instead of memory for arrays\n**Summary**\nYou can indeed use `calldata` instead of `memory` for the `_pools` array argument, because the function is marked as `external`.\nUsing `calldata` instead of `memory` can reduce the gas cost of this function, particularly for larger arrays.\n\n**There is 1 instance of this issue:**\n```solidity\nFile: contracts/lybra/miner/EUSDMiningIncentives.sol\n\n function setPools(address[] memory _pools) external onlyOwner {\n for (uint i = 0; i < _pools.length; i++) {\n require(configurator.mintVault(_pools[i]), \"NOT_VAULT\");\n }\n pools = _pools;\n }\n\n```\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/miner/EUSDMiningIncentives.sol#L93-L98\n\n**Potential Gas Savings**\nWhen array is passed as an argument of a function, the EVM charges gas for each element of the array.\nHere's the approximate cost:\n- 200 gas per word for memory\n- 3 gas per word for calldata\n\n\n### [G\u201102] Use internal function inside in the functions instead of modifiers to minimize the deployment cost.\n**Summary**\nWhen you use the modifier the whole code of the modifier is repeated every time. To minimize the deployment cost of your contract instead you can create an internal function with the code of the modifier and call it from the other functions who need it.\n\n**There are 8 instances of this issue:**\n```solidity\nFile: contracts/lybra/configuration/LybraConfigurator.sol\n\n modifier onlyRole(bytes32 role) {\n GovernanceTimelock.checkOnlyRole(role, msg.sender);\n _;\n }\n // https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/configuration/LybraConfigurator.sol#L85-L88\n```\n\n```solidity\nFile: contracts/lybra/configuration/LybraConfigurator.sol\n\n modifier checkRole(bytes32 role) {\n GovernanceTimelock.checkRole(role, msg.sender);\n _;\n }\n // https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/configuration/LybraConfigurator.sol#L", "vulnerable_code": "File: contracts/lybra/miner/EUSDMiningIncentives.sol\n\n function setPools(address[] memory _pools) external onlyOwner {\n for (uint i = 0; i < _pools.length; i++) {\n require(configurator.mintVault(_pools[i]), \"NOT_VAULT\");\n }\n pools = _pools;\n }\n", "fixed_code": "File: contracts/lybra/configuration/LybraConfigurator.sol\n\n modifier onlyRole(bytes32 role) {\n GovernanceTimelock.checkOnlyRole(role, msg.sender);\n _;\n }\n // https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/configuration/LybraConfigurator.sol#L85-L88", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/Pechenite-G.md", "collected_at": "2026-01-02T18:22:34.616640+00:00", "source_hash": "7a4b97f33e435e12526d7058efdce8b86f8bcc438c4291e296f07fb1f7826174", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 573, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/lybra/miner/EUSDMiningIncentives.sol\n\n function setPools(address[] memory _pools) external onlyOwner {\n for (uint i = 0; i < _pools.length; i++) {\n require(configurator.mintVault(_pools[i]), \"NOT_VAULT\");\n }\n pools = _pools;\n }", "primary_code_language": "solidity", "primary_code_char_count": 281, "all_code_blocks": "// Code block 1 (solidity):\nFile: contracts/lybra/miner/EUSDMiningIncentives.sol\n\n function setPools(address[] memory _pools) external onlyOwner {\n for (uint i = 0; i < _pools.length; i++) {\n require(configurator.mintVault(_pools[i]), \"NOT_VAULT\");\n }\n pools = _pools;\n }\n\n// Code block 2 (solidity):\nFile: contracts/lybra/configuration/LybraConfigurator.sol\n\n modifier onlyRole(bytes32 role) {\n GovernanceTimelock.checkOnlyRole(role, msg.sender);\n _;\n }\n // https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/configuration/LybraConfigurator.sol#L85-L88", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: contracts/lybra/miner/EUSDMiningIncentives.sol\n\n function setPools(address[] memory _pools) external onlyOwner {\n for (uint i = 0; i < _pools.length; i++) {\n require(configurator.mintVault(_pools[i]), \"NOT_VAULT\");\n }\n pools = _pools;\n }\n\nFile: contracts/lybra/configuration/LybraConfigurator.sol\n\n modifier onlyRole(bytes32 role) {\n GovernanceTimelock.checkOnlyRole(role, msg.sender);\n _;\n }\n // https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/configuration/LybraConfigurator.sol#L85-L88", "github_refs_formatted": "EUSDMiningIncentives.sol#L93-L98, LybraConfigurator.sol#L85-L88, LybraConfigurator.sol", "github_files_list": "EUSDMiningIncentives.sol, LybraConfigurator.sol", "github_refs_count": 3, "vulnerable_code_actual": "File: contracts/lybra/miner/EUSDMiningIncentives.sol\n\n function setPools(address[] memory _pools) external onlyOwner {\n for (uint i = 0; i < _pools.length; i++) {\n require(configurator.mintVault(_pools[i]), \"NOT_VAULT\");\n }\n pools = _pools;\n }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/lybra/configuration/LybraConfigurator.sol\n\n modifier onlyRole(bytes32 role) {\n GovernanceTimelock.checkOnlyRole(role, msg.sender);\n _;\n }\n // https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/configuration/LybraConfigurator.sol#L85-L88", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "02-ai-arena", "title": "Aamir Q", "severity_raw": "Critical", "severity": "critical", "description": "# Summary\n\n| Severity | Issue | Instance |\n| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- | -------- |\n| [[L-0](#low-0)] | `iconsTypes` length should also be checked in `FighterFarm::redeemMintPass(...)` | 1 |\n| [[L-1](#low-1)] | `customAttributes` are not checked for valid ranges when sent using `FighterFarm::mintFromMergingPool(...)` | 1 |\n| [[L-2](#low-2)] | No check for new Game Item is added in `GameItems::createGameItem(...)` | 1 |\n| [[L-3](#low-3)] | Add checks for duplicate addresses passed as winners in `MergingPool::pickWinner()` | 1 |\n| [[L-4](#low-4)] | Add Array parameter length checks in `MergingPool::claimRewards(...)` | 1 |\n| [[L-5](#low-5)] | `Neuron::mint(...)` contract can't mint tokens to the absolute value of `MAX_SUPPLY` | 1 |\n| [[L-6](#low-6)] | `globalStakedAmount` is not updated after the end of each round showing incorrect info. | 1 |\n| [[L-7](#low-7)] | Holder of the tokenId will not be to claim rewards in `RankedBattle::claimNRN(...)` if the NFT is transferred to another address | 1 |\n| [[L-8](#low-8)] | `RankedBattle::_getStakingFactor()` works in a biased way for small stakers. ", "vulnerable_code": "File: 2024-02-ai-arena/src/FighterFarm.sol\n\n243 require(\n244 mintpassIdsToBurn.length == mintPassDnas.length &&\n245 mintPassDnas.length == fighterTypes.length &&\n246 fighterTypes.length == modelHashes.length &&\n248 modelHashes.length == modelTypes.length\n249 );", "fixed_code": "File: 2024-02-ai-arena/src/FighterFarm.sol\n\n function _createFighterBase(\n uint256 dna,\n uint8 fighterType\n )\n private\n view\n returns (uint256, uint256, uint256)\n {\n@> uint256 element = dna % numElements[generation[fighterType]];\n@> uint256 weight = dna % 31 + 65;\n@> uint256 newDna = fighterType == 0 ? dna : uint256(fighterType);\n return (element, weight, newDna);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/Aamir-Q.md", "collected_at": "2026-01-02T19:02:13.362065+00:00", "source_hash": "7a68fdebfaa534af6364c88ff47b03570f0ef586a78c4d991f69ec8223feaa24", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: 2024-02-ai-arena/src/FighterFarm.sol\n\n243 require(\n244 mintpassIdsToBurn.length == mintPassDnas.length &&\n245 mintPassDnas.length == fighterTypes.length &&\n246 fighterTypes.length == modelHashes.length &&\n248 modelHashes.length == modelTypes.length\n249 );", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: 2024-02-ai-arena/src/FighterFarm.sol\n\n function _createFighterBase(\n uint256 dna,\n uint8 fighterType\n )\n private\n view\n returns (uint256, uint256, uint256)\n {\n@> uint256 element = dna % numElements[generation[fighterType]];\n@> uint256 weight = dna % 31 + 65;\n@> uint256 newDna = fighterType == 0 ? dna : uint256(fighterType);\n return (element, weight, newDna);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "02-ethos", "title": "Dinesh11G G", "severity_raw": "Low", "severity": "low", "description": "### 1st BUG\nDon't Initialize Variables with Default Value\n\n#### Impact\nIssue Information: \nUninitialized variables are assigned with the types default value.\n\nExplicitly initializing a variable with it's default value costs unnecessary gas.\n\nExample\n\ud83e\udd26 Bad:\n\nuint256 x = 0;\nbool y = false;\n\ud83d\ude80 Good:\n\nuint256 x;\nbool y;\n\n#### Findings:\n```\n2023-02-ethos/Ethos-Core/contracts/MultiTroveGetter.sol::72 => for (uint idx = 0; idx < _startIdx; ++idx) {\n2023-02-ethos/Ethos-Core/contracts/MultiTroveGetter.sol::78 => for (uint idx = 0; idx < _count; ++idx) {\n2023-02-ethos/Ethos-Core/contracts/MultiTroveGetter.sol::101 => for (uint idx = 0; idx < _startIdx; ++idx) {\n2023-02-ethos/Ethos-Core/contracts/MultiTroveGetter.sol::107 => for (uint idx = 0; idx < _count; ++idx) {\n2023-02-ethos/Ethos-Core/contracts/PriceFeed.sol::113 => for (uint256 i = 0; i < numCollaterals; i++) {\n```\n#### Tools used\nManual VS Code review\n\n### 2nd BUG\nCache Array Length Outside of Loop\n\n#### Impact\nIssue Information: \nCaching the array length outside a loop saves reading it on each iteration, as long as the array's length is not changed during the loop.\n\nExample\n\ud83e\udd26 Bad:\n\nfor (uint256 i = 0; i < array.length; i++) {\n // invariant: array's length is not changed\n}\n\ud83d\ude80 Good:\n\nuint256 len = array.length\nfor (uint256 i = 0; i < len; i++) {\n // invariant: array's length is not changed\n}\n\n#### Findings:\n```\n2023-02-ethos/Ethos-Core/contracts/ActivePool.sol::106 => uint256 numCollaterals = collaterals.length;\n2023-02-ethos/Ethos-Core/contracts/ActivePool.sol::107 => require(numCollaterals == _erc4626vaults.length, \"Vaults array length must match number of collaterals\");\n2023-02-ethos/Ethos-Core/contracts/CollateralConfig.sol::52 => require(_collaterals.length != 0, \"At least one collateral required\");\n2023-02-ethos/Ethos-Core/contracts/CollateralConfig.sol::53 => require(_MCRs.length == _collaterals.length, \"Array lengths must match\");\n2023-02-ethos/Ethos-Core/contracts/CollateralConfig.sol::54 => require(_CCRs.l", "vulnerable_code": "2023-02-ethos/Ethos-Core/contracts/MultiTroveGetter.sol::72 => for (uint idx = 0; idx < _startIdx; ++idx) {\n2023-02-ethos/Ethos-Core/contracts/MultiTroveGetter.sol::78 => for (uint idx = 0; idx < _count; ++idx) {\n2023-02-ethos/Ethos-Core/contracts/MultiTroveGetter.sol::101 => for (uint idx = 0; idx < _startIdx; ++idx) {\n2023-02-ethos/Ethos-Core/contracts/MultiTroveGetter.sol::107 => for (uint idx = 0; idx < _count; ++idx) {\n2023-02-ethos/Ethos-Core/contracts/PriceFeed.sol::113 => for (uint256 i = 0; i < numCollaterals; i++) {", "fixed_code": "2023-02-ethos/Ethos-Core/contracts/ActivePool.sol::106 => uint256 numCollaterals = collaterals.length;\n2023-02-ethos/Ethos-Core/contracts/ActivePool.sol::107 => require(numCollaterals == _erc4626vaults.length, \"Vaults array length must match number of collaterals\");\n2023-02-ethos/Ethos-Core/contracts/CollateralConfig.sol::52 => require(_collaterals.length != 0, \"At least one collateral required\");\n2023-02-ethos/Ethos-Core/contracts/CollateralConfig.sol::53 => require(_MCRs.length == _collaterals.length, \"Array lengths must match\");\n2023-02-ethos/Ethos-Core/contracts/CollateralConfig.sol::54 => require(_CCRs.length == _collaterals.length, \"Array lenghts must match\");\n2023-02-ethos/Ethos-Core/contracts/Dependencies/Address.sol::152 => if (returndata.length > 0) {\n2023-02-ethos/Ethos-Core/contracts/Dependencies/SafeERC20.sol::70 => if (returndata.length > 0) { // Return data is optional\n2023-02-ethos/Ethos-Core/contracts/Dependencies/UsingTellor.sol::359 => for (uint256 _i = 0; _i < _b.length; _i++) {\n2023-02-ethos/Ethos-Core/contracts/HintHelpers.sol::156 => Submitting numTrials = k * sqrt(length), with k = 15 makes it very, very likely that the ouput address will\n2023-02-ethos/Ethos-Core/contracts/HintHelpers.sol::157 => be <= sqrt(length) positions away from the correct insert position.\n2023-02-ethos/Ethos-Core/contracts/LQTY/LQTYStaking.sol::205 => amounts = new uint[](assets.length);\n2023-02-ethos/Ethos-Core/contracts/LQTY/LQTYStaking.sol::227 => uint[] memory amounts = new uint[](collaterals.length);\n2023-02-ethos/Ethos-Core/contracts/LQTY/LQTYStaking.sol::239 => uint numCollaterals = assets.length;\n2023-02-ethos/Ethos-Core/contracts/PriceFeed.sol::105 => uint256 numCollaterals = collaterals.length;\n2023-02-ethos/Ethos-Core/contracts/PriceFeed.sol::107 => require(_priceAggregatorAddresses.length == numCollaterals, \"Array lengths must match\");\n2023-02-ethos/Ethos-Core/contracts/PriceFeed.sol::108 => require(_tellorQueryIds.length == numCollaterals, \"Array lengths ", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/Dinesh11G-G.md", "collected_at": "2026-01-02T18:16:10.731086+00:00", "source_hash": "7a69cecf617130284e19bc84ffe76907d86129c138c52e482953239b309c6cf0", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 531, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "2023-02-ethos/Ethos-Core/contracts/MultiTroveGetter.sol::72 => for (uint idx = 0; idx < _startIdx; ++idx) {\n2023-02-ethos/Ethos-Core/contracts/MultiTroveGetter.sol::78 => for (uint idx = 0; idx < _count; ++idx) {\n2023-02-ethos/Ethos-Core/contracts/MultiTroveGetter.sol::101 => for (uint idx = 0; idx < _startIdx; ++idx) {\n2023-02-ethos/Ethos-Core/contracts/MultiTroveGetter.sol::107 => for (uint idx = 0; idx < _count; ++idx) {\n2023-02-ethos/Ethos-Core/contracts/PriceFeed.sol::113 => for (uint256 i = 0; i < numCollaterals; i++) {", "primary_code_language": "unknown", "primary_code_char_count": 531, "all_code_blocks": "// Code block 1 (unknown):\n2023-02-ethos/Ethos-Core/contracts/MultiTroveGetter.sol::72 => for (uint idx = 0; idx < _startIdx; ++idx) {\n2023-02-ethos/Ethos-Core/contracts/MultiTroveGetter.sol::78 => for (uint idx = 0; idx < _count; ++idx) {\n2023-02-ethos/Ethos-Core/contracts/MultiTroveGetter.sol::101 => for (uint idx = 0; idx < _startIdx; ++idx) {\n2023-02-ethos/Ethos-Core/contracts/MultiTroveGetter.sol::107 => for (uint idx = 0; idx < _count; ++idx) {\n2023-02-ethos/Ethos-Core/contracts/PriceFeed.sol::113 => for (uint256 i = 0; i < numCollaterals; i++) {", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "2023-02-ethos/Ethos-Core/contracts/MultiTroveGetter.sol::72 => for (uint idx = 0; idx < _startIdx; ++idx) {\n2023-02-ethos/Ethos-Core/contracts/MultiTroveGetter.sol::78 => for (uint idx = 0; idx < _count; ++idx) {\n2023-02-ethos/Ethos-Core/contracts/MultiTroveGetter.sol::101 => for (uint idx = 0; idx < _startIdx; ++idx) {\n2023-02-ethos/Ethos-Core/contracts/MultiTroveGetter.sol::107 => for (uint idx = 0; idx < _count; ++idx) {\n2023-02-ethos/Ethos-Core/contracts/PriceFeed.sol::113 => for (uint256 i = 0; i < numCollaterals; i++) {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "2023-02-ethos/Ethos-Core/contracts/ActivePool.sol::106 => uint256 numCollaterals = collaterals.length;\n2023-02-ethos/Ethos-Core/contracts/ActivePool.sol::107 => require(numCollaterals == _erc4626vaults.length, \"Vaults array length must match number of collaterals\");\n2023-02-ethos/Ethos-Core/contracts/CollateralConfig.sol::52 => require(_collaterals.length != 0, \"At least one collateral required\");\n2023-02-ethos/Ethos-Core/contracts/CollateralConfig.sol::53 => require(_MCRs.length == _collaterals.length, \"Array lengths must match\");\n2023-02-ethos/Ethos-Core/contracts/CollateralConfig.sol::54 => require(_CCRs.length == _collaterals.length, \"Array lenghts must match\");\n2023-02-ethos/Ethos-Core/contracts/Dependencies/Address.sol::152 => if (returndata.length > 0) {\n2023-02-ethos/Ethos-Core/contracts/Dependencies/SafeERC20.sol::70 => if (returndata.length > 0) { // Return data is optional\n2023-02-ethos/Ethos-Core/contracts/Dependencies/UsingTellor.sol::359 => for (uint256 _i = 0; _i < _b.length; _i++) {\n2023-02-ethos/Ethos-Core/contracts/HintHelpers.sol::156 => Submitting numTrials = k * sqrt(length), with k = 15 makes it very, very likely that the ouput address will\n2023-02-ethos/Ethos-Core/contracts/HintHelpers.sol::157 => be <= sqrt(length) positions away from the correct insert position.\n2023-02-ethos/Ethos-Core/contracts/LQTY/LQTYStaking.sol::205 => amounts = new uint[](assets.length);\n2023-02-ethos/Ethos-Core/contracts/LQTY/LQTYStaking.sol::227 => uint[] memory amounts = new uint[](collaterals.length);\n2023-02-ethos/Ethos-Core/contracts/LQTY/LQTYStaking.sol::239 => uint numCollaterals = assets.length;\n2023-02-ethos/Ethos-Core/contracts/PriceFeed.sol::105 => uint256 numCollaterals = collaterals.length;\n2023-02-ethos/Ethos-Core/contracts/PriceFeed.sol::107 => require(_priceAggregatorAddresses.length == numCollaterals, \"Array lengths must match\");\n2023-02-ethos/Ethos-Core/contracts/PriceFeed.sol::108 => require(_tellorQueryIds.length == numCollaterals, \"Array lengths ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-ondo", "title": "nicobevi Q", "severity_raw": "High", "severity": "high", "description": "# [QA] - OpenZeppelin's library used is too old. An upgrade is recommended.\n\nThe OZ's contracts library used on `contracts/cash` is the version `v4.4.1`. However, the newest version available is `v4.7.0`. The recommendation is to upgrade the library and install it through forge as an external library instead of copy the files to an internal folder.\n\n1. Install the library through forge command line:\n```sh\n forge install Openzeppelin/openzeppelin-contracts --no-commit\n forge install Openzeppelin/openzeppelin-contracts-upgradeable --no-commit\n```\n\n2. Remove the files from `/contracts/cash/external/openzeppelin`\n\n3. Add this line to your `remappings.txt` file:\n```txt\n @openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/\n @openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/\n```\n\n4. Change all the references to the installed version. (Fix the breaking changes that could popup with this change)\n```diff\n- import \"contracts/cash/external/openzeppelin/contracts/...\";\n+ import \"@openzeppelin/contracts/...\";\n\n- import \"contracts/cash/external/openzeppelin/contracts-upgradeable/access/IAccessControlEnumerableUpgradeable.sol\";\n+ import \"@openzeppelin/contracts-upgradeable/access/IAccessControlEnumerableUpgradeable.sol\";\n```\n\n# [QA] - Function params shadowing storage variables\nIf an input param has the same name than a storage variable, this one will be shadowed by that input variable. The recommendation is to change the names so these are unique.\n\n## Where\n* https://github.com/code-423n4/2023-01-ondo/blob/12537cc94f4b0e9b213d53906aa2f95e425dd899/contracts/cash/Proxy.sol#L25 (`_admin` is shadowing a storage variable)\n\n\n# [QA] - Different pragma versions across the project\nIt is recommended to use the same and fixed pragma version across the entire project. Currently we can find different versions on different contracts. \n\nFor example:\n* `/contracts/lending/tokens/cCash/CTokenCash.sol` is using `^0.8.10;`\n* `/contracts/cash/Proxy.so", "vulnerable_code": "2. Remove the files from `/contracts/cash/external/openzeppelin`\n\n3. Add this line to your `remappings.txt` file:", "fixed_code": "4. Change all the references to the installed version. (Fix the breaking changes that could popup with this change)", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/nicobevi-Q.md", "collected_at": "2026-01-02T18:15:23.285386+00:00", "source_hash": "7ab942723e6c3baea0cd9c9dd63c6529590576b007c8696fea8a3b675d4d437a", "code_block_count": 3, "solidity_block_count": 1, "total_code_chars": 604, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "forge install Openzeppelin/openzeppelin-contracts --no-commit\n forge install Openzeppelin/openzeppelin-contracts-upgradeable --no-commit", "primary_code_language": "sh", "primary_code_char_count": 137, "all_code_blocks": "// Code block 1 (sh):\nforge install Openzeppelin/openzeppelin-contracts --no-commit\n forge install Openzeppelin/openzeppelin-contracts-upgradeable --no-commit\n\n// Code block 2 (txt):\n@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/\n @openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/\n\n// Code block 3 (diff):\n- import \"contracts/cash/external/openzeppelin/contracts/...\";\n+ import \"@openzeppelin/contracts/...\";\n\n- import \"contracts/cash/external/openzeppelin/contracts-upgradeable/access/IAccessControlEnumerableUpgradeable.sol\";\n+ import \"@openzeppelin/contracts-upgradeable/access/IAccessControlEnumerableUpgradeable.sol\";", "all_code_blocks_count": 3, "has_diff_blocks": true, "diff_code": "- import \"contracts/cash/external/openzeppelin/contracts/...\";\n+ import \"@openzeppelin/contracts/...\";\n\n- import \"contracts/cash/external/openzeppelin/contracts-upgradeable/access/IAccessControlEnumerableUpgradeable.sol\";\n+ import \"@openzeppelin/contracts-upgradeable/access/IAccessControlEnumerableUpgradeable.sol\";", "solidity_code": "", "github_refs_formatted": "Proxy.sol#L25", "github_files_list": "Proxy.sol", "github_refs_count": 1, "vulnerable_code_actual": "2. Remove the files from `/contracts/cash/external/openzeppelin`\n\n3. Add this line to your `remappings.txt` file:", "has_vulnerable_code_snippet": true, "fixed_code_actual": "4. Change all the references to the installed version. (Fix the breaking changes that could popup with this change)", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 11} {"source": "c4", "protocol": "04-caviar", "title": "GT_Blockchain Q", "severity_raw": "High", "severity": "high", "description": "--- PrivatePool.sol ---\n\nA. Fee structure is inconsistent for buys/changes. In `buy()` and `sell()` function protocolFee is based on a percentage of the input/output amount but in `change()` the fee is based on the pool fee not the input amount. It should be based on the input/output amount for consistency\n\nB. Several places use the `ERC20.decimals()` function. `decimals()` is not a required part of the ERC20 standard, and not every token uses it. If the baseToken does not support decimals then the pool will be unusable since baseToken cannot be changed once initialized. Proper procedure is to wrap the decimals call in a \"try-catch\" block where decimals is default set at 18 if the call fails.\nLines 733 & 744, \n```\ntry ERC20(baseToken).decimals() returns (uint8 decimals) {\n exponent = 36 - decimals;\n } catch {\n // handle the exception here, e.g. set a default value\n exponent = 18;\n```\nhttps://eips.ethereum.org/EIPS/eip-20\n\nC. Functions that take in multiple arrays as parameters do not verify that the arrays are of equal length. This can result in unexpected outcomes and transaction failures.\n\nD. `FlashFee` is a flat amount, meaning the cost to flash loan an NFT at floor price is the same as one worth 5x the floor price. `FlashFee` should instead be based on the weigh of the NFT being flashloaned, with more expensive NFTs charging a higher fee.\n\nE. All external facing functions should have `nonReentrant` tagged to prevent reentrancy vulnerabilities.", "vulnerable_code": "try ERC20(baseToken).decimals() returns (uint8 decimals) {\n exponent = 36 - decimals;\n } catch {\n // handle the exception here, e.g. set a default value\n exponent = 18;", "fixed_code": "", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/GT_Blockchain-Q.md", "collected_at": "2026-01-02T18:19:40.787253+00:00", "source_hash": "7ac9264762ef2447773e7babddafc56f251efa6bd88ef41ad794d94e23044bfb", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 182, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "try ERC20(baseToken).decimals() returns (uint8 decimals) {\n exponent = 36 - decimals;\n } catch {\n // handle the exception here, e.g. set a default value\n exponent = 18;", "primary_code_language": "unknown", "primary_code_char_count": 182, "all_code_blocks": "// Code block 1 (unknown):\ntry ERC20(baseToken).decimals() returns (uint8 decimals) {\n exponent = 36 - decimals;\n } catch {\n // handle the exception here, e.g. set a default value\n exponent = 18;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "try ERC20(baseToken).decimals() returns (uint8 decimals) {\n exponent = 36 - decimals;\n } catch {\n // handle the exception here, e.g. set a default value\n exponent = 18;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.97} {"source": "c4", "protocol": "02-ethos", "title": "Morraez G", "severity_raw": "Medium", "severity": "medium", "description": "# Gas Optimizations - (Total Optimizations 326)\n\n## Mark storage variables as `immutable` if they never change after contract initialization.\n\nState variables can be declared as constant or immutable. In both cases, the variables cannot be modified after the contract has been constructed. For constant variables, the value has to be fixed at compile-time, while for immutable, it can still be assigned at construction time.\n\nThe compiler does not reserve a storage slot for these variables, and every occurrence is inlined by the respective value.\n\nCompared to regular state variables, the gas costs of constant and immutable variables are much lower. For a constant variable, the expression assigned to it is copied to all the places where it is accessed and also re-evaluated each time. This allows for local optimizations. Immutable variables are evaluated once at construction time and their value is copied to all the places in the code where they are accessed. For these values, 32 bytes are reserved, even if they would fit in fewer bytes. Due to this, constant values can sometimes be cheaper than immutable values.\n\n\n```js\n\ncontract GasTest is DSTest {\nContract0 c0;\nContract1 c1;\nContract2 c2;\n\nfunction setUp() public {\n c0 = new Contract0();\n c1 = new Contract1();\n c2 = new Contract2();\n\n}\n\nfunction testGas() public view {\n c0.addValue();\n c1.addImmutableValue();\n c2.addConstantValue();\n}\n}\n\ncontract Contract0 {\nuint256 val;\n\nconstructor() {\n val = 10000;\n}\n\nfunction addValue() public view {\n uint256 newVal = val + 1000;\n}\n}\n\ncontract Contract1 {\nuint256 immutable val;\n\nconstructor() {\n val = 10000;\n}\n\nfunction addImmutableValue() public view {\n uint256 newVal = val + 1000;\n}\n}\n\ncontract Contract2 {\nuint256 constant val = 10;\n\nfunction addConstantValue() public view {\n uint256 newVal = val + 1000;\n}\n}\n\n```\n\n### Gas Report\n```js\n\u256d\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n\u2502 Contract0 contract \u2506 \u2506 \u2506 ", "vulnerable_code": "contract GasTest is DSTest {\nContract0 c0;\nContract1 c1;\nContract2 c2;\n\nfunction setUp() public {\n c0 = new Contract0();\n c1 = new Contract1();\n c2 = new Contract2();\n\n}\n\nfunction testGas() public view {\n c0.addValue();\n c1.addImmutableValue();\n c2.addConstantValue();\n}\n}\n\ncontract Contract0 {\nuint256 val;\n\nconstructor() {\n val = 10000;\n}\n\nfunction addValue() public view {\n uint256 newVal = val + 1000;\n}\n}\n\ncontract Contract1 {\nuint256 immutable val;\n\nconstructor() {\n val = 10000;\n}\n\nfunction addImmutableValue() public view {\n uint256 newVal = val + 1000;\n}\n}\n\ncontract Contract2 {\nuint256 constant val = 10;\n\nfunction addConstantValue() public view {\n uint256 newVal = val + 1000;\n}\n}\n", "fixed_code": "\u256d\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n\u2502 Contract0 contract \u2506 \u2506 \u2506 \u2506 \u2506 \u2502\n\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561\n\u2502 Deployment Cost \u2506 Deployment Size \u2506 \u2506 \u2506 \u2506 \u2502\n\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n\u2502 54593 \u2506 198 \u2506 \u2506 \u2506 \u2506 \u2502\n\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n\u2502 Function Name \u2506 min \u2506 avg \u2506 median \u2506 max \u2506 # calls \u2502\n\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n\u2502 addValue \u2506 2302 \u2506 2302 \u2506 2302 \u2506 2302 \u2506 1 \u2502\n\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n\u256d\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n\u2502 Contract1 contract \u2506 \u2506 \u2506 \u2506 \u2506 \u2502\n\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561\n\u2502 Deployment Cost \u2506 Deployment Size \u2506 \u2506 \u2506 \u2506 \u2502\n\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n\u2502 38514 \u2506 239 \u2506 \u2506 \u2506 \u2506 \u2502\n\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n\u2502 Function Name \u2506 min \u2506 avg \u2506 median \u2506 max \u2506 # calls \u2502\n\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n\u2502 addImmutableValue \u2506 199 \u2506 199 \u2506 199 \u2506 199 \u2506 1 \u2502\n\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n\u256d\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n\u2502 Contract2 contract \u2506 \u2506 \u2506 \u2506 \u2506 \u2502\n\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561\n\u2502 Deployment Cost \u2506 Deployment Size \u2506 \u2506 \u2506 \u2506 \u2502\n\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n\u2502 32287 \u2506 191 ", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/Morraez-G.md", "collected_at": "2026-01-02T18:16:22.978659+00:00", "source_hash": "7af87f20be9fb58bfc4cead043f363935b2d69455302ad5ea592690ca944dc79", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 714, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "contract GasTest is DSTest {\nContract0 c0;\nContract1 c1;\nContract2 c2;\n\nfunction setUp() public {\n c0 = new Contract0();\n c1 = new Contract1();\n c2 = new Contract2();\n\n}\n\nfunction testGas() public view {\n c0.addValue();\n c1.addImmutableValue();\n c2.addConstantValue();\n}\n}\n\ncontract Contract0 {\nuint256 val;\n\nconstructor() {\n val = 10000;\n}\n\nfunction addValue() public view {\n uint256 newVal = val + 1000;\n}\n}\n\ncontract Contract1 {\nuint256 immutable val;\n\nconstructor() {\n val = 10000;\n}\n\nfunction addImmutableValue() public view {\n uint256 newVal = val + 1000;\n}\n}\n\ncontract Contract2 {\nuint256 constant val = 10;\n\nfunction addConstantValue() public view {\n uint256 newVal = val + 1000;\n}\n}", "primary_code_language": "js", "primary_code_char_count": 714, "all_code_blocks": "// Code block 1 (js):\ncontract GasTest is DSTest {\nContract0 c0;\nContract1 c1;\nContract2 c2;\n\nfunction setUp() public {\n c0 = new Contract0();\n c1 = new Contract1();\n c2 = new Contract2();\n\n}\n\nfunction testGas() public view {\n c0.addValue();\n c1.addImmutableValue();\n c2.addConstantValue();\n}\n}\n\ncontract Contract0 {\nuint256 val;\n\nconstructor() {\n val = 10000;\n}\n\nfunction addValue() public view {\n uint256 newVal = val + 1000;\n}\n}\n\ncontract Contract1 {\nuint256 immutable val;\n\nconstructor() {\n val = 10000;\n}\n\nfunction addImmutableValue() public view {\n uint256 newVal = val + 1000;\n}\n}\n\ncontract Contract2 {\nuint256 constant val = 10;\n\nfunction addConstantValue() public view {\n uint256 newVal = val + 1000;\n}\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "contract GasTest is DSTest {\nContract0 c0;\nContract1 c1;\nContract2 c2;\n\nfunction setUp() public {\n c0 = new Contract0();\n c1 = new Contract1();\n c2 = new Contract2();\n\n}\n\nfunction testGas() public view {\n c0.addValue();\n c1.addImmutableValue();\n c2.addConstantValue();\n}\n}\n\ncontract Contract0 {\nuint256 val;\n\nconstructor() {\n val = 10000;\n}\n\nfunction addValue() public view {\n uint256 newVal = val + 1000;\n}\n}\n\ncontract Contract1 {\nuint256 immutable val;\n\nconstructor() {\n val = 10000;\n}\n\nfunction addImmutableValue() public view {\n uint256 newVal = val + 1000;\n}\n}\n\ncontract Contract2 {\nuint256 constant val = 10;\n\nfunction addConstantValue() public view {\n uint256 newVal = val + 1000;\n}\n}\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "\u256d\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n\u2502 Contract0 contract \u2506 \u2506 \u2506 \u2506 \u2506 \u2502\n\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561\n\u2502 Deployment Cost \u2506 Deployment Size \u2506 \u2506 \u2506 \u2506 \u2502\n\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n\u2502 54593 \u2506 198 \u2506 \u2506 \u2506 \u2506 \u2502\n\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n\u2502 Function Name \u2506 min \u2506 avg \u2506 median \u2506 max \u2506 # calls \u2502\n\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n\u2502 addValue \u2506 2302 \u2506 2302 \u2506 2302 \u2506 2302 \u2506 1 \u2502\n\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n\u256d\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n\u2502 Contract1 contract \u2506 \u2506 \u2506 \u2506 \u2506 \u2502\n\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561\n\u2502 Deployment Cost \u2506 Deployment Size \u2506 \u2506 \u2506 \u2506 \u2502\n\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n\u2502 38514 \u2506 239 \u2506 \u2506 \u2506 \u2506 \u2502\n\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n\u2502 Function Name \u2506 min \u2506 avg \u2506 median \u2506 max \u2506 # calls \u2502\n\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n\u2502 addImmutableValue \u2506 199 \u2506 199 \u2506 199 \u2506 199 \u2506 1 \u2502\n\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n\u256d\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n\u2502 Contract2 contract \u2506 \u2506 \u2506 \u2506 \u2506 \u2502\n\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561\n\u2502 Deployment Cost \u2506 Deployment Size \u2506 \u2506 \u2506 \u2506 \u2502\n\u251c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u253c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u254c\u2524\n\u2502 32287 \u2506 191 ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "05-ajna", "title": "j4ld1na Q", "severity_raw": "Medium", "severity": "medium", "description": "| | Issues | Instances |\n| :-- | :--------------------------------------------------------------------------------------------------- | --------: |\n| 01 | Constants in comparisons should appear on the left side. | 28 |\n| 02 | Don't use of `Block.Timestamp` can be manipulat | 1 |\n| 03 | According to the syntax rules, use `=> mapping ( ` instead of `=> mapping(` using spaces as keyword. | 19 |\n\n## [01] Constants in comparisons should appear on the left side.\n\n_Constants on the left are better, but this is often trumped by a preference for English word order_\n\n_Doing so will prevent [typo bugs](https://www.moserware.com/2008/01/constants-on-left-are-better-but-this.html)._\n\nTypically we all write comparison statements like this:\n\n```java\nif (currentValue == 5)\n{\n // do work\n}\n```\n\nBut, the following is just as valid:\n\n```java\nif (5 == currentValue)\n{\n // do work\n}\n```\n\nThere are 28 instances:\n\n[ajna-grants/src/grants/GrantFund.sol#L39-L40](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/GrantFund.sol#L39-L40)\n\n```java\nif (_standardFundingProposals[proposalId_].proposalId != 0) return FundingMechanism.Standard;\n else if (_extraordinaryFundingProposals[proposalId_].proposalId != 0) return FundingMechanism.Extraordinary;\n```\n\n[ajna-core/src/PositionManager.sol#L146](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/PositionManager.sol#L146)\n\n```java\nif (positionIndexes[params_.tokenId].length() != 0) revert LiquidityNotRemoved();\n```\n\n[ajna-core/src/PositionManager.sol#L193](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/PositionManager.sol#L193)\n\n```java\nif (position.depositTime != 0) {\n```\n\n[ajna-core/src/PositionManager.sol#L271](https://github.com/code-423n4/2023-05-ajna/blob", "vulnerable_code": "But, the following is just as valid:\n", "fixed_code": "There are 28 instances:\n\n[ajna-grants/src/grants/GrantFund.sol#L39-L40](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/GrantFund.sol#L39-L40)\n", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/j4ld1na-Q.md", "collected_at": "2026-01-02T18:21:31.792188+00:00", "source_hash": "7b0f4d443d720b8b8b9ff9f10008e0661d4b9d65d739e6f7d763f32628b6543f", "code_block_count": 5, "solidity_block_count": 0, "total_code_chars": 405, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "if (currentValue == 5)\n{\n // do work\n}", "primary_code_language": "java", "primary_code_char_count": 41, "all_code_blocks": "// Code block 1 (java):\nif (currentValue == 5)\n{\n // do work\n}\n\n// Code block 2 (java):\nif (5 == currentValue)\n{\n // do work\n}\n\n// Code block 3 (java):\nif (_standardFundingProposals[proposalId_].proposalId != 0) return FundingMechanism.Standard;\n else if (_extraordinaryFundingProposals[proposalId_].proposalId != 0) return FundingMechanism.Extraordinary;\n\n// Code block 4 (java):\nif (positionIndexes[params_.tokenId].length() != 0) revert LiquidityNotRemoved();\n\n// Code block 5 (java):\nif (position.depositTime != 0) {", "all_code_blocks_count": 5, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "GrantFund.sol#L39-L40, PositionManager.sol#L146, PositionManager.sol#L193", "github_files_list": "GrantFund.sol, PositionManager.sol", "github_refs_count": 3, "vulnerable_code_actual": "But, the following is just as valid:\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "There are 28 instances:\n\n[ajna-grants/src/grants/GrantFund.sol#L39-L40](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/GrantFund.sol#L39-L40)\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 11} {"source": "c4", "protocol": "06-lybra", "title": "ayden Q", "severity_raw": "Gas", "severity": "gas", "description": "\n1.The result of function getPreUnlockableAmount should be cached into local variable instead of double calculate.\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/miner/ProtocolRewardsPool.sol#128#L144\n\n```solidity\n function unlockPrematurely() external {\n require(\n block.timestamp + exitCycle - 3 days >\n time2fullRedemption[msg.sender],\n \"ENW\"\n );\n+ uint256 preUnlockableAmount = getPreUnlockableAmount(msg.sender);\n- uint256 burnAmount = getReservedLBRForVesting(msg.sender) -\n- getPreUnlockableAmount(msg.sender);\n- uint256 amount = getPreUnlockableAmount(msg.sender) +\n getClaimAbleLBR(msg.sender);\n+ uint256 burnAmount = getReservedLBRForVesting(msg.sender) + preUnlockableAmount;\n+ uint256 amount = preUnlockableAmount - getClaimAbleLBR(msg.sender);\n if (amount > 0) {\n LBR.mint(msg.sender, amount);\n }\n unstakeRatio[msg.sender] = 0;\n time2fullRedemption[msg.sender] = 0;\n grabableAmount += burnAmount;\n }\n```\n\n2.LBR.burn will lost precision when amount is small\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/miner/ProtocolRewardsPool.sol#L156\n\n```solidity\n function testGrabEsLBR() public {\n vm.startPrank(Alice);\n assertEq(lbr.balanceOf(Alice), 1e18);\n\n for (uint256 i = 0; i < 10_000; i++) {\n pool.grabEsLBR(3);\n }\n\n assertEq(lbr.balanceOf(Alice), 1e18);\n assertEq(eslbr.balanceOf(Alice), 30_000);\n }\n```\n\n3.Change `x <= y ? x : y` to `x < y ? x : y` save 3 gas.\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/miner/stakerewardV2pool.sol#L147#L150\n\n4.`unlockPrematurely` should ensure user `time2fullRedemption` > 0.\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/miner/ProtocolRewardsPool.sol#L129#L145\n\n```solidity\n function unlockPrematurely() external {\n+ require(tim", "vulnerable_code": " function unlockPrematurely() external {\n require(\n block.timestamp + exitCycle - 3 days >\n time2fullRedemption[msg.sender],\n \"ENW\"\n );\n+ uint256 preUnlockableAmount = getPreUnlockableAmount(msg.sender);\n- uint256 burnAmount = getReservedLBRForVesting(msg.sender) -\n- getPreUnlockableAmount(msg.sender);\n- uint256 amount = getPreUnlockableAmount(msg.sender) +\n getClaimAbleLBR(msg.sender);\n+ uint256 burnAmount = getReservedLBRForVesting(msg.sender) + preUnlockableAmount;\n+ uint256 amount = preUnlockableAmount - getClaimAbleLBR(msg.sender);\n if (amount > 0) {\n LBR.mint(msg.sender, amount);\n }\n unstakeRatio[msg.sender] = 0;\n time2fullRedemption[msg.sender] = 0;\n grabableAmount += burnAmount;\n }", "fixed_code": " function testGrabEsLBR() public {\n vm.startPrank(Alice);\n assertEq(lbr.balanceOf(Alice), 1e18);\n\n for (uint256 i = 0; i < 10_000; i++) {\n pool.grabEsLBR(3);\n }\n\n assertEq(lbr.balanceOf(Alice), 1e18);\n assertEq(eslbr.balanceOf(Alice), 30_000);\n }", "recommendation": "", "category": "rounding", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/ayden-Q.md", "collected_at": "2026-01-02T18:22:51.212727+00:00", "source_hash": "7b66be650a6e1e6e5a9fb4f7f9ee5573fb11ea1168ddb410e8d973316b29e14a", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 1150, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function unlockPrematurely() external {\n require(\n block.timestamp + exitCycle - 3 days >\n time2fullRedemption[msg.sender],\n \"ENW\"\n );\n+ uint256 preUnlockableAmount = getPreUnlockableAmount(msg.sender);\n- uint256 burnAmount = getReservedLBRForVesting(msg.sender) -\n- getPreUnlockableAmount(msg.sender);\n- uint256 amount = getPreUnlockableAmount(msg.sender) +\n getClaimAbleLBR(msg.sender);\n+ uint256 burnAmount = getReservedLBRForVesting(msg.sender) + preUnlockableAmount;\n+ uint256 amount = preUnlockableAmount - getClaimAbleLBR(msg.sender);\n if (amount > 0) {\n LBR.mint(msg.sender, amount);\n }\n unstakeRatio[msg.sender] = 0;\n time2fullRedemption[msg.sender] = 0;\n grabableAmount += burnAmount;\n }", "primary_code_language": "solidity", "primary_code_char_count": 849, "all_code_blocks": "// Code block 1 (solidity):\nfunction unlockPrematurely() external {\n require(\n block.timestamp + exitCycle - 3 days >\n time2fullRedemption[msg.sender],\n \"ENW\"\n );\n+ uint256 preUnlockableAmount = getPreUnlockableAmount(msg.sender);\n- uint256 burnAmount = getReservedLBRForVesting(msg.sender) -\n- getPreUnlockableAmount(msg.sender);\n- uint256 amount = getPreUnlockableAmount(msg.sender) +\n getClaimAbleLBR(msg.sender);\n+ uint256 burnAmount = getReservedLBRForVesting(msg.sender) + preUnlockableAmount;\n+ uint256 amount = preUnlockableAmount - getClaimAbleLBR(msg.sender);\n if (amount > 0) {\n LBR.mint(msg.sender, amount);\n }\n unstakeRatio[msg.sender] = 0;\n time2fullRedemption[msg.sender] = 0;\n grabableAmount += burnAmount;\n }\n\n// Code block 2 (solidity):\nfunction testGrabEsLBR() public {\n vm.startPrank(Alice);\n assertEq(lbr.balanceOf(Alice), 1e18);\n\n for (uint256 i = 0; i < 10_000; i++) {\n pool.grabEsLBR(3);\n }\n\n assertEq(lbr.balanceOf(Alice), 1e18);\n assertEq(eslbr.balanceOf(Alice), 30_000);\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function unlockPrematurely() external {\n require(\n block.timestamp + exitCycle - 3 days >\n time2fullRedemption[msg.sender],\n \"ENW\"\n );\n+ uint256 preUnlockableAmount = getPreUnlockableAmount(msg.sender);\n- uint256 burnAmount = getReservedLBRForVesting(msg.sender) -\n- getPreUnlockableAmount(msg.sender);\n- uint256 amount = getPreUnlockableAmount(msg.sender) +\n getClaimAbleLBR(msg.sender);\n+ uint256 burnAmount = getReservedLBRForVesting(msg.sender) + preUnlockableAmount;\n+ uint256 amount = preUnlockableAmount - getClaimAbleLBR(msg.sender);\n if (amount > 0) {\n LBR.mint(msg.sender, amount);\n }\n unstakeRatio[msg.sender] = 0;\n time2fullRedemption[msg.sender] = 0;\n grabableAmount += burnAmount;\n }\n\nfunction testGrabEsLBR() public {\n vm.startPrank(Alice);\n assertEq(lbr.balanceOf(Alice), 1e18);\n\n for (uint256 i = 0; i < 10_000; i++) {\n pool.grabEsLBR(3);\n }\n\n assertEq(lbr.balanceOf(Alice), 1e18);\n assertEq(eslbr.balanceOf(Alice), 30_000);\n }", "github_refs_formatted": "ProtocolRewardsPool.sol, ProtocolRewardsPool.sol#L156, stakerewardV2pool.sol#L147, ProtocolRewardsPool.sol#L129", "github_files_list": "ProtocolRewardsPool.sol, stakerewardV2pool.sol", "github_refs_count": 4, "vulnerable_code_actual": " function unlockPrematurely() external {\n require(\n block.timestamp + exitCycle - 3 days >\n time2fullRedemption[msg.sender],\n \"ENW\"\n );\n+ uint256 preUnlockableAmount = getPreUnlockableAmount(msg.sender);\n- uint256 burnAmount = getReservedLBRForVesting(msg.sender) -\n- getPreUnlockableAmount(msg.sender);\n- uint256 amount = getPreUnlockableAmount(msg.sender) +\n getClaimAbleLBR(msg.sender);\n+ uint256 burnAmount = getReservedLBRForVesting(msg.sender) + preUnlockableAmount;\n+ uint256 amount = preUnlockableAmount - getClaimAbleLBR(msg.sender);\n if (amount > 0) {\n LBR.mint(msg.sender, amount);\n }\n unstakeRatio[msg.sender] = 0;\n time2fullRedemption[msg.sender] = 0;\n grabableAmount += burnAmount;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function testGrabEsLBR() public {\n vm.startPrank(Alice);\n assertEq(lbr.balanceOf(Alice), 1e18);\n\n for (uint256 i = 0; i < 10_000; i++) {\n pool.grabEsLBR(3);\n }\n\n assertEq(lbr.balanceOf(Alice), 1e18);\n assertEq(eslbr.balanceOf(Alice), 30_000);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "06-lybra", "title": "0xnacho Q", "severity_raw": "High", "severity": "high", "description": "# [L-01]: LybraWBETHVault: Misleading WBETH address specified in the comments\n\nThe WBETH address specified in the [LybraWBETHVault comments](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/LybraWbETHVault.sol#L16-L17) is misleading. The displayed address is actually the `rETH` mainnet address (https://etherscan.io/token/0xae78736Cd615f374D3085123A210448E74Fc6393).\n\n# [L-02]: LybraRETHVault: Initial value of `rkPool` variable is not valid on all the chains\n\nThe address which is used to initialize the `rkPool` variable is only valid on `mainnet`, but it doesn't correspond to a RocketPool Deposit pool on `Arbitrum` or other L2s.\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/LybraRETHVault.sol#L18\n\n```\nIRkPool rkPool = IRkPool(0xDD3f50F8A6CafbE9b31a427582963f465E745AF8);\n```\n\nTherefore, removing the `rkPool` initialization is highly recommended.\n\n# [L-03]: LybraPeUSDVaultBase#liquidation: redundant allowance check\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L131\n\n```\nrequire(PeUSD.allowance(provider, address(this)) > 0, \"provider should authorize to provide liquidation EUSD\");\n```\n\n1. This is checked for ulterior `PeUSD.transferFrom` (https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L197-L204) in the `_repay` function.\n2. The `transferFrom` method doesn't check for allowance if the vault is already a mint vault.\n3. `LybraPeUSDVaultBase` is a mint vault, so the allowance is not checked\n\nGiven these, the allowance check is redundant.\n\n# [L-04]: LybraPeUSDVaultBase: emitted `WithdrawAsset` - wrong params order\n\nDeclaration:\n\n```\nevent WithdrawAsset(address sponsor, address indexed onBehalfOf, address asset, uint256 amount, uint256 timestamp);\n```\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L219\n\n```\n emit WithdrawAsset(\n _provider,\n ", "vulnerable_code": "IRkPool rkPool = IRkPool(0xDD3f50F8A6CafbE9b31a427582963f465E745AF8);", "fixed_code": "require(PeUSD.allowance(provider, address(this)) > 0, \"provider should authorize to provide liquidation EUSD\");", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/0xnacho-Q.md", "collected_at": "2026-01-02T18:22:05.463395+00:00", "source_hash": "7b6928653b888ee1f06789d88cd8d6356f87a1b0b3d873f6f6de1bcf47843f79", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 295, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "IRkPool rkPool = IRkPool(0xDD3f50F8A6CafbE9b31a427582963f465E745AF8);", "primary_code_language": "unknown", "primary_code_char_count": 69, "all_code_blocks": "// Code block 1 (unknown):\nIRkPool rkPool = IRkPool(0xDD3f50F8A6CafbE9b31a427582963f465E745AF8);\n\n// Code block 2 (unknown):\nrequire(PeUSD.allowance(provider, address(this)) > 0, \"provider should authorize to provide liquidation EUSD\");\n\n// Code block 3 (unknown):\nevent WithdrawAsset(address sponsor, address indexed onBehalfOf, address asset, uint256 amount, uint256 timestamp);", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LybraWbETHVault.sol#L16-L17, LybraRETHVault.sol#L18, LybraPeUSDVaultBase.sol#L131, LybraPeUSDVaultBase.sol#L197-L204, LybraPeUSDVaultBase.sol#L219", "github_files_list": "LybraPeUSDVaultBase.sol, LybraWbETHVault.sol, LybraRETHVault.sol", "github_refs_count": 5, "vulnerable_code_actual": "IRkPool rkPool = IRkPool(0xDD3f50F8A6CafbE9b31a427582963f465E745AF8);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "require(PeUSD.allowance(provider, address(this)) > 0, \"provider should authorize to provide liquidation EUSD\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "08-dopex", "title": "Matin Q", "severity_raw": "Critical", "severity": "critical", "description": "## Summary\n\n### Low-Risk Issues\n\n| | Issue | Instances |\n| --- | --- | --- |\n| [L\u201101] | Early users can modify the underlying assets' unit share price | 1 |\n| [L\u201102] | Multiple roles needed to invoke the function settle() | 1 |\n\nTotal: 2 instances over 2 issues\n\n### Non-critical Issues\n\n| | Issue | Instances |\n| --- | --- | --- |\n| [N\u201101] | Wrong natspec descriptions | 1 |\n\nTotal: 8 instances over 3 issues\n\nNote: The above tables were created, considering the automatic findings and thus, those are not included.\n\n---\n\n## Low-Risk Issues\n\n### [L\u201101] **Early users can modify the underlying assets' unit share price**\n\nSummary: \n\nERC4626, an extension of ERC20, is a standard that is mostly used in yield-bearing tokens. The contract of an ERC4626 token itself is an ERC20 which serves as a \"shares\" token and has an underlying asset which is another ERC20. The idea behind this is in such a way that the users deposit their assets and get corresponding shares. The function `convertToShares()` is responsible for returning the corresponding share of a user with respect to his deposited assets.\n\n```Solidity\n function convertToShares(\n uint256 assets\n ) public view returns (uint256 shares) {\n uint256 supply = totalSupply;\n uint256 rdpxPriceInAlphaToken = perpetualAtlanticVault.getUnderlyingPrice();\n\n uint256 totalVaultCollateral = totalCollateral() +\n ((_rdpxCollateral * rdpxPriceInAlphaToken) / 1e8);\n return\n supply == 0 ? assets : assets.mulDivDown(supply, totalVaultCollateral);\n }\n```\n\nOne of the main problems with these tokens lies in the fact that the first depositor can manipulate the unit share price in a bad way. The ratio of $\\large\\dfrac{totalSupply}{totalAssets}$ determines the corresponding share of a deposited asset. As it is clear from the ratio if the first user deposits 1 Wei, will get 1 Wei worth of share. Now consider a scenario with the preceding steps:\n\n1 - The same bad guy deposits $\\large 10000 \\times 10^{18} - 1$ amount of un", "vulnerable_code": " function convertToShares(\n uint256 assets\n ) public view returns (uint256 shares) {\n uint256 supply = totalSupply;\n uint256 rdpxPriceInAlphaToken = perpetualAtlanticVault.getUnderlyingPrice();\n\n uint256 totalVaultCollateral = totalCollateral() +\n ((_rdpxCollateral * rdpxPriceInAlphaToken) / 1e8);\n return\n supply == 0 ? assets : assets.mulDivDown(supply, totalVaultCollateral);\n }", "fixed_code": " function convertToShares(\n uint256 assets\n ) public view returns (uint256 shares) {\n uint256 supply = totalSupply;\n uint256 rdpxPriceInAlphaToken = perpetualAtlanticVault.getUnderlyingPrice();\n\n uint256 totalVaultCollateral = totalCollateral() +\n ((_rdpxCollateral * rdpxPriceInAlphaToken) / 1e8);\n return\n supply == 0 ? assets : assets.mulDivDown(supply, totalVaultCollateral);\n }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/Matin-Q.md", "collected_at": "2026-01-02T18:24:52.004647+00:00", "source_hash": "7b7d26c01e4ba2eb2dea8affb34828e0df9a5387e06d2b2538ea745f48f07514", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 408, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function convertToShares(\n uint256 assets\n ) public view returns (uint256 shares) {\n uint256 supply = totalSupply;\n uint256 rdpxPriceInAlphaToken = perpetualAtlanticVault.getUnderlyingPrice();\n\n uint256 totalVaultCollateral = totalCollateral() +\n ((_rdpxCollateral * rdpxPriceInAlphaToken) / 1e8);\n return\n supply == 0 ? assets : assets.mulDivDown(supply, totalVaultCollateral);\n }", "primary_code_language": "Solidity", "primary_code_char_count": 408, "all_code_blocks": "// Code block 1 (Solidity):\nfunction convertToShares(\n uint256 assets\n ) public view returns (uint256 shares) {\n uint256 supply = totalSupply;\n uint256 rdpxPriceInAlphaToken = perpetualAtlanticVault.getUnderlyingPrice();\n\n uint256 totalVaultCollateral = totalCollateral() +\n ((_rdpxCollateral * rdpxPriceInAlphaToken) / 1e8);\n return\n supply == 0 ? assets : assets.mulDivDown(supply, totalVaultCollateral);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function convertToShares(\n uint256 assets\n ) public view returns (uint256 shares) {\n uint256 supply = totalSupply;\n uint256 rdpxPriceInAlphaToken = perpetualAtlanticVault.getUnderlyingPrice();\n\n uint256 totalVaultCollateral = totalCollateral() +\n ((_rdpxCollateral * rdpxPriceInAlphaToken) / 1e8);\n return\n supply == 0 ? assets : assets.mulDivDown(supply, totalVaultCollateral);\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function convertToShares(\n uint256 assets\n ) public view returns (uint256 shares) {\n uint256 supply = totalSupply;\n uint256 rdpxPriceInAlphaToken = perpetualAtlanticVault.getUnderlyingPrice();\n\n uint256 totalVaultCollateral = totalCollateral() +\n ((_rdpxCollateral * rdpxPriceInAlphaToken) / 1e8);\n return\n supply == 0 ? assets : assets.mulDivDown(supply, totalVaultCollateral);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function convertToShares(\n uint256 assets\n ) public view returns (uint256 shares) {\n uint256 supply = totalSupply;\n uint256 rdpxPriceInAlphaToken = perpetualAtlanticVault.getUnderlyingPrice();\n\n uint256 totalVaultCollateral = totalCollateral() +\n ((_rdpxCollateral * rdpxPriceInAlphaToken) / 1e8);\n return\n supply == 0 ? assets : assets.mulDivDown(supply, totalVaultCollateral);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "09-ondo", "title": "turvy_fuzz G", "severity_raw": "Gas", "severity": "gas", "description": "## the costly _attachThreshold() function can be adjusted to save gas\nthis:\n```solidity\nfunction _attachThreshold(\n uint256 amount,\n bytes32 txnHash,\n string memory srcChain\n ) internal {\n Threshold[] memory thresholds = chainToThresholds[srcChain];\n for (uint256 i = 0; i < thresholds.length; ++i) {\n Threshold memory t = thresholds[i];\n if (amount <= t.amount) {\n txnToThresholdSet[txnHash] = TxnThreshold(\n t.numberOfApprovalsNeeded,\n new address[](0)\n );\n break;\n }\n }\n if (txnToThresholdSet[txnHash].numberOfApprovalsNeeded == 0) {\n revert NoThresholdMatch();\n }\n }\n```\ncan be adjusted to this:\n```solidity\nfunction _attachThreshold(\n uint256 amount,\n bytes32 txnHash,\n string memory srcChain\n ) internal {\n Threshold[] memory thresholds = chainToThresholds[srcChain];\n TxnThreshold memory txnThreshold;\n for (uint256 i = 0; i < thresholds.length; ++i) {\n Threshold memory t = thresholds[i];\n if (amount <= t.amount) {\n txnThreshold = TxnThreshold(\n t.numberOfApprovalsNeeded,\n new address[](0)\n );\n break;\n }\n }\n if(txnThreshold.numberOfApprovalsNeeded == 0) {\n revert NoThresholdMatch();\n }\n txnToThresholdSet[txnHash] = txnThreshold;\n}\n```", "vulnerable_code": "function _attachThreshold(\n uint256 amount,\n bytes32 txnHash,\n string memory srcChain\n ) internal {\n Threshold[] memory thresholds = chainToThresholds[srcChain];\n for (uint256 i = 0; i < thresholds.length; ++i) {\n Threshold memory t = thresholds[i];\n if (amount <= t.amount) {\n txnToThresholdSet[txnHash] = TxnThreshold(\n t.numberOfApprovalsNeeded,\n new address[](0)\n );\n break;\n }\n }\n if (txnToThresholdSet[txnHash].numberOfApprovalsNeeded == 0) {\n revert NoThresholdMatch();\n }\n }", "fixed_code": "function _attachThreshold(\n uint256 amount,\n bytes32 txnHash,\n string memory srcChain\n ) internal {\n Threshold[] memory thresholds = chainToThresholds[srcChain];\n TxnThreshold memory txnThreshold;\n for (uint256 i = 0; i < thresholds.length; ++i) {\n Threshold memory t = thresholds[i];\n if (amount <= t.amount) {\n txnThreshold = TxnThreshold(\n t.numberOfApprovalsNeeded,\n new address[](0)\n );\n break;\n }\n }\n if(txnThreshold.numberOfApprovalsNeeded == 0) {\n revert NoThresholdMatch();\n }\n txnToThresholdSet[txnHash] = txnThreshold;\n}", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/turvy_fuzz-G.md", "collected_at": "2026-01-02T18:26:18.928767+00:00", "source_hash": "7ba23a93df5a967a50b30d6f3f29ad54dac80422b665c3f7d9f42bb2363e71a3", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 1182, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _attachThreshold(\n uint256 amount,\n bytes32 txnHash,\n string memory srcChain\n ) internal {\n Threshold[] memory thresholds = chainToThresholds[srcChain];\n for (uint256 i = 0; i < thresholds.length; ++i) {\n Threshold memory t = thresholds[i];\n if (amount <= t.amount) {\n txnToThresholdSet[txnHash] = TxnThreshold(\n t.numberOfApprovalsNeeded,\n new address[](0)\n );\n break;\n }\n }\n if (txnToThresholdSet[txnHash].numberOfApprovalsNeeded == 0) {\n revert NoThresholdMatch();\n }\n }", "primary_code_language": "solidity", "primary_code_char_count": 567, "all_code_blocks": "// Code block 1 (solidity):\nfunction _attachThreshold(\n uint256 amount,\n bytes32 txnHash,\n string memory srcChain\n ) internal {\n Threshold[] memory thresholds = chainToThresholds[srcChain];\n for (uint256 i = 0; i < thresholds.length; ++i) {\n Threshold memory t = thresholds[i];\n if (amount <= t.amount) {\n txnToThresholdSet[txnHash] = TxnThreshold(\n t.numberOfApprovalsNeeded,\n new address[](0)\n );\n break;\n }\n }\n if (txnToThresholdSet[txnHash].numberOfApprovalsNeeded == 0) {\n revert NoThresholdMatch();\n }\n }\n\n// Code block 2 (solidity):\nfunction _attachThreshold(\n uint256 amount,\n bytes32 txnHash,\n string memory srcChain\n ) internal {\n Threshold[] memory thresholds = chainToThresholds[srcChain];\n TxnThreshold memory txnThreshold;\n for (uint256 i = 0; i < thresholds.length; ++i) {\n Threshold memory t = thresholds[i];\n if (amount <= t.amount) {\n txnThreshold = TxnThreshold(\n t.numberOfApprovalsNeeded,\n new address[](0)\n );\n break;\n }\n }\n if(txnThreshold.numberOfApprovalsNeeded == 0) {\n revert NoThresholdMatch();\n }\n txnToThresholdSet[txnHash] = txnThreshold;\n}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function _attachThreshold(\n uint256 amount,\n bytes32 txnHash,\n string memory srcChain\n ) internal {\n Threshold[] memory thresholds = chainToThresholds[srcChain];\n for (uint256 i = 0; i < thresholds.length; ++i) {\n Threshold memory t = thresholds[i];\n if (amount <= t.amount) {\n txnToThresholdSet[txnHash] = TxnThreshold(\n t.numberOfApprovalsNeeded,\n new address[](0)\n );\n break;\n }\n }\n if (txnToThresholdSet[txnHash].numberOfApprovalsNeeded == 0) {\n revert NoThresholdMatch();\n }\n }\n\nfunction _attachThreshold(\n uint256 amount,\n bytes32 txnHash,\n string memory srcChain\n ) internal {\n Threshold[] memory thresholds = chainToThresholds[srcChain];\n TxnThreshold memory txnThreshold;\n for (uint256 i = 0; i < thresholds.length; ++i) {\n Threshold memory t = thresholds[i];\n if (amount <= t.amount) {\n txnThreshold = TxnThreshold(\n t.numberOfApprovalsNeeded,\n new address[](0)\n );\n break;\n }\n }\n if(txnThreshold.numberOfApprovalsNeeded == 0) {\n revert NoThresholdMatch();\n }\n txnToThresholdSet[txnHash] = txnThreshold;\n}", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function _attachThreshold(\n uint256 amount,\n bytes32 txnHash,\n string memory srcChain\n ) internal {\n Threshold[] memory thresholds = chainToThresholds[srcChain];\n for (uint256 i = 0; i < thresholds.length; ++i) {\n Threshold memory t = thresholds[i];\n if (amount <= t.amount) {\n txnToThresholdSet[txnHash] = TxnThreshold(\n t.numberOfApprovalsNeeded,\n new address[](0)\n );\n break;\n }\n }\n if (txnToThresholdSet[txnHash].numberOfApprovalsNeeded == 0) {\n revert NoThresholdMatch();\n }\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function _attachThreshold(\n uint256 amount,\n bytes32 txnHash,\n string memory srcChain\n ) internal {\n Threshold[] memory thresholds = chainToThresholds[srcChain];\n TxnThreshold memory txnThreshold;\n for (uint256 i = 0; i < thresholds.length; ++i) {\n Threshold memory t = thresholds[i];\n if (amount <= t.amount) {\n txnThreshold = TxnThreshold(\n t.numberOfApprovalsNeeded,\n new address[](0)\n );\n break;\n }\n }\n if(txnThreshold.numberOfApprovalsNeeded == 0) {\n revert NoThresholdMatch();\n }\n txnToThresholdSet[txnHash] = txnThreshold;\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6.63} {"source": "c4", "protocol": "01-salty", "title": "Tigerfrake Q", "severity_raw": "High", "severity": "high", "description": "# [01] Improper Indentation:\n\n### Description:\nThe indentation in the following instances is inconsistent, making it harder to read and understand the code.\nExample:\n\n```Solidity\n if ( address(swapTokenIn) == address(wbtc))\n if ( address(swapTokenOut) == address(weth))\n return (wbtc, salt);\n```\nProper indentation improves code readability.\n\n### Instances:\n\n- https://github.com/code-423n4/2024-01-salty/blob/main/src%2Farbitrage%2FArbitrageSearch.sol#L35-L37\n- https://github.com/code-423n4/2024-01-salty/blob/main/src%2Farbitrage%2FArbitrageSearch.sol#L41-L43\n\n### Recommendation:\n> Nest the two if checks with proper indentation or use the && operand in one if-check if both checks are required to be valid for these operations\n\n# [02] Avoid Block `Timestamp` Manipulation\n\n### Description:\n`Block timestamps` have been used historically for a number of purposes, including `entropy for random numbers locking funds for a set amount of time, and different state-changing, time-dependent conditional statements`. \nBecause validators have the capacity to slightly alter `timestamps`, using `block timestamps` wrongly in smart contracts can be quite risky.\nThe time difference between events can be estimated using `block.number` and the average `block time`. However, because `block times` can change and break functionality, it's best to avoid its use.\n\n### Instances:\nhttps://github.com/code-423n4/2024-01-salty/blob/main/src%2Fdao%2FProposals.sol#L392\n```Solidity\n if (block.timestamp < ballot.ballotMinimumEndTime )\n```\n\n# [03] Missing or Incomplete NatSpec\n\n### Description\nSome functions are missing `@notice/@dev` NatSpec comments for the function, `@param` for all/some of their parameters and `@return` for return values. Given that NatSpec is an important part of code documentation, this affects code comprehension, auditability and usability.\n\n### Instances:\nAll contracts\n\n### Recommendation\n> Consider adding in full NatSpec", "vulnerable_code": " if ( address(swapTokenIn) == address(wbtc))\n if ( address(swapTokenOut) == address(weth))\n return (wbtc, salt);", "fixed_code": " if (block.timestamp < ballot.ballotMinimumEndTime )", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/Tigerfrake-Q.md", "collected_at": "2026-01-02T19:01:30.918901+00:00", "source_hash": "7bc4347034828c0fea94da6333a10ebdd72b01b0c026ac8c4b4e2e821d403b73", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 200, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "if ( address(swapTokenIn) == address(wbtc))\n if ( address(swapTokenOut) == address(weth))\n return (wbtc, salt);", "primary_code_language": "Solidity", "primary_code_char_count": 149, "all_code_blocks": "// Code block 1 (Solidity):\nif ( address(swapTokenIn) == address(wbtc))\n if ( address(swapTokenOut) == address(weth))\n return (wbtc, salt);\n\n// Code block 2 (Solidity):\nif (block.timestamp < ballot.ballotMinimumEndTime )", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "if ( address(swapTokenIn) == address(wbtc))\n if ( address(swapTokenOut) == address(weth))\n return (wbtc, salt);\n\nif (block.timestamp < ballot.ballotMinimumEndTime )", "github_refs_formatted": "src%2Farbitrage%2FArbitrageSearch.sol#L35-L37, src%2Farbitrage%2FArbitrageSearch.sol#L41-L43, src%2Fdao%2FProposals.sol#L392", "github_files_list": "src%2Farbitrage%2FArbitrageSearch.sol, src%2Fdao%2FProposals.sol", "github_refs_count": 3, "vulnerable_code_actual": " if ( address(swapTokenIn) == address(wbtc))\n if ( address(swapTokenOut) == address(weth))\n return (wbtc, salt);", "has_vulnerable_code_snippet": true, "fixed_code_actual": " if (block.timestamp < ballot.ballotMinimumEndTime )", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-ondo", "title": "SleepingBugs Q", "severity_raw": "Low", "severity": "low", "description": "\n## Upgradeable contract is missing a __gap[50] storage variable to allow for new storage variables in later versions\n### Impact \nFor upgradeable contracts, there must be storage gap to \"allow developers to freely add new state variables in the future without compromising the storage compatibility with existing deployments\" (quote OpenZeppelin). Otherwise it may be very difficult to write new implementation code. Without storage gap, the variable in child contract might be overwritten by the upgraded base contract if new variables are added to the base contract. This could have unintended and very serious consequences to the child contracts, potentially causing loss of user fund or cause the contract to malfunction completely.\n\nSee this [doc page](https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps) form OpenZeppelin for a description of this storage variable. While some contracts may not currently be sub-classed, adding the variable now protects against forgetting to add it in the future.\n\n### Vulnerability Details\nIn the following context of the upgradeable contracts they are expected to use gaps for avoiding collision:\n- `ERC20PresetMinterPauserUpgradeable`\n- `Initializable`\n\nHowever, none of these contracts contain storage gap. The storage gap is essential for upgradeable contract because \"It allows us to freely add new state variables in the future without compromising the storage compatibility with existing deployments\". Refer to the bottom part of this [article](https://docs.openzeppelin.com/contracts/4.x/upgradeable).\n\nIf a contract inheriting from a base contract contains additional variable, then the base contract cannot be upgraded to include any additional variable, because it would overwrite the variable declared in its child contract. This greatly limits contract upgradeability.\n\n### Github Permalinks\nhttps://github.com/code-423n4/2023-01-ondo/blob/12537cc94f4b0e9b213d53906aa2f95e425dd899/contracts/cash/kyc/KYCRegistryClientInitializab", "vulnerable_code": "## Missing checks for address(0x0) when assigning values to `address` state or `immutable` variables \n`NOTE`: None of these findings where found by [Picodes. NC-1](https://gist.github.com/iFrostizz/bbbadb3d93229f60c94f01b6626c056d)\n\n### Summary\nZero address should be checked for state variables, immutable variables. \n\n### Impact\nUnexpected behaviors in edge cases\n\n### Github Permalinks\nThese 2 are not found by the automatic tool\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/12537cc94f4b0e9b213d53906aa2f95e425dd899/contracts/cash/kyc/KYCRegistry.sol#L57\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/12537cc94f4b0e9b213d53906aa2f95e425dd899/contracts/lending/JumpRateModelV2.sol#L66\n\n`NOTE`: These are already \"found\" but not at the correct line, so better don't count them, I add them to improve the review. All lines in the later 3 links in the automatic findings are L70, while real line is L54 or L57\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/12537cc94f4b0e9b213d53906aa2f95e425dd899/contracts/cash/factory/CashKYCSenderFactory.sol#L54\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/12537cc94f4b0e9b213d53906aa2f95e425dd899/contracts/cash/factory/CashKYCSenderReceiverFactory.sol#L54\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/12537cc94f4b0e9b213d53906aa2f95e425dd899/contracts/cash/kyc/KYCRegistry.sol#L57\n\n### Mitigation\nCheck zero address before assigning or using it", "fixed_code": "", "recommendation": "", "category": "validation", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/SleepingBugs-Q.md", "collected_at": "2026-01-02T18:14:48.904909+00:00", "source_hash": "7c7e977064bd364c1a677e1f9edefdec5e34bf6a4f85ce68383d9acc509aa466", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "KYCRegistry.sol#L57, JumpRateModelV2.sol#L66, CashKYCSenderFactory.sol#L54, CashKYCSenderReceiverFactory.sol#L54", "github_files_list": "JumpRateModelV2.sol, KYCRegistry.sol, CashKYCSenderReceiverFactory.sol, CashKYCSenderFactory.sol", "github_refs_count": 4, "vulnerable_code_actual": "## Missing checks for address(0x0) when assigning values to `address` state or `immutable` variables \n`NOTE`: None of these findings where found by [Picodes. NC-1](https://gist.github.com/iFrostizz/bbbadb3d93229f60c94f01b6626c056d)\n\n### Summary\nZero address should be checked for state variables, immutable variables. \n\n### Impact\nUnexpected behaviors in edge cases\n\n### Github Permalinks\nThese 2 are not found by the automatic tool\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/12537cc94f4b0e9b213d53906aa2f95e425dd899/contracts/cash/kyc/KYCRegistry.sol#L57\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/12537cc94f4b0e9b213d53906aa2f95e425dd899/contracts/lending/JumpRateModelV2.sol#L66\n\n`NOTE`: These are already \"found\" but not at the correct line, so better don't count them, I add them to improve the review. All lines in the later 3 links in the automatic findings are L70, while real line is L54 or L57\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/12537cc94f4b0e9b213d53906aa2f95e425dd899/contracts/cash/factory/CashKYCSenderFactory.sol#L54\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/12537cc94f4b0e9b213d53906aa2f95e425dd899/contracts/cash/factory/CashKYCSenderReceiverFactory.sol#L54\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/12537cc94f4b0e9b213d53906aa2f95e425dd899/contracts/cash/kyc/KYCRegistry.sol#L57\n\n### Mitigation\nCheck zero address before assigning or using it", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "06-lybra", "title": "Rickard Q", "severity_raw": "High", "severity": "high", "description": "# [N-01] Move IF/validation statements to the top of the function when validating input parameters\n````solidity\nFile: contracts/lybra/pools/LybraRETHVault.sol\n\n27 function depositEtherToMint(uint256 mintAmount) external payable override {\n28 require(msg.value >= 1 ether, \"DNL\");\n29 uint256 preBalance = collateralAsset.balanceOf(address(this));\n30 rkPool.deposit{value: msg.value}();\n31 uint256 balance = collateralAsset.balanceOf(address(this));\n32 depositedAsset[msg.sender] += balance - preBalance;\n33 \n34: if (mintAmount > 0) {\n35: _mintPeUSD(msg.sender, msg.sender, mintAmount, getAssetPrice());\n36: }\n````\n[LybraRETHVault.sol#L27-L39](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/LybraRETHVault.sol#L27-L39) \n\nSame goes for: \n[LybraStETHVault.sol#L47-L49](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/LybraStETHVault.sol#L47-L49), [LybraWbETHVault.sol#L27-L29](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/LybraWbETHVault.sol#L27-L29), [LybraWstETHVault.sol#L41-L43](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/LybraWstETHVault.sol#L41-L43), [LybraEUSDVaultBase.sol#L82-L84](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/base/LybraEUSDVaultBase.sol#L82-L84), [LybraPeUSDVaultBase.sol#L65-L68](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L65-L68).\n````solidity\nFile: contracts/lybra/pools/base/LybraPeUSDVaultBase.sol\n212 function _withdraw(address _provider, address _onBehalfOf, uint256 _amount) internal {\n213 require(depositedAsset[_provider] >= _amount, \"Withdraw amount exceeds deposited amount.\");\n214 depositedAsset[_provider] -= _amount;\n215 collateralAsset.transfer(_onBehalfOf, _amount);\n216: if (getBorrowedOf(_p", "vulnerable_code": "File: contracts/lybra/pools/LybraRETHVault.sol\n\n27 function depositEtherToMint(uint256 mintAmount) external payable override {\n28 require(msg.value >= 1 ether, \"DNL\");\n29 uint256 preBalance = collateralAsset.balanceOf(address(this));\n30 rkPool.deposit{value: msg.value}();\n31 uint256 balance = collateralAsset.balanceOf(address(this));\n32 depositedAsset[msg.sender] += balance - preBalance;\n33 \n34: if (mintAmount > 0) {\n35: _mintPeUSD(msg.sender, msg.sender, mintAmount, getAssetPrice());\n36: }", "fixed_code": "File: contracts/lybra/pools/base/LybraPeUSDVaultBase.sol\n212 function _withdraw(address _provider, address _onBehalfOf, uint256 _amount) internal {\n213 require(depositedAsset[_provider] >= _amount, \"Withdraw amount exceeds deposited amount.\");\n214 depositedAsset[_provider] -= _amount;\n215 collateralAsset.transfer(_onBehalfOf, _amount);\n216: if (getBorrowedOf(_provider) > 0) {\n217: _checkHealth(_provider, getAssetPrice());\n218: }", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/Rickard-Q.md", "collected_at": "2026-01-02T18:22:39.540122+00:00", "source_hash": "7d04de045b9310b4f6a123125996f3d9e229d7fa5afe87f861b380ad32a53fde", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 590, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/lybra/pools/LybraRETHVault.sol\n\n27 function depositEtherToMint(uint256 mintAmount) external payable override {\n28 require(msg.value >= 1 ether, \"DNL\");\n29 uint256 preBalance = collateralAsset.balanceOf(address(this));\n30 rkPool.deposit{value: msg.value}();\n31 uint256 balance = collateralAsset.balanceOf(address(this));\n32 depositedAsset[msg.sender] += balance - preBalance;\n33 \n34: if (mintAmount > 0) {\n35: _mintPeUSD(msg.sender, msg.sender, mintAmount, getAssetPrice());\n36: }", "primary_code_language": "solidity", "primary_code_char_count": 590, "all_code_blocks": "// Code block 1 (solidity):\nFile: contracts/lybra/pools/LybraRETHVault.sol\n\n27 function depositEtherToMint(uint256 mintAmount) external payable override {\n28 require(msg.value >= 1 ether, \"DNL\");\n29 uint256 preBalance = collateralAsset.balanceOf(address(this));\n30 rkPool.deposit{value: msg.value}();\n31 uint256 balance = collateralAsset.balanceOf(address(this));\n32 depositedAsset[msg.sender] += balance - preBalance;\n33 \n34: if (mintAmount > 0) {\n35: _mintPeUSD(msg.sender, msg.sender, mintAmount, getAssetPrice());\n36: }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: contracts/lybra/pools/LybraRETHVault.sol\n\n27 function depositEtherToMint(uint256 mintAmount) external payable override {\n28 require(msg.value >= 1 ether, \"DNL\");\n29 uint256 preBalance = collateralAsset.balanceOf(address(this));\n30 rkPool.deposit{value: msg.value}();\n31 uint256 balance = collateralAsset.balanceOf(address(this));\n32 depositedAsset[msg.sender] += balance - preBalance;\n33 \n34: if (mintAmount > 0) {\n35: _mintPeUSD(msg.sender, msg.sender, mintAmount, getAssetPrice());\n36: }", "github_refs_formatted": "LybraRETHVault.sol#L27-L39, LybraStETHVault.sol#L47-L49, LybraWbETHVault.sol#L27-L29, LybraWstETHVault.sol#L41-L43, LybraEUSDVaultBase.sol#L82-L84, LybraPeUSDVaultBase.sol#L65-L68", "github_files_list": "LybraEUSDVaultBase.sol, LybraWstETHVault.sol, LybraRETHVault.sol, LybraStETHVault.sol, LybraWbETHVault.sol, LybraPeUSDVaultBase.sol", "github_refs_count": 6, "vulnerable_code_actual": "File: contracts/lybra/pools/LybraRETHVault.sol\n\n27 function depositEtherToMint(uint256 mintAmount) external payable override {\n28 require(msg.value >= 1 ether, \"DNL\");\n29 uint256 preBalance = collateralAsset.balanceOf(address(this));\n30 rkPool.deposit{value: msg.value}();\n31 uint256 balance = collateralAsset.balanceOf(address(this));\n32 depositedAsset[msg.sender] += balance - preBalance;\n33 \n34: if (mintAmount > 0) {\n35: _mintPeUSD(msg.sender, msg.sender, mintAmount, getAssetPrice());\n36: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/lybra/pools/base/LybraPeUSDVaultBase.sol\n212 function _withdraw(address _provider, address _onBehalfOf, uint256 _amount) internal {\n213 require(depositedAsset[_provider] >= _amount, \"Withdraw amount exceeds deposited amount.\");\n214 depositedAsset[_provider] -= _amount;\n215 collateralAsset.transfer(_onBehalfOf, _amount);\n216: if (getBorrowedOf(_provider) > 0) {\n217: _checkHealth(_provider, getAssetPrice());\n218: }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-salty", "title": "b0g0 Q", "severity_raw": "Medium", "severity": "medium", "description": "## [L-01] Signature verification function does not prevent signature malleability\n\n## Issue Description\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/SigningTools.sol#L11\n\nA common attack vector when it comes to using signatures is their malleability. In simple terms this allows an already used signature to be modified without changing it's signed data and reusing it a second time ([article](https://medium.com/draftkings-engineering/signature-malleability-7a804429b14a)). The way to prevent this is to check that s value of the signature is in the lower half order, and the v value to be either 27 or 28. However the `_verifySignature` inside `SigningTools.sol` library doesn't do this and allows such forged signatures to be accepted. This is used during voting to start the exchange and could lead to double votes\n\n```\nfunction _verifySignature(\n bytes32 messageHash,\n bytes memory signature\n ) internal pure returns (bool) {\n require(signature.length == 65, \"Invalid signature length\");\n\n bytes32 r;\n bytes32 s;\n uint8 v;\n\n //@audit [L] -> does not check for upper/lower value of the signature\n\n assembly {\n r := mload(add(signature, 0x20))\n s := mload(add(signature, 0x40))\n v := mload(add(signature, 0x41))\n }\n\n address recoveredAddress = ecrecover(messageHash, v, r, s);\n\n return (recoveredAddress == EXPECTED_SIGNER);\n }\n```\n\n## Recommended Mitigation Steps\nConsider using OpenZeppelin ECDSA library (which handles this) instead of implementing it yourself -> https://docs.openzeppelin.com/contracts/2.x/api/cryptography#ECDSA-recover-bytes32-bytes-\n\n## [L-02] BoostrapBallot does not use `deadline` in the signature when verifying votes in the `vote()` method\n\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/launch/BootstrapBallot.sol#L48\n\n## Issue Description\nUsing deadlines", "vulnerable_code": "function _verifySignature(\n bytes32 messageHash,\n bytes memory signature\n ) internal pure returns (bool) {\n require(signature.length == 65, \"Invalid signature length\");\n\n bytes32 r;\n bytes32 s;\n uint8 v;\n\n //@audit [L] -> does not check for upper/lower value of the signature\n\n assembly {\n r := mload(add(signature, 0x20))\n s := mload(add(signature, 0x40))\n v := mload(add(signature, 0x41))\n }\n\n address recoveredAddress = ecrecover(messageHash, v, r, s);\n\n return (recoveredAddress == EXPECTED_SIGNER);\n }", "fixed_code": "function finalizeBallot() external nonReentrant {\n require(!ballotFinalized, \"Ballot has already been finalized\");\n require(\n block.timestamp >= completionTimestamp,\n \"Ballot is not yet complete\"\n );\n\n if (startExchangeYes > startExchangeNo) {\n exchangeConfig.initialDistribution().distributionApproved();\n //@audit - there is a nested nasty loop here- can deployment go out of gas for too many whitelisted pools\n exchangeConfig.dao().pools().startExchangeApproved();\n\n startExchangeApproved = true;\n }\n\n emit BallotFinalized(startExchangeApproved);\n\n ballotFinalized = true;\n }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/b0g0-Q.md", "collected_at": "2026-01-02T19:01:33.152976+00:00", "source_hash": "7d35e40769e0e1db5249935ea1eaaaf88f07d7e587ae188a0c927ce0bc51e143", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 622, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _verifySignature(\n bytes32 messageHash,\n bytes memory signature\n ) internal pure returns (bool) {\n require(signature.length == 65, \"Invalid signature length\");\n\n bytes32 r;\n bytes32 s;\n uint8 v;\n\n //@audit [L] -> does not check for upper/lower value of the signature\n\n assembly {\n r := mload(add(signature, 0x20))\n s := mload(add(signature, 0x40))\n v := mload(add(signature, 0x41))\n }\n\n address recoveredAddress = ecrecover(messageHash, v, r, s);\n\n return (recoveredAddress == EXPECTED_SIGNER);\n }", "primary_code_language": "unknown", "primary_code_char_count": 622, "all_code_blocks": "// Code block 1 (unknown):\nfunction _verifySignature(\n bytes32 messageHash,\n bytes memory signature\n ) internal pure returns (bool) {\n require(signature.length == 65, \"Invalid signature length\");\n\n bytes32 r;\n bytes32 s;\n uint8 v;\n\n //@audit [L] -> does not check for upper/lower value of the signature\n\n assembly {\n r := mload(add(signature, 0x20))\n s := mload(add(signature, 0x40))\n v := mload(add(signature, 0x41))\n }\n\n address recoveredAddress = ecrecover(messageHash, v, r, s);\n\n return (recoveredAddress == EXPECTED_SIGNER);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SigningTools.sol#L11, BootstrapBallot.sol#L48", "github_files_list": "SigningTools.sol, BootstrapBallot.sol", "github_refs_count": 2, "vulnerable_code_actual": "function _verifySignature(\n bytes32 messageHash,\n bytes memory signature\n ) internal pure returns (bool) {\n require(signature.length == 65, \"Invalid signature length\");\n\n bytes32 r;\n bytes32 s;\n uint8 v;\n\n //@audit [L] -> does not check for upper/lower value of the signature\n\n assembly {\n r := mload(add(signature, 0x20))\n s := mload(add(signature, 0x40))\n v := mload(add(signature, 0x41))\n }\n\n address recoveredAddress = ecrecover(messageHash, v, r, s);\n\n return (recoveredAddress == EXPECTED_SIGNER);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function finalizeBallot() external nonReentrant {\n require(!ballotFinalized, \"Ballot has already been finalized\");\n require(\n block.timestamp >= completionTimestamp,\n \"Ballot is not yet complete\"\n );\n\n if (startExchangeYes > startExchangeNo) {\n exchangeConfig.initialDistribution().distributionApproved();\n //@audit - there is a nested nasty loop here- can deployment go out of gas for too many whitelisted pools\n exchangeConfig.dao().pools().startExchangeApproved();\n\n startExchangeApproved = true;\n }\n\n emit BallotFinalized(startExchangeApproved);\n\n ballotFinalized = true;\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "11-kelp", "title": "Shawon G", "severity_raw": "Gas", "severity": "gas", "description": "# Don't store data in a variable if it is used only once.\n\n``` solidity \nfile: utils/LRTDeposit.sol\n\n81 uint256 ndcsCount = nodeDelegatorQueue.length;\n for (uint256 i; i < ndcsCount;) {\n assetLyingInNDCs += IERC20(asset).balanceOf(nodeDelegatorQueue[i]);\n assetStakedInEigenLayer += INodeDelegator(nodeDelegatorQueue[i]).getAssetBalance(asset);\n unchecked {\n ++i;\n }\n }\n }\n```\nThe value of `nodeDelegatorQueue.length` is used only once and caching it inside a uint256 variable would only use memory storage hence,\nincreasing the gas price.\n\nInsdead, do this:\n\n``` solidity\nfor (uint256 i; i < nodeDelegatorQueue.length;) {\n assetLyingInNDCs += IERC20(asset).balanceOf(nodeDelegatorQueue[i]);\n assetStakedInEigenLayer += INodeDelegator(nodeDelegatorQueue[i]).getAssetBalance(asset);\n unchecked {\n ++i;\n }\n }\n }\n```", "vulnerable_code": "The value of `nodeDelegatorQueue.length` is used only once and caching it inside a uint256 variable would only use memory storage hence,\nincreasing the gas price.\n\nInsdead, do this:\n", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/Shawon-G.md", "collected_at": "2026-01-02T18:27:40.305174+00:00", "source_hash": "7db1af1485da90c475684033ebae2c95c311a54df7f479645cc09c2c14e9cd9b", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 181, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "The value of `nodeDelegatorQueue.length` is used only once and caching it inside a uint256 variable would only use memory storage hence,\nincreasing the gas price.\n\nInsdead, do this:", "primary_code_language": "unknown", "primary_code_char_count": 181, "all_code_blocks": "// Code block 1 (unknown):\nThe value of `nodeDelegatorQueue.length` is used only once and caching it inside a uint256 variable would only use memory storage hence,\nincreasing the gas price.\n\nInsdead, do this:", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "The value of `nodeDelegatorQueue.length` is used only once and caching it inside a uint256 variable would only use memory storage hence,\nincreasing the gas price.\n\nInsdead, do this:\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 3.92} {"source": "c4", "protocol": "08-dopex", "title": "Stormreckson Q", "severity_raw": "Medium", "severity": "medium", "description": "1- https://github.com/code-423n4/2023-08-dopex/blob/b174dcd7b68a5372d7b9a97c9dd50895e742689c/contracts/core/RdpxV2Core.sol#L894-L899\n\n\nIn the `bond` function,the `_to` parameter represents the recipient of the bond receipt, it wouldbe rational for `_to` to be `msg.sender`.\nSetting `_to` as `msg.sender` would ensure that the bond receipt is sent directly to the caller of the function who is making the bond with the delegates. \n\ni. Setting `_to` as msg.sender eliminates the need for the caller to provide an additional address parameter, simplifying the function call.\n\nii. By using msg.sender as the recipient, it avoids an additional storage write operation to store the recipient's address, resulting in potential gas savings.\n\niii. Gas Efficiency: By using msg.sender as the recipient, it avoids an additional storage write operation to store the recipient's address, resulting in potential gas savings.\nIn order to make the functionality more intuitive and align it with the caller's intent, I propose updating the `bondWithDelegate` function to set the `_to` parameter as `msg.sender`. By doing so, the caller of the function will automatically become the recipient of the bond receipt.\n\nModified Function:\n\n\n function bondWithDelegate(\n uint256[] memory _amounts,\n uint256[] memory _delegateIds,\n uint256 rdpxBondId\n ) public returns (uint256 \n receiptTokenAmount, uint256[] \n memory delegateReceiptTokenAmounts)\n\nThe change only adjusts the default behavior so that the caller becomes the recipient of the bond receipt. It improves usability and saves users from the need to explicitly provide their own address as the receipt recipient.\n\n2- there are some confusing function descriptions in `RdpxV2core.sol` contract.\nIt states only the `owner` can call certain functions whereas the function `Roles` points to the `Admin`, for clearity purpose I suggest changing them to follow the function implementations.\n\nhttps://github.com", "vulnerable_code": " /**\n * @notice Pauses the vault for emergency cases\n * @dev Can only be called by the owner\n **/\n function pause() external onlyRole(DEFAULT_ADMIN_ROLE) {\n\n /**\n * @notice Unpauses the vault\n * @dev Can only be called by the owner\n **/\n function unpause() external onlyRole(DEFAULT_ADMIN_ROLE) {\n\n /**\n * @notice Transfers all funds to msg.sender\n * @dev Can only be called by the owner\n * @param tokens The list of erc20 tokens to withdraw\n **/\n function emergencyWithdraw(\n address[] calldata tokens\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {", "fixed_code": " for (uint256 i = 0; i < optionIds.length; i++) {\n uint256 strike = optionPositions[optionIds[i]].strike;\n uint256 amount = optionPositions[optionIds[i]].amount;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/Stormreckson-Q.md", "collected_at": "2026-01-02T18:25:06.298300+00:00", "source_hash": "7dd4302390137f624f7255a4eea45494334c4822fbd0ce5489adf028034e6389", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "RdpxV2Core.sol#L894-L899", "github_files_list": "RdpxV2Core.sol", "github_refs_count": 1, "vulnerable_code_actual": " /**\n * @notice Pauses the vault for emergency cases\n * @dev Can only be called by the owner\n **/\n function pause() external onlyRole(DEFAULT_ADMIN_ROLE) {\n\n /**\n * @notice Unpauses the vault\n * @dev Can only be called by the owner\n **/\n function unpause() external onlyRole(DEFAULT_ADMIN_ROLE) {\n\n /**\n * @notice Transfers all funds to msg.sender\n * @dev Can only be called by the owner\n * @param tokens The list of erc20 tokens to withdraw\n **/\n function emergencyWithdraw(\n address[] calldata tokens\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {", "has_vulnerable_code_snippet": true, "fixed_code_actual": " for (uint256 i = 0; i < optionIds.length; i++) {\n uint256 strike = optionPositions[optionIds[i]].strike;\n uint256 amount = optionPositions[optionIds[i]].amount;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "06-lybra", "title": "Grzegorz Q", "severity_raw": "Unknown", "severity": "unknown", "description": "# The LybraConfigurator.setBadCollateralRatio function emits incorrect event. It should emit BadCollaterialRatioChanged instead of SafeCollateralRatioChanged.\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/configuration/LybraConfigurator.sol#L126C1-L130\n```\n function setBadCollateralRatio(address pool, uint256 newRatio) external onlyRole(DAO) {\n require(newRatio >= 130 * 1e18 && newRatio <= 150 * 1e18 && newRatio <= vaultSafeCollateralRatio[pool] + 1e19, \"LNA\");\n vaultBadCollateralRatio[pool] = newRatio;\n emit SafeCollateralRatioChanged(pool, newRatio);\n }\n```\n\n# The EUSDMiningIncentives.notifyRewardAmount function call can be used to significantly reduce rewardRatio.\n1. Let's assume duration=1_000_000\n Admin calls EUSDMiningIncentives.notifyRewardAmount(1_000_000)\nrewardRatio = 1_000_000 / 1_000_000 = 1\n2. After half of the duration admin calls EUSDMiningIncentives.notifyRewardAmount(2)\nremainingRewards = 500_000\nrewardRatio = ((1_000_000 - 500_000) + 2) / 1_000_000 = 0.502\n", "vulnerable_code": " function setBadCollateralRatio(address pool, uint256 newRatio) external onlyRole(DAO) {\n require(newRatio >= 130 * 1e18 && newRatio <= 150 * 1e18 && newRatio <= vaultSafeCollateralRatio[pool] + 1e19, \"LNA\");\n vaultBadCollateralRatio[pool] = newRatio;\n emit SafeCollateralRatioChanged(pool, newRatio);\n }", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/Grzegorz-Q.md", "collected_at": "2026-01-02T18:22:18.637042+00:00", "source_hash": "7df409d514853d59f1774f62f18e050953a09966404a86f751746de08625b4e1", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 327, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function setBadCollateralRatio(address pool, uint256 newRatio) external onlyRole(DAO) {\n require(newRatio >= 130 * 1e18 && newRatio <= 150 * 1e18 && newRatio <= vaultSafeCollateralRatio[pool] + 1e19, \"LNA\");\n vaultBadCollateralRatio[pool] = newRatio;\n emit SafeCollateralRatioChanged(pool, newRatio);\n }", "primary_code_language": "unknown", "primary_code_char_count": 327, "all_code_blocks": "// Code block 1 (unknown):\nfunction setBadCollateralRatio(address pool, uint256 newRatio) external onlyRole(DAO) {\n require(newRatio >= 130 * 1e18 && newRatio <= 150 * 1e18 && newRatio <= vaultSafeCollateralRatio[pool] + 1e19, \"LNA\");\n vaultBadCollateralRatio[pool] = newRatio;\n emit SafeCollateralRatioChanged(pool, newRatio);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LybraConfigurator.sol#L126-L1", "github_files_list": "LybraConfigurator.sol", "github_refs_count": 1, "vulnerable_code_actual": " function setBadCollateralRatio(address pool, uint256 newRatio) external onlyRole(DAO) {\n require(newRatio >= 130 * 1e18 && newRatio <= 150 * 1e18 && newRatio <= vaultSafeCollateralRatio[pool] + 1e19, \"LNA\");\n vaultBadCollateralRatio[pool] = newRatio;\n emit SafeCollateralRatioChanged(pool, newRatio);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5.15} {"source": "c4", "protocol": "02-ethos", "title": "0xhacksmithh G", "severity_raw": "High", "severity": "high", "description": "\n\n### [Gas-01] Struct can be packed\n*instances(16 structs)*\n```\nFile: Ethos-Core/contracts/CollateralConfig.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol#L27-L32\n````\n```\nFile: Ethos-Core/contracts/BorrowerOperations.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L47-L64\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L66-L78\n```\n```\nFile: Ethos-Core/contracts/TroveManager.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L129-L138\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L140-L144\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L146-L158\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L160-L170\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L172-L182\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L1-L1\n```\n```\nFile: Ethos-Core/contracts/ActivePool.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol#L220-L237\n```\n```\nFile: Ethos-Core/contracts/StabilityPool.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/StabilityPool.sol#L214\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/StabilityPool.sol#L223\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/StabilityPool.sol#L646-L655\n```\n```\nFile: Ethos-Core/contracts/LUSDToken.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L58\n```\n```\nFile: Ethos-Vault/contracts/ReaperVaultV2.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L25-L32\nhttps://github.com/code-423n4/2023-02-ethos/blob/main", "vulnerable_code": "File: Ethos-Core/contracts/CollateralConfig.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol#L27-L32", "fixed_code": "File: Ethos-Core/contracts/BorrowerOperations.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L47-L64\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L66-L78", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/0xhacksmithh-G.md", "collected_at": "2026-01-02T18:15:50.939639+00:00", "source_hash": "7e433d257bfa97f476e33ea7c0bc09510dbdfe3103762108cbca9391cb1f8d61", "code_block_count": 6, "solidity_block_count": 0, "total_code_chars": 1680, "github_ref_count": 15, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: Ethos-Core/contracts/CollateralConfig.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol#L27-L32", "primary_code_language": "unknown", "primary_code_char_count": 151, "all_code_blocks": "// Code block 1 (unknown):\nFile: Ethos-Core/contracts/CollateralConfig.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol#L27-L32\n\n// Code block 2 (unknown):\nFile: Ethos-Core/contracts/BorrowerOperations.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L47-L64\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L66-L78\n\n// Code block 3 (unknown):\nFile: Ethos-Core/contracts/TroveManager.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L129-L138\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L140-L144\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L146-L158\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L160-L170\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L172-L182\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L1-L1\n\n// Code block 4 (unknown):\nFile: Ethos-Core/contracts/ActivePool.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol#L220-L237\n\n// Code block 5 (unknown):\nFile: Ethos-Core/contracts/StabilityPool.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/StabilityPool.sol#L214\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/StabilityPool.sol#L223\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/StabilityPool.sol#L646-L655\n\n// Code block 6 (unknown):\nFile: Ethos-Core/contracts/LUSDToken.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L58", "all_code_blocks_count": 6, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CollateralConfig.sol#L27-L32, BorrowerOperations.sol#L47-L64, BorrowerOperations.sol#L66-L78, TroveManager.sol#L129-L138, TroveManager.sol#L140-L144, TroveManager.sol#L146-L158, TroveManager.sol#L160-L170, TroveManager.sol#L172-L182, TroveManager.sol#L1, ActivePool.sol#L220-L237, StabilityPool.sol#L214, StabilityPool.sol#L223, StabilityPool.sol#L646-L655, LUSDToken.sol#L58, ReaperVaultV2.sol#L25-L32", "github_files_list": "StabilityPool.sol, TroveManager.sol, BorrowerOperations.sol, ReaperVaultV2.sol, LUSDToken.sol, ActivePool.sol, CollateralConfig.sol", "github_refs_count": 15, "vulnerable_code_actual": "File: Ethos-Core/contracts/CollateralConfig.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol#L27-L32", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: Ethos-Core/contracts/BorrowerOperations.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L47-L64\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L66-L78", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 12} {"source": "c4", "protocol": "01-salty", "title": "Kaysoft G", "severity_raw": "Low", "severity": "low", "description": "## [GAS-1] The Ownable library is unnecessary on the `USDS.sol` contract.\nThere is 1 instance of this\n- https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/stable/USDS.sol#L14\n\nThe `onlyOwner` modifier of the `ownable` contract was used only once in the function that is to be executed only once at deployment, then ownership is renounced in the same function. \n\nSince the below function is the only function where `onlyOwner` modifier is used and it is executed only once at deployment according to the comment above it, the code in the `setCollateralAndLiquidity(...)` can be implemented in the constructor since the constructor is run only once and can only be by the deployer.\n\n```\nFile: src/stable/USDS.sol\n28: // This will be called only once - at deployment time\n29:\tfunction setCollateralAndLiquidity( ICollateralAndLiquidity _collateralAndLiquidity ) external onlyOwner\n30:\t\t{\n31:\t\tcollateralAndLiquidity = _collateralAndLiquidity; //@audit set this in the constructor since it will be called at deployment.\n\n32:\t\t// setCollateralAndLiquidity can only be called once\n33:\t\trenounceOwnership();//@audit ownable is unnecessary.\n34:\t\t}\n```\n\nImpact:\nReduces deployment gas cost because the `Ownable` contract code is removed.\n\nRecommendation:\nImplement the code in the `setCollateralAndLiquidity(...)` in the constructor of the contract this way:\n\n```\nconstructor(ICollateralAndLiquidity _collateralAndLiquidity) ERC20( \"USDS\", \"USDS\" ) {\n collateralAndLiquidity = _collateralAndLiquidity;// also emit event.\n}\n```\n\nThe above will remove the need for the `setCollateralAndLiquidity(...)` and the `Ownable` contract codes.", "vulnerable_code": "File: src/stable/USDS.sol\n28: // This will be called only once - at deployment time\n29:\tfunction setCollateralAndLiquidity( ICollateralAndLiquidity _collateralAndLiquidity ) external onlyOwner\n30:\t\t{\n31:\t\tcollateralAndLiquidity = _collateralAndLiquidity; //@audit set this in the constructor since it will be called at deployment.\n\n32:\t\t// setCollateralAndLiquidity can only be called once\n33:\t\trenounceOwnership();//@audit ownable is unnecessary.\n34:\t\t}", "fixed_code": "constructor(ICollateralAndLiquidity _collateralAndLiquidity) ERC20( \"USDS\", \"USDS\" ) {\n collateralAndLiquidity = _collateralAndLiquidity;// also emit event.\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/Kaysoft-G.md", "collected_at": "2026-01-02T19:01:22.828009+00:00", "source_hash": "7e4afb64b7b1b9b688e69cd46417c317e275c4098e31b4bfda2c70a373265865", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 614, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: src/stable/USDS.sol\n28: // This will be called only once - at deployment time\n29:\tfunction setCollateralAndLiquidity( ICollateralAndLiquidity _collateralAndLiquidity ) external onlyOwner\n30:\t\t{\n31:\t\tcollateralAndLiquidity = _collateralAndLiquidity; //@audit set this in the constructor since it will be called at deployment.\n\n32:\t\t// setCollateralAndLiquidity can only be called once\n33:\t\trenounceOwnership();//@audit ownable is unnecessary.\n34:\t\t}", "primary_code_language": "unknown", "primary_code_char_count": 454, "all_code_blocks": "// Code block 1 (unknown):\nFile: src/stable/USDS.sol\n28: // This will be called only once - at deployment time\n29:\tfunction setCollateralAndLiquidity( ICollateralAndLiquidity _collateralAndLiquidity ) external onlyOwner\n30:\t\t{\n31:\t\tcollateralAndLiquidity = _collateralAndLiquidity; //@audit set this in the constructor since it will be called at deployment.\n\n32:\t\t// setCollateralAndLiquidity can only be called once\n33:\t\trenounceOwnership();//@audit ownable is unnecessary.\n34:\t\t}\n\n// Code block 2 (unknown):\nconstructor(ICollateralAndLiquidity _collateralAndLiquidity) ERC20( \"USDS\", \"USDS\" ) {\n collateralAndLiquidity = _collateralAndLiquidity;// also emit event.\n}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "USDS.sol#L14", "github_files_list": "USDS.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: src/stable/USDS.sol\n28: // This will be called only once - at deployment time\n29:\tfunction setCollateralAndLiquidity( ICollateralAndLiquidity _collateralAndLiquidity ) external onlyOwner\n30:\t\t{\n31:\t\tcollateralAndLiquidity = _collateralAndLiquidity; //@audit set this in the constructor since it will be called at deployment.\n\n32:\t\t// setCollateralAndLiquidity can only be called once\n33:\t\trenounceOwnership();//@audit ownable is unnecessary.\n34:\t\t}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "constructor(ICollateralAndLiquidity _collateralAndLiquidity) ERC20( \"USDS\", \"USDS\" ) {\n collateralAndLiquidity = _collateralAndLiquidity;// also emit event.\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "08-dopex", "title": "Brenzee Q", "severity_raw": "Low", "severity": "low", "description": "## L-01 `removeAssetFromTokenReserves` function does not remove assets correctly from the `reserveTokens` array\n\n[Link to the code](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L287)\n\n`removeAssetFromtokenReserves` function removes tokens from `reserveAsset`, `reserveIndex`, and `reserveTokens`. But from the `reserveTokens` array it is not removed correctly - function removes **last** token no matter what token is intented to be removed.\n\n```solidity\n reservesIndex[reserveTokens[reserveTokens.length - 1]] = index;\n\n // update the index of reserveAsset with the last element\n reserveAsset[index] = reserveAsset[reserveAsset.length - 1];\n\n // remove the last element\n reserveAsset.pop();\n reserveTokens.pop();\n```\n\n### Recommended solution\nUpdate the code to the following\n\n```solidity\n reservesIndex[reserveTokens[reserveTokens.length - 1]] = index;\n\n // update the index of reserveAsset with the last element\n string memory lastElement = reserveTokens[reserveTokens.length - 1];\n reservesIndex[lastElement] = index;\n reserveTokens[index] = lastElement;\n\n // remove the last element\n reserveAsset.pop();\n reserveTokens.pop();\n```\n\n", "vulnerable_code": " reservesIndex[reserveTokens[reserveTokens.length - 1]] = index;\n\n // update the index of reserveAsset with the last element\n reserveAsset[index] = reserveAsset[reserveAsset.length - 1];\n\n // remove the last element\n reserveAsset.pop();\n reserveTokens.pop();", "fixed_code": " reservesIndex[reserveTokens[reserveTokens.length - 1]] = index;\n\n // update the index of reserveAsset with the last element\n string memory lastElement = reserveTokens[reserveTokens.length - 1];\n reservesIndex[lastElement] = index;\n reserveTokens[index] = lastElement;\n\n // remove the last element\n reserveAsset.pop();\n reserveTokens.pop();", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/Brenzee-Q.md", "collected_at": "2026-01-02T18:24:32.627535+00:00", "source_hash": "7e8f1ca85faf427214059076790d60e739b8d017f4886727ed7f3faf779d9d5a", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 632, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "reservesIndex[reserveTokens[reserveTokens.length - 1]] = index;\n\n // update the index of reserveAsset with the last element\n reserveAsset[index] = reserveAsset[reserveAsset.length - 1];\n\n // remove the last element\n reserveAsset.pop();\n reserveTokens.pop();", "primary_code_language": "solidity", "primary_code_char_count": 272, "all_code_blocks": "// Code block 1 (solidity):\nreservesIndex[reserveTokens[reserveTokens.length - 1]] = index;\n\n // update the index of reserveAsset with the last element\n reserveAsset[index] = reserveAsset[reserveAsset.length - 1];\n\n // remove the last element\n reserveAsset.pop();\n reserveTokens.pop();\n\n// Code block 2 (solidity):\nreservesIndex[reserveTokens[reserveTokens.length - 1]] = index;\n\n // update the index of reserveAsset with the last element\n string memory lastElement = reserveTokens[reserveTokens.length - 1];\n reservesIndex[lastElement] = index;\n reserveTokens[index] = lastElement;\n\n // remove the last element\n reserveAsset.pop();\n reserveTokens.pop();", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "reservesIndex[reserveTokens[reserveTokens.length - 1]] = index;\n\n // update the index of reserveAsset with the last element\n reserveAsset[index] = reserveAsset[reserveAsset.length - 1];\n\n // remove the last element\n reserveAsset.pop();\n reserveTokens.pop();\n\nreservesIndex[reserveTokens[reserveTokens.length - 1]] = index;\n\n // update the index of reserveAsset with the last element\n string memory lastElement = reserveTokens[reserveTokens.length - 1];\n reservesIndex[lastElement] = index;\n reserveTokens[index] = lastElement;\n\n // remove the last element\n reserveAsset.pop();\n reserveTokens.pop();", "github_refs_formatted": "RdpxV2Core.sol#L287", "github_files_list": "RdpxV2Core.sol", "github_refs_count": 1, "vulnerable_code_actual": " reservesIndex[reserveTokens[reserveTokens.length - 1]] = index;\n\n // update the index of reserveAsset with the last element\n reserveAsset[index] = reserveAsset[reserveAsset.length - 1];\n\n // remove the last element\n reserveAsset.pop();\n reserveTokens.pop();", "has_vulnerable_code_snippet": true, "fixed_code_actual": " reservesIndex[reserveTokens[reserveTokens.length - 1]] = index;\n\n // update the index of reserveAsset with the last element\n string memory lastElement = reserveTokens[reserveTokens.length - 1];\n reservesIndex[lastElement] = index;\n reserveTokens[index] = lastElement;\n\n // remove the last element\n reserveAsset.pop();\n reserveTokens.pop();", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7.43} {"source": "c4", "protocol": "01-ondo", "title": "Breeje G", "severity_raw": "High", "severity": "high", "description": "## Gas Optimizations\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [GAS-1](#GAS-1) | ++I/I++ SHOULD BE UNCHECKED{++I}/UNCHECKED{I++} WHEN IT IS NOT POSSIBLE FOR THEM TO OVERFLOW | 12 |\n| [GAS-2](#GAS-2) | SPLITTING REQUIRE() STATEMENTS THAT USE && SAVES GAS | 3 |\n| [GAS-3](#GAS-3) | NOT USING THE NAMED RETURN VARIABLES WHEN A FUNCTION RETURNS, WASTES DEPLOYMENT GAS | 1 |\n\n### [GAS-1] ++I/I++ SHOULD BE UNCHECKED{++I}/UNCHECKED{I++} WHEN IT IS NOT POSSIBLE FOR THEM TO OVERFLOW\n\nThe unchecked keyword is new in solidity version 0.8.0, so this only applies to that version or higher, which these instances are. This saves 30-40 gas per loop.\n\n*Instances (12)*:\n```solidity\nFile: cash/CashManager.sol\n\n750: for (uint256 i = 0; i < size; ++i) {\n\n786: for (uint256 i = 0; i < size; ++i) {\n\n933: for (uint256 i = 0; i < size; ++i) {\n\n961: for (uint256 i = 0; i < exCallData.length; ++i) {\n\n```\n\n```solidity\nFile: cash/factory/CashFactory.sol\n\n127: for (uint256 i = 0; i < exCallData.length; ++i) {\n\n```\n\n```solidity\nFile: cash/factory/CashKYCSenderFactory.sol\n\n137: for (uint256 i = 0; i < exCallData.length; ++i) {\n\n```\n\n```solidity\nFile: cash/factory/CashKYCSenderReceiverFactory.sol\n\n137: for (uint256 i = 0; i < exCallData.length; ++i) {\n\n```\n\n```solidity\nFile: cash/kyc/KYCRegistry.sol\n\n163: for (uint256 i = 0; i < length; i++) {\n\n180: for (uint256 i = 0; i < length; i++) {\n\n```\n\n```solidity\nFile: lending/CompoundLens.sol\n\n85: for (uint i = 0; i < cTokenCount; i++) {\n\n135: for (uint i = 0; i < cTokenCount; i++) {\n\n167: for (uint i = 0; i < cTokenCount; i++) {\n\n```\n\n### [GAS-2] SPLITTING REQUIRE() STATEMENTS THAT USE && SAVES GAS\n\nSaves 3 gas per instance.\n\n*Instances (3)*:\n```solidity\nFile: lending/OndoPriceOracleV2.sol\n\n293: (answeredInRound >= roundId) &&\n\n```\n\n```solidity\nFile: lending/tokens/cCash/CTokenCash.sol\n\n46: accrualBlockNumber == 0 && borrowIndex == 0,\n\n```\n\n```solidity\nFile: lending/tokens/cCash/CTokenModif", "vulnerable_code": "File: cash/CashManager.sol\n\n750: for (uint256 i = 0; i < size; ++i) {\n\n786: for (uint256 i = 0; i < size; ++i) {\n\n933: for (uint256 i = 0; i < size; ++i) {\n\n961: for (uint256 i = 0; i < exCallData.length; ++i) {\n", "fixed_code": "File: cash/factory/CashFactory.sol\n\n127: for (uint256 i = 0; i < exCallData.length; ++i) {\n", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/Breeje-G.md", "collected_at": "2026-01-02T18:14:32.886548+00:00", "source_hash": "7e98d70f660362059de51c0ac48877384ae0d17274b0aef9f7ce195e2d6071fe", "code_block_count": 8, "solidity_block_count": 8, "total_code_chars": 1036, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: cash/CashManager.sol\n\n750: for (uint256 i = 0; i < size; ++i) {\n\n786: for (uint256 i = 0; i < size; ++i) {\n\n933: for (uint256 i = 0; i < size; ++i) {\n\n961: for (uint256 i = 0; i < exCallData.length; ++i) {", "primary_code_language": "solidity", "primary_code_char_count": 231, "all_code_blocks": "// Code block 1 (solidity):\nFile: cash/CashManager.sol\n\n750: for (uint256 i = 0; i < size; ++i) {\n\n786: for (uint256 i = 0; i < size; ++i) {\n\n933: for (uint256 i = 0; i < size; ++i) {\n\n961: for (uint256 i = 0; i < exCallData.length; ++i) {\n\n// Code block 2 (solidity):\nFile: cash/factory/CashFactory.sol\n\n127: for (uint256 i = 0; i < exCallData.length; ++i) {\n\n// Code block 3 (solidity):\nFile: cash/factory/CashKYCSenderFactory.sol\n\n137: for (uint256 i = 0; i < exCallData.length; ++i) {\n\n// Code block 4 (solidity):\nFile: cash/factory/CashKYCSenderReceiverFactory.sol\n\n137: for (uint256 i = 0; i < exCallData.length; ++i) {\n\n// Code block 5 (solidity):\nFile: cash/kyc/KYCRegistry.sol\n\n163: for (uint256 i = 0; i < length; i++) {\n\n180: for (uint256 i = 0; i < length; i++) {\n\n// Code block 6 (solidity):\nFile: lending/CompoundLens.sol\n\n85: for (uint i = 0; i < cTokenCount; i++) {\n\n135: for (uint i = 0; i < cTokenCount; i++) {\n\n167: for (uint i = 0; i < cTokenCount; i++) {\n\n// Code block 7 (solidity):\nFile: lending/OndoPriceOracleV2.sol\n\n293: (answeredInRound >= roundId) &&\n\n// Code block 8 (solidity):\nFile: lending/tokens/cCash/CTokenCash.sol\n\n46: accrualBlockNumber == 0 && borrowIndex == 0,", "all_code_blocks_count": 8, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: cash/CashManager.sol\n\n750: for (uint256 i = 0; i < size; ++i) {\n\n786: for (uint256 i = 0; i < size; ++i) {\n\n933: for (uint256 i = 0; i < size; ++i) {\n\n961: for (uint256 i = 0; i < exCallData.length; ++i) {\n\nFile: cash/factory/CashFactory.sol\n\n127: for (uint256 i = 0; i < exCallData.length; ++i) {\n\nFile: cash/factory/CashKYCSenderFactory.sol\n\n137: for (uint256 i = 0; i < exCallData.length; ++i) {\n\nFile: cash/factory/CashKYCSenderReceiverFactory.sol\n\n137: for (uint256 i = 0; i < exCallData.length; ++i) {\n\nFile: cash/kyc/KYCRegistry.sol\n\n163: for (uint256 i = 0; i < length; i++) {\n\n180: for (uint256 i = 0; i < length; i++) {\n\nFile: lending/CompoundLens.sol\n\n85: for (uint i = 0; i < cTokenCount; i++) {\n\n135: for (uint i = 0; i < cTokenCount; i++) {\n\n167: for (uint i = 0; i < cTokenCount; i++) {\n\nFile: lending/OndoPriceOracleV2.sol\n\n293: (answeredInRound >= roundId) &&\n\nFile: lending/tokens/cCash/CTokenCash.sol\n\n46: accrualBlockNumber == 0 && borrowIndex == 0,", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: cash/CashManager.sol\n\n750: for (uint256 i = 0; i < size; ++i) {\n\n786: for (uint256 i = 0; i < size; ++i) {\n\n933: for (uint256 i = 0; i < size; ++i) {\n\n961: for (uint256 i = 0; i < exCallData.length; ++i) {\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: cash/factory/CashFactory.sol\n\n127: for (uint256 i = 0; i < exCallData.length; ++i) {\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 13} {"source": "c4", "protocol": "07-amphora", "title": "SM3_SS G", "severity_raw": "High", "severity": "high", "description": "\n# Gas Optimizations Summary\n\n| NO | \tIssue | Instances |\n|------|-----------|-------------|\n|[G-01]| Cache external calls outside of loop to avoid re-calling function on each iteration | 6 | \n|[G-02]| Combine events to save 2 Glogtopic (375 gas) | 6 | \n|[G-03]| Use calldata instead of memory for function arguments that do not get mutated | 10 | \n|[G-04]| Avoid emitting storage values | 16 | \n|[G-05]| A modifier used only once and not being inherited should be inlined to save gas | 1 | \n|[G-06]| If statements that use && can be refactored into nested if statements | 7 | \n|[G-07]| Use assembly to write address storage values | 14 | \n|[G-08]| Using > 0 costs more gas than != 0 when used on a uint in a require() statement | 9 | \n|[G-09]| Do not calculate constants | 8 | \n|[G-10]| Use hardcode address instead address(this) | 19 | \n|[G-11]| Don\u2019t compare boolean expressions to boolean literals | 6 | \n|[G-12]| Assigning keccak operations to constant variables results in extra gas costs | 5 | \n|[G-13]| With assembly, .call (bool success) transfer can be done gas-optimized | 1 | \n|[G-14]| Unnecessary look up in if condition | 2 | \n|[G-15]| State variables can be packed into fewer storage slots | 2 | \n|[G-16]| Use shift Right/Left instead of division/multiplication if possible | 10 | \n|[G-17]| Amounts should be checked for 0 before calling a transfer | 5 | \n|[G-18]| internal functions not called by the contract should be removed to save deployment gas | 3 | \n|[G-19]| Using a positive conditional flow to save a NOT opcode | 8 | \n|[G-20]| Use do while loops instead of for loops | 5 | \n|[G-21]| Failure to check the zero address in the constructor causes the contract to be deployed again | 3 | \n|[G-22]| Inverting the condition of an if-else-statement wastes gas | 8 | \n|[G-23]| Use assembly to emit events | 72 | \n|[G-24]| Create immutable variable to avoid redundant external calls | 1 | \n|[G-25]| Forgo internal function to save 1 ", "vulnerable_code": "file: contracts/core/VaultController.sol\n\n255 for (uint256 _i; _i < _tokenAddresses.length;) {\n _tokenId = _oldVaultController.tokenId(_tokenAddresses[_i]);\n if (_tokenId == 0) revert VaultController_WrongCollateralAddress();\n _tokensRegistered++;\n\n CollateralInfo memory _collateral = _oldVaultController.tokenCollateralInfo(_tokenAddresses[_i]);\n _collateral.tokenId = _tokensRegistered;\n _collateral.totalDeposited = 0;\n\n enabledTokens.push(_tokenAddresses[_i]);\n tokenAddressCollateralInfo[_tokenAddresses[_i]] = _collateral;\n\n unchecked {\n ++_i;\n }\n }\n", "fixed_code": "file: contracts/core/Vault.sol\n\n169 for (uint256 _i; _i < _tokenAddresses.length;) {\n IVaultController.CollateralInfo memory _collateralInfo = CONTROLLER.tokenCollateralInfo(_tokenAddresses[_i]);\n if (_collateralInfo.tokenId == 0) revert Vault_TokenNotRegistered();\n if (_collateralInfo.collateralType != IVaultController.CollateralType.CurveLPStakedOnConvex) {\n revert Vault_TokenNotCurveLP();\n }\n\n188 for (uint256 _j; _j < _extraRewards;) {\n IVirtualBalanceRewardPool _virtualReward = _rewardsContract.extraRewards(_j);\n IERC20 _rewardToken = _virtualReward.rewardToken();\n uint256 _earnedReward = _virtualReward.earned(address(this));\n if (_earnedReward != 0) {\n _virtualReward.getReward();\n _rewardToken.transfer(_msgSender(), _earnedReward);\n emit ClaimedReward(address(_rewardToken), _earnedReward);\n }\n unchecked {\n ++_j;\n }\n }\n unchecked {\n ++_i;\n }\n } \n\n254 for (_i; _i < _rewardsAmount;) {\n IVirtualBalanceRewardPool _virtualReward = _rewardsContract.extraRewards(_i);\n IERC20 _rewardToken = _virtualReward.rewardToken();\n uint256 _earnedReward = _virtualReward.earned(address(this));\n _rewards[_i + 2] = Reward(_rewardToken, _earnedReward);\n\n unchecked {\n ++_i;\n }\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/SM3_SS-G.md", "collected_at": "2026-01-02T18:23:34.956595+00:00", "source_hash": "7ed4258f919bf1ab195da26ef2309ac7d49a3e29557ac4510bfdccc5b28fc787", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "file: contracts/core/VaultController.sol\n\n255 for (uint256 _i; _i < _tokenAddresses.length;) {\n _tokenId = _oldVaultController.tokenId(_tokenAddresses[_i]);\n if (_tokenId == 0) revert VaultController_WrongCollateralAddress();\n _tokensRegistered++;\n\n CollateralInfo memory _collateral = _oldVaultController.tokenCollateralInfo(_tokenAddresses[_i]);\n _collateral.tokenId = _tokensRegistered;\n _collateral.totalDeposited = 0;\n\n enabledTokens.push(_tokenAddresses[_i]);\n tokenAddressCollateralInfo[_tokenAddresses[_i]] = _collateral;\n\n unchecked {\n ++_i;\n }\n }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "file: contracts/core/Vault.sol\n\n169 for (uint256 _i; _i < _tokenAddresses.length;) {\n IVaultController.CollateralInfo memory _collateralInfo = CONTROLLER.tokenCollateralInfo(_tokenAddresses[_i]);\n if (_collateralInfo.tokenId == 0) revert Vault_TokenNotRegistered();\n if (_collateralInfo.collateralType != IVaultController.CollateralType.CurveLPStakedOnConvex) {\n revert Vault_TokenNotCurveLP();\n }\n\n188 for (uint256 _j; _j < _extraRewards;) {\n IVirtualBalanceRewardPool _virtualReward = _rewardsContract.extraRewards(_j);\n IERC20 _rewardToken = _virtualReward.rewardToken();\n uint256 _earnedReward = _virtualReward.earned(address(this));\n if (_earnedReward != 0) {\n _virtualReward.getReward();\n _rewardToken.transfer(_msgSender(), _earnedReward);\n emit ClaimedReward(address(_rewardToken), _earnedReward);\n }\n unchecked {\n ++_j;\n }\n }\n unchecked {\n ++_i;\n }\n } \n\n254 for (_i; _i < _rewardsAmount;) {\n IVirtualBalanceRewardPool _virtualReward = _rewardsContract.extraRewards(_i);\n IERC20 _rewardToken = _virtualReward.rewardToken();\n uint256 _earnedReward = _virtualReward.earned(address(this));\n _rewards[_i + 2] = Reward(_rewardToken, _earnedReward);\n\n unchecked {\n ++_i;\n }\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-asymmetry", "title": "charlesjhongc G", "severity_raw": "Gas", "severity": "gas", "description": "# Gas Optmization Findings\n\n## Replace i++ in for loop\nCould be replace with ++i or unchecked math block\n```solidity\n// option1\nfor (uint256 i = 0; i < derivativeCount; ++i)\n{\n // ...\n}\n```\n```solidity\n// option2\nfor (uint256 i = 0; i < derivativeCount;)\n{\n // ...\n unchecked{\n ++i;\n }\n}\n```\nOccurrences\n- https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L71\n- https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L84\n- https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L113\n- https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L140\n- https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L147\n- https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L171\n- https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L191\n\n## totalWeight calculation could be further optimized\nThe `adjustWeight` and `addDerivative` function will result in `totalWeight` change. But instead of re-calcualting it by for loop iterating, the `totalWeight` could be updated by adding the weight of new derivative (in `addDerivative` case) or the difference between new and old weight (in `adjustWeight` case). It could save multiple storage reads.\n```solidity\nfunction adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n) external onlyOwner {\n uint256 originalWeight = weights[_derivativeIndex];\n totalWeight = totalWeight + _weight - originalWeight;\n weights[_derivativeIndex] = _weight;\n emit WeightChange(_derivativeIndex, _weight);\n}\n```\n```solidity\nfunction addDerivative(\n address _contractAddress,\n uint256 _weight\n) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n totalWeight += _weight;\n emit DerivativeAdded(_contractAdd", "vulnerable_code": "// option1\nfor (uint256 i = 0; i < derivativeCount; ++i)\n{\n // ...\n}", "fixed_code": "// option2\nfor (uint256 i = 0; i < derivativeCount;)\n{\n // ...\n unchecked{\n ++i;\n }\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/charlesjhongc-G.md", "collected_at": "2026-01-02T18:18:58.029003+00:00", "source_hash": "7ee48b947ff4b3edc0b404f414c7002851b5d7f8b978d3c5e2ce51dd91ac2df8", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 474, "github_ref_count": 7, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "// option1\nfor (uint256 i = 0; i < derivativeCount; ++i)\n{\n // ...\n}", "primary_code_language": "solidity", "primary_code_char_count": 71, "all_code_blocks": "// Code block 1 (solidity):\n// option1\nfor (uint256 i = 0; i < derivativeCount; ++i)\n{\n // ...\n}\n\n// Code block 2 (solidity):\n// option2\nfor (uint256 i = 0; i < derivativeCount;)\n{\n // ...\n unchecked{\n ++i;\n }\n}\n\n// Code block 3 (solidity):\nfunction adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n) external onlyOwner {\n uint256 originalWeight = weights[_derivativeIndex];\n totalWeight = totalWeight + _weight - originalWeight;\n weights[_derivativeIndex] = _weight;\n emit WeightChange(_derivativeIndex, _weight);\n}", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "// option1\nfor (uint256 i = 0; i < derivativeCount; ++i)\n{\n // ...\n}\n\n// option2\nfor (uint256 i = 0; i < derivativeCount;)\n{\n // ...\n unchecked{\n ++i;\n }\n}\n\nfunction adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n) external onlyOwner {\n uint256 originalWeight = weights[_derivativeIndex];\n totalWeight = totalWeight + _weight - originalWeight;\n weights[_derivativeIndex] = _weight;\n emit WeightChange(_derivativeIndex, _weight);\n}", "github_refs_formatted": "SafEth.sol#L71, SafEth.sol#L84, SafEth.sol#L113, SafEth.sol#L140, SafEth.sol#L147, SafEth.sol#L171, SafEth.sol#L191", "github_files_list": "SafEth.sol", "github_refs_count": 7, "vulnerable_code_actual": "// option1\nfor (uint256 i = 0; i < derivativeCount; ++i)\n{\n // ...\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "// option2\nfor (uint256 i = 0; i < derivativeCount;)\n{\n // ...\n unchecked{\n ++i;\n }\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "06-lybra", "title": "Tripathi Q", "severity_raw": "Low", "severity": "low", "description": "### Low Risk Issues\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [L‑01] | `_mintEUSD ` emits incorrect parameter in `Mint` event | 1 | \n\n\n### [L‑01] `_mintEUSD ` emits incorrect parameter in `Mint` event\n`_mintEUSD ` is a internal function in pool/base contracts which emit an event after sucessfull minting of eUSD. \nCurrently first parameter is `msg.sender` which should be replaced by `_provider`. The fact that, everywhere `msg.sender` is same as `_provider` in current implementation is not creating any problem .But this will emit incorrect event if `msg.sender` and `_provider` are different in any case.\n\n```solidity\nFile: contracts/lybra/pools/base/LybraEUSDVaultBase.sol\n\n268: emit Mint(msg.sender, _onBehalfOf, _mintAmount, block.timestamp);\n\n```\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/base/LybraEUSDVaultBase.sol#L268C5-L268C74\n\n\n\n", "vulnerable_code": "File: contracts/lybra/pools/base/LybraEUSDVaultBase.sol\n\n268: emit Mint(msg.sender, _onBehalfOf, _mintAmount, block.timestamp);\n", "fixed_code": "", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/Tripathi-Q.md", "collected_at": "2026-01-02T18:22:48.520496+00:00", "source_hash": "7ef01520e9e6be6ec27bd5f6bff246b6ea91901d320fd3eddf2afe8abf39b9db", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 142, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "File: contracts/lybra/pools/base/LybraEUSDVaultBase.sol\n\n268: emit Mint(msg.sender, _onBehalfOf, _mintAmount, block.timestamp);", "primary_code_language": "solidity", "primary_code_char_count": 142, "all_code_blocks": "// Code block 1 (solidity):\nFile: contracts/lybra/pools/base/LybraEUSDVaultBase.sol\n\n268: emit Mint(msg.sender, _onBehalfOf, _mintAmount, block.timestamp);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: contracts/lybra/pools/base/LybraEUSDVaultBase.sol\n\n268: emit Mint(msg.sender, _onBehalfOf, _mintAmount, block.timestamp);", "github_refs_formatted": "LybraEUSDVaultBase.sol#L268-L5", "github_files_list": "LybraEUSDVaultBase.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: contracts/lybra/pools/base/LybraEUSDVaultBase.sol\n\n268: emit Mint(msg.sender, _onBehalfOf, _mintAmount, block.timestamp);\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.8} {"source": "c4", "protocol": "01-salty", "title": "0xOmer Q", "severity_raw": "Low", "severity": "low", "description": "## Missing check for wallets to not be the same addresses\n`ManagedWallet` contract introduces 2 wallets `mainWallet` and `confirmationWallet`. It is possible to pick them as same addresses. Since they have different roles they must not be same. Consider adding relevant checks both in `constructor` and `proposeWallets()` to block the logic fail.\n\n\n## ProposedConfirmationWallet can be overwritten\nAccording to the [comment](https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/ManagedWallet.sol#L48), overwriting a proposal should not allowed. Though the mentioned check exist for [proposedMainWallet](https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/ManagedWallet.sol#L49), there isn't for `proposedConfirmationWallet`.\n\n## `approve()` should be replaced with `safeIncreaseAllowance()` / `safeDecreaseAllowance()`\n`approve` is subject to known front-running attacks and does not handle non-standard ERC20 behaviors. Consider using `safeIncreaseAllowance` and `safeDecreaseAllowance` instead:\n\n```ruby\nsrc/staking/Liquidity.sol:\n 86 if (swapAmountA > 0) {\n 87: tokenA.approve(address(pools), swapAmountA);\n 88 \n\n 100 else if (swapAmountB > 0) {\n 101: tokenB.approve(address(pools), swapAmountB);\n 102 \n\n 154 // Approve the liquidity to add\n 155: tokenA.approve(address(pools), maxAmountA);\n 156: tokenB.approve(address(pools), maxAmountB);\n 157 \n```\nKeep in mind that safeApprove() is deprecated by OZ and recommended using their `safeIncreaseAllowance()` and `safeDecreaseAllowance()`\n\nSee this discussion: [SafeERC20.safeApprove() Has unnecessary and unsecure added behavior](https://github.com/OpenZeppelin/openzeppelin-contracts/issues/2219)\n\n**NOTE:** In bot report this issue is mentioned but it recommends to use `safeApprove()` which is deprecated and not safe to use.\n\n\n## Missing zero address check in [`PriceAggregator.", "vulnerable_code": "", "fixed_code": "", "recommendation": "", "category": "front-running", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/0xOmer-Q.md", "collected_at": "2026-01-02T19:01:04.711888+00:00", "source_hash": "7f224500569bd7a1ab5688c5c93e08214498a088114a775c56d0b9dbf31e1022", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 424, "github_ref_count": 2, "vulnerable_code_is_url": true, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "src/staking/Liquidity.sol:\n 86 if (swapAmountA > 0) {\n 87: tokenA.approve(address(pools), swapAmountA);\n 88 \n\n 100 else if (swapAmountB > 0) {\n 101: tokenB.approve(address(pools), swapAmountB);\n 102 \n\n 154 // Approve the liquidity to add\n 155: tokenA.approve(address(pools), maxAmountA);\n 156: tokenB.approve(address(pools), maxAmountB);\n 157", "primary_code_language": "ruby", "primary_code_char_count": 424, "all_code_blocks": "// Code block 1 (ruby):\nsrc/staking/Liquidity.sol:\n 86 if (swapAmountA > 0) {\n 87: tokenA.approve(address(pools), swapAmountA);\n 88 \n\n 100 else if (swapAmountB > 0) {\n 101: tokenB.approve(address(pools), swapAmountB);\n 102 \n\n 154 // Approve the liquidity to add\n 155: tokenA.approve(address(pools), maxAmountA);\n 156: tokenB.approve(address(pools), maxAmountB);\n 157", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ManagedWallet.sol#L48, ManagedWallet.sol#L49", "github_files_list": "ManagedWallet.sol", "github_refs_count": 2, "vulnerable_code_actual": "", "has_vulnerable_code_snippet": false, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "03-asymmetry", "title": "ch0bu Q", "severity_raw": "Critical", "severity": "critical", "description": "## 1. For modern and more readable code; update import usages\n\nSolidity code is also cleaner in another way that might not be noticeable: the struct Point. We were importing it previously with global import but not using it. The Point struct `polluted the source code` with an unnecessary object we were not using because we did not need it.\n\nThis was breaking the rule of modularity and modular programming: `only import what you need` Specific imports with curly braces allow us to apply this rule better.\n\nRecommendation\n`import {contract1 , contract2} from \"filename.sol\";`\n\n\n## 2. Missing event for critical parameter change\n\nEvents help non-contract tools to track changes, and events prevent users from being surprised by changes\n\n\n```\n58\tfunction setMaxSlippage(uint256 _slippage) external onlyOwner {\n```\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol\n```\n51\tfunction setMaxSlippage(uint256 _slippage) external onlyOwner {\n```\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol\n```\n48\tfunction setMaxSlippage(uint256 _slippage) external onlyOwner {\n```\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol\n\n\n## 3. Use scientific notation (e.g. 1e18) rather than exponentiation (e.g. 10**18)\n\nUse (e.g. 1e6) rather than decimal literals (e.g. 1000000), for better code readability.\n\n```\n44\tmaxSlippage = (1 * 10 ** 16); // 1%\n171\tuint rethPerEth = (10 ** 36) / poolPrice();\n173\tuint256 minOut = ((((rethPerEth * msg.value) / 10 ** 18) *\n174\t((10 ** 18 - maxSlippage))) / 10 ** 18);\n214\tRocketTokenRETHInterface(rethAddress()).getEthValue(10 ** 18);\n215\telse return (poolPrice() * 10 ** 18) / (10 ** 18);\n```\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol\n```\n54\tminAmount = 5 * 10 ** 17;\n55\tmaxAmount = 200 * 10 ** 18;\n75\t10 ** 18;\n80\tpreDepositPrice = 10 ** 18; // initializes with a price of 1\n81\tel", "vulnerable_code": "58\tfunction setMaxSlippage(uint256 _slippage) external onlyOwner {", "fixed_code": "51\tfunction setMaxSlippage(uint256 _slippage) external onlyOwner {", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/ch0bu-Q.md", "collected_at": "2026-01-02T18:18:56.224747+00:00", "source_hash": "7f3c9bbca9058fd9d5875f07db5c2b6f711cb4656df218745dbf41458d5a81d5", "code_block_count": 4, "solidity_block_count": 0, "total_code_chars": 514, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "58\tfunction setMaxSlippage(uint256 _slippage) external onlyOwner {", "primary_code_language": "unknown", "primary_code_char_count": 66, "all_code_blocks": "// Code block 1 (unknown):\n58\tfunction setMaxSlippage(uint256 _slippage) external onlyOwner {\n\n// Code block 2 (unknown):\n51\tfunction setMaxSlippage(uint256 _slippage) external onlyOwner {\n\n// Code block 3 (unknown):\n48\tfunction setMaxSlippage(uint256 _slippage) external onlyOwner {\n\n// Code block 4 (unknown):\n44\tmaxSlippage = (1 * 10 ** 16); // 1%\n171\tuint rethPerEth = (10 ** 36) / poolPrice();\n173\tuint256 minOut = ((((rethPerEth * msg.value) / 10 ** 18) *\n174\t((10 ** 18 - maxSlippage))) / 10 ** 18);\n214\tRocketTokenRETHInterface(rethAddress()).getEthValue(10 ** 18);\n215\telse return (poolPrice() * 10 ** 18) / (10 ** 18);", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Reth.sol, SfrxEth.sol, WstEth.sol", "github_files_list": "SfrxEth.sol, Reth.sol, WstEth.sol", "github_refs_count": 3, "vulnerable_code_actual": "58\tfunction setMaxSlippage(uint256 _slippage) external onlyOwner {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "51\tfunction setMaxSlippage(uint256 _slippage) external onlyOwner {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "08-dopex", "title": "JP_Courses Q", "severity_raw": "Low", "severity": "low", "description": "0. QA/LOW: RdpxV2Core - Likely incorrect/misleading comment regarding precision for state variable `slippageTolerance`, or precision hasn't been added to variable value yet. \n\nhttps://github.com/code-423n4/2023-08-dopex/blob/e96aaa5ea21f11b29d828dbe2d0745974cd046ed/contracts/core/RdpxV2Core.sol#L99-L100\n\nL100:\n`slippageTolerance = 5e5` but comment mentions 1e8 precision as per below:\n\n```solidity\n /// @notice The slippage tolernce in swaps in 1e8 precision\n uint256 public slippageTolerance = 5e5; // 0.5%\n```\n\nRecommendation:\n\nFix the comment or fix the assignment value, depending on which one is incorrect.\n\nIf assignment incorrect, then:\n\n```solidity\nuint256 public slippageTolerance = 5e5 * 1e8; // 0.5%\n```\n\n1. QA: RdpxV2Core - `liquiditySlippageTolerance` state variable not used in this contract.\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/e96aaa5ea21f11b29d828dbe2d0745974cd046ed/contracts/core/RdpxV2Core.sol#L102-L103\n\n```solidity\n /// @notice Liquidity slippage tolerance\n uint256 public liquiditySlippageTolerance = 5e5; // 0.5%\n```\n\nRecommendation:\n\nRemove the variable to save on gas costs during deployments, or comment it out if planning to use later, also consider its storage slot.\n\n\n", "vulnerable_code": " /// @notice The slippage tolernce in swaps in 1e8 precision\n uint256 public slippageTolerance = 5e5; // 0.5%", "fixed_code": "uint256 public slippageTolerance = 5e5 * 1e8; // 0.5%", "recommendation": "", "category": "slippage", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/JP_Courses-Q.md", "collected_at": "2026-01-02T18:24:42.947830+00:00", "source_hash": "7f478a7aba7e18c9a6f6450734d49b236e944c4b0e7d59bf44f9cf4f47e0336f", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 261, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "/// @notice The slippage tolernce in swaps in 1e8 precision\n uint256 public slippageTolerance = 5e5; // 0.5%", "primary_code_language": "solidity", "primary_code_char_count": 109, "all_code_blocks": "// Code block 1 (solidity):\n/// @notice The slippage tolernce in swaps in 1e8 precision\n uint256 public slippageTolerance = 5e5; // 0.5%\n\n// Code block 2 (solidity):\nuint256 public slippageTolerance = 5e5 * 1e8; // 0.5%\n\n// Code block 3 (solidity):\n/// @notice Liquidity slippage tolerance\n uint256 public liquiditySlippageTolerance = 5e5; // 0.5%", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "/// @notice The slippage tolernce in swaps in 1e8 precision\n uint256 public slippageTolerance = 5e5; // 0.5%\n\nuint256 public slippageTolerance = 5e5 * 1e8; // 0.5%\n\n/// @notice Liquidity slippage tolerance\n uint256 public liquiditySlippageTolerance = 5e5; // 0.5%", "github_refs_formatted": "RdpxV2Core.sol#L99-L100, RdpxV2Core.sol#L102-L103", "github_files_list": "RdpxV2Core.sol", "github_refs_count": 2, "vulnerable_code_actual": " /// @notice The slippage tolernce in swaps in 1e8 precision\n uint256 public slippageTolerance = 5e5; // 0.5%", "has_vulnerable_code_snippet": true, "fixed_code_actual": "uint256 public slippageTolerance = 5e5 * 1e8; // 0.5%", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8.44} {"source": "c4", "protocol": "05-ajna", "title": "Jorgect G", "severity_raw": "Informational", "severity": "informational", "description": "#GAS OPTMIZATION\n\n## [G-01] CREATING A NEW MODIFIER CAN SAVE GAS\nthe next owner validation is used in 3 different function, can crate a modifier to save gas:\n\n```\nfile: ajna-core/src/RewardsManager.sol\nif (msg.sender != stakeInfo.owner) revert NotOwnerOfDeposit();\n```\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-core/src/RewardsManager.sol#L120\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-core/src/RewardsManager.sol#L143\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-core/src/RewardsManager.sol#L275\n\nconsider add the next modifier:\n\n```\nmodifier isOwner(uint256 id) {\nif (msg.sender != stakes[id].owner) revert NotOwnerOfDeposit();\n_;\n}\n```\n\n\n\n", "vulnerable_code": "file: ajna-core/src/RewardsManager.sol\nif (msg.sender != stakeInfo.owner) revert NotOwnerOfDeposit();", "fixed_code": "modifier isOwner(uint256 id) {\nif (msg.sender != stakes[id].owner) revert NotOwnerOfDeposit();\n_;\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/Jorgect-G.md", "collected_at": "2026-01-02T18:21:01.294904+00:00", "source_hash": "7f74723f0d86f50ee287a2ceff750192ce03aecc922ae70866d60bd2e7883de2", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 200, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "file: ajna-core/src/RewardsManager.sol\nif (msg.sender != stakeInfo.owner) revert NotOwnerOfDeposit();", "primary_code_language": "unknown", "primary_code_char_count": 101, "all_code_blocks": "// Code block 1 (unknown):\nfile: ajna-core/src/RewardsManager.sol\nif (msg.sender != stakeInfo.owner) revert NotOwnerOfDeposit();\n\n// Code block 2 (unknown):\nmodifier isOwner(uint256 id) {\nif (msg.sender != stakes[id].owner) revert NotOwnerOfDeposit();\n_;\n}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "RewardsManager.sol#L120, RewardsManager.sol#L143, RewardsManager.sol#L275", "github_files_list": "RewardsManager.sol", "github_refs_count": 3, "vulnerable_code_actual": "file: ajna-core/src/RewardsManager.sol\nif (msg.sender != stakeInfo.owner) revert NotOwnerOfDeposit();", "has_vulnerable_code_snippet": true, "fixed_code_actual": "modifier isOwner(uint256 id) {\nif (msg.sender != stakes[id].owner) revert NotOwnerOfDeposit();\n_;\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6.59} {"source": "c4", "protocol": "09-ondo", "title": "0xblackskull Q", "severity_raw": "Low", "severity": "low", "description": "1- Missing events in rescueTokens and zero address check\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/DestinationBridge.sol#L322\n```\n function rescueTokens(address _token) external onlyOwner {\n uint256 balance = IRWALike(_token).balanceOf(address(this));\n IRWALike(_token).transfer(owner(), balance);\n }\n```\n\n2- Emit should be in next line after uint256 tokensAmount as a solidity good practices\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDY.sol#L421\n```\n function transferShares(\n address _recipient,\n uint256 _sharesAmount\n ) public returns (uint256) {\n _transferShares(msg.sender, _recipient, _sharesAmount);\n emit TransferShares(msg.sender, _recipient, _sharesAmount);\n uint256 tokensAmount = getRUSDYByShares(_sharesAmount);\n emit Transfer(msg.sender, _recipient, tokensAmount);\n return tokensAmount;\n }\n```\n\n3- Need approve before transferFrom() in wrap()\n ```\nfunction wrap(uint256 _USDYAmount) external whenNotPaused {\n require(_USDYAmount > 0, \"rUSDY: can't wrap zero USDY tokens\");\n _mintShares(msg.sender, _USDYAmount * BPS_DENOMINATOR);\n+ usdy.approve(address(this), _USDYAmount);\n usdy.transferFrom(msg.sender, address(this), _USDYAmount);\n emit Transfer(address(0), msg.sender, getRUSDYByShares(_USDYAmount));\n emit TransferShares(address(0), msg.sender, _USDYAmount);\n }\n```", "vulnerable_code": " function rescueTokens(address _token) external onlyOwner {\n uint256 balance = IRWALike(_token).balanceOf(address(this));\n IRWALike(_token).transfer(owner(), balance);\n }", "fixed_code": " function transferShares(\n address _recipient,\n uint256 _sharesAmount\n ) public returns (uint256) {\n _transferShares(msg.sender, _recipient, _sharesAmount);\n emit TransferShares(msg.sender, _recipient, _sharesAmount);\n uint256 tokensAmount = getRUSDYByShares(_sharesAmount);\n emit Transfer(msg.sender, _recipient, tokensAmount);\n return tokensAmount;\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/0xblackskull-Q.md", "collected_at": "2026-01-02T18:25:16.380790+00:00", "source_hash": "7fb79f0261ec089d7681f3aee1055dbcc06f049ca7f9bf3b56d40dcc38fadad6", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 987, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function rescueTokens(address _token) external onlyOwner {\n uint256 balance = IRWALike(_token).balanceOf(address(this));\n IRWALike(_token).transfer(owner(), balance);\n }", "primary_code_language": "unknown", "primary_code_char_count": 176, "all_code_blocks": "// Code block 1 (unknown):\nfunction rescueTokens(address _token) external onlyOwner {\n uint256 balance = IRWALike(_token).balanceOf(address(this));\n IRWALike(_token).transfer(owner(), balance);\n }\n\n// Code block 2 (unknown):\nfunction transferShares(\n address _recipient,\n uint256 _sharesAmount\n ) public returns (uint256) {\n _transferShares(msg.sender, _recipient, _sharesAmount);\n emit TransferShares(msg.sender, _recipient, _sharesAmount);\n uint256 tokensAmount = getRUSDYByShares(_sharesAmount);\n emit Transfer(msg.sender, _recipient, tokensAmount);\n return tokensAmount;\n }\n\n// Code block 3 (unknown):\nfunction wrap(uint256 _USDYAmount) external whenNotPaused {\n require(_USDYAmount > 0, \"rUSDY: can't wrap zero USDY tokens\");\n _mintShares(msg.sender, _USDYAmount * BPS_DENOMINATOR);\n+ usdy.approve(address(this), _USDYAmount);\n usdy.transferFrom(msg.sender, address(this), _USDYAmount);\n emit Transfer(address(0), msg.sender, getRUSDYByShares(_USDYAmount));\n emit TransferShares(address(0), msg.sender, _USDYAmount);\n }", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "DestinationBridge.sol#L322, rUSDY.sol#L421", "github_files_list": "rUSDY.sol, DestinationBridge.sol", "github_refs_count": 2, "vulnerable_code_actual": " function rescueTokens(address _token) external onlyOwner {\n uint256 balance = IRWALike(_token).balanceOf(address(this));\n IRWALike(_token).transfer(owner(), balance);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function transferShares(\n address _recipient,\n uint256 _sharesAmount\n ) public returns (uint256) {\n _transferShares(msg.sender, _recipient, _sharesAmount);\n emit TransferShares(msg.sender, _recipient, _sharesAmount);\n uint256 tokensAmount = getRUSDYByShares(_sharesAmount);\n emit Transfer(msg.sender, _recipient, tokensAmount);\n return tokensAmount;\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8.79} {"source": "c4", "protocol": "01-salty", "title": "0xbrett8571 Analysis", "severity_raw": "Critical", "severity": "critical", "description": "## Introduction\n\nSalty.IO is an Ethereum-based decentralized exchange (DEX) that aims to provide zero swap fees, yield from automatic arbitrage, and a native stablecoin (USDS) backed by WBTC/WETH collateral. \n\nIn this report, I analyze the Salty.IO smart contract architecture and identifies strengths, risks, and recommendations in key areas. Focus is placed on token safety, access controls, reward mechanisms, price oracles, and the USDS stablecoin model. Both systematic risks and specific vulnerabilities are covered.\n\n**Evaluation Approach**\n\nThe analysis focused on auditing the critical Salty.IO contracts:\n\n- [Pools.sol](https://github.com/code-423n4/2024-01-salty/blob/main/src/pools/Pools.sol) - Core AMM and arbitrage logic \n- [DAO.sol](https://github.com/code-423n4/2024-01-salty/blob/main/src/dao/DAO.sol) - Governance and protocol owned liquidity\n- [Upkeep.sol](https://github.com/code-423n4/2024-01-salty/blob/main/src/Upkeep.sol) - Rewards distribution and emissions\n- [PriceAggregator.sol](https://github.com/code-423n4/2024-01-salty/blob/main/src/price_feed/PriceAggregator.sol) - Redundant price feed \n- [USDS.sol](https://github.com/code-423n4/2024-01-salty/blob/main/src/stable/USDS.sol) + [CollateralAndLiquidity.sol](https://github.com/code-423n4/2024-01-salty/blob/main/src/stable/CollateralAndLiquidity.sol) - Stablecoin model\n\nManual review was supplemented by unit tests, debugging sessions, and code instrumentation to validate assumptions and behavior. \n\nKey areas of attention included:\n\n- Access control and trust minimization \n- Token tracking and arithmetic safety\n- Protocol incentives and sustainability \n- Price feed redundancy and manipulation resistance\n- Stablecoin collateral ratios and liquidity\n\n**Here is an explanation of some of the main contracts in Salty.IO, along with a brief analysis, risks, and recommendations for each:**\n\n[**Pools.sol**](https://github.com/code-423n4/2024-01-salty/blob/main/src/pools/Pools.sol)\n\nThis is the core contract that", "vulnerable_code": "\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \n\u2502 \u2502 \n\u2502 DAO.sol \u2502 \n\u2502 Governance \u2502\n\u2502 \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u2502\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Pools.sol \u2502 \n\u2502 AMM + Arbitrage \u2502 \n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u2502 \n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2510\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Upkeep.sol \u2502\u2502 Collateral.sol \u2502\n\u2502 Rewards \u2502\u2502 Stablecoin \u2502 \n\u2502Distribution\u2502\u2502 Model \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2518\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u2502 \u2502\n \u2502 \u2502\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\u2502\n\u2502 PriceAggregator.sol\u2502\u2502 \n\u2502 Redundant \u2502\u2502\n\u2502 Price Feed \u2502\u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\u2502\n \u2502\n \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 Peripheral Contracts \n \u2502 Staking.sol, RewardsEmitter.sol, etc \n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/0xbrett8571-Analysis.md", "collected_at": "2026-01-02T19:01:09.470602+00:00", "source_hash": "7fd895abe60e09f3bf918153aa85c2c91c0e58c1b3f62452442a7467a604b9c8", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Pools.sol, DAO.sol, Upkeep.sol, PriceAggregator.sol, USDS.sol, CollateralAndLiquidity.sol", "github_files_list": "Pools.sol, DAO.sol, CollateralAndLiquidity.sol, Upkeep.sol, USDS.sol, PriceAggregator.sol", "github_refs_count": 6, "vulnerable_code_actual": "\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \n\u2502 \u2502 \n\u2502 DAO.sol \u2502 \n\u2502 Governance \u2502\n\u2502 \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u2502\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Pools.sol \u2502 \n\u2502 AMM + Arbitrage \u2502 \n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u2502 \n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2510\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Upkeep.sol \u2502\u2502 Collateral.sol \u2502\n\u2502 Rewards \u2502\u2502 Stablecoin \u2502 \n\u2502Distribution\u2502\u2502 Model \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2518\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u2502 \u2502\n \u2502 \u2502\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\u2502\n\u2502 PriceAggregator.sol\u2502\u2502 \n\u2502 Redundant \u2502\u2502\n\u2502 Price Feed \u2502\u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\u2502\n \u2502\n \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 Peripheral Contracts \n \u2502 Staking.sol, RewardsEmitter.sol, etc \n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "03-asymmetry", "title": "Lef Q", "severity_raw": "Low", "severity": "low", "description": "1) Unused function parameters should be commented out as a better and declarative way to silence runtime warning messages. As an example, the following functions may have these parameters refactored to:\n\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/d016bef40dc745b6a16e18d83bd4f7d776245903/contracts/SafEth/derivatives/SfrxEth.sol#L111\n\nRecommendation :\n\n```\n function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n \n change to\n \n function ethPerDerivative() public view returns (uint256) {\n```\n\nsame for :\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol#L86\n\n```\n function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n\n change to\n\n function ethPerDerivative() public view returns (uint256) {\n```\n\n\n\n\n\n2) Inconsistent use of uint and uint256 in events\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L207\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L25\n\n```\nevent has uint256 (uint256 indexed index, uint256 slippage);\nfunction has uint (uint _derivativeIndex, uint _slippage)\n```\nSame for events :\n\n event Staked(address indexed recipient, uint ethIn, uint safEthOut);\n event Unstaked(address indexed recipient, uint ethOut, uint safEthIn);\n event WeightChange(uint indexed index, uint weight);\n event DerivativeAdded(address indexed contractAddress,uint weight,uint index);", "vulnerable_code": " function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n \n change to\n \n function ethPerDerivative() public view returns (uint256) {", "fixed_code": " function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n\n change to\n\n function ethPerDerivative() public view returns (uint256) {", "recommendation": "", "category": "slippage", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Lef-Q.md", "collected_at": "2026-01-02T18:18:17.074827+00:00", "source_hash": "7ffa0b43cbb2dcb86fb162eb2ff033960fec0094b4c96d4f4c5bcb1c13e06049", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 424, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n \n change to\n \n function ethPerDerivative() public view returns (uint256) {", "primary_code_language": "unknown", "primary_code_char_count": 154, "all_code_blocks": "// Code block 1 (unknown):\nfunction ethPerDerivative(uint256 _amount) public view returns (uint256) {\n \n change to\n \n function ethPerDerivative() public view returns (uint256) {\n\n// Code block 2 (unknown):\nfunction ethPerDerivative(uint256 _amount) public view returns (uint256) {\n\n change to\n\n function ethPerDerivative() public view returns (uint256) {\n\n// Code block 3 (unknown):\nevent has uint256 (uint256 indexed index, uint256 slippage);\nfunction has uint (uint _derivativeIndex, uint _slippage)", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SfrxEth.sol#L111, WstEth.sol#L86, SafEth.sol#L207, SafEth.sol#L25", "github_files_list": "SfrxEth.sol, WstEth.sol, SafEth.sol", "github_refs_count": 4, "vulnerable_code_actual": " function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n \n change to\n \n function ethPerDerivative() public view returns (uint256) {", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n\n change to\n\n function ethPerDerivative() public view returns (uint256) {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8.96} {"source": "c4", "protocol": "02-ai-arena", "title": "KmanOfficial Q", "severity_raw": "Low", "severity": "low", "description": "### Low Risk / QA Issues\n\n### [01] Unnecessary emit of PointsAdded event for the Merging Pool when a fight has been won but the stakeAtRisk is more than 0.\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/RankedBattle.sol#L416-L500\n\n```\nif (battleResult == 0) {\n /// If the user won the match\n\n /// If the user has no NRNs at risk, then they can earn points\n if (stakeAtRisk == 0) {\n points = stakingFactor[tokenId] * eloFactor;\n }\n\n /// Divert a portion of the points to the merging pool\n uint256 mergingPoints = (points * mergingPortion) / 100;\n points -= mergingPoints;\n _mergingPoolInstance.addPoints(tokenId, mergingPoints);\n...\n}\n```\n\nIf stakeAtRisk is 0, it means the user is eligible to gain some points based on how much they have staked, but initially points is initialised to 0 within the function so there is no need to do calculate mergingPoints if points will be 0. It leads to unnecessary execution of `_mergingPoolInstance.addPoints` which under all circumstances emits an pointsAdded event which is state data that doesn't need to be indexed as no points were actually added to the mergingPool.\n\nRecommendation: Wrap the merging points calculation points and addition code within an if statement - `if(points > 0)`.\n\n--\n\n### [02] Total Battles is incorrectly updated twice for the same battle.\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/RankedBattle.sol#L348\n\nThe totalBattles value globally tracks the number of fights that has taken place. A fight between two users is one battle. `RankedBattle.UpdateBattleRecord` is called twice for one fight. Once for the initiator and once for the opponent. The code incorrectly increments total battles by 1 for each call for the respective users in the fight. This would give the indication that two separate battles took place, when it's the same battle. \n\nRecommendation: Move `totalBattles += 1;` to wit", "vulnerable_code": "if (battleResult == 0) {\n /// If the user won the match\n\n /// If the user has no NRNs at risk, then they can earn points\n if (stakeAtRisk == 0) {\n points = stakingFactor[tokenId] * eloFactor;\n }\n\n /// Divert a portion of the points to the merging pool\n uint256 mergingPoints = (points * mergingPortion) / 100;\n points -= mergingPoints;\n _mergingPoolInstance.addPoints(tokenId, mergingPoints);\n...\n}", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/KmanOfficial-Q.md", "collected_at": "2026-01-02T19:02:30.473118+00:00", "source_hash": "800636e4fbd7190d3687ffe469d0914595e5e3b68c20c25163e681028254dba4", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 501, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "if (battleResult == 0) {\n /// If the user won the match\n\n /// If the user has no NRNs at risk, then they can earn points\n if (stakeAtRisk == 0) {\n points = stakingFactor[tokenId] * eloFactor;\n }\n\n /// Divert a portion of the points to the merging pool\n uint256 mergingPoints = (points * mergingPortion) / 100;\n points -= mergingPoints;\n _mergingPoolInstance.addPoints(tokenId, mergingPoints);\n...\n}", "primary_code_language": "unknown", "primary_code_char_count": 501, "all_code_blocks": "// Code block 1 (unknown):\nif (battleResult == 0) {\n /// If the user won the match\n\n /// If the user has no NRNs at risk, then they can earn points\n if (stakeAtRisk == 0) {\n points = stakingFactor[tokenId] * eloFactor;\n }\n\n /// Divert a portion of the points to the merging pool\n uint256 mergingPoints = (points * mergingPortion) / 100;\n points -= mergingPoints;\n _mergingPoolInstance.addPoints(tokenId, mergingPoints);\n...\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "RankedBattle.sol#L416-L500, RankedBattle.sol#L348", "github_files_list": "RankedBattle.sol", "github_refs_count": 2, "vulnerable_code_actual": "if (battleResult == 0) {\n /// If the user won the match\n\n /// If the user has no NRNs at risk, then they can earn points\n if (stakeAtRisk == 0) {\n points = stakingFactor[tokenId] * eloFactor;\n }\n\n /// Divert a portion of the points to the merging pool\n uint256 mergingPoints = (points * mergingPortion) / 100;\n points -= mergingPoints;\n _mergingPoolInstance.addPoints(tokenId, mergingPoints);\n...\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "03-asymmetry", "title": "Rickard G", "severity_raw": "Low", "severity": "low", "description": "# [G-01] Setting the constructor to `payable`\nYou can cut out 10 opcodes in the creation-time EVM bytecode if you declare a constructor `payable`. Making the constructor payable eliminates the need for an initial check of `msg.value == 0` and saves 13 gas on deployment with no security risks.\n## Context\n4 results - 4 files\n````solidity\ncontracts/SafEth/derivatives/WstEth.sol\n24: constructor() {\n````\n[https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol#L24](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol#L24)\n````solidity\ncontracts/SafEth/derivatives/Reth.sol\n33: constructor() {\n````\n[https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L33](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L33)\n````solidity\ncontracts/SafEth/derivatives/SfrxEth.sol\n27: constructor() {\n````\n[https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol#L27](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol#L27)\n````solidity\ncontracts/SafEth/derivatives/WstEth.sol\n24: constructor() {\n````\n[https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol#L24](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol#L24)\n## Recommended mitigation steps\nSet the constructor to `payable`.\n\n# [G-02] ` += ` costs more gas than ` = + ` for state variables (`-=` too)\nUsing the addition operator instead of plus-equals saves [113 gas](https://gist.github.com/IllIllI000/cbbfb267425b898e5be734d4008d4fe8). Subtractions act the same way. \n \nThere are 10 instances of this issue.\n\n# [G-03] Functions guaranteed to revert when called by normal users can be marked `payable`\nIf a function modifier such as `onlyOwner` is use", "vulnerable_code": "contracts/SafEth/derivatives/WstEth.sol\n24: constructor() {", "fixed_code": "contracts/SafEth/derivatives/Reth.sol\n33: constructor() {", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Rickard-G.md", "collected_at": "2026-01-02T18:18:28.768234+00:00", "source_hash": "8007a934d07033020384f902f3ef515ce0c0b04ce6d11290512036b74927efdc", "code_block_count": 4, "solidity_block_count": 4, "total_code_chars": 251, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "contracts/SafEth/derivatives/WstEth.sol\n24: constructor() {", "primary_code_language": "solidity", "primary_code_char_count": 63, "all_code_blocks": "// Code block 1 (solidity):\ncontracts/SafEth/derivatives/WstEth.sol\n24: constructor() {\n\n// Code block 2 (solidity):\ncontracts/SafEth/derivatives/Reth.sol\n33: constructor() {\n\n// Code block 3 (solidity):\ncontracts/SafEth/derivatives/SfrxEth.sol\n27: constructor() {\n\n// Code block 4 (solidity):\ncontracts/SafEth/derivatives/WstEth.sol\n24: constructor() {", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "contracts/SafEth/derivatives/WstEth.sol\n24: constructor() {\n\ncontracts/SafEth/derivatives/Reth.sol\n33: constructor() {\n\ncontracts/SafEth/derivatives/SfrxEth.sol\n27: constructor() {\n\ncontracts/SafEth/derivatives/WstEth.sol\n24: constructor() {", "github_refs_formatted": "WstEth.sol#L24, Reth.sol#L33, SfrxEth.sol#L27", "github_files_list": "SfrxEth.sol, Reth.sol, WstEth.sol", "github_refs_count": 3, "vulnerable_code_actual": "contracts/SafEth/derivatives/WstEth.sol\n24: constructor() {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "contracts/SafEth/derivatives/Reth.sol\n33: constructor() {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "02-ai-arena", "title": "0xMAKEOUTHILL Q", "severity_raw": "Low", "severity": "low", "description": "**Low** - There will always be **1** unused NRN token, because of the following statement in `mint` in `Neuron.sol`:\n\n```\nfunction mint(address to, uint256 amount) public virtual {\n \n //@audit this won't mint the last token of the MAX_SUPPLY\n@>>> require(totalSupply() + amount < MAX_SUPPLY, \"Trying to mint more than the max supply\");\n require(hasRole(MINTER_ROLE, msg.sender), \"ERC20: must have minter role to mint\");\n _mint(to, amount);\n }\n```\n\n**Dummy values**\n\n**MAX_SUPPLY** = 100\n**totalSupply** - 99\n\nSo when we try to call `mint` with `amount` = 1, the `require` will revert because\n`99 + 1 < 100`. Fix the check the following way:\n\n`require(totalSupply() + amount <= MAX_SUPPLY, \"Trying to mint more than the max supply\");\n`\n\n-----------------------------------------------------------------------------------\n\n**Informational** - In `AiArenaHelper.sol` in the constructor, when we add attribute probabilities via `addAttributeProbabilities`, then when we iterate over the attributes, we again add the same probabilities to the same attributes. Remove the second adding of probabilities.\n\n```\nconstructor(uint8[][] memory probabilities) {\n\n _ownerAddress = msg.sender;\n \n // Initialize the probabilities for each attribute\n addAttributeProbabilities(0, probabilities);\n\n uint256 attributesLength = attributes.length;\n\n for (uint8 i = 0; i < attributesLength; i++) {\n \n //@audit this is not needed, remove it.\n@>>>> attributeProbabilities[0][attributes[i]] = probabilities[i];\n\n attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n\n }\n } \n```\n\n-----------------------------------------------------------------------------------\n\n**Informational** - In `FighterFarm.sol`, `redeemMintPass` the natspec above the function says:\n\n**\"/// @dev This function requires the length of all input arrays to be equal.\"**.\n\nHowever this is not the case, as `uint8[] calldata", "vulnerable_code": "function mint(address to, uint256 amount) public virtual {\n \n //@audit this won't mint the last token of the MAX_SUPPLY\n@>>> require(totalSupply() + amount < MAX_SUPPLY, \"Trying to mint more than the max supply\");\n require(hasRole(MINTER_ROLE, msg.sender), \"ERC20: must have minter role to mint\");\n _mint(to, amount);\n }", "fixed_code": "constructor(uint8[][] memory probabilities) {\n\n _ownerAddress = msg.sender;\n \n // Initialize the probabilities for each attribute\n addAttributeProbabilities(0, probabilities);\n\n uint256 attributesLength = attributes.length;\n\n for (uint8 i = 0; i < attributesLength; i++) {\n \n //@audit this is not needed, remove it.\n@>>>> attributeProbabilities[0][attributes[i]] = probabilities[i];\n\n attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n\n }\n } ", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/0xMAKEOUTHILL-Q.md", "collected_at": "2026-01-02T19:02:03.325756+00:00", "source_hash": "803db6a08d215cf17d771e5c5414fac8ce7a371fc5bbbac58ee2d878144042ae", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 894, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function mint(address to, uint256 amount) public virtual {\n \n //@audit this won't mint the last token of the MAX_SUPPLY\n@>>> require(totalSupply() + amount < MAX_SUPPLY, \"Trying to mint more than the max supply\");\n require(hasRole(MINTER_ROLE, msg.sender), \"ERC20: must have minter role to mint\");\n _mint(to, amount);\n }", "primary_code_language": "unknown", "primary_code_char_count": 354, "all_code_blocks": "// Code block 1 (unknown):\nfunction mint(address to, uint256 amount) public virtual {\n \n //@audit this won't mint the last token of the MAX_SUPPLY\n@>>> require(totalSupply() + amount < MAX_SUPPLY, \"Trying to mint more than the max supply\");\n require(hasRole(MINTER_ROLE, msg.sender), \"ERC20: must have minter role to mint\");\n _mint(to, amount);\n }\n\n// Code block 2 (unknown):\nconstructor(uint8[][] memory probabilities) {\n\n _ownerAddress = msg.sender;\n \n // Initialize the probabilities for each attribute\n addAttributeProbabilities(0, probabilities);\n\n uint256 attributesLength = attributes.length;\n\n for (uint8 i = 0; i < attributesLength; i++) {\n \n //@audit this is not needed, remove it.\n@>>>> attributeProbabilities[0][attributes[i]] = probabilities[i];\n\n attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n\n }\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function mint(address to, uint256 amount) public virtual {\n \n //@audit this won't mint the last token of the MAX_SUPPLY\n@>>> require(totalSupply() + amount < MAX_SUPPLY, \"Trying to mint more than the max supply\");\n require(hasRole(MINTER_ROLE, msg.sender), \"ERC20: must have minter role to mint\");\n _mint(to, amount);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "constructor(uint8[][] memory probabilities) {\n\n _ownerAddress = msg.sender;\n \n // Initialize the probabilities for each attribute\n addAttributeProbabilities(0, probabilities);\n\n uint256 attributesLength = attributes.length;\n\n for (uint8 i = 0; i < attributesLength; i++) {\n \n //@audit this is not needed, remove it.\n@>>>> attributeProbabilities[0][attributes[i]] = probabilities[i];\n\n attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n\n }\n } ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "10-badger", "title": "SpicyMeatball Q", "severity_raw": "High", "severity": "high", "description": "### Redundant check\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/LiquidationLibrary.sol#L863\n`_redistributeDebt` will never be called if debt = 0\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/LiquidationLibrary.sol#L525-L527\n### BaseMath is not used\nPriceFeed contract inherits from BaseMath but doesn't use it's single constant DECIMAL_PRECISION, so it's possible to remove it.\n### Unused modifier\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/EBTCToken.sol#L323\nthis modifier is not used in `EBTCTokem.sol`\n### Double checking `recipient != address(0)`\nBefore transferring tokens we invoke `_requireValidRecipient`, where among many checks we check that recipient != address(0),\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/EBTCToken.sol#L297\nsame check is made inside `_transfer` function\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/EBTCToken.sol#L248\n### Enforce beta is not zero\nAuthorized users can change `beta` value\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/CdpManager.sol#L830\nif it's set to zero. we'll divide by zero here\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/CdpManager.sol#L624\n\n### `arrayIndex` value is not deleted when we remove cpd\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/CdpManagerStorage.sol#L269-L274\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/CdpManagerStorage.sol#L471\nWhen we remove cpd, we zero all it's values, but `arrayIndex` remains.\n### UpdateManager?\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/BorrowerOperations.sol#L963\n`Borrower` can approve operations to the `PositionManager`, `UpdateManager` is not mentioned anywhere in the contract. `_requireBorrowerOrP", "vulnerable_code": " keccak256(\n \"PermitPositionManagerApproval(address borrower,address positionManager,uint8 status,uint256 nonce,uint256 deadline)\"\n );", "fixed_code": " function syncGlobalAccounting() external {\n _requireCallerIsBorrowerOperations();\n _syncGlobalAccounting();\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/SpicyMeatball-Q.md", "collected_at": "2026-01-02T18:26:38.335591+00:00", "source_hash": "80733ad2dc320877ecf50b4eb1c022072ff9b8b127c018ca3f4ae689440323dd", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 10, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LiquidationLibrary.sol#L863, LiquidationLibrary.sol#L525-L527, EBTCToken.sol#L323, EBTCToken.sol#L297, EBTCToken.sol#L248, CdpManager.sol#L830, CdpManager.sol#L624, CdpManagerStorage.sol#L269-L274, CdpManagerStorage.sol#L471, BorrowerOperations.sol#L963", "github_files_list": "CdpManagerStorage.sol, BorrowerOperations.sol, CdpManager.sol, EBTCToken.sol, LiquidationLibrary.sol", "github_refs_count": 10, "vulnerable_code_actual": " keccak256(\n \"PermitPositionManagerApproval(address borrower,address positionManager,uint8 status,uint256 nonce,uint256 deadline)\"\n );", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function syncGlobalAccounting() external {\n _requireCallerIsBorrowerOperations();\n _syncGlobalAccounting();\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "02-ai-arena", "title": "MatricksDeCoder G", "severity_raw": "Critical", "severity": "critical", "description": "#### GAS-1 Optimize Address Storage Value Management with assembly\n\nAssembly storing leads to gas savings as it has less overheads compared to abstractions\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/Neuron.sol#L71\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/Neuron.sol#L72\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/Neuron.sol#L87\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/RankedBattle.sol#L152\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/RankedBattle.sol#L153\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/RankedBattle.sol#L169\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/RankedBattle.sol#L186\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/RankedBattle.sol#L194\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/AiArenaHelper.sol#L42\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/AiArenaHelper.sol#L63\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L107\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L108\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L109\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L122\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/GameItems.sol#L96\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1", "vulnerable_code": "struct GameItemAttributes {\n string name;\n bool finiteSupply;\n bool transferable;\n uint256 itemsRemaining;\n uint256 itemPrice;\n uint256 dailyAllowance;\n } ", "fixed_code": "function setValue(uint256 _value) external onlyOwner {\n value = _value;\n}\nCan be rewritten\nfunction setValue(uint256 _value) external onlyOwner {\n assembly {\n sstore(value.slot,_value);\n }\n}\n\n\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/MatricksDeCoder-G.md", "collected_at": "2026-01-02T19:02:33.167040+00:00", "source_hash": "80ab38cc488f76c720600a7edee52ddfa5593926fb1a74111683653aabbd256f", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 15, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Neuron.sol#L71, Neuron.sol#L72, Neuron.sol#L87, RankedBattle.sol#L152, RankedBattle.sol#L153, RankedBattle.sol#L169, RankedBattle.sol#L186, RankedBattle.sol#L194, AiArenaHelper.sol#L42, AiArenaHelper.sol#L63, FighterFarm.sol#L107, FighterFarm.sol#L108, FighterFarm.sol#L109, FighterFarm.sol#L122, GameItems.sol#L96", "github_files_list": "GameItems.sol, Neuron.sol, RankedBattle.sol, FighterFarm.sol, AiArenaHelper.sol", "github_refs_count": 15, "vulnerable_code_actual": "struct GameItemAttributes {\n string name;\n bool finiteSupply;\n bool transferable;\n uint256 itemsRemaining;\n uint256 itemPrice;\n uint256 dailyAllowance;\n } ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function setValue(uint256 _value) external onlyOwner {\n value = _value;\n}\nCan be rewritten\nfunction setValue(uint256 _value) external onlyOwner {\n assembly {\n sstore(value.slot,_value);\n }\n}\n\n\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "08-dopex", "title": "0xhacksmithh Q", "severity_raw": "High", "severity": "high", "description": "### [Low-01] Code is contradicting comments\nIn `decreaseAmount()` according to comment it decreases bond amount (rdpxAmount) associated with corresponding `bondId`\n\nBut in code instead of substracting `decreaseAmount` from bond's rdpxAmount it directly set that variable('rdpxAmount') to inputed decreaseAmount. \n\nThere also absence of bond existance check before making operations on it. \n```solidity\n /// @notice Decreases the bond amount\n /// @dev Can only be called by the rdpxV2Core\n /// @param bondId id of the bond to decrease\n /// @param amount amount to decrease\n function decreaseAmount( \n uint256 bondId,\n uint256 amount\n ) public onlyRole(RDPXV2CORE_ROLE) {\n _whenNotPaused();\n- bonds[bondId].rdpxAmount = amount; \n\n\n+ bonds[bondId].rdpxAmount = bonds[bondId].rdpxAmount - amount; // @audit underflow by default reverted\n }\n```\n```\nfile: contracts/decaying-bonds/RdpxDecayingBonds.sol\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/decaying-bonds/RdpxDecayingBonds.sol#L139-L145\n```\n\n### [Low-02] While locking Collateral via `lockCollateral()` it doesn't check that locked amount is exceeding totalCollateral or not\n`lockCollateral()` simply increase `_activeCollateral` via `amount` that may lead `_activeCollateral` value to exceed `totalCollateral` in that case `totalAvailableCollateral()` call always failed.\n\nSo while increasing locked amount there should be a check that ensure increased `_activeCollateral` will never exceed `totalCollateral`\n\n```solidity\nfunction lockCollateral(uint256 amount) public onlyPerpVault {\n _activeCollateral += amount; \n }\n```\n*Instances(1)*\n```\nFile: contracts/perp-vault/PerpetualAtlanticVaultLP.sol\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/perp-vault/PerpetualAtlanticVaultLP.sol#L180-L182\n```\n\n### [Low-03] Functions like `mint()`, `burn()`, `burnFrom()` not respecting `pause` or `unpause` functionality\nThese `mint()`, `burn()`, `burnFrom()` 3 functions are `public` and only call", "vulnerable_code": " /// @notice Decreases the bond amount\n /// @dev Can only be called by the rdpxV2Core\n /// @param bondId id of the bond to decrease\n /// @param amount amount to decrease\n function decreaseAmount( \n uint256 bondId,\n uint256 amount\n ) public onlyRole(RDPXV2CORE_ROLE) {\n _whenNotPaused();\n- bonds[bondId].rdpxAmount = amount; \n\n\n+ bonds[bondId].rdpxAmount = bonds[bondId].rdpxAmount - amount; // @audit underflow by default reverted\n }", "fixed_code": "file: contracts/decaying-bonds/RdpxDecayingBonds.sol\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/decaying-bonds/RdpxDecayingBonds.sol#L139-L145", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/0xhacksmithh-Q.md", "collected_at": "2026-01-02T18:24:24.962531+00:00", "source_hash": "80b47367c3b51a974de236961de94703069b4e82873325dd552f5f81866fd72f", "code_block_count": 4, "solidity_block_count": 2, "total_code_chars": 882, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "/// @notice Decreases the bond amount\n /// @dev Can only be called by the rdpxV2Core\n /// @param bondId id of the bond to decrease\n /// @param amount amount to decrease\n function decreaseAmount( \n uint256 bondId,\n uint256 amount\n ) public onlyRole(RDPXV2CORE_ROLE) {\n _whenNotPaused();\n- bonds[bondId].rdpxAmount = amount; \n\n\n+ bonds[bondId].rdpxAmount = bonds[bondId].rdpxAmount - amount; // @audit underflow by default reverted\n }", "primary_code_language": "solidity", "primary_code_char_count": 450, "all_code_blocks": "// Code block 1 (solidity):\n/// @notice Decreases the bond amount\n /// @dev Can only be called by the rdpxV2Core\n /// @param bondId id of the bond to decrease\n /// @param amount amount to decrease\n function decreaseAmount( \n uint256 bondId,\n uint256 amount\n ) public onlyRole(RDPXV2CORE_ROLE) {\n _whenNotPaused();\n- bonds[bondId].rdpxAmount = amount; \n\n\n+ bonds[bondId].rdpxAmount = bonds[bondId].rdpxAmount - amount; // @audit underflow by default reverted\n }\n\n// Code block 2 (unknown):\nfile: contracts/decaying-bonds/RdpxDecayingBonds.sol\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/decaying-bonds/RdpxDecayingBonds.sol#L139-L145\n\n// Code block 3 (solidity):\nfunction lockCollateral(uint256 amount) public onlyPerpVault {\n _activeCollateral += amount; \n }\n\n// Code block 4 (unknown):\nFile: contracts/perp-vault/PerpetualAtlanticVaultLP.sol\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/perp-vault/PerpetualAtlanticVaultLP.sol#L180-L182", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "/// @notice Decreases the bond amount\n /// @dev Can only be called by the rdpxV2Core\n /// @param bondId id of the bond to decrease\n /// @param amount amount to decrease\n function decreaseAmount( \n uint256 bondId,\n uint256 amount\n ) public onlyRole(RDPXV2CORE_ROLE) {\n _whenNotPaused();\n- bonds[bondId].rdpxAmount = amount; \n\n\n+ bonds[bondId].rdpxAmount = bonds[bondId].rdpxAmount - amount; // @audit underflow by default reverted\n }\n\nfunction lockCollateral(uint256 amount) public onlyPerpVault {\n _activeCollateral += amount; \n }", "github_refs_formatted": "RdpxDecayingBonds.sol#L139-L145, PerpetualAtlanticVaultLP.sol#L180-L182", "github_files_list": "RdpxDecayingBonds.sol, PerpetualAtlanticVaultLP.sol", "github_refs_count": 2, "vulnerable_code_actual": " /// @notice Decreases the bond amount\n /// @dev Can only be called by the rdpxV2Core\n /// @param bondId id of the bond to decrease\n /// @param amount amount to decrease\n function decreaseAmount( \n uint256 bondId,\n uint256 amount\n ) public onlyRole(RDPXV2CORE_ROLE) {\n _whenNotPaused();\n- bonds[bondId].rdpxAmount = amount; \n\n\n+ bonds[bondId].rdpxAmount = bonds[bondId].rdpxAmount - amount; // @audit underflow by default reverted\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "file: contracts/decaying-bonds/RdpxDecayingBonds.sol\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/decaying-bonds/RdpxDecayingBonds.sol#L139-L145", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "02-ethos", "title": "lukris02 G", "severity_raw": "Low", "severity": "low", "description": "# Gas Optimizations Report for Ethos Reserve contest\n## Overview\nDuring the audit, 2 gas issues were found. \n\n\u2116 | Title | Instance Count \n--- | --- | --- \nG-1 | Use unchecked blocks for subtractions where underflow is impossible | 14 \nG-2 | Using ```storage``` pointer to ```struct```/```array```/```mapping``` is cheaper than using ```memory``` | 2 \n\n## Gas Optimizations Findings(2)\n### G-1. Use unchecked blocks for subtractions where underflow is impossible\n##### Description\nIn Solidity 0.8+, there\u2019s a default overflow and underflow check on unsigned integers. When an overflow or underflow isn\u2019t possible (after require or if-statement), some gas (~35 per instance) can be saved by using [unchecked blocks](https://docs.soliditylang.org/en/v0.8.17/control-structures.html#checked-or-unchecked-arithmetic).\n##### Instances\n- [```return -int256(stratCurrentAllocation - stratMaxAllocation);```](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L235) \n- [```uint256 remaining = value - vaultBalance;```](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L384) \n- [```token.safeTransfer(vars.stratAddr, vars.credit - vars.freeWantInStrat);```](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L526) \n- [```token.safeTransferFrom(vars.stratAddr, address(this), vars.freeWantInStrat - vars.credit);```](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L528) \n- [```lockedProfit = vars.lockedProfitBeforeLoss - vars.loss;```](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L535) \n- [```return tvlCap - balance();```](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultERC4626.sol#L82) \n- [```return convertToShares(tvlCap - balance());```](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultERC4626.so", "vulnerable_code": "##### Description\nWhen you copy a storage ```struct```/```array```/```mapping``` to a memory variable, you are copying each member by reading it from the storage, which is expensive, but when you use the ```storage``` keyword, you are just storing a pointer to the storage, which is much cheaper.\n##### Instances\n- [```Snapshots memory snapshots = depositSnapshots[_depositor];```](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/StabilityPool.sol#L687) \n- [```Snapshots memory snapshots = depositSnapshots[_depositor];```](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/StabilityPool.sol#L722) \n\n##### Recommendation\nFor example, change: ", "fixed_code": "to: ", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/lukris02-G.md", "collected_at": "2026-01-02T18:17:21.724451+00:00", "source_hash": "80c36a1eb6451ea239394e992195a932deb6129e66326bda49a556ece205225a", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 8, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ReaperVaultV2.sol#L235, ReaperVaultV2.sol#L384, ReaperVaultV2.sol#L526, ReaperVaultV2.sol#L528, ReaperVaultV2.sol#L535, ReaperVaultERC4626.sol#L82, StabilityPool.sol#L687, StabilityPool.sol#L722", "github_files_list": "ReaperVaultV2.sol, ReaperVaultERC4626.sol, StabilityPool.sol", "github_refs_count": 8, "vulnerable_code_actual": "##### Description\nWhen you copy a storage ```struct```/```array```/```mapping``` to a memory variable, you are copying each member by reading it from the storage, which is expensive, but when you use the ```storage``` keyword, you are just storing a pointer to the storage, which is much cheaper.\n##### Instances\n- [```Snapshots memory snapshots = depositSnapshots[_depositor];```](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/StabilityPool.sol#L687) \n- [```Snapshots memory snapshots = depositSnapshots[_depositor];```](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/StabilityPool.sol#L722) \n\n##### Recommendation\nFor example, change: ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "to: ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "03-asymmetry", "title": "EvanW Q", "severity_raw": "Low", "severity": "low", "description": "[QA-01] **NatSpec comments provide rich code documentation. The following functions are some examples that miss the\u00a0`@param`\u00a0and/or\u00a0`@return`\u00a0comments.**\n\n```solidity\ncontracts/SafEth/derivativrs/WstEth.sol\n48: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n56: function withdraw(uint256 _amount) external onlyOwner {\n86: function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n\ncontracts/SafEth/derivativrs/SfrxEth.sol\n51: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n111: function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n\ncontracts/SafEth/derivativrs/Reth.sol\n103: function withdraw(uint256 amount) external onlyOwner {\n```", "vulnerable_code": "contracts/SafEth/derivativrs/WstEth.sol\n48: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n56: function withdraw(uint256 _amount) external onlyOwner {\n86: function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n\ncontracts/SafEth/derivativrs/SfrxEth.sol\n51: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n111: function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n\ncontracts/SafEth/derivativrs/Reth.sol\n103: function withdraw(uint256 amount) external onlyOwner {", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/EvanW-Q.md", "collected_at": "2026-01-02T18:18:04.733109+00:00", "source_hash": "80c4de361a59aff4d1b684a8564e01340be2df37cdf057118c6133f0c398d730", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 535, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "contracts/SafEth/derivativrs/WstEth.sol\n48: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n56: function withdraw(uint256 _amount) external onlyOwner {\n86: function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n\ncontracts/SafEth/derivativrs/SfrxEth.sol\n51: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n111: function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n\ncontracts/SafEth/derivativrs/Reth.sol\n103: function withdraw(uint256 amount) external onlyOwner {", "primary_code_language": "solidity", "primary_code_char_count": 535, "all_code_blocks": "// Code block 1 (solidity):\ncontracts/SafEth/derivativrs/WstEth.sol\n48: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n56: function withdraw(uint256 _amount) external onlyOwner {\n86: function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n\ncontracts/SafEth/derivativrs/SfrxEth.sol\n51: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n111: function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n\ncontracts/SafEth/derivativrs/Reth.sol\n103: function withdraw(uint256 amount) external onlyOwner {", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "contracts/SafEth/derivativrs/WstEth.sol\n48: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n56: function withdraw(uint256 _amount) external onlyOwner {\n86: function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n\ncontracts/SafEth/derivativrs/SfrxEth.sol\n51: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n111: function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n\ncontracts/SafEth/derivativrs/Reth.sol\n103: function withdraw(uint256 amount) external onlyOwner {", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "contracts/SafEth/derivativrs/WstEth.sol\n48: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n56: function withdraw(uint256 _amount) external onlyOwner {\n86: function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n\ncontracts/SafEth/derivativrs/SfrxEth.sol\n51: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n111: function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n\ncontracts/SafEth/derivativrs/Reth.sol\n103: function withdraw(uint256 amount) external onlyOwner {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 3.41} {"source": "c4", "protocol": "03-asymmetry", "title": "Infect3d Q", "severity_raw": "Critical", "severity": "critical", "description": "# Low Risk and Non-Critical Issues\n\n## N-01 Better to use `__ownable_init()` instead of `_transferOwnership()` as this is the recommended way to initialize the Ownable contract.\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L53\n\n##### SafEth::initialize\n\n```solidity\nFile: contracts\\SafeEth.sol\n48: function initialize(\n49: string memory _tokenName,\n50: string memory _tokenSymbol\n51: ) external initializer {\n52: ERC20Upgradeable.__ERC20_init(_tokenName, _tokenSymbol);\n53: _transferOwnership(msg.sender);\n\n\n```\n\n\n## N-02 No event triggered when `minAmount` and `maxAmount` are set\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L54-L55\nImportnat changes to the protocol should be emitted through events\n\n##### SafeEth::initialize\n```solidity\nFile: contracts\\SafeEth.sol\n48: function initialize(\n49: string memory _tokenName,\n50: string memory _tokenSymbol\n51: ) external initializer {\n52: ERC20Upgradeable.__ERC20_init(_tokenName, _tokenSymbol);\n53: _transferOwnership(msg.sender);\n54: minAmount = 5 * 10 ** 17; // initializing with .5 ETH as minimum\n55: maxAmount = 200 * 10 ** 18; // initializing with 200 ETH as maximum\n56: }\n\n```\n", "vulnerable_code": "File: contracts\\SafeEth.sol\n48: function initialize(\n49: string memory _tokenName,\n50: string memory _tokenSymbol\n51: ) external initializer {\n52: ERC20Upgradeable.__ERC20_init(_tokenName, _tokenSymbol);\n53: _transferOwnership(msg.sender);\n\n", "fixed_code": "File: contracts\\SafeEth.sol\n48: function initialize(\n49: string memory _tokenName,\n50: string memory _tokenSymbol\n51: ) external initializer {\n52: ERC20Upgradeable.__ERC20_init(_tokenName, _tokenSymbol);\n53: _transferOwnership(msg.sender);\n54: minAmount = 5 * 10 ** 17; // initializing with .5 ETH as minimum\n55: maxAmount = 200 * 10 ** 18; // initializing with 200 ETH as maximum\n56: }\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Infect3d-Q.md", "collected_at": "2026-01-02T18:18:10.674441+00:00", "source_hash": "80d6712a55742a60b12599c67b5feea997433bbcaa40cc83ed7fabbb09819643", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 725, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts\\SafeEth.sol\n48: function initialize(\n49: string memory _tokenName,\n50: string memory _tokenSymbol\n51: ) external initializer {\n52: ERC20Upgradeable.__ERC20_init(_tokenName, _tokenSymbol);\n53: _transferOwnership(msg.sender);", "primary_code_language": "solidity", "primary_code_char_count": 279, "all_code_blocks": "// Code block 1 (solidity):\nFile: contracts\\SafeEth.sol\n48: function initialize(\n49: string memory _tokenName,\n50: string memory _tokenSymbol\n51: ) external initializer {\n52: ERC20Upgradeable.__ERC20_init(_tokenName, _tokenSymbol);\n53: _transferOwnership(msg.sender);\n\n// Code block 2 (solidity):\nFile: contracts\\SafeEth.sol\n48: function initialize(\n49: string memory _tokenName,\n50: string memory _tokenSymbol\n51: ) external initializer {\n52: ERC20Upgradeable.__ERC20_init(_tokenName, _tokenSymbol);\n53: _transferOwnership(msg.sender);\n54: minAmount = 5 * 10 ** 17; // initializing with .5 ETH as minimum\n55: maxAmount = 200 * 10 ** 18; // initializing with 200 ETH as maximum\n56: }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: contracts\\SafeEth.sol\n48: function initialize(\n49: string memory _tokenName,\n50: string memory _tokenSymbol\n51: ) external initializer {\n52: ERC20Upgradeable.__ERC20_init(_tokenName, _tokenSymbol);\n53: _transferOwnership(msg.sender);\n\nFile: contracts\\SafeEth.sol\n48: function initialize(\n49: string memory _tokenName,\n50: string memory _tokenSymbol\n51: ) external initializer {\n52: ERC20Upgradeable.__ERC20_init(_tokenName, _tokenSymbol);\n53: _transferOwnership(msg.sender);\n54: minAmount = 5 * 10 ** 17; // initializing with .5 ETH as minimum\n55: maxAmount = 200 * 10 ** 18; // initializing with 200 ETH as maximum\n56: }", "github_refs_formatted": "SafEth.sol#L53, SafEth.sol#L54-L55", "github_files_list": "SafEth.sol", "github_refs_count": 2, "vulnerable_code_actual": "File: contracts\\SafeEth.sol\n48: function initialize(\n49: string memory _tokenName,\n50: string memory _tokenSymbol\n51: ) external initializer {\n52: ERC20Upgradeable.__ERC20_init(_tokenName, _tokenSymbol);\n53: _transferOwnership(msg.sender);\n\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts\\SafeEth.sol\n48: function initialize(\n49: string memory _tokenName,\n50: string memory _tokenSymbol\n51: ) external initializer {\n52: ERC20Upgradeable.__ERC20_init(_tokenName, _tokenSymbol);\n53: _transferOwnership(msg.sender);\n54: minAmount = 5 * 10 ** 17; // initializing with .5 ETH as minimum\n55: maxAmount = 200 * 10 ** 18; // initializing with 200 ETH as maximum\n56: }\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7.63} {"source": "c4", "protocol": "01-biconomy", "title": "seeu G", "severity_raw": "Gas", "severity": "gas", "description": "## Missing implementation Shift Right/Left for division and multiplication\n\n### Description\n\nThe `SHR` opcode only utilizes 3 gas, compared to the 5 gas used by the `DIV` opcode. Additionally, shifting is used to get around Solidity's division operation's division-by-0 prohibition.\n\n### Findings\n\n```\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/libs/Math.sol#L36 => return (a & b) + (a ^ b) / 2;\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L200 => uint256 startGas = gasleft() + 21000 + msg.data.length * 8;\n```\n\n### References\n- [G008 - Use Shift Right/Left instead of Division/Multiplication if possible](https://github.com/byterocket/c4-common-issues/blob/main/0-Gas-Optimizations.md#g008---use-shift-rightleft-instead-of-divisionmultiplication-if-possible)\n- [EVM Opcodes](https://www.evm.codes/)\n\n", "vulnerable_code": "https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/libs/Math.sol#L36 => return (a & b) + (a ^ b) / 2;\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L200 => uint256 startGas = gasleft() + 21000 + msg.data.length * 8;", "fixed_code": "", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/seeu-G.md", "collected_at": "2026-01-02T18:14:08.735589+00:00", "source_hash": "80d95b4934806dde337d3a05718a750eaa68e50b08015fecdd6c0be79c9c3d6e", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 341, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/libs/Math.sol#L36 => return (a & b) + (a ^ b) / 2;\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L200 => uint256 startGas = gasleft() + 21000 + msg.data.length * 8;", "primary_code_language": "unknown", "primary_code_char_count": 341, "all_code_blocks": "// Code block 1 (unknown):\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/libs/Math.sol#L36 => return (a & b) + (a ^ b) / 2;\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L200 => uint256 startGas = gasleft() + 21000 + msg.data.length * 8;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Math.sol#L36, SmartAccount.sol#L200", "github_files_list": "Math.sol, SmartAccount.sol", "github_refs_count": 2, "vulnerable_code_actual": "https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/libs/Math.sol#L36 => return (a & b) + (a ^ b) / 2;\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L200 => uint256 startGas = gasleft() + 21000 + msg.data.length * 8;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.88} {"source": "c4", "protocol": "01-salty", "title": "0xta G", "severity_raw": "Medium", "severity": "medium", "description": "# Gas Optimization\n\n## [G-01] Pre-increment and pre-decrement are cheaper than +1 ,-1\n\n```solidity\nFile: src/stable/CollateralAndLiquidity.sol\n\n350\t\treturn findLiquidatableUsers( 0, numberOfUsersWithBorrowedUSDS() - 1 );\n```\n\nhttps://github.com/code-423n4/2024-01-salty/blob/main/src/stable/CollateralAndLiquidity.sol#L350\n\n```solidity\nFile: src/stable/StableConfig.sol\n\n52\t\t\tuint256 remainingRatioAfterReward = minimumCollateralRatioPercent - rewardPercentForCallingLiquidation - 1;\n\n128\t\t\tuint256 remainingRatioAfterReward = minimumCollateralRatioPercent - 1 - rewardPercentForCallingLiquidation;\n```\n\nhttps://github.com/code-423n4/2024-01-salty/blob/main/src/stable/StableConfig.sol#L52\n\n```solidity\nFile: src/staking/Staking.sol\n\n160 Unstake[] memory unstakes = new Unstake[](end - start + 1);\n\n179\t\treturn unstakesForUser( user, 0, unstakeIDs.length - 1 );\n```\n\nhttps://github.com/code-423n4/2024-01-salty/blob/main/src/staking/Staking.sol#L160\n\n```solidity\nFile: src/stable/CollateralAndLiquidity.sol\n\n313\t\taddress[] memory liquidatableUsers = new address[](endIndex - startIndex + 1);\n```\n\nhttps://github.com/code-423n4/2024-01-salty/blob/main/src/stable/CollateralAndLiquidity.sol#L313\n\n## [G-02] Use ASSEMBLY to validate msg.sender\n\n```solidity\nFile: src/AccessManager.sol\n\n43 \trequire( msg.sender == address(dao), \"AccessManager.excludedCountriedUpdated only callable by the DAO\" );\n```\n\nhttps://github.com/code-423n4/2024-01-salty/blob/main/src/AccessManager.sol#L43\n\n```solidity\nFile: src/launch/Airdrop.sol\n\n48 \trequire( msg.sender == address(exchangeConfig.initialDistribution().bootstrapBallot()), \"Only the BootstrapBallot can call Airdrop.authorizeWallet\" );\n\n58 \trequire( msg.sender == address(exchangeConfig.initialDistribution()), \"Airdrop.allowClaiming can only be called by the InitialDistribution contract\" );\n\n```\n\nhttps://github.com/code-423n4/2024-01-salty/blob/main/src/launch/Airdrop.sol#L48\n\n```solidity\nFile: src/stable/CollateralAndLiquidity.sol\n\n142\t\tr", "vulnerable_code": "File: src/stable/CollateralAndLiquidity.sol\n\n350\t\treturn findLiquidatableUsers( 0, numberOfUsersWithBorrowedUSDS() - 1 );", "fixed_code": "File: src/stable/StableConfig.sol\n\n52\t\t\tuint256 remainingRatioAfterReward = minimumCollateralRatioPercent - rewardPercentForCallingLiquidation - 1;\n\n128\t\t\tuint256 remainingRatioAfterReward = minimumCollateralRatioPercent - 1 - rewardPercentForCallingLiquidation;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/0xta-G.md", "collected_at": "2026-01-02T19:01:10.387362+00:00", "source_hash": "80dc568d9d5dfdf0a5341b69317e924815c9e128a437c06dfe5d95af944140fc", "code_block_count": 6, "solidity_block_count": 6, "total_code_chars": 1164, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: src/stable/CollateralAndLiquidity.sol\n\n350\t\treturn findLiquidatableUsers( 0, numberOfUsersWithBorrowedUSDS() - 1 );", "primary_code_language": "solidity", "primary_code_char_count": 121, "all_code_blocks": "// Code block 1 (solidity):\nFile: src/stable/CollateralAndLiquidity.sol\n\n350\t\treturn findLiquidatableUsers( 0, numberOfUsersWithBorrowedUSDS() - 1 );\n\n// Code block 2 (solidity):\nFile: src/stable/StableConfig.sol\n\n52\t\t\tuint256 remainingRatioAfterReward = minimumCollateralRatioPercent - rewardPercentForCallingLiquidation - 1;\n\n128\t\t\tuint256 remainingRatioAfterReward = minimumCollateralRatioPercent - 1 - rewardPercentForCallingLiquidation;\n\n// Code block 3 (solidity):\nFile: src/staking/Staking.sol\n\n160 Unstake[] memory unstakes = new Unstake[](end - start + 1);\n\n179\t\treturn unstakesForUser( user, 0, unstakeIDs.length - 1 );\n\n// Code block 4 (solidity):\nFile: src/stable/CollateralAndLiquidity.sol\n\n313\t\taddress[] memory liquidatableUsers = new address[](endIndex - startIndex + 1);\n\n// Code block 5 (solidity):\nFile: src/AccessManager.sol\n\n43 \trequire( msg.sender == address(dao), \"AccessManager.excludedCountriedUpdated only callable by the DAO\" );\n\n// Code block 6 (solidity):\nFile: src/launch/Airdrop.sol\n\n48 \trequire( msg.sender == address(exchangeConfig.initialDistribution().bootstrapBallot()), \"Only the BootstrapBallot can call Airdrop.authorizeWallet\" );\n\n58 \trequire( msg.sender == address(exchangeConfig.initialDistribution()), \"Airdrop.allowClaiming can only be called by the InitialDistribution contract\" );", "all_code_blocks_count": 6, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: src/stable/CollateralAndLiquidity.sol\n\n350\t\treturn findLiquidatableUsers( 0, numberOfUsersWithBorrowedUSDS() - 1 );\n\nFile: src/stable/StableConfig.sol\n\n52\t\t\tuint256 remainingRatioAfterReward = minimumCollateralRatioPercent - rewardPercentForCallingLiquidation - 1;\n\n128\t\t\tuint256 remainingRatioAfterReward = minimumCollateralRatioPercent - 1 - rewardPercentForCallingLiquidation;\n\nFile: src/staking/Staking.sol\n\n160 Unstake[] memory unstakes = new Unstake[](end - start + 1);\n\n179\t\treturn unstakesForUser( user, 0, unstakeIDs.length - 1 );\n\nFile: src/stable/CollateralAndLiquidity.sol\n\n313\t\taddress[] memory liquidatableUsers = new address[](endIndex - startIndex + 1);\n\nFile: src/AccessManager.sol\n\n43 \trequire( msg.sender == address(dao), \"AccessManager.excludedCountriedUpdated only callable by the DAO\" );\n\nFile: src/launch/Airdrop.sol\n\n48 \trequire( msg.sender == address(exchangeConfig.initialDistribution().bootstrapBallot()), \"Only the BootstrapBallot can call Airdrop.authorizeWallet\" );\n\n58 \trequire( msg.sender == address(exchangeConfig.initialDistribution()), \"Airdrop.allowClaiming can only be called by the InitialDistribution contract\" );", "github_refs_formatted": "CollateralAndLiquidity.sol#L350, StableConfig.sol#L52, Staking.sol#L160, CollateralAndLiquidity.sol#L313, AccessManager.sol#L43, Airdrop.sol#L48", "github_files_list": "Airdrop.sol, AccessManager.sol, CollateralAndLiquidity.sol, Staking.sol, StableConfig.sol", "github_refs_count": 6, "vulnerable_code_actual": "File: src/stable/CollateralAndLiquidity.sol\n\n350\t\treturn findLiquidatableUsers( 0, numberOfUsersWithBorrowedUSDS() - 1 );", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: src/stable/StableConfig.sol\n\n52\t\t\tuint256 remainingRatioAfterReward = minimumCollateralRatioPercent - rewardPercentForCallingLiquidation - 1;\n\n128\t\t\tuint256 remainingRatioAfterReward = minimumCollateralRatioPercent - 1 - rewardPercentForCallingLiquidation;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 12} {"source": "c4", "protocol": "11-kelp", "title": "cheatc0d3 G", "severity_raw": "Medium", "severity": "medium", "description": "## Gas Optimization Report for Kelp DAO\n\n### Use Smaller Integer Types for State Variables\n\nSmaller integer types can reduce gas costs significantly when used in state variables.\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTConfig.sol#L16\n\n**Instances:**\n- `depositLimitByAsset` mapping uses `uint256` for deposit limits.\n\n```solidity\nmapping(address token => uint256 amount) public depositLimitByAsset;\n```\n\n**Proposed Changes:**\nIf the expected range of `depositLimitByAsset` values is within the limits of a smaller integer type, consider using `uint128` or another smaller type.\n\n```solidity\nmapping(address token => uint128 amount) public depositLimitByAsset;\n```\n\n### Caching Results of External Functions\n\nRepeatedly calling the same external function in a transaction can be optimized by caching its result in a local variable.\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTConfig.sol#L80\n\n**Instances:**\n- Multiple checks of `isSupportedAsset[asset]` in `_addNewSupportedAsset` function.\n\n```solidity\nfunction _addNewSupportedAsset(address asset, uint256 depositLimit) private {\n UtilLib.checkNonZeroAddress(asset);\n if (isSupportedAsset[asset]) {\n revert AssetAlreadySupported();\n }\n // ...\n}\n```\n\n**Proposed Changes:**\nCache the value of `isSupportedAsset[asset]` in a local variable to reduce gas costs.\n\n```solidity\nfunction _addNewSupportedAsset(address asset, uint256 depositLimit) private {\n UtilLib.checkNonZeroAddress(asset);\n bool assetSupported = isSupportedAsset[asset];\n if (assetSupported) {\n revert AssetAlreadySupported();\n }\n // ...\n}\n```\n\n### Using Immutable for Fixed Values\n\nImmutable variables are cheaper to access than regular state variables.\n\n**Instances:**\n- `rsETH` address is a regular state variable.\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTConfig.sol#L21\n\n```solidity\naddress public rsETH;\n```\n\n**Proposed Changes:**\nIf `rsETH` is set once and does not change, conside", "vulnerable_code": "mapping(address token => uint256 amount) public depositLimitByAsset;", "fixed_code": "mapping(address token => uint128 amount) public depositLimitByAsset;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/cheatc0d3-G.md", "collected_at": "2026-01-02T18:27:53.762769+00:00", "source_hash": "80e69bbede4c3279812c3cbbd7dc177adc260399ca0c1fd3f3b074af9a480d5e", "code_block_count": 5, "solidity_block_count": 5, "total_code_chars": 621, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "mapping(address token => uint256 amount) public depositLimitByAsset;", "primary_code_language": "solidity", "primary_code_char_count": 68, "all_code_blocks": "// Code block 1 (solidity):\nmapping(address token => uint256 amount) public depositLimitByAsset;\n\n// Code block 2 (solidity):\nmapping(address token => uint128 amount) public depositLimitByAsset;\n\n// Code block 3 (solidity):\nfunction _addNewSupportedAsset(address asset, uint256 depositLimit) private {\n UtilLib.checkNonZeroAddress(asset);\n if (isSupportedAsset[asset]) {\n revert AssetAlreadySupported();\n }\n // ...\n}\n\n// Code block 4 (solidity):\nfunction _addNewSupportedAsset(address asset, uint256 depositLimit) private {\n UtilLib.checkNonZeroAddress(asset);\n bool assetSupported = isSupportedAsset[asset];\n if (assetSupported) {\n revert AssetAlreadySupported();\n }\n // ...\n}\n\n// Code block 5 (solidity):\naddress public rsETH;", "all_code_blocks_count": 5, "has_diff_blocks": false, "diff_code": "", "solidity_code": "mapping(address token => uint256 amount) public depositLimitByAsset;\n\nmapping(address token => uint128 amount) public depositLimitByAsset;\n\nfunction _addNewSupportedAsset(address asset, uint256 depositLimit) private {\n UtilLib.checkNonZeroAddress(asset);\n if (isSupportedAsset[asset]) {\n revert AssetAlreadySupported();\n }\n // ...\n}\n\nfunction _addNewSupportedAsset(address asset, uint256 depositLimit) private {\n UtilLib.checkNonZeroAddress(asset);\n bool assetSupported = isSupportedAsset[asset];\n if (assetSupported) {\n revert AssetAlreadySupported();\n }\n // ...\n}\n\naddress public rsETH;", "github_refs_formatted": "LRTConfig.sol#L16, LRTConfig.sol#L80, LRTConfig.sol#L21", "github_files_list": "LRTConfig.sol", "github_refs_count": 3, "vulnerable_code_actual": "mapping(address token => uint256 amount) public depositLimitByAsset;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "mapping(address token => uint128 amount) public depositLimitByAsset;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 11} {"source": "c4", "protocol": "01-salty", "title": "0xMango Q", "severity_raw": "High", "severity": "high", "description": "## It is possible to use invalid signatures to vote in ```BoostrapBallot.sol```\n\nSignature malleability:\nDue to the lack of checks in the ```SigningTools.sol``` contract, given signatures can be modified for invalid ```s``` and ```v```. These signatures if passed into ```SigningTools._verifySignature()``` will still generate the desired public key & have the function call pass.\n\nAffected line in question:\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/SigningTools.sol#L11\n\nAs proof of this being possible, this modified signature can be used instead of the provided signature in dev/Deployment.sol ln:120.\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/dev/Deployment.sol#L120\n\nModified Signature:\n```\nhex\"0x291f777bcf554105b4067f14d2bb3da27f778af49fe2f008e718328a91cae2f8e1314f4b12e29a3ab940f9fc393caa97141250333d7957bb1d3c1093d96480e11b\"\n```\n\nOriginal Signature:\n```\nhex\"291f777bcf554105b4067f14d2bb3da27f778af49fe2f008e718328a91cae2f81eceb0b4ed1d65c546bf0603c6c35567a69c8cb371cf4880a2964df8f6d1c0601c\";\n```\n\nThis signature will successfully sign tx's with the dataHash of ```keccak256(abi.encode(block.chainid, msg.sender));```\nWhere the chainid is the one from Sepolia & msg.sender being Alice's public key.\n\nSolution:\nUsing OZ ECDSA.sol contract, which has the proper error handling for invalid signatures and ensures for proper lower ```s``` values.\n\n## Uniswapv3's TWAP could potentially be manipulated to cause a DOS or price manipulation\n\nUniswap's v3 TWAP oracle can be manipulated by validators with high stake.\nDue to the nature of Uniswapv3's geometric mean, the price change needs to occur multiple times, to eventually affect the resulting price feed.\nSource: \nhttps://chainsecurity.com/oracle-manipulation-after-merge/\nUnfortunately, the amount of times might not have to be that many. To write an observation in UniswapV3 pools, users must pay extra gas, to make the addition to the a", "vulnerable_code": "Signature malleability:\nDue to the lack of checks in the ```SigningTools.sol``` contract, given signatures can be modified for invalid ```s``` and ```v```. These signatures if passed into ```SigningTools._verifySignature()``` will still generate the desired public key & have the function call pass.\n\nAffected line in question:\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/SigningTools.sol#L11\n\nAs proof of this being possible, this modified signature can be used instead of the provided signature in dev/Deployment.sol ln:120.\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/dev/Deployment.sol#L120\n\nModified Signature:", "fixed_code": "Original Signature:", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/0xMango-Q.md", "collected_at": "2026-01-02T19:01:04.235391+00:00", "source_hash": "80fe5184a4fabe97343401c74f0d05c265f79525892cb3c4951f6c874afdb2ab", "code_block_count": 4, "solidity_block_count": 0, "total_code_chars": 537, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "Signature malleability:\nDue to the lack of checks in the", "primary_code_language": "unknown", "primary_code_char_count": 56, "all_code_blocks": "// Code block 1 (unknown):\nSignature malleability:\nDue to the lack of checks in the\n\n// Code block 2 (unknown):\nhex\"0x291f777bcf554105b4067f14d2bb3da27f778af49fe2f008e718328a91cae2f8e1314f4b12e29a3ab940f9fc393caa97141250333d7957bb1d3c1093d96480e11b\"\n\n// Code block 3 (unknown):\nhex\"291f777bcf554105b4067f14d2bb3da27f778af49fe2f008e718328a91cae2f81eceb0b4ed1d65c546bf0603c6c35567a69c8cb371cf4880a2964df8f6d1c0601c\";\n\n// Code block 4 (unknown):\nWhere the chainid is the one from Sepolia & msg.sender being Alice's public key.\n\nSolution:\nUsing OZ ECDSA.sol contract, which has the proper error handling for invalid signatures and ensures for proper lower", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SigningTools.sol#L11, Deployment.sol#L120", "github_files_list": "SigningTools.sol, Deployment.sol", "github_refs_count": 2, "vulnerable_code_actual": "Signature malleability:\nDue to the lack of checks in the ```SigningTools.sol``` contract, given signatures can be modified for invalid ```s``` and ```v```. These signatures if passed into ```SigningTools._verifySignature()``` will still generate the desired public key & have the function call pass.\n\nAffected line in question:\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/SigningTools.sol#L11\n\nAs proof of this being possible, this modified signature can be used instead of the provided signature in dev/Deployment.sol ln:120.\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/dev/Deployment.sol#L120\n\nModified Signature:", "has_vulnerable_code_snippet": true, "fixed_code_actual": "Original Signature:", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "08-dopex", "title": "0x180db Q", "severity_raw": "Low", "severity": "low", "description": "# L-01\nPotential DoS: If the admin sets the `_fundingDuration` variable to a value of `0` in the `updateFundingDuration` function, then the `nextFundingPaymentTimestamp()` function will always return the value of the `genesis` variable. As a result, the expression in the loop of the `updateFundingPaymentPointer()` function will always evaluate to `true`.\n```\n function updateFundingDuration(\n uint256 _fundingDuration\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n fundingDuration = _fundingDuration;\n }\n```\n[https://github.com/code-423n4/2023-08-dopex/blob/b174dcd7b68a5372d7b9a97c9dd50895e742689c/contracts/perp-vault/PerpetualAtlanticVault.sol#L237](https://github.com/code-423n4/2023-08-dopex/blob/b174dcd7b68a5372d7b9a97c9dd50895e742689c/contracts/perp-vault/PerpetualAtlanticVault.sol#L237)\n\n```\n function nextFundingPaymentTimestamp()\n public\n view\n returns (uint256 timestamp)\n {\n return genesis + (latestFundingPaymentPointer * fundingDuration);\n }\n```\n[https://github.com/code-423n4/2023-08-dopex/blob/b174dcd7b68a5372d7b9a97c9dd50895e742689c/contracts/perp-vault/PerpetualAtlanticVault.sol#L568](https://github.com/code-423n4/2023-08-dopex/blob/b174dcd7b68a5372d7b9a97c9dd50895e742689c/contracts/perp-vault/PerpetualAtlanticVault.sol#L568)\n\n```\n function updateFundingPaymentPointer() public {\n while (block.timestamp >= nextFundingPaymentTimestamp()) {\n ...\n }\n }\n```\n[https://github.com/code-423n4/2023-08-dopex/blob/b174dcd7b68a5372d7b9a97c9dd50895e742689c/contracts/perp-vault/PerpetualAtlanticVault.sol#L463](https://github.com/code-423n4/2023-08-dopex/blob/b174dcd7b68a5372d7b9a97c9dd50895e742689c/contracts/perp-vault/PerpetualAtlanticVault.sol#L463)\n\n## Recommended Mitigation Steps\nTo address this, add validation for the value of the `_funding` variable\n```\n _validate(_fundingDuration > 0, 1);\n```\n\n# L-02\nUnused function `getLpTokenBalanceInWeth()`\n\n```\n> grep -r -n \"getLpTokenBalanceInWeth\" .\n./amo/UniV2LiquidityAmo.sol:372: function ", "vulnerable_code": " function updateFundingDuration(\n uint256 _fundingDuration\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n fundingDuration = _fundingDuration;\n }", "fixed_code": " function nextFundingPaymentTimestamp()\n public\n view\n returns (uint256 timestamp)\n {\n return genesis + (latestFundingPaymentPointer * fundingDuration);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/0x180db-Q.md", "collected_at": "2026-01-02T18:24:09.652285+00:00", "source_hash": "81453ba3d0c98d20af97b0f8ec1ad421b64f1134e084689155d79b7eb0cff163", "code_block_count": 4, "solidity_block_count": 0, "total_code_chars": 482, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function updateFundingDuration(\n uint256 _fundingDuration\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n fundingDuration = _fundingDuration;\n }", "primary_code_language": "unknown", "primary_code_char_count": 148, "all_code_blocks": "// Code block 1 (unknown):\nfunction updateFundingDuration(\n uint256 _fundingDuration\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n fundingDuration = _fundingDuration;\n }\n\n// Code block 2 (unknown):\nfunction nextFundingPaymentTimestamp()\n public\n view\n returns (uint256 timestamp)\n {\n return genesis + (latestFundingPaymentPointer * fundingDuration);\n }\n\n// Code block 3 (unknown):\nfunction updateFundingPaymentPointer() public {\n while (block.timestamp >= nextFundingPaymentTimestamp()) {\n ...\n }\n }\n\n// Code block 4 (unknown):\n_validate(_fundingDuration > 0, 1);", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "PerpetualAtlanticVault.sol#L237, PerpetualAtlanticVault.sol#L568, PerpetualAtlanticVault.sol#L463", "github_files_list": "PerpetualAtlanticVault.sol", "github_refs_count": 3, "vulnerable_code_actual": " function updateFundingDuration(\n uint256 _fundingDuration\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n fundingDuration = _fundingDuration;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function nextFundingPaymentTimestamp()\n public\n view\n returns (uint256 timestamp)\n {\n return genesis + (latestFundingPaymentPointer * fundingDuration);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "01-biconomy", "title": "IllIllI G", "severity_raw": "High", "severity": "high", "description": "## Summary\n\n### Gas Optimizations\n| |Issue|Instances|Total Gas Saved|\n|-|:-|:-:|:-:|\n| [G‑01] | `internal` functions only called once can be inlined to save gas | 9 | 180 |\n| [G‑02] | Add `unchecked {}` for subtractions where the operands cannot underflow because of a previous `require()` or `if`-statement | 2 | 170 |\n| [G‑03] | `++i`/`i++` should be `unchecked{++i}`/`unchecked{i++}` when it is not possible for them to overflow, as is the case when used in `for`- and `while`-loops | 5 | 300 |\n| [G‑04] | `require()`/`revert()` strings longer than 32 bytes cost extra gas | 1 | - |\n| [G‑05] | `keccak256()` should only need to be called on a specific string literal once | 1 | 42 |\n| [G‑06] | Optimize names to save gas | 21 | 462 |\n| [G‑07] | `>=` costs less gas than `>` | 1 | 3 |\n| [G‑08] | Splitting `require()` statements that use `&&` saves gas | 3 | 9 |\n| [G‑09] | `require()` or `revert()` statements that check input arguments should be at the top of the function | 6 | - |\n| [G‑10] | Functions guaranteed to revert when called by normal users can be marked `payable` | 4 | 84 |\n\nTotal: 53 instances over 10 issues with **1250 gas** saved\n\nGas totals use lower bounds of ranges and count two iterations of each `for`-loop. All values above are runtime, not deployment, values; deployment values are listed in the individual issue descriptions. The table above as well as its gas numbers do not include any of the excluded findings.\n\n\n\n\n\n## Gas Optimizations\n\n### [G‑01] `internal` functions only called once can be inlined to save gas\nNot inlining costs **20 to 40 gas** because of two extra `JUMP` instructions and additional stack operations needed for function calls.\n\n*There are 9 instances of this issue:*\n\n```solidity\nFile: scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol\n\n203: function _copyUserOpToMemory(UserOperation calldata userOp, MemoryUserOp memory mUse", "vulnerable_code": "File: scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol\n\n203: function _copyUserOpToMemory(UserOperation calldata userOp, MemoryUserOp memory mUserOp) internal pure {\n\n248: function _getRequiredPrefund(MemoryUserOp memory mUserOp) internal view returns (uint256 requiredPrefund) {\n\n261: function _createSenderIfNeeded(uint256 opIndex, UserOpInfo memory opInfo, bytes calldata initCode) internal {\n\n289 function _validateAccountPrepayment(uint256 opIndex, UserOperation calldata op, UserOpInfo memory opInfo, address aggregator, uint256 requiredPrefund)\n290: internal returns (uint256 gasUsedByValidateAccountPrepayment, address actualAggregator, uint256 deadline) {\n\n349: function _validatePaymasterPrepayment(uint256 opIndex, UserOperation calldata op, UserOpInfo memory opInfo, uint256 requiredPreFund, uint256 gasUsedByValidateAccountPrepayment) internal returns (bytes memory context, uint256 deadline) {\n\n496: function min(uint256 a, uint256 b) internal pure returns (uint256) {\n\n500: function getOffsetOfMemoryBytes(bytes memory data) internal pure returns (uint256 offset) {\n\n504: function getMemoryBytesFromOffset(uint256 offset) internal pure returns (bytes memory data) {\n", "fixed_code": "File: scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n\n181: function max(uint256 a, uint256 b) internal pure returns (uint256) {\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/IllIllI-G.md", "collected_at": "2026-01-02T18:13:06.662772+00:00", "source_hash": "818e17d7791b2d404101c346c1fbf4b662bae6660247d85c7815964be1a4d478", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol\n\n203: function _copyUserOpToMemory(UserOperation calldata userOp, MemoryUserOp memory mUserOp) internal pure {\n\n248: function _getRequiredPrefund(MemoryUserOp memory mUserOp) internal view returns (uint256 requiredPrefund) {\n\n261: function _createSenderIfNeeded(uint256 opIndex, UserOpInfo memory opInfo, bytes calldata initCode) internal {\n\n289 function _validateAccountPrepayment(uint256 opIndex, UserOperation calldata op, UserOpInfo memory opInfo, address aggregator, uint256 requiredPrefund)\n290: internal returns (uint256 gasUsedByValidateAccountPrepayment, address actualAggregator, uint256 deadline) {\n\n349: function _validatePaymasterPrepayment(uint256 opIndex, UserOperation calldata op, UserOpInfo memory opInfo, uint256 requiredPreFund, uint256 gasUsedByValidateAccountPrepayment) internal returns (bytes memory context, uint256 deadline) {\n\n496: function min(uint256 a, uint256 b) internal pure returns (uint256) {\n\n500: function getOffsetOfMemoryBytes(bytes memory data) internal pure returns (uint256 offset) {\n\n504: function getMemoryBytesFromOffset(uint256 offset) internal pure returns (bytes memory data) {\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n\n181: function max(uint256 a, uint256 b) internal pure returns (uint256) {\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "04-caviar", "title": "JCN G", "severity_raw": "High", "severity": "high", "description": "# Summary\nA majority of the optimizations were benchmarked via the protocol's tests, i.e. using the following config: `solc version 0.8.19`, `optimizer on`, and `200 runs`. Optimizations that were not benchmarked are explained via EVM gas costs and opcodes.\n\nBelow are the overall average gas savings for the following tested functions (with all the optimizations applied):\n| Function | Before | After | Avg Gas Savings |\n| ------ | -------- | -------- | ------- |\n| EthRouter.buy | 199750 | 190464 | 9286 | \n| EthRouter.change | 217295 | 202568 | 14727 | \n| EthRouter.deposit | 29900 | 29393 | 507 | \n| EthRouter.sell | 232102 | 223981 | 8121 | \n| Factory.create | 148801 | 148672 | 129 | \n| PrivatePool.buy | 70884 | 69821 | 1063 | \n| PrivatePool.change | 82138 | 78083 | 4055 | \n| PrivatePool.execute | 18890 | 18550 | 340 | \n| PrivatePool.flashLoan | 83063 | 82915 | 148 | \n| PrivatePool.sell | 81969 | 81284 | 685 | \n| PrivatePool.withdraw | 62023 | 61038 | 985 | \n\n**Total gas saved across all listed functions: 40046**\n\n*Notes*: \n\n- The [Gas report](#gasreport-output-with-all-optimizations-applied) output, after all optimizations have been applied, can be found at the end of the report.\n- The final diffs for each contract, with all the optimizations applied, can be found [here](https://gist.github.com/0xJCN/b03b5f1f8cabc937c8bbe4d4a46b8d47).\n- Some code snippets may be truncated to save space. Code snippets may also be accompanied by `@audit` tags in comments to aid in explaining the issue.\n\n## Gas Optimizations\n| Number |Issue|Instances|\n|-|:-|:-:| \n| [G-01](#cache-calldatamemory-pointers-for-complex-types-to-avoid-offset-calculations) | Cache calldata/memory pointers for complex types to avoid offset calculations | 52 | \n| [G-02](#use-calldata-instead-of-memory-for-function-arguments-that-do-not-get-mutated) | Use calldata instead of memory for function arguments that do not get mutated | 4 | \n| [G-03](#state-variable", "vulnerable_code": "File: src/EthRouter.sol\n106: for (uint256 i = 0; i < buys.length; i++) {\n107: if (buys[i].isPublicPool) {\n108: // execute the buy against a public pool\n109: uint256 inputAmount = Pair(buys[i].pool).nftBuy{value: buys[i].baseTokenAmount}(\n110: buys[i].tokenIds, buys[i].baseTokenAmount, 0\n111: );\n112:\n113: // pay the royalties if buyer has opted-in\n114: if (payRoyalties) {\n115: uint256 salePrice = inputAmount / buys[i].tokenIds.length;\n116: for (uint256 j = 0; j < buys[i].tokenIds.length; j++) {\n117: // get the royalty fee and recipient\n118: (uint256 royaltyFee, address royaltyRecipient) =\n119: getRoyalty(buys[i].nft, buys[i].tokenIds[j], salePrice);\n120:\n121: if (royaltyFee > 0) {\n122: // transfer the royalty fee to the royalty recipient\n123: royaltyRecipient.safeTransferETH(royaltyFee);\n124: }\n125: }\n126: }\n127: } else {\n128: // execute the buy against a private pool\n129: PrivatePool(buys[i].pool).buy{value: buys[i].baseTokenAmount}(\n130: buys[i].tokenIds, buys[i].tokenWeights, buys[i].proof\n131: );\n132: }\n133:\n134: for (uint256 j = 0; j < buys[i].tokenIds.length; j++) {\n135: // transfer the NFT to the caller\n136: ERC721(buys[i].nft).safeTransferFrom(address(this), msg.sender, buys[i].tokenIds[j]);\n137: }\n138: }", "fixed_code": "https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L159-L200\n\n### Cache calldata pointers for `sells[i]` and `sells[i].tokenIds`\n\n*Gas Savings for `EthRouter.sell`, obtained via protocol's tests: Avg 5422 gas*\n\n| | Med | Max | Avg | # calls |\n| ------ | -------- | -------- | ------- | -------- |\n| Before | 217300 | 402940 | 232102 | 7 |\n| After | 212264 | 392556 | 226680 | 7 |\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/JCN-G.md", "collected_at": "2026-01-02T18:19:43.003199+00:00", "source_hash": "81b5be42872e4837c77c91b9425ae34e9790d2375de1eefd6439936e83848673", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "EthRouter.sol#L159-L200", "github_files_list": "EthRouter.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: src/EthRouter.sol\n106: for (uint256 i = 0; i < buys.length; i++) {\n107: if (buys[i].isPublicPool) {\n108: // execute the buy against a public pool\n109: uint256 inputAmount = Pair(buys[i].pool).nftBuy{value: buys[i].baseTokenAmount}(\n110: buys[i].tokenIds, buys[i].baseTokenAmount, 0\n111: );\n112:\n113: // pay the royalties if buyer has opted-in\n114: if (payRoyalties) {\n115: uint256 salePrice = inputAmount / buys[i].tokenIds.length;\n116: for (uint256 j = 0; j < buys[i].tokenIds.length; j++) {\n117: // get the royalty fee and recipient\n118: (uint256 royaltyFee, address royaltyRecipient) =\n119: getRoyalty(buys[i].nft, buys[i].tokenIds[j], salePrice);\n120:\n121: if (royaltyFee > 0) {\n122: // transfer the royalty fee to the royalty recipient\n123: royaltyRecipient.safeTransferETH(royaltyFee);\n124: }\n125: }\n126: }\n127: } else {\n128: // execute the buy against a private pool\n129: PrivatePool(buys[i].pool).buy{value: buys[i].baseTokenAmount}(\n130: buys[i].tokenIds, buys[i].tokenWeights, buys[i].proof\n131: );\n132: }\n133:\n134: for (uint256 j = 0; j < buys[i].tokenIds.length; j++) {\n135: // transfer the NFT to the caller\n136: ERC721(buys[i].nft).safeTransferFrom(address(this), msg.sender, buys[i].tokenIds[j]);\n137: }\n138: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L159-L200\n\n### Cache calldata pointers for `sells[i]` and `sells[i].tokenIds`\n\n*Gas Savings for `EthRouter.sell`, obtained via protocol's tests: Avg 5422 gas*\n\n| | Med | Max | Avg | # calls |\n| ------ | -------- | -------- | ------- | -------- |\n| Before | 217300 | 402940 | 232102 | 7 |\n| After | 212264 | 392556 | 226680 | 7 |\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "02-ethos", "title": "SleepingBugs Q", "severity_raw": "Critical", "severity": "critical", "description": "\n\n# Low\n\n| | Issue index |\n| ----------- | ----------- |\n| 1 | [New `tvlCap` can be less than current value locked](#new-`tvlcap`-can-be-less-than-current-value-locked) |\n| 2 | [Use of `asserts()`](#use-of-`asserts()`) |\n| 3 | [Upgradeable contract is missing a `__gap[50]` storage variable to allow for new storage variables in later versions](#upgradeable-contract-is-missing-a-`__gap[50]`-storage-variable-to-allow-for-new-storage-variables-in-later-versions) |\n| 4 | [Missing important events emissions affects off-chain monitoring](#missing-important-events-emissions-affects-off-chain-monitoring) |\n| 5 | [Critical address change should use two-step procedure](#critical-address-change-should-use-two-step-procedure) |\n| 6 | [`updateCollateralRatios` is not safe without a two-step procedure](#`updatecollateralratios`-is-not-safe-without-a-two-step-procedure) |\n| 7 | [`_safeTransfer()` should be use rather than `_transfer`](#`_safetransfer()`-should-be-use-rather-than-`_transfer`) |\n| 8 | [`distributionPeriod` can be changed without anybody noticing and removing `rewardPerSecond` until changed back](#`distributionperiod`-can-be-changed-without-anybody-noticing-and-removing-`rewardpersecond`-until-changed-back) |\n| 9 | [`_approve` can be frontrunned](#`_approve`-can-be-frontrunned) |\n| 10 | [Wrong comment](#wrong-comment) |\n| 11 | [Collateral is not checked to already exist, this leads to unexpected behaviors](#collateral-is-not-checked-to-already-exist,-this-leads-to-unexpected-behaviors) |\n| 12 | [Missing `emit` keyword](#missing-`emit`-keyword) |\n| 13 | [Single-step process for critical ownership transfer/renounce is risky](#single-step-process-for-critical-ownership-transfer/renounce-is-risky) |\n## New `tvlCap` can be less than current value locked\n\nAdd a check to ensure new `tvlCap ` is not less than current value locked.\n\n- [ReaperVaultV2.sol#L580](https://github.com/code-423n4/2023-02-ethos/blob/34ba1e7dd2d259f06f9d5fa13f5d96be7829ff34/Ethos-Vault/contracts/ReaperV", "vulnerable_code": " UUPSUpgradeable,\n AccessControlEnumerableUpgradeable", "fixed_code": " function fund(uint amount) external onlyOwner {\n require(amount != 0, \"cannot fund 0\");\n OathToken.transferFrom(msg.sender, address(this), amount);\n // roll any unissued OATH into new distribution\n if (lastIssuanceTimestamp < lastDistributionTime) {\n uint timeLeft = lastDistributionTime.sub(lastIssuanceTimestamp);\n uint notIssued = timeLeft.mul(rewardPerSecond);\n amount = amount.add(notIssued);\n }\n\n rewardPerSecond = amount.div(distributionPeriod); //@audit div by high value\n lastDistributionTime = block.timestamp.add(distributionPeriod);\n lastIssuanceTimestamp = block.timestamp;\n\n emit LogRewardPerSecond(rewardPerSecond);\n }\n\n // Owner-only function to update the distribution period\n function updateDistributionPeriod(uint256 _newDistributionPeriod) external onlyOwner {\n distributionPeriod = _newDistributionPeriod;\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/SleepingBugs-Q.md", "collected_at": "2026-01-02T18:16:39.182796+00:00", "source_hash": "81eda70199e104311f416204305952e26cd5b1943971afce2f783ee3341fdf59", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " UUPSUpgradeable,\n AccessControlEnumerableUpgradeable", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function fund(uint amount) external onlyOwner {\n require(amount != 0, \"cannot fund 0\");\n OathToken.transferFrom(msg.sender, address(this), amount);\n // roll any unissued OATH into new distribution\n if (lastIssuanceTimestamp < lastDistributionTime) {\n uint timeLeft = lastDistributionTime.sub(lastIssuanceTimestamp);\n uint notIssued = timeLeft.mul(rewardPerSecond);\n amount = amount.add(notIssued);\n }\n\n rewardPerSecond = amount.div(distributionPeriod); //@audit div by high value\n lastDistributionTime = block.timestamp.add(distributionPeriod);\n lastIssuanceTimestamp = block.timestamp;\n\n emit LogRewardPerSecond(rewardPerSecond);\n }\n\n // Owner-only function to update the distribution period\n function updateDistributionPeriod(uint256 _newDistributionPeriod) external onlyOwner {\n distributionPeriod = _newDistributionPeriod;\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-salty", "title": "7ashraf G", "severity_raw": "High", "severity": "high", "description": "# Gas Efficiency Report\n\n## Summary:\n\nThe gas report highlights potential optimizations to reduce gas consumption in the codebase. Instances in [Proposals.sol #90, #324, #326, #329] involve on-chain computations for known results, suggesting gas savings by avoiding unnecessary calculations. Furthermore, [Dao.sol #121] indicates a redundant second `if` check that can be removed for more efficient gas usage. Additionally, [Dao.sol #345] and [StakingRewards.sol #253] suggest areas where using `unchecked` could enhance gas efficiency while maintaining safety. These optimizations aim to mitigate gas costs during contract execution.\n\n### Summary Table:\n\n| Number | Title | Number of Instances |\n|--------|-------------------------------------------------|---------------------|\n| [G-01] | Avoid on-chain computation for known results | 6 |\n| [G-02] | Eliminate redundant second `if` check | 1 |\n| [G-03] | Use `unchecked` for safe gas optimization | 2 |\n\n## [G-01] Avoid on-chain computation if the result is known \n### Instances\n* [Proposals.sol #90](https://github.com/code-423n4/2024-01-salty/blob/main/src/dao/Proposals.sol#L90)\n```solidity\n\t\t\tuint256 requiredXSalt = ( totalStaked * daoConfig.requiredProposalPercentStakeTimes1000() ) / ( 100 * 1000 );\n\n```\n* [Proposals.sol #324](https://github.com/code-423n4/2024-01-salty/blob/main/src/dao/Proposals.sol#L324)\n```solidity\n\t\t\trequiredQuorum = ( 1 * totalStaked * daoConfig.baseBallotQuorumPercentTimes1000()) / ( 100 * 1000 );\n\n```\n* [Proposals.sol #326](https://github.com/code-423n4/2024-01-salty/blob/main/src/dao/Proposals.sol#L326)\n```solidity\n\t\t\trequiredQuorum = ( 2 * totalStaked * daoConfig.baseBallotQuorumPercentTimes1000()) / ( 100 * 1000 );\n\n```\n* [Proposals.sol #329](https://github.com/code-423n4/2024-01-salty/blob/main/src/dao/Proposals.sol#L329)\n```solidity\n\t\t\trequiredQuorum = ( 3 * totalStak", "vulnerable_code": "\t\t\tuint256 requiredXSalt = ( totalStaked * daoConfig.requiredProposalPercentStakeTimes1000() ) / ( 100 * 1000 );\n", "fixed_code": "\t\t\trequiredQuorum = ( 1 * totalStaked * daoConfig.baseBallotQuorumPercentTimes1000()) / ( 100 * 1000 );\n", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/7ashraf-G.md", "collected_at": "2026-01-02T19:01:11.315351+00:00", "source_hash": "8242ea1b26a1c197d5e725d4d67d01df629990e89fe8d47ff10a9b079d70add8", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 309, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "uint256 requiredXSalt = ( totalStaked * daoConfig.requiredProposalPercentStakeTimes1000() ) / ( 100 * 1000 );", "primary_code_language": "solidity", "primary_code_char_count": 109, "all_code_blocks": "// Code block 1 (solidity):\nuint256 requiredXSalt = ( totalStaked * daoConfig.requiredProposalPercentStakeTimes1000() ) / ( 100 * 1000 );\n\n// Code block 2 (solidity):\nrequiredQuorum = ( 1 * totalStaked * daoConfig.baseBallotQuorumPercentTimes1000()) / ( 100 * 1000 );\n\n// Code block 3 (solidity):\nrequiredQuorum = ( 2 * totalStaked * daoConfig.baseBallotQuorumPercentTimes1000()) / ( 100 * 1000 );", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "uint256 requiredXSalt = ( totalStaked * daoConfig.requiredProposalPercentStakeTimes1000() ) / ( 100 * 1000 );\n\nrequiredQuorum = ( 1 * totalStaked * daoConfig.baseBallotQuorumPercentTimes1000()) / ( 100 * 1000 );\n\nrequiredQuorum = ( 2 * totalStaked * daoConfig.baseBallotQuorumPercentTimes1000()) / ( 100 * 1000 );", "github_refs_formatted": "Proposals.sol#L90, Proposals.sol#L324, Proposals.sol#L326, Proposals.sol#L329", "github_files_list": "Proposals.sol", "github_refs_count": 4, "vulnerable_code_actual": "\t\t\tuint256 requiredXSalt = ( totalStaked * daoConfig.requiredProposalPercentStakeTimes1000() ) / ( 100 * 1000 );\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "\t\t\trequiredQuorum = ( 1 * totalStaked * daoConfig.baseBallotQuorumPercentTimes1000()) / ( 100 * 1000 );\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "01-ondo", "title": "Breeje Q", "severity_raw": "Low", "severity": "low", "description": "## QA Report\n\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [L-1](#L-1) | NO ZERO ADDRESS CHECK IN CONSTRUCTOR FOR KEY ADDRESSES | 3 |\n| [L-2](#L-2) | USE OF FLOATING PRAGMA | 26 |\n| [L-3](#L-3) | USERS CAN'T CLAIM MINT AFTER DEPOSIT AND DEPEND ON `SETTER_ADMIN` TO SET THE EXCHANGE RATE FIRST | 1 |\n| [L-4](#L-4) | MISSING CONTRACT-EXISTENCE CHECKS BEFORE LOW-LEVEL CALLS | 1 |\n| [NC-1](#NC-1) | USE REQUIRE INSTEAD OF ASSERT | 3 |\n| [NC-2](#NC-2) | STOP USING `V == 27 or V == 28` | 1 |\n| [NC-3](#NC-3) | RECOMMENDED TO USE OWNABLE2STEP RATHER THAN OWNABLE | 1 |\n\n### [L-1] NO ZERO ADDRESS CHECK IN CONSTRUCTOR FOR KEY ADDRESSES\n\nIn `CashManager.sol`, constructor is used to initialize different state variable and grant roles. But there is no Zero Address check on important variables like `managerAdmin` and `pauser`. \n\nIt can result in serious consequences given they have been granted Important roles in the constructor.\n\n*Instances:*\n```solidity \nFile: cash/factory/CashFactory.sol\n\n130: address managerAdmin,\n131: address pauser,\n\n```\n[Link to Code](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/factory/CashFactory.sol#L130-L131)\n\n```solidity \nFile: lending/JumpRateModelV2.sol\n\n66: owner = owner_;\n\n```\n[Link to Code](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/JumpRateModelV2.sol#L66)\n\n### [L-2] USE OF FLOATING PRAGMA\n\n*Instances: (26)*\n* [JumpRateModelV2.sol](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/JumpRateModelV2.sol#L1)\n* [IOndo.sol](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/ondo/ondo-token/IOndo.sol#L2)\n* [LinearTimelock.sol](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/ondo/ondo-token/LinearTimelock.sol#L2)\n* [CCash.sol](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cCash/CCash.sol#L2)\n* [CCashDelegate.sol](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cCash/CCashDele", "vulnerable_code": "File: cash/factory/CashFactory.sol\n\n130: address managerAdmin,\n131: address pauser,\n", "fixed_code": "File: lending/JumpRateModelV2.sol\n\n66: owner = owner_;\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/Breeje-Q.md", "collected_at": "2026-01-02T18:14:33.319511+00:00", "source_hash": "8255a398c66d2f2c75ddc8f87f65834b3b291518fe35788d130de0915cbd3fb7", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 112, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "[Link to Code](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/factory/CashFactory.sol#L130-L131)", "primary_code_language": "unknown", "primary_code_char_count": 112, "all_code_blocks": "// Code block 1 (unknown):\n[Link to Code](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/factory/CashFactory.sol#L130-L131)", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CashFactory.sol#L130-L131, JumpRateModelV2.sol#L66, JumpRateModelV2.sol#L1, IOndo.sol#L2, LinearTimelock.sol#L2, CCash.sol#L2", "github_files_list": "IOndo.sol, LinearTimelock.sol, CashFactory.sol, JumpRateModelV2.sol, CCash.sol", "github_refs_count": 6, "vulnerable_code_actual": "File: cash/factory/CashFactory.sol\n\n130: address managerAdmin,\n131: address pauser,\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: lending/JumpRateModelV2.sol\n\n66: owner = owner_;\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-asymmetry", "title": "TheSavageTeddy G", "severity_raw": "Low", "severity": "low", "description": "# Use `unchecked{}` for subtraction operations where operands cannot underflow because of a previous `require` statement\nUsing `unchecked{}` for operations that cannot underflow because of a previous `require` statement saves gas as it ignores the overflow/underflow checks.\n\n*There is 1 instance of this issue:*\n```solidity\nFile: Reth.sol\n200: require(rethBalance2 > rethBalance1, \"No rETH was minted\");\n201: uint256 rethMinted = rethBalance2 - rethBalance1; // @audit use unchecked{} cannot overflow because of previous require\n```\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L200-L201", "vulnerable_code": "File: Reth.sol\n200: require(rethBalance2 > rethBalance1, \"No rETH was minted\");\n201: uint256 rethMinted = rethBalance2 - rethBalance1; // @audit use unchecked{} cannot overflow because of previous require", "fixed_code": "", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/TheSavageTeddy-G.md", "collected_at": "2026-01-02T18:18:36.921890+00:00", "source_hash": "825fcd26e1e58b3c41d6c007737da20e8421be7700fc0bc8d72bc6d33ef57491", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 228, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "File: Reth.sol\n200: require(rethBalance2 > rethBalance1, \"No rETH was minted\");\n201: uint256 rethMinted = rethBalance2 - rethBalance1; // @audit use unchecked{} cannot overflow because of previous require", "primary_code_language": "solidity", "primary_code_char_count": 228, "all_code_blocks": "// Code block 1 (solidity):\nFile: Reth.sol\n200: require(rethBalance2 > rethBalance1, \"No rETH was minted\");\n201: uint256 rethMinted = rethBalance2 - rethBalance1; // @audit use unchecked{} cannot overflow because of previous require", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: Reth.sol\n200: require(rethBalance2 > rethBalance1, \"No rETH was minted\");\n201: uint256 rethMinted = rethBalance2 - rethBalance1; // @audit use unchecked{} cannot overflow because of previous require", "github_refs_formatted": "Reth.sol#L200-L201", "github_files_list": "Reth.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: Reth.sol\n200: require(rethBalance2 > rethBalance1, \"No rETH was minted\");\n201: uint256 rethMinted = rethBalance2 - rethBalance1; // @audit use unchecked{} cannot overflow because of previous require", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.33} {"source": "c4", "protocol": "07-amphora", "title": "dharma09 G", "severity_raw": "Medium", "severity": "medium", "description": "# GAS OPTIMIZATIONS\n\nAll the gas optimizations are determined based on opcodes and sample tests.\n\n| Count | Issues | Instances | Gas Saved |\n| --- | --- | --- | --- |\n| [[G-1]](#) | Use of\u00a0memory\u00a0instead of\u00a0storage\u00a0for struct/array state variables | 3 | 6300 |\n| [[G-2]](#) | Emitting storage values instead of the memory one | 11 | 1100 |\n| [[G-3]](#) | Use nested if and, avoid multiple check combinations | 3 | 45 |\n| [[G-4]](#) | Multiple accesses of a mapping/array should use a local variable cache | 1 | 100 |\n| [[G-5]](#) | Redundant External Self Calls | 3 | 300 |\n| [[G-6]](#) | Use calldata instead of memory for function arguments that do not get mutated | 6 | 2100 |\n| [[G-7]](#) | Pre-increments and pre-decrements are cheaper than post-increments and post-decrements |1 | 6 |\n| [[G-8]](#) | Cache state variables with stack variables | 2 | 400 |\n\n`Total Gas saves 10351`\n\n### [G-01] Use of\u00a0`memory`\u00a0instead of\u00a0`storage`\u00a0for struct/array state variables\n\nWhen fetching data from\u00a0`storage`, using the\u00a0`memory`\u00a0keyword to assign it to a variable reads all fields of the struct/array and incurs a Gcoldsload (**2100 gas**) for each field.\n\nThis can be avoided by declaring the variable with the\u00a0`storage`\u00a0keyword and caching the necessary fields in stack variables.\n\nThe\u00a0`memory`\u00a0keyword should only be used if the entire struct/array is being returned or passed to a function that requires\u00a0`memory`, or if it is being read from another\u00a0`memory`\u00a0array/struct.\n\n`Gas save 6300`\n\n- https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/Vault.sol#L170\n\n```solidity\nFile: [/contracts/core/Vault.sol](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/Vault.sol#L170) \n\n170: IVaultController.CollateralInfo memory _collateralInfo = CONTROLLER.tokenCollateralInfo(_tokenAddresses[_i]);\n```\n\n- https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/governance/GovernorCharlie.sol#L452\n\n```solidity\nFile: ", "vulnerable_code": "File: [/contracts/core/Vault.sol](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/Vault.sol#L170) \n\n170: IVaultController.CollateralInfo memory _collateralInfo = CONTROLLER.tokenCollateralInfo(_tokenAddresses[_i]);", "fixed_code": "File: [/contracts/governance/GovernorCharlie.sol](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/governance/GovernorCharlie.sol#L452)\n\n449: function getReceipt(\n450: uint256 _proposalId,\n451: address _voter\n452: ) external view override returns (Receipt memory _votingReceipt) { //@audit\n453: _votingReceipt = proposalReceipts[_proposalId][_voter];\n454: }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/dharma09-G.md", "collected_at": "2026-01-02T18:23:43.467729+00:00", "source_hash": "827c6ebd846959d3b495664dc2f62b19d7042d9dca255152f7f8f64d9b85fc15", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 251, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: [/contracts/core/Vault.sol](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/Vault.sol#L170) \n\n170: IVaultController.CollateralInfo memory _collateralInfo = CONTROLLER.tokenCollateralInfo(_tokenAddresses[_i]);", "primary_code_language": "solidity", "primary_code_char_count": 251, "all_code_blocks": "// Code block 1 (solidity):\nFile: [/contracts/core/Vault.sol](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/Vault.sol#L170) \n\n170: IVaultController.CollateralInfo memory _collateralInfo = CONTROLLER.tokenCollateralInfo(_tokenAddresses[_i]);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: [/contracts/core/Vault.sol](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/Vault.sol#L170) \n\n170: IVaultController.CollateralInfo memory _collateralInfo = CONTROLLER.tokenCollateralInfo(_tokenAddresses[_i]);", "github_refs_formatted": "Vault.sol#L170, GovernorCharlie.sol#L452", "github_files_list": "GovernorCharlie.sol, Vault.sol", "github_refs_count": 2, "vulnerable_code_actual": "File: [/contracts/core/Vault.sol](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/Vault.sol#L170) \n\n170: IVaultController.CollateralInfo memory _collateralInfo = CONTROLLER.tokenCollateralInfo(_tokenAddresses[_i]);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: [/contracts/governance/GovernorCharlie.sol](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/governance/GovernorCharlie.sol#L452)\n\n449: function getReceipt(\n450: uint256 _proposalId,\n451: address _voter\n452: ) external view override returns (Receipt memory _votingReceipt) { //@audit\n453: _votingReceipt = proposalReceipts[_proposalId][_voter];\n454: }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "09-ondo", "title": "SAQ G", "severity_raw": "Medium", "severity": "medium", "description": "## Summary\n\n### Gas Optimization\n\nno | Issue |Instances||\n|-|:-|:-:|:-:|\n| [G-01] | Avoid contract existence checks by using low level calls | 2 | - |\n| [G-02] | Pre-increments and pre-decrements are cheaper than post-increments and post-decrements | 1 | - |\n| [G-03] | Using fixed bytes is cheaper than using string | 2 | - |\n| [G-04] | Expressions for constant values such as a call to keccak256(), should use immutable rather than constant | 7 | - |\n| [G-05] | Not using the named return variable when a function returns, wastes deployment gas | 2 | - |\n| [G-06] | Should use arguments instead of state variable | 4 | - |\n| [G-07] | Before transfer of some functions, we should check some variables for possible gas save | 2 | - |\n| [G-08] | With assembly, .call (bool success) transfer can be done gas-optimized | 2 | - |\n| [G-09] | Duplicated require()/if() checks should be refactored to a modifier or function | 1 | - |\n| [G-10] | A modifier used only once and not being inherited should be inlined to save gas | 1 | - |\n| [G-11] | abi.encode() is less efficient than abi.encodepacked() | 3 | - |\n| [G-12] | Do not calculate constant | 1 | - |\n| [G-13] | require() Should Be Used Instead Of assert() | 1 | - |\n| [G-14] | Use hardcode address instead address(this) | 3 | - |\n| [G-15] | Use assembly for math (add, sub, mul, div) | 3 | - |\n| [G-16] | Multiplication/division by two should use bit shifting | 1 | - |\n| [G-17] | Refactor event to avoid emitting empty data | 1 | - |\n| [G-18] | 2** should be re-written as type(uint).max | 1 | - |\n| [G-19] | Shorten the array rather than copying to a new one | 1 | - |\n| [G-20] | Use assembly to validate msg.sender | 6 | - |\n| [G-21] | No need to evaluate all expressions to know if one of them is true | 1 | - |\n| [G-22] | Make 3 event parameters indexed when possible | 3 | - |\n\n## Gas Optimizations \n\n## [G-01] Avoid contract existence checks by using low level calls\t\t\n\nPrior to 0.8.10 the compiler inserted extra code, including E", "vulnerable_code": "file: /contracts/bridge/SourceBridge.sol\n\n125 destChainToContractAddr[destinationChain] = AddressToString.toString(\n126 contractAddress\n127 );\n", "fixed_code": "file: /contracts/bridge/DestinationBridge.sol\n\n323 uint256 balance = IRWALike(_token).balanceOf(address(this));\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/SAQ-G.md", "collected_at": "2026-01-02T18:25:39.450061+00:00", "source_hash": "8318e29e57e20b0fd364173358c3726ecbf24f7598e98155e8ca2d5e3e9b948e", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "file: /contracts/bridge/SourceBridge.sol\n\n125 destChainToContractAddr[destinationChain] = AddressToString.toString(\n126 contractAddress\n127 );\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "file: /contracts/bridge/DestinationBridge.sol\n\n323 uint256 balance = IRWALike(_token).balanceOf(address(this));\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "10-badger", "title": "ether_sky Q", "severity_raw": "Low", "severity": "low", "description": "I believe this is an incorrect check for `partial debt size`. \nPartial `liquidation` or `redemption` should reserve `collateral` of at least 2 `stEth`. \nWe have below check for this.\n```\nfunction _requirePartialLiqCollSize(uint256 _entireColl) internal pure {\n require(\n _entireColl >= MIN_NET_STETH_BALANCE,\n \"LiquidationLibrary: Coll remaining in partially liquidated CDP must be >= minimum\"\n );\n}\n```\nHowever, this check adds another `limitation` to the `debt size`.\nhttps://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/LiquidationLibrary.sol#L896-L906\n```\nrequire(\n (_partialDebt + _convertDebtDenominationToBtc(MIN_NET_STETH_BALANCE, _price)) <=\n _entireDebt,\n \"LiquidationLibrary: Partial debt liquidated must be less than total debt\"\n);\n```", "vulnerable_code": "function _requirePartialLiqCollSize(uint256 _entireColl) internal pure {\n require(\n _entireColl >= MIN_NET_STETH_BALANCE,\n \"LiquidationLibrary: Coll remaining in partially liquidated CDP must be >= minimum\"\n );\n}", "fixed_code": "require(\n (_partialDebt + _convertDebtDenominationToBtc(MIN_NET_STETH_BALANCE, _price)) <=\n _entireDebt,\n \"LiquidationLibrary: Partial debt liquidated must be less than total debt\"\n);", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/ether_sky-Q.md", "collected_at": "2026-01-02T18:26:47.851710+00:00", "source_hash": "832254f384ce2bf2b140f5c7e85a9f48a3646b7787714fd6950c0d07c99e6003", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 433, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _requirePartialLiqCollSize(uint256 _entireColl) internal pure {\n require(\n _entireColl >= MIN_NET_STETH_BALANCE,\n \"LiquidationLibrary: Coll remaining in partially liquidated CDP must be >= minimum\"\n );\n}", "primary_code_language": "unknown", "primary_code_char_count": 232, "all_code_blocks": "// Code block 1 (unknown):\nfunction _requirePartialLiqCollSize(uint256 _entireColl) internal pure {\n require(\n _entireColl >= MIN_NET_STETH_BALANCE,\n \"LiquidationLibrary: Coll remaining in partially liquidated CDP must be >= minimum\"\n );\n}\n\n// Code block 2 (unknown):\nrequire(\n (_partialDebt + _convertDebtDenominationToBtc(MIN_NET_STETH_BALANCE, _price)) <=\n _entireDebt,\n \"LiquidationLibrary: Partial debt liquidated must be less than total debt\"\n);", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LiquidationLibrary.sol#L896-L906", "github_files_list": "LiquidationLibrary.sol", "github_refs_count": 1, "vulnerable_code_actual": "function _requirePartialLiqCollSize(uint256 _entireColl) internal pure {\n require(\n _entireColl >= MIN_NET_STETH_BALANCE,\n \"LiquidationLibrary: Coll remaining in partially liquidated CDP must be >= minimum\"\n );\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "require(\n (_partialDebt + _convertDebtDenominationToBtc(MIN_NET_STETH_BALANCE, _price)) <=\n _entireDebt,\n \"LiquidationLibrary: Partial debt liquidated must be less than total debt\"\n);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6.7} {"source": "c4", "protocol": "11-kelp", "title": "hihen Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA Report\n\n## Summary\n\n### Low Issues\n\nTotal **23 instances** over **4 issues**:\n\n|ID|Issue|Instances|\n|:--:|:---|:--:|\n| [[L-01]](#l-01-owner-can-renounce-while-system-is-paused) | Owner can renounce while system is paused | 4 |\n| [[L-02]](#l-02-revert-on-transfer-to-the-zero-address) | Revert on transfer to the zero address | 2 |\n| [[L-03]](#l-03-critical-functions-should-be-controlled-by-time-locks) | Critical functions should be controlled by time locks | 14 |\n| [[L-04]](#l-04-contracts-are-vulnerable-to-rebasing-accounting-related-issues) | Contracts are vulnerable to rebasing accounting-related issues | 3 |\n\n### Non Critical Issues\n\nTotal **40 instances** over **8 issues**:\n\n|ID|Issue|Instances|\n|:--:|:---|:--:|\n| [[N-01]](#n-01-redundant-inheritance-specifier) | Redundant inheritance specifier | 1 |\n| [[N-02]](#n-02-events-should-be-emitted-before-external-calls) | Events should be emitted before external calls | 1 |\n| [[N-03]](#n-03-openzeppelincontracts-should-be-upgraded-to-a-newer-version) | @openzeppelin/contracts should be upgraded to a newer version | 11 |\n| [[N-04]](#n-04-expressions-for-constant-values-should-use-immutable-rather-than-constant) | Expressions for constant values should use `immutable` rather than `constant` | 9 |\n| [[N-05]](#n-05-unnecessary-casting) | Unnecessary casting | 2 |\n| [[N-06]](#n-06-using-underscore-at-the-end-of-variable-name) | Using underscore at the end of variable name | 5 |\n| [[N-07]](#n-07-multiple-mappings-with-same-keys-can-be-combined-into-a-single-struct-mapping-for-readability) | Multiple mappings with same keys can be combined into a single struct mapping for readability | 5 |\n| [[N-08]](#n-08-inconsistent-spacing-in-comments) | Inconsistent spacing in comments | 6 |\n\n## Low Issues\n\n### [L-01] Owner can renounce while system is paused\n\nThe contract owner or single user with a role is not prevented from renouncing the role/ownership while the contract is paused, which would cause any user assets stored in the", "vulnerable_code": "208: function pause() external onlyLRTManager {\n209: _pause();\n210: }", "fixed_code": "102: function pause() external onlyLRTManager {\n103: _pause();\n104: }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/hihen-Q.md", "collected_at": "2026-01-02T18:28:06.373019+00:00", "source_hash": "834785d8137ee8512fe3a37ceb1724f8d925f0e44efad278d01bde2775d81950", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "208: function pause() external onlyLRTManager {\n209: _pause();\n210: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "102: function pause() external onlyLRTManager {\n103: _pause();\n104: }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "06-lybra", "title": "devival Q", "severity_raw": "Low", "severity": "low", "description": "## Title QA\nEUSD shares can be transferred to EUSD contract itself\n\n## Links to affected code:\nProvide GitHub links, including line numbers, to all instances of this bug throughout the repo.\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/token/EUSD.sol#L334-L341\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/token/EUSD.sol#L391-L400\n\n## Proof of Concept\nProvide direct links to all referenced code in GitHub. Add screenshots, logs, or any other relevant proof that illustrates the concept.\n\nThere is a lack of any check in `transferShares` and `_transferShares` for the recipient to not be `address(this)` meaning the `EUSD` contract itself.\n\n`transferShares` and `_transferShares` functions in `EUSD.sol`\n```\n function transferShares(address _recipient, uint256 _sharesAmount) public returns (uint256) {\n address owner = _msgSender();\n _transferShares(owner, _recipient, _sharesAmount);\n emit TransferShares(owner, _recipient, _sharesAmount);\n uint256 tokensAmount = getMintedEUSDByShares(_sharesAmount);\n emit Transfer(owner, _recipient, tokensAmount);\n return tokensAmount;\n }\n //...\n function _transferShares(address _sender, address _recipient, uint256 _sharesAmount) internal {\n require(_sender != address(0), \"TRANSFER_FROM_THE_ZERO_ADDRESS\");\n require(_recipient != address(0), \"TRANSFER_TO_THE_ZERO_ADDRESS\");\n\n uint256 currentSenderShares = shares[_sender];\n require(_sharesAmount <= currentSenderShares, \"TRANSFER_AMOUNT_EXCEEDS_BALANCE\");\n\n shares[_sender] = currentSenderShares.sub(_sharesAmount);\n shares[_recipient] = shares[_recipient].add(_sharesAmount);\n }\n```\n[EUSD.sol#L334-L341](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/token/EUSD.sol#L334-L341)\n[EUSD.sol#L391-L400](https://github.com/code-423", "vulnerable_code": " function transferShares(address _recipient, uint256 _sharesAmount) public returns (uint256) {\n address owner = _msgSender();\n _transferShares(owner, _recipient, _sharesAmount);\n emit TransferShares(owner, _recipient, _sharesAmount);\n uint256 tokensAmount = getMintedEUSDByShares(_sharesAmount);\n emit Transfer(owner, _recipient, tokensAmount);\n return tokensAmount;\n }\n //...\n function _transferShares(address _sender, address _recipient, uint256 _sharesAmount) internal {\n require(_sender != address(0), \"TRANSFER_FROM_THE_ZERO_ADDRESS\");\n require(_recipient != address(0), \"TRANSFER_TO_THE_ZERO_ADDRESS\");\n\n uint256 currentSenderShares = shares[_sender];\n require(_sharesAmount <= currentSenderShares, \"TRANSFER_AMOUNT_EXCEEDS_BALANCE\");\n\n shares[_sender] = currentSenderShares.sub(_sharesAmount);\n shares[_recipient] = shares[_recipient].add(_sharesAmount);\n }", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/devival-Q.md", "collected_at": "2026-01-02T18:22:55.229158+00:00", "source_hash": "836851a5017d66b98725fccb8b6cff5b59845d13668a2f775fa686e5d7b3087a", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 959, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function transferShares(address _recipient, uint256 _sharesAmount) public returns (uint256) {\n address owner = _msgSender();\n _transferShares(owner, _recipient, _sharesAmount);\n emit TransferShares(owner, _recipient, _sharesAmount);\n uint256 tokensAmount = getMintedEUSDByShares(_sharesAmount);\n emit Transfer(owner, _recipient, tokensAmount);\n return tokensAmount;\n }\n //...\n function _transferShares(address _sender, address _recipient, uint256 _sharesAmount) internal {\n require(_sender != address(0), \"TRANSFER_FROM_THE_ZERO_ADDRESS\");\n require(_recipient != address(0), \"TRANSFER_TO_THE_ZERO_ADDRESS\");\n\n uint256 currentSenderShares = shares[_sender];\n require(_sharesAmount <= currentSenderShares, \"TRANSFER_AMOUNT_EXCEEDS_BALANCE\");\n\n shares[_sender] = currentSenderShares.sub(_sharesAmount);\n shares[_recipient] = shares[_recipient].add(_sharesAmount);\n }", "primary_code_language": "unknown", "primary_code_char_count": 959, "all_code_blocks": "// Code block 1 (unknown):\nfunction transferShares(address _recipient, uint256 _sharesAmount) public returns (uint256) {\n address owner = _msgSender();\n _transferShares(owner, _recipient, _sharesAmount);\n emit TransferShares(owner, _recipient, _sharesAmount);\n uint256 tokensAmount = getMintedEUSDByShares(_sharesAmount);\n emit Transfer(owner, _recipient, tokensAmount);\n return tokensAmount;\n }\n //...\n function _transferShares(address _sender, address _recipient, uint256 _sharesAmount) internal {\n require(_sender != address(0), \"TRANSFER_FROM_THE_ZERO_ADDRESS\");\n require(_recipient != address(0), \"TRANSFER_TO_THE_ZERO_ADDRESS\");\n\n uint256 currentSenderShares = shares[_sender];\n require(_sharesAmount <= currentSenderShares, \"TRANSFER_AMOUNT_EXCEEDS_BALANCE\");\n\n shares[_sender] = currentSenderShares.sub(_sharesAmount);\n shares[_recipient] = shares[_recipient].add(_sharesAmount);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "EUSD.sol#L334-L341, EUSD.sol#L391-L400", "github_files_list": "EUSD.sol", "github_refs_count": 2, "vulnerable_code_actual": " function transferShares(address _recipient, uint256 _sharesAmount) public returns (uint256) {\n address owner = _msgSender();\n _transferShares(owner, _recipient, _sharesAmount);\n emit TransferShares(owner, _recipient, _sharesAmount);\n uint256 tokensAmount = getMintedEUSDByShares(_sharesAmount);\n emit Transfer(owner, _recipient, tokensAmount);\n return tokensAmount;\n }\n //...\n function _transferShares(address _sender, address _recipient, uint256 _sharesAmount) internal {\n require(_sender != address(0), \"TRANSFER_FROM_THE_ZERO_ADDRESS\");\n require(_recipient != address(0), \"TRANSFER_TO_THE_ZERO_ADDRESS\");\n\n uint256 currentSenderShares = shares[_sender];\n require(_sharesAmount <= currentSenderShares, \"TRANSFER_AMOUNT_EXCEEDS_BALANCE\");\n\n shares[_sender] = currentSenderShares.sub(_sharesAmount);\n shares[_recipient] = shares[_recipient].add(_sharesAmount);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "03-asymmetry", "title": "arialblack14 G", "severity_raw": "High", "severity": "high", "description": "# GAS OPTIMIZATION REPORT\n---\n### Summary of optimizations\n| Number | Issue details | Instances |\n|---|---|:---:|\n| [G-1](#G1) |Usage of `uint`s/`int`s smaller than 32 bytes (256 bits) incurs overhead. | 1\n| [G-2](#G2) |Multiple accesses of a mapping/array should use a local variable cache. | 7\n| [G-3](#G3) |`>=` costs less gas than `>`. | 2\n| [G-4](#G4) |` += ` costs more gas than ` = + ` for state variables | 4\n| [G-5](#G5) |Using fixed bytes is cheaper than using `string`. | 5\n\n*Total: 5 issues.*\n\n---\n### Gas Optimizations\n### [G-1] Usage of `uint`s/`int`s smaller than 32 bytes (256 bits) incurs overhead.\n\n##### Description\nWhen using elements that are smaller than 32 bytes, your contract\u2019s gas usage may be higher. This is because the EVM operates on 32 bytes at a time. Therefore, if the element is smaller than that, the EVM must use more operations in order to reduce the size of the element from 32 bytes to the desired size.\n\n##### Recommendation\nUse `uint256` instead.\n\n##### *Instances (1):*\nFile: [2023-03-asymmetry/contracts/SafEth/derivatives/Reth.sol](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L86 )\n```solidity\n86: uint24 _poolFee,\n```\n### [G-2] Multiple accesses of a mapping/array should use a local variable cache.\n\n##### Description\nThe instances below point to the second+ access of a value inside a mapping/array, within a function. Caching a mapping's value in a local storage or calldata variable when the value is accessed multiple times, saves ~42 gas per access due to not having to recalculate the key's keccak256 hash (Gkeccak256 - 30 gas) and that calculation's associated stack operations. Caching an array's struct avoids recalculating the array offsets into memory/calldata. [Similar findings](https://github.com/code-423n4/2022-06-infinity-findings/issues/186)\n\n##### Recommendation\nUse a local variable cache.\n\n##### *Instances (7):*\nFile: [2023-03-asymmetr", "vulnerable_code": "86: uint24 _poolFee,", "fixed_code": "73: (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n74: derivatives[i].balance()) /\n115: uint256 derivativeAmount = (derivatives[i].balance() *\n118: derivatives[i].withdraw(derivativeAmount);\n141: if (derivatives[i].balance() > 0)\n142: derivatives[i].withdraw(derivatives[i].balance());\n152: derivatives[i].deposit{value: ethAmount}();", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/arialblack14-G.md", "collected_at": "2026-01-02T18:18:48.140662+00:00", "source_hash": "839e15a30bc5514c320906ee22d0ab11b2f90567a5d02c338db74686651d9cac", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 20, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "86: uint24 _poolFee,", "primary_code_language": "solidity", "primary_code_char_count": 20, "all_code_blocks": "// Code block 1 (solidity):\n86: uint24 _poolFee,", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "86: uint24 _poolFee,", "github_refs_formatted": "Reth.sol#L86", "github_files_list": "Reth.sol", "github_refs_count": 1, "vulnerable_code_actual": "86: uint24 _poolFee,", "has_vulnerable_code_snippet": true, "fixed_code_actual": "73: (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n74: derivatives[i].balance()) /\n115: uint256 derivativeAmount = (derivatives[i].balance() *\n118: derivatives[i].withdraw(derivativeAmount);\n141: if (derivatives[i].balance() > 0)\n142: derivatives[i].withdraw(derivatives[i].balance());\n152: derivatives[i].deposit{value: ethAmount}();", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-salty", "title": "0x11singh99 Q", "severity_raw": "Critical", "severity": "critical", "description": "# Quality Assurance Report\n\n\n| QA Issues | Issues | Instances |\n| --------- | ---------------------------------------------- | --------- |\n| [[L-01](#l-01-in-poolsremoveliquidity-function-reservesreserve0-used-twice-in-one-condition-but-reservesreserve1-not-checked)] | In `Pools::removeLiquidity` function `reserves.reserve0` used twice in one condition but `reserves.reserve1` not checked. | 1 |\n| [[L-02](#l-02-check-value-before-dividing-by-zero)] | Check value before dividing by zero | 8 |\n| [[L-03](#l-03-unsafe-downcasting)] | Unsafe downcasting | 2 |\n| [[L-04](#l-04-use-owanble2step-and-override-renounce-ownership-so-owner-cant-renounce-it)] | Use owanble2step and override renounce ownership so owner can't renounce it. | 2 |\n| [[L-05](#l-05-check-return-value-of-approve)] | check return value of approve | 2 |\n| [[L-06](#l-06-after-minting-one-time-100-million-salt-tokens-there-is-no-way-to-mint-again-only-burn)] | After minting one time 100 Million Salt tokens there is no way to mint again only burn. | 1 |\n| [[N-01](#n-01-refactor-requireif-statement-to-modifier-if-it-is-used-more-than-once)] | Refactor require()/if() statement to modifier if it is used more than once | 2 |\n| [[N-02](#n-02-not-used-return-name-variable)] | Not used return name variable | 1 |\n| [[N-03](#n-03-use-uint256-instead-of-uint)] | Use `uint256` instead of `uint` | 1 |\n| [[N-04](#n-04-typo)] | Typo | 1 |\n# Low-Severity\n\n## [L-01] In `Pools::removeLiquidity` function `reserves.reserve0` used twice in one condition but `reserves.reserve1` not checked.\nIt can lead to continuing a transaction even though `reserves.reserve1` is less than DUST. It is not intended flow of the function. This is to ensure that ratios remain relatively constant even after a maximum withdrawal. But this will not be true. So better would be to `reserves.reserve1` is not less than DUST.\n\n```diff\nFile : src/pools/Pool.sol\n\n185: // Make sure that removing liquidity doesn't drive ei", "vulnerable_code": "https://github.com/code-423n4/2024-01-salty/blob/main/src/pools/Pools.sol#L185C3-L187C146\n\n## [L-02] Check value before dividing by zero\n\nChecking for zero before performing a division operation is crucial to prevent division by zero errors. If you attempt to divide a number by zero in most programming languages, it will result in an error or an exception. In Solidity and smart contract development, encountering such errors can have severe consequences, potentially leading to a halt in the execution of the smart contract or unexpected behavior.\n\n_8 instances_\n\n### Check `totalLiquidity` \n", "fixed_code": "https://github.com/code-423n4/2024-01-salty/blob/main/src/pools/Pools.sol#L179C1-L180C75\n\n### Check `reserve1` and `reserve0`\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/0x11singh99-Q.md", "collected_at": "2026-01-02T19:01:01.381753+00:00", "source_hash": "83eb7ee32086634c4771a2970243e702102716c6b9f2f580e05c333bd9e10798", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Pools.sol#L185-L3, Pools.sol#L179-L1", "github_files_list": "Pools.sol", "github_refs_count": 2, "vulnerable_code_actual": "https://github.com/code-423n4/2024-01-salty/blob/main/src/pools/Pools.sol#L185C3-L187C146\n\n## [L-02] Check value before dividing by zero\n\nChecking for zero before performing a division operation is crucial to prevent division by zero errors. If you attempt to divide a number by zero in most programming languages, it will result in an error or an exception. In Solidity and smart contract development, encountering such errors can have severe consequences, potentially leading to a halt in the execution of the smart contract or unexpected behavior.\n\n_8 instances_\n\n### Check `totalLiquidity` \n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "07-amphora", "title": "K42 G", "severity_raw": "Medium", "severity": "medium", "description": "## Gas Optimization Report for [Amphora](https://github.com/code-423n4/2023-07-amphora) by K42\n\n### Possible Optimization in [VaultController.sol](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/VaultController.sol)\n\nGeneral Optimizations = \n- Reducing the number of storage operations, as they are the most expensive in terms of gas.\n- Using events instead of storage for data that doesn't need to be accessed within the contract.\n- Using libraries for reusable code to reduce the size of the contract.\n- Using short-circuiting in conditionals to avoid unnecessary computation.\n\nPossible Optimization 1 = Packing variables into a struct:\n- You have several [uint192](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/VaultController.sol#L65C1-L71C33) variables. You can pack these variables into a ``struct`` to save gas. Here's an example:\n\n\n\n\n```solidity\nstruct VaultControllerStorage {\n uint192 totalBaseLiability;\n uint192 protocolFee;\n uint192 initialBorrowingFee;\n uint192 liquidationFee;\n}\n\nVaultControllerStorage public vaultControllerStorage;\n```\n\n\n\n\nYou can then access these variables like this: \n\n\n\n\n```solidity\nvaultControllerStorage.totalBaseLiability\n```\n\n\n\n\n- Estimated gas saved = This optimization can save approximately 20,000 gas per transaction that involves these variables due to reducing the number of ``SSTORE`` operations.\n\nPossible Optimization 2 = Removing redundant checks:\n- In the [_liquidationMath](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/VaultController.sol#L743C1-L757C4) function, there is a check to see if the vault is solvent. However, this check is also performed in the [liquidateVault](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/VaultController.sol#L646C1-L697C4) function, which is the only function that calls [_liquidationMath](https://github.com/code-423n4/2023-07-amphora/blob/main", "vulnerable_code": "struct VaultControllerStorage {\n uint192 totalBaseLiability;\n uint192 protocolFee;\n uint192 initialBorrowingFee;\n uint192 liquidationFee;\n}\n\nVaultControllerStorage public vaultControllerStorage;", "fixed_code": "vaultControllerStorage.totalBaseLiability", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/K42-G.md", "collected_at": "2026-01-02T18:23:26.902175+00:00", "source_hash": "844decfefd359bc0cea36e435a6407047c4aed357e893b2946905a49d8c3a29a", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 247, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "struct VaultControllerStorage {\n uint192 totalBaseLiability;\n uint192 protocolFee;\n uint192 initialBorrowingFee;\n uint192 liquidationFee;\n}\n\nVaultControllerStorage public vaultControllerStorage;", "primary_code_language": "solidity", "primary_code_char_count": 206, "all_code_blocks": "// Code block 1 (solidity):\nstruct VaultControllerStorage {\n uint192 totalBaseLiability;\n uint192 protocolFee;\n uint192 initialBorrowingFee;\n uint192 liquidationFee;\n}\n\nVaultControllerStorage public vaultControllerStorage;\n\n// Code block 2 (solidity):\nvaultControllerStorage.totalBaseLiability", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "struct VaultControllerStorage {\n uint192 totalBaseLiability;\n uint192 protocolFee;\n uint192 initialBorrowingFee;\n uint192 liquidationFee;\n}\n\nVaultControllerStorage public vaultControllerStorage;\n\nvaultControllerStorage.totalBaseLiability", "github_refs_formatted": "VaultController.sol, VaultController.sol#L65-L1, VaultController.sol#L743-L1, VaultController.sol#L646-L1", "github_files_list": "VaultController.sol", "github_refs_count": 4, "vulnerable_code_actual": "struct VaultControllerStorage {\n uint192 totalBaseLiability;\n uint192 protocolFee;\n uint192 initialBorrowingFee;\n uint192 liquidationFee;\n}\n\nVaultControllerStorage public vaultControllerStorage;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "vaultControllerStorage.totalBaseLiability", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "04-caviar", "title": "atharvasama G", "severity_raw": "Medium", "severity": "medium", "description": "# Gas Optimizations list\n\n| Number | Details | Instances |\n| ------ | ------------------------------------------------------------------------------------------------- | --------- |\n| 1 | ```x += y```/```x -= y``` COSTS MORE GAS THAN ```x = x + y```/```x = x - y``` FOR STATE VARIABLES | 4 |\n| 2 | CAN DECLARE VARIABLE OUTSIDE LOOP TO SAVE GAS | 13 |\n| 3 | PUBLIC FUNCTIONS NOT CALLED BY THE CONTRACT SHOULD BE DECLARED EXTERNAL INSTEAD | 21 |\n| 4 | OPTIMIZE NAMES TO SAVE GAS | 4 |\n| 5 | BEFORE SOME FUNCTIONS, WE SHOULD CHECK SOME VARIABLES FOR POSSIBLE GAS SAVE | 1 |\n| 6 | REORDER STRUCTURE LAYOUT | 2 |\n| 7 | USE ASSEMBLY TO CHECK FOR ```address(0)``` | 21 |\n\n# Gas Optimizations\n## [G-01] ```x += y```/```x -= y``` COSTS MORE GAS THAN ```x = x + y```/```x = x - y``` FOR STATE VARIABLES\nUsing the addition operator instead of plus-equals saves some gas for state variables.\n\nsrc\\PrivatePool.sol\n```js\n230: virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n\n231: virtualNftReserves -= uint128(weightSum);\n\n323: virtualBaseTokenReserves -= uint128(netOutputAmount + protocolFeeAmount + feeAmount);\n\n324: virtualNftReserves += uint128(weightSum);\n```\n\n## [G-02] CAN DECLARE VARIABLE OUTSIDE LOOP TO SAVE GAS \nDeclaring the stack variable outside the loop will save gas that would otherwise be spent on declaring the variable over and over again. \n\nsrc\\EthRouter.sol\n```js\n109: uint256 inputAmount = Pair(buys[i].pool).nftBuy{value: buys[i].bas", "vulnerable_code": "230: virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n\n231: virtualNftReserves -= uint128(weightSum);\n\n323: virtualBaseTokenReserves -= uint128(netOutputAmount + protocolFeeAmount + feeAmount);\n\n324: virtualNftReserves += uint128(weightSum);", "fixed_code": "109: uint256 inputAmount = Pair(buys[i].pool).nftBuy{value: buys[i].baseTokenAmount}(\n\n115: uint256 salePrice = inputAmount / buys[i].tokenIds.length;\n\n118: (uint256 royaltyFee, address royaltyRecipient) =\n\n170: uint256 outputAmount = Pair(sells[i].pool).nftSell(\n\n182: uint256 salePrice = outputAmount / sells[i].tokenIds.length;\n\n185: (uint256 royaltyFee, address royaltyRecipient) =\n\n262: Change memory _change = changes[i];", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/atharvasama-G.md", "collected_at": "2026-01-02T18:20:15.230524+00:00", "source_hash": "845a06fd2f76f824d99211287e05f869b209a858059946ae715d7abd99c34410", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 309, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "230: virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n\n231: virtualNftReserves -= uint128(weightSum);\n\n323: virtualBaseTokenReserves -= uint128(netOutputAmount + protocolFeeAmount + feeAmount);\n\n324: virtualNftReserves += uint128(weightSum);", "primary_code_language": "js", "primary_code_char_count": 309, "all_code_blocks": "// Code block 1 (js):\n230: virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n\n231: virtualNftReserves -= uint128(weightSum);\n\n323: virtualBaseTokenReserves -= uint128(netOutputAmount + protocolFeeAmount + feeAmount);\n\n324: virtualNftReserves += uint128(weightSum);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "230: virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n\n231: virtualNftReserves -= uint128(weightSum);\n\n323: virtualBaseTokenReserves -= uint128(netOutputAmount + protocolFeeAmount + feeAmount);\n\n324: virtualNftReserves += uint128(weightSum);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "109: uint256 inputAmount = Pair(buys[i].pool).nftBuy{value: buys[i].baseTokenAmount}(\n\n115: uint256 salePrice = inputAmount / buys[i].tokenIds.length;\n\n118: (uint256 royaltyFee, address royaltyRecipient) =\n\n170: uint256 outputAmount = Pair(sells[i].pool).nftSell(\n\n182: uint256 salePrice = outputAmount / sells[i].tokenIds.length;\n\n185: (uint256 royaltyFee, address royaltyRecipient) =\n\n262: Change memory _change = changes[i];", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "04-caviar", "title": "ayden Q", "severity_raw": "High", "severity": "high", "description": "https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L143\n1.Lack of a zero address(0) check\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L157\n2.Initializers could be front-run, allowing an attacker to either set their own values, take ownership of the contract, and in the best case forcing a re-deployment\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L211#L289\n3.ensure that the tokenIds and tokenWeights arrays have a length greater than zero and that they have the same length.\nAnd at line 236, tokenIds.length is used as the denominator, but it has been previously ensured that this length is greater than 0\n\n```solidity\n+ require(tokenIds.length > 0 && tokenIds.length == tokenWeights.length, \"Invalid input arrays\");\n```\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/Factory.sol#L142\n4.The protocol fee should be set within a reasonable range,if the value of protocolFeeRate is mistakenly set, the protocolFeeAmount in sellQuote may be larger than the outputAmount\n\n```solidity\nif (_protocolFeeRate > 5_000) revert ProtocolRateTooHigh();\n```\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L230#L231\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L323#L324\nTo ensure that there is no overflow when converting uint256 to uint128,and the totalNetInputAmount can be extracted so that it does not need to be calculated again later\n\n```solidity\n\n- virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n- virtualNftReserves -= uint128(weightSum);\n\n+ uint256 totalNetInputAmount = netInputAmount - feeAmount - protocolFeeAmount;\n+ require(uint128(totalNetInputAmount) == totalNetInputAmount, \"totalNetInputAmount is not an int\");\n+ require(uint128(weightSum) == weightSum, \"weightSum is not an int\");\n```\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L506\n5.When the baseToken is a nati", "vulnerable_code": "+ require(tokenIds.length > 0 && tokenIds.length == tokenWeights.length, \"Invalid input arrays\");", "fixed_code": "if (_protocolFeeRate > 5_000) revert ProtocolRateTooHigh();", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/ayden-Q.md", "collected_at": "2026-01-02T18:20:16.745396+00:00", "source_hash": "847481039a3ffc7b9ef39fdae11c63d363d4ab5f012a8e428ee761ce08d3e432", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 539, "github_ref_count": 7, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "+ require(tokenIds.length > 0 && tokenIds.length == tokenWeights.length, \"Invalid input arrays\");", "primary_code_language": "solidity", "primary_code_char_count": 97, "all_code_blocks": "// Code block 1 (solidity):\n+ require(tokenIds.length > 0 && tokenIds.length == tokenWeights.length, \"Invalid input arrays\");\n\n// Code block 2 (solidity):\nif (_protocolFeeRate > 5_000) revert ProtocolRateTooHigh();\n\n// Code block 3 (solidity):\n- virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n- virtualNftReserves -= uint128(weightSum);\n\n+ uint256 totalNetInputAmount = netInputAmount - feeAmount - protocolFeeAmount;\n+ require(uint128(totalNetInputAmount) == totalNetInputAmount, \"totalNetInputAmount is not an int\");\n+ require(uint128(weightSum) == weightSum, \"weightSum is not an int\");", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "+ require(tokenIds.length > 0 && tokenIds.length == tokenWeights.length, \"Invalid input arrays\");\n\nif (_protocolFeeRate > 5_000) revert ProtocolRateTooHigh();\n\n- virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n- virtualNftReserves -= uint128(weightSum);\n\n+ uint256 totalNetInputAmount = netInputAmount - feeAmount - protocolFeeAmount;\n+ require(uint128(totalNetInputAmount) == totalNetInputAmount, \"totalNetInputAmount is not an int\");\n+ require(uint128(weightSum) == weightSum, \"weightSum is not an int\");", "github_refs_formatted": "PrivatePool.sol#L143, PrivatePool.sol#L157, PrivatePool.sol#L211, Factory.sol#L142, PrivatePool.sol#L230, PrivatePool.sol#L323, PrivatePool.sol#L506", "github_files_list": "PrivatePool.sol, Factory.sol", "github_refs_count": 7, "vulnerable_code_actual": "+ require(tokenIds.length > 0 && tokenIds.length == tokenWeights.length, \"Invalid input arrays\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": "if (_protocolFeeRate > 5_000) revert ProtocolRateTooHigh();", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "02-ethos", "title": "luxartvinsec Q", "severity_raw": "Medium", "severity": "medium", "description": "# 1. Possible integer overflow in `CollateralConfig` contract\n\n### Link : https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol#L66\n\n### Summary: \n\nThe `CollateralConfig` contract contains a constant variable `MIN_ALLOWED_CCR` with the value 1.5 ether. The value of ether is assumed to be 10^18, but if ether were to be assigned a different value, there could be an integer overflow during the execution of the contract. An attacker could exploit this vulnerability to cause unexpected behavior in the contract.\n\n### Impact: \n\nAn integer overflow caused by a change in the value of ether could result in a breach of the security of the contract. Depending on the severity of the overflow, the attacker could be able to steal funds or cause a denial-of-service attack. In the worst case, the contract could be rendered completely unusable.\n\n### Recommendation: \n\nIt is recommended to replace the constant variables with the explicit values of 110% and 150%, respectively, to prevent potential integer overflow issues in the future. Additionally, it is recommended to use `SafeMath` to perform arithmetic operations in the contract, which would prevent integer overflow attacks.\n\n### Example: \n\nThe `MIN_ALLOWED_CCR` and `MIN_ALLOWED_MCR` variables could be replaced with the following code snippet:\n\n```\nuint256 constant public MIN_ALLOWED_MCR = 110e16; // 110%\nuint256 constant public MIN_ALLOWED_CCR = 150e16; // 150%\n```\n\nThe `SafeMath` library could be imported and used for arithmetic operations, as shown below:\n\n```\nimport \"./Dependencies/SafeMath.sol\";\n\n// ...\n\nuint256 constant public MIN_ALLOWED_MCR = 110e16; // 110%\nuint256 constant public MIN_ALLOWED_CCR = 150e16; // 150%\n\nusing SafeMath for uint256;\n\n// ...\n\nrequire(_MCRs[i].safeMul(1e18) >= MIN_ALLOWED_MCR, \"MCR below allowed minimum\");\nconfig.MCR = _MCRs[i];\n\nrequire(_CCRs[i].safeMul(1e18) >= MIN_ALLOWED_CCR, \"CCR below allowed minimum\");\nconfig.CCR = _CCRs[i];\n```\n\n# 2. Potential Re-Ent", "vulnerable_code": "uint256 constant public MIN_ALLOWED_MCR = 110e16; // 110%\nuint256 constant public MIN_ALLOWED_CCR = 150e16; // 150%", "fixed_code": "import \"./Dependencies/SafeMath.sol\";\n\n// ...\n\nuint256 constant public MIN_ALLOWED_MCR = 110e16; // 110%\nuint256 constant public MIN_ALLOWED_CCR = 150e16; // 150%\n\nusing SafeMath for uint256;\n\n// ...\n\nrequire(_MCRs[i].safeMul(1e18) >= MIN_ALLOWED_MCR, \"MCR below allowed minimum\");\nconfig.MCR = _MCRs[i];\n\nrequire(_CCRs[i].safeMul(1e18) >= MIN_ALLOWED_CCR, \"CCR below allowed minimum\");\nconfig.CCR = _CCRs[i];", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/luxartvinsec-Q.md", "collected_at": "2026-01-02T18:17:22.610750+00:00", "source_hash": "847aa02276856f1efa1f17c9681aff21bf1a6bbe519e8e2b62ca70051544e125", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 524, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "uint256 constant public MIN_ALLOWED_MCR = 110e16; // 110%\nuint256 constant public MIN_ALLOWED_CCR = 150e16; // 150%", "primary_code_language": "unknown", "primary_code_char_count": 115, "all_code_blocks": "// Code block 1 (unknown):\nuint256 constant public MIN_ALLOWED_MCR = 110e16; // 110%\nuint256 constant public MIN_ALLOWED_CCR = 150e16; // 150%\n\n// Code block 2 (unknown):\nimport \"./Dependencies/SafeMath.sol\";\n\n// ...\n\nuint256 constant public MIN_ALLOWED_MCR = 110e16; // 110%\nuint256 constant public MIN_ALLOWED_CCR = 150e16; // 150%\n\nusing SafeMath for uint256;\n\n// ...\n\nrequire(_MCRs[i].safeMul(1e18) >= MIN_ALLOWED_MCR, \"MCR below allowed minimum\");\nconfig.MCR = _MCRs[i];\n\nrequire(_CCRs[i].safeMul(1e18) >= MIN_ALLOWED_CCR, \"CCR below allowed minimum\");\nconfig.CCR = _CCRs[i];", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CollateralConfig.sol#L66", "github_files_list": "CollateralConfig.sol", "github_refs_count": 1, "vulnerable_code_actual": "uint256 constant public MIN_ALLOWED_MCR = 110e16; // 110%\nuint256 constant public MIN_ALLOWED_CCR = 150e16; // 150%", "has_vulnerable_code_snippet": true, "fixed_code_actual": "import \"./Dependencies/SafeMath.sol\";\n\n// ...\n\nuint256 constant public MIN_ALLOWED_MCR = 110e16; // 110%\nuint256 constant public MIN_ALLOWED_CCR = 150e16; // 150%\n\nusing SafeMath for uint256;\n\n// ...\n\nrequire(_MCRs[i].safeMul(1e18) >= MIN_ALLOWED_MCR, \"MCR below allowed minimum\");\nconfig.MCR = _MCRs[i];\n\nrequire(_CCRs[i].safeMul(1e18) >= MIN_ALLOWED_CCR, \"CCR below allowed minimum\");\nconfig.CCR = _CCRs[i];", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "08-dopex", "title": "0xSmartContract Analysis", "severity_raw": "Critical", "severity": "critical", "description": "# \ud83d\udee0\ufe0f Analysis - Dopex Protocol ![image](https://github.com/code-423n4/2023-08-dopex/assets/104318932/6c6fb6aa-df12-4c09-aa49-fc7b6709a628)\n\n\n### Summary\n| List |Head |Details|\n|:--|:----------------|:------|\n|a) |The approach I followed when reviewing the code | Stages in my code review and analysis |\n|b) |Analysis of the code base | What is unique? How are the existing patterns used? |\n|c) |Test analysis | Test scope of the project and quality of tests |\n|d) |Centralization risks | How was the risk of centralization handled in the project, what could be alternatives? |\n|e) |Systemic risks | Potential systemic risks in the project |\n|f) |Competition analysis| What are similar projects? |\n|g) |Security Approach of the Project | Audit approach of the Project |\n|h) |Other Audit Reports and Automated Findings | What are the previous Audit reports and their analysis |\n|i) |Gas Optimization | Gas usage approach of the project and alternative solutions to it |\n|j) |Other recommendations | What is unique? How are the existing patterns used? |\n|k) |New insights and learning from this audit | Things learned from the project |\n\n## a) The approach I followed when reviewing the code\n\nFirst, by examining the scope of the code, I determined my code review and analysis strategy.\nhttps://github.com/code-423n4/2023-08-dopex\n\nAccordingly, I analyzed and audited the subject in the following steps;\n\n| Number |Stage |Details|Information|\n|:--|:----------------|:------|:------|\n|1|Compile and Run Test|[Installation](https://github.com/code-423n4/2023-08-dopex#running-tests)|Test and installation structure is simple, cleanly designed|\n|2|Architecture Review|The [Dopex](https://dopex.notion.site/rDPX-V2-RI-b45b5b402af54bcab758d62fb7c69cb4) explainer provides a high-level overview of the Project system and the describe the core components.|Provides a basic architectural teaching for General Architecture|\n|3|Graphical Analysis |Graphical Analysis with [Solidity-metrics](https://github.com/C", "vulnerable_code": "Readme.md\n- What is the overall line coverage percentage provided by your tests?: 95%", "fixed_code": "contracts\\core\\RdpxV2Core.sol:\n 1015 **/\n 1016: function redeem(\n 1017: uint256 id,\n 1018: address to\n 1019: ) external returns (uint256 receiptTokenAmount) {\n 1020: // Validate bond ID\n 1021: _validate(bonds[id].timestamp > 0, 6);\n 1022: // Validate if bond has matured\n 1023: _validate(block.timestamp > bonds[id].maturity, 7);\n 1024: \n 1025: _validate(\n 1026: msg.sender == RdpxV2Bond(addresses.receiptTokenBonds).ownerOf(id),\n 1027: 9\n 1028: );\n 1029: \n 1030: // Burn the bond token\n 1031: // Note requires an approval of the bond token to this contract\n 1032: RdpxV2Bond(addresses.receiptTokenBonds).burn(id);\n 1033: \n 1034: // transfer receipt tokens to user\n 1035: receiptTokenAmount = bonds[id].amount;\n 1036: IERC20WithBurn(addresses.rdpxV2ReceiptToken).safeTransfer(\n 1037: to,\n 1038: receiptTokenAmount\n 1039: );\n 1040: \n 1041: emit LogRedeem(to, receiptTokenAmount);\n 1042: }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/0xSmartContract-Analysis.md", "collected_at": "2026-01-02T18:24:19.115772+00:00", "source_hash": "84c1a3e7a61690548eea0b2e8f6d3361c572515977e94ed0eee5a3a3178b15ee", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "Readme.md\n- What is the overall line coverage percentage provided by your tests?: 95%", "has_vulnerable_code_snippet": true, "fixed_code_actual": "contracts\\core\\RdpxV2Core.sol:\n 1015 **/\n 1016: function redeem(\n 1017: uint256 id,\n 1018: address to\n 1019: ) external returns (uint256 receiptTokenAmount) {\n 1020: // Validate bond ID\n 1021: _validate(bonds[id].timestamp > 0, 6);\n 1022: // Validate if bond has matured\n 1023: _validate(block.timestamp > bonds[id].maturity, 7);\n 1024: \n 1025: _validate(\n 1026: msg.sender == RdpxV2Bond(addresses.receiptTokenBonds).ownerOf(id),\n 1027: 9\n 1028: );\n 1029: \n 1030: // Burn the bond token\n 1031: // Note requires an approval of the bond token to this contract\n 1032: RdpxV2Bond(addresses.receiptTokenBonds).burn(id);\n 1033: \n 1034: // transfer receipt tokens to user\n 1035: receiptTokenAmount = bonds[id].amount;\n 1036: IERC20WithBurn(addresses.rdpxV2ReceiptToken).safeTransfer(\n 1037: to,\n 1038: receiptTokenAmount\n 1039: );\n 1040: \n 1041: emit LogRedeem(to, receiptTokenAmount);\n 1042: }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-asymmetry", "title": "RaymondFam G", "severity_raw": "High", "severity": "high", "description": "## For loop pre-condition\nIn `rebalanceToWeights()` of SatEth.sol, `ethAmountToRebalance == 0` should be moved out of the if block before the for loop to save gas on iterations. This is because if `ethAmountToRebalance` is ever true, it means there is no ETH available to deposit into any of the derivatives.\n\nConsider refactoring the affected code as follows:\n\n[File: SafEth.sol#L147-L155](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L147-L155) \n\n```diff\n+ if (ethAmountToRebalance == 0) return; \n\n for (uint i = 0; i < derivativeCount; i++) {\n- if (weights[i] == 0 || ethAmountToRebalance == 0) continue;\n+ if (weights[i] == 0) continue;\n uint256 ethAmount = (ethAmountToRebalance * weights[i]) /\n totalWeight;\n // Price will change due to slippage\n derivatives[i].deposit{value: ethAmount}();\n }\n emit Rebalanced();\n }\n```\n## Use array of mappings\nWhen a derivative has turned obsolete, i.e. weights assigned zero and the associated underlyingValue has been fully drained after [`rebalanceToWeights()`](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L138-L155) is called, it does not make sense the derivative will have to be called and skipped each time `unstake()` is called, which incurs additional gas.\n\nConsider adding `derivatives[x]` and `weights[x]` to their respective arrays in [`addDerivative()`](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L182-L195) and have the obsolete mappings removed from the arrays via `rebalanceToWeights()` or a separately implemented function when need be and deemed fit. Use the array length to iterate the for loop in [`stake()`](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L71-L96) and [`unstake()`](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L1", "vulnerable_code": "## Use array of mappings\nWhen a derivative has turned obsolete, i.e. weights assigned zero and the associated underlyingValue has been fully drained after [`rebalanceToWeights()`](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L138-L155) is called, it does not make sense the derivative will have to be called and skipped each time `unstake()` is called, which incurs additional gas.\n\nConsider adding `derivatives[x]` and `weights[x]` to their respective arrays in [`addDerivative()`](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L182-L195) and have the obsolete mappings removed from the arrays via `rebalanceToWeights()` or a separately implemented function when need be and deemed fit. Use the array length to iterate the for loop in [`stake()`](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L71-L96) and [`unstake()`](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L113-L119) instead of `derivativeCount`.\n\n## Avoid comparing boolean expressions to boolean literals\nComparing a boolean value to a boolean literal incurs the `ISZERO` operation and costs more gas than using a boolean expression.\n\nHere are some of the affected code lines that may be refactored as follows:\n\n[File: SafEth.sol#L64](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L64)\n", "fixed_code": "[File: SafEth.sol#L109](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L109)\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/RaymondFam-G.md", "collected_at": "2026-01-02T18:18:26.976547+00:00", "source_hash": "84da2365b327e8c6474299f4edb00c2cc14955ddd9d2dbd187fffe306c980467", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 466, "github_ref_count": 8, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "+ if (ethAmountToRebalance == 0) return; \n\n for (uint i = 0; i < derivativeCount; i++) {\n- if (weights[i] == 0 || ethAmountToRebalance == 0) continue;\n+ if (weights[i] == 0) continue;\n uint256 ethAmount = (ethAmountToRebalance * weights[i]) /\n totalWeight;\n // Price will change due to slippage\n derivatives[i].deposit{value: ethAmount}();\n }\n emit Rebalanced();\n }", "primary_code_language": "diff", "primary_code_char_count": 466, "all_code_blocks": "// Code block 1 (diff):\n+ if (ethAmountToRebalance == 0) return; \n\n for (uint i = 0; i < derivativeCount; i++) {\n- if (weights[i] == 0 || ethAmountToRebalance == 0) continue;\n+ if (weights[i] == 0) continue;\n uint256 ethAmount = (ethAmountToRebalance * weights[i]) /\n totalWeight;\n // Price will change due to slippage\n derivatives[i].deposit{value: ethAmount}();\n }\n emit Rebalanced();\n }", "all_code_blocks_count": 1, "has_diff_blocks": true, "diff_code": "+ if (ethAmountToRebalance == 0) return; \n\n for (uint i = 0; i < derivativeCount; i++) {\n- if (weights[i] == 0 || ethAmountToRebalance == 0) continue;\n+ if (weights[i] == 0) continue;\n uint256 ethAmount = (ethAmountToRebalance * weights[i]) /\n totalWeight;\n // Price will change due to slippage\n derivatives[i].deposit{value: ethAmount}();\n }\n emit Rebalanced();\n }", "solidity_code": "", "github_refs_formatted": "SafEth.sol#L147-L155, SafEth.sol#L138-L155, SafEth.sol#L182-L195, SafEth.sol#L71-L96, SafEth.sol#L1, SafEth.sol#L113-L119, SafEth.sol#L64, SafEth.sol#L109", "github_files_list": "SafEth.sol", "github_refs_count": 8, "vulnerable_code_actual": "## Use array of mappings\nWhen a derivative has turned obsolete, i.e. weights assigned zero and the associated underlyingValue has been fully drained after [`rebalanceToWeights()`](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L138-L155) is called, it does not make sense the derivative will have to be called and skipped each time `unstake()` is called, which incurs additional gas.\n\nConsider adding `derivatives[x]` and `weights[x]` to their respective arrays in [`addDerivative()`](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L182-L195) and have the obsolete mappings removed from the arrays via `rebalanceToWeights()` or a separately implemented function when need be and deemed fit. Use the array length to iterate the for loop in [`stake()`](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L71-L96) and [`unstake()`](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L113-L119) instead of `derivativeCount`.\n\n## Avoid comparing boolean expressions to boolean literals\nComparing a boolean value to a boolean literal incurs the `ISZERO` operation and costs more gas than using a boolean expression.\n\nHere are some of the affected code lines that may be refactored as follows:\n\n[File: SafEth.sol#L64](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L64)\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "[File: SafEth.sol#L109](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L109)\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "03-asymmetry", "title": "chriszhou G", "severity_raw": "Gas", "severity": "gas", "description": "### Using private rather than public for constants, saves gas\n\nIf needed, the values can be read from the verified contract source code, or if there are multiple values there can be a single getter function that returns a tuple of the values of all currently-public constants. Saves 3406-3606 gas in deployment gas due to the compiler not having to create non-payable getter functions for deployment calldata, not having to store the bytes of the value outside of where it's used, and not adding another entry to the method ID table\n\nThere are 11 instances of this issue.\n\n```\nFile: ./contracts/SafEth/derivatives/Reth.sol\n\n20: address public constant ROCKET_STORAGE_ADDRESS =\n22: address public constant W_ETH_ADDRESS =\n24: address public constant UNISWAP_ROUTER =\n26: address public constant UNI_V3_FACTORY =\n```\n\n```\nFile: ./contracts/SafEth/derivatives/SfrxEth.sol\n\n14: address public constant SFRX_ETH_ADDRESS =\n16: address public constant FRX_ETH_ADDRESS =\n18: address public constant FRX_ETH_CRV_POOL_ADDRESS =\n20: address public constant FRX_ETH_MINTER_ADDRESS =\n```\n\n```\nFile: ./contracts/SafEth/derivatives/WstEth.sol\n\n13: address public constant WST_ETH =\n15: address public constant LIDO_CRV_POOL =\n17: address public constant STETH_TOKEN =\n```\n\n\n\n", "vulnerable_code": "File: ./contracts/SafEth/derivatives/Reth.sol\n\n20: address public constant ROCKET_STORAGE_ADDRESS =\n22: address public constant W_ETH_ADDRESS =\n24: address public constant UNISWAP_ROUTER =\n26: address public constant UNI_V3_FACTORY =", "fixed_code": "File: ./contracts/SafEth/derivatives/SfrxEth.sol\n\n14: address public constant SFRX_ETH_ADDRESS =\n16: address public constant FRX_ETH_ADDRESS =\n18: address public constant FRX_ETH_CRV_POOL_ADDRESS =\n20: address public constant FRX_ETH_MINTER_ADDRESS =", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/chriszhou-G.md", "collected_at": "2026-01-02T18:18:58.486199+00:00", "source_hash": "84e3c3578e67a54833e2ad95ea7b9cce700cab16e8904e8e807f3f2a90110182", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 699, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: ./contracts/SafEth/derivatives/Reth.sol\n\n20: address public constant ROCKET_STORAGE_ADDRESS =\n22: address public constant W_ETH_ADDRESS =\n24: address public constant UNISWAP_ROUTER =\n26: address public constant UNI_V3_FACTORY =", "primary_code_language": "unknown", "primary_code_char_count": 249, "all_code_blocks": "// Code block 1 (unknown):\nFile: ./contracts/SafEth/derivatives/Reth.sol\n\n20: address public constant ROCKET_STORAGE_ADDRESS =\n22: address public constant W_ETH_ADDRESS =\n24: address public constant UNISWAP_ROUTER =\n26: address public constant UNI_V3_FACTORY =\n\n// Code block 2 (unknown):\nFile: ./contracts/SafEth/derivatives/SfrxEth.sol\n\n14: address public constant SFRX_ETH_ADDRESS =\n16: address public constant FRX_ETH_ADDRESS =\n18: address public constant FRX_ETH_CRV_POOL_ADDRESS =\n20: address public constant FRX_ETH_MINTER_ADDRESS =\n\n// Code block 3 (unknown):\nFile: ./contracts/SafEth/derivatives/WstEth.sol\n\n13: address public constant WST_ETH =\n15: address public constant LIDO_CRV_POOL =\n17: address public constant STETH_TOKEN =", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: ./contracts/SafEth/derivatives/Reth.sol\n\n20: address public constant ROCKET_STORAGE_ADDRESS =\n22: address public constant W_ETH_ADDRESS =\n24: address public constant UNISWAP_ROUTER =\n26: address public constant UNI_V3_FACTORY =", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: ./contracts/SafEth/derivatives/SfrxEth.sol\n\n14: address public constant SFRX_ETH_ADDRESS =\n16: address public constant FRX_ETH_ADDRESS =\n18: address public constant FRX_ETH_CRV_POOL_ADDRESS =\n20: address public constant FRX_ETH_MINTER_ADDRESS =", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7.61} {"source": "c4", "protocol": "04-caviar", "title": "decade Q", "severity_raw": "High", "severity": "high", "description": "## Q/A \n---\n#### 1. ProtocolFee should have max limit check before being initialized or updated.\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/Factory.sol#L141\n```\n /// @notice Sets the protocol fee that is taken on each buy/sell/change. It's in basis points: 350 = 3.5%.\n /// @param _protocolFeeRate The protocol fee.\n function setProtocolFeeRate(uint16 _protocolFeeRate) public onlyOwner {\n protocolFeeRate = _protocolFeeRate;\n }\n```\n-- ProtocolFee set by admin should have a check for max limit. \n-- Admin should not be able to set protocol fees above a certain limit. This allows protection against future admin key theft. \n\n---\n\n#### 2. Place 2-step verification before changing private pool implementation.\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/Factory.sol#L135 \n```\n function setPrivatePoolImplementation(address _privatePoolImplementation) public onlyOwner {\n privatePoolImplementation = _privatePoolImplementation;\n }\n```\n-- As theft of admin key could lead to Parity bug type situation where faulty implementation will affect **all the future pools**.\nhttps://github.com/openethereum/parity-ethereum/issues/6995\n\n---\n\n#### 3. Place 2-step ownership transfer for factory contract .\n-- Factory contract currently uses direct ownership transfer via [solmate](https://github.com/transmissions11/solmate/blob/1b3adf677e7e383cc684b5d5bd441da86bf4bf1c/src/auth/Owned.sol), which directly transfers ownership to the given address. It is recommended not to use this approach as direct transfer of ownership that could lead to misconfiguration.\n-- 2 step ownership transfer supports protocol not lose ownership to a dead address.\n\n---\n\n#### 4. No check present for length mismatch of dynamic arrays.\n-- Where - [`sumWeightsAndValidateProof()`](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L661-L6", "vulnerable_code": " /// @notice Sets the protocol fee that is taken on each buy/sell/change. It's in basis points: 350 = 3.5%.\n /// @param _protocolFeeRate The protocol fee.\n function setProtocolFeeRate(uint16 _protocolFeeRate) public onlyOwner {\n protocolFeeRate = _protocolFeeRate;\n }", "fixed_code": " function setPrivatePoolImplementation(address _privatePoolImplementation) public onlyOwner {\n privatePoolImplementation = _privatePoolImplementation;\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/decade-Q.md", "collected_at": "2026-01-02T18:20:28.172546+00:00", "source_hash": "84fbf6846341e4e84e77f7e773a03c136e3405124bccdb6efc36d7f388d81bc5", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 444, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "/// @notice Sets the protocol fee that is taken on each buy/sell/change. It's in basis points: 350 = 3.5%.\n /// @param _protocolFeeRate The protocol fee.\n function setProtocolFeeRate(uint16 _protocolFeeRate) public onlyOwner {\n protocolFeeRate = _protocolFeeRate;\n }", "primary_code_language": "unknown", "primary_code_char_count": 282, "all_code_blocks": "// Code block 1 (unknown):\n/// @notice Sets the protocol fee that is taken on each buy/sell/change. It's in basis points: 350 = 3.5%.\n /// @param _protocolFeeRate The protocol fee.\n function setProtocolFeeRate(uint16 _protocolFeeRate) public onlyOwner {\n protocolFeeRate = _protocolFeeRate;\n }\n\n// Code block 2 (unknown):\nfunction setPrivatePoolImplementation(address _privatePoolImplementation) public onlyOwner {\n privatePoolImplementation = _privatePoolImplementation;\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Factory.sol#L141, Factory.sol#L135, Owned.sol, PrivatePool.sol#L661-L6", "github_files_list": "PrivatePool.sol, Owned.sol, Factory.sol", "github_refs_count": 4, "vulnerable_code_actual": " /// @notice Sets the protocol fee that is taken on each buy/sell/change. It's in basis points: 350 = 3.5%.\n /// @param _protocolFeeRate The protocol fee.\n function setProtocolFeeRate(uint16 _protocolFeeRate) public onlyOwner {\n protocolFeeRate = _protocolFeeRate;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function setPrivatePoolImplementation(address _privatePoolImplementation) public onlyOwner {\n privatePoolImplementation = _privatePoolImplementation;\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "09-ondo", "title": "zigtur G", "severity_raw": "Unknown", "severity": "unknown", "description": "\n# SharesBurnt event is incorrect\nIn _burnShares, `preRebaseTokenAmount` and `postRebaseTokenAmount` get their value from `getRUSDYByShares(_sharesAmount)` before and after burning shares (`totalShares` and `shares[account]` are updated).\n\nAs `getRUSDYByShares` doesn't use any of the updated value and `sharesAmount` is not modified, then `preRebaseTokenAmount` and `postRebaseTokenAmount` will always be equal.\n\n## Code fixed\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDY.sol#L586-L592\n\n```solidity\n uint256 preRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\n totalShares -= _sharesAmount;\n\n shares[_account] = accountShares - _sharesAmount;\n\n uint256 postRebaseTokenAmount = preRebaseTokenAmount;\n```", "vulnerable_code": " uint256 preRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\n totalShares -= _sharesAmount;\n\n shares[_account] = accountShares - _sharesAmount;\n\n uint256 postRebaseTokenAmount = preRebaseTokenAmount;", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/zigtur-G.md", "collected_at": "2026-01-02T18:26:23.409060+00:00", "source_hash": "8500acd0402597630f7657d6e32a005c8ed6ccd4d2fe2885f036b9c9e96579de", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 212, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "uint256 preRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\n totalShares -= _sharesAmount;\n\n shares[_account] = accountShares - _sharesAmount;\n\n uint256 postRebaseTokenAmount = preRebaseTokenAmount;", "primary_code_language": "solidity", "primary_code_char_count": 212, "all_code_blocks": "// Code block 1 (solidity):\nuint256 preRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\n totalShares -= _sharesAmount;\n\n shares[_account] = accountShares - _sharesAmount;\n\n uint256 postRebaseTokenAmount = preRebaseTokenAmount;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "uint256 preRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\n totalShares -= _sharesAmount;\n\n shares[_account] = accountShares - _sharesAmount;\n\n uint256 postRebaseTokenAmount = preRebaseTokenAmount;", "github_refs_formatted": "rUSDY.sol#L586-L592", "github_files_list": "rUSDY.sol", "github_refs_count": 1, "vulnerable_code_actual": " uint256 preRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\n totalShares -= _sharesAmount;\n\n shares[_account] = accountShares - _sharesAmount;\n\n uint256 postRebaseTokenAmount = preRebaseTokenAmount;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.5} {"source": "c4", "protocol": "03-asymmetry", "title": "brgltd Q", "severity_raw": "Critical", "severity": "critical", "description": "# [01] Add checks for weight values\n\nCurrently it's possible to set any value for the weights. Some combinations for weights could result in issues while calculating `ethAmount`.\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L169\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L187\n\nFor example, assuming the minimum value for msg.value, three derivatives and strange values for the weights.\n\n```\nmsg.value = 5e17 = 0.5e18\nweight1 = 5e17 = 0.5e18\nweight2 = 19e18 = 19e18\nweight3 = 19e19 = 190e18\n\nethAmount = (msg.value * weight) / totalWeight\n5e17 * 5e17 / (5e17 + 19e18 + 19e19)\n```\n\nThis would result in `1193317422434367.5` which would round down in solidity.\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L88\n\n## Recommendation\n\nAdd checks for min and max values for weights.\n\n# [02] Lack of method to remove derivatives\n\nIn case a derivative gets added by mistake or with incorrect parameters, currently this derivative would remain stuck in `SafEth.sol`.\n\n## Recommendation\n\nConsider adding a method that allows removing derivatives from `SafEth.sol`.\n\n# [03] Reentrancy for `SafEth.unstake()`\n\nThere is a reentrancy possibility in `SafEth.unstake()` where the tokens are burned only after the derivative withdraw.\n\nIf the `derivatives[i].withdraw()` external call where to reenter into `SafEth.unstake()`, the `safEthAmount` is still not updated, since the `_burn()` is only called after, and the function doesn't contain a nonReentranct modifier.\n\nNote: this would only be an issue for a malicious derivative contract.\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L113-L120\n\n## Recommendation\n\nCall `_burn()` before `derivatives[i].withdraw()` in `SafEth.unstake()`.\n\n# [04] Unbounded loop\n\nThere are multiple instances of loops executing external calls where the number of iterations is unbounded and controlled by the nu", "vulnerable_code": "msg.value = 5e17 = 0.5e18\nweight1 = 5e17 = 0.5e18\nweight2 = 19e18 = 19e18\nweight3 = 19e19 = 190e18\n\nethAmount = (msg.value * weight) / totalWeight\n5e17 * 5e17 / (5e17 + 19e18 + 19e19)", "fixed_code": "require(!pausedStaking && !pauseUnstaking, \"error\");", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/brgltd-Q.md", "collected_at": "2026-01-02T18:18:52.178518+00:00", "source_hash": "853d0794da09eda82b319b58158a0cff945cbeac6ffc045b106a7ec300796373", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 188, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "msg.value = 5e17 = 0.5e18\nweight1 = 5e17 = 0.5e18\nweight2 = 19e18 = 19e18\nweight3 = 19e19 = 190e18\n\nethAmount = (msg.value * weight) / totalWeight\n5e17 * 5e17 / (5e17 + 19e18 + 19e19)", "primary_code_language": "unknown", "primary_code_char_count": 188, "all_code_blocks": "// Code block 1 (unknown):\nmsg.value = 5e17 = 0.5e18\nweight1 = 5e17 = 0.5e18\nweight2 = 19e18 = 19e18\nweight3 = 19e19 = 190e18\n\nethAmount = (msg.value * weight) / totalWeight\n5e17 * 5e17 / (5e17 + 19e18 + 19e19)", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol#L169, SafEth.sol#L187, SafEth.sol#L88, SafEth.sol#L113-L120", "github_files_list": "SafEth.sol", "github_refs_count": 4, "vulnerable_code_actual": "msg.value = 5e17 = 0.5e18\nweight1 = 5e17 = 0.5e18\nweight2 = 19e18 = 19e18\nweight3 = 19e19 = 190e18\n\nethAmount = (msg.value * weight) / totalWeight\n5e17 * 5e17 / (5e17 + 19e18 + 19e19)", "has_vulnerable_code_snippet": true, "fixed_code_actual": "require(!pausedStaking && !pauseUnstaking, \"error\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "05-ajna", "title": "MohammedRizwan G", "severity_raw": "Medium", "severity": "medium", "description": "## Summary\n\n### Gas Optimizations\n| |Issue|Instances| |\n|-|:-|:-:|:-:|\n| [G‑01] | += costs more gas than = + for state variables | 30 |\n| [G‑02] | Don\u2019t initialize variables with default value | 22 |\n| [G‑03] | Use nested if and, avoid multiple check combinations | 5 |\n\n\n### [G‑01] += costs more gas than = + for state variables\nUsing compound assignment operators for state variables (like State += X or State -= X \u2026) it\u2019s more expensive than using operator assignment (like State = State + X or State = State - X \u2026). \nUsing the addition operator instead of plus-equals saves 113 gas. [Link to reference](https://gist.github.com/IllIllI000/cbbfb267425b898e5be734d4008d4fe8)\n\nTotal gas saved can be ~ 3300 approx.\n\nThere are 30 instances of this issue.\n\n```solidity\nFile: ajna-grants/src/grants/GrantFund.sol\n\n62 treasury += fundingAmount_;\n```\n[Link to code](https://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/GrantFund.sol#LL62C1-L62C36)\n\n```solidity\nFile: ajna-core/src/PositionManager.sol\n\n202 position.lps += lpBalance;\n```\n[Link to code](https://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-core/src/PositionManager.sol#LL202C1-L202C39)\n\n```solidity\nFile: ajna-core/src/PositionManager.sol\n\n320 fromPosition.lps -= vars.lpbAmountFrom;\n321 toPosition.lps += vars.lpbAmountTo;\n```\n[Link to code](https://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-core/src/PositionManager.sol#LL320C1-L321C46)\n\n```solidity\nFile: ajna-core/src/RewardsManager.sol\n\n339 rewards_ += _calculateNextEpochRewards(\n```\n[Link to code](https://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-core/src/RewardsManager.sol#LL339C1-L339C52)\n\n```solidity\nFile: ajna-core/src/RewardsManager.sol\n\n406 rewards_ += nextEpoch", "vulnerable_code": "File: ajna-grants/src/grants/GrantFund.sol\n\n62 treasury += fundingAmount_;", "fixed_code": "File: ajna-core/src/PositionManager.sol\n\n202 position.lps += lpBalance;", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/MohammedRizwan-G.md", "collected_at": "2026-01-02T18:21:06.101668+00:00", "source_hash": "854a8eea77aab159e8d38b72a5776158996c9710cfb2e1a92dc883300e4fd1e7", "code_block_count": 4, "solidity_block_count": 4, "total_code_chars": 397, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: ajna-grants/src/grants/GrantFund.sol\n\n62 treasury += fundingAmount_;", "primary_code_language": "solidity", "primary_code_char_count": 81, "all_code_blocks": "// Code block 1 (solidity):\nFile: ajna-grants/src/grants/GrantFund.sol\n\n62 treasury += fundingAmount_;\n\n// Code block 2 (solidity):\nFile: ajna-core/src/PositionManager.sol\n\n202 position.lps += lpBalance;\n\n// Code block 3 (solidity):\nFile: ajna-core/src/PositionManager.sol\n\n320 fromPosition.lps -= vars.lpbAmountFrom;\n321 toPosition.lps += vars.lpbAmountTo;\n\n// Code block 4 (solidity):\nFile: ajna-core/src/RewardsManager.sol\n\n339 rewards_ += _calculateNextEpochRewards(", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: ajna-grants/src/grants/GrantFund.sol\n\n62 treasury += fundingAmount_;\n\nFile: ajna-core/src/PositionManager.sol\n\n202 position.lps += lpBalance;\n\nFile: ajna-core/src/PositionManager.sol\n\n320 fromPosition.lps -= vars.lpbAmountFrom;\n321 toPosition.lps += vars.lpbAmountTo;\n\nFile: ajna-core/src/RewardsManager.sol\n\n339 rewards_ += _calculateNextEpochRewards(", "github_refs_formatted": "GrantFund.sol, PositionManager.sol, RewardsManager.sol", "github_files_list": "RewardsManager.sol, GrantFund.sol, PositionManager.sol", "github_refs_count": 3, "vulnerable_code_actual": "File: ajna-grants/src/grants/GrantFund.sol\n\n62 treasury += fundingAmount_;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: ajna-core/src/PositionManager.sol\n\n202 position.lps += lpBalance;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "10-badger", "title": "Topmark Q", "severity_raw": "Low", "severity": "low", "description": "### Report 1:\nTypographical Error in L48 & L61 of CdpManagerStorage.sol contract, It should be \"purposes\" not \"pruposes\"\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/CdpManagerStorage.sol#L48\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/CdpManagerStorage.sol#L61\n```solidity\n /// @dev Internal notify called by Redemptions and Liquidations\n>>> /// @dev Specified TCR is emitted for notification pruposes regardless of whether the Grace Period timestamp is set\n function _startGracePeriod(uint256 _tcr) internal {\n```\n```solidity\n>>> /// @dev Specified TCR is emitted for notification pruposes regardless of whether the Grace Period timestamp is set\n /// @dev Internal notify called by Redemptions and Liquidations\n function _endGracePeriod(uint256 _tcr) internal {\n```\n### Report 2:\n## Title \nCode Reversion due to improper Validation\n## Impact\nMissing Validation to ensure prevChainlinkResponse is not zero would allow reversion and Denial of Service if _currentRoundEthBtcId or _currentRoundStEthEthId is equal 1 in the _getPrevChainlinkResponse(...) function of the PriceFeed.sol contract.\n## Proof of Concept\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/PriceFeed.sol#L687-L722\n\nAs seen in the code provided below and as noted by the arrows, subtraction is done for _currentRoundEthBtcId and _currentRoundStEthEthId i.e minus 1, the problem is id for prevChainlinkResponse would be zero which opens up reversion since this zero value is used to interact with external contracts as noted in the \"getRoundData(...)\" function, thereby causing denial of service.\n```solidity\n function _getPrevChainlinkResponse(\n>>> uint80 _currentRoundEthBtcId,\n>>> uint80 _currentRoundStEthEthId\n ) internal view returns (ChainlinkResponse memory prevChainlinkResponse) {\n // If first round, early return\n // Handles revert from underflow in _curre", "vulnerable_code": " /// @dev Internal notify called by Redemptions and Liquidations\n>>> /// @dev Specified TCR is emitted for notification pruposes regardless of whether the Grace Period timestamp is set\n function _startGracePeriod(uint256 _tcr) internal {", "fixed_code": ">>> /// @dev Specified TCR is emitted for notification pruposes regardless of whether the Grace Period timestamp is set\n /// @dev Internal notify called by Redemptions and Liquidations\n function _endGracePeriod(uint256 _tcr) internal {", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/Topmark-Q.md", "collected_at": "2026-01-02T18:26:39.235037+00:00", "source_hash": "856ac000be33b68389595c20b4aa034e0061d9357698584110a2ebd6543b8bff", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 485, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "/// @dev Internal notify called by Redemptions and Liquidations\n>>> /// @dev Specified TCR is emitted for notification pruposes regardless of whether the Grace Period timestamp is set\n function _startGracePeriod(uint256 _tcr) internal {", "primary_code_language": "solidity", "primary_code_char_count": 242, "all_code_blocks": "// Code block 1 (solidity):\n/// @dev Internal notify called by Redemptions and Liquidations\n>>> /// @dev Specified TCR is emitted for notification pruposes regardless of whether the Grace Period timestamp is set\n function _startGracePeriod(uint256 _tcr) internal {\n\n// Code block 2 (solidity):\n>>> /// @dev Specified TCR is emitted for notification pruposes regardless of whether the Grace Period timestamp is set\n /// @dev Internal notify called by Redemptions and Liquidations\n function _endGracePeriod(uint256 _tcr) internal {", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "/// @dev Internal notify called by Redemptions and Liquidations\n>>> /// @dev Specified TCR is emitted for notification pruposes regardless of whether the Grace Period timestamp is set\n function _startGracePeriod(uint256 _tcr) internal {\n\n>>> /// @dev Specified TCR is emitted for notification pruposes regardless of whether the Grace Period timestamp is set\n /// @dev Internal notify called by Redemptions and Liquidations\n function _endGracePeriod(uint256 _tcr) internal {", "github_refs_formatted": "CdpManagerStorage.sol#L48, CdpManagerStorage.sol#L61, PriceFeed.sol#L687-L722", "github_files_list": "PriceFeed.sol, CdpManagerStorage.sol", "github_refs_count": 3, "vulnerable_code_actual": " /// @dev Internal notify called by Redemptions and Liquidations\n>>> /// @dev Specified TCR is emitted for notification pruposes regardless of whether the Grace Period timestamp is set\n function _startGracePeriod(uint256 _tcr) internal {", "has_vulnerable_code_snippet": true, "fixed_code_actual": ">>> /// @dev Specified TCR is emitted for notification pruposes regardless of whether the Grace Period timestamp is set\n /// @dev Internal notify called by Redemptions and Liquidations\n function _endGracePeriod(uint256 _tcr) internal {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "05-ajna", "title": "rfa G", "severity_raw": "Gas", "severity": "gas", "description": "## [G-1] Using storage pointer to declare `positions` var\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/PositionManager.sol#L190\n\nBy using `storage` to declare `positions` and remove L207, we can save at least 103 gas per loop\n\nRecommended mitigation step:\n```solidity\n\t//change this line\n\tPosition storage position = positions[params_.tokenId][index];\n\n // check for previous deposits\n if (position.depositTime != 0) {\n // check that bucket didn't go bankrupt after prior memorialization\n if (_bucketBankruptAfterDeposit(pool, index, position.depositTime)) {\n // if bucket did go bankrupt, zero out the LP tracked by position manager\n position.lps = 0;\n }\n }\n\n // update token position LP\n position.lps += lpBalance;\n // set token's position deposit time to the original lender's deposit time\n position.depositTime = depositTime;\n\n // remove this part\n //positions[params_.tokenId][index] = position;\n```", "vulnerable_code": "\t//change this line\n\tPosition storage position = positions[params_.tokenId][index];\n\n // check for previous deposits\n if (position.depositTime != 0) {\n // check that bucket didn't go bankrupt after prior memorialization\n if (_bucketBankruptAfterDeposit(pool, index, position.depositTime)) {\n // if bucket did go bankrupt, zero out the LP tracked by position manager\n position.lps = 0;\n }\n }\n\n // update token position LP\n position.lps += lpBalance;\n // set token's position deposit time to the original lender's deposit time\n position.depositTime = depositTime;\n\n // remove this part\n //positions[params_.tokenId][index] = position;", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/rfa-G.md", "collected_at": "2026-01-02T18:21:45.436070+00:00", "source_hash": "85c38cea0ee480297d4a30b3591177807497d308ecd3987a5e9a71b1bac51038", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 813, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "//change this line\n\tPosition storage position = positions[params_.tokenId][index];\n\n // check for previous deposits\n if (position.depositTime != 0) {\n // check that bucket didn't go bankrupt after prior memorialization\n if (_bucketBankruptAfterDeposit(pool, index, position.depositTime)) {\n // if bucket did go bankrupt, zero out the LP tracked by position manager\n position.lps = 0;\n }\n }\n\n // update token position LP\n position.lps += lpBalance;\n // set token's position deposit time to the original lender's deposit time\n position.depositTime = depositTime;\n\n // remove this part\n //positions[params_.tokenId][index] = position;", "primary_code_language": "solidity", "primary_code_char_count": 813, "all_code_blocks": "// Code block 1 (solidity):\n//change this line\n\tPosition storage position = positions[params_.tokenId][index];\n\n // check for previous deposits\n if (position.depositTime != 0) {\n // check that bucket didn't go bankrupt after prior memorialization\n if (_bucketBankruptAfterDeposit(pool, index, position.depositTime)) {\n // if bucket did go bankrupt, zero out the LP tracked by position manager\n position.lps = 0;\n }\n }\n\n // update token position LP\n position.lps += lpBalance;\n // set token's position deposit time to the original lender's deposit time\n position.depositTime = depositTime;\n\n // remove this part\n //positions[params_.tokenId][index] = position;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "//change this line\n\tPosition storage position = positions[params_.tokenId][index];\n\n // check for previous deposits\n if (position.depositTime != 0) {\n // check that bucket didn't go bankrupt after prior memorialization\n if (_bucketBankruptAfterDeposit(pool, index, position.depositTime)) {\n // if bucket did go bankrupt, zero out the LP tracked by position manager\n position.lps = 0;\n }\n }\n\n // update token position LP\n position.lps += lpBalance;\n // set token's position deposit time to the original lender's deposit time\n position.depositTime = depositTime;\n\n // remove this part\n //positions[params_.tokenId][index] = position;", "github_refs_formatted": "PositionManager.sol#L190", "github_files_list": "PositionManager.sol", "github_refs_count": 1, "vulnerable_code_actual": "\t//change this line\n\tPosition storage position = positions[params_.tokenId][index];\n\n // check for previous deposits\n if (position.depositTime != 0) {\n // check that bucket didn't go bankrupt after prior memorialization\n if (_bucketBankruptAfterDeposit(pool, index, position.depositTime)) {\n // if bucket did go bankrupt, zero out the LP tracked by position manager\n position.lps = 0;\n }\n }\n\n // update token position LP\n position.lps += lpBalance;\n // set token's position deposit time to the original lender's deposit time\n position.depositTime = depositTime;\n\n // remove this part\n //positions[params_.tokenId][index] = position;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5.22} {"source": "c4", "protocol": "01-salty", "title": "Audinarey Q", "severity_raw": "Low", "severity": "low", "description": "## [L-01] Parameter Ballot can be proposed with invalid `parameterType`\n\nIf [`Proposals.proposeParameterBallot(...)`](https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/dao/Proposals.sol#L155-L159) is called with an invalid `parameterType` the function does not revert. I am reporting this as a LOW severity because it does not break the protocols functionality as an invalid `parameterType` does not do anything.\n\n## Suggestion\n\nModify the `Proposals.proposeParameterBallot(...)` as shown below\n\n```\nfunction proposeParameterBallot( uint256 parameterType, string calldata description ) external nonReentrant returns (uint256 ballotID)\n\t\t{\n+\t\trequire(parameterType < 26, \"Invalid ParameterType\");\n\t\tstring memory ballotName = string.concat(\"parameter:\", Strings.toString(parameterType) );\n\t\treturn _possiblyCreateProposal( ballotName, BallotType.PARAMETER, address(0), parameterType, \"\", description );\n\t\t}\n```\n\n\n## [L-02] `SendSALT` can be proposed with zero amount\n\nIf [`Proposals.proposeSendSALT(...)`](https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/dao/Proposals.sol#L196-L209) is called with zero as the `amount` of SALT to send, the function does not revert.\n\nAlthough no SALT is sent even when the proposal passes but the caller still spends gas fee when the call is made.\n\n## Suggestion\n\n- Modify the `Proposals.proposeSendSALT(...)` to revert when the SALT balance is less than `100 wei` (to avoid rounding errors)\n\n```solidity\nfunction proposeSendSALT( address wallet, uint256 amount, string calldata description ) external nonReentrant returns (uint256 ballotID)\n\t\t{\n\t\t...\n\t\tuint256 balance = exchangeConfig.salt().balanceOf( address(exchangeConfig.dao()) );\n\t\trequire(balance > 100 wei, \"Insufficient SALT balance\");\n\t\tuint256 maxSendable = balance * 5 / 100;\n\n\t\t...\n\t\t}\n```\n", "vulnerable_code": "function proposeParameterBallot( uint256 parameterType, string calldata description ) external nonReentrant returns (uint256 ballotID)\n\t\t{\n+\t\trequire(parameterType < 26, \"Invalid ParameterType\");\n\t\tstring memory ballotName = string.concat(\"parameter:\", Strings.toString(parameterType) );\n\t\treturn _possiblyCreateProposal( ballotName, BallotType.PARAMETER, address(0), parameterType, \"\", description );\n\t\t}", "fixed_code": "function proposeSendSALT( address wallet, uint256 amount, string calldata description ) external nonReentrant returns (uint256 ballotID)\n\t\t{\n\t\t...\n\t\tuint256 balance = exchangeConfig.salt().balanceOf( address(exchangeConfig.dao()) );\n\t\trequire(balance > 100 wei, \"Insufficient SALT balance\");\n\t\tuint256 maxSendable = balance * 5 / 100;\n\n\t\t...\n\t\t}", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/Audinarey-Q.md", "collected_at": "2026-01-02T19:01:12.238535+00:00", "source_hash": "85fac863dfaf96c86a505f542ed1d38faea7b73b5d05408b7093f091e9bb66b7", "code_block_count": 2, "solidity_block_count": 1, "total_code_chars": 750, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function proposeParameterBallot( uint256 parameterType, string calldata description ) external nonReentrant returns (uint256 ballotID)\n\t\t{\n+\t\trequire(parameterType < 26, \"Invalid ParameterType\");\n\t\tstring memory ballotName = string.concat(\"parameter:\", Strings.toString(parameterType) );\n\t\treturn _possiblyCreateProposal( ballotName, BallotType.PARAMETER, address(0), parameterType, \"\", description );\n\t\t}", "primary_code_language": "unknown", "primary_code_char_count": 405, "all_code_blocks": "// Code block 1 (unknown):\nfunction proposeParameterBallot( uint256 parameterType, string calldata description ) external nonReentrant returns (uint256 ballotID)\n\t\t{\n+\t\trequire(parameterType < 26, \"Invalid ParameterType\");\n\t\tstring memory ballotName = string.concat(\"parameter:\", Strings.toString(parameterType) );\n\t\treturn _possiblyCreateProposal( ballotName, BallotType.PARAMETER, address(0), parameterType, \"\", description );\n\t\t}\n\n// Code block 2 (solidity):\nfunction proposeSendSALT( address wallet, uint256 amount, string calldata description ) external nonReentrant returns (uint256 ballotID)\n\t\t{\n\t\t...\n\t\tuint256 balance = exchangeConfig.salt().balanceOf( address(exchangeConfig.dao()) );\n\t\trequire(balance > 100 wei, \"Insufficient SALT balance\");\n\t\tuint256 maxSendable = balance * 5 / 100;\n\n\t\t...\n\t\t}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function proposeSendSALT( address wallet, uint256 amount, string calldata description ) external nonReentrant returns (uint256 ballotID)\n\t\t{\n\t\t...\n\t\tuint256 balance = exchangeConfig.salt().balanceOf( address(exchangeConfig.dao()) );\n\t\trequire(balance > 100 wei, \"Insufficient SALT balance\");\n\t\tuint256 maxSendable = balance * 5 / 100;\n\n\t\t...\n\t\t}", "github_refs_formatted": "Proposals.sol#L155-L159, Proposals.sol#L196-L209", "github_files_list": "Proposals.sol", "github_refs_count": 2, "vulnerable_code_actual": "function proposeParameterBallot( uint256 parameterType, string calldata description ) external nonReentrant returns (uint256 ballotID)\n\t\t{\n+\t\trequire(parameterType < 26, \"Invalid ParameterType\");\n\t\tstring memory ballotName = string.concat(\"parameter:\", Strings.toString(parameterType) );\n\t\treturn _possiblyCreateProposal( ballotName, BallotType.PARAMETER, address(0), parameterType, \"\", description );\n\t\t}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function proposeSendSALT( address wallet, uint256 amount, string calldata description ) external nonReentrant returns (uint256 ballotID)\n\t\t{\n\t\t...\n\t\tuint256 balance = exchangeConfig.salt().balanceOf( address(exchangeConfig.dao()) );\n\t\trequire(balance > 100 wei, \"Insufficient SALT balance\");\n\t\tuint256 maxSendable = balance * 5 / 100;\n\n\t\t...\n\t\t}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "04-caviar", "title": "Tomio G", "severity_raw": "Low", "severity": "low", "description": "Title: Consider delete empty block or emit something\n\nimpact:\nThe code should be refactored such that they no longer exist, or the block should do something useful, such as emitting an event or reverting.\n\nProof of Concept:\n[Factory.sol#L55](https://github.com/code-423n4/2023-04-caviar/blob/main/src/Factory.sol#L55)\n[EthRouter.sol#L88](https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L88)\n________________________________________________________________________\n\nTitle: Move `SafeTransferLib` and `LibClone` functions into the `PrivatePool` contract to avoid unnecessary function calls and gas costs.\n\nProof of Concept:\nInstead of using SafeTransferLib and LibClone in the Factory contract, we can move these functions into the PrivatePool contract and call them directly from there. This can help to reduce the number of function calls and gas costs.\n[Factory.sol#L38-L39](https://github.com/code-423n4/2023-04-caviar/blob/main/src/Factory.sol#L38-L39)\n________________________________________________________________________\n\n\nTitle: Use `uint256` instead of `uint128` to avoid unnecessary conversions and gas costs.\n\nProof of Concept:\n[Factory.sol#L74-L75](https://github.com/code-423n4/2023-04-caviar/blob/main/src/Factory.sol#L74-L75)\n________________________________________________________________________\n\n\nTitle: function `sumWeightsAndValidateProof()` gas improvement on returning value\n\nProof of Concept:\n[PrivatePool.sol#L671](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L671)\n\nRecommended Mitigation Steps:\nby set `sum` in returns L#665 and delete L#671 can save gas\n\n```\nfunction sumWeightsAndValidateProof(\n uint256[] memory tokenIds,\n uint256[] memory tokenWeights,\n MerkleMultiProof memory proof\n ) public view returns (uint256 sum) { //@audit-info: set here\n```\n________________________________________________________________________\n\nTitle: Use `require` instead of `revert`\n\nProof of Concept:\nUse ", "vulnerable_code": "function sumWeightsAndValidateProof(\n uint256[] memory tokenIds,\n uint256[] memory tokenWeights,\n MerkleMultiProof memory proof\n ) public view returns (uint256 sum) { //@audit-info: set here", "fixed_code": "require(\n (_baseToken == address(0) && msg.value != baseTokenAmount) ||\n (_baseToken != address(0) && msg.value > 0),\n \"Invalid ETH amount\"\n );", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/Tomio-G.md", "collected_at": "2026-01-02T18:20:09.673461+00:00", "source_hash": "864631986dbe65ac76bbaa9ca7258f4a29f528c316f458a6fea641553a7d42af", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 214, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function sumWeightsAndValidateProof(\n uint256[] memory tokenIds,\n uint256[] memory tokenWeights,\n MerkleMultiProof memory proof\n ) public view returns (uint256 sum) { //@audit-info: set here", "primary_code_language": "unknown", "primary_code_char_count": 214, "all_code_blocks": "// Code block 1 (unknown):\nfunction sumWeightsAndValidateProof(\n uint256[] memory tokenIds,\n uint256[] memory tokenWeights,\n MerkleMultiProof memory proof\n ) public view returns (uint256 sum) { //@audit-info: set here", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Factory.sol#L55, EthRouter.sol#L88, Factory.sol#L38-L39, Factory.sol#L74-L75, PrivatePool.sol#L671", "github_files_list": "EthRouter.sol, Factory.sol, PrivatePool.sol", "github_refs_count": 5, "vulnerable_code_actual": "function sumWeightsAndValidateProof(\n uint256[] memory tokenIds,\n uint256[] memory tokenWeights,\n MerkleMultiProof memory proof\n ) public view returns (uint256 sum) { //@audit-info: set here", "has_vulnerable_code_snippet": true, "fixed_code_actual": "require(\n (_baseToken == address(0) && msg.value != baseTokenAmount) ||\n (_baseToken != address(0) && msg.value > 0),\n \"Invalid ETH amount\"\n );", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "11-kelp", "title": "QiuhaoLi Q", "severity_raw": "Low", "severity": "low", "description": "## [LOW] LRTConfigRoleChecker should add a storage gap\n\n`LRTConfigRoleChecker` is a contract inherited by `LRTDepositPool`, `LRTOracle`, `NodeDelegator`, `RSETH`, etc, which are upgradable contracts. E.g. for `LRTDepositPool`, it's defined as:\n\n```solidity\ncontract LRTDepositPool is ILRTDepositPool, LRTConfigRoleChecker, PausableUpgradeable, ReentrancyGuardUpgradeable {\n``` \n\nIn `LRTConfigRoleChecker`, we have a storage variable, but don't have storage gap:\n\n```solidity\nabstract contract LRTConfigRoleChecker {\n ILRTConfig public lrtConfig;\n......\n}\n```\n\nTo avoid future needs to add storage slot in `LRTConfigRoleChecker` and storage conflicts. Better add a storage gap:\n\n```solidity\n **\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n *\n uint256[49] private __gap;\n```", "vulnerable_code": "contract LRTDepositPool is ILRTDepositPool, LRTConfigRoleChecker, PausableUpgradeable, ReentrancyGuardUpgradeable {", "fixed_code": "abstract contract LRTConfigRoleChecker {\n ILRTConfig public lrtConfig;\n......\n}", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/QiuhaoLi-Q.md", "collected_at": "2026-01-02T18:27:34.501771+00:00", "source_hash": "868825dd3726ec10b0113280077060055ee62741dafe8bc1a0017cd0809d3b6c", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 480, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "contract LRTDepositPool is ILRTDepositPool, LRTConfigRoleChecker, PausableUpgradeable, ReentrancyGuardUpgradeable {", "primary_code_language": "solidity", "primary_code_char_count": 115, "all_code_blocks": "// Code block 1 (solidity):\ncontract LRTDepositPool is ILRTDepositPool, LRTConfigRoleChecker, PausableUpgradeable, ReentrancyGuardUpgradeable {\n\n// Code block 2 (solidity):\nabstract contract LRTConfigRoleChecker {\n ILRTConfig public lrtConfig;\n......\n}\n\n// Code block 3 (solidity):\n**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n *\n uint256[49] private __gap;", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "contract LRTDepositPool is ILRTDepositPool, LRTConfigRoleChecker, PausableUpgradeable, ReentrancyGuardUpgradeable {\n\nabstract contract LRTConfigRoleChecker {\n ILRTConfig public lrtConfig;\n......\n}\n\n**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n *\n uint256[49] private __gap;", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "contract LRTDepositPool is ILRTDepositPool, LRTConfigRoleChecker, PausableUpgradeable, ReentrancyGuardUpgradeable {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "abstract contract LRTConfigRoleChecker {\n ILRTConfig public lrtConfig;\n......\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6.97} {"source": "c4", "protocol": "01-ondo", "title": "amshirif G", "severity_raw": "Low", "severity": "low", "description": "Require statements are used after making calls/not the first line(s) of a function call. In most cases only a very small amount of gas would be lost. I will list them below, however they do not amount to much. The main concern would be in contracts `contracts/lending/tokens/cCash/CCashDelegate.sol` and `contracts/lending/tokens/cToken/CTokenDelegate.sol`. The reason being is the stated intention (in the code comments) that an update using the `data` field is to come in the future. It should be noted that all logic is done after initial checks. In both cases here is a recommended version.\n\nBoth data and the unnecessary check to set to zero can be removed without any alteration to the code's behavior. (This in itself could be considered an optimization). \n\n```solidity\nfunction _becomeImplementation(bytes) public virtual override {\n require(\n msg.sender == admin,\n \"only the admin may call _becomeImplementation\"\n );\n }\n```\n\nHere are all the occurrences, most of these calls are minor unless `_beforeTokenTransfer()` is changed. \n\nhttps://github.com/code-423n4/2023-01-ondo/blob/83a45fa7cbc427a62ccf04d0e5cf9b0e780ec26c/contracts/lending/tokens/cCash/CCashDelegate.sol#L21-L34\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/83a45fa7cbc427a62ccf04d0e5cf9b0e780ec26c/contracts/lending/tokens/cToken/CTokenDelegate.sol#L21-L34\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/83a45fa7cbc427a62ccf04d0e5cf9b0e780ec26c/contracts/cash/token/Cash.sol#L29-L40\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/83a45fa7cbc427a62ccf04d0e5cf9b0e780ec26c/contracts/cash/token/CashKYCSender.sol#L56-L75\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/83a45fa7cbc427a62ccf04d0e5cf9b0e780ec26c/contracts/cash/token/CashKYCSenderReceiver.sol#L56-L83", "vulnerable_code": "function _becomeImplementation(bytes) public virtual override {\n require(\n msg.sender == admin,\n \"only the admin may call _becomeImplementation\"\n );\n }", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/amshirif-G.md", "collected_at": "2026-01-02T18:14:53.789828+00:00", "source_hash": "86ac76e665db5efa383b227c725b778dbe711b7985516a6e1c5ca0c4e79cde8f", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 168, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _becomeImplementation(bytes) public virtual override {\n require(\n msg.sender == admin,\n \"only the admin may call _becomeImplementation\"\n );\n }", "primary_code_language": "solidity", "primary_code_char_count": 168, "all_code_blocks": "// Code block 1 (solidity):\nfunction _becomeImplementation(bytes) public virtual override {\n require(\n msg.sender == admin,\n \"only the admin may call _becomeImplementation\"\n );\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function _becomeImplementation(bytes) public virtual override {\n require(\n msg.sender == admin,\n \"only the admin may call _becomeImplementation\"\n );\n }", "github_refs_formatted": "CCashDelegate.sol#L21-L34, CTokenDelegate.sol#L21-L34, Cash.sol#L29-L40, CashKYCSender.sol#L56-L75, CashKYCSenderReceiver.sol#L56-L83", "github_files_list": "CashKYCSenderReceiver.sol, CTokenDelegate.sol, CashKYCSender.sol, Cash.sol, CCashDelegate.sol", "github_refs_count": 5, "vulnerable_code_actual": "function _becomeImplementation(bytes) public virtual override {\n require(\n msg.sender == admin,\n \"only the admin may call _becomeImplementation\"\n );\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "02-ai-arena", "title": "Benterkiii G", "severity_raw": "Gas", "severity": "gas", "description": "# Improvements to `createPhysicalAttributes` Function\n\n **Variable Declaration Order:**\nThe function variable `attributesLength` should be declared before the array `finalAttributeProbabilityIndexes`.\n\n```solidity\n uint256 attributesLength = attributes.length;\n uint256[] memory finalAttributeProbabilityIndexes = new uint[](attributesLength);\n```\nby doing this we save 12 gas every time the function get executed.\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/AiArenaHelper.sol#L96\n\nUpdated function:\n\n```solidity\nfunction createPhysicalAttributes(\n uint256 dna, \n uint8 generation, \n uint8 iconsType, \n bool dendroidBool\n ) \n external \n view \n returns (FighterOps.FighterPhysicalAttributes memory) \n {\n if (dendroidBool) {\n return FighterOps.FighterPhysicalAttributes(99, 99, 99, 99, 99, 99);\n } else {\n uint256[] memory finalAttributeProbabilityIndexes = new uint[](attributes.length);\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n if (\n i == 0 && iconsType == 2 || // Custom icons head (beta helmet)\n i == 1 && iconsType > 0 || // Custom icons eyes (red diamond)\n i == 4 && iconsType == 3 // Custom icons hands (bowling ball)\n ) {\n finalAttributeProbabilityIndexes[i] = 50;\n } else {\n uint256 rarityRank = (dna / attributeToDnaDivisor[attributes[i]]) % 100;\n uint256 attributeIndex = dnaToIndex(generation, rarityRank, attributes[i]);\n finalAttributeProbabilityIndexes[i] = attributeIndex;\n }\n }\n return FighterOps.FighterPhysicalAttributes(\n finalAttributeProbabilityIndexes[0],\n finalAttributeProbabilityIndexes[1],\n fin", "vulnerable_code": " uint256 attributesLength = attributes.length;\n uint256[] memory finalAttributeProbabilityIndexes = new uint[](attributesLength);", "fixed_code": "function createPhysicalAttributes(\n uint256 dna, \n uint8 generation, \n uint8 iconsType, \n bool dendroidBool\n ) \n external \n view \n returns (FighterOps.FighterPhysicalAttributes memory) \n {\n if (dendroidBool) {\n return FighterOps.FighterPhysicalAttributes(99, 99, 99, 99, 99, 99);\n } else {\n uint256[] memory finalAttributeProbabilityIndexes = new uint[](attributes.length);\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n if (\n i == 0 && iconsType == 2 || // Custom icons head (beta helmet)\n i == 1 && iconsType > 0 || // Custom icons eyes (red diamond)\n i == 4 && iconsType == 3 // Custom icons hands (bowling ball)\n ) {\n finalAttributeProbabilityIndexes[i] = 50;\n } else {\n uint256 rarityRank = (dna / attributeToDnaDivisor[attributes[i]]) % 100;\n uint256 attributeIndex = dnaToIndex(generation, rarityRank, attributes[i]);\n finalAttributeProbabilityIndexes[i] = attributeIndex;\n }\n }\n return FighterOps.FighterPhysicalAttributes(\n finalAttributeProbabilityIndexes[0],\n finalAttributeProbabilityIndexes[1],\n finalAttributeProbabilityIndexes[2],\n finalAttributeProbabilityIndexes[3],\n finalAttributeProbabilityIndexes[4],\n finalAttributeProbabilityIndexes[5]\n );\n }\n }", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/Benterkiii-G.md", "collected_at": "2026-01-02T19:02:16.581893+00:00", "source_hash": "87c6097e804e0ba1690f9ad6f8e8dcc5f0f1b418f273a27c40ce8dc69d2e5a7c", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 130, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "uint256 attributesLength = attributes.length;\n uint256[] memory finalAttributeProbabilityIndexes = new uint[](attributesLength);", "primary_code_language": "solidity", "primary_code_char_count": 130, "all_code_blocks": "// Code block 1 (solidity):\nuint256 attributesLength = attributes.length;\n uint256[] memory finalAttributeProbabilityIndexes = new uint[](attributesLength);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "uint256 attributesLength = attributes.length;\n uint256[] memory finalAttributeProbabilityIndexes = new uint[](attributesLength);", "github_refs_formatted": "AiArenaHelper.sol#L96", "github_files_list": "AiArenaHelper.sol", "github_refs_count": 1, "vulnerable_code_actual": " uint256 attributesLength = attributes.length;\n uint256[] memory finalAttributeProbabilityIndexes = new uint[](attributesLength);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function createPhysicalAttributes(\n uint256 dna, \n uint8 generation, \n uint8 iconsType, \n bool dendroidBool\n ) \n external \n view \n returns (FighterOps.FighterPhysicalAttributes memory) \n {\n if (dendroidBool) {\n return FighterOps.FighterPhysicalAttributes(99, 99, 99, 99, 99, 99);\n } else {\n uint256[] memory finalAttributeProbabilityIndexes = new uint[](attributes.length);\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n if (\n i == 0 && iconsType == 2 || // Custom icons head (beta helmet)\n i == 1 && iconsType > 0 || // Custom icons eyes (red diamond)\n i == 4 && iconsType == 3 // Custom icons hands (bowling ball)\n ) {\n finalAttributeProbabilityIndexes[i] = 50;\n } else {\n uint256 rarityRank = (dna / attributeToDnaDivisor[attributes[i]]) % 100;\n uint256 attributeIndex = dnaToIndex(generation, rarityRank, attributes[i]);\n finalAttributeProbabilityIndexes[i] = attributeIndex;\n }\n }\n return FighterOps.FighterPhysicalAttributes(\n finalAttributeProbabilityIndexes[0],\n finalAttributeProbabilityIndexes[1],\n finalAttributeProbabilityIndexes[2],\n finalAttributeProbabilityIndexes[3],\n finalAttributeProbabilityIndexes[4],\n finalAttributeProbabilityIndexes[5]\n );\n }\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ai-arena", "title": "Kaysoft Q", "severity_raw": "Low", "severity": "low", "description": "## [L-1] Consider using 2 step ownership transfer\n\nThe Neuron.sol#transferOwnership() function transfers ownership in a single step. This can cause the ownership of the contract to be easily lost when a wrong address is mistakenly entered. \n\nWith 2 step ownership transfer, the above mistake can be recovered from because the new owner send a confirmation trasnaction to accept ownership while its pending.\n\nthere 7 instances of these\n- https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/Neuron.sol#L85C5-L88C6\n- https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/AiArenaHelper.sol#L61C5-L64C6\n- https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L120\n- https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/GameItems.sol#L108\n- https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/MergingPool.sol#L89\n- https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/RankedBattle.sol#L167\n- https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/VoltageManager.sol#L64\n\n```\nFile: Neuron.sol\nfunction transferOwnership(address newOwnerAddress) external {\n require(msg.sender == _ownerAddress);\n _ownerAddress = newOwnerAddress;\n }\n```\n\nRecommendation:\nConsider using Openzeppelin's Ownable2step library.\n\n\n## [L-2] Consider having functions that can also remove `minter`, `staker` and `spender`\n\nThe `addMinter`, `addStaker` and `addSpender` function are used to grant roles to some contracts. `owner` should be able to also `revoke` roles.\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/Neuron.sol#L93C5-L112C6\n\nRecommendation:\nConsider creating functions that allows revoking the above roles. \n\n\n## [L-3] FighterFa", "vulnerable_code": "File: Neuron.sol\nfunction transferOwnership(address newOwnerAddress) external {\n require(msg.sender == _ownerAddress);\n _ownerAddress = newOwnerAddress;\n }", "fixed_code": "/// @notice Adds a new address that is allowed to stake fighters on behalf of users.\n /// @dev Only the owner address is authorized to call this function.\n /// @param newStaker The address of the new staker\n function addStaker(address newStaker) external {\n require(msg.sender == _ownerAddress);\n hasStakerRole[newStaker] = true;\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/Kaysoft-Q.md", "collected_at": "2026-01-02T19:02:30.026125+00:00", "source_hash": "8811288dac3252016a440f0569684c8a05feaec0c6bba2b9cedb3865db3e32dc", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 172, "github_ref_count": 8, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: Neuron.sol\nfunction transferOwnership(address newOwnerAddress) external {\n require(msg.sender == _ownerAddress);\n _ownerAddress = newOwnerAddress;\n }", "primary_code_language": "unknown", "primary_code_char_count": 172, "all_code_blocks": "// Code block 1 (unknown):\nFile: Neuron.sol\nfunction transferOwnership(address newOwnerAddress) external {\n require(msg.sender == _ownerAddress);\n _ownerAddress = newOwnerAddress;\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Neuron.sol#L85-L5, AiArenaHelper.sol#L61-L5, FighterFarm.sol#L120, GameItems.sol#L108, MergingPool.sol#L89, RankedBattle.sol#L167, VoltageManager.sol#L64, Neuron.sol#L93-L5", "github_files_list": "GameItems.sol, Neuron.sol, VoltageManager.sol, RankedBattle.sol, FighterFarm.sol, MergingPool.sol, AiArenaHelper.sol", "github_refs_count": 8, "vulnerable_code_actual": "File: Neuron.sol\nfunction transferOwnership(address newOwnerAddress) external {\n require(msg.sender == _ownerAddress);\n _ownerAddress = newOwnerAddress;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "/// @notice Adds a new address that is allowed to stake fighters on behalf of users.\n /// @dev Only the owner address is authorized to call this function.\n /// @param newStaker The address of the new staker\n function addStaker(address newStaker) external {\n require(msg.sender == _ownerAddress);\n hasStakerRole[newStaker] = true;\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "04-caviar", "title": "matrix_0wl G", "severity_raw": "High", "severity": "high", "description": "## Gas Optimizations\n\n| | Issue |\n| ------ | :-------------------------------------------------------------------------------------------------------------------------------------------------- |\n| GAS-1 | USE `SELFBALANCE()` INSTEAD OF `ADDRESS(THIS).BALANCE` |\n| GAS-2 | ` += `/` -= ` COSTS MORE GAS THAN ` = + `/` = - ` FOR STATE VARIABLES |\n| GAS-3 | `ABI.ENCODE()` IS LESS EFFICIENT THAN `ABI.ENCODEPACKED()` |\n| GAS-4 | BEFORE SOME FUNCTIONS, WE SHOULD CHECK SOME VARIABLES FOR POSSIBLE GAS SAVE |\n| GAS-5 | SETTING THE CONSTRUCTOR TO PAYABLE |\n| GAS-6 | DIV BY 0 |\n| GAS-7 | DOS WITH BLOCK GAS LIMIT |\n| GAS-8 | USE FUNCTION INSTEAD OF MODIFIERS |\n| GAS-9 | INSTEAD OF CALCULATING A STATEVAR WITH KECCAK256() EVERY TIME THE CONTRACT IS MADE PRE CALCULATE THEM BEFORE AND ONLY GIVE THE RESULT TO A CONSTANT |\n| GAS-10 | CONSTANT VALUES SUCH AS A CALL TO KECCAK256(), SHOULD USE IMMUTABLE RATHER THAN CONSTANT |\n| GAS-11 | KECCAK256() SHOULD ONLY NEED TO BE ", "vulnerable_code": "File: src/EthRouter.sol\n\n141: if (address(this).balance > 0) {\n\n142: msg.sender.safeTransferETH(address(this).balance);\n\n203: if (address(this).balance < minOutputAmount) {\n\n208: msg.sender.safeTransferETH(address(this).balance);\n\n290: if (address(this).balance > 0) {\n\n291: msg.sender.safeTransferETH(address(this).balance);\n", "fixed_code": "File: src/PrivatePool.sol\n\n230: virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n\n231: virtualNftReserves -= uint128(weightSum);\n\n247: royaltyFeeAmount += royaltyFee;\n\n252: netInputAmount += royaltyFeeAmount;\n\n323: virtualBaseTokenReserves -= uint128(netOutputAmount + protocolFeeAmount + feeAmount);\n\n324: virtualNftReserves += uint128(weightSum);\n\n341: royaltyFeeAmount += royaltyFee;\n\n355: netOutputAmount -= royaltyFeeAmount;\n\n678: sum += tokenWeights[i];\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/matrix_0wl-G.md", "collected_at": "2026-01-02T18:20:41.121073+00:00", "source_hash": "88bf20273d6b8a7fcaba825d1329adac9d04420186802e4249a904e5425b5151", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: src/EthRouter.sol\n\n141: if (address(this).balance > 0) {\n\n142: msg.sender.safeTransferETH(address(this).balance);\n\n203: if (address(this).balance < minOutputAmount) {\n\n208: msg.sender.safeTransferETH(address(this).balance);\n\n290: if (address(this).balance > 0) {\n\n291: msg.sender.safeTransferETH(address(this).balance);\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: src/PrivatePool.sol\n\n230: virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n\n231: virtualNftReserves -= uint128(weightSum);\n\n247: royaltyFeeAmount += royaltyFee;\n\n252: netInputAmount += royaltyFeeAmount;\n\n323: virtualBaseTokenReserves -= uint128(netOutputAmount + protocolFeeAmount + feeAmount);\n\n324: virtualNftReserves += uint128(weightSum);\n\n341: royaltyFeeAmount += royaltyFee;\n\n355: netOutputAmount -= royaltyFeeAmount;\n\n678: sum += tokenWeights[i];\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "10-badger", "title": "Daniel526 Q", "severity_raw": "Low", "severity": "low", "description": "## A. Possible underflow when decreasing system Debt:\n[Link](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/ActivePool.sol#L207-L214)\nIf `_amount` is greater than `systemDebt` and not properly handled elsewhere in the code, it could lead to an underflow. Underflows can potentially be exploited to manipulate balances and disrupt the functioning of the contract.\n## Impact:\nIncorrect accounting of system debt could distort the protocol's financial health and risk assessments. It may provide an inaccurate representation of the protocol's ability to manage and cover its debt, potentially leading to suboptimal decisions by protocol users or administrators.\n## Mitigation:\n```solidity\nfunction decreaseSystemDebt(uint256 _amount) external override {\n _requireCallerIsBOorCdpM();\n\n require(_amount <= systemDebt, \"ActivePool: Amount exceeds systemDebt\");\n\n uint256 cachedSystemDebt = systemDebt - _amount;\n\n systemDebt = cachedSystemDebt;\n emit ActivePoolEBTCDebtUpdated(cachedSystemDebt);\n}\n```\n## B. Unverified Collateral Token Transfer in 'flashLoan' Function\n[Link](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/ActivePool.sol#L261-L310)\nThe `flashLoan` function allows borrowers to borrow stETH tokens through a flash loan. In this function, `collateral` tokens are transferred to the `receiver` address using the `collateral.transfer(address(receiver), amount);` statement. However, the code does not verify whether the transfer was successful. If the transfer fails for any reason, such as an out-of-gas condition or insufficient token balance, the contract will proceed with the remaining operations, potentially leading to unexpected behavior or loss of funds.\n## Impact:\n If the collateral token transfer to the `receiver` address fails, it may result in the loss of funds for the flash loan borrower. This can lead to unexpecte", "vulnerable_code": "function decreaseSystemDebt(uint256 _amount) external override {\n _requireCallerIsBOorCdpM();\n\n require(_amount <= systemDebt, \"ActivePool: Amount exceeds systemDebt\");\n\n uint256 cachedSystemDebt = systemDebt - _amount;\n\n systemDebt = cachedSystemDebt;\n emit ActivePoolEBTCDebtUpdated(cachedSystemDebt);\n}", "fixed_code": "// ...\n// Use a require statement to check the success of the transfer\nrequire(collateral.transfer(address(receiver), amount), \"ActivePool: Transfer failed\");\n// ...\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/Daniel526-Q.md", "collected_at": "2026-01-02T18:26:30.855005+00:00", "source_hash": "88c2d750ae211ebec1c0f0f96b732217ef9e9044bd16a68c0af9f4eb101511f1", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 320, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function decreaseSystemDebt(uint256 _amount) external override {\n _requireCallerIsBOorCdpM();\n\n require(_amount <= systemDebt, \"ActivePool: Amount exceeds systemDebt\");\n\n uint256 cachedSystemDebt = systemDebt - _amount;\n\n systemDebt = cachedSystemDebt;\n emit ActivePoolEBTCDebtUpdated(cachedSystemDebt);\n}", "primary_code_language": "solidity", "primary_code_char_count": 320, "all_code_blocks": "// Code block 1 (solidity):\nfunction decreaseSystemDebt(uint256 _amount) external override {\n _requireCallerIsBOorCdpM();\n\n require(_amount <= systemDebt, \"ActivePool: Amount exceeds systemDebt\");\n\n uint256 cachedSystemDebt = systemDebt - _amount;\n\n systemDebt = cachedSystemDebt;\n emit ActivePoolEBTCDebtUpdated(cachedSystemDebt);\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function decreaseSystemDebt(uint256 _amount) external override {\n _requireCallerIsBOorCdpM();\n\n require(_amount <= systemDebt, \"ActivePool: Amount exceeds systemDebt\");\n\n uint256 cachedSystemDebt = systemDebt - _amount;\n\n systemDebt = cachedSystemDebt;\n emit ActivePoolEBTCDebtUpdated(cachedSystemDebt);\n}", "github_refs_formatted": "ActivePool.sol#L207-L214, ActivePool.sol#L261-L310", "github_files_list": "ActivePool.sol", "github_refs_count": 2, "vulnerable_code_actual": "function decreaseSystemDebt(uint256 _amount) external override {\n _requireCallerIsBOorCdpM();\n\n require(_amount <= systemDebt, \"ActivePool: Amount exceeds systemDebt\");\n\n uint256 cachedSystemDebt = systemDebt - _amount;\n\n systemDebt = cachedSystemDebt;\n emit ActivePoolEBTCDebtUpdated(cachedSystemDebt);\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "// ...\n// Use a require statement to check the success of the transfer\nrequire(collateral.transfer(address(receiver), amount), \"ActivePool: Transfer failed\");\n// ...\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "06-lybra", "title": "3agle Q", "severity_raw": "Critical", "severity": "critical", "description": "### Issues Template\n\n|Letter |Name|Description|\n|--|-------|-------|\n| NC | Non-critical | Non risky findings |\n| R | Refactor | Changing the code |\n\n| Total Found Issues | 4 |\n|:--:|:--:|\n\n### Non-Critical Template\n\n| Count | Explanation | Instances |\n|:--:|:-------|:--:|\n| [L-01] | Missing checks | 2 |\n\n### Refactor Template\n\n| Count | Explanation | Instances |\n|:--:|:-------|:--:|\n| [R-01] | Documentation Mismatch | 1 |\n| [R-02] | Misleading comments | 2 |\n\n\n### [L-01] Missing checks\n- According to the comment, the `amount` should be higher than 0. But there is no check to ensure this\n- https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/base/LybraEUSDVaultBase.sol#L137\n```solidity\n /**\n * @notice Burn the amount of EUSD and payback the amount of minted EUSD\n * Emits a `Burn` event.\n * Requirements:\n * - `onBehalfOf` cannot be the zero address.\n * - `amount` Must be higher than 0.\n * @dev Calling the internal`_repay`function.\n */\n function burn(address onBehalfOf, uint256 amount) external {\n require(onBehalfOf != address(0), \"BURN_TO_THE_ZERO_ADDRESS\");\n require(amount>0,\"ZERO_AMOUNT\"); //Add this check\n _repay(msg.sender, onBehalfOf, amount);\n }\n```\n- In `LybraEUSDVaultBase.sol`, the check to ensure that \"individual mint amount shouldn't surpass 10% when the circulation reaches 10_000_000\" is missing.\n- https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/base/LybraEUSDVaultBase.sol#L118-L130\n```solidity\n\n /**\n * @notice The mint amount number of EUSD is minted to the address\n * Emits a `Mint` event.\n *\n * Requirements:\n * - `onBehalfOf` cannot be the zero address.\n * - `amount` Must be higher than 0. Individual mint amount shouldn't surpass 10% when the circulation reaches 10_000_000\n */\n \n function mint(address onBehalfOf, uint256 amount) external {\n require(onBehalfOf != address(0), \"MINT_TO_THE_ZERO_ADDRESS\")", "vulnerable_code": " /**\n * @notice Burn the amount of EUSD and payback the amount of minted EUSD\n * Emits a `Burn` event.\n * Requirements:\n * - `onBehalfOf` cannot be the zero address.\n * - `amount` Must be higher than 0.\n * @dev Calling the internal`_repay`function.\n */\n function burn(address onBehalfOf, uint256 amount) external {\n require(onBehalfOf != address(0), \"BURN_TO_THE_ZERO_ADDRESS\");\n require(amount>0,\"ZERO_AMOUNT\"); //Add this check\n _repay(msg.sender, onBehalfOf, amount);\n }", "fixed_code": " /**\n * @notice The mint amount number of EUSD is minted to the address\n * Emits a `Mint` event.\n *\n * Requirements:\n * - `onBehalfOf` cannot be the zero address.\n * - `amount` Must be higher than 0. Individual mint amount shouldn't surpass 10% when the circulation reaches 10_000_000\n */\n \n function mint(address onBehalfOf, uint256 amount) external {\n require(onBehalfOf != address(0), \"MINT_TO_THE_ZERO_ADDRESS\");\n require(amount > 0, \"ZERO_MINT\");\n _mintEUSD(msg.sender, onBehalfOf, amount, getAssetPrice());\n }", "recommendation": "", "category": "dos", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/3agle-Q.md", "collected_at": "2026-01-02T18:22:07.430886+00:00", "source_hash": "892e10030f53424d09d56d031d7b10ee309ec65c02cb1c02e1b9e938f71d405c", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 527, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "/**\n * @notice Burn the amount of EUSD and payback the amount of minted EUSD\n * Emits a `Burn` event.\n * Requirements:\n * - `onBehalfOf` cannot be the zero address.\n * - `amount` Must be higher than 0.\n * @dev Calling the internal`_repay`function.\n */\n function burn(address onBehalfOf, uint256 amount) external {\n require(onBehalfOf != address(0), \"BURN_TO_THE_ZERO_ADDRESS\");\n require(amount>0,\"ZERO_AMOUNT\"); //Add this check\n _repay(msg.sender, onBehalfOf, amount);\n }", "primary_code_language": "solidity", "primary_code_char_count": 527, "all_code_blocks": "// Code block 1 (solidity):\n/**\n * @notice Burn the amount of EUSD and payback the amount of minted EUSD\n * Emits a `Burn` event.\n * Requirements:\n * - `onBehalfOf` cannot be the zero address.\n * - `amount` Must be higher than 0.\n * @dev Calling the internal`_repay`function.\n */\n function burn(address onBehalfOf, uint256 amount) external {\n require(onBehalfOf != address(0), \"BURN_TO_THE_ZERO_ADDRESS\");\n require(amount>0,\"ZERO_AMOUNT\"); //Add this check\n _repay(msg.sender, onBehalfOf, amount);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "/**\n * @notice Burn the amount of EUSD and payback the amount of minted EUSD\n * Emits a `Burn` event.\n * Requirements:\n * - `onBehalfOf` cannot be the zero address.\n * - `amount` Must be higher than 0.\n * @dev Calling the internal`_repay`function.\n */\n function burn(address onBehalfOf, uint256 amount) external {\n require(onBehalfOf != address(0), \"BURN_TO_THE_ZERO_ADDRESS\");\n require(amount>0,\"ZERO_AMOUNT\"); //Add this check\n _repay(msg.sender, onBehalfOf, amount);\n }", "github_refs_formatted": "LybraEUSDVaultBase.sol#L137, LybraEUSDVaultBase.sol#L118-L130", "github_files_list": "LybraEUSDVaultBase.sol", "github_refs_count": 2, "vulnerable_code_actual": " /**\n * @notice Burn the amount of EUSD and payback the amount of minted EUSD\n * Emits a `Burn` event.\n * Requirements:\n * - `onBehalfOf` cannot be the zero address.\n * - `amount` Must be higher than 0.\n * @dev Calling the internal`_repay`function.\n */\n function burn(address onBehalfOf, uint256 amount) external {\n require(onBehalfOf != address(0), \"BURN_TO_THE_ZERO_ADDRESS\");\n require(amount>0,\"ZERO_AMOUNT\"); //Add this check\n _repay(msg.sender, onBehalfOf, amount);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " /**\n * @notice The mint amount number of EUSD is minted to the address\n * Emits a `Mint` event.\n *\n * Requirements:\n * - `onBehalfOf` cannot be the zero address.\n * - `amount` Must be higher than 0. Individual mint amount shouldn't surpass 10% when the circulation reaches 10_000_000\n */\n \n function mint(address onBehalfOf, uint256 amount) external {\n require(onBehalfOf != address(0), \"MINT_TO_THE_ZERO_ADDRESS\");\n require(amount > 0, \"ZERO_MINT\");\n _mintEUSD(msg.sender, onBehalfOf, amount, getAssetPrice());\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ethos", "title": "p0wd3r Q", "severity_raw": "Unknown", "severity": "unknown", "description": "# The liquidateTroves function in TroveManager does not verify if the Trove is active.\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L513\n\n\nCompared to the `liquidate` function, the `liquidateTroves` function is also an external function and does not check if the Trove is active, which could lead to unexpected issues.\n\n```\nfunction liquidate(address _borrower, address _collateral) external override {\n _requireTroveIsActive(_borrower, _collateral);\n ...\n}\n```\n\n# Add checkContract for RedemptionHelper\n\nUse `checkContract` to verify the correctness of the `setAddresses` function in RedemptionHelper, just like other contracts such as ActivePool.\n\n\n", "vulnerable_code": "function liquidate(address _borrower, address _collateral) external override {\n _requireTroveIsActive(_borrower, _collateral);\n ...\n}", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/p0wd3r-Q.md", "collected_at": "2026-01-02T18:17:27.553424+00:00", "source_hash": "89c198cf11c141ce5b41959211bfbca79b0c58a5ea828ddbb6cb3e4294fb1bc2", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 147, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function liquidate(address _borrower, address _collateral) external override {\n _requireTroveIsActive(_borrower, _collateral);\n ...\n}", "primary_code_language": "unknown", "primary_code_char_count": 147, "all_code_blocks": "// Code block 1 (unknown):\nfunction liquidate(address _borrower, address _collateral) external override {\n _requireTroveIsActive(_borrower, _collateral);\n ...\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "TroveManager.sol#L513", "github_files_list": "TroveManager.sol", "github_refs_count": 1, "vulnerable_code_actual": "function liquidate(address _borrower, address _collateral) external override {\n _requireTroveIsActive(_borrower, _collateral);\n ...\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.43} {"source": "c4", "protocol": "07-amphora", "title": "Bauchibred Q", "severity_raw": "High", "severity": "high", "description": "# Amphora Protocol QA Report\n\n## **Table of Contents**\n\n| Identifier | Issue |\n| ---------- | ---------------------------------------------------------------------------------- |\n| QA-01 | Prevent underflows in the recovery of stranded tokens |\n| QA-02 | The `if (_answer <= 0)` check for chainlink return is no longer needed |\n| QA-03 | A different oracle should be used to price stETH |\n| QA-04 | Unnecessary dual type casting adds to code complexity |\n| QA-05 | WUSDA.sol: `mintFor()` should not be allowed to mint to the zero address |\n| QA-06 | Unnecessary calculation due to lack of check for decimal precision |\n| QA-07 | `_migrateCollateralsFrom()` could be made more effective |\n| QA-08 | `TriCrypto2Oracle::_get()` should be made more similar to its Vyper implementation |\n| QA-09 | Unsafe typecasts |\n| QA-10 | Functions including boundaries should implement sanity checks |\n| QA-11 | No protection against division/multiplication by zero |\n| QA-12 | Fix typos |\n| QA-13 | Underflow in `withdraw()` and `withdrawTo()` not protected against |\n| QA-14 | More measures should be taken to take care of any stranded tokens in the contract |\n| QA-15 | Lack of consistency in `_mint()` and `_burn()` functions |\n\n## QA-01 - Prevent underflows in the recovery of stranded tokens\n\n### Vulnerability Details\n\nThe current implementation of the contract includes a function, `recoverDust`, which is designed to manage the risk of tokens accidentally being sent ", "vulnerable_code": "function recoverDust(address _to) external onlyOwner {\n uint256 _amount = sUSD.balanceOf(address(this)) - reserveAmount;\n require(sUSD.transfer(_to, _amount), \"Transfer failed\");\n}", "fixed_code": "function recoverDust(address _to) external onlyOwner {\n uint256 balance = sUSD.balanceOf(address(this));\n require(balance > reserveAmount, \"Insufficient balance to recover dust\");\n uint256 _amount = balance - reserveAmount;\n require(sUSD.transfer(_to, _amount), \"Transfer failed\");\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/Bauchibred-Q.md", "collected_at": "2026-01-02T18:23:23.731855+00:00", "source_hash": "89c5dfdf9e7334bb3f61d2b901b8b8bfcb35905b283d8a42e3e7b13be83ca10c", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function recoverDust(address _to) external onlyOwner {\n uint256 _amount = sUSD.balanceOf(address(this)) - reserveAmount;\n require(sUSD.transfer(_to, _amount), \"Transfer failed\");\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function recoverDust(address _to) external onlyOwner {\n uint256 balance = sUSD.balanceOf(address(this));\n require(balance > reserveAmount, \"Insufficient balance to recover dust\");\n uint256 _amount = balance - reserveAmount;\n require(sUSD.transfer(_to, _amount), \"Transfer failed\");\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "07-amphora", "title": "Raihan G", "severity_raw": "High", "severity": "high", "description": "# Gas Optamization\n ## Note: The last 5 types were not found completely by the bots {30,31,32,33,34,35}\n I found that it was missed by the bots\n# SUMMRY\n| | ISSUE | INSTANCE |\n|------|--------------|-------------|\n|[G-01]| Can Make The Variable Outside The Loop To Save Gas |13|\n|[G-02]| Use do while loops instead of for loops|1|\n|[G-03]| Use assembly to write address storage values|9|\n|[G-04]| Use nested if statements instead of &&|7|\n|[G-05]| Make 3 event parameters indexed when possible|30|\n|[G-06]| Use assembly to perform efficient back-to-back calls|2|\n|[G-07]| public\u00a0functions to\u00a0external|9|\n|[G-08]| Expressions for constant values such as a call to\u00a0keccak256(), should use immutable rather than constant|5|\n|[G-09]| internal functions not called by the contract should be removed to save deployment gas|3|\n|[G-10]| Amounts should be checked for\u00a00\u00a0before calling a transfer|7|\n|[G-11]| Do not calculate constants|8|\n|[G-12]| State variables can be packed to use fewer storage slots|1|\n|[G-13]| Gas savings can be achieved by changing the model for assigning value to the structure |1|\n|[G-14]| Use\u00a0!= 0\u00a0instead of\u00a0> 0\u00a0for unsigned integer comparison|8|\n|[G-15]| Use hardcode address instead address(this)|8|\n|[G-16]| use Mappings Instead of Arrays|2|\n|[G-17]| Duplicated require()/if() checks should be refactored to a modifier or function|5|\n|[G-18]| Not using the named return variables when a function returns, wastes deployment gas|6|\n|[G-19]| Unnecessary computation|14|\n|[G-20]| keccak256() should only need to be called on a specific string literal once|4|\n|[G-21]| array[index] += amount is cheaper than array[index] = array[index] + amount (or related variants)|7|\n|[G-22]| Avoid emitting storage values|16|\n|[G-23]| Use uint256(1)/uint256(2) instead for true and false boolean states|6|\n|[G-24]| Using XOR (^) and OR (|) bitwise equivalents|8|\n|[G-25]| When possible, use assembly instead of unchecked{++i}|10|\n|[G-26]| Use assembly for math (add, sub, mul, ", "vulnerable_code": "contract MyContract {\n function sum(uint256[] memory values) public pure returns (uint256) {\n uint256 total = 0;\n \n for (uint256 i = 0; i < values.length; i++) {\n total += values[i];\n }\n \n return total;\n }\n}", "fixed_code": "File: core/solidity/contracts/core/Vault.sol\n177 uint256 _crvReward = _rewardsContract.earned(address(this));\n\n187 uint256 _extraRewards = _rewardsContract.extraRewardsLength();\n\n209 (uint256 _takenCVX, uint256 _takenCRV, uint256 _claimableAmph) =\n _amphClaimer.claimable(address(this), this.id(), _totalCvxReward, _totalCrvReward);\n\n257 uint256 _earnedReward = _virtualReward.earned(address(this)); ", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/Raihan-G.md", "collected_at": "2026-01-02T18:23:30.916689+00:00", "source_hash": "89ce191a11abb63ff8aedee6fd7b030355bcacb1a9486e53591a39301dc9892a", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "contract MyContract {\n function sum(uint256[] memory values) public pure returns (uint256) {\n uint256 total = 0;\n \n for (uint256 i = 0; i < values.length; i++) {\n total += values[i];\n }\n \n return total;\n }\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: core/solidity/contracts/core/Vault.sol\n177 uint256 _crvReward = _rewardsContract.earned(address(this));\n\n187 uint256 _extraRewards = _rewardsContract.extraRewardsLength();\n\n209 (uint256 _takenCVX, uint256 _takenCRV, uint256 _claimableAmph) =\n _amphClaimer.claimable(address(this), this.id(), _totalCvxReward, _totalCrvReward);\n\n257 uint256 _earnedReward = _virtualReward.earned(address(this)); ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "10-badger", "title": "bdmcbri Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA Report\n\n## Low Findings\n### L01 - Loop conditions in `_descendList` and `_ascendList` contain incorrect termination condition\nThe first loop condition when [ascending](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/SortedCdps.sol#L642) and [descending](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/SortedCdps.sol#L619) the sorted cdp list is unnecessary or incorrect, but it is unclear that it causes any problems\n\nI believe this is the correct logic:\n\n```diff\ndiff --git a/packages/contracts/contracts/SortedCdps.sol b/packages/contracts/contracts/SortedCdps.sol\nindex 0fd34e7..f37cdc4 100644\n--- a/packages/contracts/contracts/SortedCdps.sol\n+++ b/packages/contracts/contracts/SortedCdps.sol\n@@ -626,7 +626,7 @@ contract SortedCdps is ISortedCdps {\n bytes32 nextId = data.nodes[prevId].nextId;\n\n // Descend the list until we reach the end or until we find a valid insert position\n- while (prevId != dummyId && !_validInsertPosition(_NICR, prevId, nextId)) {\n+ while (nextId != dummyId && !_validInsertPosition(_NICR, prevId, nextId)) {\n prevId = data.nodes[prevId].nextId;\n nextId = data.nodes[prevId].nextId;\n }\n@@ -649,7 +649,7 @@ contract SortedCdps is ISortedCdps {\n bytes32 prevId = data.nodes[nextId].prevId;\n\n // Ascend the list until we reach the end or until we find a valid insertion point\n- while (nextId != dummyId && !_validInsertPosition(_NICR, prevId, nextId)) {\n+ while (prevId != dummyId && !_validInsertPosition(_NICR, prevId, nextId)) {\n nextId = data.nodes[nextId].prevId;\n prevId = data.nodes[nextId].prevId;\n }\n```\n\nHowever, removing the first condition also is perfectly valid as the necessary logic for loop termination is redundantly captured in `_validInsertPosition`. The following logic also ", "vulnerable_code": "However, removing the first condition also is perfectly valid as the necessary logic for loop termination is redundantly captured in `_validInsertPosition`. The following logic also works:\n", "fixed_code": "If this is not correct, the test cases do not reflect the need for this condition, as all three instances pass the tests.\n## Non-Critical Findings\n\n### NC01 - Unnecessary containment check for EnumerableSet\n\nIn `RolesAuthority.sol` there are a couple checks to see if an EnumerableSet contains an item before adding it to the set. This is unnecessary as `add` in EnumerableSet will also check for containment.\n\n[L116](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/Dependencies/RolesAuthority.sol#L116) in `setRoleCapability`:", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/bdmcbri-Q.md", "collected_at": "2026-01-02T18:26:43.269995+00:00", "source_hash": "89da2380963ddead8a5b00bb1d21352cc6980e0b1d5bc7cef877cd9c96a3da3c", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 1197, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "diff --git a/packages/contracts/contracts/SortedCdps.sol b/packages/contracts/contracts/SortedCdps.sol\nindex 0fd34e7..f37cdc4 100644\n--- a/packages/contracts/contracts/SortedCdps.sol\n+++ b/packages/contracts/contracts/SortedCdps.sol\n@@ -626,7 +626,7 @@ contract SortedCdps is ISortedCdps {\n bytes32 nextId = data.nodes[prevId].nextId;\n\n // Descend the list until we reach the end or until we find a valid insert position\n- while (prevId != dummyId && !_validInsertPosition(_NICR, prevId, nextId)) {\n+ while (nextId != dummyId && !_validInsertPosition(_NICR, prevId, nextId)) {\n prevId = data.nodes[prevId].nextId;\n nextId = data.nodes[prevId].nextId;\n }\n@@ -649,7 +649,7 @@ contract SortedCdps is ISortedCdps {\n bytes32 prevId = data.nodes[nextId].prevId;\n\n // Ascend the list until we reach the end or until we find a valid insertion point\n- while (nextId != dummyId && !_validInsertPosition(_NICR, prevId, nextId)) {\n+ while (prevId != dummyId && !_validInsertPosition(_NICR, prevId, nextId)) {\n nextId = data.nodes[nextId].prevId;\n prevId = data.nodes[nextId].prevId;\n }", "primary_code_language": "diff", "primary_code_char_count": 1197, "all_code_blocks": "// Code block 1 (diff):\ndiff --git a/packages/contracts/contracts/SortedCdps.sol b/packages/contracts/contracts/SortedCdps.sol\nindex 0fd34e7..f37cdc4 100644\n--- a/packages/contracts/contracts/SortedCdps.sol\n+++ b/packages/contracts/contracts/SortedCdps.sol\n@@ -626,7 +626,7 @@ contract SortedCdps is ISortedCdps {\n bytes32 nextId = data.nodes[prevId].nextId;\n\n // Descend the list until we reach the end or until we find a valid insert position\n- while (prevId != dummyId && !_validInsertPosition(_NICR, prevId, nextId)) {\n+ while (nextId != dummyId && !_validInsertPosition(_NICR, prevId, nextId)) {\n prevId = data.nodes[prevId].nextId;\n nextId = data.nodes[prevId].nextId;\n }\n@@ -649,7 +649,7 @@ contract SortedCdps is ISortedCdps {\n bytes32 prevId = data.nodes[nextId].prevId;\n\n // Ascend the list until we reach the end or until we find a valid insertion point\n- while (nextId != dummyId && !_validInsertPosition(_NICR, prevId, nextId)) {\n+ while (prevId != dummyId && !_validInsertPosition(_NICR, prevId, nextId)) {\n nextId = data.nodes[nextId].prevId;\n prevId = data.nodes[nextId].prevId;\n }", "all_code_blocks_count": 1, "has_diff_blocks": true, "diff_code": "diff --git a/packages/contracts/contracts/SortedCdps.sol b/packages/contracts/contracts/SortedCdps.sol\nindex 0fd34e7..f37cdc4 100644\n--- a/packages/contracts/contracts/SortedCdps.sol\n+++ b/packages/contracts/contracts/SortedCdps.sol\n@@ -626,7 +626,7 @@ contract SortedCdps is ISortedCdps {\n bytes32 nextId = data.nodes[prevId].nextId;\n\n // Descend the list until we reach the end or until we find a valid insert position\n- while (prevId != dummyId && !_validInsertPosition(_NICR, prevId, nextId)) {\n+ while (nextId != dummyId && !_validInsertPosition(_NICR, prevId, nextId)) {\n prevId = data.nodes[prevId].nextId;\n nextId = data.nodes[prevId].nextId;\n }\n@@ -649,7 +649,7 @@ contract SortedCdps is ISortedCdps {\n bytes32 prevId = data.nodes[nextId].prevId;\n\n // Ascend the list until we reach the end or until we find a valid insertion point\n- while (nextId != dummyId && !_validInsertPosition(_NICR, prevId, nextId)) {\n+ while (prevId != dummyId && !_validInsertPosition(_NICR, prevId, nextId)) {\n nextId = data.nodes[nextId].prevId;\n prevId = data.nodes[nextId].prevId;\n }", "solidity_code": "", "github_refs_formatted": "SortedCdps.sol#L642, SortedCdps.sol#L619, RolesAuthority.sol#L116", "github_files_list": "SortedCdps.sol, RolesAuthority.sol", "github_refs_count": 3, "vulnerable_code_actual": "However, removing the first condition also is perfectly valid as the necessary logic for loop termination is redundantly captured in `_validInsertPosition`. The following logic also works:\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "If this is not correct, the test cases do not reflect the need for this condition, as all three instances pass the tests.\n## Non-Critical Findings\n\n### NC01 - Unnecessary containment check for EnumerableSet\n\nIn `RolesAuthority.sol` there are a couple checks to see if an EnumerableSet contains an item before adding it to the set. This is unnecessary as `add` in EnumerableSet will also check for containment.\n\n[L116](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/Dependencies/RolesAuthority.sol#L116) in `setRoleCapability`:", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "01-biconomy", "title": "ro Q", "severity_raw": "High", "severity": "high", "description": "1. The entry point address must be a contract, currently, there is no input validation. You can provide an EOA as the entry point. \n\nInstances: \n\n- https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L173\n- https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L173\n\n\nRecommendation: \nCheck that the entry point has code. \n\n\n2. Update the EIP1271 implementation.\n\n Notice: The current EIP1271 is forked from gnosis safe. But the implementation is not eip1271 compliant, because gnosis safe implemented it \n prior to the eip completeness. \n There are a few changes to be made: \n 1: Update the magic value. The current magic value is: \n\n ``` solidity\n bytes4 internal constant EIP1271_MAGIC_VALUE = 0x20c13b0b;\n ``` \n But the compliant magic value for the eip is: 0x1626ba7e\n\n 2: Update the \"isValidSignature\" parameters. \n In the validation signature, the interface for isValidSignature is: \n\n \n function isValidSignature(bytes memory _data, bytes memory _signature) public view virtual returns (bytes4);\n \n But the correct compliant interface is: \n\n function isValidSignature(\n bytes32 _hash, \n bytes memory _signature)\n public\n view \n returns (bytes4 magicValue);\n\n\n3. Incorrect \"validateUserOp\" implementation. \n If an invalid signature is provided in \"validateUserOp\", we should return an invalid message instead of reverting.\n As stated from the eip: \"SHOULD return SIG_VALIDATION_FAILED (and not revert) on signature mismatch.\"\n\n The current implementation just reverts if the signatures don't belong to the owner: \n https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L506\n\n ```solidity\n require(owner == hash.recover(userOp.signature) || tx.origin == address(0), \"account: wrong signature\");\n```\n Recommenda", "vulnerable_code": " But the compliant magic value for the eip is: 0x1626ba7e\n\n 2: Update the \"isValidSignature\" parameters. \n In the validation signature, the interface for isValidSignature is: \n\n \n function isValidSignature(bytes memory _data, bytes memory _signature) public view virtual returns (bytes4);\n \n But the correct compliant interface is: \n\n function isValidSignature(\n bytes32 _hash, \n bytes memory _signature)\n public\n view \n returns (bytes4 magicValue);\n\n\n3. Incorrect \"validateUserOp\" implementation. \n If an invalid signature is provided in \"validateUserOp\", we should return an invalid message instead of reverting.\n As stated from the eip: \"SHOULD return SIG_VALIDATION_FAILED (and not revert) on signature mismatch.\"\n\n The current implementation just reverts if the signatures don't belong to the owner: \n https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L506\n\n ```solidity\n require(owner == hash.recover(userOp.signature) || tx.origin == address(0), \"account: wrong signature\");", "fixed_code": " function _validateSignature(UserOperation calldata userOp, bytes32 userOpHash, address)\n internal override virtual returns (uint256 sigTimeRange) {\n bytes32 hash = userOpHash.toEthSignedMessageHash();\n if (owner != hash.recover(userOp.signature))\n return SIG_VALIDATION_FAILED;\n return 0;\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/ro-Q.md", "collected_at": "2026-01-02T18:14:05.634877+00:00", "source_hash": "89f977c40b5285af41fe80629c72e6105de3e2da5adf4e72d02925e43714a39a", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 104, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "require(owner == hash.recover(userOp.signature) || tx.origin == address(0), \"account: wrong signature\");", "primary_code_language": "solidity", "primary_code_char_count": 104, "all_code_blocks": "// Code block 1 (solidity):\nrequire(owner == hash.recover(userOp.signature) || tx.origin == address(0), \"account: wrong signature\");", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "require(owner == hash.recover(userOp.signature) || tx.origin == address(0), \"account: wrong signature\");", "github_refs_formatted": "SmartAccount.sol#L173, SmartAccount.sol#L506", "github_files_list": "SmartAccount.sol", "github_refs_count": 2, "vulnerable_code_actual": " But the compliant magic value for the eip is: 0x1626ba7e\n\n 2: Update the \"isValidSignature\" parameters. \n In the validation signature, the interface for isValidSignature is: \n\n \n function isValidSignature(bytes memory _data, bytes memory _signature) public view virtual returns (bytes4);\n \n But the correct compliant interface is: \n\n function isValidSignature(\n bytes32 _hash, \n bytes memory _signature)\n public\n view \n returns (bytes4 magicValue);\n\n\n3. Incorrect \"validateUserOp\" implementation. \n If an invalid signature is provided in \"validateUserOp\", we should return an invalid message instead of reverting.\n As stated from the eip: \"SHOULD return SIG_VALIDATION_FAILED (and not revert) on signature mismatch.\"\n\n The current implementation just reverts if the signatures don't belong to the owner: \n https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L506\n\n ```solidity\n require(owner == hash.recover(userOp.signature) || tx.origin == address(0), \"account: wrong signature\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function _validateSignature(UserOperation calldata userOp, bytes32 userOpHash, address)\n internal override virtual returns (uint256 sigTimeRange) {\n bytes32 hash = userOpHash.toEthSignedMessageHash();\n if (owner != hash.recover(userOp.signature))\n return SIG_VALIDATION_FAILED;\n return 0;\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-asymmetry", "title": "RaymondFam Q", "severity_raw": "Critical", "severity": "critical", "description": "## Timelock for `adjustWeight()` and `addDerivative()`\nChanges made via `adjustWeight()` and `addDerivative()` are sensitive transactions that may go against users` original portfolio plan with Asymmetry Finance. As such, users of the system should have assurances about the behavior of the changed action(s) they\u2019re about to take.\n\nHere are two typical secnarios that could transpire:\n- A user decides to stake 100 ETH after seeing a placing of weights to his desire the system has on the the three derivatives, i.e. Reth, SfrxEth and WstEth. His call happens to be inadvertently front run by [`adjustWeight()`](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L165-L175) or [`addDerivative()`](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L182-L195) with his ETH now diversified to a different portfolio of staked derivatives.\n- The same situation could also happen later, if not front run. \n\nConsider implementing a time lock by making the weight and derivative parameter changes require two steps with a mandatory time window between them. The first step merely broadcasts to users that a particular change is coming, and the second step commits that change after a suitable waiting period. This allows users that do not accept the change to withdraw their positions in time.\n\n## Zero address check\nZero address check for `_contractAddress` should be implemented in `addDerivative()`. It is more crucial than having a zero value check for `_weight` because the former, if there is any any error committed, can never be undone or deleted since we are dealing here with a mapping that has no function implemented to update or make changes to it. If this were to happen, `stake()` would have to forever be dealing with this obsolete mapping variable in its for loops. \n\n## Modularity on import usages\nFor cleaner Solidity code in conjunction with the rule of modularity and modular programming, use named imports with", "vulnerable_code": "## Parameterized address variables\nAddresses should be parameterized and initialized instead of being declared as constants.\n\nHere are the contract instances entailed:\n\n[File: Reth.sol#L20-L27](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L20-L27)\n[File: SfrxEth.sol#L15-L21](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol#L15-L21)\n[File: WstEth.sol#L13-L18](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol#L13-L18)\n\n## Unspecific compiler version pragma\nFor some source-units the compiler version pragma is very unspecific, i.e. ^0.8.13. While this often makes sense for libraries to allow them to be included with multiple different versions of an application, it may be a security risk for the actual application implementation itself. A known vulnerable compiler version may accidentally be selected or security tools might fall-back to an older compiler version ending up actually checking a different EVM compilation that is ultimately deployed on the blockchain.\n\nAvoid floating pragmas where possible. It is highly recommend pinning a concrete compiler version (latest without security issues) in at least the top-level \u201cdeployed\u201d contracts to make it unambiguous which compiler version is being used. Rule of thumb: a flattened source-unit should have at least one non-floating concrete solidity compiler version pragma.\n\n## Use a more recent version of solidity\nThe protocol adopts version 0.8.13 on writing contracts. For better security, it is best practice to use the latest Solidity version, 0.8.17.\n\nSecurity fix list in the versions can be found in the link below:\n\nhttps://github.com/ethereum/solidity/blob/develop/Changelog.md\n\n## Devoid of system documentation and complete technical specification\nA system\u2019s design specification and supporting documentation should be almost as important as the system\u2019s implementation itself. ", "fixed_code": "## No storage gap for upgradeable contracts\nConsider adding a storage gap at the end of an upgradeable contract, just in case it would entail some child contracts in the future. This would ensure no shifting down of storage in the inheritance chain.\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/RaymondFam-Q.md", "collected_at": "2026-01-02T18:18:27.425953+00:00", "source_hash": "8a17b2c3452639080afe77001a52d2c7cb39ec99060f54af19de818482cecbf7", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol#L165-L175, SafEth.sol#L182-L195, Reth.sol#L20-L27, SfrxEth.sol#L15-L21, WstEth.sol#L13-L18", "github_files_list": "SfrxEth.sol, Reth.sol, WstEth.sol, SafEth.sol", "github_refs_count": 5, "vulnerable_code_actual": "## Parameterized address variables\nAddresses should be parameterized and initialized instead of being declared as constants.\n\nHere are the contract instances entailed:\n\n[File: Reth.sol#L20-L27](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L20-L27)\n[File: SfrxEth.sol#L15-L21](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol#L15-L21)\n[File: WstEth.sol#L13-L18](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol#L13-L18)\n\n## Unspecific compiler version pragma\nFor some source-units the compiler version pragma is very unspecific, i.e. ^0.8.13. While this often makes sense for libraries to allow them to be included with multiple different versions of an application, it may be a security risk for the actual application implementation itself. A known vulnerable compiler version may accidentally be selected or security tools might fall-back to an older compiler version ending up actually checking a different EVM compilation that is ultimately deployed on the blockchain.\n\nAvoid floating pragmas where possible. It is highly recommend pinning a concrete compiler version (latest without security issues) in at least the top-level \u201cdeployed\u201d contracts to make it unambiguous which compiler version is being used. Rule of thumb: a flattened source-unit should have at least one non-floating concrete solidity compiler version pragma.\n\n## Use a more recent version of solidity\nThe protocol adopts version 0.8.13 on writing contracts. For better security, it is best practice to use the latest Solidity version, 0.8.17.\n\nSecurity fix list in the versions can be found in the link below:\n\nhttps://github.com/ethereum/solidity/blob/develop/Changelog.md\n\n## Devoid of system documentation and complete technical specification\nA system\u2019s design specification and supporting documentation should be almost as important as the system\u2019s implementation itself. ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## No storage gap for upgradeable contracts\nConsider adding a storage gap at the end of an upgradeable contract, just in case it would entail some child contracts in the future. This would ensure no shifting down of storage in the inheritance chain.\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "08-dopex", "title": "Nikki Q", "severity_raw": "Low", "severity": "low", "description": "1. Incorrect POP operation of the value `reserveTokens` in the function `removeAssetFromtokenReserves`.\nLink:\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L287\n\nSummary:\n```solidity\n // remove the asset from the mapping\n reservesIndex[_assetSymbol] = 0;\n\n // add new index for the last element\n reservesIndex[reserveTokens[reserveTokens.length - 1]] = index;\n\n // update the index of reserveAsset with the last element\n reserveAsset[index] = reserveAsset[reserveAsset.length - 1];\n\n // remove the last element\n reserveAsset.pop();\n reserveTokens.pop();\n```\nThis would always delete the last symbol of `reserveTokens` in the array, irrespective of the `_assetSymbol` provided to delete.\n\nPOC:\n```solidity\n function testPopBugPoc() public {\n // rdpxV2Core.addAssetTotokenReserves(address(rdpx), \"RDPX\"); - 1\n // rdpxV2Core.addAssetTotokenReserves(address(weth), \"WETH\"); - 2\n // rdpxV2Core.addAssetTotokenReserves(address(dpxETH), \"DPXETH\"); - 3\n assertEq(rdpxV2Core.getReserveAssetLength(), 4);\n assertEq(rdpxV2Core.getReserveTokensLength(), 3);\n\n rdpxV2Core.removeAssetFromtokenReserves(\"WETH\");\n uint len = rdpxV2Core.getReserveTokensLength();\n string memory tokens_ = rdpxV2Core.reserveTokens(len - 1);\n assertNotEq(tokens_, \"DPXETH\");\n assertEq(tokens_, \"WETH\");\n }\n```\n\nRecommondations:\n```\n function testPopBugPoc() public {\n rdpxV2Core.addAssetTotokenReserves(address(rdpx), \"RDPX\"); - 1\n rdpxV2Core.addAssetTotokenReserves(address(weth), \"WETH\"); - 2\n rdpxV2Core.addAssetTotokenReserves(address(dpxETH), \"DPXETH\"); - 3\n assertEq(rdpxV2Core.getReserveAssetLength(), 4);\n assertEq(rdpxV2Core.getReserveTokensLength(), 3);\n\n rdpxV2Core.removeAssetFromtokenReserves(\"WETH\");\n uint len = rdpxV2Core.getReserveTokensLength();\n string memory tokens_ = rdpxV2Core.reserveTokens(len - 1);\n\n assertNotEq(tokens_, \"DPXETH\");\n assertEq(tokens_, \"WETH\");\n }\n``", "vulnerable_code": " // remove the asset from the mapping\n reservesIndex[_assetSymbol] = 0;\n\n // add new index for the last element\n reservesIndex[reserveTokens[reserveTokens.length - 1]] = index;\n\n // update the index of reserveAsset with the last element\n reserveAsset[index] = reserveAsset[reserveAsset.length - 1];\n\n // remove the last element\n reserveAsset.pop();\n reserveTokens.pop();", "fixed_code": " function testPopBugPoc() public {\n // rdpxV2Core.addAssetTotokenReserves(address(rdpx), \"RDPX\"); - 1\n // rdpxV2Core.addAssetTotokenReserves(address(weth), \"WETH\"); - 2\n // rdpxV2Core.addAssetTotokenReserves(address(dpxETH), \"DPXETH\"); - 3\n assertEq(rdpxV2Core.getReserveAssetLength(), 4);\n assertEq(rdpxV2Core.getReserveTokensLength(), 3);\n\n rdpxV2Core.removeAssetFromtokenReserves(\"WETH\");\n uint len = rdpxV2Core.getReserveTokensLength();\n string memory tokens_ = rdpxV2Core.reserveTokens(len - 1);\n assertNotEq(tokens_, \"DPXETH\");\n assertEq(tokens_, \"WETH\");\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/Nikki-Q.md", "collected_at": "2026-01-02T18:24:55.554199+00:00", "source_hash": "8addecbb94f796a35b207b254f8ab9e824447c4b4121bcf8c0a980754dfff5ff", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 995, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "// remove the asset from the mapping\n reservesIndex[_assetSymbol] = 0;\n\n // add new index for the last element\n reservesIndex[reserveTokens[reserveTokens.length - 1]] = index;\n\n // update the index of reserveAsset with the last element\n reserveAsset[index] = reserveAsset[reserveAsset.length - 1];\n\n // remove the last element\n reserveAsset.pop();\n reserveTokens.pop();", "primary_code_language": "solidity", "primary_code_char_count": 393, "all_code_blocks": "// Code block 1 (solidity):\n// remove the asset from the mapping\n reservesIndex[_assetSymbol] = 0;\n\n // add new index for the last element\n reservesIndex[reserveTokens[reserveTokens.length - 1]] = index;\n\n // update the index of reserveAsset with the last element\n reserveAsset[index] = reserveAsset[reserveAsset.length - 1];\n\n // remove the last element\n reserveAsset.pop();\n reserveTokens.pop();\n\n// Code block 2 (solidity):\nfunction testPopBugPoc() public {\n // rdpxV2Core.addAssetTotokenReserves(address(rdpx), \"RDPX\"); - 1\n // rdpxV2Core.addAssetTotokenReserves(address(weth), \"WETH\"); - 2\n // rdpxV2Core.addAssetTotokenReserves(address(dpxETH), \"DPXETH\"); - 3\n assertEq(rdpxV2Core.getReserveAssetLength(), 4);\n assertEq(rdpxV2Core.getReserveTokensLength(), 3);\n\n rdpxV2Core.removeAssetFromtokenReserves(\"WETH\");\n uint len = rdpxV2Core.getReserveTokensLength();\n string memory tokens_ = rdpxV2Core.reserveTokens(len - 1);\n assertNotEq(tokens_, \"DPXETH\");\n assertEq(tokens_, \"WETH\");\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "// remove the asset from the mapping\n reservesIndex[_assetSymbol] = 0;\n\n // add new index for the last element\n reservesIndex[reserveTokens[reserveTokens.length - 1]] = index;\n\n // update the index of reserveAsset with the last element\n reserveAsset[index] = reserveAsset[reserveAsset.length - 1];\n\n // remove the last element\n reserveAsset.pop();\n reserveTokens.pop();\n\nfunction testPopBugPoc() public {\n // rdpxV2Core.addAssetTotokenReserves(address(rdpx), \"RDPX\"); - 1\n // rdpxV2Core.addAssetTotokenReserves(address(weth), \"WETH\"); - 2\n // rdpxV2Core.addAssetTotokenReserves(address(dpxETH), \"DPXETH\"); - 3\n assertEq(rdpxV2Core.getReserveAssetLength(), 4);\n assertEq(rdpxV2Core.getReserveTokensLength(), 3);\n\n rdpxV2Core.removeAssetFromtokenReserves(\"WETH\");\n uint len = rdpxV2Core.getReserveTokensLength();\n string memory tokens_ = rdpxV2Core.reserveTokens(len - 1);\n assertNotEq(tokens_, \"DPXETH\");\n assertEq(tokens_, \"WETH\");\n }", "github_refs_formatted": "RdpxV2Core.sol#L287", "github_files_list": "RdpxV2Core.sol", "github_refs_count": 1, "vulnerable_code_actual": " // remove the asset from the mapping\n reservesIndex[_assetSymbol] = 0;\n\n // add new index for the last element\n reservesIndex[reserveTokens[reserveTokens.length - 1]] = index;\n\n // update the index of reserveAsset with the last element\n reserveAsset[index] = reserveAsset[reserveAsset.length - 1];\n\n // remove the last element\n reserveAsset.pop();\n reserveTokens.pop();", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function testPopBugPoc() public {\n // rdpxV2Core.addAssetTotokenReserves(address(rdpx), \"RDPX\"); - 1\n // rdpxV2Core.addAssetTotokenReserves(address(weth), \"WETH\"); - 2\n // rdpxV2Core.addAssetTotokenReserves(address(dpxETH), \"DPXETH\"); - 3\n assertEq(rdpxV2Core.getReserveAssetLength(), 4);\n assertEq(rdpxV2Core.getReserveTokensLength(), 3);\n\n rdpxV2Core.removeAssetFromtokenReserves(\"WETH\");\n uint len = rdpxV2Core.getReserveTokensLength();\n string memory tokens_ = rdpxV2Core.reserveTokens(len - 1);\n assertNotEq(tokens_, \"DPXETH\");\n assertEq(tokens_, \"WETH\");\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "03-revert-lend", "title": "InAllHonesty G", "severity_raw": "Medium", "severity": "medium", "description": "## [G-01] `Unauthorized` check in `V3Vault::borrow` should be moved right below the `bool isTransformMode` declaration line to save gas in case of failure.\n\nThe function below performs 2 internal functions calls (`_updateGlobalInterest` and `_resetDailyDebtIncreaseLimit`) and a SLOAD before executing the `if (!isTransformMode && tokenOwner[tokenId] != msg.sender && address(this) != msg.sender)` check:\n```\nfunction borrow(uint256 tokenId, uint256 assets) external override {\n bool isTransformMode =\n transformedTokenId > 0 && transformedTokenId == tokenId && transformerAllowList[msg.sender];\n\n (uint256 newDebtExchangeRateX96, uint256 newLendExchangeRateX96) = _updateGlobalInterest();\n\n _resetDailyDebtIncreaseLimit(newLendExchangeRateX96, false);\n\n Loan storage loan = loans[tokenId];\n\n // if not in transfer mode - must be called from owner or the vault itself\n@> if (!isTransformMode && tokenOwner[tokenId] != msg.sender && address(this) != msg.sender) {\n@> revert Unauthorized();\n }\n```\n\nThat check could be moved right after [Line 552](https://github.com/code-423n4/2024-03-revert-lend/blob/435b054f9ad2404173f36f0f74a5096c894b12b7/src/V3Vault.sol#L552) to save gas in case of failure.\n\nPlease paste the following test into `V3Vault.t.sol`:\n```\n function testBorrowUnauthorized() external {\n // 0 borrow loan\n uint256 amount = 1e6;\n _setupBasicLoan(false);\n\n (,, uint256 collateralValue,,) = vault.loanInfo(TEST_NFT);\n\n vm.assume(amount <= collateralValue * 100);\n\n uint256 debtLimit = vault.globalDebtLimit();\n uint256 increaseLimit = vault.dailyDebtIncreaseLimitMin();\n\n if (amount > debtLimit) {\n vm.expectRevert(IErrors.GlobalDebtLimit.selector);\n } else if (amount > increaseLimit) {\n vm.expectRevert(IErrors.DailyDebtIncreaseLimit.selector);\n } else if (amount > collateralValue) {\n vm.expectRevert(IErrors.", "vulnerable_code": "function borrow(uint256 tokenId, uint256 assets) external override {\n bool isTransformMode =\n transformedTokenId > 0 && transformedTokenId == tokenId && transformerAllowList[msg.sender];\n\n (uint256 newDebtExchangeRateX96, uint256 newLendExchangeRateX96) = _updateGlobalInterest();\n\n _resetDailyDebtIncreaseLimit(newLendExchangeRateX96, false);\n\n Loan storage loan = loans[tokenId];\n\n // if not in transfer mode - must be called from owner or the vault itself\n@> if (!isTransformMode && tokenOwner[tokenId] != msg.sender && address(this) != msg.sender) {\n@> revert Unauthorized();\n }", "fixed_code": " function testBorrowUnauthorized() external {\n // 0 borrow loan\n uint256 amount = 1e6;\n _setupBasicLoan(false);\n\n (,, uint256 collateralValue,,) = vault.loanInfo(TEST_NFT);\n\n vm.assume(amount <= collateralValue * 100);\n\n uint256 debtLimit = vault.globalDebtLimit();\n uint256 increaseLimit = vault.dailyDebtIncreaseLimitMin();\n\n if (amount > debtLimit) {\n vm.expectRevert(IErrors.GlobalDebtLimit.selector);\n } else if (amount > increaseLimit) {\n vm.expectRevert(IErrors.DailyDebtIncreaseLimit.selector);\n } else if (amount > collateralValue) {\n vm.expectRevert(IErrors.CollateralFail.selector);\n }\n\n vm.prank(TEST_NFT_ACCOUNT);\n vm.expectRevert(IErrors.Unauthorized.selector);\n vault.borrow(0, amount); //NFT id hardcoded to 0 to make the function fail\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/InAllHonesty-G.md", "collected_at": "2026-01-02T19:02:59.256371+00:00", "source_hash": "8b92a64d785190ad99bdf79cdb79ee2600ba498036cb0a14ab754e3f079d1cb3", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 653, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function borrow(uint256 tokenId, uint256 assets) external override {\n bool isTransformMode =\n transformedTokenId > 0 && transformedTokenId == tokenId && transformerAllowList[msg.sender];\n\n (uint256 newDebtExchangeRateX96, uint256 newLendExchangeRateX96) = _updateGlobalInterest();\n\n _resetDailyDebtIncreaseLimit(newLendExchangeRateX96, false);\n\n Loan storage loan = loans[tokenId];\n\n // if not in transfer mode - must be called from owner or the vault itself\n@> if (!isTransformMode && tokenOwner[tokenId] != msg.sender && address(this) != msg.sender) {\n@> revert Unauthorized();\n }", "primary_code_language": "unknown", "primary_code_char_count": 653, "all_code_blocks": "// Code block 1 (unknown):\nfunction borrow(uint256 tokenId, uint256 assets) external override {\n bool isTransformMode =\n transformedTokenId > 0 && transformedTokenId == tokenId && transformerAllowList[msg.sender];\n\n (uint256 newDebtExchangeRateX96, uint256 newLendExchangeRateX96) = _updateGlobalInterest();\n\n _resetDailyDebtIncreaseLimit(newLendExchangeRateX96, false);\n\n Loan storage loan = loans[tokenId];\n\n // if not in transfer mode - must be called from owner or the vault itself\n@> if (!isTransformMode && tokenOwner[tokenId] != msg.sender && address(this) != msg.sender) {\n@> revert Unauthorized();\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "V3Vault.sol#L552", "github_files_list": "V3Vault.sol", "github_refs_count": 1, "vulnerable_code_actual": "function borrow(uint256 tokenId, uint256 assets) external override {\n bool isTransformMode =\n transformedTokenId > 0 && transformedTokenId == tokenId && transformerAllowList[msg.sender];\n\n (uint256 newDebtExchangeRateX96, uint256 newLendExchangeRateX96) = _updateGlobalInterest();\n\n _resetDailyDebtIncreaseLimit(newLendExchangeRateX96, false);\n\n Loan storage loan = loans[tokenId];\n\n // if not in transfer mode - must be called from owner or the vault itself\n@> if (!isTransformMode && tokenOwner[tokenId] != msg.sender && address(this) != msg.sender) {\n@> revert Unauthorized();\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function testBorrowUnauthorized() external {\n // 0 borrow loan\n uint256 amount = 1e6;\n _setupBasicLoan(false);\n\n (,, uint256 collateralValue,,) = vault.loanInfo(TEST_NFT);\n\n vm.assume(amount <= collateralValue * 100);\n\n uint256 debtLimit = vault.globalDebtLimit();\n uint256 increaseLimit = vault.dailyDebtIncreaseLimitMin();\n\n if (amount > debtLimit) {\n vm.expectRevert(IErrors.GlobalDebtLimit.selector);\n } else if (amount > increaseLimit) {\n vm.expectRevert(IErrors.DailyDebtIncreaseLimit.selector);\n } else if (amount > collateralValue) {\n vm.expectRevert(IErrors.CollateralFail.selector);\n }\n\n vm.prank(TEST_NFT_ACCOUNT);\n vm.expectRevert(IErrors.Unauthorized.selector);\n vault.borrow(0, amount); //NFT id hardcoded to 0 to make the function fail\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "10-badger", "title": "alpha Q", "severity_raw": "Critical", "severity": "critical", "description": "1. Use braces around operators with uncertain precedence\nIn RolesAuthority::canCall we see the following code\n```\nFile: package/contracts/contracts/Dependencies/RolesAuthority.sol\nfunction canCall(\n address user,\n address target,\n bytes4 functionSig\n ) public view virtual override returns (bool) {\nreturn bytes32(0) != getUserRoles[user] & getRolesWithCapability[target][functionSig];\n```\n\nIn Solidity the & operator will be executed before != but this might not always be clear and might be different in other languages. I suggest adding braces around getUserRoles[user] & getRolesWithCapability[target][functionSig] to clarify operator precedence.\n\n2. More check for save storage\nIn the RolesAuthority::setRoleCapability method, a require condition should be added at the beginning to ensure that the functionSig is not invoked for the CapabilityFlag.Burned and CapabilityFlag.Public cases:\n\n```\nFile: package/contracts/contracts/Dependencies/RolesAuthority.sol\nfunction setRoleCapability(\n uint8 role,\n address target,\n bytes4 functionSig,\n bool enabled\n ) public virtual requiresAuth {\nrequire(capabilityFlag[target][functionSig] == CapabilityFlag.None,\"xxx\");\n```\nThis condition serves to protect the owner from setting roles as burned or public, thus preventing unnecessary storage wastage.\n\n3. `transferOwnership` should be two step process\n```\nFile: package/contracts/contracts/Dependencies/Auth.sol\nfunction transferOwnership(address newOwner) public virtual requiresAuth {\n owner = newOwner;\n\n emit OwnershipTransferred(msg.sender, newOwner);\n }\n```\nThe function transferOwnership() transfer ownership to a new address. In case a wrong address is supplied\nownership is inaccessible. \nConsider implementing a two step ownership transfer.\n\n4. Strengthening Checks in the _initializeAuthority Method for Enhanced Reliability\n```\nFile: package/contracts/contracts/Dependencies/AuthNoOwner.sol\nfunction _initializeAuthorit", "vulnerable_code": "File: package/contracts/contracts/Dependencies/RolesAuthority.sol\nfunction canCall(\n address user,\n address target,\n bytes4 functionSig\n ) public view virtual override returns (bool) {\nreturn bytes32(0) != getUserRoles[user] & getRolesWithCapability[target][functionSig];", "fixed_code": "File: package/contracts/contracts/Dependencies/RolesAuthority.sol\nfunction setRoleCapability(\n uint8 role,\n address target,\n bytes4 functionSig,\n bool enabled\n ) public virtual requiresAuth {\nrequire(capabilityFlag[target][functionSig] == CapabilityFlag.None,\"xxx\");", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/alpha-Q.md", "collected_at": "2026-01-02T18:26:42.388998+00:00", "source_hash": "8bd7cbf80f8c2d973ccf5d66f796ecb13f06541a0f5c866759ee3307bb9ddcca", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 812, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: package/contracts/contracts/Dependencies/RolesAuthority.sol\nfunction canCall(\n address user,\n address target,\n bytes4 functionSig\n ) public view virtual override returns (bool) {\nreturn bytes32(0) != getUserRoles[user] & getRolesWithCapability[target][functionSig];", "primary_code_language": "unknown", "primary_code_char_count": 295, "all_code_blocks": "// Code block 1 (unknown):\nFile: package/contracts/contracts/Dependencies/RolesAuthority.sol\nfunction canCall(\n address user,\n address target,\n bytes4 functionSig\n ) public view virtual override returns (bool) {\nreturn bytes32(0) != getUserRoles[user] & getRolesWithCapability[target][functionSig];\n\n// Code block 2 (unknown):\nFile: package/contracts/contracts/Dependencies/RolesAuthority.sol\nfunction setRoleCapability(\n uint8 role,\n address target,\n bytes4 functionSig,\n bool enabled\n ) public virtual requiresAuth {\nrequire(capabilityFlag[target][functionSig] == CapabilityFlag.None,\"xxx\");\n\n// Code block 3 (unknown):\nFile: package/contracts/contracts/Dependencies/Auth.sol\nfunction transferOwnership(address newOwner) public virtual requiresAuth {\n owner = newOwner;\n\n emit OwnershipTransferred(msg.sender, newOwner);\n }", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: package/contracts/contracts/Dependencies/RolesAuthority.sol\nfunction canCall(\n address user,\n address target,\n bytes4 functionSig\n ) public view virtual override returns (bool) {\nreturn bytes32(0) != getUserRoles[user] & getRolesWithCapability[target][functionSig];", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: package/contracts/contracts/Dependencies/RolesAuthority.sol\nfunction setRoleCapability(\n uint8 role,\n address target,\n bytes4 functionSig,\n bool enabled\n ) public virtual requiresAuth {\nrequire(capabilityFlag[target][functionSig] == CapabilityFlag.None,\"xxx\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "02-ai-arena", "title": "0xpoor4ever Q", "severity_raw": "Unknown", "severity": "unknown", "description": "Incorrect comment, The correct comment should be: \"Mapping of tokenId to fighter points.\"\n[MergingPool.sol#L50](https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/MergingPool.sol#L50)\n```\n /// @notice Mapping of address to fighter points.\n mapping(uint256 => uint256) public fighterPoints;\n```", "vulnerable_code": " /// @notice Mapping of address to fighter points.\n mapping(uint256 => uint256) public fighterPoints;", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/0xpoor4ever-Q.md", "collected_at": "2026-01-02T19:02:09.638689+00:00", "source_hash": "8c1b67315b8585c7a8c7b1fc419b6cbe157c1312b99d8d02bc3c2fd78f473fb0", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 103, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "/// @notice Mapping of address to fighter points.\n mapping(uint256 => uint256) public fighterPoints;", "primary_code_language": "unknown", "primary_code_char_count": 103, "all_code_blocks": "// Code block 1 (unknown):\n/// @notice Mapping of address to fighter points.\n mapping(uint256 => uint256) public fighterPoints;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "MergingPool.sol#L50", "github_files_list": "MergingPool.sol", "github_refs_count": 1, "vulnerable_code_actual": " /// @notice Mapping of address to fighter points.\n mapping(uint256 => uint256) public fighterPoints;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 3.62} {"source": "c4", "protocol": "11-kelp", "title": "adriro Q", "severity_raw": "Critical", "severity": "critical", "description": "# Report\n\n## Summary\n\n### Low Issues\n\nTotal of **7 issues**:\n\n|ID|Issue|\n|:--:|:---|\n| [L-1](#l-1-supported-assets-cannot-be-removed) | Supported assets cannot be removed |\n| [L-2](#l-2-duplicate-access-list-in-rseth-contract) | Duplicate access list in RSETH contract |\n| [L-3](#l-3-admin-could-get-locked-out-when-updating-lrtconfig) | Admin could get locked out when updating LRTConfig |\n| [L-4](#l-4-missing-storage-gap-in-lrtconfigrolechecker) | Missing storage gap in LRTConfigRoleChecker |\n| [L-5](#l-5-no-decimal-normalization-in-price-feeds) | No decimal normalization in price feeds |\n| [L-6](#l-6-potential-denial-of-service-due-to-unbounded-gas-usage-in-gettotalassetdeposits) | Potential denial of service due to unbounded gas usage in `getTotalAssetDeposits()` |\n| [L-7](#l-7-potential-overflow-in-getassetcurrentlimit) | Potential overflow in `getAssetCurrentLimit()` |\n\n### Non Critical Issues\n\nTotal of **2 issues**:\n\n|ID|Issue|\n|:--:|:---|\n| [NC-1](#nc-1-add-an-initializer-to-the-lrtconfigrolechecker-contract) | Add an initializer to the LRTConfigRoleChecker contract |\n| [NC-2](#nc-2-use-uups-over-transparentproxy) | Use UUPS over TransparentProxy |\n\n## Low Issues\n\n### [L-1] Supported assets cannot be removed\n\nConfigured assets in the LRTConfig contract can be added by calling `addNewSupportedAsset()`, but there is no current way of removing these assets if it is needed later.\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTConfig.sol#L73-L75\n\n```solidity\n73: function addNewSupportedAsset(address asset, uint256 depositLimit) external onlyRole(LRTConstants.MANAGER) {\n74: _addNewSupportedAsset(asset, depositLimit);\n75: }\n```\n\nConsider adding a function to let admins or managers to eventually remove an asset from the supported list.\n\n### [L-2] Duplicate access list in RSETH contract\n\nThe LRTConfig acts as an access list through the protocol, contracts inherit from L", "vulnerable_code": "73: function addNewSupportedAsset(address asset, uint256 depositLimit) external onlyRole(LRTConstants.MANAGER) {\n74: _addNewSupportedAsset(asset, depositLimit);\n75: }", "fixed_code": "47: function updateLRTConfig(address lrtConfigAddr) external virtual onlyLRTAdmin {\n48: UtilLib.checkNonZeroAddress(lrtConfigAddr);\n49: lrtConfig = ILRTConfig(lrtConfigAddr);\n50: emit UpdatedLRTConfig(lrtConfigAddr);\n51: }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/adriro-Q.md", "collected_at": "2026-01-02T18:27:47.522225+00:00", "source_hash": "8c2ffe8f6b34ec677b8185448f9dbc1b2cec540d961394effd7648969b922986", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 182, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "73: function addNewSupportedAsset(address asset, uint256 depositLimit) external onlyRole(LRTConstants.MANAGER) {\n74: _addNewSupportedAsset(asset, depositLimit);\n75: }", "primary_code_language": "solidity", "primary_code_char_count": 182, "all_code_blocks": "// Code block 1 (solidity):\n73: function addNewSupportedAsset(address asset, uint256 depositLimit) external onlyRole(LRTConstants.MANAGER) {\n74: _addNewSupportedAsset(asset, depositLimit);\n75: }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "73: function addNewSupportedAsset(address asset, uint256 depositLimit) external onlyRole(LRTConstants.MANAGER) {\n74: _addNewSupportedAsset(asset, depositLimit);\n75: }", "github_refs_formatted": "LRTConfig.sol#L73-L75", "github_files_list": "LRTConfig.sol", "github_refs_count": 1, "vulnerable_code_actual": "73: function addNewSupportedAsset(address asset, uint256 depositLimit) external onlyRole(LRTConstants.MANAGER) {\n74: _addNewSupportedAsset(asset, depositLimit);\n75: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "47: function updateLRTConfig(address lrtConfigAddr) external virtual onlyLRTAdmin {\n48: UtilLib.checkNonZeroAddress(lrtConfigAddr);\n49: lrtConfig = ILRTConfig(lrtConfigAddr);\n50: emit UpdatedLRTConfig(lrtConfigAddr);\n51: }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "04-caviar", "title": "holyhansss_kr Q", "severity_raw": "Critical", "severity": "critical", "description": "## no event on critical events\n\n```solidity\nfunction setPrivatePoolMetadata()\nfunction setPrivatePoolImplementation()\nfunction setProtocolFeeRate()\n```\n\n## use safeTransfer and safeTransferFrom on ERC20 transfer\n\n[https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L365](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L365)\n\n[https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L527](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L527)\n\n[https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L651](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L651)\n\n## User is able to create pool with 0 NFT\nUser is able to create private pool without sending any NFT.", "vulnerable_code": "function setPrivatePoolMetadata()\nfunction setPrivatePoolImplementation()\nfunction setProtocolFeeRate()", "fixed_code": "", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/holyhansss_kr-Q.md", "collected_at": "2026-01-02T18:20:34.562131+00:00", "source_hash": "8c3ec08de187024538f1c44270bdc1cf5daf73dd7572abee0fcc6d854eb70031", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 103, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function setPrivatePoolMetadata()\nfunction setPrivatePoolImplementation()\nfunction setProtocolFeeRate()", "primary_code_language": "solidity", "primary_code_char_count": 103, "all_code_blocks": "// Code block 1 (solidity):\nfunction setPrivatePoolMetadata()\nfunction setPrivatePoolImplementation()\nfunction setProtocolFeeRate()", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function setPrivatePoolMetadata()\nfunction setPrivatePoolImplementation()\nfunction setProtocolFeeRate()", "github_refs_formatted": "PrivatePool.sol#L365, PrivatePool.sol#L527, PrivatePool.sol#L651", "github_files_list": "PrivatePool.sol", "github_refs_count": 3, "vulnerable_code_actual": "function setPrivatePoolMetadata()\nfunction setPrivatePoolImplementation()\nfunction setProtocolFeeRate()", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5.05} {"source": "c4", "protocol": "01-biconomy", "title": "ladboy233 Q", "severity_raw": "High", "severity": "high", "description": "# ReentrancyGuardUpgradeable is not initalized in the init function of the SmartAccount\n\n### Line of Code\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L28\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L166\n\n### Vulnerability and recommended fix\n\nThe SmartAccount inherits from ReentrancyGuardUpgradeable\n\n```solidity\ncontract SmartAccount is \n Singleton,\n BaseSmartAccount,\n IERC165,\n ModuleManager,\n SignatureDecoder,\n SecuredTokenTransfer,\n ISignatureValidatorConstants,\n FallbackManager,\n Initializable,\n ReentrancyGuardUpgradeable\n {\n```\n\nHowever, in the init function of the SmartAccount, the ReentrancyGuardUpgradeable is not initalized.\n\n```solidity\n // init\n // Initialize / Setup\n // Used to setup\n // i. owner ii. entry point address iii. handler\n function init(address _owner, address _entryPointAddress, address _handler) public override initializer { \n require(owner == address(0), \"Already initialized\");\n require(address(_entryPoint) == address(0), \"Already initialized\");\n require(_owner != address(0),\"Invalid owner\");\n require(_entryPointAddress != address(0), \"Invalid Entrypoint\");\n require(_handler != address(0), \"Invalid Entrypoint\");\n owner = _owner;\n _entryPoint = IEntryPoint(payable(_entryPointAddress));\n if (_handler != address(0)) internalSetFallbackHandler(_handler);\n setupModules(address(0), bytes(\"\"));\n }\n```\n\nIf in fact, if the SmartAccount is not upgradeable, no need to use the ReentrancyGuardUpgradeable, just use the regular reentrancy guard should be sufficient, otherwise, the recommended fix is init the ReentrancyGuardUpgradeable inside the init function\n\nhttps://github.com/OpenZeppelin/openzeppelin-contrac", "vulnerable_code": "contract SmartAccount is \n Singleton,\n BaseSmartAccount,\n IERC165,\n ModuleManager,\n SignatureDecoder,\n SecuredTokenTransfer,\n ISignatureValidatorConstants,\n FallbackManager,\n Initializable,\n ReentrancyGuardUpgradeable\n {", "fixed_code": " // init\n // Initialize / Setup\n // Used to setup\n // i. owner ii. entry point address iii. handler\n function init(address _owner, address _entryPointAddress, address _handler) public override initializer { \n require(owner == address(0), \"Already initialized\");\n require(address(_entryPoint) == address(0), \"Already initialized\");\n require(_owner != address(0),\"Invalid owner\");\n require(_entryPointAddress != address(0), \"Invalid Entrypoint\");\n require(_handler != address(0), \"Invalid Entrypoint\");\n owner = _owner;\n _entryPoint = IEntryPoint(payable(_entryPointAddress));\n if (_handler != address(0)) internalSetFallbackHandler(_handler);\n setupModules(address(0), bytes(\"\"));\n }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/ladboy233-Q.md", "collected_at": "2026-01-02T18:13:53.076295+00:00", "source_hash": "8c8e482e81f125107ad29e3c7509b1c5286f8d6aa39f4434727166aca78dfade", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 1023, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "contract SmartAccount is \n Singleton,\n BaseSmartAccount,\n IERC165,\n ModuleManager,\n SignatureDecoder,\n SecuredTokenTransfer,\n ISignatureValidatorConstants,\n FallbackManager,\n Initializable,\n ReentrancyGuardUpgradeable\n {", "primary_code_language": "solidity", "primary_code_char_count": 263, "all_code_blocks": "// Code block 1 (solidity):\ncontract SmartAccount is \n Singleton,\n BaseSmartAccount,\n IERC165,\n ModuleManager,\n SignatureDecoder,\n SecuredTokenTransfer,\n ISignatureValidatorConstants,\n FallbackManager,\n Initializable,\n ReentrancyGuardUpgradeable\n {\n\n// Code block 2 (solidity):\n// init\n // Initialize / Setup\n // Used to setup\n // i. owner ii. entry point address iii. handler\n function init(address _owner, address _entryPointAddress, address _handler) public override initializer { \n require(owner == address(0), \"Already initialized\");\n require(address(_entryPoint) == address(0), \"Already initialized\");\n require(_owner != address(0),\"Invalid owner\");\n require(_entryPointAddress != address(0), \"Invalid Entrypoint\");\n require(_handler != address(0), \"Invalid Entrypoint\");\n owner = _owner;\n _entryPoint = IEntryPoint(payable(_entryPointAddress));\n if (_handler != address(0)) internalSetFallbackHandler(_handler);\n setupModules(address(0), bytes(\"\"));\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "contract SmartAccount is \n Singleton,\n BaseSmartAccount,\n IERC165,\n ModuleManager,\n SignatureDecoder,\n SecuredTokenTransfer,\n ISignatureValidatorConstants,\n FallbackManager,\n Initializable,\n ReentrancyGuardUpgradeable\n {\n\n// init\n // Initialize / Setup\n // Used to setup\n // i. owner ii. entry point address iii. handler\n function init(address _owner, address _entryPointAddress, address _handler) public override initializer { \n require(owner == address(0), \"Already initialized\");\n require(address(_entryPoint) == address(0), \"Already initialized\");\n require(_owner != address(0),\"Invalid owner\");\n require(_entryPointAddress != address(0), \"Invalid Entrypoint\");\n require(_handler != address(0), \"Invalid Entrypoint\");\n owner = _owner;\n _entryPoint = IEntryPoint(payable(_entryPointAddress));\n if (_handler != address(0)) internalSetFallbackHandler(_handler);\n setupModules(address(0), bytes(\"\"));\n }", "github_refs_formatted": "SmartAccount.sol#L28, SmartAccount.sol#L166", "github_files_list": "SmartAccount.sol", "github_refs_count": 2, "vulnerable_code_actual": "contract SmartAccount is \n Singleton,\n BaseSmartAccount,\n IERC165,\n ModuleManager,\n SignatureDecoder,\n SecuredTokenTransfer,\n ISignatureValidatorConstants,\n FallbackManager,\n Initializable,\n ReentrancyGuardUpgradeable\n {", "has_vulnerable_code_snippet": true, "fixed_code_actual": " // init\n // Initialize / Setup\n // Used to setup\n // i. owner ii. entry point address iii. handler\n function init(address _owner, address _entryPointAddress, address _handler) public override initializer { \n require(owner == address(0), \"Already initialized\");\n require(address(_entryPoint) == address(0), \"Already initialized\");\n require(_owner != address(0),\"Invalid owner\");\n require(_entryPointAddress != address(0), \"Invalid Entrypoint\");\n require(_handler != address(0), \"Invalid Entrypoint\");\n owner = _owner;\n _entryPoint = IEntryPoint(payable(_entryPointAddress));\n if (_handler != address(0)) internalSetFallbackHandler(_handler);\n setupModules(address(0), bytes(\"\"));\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "09-ondo", "title": "pipidu83 Q", "severity_raw": "Medium", "severity": "medium", "description": "# Low Risk Issues\n\n## 1. ShareBurnt event is emitted with two identical inputs.\n\n```preRebaseTokenAmount``` and ```postRebaseTokenAmount``` calculations will always return the same value in the ```_burnShares``` function as they take the same input parameter ```_sharesAmount``` and they share an identical timestamp (used in ```oracle.getPrice()```), while the range was not changed.\n\n```solidity\nfunction _burnShares(\naddress _account,\nuint256 _sharesAmount\n) internal whenNotPaused returns (uint256) {\nrequire(_account != address(0), \"BURN_FROM_THE_ZERO_ADDRESS\");\n\n_beforeTokenTransfer(_account, address(0), _sharesAmount);\n\nuint256 accountShares = shares[_account];\nrequire(_sharesAmount <= accountShares, \"BURN_AMOUNT_EXCEEDS_BALANCE\");\n\nuint256 preRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\ntotalShares -= _sharesAmount;\n\nshares[_account] = accountShares - _sharesAmount;\n\nuint256 postRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\nemit SharesBurnt(\n_account,\npreRebaseTokenAmount,\npostRebaseTokenAmount,\n_sharesAmount\n);\n\nreturn totalShares;\n\n// Notice: we're not emitting a Transfer event to the zero address here since shares burn\n// works by redistributing the amount of tokens corresponding to the burned shares between\n// all other token holders. The total supply of the token doesn't change as the result.\n// This is equivalent to performing a send from `address` to each other token holder address,\n// but we cannot reflect this as it would require sending an unbounded number of events.\n\n// We're emitting `SharesBurnt` event to provide an explicit rebase log record nonetheless.\n}\n```\n\nGiven [getRUSDYByShares](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDY.sol#L397) definition below:\n\n```solidity\nfunction getRUSDYByShares(uint256 _shares) public view returns (uint256) {\nreturn (_shares * oracle.getPrice()) / (1e18 * BPS_DENOMINATOR);\n}\n```\n\nAnd the getPrice() function in [RWADynamicOracle.sol](https://github.com/code-423n4/2023-09-", "vulnerable_code": "function _burnShares(\naddress _account,\nuint256 _sharesAmount\n) internal whenNotPaused returns (uint256) {\nrequire(_account != address(0), \"BURN_FROM_THE_ZERO_ADDRESS\");\n\n_beforeTokenTransfer(_account, address(0), _sharesAmount);\n\nuint256 accountShares = shares[_account];\nrequire(_sharesAmount <= accountShares, \"BURN_AMOUNT_EXCEEDS_BALANCE\");\n\nuint256 preRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\ntotalShares -= _sharesAmount;\n\nshares[_account] = accountShares - _sharesAmount;\n\nuint256 postRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\nemit SharesBurnt(\n_account,\npreRebaseTokenAmount,\npostRebaseTokenAmount,\n_sharesAmount\n);\n\nreturn totalShares;\n\n// Notice: we're not emitting a Transfer event to the zero address here since shares burn\n// works by redistributing the amount of tokens corresponding to the burned shares between\n// all other token holders. The total supply of the token doesn't change as the result.\n// This is equivalent to performing a send from `address` to each other token holder address,\n// but we cannot reflect this as it would require sending an unbounded number of events.\n\n// We're emitting `SharesBurnt` event to provide an explicit rebase log record nonetheless.\n}", "fixed_code": "function getRUSDYByShares(uint256 _shares) public view returns (uint256) {\nreturn (_shares * oracle.getPrice()) / (1e18 * BPS_DENOMINATOR);\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/pipidu83-Q.md", "collected_at": "2026-01-02T18:26:13.116692+00:00", "source_hash": "8c902165392d821b45987b7bfef84699f07bc39f453dbcfa09defedd3d8cd9db", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 1358, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _burnShares(\naddress _account,\nuint256 _sharesAmount\n) internal whenNotPaused returns (uint256) {\nrequire(_account != address(0), \"BURN_FROM_THE_ZERO_ADDRESS\");\n\n_beforeTokenTransfer(_account, address(0), _sharesAmount);\n\nuint256 accountShares = shares[_account];\nrequire(_sharesAmount <= accountShares, \"BURN_AMOUNT_EXCEEDS_BALANCE\");\n\nuint256 preRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\ntotalShares -= _sharesAmount;\n\nshares[_account] = accountShares - _sharesAmount;\n\nuint256 postRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\nemit SharesBurnt(\n_account,\npreRebaseTokenAmount,\npostRebaseTokenAmount,\n_sharesAmount\n);\n\nreturn totalShares;\n\n// Notice: we're not emitting a Transfer event to the zero address here since shares burn\n// works by redistributing the amount of tokens corresponding to the burned shares between\n// all other token holders. The total supply of the token doesn't change as the result.\n// This is equivalent to performing a send from `address` to each other token holder address,\n// but we cannot reflect this as it would require sending an unbounded number of events.\n\n// We're emitting `SharesBurnt` event to provide an explicit rebase log record nonetheless.\n}", "primary_code_language": "solidity", "primary_code_char_count": 1217, "all_code_blocks": "// Code block 1 (solidity):\nfunction _burnShares(\naddress _account,\nuint256 _sharesAmount\n) internal whenNotPaused returns (uint256) {\nrequire(_account != address(0), \"BURN_FROM_THE_ZERO_ADDRESS\");\n\n_beforeTokenTransfer(_account, address(0), _sharesAmount);\n\nuint256 accountShares = shares[_account];\nrequire(_sharesAmount <= accountShares, \"BURN_AMOUNT_EXCEEDS_BALANCE\");\n\nuint256 preRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\ntotalShares -= _sharesAmount;\n\nshares[_account] = accountShares - _sharesAmount;\n\nuint256 postRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\nemit SharesBurnt(\n_account,\npreRebaseTokenAmount,\npostRebaseTokenAmount,\n_sharesAmount\n);\n\nreturn totalShares;\n\n// Notice: we're not emitting a Transfer event to the zero address here since shares burn\n// works by redistributing the amount of tokens corresponding to the burned shares between\n// all other token holders. The total supply of the token doesn't change as the result.\n// This is equivalent to performing a send from `address` to each other token holder address,\n// but we cannot reflect this as it would require sending an unbounded number of events.\n\n// We're emitting `SharesBurnt` event to provide an explicit rebase log record nonetheless.\n}\n\n// Code block 2 (solidity):\nfunction getRUSDYByShares(uint256 _shares) public view returns (uint256) {\nreturn (_shares * oracle.getPrice()) / (1e18 * BPS_DENOMINATOR);\n}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function _burnShares(\naddress _account,\nuint256 _sharesAmount\n) internal whenNotPaused returns (uint256) {\nrequire(_account != address(0), \"BURN_FROM_THE_ZERO_ADDRESS\");\n\n_beforeTokenTransfer(_account, address(0), _sharesAmount);\n\nuint256 accountShares = shares[_account];\nrequire(_sharesAmount <= accountShares, \"BURN_AMOUNT_EXCEEDS_BALANCE\");\n\nuint256 preRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\ntotalShares -= _sharesAmount;\n\nshares[_account] = accountShares - _sharesAmount;\n\nuint256 postRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\nemit SharesBurnt(\n_account,\npreRebaseTokenAmount,\npostRebaseTokenAmount,\n_sharesAmount\n);\n\nreturn totalShares;\n\n// Notice: we're not emitting a Transfer event to the zero address here since shares burn\n// works by redistributing the amount of tokens corresponding to the burned shares between\n// all other token holders. The total supply of the token doesn't change as the result.\n// This is equivalent to performing a send from `address` to each other token holder address,\n// but we cannot reflect this as it would require sending an unbounded number of events.\n\n// We're emitting `SharesBurnt` event to provide an explicit rebase log record nonetheless.\n}\n\nfunction getRUSDYByShares(uint256 _shares) public view returns (uint256) {\nreturn (_shares * oracle.getPrice()) / (1e18 * BPS_DENOMINATOR);\n}", "github_refs_formatted": "rUSDY.sol#L397", "github_files_list": "rUSDY.sol", "github_refs_count": 1, "vulnerable_code_actual": "function _burnShares(\naddress _account,\nuint256 _sharesAmount\n) internal whenNotPaused returns (uint256) {\nrequire(_account != address(0), \"BURN_FROM_THE_ZERO_ADDRESS\");\n\n_beforeTokenTransfer(_account, address(0), _sharesAmount);\n\nuint256 accountShares = shares[_account];\nrequire(_sharesAmount <= accountShares, \"BURN_AMOUNT_EXCEEDS_BALANCE\");\n\nuint256 preRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\ntotalShares -= _sharesAmount;\n\nshares[_account] = accountShares - _sharesAmount;\n\nuint256 postRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\nemit SharesBurnt(\n_account,\npreRebaseTokenAmount,\npostRebaseTokenAmount,\n_sharesAmount\n);\n\nreturn totalShares;\n\n// Notice: we're not emitting a Transfer event to the zero address here since shares burn\n// works by redistributing the amount of tokens corresponding to the burned shares between\n// all other token holders. The total supply of the token doesn't change as the result.\n// This is equivalent to performing a send from `address` to each other token holder address,\n// but we cannot reflect this as it would require sending an unbounded number of events.\n\n// We're emitting `SharesBurnt` event to provide an explicit rebase log record nonetheless.\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function getRUSDYByShares(uint256 _shares) public view returns (uint256) {\nreturn (_shares * oracle.getPrice()) / (1e18 * BPS_DENOMINATOR);\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "02-ai-arena", "title": "SY_S G", "severity_raw": "Medium", "severity": "medium", "description": "## Summary\n\n### Gas Optimization\n\nno |Issue |Instances||\n|-|:-|:-:|:-:|\n| [G-01] |Mappings not used externally/internally can be marked private | |17|--| \n| [G-02] |Redundant state variable getters | |15|--| \n| [G-03] |Use named returns for local variables of pure/view functions where it is possible | ||--| \n| [G-04] |Using\u00a0PRIVATE\u00a0rather than\u00a0PUBLIC\u00a0FOR Constants/Immutable, Saves Gas| |8|--| \n| [G-05] |Before transfer of some functions, we should check some variables for possible gas save | |2|--| \n| [G-06] |Require() or revert() statements that check input arguments should be at the top of the function | |3|--| \n| [G-07] |Optimize Address Storage Value Management with `assembly` | |17|--| \n| [G-08] |Use assembly to emit events | |19|--| \n| [G-09] |Use byte32 in place of string| |21|--| \n| [G-10] |Divisions which do not divide by -X cannot overflow or overflow so such operations can be unchecked to save gas | |8|--| \n| [G-11] |Do not calculate constants | |3|--| \n| [G-12] |Stack variable cost less while used in emiting event| |8|--| \n| [G-13] | `internal` functions only called once can be inlined to save gas | |2|--| \n| [G-14] |Use shift Left instead of multiplication if possible to save gas | |3|--| \n\n\n\n\n## Gas Optimizations \n\n## [G-1] Mappings not used externally/internally can be marked private \nin this case, since all mappings are declared as public, they can be accessed and modified by any external contract or account. If you do not need this level of accessibility, it's recommended to mark them as private to restrict their usage to within the contract where they are defined. This can help prevent unintended or malicious manipulation of the mapping data from external sources.\n\n\n```solidity\nfile:/src/AiArenaHelper.sol\n 30 mapping(uint256 => mapping(string => uint8[])) public attributeProbabilities;\n 33 mapping(string => uint8) public attributeToDnaDivisor;\n\n```\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/f2952187a8afc44ee6adc2876965", "vulnerable_code": "file:/src/AiArenaHelper.sol\n 30 mapping(uint256 => mapping(string => uint8[])) public attributeProbabilities;\n 33 mapping(string => uint8) public attributeToDnaDivisor;\n", "fixed_code": "File: /src/FighterFarm.sol\n 76 mapping(uint256 => bool) public fighterStaked;\n\n 79 mapping(uint256 => uint8) public numRerolls;\n\n 82 mapping(address => bool) public hasStakerRole;\n\n \n 85 mapping(uint8 => uint8) public numElements;\n\n \n 88 mapping(address => mapping(uint8 => uint8)) public nftsClaimed;\n\n\n 91 mapping(uint256 => uint32) public numTrained;\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/SY_S-G.md", "collected_at": "2026-01-02T19:02:44.292605+00:00", "source_hash": "8cb0ed9cf03211e22487c28da94fa1abbaf0ea34ccc1ac2912b803e02f5ffc35", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 172, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "file:/src/AiArenaHelper.sol\n 30 mapping(uint256 => mapping(string => uint8[])) public attributeProbabilities;\n 33 mapping(string => uint8) public attributeToDnaDivisor;", "primary_code_language": "solidity", "primary_code_char_count": 172, "all_code_blocks": "// Code block 1 (solidity):\nfile:/src/AiArenaHelper.sol\n 30 mapping(uint256 => mapping(string => uint8[])) public attributeProbabilities;\n 33 mapping(string => uint8) public attributeToDnaDivisor;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "file:/src/AiArenaHelper.sol\n 30 mapping(uint256 => mapping(string => uint8[])) public attributeProbabilities;\n 33 mapping(string => uint8) public attributeToDnaDivisor;", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "file:/src/AiArenaHelper.sol\n 30 mapping(uint256 => mapping(string => uint8[])) public attributeProbabilities;\n 33 mapping(string => uint8) public attributeToDnaDivisor;\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: /src/FighterFarm.sol\n 76 mapping(uint256 => bool) public fighterStaked;\n\n 79 mapping(uint256 => uint8) public numRerolls;\n\n 82 mapping(address => bool) public hasStakerRole;\n\n \n 85 mapping(uint8 => uint8) public numElements;\n\n \n 88 mapping(address => mapping(uint8 => uint8)) public nftsClaimed;\n\n\n 91 mapping(uint256 => uint32) public numTrained;\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-biconomy", "title": "ballx G", "severity_raw": "High", "severity": "high", "description": "# c4udit Report\n\n## Files analyzed\n- contracts/smart-contract-wallet/BaseSmartAccount.sol\n- contracts/smart-contract-wallet/Proxy.sol\n- contracts/smart-contract-wallet/SmartAccount.sol\n- contracts/smart-contract-wallet/SmartAccountFactory.sol\n- contracts/smart-contract-wallet/SmartAccountNoAuth.sol\n- contracts/smart-contract-wallet/aa-4337/core/BaseAccount.sol\n- contracts/smart-contract-wallet/aa-4337/core/BasePaymaster.sol\n- contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol\n- contracts/smart-contract-wallet/aa-4337/core/SenderCreator.sol\n- contracts/smart-contract-wallet/aa-4337/core/StakeManager.sol\n- contracts/smart-contract-wallet/aa-4337/interfaces/IAccount.sol\n- contracts/smart-contract-wallet/aa-4337/interfaces/IAggregatedAccount.sol\n- contracts/smart-contract-wallet/aa-4337/interfaces/IAggregator.sol\n- contracts/smart-contract-wallet/aa-4337/interfaces/IEntryPoint.sol\n- contracts/smart-contract-wallet/aa-4337/interfaces/IPaymaster.sol\n- contracts/smart-contract-wallet/aa-4337/interfaces/IStakeManager.sol\n- contracts/smart-contract-wallet/aa-4337/interfaces/UserOperation.sol\n- contracts/smart-contract-wallet/aa-4337/samples/DepositPaymaster.sol\n- contracts/smart-contract-wallet/aa-4337/samples/IOracle.sol\n- contracts/smart-contract-wallet/aa-4337/samples/SimpleAccount.sol\n- contracts/smart-contract-wallet/aa-4337/samples/SimpleAccountFactory.sol\n- contracts/smart-contract-wallet/aa-4337/samples/SimpleAccountForTokens.sol\n- contracts/smart-contract-wallet/aa-4337/samples/TestAggregatedAccount.sol\n- contracts/smart-contract-wallet/aa-4337/samples/TestAggregatedAccountFactory.sol\n- contracts/smart-contract-wallet/aa-4337/samples/TestSignatureAggregator.sol\n- contracts/smart-contract-wallet/aa-4337/samples/TokenPaymaster.sol\n- contracts/smart-contract-wallet/aa-4337/samples/VerifyingPaymaster.sol\n- contracts/smart-contract-wallet/aa-4337/test/TestCounter.sol\n- contracts/smart-contract-wallet/aa-4337/test/TestExpirePaymaster.sol\n- contracts/smart-contrac", "vulnerable_code": "contracts/smart-contract-wallet/SmartAccount.sol::234 => uint256 payment = 0;\ncontracts/smart-contract-wallet/SmartAccount.sol::310 => uint256 i = 0;\ncontracts/smart-contract-wallet/SmartAccount.sol::468 => for (uint i = 0; i < dest.length;) {\ncontracts/smart-contract-wallet/SmartAccountNoAuth.sol::234 => uint256 payment = 0;\ncontracts/smart-contract-wallet/SmartAccountNoAuth.sol::305 => uint256 i = 0;\ncontracts/smart-contract-wallet/SmartAccountNoAuth.sol::458 => for (uint i = 0; i < dest.length;) {\ncontracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol::74 => for (uint256 i = 0; i < opslen; i++) {\ncontracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol::78 => uint256 collected = 0;\ncontracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol::80 => for (uint256 i = 0; i < opslen; i++) {\ncontracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol::99 => uint256 totalOps = 0;\ncontracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol::100 => for (uint256 i = 0; i < opasLen; i++) {\ncontracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol::106 => uint256 opIndex = 0;\ncontracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol::107 => for (uint256 a = 0; a < opasLen; a++) {\ncontracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol::112 => for (uint256 i = 0; i < opslen; i++) {\ncontracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol::126 => uint256 collected = 0;\ncontracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol::128 => for (uint256 a = 0; a < opasLen; a++) {\ncontracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol::134 => for (uint256 i = 0; i < opslen; i++) {\ncontracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol::313 => uint256 missingAccountFunds = 0;\ncontracts/smart-contract-wallet/aa-4337/samples/SimpleAccount.sol::71 => for (uint256 i = 0; i < dest.length; i++) {\ncontracts/smart-contract-wallet/aa-4337/samples/TestSignatureAggregator.sol::18 => uint sum = 0;\ncontracts/smart-contract-wallet/aa-4337/samples/TestSignatureAggregato", "fixed_code": "contracts/smart-contract-wallet/BaseSmartAccount.sol::64 => if (userOp.initCode.length == 0) {\ncontracts/smart-contract-wallet/SmartAccount.sol::199 => // ~= 21k + calldata.length * [1/3 * 16 + 2/3 * 4]\ncontracts/smart-contract-wallet/SmartAccount.sol::200 => uint256 startGas = gasleft() + 21000 + msg.data.length * 8;\ncontracts/smart-contract-wallet/SmartAccount.sol::201 => //console.log(\"init %s\", 21000 + msg.data.length * 8);\ncontracts/smart-contract-wallet/SmartAccount.sol::324 => // Check that signature data pointer (s) is in bounds (points to the length of data -> 32 bytes)\ncontracts/smart-contract-wallet/SmartAccount.sol::325 => require(uint256(s) + 32 <= signatures.length, \"BSA022\");\ncontracts/smart-contract-wallet/SmartAccount.sol::327 => // Check if the contract signature is in bounds: start of data is s + 32 and end is start + signature length\ncontracts/smart-contract-wallet/SmartAccount.sol::333 => require(uint256(s) + 32 + contractSignatureLen <= signatures.length, \"BSA023\");\ncontracts/smart-contract-wallet/SmartAccount.sol::467 => require(dest.length == func.length, \"wrong array lengths\");\ncontracts/smart-contract-wallet/SmartAccount.sol::468 => for (uint i = 0; i < dest.length;) {\ncontracts/smart-contract-wallet/SmartAccountNoAuth.sol::199 => // ~= 21k + calldata.length * [1/3 * 16 + 2/3 * 4]\ncontracts/smart-contract-wallet/SmartAccountNoAuth.sol::200 => uint256 startGas = gasleft() + 21000 + msg.data.length * 8;\ncontracts/smart-contract-wallet/SmartAccountNoAuth.sol::201 => //console.log(\"init %s\", 21000 + msg.data.length * 8);\ncontracts/smart-contract-wallet/SmartAccountNoAuth.sol::319 => // Check that signature data pointer (s) is in bounds (points to the length of data -> 32 bytes)\ncontracts/smart-contract-wallet/SmartAccountNoAuth.sol::320 => require(uint256(s) + 32 <= signatures.length, \"BSA022\");\ncontracts/smart-contract-wallet/SmartAccountNoAuth.sol::322 => // Check if the contract signature is in bounds: start of data is ", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/ballx-G.md", "collected_at": "2026-01-02T18:13:32.370602+00:00", "source_hash": "8cbe7bb37cb487c9d88940654256f76d036c9aec1314ba26fbc886126e328596", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "contracts/smart-contract-wallet/SmartAccount.sol::234 => uint256 payment = 0;\ncontracts/smart-contract-wallet/SmartAccount.sol::310 => uint256 i = 0;\ncontracts/smart-contract-wallet/SmartAccount.sol::468 => for (uint i = 0; i < dest.length;) {\ncontracts/smart-contract-wallet/SmartAccountNoAuth.sol::234 => uint256 payment = 0;\ncontracts/smart-contract-wallet/SmartAccountNoAuth.sol::305 => uint256 i = 0;\ncontracts/smart-contract-wallet/SmartAccountNoAuth.sol::458 => for (uint i = 0; i < dest.length;) {\ncontracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol::74 => for (uint256 i = 0; i < opslen; i++) {\ncontracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol::78 => uint256 collected = 0;\ncontracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol::80 => for (uint256 i = 0; i < opslen; i++) {\ncontracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol::99 => uint256 totalOps = 0;\ncontracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol::100 => for (uint256 i = 0; i < opasLen; i++) {\ncontracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol::106 => uint256 opIndex = 0;\ncontracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol::107 => for (uint256 a = 0; a < opasLen; a++) {\ncontracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol::112 => for (uint256 i = 0; i < opslen; i++) {\ncontracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol::126 => uint256 collected = 0;\ncontracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol::128 => for (uint256 a = 0; a < opasLen; a++) {\ncontracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol::134 => for (uint256 i = 0; i < opslen; i++) {\ncontracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol::313 => uint256 missingAccountFunds = 0;\ncontracts/smart-contract-wallet/aa-4337/samples/SimpleAccount.sol::71 => for (uint256 i = 0; i < dest.length; i++) {\ncontracts/smart-contract-wallet/aa-4337/samples/TestSignatureAggregator.sol::18 => uint sum = 0;\ncontracts/smart-contract-wallet/aa-4337/samples/TestSignatureAggregato", "has_vulnerable_code_snippet": true, "fixed_code_actual": "contracts/smart-contract-wallet/BaseSmartAccount.sol::64 => if (userOp.initCode.length == 0) {\ncontracts/smart-contract-wallet/SmartAccount.sol::199 => // ~= 21k + calldata.length * [1/3 * 16 + 2/3 * 4]\ncontracts/smart-contract-wallet/SmartAccount.sol::200 => uint256 startGas = gasleft() + 21000 + msg.data.length * 8;\ncontracts/smart-contract-wallet/SmartAccount.sol::201 => //console.log(\"init %s\", 21000 + msg.data.length * 8);\ncontracts/smart-contract-wallet/SmartAccount.sol::324 => // Check that signature data pointer (s) is in bounds (points to the length of data -> 32 bytes)\ncontracts/smart-contract-wallet/SmartAccount.sol::325 => require(uint256(s) + 32 <= signatures.length, \"BSA022\");\ncontracts/smart-contract-wallet/SmartAccount.sol::327 => // Check if the contract signature is in bounds: start of data is s + 32 and end is start + signature length\ncontracts/smart-contract-wallet/SmartAccount.sol::333 => require(uint256(s) + 32 + contractSignatureLen <= signatures.length, \"BSA023\");\ncontracts/smart-contract-wallet/SmartAccount.sol::467 => require(dest.length == func.length, \"wrong array lengths\");\ncontracts/smart-contract-wallet/SmartAccount.sol::468 => for (uint i = 0; i < dest.length;) {\ncontracts/smart-contract-wallet/SmartAccountNoAuth.sol::199 => // ~= 21k + calldata.length * [1/3 * 16 + 2/3 * 4]\ncontracts/smart-contract-wallet/SmartAccountNoAuth.sol::200 => uint256 startGas = gasleft() + 21000 + msg.data.length * 8;\ncontracts/smart-contract-wallet/SmartAccountNoAuth.sol::201 => //console.log(\"init %s\", 21000 + msg.data.length * 8);\ncontracts/smart-contract-wallet/SmartAccountNoAuth.sol::319 => // Check that signature data pointer (s) is in bounds (points to the length of data -> 32 bytes)\ncontracts/smart-contract-wallet/SmartAccountNoAuth.sol::320 => require(uint256(s) + 32 <= signatures.length, \"BSA022\");\ncontracts/smart-contract-wallet/SmartAccountNoAuth.sol::322 => // Check if the contract signature is in bounds: start of data is ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "06-lybra", "title": "Rolezn Q", "severity_raw": "Critical", "severity": "critical", "description": "## QA Summary\n\n### Low Risk Issues\n| |Issue|Contexts|\n|-|:-|:-:|\n| [LOW‑1](#LOW‑1) | IERC20 `approve()` Is Deprecated | 2 |\n| [LOW‑2](#LOW‑2) | Consider the case where `totalsupply` is 0 | 1 |\n| [LOW‑3](#LOW‑3) | Do not allow fees to be set to `100%` | 2 |\n| [LOW‑4](#LOW‑4) | External calls in an un-bounded `for-`loop may result in a DOS | 2 |\n| [LOW‑5](#LOW‑5) | Hardcoded String that is repeatedly used can be replaced with a constant | 4 |\n| [LOW‑6](#LOW‑6) | Lack of checks-effects-interactions | 2 |\n| [LOW‑7](#LOW‑7) | Minting tokens to the zero address should be avoided | 1 |\n| [LOW‑8](#LOW‑8) | The Contract Should `approve(0)` First | 2 |\n| [LOW‑9](#LOW‑9) | Contracts are not using their OZ Upgradeable counterparts | 23 |\n| [LOW‑10](#LOW‑10) | There should be an upper limit for flash loan settings | 2 |\n| [LOW‑11](#LOW‑11) | Remove unused code | 8 |\n| [LOW‑12](#LOW‑12) | Unbounded loop | 1 |\n| [LOW‑13](#LOW‑13) | Upgrade OpenZeppelin Contract Dependency | 1 |\n| [LOW‑14](#LOW‑14) | Use `safeTransferOwnership` instead of `transferOwnership` function | 4 |\n| [LOW‑15](#LOW‑15) | `_creditTo` call should avoid setting to 0 `amount` and to zero `address` | 1 |\n\nTotal: 56 contexts over 15 issues\n\n### Non-critical Issues\n| |Issue|Contexts|\n|-|:-|:-:|\n| [NC‑1](#NC‑1) | No need for `== true` or `== false` checks | 1 |\n| [NC‑2](#NC‑2) | Critical Changes Should Use Two-step Procedure | 33 |\n| [NC‑3](#NC‑3) | `block.timestamp` is already used when emitting events, no need to input timestamp | 36 |\n| [NC‑4](#NC‑4) | Immutables can be named using the same convention | 18 |\n| [NC‑5](#NC‑5) | Initial value check is missing in Set Functions | 31 |\n| [NC‑6](#NC‑6) | Omissi", "vulnerable_code": "302: EUSD.approve(address(curvePool), balance);", "fixed_code": "35: lido.approve(address(collateralAsset), msg.value);", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/Rolezn-Q.md", "collected_at": "2026-01-02T18:22:40.420046+00:00", "source_hash": "8cffb094df680b6e22d918e1856224e865114b64ce0c3618189fc37e6a8da3f9", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "302: EUSD.approve(address(curvePool), balance);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "35: lido.approve(address(collateralAsset), msg.value);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-salty", "title": "forkforkdog Q", "severity_raw": "Low", "severity": "low", "description": "## Adding reserves with a large disproportion can lead to subsequent *k* manipulation due to rounding errors \n**Github:** [Liquidity.sol:l146](https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/staking/Liquidity.sol#L146)\n\n### Vulnerability details:\nCalling depositLiquidityAndIncreaseShare() with values that differs more than 1e26, for example 1000 and 10e26, for reserve0 and reserve1 will lead to the situation when subsequent calls of depositLiquidityAndIncreaseShare() with values up to 10e23 for both reserve0 and reserve1 will add 10e23 liquidity to reserve1 and 0 to reserve0. \n\nThis allows attacker influence manipulate k value by adding liquidity only to reserve1 in the loop. \n\nSubsequent swaps will be calculated with manipulated k.\n\n### POC \n```javascript\nfunction testMultipleInteractions() public {\n vm.startPrank(address(collateralAndLiquidity));\n\n IERC20 token0 = new TestERC20(\"TEST\", 18);\n IERC20 token1 = new TestERC20(\"TEST\", 18);\n vm.stopPrank();\n\n vm.prank(address(dao));\n poolsConfig.whitelistPool(pools, token0, token1);\n\n vm.startPrank(address(collateralAndLiquidity));\n\n token0.transfer(\n alice,\n token0.balanceOf(address(collateralAndLiquidity))\n );\n\n token1.transfer(\n alice,\n token1.balanceOf(address(collateralAndLiquidity))\n );\n\n vm.stopPrank();\n\n vm.startPrank(alice);\n token0.approve(address(collateralAndLiquidity), type(uint256).max);\n token1.approve(address(collateralAndLiquidity), type(uint256).max);\n token0.approve(address(pools), type(uint256).max);\n token1.approve(address(pools), type(uint256).max);\n vm.stopPrank();\n\n vm.startPrank(bob);\n token0.approve(address(collateralAndLiquidity), type(uint256).max);\n token1.approve(address(collateralAndLiquidity), type(uint256).max);\n token0.approve(address(pools), type(uint256).max);\n token1.approve(address(pools), type(uint256).max);\n vm.stopPrank();\n\n bytes32", "vulnerable_code": "function testMultipleInteractions() public {\n vm.startPrank(address(collateralAndLiquidity));\n\n IERC20 token0 = new TestERC20(\"TEST\", 18);\n IERC20 token1 = new TestERC20(\"TEST\", 18);\n vm.stopPrank();\n\n vm.prank(address(dao));\n poolsConfig.whitelistPool(pools, token0, token1);\n\n vm.startPrank(address(collateralAndLiquidity));\n\n token0.transfer(\n alice,\n token0.balanceOf(address(collateralAndLiquidity))\n );\n\n token1.transfer(\n alice,\n token1.balanceOf(address(collateralAndLiquidity))\n );\n\n vm.stopPrank();\n\n vm.startPrank(alice);\n token0.approve(address(collateralAndLiquidity), type(uint256).max);\n token1.approve(address(collateralAndLiquidity), type(uint256).max);\n token0.approve(address(pools), type(uint256).max);\n token1.approve(address(pools), type(uint256).max);\n vm.stopPrank();\n\n vm.startPrank(bob);\n token0.approve(address(collateralAndLiquidity), type(uint256).max);\n token1.approve(address(collateralAndLiquidity), type(uint256).max);\n token0.approve(address(pools), type(uint256).max);\n token1.approve(address(pools), type(uint256).max);\n vm.stopPrank();\n\n bytes32 poolID = PoolUtils._poolID(token0, token1);\n {\n vm.startPrank(alice);\n\n token0.transfer(bob, 10 ** 27);\n token1.transfer(bob, 10 ** 27);\n\n collateralAndLiquidity.depositLiquidityAndIncreaseShare(\n token0,\n token1,\n 1000,\n 10 ** 26, //should be >= 10 ** 26\n 0,\n block.timestamp,\n false\n );\n\n vm.warp(block.timestamp + 1 hours);\n vm.stopPrank();\n (uint reserve0middle, uint reserve1middle) = pools.getPoolReserves(\n token0,\n token1\n );\n\n console2.log(\n \"1. k is \",\n (reserve0middle * reserve1middle + 5 * 10 ** 21) / 10 ** 22\n );\n\n vm.startPrank(bob);\n for (uint i; i < 100; ++i) {\n collat", "fixed_code": "", "recommendation": "", "category": "rounding", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/forkforkdog-Q.md", "collected_at": "2026-01-02T19:01:40.805842+00:00", "source_hash": "8d0dff9948d72c245bc43235977aefc287a4e7175769ec6a9217a61f7f1c2e75", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Liquidity.sol#L146", "github_files_list": "Liquidity.sol", "github_refs_count": 1, "vulnerable_code_actual": "function testMultipleInteractions() public {\n vm.startPrank(address(collateralAndLiquidity));\n\n IERC20 token0 = new TestERC20(\"TEST\", 18);\n IERC20 token1 = new TestERC20(\"TEST\", 18);\n vm.stopPrank();\n\n vm.prank(address(dao));\n poolsConfig.whitelistPool(pools, token0, token1);\n\n vm.startPrank(address(collateralAndLiquidity));\n\n token0.transfer(\n alice,\n token0.balanceOf(address(collateralAndLiquidity))\n );\n\n token1.transfer(\n alice,\n token1.balanceOf(address(collateralAndLiquidity))\n );\n\n vm.stopPrank();\n\n vm.startPrank(alice);\n token0.approve(address(collateralAndLiquidity), type(uint256).max);\n token1.approve(address(collateralAndLiquidity), type(uint256).max);\n token0.approve(address(pools), type(uint256).max);\n token1.approve(address(pools), type(uint256).max);\n vm.stopPrank();\n\n vm.startPrank(bob);\n token0.approve(address(collateralAndLiquidity), type(uint256).max);\n token1.approve(address(collateralAndLiquidity), type(uint256).max);\n token0.approve(address(pools), type(uint256).max);\n token1.approve(address(pools), type(uint256).max);\n vm.stopPrank();\n\n bytes32 poolID = PoolUtils._poolID(token0, token1);\n {\n vm.startPrank(alice);\n\n token0.transfer(bob, 10 ** 27);\n token1.transfer(bob, 10 ** 27);\n\n collateralAndLiquidity.depositLiquidityAndIncreaseShare(\n token0,\n token1,\n 1000,\n 10 ** 26, //should be >= 10 ** 26\n 0,\n block.timestamp,\n false\n );\n\n vm.warp(block.timestamp + 1 hours);\n vm.stopPrank();\n (uint reserve0middle, uint reserve1middle) = pools.getPoolReserves(\n token0,\n token1\n );\n\n console2.log(\n \"1. k is \",\n (reserve0middle * reserve1middle + 5 * 10 ** 21) / 10 ** 22\n );\n\n vm.startPrank(bob);\n for (uint i; i < 100; ++i) {\n collat", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "02-ethos", "title": "hl_ Q", "severity_raw": "Low", "severity": "low", "description": "# Table of contents\n\n- [N-01] Insufficient test coverage\n- [N-02] Use `require` instead of `assert`\n- [N-03] Values such as a call to keccak256() should used to `immutable` rather than `constant`\n- [N-04] `0 address` check for `asset`\n- [N-05] Use a more recent version of solidity\n- [N-06] Avoid the use of sensitive terms in favour of neutral ones\n- [N-07] Non-library/interface files should use fixed compiler versions, not floating ones\n- [N-08] Best practice is to prevent signature malleability\n- [N-09] Import exact functions\n- [L-01] `_account` not checked for address(0) \n- [L-02] `_OathAmount` not checked for 0 amount\n\n## [N-01] Insufficient test coverage\nTesting all functions is best practice in terms of security criteria. Noted the current overall line coverage percentage provided by tests is 93. Due to its capacity, test coverage is expected to be 100%.\n\n## [N-02] Use `require` instead of `assert`\n\n`assert` should not be used except for tests; `require` should be used.\n\nPrior to Solidity 0.8.0, pressing a confirm consumes the remainder of the process\u2019s available gas instead of returning it, as request()/revert() did.\n\n`assert()` and `reqire()` -\n\nThe big difference between the two is that the assert()function when false, uses up all the remaining gas and reverts all the changes made.\n\nMeanwhile, a require() function when false, also reverts back all the changes made to the contract but does refund all the remaining gas fees we offered to pay.This is the most common Solidity function used by developers for debugging and error handling.\n\nFor example: \n\n```solidity\nLUSDToken.sol:\n311 function _transfer(address sender, address recipient, uint256 amount) internal {\n312: assert(sender != address(0));\n313: assert(recipient != address(0));\n```\n\n## [N-03] Values such as a call to keccak256() should used to `immutable` rather than `constant`\n\n`constant` and `immutable` variables should each be used in their appropriate contexts: Constants should be used for li", "vulnerable_code": "LUSDToken.sol:\n311 function _transfer(address sender, address recipient, uint256 amount) internal {\n312: assert(sender != address(0));\n313: assert(recipient != address(0));", "fixed_code": "ReaperVaultV2.sol (L73 - 76):\n bytes32 public constant DEPOSITOR = keccak256(\"DEPOSITOR\");\n bytes32 public constant STRATEGIST = keccak256(\"STRATEGIST\");\n bytes32 public constant GUARDIAN = keccak256(\"GUARDIAN\");\n bytes32 public constant ADMIN = keccak256(\"ADMIN\");", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/hl_-Q.md", "collected_at": "2026-01-02T18:17:17.227544+00:00", "source_hash": "8d131c30a875cab4f5ced3af58c7e681a01133eaf2490834c84fdc23de883f16", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 182, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "LUSDToken.sol:\n311 function _transfer(address sender, address recipient, uint256 amount) internal {\n312: assert(sender != address(0));\n313: assert(recipient != address(0));", "primary_code_language": "solidity", "primary_code_char_count": 182, "all_code_blocks": "// Code block 1 (solidity):\nLUSDToken.sol:\n311 function _transfer(address sender, address recipient, uint256 amount) internal {\n312: assert(sender != address(0));\n313: assert(recipient != address(0));", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "LUSDToken.sol:\n311 function _transfer(address sender, address recipient, uint256 amount) internal {\n312: assert(sender != address(0));\n313: assert(recipient != address(0));", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "LUSDToken.sol:\n311 function _transfer(address sender, address recipient, uint256 amount) internal {\n312: assert(sender != address(0));\n313: assert(recipient != address(0));", "has_vulnerable_code_snippet": true, "fixed_code_actual": "ReaperVaultV2.sol (L73 - 76):\n bytes32 public constant DEPOSITOR = keccak256(\"DEPOSITOR\");\n bytes32 public constant STRATEGIST = keccak256(\"STRATEGIST\");\n bytes32 public constant GUARDIAN = keccak256(\"GUARDIAN\");\n bytes32 public constant ADMIN = keccak256(\"ADMIN\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "06-lybra", "title": "btk Q", "severity_raw": "Low", "severity": "low", "description": "| Issues Summarize|\n|-----------------|\n\n| Risk | Issues Details |\n|---------|---------------------------------------------------------------------------------------------------------------|\n| [QA-01] | Owner may delete all the pools unintentionally |\n| [QA-02] | Loss of precision due to division before multiplication |\n\n### [QA-01] Owner may delete all the pools unintentionally\n\n#### Impact\n\nThe [`EUSDMiningIncentives.setPools()`](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/miner/EUSDMiningIncentives.sol#L93-L98) function has a bad design where all pools can be unintentionally deleted. This can render the contract unusable if the owner adds a single pool.\n\n```solidity\n function setPools(address[] memory _pools) external onlyOwner {\n for (uint i = 0; i < _pools.length; i++) {\n require(configurator.mintVault(_pools[i]), \"NOT_VAULT\");\n }\n pools = _pools;\n }\n```\n\nThe current implementation overwrites the existing pool list with the new input, causing an unintentional deletion of all pools except the ones provided as arguments.\n\n#### Tools Used\n\nManual Review\n\n#### Recommended Mitigation Steps\n\nWe rcommend updating the function as follow:\n\n```solidity\n function setPools(address[] memory _pools) external onlyOwner {\n for (uint i = 0; i < _pools.length; i++) {\n require(configurator.mintVault(_pools[i]), \"NOT_VAULT\");\n pools.push(_pools[i]);\n }\n }\n```\n\n### [QA-02] Loss of precision due to division before multiplication\n\n#### Impact\n\n`collateralAmount` incurs a precision loss due to division before multiplication. As a result, users will receive less collateral than they are entitled to.\n\n#### Proof of Concept\n\n```solidity\n uint256 collateralAmount = (", "vulnerable_code": " function setPools(address[] memory _pools) external onlyOwner {\n for (uint i = 0; i < _pools.length; i++) {\n require(configurator.mintVault(_pools[i]), \"NOT_VAULT\");\n }\n pools = _pools;\n }", "fixed_code": " function setPools(address[] memory _pools) external onlyOwner {\n for (uint i = 0; i < _pools.length; i++) {\n require(configurator.mintVault(_pools[i]), \"NOT_VAULT\");\n pools.push(_pools[i]);\n }\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/btk-Q.md", "collected_at": "2026-01-02T18:22:53.011165+00:00", "source_hash": "8d73a3c1a72f45960466d7b20692efecb3f258089df650800545cd4daa4b5683", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 457, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function setPools(address[] memory _pools) external onlyOwner {\n for (uint i = 0; i < _pools.length; i++) {\n require(configurator.mintVault(_pools[i]), \"NOT_VAULT\");\n }\n pools = _pools;\n }", "primary_code_language": "solidity", "primary_code_char_count": 223, "all_code_blocks": "// Code block 1 (solidity):\nfunction setPools(address[] memory _pools) external onlyOwner {\n for (uint i = 0; i < _pools.length; i++) {\n require(configurator.mintVault(_pools[i]), \"NOT_VAULT\");\n }\n pools = _pools;\n }\n\n// Code block 2 (solidity):\nfunction setPools(address[] memory _pools) external onlyOwner {\n for (uint i = 0; i < _pools.length; i++) {\n require(configurator.mintVault(_pools[i]), \"NOT_VAULT\");\n pools.push(_pools[i]);\n }\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function setPools(address[] memory _pools) external onlyOwner {\n for (uint i = 0; i < _pools.length; i++) {\n require(configurator.mintVault(_pools[i]), \"NOT_VAULT\");\n }\n pools = _pools;\n }\n\nfunction setPools(address[] memory _pools) external onlyOwner {\n for (uint i = 0; i < _pools.length; i++) {\n require(configurator.mintVault(_pools[i]), \"NOT_VAULT\");\n pools.push(_pools[i]);\n }\n }", "github_refs_formatted": "EUSDMiningIncentives.sol#L93-L98", "github_files_list": "EUSDMiningIncentives.sol", "github_refs_count": 1, "vulnerable_code_actual": " function setPools(address[] memory _pools) external onlyOwner {\n for (uint i = 0; i < _pools.length; i++) {\n require(configurator.mintVault(_pools[i]), \"NOT_VAULT\");\n }\n pools = _pools;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function setPools(address[] memory _pools) external onlyOwner {\n for (uint i = 0; i < _pools.length; i++) {\n require(configurator.mintVault(_pools[i]), \"NOT_VAULT\");\n pools.push(_pools[i]);\n }\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "03-asymmetry", "title": "0xdaydream G", "severity_raw": "High", "severity": "high", "description": "# Details\n\n| Number | Optimization Details | Instances | Total Gas Saved |\n|---|---|---|---|\n| [G-01] | With assembly, `.call (bool success)` transfer can be done gas-optimized | 5 | 594 |\n| [G-02] | Functions guaranteed to revert when callled by normal users can be marked `payable` | 9 | 192 |\n| [G-03] | Setting the _constructor_ to `payable` | 4 | - |\n| [G-04] | Usage of uints/ints smaller than 32 bytes (256 bits) incurs overhead | 2 | - |\n| [G-05] | Use a more recent version of solidity | 4 | - |\n| [G-06] | Optimize names to save gas | - | - |\n\nTotal: 24 instances over 6 issues with **786 gas** saved\n\nAll values above are runtime, not deployment, values; deployment values are listed in the individual issue descriptions.\n\n\n## [G-01] With assembly, `.call (bool success)` transfer can be done gas-optimized\n\n`return` data `(bool success,)` has to be stored due to EVM architecture, but in a usage like below, 'out' and 'outsize' values are given (0,0), this storage disappears and gas optimization is provided.\n\nhttps://twitter.com/pashovkrum/status/1607024043718316032?t=xs30iD6ORWtE2bTTYsCFIQ&s=19\n\n5 instances - 4 files:\n\n```diff\ncontracts/SafEth/SafEth.sol#L124:\n- (bool sent, ) = address(msg.sender).call{value: ethAmountToWithdraw}(\n- \"\"\n- );\n+ bool sent; \n+ address sender = msg.sender;\n+ // solhint-disable-next-line\n+ assembly { \n+ sent := call(gas(), sender, ethAmountToWithdraw, 0, 0, 0, 0)\n+ }\n```\n[SafEth.sol#L124](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L124)\n\n```solidity\ncontracts/SafEth/derivatives/Reth.sol#L110:\n110: (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n111: \"\"\n112: );\n```\n[Reth.sol#L110](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L110)\n\n```solidity\ncontracts/SafEth/d", "vulnerable_code": "[SafEth.sol#L124](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L124)\n", "fixed_code": "[Reth.sol#L110](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L110)\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/0xdaydream-G.md", "collected_at": "2026-01-02T18:17:40.489196+00:00", "source_hash": "8d842137cf06667cb831e947041ae1fb04004004dde11b730c1a5054bce34e38", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 574, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "contracts/SafEth/SafEth.sol#L124:\n- (bool sent, ) = address(msg.sender).call{value: ethAmountToWithdraw}(\n- \"\"\n- );\n+ bool sent; \n+ address sender = msg.sender;\n+ // solhint-disable-next-line\n+ assembly { \n+ sent := call(gas(), sender, ethAmountToWithdraw, 0, 0, 0, 0)\n+ }", "primary_code_language": "diff", "primary_code_char_count": 413, "all_code_blocks": "// Code block 1 (diff):\ncontracts/SafEth/SafEth.sol#L124:\n- (bool sent, ) = address(msg.sender).call{value: ethAmountToWithdraw}(\n- \"\"\n- );\n+ bool sent; \n+ address sender = msg.sender;\n+ // solhint-disable-next-line\n+ assembly { \n+ sent := call(gas(), sender, ethAmountToWithdraw, 0, 0, 0, 0)\n+ }\n\n// Code block 2 (solidity):\ncontracts/SafEth/derivatives/Reth.sol#L110:\n110: (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n111: \"\"\n112: );", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "contracts/SafEth/SafEth.sol#L124:\n- (bool sent, ) = address(msg.sender).call{value: ethAmountToWithdraw}(\n- \"\"\n- );\n+ bool sent; \n+ address sender = msg.sender;\n+ // solhint-disable-next-line\n+ assembly { \n+ sent := call(gas(), sender, ethAmountToWithdraw, 0, 0, 0, 0)\n+ }", "solidity_code": "contracts/SafEth/derivatives/Reth.sol#L110:\n110: (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n111: \"\"\n112: );", "github_refs_formatted": "SafEth.sol#L124, Reth.sol#L110", "github_files_list": "Reth.sol, SafEth.sol", "github_refs_count": 2, "vulnerable_code_actual": "[SafEth.sol#L124](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L124)\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "[Reth.sol#L110](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L110)\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "02-ethos", "title": "ABA Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA Report for Ethos Reserve contest\n\n## Overview\nDuring the audit, 7 low and 14 non-critical issues were found.\n\n### Low Risk Issues\n\nTotal: 11 instances over 7 issues\n\n|#|Issue|Instances|\n|-|:-|:-:|\n| [L-01] | `hasPendingRewards` only checks for pending collateral rewards and not for pending LUSD Debt Rewards | 1 | \n| [L-02] | Fallback price oracle Tellor can be easily manipulated | 1 |\n| [L-03] | Local variables or function arguments declared as `storage` without actual need | 5 | \n| [L-04] | `setHarvestSteps` accepts an empty array which simply deletes the steps | 1 | \n| [L-05] | `updateStrategyFeeBPS` should have differentiating behavior when `emergencyShutdown` is set | 1 | \n| [L-06] | Ambiguous implementation of `setWithdrawalQueue` may lead to unforeseen issues | 1 | \n| [L-07] | There is no way to completely remove a strategy from the ReaperVault | 1 | \n\n### Non-critical Issues\n\nTotal: 29 instances over 14 issues\n\n|#|Issue|Instances|\n|-|:-|:-:|\n|[NC-01]| `updateCollateralRatios` accepts redundant updating with the same values | 1 |\n|[NC-02]| Not enough tests for calculating collateral surplus in a sub-case of recovery mode | 6 |\n|[NC-03]| Use \"type(uint256).max\" instead of \"uint256(-1)\" | 1 |\n|[NC-04]| Inconsistent event emission syntax used | 2 |\n|[NC-05]| Incomplete require error messages | 2 |\n|[NC-06]| Unused code | 1 |\n|[NC-07]| Missing events for critical parameter changes | 3 |\n|[NC-08]| `_requireValidMaxFeePercentage` can be rewritten to optimize calculations | 1 |\n|[NC-09]| `_cascadingAccessRoles` can be pure instead of view | 2 |\n|[NC-10]| Dead Comments | 1 |\n|[NC-11]| Inconsistent shares calculation across code base | 2 |\n|[NC-12]| Open TODOs | 3 |\n|[NC-13]| Already declared variable not reused | 2 |\n|[NC-14]| Functions do not respect camelCase naming convention | 2 |\n\n\n## Low Risk Issues (7)\n#\n### [L-01] `hasPendingRewards` only checks for pending collateral rewards and not for pending LUSD Debt Rewards\n##### Description\n\n`applyPendingRewards` f", "vulnerable_code": " function applyPendingRewards(address _borrower, address _collateral) external override {\n _requireCallerIsBorrowerOperationsOrRedemptionHelper();\n return _applyPendingRewards(activePool, defaultPool, _borrower, _collateral);\n }\n\n\n // Add the borrowers's coll and debt rewards earned from redistributions, to their Trove\n function _applyPendingRewards(IActivePool _activePool, IDefaultPool _defaultPool, address _borrower, address _collateral) internal {\n if (hasPendingRewards(_borrower, _collateral)) {", "fixed_code": " return (rewardSnapshots[_borrower][_collateral].collAmount < L_Collateral[_collateral]);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/ABA-Q.md", "collected_at": "2026-01-02T18:15:55.898692+00:00", "source_hash": "8d9c18891e70726acf212b3428a84aac199837b601ae9c580ce9e79643256935", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function applyPendingRewards(address _borrower, address _collateral) external override {\n _requireCallerIsBorrowerOperationsOrRedemptionHelper();\n return _applyPendingRewards(activePool, defaultPool, _borrower, _collateral);\n }\n\n\n // Add the borrowers's coll and debt rewards earned from redistributions, to their Trove\n function _applyPendingRewards(IActivePool _activePool, IDefaultPool _defaultPool, address _borrower, address _collateral) internal {\n if (hasPendingRewards(_borrower, _collateral)) {", "has_vulnerable_code_snippet": true, "fixed_code_actual": " return (rewardSnapshots[_borrower][_collateral].collAmount < L_Collateral[_collateral]);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "06-lybra", "title": "itzr Q", "severity_raw": "Critical", "severity": "critical", "description": "\n# Issue 1 \n\n## `TIMELOCK` role is not assigned to any address/account\n\nIn `GovernanceTimelock::constructor`, roles and role admins are granted, yet the `TIMELOCK` role is not assigned to any address.\n\n```\nconstructor(uint256 minDelay, address[] memory proposers, address[] memory executors, address admin) TimelockController(minDelay, proposers, executors, admin) {\n _setRoleAdmin(DAO, GOV);\n _setRoleAdmin(TIMELOCK, GOV);\n _setRoleAdmin(ADMIN, GOV);\n _grantRole(DAO, address(this));\n _grantRole(DAO, msg.sender);\n _grantRole(GOV, msg.sender);\n}\n```\nFailure to grant the `TIMELOCK` role to any address means that the protocol is not upgradable via DAO Governance, since `LybraGovernance::_execute` requires: `(GovernanceTimelock.checkOnlyRole(keccak256(\"TIMELOCK\"), msg.sender), \"not authorized\");`\n\nThis is not a critical bug since the team can grant roles at a future date, however on deployment `LybraGovernance::_execute` will not run.\n\nIt is recommended to grant the address of `AdminTimelock` with the `TIMELOCK` role within the `GovernanceTimelock::constructor` and open source the deployment script.\n\n# Issue 2 \n\n## Both `msg.sender` and `address(this)` control the DAO\n\nThe v2 docs claim that `The Lybra protocol is governed by esLBR token holders`, and in `LybraConfigurator` it's stated that the `DAO` is `A time-locked contract initiated by esLBR voting, with a minimum effective period of 14 days. After the vote is passed, only the developer can execute the action`. However, in `GovernanceTimelock::constructor`, `msg.sender` is assigned with the `DAO` role and given full administrative rights over role assignment via `GOV`. So long as this is the case, the protocol remains 100% in the control of the core team, not the DAO.\n\n\n```\nconstructor(uint256 minDelay, address[] memory proposers, address[] memory executors, address admin) TimelockController(minDelay, proposers, executors, admin) {\n _setRoleAdmin(DAO, GOV);\n _setRoleAdmin(TIMELOCK, GOV);\n _setRoleAdmin", "vulnerable_code": "constructor(uint256 minDelay, address[] memory proposers, address[] memory executors, address admin) TimelockController(minDelay, proposers, executors, admin) {\n _setRoleAdmin(DAO, GOV);\n _setRoleAdmin(TIMELOCK, GOV);\n _setRoleAdmin(ADMIN, GOV);\n _grantRole(DAO, address(this));\n _grantRole(DAO, msg.sender);\n _grantRole(GOV, msg.sender);\n}", "fixed_code": "constructor(uint256 minDelay, address[] memory proposers, address[] memory executors, address admin) TimelockController(minDelay, proposers, executors, admin) {\n _setRoleAdmin(DAO, GOV);\n _setRoleAdmin(TIMELOCK, GOV);\n _setRoleAdmin(ADMIN, GOV);\n _grantRole(DAO, address(this));\n _grantRole(DAO, msg.sender);\n _grantRole(GOV, msg.sender);\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/itzr-Q.md", "collected_at": "2026-01-02T18:23:01.513213+00:00", "source_hash": "8da1978be2551fab05891268aeedea426082b7fbd0489b11c6718fd6d765b25f", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 352, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "constructor(uint256 minDelay, address[] memory proposers, address[] memory executors, address admin) TimelockController(minDelay, proposers, executors, admin) {\n _setRoleAdmin(DAO, GOV);\n _setRoleAdmin(TIMELOCK, GOV);\n _setRoleAdmin(ADMIN, GOV);\n _grantRole(DAO, address(this));\n _grantRole(DAO, msg.sender);\n _grantRole(GOV, msg.sender);\n}", "primary_code_language": "unknown", "primary_code_char_count": 352, "all_code_blocks": "// Code block 1 (unknown):\nconstructor(uint256 minDelay, address[] memory proposers, address[] memory executors, address admin) TimelockController(minDelay, proposers, executors, admin) {\n _setRoleAdmin(DAO, GOV);\n _setRoleAdmin(TIMELOCK, GOV);\n _setRoleAdmin(ADMIN, GOV);\n _grantRole(DAO, address(this));\n _grantRole(DAO, msg.sender);\n _grantRole(GOV, msg.sender);\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "constructor(uint256 minDelay, address[] memory proposers, address[] memory executors, address admin) TimelockController(minDelay, proposers, executors, admin) {\n _setRoleAdmin(DAO, GOV);\n _setRoleAdmin(TIMELOCK, GOV);\n _setRoleAdmin(ADMIN, GOV);\n _grantRole(DAO, address(this));\n _grantRole(DAO, msg.sender);\n _grantRole(GOV, msg.sender);\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "constructor(uint256 minDelay, address[] memory proposers, address[] memory executors, address admin) TimelockController(minDelay, proposers, executors, admin) {\n _setRoleAdmin(DAO, GOV);\n _setRoleAdmin(TIMELOCK, GOV);\n _setRoleAdmin(ADMIN, GOV);\n _grantRole(DAO, address(this));\n _grantRole(DAO, msg.sender);\n _grantRole(GOV, msg.sender);\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "10-badger", "title": "Madalad Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA Report\n\n## Low Risk\n| |Issue|Instances|\n|:-:|:-|:-:|\n|[[L-01]](#l-01-potential-dos-if-constantimmutable-address-becomes-blacklisted)|Potential DOS if `constant`/`immutable` address becomes blacklisted|1|\n|[[L-02]](#l-02-chainlink-aggregators-return-the-incorrect-price-if-it-drops-below-minanswer)|Chainlink aggregators return the incorrect price if it drops below `minAnswer`|3|\n|[[L-03]](#l-03-fee-on-transferrebasing-tokens-not-properly-accounted-for)|Fee on transfer/rebasing tokens not properly accounted for|3|\n|[[L-04]](#l-04-user-facing-functions-should-have-address0-checks)|User facing functions should have `address(0)` checks|38|\n|[[L-05]](#l-05-missing-address0-checks-when-assigning-to-address-state-variables)|Missing `address(0)` checks when assigning to `address` state variables|1|\n|[[L-06]](#l-06-approval-may-revert-if-current-allowance-is-non-zero)|Approval may revert if current allowance is non-zero|1|\n|[[L-07]](#l-07-use-require-instead-of-assert)|Use `require` instead of `assert`|1|\n|[[L-08]](#l-08-missing-contract-existence-check-for-yul-call)|Missing contract existence check for yul `call`|3|\n|[[L-09]](#l-09-lack-of-two-step-update-for-critical-functions)|Lack of two-step update for critical functions|17|\n|[[L-10]](#l-10-contract-deployment-is-vulnerable-to-block-re-orgs)|Contract deployment is vulnerable to block re-orgs|1|\n|[[L-11]](#l-11-division-before-multiplications-leads-to-precision-loss)|Division before multiplications leads to precision loss|1|\n|[[L-12]](#l-12-numbers-downcast-to-address-may-result-in-collisions)|Numbers downcast to `address` may result in collisions|1|\n|[[L-13]](#l-13-decimals-is-not-part-of-the-erc20-standard)|`decimals()` is not part of the ERC20 standard|4|\n|[[L-14]](#l-14-erc20-may-revert-on-zero-transfer)|ERC20 may revert on zero transfer|7|\n|[[L-15]](#l-15-soliditys-ecrecover-is-vulnerable-to-signature-malleability)|Solidity's `ecrecover` is vulnerable to signature malleability|2|\n|[[L-16]](#l-16-consider-bounding", "vulnerable_code": "File: packages/contracts/contracts/CollSurplusPool.sol\n\n148: IERC20(token).safeTransfer(feeRecipientAddress, amount);\n", "fixed_code": "File: packages/contracts/contracts/PriceFeed.sol\n\n634: try ETH_BTC_CL_FEED.latestRoundData() returns (\n635: uint80 roundId,\n636: int256 answer,\n637: uint256,\n638: /* startedAt */\n639: uint256 timestamp,\n640: uint80 /* answeredInRound */\n641: ) {\n\n650: try STETH_ETH_CL_FEED.latestRoundData() returns (\n651: uint80 roundId,\n652: int256 answer,\n653: uint256,\n654: /* startedAt */\n655: uint256 timestamp,\n656: uint80 /* answeredInRound */\n657: ) {\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/Madalad-Q.md", "collected_at": "2026-01-02T18:26:34.701616+00:00", "source_hash": "8df2c1b8a029728788d0f9e633f97f333e7bed7780e1ef58f09d51564ef0c587", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: packages/contracts/contracts/CollSurplusPool.sol\n\n148: IERC20(token).safeTransfer(feeRecipientAddress, amount);\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: packages/contracts/contracts/PriceFeed.sol\n\n634: try ETH_BTC_CL_FEED.latestRoundData() returns (\n635: uint80 roundId,\n636: int256 answer,\n637: uint256,\n638: /* startedAt */\n639: uint256 timestamp,\n640: uint80 /* answeredInRound */\n641: ) {\n\n650: try STETH_ETH_CL_FEED.latestRoundData() returns (\n651: uint80 roundId,\n652: int256 answer,\n653: uint256,\n654: /* startedAt */\n655: uint256 timestamp,\n656: uint80 /* answeredInRound */\n657: ) {\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "11-kelp", "title": "Walter G", "severity_raw": "Low", "severity": "low", "description": "## NodeDelegator\n1) IERC20(token) in line 60(https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/NodeDelegator.sol#L60) could be implemented directly inside the lines without creating temp variable,following the standard of other functions like ``maxApproveToEigenStrategyManager``,in this way every call of the ``depositAssetIntoStrategy`` will save 2 gas by re-writing the depositAssetIntoStrategy function like this:\n```\n function depositAssetIntoStrategy(address asset)\n external\n override\n whenNotPaused\n nonReentrant\n onlySupportedAsset(asset)\n onlyLRTManager\n {\n address strategy = lrtConfig.assetStrategy(asset);\n address eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);\n\n uint256 balance = IERC20(asset).balanceOf(address(this));\n\n emit AssetDepositIntoStrategy(asset, strategy, balance);\n\n IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), IERC20(asset), balance);\n }\n```", "vulnerable_code": " function depositAssetIntoStrategy(address asset)\n external\n override\n whenNotPaused\n nonReentrant\n onlySupportedAsset(asset)\n onlyLRTManager\n {\n address strategy = lrtConfig.assetStrategy(asset);\n address eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);\n\n uint256 balance = IERC20(asset).balanceOf(address(this));\n\n emit AssetDepositIntoStrategy(asset, strategy, balance);\n\n IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), IERC20(asset), balance);\n }", "fixed_code": "", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/Walter-G.md", "collected_at": "2026-01-02T18:27:43.897994+00:00", "source_hash": "8e12c568d4ce70304bc7245460b1544acc48a7ab7f6566b7290a1a6d1a142fe9", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 628, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function depositAssetIntoStrategy(address asset)\n external\n override\n whenNotPaused\n nonReentrant\n onlySupportedAsset(asset)\n onlyLRTManager\n {\n address strategy = lrtConfig.assetStrategy(asset);\n address eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);\n\n uint256 balance = IERC20(asset).balanceOf(address(this));\n\n emit AssetDepositIntoStrategy(asset, strategy, balance);\n\n IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), IERC20(asset), balance);\n }", "primary_code_language": "unknown", "primary_code_char_count": 628, "all_code_blocks": "// Code block 1 (unknown):\nfunction depositAssetIntoStrategy(address asset)\n external\n override\n whenNotPaused\n nonReentrant\n onlySupportedAsset(asset)\n onlyLRTManager\n {\n address strategy = lrtConfig.assetStrategy(asset);\n address eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);\n\n uint256 balance = IERC20(asset).balanceOf(address(this));\n\n emit AssetDepositIntoStrategy(asset, strategy, balance);\n\n IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), IERC20(asset), balance);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "NodeDelegator.sol#L60", "github_files_list": "NodeDelegator.sol", "github_refs_count": 1, "vulnerable_code_actual": " function depositAssetIntoStrategy(address asset)\n external\n override\n whenNotPaused\n nonReentrant\n onlySupportedAsset(asset)\n onlyLRTManager\n {\n address strategy = lrtConfig.assetStrategy(asset);\n address eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);\n\n uint256 balance = IERC20(asset).balanceOf(address(this));\n\n emit AssetDepositIntoStrategy(asset, strategy, balance);\n\n IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), IERC20(asset), balance);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5.2} {"source": "c4", "protocol": "05-ajna", "title": "Raihan G", "severity_raw": "High", "severity": "high", "description": "# Gas optimization\n\n### Note: The Last types 5 Not Find by Bots completly ([G-33],[G-34],[G-35],[G-36],[G-37])\n\n## Summary\n| | Issue | Instance |\n|------|----------|------------|\n|[G\u201101]| Use\u00a0calldata\u00a0instead of\u00a0memory | 14 |\n|[G-02]| Can Make The Variable Outside The Loop To Save Gas | 3 |\n|[G-03]| Access mappings directly rather than using accessor functions | 4 |\n|[G-04]| Use assembly to write address storage values | 1 |\n|[G-05]| A modifier used only once and not being inherited should be inlined to save gas | 1 |\n|[G-06]|Use double if statements instead of && | 4 | \n|[G-07]| Make 3 event parameters indexed when possible | 6 |\n|[G-08]| Sort Solidity operations using short-circuit mode\u00a0| 10 |\n|[G-09]|\u00a0public\u00a0functions to\u00a0external | 1 |\n|[G-10]| Expressions for constant values such as a call to\u00a0keccak256(), should use immutable rather than constant | 2 |\n|[G-11]| Unnecessary computation | 2 |\n|[G-12]|\u00a0>=\u00a0costs less gas than\u00a0> | 4 |\n|[G-13]| internal functions not called by the contract should be removed to save deployment gas | 6 |\n|[G-14]| Initialize variables with no default value | 24 |\n|[G-15]| Amounts should be checked for\u00a00\u00a0before calling a transfer | 1 |\n|[G-16]| abi.encode()\u00a0is less efficient than\u00a0abi.encodePacked() | 7 |\n|[G-17]| Using\u00a0bools for storage incurs overhead | 6 |\n|[G-18]| Do not calculate constants | 6 |\n|[G-19]|Delete variables that you don\u2019t need | 6 |\n|[G-20]|Do not shrink Variables | 7 |\n|[G-21]| Change\u00a0public\u00a0state variable visibility to\u00a0private | 4 |\n|[G-22]| State variables can be packed to use fewer storage slots | 1 |\n|[G-23]| With assembly,\u00a0.call (bool success)\u00a0transfer can be done gas-optimized | 1 |\n|[G-24]|Use\u00a0!= 0\u00a0instead of\u00a0> 0\u00a0for unsigned integer comparison | 1 |\n|[G-25]| Use hardcode address instead address(this) | 6 |\n|[G\u201126]| Structs can be packed into fewer storage slots | 1 |\n|[G-27]|use Mappings Instead of Arrays | 12 |\n|[G-28]| Use Assembly To Check For\u00a0address(0) | 1 |\n|[G-29]| Use constants instead of type", "vulnerable_code": "File: /ajna-core/src/RewardsManager.sol\n135 function moveStakedLiquidity(\n uint256 tokenId_,\n uint256[] memory fromBuckets_,\n uint256[] memory toBuckets_,\n uint256 expiry_\n ) external nonReentrant override {\n", "fixed_code": "File: /ajna-grants/src/grants/GrantFund.so\n22 function hashProposal(\n address[] memory targets_,\n uint256[] memory values_,\n bytes[] memory calldatas_,\n bytes32 descriptionHash_\n ) external pure override returns (uint256 proposalId_) {", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/Raihan-G.md", "collected_at": "2026-01-02T18:21:09.426934+00:00", "source_hash": "8e48b696b006a7ba1f5340e7521994e64b1eddf4eb93f185666fdb6cc087f4a2", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: /ajna-core/src/RewardsManager.sol\n135 function moveStakedLiquidity(\n uint256 tokenId_,\n uint256[] memory fromBuckets_,\n uint256[] memory toBuckets_,\n uint256 expiry_\n ) external nonReentrant override {\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: /ajna-grants/src/grants/GrantFund.so\n22 function hashProposal(\n address[] memory targets_,\n uint256[] memory values_,\n bytes[] memory calldatas_,\n bytes32 descriptionHash_\n ) external pure override returns (uint256 proposalId_) {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "11-kelp", "title": "0xta G", "severity_raw": "Low", "severity": "low", "description": "# Gas Optimization\n\n# Summary\n\n| Number | Gas Optimization | Context |\n| :----: | :------------------------------------------------------------------------------------------------------- | :-----: |\n| [G-01] | Shorten arrays with inline assembly | 2 |\n| [G-02] | It is sometimes cheaper to cache calldata | 1 |\n| [G-03] | Mark initializer functions as payable to save deployment gas | 6 |\n| [G-04] | Using mappings instead of arrays to avoid length checks | 2 |\n| [G-05] | Use do while loops instead of for loops | 4 |\n| [G-06] | Using Storage instead of memory for structs/arrays saves gas | 2 |\n| [G-07] | Don't make variables public unless necessary | 14 |\n| [G-08] | Avoid contract existence checks by using low level calls | 22 |\n| [G-09] | Use hardcoded addresses instead of address(this) | 6 |\n| [G-10] | Use constants instead of type(uintx).max | 1 |\n| [G-11] | Expressions for constant values such as a call to keccak256(), should use immutable rather than constant | 9 |\n\n## [G-01] Shorten arrays with inline assembly\n\n```solidity\nFile: src/NodeDelegator.sol\n\n106 assets = new address[](strategiesLength);\n\n107 assetBalances = new uint256[](strategiesLength);\n```\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/NodeDelegator.sol#L106-L107\n\n## [G-02] I", "vulnerable_code": "File: src/NodeDelegator.sol\n\n106 assets = new address[](strategiesLength);\n\n107 assetBalances = new uint256[](strategiesLength);", "fixed_code": "File: src/LRTDepositPool.sol\n\n162 function addNodeDelegatorContractToQueue(address[] calldata nodeDelegatorContracts) external onlyLRTAdmin {", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/0xta-G.md", "collected_at": "2026-01-02T18:27:16.430496+00:00", "source_hash": "8e6af943895fdf6c497235f3d54ddb0dca7c22c2e6fda9d27fce206557bd771d", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 142, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: src/NodeDelegator.sol\n\n106 assets = new address[](strategiesLength);\n\n107 assetBalances = new uint256[](strategiesLength);", "primary_code_language": "solidity", "primary_code_char_count": 142, "all_code_blocks": "// Code block 1 (solidity):\nFile: src/NodeDelegator.sol\n\n106 assets = new address[](strategiesLength);\n\n107 assetBalances = new uint256[](strategiesLength);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: src/NodeDelegator.sol\n\n106 assets = new address[](strategiesLength);\n\n107 assetBalances = new uint256[](strategiesLength);", "github_refs_formatted": "NodeDelegator.sol#L106-L107", "github_files_list": "NodeDelegator.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: src/NodeDelegator.sol\n\n106 assets = new address[](strategiesLength);\n\n107 assetBalances = new uint256[](strategiesLength);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: src/LRTDepositPool.sol\n\n162 function addNodeDelegatorContractToQueue(address[] calldata nodeDelegatorContracts) external onlyLRTAdmin {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "10-badger", "title": "SY_S G", "severity_raw": "Medium", "severity": "medium", "description": "## Summary\n\n### Gas Optimization\n\nno | Issue |Instances||\n|-|:-|:-:|:-:|\n| [G-01] |Require()/Revert() string longer than 32 bytes cost extra gas | |10| | \n| [G-02] |Bytes constants are more efficient than String constants | |6| | \n| [G-03] |Require() or revert() statements that check input arguments should be at the top of the function | |7| | \n| [G-04] |Using\u00a0PRIVATE\u00a0rather than\u00a0PUBLIC\u00a0FOR Constants/Immutable, Saves Gas | |6| | \n| [G-05] |Before transfer of some functions, we should check some variables for possible gas save | |2| | \n| [G-06] |Duplicated require()/if() checks should be refactored to a modifier or function | |1| | \n| [G-07] | keccak256()\u00a0should only need to be called on a specific string literal once | |1| | \n| [G-08] |Use constants instead of type(uintx).max | |8| | \n| [G-09] |Optimize Names to save Gas | |5| | \n| [G-10] |Avoid contract existence checks by using low level calls | |13+| | \n| [G-11] |SPLITTING\u00a0\u00a0REQUIRE() STATEMENTS THAT USE\u00a0\u00a0&& SAVES GAS | |4| | \n| [G-12] |USE A MORE RECENT VERSION OF SOLIDITY | |All file +39| | \n| [G-13] |Internal functions only called once can be inlined to save gas | |6| | \n| [G-14] |A modifier used only once and not being inherited should be inlined to save gas | |3| | \n| [G-15] | Do not calculate constant | |1| | \n| [G-16] |abi.encode() is less efficient than abi.encodepacked() | |1| | \n| [G-17] | Setting the constructor to payable | |4| | \n| [G-18] |Using storage instead of memory for structs/arrays saves gas | |5| | \n| [G-19] |State varaibles only set in the Constructor should be declared Immutable | |2| | \n| [G-20] |Don't compare boolean expressions to boolean literals | |1| | \n\n\n\n\n\n## Gas Optimizations \n## [G-1] Require()/Revert() string longer than 32 bytes cost extra gas \n\nEach extra memory word of bytes past the original 32\u00a0incurs an MSTORE\u00a0which costs\u00a03 gas\n\nwhen these strings get longer than 32 bytes, they cost more gas\nUse shorter require()/revert() strings\n\n```solidity\nfile: /contracts/con", "vulnerable_code": "file: /contracts/contracts/ActivePool.sol\n\n137 require(cachedSystemCollShares >= _shares, \"ActivePool: Insufficient collateral shares\");\n\n\n162 require(cachedSystemCollShares >= _shares, \"ActivePool: Insufficient collateral shares\");\n\n\n\n220 require(\n msg.sender == borrowerOperationsAddress,\n \"ActivePool: Caller is not BorrowerOperations\"\n223 );\n\n\n228 require(\n msg.sender == borrowerOperationsAddress || msg.sender == cdpManagerAddress,\n \"ActivePool: Caller is neither BorrowerOperations nor CdpManager\"\n231 );\n\n\n377 require(amount <= balance, \"ActivePool: Attempt to sweep more than balance\");\n", "fixed_code": "file: /contracts/contracts/BorrowerOperations.sol\n \n145 require(locked == OPEN, \"BorrowerOperations: Reentrancy in nonReentrant call\");\n\n require(\n ReentrancyGuard(address(cdpManager)).locked() == OPEN,\n \"CdpManager: Reentrancy in nonReentrant call\"\n );\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/SY_S-G.md", "collected_at": "2026-01-02T18:26:36.987170+00:00", "source_hash": "8e72ce1f80dd9518bd8116e775eb3deaeb6af3d24301df87c577b969513e84b6", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "file: /contracts/contracts/ActivePool.sol\n\n137 require(cachedSystemCollShares >= _shares, \"ActivePool: Insufficient collateral shares\");\n\n\n162 require(cachedSystemCollShares >= _shares, \"ActivePool: Insufficient collateral shares\");\n\n\n\n220 require(\n msg.sender == borrowerOperationsAddress,\n \"ActivePool: Caller is not BorrowerOperations\"\n223 );\n\n\n228 require(\n msg.sender == borrowerOperationsAddress || msg.sender == cdpManagerAddress,\n \"ActivePool: Caller is neither BorrowerOperations nor CdpManager\"\n231 );\n\n\n377 require(amount <= balance, \"ActivePool: Attempt to sweep more than balance\");\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "file: /contracts/contracts/BorrowerOperations.sol\n \n145 require(locked == OPEN, \"BorrowerOperations: Reentrancy in nonReentrant call\");\n\n require(\n ReentrancyGuard(address(cdpManager)).locked() == OPEN,\n \"CdpManager: Reentrancy in nonReentrant call\"\n );\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "02-ai-arena", "title": "0xAleko Q", "severity_raw": "Unknown", "severity": "unknown", "description": "1. https://github.com/code-423n4/2024-02-ai-arena/blob/1d18d1298729e443e14fea08149c77182a65da32/src/MergingPool.sol#L206\n\npoints array length is 1. If user input maxId more than 1, function will be reverted: Index out of bound.\n\nPoC:\n```\nfunction testRevertGetFighterPoints() public {\n // owner mints a fighter by claiming\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_ownerAddress);\n\n address owner = _fighterFarmContract.ownerOf(0);\n assertEq(owner, _ownerAddress);\n\n // rankedeBattle contract adds points\n vm.startPrank(address(_rankedBattleContract));\n _mergingPoolContract.addPoints(0, 100);\n _mergingPoolContract.addPoints(1, 100);\n _mergingPoolContract.addPoints(2, 100);\n vm.stopPrank();\n\n assertEq(_mergingPoolContract.totalPoints(), 300);\n\n // getFighterPoints for owners fighter\n uint256[] memory fighterPoints = _mergingPoolContract.getFighterPoints(3);\n assertEq(fighterPoints.length >= 1 && fighterPoints[0] == 100, true);\n }\n```\n\nRecommendation: \n`-uint256[] memory points = new uint256[](1);`\n`+uint256[] memory points = new uint256[](maxId);`", "vulnerable_code": "function testRevertGetFighterPoints() public {\n // owner mints a fighter by claiming\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_ownerAddress);\n\n address owner = _fighterFarmContract.ownerOf(0);\n assertEq(owner, _ownerAddress);\n\n // rankedeBattle contract adds points\n vm.startPrank(address(_rankedBattleContract));\n _mergingPoolContract.addPoints(0, 100);\n _mergingPoolContract.addPoints(1, 100);\n _mergingPoolContract.addPoints(2, 100);\n vm.stopPrank();\n\n assertEq(_mergingPoolContract.totalPoints(), 300);\n\n // getFighterPoints for owners fighter\n uint256[] memory fighterPoints = _mergingPoolContract.getFighterPoints(3);\n assertEq(fighterPoints.length >= 1 && fighterPoints[0] == 100, true);\n }", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/0xAleko-Q.md", "collected_at": "2026-01-02T19:01:58.815748+00:00", "source_hash": "8ec2934a7861c281e4c69219dc353a4cc87d5b5bf17d5f5c0139f209fcd22182", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 869, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function testRevertGetFighterPoints() public {\n // owner mints a fighter by claiming\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_ownerAddress);\n\n address owner = _fighterFarmContract.ownerOf(0);\n assertEq(owner, _ownerAddress);\n\n // rankedeBattle contract adds points\n vm.startPrank(address(_rankedBattleContract));\n _mergingPoolContract.addPoints(0, 100);\n _mergingPoolContract.addPoints(1, 100);\n _mergingPoolContract.addPoints(2, 100);\n vm.stopPrank();\n\n assertEq(_mergingPoolContract.totalPoints(), 300);\n\n // getFighterPoints for owners fighter\n uint256[] memory fighterPoints = _mergingPoolContract.getFighterPoints(3);\n assertEq(fighterPoints.length >= 1 && fighterPoints[0] == 100, true);\n }", "primary_code_language": "unknown", "primary_code_char_count": 869, "all_code_blocks": "// Code block 1 (unknown):\nfunction testRevertGetFighterPoints() public {\n // owner mints a fighter by claiming\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_ownerAddress);\n\n address owner = _fighterFarmContract.ownerOf(0);\n assertEq(owner, _ownerAddress);\n\n // rankedeBattle contract adds points\n vm.startPrank(address(_rankedBattleContract));\n _mergingPoolContract.addPoints(0, 100);\n _mergingPoolContract.addPoints(1, 100);\n _mergingPoolContract.addPoints(2, 100);\n vm.stopPrank();\n\n assertEq(_mergingPoolContract.totalPoints(), 300);\n\n // getFighterPoints for owners fighter\n uint256[] memory fighterPoints = _mergingPoolContract.getFighterPoints(3);\n assertEq(fighterPoints.length >= 1 && fighterPoints[0] == 100, true);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "MergingPool.sol#L206", "github_files_list": "MergingPool.sol", "github_refs_count": 1, "vulnerable_code_actual": "function testRevertGetFighterPoints() public {\n // owner mints a fighter by claiming\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_ownerAddress);\n\n address owner = _fighterFarmContract.ownerOf(0);\n assertEq(owner, _ownerAddress);\n\n // rankedeBattle contract adds points\n vm.startPrank(address(_rankedBattleContract));\n _mergingPoolContract.addPoints(0, 100);\n _mergingPoolContract.addPoints(1, 100);\n _mergingPoolContract.addPoints(2, 100);\n vm.stopPrank();\n\n assertEq(_mergingPoolContract.totalPoints(), 300);\n\n // getFighterPoints for owners fighter\n uint256[] memory fighterPoints = _mergingPoolContract.getFighterPoints(3);\n assertEq(fighterPoints.length >= 1 && fighterPoints[0] == 100, true);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5.45} {"source": "c4", "protocol": "08-dopex", "title": "Sathish9098 G", "severity_raw": "High", "severity": "high", "description": "# GAS OPTIMIZATION\n\nThe final gas calculations are determined based on the ``OPCODEs`` and the ``sample tests``. The ``OPCODEs`` are the basic instructions that are used to execute code in Solidity. The sample test is a piece of code that is used to test the gas consumption of a function.\n\nThe gas costs of each ``OPCODE`` are defined in the Solidity documentation. The gas costs of the sample test can be calculated by ``running`` the ``test`` and ``measuring`` the ``amount of gas`` that is used.\n\n- [Struct can be packed in fewer slots - Saves ``4000 GAS``](#g-1-struct-can-be-packed-in-fewer-slots)\n - [``owner``,``expiry`` can be packed within same slot : Saves ``2000 GAS``, ``1 SLOT``](#ownerexpiry-can-be-packed-within-same-slot--saves-2000-gas-1-slot)\n - [``_amount0Min`` and ``_amount1Min`` can be packed to same slot : Saves ``2000 GAS`` , ``1 SLOT``](#_amount0min-and-_amount1min-can-be-packed-to-same-slot--saves-2000-gas--1-slot)\n\n- [The result of a function calls should be cached rather than re-calling the function - Saves ``27912 GAS``](#g-2-the-result-of-a-function-calls-should-be-cached-rather-than-re-calling-the-function)\n - [``getEthPrice()``,``getDpxEthPrice()``, ``getRdpxPrice()`` functions should be cached : Saves ``300 GAS``](#getethpricegetdpxethprice-getrdpxprice-functions-should-be-cached--saves-300-gas)\n - [``nextFundingPaymentTimestamp()`` function should be cached : Saves ``27612 GAS``, ``9 Instances``](#nextfundingpaymenttimestamp-function-should-be-cached--saves-27612-gas-9-instances)\n- [Using ``calldata`` to optimize gas costs for ``Read-Only`` external function arguments - Saves ``1420 GAS`` ](#g-3-using-calldata-to-optimize-gas-costs-for-read-only-external-function-arguments)\n - [``_assetSymbol``, ``_assetSymbol``, and ``optionIds``can be declared in ``calldata`` instead of ``memory`` : Saves ``852 GAS``, ``3 Instances``](#_assetsymbol-_assetsymbol-and-optionidscan-be-declared-in-calldata-instead-of-memory--saves-852-gas-3-instances)\n - [", "vulnerable_code": "### ``_amount0Min`` and ``_amount1Min`` can be packed to same slot : Saves ``2000 GAS`` , ``1 SLOT``\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/amo/UniV3LiquidityAmo.sol#L50-L60\n\n``_amount0Min`` and ``_amount1Min`` store the minimum allowed values, which are not very large. Therefore, a ``uint128`` is more than enough to store these values accurately.\n", "fixed_code": "##\n\n## [G-2] The result of a function calls should be cached rather than re-calling the function\n\nExternal calls are expensive\n\n### ``getEthPrice()``,``getDpxEthPrice()``, ``getRdpxPrice()`` functions should be cached : Saves ``300 GAS``\n\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/core/RdpxV2Core.sol#L546-L549\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/Sathish9098-G.md", "collected_at": "2026-01-02T18:25:04.051487+00:00", "source_hash": "8ecae52b45de9c7e8df0db79bc304fe8983dbc121eb595e1fbda6215a75b51bb", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "UniV3LiquidityAmo.sol#L50-L60, RdpxV2Core.sol#L546-L549", "github_files_list": "RdpxV2Core.sol, UniV3LiquidityAmo.sol", "github_refs_count": 2, "vulnerable_code_actual": "### ``_amount0Min`` and ``_amount1Min`` can be packed to same slot : Saves ``2000 GAS`` , ``1 SLOT``\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/amo/UniV3LiquidityAmo.sol#L50-L60\n\n``_amount0Min`` and ``_amount1Min`` store the minimum allowed values, which are not very large. Therefore, a ``uint128`` is more than enough to store these values accurately.\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "##\n\n## [G-2] The result of a function calls should be cached rather than re-calling the function\n\nExternal calls are expensive\n\n### ``getEthPrice()``,``getDpxEthPrice()``, ``getRdpxPrice()`` functions should be cached : Saves ``300 GAS``\n\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/core/RdpxV2Core.sol#L546-L549\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "02-ai-arena", "title": "0xmystery Q", "severity_raw": "Critical", "severity": "critical", "description": "## [L-01] Incomplete array length check\n`FighterFarm.redeemMintPass()`'s design requires equal lengths for arrays such as `mintpassIdsToBurn`, `mintPassDnas`, `fighterTypes`, `modelHashes`, and `modelTypes` to ensure each element corresponds across these arrays during the fighter creation process. However, the initial implementation overlooked the `iconsTypes` array, which also plays a significant role in this process. Incorporating a length check for the `iconsTypes` array alongside the existing ones is essential to guarantee that each fighter's creation is based on consistent and complete data, thereby enhancing the contract's reliability and preventing transaction failures due to data mismatches.\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/FighterFarm.sol#L243-L248\n\n```diff\n require(\n mintpassIdsToBurn.length == mintPassDnas.length && \n mintPassDnas.length == fighterTypes.length && \n fighterTypes.length == modelHashes.length &&\n+ fighterTypes.length == iconTypes.length &&\n modelHashes.length == modelTypes.length\n );\n```\n## [L-02] Fighters should not be allowed to initiate a fight with zero voltage left \n`RankedBattle.updateBattleRecord()` allows for battle initiation even if the fighter's owner lacks the necessary voltage, provided the voltage replenishment time has passed as indicated in the following checks:\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/RankedBattle.sol#L334-L338\n\n```solidity\n require(\n !initiatorBool ||\n _voltageManagerInstance.ownerVoltageReplenishTime(fighterOwner) <= block.timestamp || \n _voltageManagerInstance.ownerVoltage(fighterOwner) >= VOLTAGE_COST\n );\n```\n\nThe delay could possibly lead to dodging point deduction to claim more NRN tokens for the current round and be leveraged in the next round. The loser fighter could also facilitate unstaking NRN tokens during this window to have 0 `curS", "vulnerable_code": "## [L-02] Fighters should not be allowed to initiate a fight with zero voltage left \n`RankedBattle.updateBattleRecord()` allows for battle initiation even if the fighter's owner lacks the necessary voltage, provided the voltage replenishment time has passed as indicated in the following checks:\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/RankedBattle.sol#L334-L338\n", "fixed_code": "The delay could possibly lead to dodging point deduction to claim more NRN tokens for the current round and be leveraged in the next round. The loser fighter could also facilitate unstaking NRN tokens during this window to have 0 `curStakeAtRisk` transferred to `_stakeAtRiskAddress` later that I have reported separately. \n\nA proposed adjustment to the logic strictly enforces that a fighter's owner must have enough voltage upfront if they are initiating a battle, thereby ensuring that all participants meet the same prerequisites for engagement and maintaining the integrity of the battle system.\n\n## [L-03] Enhancing flexibility in permission management \n`GameItems.setAllowedBurningAddresses()` should introduce a second boolean argument to dynamically grant or revoke burning permissions for addresses, streamlining the administrative process and reducing potential risks. This modification allows for more granular control over permissions, enabling administrators to respond swiftly to changing situations, such as addressing errors or security concerns. This approach not only simplifies the contract's interface but also enhances its adaptability and security, making it a robust solution for managing game item transactions in the AI Arena.\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/GameItems.sol#L185-L188\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/0xmystery-Q.md", "collected_at": "2026-01-02T19:02:09.180252+00:00", "source_hash": "8f1f00c31cfae4d8abdac745fed3c4f15fdeea231e8f240b12833a8727196a93", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 534, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "require(\n mintpassIdsToBurn.length == mintPassDnas.length && \n mintPassDnas.length == fighterTypes.length && \n fighterTypes.length == modelHashes.length &&\n+ fighterTypes.length == iconTypes.length &&\n modelHashes.length == modelTypes.length\n );", "primary_code_language": "diff", "primary_code_char_count": 307, "all_code_blocks": "// Code block 1 (diff):\nrequire(\n mintpassIdsToBurn.length == mintPassDnas.length && \n mintPassDnas.length == fighterTypes.length && \n fighterTypes.length == modelHashes.length &&\n+ fighterTypes.length == iconTypes.length &&\n modelHashes.length == modelTypes.length\n );\n\n// Code block 2 (solidity):\nrequire(\n !initiatorBool ||\n _voltageManagerInstance.ownerVoltageReplenishTime(fighterOwner) <= block.timestamp || \n _voltageManagerInstance.ownerVoltage(fighterOwner) >= VOLTAGE_COST\n );", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "require(\n mintpassIdsToBurn.length == mintPassDnas.length && \n mintPassDnas.length == fighterTypes.length && \n fighterTypes.length == modelHashes.length &&\n+ fighterTypes.length == iconTypes.length &&\n modelHashes.length == modelTypes.length\n );", "solidity_code": "require(\n !initiatorBool ||\n _voltageManagerInstance.ownerVoltageReplenishTime(fighterOwner) <= block.timestamp || \n _voltageManagerInstance.ownerVoltage(fighterOwner) >= VOLTAGE_COST\n );", "github_refs_formatted": "FighterFarm.sol#L243-L248, RankedBattle.sol#L334-L338, GameItems.sol#L185-L188", "github_files_list": "GameItems.sol, FighterFarm.sol, RankedBattle.sol", "github_refs_count": 3, "vulnerable_code_actual": "## [L-02] Fighters should not be allowed to initiate a fight with zero voltage left \n`RankedBattle.updateBattleRecord()` allows for battle initiation even if the fighter's owner lacks the necessary voltage, provided the voltage replenishment time has passed as indicated in the following checks:\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/RankedBattle.sol#L334-L338\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "The delay could possibly lead to dodging point deduction to claim more NRN tokens for the current round and be leveraged in the next round. The loser fighter could also facilitate unstaking NRN tokens during this window to have 0 `curStakeAtRisk` transferred to `_stakeAtRiskAddress` later that I have reported separately. \n\nA proposed adjustment to the logic strictly enforces that a fighter's owner must have enough voltage upfront if they are initiating a battle, thereby ensuring that all participants meet the same prerequisites for engagement and maintaining the integrity of the battle system.\n\n## [L-03] Enhancing flexibility in permission management \n`GameItems.setAllowedBurningAddresses()` should introduce a second boolean argument to dynamically grant or revoke burning permissions for addresses, streamlining the administrative process and reducing potential risks. This modification allows for more granular control over permissions, enabling administrators to respond swiftly to changing situations, such as addressing errors or security concerns. This approach not only simplifies the contract's interface but also enhances its adaptability and security, making it a robust solution for managing game item transactions in the AI Arena.\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/GameItems.sol#L185-L188\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "07-amphora", "title": "LeoS G", "severity_raw": "High", "severity": "high", "description": "# Summary\n| | Issue | Instances | Gas Saved |\n|--------|-------|-----------|-----------|\n|[G-01]|Compiling with another version|-|-415800|\n|[G-02]|Change the number of runs|-|-12369516|\n|[G-03]|Review of automated finding G-05 and G-09|-|-|\n\n\nThe gas saved column simply adds up the evolution in the snapshot, using the method described in the next section.\n# Benchmark\nA benchmark is performed on each optimization, using the tests snapshot provided by foundry. This snapshot is based on tests and therefore does not take into account all functions, this loss is accepted. But it is also subject to intrinsic variance. This means that some tests are not relevant to the comparison because they vary too much and are thus not taken into account. These are listed below:\n>testUnderlyingIsSet()\n>testConstructor()\n\n# [G-01] Compiling with another version\nA recent version of the compiler achieves better results with the optimizer, most of the time. But it is not always the case, and as this mostly works like a black box, it is hard to predict it. Thus, versions must be tested. \nThe results are presented below:\n\n||0.8.15|0.8.16|0.8.17|0.8.18|0.8.19|0.8.20|\n|-|-|-|-|-|-|-|\n|Gas diff:|-1930|-130844|-420577|-420587|-420697|-420697|\n\nThe gas diff is the sum of the tests snapshot.\n\nBarring any special security constraints, it would be worthwhile changing versions. `0.8.19` is suggested, as it is both better known and more efficient. Further increases are pointless.\n\nApplying this optimisation, those changes appear in the snapshot:\n```\ntestCallModifyLiability(address) (gas: -1 (-0.000%))\ntestCallVaultControllerTransfer(address) (gas: 4 (0.002%))\ntestRevertIfVaultInsolvent(address) (gas: 4 (0.003%))\ntestRevertIfVaultInsolvent() (gas: 4 (0.003%))\ntestLiquidateWithCurveLpAsCollateral() (gas: -14 (-0.003%))\ntestCheckVaultInsolvent() (gas: 8 (0.003%))\ntestVaultSummaries() (gas: 6 (0.005%))\ntestRevertIfTokenAlreadyRegistered(address,uint64,uint256) (gas: 13 (0.006%))\ntestBorrowUSDACalls", "vulnerable_code": "testCallModifyLiability(address) (gas: -1 (-0.000%))\ntestCallVaultControllerTransfer(address) (gas: 4 (0.002%))\ntestRevertIfVaultInsolvent(address) (gas: 4 (0.003%))\ntestRevertIfVaultInsolvent() (gas: 4 (0.003%))\ntestLiquidateWithCurveLpAsCollateral() (gas: -14 (-0.003%))\ntestCheckVaultInsolvent() (gas: 8 (0.003%))\ntestVaultSummaries() (gas: 6 (0.005%))\ntestRevertIfTokenAlreadyRegistered(address,uint64,uint256) (gas: 13 (0.006%))\ntestBorrowUSDACallsCurrentValue() (gas: 15 (0.006%))\ntestLiquidateWhenLiquidationFeeIsZero() (gas: -32 (-0.006%))\ntestTokensToLiquidate() (gas: 8 (0.007%))\ntestRevertIfVaultIsSolvent(uint256) (gas: 8 (0.008%))\ntestRevertIfVaultIsSolvent(uint256) (gas: 8 (0.008%))\ntestRevertIfVaultIsSolvent() (gas: 8 (0.008%))\ntestRevertIfVaultIsSolvent() (gas: 8 (0.008%))\ntestCheckVaultSolvent() (gas: 8 (0.008%))\ntestCap(uint256) (gas: -10 (-0.011%))\ntestBorrowUSDAWithFeeInZero() (gas: 26 (0.011%))\ntestAmountToSolvency() (gas: -15 (-0.013%))\ntestSimulateLiquidateVault() (gas: 64 (0.013%))\ntestEmitEvent(address) (gas: 32 (0.014%))\ntestCheckVaultCallsCurrentValue() (gas: -17 (-0.016%))\ntestWithdrawToRevertsIfAmountIsGreaterThanBalance() (gas: 5 (0.017%))\ntestWithdrawRevertsIfAmountIsGreaterThanBalance() (gas: 5 (0.018%))\ntestWithdrawToCallsTransferOnToken(uint256) (gas: 11 (0.018%))\ntestUpdateRegisteredERC20(address,uint256,uint256) (gas: 8 (0.019%))\ntestVaultSummariesBigEnd() (gas: 40 (0.019%))\ntestVaultSummariesAll() (gas: 40 (0.019%))\ntestWithdrawCallsTransferOnToken(uint256) (gas: 11 (0.019%))\ntestBorrowUSDATo() (gas: 48 (0.019%))\ntestBorrowUSDA() (gas: 48 (0.019%))\ntestBorrowUSDATreasuryReceivesFee() (gas: 48 (0.020%))\ntestLiquidateWbtc() (gas: 71 (0.020%))\ntestEnabledTokens() (gas: 8 (0.021%))\ntestRevertCapReached(uint256) (gas: -15 (-0.021%))\ntestWithdrawAllToCallsTransferOnToken() (gas: 11 (0.022%))\ntestRevertIfWbtcVaultIsSolvent(uint256) (gas: 57 (0.022%))\ntestVaultBorrowingPower() (gas: 22 (0.022%))\ntestCallModifyLiability(uint56) (gas: 15 (0.022%))", "fixed_code": "testRevertIfProvideOnlyOneAnchor() (gas: -3 (-0.007%))\ntestEmitEvent() (gas: 33 (0.037%))\ntestCap() (gas: 162 (0.045%))\ntestDepositSUSD() (gas: 105 (0.045%))\ntestDonateSUSD() (gas: 102 (0.047%))\ntestStakeAndWithdrawCurveLP() (gas: 552 (0.050%))\ntestStakeCrvLpAfterPoolIdUpdate() (gas: 441 (0.051%))\ntestEmitEvent(uint56) (gas: 30 (0.052%))\ntestEmitEvent(uint56) (gas: 45 (0.052%))\ntestEthSafeCurveLpOracleIsSafeFromManipulation() (gas: 192 (0.052%))\ntestEthSafeCurveLpOracleIsSafeFromManipulation() (gas: 192 (0.055%))\ntestClaimCurveLPRewardsWithClaimerAsZeroAddress() (gas: 492 (0.056%))\ntestRevertWhenDifferentUnderlying() (gas: 74 (0.059%))\ntestDepositCrvLpAfterPoolIdUpdate() (gas: 525 (0.059%))\ntestUSDAOwner() (gas: 6 (0.060%))\ntestRevertCapReached() (gas: 201 (0.060%))\ntestVaultControllerOwner() (gas: 6 (0.060%))\ntestVaultDeposits() (gas: 12 (0.061%))\ntestRecoverDust() (gas: 204 (0.061%))\ntestAddsToUserBalance(uint56) (gas: 57 (0.064%))\ntestAddsToUserBalance(uint56) (gas: 57 (0.066%))\ntestAddsVaultController() (gas: 60 (0.069%))\ntestTransferSUSDtoUSDA() (gas: 111 (0.072%))\ntestClaimMultipleCurveLPWithExtraRewards() (gas: 2433 (0.072%))\ntestSetEmergencyVotingPeriod() (gas: 12 (0.076%))\ntestSetVotingDelay() (gas: 12 (0.076%))\ntestSetDelay() (gas: 12 (0.076%))\ntestSetEmergencyDelay() (gas: 12 (0.076%))\ntestSetEmergencyQuorumVotes() (gas: 12 (0.076%))\ntestSetQuorumVotes() (gas: 12 (0.076%))\ntestSetVotingPeriod() (gas: 12 (0.076%))\ntestSetOptimisticQuorumVotes() (gas: 12 (0.076%))\ntestSetProposalThreshold() (gas: 12 (0.076%))\ntestSetOptimisticDelay() (gas: 12 (0.076%))\ntestDepositAddsToReserve(uint56) (gas: 69 (0.078%))\ntestDepositAddsToReserve(uint56) (gas: 69 (0.080%))\ntestSetMaxWhitelistPeriod() (gas: 12 (0.083%))\ntestEmitEvent(uint56) (gas: 36 (0.083%))\ntestRevertIfDepositingMoreThanBalance() (gas: 138 (0.094%))\ntestRevertIfWithdrawMoreThanBalance() (gas: 252 (0.095%))\ntestReserveRatioAfterMint(uint64) (gas: 60 (0.098%))\ntestEmitEvent() (gas: 26 (0.098%))\ntestEmitEvent(", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/LeoS-G.md", "collected_at": "2026-01-02T18:23:27.807783+00:00", "source_hash": "8f5225e05af895637437bfac3fd5a39a5559fb4092f10ced691deefb4361cc44", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "testCallModifyLiability(address) (gas: -1 (-0.000%))\ntestCallVaultControllerTransfer(address) (gas: 4 (0.002%))\ntestRevertIfVaultInsolvent(address) (gas: 4 (0.003%))\ntestRevertIfVaultInsolvent() (gas: 4 (0.003%))\ntestLiquidateWithCurveLpAsCollateral() (gas: -14 (-0.003%))\ntestCheckVaultInsolvent() (gas: 8 (0.003%))\ntestVaultSummaries() (gas: 6 (0.005%))\ntestRevertIfTokenAlreadyRegistered(address,uint64,uint256) (gas: 13 (0.006%))\ntestBorrowUSDACallsCurrentValue() (gas: 15 (0.006%))\ntestLiquidateWhenLiquidationFeeIsZero() (gas: -32 (-0.006%))\ntestTokensToLiquidate() (gas: 8 (0.007%))\ntestRevertIfVaultIsSolvent(uint256) (gas: 8 (0.008%))\ntestRevertIfVaultIsSolvent(uint256) (gas: 8 (0.008%))\ntestRevertIfVaultIsSolvent() (gas: 8 (0.008%))\ntestRevertIfVaultIsSolvent() (gas: 8 (0.008%))\ntestCheckVaultSolvent() (gas: 8 (0.008%))\ntestCap(uint256) (gas: -10 (-0.011%))\ntestBorrowUSDAWithFeeInZero() (gas: 26 (0.011%))\ntestAmountToSolvency() (gas: -15 (-0.013%))\ntestSimulateLiquidateVault() (gas: 64 (0.013%))\ntestEmitEvent(address) (gas: 32 (0.014%))\ntestCheckVaultCallsCurrentValue() (gas: -17 (-0.016%))\ntestWithdrawToRevertsIfAmountIsGreaterThanBalance() (gas: 5 (0.017%))\ntestWithdrawRevertsIfAmountIsGreaterThanBalance() (gas: 5 (0.018%))\ntestWithdrawToCallsTransferOnToken(uint256) (gas: 11 (0.018%))\ntestUpdateRegisteredERC20(address,uint256,uint256) (gas: 8 (0.019%))\ntestVaultSummariesBigEnd() (gas: 40 (0.019%))\ntestVaultSummariesAll() (gas: 40 (0.019%))\ntestWithdrawCallsTransferOnToken(uint256) (gas: 11 (0.019%))\ntestBorrowUSDATo() (gas: 48 (0.019%))\ntestBorrowUSDA() (gas: 48 (0.019%))\ntestBorrowUSDATreasuryReceivesFee() (gas: 48 (0.020%))\ntestLiquidateWbtc() (gas: 71 (0.020%))\ntestEnabledTokens() (gas: 8 (0.021%))\ntestRevertCapReached(uint256) (gas: -15 (-0.021%))\ntestWithdrawAllToCallsTransferOnToken() (gas: 11 (0.022%))\ntestRevertIfWbtcVaultIsSolvent(uint256) (gas: 57 (0.022%))\ntestVaultBorrowingPower() (gas: 22 (0.022%))\ntestCallModifyLiability(uint56) (gas: 15 (0.022%))", "has_vulnerable_code_snippet": true, "fixed_code_actual": "testRevertIfProvideOnlyOneAnchor() (gas: -3 (-0.007%))\ntestEmitEvent() (gas: 33 (0.037%))\ntestCap() (gas: 162 (0.045%))\ntestDepositSUSD() (gas: 105 (0.045%))\ntestDonateSUSD() (gas: 102 (0.047%))\ntestStakeAndWithdrawCurveLP() (gas: 552 (0.050%))\ntestStakeCrvLpAfterPoolIdUpdate() (gas: 441 (0.051%))\ntestEmitEvent(uint56) (gas: 30 (0.052%))\ntestEmitEvent(uint56) (gas: 45 (0.052%))\ntestEthSafeCurveLpOracleIsSafeFromManipulation() (gas: 192 (0.052%))\ntestEthSafeCurveLpOracleIsSafeFromManipulation() (gas: 192 (0.055%))\ntestClaimCurveLPRewardsWithClaimerAsZeroAddress() (gas: 492 (0.056%))\ntestRevertWhenDifferentUnderlying() (gas: 74 (0.059%))\ntestDepositCrvLpAfterPoolIdUpdate() (gas: 525 (0.059%))\ntestUSDAOwner() (gas: 6 (0.060%))\ntestRevertCapReached() (gas: 201 (0.060%))\ntestVaultControllerOwner() (gas: 6 (0.060%))\ntestVaultDeposits() (gas: 12 (0.061%))\ntestRecoverDust() (gas: 204 (0.061%))\ntestAddsToUserBalance(uint56) (gas: 57 (0.064%))\ntestAddsToUserBalance(uint56) (gas: 57 (0.066%))\ntestAddsVaultController() (gas: 60 (0.069%))\ntestTransferSUSDtoUSDA() (gas: 111 (0.072%))\ntestClaimMultipleCurveLPWithExtraRewards() (gas: 2433 (0.072%))\ntestSetEmergencyVotingPeriod() (gas: 12 (0.076%))\ntestSetVotingDelay() (gas: 12 (0.076%))\ntestSetDelay() (gas: 12 (0.076%))\ntestSetEmergencyDelay() (gas: 12 (0.076%))\ntestSetEmergencyQuorumVotes() (gas: 12 (0.076%))\ntestSetQuorumVotes() (gas: 12 (0.076%))\ntestSetVotingPeriod() (gas: 12 (0.076%))\ntestSetOptimisticQuorumVotes() (gas: 12 (0.076%))\ntestSetProposalThreshold() (gas: 12 (0.076%))\ntestSetOptimisticDelay() (gas: 12 (0.076%))\ntestDepositAddsToReserve(uint56) (gas: 69 (0.078%))\ntestDepositAddsToReserve(uint56) (gas: 69 (0.080%))\ntestSetMaxWhitelistPeriod() (gas: 12 (0.083%))\ntestEmitEvent(uint56) (gas: 36 (0.083%))\ntestRevertIfDepositingMoreThanBalance() (gas: 138 (0.094%))\ntestRevertIfWithdrawMoreThanBalance() (gas: 252 (0.095%))\ntestReserveRatioAfterMint(uint64) (gas: 60 (0.098%))\ntestEmitEvent() (gas: 26 (0.098%))\ntestEmitEvent(", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "02-ethos", "title": "W0RR1O G", "severity_raw": "Low", "severity": "low", "description": "Splitting `require()` statements that uses `&&` saves gas\n====================================\nDescription:\n-------------\nInstead of using the `&&` operator on a single require statement, use two `require` can save more gas\n\ni.e for `require(version==1 && balance >= 0, \"Error\")` use\n```\nrequire(version==1);\nrequire(balance>=0);\n```\n\nProof Of Concept\n-------------------\n* https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L653\n```653: require(_maxFeePercentage >= BORROWING_FEE_FLOOR && _maxFeePercentage <= DECIMAL_PRECISION,\"Max fee percentage must between 0.5% and 100%\");```\n\n* https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L348\n```348: require(_recipient != address(0) && _recipient != address(this),\"LUSD: Cannot transfer tokens directly to the LUSD token contract or the zero address\");```\n\n* https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L353\n```353: require(!stabilityPools[_recipient] && !troveManagers[_recipient] && !borrowerOperations[_recipient],\"LUSD: Cannot transfer tokens directly to the StabilityPool, TroveManager or BorrowerOps\");```\n\n* https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L1539\n``` 1539: require (TroveOwnersArrayLength > 1 && sortedTroves.getSize(_collateral) > 1);```\n\n\n\n`internal` functions that are only called once can be inlined to save gas\n==============================================\nProof Of Concept:\n--------------------\n* https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol#L320\n* https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L438\n* https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L455\n* https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L476\n* https://github.com/code-423n4/2023-02-", "vulnerable_code": "require(version==1);\nrequire(balance>=0);", "fixed_code": "* https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L348", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/W0RR1O-G.md", "collected_at": "2026-01-02T18:16:44.127165+00:00", "source_hash": "8f70030ad381f680ff6eda7bff30710e1c6f6278de2cd09ab94741e46bf7dbc2", "code_block_count": 4, "solidity_block_count": 0, "total_code_chars": 330, "github_ref_count": 8, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "require(version==1);\nrequire(balance>=0);", "primary_code_language": "unknown", "primary_code_char_count": 41, "all_code_blocks": "// Code block 1 (unknown):\nrequire(version==1);\nrequire(balance>=0);\n\n// Code block 2 (unknown):\n* https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L348\n\n// Code block 3 (unknown):\n* https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L353\n\n// Code block 4 (unknown):\n* https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L1539", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "BorrowerOperations.sol#L653, LUSDToken.sol#L348, LUSDToken.sol#L353, TroveManager.sol#L1539, ActivePool.sol#L320, BorrowerOperations.sol#L438, BorrowerOperations.sol#L455, BorrowerOperations.sol#L476", "github_files_list": "LUSDToken.sol, BorrowerOperations.sol, ActivePool.sol, TroveManager.sol", "github_refs_count": 8, "vulnerable_code_actual": "require(version==1);\nrequire(balance>=0);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "* https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L348", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "03-revert-lend", "title": "JecikPo Q", "severity_raw": "High", "severity": "high", "description": "## [L-01] repay() function can be front-run with repaying dust\n\nAnyone can repay any loan. So when an original loan owner wishes to repay the whole debt by specifying the attributes of the `repay()`, the transaction could be front-run by an attacker where he repays the exact amount so that the `loan.debtShares` decrements by 1. This way the debt owner's transaction gets reverted due to the below condition.\n\n```solidity\nFile: src/V3Vault.sol\n\n973: if (shares > currentShares) {\n revert RepayExceedsDebt();\n }\n```\n\n### Recommendation:\nThe fix should be the following: If the debt/loan owner specifies too high amount, and the above condition is hit, the shares/assets values should be recalculated, like this:\n\n```solidity\n973: if (shares > currentShares) {\n shares = currentShares\n assets = _convertToAssets(shares, newDebtExchangeRateX96, Math.Rounding.Up);\n }\n```\nThis way would protect the loan/debt owners from unnecessarily repeated transaction and hence save them gas.\n\n*GitHub* : [973](https://github.com/code-423n4/2024-03-revert-lend/blob/ac520c5fedf4e1654c597a46efaf5a7c27295de1/src/V3Vault.sol#L973)\n\n## [L-02] Uniswap positions minted to V3Vault are stuck\nUsing the `NonfungiblePositionManager` directly a user could potentially mint a position directly to V3Vault by having V3Vault as the receiver when calling `NonfungiblePositionManager.mint()`.\n\nSince NonfungiblePositionManager doesn\u2019t use `safeMint()` this would just transfer the token and liquidity to V3Vault without calling `V3Vault.onERC721Received()`, thus the liquidity would be lost.\n\n### Recommendation\nConsider adding a rescue function callable by owner that can transfer any accidentally minted tokens out of the contract. This could check that V3Vault is the owner of the token but has `loans[tokenId].owner == address(0)` to prevent misuse.", "vulnerable_code": "File: src/V3Vault.sol\n\n973: if (shares > currentShares) {\n revert RepayExceedsDebt();\n }", "fixed_code": "973: if (shares > currentShares) {\n shares = currentShares\n assets = _convertToAssets(shares, newDebtExchangeRateX96, Math.Rounding.Up);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/JecikPo-Q.md", "collected_at": "2026-01-02T19:03:00.608209+00:00", "source_hash": "8f939d087fdb487ef24d0a7b31af81618584ec0b09f5846058fa9a260177d63f", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 265, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: src/V3Vault.sol\n\n973: if (shares > currentShares) {\n revert RepayExceedsDebt();\n }", "primary_code_language": "solidity", "primary_code_char_count": 106, "all_code_blocks": "// Code block 1 (solidity):\nFile: src/V3Vault.sol\n\n973: if (shares > currentShares) {\n revert RepayExceedsDebt();\n }\n\n// Code block 2 (solidity):\n973: if (shares > currentShares) {\n shares = currentShares\n assets = _convertToAssets(shares, newDebtExchangeRateX96, Math.Rounding.Up);\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: src/V3Vault.sol\n\n973: if (shares > currentShares) {\n revert RepayExceedsDebt();\n }\n\n973: if (shares > currentShares) {\n shares = currentShares\n assets = _convertToAssets(shares, newDebtExchangeRateX96, Math.Rounding.Up);\n }", "github_refs_formatted": "V3Vault.sol#L973", "github_files_list": "V3Vault.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: src/V3Vault.sol\n\n973: if (shares > currentShares) {\n revert RepayExceedsDebt();\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "973: if (shares > currentShares) {\n shares = currentShares\n assets = _convertToAssets(shares, newDebtExchangeRateX96, Math.Rounding.Up);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-biconomy", "title": "pauliax Q", "severity_raw": "Low", "severity": "low", "description": "* ```ReentrancyGuardUpgradeable``` is not initialized by calling ```__ReentrancyGuard_init``` or ```__ReentrancyGuard_init_unchained```:\n```solidity\ncontract SmartAccount is \n ...\n ReentrancyGuardUpgradeable\n```\nhttps://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/master/contracts/security/ReentrancyGuardUpgradeable.sol#L40-L46\n\n* Setting an owner could be separated into a 2-step process to prevent accidental mistakes:\n```solidity\n function setOwner(address _newOwner) external mixedAuth\n```\n\n* No need for assembly, can use ```block.chainid```:\n```solidity\nfunction getChainId() public view returns (uint256) {\n uint256 id;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n id := chainid()\n }\n return id;\n}\n```\n\n* Should be ```<=```:\n```solidity\n require(stake < type(uint112).max, \"stake overflow\");\n```\n\n* Should better use safe casting:\n```solidity\n info.deposit = uint112(info.deposit - withdrawAmount);\n```\n\n* Probably you are aware that this is not a reliable way to check for EOA:\n```solidity\n function isContract(address account) internal view returns (bool) {\n uint256 csize;\n // solhint-disable-next-line no-inline-assembly\n assembly { csize := extcodesize(account) }\n return csize != 0;\n }\n```\n\n* ```deployWallet``` similarly like ```deployCounterFactualWallet``` should emit ```SmartAccountCreated``` event.\n\n* ```getModulesPaginated``` does not return the correct ```next```, this function was copied from Gnosis Safe and is fixed in the upcoming release:\nhttps://github.com/safe-global/safe-contracts/issues/461\n\n* Gnosis Safe is not entirely EIP-1271 compliant and are planning to refactor EIP-1271 support:\n\"EIP-1271 in the form added is not supported anymore, therefore the logic for it should be removed\"\nSee: https://github.com/safe-global/safe-contracts/issues/391 and https://forum.gnosis-safe.io/t/safe-contract-v2/87", "vulnerable_code": "contract SmartAccount is \n ...\n ReentrancyGuardUpgradeable", "fixed_code": " function setOwner(address _newOwner) external mixedAuth", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/pauliax-Q.md", "collected_at": "2026-01-02T18:14:00.243513+00:00", "source_hash": "8fc76fd34862ce6eabfcbb00ef241fd7089f0a0e5187c376906cd802342f6b90", "code_block_count": 6, "solidity_block_count": 6, "total_code_chars": 617, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "contract SmartAccount is \n ...\n ReentrancyGuardUpgradeable", "primary_code_language": "solidity", "primary_code_char_count": 66, "all_code_blocks": "// Code block 1 (solidity):\ncontract SmartAccount is \n ...\n ReentrancyGuardUpgradeable\n\n// Code block 2 (solidity):\nfunction setOwner(address _newOwner) external mixedAuth\n\n// Code block 3 (solidity):\nfunction getChainId() public view returns (uint256) {\n uint256 id;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n id := chainid()\n }\n return id;\n}\n\n// Code block 4 (solidity):\nrequire(stake < type(uint112).max, \"stake overflow\");\n\n// Code block 5 (solidity):\ninfo.deposit = uint112(info.deposit - withdrawAmount);\n\n// Code block 6 (solidity):\nfunction isContract(address account) internal view returns (bool) {\n uint256 csize;\n // solhint-disable-next-line no-inline-assembly\n assembly { csize := extcodesize(account) }\n return csize != 0;\n }", "all_code_blocks_count": 6, "has_diff_blocks": false, "diff_code": "", "solidity_code": "contract SmartAccount is \n ...\n ReentrancyGuardUpgradeable\n\nfunction setOwner(address _newOwner) external mixedAuth\n\nfunction getChainId() public view returns (uint256) {\n uint256 id;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n id := chainid()\n }\n return id;\n}\n\nrequire(stake < type(uint112).max, \"stake overflow\");\n\ninfo.deposit = uint112(info.deposit - withdrawAmount);\n\nfunction isContract(address account) internal view returns (bool) {\n uint256 csize;\n // solhint-disable-next-line no-inline-assembly\n assembly { csize := extcodesize(account) }\n return csize != 0;\n }", "github_refs_formatted": "ReentrancyGuardUpgradeable.sol#L40-L46", "github_files_list": "ReentrancyGuardUpgradeable.sol", "github_refs_count": 1, "vulnerable_code_actual": "contract SmartAccount is \n ...\n ReentrancyGuardUpgradeable", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function setOwner(address _newOwner) external mixedAuth", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 12} {"source": "c4", "protocol": "11-kelp", "title": "hals Q", "severity_raw": "Low", "severity": "low", "description": "# Findings Summary\n\n| ID | Title | Severity |\n| ------------- | ----------------------------------------------------------------------------------------------------------------------------------- | -------- |\n| [L-01](#l-01) | `NodeDelegator` contract doesn't have a mechanism to remove LST asset approval from `eigenStrategyManager` contract | Low |\n| [L-02](#l-02) | `LRTConfig.setRSETH` function: updating the `rsETH` contract address will result in loss of users deposits | Low |\n| [L-03](#l-03) | `LRTConfig` contract: no mechanism implemented to remove supported LST assets | Low |\n| [L-04](#l-04) | `LRTDepositPool.addNodeDelegatorContractToQueue` function is accessed by the LRTAdmin while it should be accessed by the LRTManager | Low |\n| [L-05](#l-05) | `LRTDepositPool.transferAssetToNodeDelegator` function doesn't check if the `nodeDelegator` exists before sending it LST assets | Low |\n\n# Low\n\n## [L-01] `NodeDelegator` contract doesn't have a mechanism to remove LST asset approval from `eigenStrategyManager` contract \n\n## Impact\n\n- The main purpose of the node delegators is to act as temporary LST holders before depositing in EigenLayer protocol (3rd party); mainly to prevent disabling the `kelp` protocol if the EigenLayer paused the deposit operations.\n\n- First the LST assets are transferred to a `nodeDelegator` contract by the deposit pool manager, then transferred to `eigenStrategyManager` contract by calling `NodeDelegator.depositAssetIntoStrategy` function that will in turn calls the `IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);`, but before that, the nodeDelegator should approve the `eigenStrategyManager` contract on ", "vulnerable_code": " function maxApproveToEigenStrategyManager(address asset)\n external\n override\n onlySupportedAsset(asset)\n onlyLRTManager\n {\n address eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);\n IERC20(asset).approve(eigenlayerStrategyManagerAddress, type(uint256).max);\n }", "fixed_code": "```diff\n- function maxApproveToEigenStrategyManager(address asset)\n- external\n- override\n- onlySupportedAsset(asset)\n- onlyLRTManager\n- {\n- address eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);\n- IERC20(asset).approve(eigenlayerStrategyManagerAddress, type(uint256).max);\n- }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/hals-Q.md", "collected_at": "2026-01-02T18:28:05.491227+00:00", "source_hash": "8fe1a5e3783a3e547c0e516cf24d166cb11de6fa95fd0ddf0f9bd84ae662029f", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function maxApproveToEigenStrategyManager(address asset)\n external\n override\n onlySupportedAsset(asset)\n onlyLRTManager\n {\n address eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);\n IERC20(asset).approve(eigenlayerStrategyManagerAddress, type(uint256).max);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "```diff\n- function maxApproveToEigenStrategyManager(address asset)\n- external\n- override\n- onlySupportedAsset(asset)\n- onlyLRTManager\n- {\n- address eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);\n- IERC20(asset).approve(eigenlayerStrategyManagerAddress, type(uint256).max);\n- }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "02-ethos", "title": "abiih G", "severity_raw": "High", "severity": "high", "description": "# Report\n\n---\n\n## Gas Optimizations\n\n---\n\n| | Findings |\n| --- | ----------------------------------------------------------------------------------------------------------------------------------------- |\n| 1 | [ Use Internal View Functions in Modifiers To Save Bytecode](#use-internal-view-functions-in-modifiers-to-save-bytecode) |\n| 2 | [Increments/Decrements Can Be Unchecked In For-Loops](#incrementsdecrements-can-be-unchecked-in-for-loops) |\n| 3 | [Use Named Returns For Local Variables Where It Is Possible](#use-named-returns-for-local-variables-where-it-is-possible) |\n| 4 | [Multiple Mapping Can be Combined In a Single Struct](#multiple-mapping-can-be-combined-in-a-single-struct) |\n| 5 | [Using Storage Instead Of Memory For Structs/Arrays Saves Gas](#using-storage-instead-of-memory-for-structsarrays-saves-gas) |\n| 6 | [Avoid Emitting a Storage Variable When a Memory Value Is Available](#avoid-emitting-a-storage-variable-when-a-memory-value-is-available) |\n\n---\n\n1. ### Use Internal View Functions in Modifiers To Save Bytecode\n\n When you add a function modifier, the code of that function is picked up and put in the function modifier in place of the \"\\_\" symbol. This can also be understood as \u2018The function modifiers are inlined\u201d. In normal programming languages, inlining small code is more efficient without any real drawback but Solidity is no ordinary language. In Solidity, the maximum size of a contract is restricted to 24 KB by EIP 170. If the same code is inlined multiple times, it adds up in size and that size limit can be hit easily.\n\n Internal functions, on the other hand, are not inlined but called as separate functions. This means they are very slightly more expensive in run time but save a lot of redu", "vulnerable_code": "2. ### Increments/Decrements Can Be Unchecked In For-Loops\n Consider wrapping with an unchecked block here (around 25 gas saved per instance): The change would be:\n\n- https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol#L56\n- https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L608\n- https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L690\n- https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L882\n", "fixed_code": "3. ### Use Named Returns For Local Variables Where It Is Possible\n\n---\n\n- https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L419\n", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/abiih-G.md", "collected_at": "2026-01-02T18:16:45.453992+00:00", "source_hash": "900b00cfd62ee98fb8c25a73718dace2039b044a885f5ca8f2b3df82df886443", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CollateralConfig.sol#L56, TroveManager.sol#L608, TroveManager.sol#L690, TroveManager.sol#L882, BorrowerOperations.sol#L419", "github_files_list": "TroveManager.sol, BorrowerOperations.sol, CollateralConfig.sol", "github_refs_count": 5, "vulnerable_code_actual": "2. ### Increments/Decrements Can Be Unchecked In For-Loops\n Consider wrapping with an unchecked block here (around 25 gas saved per instance): The change would be:\n\n- https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol#L56\n- https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L608\n- https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L690\n- https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L882\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "3. ### Use Named Returns For Local Variables Where It Is Possible\n\n---\n\n- https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L419\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-ondo", "title": "0xSmartContract Q", "severity_raw": "Critical", "severity": "critical", "description": "## Summary\n### Low Risk Issues List\n| Number |Issues Details|Context|\n|:--:|:-------|:--:|\n|[L-01]| Project has NPM Dependency which uses a vulnerable version : `axios`| 1 |\n|[L-02]| Project has NPM Dependency which uses a vulnerable version : `node-fetch`| 1 |\n|[L-03]| Loss of precision due to rounding| 1 |\n|[L-04]| Missing Event for critical parameters init and change| 6 |\n|[L-05]| Use `2Step` change architecture instead of ` setfeeRecipient ` and `setAssetRecipient`| 1 |\n|[L-06]| Stack too deep when compiling | |\n|[L-07]|There is a risk that the `setMintFee` variable is accidentally execute to 0 with `setMintFee` function| 1 |\n|[L-08]| No Storage Gap for `KYCRegistryClientInitializable`| 1 |\n|[L-09]| The nonReentrant modifier should occur before all other modifiers| 1 |\n|[L-10]| initialize() functions can be called by anybody| 4 |\n|[L-11]| Use `uint256` instead `uint` | 336 |\n\nTotal 11 issues\n\n\n### Non-Critical Issues List\n| Number |Issues Details|Context|\n|:--:|:-------|:--:|\n| [N-01]|Insufficient coverage |All Contracts|\n| [N-02] |NatSpec comments should be increased in contracts |All Contracts|\n| [N-03] |`Function writing` that does not comply with the `Solidity Style Guide`| All Contracts |\n| [N-04] |Add a timelock to critical functions | 1 |\n| [N-05] |Include return parameters in NatSpec comments | All contracts |\n| [N-06] |Keccak Constant values should used to immutable rather than constant| 14 |\n| [N-07] |Mark visibility of\u00a0initialize(...)\u00a0functions as\u00a0``external`` | 4 |\n| [N-08] |Use underscores for number literals | 2 |\n| [N-09] |Lack of event emission after critical\u00a0`initialize()`\u00a0function| 4 |\n| [N-10] |`Empty blocks` should be _removed_ or _Emit_ something | 3 |\n| [N-11] |Tokens accidentally sent to the contract cannot be recovered| |\n| [N-12] |Assembly Codes Specific \u2013 Should Have Comments |7 |\n| [N-13] |Use a single file for all system-wide constants | 34 |\n| [N-14] |Take advantage of Custom Error's return value property | 49 |\n| [N-15] |Repea", "vulnerable_code": "package.json:\n 28 \"deploy\": \"hardhat --network ethereum deploy\"\n 29: },\n 30: \"dependencies\": {\n 35: \"axios\": \"0.21.1\",", "fixed_code": "package.json:\n 29 },\n 30: \"dependencies\": {\n 52: \"node-fetch\": \"2.6.1\",\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/0xSmartContract-Q.md", "collected_at": "2026-01-02T18:14:22.094256+00:00", "source_hash": "90101765b38058c8fcdcb229df72fc30db74c430925858979c5e281138943aa2", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "package.json:\n 28 \"deploy\": \"hardhat --network ethereum deploy\"\n 29: },\n 30: \"dependencies\": {\n 35: \"axios\": \"0.21.1\",", "has_vulnerable_code_snippet": true, "fixed_code_actual": "package.json:\n 29 },\n 30: \"dependencies\": {\n 52: \"node-fetch\": \"2.6.1\",\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "06-lybra", "title": "SanketKogekar Q", "severity_raw": "Low", "severity": "low", "description": "\n1. There are multiple cases when transfer can fail silently as returned value is unchecked, one of the example would be in `LybraConfiguration.distributeRewards()`\n\n```\npeUSD.transfer(address(lybraProtocolRewardsPool), peUSDBalance);\n```\nIt is recommended to prefer using `safeTransfer` / `safeApprove` functions from OZ's library.\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/configuration/LybraConfigurator.sol#L292-L293\n\n2. The `LybraConfiguration.setMaxStableRatio()` requires a check:\n\n```\nrequire(_ratio > 0, \"Ratio should be greater than 0\");\n```\n\nIn case it is set to 0 by accident, the function `LybraConfigurator.getEUSDMaxLocked` will break, which in case would break other functions that use it.\n\n(Likelihood is low becuase it utilizes timelock)\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/configuration/LybraConfigurator.sol#L246-L249\n\n3. The `LybraConfiguration.setTokenMiner` does not check if both arrays from args are of equal length.\n\nMake sure `_contracts.length == _bools.length`\n\n(Likelihood is low becuase it utilizes timelock)\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/configuration/LybraConfigurator.sol#L235-L240\n\n4. The `LybraConfiguration.setKeeperRatio` has an incorrect condition:\n\n```\nrequire(newRatio <= 5, \"Max Keeper reward is 5%\");\n```\n\nbased on the comment\n\n```\n* @param newRatio The new reward ratio to set, limited to a maximum of 5%.\n```\n\nI think the developer meant to code just as how percentage is calculated like other functions:\n```\nrequire(newRatio <= 500, \"Max Keeper reward is 5%\");\n```\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/configuration/LybraConfigurator.sol#L224-L228\n\n5. There are several instances in code where tokens are not approved before initiating `transferFrom` in functions.\n\n6. As", "vulnerable_code": "peUSD.transfer(address(lybraProtocolRewardsPool), peUSDBalance);", "fixed_code": "require(_ratio > 0, \"Ratio should be greater than 0\");", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/SanketKogekar-Q.md", "collected_at": "2026-01-02T18:22:43.098271+00:00", "source_hash": "90532c143494cf74929ff72a8628bc4c49059d23aac8a250e22ee89fea0d7ada", "code_block_count": 5, "solidity_block_count": 0, "total_code_chars": 294, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "peUSD.transfer(address(lybraProtocolRewardsPool), peUSDBalance);", "primary_code_language": "unknown", "primary_code_char_count": 64, "all_code_blocks": "// Code block 1 (unknown):\npeUSD.transfer(address(lybraProtocolRewardsPool), peUSDBalance);\n\n// Code block 2 (unknown):\nrequire(_ratio > 0, \"Ratio should be greater than 0\");\n\n// Code block 3 (unknown):\nrequire(newRatio <= 5, \"Max Keeper reward is 5%\");\n\n// Code block 4 (unknown):\n* @param newRatio The new reward ratio to set, limited to a maximum of 5%.\n\n// Code block 5 (unknown):\nrequire(newRatio <= 500, \"Max Keeper reward is 5%\");", "all_code_blocks_count": 5, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LybraConfigurator.sol#L292-L293, LybraConfigurator.sol#L246-L249, LybraConfigurator.sol#L235-L240, LybraConfigurator.sol#L224-L228", "github_files_list": "LybraConfigurator.sol", "github_refs_count": 4, "vulnerable_code_actual": "peUSD.transfer(address(lybraProtocolRewardsPool), peUSDBalance);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "require(_ratio > 0, \"Ratio should be greater than 0\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 11} {"source": "c4", "protocol": "04-caviar", "title": "Rolezn Q", "severity_raw": "Critical", "severity": "critical", "description": "## Summary\n\n### Low Risk Issues\n| |Issue|Contexts|\n|-|:-|:-:|\n| [LOW‑1](#LOW‑1) | Add to `blacklist` function | 1 |\n| [LOW‑2](#LOW‑2) | Do not allow fees to be set to `100%` | 2 |\n| [LOW‑3](#LOW‑3) | `decimals()` not part of ERC20 standard | 2 |\n| [LOW‑4](#LOW‑4) | Event is missing parameters | 7 |\n| [LOW‑5](#LOW‑5) | Missing Contract-existence Checks Before Low-level Calls | 1 |\n| [LOW‑6](#LOW‑6) | Missing ReEntrancy Guard to `withdraw` function | 1 |\n| [LOW‑7](#LOW‑7) | Missing Checks for Address(0x0) | 1 |\n| [LOW‑8](#LOW‑8) | Contracts are not using their OZ Upgradeable counterparts | 5 |\n| [LOW‑9](#LOW‑9) | Missing length check for inputs | 4 |\n| [LOW‑10](#LOW‑10) | Protect your NFT from copying in POW forks | 2 |\n| [LOW‑11](#LOW‑11) | `tokenURI()` does not follow EIP-721 | 2 |\n| [LOW‑12](#LOW‑12) | Unused `receive()` Function Will Lock Ether In Contract | 3 |\n\nTotal: 31 contexts over 12 issues\n\n### Non-critical Issues\n| |Issue|Contexts|\n|-|:-|:-:|\n| [NC‑1](#NC‑1) | Add a timelock to critical functions | 12 |\n| [NC‑2](#NC‑2) | Avoid Floating Pragmas: The Version Should Be Locked | 5 |\n| [NC‑3](#NC‑3) | Critical Changes Should Use Two-step Procedure | 12 |\n| [NC‑4](#NC‑4) | Event Is Missing Indexed Fields | 5 |\n| [NC‑5](#NC‑5) | Imports can be grouped together | 24 |\n| [NC‑6](#NC‑6) | NatSpec return parameters should be included in contracts | 1 |\n| [NC‑7](#NC‑7) | No need to initialize uints to zero | 2 |\n| [NC‑8](#NC‑8) | Initial value check is missing in Set Functions | 10 |\n| [NC‑9](#NC‑9) | Missing event for critical parameter change | 5 |\n| [NC‑10](#NC‑10) | Implementation contract may not be initialized | 3 |\n| [NC‑11](#NC ", "vulnerable_code": " modifier nonBlacklistRequired(address extension) {\n require(!_blacklistedExtensions.contains(extension), \"Extension blacklisted\");\n _;\n }", "fixed_code": "function setProtocolFeeRate(uint16 _protocolFeeRate) public onlyOwner {\n protocolFeeRate = _protocolFeeRate;\n }\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/Rolezn-Q.md", "collected_at": "2026-01-02T18:20:03.216350+00:00", "source_hash": "90eb6c61490d039a732b23ed75770577602d9e3412d3b868da2776f707df64df", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " modifier nonBlacklistRequired(address extension) {\n require(!_blacklistedExtensions.contains(extension), \"Extension blacklisted\");\n _;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function setProtocolFeeRate(uint16 _protocolFeeRate) public onlyOwner {\n protocolFeeRate = _protocolFeeRate;\n }\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "09-ondo", "title": "mrudenko G", "severity_raw": "Gas", "severity": "gas", "description": "RWADynamicOracle\n1) Storage is one of the most expensive operations in terms of gas. Reducing storage writes can save a significant amount of gas.\n\nFor example, in the overrideRange function:\n```\nranges[indexToModify] = Range(\n newStart,\n newEnd,\n newDailyIR,\n newPrevRangeClosePrice\n );\n\n```\nInstead of creating a new Range struct every time, you can modify the existing one:\n```\nranges[indexToModify].start = newStart;\nranges[indexToModify].end = newEnd;\nranges[indexToModify].dailyInterestRate = newDailyIR;\nranges[indexToModify].prevRangeClosePrice = newPrevRangeClosePrice;\n```\n\nrUSDY.sol\nThe contract imports both IERC20Upgradeable and IERC20MetadataUpgradeable. However, IERC20MetadataUpgradeable already extends IERC20Upgradeable, so you only need to import IERC20MetadataUpgradeable.\n```\nimport \"contracts/external/openzeppelin/contracts-upgradeable/token/ERC20/IERC20MetadataUpgradeable.sol\";\n```\nThe _beforeTokenTransfer function is marked as internal but is only used within the contract. Consider changing its visibility to private unless you expect derived contracts to use it.\n", "vulnerable_code": "ranges[indexToModify] = Range(\n newStart,\n newEnd,\n newDailyIR,\n newPrevRangeClosePrice\n );\n", "fixed_code": "ranges[indexToModify].start = newStart;\nranges[indexToModify].end = newEnd;\nranges[indexToModify].dailyInterestRate = newDailyIR;\nranges[indexToModify].prevRangeClosePrice = newPrevRangeClosePrice;", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/mrudenko-G.md", "collected_at": "2026-01-02T18:26:07.706242+00:00", "source_hash": "90f99fbe38c04497da47c4d443571fdd4497447a391c639418c1c3bdacf24e6d", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 426, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "ranges[indexToModify] = Range(\n newStart,\n newEnd,\n newDailyIR,\n newPrevRangeClosePrice\n );", "primary_code_language": "unknown", "primary_code_char_count": 124, "all_code_blocks": "// Code block 1 (unknown):\nranges[indexToModify] = Range(\n newStart,\n newEnd,\n newDailyIR,\n newPrevRangeClosePrice\n );\n\n// Code block 2 (unknown):\nranges[indexToModify].start = newStart;\nranges[indexToModify].end = newEnd;\nranges[indexToModify].dailyInterestRate = newDailyIR;\nranges[indexToModify].prevRangeClosePrice = newPrevRangeClosePrice;\n\n// Code block 3 (unknown):\nimport \"contracts/external/openzeppelin/contracts-upgradeable/token/ERC20/IERC20MetadataUpgradeable.sol\";", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "ranges[indexToModify] = Range(\n newStart,\n newEnd,\n newDailyIR,\n newPrevRangeClosePrice\n );\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "ranges[indexToModify].start = newStart;\nranges[indexToModify].end = newEnd;\nranges[indexToModify].dailyInterestRate = newDailyIR;\nranges[indexToModify].prevRangeClosePrice = newPrevRangeClosePrice;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7.25} {"source": "c4", "protocol": "05-ajna", "title": "nzm_ Q", "severity_raw": "Medium", "severity": "medium", "description": "### Events should have `msg.sender`'s indexed address as an argument\n \nWhen a transaction is triggered based on a user's action, not being able to filter based on who triggered the action makes event processing a lot more cumbersome. Including `msg.sender` in the events will make events much more useful.\n\n9 Instances found:\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/interfaces/IFunding.sol#L49\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/interfaces/IStandardFunding.sol#L74-L77\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/interfaces/IStandardFunding.sol#L85-L89\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/interfaces/IGrantFund.sol#L24\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/interfaces/position/IPositionManagerEvents.sol#L25-L29\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/interfaces/position/IPositionManagerEvents.sol#L37-L41\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/interfaces/position/IPositionManagerEvents.sol#L52-L59\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/interfaces/position/IPositionManagerEvents.sol#L66-L70\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/interfaces/rewards/IRewardsManagerEvents.sol#L32-L36\n\n### Variables need not be initialized\n\nThe default value for variables is already zero. \n\nAnd in `StandardFunding.sol` in the function `_fundingVote()` the variable `support` is initialize with value 1, but then immediately rewritten.\n\n9 Instances found:\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L63\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L619\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L770\nhttps://github.com/code-423n4/2023-05-ajna/blob/mai", "vulnerable_code": "newTopSlate_ = currentSlateHash == 0 ||\n (currentSlateHash != 0 && sum > _sumProposalFundingVotes(_fundedProposalSlates[currentSlateHash]));", "fixed_code": " modifier mayInteract(address pool_, uint256 tokenId_) {\n\n // revert if token id is not a valid / minted id\n _requireMinted(tokenId_);\n\n // revert if sender is not owner of or entitled to operate on token id\n if (!_isApprovedOrOwner(msg.sender, tokenId_)) revert NoAuth();\n\n // revert if the token id is not minted for given pool address\n if (pool_ != poolKey[tokenId_]) revert WrongPool();\n\n _;\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/nzm_-Q.md", "collected_at": "2026-01-02T18:21:41.022129+00:00", "source_hash": "912a38a6d49feff5be3a70021d472877c802e9d834b28bb5f902dc0f737efd42", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 12, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "IFunding.sol#L49, IStandardFunding.sol#L74-L77, IStandardFunding.sol#L85-L89, IGrantFund.sol#L24, IPositionManagerEvents.sol#L25-L29, IPositionManagerEvents.sol#L37-L41, IPositionManagerEvents.sol#L52-L59, IPositionManagerEvents.sol#L66-L70, IRewardsManagerEvents.sol#L32-L36, StandardFunding.sol#L63, StandardFunding.sol#L619, StandardFunding.sol#L770", "github_files_list": "IStandardFunding.sol, IPositionManagerEvents.sol, IRewardsManagerEvents.sol, StandardFunding.sol, IGrantFund.sol, IFunding.sol", "github_refs_count": 12, "vulnerable_code_actual": "newTopSlate_ = currentSlateHash == 0 ||\n (currentSlateHash != 0 && sum > _sumProposalFundingVotes(_fundedProposalSlates[currentSlateHash]));", "has_vulnerable_code_snippet": true, "fixed_code_actual": " modifier mayInteract(address pool_, uint256 tokenId_) {\n\n // revert if token id is not a valid / minted id\n _requireMinted(tokenId_);\n\n // revert if sender is not owner of or entitled to operate on token id\n if (!_isApprovedOrOwner(msg.sender, tokenId_)) revert NoAuth();\n\n // revert if the token id is not minted for given pool address\n if (pool_ != poolKey[tokenId_]) revert WrongPool();\n\n _;\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "03-asymmetry", "title": "MiniGlome G", "severity_raw": "High", "severity": "high", "description": "## Gas Optimizations\n| |Issue|Instances|\n|-|:-|:-:|\n| [GAS-01] | The result of function calls should be cached rather than re-calling the function | 2 |\n| [GAS-02] | For loop can be replace by simple addition | 1 | \n| [GAS-03] | Check should be done before For loop | 1 | \n| [GAS-04] | Check should be done beforehand | 1 | \n| [GAS-05] | Unnecessary calculations | 1 | \n| [GAS-06] | Functions guaranteed to revert when called by normal users can be marked `payable` | 14 | \n| [GAS-07] | Increments can be `unchecked` | 1 | \n| [GAS-08] | Setting the `constructor` to `payable` | 4 | \n\n### [GAS-01] The result of function calls should be cached rather than re-calling the function\nThe instances below point to the second+ call of the function within a single function.\n\n*Instances (2)*:\n```solidity\nFile: contracts/SafEth/SafEth.sol\n74:\t\t\t\t\tderivatives[i].balance()\n\n142:\t\t\t\tderivatives[i].withdraw(derivatives[i].balance());\n\n```\nConsider storing the value of `derivatives[i].balance()` in a local variable instead of calling this function twice.\n\n### [GAS-02] For loop can be replace by simple addition\nIn the following code, the for loop can be replaced by a simple addition because only the `_weight` is to be added to the `totalWeight`.\n\n*Instance (1)*:\n```solidity\nFile: contracts/SafEth/SafEth.sol\n190:\tuint256 localTotalWeight = 0;\n\t\tfor (uint256 i = 0; i < derivativeCount; i++)\n\t\t\tlocalTotalWeight += weights[i];\n\t\ttotalWeight = localTotalWeight;\n\n```\nCan be replaced by:\n```solidity\ntotalWeight = totalWeight + _weight;\n```\n\n### [GAS-03] Check should be done before For loop\nThe check of `ethAmountToRebalance` should be done before the for loop.\n\n*Instance (1)*:\n```solidity\nFile: contracts/SafEth/SafEth.sol\n148:\tfor (uint i = 0; i < derivativeCount; i++) {\n\t\t\tif (weights[i] == 0 || ethAmountToRebalance == 0) continue; // @audit edit this check\n\t\t\tuint256 ethAmount = (ethAmountToRebalance * weights[i]) /\n\t\t\t\ttotalWeight;\n\t\t\t// Price will change due to slippage\n\t\t\tderivatives[i].depos", "vulnerable_code": "File: contracts/SafEth/SafEth.sol\n74:\t\t\t\t\tderivatives[i].balance()\n\n142:\t\t\t\tderivatives[i].withdraw(derivatives[i].balance());\n", "fixed_code": "File: contracts/SafEth/SafEth.sol\n190:\tuint256 localTotalWeight = 0;\n\t\tfor (uint256 i = 0; i < derivativeCount; i++)\n\t\t\tlocalTotalWeight += weights[i];\n\t\ttotalWeight = localTotalWeight;\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/MiniGlome-G.md", "collected_at": "2026-01-02T18:18:21.153885+00:00", "source_hash": "912fc8a145f081732140b70230d8b8523d844bbe31c8bbbd72b7577447ed5b15", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 347, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/SafEth/SafEth.sol\n74:\t\t\t\t\tderivatives[i].balance()\n\n142:\t\t\t\tderivatives[i].withdraw(derivatives[i].balance());", "primary_code_language": "solidity", "primary_code_char_count": 126, "all_code_blocks": "// Code block 1 (solidity):\nFile: contracts/SafEth/SafEth.sol\n74:\t\t\t\t\tderivatives[i].balance()\n\n142:\t\t\t\tderivatives[i].withdraw(derivatives[i].balance());\n\n// Code block 2 (solidity):\nFile: contracts/SafEth/SafEth.sol\n190:\tuint256 localTotalWeight = 0;\n\t\tfor (uint256 i = 0; i < derivativeCount; i++)\n\t\t\tlocalTotalWeight += weights[i];\n\t\ttotalWeight = localTotalWeight;\n\n// Code block 3 (solidity):\ntotalWeight = totalWeight + _weight;", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: contracts/SafEth/SafEth.sol\n74:\t\t\t\t\tderivatives[i].balance()\n\n142:\t\t\t\tderivatives[i].withdraw(derivatives[i].balance());\n\nFile: contracts/SafEth/SafEth.sol\n190:\tuint256 localTotalWeight = 0;\n\t\tfor (uint256 i = 0; i < derivativeCount; i++)\n\t\t\tlocalTotalWeight += weights[i];\n\t\ttotalWeight = localTotalWeight;\n\ntotalWeight = totalWeight + _weight;", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: contracts/SafEth/SafEth.sol\n74:\t\t\t\t\tderivatives[i].balance()\n\n142:\t\t\t\tderivatives[i].withdraw(derivatives[i].balance());\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/SafEth/SafEth.sol\n190:\tuint256 localTotalWeight = 0;\n\t\tfor (uint256 i = 0; i < derivativeCount; i++)\n\t\t\tlocalTotalWeight += weights[i];\n\t\ttotalWeight = localTotalWeight;\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "09-ondo", "title": "0xanmol G", "severity_raw": "Medium", "severity": "medium", "description": "## [G-1] In the ```_rpow``` function the n is never gonna be 0 so it is useless to run the switch case to check if n==0\n\n### Code line\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/rwaOracles/RWADynamicOracle.sol#L354\n\n\n### Details\n\nIn ```_rpow``` there is a switch case which checks for if n==0, this is the condition never meet because ``_rpow``` is only called inside the ```derivePrice``` function where the value is always summed by 1 so it never gonna be 0. minimum it can be 1. it is useless to check for this and waste some gas.\n\n```diff\n - case 0 {\n - switch n\n - case 0 { z := base }\n - default { z := 0 }\n }\n\n\n + case 0 {\n + s := 0\n + }\n \n \n```\n\nIt is reccomended to removed the unused code to save some gas.", "vulnerable_code": "", "fixed_code": "", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/0xanmol-G.md", "collected_at": "2026-01-02T18:25:14.845307+00:00", "source_hash": "9132288c0a5cfd849521385c8f58de1f55aeb33cbed3e385b2876926b76613d4", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 148, "github_ref_count": 1, "vulnerable_code_is_url": true, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "- case 0 {\n - switch n\n - case 0 { z := base }\n - default { z := 0 }\n }\n\n\n + case 0 {\n + s := 0\n + }", "primary_code_language": "diff", "primary_code_char_count": 148, "all_code_blocks": "// Code block 1 (diff):\n- case 0 {\n - switch n\n - case 0 { z := base }\n - default { z := 0 }\n }\n\n\n + case 0 {\n + s := 0\n + }", "all_code_blocks_count": 1, "has_diff_blocks": true, "diff_code": "- case 0 {\n - switch n\n - case 0 { z := base }\n - default { z := 0 }\n }\n\n\n + case 0 {\n + s := 0\n + }", "solidity_code": "", "github_refs_formatted": "RWADynamicOracle.sol#L354", "github_files_list": "RWADynamicOracle.sol", "github_refs_count": 1, "vulnerable_code_actual": "", "has_vulnerable_code_snippet": false, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5.66} {"source": "c4", "protocol": "08-dopex", "title": "Stryder Q", "severity_raw": "Unknown", "severity": "unknown", "description": "# [NC-01] Missing Validation Checks for tokenA and tokenB in **approveContractToSpend** function \n\nSince the contract is only dealing with weth and rdpx tokens , so all the transactions that happen must involve those tokens only. Please consider adding a check for checking if the token address passed is either tokenA or tokenB\n\n``` \nfunction approveContractToSpend(\n address _token,\n address _spender,\n uint256 _amount\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n require(_token == addresses.tokenA || _token ==addresses.tokenB )\n require(_token != address(0), \"reLPContract: token cannot be 0\");\n require(_spender != address(0), \"reLPContract: spender cannot be 0\");\n require(_amount > 0, \"reLPContract: amount must be greater than 0\");\n IERC20WithBurn(_token).approve(_spender, _amount); \n\n }\n\n```\nLink : https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/amo/UniV2LiquidityAmo.sol#L126-L135\n\n# [NC-02] Consider using addLiquidityETH instead of addLiquidity \n\nSince the contract is dealing with weth , its suggested to use addLiquidityETH instead of using addLiquidity . Its also given in the uniswap docs ( https://docs.uniswap.org/contracts/v2/guides/smart-contract-integration/providing-liquidity#:~:text=use%20addLiquidity.%20If%20WETH%20is%20involved%2C%20use%20addLiquidityETH )\n\nLink : https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/amo/UniV2LiquidityAmo.sol#L223\n\n# [NC-03] Adding Checks for avoiding slippage \n\nWhile adding liquidity , consider adding a check for amount0Min and amount1Min to check that they are greater than 0. This will help avoid slippage for while adding liquidity . Consider adding this check \n``` \nrequire(_amount0Min!=0 && _amount1Min!=0);\n```\n\nLink : \n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/amo/UniV2LiquidityAmo.sol#L223\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/amo/UniV3LiquidityAmo.sol#L178-L191\n\n\n\n", "vulnerable_code": "function approveContractToSpend(\n address _token,\n address _spender,\n uint256 _amount\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n require(_token == addresses.tokenA || _token ==addresses.tokenB )\n require(_token != address(0), \"reLPContract: token cannot be 0\");\n require(_spender != address(0), \"reLPContract: spender cannot be 0\");\n require(_amount > 0, \"reLPContract: amount must be greater than 0\");\n IERC20WithBurn(_token).approve(_spender, _amount); \n\n }\n", "fixed_code": "require(_amount0Min!=0 && _amount1Min!=0);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/Stryder-Q.md", "collected_at": "2026-01-02T18:25:08.567489+00:00", "source_hash": "913729a81da68fc16a73c4e55725324569c7d02cda595d00d27e50fcd8fecaec", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 855, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "Link : https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/amo/UniV2LiquidityAmo.sol#L126-L135\n\n# [NC-02] Consider using addLiquidityETH instead of addLiquidity \n\nSince the contract is dealing with weth , its suggested to use addLiquidityETH instead of using addLiquidity . Its also given in the uniswap docs ( https://docs.uniswap.org/contracts/v2/guides/smart-contract-integration/providing-liquidity#:~:text=use%20addLiquidity.%20If%20WETH%20is%20involved%2C%20use%20addLiquidityETH )\n\nLink : https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/amo/UniV2LiquidityAmo.sol#L223\n\n# [NC-03] Adding Checks for avoiding slippage \n\nWhile adding liquidity , consider adding a check for amount0Min and amount1Min to check that they are greater than 0. This will help avoid slippage for while adding liquidity . Consider adding this check", "primary_code_language": "unknown", "primary_code_char_count": 855, "all_code_blocks": "// Code block 1 (unknown):\nLink : https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/amo/UniV2LiquidityAmo.sol#L126-L135\n\n# [NC-02] Consider using addLiquidityETH instead of addLiquidity \n\nSince the contract is dealing with weth , its suggested to use addLiquidityETH instead of using addLiquidity . Its also given in the uniswap docs ( https://docs.uniswap.org/contracts/v2/guides/smart-contract-integration/providing-liquidity#:~:text=use%20addLiquidity.%20If%20WETH%20is%20involved%2C%20use%20addLiquidityETH )\n\nLink : https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/amo/UniV2LiquidityAmo.sol#L223\n\n# [NC-03] Adding Checks for avoiding slippage \n\nWhile adding liquidity , consider adding a check for amount0Min and amount1Min to check that they are greater than 0. This will help avoid slippage for while adding liquidity . Consider adding this check", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "UniV2LiquidityAmo.sol#L126-L135, UniV2LiquidityAmo.sol#L223, UniV3LiquidityAmo.sol#L178-L191", "github_files_list": "UniV2LiquidityAmo.sol, UniV3LiquidityAmo.sol", "github_refs_count": 3, "vulnerable_code_actual": "function approveContractToSpend(\n address _token,\n address _spender,\n uint256 _amount\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n require(_token == addresses.tokenA || _token ==addresses.tokenB )\n require(_token != address(0), \"reLPContract: token cannot be 0\");\n require(_spender != address(0), \"reLPContract: spender cannot be 0\");\n require(_amount > 0, \"reLPContract: amount must be greater than 0\");\n IERC20WithBurn(_token).approve(_spender, _amount); \n\n }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "require(_amount0Min!=0 && _amount1Min!=0);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "09-ondo", "title": "Arz Q", "severity_raw": "Low", "severity": "low", "description": "### Low risk issues\n| |Issue|Instances|\n|-|:-|:-:|\n| [L‑01] | The admin wont be able to burn rUSDY if the address is blacklisted/sanctioned and not on the allowlist | 1 | \n| [L‑02] | When overriding a range the prevRangeClosePrice of the next range is not updated | 1 | \n| [L‑03] | If a user wraps a small amount then the calculations will be wrong because of rounding | 1 | \n| [L‑04] | If the user bridges more than the max mint limit/max threshold then he will lose everything | 1 |\n| [L‑05] | lastResetMintTime and currentMintAmount should be reset when the admin sets a new mint limit | 1 | \n| [L‑06] | Wrong values are emitted when wrapping | 2 | \n| [L‑07] | Wrong comment in RWADynamicOracle.sol | 1 | \n| [L‑08] | dailyInterestRate can be accidentally set to 0 | 1 | \n\nTotal: 9 instances over 8 issues \n\n## [L‑01] The admin wont be able to burn rUSDY if the address is blacklisted/sanctioned and not on the allowlist\n\nThe `burn()` function in `rUSDY.sol` allows the admin to seize rUSDY if the user is not legally allowed to own it. It will first burn the shares and then it will transfer the USDY. The problem is that the user can be blacklisted/sanctioned which will make the tx revert because of `_beforeTokenTransfer().` The user also needs to be on the allowlist. \n\n\nIt is very likely that the user will first be blacklisted to prevent him from transferring his assets before they are seized so the admin wont be able to seize the assets because when burning `_beforeTokenTransfer()` checks if the address is blacklisted/sanctioned or no and reverts.\n\n\n### Impact\n\nThe admin wont be able to seize assets from the user and he will have to unblacklist him and maybe put him on the allowlist to do this which can be a problem because the user can quickly transfer his assets when he is not blacklisted. \n\n\n\n\n### Code Snippet\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contr", "vulnerable_code": "File: usdy/rUSDY.sol\n\n672: function burn(\n673: address _account,\n674: uint256 _amount\n675: ) external onlyRole(BURNER_ROLE) {\n676: uint256 sharesAmount = getSharesByRUSDY(_amount);\n677:\n678: _burnShares(_account, sharesAmount);", "fixed_code": "File: rwaOracles/RWADynamicOracle.sol\n\n218: if (indexToModify == 0) {\n219: uint256 trueStart = (newPrevRangeClosePrice * ONE) / newDailyIR;\n220: ranges[indexToModify] = Range(newStart, newEnd, newDailyIR, trueStart);\n221: } else {\n222: ranges[indexToModify] = Range(\n223: newStart,\n224: newEnd,\n225: newDailyIR,\n226: newPrevRangeClosePrice\n227: );\n228: }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/Arz-Q.md", "collected_at": "2026-01-02T18:25:23.265968+00:00", "source_hash": "913bc7a2a115ac6de319bc06729587fb0ca446cfae30e880df831183cc0bb0dc", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: usdy/rUSDY.sol\n\n672: function burn(\n673: address _account,\n674: uint256 _amount\n675: ) external onlyRole(BURNER_ROLE) {\n676: uint256 sharesAmount = getSharesByRUSDY(_amount);\n677:\n678: _burnShares(_account, sharesAmount);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: rwaOracles/RWADynamicOracle.sol\n\n218: if (indexToModify == 0) {\n219: uint256 trueStart = (newPrevRangeClosePrice * ONE) / newDailyIR;\n220: ranges[indexToModify] = Range(newStart, newEnd, newDailyIR, trueStart);\n221: } else {\n222: ranges[indexToModify] = Range(\n223: newStart,\n224: newEnd,\n225: newDailyIR,\n226: newPrevRangeClosePrice\n227: );\n228: }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "09-ondo", "title": "zabihullahazadzoi G", "severity_raw": "High", "severity": "high", "description": "# Ondo Finance - Gas Optimizations Report\n\n**Notes**: \n- For Gas estimates I\u2019ve tried to give the exact amount of gas being saved from running the included tests. Whenever the function is within the test coverage, the average, before and after will be included, and often a diff of the code will also accompany this.\nSome functions are not covered by the test cases or are internal/private functions. In this case, the gas can be estimated by looking at the opcodes involved.\n- Instances pointed out in G-04, G-05, G-08, have missed by bot race and aren't included in automated report.\n\n\n# Summary\n\n| Number | Issue | Instances |\n|------|----------|------------|\n|[G-01]| Use calldata instead of memory for function arguments that do not get mutated|2|\n|[G-02]| Access mappings directly rather than using accessor functions|1|\n|[G-03]| Expressions for constant values such as a call to\u00a0keccak256(), should use immutable rather than constant|8|\n|[G-04]| >=/<= costs less gas than >/<|4|\n|[G-05]| Amounts should be checked for\u00a00\u00a0before calling a transfer|1|\n|[G-06]| Use hardcode address instead address(this)|3|\n|[G-07]| Use Assembly To Check For\u00a0address(0)|8|\n|[G-08]| Use assembly to hash instead of Solidity|6|\n|[G-09]| ++i/i++ should be unchecked{++i}/unchecked{i++} when it is not possible for them to overflow, as is the case when used in for loops|8|\n\n\n\n## [G-01] Use calldata instead of memory for function arguments that do not get mutated\nWhen you specify a data location as memory, that value will be copied into memory. When you specify the location as calldata, the value will stay static within calldata. If the value is a large, complex type, using memory may result in extra memory expansion costs as well as cost more gas for protocol.\n\nGas saving for `SourceBridge.setDestinationChainContractAddress`, obtained via protocol's tests: Avg 394 gas.\n\n| | Min| Average| Max |\n|------|----------|-------|-----|\n|Before|3035|83198|90409|\n|After|2894|82804|89998|\n\n\n```solidity\nFil", "vulnerable_code": "File:\tcontracts/bridge/SourceBridge.sol\n122 string memory destinationChain,", "fixed_code": "https://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/bridge/SourceBridge.sol#L122\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/zabihullahazadzoi-G.md", "collected_at": "2026-01-02T18:26:22.500806+00:00", "source_hash": "917d9fb577feb8beb0602a993fd508161171635a00b14ab68f1b48ba765b4c6b", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SourceBridge.sol#L122", "github_files_list": "SourceBridge.sol", "github_refs_count": 1, "vulnerable_code_actual": "File:\tcontracts/bridge/SourceBridge.sol\n122 string memory destinationChain,", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "03-asymmetry", "title": "Jerry0x G", "severity_raw": "High", "severity": "high", "description": "```\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L79-L81\n\n if (totalSupply != 0)\n preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n else \n preDepositPrice = 10 ** 18; // initializes with a price of 1\n```\n\n```\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L72-L75\n\n for (uint i = 0; i < derivativeCount; i++){\n IDerivative derivative = derivatives[i];\n underlyingValue +=\n (derivative.ethPerDerivative(derivative.balance()) *\n derivative.balance()) /\n 10 ** 18;\n }\n\n```\n```\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L65-L66\n\n require(msg.value > minAmount, \"amount too low\");\n require(msg.value < maxAmount, \"amount too high\");\n```\n```\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L215\n function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n if (poolCanDeposit(_amount))\n return\n RocketTokenRETHInterface(rethAddress()).getEthValue(10 ** 18);\n else return poolPrice();\n }\n```", "vulnerable_code": "https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L79-L81\n\n if (totalSupply != 0)\n preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n else \n preDepositPrice = 10 ** 18; // initializes with a price of 1", "fixed_code": "https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L72-L75\n\n for (uint i = 0; i < derivativeCount; i++){\n IDerivative derivative = derivatives[i];\n underlyingValue +=\n (derivative.ethPerDerivative(derivative.balance()) *\n derivative.balance()) /\n 10 ** 18;\n }\n", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Jerry0x-G.md", "collected_at": "2026-01-02T18:18:12.019979+00:00", "source_hash": "9186cde7ff36091b344fbe525b178f947d750cd242be905cd37b559ab28a40e0", "code_block_count": 4, "solidity_block_count": 0, "total_code_chars": 1228, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L79-L81\n\n if (totalSupply != 0)\n preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n else \n preDepositPrice = 10 ** 18; // initializes with a price of 1", "primary_code_language": "unknown", "primary_code_char_count": 285, "all_code_blocks": "// Code block 1 (unknown):\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L79-L81\n\n if (totalSupply != 0)\n preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n else \n preDepositPrice = 10 ** 18; // initializes with a price of 1\n\n// Code block 2 (unknown):\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L72-L75\n\n for (uint i = 0; i < derivativeCount; i++){\n IDerivative derivative = derivatives[i];\n underlyingValue +=\n (derivative.ethPerDerivative(derivative.balance()) *\n derivative.balance()) /\n 10 ** 18;\n }\n\n// Code block 3 (unknown):\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L65-L66\n\n require(msg.value > minAmount, \"amount too low\");\n require(msg.value < maxAmount, \"amount too high\");\n\n// Code block 4 (unknown):\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L215\n function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n if (poolCanDeposit(_amount))\n return\n RocketTokenRETHInterface(rethAddress()).getEthValue(10 ** 18);\n else return poolPrice();\n }", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol#L79-L81, SafEth.sol#L72-L75, SafEth.sol#L65-L66, Reth.sol#L215", "github_files_list": "Reth.sol, SafEth.sol", "github_refs_count": 4, "vulnerable_code_actual": "https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L79-L81\n\n if (totalSupply != 0)\n preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n else \n preDepositPrice = 10 ** 18; // initializes with a price of 1", "has_vulnerable_code_snippet": true, "fixed_code_actual": "https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L72-L75\n\n for (uint i = 0; i < derivativeCount; i++){\n IDerivative derivative = derivatives[i];\n underlyingValue +=\n (derivative.ethPerDerivative(derivative.balance()) *\n derivative.balance()) /\n 10 ** 18;\n }\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9.53} {"source": "c4", "protocol": "07-amphora", "title": "foxb868 G", "severity_raw": "High", "severity": "high", "description": "## GAS-01 - Large Loop in _calculate Function\nIn the `_calculate` function, the loop is used to calculate the amount of AMPH to mint based on the input token amount `(_tempAmountReceived)`. The loop iterates to determine how much AMPH should be minted for a given amount of input tokens (CRV) based on certain conditions and cliff limits.\n\nInstance: https://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/core/AMPHClaimer.sol#L210\n```solidity\nwhile (_tempAmountReceived > 0) {\n // ... loop body ...\n}\n```\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/core/AMPHClaimer.sol#L210-L246\n\nThis` while` loop is used to calculate the amount of AMPH to mint based on the input token amount `(_tempAmountReceived)`. The loop performs multiple calculations to determine the correct amount of AMPH to mint based on certain conditions and cliff limits.\n\nThe loop can be computationally expensive, especially if `_tempAmountReceived` is a large value. As the loop iterates, the gas cost increases linearly with the number of iterations. If `_tempAmountReceived` is very large, it could lead to significantly higher gas costs, which may exceed the block gas limit. Transactions consuming too much gas may fail or become unreasonably expensive for users.\n\n## GAS-02 - Complex Mathematical Operations in `_calculate` Function.\nIn this line, `_amphForThisTurn` is calculated based on _rate (a value derived from previous calculations), multiplied by `_tempAmountReceived` (the input token amount), and then divided by 1e12 and 1e6. This involves multiple divisions and multiplications, which can lead to significant gas consumption, especially if `_tempAmountReceived` is a large value.\n\n[#L222](https://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/core/AMPHClaimer.sol#L222)\n```solidity\n_amphForThisTurn = ((_rate * _tempA", "vulnerable_code": "while (_tempAmountReceived > 0) {\n // ... loop body ...\n}", "fixed_code": "_amphForThisTurn = ((_rate * _tempAmountReceived) / 1e12) / 1e6; // 1e6", "recommendation": "", "category": "dos", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/foxb868-G.md", "collected_at": "2026-01-02T18:23:47.916115+00:00", "source_hash": "91bf5d746534db76b6dae866f7537d09275457975dd8b8155d6fa754827ac56e", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 58, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "while (_tempAmountReceived > 0) {\n // ... loop body ...\n}", "primary_code_language": "solidity", "primary_code_char_count": 58, "all_code_blocks": "// Code block 1 (solidity):\nwhile (_tempAmountReceived > 0) {\n // ... loop body ...\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "while (_tempAmountReceived > 0) {\n // ... loop body ...\n}", "github_refs_formatted": "AMPHClaimer.sol#L210, AMPHClaimer.sol#L222", "github_files_list": "AMPHClaimer.sol", "github_refs_count": 2, "vulnerable_code_actual": "while (_tempAmountReceived > 0) {\n // ... loop body ...\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "_amphForThisTurn = ((_rate * _tempAmountReceived) / 1e12) / 1e6; // 1e6", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "08-dopex", "title": "HHK Q", "severity_raw": "Low", "severity": "low", "description": "### INFO1: Natspec return values are inversed for [`_calculateAmounts()`](https://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/core/RdpxV2Core.sol#L598).\n\n#### Technical Details\n\nIn the function `_calculateAmounts()` the `amount1` returned is the amount received by the delegatee and the `amount2` is the amount received by the delegate but the natspec for this function says the opposite.\n\n#### Impact\n\nCan be missleading for future auditors or integrators.\n\n#### Recommendation\n\nUpdate the natspec.\n\n```diff\n- * @return amount1 The amount received by the delegate\n- * @return amount2 The amount received by the delegatee\n+ * @return amount1 The amount received by the delegatee\n+ * @return amount2 The amount received by the delegate\n```\n\n### LOW1: No `_whenNotPaused()` in `redeem()`\n\n#### Technical Details\n\nAlmost all state changing functions have `_whenNotPaused()` in the core contract but it is not the case for [`redeem()`](https://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/core/RdpxV2Core.sol#L1016).\n\nThe NFT it interact with has a pause/unpause functionnality so the function will revert if the NFT is paused thus the impact seems low.\n\n#### Impact\n\nUser could still redeem even tho the core contract is paused.\n\n#### Recommendation\n\nAdd `_whenNotPaused()` to the function.\n\n### LOW2: Calling `liquidityInPool()` will always return 0 on UniV3 AMO\n\n#### Technical Details\n\nBecause uniswap v3 position are minted using the nonFungiblePositionManager, asking the liquidity of the AMO address directly from the pool will return 0 in [`liquidityInPool()`](https://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/amo/UniV3LiquidityAmo.sol#L94).\n\n#### Impact\n\nIncorrect liquidity returned.\n\n#### Recommendation\n\nQuery the liquidity on the nonFungiblePositionManager instead of the pool.\n\n### LOW3: `collectFees()` might become gas intensive over time\n\n#", "vulnerable_code": "", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/HHK-Q.md", "collected_at": "2026-01-02T18:24:39.293075+00:00", "source_hash": "91f5e7915c577f0128326201ce5671edb63a5c45b218a080e6d412e8cbcbc92d", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 225, "github_ref_count": 3, "vulnerable_code_is_url": true, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "- * @return amount1 The amount received by the delegate\n- * @return amount2 The amount received by the delegatee\n+ * @return amount1 The amount received by the delegatee\n+ * @return amount2 The amount received by the delegate", "primary_code_language": "diff", "primary_code_char_count": 225, "all_code_blocks": "// Code block 1 (diff):\n- * @return amount1 The amount received by the delegate\n- * @return amount2 The amount received by the delegatee\n+ * @return amount1 The amount received by the delegatee\n+ * @return amount2 The amount received by the delegate", "all_code_blocks_count": 1, "has_diff_blocks": true, "diff_code": "- * @return amount1 The amount received by the delegate\n- * @return amount2 The amount received by the delegatee\n+ * @return amount1 The amount received by the delegatee\n+ * @return amount2 The amount received by the delegate", "solidity_code": "", "github_refs_formatted": "RdpxV2Core.sol#L598, RdpxV2Core.sol#L1016, UniV3LiquidityAmo.sol#L94", "github_files_list": "RdpxV2Core.sol, UniV3LiquidityAmo.sol", "github_refs_count": 3, "vulnerable_code_actual": "", "has_vulnerable_code_snippet": false, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 7} {"source": "c4", "protocol": "02-ethos", "title": "cryptostellar5 G", "severity_raw": "High", "severity": "high", "description": "\n\n|Sno.|Issue|Instances|Gas Savings|\n|---|---|---|---|\n|[G-01]|++I or I++ SHOULD BE UNCHECKED{++I} or UNCHECKED{I++} WHEN IT IS NOT POSSIBLE FOR THEM TO OVERFLOW, AS IS THE CASE WHEN USED IN FOR- AND WHILE-LOOPS|15|600\n|[G-02]|REQUIRE or REVERT STRINGS LONGER THAN 32 BYTES COST EXTRA GAS|47|141\n|[G-03]|SPLITTING REQUIRE() STATEMENTS THAT USE && SAVES GAS|4|12\n|[G-04]|USING REQUIRE() INSTEAD OF ASSERT() HELPS SAVE GAS|20|\n|[G-05]|X += Y COSTS MORE GAS THAN X = X + Y FOR STATE VARIABLES|21|2373\n|[G-06]|USING FIXED BYTES IS CHEAPER THAN USING STRING|6|variable\n|[G-07]|USING BOTH NAMED RETURNS AND A RETURN STATEMENT ISNT NECESSARY|14|42\n|[G-08]|USING 10\\*\\*X FOR CONSTANTS ISN'T GAS EFFICIENT|1|\n\n\n### G-01 ++I or I++ SHOULD BE UNCHECKED{++I} or UNCHECKED{I++} WHEN IT IS NOT POSSIBLE FOR THEM TO OVERFLOW, AS IS THE CASE WHEN USED IN FOR- AND WHILE-LOOPS\n\n*Number of Instances Identified: 15*\n\nThe\u00a0`unchecked`\u00a0keyword is new in solidity version 0.8.0, so this only applies to that version or higher, which these instances are. This saves\u00a0**30-40 gas\u00a0[per loop](https://gist.github.com/hrkrshnn/ee8fabd532058307229d65dcd5836ddc#the-increment-in-for-loop-post-condition-can-be-made-unchecked)**.\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol\n\n```\n108: for(uint256 i = 0; i < numCollaterals; i++) {\n```\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol\n\n```\n56: for(uint256 i = 0; i < _collaterals.length; i++) {\n```\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/StabilityPool.sol\n\n```\n351: for (uint i = 0; i < numCollaterals; i++) {\n397: for (uint i = 0; i < numCollaterals; i++) {\n640: for (uint i = 0; i < assets.length; i++) {\n810: for (uint i = 0; i < collaterals.length; i++) {\n831: for (uint i = 0; i < collaterals.length; i++) {\n859: for (uint i = 0; i < numCollaterals; i++) {\n```\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveMana", "vulnerable_code": "108: for(uint256 i = 0; i < numCollaterals; i++) {", "fixed_code": "56: for(uint256 i = 0; i < _collaterals.length; i++) {", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/cryptostellar5-G.md", "collected_at": "2026-01-02T18:17:00.674317+00:00", "source_hash": "91f74f7be617381077d52910c74f43eacd3058b77a16ef95f0843e3cfd291bb5", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 404, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "108: for(uint256 i = 0; i < numCollaterals; i++) {", "primary_code_language": "unknown", "primary_code_char_count": 50, "all_code_blocks": "// Code block 1 (unknown):\n108: for(uint256 i = 0; i < numCollaterals; i++) {\n\n// Code block 2 (unknown):\n56: for(uint256 i = 0; i < _collaterals.length; i++) {\n\n// Code block 3 (unknown):\n351: for (uint i = 0; i < numCollaterals; i++) {\n397: for (uint i = 0; i < numCollaterals; i++) {\n640: for (uint i = 0; i < assets.length; i++) {\n810: for (uint i = 0; i < collaterals.length; i++) {\n831: for (uint i = 0; i < collaterals.length; i++) {\n859: for (uint i = 0; i < numCollaterals; i++) {", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ActivePool.sol, CollateralConfig.sol, StabilityPool.sol", "github_files_list": "CollateralConfig.sol, ActivePool.sol, StabilityPool.sol", "github_refs_count": 3, "vulnerable_code_actual": "108: for(uint256 i = 0; i < numCollaterals; i++) {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "56: for(uint256 i = 0; i < _collaterals.length; i++) {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "07-amphora", "title": "0xSmartContract Analysis", "severity_raw": "Critical", "severity": "critical", "description": "# Analysis -\ud83c\udffaAmphora Project \ud83c\udffa\n### Summary\n| List |Head |Details|\n|:--|:----------------|:------|\n|a) |The approach I followed when reviewing the code | Stages in my code review and analysis |\n|b) |Analysis of the code base | What is unique? How are the existing patterns used? |\n|c) |Test analysis | Test scope of the project and quality of tests |\n|d) |Architectural | Architecture feedback |\n|e) |Documents | What is the scope and quality of documentation for Users and Administrators? |\n|f) |Centralization risks | How was the risk of centralization handled in the project, what could be alternatives? |\n|g) |Systemic risks | Potential systemic risks in the project |\n|h) |Competition analysis| What are similar projects? |\n|i) |Security Approach of the Project | Audit approach of the Project |\n|j) |Other Audit Reports and Automated Findings | What are the previous Audit reports and their analysis |\n|k) |Gas Optimization | Gas usage approach of the project and alternative solutions to it |\n|l) |New insights and learning from this audit | Things learned from the project |\n\n\n## a) The approach I followed when reviewing the code\n\nFirst, by examining the scope of the code, I determined my code review and analysis strategy.\nhttps://github.com/code-423n4/2023-07-amphora#scope\n\nAccordingly, I analyzed and audited the subject in the following steps;\n\n| Number |Stage |Details|Information|\n|:--|:----------------|:------|:------|\n|1|Compile and Run Test|[Installation](https://github.com/code-423n4/2023-07-amphora#tests)|Test and installation structure is simple, cleanly designed|\n|2|Architecture Review| [Amphora Protocol](https://amphora-protocol.gitbook.io/amphora-protocol) |Provides a basic architectural teaching for General Architecture|\n|3|Graphical Analysis |Graphical Analysis with [Solidity-metrics](https://github.com/ConsenSys/solidity-metrics)|A visual view has been made to dominate the general structure of the codes of the project.|\n|4|Slither Analysis | [Slither](https", "vulnerable_code": "core\\solidity\\test\\invariant\\USDA.t.sol:\n 40 /// @dev the sum of all deposits minus the withdrawals, minus the donated amount should be equal to the total supply of USDA\n 41: function invariant_theSumOfDepositedMinusWithdrawnShouldBeEqualToTotalSupply() public view {\n 42: uint256 _sUSDInTheSystem = usdaHandler.ghost_depositSum() - usdaHandler.ghost_withdrawSum();\n 43: \n 44: uint256 _totalMintedUsda = usdaHandler.ghost_mintedSum() - usdaHandler.ghost_burnedSum();\n 45: \n 46: uint256 _usdaTotalSupplyInitialWithoutDonations = usda.totalSupply() - usdaHandler.initialFragmentsSupply();\n 47: uint256 _usdaTotalSupplyInitialWithDonations =\n 48: _usdaTotalSupplyInitialWithoutDonations - usdaHandler.ghost_donatedSum();\n 49: \n 50: uint256 _totalSupply = _usdaTotalSupplyInitialWithDonations > _totalMintedUsda\n 51: ? _usdaTotalSupplyInitialWithDonations - _totalMintedUsda\n 52: : _totalMintedUsda - _usdaTotalSupplyInitialWithDonations;\n 53: \n 54: assert(_sUSDInTheSystem == _totalSupply);\n 55: }", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/0xSmartContract-Analysis.md", "collected_at": "2026-01-02T18:23:18.822960+00:00", "source_hash": "91f8fc36442d36e236fa4356b1b882860c1ea8e4275e3e29cb9062abbc579884", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "core\\solidity\\test\\invariant\\USDA.t.sol:\n 40 /// @dev the sum of all deposits minus the withdrawals, minus the donated amount should be equal to the total supply of USDA\n 41: function invariant_theSumOfDepositedMinusWithdrawnShouldBeEqualToTotalSupply() public view {\n 42: uint256 _sUSDInTheSystem = usdaHandler.ghost_depositSum() - usdaHandler.ghost_withdrawSum();\n 43: \n 44: uint256 _totalMintedUsda = usdaHandler.ghost_mintedSum() - usdaHandler.ghost_burnedSum();\n 45: \n 46: uint256 _usdaTotalSupplyInitialWithoutDonations = usda.totalSupply() - usdaHandler.initialFragmentsSupply();\n 47: uint256 _usdaTotalSupplyInitialWithDonations =\n 48: _usdaTotalSupplyInitialWithoutDonations - usdaHandler.ghost_donatedSum();\n 49: \n 50: uint256 _totalSupply = _usdaTotalSupplyInitialWithDonations > _totalMintedUsda\n 51: ? _usdaTotalSupplyInitialWithDonations - _totalMintedUsda\n 52: : _totalMintedUsda - _usdaTotalSupplyInitialWithDonations;\n 53: \n 54: assert(_sUSDInTheSystem == _totalSupply);\n 55: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4} {"source": "c4", "protocol": "02-ethos", "title": "Kamil Chmielewski Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA Report\n### Non-Critical Issues\n\n| # | Title | Type | Instances |\n| :--: | --- | :---: | :---: |\n| N-01 | Use named import syntax | Code Quality | All contracts in scope | \n\n### [N-01] Use named import syntax\nInstead of importing entire files, use named import syntax. As the repository grows, static analyzers like Slither or the Solidity compiler might raise \"duplicate definition\" errors because some dependencies might have overlapping names.\n\nAdditionally, using explicit import names increases readability. In the example below in the `CollateralConfig.sol` contract, it is immediately visible that the `IERC20` is imported from the `SafeERC20.sol` thanks to the named import syntax.\n\n```diff\n--- a/Ethos-Core/contracts/CollateralConfig.sol\n+++ b/Ethos-Core/contracts/CollateralConfig.sol\n@@ -2,10 +2,10 @@\n \n pragma solidity 0.6.11;\n \n-import \"./Dependencies/CheckContract.sol\";\n-import \"./Dependencies/Ownable.sol\";\n-import \"./Dependencies/SafeERC20.sol\";\n-import \"./Interfaces/ICollateralConfig.sol\";\n+import {CheckContract} from \"./Dependencies/CheckContract.sol\";\n+import {Ownable} from \"./Dependencies/Ownable.sol\";\n+import {SafeERC20, IERC20} from \"./Dependencies/SafeERC20.sol\";\n+import {ICollateralConfig} from \"./Interfaces/ICollateralConfig.sol\";\n```\n\n", "vulnerable_code": "", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/Kamil-Chmielewski-Q.md", "collected_at": "2026-01-02T18:16:17.538884+00:00", "source_hash": "91fe04827e1e3c9a5a6898da292f5b149025d6728739edf8058e0155a5cfe08f", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 564, "github_ref_count": 0, "vulnerable_code_is_url": true, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "--- a/Ethos-Core/contracts/CollateralConfig.sol\n+++ b/Ethos-Core/contracts/CollateralConfig.sol\n@@ -2,10 +2,10 @@\n \n pragma solidity 0.6.11;\n \n-import \"./Dependencies/CheckContract.sol\";\n-import \"./Dependencies/Ownable.sol\";\n-import \"./Dependencies/SafeERC20.sol\";\n-import \"./Interfaces/ICollateralConfig.sol\";\n+import {CheckContract} from \"./Dependencies/CheckContract.sol\";\n+import {Ownable} from \"./Dependencies/Ownable.sol\";\n+import {SafeERC20, IERC20} from \"./Dependencies/SafeERC20.sol\";\n+import {ICollateralConfig} from \"./Interfaces/ICollateralConfig.sol\";", "primary_code_language": "diff", "primary_code_char_count": 564, "all_code_blocks": "// Code block 1 (diff):\n--- a/Ethos-Core/contracts/CollateralConfig.sol\n+++ b/Ethos-Core/contracts/CollateralConfig.sol\n@@ -2,10 +2,10 @@\n \n pragma solidity 0.6.11;\n \n-import \"./Dependencies/CheckContract.sol\";\n-import \"./Dependencies/Ownable.sol\";\n-import \"./Dependencies/SafeERC20.sol\";\n-import \"./Interfaces/ICollateralConfig.sol\";\n+import {CheckContract} from \"./Dependencies/CheckContract.sol\";\n+import {Ownable} from \"./Dependencies/Ownable.sol\";\n+import {SafeERC20, IERC20} from \"./Dependencies/SafeERC20.sol\";\n+import {ICollateralConfig} from \"./Interfaces/ICollateralConfig.sol\";", "all_code_blocks_count": 1, "has_diff_blocks": true, "diff_code": "--- a/Ethos-Core/contracts/CollateralConfig.sol\n+++ b/Ethos-Core/contracts/CollateralConfig.sol\n@@ -2,10 +2,10 @@\n \n pragma solidity 0.6.11;\n \n-import \"./Dependencies/CheckContract.sol\";\n-import \"./Dependencies/Ownable.sol\";\n-import \"./Dependencies/SafeERC20.sol\";\n-import \"./Interfaces/ICollateralConfig.sol\";\n+import {CheckContract} from \"./Dependencies/CheckContract.sol\";\n+import {Ownable} from \"./Dependencies/Ownable.sol\";\n+import {SafeERC20, IERC20} from \"./Dependencies/SafeERC20.sol\";\n+import {ICollateralConfig} from \"./Interfaces/ICollateralConfig.sol\";", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "", "has_vulnerable_code_snippet": false, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5.55} {"source": "c4", "protocol": "03-revert-lend", "title": "cryptothemex G", "severity_raw": "Medium", "severity": "medium", "description": "### Gas Risk Issues\nAlready reported issues have been removed from report and only new issues are being reported. \n\n### [G-01] `a = a + b` is more gas effective than `a += b` for state variables (excluding arrays and mappings)\n\nThis saves **16 gas per instance.**\n\n*There are 10 instance(s) of this issue:*\n\n```solidity\nFile: src/V3Oracle.sol\n\n440: fees0 += state.tokensOwed0;\n\n441: fees1 += state.tokensOwed1;\n\n```\n\n\n\n*GitHub* : [440](https://github.com/code-423n4/2024-03-revert-lend/src/V3Oracle.sol#L440), [441](https://github.com/code-423n4/2024-03-revert-lend/src/V3Oracle.sol#L441)\n\n```solidity\nFile: src/transformers/LeverageTransformer.sol\n\n62: amount0 += amountOut;\n\n74: amount1 += amountOut;\n\n153: amount += amountOut;\n\n162: amount += amountOut;\n\n```\n\n\n\n*GitHub* : [62](https://github.com/code-423n4/2024-03-revert-lend/src/transformers/LeverageTransformer.sol#L62), [74](https://github.com/code-423n4/2024-03-revert-lend/src/transformers/LeverageTransformer.sol#L74), [153](https://github.com/code-423n4/2024-03-revert-lend/src/transformers/LeverageTransformer.sol#L153), [162](https://github.com/code-423n4/2024-03-revert-lend/src/transformers/LeverageTransformer.sol#L162)\n\n```solidity\nFile: src/transformers/V3Utils.sol\n\n319: targetAmount += amountOutDelta;\n\n321: targetAmount += amount0;\n\n336: targetAmount += amountOutDelta;\n\n338: targetAmount += amount1;\n\n```\n\n\n*GitHub* : [319](https://github.com/code-423n4/2024-03-revert-lend/src/transformers/V3Utils.sol#L319), [321](https://github.com/code-423n4/2024-03-revert-lend/src/transformers/V3Utils.sol#L321), [336](https://github.com/code-423n4/2024-03-revert-lend/src/transformers/V3Utils.sol#L336), [338](https://github.com/code-423n4/2024-03-revert-lend/src/transformers/V3Utils.sol#L338)\n\n### [G-02] `array[index] += amount` is cheaper than `array[index] = array[i", "vulnerable_code": "File: src/V3Oracle.sol\n\n440: fees0 += state.tokensOwed0;\n\n441: fees1 += state.tokensOwed1;\n", "fixed_code": "File: src/transformers/LeverageTransformer.sol\n\n62: amount0 += amountOut;\n\n74: amount1 += amountOut;\n\n153: amount += amountOut;\n\n162: amount += amountOut;\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/cryptothemex-G.md", "collected_at": "2026-01-02T19:03:09.546123+00:00", "source_hash": "926d0e24345bbb8a7da1875cc962184fb69d34623e3554250ac6ca2e862b70af", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 544, "github_ref_count": 10, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: src/V3Oracle.sol\n\n440: fees0 += state.tokensOwed0;\n\n441: fees1 += state.tokensOwed1;", "primary_code_language": "solidity", "primary_code_char_count": 106, "all_code_blocks": "// Code block 1 (solidity):\nFile: src/V3Oracle.sol\n\n440: fees0 += state.tokensOwed0;\n\n441: fees1 += state.tokensOwed1;\n\n// Code block 2 (solidity):\nFile: src/transformers/LeverageTransformer.sol\n\n62: amount0 += amountOut;\n\n74: amount1 += amountOut;\n\n153: amount += amountOut;\n\n162: amount += amountOut;\n\n// Code block 3 (solidity):\nFile: src/transformers/V3Utils.sol\n\n319: targetAmount += amountOutDelta;\n\n321: targetAmount += amount0;\n\n336: targetAmount += amountOutDelta;\n\n338: targetAmount += amount1;", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: src/V3Oracle.sol\n\n440: fees0 += state.tokensOwed0;\n\n441: fees1 += state.tokensOwed1;\n\nFile: src/transformers/LeverageTransformer.sol\n\n62: amount0 += amountOut;\n\n74: amount1 += amountOut;\n\n153: amount += amountOut;\n\n162: amount += amountOut;\n\nFile: src/transformers/V3Utils.sol\n\n319: targetAmount += amountOutDelta;\n\n321: targetAmount += amount0;\n\n336: targetAmount += amountOutDelta;\n\n338: targetAmount += amount1;", "github_refs_formatted": "V3Oracle.sol#L440, V3Oracle.sol#L441, LeverageTransformer.sol#L62, LeverageTransformer.sol#L74, LeverageTransformer.sol#L153, LeverageTransformer.sol#L162, V3Utils.sol#L319, V3Utils.sol#L321, V3Utils.sol#L336, V3Utils.sol#L338", "github_files_list": "LeverageTransformer.sol, V3Oracle.sol, V3Utils.sol", "github_refs_count": 10, "vulnerable_code_actual": "File: src/V3Oracle.sol\n\n440: fees0 += state.tokensOwed0;\n\n441: fees1 += state.tokensOwed1;\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: src/transformers/LeverageTransformer.sol\n\n62: amount0 += amountOut;\n\n74: amount1 += amountOut;\n\n153: amount += amountOut;\n\n162: amount += amountOut;\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "03-revert-lend", "title": "emerald7017 Analysis", "severity_raw": "Critical", "severity": "critical", "description": "# Revert Lend Smart Contract Analysis Report\n\n## 1. Introduction\nRevert Lend is a decentralized lending protocol designed for Uniswap V3 liquidity providers (LPs). It allows LPs to collateralize their Uniswap V3 positions (NFTs) to borrow assets while retaining control over their LP positions. This report provides an in-depth analysis of the Revert Lend smart contracts, focusing on the architecture, code quality, potential issues, risks, centralization risks, and admin control abuse.\n\n## 2. Approach\nMy analysis of the Revert Lend codebase involved a thorough review of the smart contracts, including:\n- Reading the whitepaper and technical documentation to understand the protocol's intended behavior and architecture.\n- Reviewing the smart contract code line by line to identify potential vulnerabilities, code quality issues, and adherence to best practices.\n- Analyzing the protocol's architecture and design choices to assess their soundness and potential risks.\n- Examining the protocol's integration with external systems, such as Chainlink oracles and Uniswap V3 contracts.\n- Considering the protocol's resilience to various attack vectors and potential exploits.\n- Identifying centralization risks and potential for admin control abuse.\n\n## 3. Architecture Overview\nThe Revert Lend protocol consists of several key components:\n- V3Vault: The main contract that manages the lending and borrowing functionality, as well as the collateralization of Uniswap V3 positions.\n- InterestRateModel: Responsible for calculating the interest rates based on the utilization of the lending pool.\n- V3Oracle: Provides price data for the collateralized assets using a combination of Chainlink and Uniswap V3 TWAP oracles.\n- Swapper: Handles token swaps through external DEX routers, such as Uniswap V3 Router and 0x Exchange Proxy.\n- AutoCompound, AutoRange, LeverageTransformer, V3Utils: Additional contracts that provide auxiliary functionality, such as auto-compounding, range adjustment, leverage m", "vulnerable_code": "function deposit(uint256 assets, address receiver) external override returns (uint256) {\n (, uint256 shares) = _deposit(receiver, assets, false, \"\");\n return shares;\n}", "fixed_code": "function execute(ExecuteParams calldata params) external nonReentrant {\n // ...\n (state.amount0, state.amount1) = nonfungiblePositionManager.collect(\n INonfungiblePositionManager.CollectParams(\n params.tokenId, address(this), type(uint128).max, type(uint128).max\n )\n );\n // ...\n}", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/emerald7017-Analysis.md", "collected_at": "2026-01-02T19:03:10.960759+00:00", "source_hash": "928b4129f75a4b87d72719d2eb3b94f9d2913e8ab2c981a6e17398a149f32e03", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function deposit(uint256 assets, address receiver) external override returns (uint256) {\n (, uint256 shares) = _deposit(receiver, assets, false, \"\");\n return shares;\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function execute(ExecuteParams calldata params) external nonReentrant {\n // ...\n (state.amount0, state.amount1) = nonfungiblePositionManager.collect(\n INonfungiblePositionManager.CollectParams(\n params.tokenId, address(this), type(uint128).max, type(uint128).max\n )\n );\n // ...\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "02-ai-arena", "title": "Surfer_05 G", "severity_raw": "Low", "severity": "low", "description": "File name: src/AiArenaHelper.sol\n\nThe constructor can be optimised. We are initialising the attributeProbabilities. Firstly calling the function and then manually. \n```solidity\nconstructor(uint8[][] memory probabilities) {\n _ownerAddress = msg.sender;\n\n // Initialize the probabilities for each attribute\n@==> addAttributeProbabilities(0, probabilities);\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n@==> attributeProbabilities[0][attributes[i]] = probabilities[i];\n attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n }\n } \n```\nThe gas cost for this contract is as follows :\n\nsrc/AiArenaHelper.sol:AiArenaHelper contract | | | | | |\n|----------------------------------------------|-----------------|--------|--|--------|---------|\n| Deployment Cost | Deployment Size | | | | |\n| 1741279 | 8445 | \n\nNow, after reducing the initialisation to once, the code should be : \n```\nconstructor(uint8[][] memory probabilities) {\n _ownerAddress = msg.sender;\n\n // Initialize the probabilities for each attribute\n // commenting out the next line as not needed\n@==> // addAttributeProbabilities(0, probabilities);\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n attributeProbabilities[0][attributes[i]] = probabilities[i];\n attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n }\n } \n```\nAnd now the cost will be as follows : \nsrc/AiArenaHelper.sol:AiArenaHelper contract | | | | | |\n|----------------------------------------------|-----------------|--------|--------|--------|---------|\n| Deployment Cost | Deployment Siz", "vulnerable_code": "constructor(uint8[][] memory probabilities) {\n _ownerAddress = msg.sender;\n\n // Initialize the probabilities for each attribute\n@==> addAttributeProbabilities(0, probabilities);\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n@==> attributeProbabilities[0][attributes[i]] = probabilities[i];\n attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n }\n } ", "fixed_code": "constructor(uint8[][] memory probabilities) {\n _ownerAddress = msg.sender;\n\n // Initialize the probabilities for each attribute\n // commenting out the next line as not needed\n@==> // addAttributeProbabilities(0, probabilities);\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n attributeProbabilities[0][attributes[i]] = probabilities[i];\n attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n }\n } ", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/Surfer_05-G.md", "collected_at": "2026-01-02T19:02:46.541372+00:00", "source_hash": "9292d59b06a350a11d3eceba2361bef13b175310db3b301712c29cc05138401a", "code_block_count": 2, "solidity_block_count": 1, "total_code_chars": 1001, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "constructor(uint8[][] memory probabilities) {\n _ownerAddress = msg.sender;\n\n // Initialize the probabilities for each attribute\n@==> addAttributeProbabilities(0, probabilities);\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n@==> attributeProbabilities[0][attributes[i]] = probabilities[i];\n attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n }\n }", "primary_code_language": "solidity", "primary_code_char_count": 472, "all_code_blocks": "// Code block 1 (solidity):\nconstructor(uint8[][] memory probabilities) {\n _ownerAddress = msg.sender;\n\n // Initialize the probabilities for each attribute\n@==> addAttributeProbabilities(0, probabilities);\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n@==> attributeProbabilities[0][attributes[i]] = probabilities[i];\n attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n }\n }\n\n// Code block 2 (unknown):\nconstructor(uint8[][] memory probabilities) {\n _ownerAddress = msg.sender;\n\n // Initialize the probabilities for each attribute\n // commenting out the next line as not needed\n@==> // addAttributeProbabilities(0, probabilities);\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n attributeProbabilities[0][attributes[i]] = probabilities[i];\n attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n }\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "constructor(uint8[][] memory probabilities) {\n _ownerAddress = msg.sender;\n\n // Initialize the probabilities for each attribute\n@==> addAttributeProbabilities(0, probabilities);\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n@==> attributeProbabilities[0][attributes[i]] = probabilities[i];\n attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n }\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "constructor(uint8[][] memory probabilities) {\n _ownerAddress = msg.sender;\n\n // Initialize the probabilities for each attribute\n@==> addAttributeProbabilities(0, probabilities);\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n@==> attributeProbabilities[0][attributes[i]] = probabilities[i];\n attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n }\n } ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "constructor(uint8[][] memory probabilities) {\n _ownerAddress = msg.sender;\n\n // Initialize the probabilities for each attribute\n // commenting out the next line as not needed\n@==> // addAttributeProbabilities(0, probabilities);\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n attributeProbabilities[0][attributes[i]] = probabilities[i];\n attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n }\n } ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "06-lybra", "title": "MohammedRizwan Q", "severity_raw": "Medium", "severity": "medium", "description": "## Summary\n\n### Low Risk Issues\n|Number|Issue|Instances| |\n|-|:-|:-:|:-:|\n| [L‑01] | Violation of checks, Effects, Interaction Pattern in stakerewardV2pool.stake() | 1 |\n| [L‑02] | Prevent reward ratio from rounding to 0 in stakerewardV2pool.notifyRewardAmount() | 1 |\n| [L‑03] | Avoid self transfer shares in _transferShares() | 1 |\n| [L‑04] | Array length not checked in LybraConfigurator.setTokenMiner() | 1 |\n\n### Low Risk Issues\n### [L‑01] Violation of checks, Effects, Interaction Pattern(CEI) in stakerewardV2pool.stake()\nAlways CEI pattern to prevent reentrancy attacks.\nIn stakerewardV2pool.sol, at L-83 to L-90\nThere is 1 instance of this issue:\n[Link to code](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/stakerewardV2pool.sol#L83-L90)\n\n### Recommended Mitigation steps\n\n```Solidity\n\n function stake(uint256 _amount) external updateReward(msg.sender) {\n require(_amount > 0, \"amount = 0\"); // checks\n- bool success = stakingToken.transferFrom(msg.sender, address(this), _amount);\n- require(success, \"TF\");\n balanceOf[msg.sender] += _amount; // Effects\n totalSupply += _amount;\n+ bool success = stakingToken.transferFrom(msg.sender, address(this), _amount); // Interactions\n+ require(success, \"TF\");\n emit StakeToken(msg.sender, _amount, block.timestamp);\n }\n```\n\n### [L‑02] Prevent reward ration from rounding to 0 in stakerewardV2pool.notifyRewardAmount()\nAdd zero value check to prevent this issue.\nIn stakerewardV2pool.sol at L-132.\nThere is 1 instance of this issue:\n[Link to code](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/stakerewardV2pool.sol#L132-L145)\n\n### Recommended Mitigation steps\n\n```Solidity\nFile: contracts/lybra/miner/stakerewardV2pool.", "vulnerable_code": " function stake(uint256 _amount) external updateReward(msg.sender) {\n require(_amount > 0, \"amount = 0\"); // checks\n- bool success = stakingToken.transferFrom(msg.sender, address(this), _amount);\n- require(success, \"TF\");\n balanceOf[msg.sender] += _amount; // Effects\n totalSupply += _amount;\n+ bool success = stakingToken.transferFrom(msg.sender, address(this), _amount); // Interactions\n+ require(success, \"TF\");\n emit StakeToken(msg.sender, _amount, block.timestamp);\n }", "fixed_code": "File: contracts/lybra/miner/stakerewardV2pool.sol\n\n function notifyRewardAmount(uint256 _amount) external onlyOwner updateReward(address(0)) {\n+ require(_amount != 0, \"invalid amount\");\n if (block.timestamp >= finishAt) {\n rewardRatio = _amount / duration;\n } else {\n uint256 remainingRewards = (finishAt - block.timestamp) * rewardRatio;\n rewardRatio = (_amount + remainingRewards) / duration;\n }\n\n require(rewardRatio > 0, \"reward ratio = 0\");\n\n finishAt = block.timestamp + duration;\n updatedAt = block.timestamp;\n emit NotifyRewardChanged(_amount, block.timestamp);\n }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/MohammedRizwan-Q.md", "collected_at": "2026-01-02T18:22:28.623513+00:00", "source_hash": "92c599dbfea06a40f04f8ec52f78fa27055fc11fc143ac71a029a46787ff0fc3", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 623, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function stake(uint256 _amount) external updateReward(msg.sender) {\n require(_amount > 0, \"amount = 0\"); // checks\n- bool success = stakingToken.transferFrom(msg.sender, address(this), _amount);\n- require(success, \"TF\");\n balanceOf[msg.sender] += _amount; // Effects\n totalSupply += _amount;\n+ bool success = stakingToken.transferFrom(msg.sender, address(this), _amount); // Interactions\n+ require(success, \"TF\");\n emit StakeToken(msg.sender, _amount, block.timestamp);\n }", "primary_code_language": "Solidity", "primary_code_char_count": 623, "all_code_blocks": "// Code block 1 (Solidity):\nfunction stake(uint256 _amount) external updateReward(msg.sender) {\n require(_amount > 0, \"amount = 0\"); // checks\n- bool success = stakingToken.transferFrom(msg.sender, address(this), _amount);\n- require(success, \"TF\");\n balanceOf[msg.sender] += _amount; // Effects\n totalSupply += _amount;\n+ bool success = stakingToken.transferFrom(msg.sender, address(this), _amount); // Interactions\n+ require(success, \"TF\");\n emit StakeToken(msg.sender, _amount, block.timestamp);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function stake(uint256 _amount) external updateReward(msg.sender) {\n require(_amount > 0, \"amount = 0\"); // checks\n- bool success = stakingToken.transferFrom(msg.sender, address(this), _amount);\n- require(success, \"TF\");\n balanceOf[msg.sender] += _amount; // Effects\n totalSupply += _amount;\n+ bool success = stakingToken.transferFrom(msg.sender, address(this), _amount); // Interactions\n+ require(success, \"TF\");\n emit StakeToken(msg.sender, _amount, block.timestamp);\n }", "github_refs_formatted": "stakerewardV2pool.sol#L83-L90, stakerewardV2pool.sol#L132-L145", "github_files_list": "stakerewardV2pool.sol", "github_refs_count": 2, "vulnerable_code_actual": " function stake(uint256 _amount) external updateReward(msg.sender) {\n require(_amount > 0, \"amount = 0\"); // checks\n- bool success = stakingToken.transferFrom(msg.sender, address(this), _amount);\n- require(success, \"TF\");\n balanceOf[msg.sender] += _amount; // Effects\n totalSupply += _amount;\n+ bool success = stakingToken.transferFrom(msg.sender, address(this), _amount); // Interactions\n+ require(success, \"TF\");\n emit StakeToken(msg.sender, _amount, block.timestamp);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/lybra/miner/stakerewardV2pool.sol\n\n function notifyRewardAmount(uint256 _amount) external onlyOwner updateReward(address(0)) {\n+ require(_amount != 0, \"invalid amount\");\n if (block.timestamp >= finishAt) {\n rewardRatio = _amount / duration;\n } else {\n uint256 remainingRewards = (finishAt - block.timestamp) * rewardRatio;\n rewardRatio = (_amount + remainingRewards) / duration;\n }\n\n require(rewardRatio > 0, \"reward ratio = 0\");\n\n finishAt = block.timestamp + duration;\n updatedAt = block.timestamp;\n emit NotifyRewardChanged(_amount, block.timestamp);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-biconomy", "title": "damoklov G", "severity_raw": "Medium", "severity": "medium", "description": "## Biconomy Audit Report\n\n## Gas Optimizations\n\n### Increments should be unchecked\n\nIn Solidity 0.8+, there\u2019s a default overflow check on unsigned integers. It\u2019s possible to uncheck this in for-loops and save some gas at each iteration, but at the cost of some code readability, as this uncheck cannot be made inline.\n\nAlso increments can be made pre-increment instead of post-increment, so `i++` would become `++i` where necessary.\n\nhttps://github.com/ethereum/solidity/issues/10695\n\nInstances include:\n\n```solidity\nEntryPoint.handleAggregatedOps(): for (uint256 i = 0; i < opasLen; i++);\nEntryPoint.handleAggregatedOps(): for (uint256 a = 0; a < opasLen; a++);\nEntryPoint.handleAggregatedOps(): for (uint256 i = 0; i < opslen; i++);\n```\n\nThe code would go from: \n```solidity\nfor (uint256 i; i < numIterations; i++) { \n // ... \n} \n```\n\nTo: \n```solidity\nfor (uint256 i; i < numIterations;) { \n // ... \n unchecked { ++i; } \n} \n```\n\n### An array's length should be cached to save gas in for-loops\n\nReading array length at each iteration of the loop takes 6 gas (3 for mload and 3 to place memory_offset) in the stack.\n\nCaching the array length in the stack saves around 3 gas per iteration.\n\nInstances include:\n\n```solidity\nSmartAccount.executeBatch(): for (uint i = 0; i < dest.length;);\n```\n\nThe code would go from: \n```solidity\nfor (uint256 i; i < arr.length; ++i) { \n // ... \n} \n```\n\nTo: \n```solidity\nuint length = arr.length;\nfor (uint256 i; i < length; ++i) { \n // ... \n} \n```\n\n### Usage of calldata over memory when variable is read-only\n\nStoring information inside `calldata` is less expensive than storing it in `memory`. In case you only need to read the variable, you should consider switching to `calldata`.\n\nInstances include:\n\n```solidity\nSmartAccount.execTransaction(Transaction memory _tx, uint256 batchId, FeeRefund memory refundInfo, bytes memory signatures);\nSmartAccount.checkSignatures(bytes32 dataHash, bytes memory data, bytes memory signatures);\nSmartAccount.encod", "vulnerable_code": "EntryPoint.handleAggregatedOps(): for (uint256 i = 0; i < opasLen; i++);\nEntryPoint.handleAggregatedOps(): for (uint256 a = 0; a < opasLen; a++);\nEntryPoint.handleAggregatedOps(): for (uint256 i = 0; i < opslen; i++);", "fixed_code": "for (uint256 i; i < numIterations; i++) { \n // ... \n} ", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/damoklov-G.md", "collected_at": "2026-01-02T18:13:40.492738+00:00", "source_hash": "92cd57f41d4ef727c86038397136288e1946f9d61b0b01889e353acf340921b7", "code_block_count": 6, "solidity_block_count": 6, "total_code_chars": 535, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "EntryPoint.handleAggregatedOps(): for (uint256 i = 0; i < opasLen; i++);\nEntryPoint.handleAggregatedOps(): for (uint256 a = 0; a < opasLen; a++);\nEntryPoint.handleAggregatedOps(): for (uint256 i = 0; i < opslen; i++);", "primary_code_language": "solidity", "primary_code_char_count": 217, "all_code_blocks": "// Code block 1 (solidity):\nEntryPoint.handleAggregatedOps(): for (uint256 i = 0; i < opasLen; i++);\nEntryPoint.handleAggregatedOps(): for (uint256 a = 0; a < opasLen; a++);\nEntryPoint.handleAggregatedOps(): for (uint256 i = 0; i < opslen; i++);\n\n// Code block 2 (solidity):\nfor (uint256 i; i < numIterations; i++) { \n // ... \n}\n\n// Code block 3 (solidity):\nfor (uint256 i; i < numIterations;) { \n // ... \n unchecked { ++i; } \n}\n\n// Code block 4 (solidity):\nSmartAccount.executeBatch(): for (uint i = 0; i < dest.length;);\n\n// Code block 5 (solidity):\nfor (uint256 i; i < arr.length; ++i) { \n // ... \n}\n\n// Code block 6 (solidity):\nuint length = arr.length;\nfor (uint256 i; i < length; ++i) { \n // ... \n}", "all_code_blocks_count": 6, "has_diff_blocks": false, "diff_code": "", "solidity_code": "EntryPoint.handleAggregatedOps(): for (uint256 i = 0; i < opasLen; i++);\nEntryPoint.handleAggregatedOps(): for (uint256 a = 0; a < opasLen; a++);\nEntryPoint.handleAggregatedOps(): for (uint256 i = 0; i < opslen; i++);\n\nfor (uint256 i; i < numIterations; i++) { \n // ... \n}\n\nfor (uint256 i; i < numIterations;) { \n // ... \n unchecked { ++i; } \n}\n\nSmartAccount.executeBatch(): for (uint i = 0; i < dest.length;);\n\nfor (uint256 i; i < arr.length; ++i) { \n // ... \n}\n\nuint length = arr.length;\nfor (uint256 i; i < length; ++i) { \n // ... \n}", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "EntryPoint.handleAggregatedOps(): for (uint256 i = 0; i < opasLen; i++);\nEntryPoint.handleAggregatedOps(): for (uint256 a = 0; a < opasLen; a++);\nEntryPoint.handleAggregatedOps(): for (uint256 i = 0; i < opslen; i++);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "for (uint256 i; i < numIterations; i++) { \n // ... \n} ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 11} {"source": "c4", "protocol": "03-asymmetry", "title": "aga7hokakological Q", "severity_raw": "Low", "severity": "low", "description": "1. User is unable withdraw eth if a derivative is added afterwards and adjustWeight() is called\nSay there are 2 derivatives with 50/50 adjusted weight\nThen user stakes\nthe another derivative is added and weight adjusted is 33/33/33\nthen another user stakes.\nIf the first user tries to unstake it gives error. The user should have been able to withdraw but transaction reverts with `Insufficient rETH balance`\n\n```\n it.only(\"Check what happens if a derivative is added afterwards\", async () => {\n const accounts = await ethers.getSigners();\n const derivativeCount = (await safEthProxy.derivativeCount()).toNumber();\n \n const initialWeight = BigNumber.from(\"1000000000000000000\");\n const initialDeposit = ethers.utils.parseEther(\"1\");\n \n const balanceBefore = await adminAccount.getBalance();\n \n let totalNetworkFee = BigNumber.from(0);\n // set all derivatives to the same weight and stake\n // if there are 3 derivatives this is 33/33/33\n console.log(\"DERIVARTIVE COUNT::\", derivativeCount);\n for (let i = 0; i < derivativeCount; i++) {\n const tx1 = await safEthProxy.adjustWeight(i, initialWeight);\n const mined1 = await tx1.wait();\n const networkFee1 = mined1.gasUsed.mul(mined1.effectiveGasPrice);\n totalNetworkFee = totalNetworkFee.add(networkFee1);\n }\n \n const tx2 = await safEthProxy.stake({ value: initialDeposit });\n const mined2 = await tx2.wait();\n const networkFee2 = mined2.gasUsed.mul(mined2.effectiveGasPrice);\n totalNetworkFee = totalNetworkFee.add(networkFee2);\n let balBefore: any = await safEthProxy.balanceOf(adminAccount.address);\n let rethBalBefore: any = await derivative0.balance();\n let sfrxBalBefore: any = await derivative1.balance();\n console.log(\"balance before unstake::\", balBefore);\n console.log(\"reth balance before::\", rethBalBefore);\n console.log(\"sfrx balance before::\", s", "vulnerable_code": " it.only(\"Check what happens if a derivative is added afterwards\", async () => {\n const accounts = await ethers.getSigners();\n const derivativeCount = (await safEthProxy.derivativeCount()).toNumber();\n \n const initialWeight = BigNumber.from(\"1000000000000000000\");\n const initialDeposit = ethers.utils.parseEther(\"1\");\n \n const balanceBefore = await adminAccount.getBalance();\n \n let totalNetworkFee = BigNumber.from(0);\n // set all derivatives to the same weight and stake\n // if there are 3 derivatives this is 33/33/33\n console.log(\"DERIVARTIVE COUNT::\", derivativeCount);\n for (let i = 0; i < derivativeCount; i++) {\n const tx1 = await safEthProxy.adjustWeight(i, initialWeight);\n const mined1 = await tx1.wait();\n const networkFee1 = mined1.gasUsed.mul(mined1.effectiveGasPrice);\n totalNetworkFee = totalNetworkFee.add(networkFee1);\n }\n \n const tx2 = await safEthProxy.stake({ value: initialDeposit });\n const mined2 = await tx2.wait();\n const networkFee2 = mined2.gasUsed.mul(mined2.effectiveGasPrice);\n totalNetworkFee = totalNetworkFee.add(networkFee2);\n let balBefore: any = await safEthProxy.balanceOf(adminAccount.address);\n let rethBalBefore: any = await derivative0.balance();\n let sfrxBalBefore: any = await derivative1.balance();\n console.log(\"balance before unstake::\", balBefore);\n console.log(\"reth balance before::\", rethBalBefore);\n console.log(\"sfrx balance before::\", sfrxBalBefore);\n\n await safEthProxy.addDerivative(derivative2.address, \"1000000000000000000\");\n\n const derivativeCountAfter = (await safEthProxy.derivativeCount()).toNumber();\n\n console.log(\"DERIVARTIVE COUNT::\", derivativeCountAfter);\n for (let i = 0; i < derivativeCount; i++) {\n const tx3 = await safEthProxy.adjustWeight(i, initialWeight);\n const mined3 = await", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/aga7hokakological-Q.md", "collected_at": "2026-01-02T18:18:44.983227+00:00", "source_hash": "92d0271e5f31cf9d96c218be2ce63edcfcd44214797d86c5e112f7f2b38a4595", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " it.only(\"Check what happens if a derivative is added afterwards\", async () => {\n const accounts = await ethers.getSigners();\n const derivativeCount = (await safEthProxy.derivativeCount()).toNumber();\n \n const initialWeight = BigNumber.from(\"1000000000000000000\");\n const initialDeposit = ethers.utils.parseEther(\"1\");\n \n const balanceBefore = await adminAccount.getBalance();\n \n let totalNetworkFee = BigNumber.from(0);\n // set all derivatives to the same weight and stake\n // if there are 3 derivatives this is 33/33/33\n console.log(\"DERIVARTIVE COUNT::\", derivativeCount);\n for (let i = 0; i < derivativeCount; i++) {\n const tx1 = await safEthProxy.adjustWeight(i, initialWeight);\n const mined1 = await tx1.wait();\n const networkFee1 = mined1.gasUsed.mul(mined1.effectiveGasPrice);\n totalNetworkFee = totalNetworkFee.add(networkFee1);\n }\n \n const tx2 = await safEthProxy.stake({ value: initialDeposit });\n const mined2 = await tx2.wait();\n const networkFee2 = mined2.gasUsed.mul(mined2.effectiveGasPrice);\n totalNetworkFee = totalNetworkFee.add(networkFee2);\n let balBefore: any = await safEthProxy.balanceOf(adminAccount.address);\n let rethBalBefore: any = await derivative0.balance();\n let sfrxBalBefore: any = await derivative1.balance();\n console.log(\"balance before unstake::\", balBefore);\n console.log(\"reth balance before::\", rethBalBefore);\n console.log(\"sfrx balance before::\", sfrxBalBefore);\n\n await safEthProxy.addDerivative(derivative2.address, \"1000000000000000000\");\n\n const derivativeCountAfter = (await safEthProxy.derivativeCount()).toNumber();\n\n console.log(\"DERIVARTIVE COUNT::\", derivativeCountAfter);\n for (let i = 0; i < derivativeCount; i++) {\n const tx3 = await safEthProxy.adjustWeight(i, initialWeight);\n const mined3 = await", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4} {"source": "c4", "protocol": "11-kelp", "title": "ni8mare Q", "severity_raw": "Low", "severity": "low", "description": "## LOW-RISK ISSUES\n\n1. `addNodeDelegatorContractToQueue` is supposed to be called by LRTManager, but it is being called by LRTAdmin. `onlyLRTAdmin` is used, which is not the correct modifier. This can be seen from the comments below. Correct modifier needs to be used.\n\n```\n /// @notice add new node delegator contract addresses\n /// @dev only callable by LRT manager\n /// @param nodeDelegatorContracts Array of NodeDelegator contract addresses\n function addNodeDelegatorContractToQueue(address[] calldata nodeDelegatorContracts) external onlyLRTAdmin {\n uint256 length = nodeDelegatorContracts.length;\n if (nodeDelegatorQueue.length + length > maxNodeDelegatorCount) {\n revert MaximumNodeDelegatorCountReached();\n }\n\n for (uint256 i; i < length;) {\n UtilLib.checkNonZeroAddress(nodeDelegatorContracts[i]);\n nodeDelegatorQueue.push(nodeDelegatorContracts[i]);\n emit NodeDelegatorAddedinQueue(nodeDelegatorContracts[i]);\n unchecked {\n ++i;\n }\n }\n }\n```\n\n2. `transferAssetToNodeDelegator` does not have `whenNotpaused` modifier. A similar function, `depositAssetIntoStrategy` has, even though both functions are called by `onlyLRTManager`. Even, `transferBackToLRTDepositPool` also has the modifier. It is expected that when contracts are paused in an emergency, asset transfers should also be paused. But, that is not the case here.\n\n```\n /// @notice transfers asset lying in this DepositPool to node delegator contract\n /// @dev only callable by LRT manager\n /// @param ndcIndex Index of NodeDelegator contract address in nodeDelegatorQueue\n /// @param asset Asset address\n /// @param amount Asset amount to transfer\n function transferAssetToNodeDelegator(\n uint256 ndcIndex,\n address asset,\n uint256 amount\n )\n external\n nonReentrant\n onlyLRTManager\n onlySupportedAsset(asset)\n {\n address", "vulnerable_code": " /// @notice add new node delegator contract addresses\n /// @dev only callable by LRT manager\n /// @param nodeDelegatorContracts Array of NodeDelegator contract addresses\n function addNodeDelegatorContractToQueue(address[] calldata nodeDelegatorContracts) external onlyLRTAdmin {\n uint256 length = nodeDelegatorContracts.length;\n if (nodeDelegatorQueue.length + length > maxNodeDelegatorCount) {\n revert MaximumNodeDelegatorCountReached();\n }\n\n for (uint256 i; i < length;) {\n UtilLib.checkNonZeroAddress(nodeDelegatorContracts[i]);\n nodeDelegatorQueue.push(nodeDelegatorContracts[i]);\n emit NodeDelegatorAddedinQueue(nodeDelegatorContracts[i]);\n unchecked {\n ++i;\n }\n }\n }", "fixed_code": " /// @notice transfers asset lying in this DepositPool to node delegator contract\n /// @dev only callable by LRT manager\n /// @param ndcIndex Index of NodeDelegator contract address in nodeDelegatorQueue\n /// @param asset Asset address\n /// @param amount Asset amount to transfer\n function transferAssetToNodeDelegator(\n uint256 ndcIndex,\n address asset,\n uint256 amount\n )\n external\n nonReentrant\n onlyLRTManager\n onlySupportedAsset(asset)\n {\n address nodeDelegator = nodeDelegatorQueue[ndcIndex];\n if (!IERC20(asset).transfer(nodeDelegator, amount)) {\n revert TokenTransferFailed();\n }\n }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/ni8mare-Q.md", "collected_at": "2026-01-02T18:28:17.750106+00:00", "source_hash": "92d9b1aae4c338bd1419e084e99622b25ae5c57651bcf5ea0beee315e688bff9", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 800, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "/// @notice add new node delegator contract addresses\n /// @dev only callable by LRT manager\n /// @param nodeDelegatorContracts Array of NodeDelegator contract addresses\n function addNodeDelegatorContractToQueue(address[] calldata nodeDelegatorContracts) external onlyLRTAdmin {\n uint256 length = nodeDelegatorContracts.length;\n if (nodeDelegatorQueue.length + length > maxNodeDelegatorCount) {\n revert MaximumNodeDelegatorCountReached();\n }\n\n for (uint256 i; i < length;) {\n UtilLib.checkNonZeroAddress(nodeDelegatorContracts[i]);\n nodeDelegatorQueue.push(nodeDelegatorContracts[i]);\n emit NodeDelegatorAddedinQueue(nodeDelegatorContracts[i]);\n unchecked {\n ++i;\n }\n }\n }", "primary_code_language": "unknown", "primary_code_char_count": 800, "all_code_blocks": "// Code block 1 (unknown):\n/// @notice add new node delegator contract addresses\n /// @dev only callable by LRT manager\n /// @param nodeDelegatorContracts Array of NodeDelegator contract addresses\n function addNodeDelegatorContractToQueue(address[] calldata nodeDelegatorContracts) external onlyLRTAdmin {\n uint256 length = nodeDelegatorContracts.length;\n if (nodeDelegatorQueue.length + length > maxNodeDelegatorCount) {\n revert MaximumNodeDelegatorCountReached();\n }\n\n for (uint256 i; i < length;) {\n UtilLib.checkNonZeroAddress(nodeDelegatorContracts[i]);\n nodeDelegatorQueue.push(nodeDelegatorContracts[i]);\n emit NodeDelegatorAddedinQueue(nodeDelegatorContracts[i]);\n unchecked {\n ++i;\n }\n }\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " /// @notice add new node delegator contract addresses\n /// @dev only callable by LRT manager\n /// @param nodeDelegatorContracts Array of NodeDelegator contract addresses\n function addNodeDelegatorContractToQueue(address[] calldata nodeDelegatorContracts) external onlyLRTAdmin {\n uint256 length = nodeDelegatorContracts.length;\n if (nodeDelegatorQueue.length + length > maxNodeDelegatorCount) {\n revert MaximumNodeDelegatorCountReached();\n }\n\n for (uint256 i; i < length;) {\n UtilLib.checkNonZeroAddress(nodeDelegatorContracts[i]);\n nodeDelegatorQueue.push(nodeDelegatorContracts[i]);\n emit NodeDelegatorAddedinQueue(nodeDelegatorContracts[i]);\n unchecked {\n ++i;\n }\n }\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " /// @notice transfers asset lying in this DepositPool to node delegator contract\n /// @dev only callable by LRT manager\n /// @param ndcIndex Index of NodeDelegator contract address in nodeDelegatorQueue\n /// @param asset Asset address\n /// @param amount Asset amount to transfer\n function transferAssetToNodeDelegator(\n uint256 ndcIndex,\n address asset,\n uint256 amount\n )\n external\n nonReentrant\n onlyLRTManager\n onlySupportedAsset(asset)\n {\n address nodeDelegator = nodeDelegatorQueue[ndcIndex];\n if (!IERC20(asset).transfer(nodeDelegator, amount)) {\n revert TokenTransferFailed();\n }\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "04-caviar", "title": "SanketKogekar Q", "severity_raw": "High", "severity": "high", "description": "### EthRouter.sol\n\n1. In EthRouter.sol, the `buy()` function does not check if array is too large to be executed in a single transaction. This may result in an out-of-gas error if the array is large.\n [Link to code](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L99)\n\n2. In EthRouter.sol, the `buy()` function calls the `nftBuy()` function of the `Pair` contract, but it does not check the returned value. If the `nftBuy()` function reverts for some real, the `buy()` function will continue executing and may result in unexpected way.\n [Link to code](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L109)\n\n3. In EthRouter.sol, the `buy()` function calculates the royalty fee and recipient for each token separately, which may result in higher gas cost than necessary. It would be more efficient to calculate the royalty fee and recipient for all tokens at once, and then transfer the total royalty fee to the royalty recipient.\n [Link to code](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L116)\n\n4. In EthRouter.sol, the `buy()` function does not check if the `salePrice` is greater than or equal to the royalty fee. If the salePrice is smaller than the royalty fee, the transfer function will revert and the transaction will fail.\n [Link to code](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L121)\n Such type of check would work.\n ```\n require(salePrice >= royaltyFee, \"Sale price must be greater than or equal to royalty fee\");\n ```\n\n### Factory.sol\n\n5. In Factory.sol, the `create()` function, there is no check for whether the NFTs that are being deposited to the pool have been approved for transfer by the caller. This could lead to loss of funds if the caller forgets to approve the transfer before calling this funct", "vulnerable_code": "", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/SanketKogekar-Q.md", "collected_at": "2026-01-02T18:20:05.490723+00:00", "source_hash": "92eb5fe28c20c7e934ae3e728110c94c62c326cf0adcc69a7d90448e0e764161", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 92, "github_ref_count": 4, "vulnerable_code_is_url": true, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "require(salePrice >= royaltyFee, \"Sale price must be greater than or equal to royalty fee\");", "primary_code_language": "unknown", "primary_code_char_count": 92, "all_code_blocks": "// Code block 1 (unknown):\nrequire(salePrice >= royaltyFee, \"Sale price must be greater than or equal to royalty fee\");", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "EthRouter.sol#L99, EthRouter.sol#L109, EthRouter.sol#L116, EthRouter.sol#L121", "github_files_list": "EthRouter.sol", "github_refs_count": 4, "vulnerable_code_actual": "", "has_vulnerable_code_snippet": false, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "02-ethos", "title": "erictee G", "severity_raw": "Gas", "severity": "gas", "description": "### [G-01] Splitting ```require()``` statements that use && saves gas.\n\n\n#### Impact\nConsider splitting the ```require()``` statements to save gas.\n\n\n#### Findings:\n```\nEthos-Core/contracts/BorrowerOperations.sol:L653 require(_maxFeePercentage >= BORROWING_FEE_FLOOR && _maxFeePercentage <= DECIMAL_PRECISION,\n\n```\n\n", "vulnerable_code": "Ethos-Core/contracts/BorrowerOperations.sol:L653 require(_maxFeePercentage >= BORROWING_FEE_FLOOR && _maxFeePercentage <= DECIMAL_PRECISION,\n", "fixed_code": "", "recommendation": "", "category": "rounding", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/erictee-G.md", "collected_at": "2026-01-02T18:17:08.724840+00:00", "source_hash": "930409d800bb701876d973673c20840856ed6acfdd915f20949fb272358464d9", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 151, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "Ethos-Core/contracts/BorrowerOperations.sol:L653 require(_maxFeePercentage >= BORROWING_FEE_FLOOR && _maxFeePercentage <= DECIMAL_PRECISION,", "primary_code_language": "unknown", "primary_code_char_count": 151, "all_code_blocks": "// Code block 1 (unknown):\nEthos-Core/contracts/BorrowerOperations.sol:L653 require(_maxFeePercentage >= BORROWING_FEE_FLOOR && _maxFeePercentage <= DECIMAL_PRECISION,", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "Ethos-Core/contracts/BorrowerOperations.sol:L653 require(_maxFeePercentage >= BORROWING_FEE_FLOOR && _maxFeePercentage <= DECIMAL_PRECISION,\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 2.65} {"source": "c4", "protocol": "02-ethos", "title": "Bnke0x0 G", "severity_raw": "High", "severity": "high", "description": "\n### [G01] State variables only set in the constructor should be declared `immutable`\n\n#### Impact\nAvoids a Gusset (20000 gas)\n#### Findings:\n```\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::33 => address public collateralConfigAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::34 => address public borrowerOperationsAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::35 => address public troveManagerAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::36 => address public stabilityPoolAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::37 => address public defaultPoolAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::38 => address public collSurplusPoolAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::39 => address public treasuryAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::40 => address public lqtyStakingAddress;\n2023-02-ethos-main/Ethos-Core/contracts/BorrowerOperations.sol::25 => ICollateralConfig public collateralConfig;\n2023-02-ethos-main/Ethos-Core/contracts/BorrowerOperations.sol::26 => ITroveManager public troveManager;\n2023-02-ethos-main/Ethos-Core/contracts/BorrowerOperations.sol::34 => ILQTYStaking public lqtyStaking;\n2023-02-ethos-main/Ethos-Core/contracts/BorrowerOperations.sol::35 => address public lqtyStakingAddress;\n2023-02-ethos-main/Ethos-Core/contracts/BorrowerOperations.sol::37 => ILUSDToken public lusdToken;\n2023-02-ethos-main/Ethos-Core/contracts/BorrowerOperations.sol::40 => ISortedTroves public sortedTroves;\n2023-02-ethos-main/Ethos-Core/contracts/CollateralConfig.sol::18 => bool public initialized = false;\n2023-02-ethos-main/Ethos-Core/contracts/CollateralConfig.sol::34 => address[] public collaterals; // for returning entire list of allowed collaterals\n2023-02-ethos-main/Ethos-Core/contracts/LQTY/CommunityIssuance.sol::37 => IERC20 public OathToken;\n2023-02-ethos-main/Ethos-Core/contracts/LQTY/CommunityIssuance.sol::39 => address ", "vulnerable_code": "2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::33 => address public collateralConfigAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::34 => address public borrowerOperationsAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::35 => address public troveManagerAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::36 => address public stabilityPoolAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::37 => address public defaultPoolAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::38 => address public collSurplusPoolAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::39 => address public treasuryAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::40 => address public lqtyStakingAddress;\n2023-02-ethos-main/Ethos-Core/contracts/BorrowerOperations.sol::25 => ICollateralConfig public collateralConfig;\n2023-02-ethos-main/Ethos-Core/contracts/BorrowerOperations.sol::26 => ITroveManager public troveManager;\n2023-02-ethos-main/Ethos-Core/contracts/BorrowerOperations.sol::34 => ILQTYStaking public lqtyStaking;\n2023-02-ethos-main/Ethos-Core/contracts/BorrowerOperations.sol::35 => address public lqtyStakingAddress;\n2023-02-ethos-main/Ethos-Core/contracts/BorrowerOperations.sol::37 => ILUSDToken public lusdToken;\n2023-02-ethos-main/Ethos-Core/contracts/BorrowerOperations.sol::40 => ISortedTroves public sortedTroves;\n2023-02-ethos-main/Ethos-Core/contracts/CollateralConfig.sol::18 => bool public initialized = false;\n2023-02-ethos-main/Ethos-Core/contracts/CollateralConfig.sol::34 => address[] public collaterals; // for returning entire list of allowed collaterals\n2023-02-ethos-main/Ethos-Core/contracts/LQTY/CommunityIssuance.sol::37 => IERC20 public OathToken;\n2023-02-ethos-main/Ethos-Core/contracts/LQTY/CommunityIssuance.sol::39 => address public stabilityPoolAddress;\n2023-02-ethos-main/Ethos-Core/contracts/LQTY/CommunityIssuance.sol::41 => uint public totalOATHIssued;\n2023-02-ethos-", "fixed_code": "2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::33 => address public collateralConfigAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::34 => address public borrowerOperationsAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::35 => address public troveManagerAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::36 => address public stabilityPoolAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::37 => address public defaultPoolAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::38 => address public collSurplusPoolAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::39 => address public treasuryAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::40 => address public lqtyStakingAddress;\n2023-02-ethos-main/Ethos-Core/contracts/BorrowerOperations.sol::35 => address public lqtyStakingAddress;\n2023-02-ethos-main/Ethos-Core/contracts/LQTY/CommunityIssuance.sol::39 => address public stabilityPoolAddress;\n2023-02-ethos-main/Ethos-Core/contracts/LQTY/LQTYStaking.sol::43 => address public troveManagerAddress;\n2023-02-ethos-main/Ethos-Core/contracts/LQTY/LQTYStaking.sol::44 => address public borrowerOperationsAddress;\n2023-02-ethos-main/Ethos-Core/contracts/LQTY/LQTYStaking.sol::45 => address public activePoolAddress;\n2023-02-ethos-main/Ethos-Core/contracts/LUSDToken.sol::67 => address public troveManagerAddress;\n2023-02-ethos-main/Ethos-Core/contracts/LUSDToken.sol::68 => address public stabilityPoolAddress;\n2023-02-ethos-main/Ethos-Core/contracts/LUSDToken.sol::69 => address public borrowerOperationsAddress;\n2023-02-ethos-main/Ethos-Core/contracts/LUSDToken.sol::70 => address public governanceAddress; // can pause/unpause minting and upgrade addresses\n2023-02-ethos-main/Ethos-Core/contracts/LUSDToken.sol::71 => address public guardianAddress; // can pause minting during emergency\n2023-02-ethos-main/Ethos-Core/contracts/StabilityPool.sol::160 => address public lqtyTokenAddress;\n20", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/Bnke0x0-G.md", "collected_at": "2026-01-02T18:15:59.477629+00:00", "source_hash": "930b590cdde03fcd96dd6b69201007c585de76fddf4da4e7400c0e85f0824024", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::33 => address public collateralConfigAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::34 => address public borrowerOperationsAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::35 => address public troveManagerAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::36 => address public stabilityPoolAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::37 => address public defaultPoolAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::38 => address public collSurplusPoolAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::39 => address public treasuryAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::40 => address public lqtyStakingAddress;\n2023-02-ethos-main/Ethos-Core/contracts/BorrowerOperations.sol::25 => ICollateralConfig public collateralConfig;\n2023-02-ethos-main/Ethos-Core/contracts/BorrowerOperations.sol::26 => ITroveManager public troveManager;\n2023-02-ethos-main/Ethos-Core/contracts/BorrowerOperations.sol::34 => ILQTYStaking public lqtyStaking;\n2023-02-ethos-main/Ethos-Core/contracts/BorrowerOperations.sol::35 => address public lqtyStakingAddress;\n2023-02-ethos-main/Ethos-Core/contracts/BorrowerOperations.sol::37 => ILUSDToken public lusdToken;\n2023-02-ethos-main/Ethos-Core/contracts/BorrowerOperations.sol::40 => ISortedTroves public sortedTroves;\n2023-02-ethos-main/Ethos-Core/contracts/CollateralConfig.sol::18 => bool public initialized = false;\n2023-02-ethos-main/Ethos-Core/contracts/CollateralConfig.sol::34 => address[] public collaterals; // for returning entire list of allowed collaterals\n2023-02-ethos-main/Ethos-Core/contracts/LQTY/CommunityIssuance.sol::37 => IERC20 public OathToken;\n2023-02-ethos-main/Ethos-Core/contracts/LQTY/CommunityIssuance.sol::39 => address public stabilityPoolAddress;\n2023-02-ethos-main/Ethos-Core/contracts/LQTY/CommunityIssuance.sol::41 => uint public totalOATHIssued;\n2023-02-ethos-", "has_vulnerable_code_snippet": true, "fixed_code_actual": "2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::33 => address public collateralConfigAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::34 => address public borrowerOperationsAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::35 => address public troveManagerAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::36 => address public stabilityPoolAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::37 => address public defaultPoolAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::38 => address public collSurplusPoolAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::39 => address public treasuryAddress;\n2023-02-ethos-main/Ethos-Core/contracts/ActivePool.sol::40 => address public lqtyStakingAddress;\n2023-02-ethos-main/Ethos-Core/contracts/BorrowerOperations.sol::35 => address public lqtyStakingAddress;\n2023-02-ethos-main/Ethos-Core/contracts/LQTY/CommunityIssuance.sol::39 => address public stabilityPoolAddress;\n2023-02-ethos-main/Ethos-Core/contracts/LQTY/LQTYStaking.sol::43 => address public troveManagerAddress;\n2023-02-ethos-main/Ethos-Core/contracts/LQTY/LQTYStaking.sol::44 => address public borrowerOperationsAddress;\n2023-02-ethos-main/Ethos-Core/contracts/LQTY/LQTYStaking.sol::45 => address public activePoolAddress;\n2023-02-ethos-main/Ethos-Core/contracts/LUSDToken.sol::67 => address public troveManagerAddress;\n2023-02-ethos-main/Ethos-Core/contracts/LUSDToken.sol::68 => address public stabilityPoolAddress;\n2023-02-ethos-main/Ethos-Core/contracts/LUSDToken.sol::69 => address public borrowerOperationsAddress;\n2023-02-ethos-main/Ethos-Core/contracts/LUSDToken.sol::70 => address public governanceAddress; // can pause/unpause minting and upgrade addresses\n2023-02-ethos-main/Ethos-Core/contracts/LUSDToken.sol::71 => address public guardianAddress; // can pause minting during emergency\n2023-02-ethos-main/Ethos-Core/contracts/StabilityPool.sol::160 => address public lqtyTokenAddress;\n20", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "04-caviar", "title": "bshramin Q", "severity_raw": "Low", "severity": "low", "description": "# L1 - The pool takes more royalty fee than it spends\nIn sending the royalty fees the pool checks if the recipient address is zero and won't send it any tokens.\n```solidity\n(uint256 royaltyFee, address recipient) = _getRoyalty(tokenIds[i], salePrice);\nif (royaltyFee > 0 && recipient != address(0)) {\n```\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L274\n\n\nBut when the pool is calculating the amount of royalty that should be payed by the user, it ignores the recipient address and always adds the amount to the royalty fee.\n```solidity\n(uint256 royaltyFee,) = _getRoyalty(tokenIds[i], salePrice);\nroyaltyFeeAmount += royaltyFee;\n```\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L244\n\n\nThis can cause taking more funds from the user than it should if the royalty recipient is set to address zero for some NFT.\n\n\n# L2 - Royalty payment is unfair\nUser might end up paying more or less loyalty than he's supposed to. With the following code snippet we can see that the pool is calculating the royalty fee by dividing the total amount of tokens that the user is paying by the number of NFTs that he's buying.\n```solidity\nuint256 salePrice = (netOutputAmount + feeAmount + protocolFeeAmount) / tokenIds.length;\n```\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L335\n\nImagine this scenario, \n| | Royalty Percentage | Price |\n|---|---|---|\n| TOKEN1 | 10% | 10 |\n| TOKEN2 | 0% | 20 |\n| TOKEN3 | 0% | 30 |\n\n\n\nOr on the other side, this scenario, \n| | Royalty Percentage | Price |\n|---|---|---|\n| TOKEN1 | 10% | 30 |\n| TOKEN2 | 0% | 20 |\n| TOKEN3 | 0% | 10 |\n\n\nIn both these cases user ends up paying 2 tokens for royalties, but he should've only payed 1 token in the first case and 3 tokens in the second case.\nThis is not a fair calculation for royalty amounts.\n\n\n# L3 - Flash loan multiple tokens at once \nI think it would be a good idea to make the flash loan function accept multiple tok", "vulnerable_code": "(uint256 royaltyFee, address recipient) = _getRoyalty(tokenIds[i], salePrice);\nif (royaltyFee > 0 && recipient != address(0)) {", "fixed_code": "(uint256 royaltyFee,) = _getRoyalty(tokenIds[i], salePrice);\nroyaltyFeeAmount += royaltyFee;", "recommendation": "", "category": "flash-loan", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/bshramin-Q.md", "collected_at": "2026-01-02T18:20:19.186218+00:00", "source_hash": "932073f4139fe62194ac9f387c130927e82a34cb8321b8436a171eea793a7153", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 307, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "(uint256 royaltyFee, address recipient) = _getRoyalty(tokenIds[i], salePrice);\nif (royaltyFee > 0 && recipient != address(0)) {", "primary_code_language": "solidity", "primary_code_char_count": 127, "all_code_blocks": "// Code block 1 (solidity):\n(uint256 royaltyFee, address recipient) = _getRoyalty(tokenIds[i], salePrice);\nif (royaltyFee > 0 && recipient != address(0)) {\n\n// Code block 2 (solidity):\n(uint256 royaltyFee,) = _getRoyalty(tokenIds[i], salePrice);\nroyaltyFeeAmount += royaltyFee;\n\n// Code block 3 (solidity):\nuint256 salePrice = (netOutputAmount + feeAmount + protocolFeeAmount) / tokenIds.length;", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "(uint256 royaltyFee, address recipient) = _getRoyalty(tokenIds[i], salePrice);\nif (royaltyFee > 0 && recipient != address(0)) {\n\n(uint256 royaltyFee,) = _getRoyalty(tokenIds[i], salePrice);\nroyaltyFeeAmount += royaltyFee;\n\nuint256 salePrice = (netOutputAmount + feeAmount + protocolFeeAmount) / tokenIds.length;", "github_refs_formatted": "PrivatePool.sol#L274, PrivatePool.sol#L244, PrivatePool.sol#L335", "github_files_list": "PrivatePool.sol", "github_refs_count": 3, "vulnerable_code_actual": "(uint256 royaltyFee, address recipient) = _getRoyalty(tokenIds[i], salePrice);\nif (royaltyFee > 0 && recipient != address(0)) {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "(uint256 royaltyFee,) = _getRoyalty(tokenIds[i], salePrice);\nroyaltyFeeAmount += royaltyFee;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "05-ajna", "title": "BGSecurity Q", "severity_raw": "Critical", "severity": "critical", "description": "## Introduction\n\nAjna QA report was done by martin and anonresercher, with a main focus on the low severity and non-critical security aspects of the implementaion and logic of the project.\n\n## Findings Summary\n\nThe following issues were found, categorized by their severity:\n\n## Findings Summary\n\n| ID | Title | Severity |\n| ------- | --------------------------------------------------------- | ------------ |\n| [L-01] | Hardcoded Ajna token address | Low |\n| [L-02] | Function logic is misleadingly documented | Low |\n| [L-03] | Redundant parameter `reason` in `IFunding.VoteCast` event | Low |\n| [NC-01] | `emit` function called early | Non-Critical |\n| [NC-02] | Bad formatting | Non-Critical |\n\n## [L-01] Hardcoded Ajna token address\n\nIn case the addresses change due to reasons such as updating their versions in the future, addresses coded as constants cannot be updated. You can have a `immutable` variable containing the token address. And this variable can be set from a constructor.\n\nSo you can effectively pass the value from an environment variable to the contract constructor, to the contract storage.\n\n```solidity\n21: address public immutable ajnaTokenAddress = 0x9a96ec9B57Fb64FbC60B423d1f4da7691Bd35079;\n```\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/Funding.sol\n\n## [L-02] Function logic is misleadingly documented\n\nThe Nat Spec dev description assures that the function will iterate through maximum of 10 proposals, but actually it iterates through all of them in a nested loop.\n\n```solidity\n458: * @dev Only iterates through a maximum of 10 proposals that made it through the screening round.\n```\n\n## [L-03] Redundant parameter `reason` in `IFunding.VoteCast` event\n\nThe `reason` parameter is set value as an empty string everywher", "vulnerable_code": "21: address public immutable ajnaTokenAddress = 0x9a96ec9B57Fb64FbC60B423d1f4da7691Bd35079;", "fixed_code": "458: * @dev Only iterates through a maximum of 10 proposals that made it through the screening round.", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/BGSecurity-Q.md", "collected_at": "2026-01-02T18:20:55.116264+00:00", "source_hash": "93247be7a1e3d662aaa58aa4e75db2f228f4027099f30a7a646aaa9e7175901e", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 195, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "21: address public immutable ajnaTokenAddress = 0x9a96ec9B57Fb64FbC60B423d1f4da7691Bd35079;", "primary_code_language": "solidity", "primary_code_char_count": 91, "all_code_blocks": "// Code block 1 (solidity):\n21: address public immutable ajnaTokenAddress = 0x9a96ec9B57Fb64FbC60B423d1f4da7691Bd35079;\n\n// Code block 2 (solidity):\n458: * @dev Only iterates through a maximum of 10 proposals that made it through the screening round.", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "21: address public immutable ajnaTokenAddress = 0x9a96ec9B57Fb64FbC60B423d1f4da7691Bd35079;\n\n458: * @dev Only iterates through a maximum of 10 proposals that made it through the screening round.", "github_refs_formatted": "Funding.sol", "github_files_list": "Funding.sol", "github_refs_count": 1, "vulnerable_code_actual": "21: address public immutable ajnaTokenAddress = 0x9a96ec9B57Fb64FbC60B423d1f4da7691Bd35079;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "458: * @dev Only iterates through a maximum of 10 proposals that made it through the screening round.", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "03-asymmetry", "title": "HHK G", "severity_raw": "Low", "severity": "low", "description": "### Custom errors instead of requires\n\n```require(pauseStaking == false, \"staking is paused\");```\n```if(pauseStaking == false) revert StakingPaused();```\n\n### In SafETH Stake() can have everything in the same loop.\n\n### Line 88 of SafEth.sol, ```if (weight == 0) continue``` should be one line above\n\nThis would save a sload as we wouldn't need to load ```IDerivative derivative = derivatives[i];``` when weight == 0\n\n### All loops can move i++ in unckecked tags\n\n### Using a state variable in *for* condition and reading state variable multiple time should be avoided\n\nEx: https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L84\n\nDeclaring a memory d = derivativeCount and then using it in the loop would save gas as each loop will mload instead of sload. \nAlso because derivativeCount is used 2 times in this function it would save an extra sload to declare d at the beginning.\n\n### rETH ethPerDerivative() does a useless multiplication and division\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/Reth.sol#L215\n\nMultiply by 1e18 and then instantly divide by 1e18 is a waste of gas.\n\n### In SafETH addDerivative() ```localTotalWeight``` should be calculated at the beginning\n\nCalculate ```localTotalWeight``` first and then add ```_weight``` to get the new totalWeight, this will save one loop and one sload.\n\n### In SafETH rebalanceToWeights() the check ```ethAmountToRebalance == 0``` is useless\n\nIt should be checked before the loop and return or not checked at all since there is low chance this function gets called if there is no eth to rebalance.", "vulnerable_code": "", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/HHK-G.md", "collected_at": "2026-01-02T18:18:06.089503+00:00", "source_hash": "932fb6724dede45b036d2c7efc54f83f389cd8d762f74444fbaad3d60fb772f5", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 87, "github_ref_count": 2, "vulnerable_code_is_url": true, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "### In SafETH Stake() can have everything in the same loop.\n\n### Line 88 of SafEth.sol,", "primary_code_language": "unknown", "primary_code_char_count": 87, "all_code_blocks": "// Code block 1 (unknown):\n### In SafETH Stake() can have everything in the same loop.\n\n### Line 88 of SafEth.sol,", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol#L84, Reth.sol#L215", "github_files_list": "Reth.sol, SafEth.sol", "github_refs_count": 2, "vulnerable_code_actual": "", "has_vulnerable_code_snippet": false, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "01-ondo", "title": "fs0c Q", "severity_raw": "Medium", "severity": "medium", "description": "## [QA-01] lack of storage `_gap` in upgradable contracts.\n\nFor upgradeable contracts, there must be storage gap to \u201callow developers to freely add new state variables in the future without compromising the storage compatibility with existing deployments\u201d. Otherwise it may be very difficult to write new implementation code. Without storage gap, the variable in child contract might be overwritten by the upgraded base contract if new variables are added to the base contract. This could have unintended and very serious consequences to the child contracts.\n\nRefer to the bottom part of this article:\u00a0[https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable](https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable)\n\n### POC\n\n[contracts/cash/token/Cash.sol](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/token/Cash.sol)\n\n[contracts/cash/token/CashKYCSender.sol](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/token/CashKYCSender.sol)\n\n[contracts/cash/token/CashKYCSenderReceiver.sol](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/token/CashKYCSenderReceiver.sol)\n\n### Recommendation\n\nAdd the following to the contracts.\n\n```solidity\nuint256[50] private __gap;\n```\n\n## [QA-02] `minimumRedeemAmount` can be max without checks\n\nThe function `requestRedemption` checks if the value to be redeemed is less than `minimumRedeemAmount` and would revert if it is less than the minimum value. This value can be set using `setRedeemMinimum` without any check for the value.\n\nIn case of malicious owner, or the account is compromised, they can set `minimumRedeemAmount` to a very large amount and no user would be able to redeem their collateral.\n\n## [QA-03] pause and unpause roles should be given to the `PAUSER_ADMIN` role.\n\nThe pause and unpause functions should be controlled from the `PAUSER_ADMIN` role. In `CashManager` the pause role is correctly controlled by the `PAUSER_ADMIN` but the unpause role is con", "vulnerable_code": "uint256[50] private __gap;", "fixed_code": "function pause() external onlyRole(PAUSER_ADMIN) {\n _pause();\n }\n\n /**\n * @notice Will unpause minting functionality of this contract\n */\n function unpause() external onlyRole(MANAGER_ADMIN) {\n _unpause();\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/fs0c-Q.md", "collected_at": "2026-01-02T18:15:10.191784+00:00", "source_hash": "9334b643b699d706482412d08053d3a28ceda2d15863538764868750bfbc2696", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 26, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "uint256[50] private __gap;", "primary_code_language": "solidity", "primary_code_char_count": 26, "all_code_blocks": "// Code block 1 (solidity):\nuint256[50] private __gap;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "uint256[50] private __gap;", "github_refs_formatted": "Cash.sol, CashKYCSender.sol, CashKYCSenderReceiver.sol", "github_files_list": "CashKYCSender.sol, Cash.sol, CashKYCSenderReceiver.sol", "github_refs_count": 3, "vulnerable_code_actual": "uint256[50] private __gap;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function pause() external onlyRole(PAUSER_ADMIN) {\n _pause();\n }\n\n /**\n * @notice Will unpause minting functionality of this contract\n */\n function unpause() external onlyRole(MANAGER_ADMIN) {\n _unpause();\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "11-kelp", "title": "ABAIKUNANBAEV G", "severity_raw": "Gas", "severity": "gas", "description": "### Gas Optimizations List\n\n| Number | Optimization Details | Instances |\n| :----: | :----------------------------------------------------------------------------------------------------------------------- | :-------: |\n| [G-01] | Consider not using `nonReentrant` modifier where the possibility of reentrancy is 0. | 4 |\n| [G-02] | Use hard-coded address instead of `address(this)` to save gas. | 6 |\n| [G-03] | Consider not using pausability in the contract where `whenNotPaused` modifier is not used. | 1 |\n| [G-04] | Use assembly to implement for-loops. | 6 |\n| [G-05] | Use assembly to implement for address(0). | 3 |\n\nTotal 5 issues.\n\n## [G\u201101] Consider not using `nonReentrant` modifier where the possibility of reentrancy is 0. \n\nAlthough it's considered as the best practice, it's recommended to use it with the functions with callbacks are possible such as ERC1155 or ERC777 functionality, for example:\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L125\n```\n function depositAsset(\n address asset,\n uint256 depositAmount\n )\n external\n whenNotPaused\n nonReentrant\n onlySupportedAsset(asset)\n }\n```\n\n## [G\u201102] Use hard-coded address instead of address(this) to save gas. \n\nIn terms of gas, it's better to use pre-calculated contract address instead of `address(this)`:\n\n```\nassetLyingInDepositPool = IERC20(asset).balanceOf(address(this));\n```\n\n## [G\u201103] Consider not using pausability in the contract where `whenNotPaused` modifier is not used. \n\n`LRTOracle.sol` `pause() and `unpause()` functions are initialized but `whenNotPaused` modifier is never used. Therefore, these 2 functions and pausability feature may not be implemented as it just consumes more gas and not actually represent any logic:\n\nhttps://github.c", "vulnerable_code": " function depositAsset(\n address asset,\n uint256 depositAmount\n )\n external\n whenNotPaused\n nonReentrant\n onlySupportedAsset(asset)\n }", "fixed_code": "assetLyingInDepositPool = IERC20(asset).balanceOf(address(this));", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/ABAIKUNANBAEV-G.md", "collected_at": "2026-01-02T18:27:18.251849+00:00", "source_hash": "944635ab86ef34318bbb37aecc65d414c22ec76c4ff4d37445fb47973c8055f6", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 246, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function depositAsset(\n address asset,\n uint256 depositAmount\n )\n external\n whenNotPaused\n nonReentrant\n onlySupportedAsset(asset)\n }", "primary_code_language": "unknown", "primary_code_char_count": 181, "all_code_blocks": "// Code block 1 (unknown):\nfunction depositAsset(\n address asset,\n uint256 depositAmount\n )\n external\n whenNotPaused\n nonReentrant\n onlySupportedAsset(asset)\n }\n\n// Code block 2 (unknown):\nassetLyingInDepositPool = IERC20(asset).balanceOf(address(this));", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LRTDepositPool.sol#L125", "github_files_list": "LRTDepositPool.sol", "github_refs_count": 1, "vulnerable_code_actual": " function depositAsset(\n address asset,\n uint256 depositAmount\n )\n external\n whenNotPaused\n nonReentrant\n onlySupportedAsset(asset)\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "assetLyingInDepositPool = IERC20(asset).balanceOf(address(this));", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "04-caviar", "title": "Madalad G", "severity_raw": "High", "severity": "high", "description": "# Gas Optimizations Summary\n| |Issue|Instances|\n|:-:|:-|:-:|\n|[G-01]|`abi.encodePacked` is more gas efficient than `abi.encode`|2|\n|[G-02]|Functions guaranteed to revert when called by normal users can be marked `payable`|10|\n|[G-03]|Use assembly to calculate hashes|2|\n|[G-04]|Use `indexed` to save gas|11|\n|[G-05]|Refactor modifiers to call a local function|1|\n|[G-06]|Use `unchecked` for operations that cannot overflow/underflow|20|\n|[G-07]|Change `public` functions to `external`|20|\n|[G-08]|`x += y` costs more gas than `x = x + y` for state variables|4|\n|[G-09]|Usage of `uint` smaller than 32 bytes (256 bits) incurs overhead|5|\n|[G-10]|Use named return values|12|\n\nTotal issues: 10\n\nTotal instances: 87\n\n \n# Gas Optimizations\n## [G-01] `abi.encodePacked` is more gas efficient than `abi.encode`\n\n`abi.encode` pads all elementary types to 32 bytes, whereas `abi.encodePacked` will only use the minimal required memory to encode the data. See [here](https://docs.soliditylang.org/en/v0.8.11/abi-spec.html?highlight=encodepacked#non-standard-packed-mode) for more info.\n\nInstances: 2\n```solidity\nFile: src/EthRouter.sol\n\n177: abi.decode(abi.encode(sells[i].stolenNftProofs), (ReservoirOracle.Message[]))\n\n```\n- [src/EthRouter.sol#L177](https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L177)\n\n```solidity\nFile: src/PrivatePool.sol\n\n675: leafs[i] = keccak256(bytes.concat(keccak256(abi.encode(tokenIds[i], tokenWeights[i]))));\n\n```\n- [src/PrivatePool.sol#L675](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L675)\n\n\n \n## [G-02] Functions guaranteed to revert when called by normal users can be marked `payable`\n\nIf a function modifier such as `onlyOwner` is used, the function will revert if a normal user tries to pay the function. Marking the function as payable will lower the gas cost for legitimate callers because the compiler will not include checks for whether a payment was provided.\n\nThe extr", "vulnerable_code": "File: src/EthRouter.sol\n\n177: abi.decode(abi.encode(sells[i].stolenNftProofs), (ReservoirOracle.Message[]))\n", "fixed_code": "File: src/PrivatePool.sol\n\n675: leafs[i] = keccak256(bytes.concat(keccak256(abi.encode(tokenIds[i], tokenWeights[i]))));\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/Madalad-G.md", "collected_at": "2026-01-02T18:19:50.012477+00:00", "source_hash": "94c545761a6727c04ce451d9ab197dd6b055e43581fe36e579f61ed086d2d74f", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 259, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: src/EthRouter.sol\n\n177: abi.decode(abi.encode(sells[i].stolenNftProofs), (ReservoirOracle.Message[]))", "primary_code_language": "solidity", "primary_code_char_count": 127, "all_code_blocks": "// Code block 1 (solidity):\nFile: src/EthRouter.sol\n\n177: abi.decode(abi.encode(sells[i].stolenNftProofs), (ReservoirOracle.Message[]))\n\n// Code block 2 (solidity):\nFile: src/PrivatePool.sol\n\n675: leafs[i] = keccak256(bytes.concat(keccak256(abi.encode(tokenIds[i], tokenWeights[i]))));", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: src/EthRouter.sol\n\n177: abi.decode(abi.encode(sells[i].stolenNftProofs), (ReservoirOracle.Message[]))\n\nFile: src/PrivatePool.sol\n\n675: leafs[i] = keccak256(bytes.concat(keccak256(abi.encode(tokenIds[i], tokenWeights[i]))));", "github_refs_formatted": "EthRouter.sol#L177, PrivatePool.sol#L675", "github_files_list": "EthRouter.sol, PrivatePool.sol", "github_refs_count": 2, "vulnerable_code_actual": "File: src/EthRouter.sol\n\n177: abi.decode(abi.encode(sells[i].stolenNftProofs), (ReservoirOracle.Message[]))\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: src/PrivatePool.sol\n\n675: leafs[i] = keccak256(bytes.concat(keccak256(abi.encode(tokenIds[i], tokenWeights[i]))));\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "10-badger", "title": "hihen Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA Report\n\n## Summary\n\n### Low Issues\n\nTotal **176 instances** over **24 issues**:\n\n|ID|Issue|Instances|\n|:--:|:---|:--:|\n| [[L‑01]](#l01-variables-shadowing-other-definitions) | Variables shadowing other definitions | 3 |\n| [[L‑02]](#l02-missing-zero-address-check-in-constructor) | Missing zero address check in constructor | 50 |\n| [[L‑03]](#l03-function-receivepayable-fallback-does-not-authorize-sender) | Function `receive()`/`payable fallback()` does not authorize sender | 2 |\n| [[L‑04]](#l04-revert-on-transfer-to-the-zero-address) | Revert on transfer to the zero address | 4 |\n| [[L‑05]](#l05-array-is-pushed-but-not-poped) | Array is `push()`ed but not `pop()`ed | 1 |\n| [[L‑06]](#l06-state-variables-not-limited-to-reasonable-values) | State variables not limited to reasonable values | 2 |\n| [[L‑07]](#l07-tokens-may-be-minted-to-the-zero-address) | Tokens may be minted to the zero address | 1 |\n| [[L‑08]](#l08-consider-implementing-two-step-procedure-for-updating-protocol-addresses) | Consider implementing two-step procedure for updating protocol addresses | 1 |\n| [[L‑09]](#l09-downcasting-other-types-to-an-address-can-cause-collisions) | Downcasting other types to an address can cause collisions | 1 |\n| [[L‑10]](#l10-vulnerable-versions-of-packages-are-being-used) | Vulnerable versions of packages are being used | 4 |\n| [[L‑11]](#l11-constructor--initialization-function-lacks-parameter-validation) | Constructor / initialization function lacks parameter validation | 1 |\n| [[L‑12]](#l12-contracts-are-vulnerable-to-fee-on-transfer-accounting-related-issues) | Contracts are vulnerable to fee-on-transfer accounting-related issues | 8 |\n| [[L‑13]](#l13-functions-calling-contractsaddresses-with-transfer-hooks-should-be-protected-by-reentrancy-guard) | Functions calling contracts/addresses with transfer hooks should be protected by reentrancy guard | 6 |\n| [[L‑14]](#l14-c", "vulnerable_code": "/// @audit Shadows `function version()`\n680: bytes32 version", "fixed_code": "/// @audit Shadows `function name()`\n237: bytes32 name,\n\n/// @audit Shadows `function version()`\n238: bytes32 version", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/hihen-Q.md", "collected_at": "2026-01-02T18:26:50.192353+00:00", "source_hash": "94c86448354f61d5a142649802bd845dce0d04022149c0edd413b35f9e51b206", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "/// @audit Shadows `function version()`\n680: bytes32 version", "has_vulnerable_code_snippet": true, "fixed_code_actual": "/// @audit Shadows `function name()`\n237: bytes32 name,\n\n/// @audit Shadows `function version()`\n238: bytes32 version", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "11-kelp", "title": "SandNallani Q", "severity_raw": "Low", "severity": "low", "description": "### [QA-1] Inconsistent use of the `whenNotPaused` modifier in the Oracle and Deposit pool contracts\n\nThe Oracle contract inherits and implements functions to pause and unpause. However, the `whenNotPaused` modifier is not applied to any of the functions in this contract. \n\nIn the node delegator contract, when paused, cannot transfer assets back to the deposit pool. \nHowever, the deposit pool contract is able to transfer funds to the node delegator when paused. \n\n\nConsider removing the capability to pause/unpause the Oracle contract as it's not being used in the current version of the contract. \nConsider preventing the transfer of assets from the deposit pool to node delegator when paused, for better consistency. \n\n### [QA-2] The node delegator contract doesn\u2019t track the number of shares created by the Eigen stragety.\n\nThe node delegator contract's responsible for depositing the user's deposit pool funds into various\nEigenlayer strategies. \nShown below is the function that performs this task.\n \n```\nNodeDelegator::depositAssetIntoStrategy()\n//NodeDelegator.sol\nfunction depositAssetIntoStrategy(address asset){ \n...\nemit AssetDepositIntoStrategy(asset, strategy, balance);\n\nIEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);\n... \n}\n```\nHowever, the number of shares minted by the Eigenlayer strategy aren't tracked or emitted as an argument in the event `AssetDepositIntoStrategy`. \nConsider checking the number of shares minted to ensuring that there's no adverse price impact and emitting it in the event to allow for off-chain accounting.\n\n\n\n\n### [QA-3] The deposit pool's `depositAsset()` function could return the number of minted tokens\n\nThe main entry point in the Kelp protocol is the `LRTDepositPool::depositAsset()`. Which allows users to deposit approved assets into the pool to receive an amount of `rsETH` tokens. \nThe minted `rsETH` tokens represent the user's underlying asset contribution of rETH, cbET", "vulnerable_code": "NodeDelegator::depositAssetIntoStrategy()\n//NodeDelegator.sol\nfunction depositAssetIntoStrategy(address asset){ \n...\nemit AssetDepositIntoStrategy(asset, strategy, balance);\n\nIEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);\n... \n}", "fixed_code": " function getRsETHAmountToMint(\n address asset,\n uint256 amount\n )\n public\n view\n override\n returns (uint256 rsethAmountToMint) {\n ...\n rsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();\n }", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/SandNallani-Q.md", "collected_at": "2026-01-02T18:27:38.972409+00:00", "source_hash": "94eebd5e8e262617d8ac221f306ffac2db22e282a97332e7a04ae8364534412b", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 298, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "NodeDelegator::depositAssetIntoStrategy()\n//NodeDelegator.sol\nfunction depositAssetIntoStrategy(address asset){ \n...\nemit AssetDepositIntoStrategy(asset, strategy, balance);\n\nIEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);\n... \n}", "primary_code_language": "unknown", "primary_code_char_count": 298, "all_code_blocks": "// Code block 1 (unknown):\nNodeDelegator::depositAssetIntoStrategy()\n//NodeDelegator.sol\nfunction depositAssetIntoStrategy(address asset){ \n...\nemit AssetDepositIntoStrategy(asset, strategy, balance);\n\nIEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);\n... \n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "NodeDelegator::depositAssetIntoStrategy()\n//NodeDelegator.sol\nfunction depositAssetIntoStrategy(address asset){ \n...\nemit AssetDepositIntoStrategy(asset, strategy, balance);\n\nIEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);\n... \n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function getRsETHAmountToMint(\n address asset,\n uint256 amount\n )\n public\n view\n override\n returns (uint256 rsethAmountToMint) {\n ...\n rsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "03-asymmetry", "title": "CodeFoxInc Q", "severity_raw": "Critical", "severity": "critical", "description": "# Low-risk and Non-critical issues\n\n## ****Codebase Impressions & Summary****\n\nThe protocol is built on several other projects and the the enhanced way created by the team to stake Ether is quite interesting. \n\nThe protocol\u2019s contracts are well structured and quite simplified and the Natspec documentation is quite well done. These efforts made by the team made the codebase easier to be understood by the auditors. The overall quality of the documentation is good but an independent documentation rather than only the `README` file is preferred if possible. \n\nHowever, there are some minor modifications can be done to improve the healthiness of the codebase. \n\nI proposed findings which focused on several issues, e.g. Re-entrancy attack possibility, Upgradeability pattern, solidity version, trusted owner issue, code style and some issues for following the best practice of solidity, etc. If they are to be addressed, the code quality are supposed to be improved. \n\n## L-01 Make sure the `unstake()` function won\u2019t get Re-entrancy attacked\n\n### Vulnerability Details\n\n[https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L108-L129](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L108-L129)\n\nThe function `unstake()` send ether to the external accounts. It has a risk of being used as re-entrancy attack. Although the function follows the CEI rule, it is recommended that import the ReentrancyGuard contract and stay safe. \n\n### Impact\n\nThe `unstake` function sends Ether to external accounts and has a risk of being Re-entrancy attacked. \n\n### Recommendation\n\nUse OpenZeppelin\u2019s [Re-entrancy modifier library](https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/master/contracts/security/ReentrancyGuardUpgradeable.sol) to prevent such attack from happening. \n\nIn `SafEth.sol` do this: \n\n```diff\n+ import \"@openzeppelin/contract", "vulnerable_code": "## L-02 The `addDerivative()`, `adjustWeight()` and `rebalanceToWeights()` functions can be used to steal funds\n\n### **Vulnerability details**\n\nThere are quite a lot of `onlyOwner` functions and specifically speaking, the `adjustWeight`, `addDerivative` and `rebalanceToWeights` function can be used to drain funds. So there is a centralized risk. \n\nThe owner can add a new malicious derivative by calling `addDerivative` and then adjust the weight to e.g. 0/0/0/100. After that if he calls `rebalanceToWeights` function then all the funds can be drained. \n\n[https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L165-L175](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L165-L175)\n\n[https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L182-L195](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L182-L195)\n\n[https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L138-L155](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L138-L155)\n\n### Impact\n\nSo there is a centralized risk. Owner can always drain funds. Owner needs to be trusted. \n\n### Recommendation\n\nMitigate the risk by at least using a multi-sig wallet for the owner. Plus, the team can create a plan to renounce the ownership in the future if it is possible. \n\n## N-01 Use a struct array structure instead of `uint256 derivativeCount`, mapping `derivatives` and mapping `weights`\n\n[https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEthStorage.sol#L18](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/c", "fixed_code": "and put them into an array: \n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/CodeFoxInc-Q.md", "collected_at": "2026-01-02T18:17:57.964716+00:00", "source_hash": "94f28579642a30f19ac8679cca8a82be6a9b20dbc3ce7a6cd839f49f89ba9d66", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol#L108-L129, ReentrancyGuardUpgradeable.sol, SafEth.sol#L165-L175, SafEth.sol#L182-L195, SafEth.sol#L138-L155, SafEthStorage.sol#L18", "github_files_list": "SafEthStorage.sol, SafEth.sol, ReentrancyGuardUpgradeable.sol", "github_refs_count": 6, "vulnerable_code_actual": "## L-02 The `addDerivative()`, `adjustWeight()` and `rebalanceToWeights()` functions can be used to steal funds\n\n### **Vulnerability details**\n\nThere are quite a lot of `onlyOwner` functions and specifically speaking, the `adjustWeight`, `addDerivative` and `rebalanceToWeights` function can be used to drain funds. So there is a centralized risk. \n\nThe owner can add a new malicious derivative by calling `addDerivative` and then adjust the weight to e.g. 0/0/0/100. After that if he calls `rebalanceToWeights` function then all the funds can be drained. \n\n[https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L165-L175](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L165-L175)\n\n[https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L182-L195](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L182-L195)\n\n[https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L138-L155](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L138-L155)\n\n### Impact\n\nSo there is a centralized risk. Owner can always drain funds. Owner needs to be trusted. \n\n### Recommendation\n\nMitigate the risk by at least using a multi-sig wallet for the owner. Plus, the team can create a plan to renounce the ownership in the future if it is possible. \n\n## N-01 Use a struct array structure instead of `uint256 derivativeCount`, mapping `derivatives` and mapping `weights`\n\n[https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEthStorage.sol#L18](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/c", "has_vulnerable_code_snippet": true, "fixed_code_actual": "and put them into an array: \n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "05-ajna", "title": "Polaris_tow G", "severity_raw": "Gas", "severity": "gas", "description": "## USING FIXED BYTES IS CHEAPER THAN USING STRING\nAs a rule of thumb, use bytes for arbitrary-length raw byte data and string for arbitrary-length string (UTF-8) data. If you can limit the length to a certain number of bytes, always use one of bytes1 to bytes32 because they are much cheaper.\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/Funding.sol#L61\n` string memory errorMessage = \"Governor: call reverted without message\";`\n\n## CAN MAKE THE VARIABLE OUTSIDE THE LOOP TO SAVE GAS\nMake it outside and only use it inside.\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/Funding.sol#L112-L141\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/StandardFunding.sol#L582-L596\n```\n for (uint256 i = 0; i < targets_.length;) {\n\n // check targets and values params are valid\n if (targets_[i] != ajnaTokenAddress || values_[i] != 0) revert InvalidProposal();\n\n // check calldata function selector is transfer()\n bytes memory selDataWithSig = calldatas_[i];\n\n bytes4 selector;\n //slither-disable-next-line assembly\n assembly {\n selector := mload(add(selDataWithSig, 0x20))\n }\n if (selector != bytes4(0xa9059cbb)) revert InvalidProposal();\n\n // https://github.com/ethereum/solidity/issues/9439\n // retrieve tokensRequested from incoming calldata, accounting for selector and recipient address\n uint256 tokensRequested;\n bytes memory tokenDataWithSig = calldatas_[i];\n //slither-disable-next-line assembly\n assembly {\n tokensRequested := mload(add(tokenDataWithSig, 68))\n }\n\n // update tokens requested for additional calldata\n tokensRequested_ += SafeCast.t", "vulnerable_code": " for (uint256 i = 0; i < targets_.length;) {\n\n // check targets and values params are valid\n if (targets_[i] != ajnaTokenAddress || values_[i] != 0) revert InvalidProposal();\n\n // check calldata function selector is transfer()\n bytes memory selDataWithSig = calldatas_[i];\n\n bytes4 selector;\n //slither-disable-next-line assembly\n assembly {\n selector := mload(add(selDataWithSig, 0x20))\n }\n if (selector != bytes4(0xa9059cbb)) revert InvalidProposal();\n\n // https://github.com/ethereum/solidity/issues/9439\n // retrieve tokensRequested from incoming calldata, accounting for selector and recipient address\n uint256 tokensRequested;\n bytes memory tokenDataWithSig = calldatas_[i];\n //slither-disable-next-line assembly\n assembly {\n tokensRequested := mload(add(tokenDataWithSig, 68))\n }\n\n // update tokens requested for additional calldata\n tokensRequested_ += SafeCast.toUint128(tokensRequested);\n\n unchecked { ++i; }\n }\n }", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/Polaris_tow-G.md", "collected_at": "2026-01-02T18:21:07.029094+00:00", "source_hash": "951a697e1acbfe76294e8609a67491c9c4da3416185d5f1f3d4ea5ebb83716ad", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Funding.sol#L61, Funding.sol#L112-L141, StandardFunding.sol#L582-L596", "github_files_list": "Funding.sol, StandardFunding.sol", "github_refs_count": 3, "vulnerable_code_actual": " for (uint256 i = 0; i < targets_.length;) {\n\n // check targets and values params are valid\n if (targets_[i] != ajnaTokenAddress || values_[i] != 0) revert InvalidProposal();\n\n // check calldata function selector is transfer()\n bytes memory selDataWithSig = calldatas_[i];\n\n bytes4 selector;\n //slither-disable-next-line assembly\n assembly {\n selector := mload(add(selDataWithSig, 0x20))\n }\n if (selector != bytes4(0xa9059cbb)) revert InvalidProposal();\n\n // https://github.com/ethereum/solidity/issues/9439\n // retrieve tokensRequested from incoming calldata, accounting for selector and recipient address\n uint256 tokensRequested;\n bytes memory tokenDataWithSig = calldatas_[i];\n //slither-disable-next-line assembly\n assembly {\n tokensRequested := mload(add(tokenDataWithSig, 68))\n }\n\n // update tokens requested for additional calldata\n tokensRequested_ += SafeCast.toUint128(tokensRequested);\n\n unchecked { ++i; }\n }\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "02-ethos", "title": "Buck Q", "severity_raw": "Low", "severity": "low", "description": "Ethos-Core\n------------\nIn the AccessControl, there are cases where the comments do not reflect exactly what the code is doing. Not major issues, but not totally accurate.\n-------------\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol\ncontracts/TroveManager.sol\nline 1077 - in function applyPendingRewards\nthe require is less restrictive than a require further down the call stack\n```\n _requireCallerIsBorrowerOperationsOrRedemptionHelper();\n // _updateTroveRewardSnapshots calls _requireCallerIsBorrowerOperations() internally, so allowing RedemptionHelper is useless\n // _updateTroveRewardSnapshots is called by _applyPendingRewards(...)\n```\nso code should read\n```\n_requireCallerIsBorrowerOperations();\n```\n-----------------\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol\ncontracts/ActivePool.sol\nline 334 - should include redemptionHelper\n```\n \"ActivePool: Caller is neither BorrowerOperations nor TroveManager nor StabilityPool nor redemptionHelper\");\n```\n\n-----------------\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/test/AccessControlTest.js\ntest/AccessControlTest.js\nAccess control tests text does not match access controls in solidity code (in some cases)\nline 83 - add redemptionHelper\n```\nit(\"applyPendingRewards(): reverts when called by an account that is not BorrowerOperations nor RedemptionHelper\", async () => {\n```\nline 107 - add redemptionHelper\n```\nit(\"removeStake(): reverts when called by an account that is not BorrowerOperations nor RedemptionHelper\", async () => {\n```\nline 131 - add redemptionHelper\n```\nit(\"closeTrove(): reverts when called by an account that is not BorrowerOperations nor RedemptionHelper\", async () => {\n```\nline 278 - add redemptionHelper\n```\nit(\"sendCollateral(): reverts when called by an account that is not BO nor TroveM nor SP nor redemptionHelper\", async () => {\n```\nline 285 - add redemptionHelper\n```\nasse", "vulnerable_code": " _requireCallerIsBorrowerOperationsOrRedemptionHelper();\n // _updateTroveRewardSnapshots calls _requireCallerIsBorrowerOperations() internally, so allowing RedemptionHelper is useless\n // _updateTroveRewardSnapshots is called by _applyPendingRewards(...)", "fixed_code": "_requireCallerIsBorrowerOperations();", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/Buck-Q.md", "collected_at": "2026-01-02T18:16:02.650299+00:00", "source_hash": "9521fd28bca140e863d8cd6c47802c6870c6c646dc8bb7f0e069bf4812e6e979", "code_block_count": 7, "solidity_block_count": 0, "total_code_chars": 904, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "_requireCallerIsBorrowerOperationsOrRedemptionHelper();\n // _updateTroveRewardSnapshots calls _requireCallerIsBorrowerOperations() internally, so allowing RedemptionHelper is useless\n // _updateTroveRewardSnapshots is called by _applyPendingRewards(...)", "primary_code_language": "unknown", "primary_code_char_count": 267, "all_code_blocks": "// Code block 1 (unknown):\n_requireCallerIsBorrowerOperationsOrRedemptionHelper();\n // _updateTroveRewardSnapshots calls _requireCallerIsBorrowerOperations() internally, so allowing RedemptionHelper is useless\n // _updateTroveRewardSnapshots is called by _applyPendingRewards(...)\n\n// Code block 2 (unknown):\n_requireCallerIsBorrowerOperations();\n\n// Code block 3 (unknown):\n\"ActivePool: Caller is neither BorrowerOperations nor TroveManager nor StabilityPool nor redemptionHelper\");\n\n// Code block 4 (unknown):\nit(\"applyPendingRewards(): reverts when called by an account that is not BorrowerOperations nor RedemptionHelper\", async () => {\n\n// Code block 5 (unknown):\nit(\"removeStake(): reverts when called by an account that is not BorrowerOperations nor RedemptionHelper\", async () => {\n\n// Code block 6 (unknown):\nit(\"closeTrove(): reverts when called by an account that is not BorrowerOperations nor RedemptionHelper\", async () => {\n\n// Code block 7 (unknown):\nit(\"sendCollateral(): reverts when called by an account that is not BO nor TroveM nor SP nor redemptionHelper\", async () => {", "all_code_blocks_count": 7, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "TroveManager.sol, ActivePool.sol", "github_files_list": "TroveManager.sol, ActivePool.sol", "github_refs_count": 2, "vulnerable_code_actual": " _requireCallerIsBorrowerOperationsOrRedemptionHelper();\n // _updateTroveRewardSnapshots calls _requireCallerIsBorrowerOperations() internally, so allowing RedemptionHelper is useless\n // _updateTroveRewardSnapshots is called by _applyPendingRewards(...)", "has_vulnerable_code_snippet": true, "fixed_code_actual": "_requireCallerIsBorrowerOperations();", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 13} {"source": "c4", "protocol": "06-lybra", "title": "koxuan G", "severity_raw": "Medium", "severity": "medium", "description": "# Report\n\n\n## Gas Optimizations\n\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [GAS-1](#GAS-1) | Using bools for storage incurs overhead | 10 |\n| [GAS-2](#GAS-2) | Cache array length outside of loop | 4 |\n| [GAS-3](#GAS-3) | State variables should be cached in stack variables rather than re-reading them from storage | 6 |\n| [GAS-4](#GAS-4) | Use calldata instead of memory for function arguments that do not get mutated | 20 |\n| [GAS-5](#GAS-5) | For Operations that will not overflow, you could use unchecked | 770 |\n| [GAS-6](#GAS-6) | Use Custom Errors | 186 |\n| [GAS-7](#GAS-7) | Don't initialize variables with default value | 7 |\n| [GAS-8](#GAS-8) | Long revert strings | 54 |\n| [GAS-9](#GAS-9) | Functions guaranteed to revert when called by normal users can be marked `payable` | 37 |\n| [GAS-10](#GAS-10) | `++i` costs less gas than `i++`, especially when it's used in `for`-loops (`--i`/`i--` too) | 4 |\n| [GAS-11](#GAS-11) | Using `private` rather than `public` for constants, saves gas | 11 |\n| [GAS-12](#GAS-12) | Splitting require() statements that use && saves gas | 6 |\n| [GAS-13](#GAS-13) | Use != 0 instead of > 0 for unsigned integer comparison | 61 |\n| [GAS-14](#GAS-14) | `internal` functions not called by the contract should be removed | 27 |\n### [GAS-1] Using bools for storage incurs overhead\nUse uint256(1) and uint256(2) for true/false to avoid a Gwarmaccess (100 gas), and to avoid Gsset (20000 gas) when changing from \u2018false\u2019 to \u2018true\u2019, after having been \u2018true\u2019 in the past. See [source](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/58f635312aa21f947cae5f8578638a85aa2519f5/contracts/security/ReentrancyGuard.sol#L23-L27).\n\n*Instances (10)*:\n```solidity\nFile: OFT/OFTCoreV2.sol\n\n22: bool public useCustomAdapterParams;\n\n23: mapping(uint16 => mapping(bytes => mapping(uint64 => bool))) public creditedPackets;\n\n```\n\n```solidity\nFile: lybra/configuration/LybraConfigurator.sol\n\n38: mapping(address => bool) public mintVault;\n\n40: map", "vulnerable_code": "File: OFT/OFTCoreV2.sol\n\n22: bool public useCustomAdapterParams;\n\n23: mapping(uint16 => mapping(bytes => mapping(uint64 => bool))) public creditedPackets;\n", "fixed_code": "File: lybra/configuration/LybraConfigurator.sol\n\n38: mapping(address => bool) public mintVault;\n\n40: mapping(address => bool) public vaultMintPaused;\n\n41: mapping(address => bool) public vaultBurnPaused;\n\n46: mapping(address => bool) redemptionProvider;\n\n47: mapping(address => bool) public tokenMiner;\n\n61: bool public premiumTradingEnabled;\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/koxuan-G.md", "collected_at": "2026-01-02T18:23:04.666513+00:00", "source_hash": "952f2184c6eefd9070e586613de102fcc21d825260df7790afdd8b30fc3fc47d", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 162, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: OFT/OFTCoreV2.sol\n\n22: bool public useCustomAdapterParams;\n\n23: mapping(uint16 => mapping(bytes => mapping(uint64 => bool))) public creditedPackets;", "primary_code_language": "solidity", "primary_code_char_count": 162, "all_code_blocks": "// Code block 1 (solidity):\nFile: OFT/OFTCoreV2.sol\n\n22: bool public useCustomAdapterParams;\n\n23: mapping(uint16 => mapping(bytes => mapping(uint64 => bool))) public creditedPackets;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: OFT/OFTCoreV2.sol\n\n22: bool public useCustomAdapterParams;\n\n23: mapping(uint16 => mapping(bytes => mapping(uint64 => bool))) public creditedPackets;", "github_refs_formatted": "ReentrancyGuard.sol#L23-L27", "github_files_list": "ReentrancyGuard.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: OFT/OFTCoreV2.sol\n\n22: bool public useCustomAdapterParams;\n\n23: mapping(uint16 => mapping(bytes => mapping(uint64 => bool))) public creditedPackets;\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: lybra/configuration/LybraConfigurator.sol\n\n38: mapping(address => bool) public mintVault;\n\n40: mapping(address => bool) public vaultMintPaused;\n\n41: mapping(address => bool) public vaultBurnPaused;\n\n46: mapping(address => bool) redemptionProvider;\n\n47: mapping(address => bool) public tokenMiner;\n\n61: bool public premiumTradingEnabled;\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ethos", "title": "dontonka G", "severity_raw": "Low", "severity": "low", "description": "Some reported issues here are just added as a comment, but most have been applied the suggested corrections already, you can see all the final diffs. Take note that the code compile and all test pass with those too.\n\n```diff\ndiff --git a/Ethos-Core/contracts/ActivePool.sol b/Ethos-Core/contracts/ActivePool.sol\nindex 753fcd0..771da52 100644\n--- a/Ethos-Core/contracts/ActivePool.sol\n+++ b/Ethos-Core/contracts/ActivePool.sol\n@@ -176,12 +176,13 @@ contract ActivePool is Ownable, CheckContract, IActivePool {\n emit ActivePoolCollateralBalanceUpdated(_collateral, collAmount[_collateral]);\n emit CollateralSent(_collateral, _account, _amount);\n \n+ //@audit (GAS): save using the parameter _account instead of the state variable defaultPoolAddress and collSurplusPoolAddress\n if (_account == defaultPoolAddress) {\n- IERC20(_collateral).safeIncreaseAllowance(defaultPoolAddress, _amount);\n- IDefaultPool(defaultPoolAddress).pullCollateralFromActivePool(_collateral, _amount);\n+ IERC20(_collateral).safeIncreaseAllowance(_account, _amount); \n+ IDefaultPool(_account).pullCollateralFromActivePool(_collateral, _amount);\n } else if (_account == collSurplusPoolAddress) {\n- IERC20(_collateral).safeIncreaseAllowance(collSurplusPoolAddress, _amount);\n- ICollSurplusPool(collSurplusPoolAddress).pullCollateralFromActivePool(_collateral, _amount);\n+ IERC20(_collateral).safeIncreaseAllowance(_account, _amount);\n+ ICollSurplusPool(_account).pullCollateralFromActivePool(_collateral, _amount);\n } else {\n IERC20(_collateral).safeTransfer(_account, _amount);\n }\n@@ -274,6 +275,7 @@ contract ActivePool is Ownable, CheckContract, IActivePool {\n }\n \n // + means deposit, - means withdraw\n+ //@audit (GAS) can save some gas here with yieldGenerator[_collateral] being local var\n vars.netAssetMovement = int256(vars.toDeposit) - i", "vulnerable_code": "```diff\ndiff --git a/Ethos-Vault/contracts/ReaperVaultV2.sol b/Ethos-Vault/contracts/ReaperVaultV2.sol\nindex 2be0b81..a60c162 100644\n--- a/Ethos-Vault/contracts/ReaperVaultV2.sol\n+++ b/Ethos-Vault/contracts/ReaperVaultV2.sol\n@@ -266,7 +266,7 @@ contract ReaperVaultV2 is ReaperAccessControl, ERC20, IERC4626Events, AccessCont\n delete withdrawalQueue;\n for (uint256 i = 0; i < queueLength; i = i.uncheckedInc()) {\n address strategy = _withdrawalQueue[i];\n- StrategyParams storage params = strategies[strategy];\n+ StrategyParams storage params = strategies[strategy]; // @audit (GAS) use memory instead of storage, only reading\n require(params.activation != 0, \"Invalid strategy address\");\n withdrawalQueue.push(strategy);\n }\n@@ -610,6 +610,7 @@ contract ReaperVaultV2 is ReaperAccessControl, ERC20, IERC4626Events, AccessCont\n * goes back into Normal Operation.\n */\n function setEmergencyShutdown(bool _active) external {\n+ //@audit (GAS) add a require to prevent waste : require(_active != emergencyShutdown, \"Already in this state\");\n if (_active) {\n _atLeastRole(GUARDIAN);\n } else {", "fixed_code": "```diff\ndiff --git a/Ethos-Core/contracts/StabilityPool.sol b/Ethos-Core/contracts/StabilityPool.sol\nindex a33d8c3..5f8fac6 100644\n--- a/Ethos-Core/contracts/StabilityPool.sol\n+++ b/Ethos-Core/contracts/StabilityPool.sol\n@@ -807,13 +807,14 @@ contract StabilityPool is LiquityBase, Ownable, CheckContract, IStabilityPool {\n \n function _updateDepositAndSnapshots(address _depositor, uint _newValue) internal {\n deposits[_depositor].initialValue = _newValue;\n+ Snapshots storage depositSnapshotCached = depositSnapshots[_depositor]; //@audit (GAS) added a cache snapshot\n \n address[] memory collaterals = collateralConfig.getAllowedCollaterals();\n uint[] memory amounts = new uint[](collaterals.length);\n \n if (_newValue == 0) {\n for (uint i = 0; i < collaterals.length; i++) {\n- delete depositSnapshots[_depositor].S[collaterals[i]];\n+ delete depositSnapshotCached.S[collaterals[i]];\n }\n delete depositSnapshots[_depositor];\n emit DepositSnapshotUpdated(_depositor, 0, collaterals, amounts, 0);\n@@ -827,16 +828,16 @@ contract StabilityPool is LiquityBase, Ownable, CheckContract, IStabilityPool {\n uint currentG = epochToScaleToG[currentEpochCached][currentScaleCached];\n \n // Record new snapshots of the latest running product P, and sum G, for the depositor\n- depositSnapshots[_depositor].P = currentP;\n- depositSnapshots[_depositor].G = currentG;\n- depositSnapshots[_depositor].scale = currentScaleCached;\n- depositSnapshots[_depositor].epoch = currentEpochCached;\n+ depositSnapshotCached.P = currentP;\n+ depositSnapshotCached.G = currentG;\n+ depositSnapshotCached.scale = currentScaleCached;\n+ depositSnapshotCached.epoch = currentEpochCached;\n \n // Record new snapshots of the latest running sum S for all collaterals for the depositor\n for (uint i = 0; i < collaterals.length; i++) {\n ", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/dontonka-G.md", "collected_at": "2026-01-02T18:17:06.491421+00:00", "source_hash": "954422e9a7eb6e1032b748ed2b34c5835418e3dcbeb4f83ccebd33d39ab50594", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "```diff\ndiff --git a/Ethos-Vault/contracts/ReaperVaultV2.sol b/Ethos-Vault/contracts/ReaperVaultV2.sol\nindex 2be0b81..a60c162 100644\n--- a/Ethos-Vault/contracts/ReaperVaultV2.sol\n+++ b/Ethos-Vault/contracts/ReaperVaultV2.sol\n@@ -266,7 +266,7 @@ contract ReaperVaultV2 is ReaperAccessControl, ERC20, IERC4626Events, AccessCont\n delete withdrawalQueue;\n for (uint256 i = 0; i < queueLength; i = i.uncheckedInc()) {\n address strategy = _withdrawalQueue[i];\n- StrategyParams storage params = strategies[strategy];\n+ StrategyParams storage params = strategies[strategy]; // @audit (GAS) use memory instead of storage, only reading\n require(params.activation != 0, \"Invalid strategy address\");\n withdrawalQueue.push(strategy);\n }\n@@ -610,6 +610,7 @@ contract ReaperVaultV2 is ReaperAccessControl, ERC20, IERC4626Events, AccessCont\n * goes back into Normal Operation.\n */\n function setEmergencyShutdown(bool _active) external {\n+ //@audit (GAS) add a require to prevent waste : require(_active != emergencyShutdown, \"Already in this state\");\n if (_active) {\n _atLeastRole(GUARDIAN);\n } else {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "```diff\ndiff --git a/Ethos-Core/contracts/StabilityPool.sol b/Ethos-Core/contracts/StabilityPool.sol\nindex a33d8c3..5f8fac6 100644\n--- a/Ethos-Core/contracts/StabilityPool.sol\n+++ b/Ethos-Core/contracts/StabilityPool.sol\n@@ -807,13 +807,14 @@ contract StabilityPool is LiquityBase, Ownable, CheckContract, IStabilityPool {\n \n function _updateDepositAndSnapshots(address _depositor, uint _newValue) internal {\n deposits[_depositor].initialValue = _newValue;\n+ Snapshots storage depositSnapshotCached = depositSnapshots[_depositor]; //@audit (GAS) added a cache snapshot\n \n address[] memory collaterals = collateralConfig.getAllowedCollaterals();\n uint[] memory amounts = new uint[](collaterals.length);\n \n if (_newValue == 0) {\n for (uint i = 0; i < collaterals.length; i++) {\n- delete depositSnapshots[_depositor].S[collaterals[i]];\n+ delete depositSnapshotCached.S[collaterals[i]];\n }\n delete depositSnapshots[_depositor];\n emit DepositSnapshotUpdated(_depositor, 0, collaterals, amounts, 0);\n@@ -827,16 +828,16 @@ contract StabilityPool is LiquityBase, Ownable, CheckContract, IStabilityPool {\n uint currentG = epochToScaleToG[currentEpochCached][currentScaleCached];\n \n // Record new snapshots of the latest running product P, and sum G, for the depositor\n- depositSnapshots[_depositor].P = currentP;\n- depositSnapshots[_depositor].G = currentG;\n- depositSnapshots[_depositor].scale = currentScaleCached;\n- depositSnapshots[_depositor].epoch = currentEpochCached;\n+ depositSnapshotCached.P = currentP;\n+ depositSnapshotCached.G = currentG;\n+ depositSnapshotCached.scale = currentScaleCached;\n+ depositSnapshotCached.epoch = currentEpochCached;\n \n // Record new snapshots of the latest running sum S for all collaterals for the depositor\n for (uint i = 0; i < collaterals.length; i++) {\n ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-ondo", "title": "tsvetanovv G", "severity_raw": "Medium", "severity": "medium", "description": "## [GAS-01] STATE VARIABLES ONLY SET IN THE CONSTRUCTOR SHOULD BE DECLARED IMMUTABLE. \nIt allows setting contract-level variables at construction time which gets stored in code rather than storage.\n```\nJumpRateModelV2.sol\n24: address public owner;\n\ncErc20ModifiedDelegator.sol\n218: ddress payable public admin;\n```\n***\n\n## [GAS-02] ABI.ENCODE() IS LESS EFFICIENT THAN ABI.ENCODEPACKED()\nUse abi.encodePacked() where possible to save gas.\n\n```\nKYCRegistry.sol:\n93: bytes32 structHash = keccak256(\n abi.encode(_APPROVAL_TYPEHASH, kycRequirementGroup, user, deadline)\n```\n***\n\n## [GAS-03] Require() or revert() statements that check input arguments should be at the top of the function\n```\nCErc20.sol:\nfunction sweepToken(EIP20NonStandardInterface token) external override {\n require(\n msg.sender == admin,\n \"cErc20::sweepToken: only admin can sweep tokens\"\n );\n require(\n address(token) != underlying,\n \"cErc20::sweepToken: can not sweep underlying token\"\n );\n uint256 balance = token.balanceOf(address(this));\n token.transfer(admin, balance);\n }\n```\n***\n\n## [GAS-04] USE NAMED RETURNS FOR LOCAL VARIABLES WHERE IT IS POSSIBLE\n```\nOndoPriceOracleV2.sol:\n92: function getUnderlyingPrice(\n address fToken\n ) external view override returns (uint256) {\n uint256 price;\n\nCTokenCash.sol:\n771: ) internal returns (uint) {\n```\n***\n\n## [GAS-05] UNCHECKING ARITHMETICS OPERATIONS THAT CAN\u2019T UNDERFLOW/OVERFLOW\nSolidity version 0.8+ comes with implicit overflow and underflow checks on unsigned integers. When an overflow or an underflow isn\u2019t possible (as an example, when a comparison is made before the arithmetic operation), some gas can be saved by using an unchecked block.\n\n```\nCashFactory.sol:\n127: for (uint256 i = 0; i < exCallData.length; ++i) {\n\nCashKYCSenderFactory.sol:\n137: for (uint256 i = 0; i < exCallData.length; ++i) {\n\nCashKYCSenderReceiverFactory.sol:\n137: for (uint256 i = 0; i < exCallData.length; ++i) {\n\nKYCRegistry.sol:\n163: for (uint", "vulnerable_code": "JumpRateModelV2.sol\n24: address public owner;\n\ncErc20ModifiedDelegator.sol\n218: ddress payable public admin;", "fixed_code": "KYCRegistry.sol:\n93: bytes32 structHash = keccak256(\n abi.encode(_APPROVAL_TYPEHASH, kycRequirementGroup, user, deadline)", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/tsvetanovv-G.md", "collected_at": "2026-01-02T18:15:37.179705+00:00", "source_hash": "95544284380cf10de85473df2b46a01018b6ba3d8a93cd05427012845897c4f0", "code_block_count": 4, "solidity_block_count": 0, "total_code_chars": 820, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "JumpRateModelV2.sol\n24: address public owner;\n\ncErc20ModifiedDelegator.sol\n218: ddress payable public admin;", "primary_code_language": "unknown", "primary_code_char_count": 108, "all_code_blocks": "// Code block 1 (unknown):\nJumpRateModelV2.sol\n24: address public owner;\n\ncErc20ModifiedDelegator.sol\n218: ddress payable public admin;\n\n// Code block 2 (unknown):\nKYCRegistry.sol:\n93: bytes32 structHash = keccak256(\n abi.encode(_APPROVAL_TYPEHASH, kycRequirementGroup, user, deadline)\n\n// Code block 3 (unknown):\nCErc20.sol:\nfunction sweepToken(EIP20NonStandardInterface token) external override {\n require(\n msg.sender == admin,\n \"cErc20::sweepToken: only admin can sweep tokens\"\n );\n require(\n address(token) != underlying,\n \"cErc20::sweepToken: can not sweep underlying token\"\n );\n uint256 balance = token.balanceOf(address(this));\n token.transfer(admin, balance);\n }\n\n// Code block 4 (unknown):\nOndoPriceOracleV2.sol:\n92: function getUnderlyingPrice(\n address fToken\n ) external view override returns (uint256) {\n uint256 price;\n\nCTokenCash.sol:\n771: ) internal returns (uint) {", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "JumpRateModelV2.sol\n24: address public owner;\n\ncErc20ModifiedDelegator.sol\n218: ddress payable public admin;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "KYCRegistry.sol:\n93: bytes32 structHash = keccak256(\n abi.encode(_APPROVAL_TYPEHASH, kycRequirementGroup, user, deadline)", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "08-dopex", "title": "Jorgect Q", "severity_raw": "Low", "severity": "low", "description": "# LOW REPORT\n\n## [L-01] The slippageTolerance is no used in UniV2LiquidityAmo.sol contract \n\nThe slippageTolerance variable is declared in the contract, even have a function to modify it but is never used in the uniswap releted function, the related uniswap functions has his own input value where the admin set the slippage :\n\n```\n uint256 public slippageTolerance = 5e5; // 0.5%\n \n...\nfile: contracts/amo/UniV2LiquidityAmo.sol\nfunction setSlippageTolerance(\n uint256 _slippageTolerance\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n require(\n _slippageTolerance > 0,\n \"reLPContract: slippage tolerance must be greater than 0\"\n );\n slippageTolerance = _slippageTolerance;\n }\n```\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/amo/UniV2LiquidityAmo.sol#L109C3-L117C4\n\n### Recomendation\n\nUse the slippageTolerance in case that admin set 0 slippage input in the uniswap releted function.\n\n## [L-02] Set a deadline not too far from the present in addLiquidity function in UniV3LiquidityAmo.sol contract\n\nCheck the addLiquidity function:\n```\n function addLiquidity(\n AddLiquidityParams memory params\n ) public onlyRole(DEFAULT_ADMIN_ROLE) {\n ...\n INonfungiblePositionManager.MintParams\n memory mintParams = INonfungiblePositionManager.MintParams(\n params._tokenA,\n params._tokenB,\n params._fee,\n params._tickLower,\n params._tickUpper,\n params._amount0Desired,\n params._amount1Desired,\n params._amount0Min,\n params._amount1Min,\n address(this),\n type(uint256).max\n );\n...\n}\n```\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/amo/UniV3LiquidityAmo.sol#L155C1-L211C4\n\nThe contract is setting a deadline so far from the future so the transaction can be included in a worst moment\n\n### Recomendation\n\nUse a deadline no too far from the future like the other uniswapv3 releted functi", "vulnerable_code": " uint256 public slippageTolerance = 5e5; // 0.5%\n \n...\nfile: contracts/amo/UniV2LiquidityAmo.sol\nfunction setSlippageTolerance(\n uint256 _slippageTolerance\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n require(\n _slippageTolerance > 0,\n \"reLPContract: slippage tolerance must be greater than 0\"\n );\n slippageTolerance = _slippageTolerance;\n }", "fixed_code": " function addLiquidity(\n AddLiquidityParams memory params\n ) public onlyRole(DEFAULT_ADMIN_ROLE) {\n ...\n INonfungiblePositionManager.MintParams\n memory mintParams = INonfungiblePositionManager.MintParams(\n params._tokenA,\n params._tokenB,\n params._fee,\n params._tickLower,\n params._tickUpper,\n params._amount0Desired,\n params._amount1Desired,\n params._amount0Min,\n params._amount1Min,\n address(this),\n type(uint256).max\n );\n...\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/Jorgect-Q.md", "collected_at": "2026-01-02T18:24:44.806294+00:00", "source_hash": "95dc326c4c0b36d0b65e5740eb8a285fa3c52db2a5506a55cfe0117d08fb22fa", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 892, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "uint256 public slippageTolerance = 5e5; // 0.5%\n \n...\nfile: contracts/amo/UniV2LiquidityAmo.sol\nfunction setSlippageTolerance(\n uint256 _slippageTolerance\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n require(\n _slippageTolerance > 0,\n \"reLPContract: slippage tolerance must be greater than 0\"\n );\n slippageTolerance = _slippageTolerance;\n }", "primary_code_language": "unknown", "primary_code_char_count": 363, "all_code_blocks": "// Code block 1 (unknown):\nuint256 public slippageTolerance = 5e5; // 0.5%\n \n...\nfile: contracts/amo/UniV2LiquidityAmo.sol\nfunction setSlippageTolerance(\n uint256 _slippageTolerance\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n require(\n _slippageTolerance > 0,\n \"reLPContract: slippage tolerance must be greater than 0\"\n );\n slippageTolerance = _slippageTolerance;\n }\n\n// Code block 2 (unknown):\nfunction addLiquidity(\n AddLiquidityParams memory params\n ) public onlyRole(DEFAULT_ADMIN_ROLE) {\n ...\n INonfungiblePositionManager.MintParams\n memory mintParams = INonfungiblePositionManager.MintParams(\n params._tokenA,\n params._tokenB,\n params._fee,\n params._tickLower,\n params._tickUpper,\n params._amount0Desired,\n params._amount1Desired,\n params._amount0Min,\n params._amount1Min,\n address(this),\n type(uint256).max\n );\n...\n}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "UniV2LiquidityAmo.sol#L109-L3, UniV3LiquidityAmo.sol#L155-L1", "github_files_list": "UniV2LiquidityAmo.sol, UniV3LiquidityAmo.sol", "github_refs_count": 2, "vulnerable_code_actual": " uint256 public slippageTolerance = 5e5; // 0.5%\n \n...\nfile: contracts/amo/UniV2LiquidityAmo.sol\nfunction setSlippageTolerance(\n uint256 _slippageTolerance\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n require(\n _slippageTolerance > 0,\n \"reLPContract: slippage tolerance must be greater than 0\"\n );\n slippageTolerance = _slippageTolerance;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function addLiquidity(\n AddLiquidityParams memory params\n ) public onlyRole(DEFAULT_ADMIN_ROLE) {\n ...\n INonfungiblePositionManager.MintParams\n memory mintParams = INonfungiblePositionManager.MintParams(\n params._tokenA,\n params._tokenB,\n params._fee,\n params._tickLower,\n params._tickUpper,\n params._amount0Desired,\n params._amount1Desired,\n params._amount0Min,\n params._amount1Min,\n address(this),\n type(uint256).max\n );\n...\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "10-badger", "title": "codeslide Q", "severity_raw": "Critical", "severity": "critical", "description": "## Summary\n\n### Low Risk Issues\nThere are 80 instances over 14 issues.\n| ID | Description | Count |\n| :-----------: | :-------------------------------------------------------------------------------------- | ----: |\n| [L-01](#l-01) | Burn functions should be protected with access control | 2 |\n| [L-02](#l-02) | Casting of `block.timestamp` can reduce the lifespan of a contract | 1 |\n| [L-03](#l-03) | Empty `receive()`/`fallback()` function | 1 |\n| [L-04](#l-04) | Execution at deadlines should be allowed | 7 |\n| [L-05](#l-05) | Functions calling contracts/addresses with transfer hooks are missing reentrancy guards | 5 |\n| [L-06](#l-06) | Loss of precision | 19 |\n| [L-07](#l-07) | Missing checks for `address(0x0)` when updating `address` state variables | 6 |\n| [L-08](#l-08) | Missing zero address check in constructor/initializer | 17 |\n| [L-09](#l-09) | Numbers downcast to `address`es may result in collisions | 5 |\n| [L-10](#l-10) | `payable` function does not transfer Eth | 3 |\n| [L-11](#l-11) | Potential division by zero | 9 |\n| [L-12](#l-12) | `receive()`/`payable fallback()` function does not authorize requests | 1 |\n| [L-13](#l-13) | Unsafe downcast | 3 |\n| [L-14](#l-14) | Use of `assert()` | 1 |\n\n### PoolUtils.DUST, \"The amount of tokenA to add is too small\" );\nrequire( maxAmountB > PoolUtils.DUST, \"The amount of tokenB to add is too small\" );\n\n\n(bytes32 poolID, bool flipped) = PoolUtils._poolIDAndFlipped(tokenA, tokenB);\n\n\n// Flip the users arguments if they are not in reserve token order with address(tokenA) < address(tokenB)\nif ( flipped )\n (addedAmountB, addedAmountA, addedLiquidity) = _addLiquidity( poolID, maxAmountB, maxAmountA, totalLiquidity );\nelse\n (addedAmountA, addedAmountB, addedLiquidity) = _addLiquidity( poolID, maxAmountA, maxAmountB, totalLiquidity );\n\n\n// Make sure the minimum liquidity has been added\nrequire( addedLiquidity >= minLiquidityReceiv", "vulnerable_code": "function addLiquidity( IERC20 tokenA, IERC20 tokenB, uint256 maxAmountA, uint256 maxAmountB, uint256 minLiquidityReceived, uint256 totalLiquidity ) external nonReentrant returns (uint256 addedAmountA, uint256 addedAmountB, uint256 addedLiquidity)\n{\nrequire( msg.sender == address(collateralAndLiquidity), \"Pools.addLiquidity is only callable from the CollateralAndLiquidity contract\" );\nrequire( exchangeIsLive, \"The exchange is not yet live\" );\nrequire( address(tokenA) != address(tokenB), \"Cannot add liquidity for duplicate tokens\" );\n\n\nrequire( maxAmountA > PoolUtils.DUST, \"The amount of tokenA to add is too small\" );\nrequire( maxAmountB > PoolUtils.DUST, \"The amount of tokenB to add is too small\" );\n\n\n(bytes32 poolID, bool flipped) = PoolUtils._poolIDAndFlipped(tokenA, tokenB);\n\n\n// Flip the users arguments if they are not in reserve token order with address(tokenA) < address(tokenB)\nif ( flipped )\n (addedAmountB, addedAmountA, addedLiquidity) = _addLiquidity( poolID, maxAmountB, maxAmountA, totalLiquidity );\nelse\n (addedAmountA, addedAmountB, addedLiquidity) = _addLiquidity( poolID, maxAmountA, maxAmountB, totalLiquidity );\n\n\n// Make sure the minimum liquidity has been added\nrequire( addedLiquidity >= minLiquidityReceived, \"Too little liquidity received\" );\n\n\n// Transfer the tokens from the sender - only tokens without fees should be whitelisted on the DEX\ntokenA.safeTransferFrom(msg.sender, address(this), addedAmountA );\ntokenB.safeTransferFrom(msg.sender, address(this), addedAmountB );\n\n\nemit LiquidityAdded(tokenA, tokenB, addedAmountA, addedAmountB, addedLiquidity);\n}", "fixed_code": "10 function calls * 200 gas per read = 2,000 gas spent", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/LinKenji-Q.md", "collected_at": "2026-01-02T19:01:25.082564+00:00", "source_hash": "966119c0a2226b2f7b4fe3e2aa9303f9406fb7cb3add898fd7aaf876437fef3c", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Pools.sol, Proposals.sol, Pools.sol#L140-L165", "github_files_list": "Proposals.sol, Pools.sol", "github_refs_count": 3, "vulnerable_code_actual": "function addLiquidity( IERC20 tokenA, IERC20 tokenB, uint256 maxAmountA, uint256 maxAmountB, uint256 minLiquidityReceived, uint256 totalLiquidity ) external nonReentrant returns (uint256 addedAmountA, uint256 addedAmountB, uint256 addedLiquidity)\n{\nrequire( msg.sender == address(collateralAndLiquidity), \"Pools.addLiquidity is only callable from the CollateralAndLiquidity contract\" );\nrequire( exchangeIsLive, \"The exchange is not yet live\" );\nrequire( address(tokenA) != address(tokenB), \"Cannot add liquidity for duplicate tokens\" );\n\n\nrequire( maxAmountA > PoolUtils.DUST, \"The amount of tokenA to add is too small\" );\nrequire( maxAmountB > PoolUtils.DUST, \"The amount of tokenB to add is too small\" );\n\n\n(bytes32 poolID, bool flipped) = PoolUtils._poolIDAndFlipped(tokenA, tokenB);\n\n\n// Flip the users arguments if they are not in reserve token order with address(tokenA) < address(tokenB)\nif ( flipped )\n (addedAmountB, addedAmountA, addedLiquidity) = _addLiquidity( poolID, maxAmountB, maxAmountA, totalLiquidity );\nelse\n (addedAmountA, addedAmountB, addedLiquidity) = _addLiquidity( poolID, maxAmountA, maxAmountB, totalLiquidity );\n\n\n// Make sure the minimum liquidity has been added\nrequire( addedLiquidity >= minLiquidityReceived, \"Too little liquidity received\" );\n\n\n// Transfer the tokens from the sender - only tokens without fees should be whitelisted on the DEX\ntokenA.safeTransferFrom(msg.sender, address(this), addedAmountA );\ntokenB.safeTransferFrom(msg.sender, address(this), addedAmountB );\n\n\nemit LiquidityAdded(tokenA, tokenB, addedAmountA, addedAmountB, addedLiquidity);\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "10 function calls * 200 gas per read = 2,000 gas spent", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-biconomy", "title": "Awesome G", "severity_raw": "Low", "severity": "low", "description": "\n# 1. Save gas with `payable` functions\n\nMarking functions as `payable` will be cheaper (by ~20 gas) than using non-`payable` functions because the Solidity compiler inserts a check into non-`payable` functions that requires `msg.value` to be zero.\n\nFor instance, the code at [SmartAccount.sol#L449](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L449) can be refactored as:\n\n```solidity\nLine 449: function transfer(address payable dest, uint amount) external payable nonReentrant onlyOwner {\n```\n\n> **Note**: Although this optimization can save gas, it is important to be aware of the security considerations involving Ether held in contracts that it introduces.\n> More information on this topic can be found in the [Solidity Compiler Discussion](https://github.com/ethereum/solidity/issues/12539).\n\nAffected line of code:\n\n- [SmartAccount.sol#L449](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L449)\n\n# 2. Splitting `require()` Statements That Use `&&` Saves Gas - (Saves ~`3` Gas per `&&`)\n\nInstead of using the `&&` operator in a single require statement to check multiple conditions, using various require statements with 1 condition per require statement will save ~3 GAS per `&&`.\n\nAffected line of code:\n\n- [ModuleManager.sol#L34](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/base/ModuleManager.sol#L34)\n- [ModuleManager.sol#L49](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/base/ModuleManager.sol#L49)\n- [ModuleManager.sol#L68](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/base/ModuleManager.sol#L68)\n\n# 3. An internal function that can reduce to 1 line can ", "vulnerable_code": "Line 449: function transfer(address payable dest, uint amount) external payable nonReentrant onlyOwner {", "fixed_code": "contracts/smart-contract-wallet/SmartAccount.sol\nLine 461: _requireFromEntryPointOrOwner();\nLine 466: _requireFromEntryPointOrOwner();\n\nLine 494: function _requireFromEntryPointOrOwner() internal view {\nLine 495: require(msg.sender == address(entryPoint()) || msg.sender == owner, \"account: not Owner or EntryPoint\");\nLine 496: }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/Awesome-G.md", "collected_at": "2026-01-02T18:12:54.002995+00:00", "source_hash": "967d219825820d43fe02551993ce1caf820c9ebc6d29b88e494d619b997073b1", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 107, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "Line 449: function transfer(address payable dest, uint amount) external payable nonReentrant onlyOwner {", "primary_code_language": "solidity", "primary_code_char_count": 107, "all_code_blocks": "// Code block 1 (solidity):\nLine 449: function transfer(address payable dest, uint amount) external payable nonReentrant onlyOwner {", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "Line 449: function transfer(address payable dest, uint amount) external payable nonReentrant onlyOwner {", "github_refs_formatted": "SmartAccount.sol#L449, ModuleManager.sol#L34, ModuleManager.sol#L49, ModuleManager.sol#L68", "github_files_list": "ModuleManager.sol, SmartAccount.sol", "github_refs_count": 4, "vulnerable_code_actual": "Line 449: function transfer(address payable dest, uint amount) external payable nonReentrant onlyOwner {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "contracts/smart-contract-wallet/SmartAccount.sol\nLine 461: _requireFromEntryPointOrOwner();\nLine 466: _requireFromEntryPointOrOwner();\n\nLine 494: function _requireFromEntryPointOrOwner() internal view {\nLine 495: require(msg.sender == address(entryPoint()) || msg.sender == owner, \"account: not Owner or EntryPoint\");\nLine 496: }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-salty", "title": "Infect3d Q", "severity_raw": "High", "severity": "high", "description": "# [L-01] - It is possible to call `borrowUSDS` with a very low amount\n\n## Vulnerability details\nNothing prevents a user to borrow a very low amount of USDS (for example 1 wei)\nThe issue is that everytime a user borrow some USDS, an element is added to `_walletsWithBorrowedUSDS`\n\n```soldiity\n function borrowUSDS( uint256 amountBorrowed ) external nonReentrant\n\t\t{\n\t\trequire( exchangeConfig.walletHasAccess(msg.sender), \"Sender does not have exchange access\" );\n\t\trequire( userShareForPool( msg.sender, collateralPoolID ) > 0, \"User does not have any collateral\" );\n\t\trequire( amountBorrowed <= maxBorrowableUSDS(msg.sender), \"Excessive amountBorrowed\" );\n\n\t\t// Increase the borrowed amount for the user\n\t\tusdsBorrowedByUsers[msg.sender] += amountBorrowed;\n\n\t\t// Remember that the user has borrowed USDS (so they can later be checked for sufficient collateralization ratios and liquidated if necessary)\n\t\t_walletsWithBorrowedUSDS.add(msg.sender);\n\n\t\t// Mint USDS and send it to the user\n\t\tusds.mintTo( msg.sender, amountBorrowed );\n\n\t\temit BorrowedUSDS(msg.sender, amountBorrowed);\n\t\t}\n```\n\nThis can cause an issue for liquidator who want to find liquidable users, as to high value `numberOfUsersWithBorrowedUSDS` will make the gas cost of the loop to high, possibly causing a revert\n\n```solidity\nFile: src\\stable\\CollateralAndLiquidity.sol\n345: \tfunction findLiquidatableUsers() external view returns (address[] memory)\n346: \t\t{\n347: \t\tif ( numberOfUsersWithBorrowedUSDS() == 0 )\n348: \t\t\treturn new address[](0);\n349: \n350: \t\treturn findLiquidatableUsers( 0, numberOfUsersWithBorrowedUSDS() - 1 );\n351: \t\t}\n352: \t}\n```\n\n\n```solidity\nFile: src\\stable\\CollateralAndLiquidity.sol311: \tfunction findLiquidatableUsers( uint256 startIndex, uint256 endIndex ) public view returns (address[] memory) //..?@audit compare with canUserBeLiquidated\n312: \t\t{\n313: \t\taddress[] memory liquidatableUsers = new address[](endIndex - startIndex + 1);\n314: \t\tuint256 count = 0;\n315: \n316: \t\t// Cache\n317: \t\tuint256 t", "vulnerable_code": "This can cause an issue for liquidator who want to find liquidable users, as to high value `numberOfUsersWithBorrowedUSDS` will make the gas cost of the loop to high, possibly causing a revert\n", "fixed_code": "```solidity\nFile: src\\stable\\CollateralAndLiquidity.sol311: \tfunction findLiquidatableUsers( uint256 startIndex, uint256 endIndex ) public view returns (address[] memory) //..?@audit compare with canUserBeLiquidated\n312: \t\t{\n313: \t\taddress[] memory liquidatableUsers = new address[](endIndex - startIndex + 1);\n314: \t\tuint256 count = 0;\n315: \n316: \t\t// Cache\n317: \t\tuint256 totalCollateralShares = totalShares[collateralPoolID];\n318: \t\tuint256 totalCollateralValue = totalCollateralValueInUSD();\n319: \n320: \t\tif ( totalCollateralValue != 0 )\n321: \t\t\tfor ( uint256 i = startIndex; i <= endIndex; i++ )", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/Infect3d-Q.md", "collected_at": "2026-01-02T19:01:19.241173+00:00", "source_hash": "9682d83f8ad17fd1c242c3d345d6b3fe5395ec34d83980957a01e3304531c225", "code_block_count": 2, "solidity_block_count": 1, "total_code_chars": 1110, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function borrowUSDS( uint256 amountBorrowed ) external nonReentrant\n\t\t{\n\t\trequire( exchangeConfig.walletHasAccess(msg.sender), \"Sender does not have exchange access\" );\n\t\trequire( userShareForPool( msg.sender, collateralPoolID ) > 0, \"User does not have any collateral\" );\n\t\trequire( amountBorrowed <= maxBorrowableUSDS(msg.sender), \"Excessive amountBorrowed\" );\n\n\t\t// Increase the borrowed amount for the user\n\t\tusdsBorrowedByUsers[msg.sender] += amountBorrowed;\n\n\t\t// Remember that the user has borrowed USDS (so they can later be checked for sufficient collateralization ratios and liquidated if necessary)\n\t\t_walletsWithBorrowedUSDS.add(msg.sender);\n\n\t\t// Mint USDS and send it to the user\n\t\tusds.mintTo( msg.sender, amountBorrowed );\n\n\t\temit BorrowedUSDS(msg.sender, amountBorrowed);\n\t\t}", "primary_code_language": "soldiity", "primary_code_char_count": 792, "all_code_blocks": "// Code block 1 (soldiity):\nfunction borrowUSDS( uint256 amountBorrowed ) external nonReentrant\n\t\t{\n\t\trequire( exchangeConfig.walletHasAccess(msg.sender), \"Sender does not have exchange access\" );\n\t\trequire( userShareForPool( msg.sender, collateralPoolID ) > 0, \"User does not have any collateral\" );\n\t\trequire( amountBorrowed <= maxBorrowableUSDS(msg.sender), \"Excessive amountBorrowed\" );\n\n\t\t// Increase the borrowed amount for the user\n\t\tusdsBorrowedByUsers[msg.sender] += amountBorrowed;\n\n\t\t// Remember that the user has borrowed USDS (so they can later be checked for sufficient collateralization ratios and liquidated if necessary)\n\t\t_walletsWithBorrowedUSDS.add(msg.sender);\n\n\t\t// Mint USDS and send it to the user\n\t\tusds.mintTo( msg.sender, amountBorrowed );\n\n\t\temit BorrowedUSDS(msg.sender, amountBorrowed);\n\t\t}\n\n// Code block 2 (solidity):\nFile: src\\stable\\CollateralAndLiquidity.sol\n345: \tfunction findLiquidatableUsers() external view returns (address[] memory)\n346: \t\t{\n347: \t\tif ( numberOfUsersWithBorrowedUSDS() == 0 )\n348: \t\t\treturn new address[](0);\n349: \n350: \t\treturn findLiquidatableUsers( 0, numberOfUsersWithBorrowedUSDS() - 1 );\n351: \t\t}\n352: \t}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: src\\stable\\CollateralAndLiquidity.sol\n345: \tfunction findLiquidatableUsers() external view returns (address[] memory)\n346: \t\t{\n347: \t\tif ( numberOfUsersWithBorrowedUSDS() == 0 )\n348: \t\t\treturn new address[](0);\n349: \n350: \t\treturn findLiquidatableUsers( 0, numberOfUsersWithBorrowedUSDS() - 1 );\n351: \t\t}\n352: \t}", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "This can cause an issue for liquidator who want to find liquidable users, as to high value `numberOfUsersWithBorrowedUSDS` will make the gas cost of the loop to high, possibly causing a revert\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "```solidity\nFile: src\\stable\\CollateralAndLiquidity.sol311: \tfunction findLiquidatableUsers( uint256 startIndex, uint256 endIndex ) public view returns (address[] memory) //..?@audit compare with canUserBeLiquidated\n312: \t\t{\n313: \t\taddress[] memory liquidatableUsers = new address[](endIndex - startIndex + 1);\n314: \t\tuint256 count = 0;\n315: \n316: \t\t// Cache\n317: \t\tuint256 totalCollateralShares = totalShares[collateralPoolID];\n318: \t\tuint256 totalCollateralValue = totalCollateralValueInUSD();\n319: \n320: \t\tif ( totalCollateralValue != 0 )\n321: \t\t\tfor ( uint256 i = startIndex; i <= endIndex; i++ )", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ethos", "title": "kodyvim G", "severity_raw": "Critical", "severity": "critical", "description": "# Gas Optimization and QA report\n\n## Use require to save gas\nReplace `assert` with `require` to return unused gas on failure.\ninstances:\n```\nEthos-Core/contracts/BorrowerOperations.sol#L128 assert(MIN_NET_DEBT > 0)\nEthos-Core/contracts/BorrowerOperations.sol#L197 assert(vars.compositeDebt > 0);\nEthos-Core/contracts/BorrowerOperations.sol#L301 assert(msg.sender == _borrower || (msg.sender == stabilityPoolAddress && _collTopUp > 0 && _LUSDChange == 0))\nEthos-Core/contracts/BorrowerOperations.sol#L331 assert(_collWithdrawal <= vars.coll);\nEthos-Core/contracts/TroveManager.sol#L417 assert(_LUSDInStabPool != 0)\nEthos-Core/contracts/TroveManager.sol#L1224 assert(totalStakesSnapshot[_collateral] > 0);\nEthos-Core/contracts/TroveManager.sol#L1279 assert(closedStatus != Status.nonExistent && closedStatus != Status.active);\nEthos-Core/contracts/TroveManager.sol#L1342 assert(troveStatus != Status.nonExistent && troveStatus != Status.active);\nEthos-Core/contracts/TroveManager.sol#L1348 assert(index <= idxLast);\nEthos-Core/contracts/TroveManager.sol#L1414 assert(newBaseRate > 0);\nEthos-Core/contracts/TroveManager.sol#L1489 assert(decayedBaseRate <= DECIMAL_PRECISION)\nEthos-Core/contracts/StabilityPool.sol#L526 assert(_debtToOffset <= _totalLUSDDeposits);\nEthos-Core/contracts/StabilityPool.sol#L551 assert(_LUSDLossPerUnitStaked <= DECIMAL_PRECISION);\nEthos-Core/contracts/StabilityPool.sol#L591 assert(newP > 0);\nEthos-Core/contracts/LUSDToken.sol#L312 assert(sender != address(0));\nEthos-Core/contracts/LUSDToken.sol#L313 assert(recipient != address(0));\nEthos-Core/contracts/LUSDToken.sol#L321 assert(account != address(0));\nEthos-Core/contracts/LUSDToken.sol#L329 assert(account != address(0))\nEthos-Core/contracts/LUSDToken.sol#L337 assert(owner != address(0))\nEthos-Core/contracts/LUSDToken.sol#L338 assert(spender != address(0));\n\n```\n\n## Place validation of function parameters at the start of the function\nThis way gas to process the function body would be preserved on ", "vulnerable_code": "Ethos-Core/contracts/BorrowerOperations.sol#L128 assert(MIN_NET_DEBT > 0)\nEthos-Core/contracts/BorrowerOperations.sol#L197 assert(vars.compositeDebt > 0);\nEthos-Core/contracts/BorrowerOperations.sol#L301 assert(msg.sender == _borrower || (msg.sender == stabilityPoolAddress && _collTopUp > 0 && _LUSDChange == 0))\nEthos-Core/contracts/BorrowerOperations.sol#L331 assert(_collWithdrawal <= vars.coll);\nEthos-Core/contracts/TroveManager.sol#L417 assert(_LUSDInStabPool != 0)\nEthos-Core/contracts/TroveManager.sol#L1224 assert(totalStakesSnapshot[_collateral] > 0);\nEthos-Core/contracts/TroveManager.sol#L1279 assert(closedStatus != Status.nonExistent && closedStatus != Status.active);\nEthos-Core/contracts/TroveManager.sol#L1342 assert(troveStatus != Status.nonExistent && troveStatus != Status.active);\nEthos-Core/contracts/TroveManager.sol#L1348 assert(index <= idxLast);\nEthos-Core/contracts/TroveManager.sol#L1414 assert(newBaseRate > 0);\nEthos-Core/contracts/TroveManager.sol#L1489 assert(decayedBaseRate <= DECIMAL_PRECISION)\nEthos-Core/contracts/StabilityPool.sol#L526 assert(_debtToOffset <= _totalLUSDDeposits);\nEthos-Core/contracts/StabilityPool.sol#L551 assert(_LUSDLossPerUnitStaked <= DECIMAL_PRECISION);\nEthos-Core/contracts/StabilityPool.sol#L591 assert(newP > 0);\nEthos-Core/contracts/LUSDToken.sol#L312 assert(sender != address(0));\nEthos-Core/contracts/LUSDToken.sol#L313 assert(recipient != address(0));\nEthos-Core/contracts/LUSDToken.sol#L321 assert(account != address(0));\nEthos-Core/contracts/LUSDToken.sol#L329 assert(account != address(0))\nEthos-Core/contracts/LUSDToken.sol#L337 assert(owner != address(0))\nEthos-Core/contracts/LUSDToken.sol#L338 assert(spender != address(0));\n", "fixed_code": "Ethos-Core/contracts/BorrowerOperations.sol#301 assert(msg.sender == _borrower || (msg.sender == stabilityPoolAddress && _collTopUp > 0 && _LUSDChange == 0))", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/kodyvim-G.md", "collected_at": "2026-01-02T18:17:20.830008+00:00", "source_hash": "96c47452cf9e03d67083ae07a065e75d595c7db4dc73743ea9b790a13621f17a", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 1716, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "Ethos-Core/contracts/BorrowerOperations.sol#L128 assert(MIN_NET_DEBT > 0)\nEthos-Core/contracts/BorrowerOperations.sol#L197 assert(vars.compositeDebt > 0);\nEthos-Core/contracts/BorrowerOperations.sol#L301 assert(msg.sender == _borrower || (msg.sender == stabilityPoolAddress && _collTopUp > 0 && _LUSDChange == 0))\nEthos-Core/contracts/BorrowerOperations.sol#L331 assert(_collWithdrawal <= vars.coll);\nEthos-Core/contracts/TroveManager.sol#L417 assert(_LUSDInStabPool != 0)\nEthos-Core/contracts/TroveManager.sol#L1224 assert(totalStakesSnapshot[_collateral] > 0);\nEthos-Core/contracts/TroveManager.sol#L1279 assert(closedStatus != Status.nonExistent && closedStatus != Status.active);\nEthos-Core/contracts/TroveManager.sol#L1342 assert(troveStatus != Status.nonExistent && troveStatus != Status.active);\nEthos-Core/contracts/TroveManager.sol#L1348 assert(index <= idxLast);\nEthos-Core/contracts/TroveManager.sol#L1414 assert(newBaseRate > 0);\nEthos-Core/contracts/TroveManager.sol#L1489 assert(decayedBaseRate <= DECIMAL_PRECISION)\nEthos-Core/contracts/StabilityPool.sol#L526 assert(_debtToOffset <= _totalLUSDDeposits);\nEthos-Core/contracts/StabilityPool.sol#L551 assert(_LUSDLossPerUnitStaked <= DECIMAL_PRECISION);\nEthos-Core/contracts/StabilityPool.sol#L591 assert(newP > 0);\nEthos-Core/contracts/LUSDToken.sol#L312 assert(sender != address(0));\nEthos-Core/contracts/LUSDToken.sol#L313 assert(recipient != address(0));\nEthos-Core/contracts/LUSDToken.sol#L321 assert(account != address(0));\nEthos-Core/contracts/LUSDToken.sol#L329 assert(account != address(0))\nEthos-Core/contracts/LUSDToken.sol#L337 assert(owner != address(0))\nEthos-Core/contracts/LUSDToken.sol#L338 assert(spender != address(0));", "primary_code_language": "unknown", "primary_code_char_count": 1716, "all_code_blocks": "// Code block 1 (unknown):\nEthos-Core/contracts/BorrowerOperations.sol#L128 assert(MIN_NET_DEBT > 0)\nEthos-Core/contracts/BorrowerOperations.sol#L197 assert(vars.compositeDebt > 0);\nEthos-Core/contracts/BorrowerOperations.sol#L301 assert(msg.sender == _borrower || (msg.sender == stabilityPoolAddress && _collTopUp > 0 && _LUSDChange == 0))\nEthos-Core/contracts/BorrowerOperations.sol#L331 assert(_collWithdrawal <= vars.coll);\nEthos-Core/contracts/TroveManager.sol#L417 assert(_LUSDInStabPool != 0)\nEthos-Core/contracts/TroveManager.sol#L1224 assert(totalStakesSnapshot[_collateral] > 0);\nEthos-Core/contracts/TroveManager.sol#L1279 assert(closedStatus != Status.nonExistent && closedStatus != Status.active);\nEthos-Core/contracts/TroveManager.sol#L1342 assert(troveStatus != Status.nonExistent && troveStatus != Status.active);\nEthos-Core/contracts/TroveManager.sol#L1348 assert(index <= idxLast);\nEthos-Core/contracts/TroveManager.sol#L1414 assert(newBaseRate > 0);\nEthos-Core/contracts/TroveManager.sol#L1489 assert(decayedBaseRate <= DECIMAL_PRECISION)\nEthos-Core/contracts/StabilityPool.sol#L526 assert(_debtToOffset <= _totalLUSDDeposits);\nEthos-Core/contracts/StabilityPool.sol#L551 assert(_LUSDLossPerUnitStaked <= DECIMAL_PRECISION);\nEthos-Core/contracts/StabilityPool.sol#L591 assert(newP > 0);\nEthos-Core/contracts/LUSDToken.sol#L312 assert(sender != address(0));\nEthos-Core/contracts/LUSDToken.sol#L313 assert(recipient != address(0));\nEthos-Core/contracts/LUSDToken.sol#L321 assert(account != address(0));\nEthos-Core/contracts/LUSDToken.sol#L329 assert(account != address(0))\nEthos-Core/contracts/LUSDToken.sol#L337 assert(owner != address(0))\nEthos-Core/contracts/LUSDToken.sol#L338 assert(spender != address(0));", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "Ethos-Core/contracts/BorrowerOperations.sol#L128 assert(MIN_NET_DEBT > 0)\nEthos-Core/contracts/BorrowerOperations.sol#L197 assert(vars.compositeDebt > 0);\nEthos-Core/contracts/BorrowerOperations.sol#L301 assert(msg.sender == _borrower || (msg.sender == stabilityPoolAddress && _collTopUp > 0 && _LUSDChange == 0))\nEthos-Core/contracts/BorrowerOperations.sol#L331 assert(_collWithdrawal <= vars.coll);\nEthos-Core/contracts/TroveManager.sol#L417 assert(_LUSDInStabPool != 0)\nEthos-Core/contracts/TroveManager.sol#L1224 assert(totalStakesSnapshot[_collateral] > 0);\nEthos-Core/contracts/TroveManager.sol#L1279 assert(closedStatus != Status.nonExistent && closedStatus != Status.active);\nEthos-Core/contracts/TroveManager.sol#L1342 assert(troveStatus != Status.nonExistent && troveStatus != Status.active);\nEthos-Core/contracts/TroveManager.sol#L1348 assert(index <= idxLast);\nEthos-Core/contracts/TroveManager.sol#L1414 assert(newBaseRate > 0);\nEthos-Core/contracts/TroveManager.sol#L1489 assert(decayedBaseRate <= DECIMAL_PRECISION)\nEthos-Core/contracts/StabilityPool.sol#L526 assert(_debtToOffset <= _totalLUSDDeposits);\nEthos-Core/contracts/StabilityPool.sol#L551 assert(_LUSDLossPerUnitStaked <= DECIMAL_PRECISION);\nEthos-Core/contracts/StabilityPool.sol#L591 assert(newP > 0);\nEthos-Core/contracts/LUSDToken.sol#L312 assert(sender != address(0));\nEthos-Core/contracts/LUSDToken.sol#L313 assert(recipient != address(0));\nEthos-Core/contracts/LUSDToken.sol#L321 assert(account != address(0));\nEthos-Core/contracts/LUSDToken.sol#L329 assert(account != address(0))\nEthos-Core/contracts/LUSDToken.sol#L337 assert(owner != address(0))\nEthos-Core/contracts/LUSDToken.sol#L338 assert(spender != address(0));\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "Ethos-Core/contracts/BorrowerOperations.sol#301 assert(msg.sender == _borrower || (msg.sender == stabilityPoolAddress && _collTopUp > 0 && _LUSDChange == 0))", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-biconomy", "title": "apostle0x01 G", "severity_raw": "Gas", "severity": "gas", "description": "## [G-01] Splitting require() statements that use && saves gas\n\n### IMPACT\n\nRequire statements including conditions with the && operator can be broken down in\nmultiple require statements to save gas.\n\n### POC \n\n\n```\ncontracts/smart-contract-wallet/base/ModuleManager.sol:34: require(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");\ncontracts/smart-contract-wallet/base/ModuleManager.sol:49: require(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");\ncontracts/smart-contract-wallet/base/ModuleManager.sol:68: require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \"BSA104\");\n```\n\n### MITIGATION\n\nBreakdown each condition in a separate require\n```console\nrequire(module != address(0),\"BSA101\");\nrequire(module != SENTINEL_MODULES, \"BSA101\");)\n``` \n", "vulnerable_code": "contracts/smart-contract-wallet/base/ModuleManager.sol:34: require(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");\ncontracts/smart-contract-wallet/base/ModuleManager.sol:49: require(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");\ncontracts/smart-contract-wallet/base/ModuleManager.sol:68: require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \"BSA104\");", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/apostle0x01-G.md", "collected_at": "2026-01-02T18:13:29.690932+00:00", "source_hash": "96c5dda7a1f5a89c7cc47fdee9744c1e258da41be2d53f44de6e04b622e04e24", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 514, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "contracts/smart-contract-wallet/base/ModuleManager.sol:34: require(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");\ncontracts/smart-contract-wallet/base/ModuleManager.sol:49: require(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");\ncontracts/smart-contract-wallet/base/ModuleManager.sol:68: require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \"BSA104\");", "primary_code_language": "unknown", "primary_code_char_count": 427, "all_code_blocks": "// Code block 1 (unknown):\ncontracts/smart-contract-wallet/base/ModuleManager.sol:34: require(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");\ncontracts/smart-contract-wallet/base/ModuleManager.sol:49: require(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");\ncontracts/smart-contract-wallet/base/ModuleManager.sol:68: require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \"BSA104\");\n\n// Code block 2 (console):\nrequire(module != address(0),\"BSA101\");\nrequire(module != SENTINEL_MODULES, \"BSA101\");)", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "contracts/smart-contract-wallet/base/ModuleManager.sol:34: require(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");\ncontracts/smart-contract-wallet/base/ModuleManager.sol:49: require(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");\ncontracts/smart-contract-wallet/base/ModuleManager.sol:68: require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \"BSA104\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.63} {"source": "c4", "protocol": "01-biconomy", "title": "2997ms G", "severity_raw": "Gas", "severity": "gas", "description": "## Gas Optimazition Summary\n\n### Issues\n\n| | Issue | Contexts |\n| ----- | :--------------------------------------- | :------: |\n| GAS-1 | Revert directly if the length of returndata is 0 | 3 |\n| GAS-2 | += costs more gas than = + for state variables | 2 |\n|GAS-3| require()/revert() strings longer than 32 bytes cost extra gas | 3 | \n\n\n\n\n### [GAS-01]Revert directly if the length of returndata is 0\n\nThere is no need to do the calculation of ```add``` and ```mload``` if the length of returndata is 0.\n\n**Proof Of Concept**\n\n\n\n```\n if (!success) {\n assembly {\n revert(add(result, 32), mload(result))\n }\n }\n```\n\n\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol#L469\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L479\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/samples/SimpleAccount.sol#L119\n\n**Recommended Mitigation Steps**\n\nAdd in this way.\n\n```\nif (returndata.length == 0) {\n\trevert();\n}\nassembly {\n\trevert(add(32, returndata), mload(returndata))\n}\n```\n\n\n### [GAS-02] += costs more gas than = + for state variables \nUsing the addition operator instead of plus-equals saves gas\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/libs/Math.sol#L148\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/libs/Math.sol#L261-L286\n\n\n\n### [G-03] REQUIRE()/REVERT() STRINGS LONGER THAN 32 BYTES COST EXTRA GAS\nEach extra memory word of bytes past the original 32 incurs an MSTORE which costs 3 gas.\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-c", "vulnerable_code": " if (!success) {\n assembly {\n revert(add(result, 32), mload(result))\n }\n }", "fixed_code": "if (returndata.length == 0) {\n\trevert();\n}\nassembly {\n\trevert(add(32, returndata), mload(returndata))\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/2997ms-G.md", "collected_at": "2026-01-02T18:12:52.220424+00:00", "source_hash": "96cf896318520e325999413e2782399bab19550cec1ea7f33a8450b45d0f98fc", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 220, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "if (!success) {\n assembly {\n revert(add(result, 32), mload(result))\n }\n }", "primary_code_language": "unknown", "primary_code_char_count": 117, "all_code_blocks": "// Code block 1 (unknown):\nif (!success) {\n assembly {\n revert(add(result, 32), mload(result))\n }\n }\n\n// Code block 2 (unknown):\nif (returndata.length == 0) {\n\trevert();\n}\nassembly {\n\trevert(add(32, returndata), mload(returndata))\n}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SmartAccountNoAuth.sol#L469, SmartAccount.sol#L479, SimpleAccount.sol#L119, Math.sol#L148, Math.sol#L261-L286", "github_files_list": "Math.sol, SmartAccount.sol, SimpleAccount.sol, SmartAccountNoAuth.sol", "github_refs_count": 5, "vulnerable_code_actual": " if (!success) {\n assembly {\n revert(add(result, 32), mload(result))\n }\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "if (returndata.length == 0) {\n\trevert();\n}\nassembly {\n\trevert(add(32, returndata), mload(returndata))\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "05-ajna", "title": "Kose Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA Report\n\n## Summary\n\n| | Issue | Risk | Instances |\n| :-------------: |:-------------|:-------------:|:-------------:|\n| 1 | If/validation statements should be on the top of the function | NC | 1 |\n| 2 | Immutables should be uppercase to distinguish from regular variables | NC | 3 |\n\n## Findings\n\n### 1- If/validation statements should be on the top of the function :\n\n#### Risk : Non-critical\n\n#### Proof of Concept\n\nIssue occurs in the code below :\n\nFile: PositionManager.sol [Line 227-233] (https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/PositionManager.sol#LL227-L233)\n```\nfunction mint(\n MintParams calldata params_\n ) external override nonReentrant returns (uint256 tokenId_) {\n tokenId_ = _nextId++;\n\n // revert if the address is not a valid Ajna pool\n if (!_isAjnaPool(params_.pool, params_.poolSubsetHash)) revert NotAjnaPool();\n```\n\n### 2- Immutables should be uppercase to distinguish from regular variables :\n\n#### Risk : Non-critical\n\n#### Proof of Concept\n\nIssue occurs in these code below :\n\nFile: PositionManager.sol [Line 68-71] (https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/PositionManager.sol#L68-L71)\n```\n /// @dev The `ERC20` pools factory contract, used to check if address is an `Ajna` pool.\n ERC20PoolFactory private immutable erc20PoolFactory;\n /// @dev The `ERC721` pools factory contract, used to check if address is an `Ajna` pool.\n ERC721PoolFactory private immutable erc721PoolFactory;\n```\n\nFile : RewardsManager.sol [Line 86-89] (https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/RewardsManager.sol#L86-L89)\n```\n /// @dev Address of the `Ajna` token.\n address public immutable ajnaToken;\n /// @dev The `PositionManager` contract\n IPositionManager public immutable positionManager;\n```\n\nFile : Funding.sol [Line 20-21] (https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/Funding.sol#L20-L21", "vulnerable_code": "function mint(\n MintParams calldata params_\n ) external override nonReentrant returns (uint256 tokenId_) {\n tokenId_ = _nextId++;\n\n // revert if the address is not a valid Ajna pool\n if (!_isAjnaPool(params_.pool, params_.poolSubsetHash)) revert NotAjnaPool();", "fixed_code": " /// @dev The `ERC20` pools factory contract, used to check if address is an `Ajna` pool.\n ERC20PoolFactory private immutable erc20PoolFactory;\n /// @dev The `ERC721` pools factory contract, used to check if address is an `Ajna` pool.\n ERC721PoolFactory private immutable erc721PoolFactory;", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/Kose-Q.md", "collected_at": "2026-01-02T18:21:04.177429+00:00", "source_hash": "97089db5e7478441978fee6bc034f69622323d63e8e2c6da94b8637310e82b9d", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 766, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function mint(\n MintParams calldata params_\n ) external override nonReentrant returns (uint256 tokenId_) {\n tokenId_ = _nextId++;\n\n // revert if the address is not a valid Ajna pool\n if (!_isAjnaPool(params_.pool, params_.poolSubsetHash)) revert NotAjnaPool();", "primary_code_language": "unknown", "primary_code_char_count": 291, "all_code_blocks": "// Code block 1 (unknown):\nfunction mint(\n MintParams calldata params_\n ) external override nonReentrant returns (uint256 tokenId_) {\n tokenId_ = _nextId++;\n\n // revert if the address is not a valid Ajna pool\n if (!_isAjnaPool(params_.pool, params_.poolSubsetHash)) revert NotAjnaPool();\n\n// Code block 2 (unknown):\n/// @dev The `ERC20` pools factory contract, used to check if address is an `Ajna` pool.\n ERC20PoolFactory private immutable erc20PoolFactory;\n /// @dev The `ERC721` pools factory contract, used to check if address is an `Ajna` pool.\n ERC721PoolFactory private immutable erc721PoolFactory;\n\n// Code block 3 (unknown):\n/// @dev Address of the `Ajna` token.\n address public immutable ajnaToken;\n /// @dev The `PositionManager` contract\n IPositionManager public immutable positionManager;", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "PositionManager.sol, PositionManager.sol#L68-L71, RewardsManager.sol#L86-L89, Funding.sol#L20-L21", "github_files_list": "RewardsManager.sol, Funding.sol, PositionManager.sol", "github_refs_count": 4, "vulnerable_code_actual": "function mint(\n MintParams calldata params_\n ) external override nonReentrant returns (uint256 tokenId_) {\n tokenId_ = _nextId++;\n\n // revert if the address is not a valid Ajna pool\n if (!_isAjnaPool(params_.pool, params_.poolSubsetHash)) revert NotAjnaPool();", "has_vulnerable_code_snippet": true, "fixed_code_actual": " /// @dev The `ERC20` pools factory contract, used to check if address is an `Ajna` pool.\n ERC20PoolFactory private immutable erc20PoolFactory;\n /// @dev The `ERC721` pools factory contract, used to check if address is an `Ajna` pool.\n ERC721PoolFactory private immutable erc721PoolFactory;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "06-lybra", "title": "j4ld1na G", "severity_raw": "Gas", "severity": "gas", "description": "| | Issues | Instances |\n| :--- | :-------------------------------------- | --------: |\n| G-01 | Remove `SafeMath` library. | 1 |\n| G-02 | Use assembly to check for `address(0)`. | 6 |\n\n## G-01 - Remove `SafeMath` library.\n\n_Gas saved: 2.1k for each tx that uses `SafeMath` + 100 units per call._\n\n_It seems like safe math doesn\u2019t serve any purpose here and it can simply be replaced with normal math operands. The usage of library is pretty expensive since it makes a delegate call to an external address._\n\nThere an instance:\n\n[contracts/lybra/token/EUSD.sol#5](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/token/EUSD.sol#L5)\n\nRecommended Mitigation Steps:\n\n- Remove `SafeMath` library.\n\n## G-02 - Use assembly to check for `address(0)`.\n\n_Saves 6 gas per instance._\n\nExample:\n\n```ts\nfunction ownerNotZero(address _addr) public pure {\n require(_addr != address(0), \"zero address)\");\n}\n\n// Gas: 258\n```\n\n```ts\nfunction assemblyOwnerNotZero(address _addr) public pure {\n assembly {\n if iszero(_addr) {\n mstore(0x00, \"zero address\")\n revert(0x00, 0x20)\n }\n }\n}\n\n// Gas: 252\n```\n\nThere are 14 instances and [34 future instances](https://gist.github.com/liveactionllama/27513952718ec3cbcf9de0fda7fef49c#l01-missing-checks-for-address0x0-when-assigning-values-to-address-state-variables):\n\n- [contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L83](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L83)\n\n```ts\nrequire(onBehalfOf != address(0), 'TZA');\n```\n\n- [contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L97](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L97)\n\n```ts\nrequire(onBehalfOf != address(0), 'TZA');\n```\n\n- [contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L111](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts", "vulnerable_code": "```ts\nfunction assemblyOwnerNotZero(address _addr) public pure {\n assembly {\n if iszero(_addr) {\n mstore(0x00, \"zero address\")\n revert(0x00, 0x20)\n }\n }\n}\n\n// Gas: 252", "fixed_code": "- [contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L97](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L97)\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/j4ld1na-G.md", "collected_at": "2026-01-02T18:23:01.978614+00:00", "source_hash": "97253983e8199a7364059a9c5347e186e02954406a981e8cc41687c25f55d62e", "code_block_count": 4, "solidity_block_count": 0, "total_code_chars": 401, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function ownerNotZero(address _addr) public pure {\n require(_addr != address(0), \"zero address)\");\n}\n\n// Gas: 258", "primary_code_language": "ts", "primary_code_char_count": 116, "all_code_blocks": "// Code block 1 (ts):\nfunction ownerNotZero(address _addr) public pure {\n require(_addr != address(0), \"zero address)\");\n}\n\n// Gas: 258\n\n// Code block 2 (ts):\nfunction assemblyOwnerNotZero(address _addr) public pure {\n assembly {\n if iszero(_addr) {\n mstore(0x00, \"zero address\")\n revert(0x00, 0x20)\n }\n }\n}\n\n// Gas: 252\n\n// Code block 3 (ts):\nrequire(onBehalfOf != address(0), 'TZA');\n\n// Code block 4 (ts):\nrequire(onBehalfOf != address(0), 'TZA');", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "EUSD.sol#L5, LybraPeUSDVaultBase.sol#L83, LybraPeUSDVaultBase.sol#L97", "github_files_list": "LybraPeUSDVaultBase.sol, EUSD.sol", "github_refs_count": 3, "vulnerable_code_actual": "```ts\nfunction assemblyOwnerNotZero(address _addr) public pure {\n assembly {\n if iszero(_addr) {\n mstore(0x00, \"zero address\")\n revert(0x00, 0x20)\n }\n }\n}\n\n// Gas: 252", "has_vulnerable_code_snippet": true, "fixed_code_actual": "- [contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L97](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L97)\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "08-dopex", "title": "MohammedRizwan Q", "severity_raw": "Medium", "severity": "medium", "description": "## Summary\n\n### Low Risk Issues\n|Number|Issue|Instances| |\n|-|:-|:-:|:-:|\n| [L‑01] | openzeppelin's `setupRole()` is deprecated | 7 |\n| [L‑02] | set max limit of `slippageTolerance` in `setSlippageTolerance()` | 2 |\n| [L‑03] | Calls inside loops that may address DoS | 1 |\n| [L‑04] | Admin may not receive usdc/usdt if blacklisted in case of emergency | 1 |\n| [L‑05] | Insufficient validations in `setAddresses()` can cause both `tokenA` and `tokenB` same | 2 |\n| [L‑06] | `emergencyWithdraw()` functionality should be added in `UniV3LiquidityAmo.sol` like other contracts | 1 |\n| [L‑07] | `TickMath.sol` might revert in solidity version 0.8.19 as used in contracts | 1 |\n| [L‑08] | Update solc version and use unchecked in Uniswap related libraries like `LiquidityAmounts.sol` | 1 |\n| [L‑09] | Solmate safeTransferLib.sol functions does not check the codesize of the token address, which may lead to fund loss | 1 |\n| [L‑10] | An issue with `TransferHelper.sol` which is extensively used in `UniV3LiquidityAmo.sol` | 1 |\n| [L‑11] | Do not hard code the contract address, pass as constructor argument in `UniV3LiquidityAmo.sol` | 1 |\n| [L‑12] | In `RdpxDecayingBonds.sol`, `mint()` does not verify that the bond `expiry` has passed/expired | 1 |\n| [L‑13] | In `DpxEthToken.sol`, `mint()`, `burn()` and `burnFrom()` should only be called when the contract is not paused | 3 |\n| [L‑14] | `addToContractWhitelist()` does not check the contract code existence before whitelisting | 1 |\n| [L‑15] | In `RdpxV2Bond.sol`, `mint()` should be called when the contract is not paused | 1 |\n| [L‑16] | Misleading Natspec on `getLpPrice()` in `UniV2LiquidityAmo.sol` | 1 |\n| [L‑17] | `deadline` should be passed as an argument instead of hardcoding it | contracts |\n\n### [L‑01] openzeppelin's `setupRole()` is deprecated\nContracts has used `_setupRole()` in functions for setting the rol", "vulnerable_code": "File: contracts/amo/UniV2LiquidityAmo.sol\n\n function emergencyWithdraw(\n address[] calldata tokens\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n IERC20WithBurn token;\n\n for (uint256 i = 0; i < tokens.length; i++) {\n token = IERC20WithBurn(tokens[i]);\n>> token.safeTransfer(msg.sender, token.balanceOf(address(this)));\n }\n\n emit LogEmergencyWithdraw(msg.sender, tokens);", "fixed_code": "File: contracts/amo/UniV2LiquidityAmo.sol\n\n function emergencyWithdraw(\n address[] calldata tokens\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n IERC20WithBurn token;\n\n for (uint256 i = 0; i < tokens.length; i++) {\n token = IERC20WithBurn(tokens[i]);\n token.safeTransfer(msg.sender, token.balanceOf(address(this)));\n }\n\n emit LogEmergencyWithdraw(msg.sender, tokens);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/MohammedRizwan-Q.md", "collected_at": "2026-01-02T18:24:55.114899+00:00", "source_hash": "97c1843287049e47742f272e00e0992681ead8c1b19b6c51aefff3ac6a996a62", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: contracts/amo/UniV2LiquidityAmo.sol\n\n function emergencyWithdraw(\n address[] calldata tokens\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n IERC20WithBurn token;\n\n for (uint256 i = 0; i < tokens.length; i++) {\n token = IERC20WithBurn(tokens[i]);\n>> token.safeTransfer(msg.sender, token.balanceOf(address(this)));\n }\n\n emit LogEmergencyWithdraw(msg.sender, tokens);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/amo/UniV2LiquidityAmo.sol\n\n function emergencyWithdraw(\n address[] calldata tokens\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n IERC20WithBurn token;\n\n for (uint256 i = 0; i < tokens.length; i++) {\n token = IERC20WithBurn(tokens[i]);\n token.safeTransfer(msg.sender, token.balanceOf(address(this)));\n }\n\n emit LogEmergencyWithdraw(msg.sender, tokens);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-ondo", "title": "descharre G", "severity_raw": "Low", "severity": "low", "description": "## Summary\n|ID | Finding| Gas saved| Instances |\n|:----: | :--- | :----: | :----: |\n|1 |Make for loops unchecked| 414 | 1 |\n| 2 |Save storage variable to memory when it's used more than once in a function | 296| 3 |\n| 3 |Don't write old value to memory | 500| 25 |\n| 4 |Function getBlockNumber is useless | 30| 2 |\n| 5 |Don't emit 2 similar events in 1 function | 1289| 2 |\n| 7 |Miscellaneous| 4000| 2 |\n\n## Details\n## 1 Make for loops unchecked\nThe risk of for loops getting overflowed is extremely low. Because it always increments by 1. Even if the arrays are extremely long, it will take a massive amount of time and gas to let the for loop overflow.\n\n[KYCRegistry.sol#L163-L165](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistry.sol#L163-L165)\n\naddKycAdresses function avg gas saved: 414\n\nThe more addresses you want to add, the more gas you will save with this gas optimization\n```diff\nL163\n+ uint256 i;\n-\tfor (uint256 i = 0; i < length; i++) {\n+ for (; i < lenght; ){ \n\t\tkycState[kycRequirementGroup][addresses[i]] = true;\n+\tunchecked {\n+\t\ti++;\n+\t\t}\t\t\n\t}\n```\nIt can also be done on every other for loop in the project. The larger the array the more gas you will save.\n\n## 2 Save storage variable to memory when it's used more than once in a function\nWhen a storage variable is read for the second time from storage it costs 100 gas. When it's read from memory it only costs 3 gas.\n[CashManager.sol#L241-L269](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L241-L269)\n\nclaimMint function avg gas saved: 130\n```diff\n function claimMint(\n address user,\n uint256 epochToClaim\n ) external override updateEpoch nonReentrant whenNotPaused checkKYC(user) {\n+ uint256 epochToExchangeRateMemory = epochToExchangeRate[epochToClaim]; \n uint256 collateralDeposited = mintRequestsPerEpoch[epochToClaim][user];\n if (collateralDeposited == 0) {\n ", "vulnerable_code": "It can also be done on every other for loop in the project. The larger the array the more gas you will save.\n\n## 2 Save storage variable to memory when it's used more than once in a function\nWhen a storage variable is read for the second time from storage it costs 100 gas. When it's read from memory it only costs 3 gas.\n[CashManager.sol#L241-L269](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L241-L269)\n\nclaimMint function avg gas saved: 130", "fixed_code": "[CashManager.sol#L576-L587](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L576-L587)\n\ntransitionEpoch function avg gas saved: 89", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/descharre-G.md", "collected_at": "2026-01-02T18:15:05.460581+00:00", "source_hash": "97c1b39cd68b3b60bb972a68ebb7b0c39c988bff2314cebcd1145abc79b56985", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 173, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "L163\n+ uint256 i;\n-\tfor (uint256 i = 0; i < length; i++) {\n+ for (; i < lenght; ){ \n\t\tkycState[kycRequirementGroup][addresses[i]] = true;\n+\tunchecked {\n+\t\ti++;\n+\t\t}\t\t\n\t}", "primary_code_language": "diff", "primary_code_char_count": 173, "all_code_blocks": "// Code block 1 (diff):\nL163\n+ uint256 i;\n-\tfor (uint256 i = 0; i < length; i++) {\n+ for (; i < lenght; ){ \n\t\tkycState[kycRequirementGroup][addresses[i]] = true;\n+\tunchecked {\n+\t\ti++;\n+\t\t}\t\t\n\t}", "all_code_blocks_count": 1, "has_diff_blocks": true, "diff_code": "L163\n+ uint256 i;\n-\tfor (uint256 i = 0; i < length; i++) {\n+ for (; i < lenght; ){ \n\t\tkycState[kycRequirementGroup][addresses[i]] = true;\n+\tunchecked {\n+\t\ti++;\n+\t\t}\t\t\n\t}", "solidity_code": "", "github_refs_formatted": "KYCRegistry.sol#L163-L165, CashManager.sol#L241-L269, CashManager.sol#L576-L587", "github_files_list": "CashManager.sol, KYCRegistry.sol", "github_refs_count": 3, "vulnerable_code_actual": "It can also be done on every other for loop in the project. The larger the array the more gas you will save.\n\n## 2 Save storage variable to memory when it's used more than once in a function\nWhen a storage variable is read for the second time from storage it costs 100 gas. When it's read from memory it only costs 3 gas.\n[CashManager.sol#L241-L269](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L241-L269)\n\nclaimMint function avg gas saved: 130", "has_vulnerable_code_snippet": true, "fixed_code_actual": "[CashManager.sol#L576-L587](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L576-L587)\n\ntransitionEpoch function avg gas saved: 89", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "07-amphora", "title": "eeshenggoh Q", "severity_raw": "High", "severity": "high", "description": "## Summary\n Unsafe ERC20 Operation(s)\n\n## Vulnerability Details\n\nERC20 operations can be unsafe due to different implementations and vulnerabilities in the standard.\n\nIt is therefore recommended to always either use OpenZeppelin's SafeERC20 library or at least to wrap each operation in a require statement.\n\nTo circumvent ERC20's approve functions race-condition vulnerability use OpenZeppelin's SafeERC20 library's safe{Increase|Decrease}Allowance functions.\n\n\n```\nFile: core\\solidity\\contracts\\core\\AMPHClaimer.sol\n128: function recoverDust(address _token, uint256 _amount) external override onlyOwner {\n129: IERC20(_token).transfer(owner(), _amount);\n130: \n131: emit RecoveredDust(_token, owner(), _amount);\n132: }\n```\n```\nFile: core\\solidity\\contracts\\core\\USDA.sol\n101: function _deposit(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n102: if (_susdAmount == 0) revert USDA_ZeroAmount();\n103: sUSD.transferFrom(_msgSender(), address(this), _susdAmount);\n104: _mint(_target, _susdAmount);\n105: // Account for the susd received\n106: reserveAmount += _susdAmount;\n107: \n108: emit Deposit(_target, _susdAmount);\n109: }\n```\n```\nFile: core\\solidity\\contracts\\core\\USDA.sol\n147: function _withdraw(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n148: if (reserveAmount == 0) revert USDA_EmptyReserve();\n149: if (_susdAmount == 0) revert USDA_ZeroAmount();\n150: if (_susdAmount > this.balanceOf(_msgSender())) revert USDA_InsufficientFunds();\n151: // Account for the susd withdrawn\n152: reserveAmount -= _susdAmount;\n153: sUSD.transfer(_target, _susdAmount);\n154: _burn(_msgSender(), _susdAmount);\n155: \n156: emit Withdraw(_target, _susdAmount);\n157: }\n```\n```\nFile: core\\solidity\\contracts\\core\\USDA.sol\n202: function donate(uint256 _susdAmount) external override paysInterest whenNotPaused {\n203: if (_susdAmount == 0) revert USDA_ZeroAmount();\n204: // Acco", "vulnerable_code": "File: core\\solidity\\contracts\\core\\AMPHClaimer.sol\n128: function recoverDust(address _token, uint256 _amount) external override onlyOwner {\n129: IERC20(_token).transfer(owner(), _amount);\n130: \n131: emit RecoveredDust(_token, owner(), _amount);\n132: }", "fixed_code": "File: core\\solidity\\contracts\\core\\USDA.sol\n101: function _deposit(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n102: if (_susdAmount == 0) revert USDA_ZeroAmount();\n103: sUSD.transferFrom(_msgSender(), address(this), _susdAmount);\n104: _mint(_target, _susdAmount);\n105: // Account for the susd received\n106: reserveAmount += _susdAmount;\n107: \n108: emit Deposit(_target, _susdAmount);\n109: }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/eeshenggoh-Q.md", "collected_at": "2026-01-02T18:23:44.376559+00:00", "source_hash": "983465c00c2bc2d074231337b03460c4b42560e3d3965bbafe2767d3a28470b2", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 1298, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: core\\solidity\\contracts\\core\\AMPHClaimer.sol\n128: function recoverDust(address _token, uint256 _amount) external override onlyOwner {\n129: IERC20(_token).transfer(owner(), _amount);\n130: \n131: emit RecoveredDust(_token, owner(), _amount);\n132: }", "primary_code_language": "unknown", "primary_code_char_count": 263, "all_code_blocks": "// Code block 1 (unknown):\nFile: core\\solidity\\contracts\\core\\AMPHClaimer.sol\n128: function recoverDust(address _token, uint256 _amount) external override onlyOwner {\n129: IERC20(_token).transfer(owner(), _amount);\n130: \n131: emit RecoveredDust(_token, owner(), _amount);\n132: }\n\n// Code block 2 (unknown):\nFile: core\\solidity\\contracts\\core\\USDA.sol\n101: function _deposit(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n102: if (_susdAmount == 0) revert USDA_ZeroAmount();\n103: sUSD.transferFrom(_msgSender(), address(this), _susdAmount);\n104: _mint(_target, _susdAmount);\n105: // Account for the susd received\n106: reserveAmount += _susdAmount;\n107: \n108: emit Deposit(_target, _susdAmount);\n109: }\n\n// Code block 3 (unknown):\nFile: core\\solidity\\contracts\\core\\USDA.sol\n147: function _withdraw(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n148: if (reserveAmount == 0) revert USDA_EmptyReserve();\n149: if (_susdAmount == 0) revert USDA_ZeroAmount();\n150: if (_susdAmount > this.balanceOf(_msgSender())) revert USDA_InsufficientFunds();\n151: // Account for the susd withdrawn\n152: reserveAmount -= _susdAmount;\n153: sUSD.transfer(_target, _susdAmount);\n154: _burn(_msgSender(), _susdAmount);\n155: \n156: emit Withdraw(_target, _susdAmount);\n157: }", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: core\\solidity\\contracts\\core\\AMPHClaimer.sol\n128: function recoverDust(address _token, uint256 _amount) external override onlyOwner {\n129: IERC20(_token).transfer(owner(), _amount);\n130: \n131: emit RecoveredDust(_token, owner(), _amount);\n132: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: core\\solidity\\contracts\\core\\USDA.sol\n101: function _deposit(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n102: if (_susdAmount == 0) revert USDA_ZeroAmount();\n103: sUSD.transferFrom(_msgSender(), address(this), _susdAmount);\n104: _mint(_target, _susdAmount);\n105: // Account for the susd received\n106: reserveAmount += _susdAmount;\n107: \n108: emit Deposit(_target, _susdAmount);\n109: }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "02-ethos", "title": "lukris02 Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA Report for Ethos Reserve contest\n## Overview\nDuring the audit, 2 low and 12 non-critical issues were found.\n\n\u2116 | Title | Risk Rating | Instance Count\n--- | --- | --- | ---\nL-1 | Check multisigRoles.length in ReaperVaultV2 | Low | 1\nL-2 | Some events could be more informative | Low | 4\nNC-1 | Order of Functions | Non-Critical | 10\nNC-2 | Order of Layout | Non-Critical | 1\nNC-3 | Missing leading underscores | Non-Critical | 12\nNC-4 | Inconsistency when using uint and uint256 | Non-Critical | 5\nNC-5 | Unused named return variables | Non-Critical | 13\nNC-6 | Inconsistency when using the number 10000 | Non-Critical | 1\nNC-7 | Visibility is not set | Non-Critical | 5\nNC-8 | Wrong modifier order in function declaration | Non-Critical | 2\nNC-9 | Missing NatSpec | Non-Critical | 4\nNC-10 | Incomplete NatSpec | Non-Critical | 1\nNC-11 | No space between the control structures | Non-Critical | 3\nNC-12 | Maximum line length exceeded | Non-Critical | 42\n\n## Low Risk Findings(2)\n### L-1. Check multisigRoles.length in ReaperVaultV2\n##### Description\nFunction [__ReaperBaseStrategy_init](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/abstract/ReaperBaseStrategyv4.sol#L63-L88) checks that ```multisigRoles.length == 3``` before granting roles:\n```\n require(_multisigRoles.length == 3, \"Invalid number of multisig roles\");\n _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);\n _grantRole(DEFAULT_ADMIN_ROLE, _multisigRoles[0]);\n _grantRole(ADMIN, _multisigRoles[1]);\n _grantRole(GUARDIAN, _multisigRoles[2]);\n```\nBut in [ReaperVaultV2 constructor](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L111-L136), there is no such check.\n##### Instances\n- https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L132-L135\n- https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/abstract/ReaperBaseStrategyv4.sol#L81-L85\n\n##### Recommenda", "vulnerable_code": " require(_multisigRoles.length == 3, \"Invalid number of multisig roles\");\n _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);\n _grantRole(DEFAULT_ADMIN_ROLE, _multisigRoles[0]);\n _grantRole(ADMIN, _multisigRoles[1]);\n _grantRole(GUARDIAN, _multisigRoles[2]);", "fixed_code": "require(_multisigRoles.length == 3, \"Invalid number of multisig roles\");", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/lukris02-Q.md", "collected_at": "2026-01-02T18:17:22.159867+00:00", "source_hash": "98783aa077dff90b31a7a21adcfb34dadc32617f97e211db434363448008426b", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 278, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "require(_multisigRoles.length == 3, \"Invalid number of multisig roles\");\n _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);\n _grantRole(DEFAULT_ADMIN_ROLE, _multisigRoles[0]);\n _grantRole(ADMIN, _multisigRoles[1]);\n _grantRole(GUARDIAN, _multisigRoles[2]);", "primary_code_language": "unknown", "primary_code_char_count": 278, "all_code_blocks": "// Code block 1 (unknown):\nrequire(_multisigRoles.length == 3, \"Invalid number of multisig roles\");\n _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);\n _grantRole(DEFAULT_ADMIN_ROLE, _multisigRoles[0]);\n _grantRole(ADMIN, _multisigRoles[1]);\n _grantRole(GUARDIAN, _multisigRoles[2]);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ReaperBaseStrategyv4.sol#L63-L88, ReaperVaultV2.sol#L111-L136, ReaperVaultV2.sol#L132-L135, ReaperBaseStrategyv4.sol#L81-L85", "github_files_list": "ReaperBaseStrategyv4.sol, ReaperVaultV2.sol", "github_refs_count": 4, "vulnerable_code_actual": " require(_multisigRoles.length == 3, \"Invalid number of multisig roles\");\n _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);\n _grantRole(DEFAULT_ADMIN_ROLE, _multisigRoles[0]);\n _grantRole(ADMIN, _multisigRoles[1]);\n _grantRole(GUARDIAN, _multisigRoles[2]);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "require(_multisigRoles.length == 3, \"Invalid number of multisig roles\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-biconomy", "title": "apostle0x01 Q", "severity_raw": "Low", "severity": "low", "description": "## \\[L-01\\] NO TRANSFER OWNERSHIP PATTERN\n\nRecommend considering implementing a two step process where the owner or admin nominates an account and the nominated account needs to call an acceptOwnership() function for the transfer of ownership to fully succeed. This ensures the nominated EOA account is a valid and active account.\n\n\n\n### ./contracts/smart-contract-wallet/SmartAccount.sol : \nhttps://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L109-L114\n```solidity\n109: function setOwner(address _newOwner) external mixedAuth {\n110: require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n111: address oldOwner = owner;\n112: owner = _newOwner;\n113: emit EOAChanged(address(this), oldOwner, _newOwner);\n114: }\n\n```", "vulnerable_code": "109: function setOwner(address _newOwner) external mixedAuth {\n110: require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n111: address oldOwner = owner;\n112: owner = _newOwner;\n113: emit EOAChanged(address(this), oldOwner, _newOwner);\n114: }\n", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/apostle0x01-Q.md", "collected_at": "2026-01-02T18:13:30.131460+00:00", "source_hash": "98c5334484870666f50b3f65961ec4a6963b40b039ef527a27df1c5a20951b20", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 311, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "109: function setOwner(address _newOwner) external mixedAuth {\n110: require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n111: address oldOwner = owner;\n112: owner = _newOwner;\n113: emit EOAChanged(address(this), oldOwner, _newOwner);\n114: }", "primary_code_language": "solidity", "primary_code_char_count": 311, "all_code_blocks": "// Code block 1 (solidity):\n109: function setOwner(address _newOwner) external mixedAuth {\n110: require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n111: address oldOwner = owner;\n112: owner = _newOwner;\n113: emit EOAChanged(address(this), oldOwner, _newOwner);\n114: }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "109: function setOwner(address _newOwner) external mixedAuth {\n110: require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n111: address oldOwner = owner;\n112: owner = _newOwner;\n113: emit EOAChanged(address(this), oldOwner, _newOwner);\n114: }", "github_refs_formatted": "SmartAccount.sol#L109-L114", "github_files_list": "SmartAccount.sol", "github_refs_count": 1, "vulnerable_code_actual": "109: function setOwner(address _newOwner) external mixedAuth {\n110: require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n111: address oldOwner = owner;\n112: owner = _newOwner;\n113: emit EOAChanged(address(this), oldOwner, _newOwner);\n114: }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.77} {"source": "c4", "protocol": "01-ondo", "title": "Diana Q", "severity_raw": "Critical", "severity": "critical", "description": "\n## 01 Require() should be used instead of assert()\n\nAssert should not be used except for tests,\u00a0`require`\u00a0should be used\n\nPrior to Solidity 0.8.0, pressing a confirm consumes the remainder of the process\u2019s available gas instead of returning it, as request()/revert() did.\n\nAssertion() should be avoided even after solidity version 0.8.0, because its documentation states \u201cThe Assert function generates an error of type Panic(uint256). Code that works properly should never Panic, even on invalid external input. If this happens, you need to fix it in your contract. there\u2019s a mistake\u201d.\n\n_There are 3 instances of this issue_\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashFactory.sol\n\n```\nFile: contracts/cash/factory/CashFactory.sol\n\n97: assert(cashProxyAdmin.owner() == guardian);\n```\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashKYCSenderFactory.sol\n\n```\nFile: contracts/cash/factory/CashKYCSenderFactory.sol\n\n106: assert(cashKYCSenderProxyAdmin.owner() == guardian);\n```\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashKYCSenderReceiverFactory.sol\n\n```\nFile: contracts/cash/factory/CashKYCSenderReceiverFactory.sol\n\n106: assert(cashKYCSenderReceiverProxyAdmin.owner() == guardian)\n```\n\n-----\n\n## 02 Upgradeable contract is missing a __gap[50] storage variable to allow for new storage variables in later versions\n\nSee\u00a0[this](https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps)\u00a0link for a description of this storage variable. While some contracts may not currently be sub-classed, adding the variable now protects against forgetting to add it in the future.\n\n_There are 5 instances of this issue_\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/Proxy.sol\n\n```\nFile: contracts/cash/Proxy.sol\n\n20: contract TokenProxy is TransparentUpgradeableProxy {\n25: ) TransparentUpgradeableProxy(_logic, _admin, _data) {}\n```\n\nhttps://github.com/code-423n4/2023-01-o", "vulnerable_code": "File: contracts/cash/factory/CashFactory.sol\n\n97: assert(cashProxyAdmin.owner() == guardian);", "fixed_code": "File: contracts/cash/factory/CashKYCSenderFactory.sol\n\n106: assert(cashKYCSenderProxyAdmin.owner() == guardian);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/Diana-Q.md", "collected_at": "2026-01-02T18:14:35.581481+00:00", "source_hash": "9942b6dd32168a2ae1834a4ff0ff0a73d65acf238a0d26f1262bb9e46e817414", "code_block_count": 4, "solidity_block_count": 0, "total_code_chars": 480, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/cash/factory/CashFactory.sol\n\n97: assert(cashProxyAdmin.owner() == guardian);", "primary_code_language": "unknown", "primary_code_char_count": 93, "all_code_blocks": "// Code block 1 (unknown):\nFile: contracts/cash/factory/CashFactory.sol\n\n97: assert(cashProxyAdmin.owner() == guardian);\n\n// Code block 2 (unknown):\nFile: contracts/cash/factory/CashKYCSenderFactory.sol\n\n106: assert(cashKYCSenderProxyAdmin.owner() == guardian);\n\n// Code block 3 (unknown):\nFile: contracts/cash/factory/CashKYCSenderReceiverFactory.sol\n\n106: assert(cashKYCSenderReceiverProxyAdmin.owner() == guardian)\n\n// Code block 4 (unknown):\nFile: contracts/cash/Proxy.sol\n\n20: contract TokenProxy is TransparentUpgradeableProxy {\n25: ) TransparentUpgradeableProxy(_logic, _admin, _data) {}", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CashFactory.sol, CashKYCSenderFactory.sol, CashKYCSenderReceiverFactory.sol, Proxy.sol", "github_files_list": "CashFactory.sol, CashKYCSenderFactory.sol, Proxy.sol, CashKYCSenderReceiverFactory.sol", "github_refs_count": 4, "vulnerable_code_actual": "File: contracts/cash/factory/CashFactory.sol\n\n97: assert(cashProxyAdmin.owner() == guardian);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/cash/factory/CashKYCSenderFactory.sol\n\n106: assert(cashKYCSenderProxyAdmin.owner() == guardian);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "01-salty", "title": "Tigerfrake G", "severity_raw": "Low", "severity": "low", "description": "# [G-01] Switching between 1 and 2 instead of 0 and 1 (or false and true) is more gas efficient. \n\n### Description:\n`SSTORE` from 0 to 1 (or any non-zero value) costs 20000 gas. `SSTORE` from 1 to 2 (or any other non-zero value) costs 5000 gas.\nBy storing the original value once again, a refund is triggered ( https://eips.ethereum.org/EIPS/eip-2200).\nSince refunds are capped to a percentage of the total transaction\u2019s gas, it is best to keep them low, to increase the likelihood of the full refund coming into effect.\nTherefore, switching between 1, 2 instead of 0, 1 will be more gas efficient.\nSee: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/86bd4d73896afcb35a205456e361436701823c7a/contracts/security/ReentrancyGuard.sol#L29-L33\n\n### Instances:\n- https://github.com/code-423n4/2024-01-salty/blob/main/src%2Fdao%2FDAO.sol#L187\n- https://github.com/code-423n4/2024-01-salty/blob/main/src%2Fdao%2FDAO.sol#L194\n\n# [G-02] Emit local variables instead of state variable. \n(Save ~100 Gas)\n\n### Instance:\n- https://github.com/code-423n4/2024-01-salty/blob/main/src%2FManagedWallet.sol#L42-L55\n\n```Solidity\n function proposeWallets( address _proposedMainWallet, address _proposedConfirmationWallet ) external\n \n //... require statements \n proposedMainWallet = _proposedMainWallet;\n proposedConfirmationWallet = _proposedConfirmationWallet;\n\n emit WalletProposal(proposedMainWallet, proposedConfirmationWallet);\n }\n```\n\n### Description:\nSince we are setting our `state variables` `proposedMainWallet` and `proposedConfirmationWallet` to the function parameter `_proposedMainWallet` and `_proposedConfirmationWallet` respectively, we should `emit the function parameter` as it is cheaper to read compared to the `state variable`:\n\n```Solidity\n emit WalletProposal(proposedMainWallet, proposedConfirmationWallet);\n```\n\n", "vulnerable_code": " function proposeWallets( address _proposedMainWallet, address _proposedConfirmationWallet ) external\n \n //... require statements \n proposedMainWallet = _proposedMainWallet;\n proposedConfirmationWallet = _proposedConfirmationWallet;\n\n emit WalletProposal(proposedMainWallet, proposedConfirmationWallet);\n }", "fixed_code": " emit WalletProposal(proposedMainWallet, proposedConfirmationWallet);", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/Tigerfrake-G.md", "collected_at": "2026-01-02T19:01:30.464144+00:00", "source_hash": "99671bcf12e19542f6111ead6f168caac21d4c682bb6a2263dfe710d6fb8dcd0", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 449, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function proposeWallets( address _proposedMainWallet, address _proposedConfirmationWallet ) external\n \n //... require statements \n proposedMainWallet = _proposedMainWallet;\n proposedConfirmationWallet = _proposedConfirmationWallet;\n\n emit WalletProposal(proposedMainWallet, proposedConfirmationWallet);\n }", "primary_code_language": "Solidity", "primary_code_char_count": 381, "all_code_blocks": "// Code block 1 (Solidity):\nfunction proposeWallets( address _proposedMainWallet, address _proposedConfirmationWallet ) external\n \n //... require statements \n proposedMainWallet = _proposedMainWallet;\n proposedConfirmationWallet = _proposedConfirmationWallet;\n\n emit WalletProposal(proposedMainWallet, proposedConfirmationWallet);\n }\n\n// Code block 2 (Solidity):\nemit WalletProposal(proposedMainWallet, proposedConfirmationWallet);", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function proposeWallets( address _proposedMainWallet, address _proposedConfirmationWallet ) external\n \n //... require statements \n proposedMainWallet = _proposedMainWallet;\n proposedConfirmationWallet = _proposedConfirmationWallet;\n\n emit WalletProposal(proposedMainWallet, proposedConfirmationWallet);\n }\n\nemit WalletProposal(proposedMainWallet, proposedConfirmationWallet);", "github_refs_formatted": "ReentrancyGuard.sol#L29-L33, src%2Fdao%2FDAO.sol#L187, src%2Fdao%2FDAO.sol#L194, src%2FManagedWallet.sol#L42-L55", "github_files_list": "src%2FManagedWallet.sol, src%2Fdao%2FDAO.sol, ReentrancyGuard.sol", "github_refs_count": 4, "vulnerable_code_actual": " function proposeWallets( address _proposedMainWallet, address _proposedConfirmationWallet ) external\n \n //... require statements \n proposedMainWallet = _proposedMainWallet;\n proposedConfirmationWallet = _proposedConfirmationWallet;\n\n emit WalletProposal(proposedMainWallet, proposedConfirmationWallet);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " emit WalletProposal(proposedMainWallet, proposedConfirmationWallet);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "07-amphora", "title": "VIELITE Analysis", "severity_raw": "Unknown", "severity": "unknown", "description": "There are no checks for address(0) in the `_burn()` function in the USDA.sol contract which can lead to unnecessary reverts \n\n```solidity\nfunction _burn(address _target, uint256 _amount) internal {\n uint256 __gonsPerFragment = _gonsPerFragment;\n // modify the gonbalances of the sender, subtracting the amount of gons, therefore amount * gonsperfragment\n _gonBalances[_target] -= (_amount * __gonsPerFragment);\n // modify totalSupply and totalGons\n _totalSupply -= _amount;\n _totalGons -= (_amount * __gonsPerFragment);\n // emit both a burn and transfer event\n emit Transfer(_target, address(0), _amount);\n emit Burn(_target, _amount);\n }\n```\n\ncould be found at `core/solidity/contracts/core/USDA.sol`\n\n### Time spent:\n26 hours", "vulnerable_code": "function _burn(address _target, uint256 _amount) internal {\n uint256 __gonsPerFragment = _gonsPerFragment;\n // modify the gonbalances of the sender, subtracting the amount of gons, therefore amount * gonsperfragment\n _gonBalances[_target] -= (_amount * __gonsPerFragment);\n // modify totalSupply and totalGons\n _totalSupply -= _amount;\n _totalGons -= (_amount * __gonsPerFragment);\n // emit both a burn and transfer event\n emit Transfer(_target, address(0), _amount);\n emit Burn(_target, _amount);\n }", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/VIELITE-Analysis.md", "collected_at": "2026-01-02T18:23:37.659965+00:00", "source_hash": "99ac64a5dae6ff8eb3ab416551a444078af24ef8f02361ffa963048556986ebf", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 528, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function _burn(address _target, uint256 _amount) internal {\n uint256 __gonsPerFragment = _gonsPerFragment;\n // modify the gonbalances of the sender, subtracting the amount of gons, therefore amount * gonsperfragment\n _gonBalances[_target] -= (_amount * __gonsPerFragment);\n // modify totalSupply and totalGons\n _totalSupply -= _amount;\n _totalGons -= (_amount * __gonsPerFragment);\n // emit both a burn and transfer event\n emit Transfer(_target, address(0), _amount);\n emit Burn(_target, _amount);\n }", "primary_code_language": "solidity", "primary_code_char_count": 528, "all_code_blocks": "// Code block 1 (solidity):\nfunction _burn(address _target, uint256 _amount) internal {\n uint256 __gonsPerFragment = _gonsPerFragment;\n // modify the gonbalances of the sender, subtracting the amount of gons, therefore amount * gonsperfragment\n _gonBalances[_target] -= (_amount * __gonsPerFragment);\n // modify totalSupply and totalGons\n _totalSupply -= _amount;\n _totalGons -= (_amount * __gonsPerFragment);\n // emit both a burn and transfer event\n emit Transfer(_target, address(0), _amount);\n emit Burn(_target, _amount);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function _burn(address _target, uint256 _amount) internal {\n uint256 __gonsPerFragment = _gonsPerFragment;\n // modify the gonbalances of the sender, subtracting the amount of gons, therefore amount * gonsperfragment\n _gonBalances[_target] -= (_amount * __gonsPerFragment);\n // modify totalSupply and totalGons\n _totalSupply -= _amount;\n _totalGons -= (_amount * __gonsPerFragment);\n // emit both a burn and transfer event\n emit Transfer(_target, address(0), _amount);\n emit Burn(_target, _amount);\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function _burn(address _target, uint256 _amount) internal {\n uint256 __gonsPerFragment = _gonsPerFragment;\n // modify the gonbalances of the sender, subtracting the amount of gons, therefore amount * gonsperfragment\n _gonBalances[_target] -= (_amount * __gonsPerFragment);\n // modify totalSupply and totalGons\n _totalSupply -= _amount;\n _totalGons -= (_amount * __gonsPerFragment);\n // emit both a burn and transfer event\n emit Transfer(_target, address(0), _amount);\n emit Burn(_target, _amount);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 3.51} {"source": "c4", "protocol": "11-kelp", "title": "0x_Scar Q", "severity_raw": "Low", "severity": "low", "description": "The `NodeDelegator` contract and the `RSETH` contract allows for pausing and unpausing via the `pause ()` and `unpause` function. The contract code on the `pause ()` function reads as `Only callable by LRT config manager. Contract must NOT be paused.` and `unpause ()` reads as `Only callable by the rsETH admin. Contract must be paused` \n\nClearly, the intent of the project is to ensure the `pause ()` function is called only when the contract is NOT paused and vice versa for `unpause ()`. \n\nTo ensure this is the case, the project should consider adding the `whenPaused` and `whenNotPaused` modifier on the two functions as follows:\n\n```\n function pause() external onlyLRTManager whenNotPaused {\n _pause();\n }\n\n /// @notice Returns to normal state.\n /// @dev Only callable by the rsETH admin. Contract must be paused\n function unpause() external onlyRole(DEFAULT_ADMIN_ROLE) whenPaused {\n _unpause();\n }\n```", "vulnerable_code": " function pause() external onlyLRTManager whenNotPaused {\n _pause();\n }\n\n /// @notice Returns to normal state.\n /// @dev Only callable by the rsETH admin. Contract must be paused\n function unpause() external onlyRole(DEFAULT_ADMIN_ROLE) whenPaused {\n _unpause();\n }", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/0x_Scar-Q.md", "collected_at": "2026-01-02T18:27:12.308700+00:00", "source_hash": "99b5394c724f5d104402e58c93a8048d61197e1fa88040463a093e3cd395b6d1", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 293, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function pause() external onlyLRTManager whenNotPaused {\n _pause();\n }\n\n /// @notice Returns to normal state.\n /// @dev Only callable by the rsETH admin. Contract must be paused\n function unpause() external onlyRole(DEFAULT_ADMIN_ROLE) whenPaused {\n _unpause();\n }", "primary_code_language": "unknown", "primary_code_char_count": 293, "all_code_blocks": "// Code block 1 (unknown):\nfunction pause() external onlyLRTManager whenNotPaused {\n _pause();\n }\n\n /// @notice Returns to normal state.\n /// @dev Only callable by the rsETH admin. Contract must be paused\n function unpause() external onlyRole(DEFAULT_ADMIN_ROLE) whenPaused {\n _unpause();\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function pause() external onlyLRTManager whenNotPaused {\n _pause();\n }\n\n /// @notice Returns to normal state.\n /// @dev Only callable by the rsETH admin. Contract must be paused\n function unpause() external onlyRole(DEFAULT_ADMIN_ROLE) whenPaused {\n _unpause();\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 3.88} {"source": "c4", "protocol": "02-ethos", "title": "chaduke Q", "severity_raw": "Low", "severity": "low", "description": "QA1. The ``updateDistributionPeriod()`` function has no range check for the input ``_newDistributionPeriod``. As a result, it might cause an overflow for L112 of function ``fund()``: \n\n[https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/LQTY/CommunityIssuance.sol#L101-L117](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/LQTY/CommunityIssuance.sol#L101-L117)\n\nIn addition, as ``_newDistributionPeriod`` is an important configuration parameter, a timelock should be introduced help a smooth transition. \n\nMitigation: 1) introduce a range check for ``_newDistributionPeriod``; 2) introduce a timelock delay; \n\n\nQA2. ``issueOath()`` and ``fund()`` have a division-followed-by-multiplication rounding error issue, because the ``fund()`` performs a division first to calculate ``rewardPerSecond`` and then ``issueOath()`` uses a multiplication to calculate the amount ``issuance`` to issue. For example, there will be around $871 lost for distributing 1M over the given 14 days period using this division-followed-by-multiplication approach. \n\n[https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/LQTY/CommunityIssuance.sol#L84-L110](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/LQTY/CommunityIssuance.sol#L84-L110)\n\nMitigation: we multiply ``rewardPerSecond`` by WAD and then divide ``issuance`` by WAD afterwards, where WAD = 1e18:\n\n```diff\n function issueOath() external override returns (uint issuance) {\n _requireCallerIsStabilityPool();\n if (lastIssuanceTimestamp < lastDistributionTime) {\n uint256 endTimestamp = block.timestamp > lastDistributionTime ? lastDistributionTime : block.timestamp;\n uint256 timePassed = endTimestamp.sub(lastIssuanceTimestamp);\n- issuance = timePassed.mul(rewardPerSec", "vulnerable_code": "QA3. The ``permit()`` function fails to check v \u2208 {27, 28}, so it might be subject to signature malleability.\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/LUSDToken.sol#L262-L290\n\nMitigation: \nUse Zeppelin's ECDSA: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/ECDSA.sol\n\nQA4. The ``BorrowerOperations`` contract might not work for fees-on-transfer collateral tokens. \n\nFor example, the function ``_moveTokensAndCollateralFromAdjust calls ``safeTransferFrom()`` at L 497 to try to move ``_collchange`` amount of collateral tokens to the ``BorrowerOperations`` contract, however, the contract might receive less amount due to fees-on-transfer, as a result, the next statement that pull ``_collChange``, the same amount, to the ``_activePool`` will fail due to insufficient balance of collateral tokens. \n\n[https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/BorrowerOperations.sol#L476-L502](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/BorrowerOperations.sol#L476-L502)\n\nMitigation: always measure the balance before and after transfer to decide the amount that has been transferred for fees-on-transfer tokens. \n\nQA5: ``_computeNominalCR()`` assumes the debt token has a 18 decimals. Need to make this explicit or adjust the debit tokens to 18 decimals as well. \n\nhttps://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/Dependencies/LiquityMath.sol#L97-L106\n\nQA6. Nothing concrete regarding ``lqtystaking`` is implemented now in ``TroveManager.sol``, so state variable or event can be deleted regarding ``lqtystaking`` or complete the implementation if necessary.", "fixed_code": "QA7. ``updateGovernance()`` and ``updateGuardian()`` use only one step to change address. \n\n[https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/LUSDToken.sol#L146-L158](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/LUSDToken.sol#L146-L158)\n\nChanging adminS in one step is risky: if the new address is a wrong input by mistake, we will lose all the privileges of the owner. \n\nRecommendation: Use OpenZeppelin's Ownable2Step. https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable2Step.sol\n\nQA8. There is no way to revoke a permit of approval. It the approval permit was given to the wrong person or with the wrong amount, a revocation is necessary. \n\nhttps://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/LUSDToken.sol#L262-L290\n\nMitigation: One can revoke a permit by increasing the nonce number. \n\nQA9. ``permit()`` will bypass signature check when ``owner = 0x0``, allowing allowance approval from the zero address and possible other future exploits (such as transfer LUSD from zero address to the attacker's address)\n\nFor example, Bob can call ``permit(address(0), Bob, balanceOf(adress(0)), deadline, v, r, s)`` to get an allowance from zero address with the amount of the LUSD balance of the zero address. \n\n[https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/LUSDToken.sol#L262-L294](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/LUSDToken.sol#L262-L294)\n\nHe will pick a value ``s`` such that it will pass the check", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/chaduke-Q.md", "collected_at": "2026-01-02T18:16:56.221456+00:00", "source_hash": "99bc7570d3b78bb65486ed67d1c69929ffee5cdfcba6e45e3fc909f4993a907a", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 8, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CommunityIssuance.sol#L101-L117, CommunityIssuance.sol#L84-L110, LUSDToken.sol#L262-L290, ECDSA.sol, BorrowerOperations.sol#L476-L502, LiquityMath.sol#L97-L106, LUSDToken.sol#L146-L158, Ownable2Step.sol", "github_files_list": "BorrowerOperations.sol, LUSDToken.sol, Ownable2Step.sol, CommunityIssuance.sol, LiquityMath.sol, ECDSA.sol", "github_refs_count": 8, "vulnerable_code_actual": "QA3. The ``permit()`` function fails to check v \u2208 {27, 28}, so it might be subject to signature malleability.\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/LUSDToken.sol#L262-L290\n\nMitigation: \nUse Zeppelin's ECDSA: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/ECDSA.sol\n\nQA4. The ``BorrowerOperations`` contract might not work for fees-on-transfer collateral tokens. \n\nFor example, the function ``_moveTokensAndCollateralFromAdjust calls ``safeTransferFrom()`` at L 497 to try to move ``_collchange`` amount of collateral tokens to the ``BorrowerOperations`` contract, however, the contract might receive less amount due to fees-on-transfer, as a result, the next statement that pull ``_collChange``, the same amount, to the ``_activePool`` will fail due to insufficient balance of collateral tokens. \n\n[https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/BorrowerOperations.sol#L476-L502](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/BorrowerOperations.sol#L476-L502)\n\nMitigation: always measure the balance before and after transfer to decide the amount that has been transferred for fees-on-transfer tokens. \n\nQA5: ``_computeNominalCR()`` assumes the debt token has a 18 decimals. Need to make this explicit or adjust the debit tokens to 18 decimals as well. \n\nhttps://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/Dependencies/LiquityMath.sol#L97-L106\n\nQA6. Nothing concrete regarding ``lqtystaking`` is implemented now in ``TroveManager.sol``, so state variable or event can be deleted regarding ``lqtystaking`` or complete the implementation if necessary.", "has_vulnerable_code_snippet": true, "fixed_code_actual": "QA7. ``updateGovernance()`` and ``updateGuardian()`` use only one step to change address. \n\n[https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/LUSDToken.sol#L146-L158](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/LUSDToken.sol#L146-L158)\n\nChanging adminS in one step is risky: if the new address is a wrong input by mistake, we will lose all the privileges of the owner. \n\nRecommendation: Use OpenZeppelin's Ownable2Step. https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable2Step.sol\n\nQA8. There is no way to revoke a permit of approval. It the approval permit was given to the wrong person or with the wrong amount, a revocation is necessary. \n\nhttps://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/LUSDToken.sol#L262-L290\n\nMitigation: One can revoke a permit by increasing the nonce number. \n\nQA9. ``permit()`` will bypass signature check when ``owner = 0x0``, allowing allowance approval from the zero address and possible other future exploits (such as transfer LUSD from zero address to the attacker's address)\n\nFor example, Bob can call ``permit(address(0), Bob, balanceOf(adress(0)), deadline, v, r, s)`` to get an allowance from zero address with the amount of the LUSD balance of the zero address. \n\n[https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/LUSDToken.sol#L262-L294](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/LUSDToken.sol#L262-L294)\n\nHe will pick a value ``s`` such that it will pass the check", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "05-ajna", "title": "nadin Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA Report\n\n## Summary\nTotal 04 Low and 06 Non-Critical\n### Low Risk Issues\n- [L-01] EXPIRED PROPOSALS ARE NOT CHECKED\n- [L-02] Consider using OpenZeppelin\u2019s SafeCast library to prevent unexpected overflows when casting from uint256\n- [L-03] Hard coding MAX_EFM_PROPOSAL_LENGTH can lead to a revert in ExtraordinaryFunding.proposExtraordinary()\n- [L-04] The nonReentrant modifier should occur before all other modifiers\n### Non-Critical Issues\n- [N-01] immutable should be UPPERCASE\n- [N-02] According to the syntax rules, use => mapping ( instead of => mapping( using spaces as keyword\n- [N-03] Use SMTChecker\n- [N-04] Assembly Codes Specific \u2013 Should Have Comments\n- [N-05] Take advantage of Custom Error\u2019s return value property\n- [N-06] Use named parameters for mapping type declarations\n\n## [L-01] EXPIRED PROPOSALS ARE NOT CHECKED\n### Description:\nIn the implementation `GrantFund.state`, expired proposals are not check on the state function. Thus expired proposals still can be executed\n### POC\n[GrantFund.state](https://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/GrantFund.sol#L45-L51)\n```\n function state(\n uint256 proposalId_\n ) external view override returns (ProposalState) {\n FundingMechanism mechanism = findMechanismOfProposal(proposalId_);\n\n\n return mechanism == FundingMechanism.Standard ? _standardProposalState(proposalId_) : _getExtraordinaryProposalState(proposalId_);\n }\n```\n[_standardProposalState(proposalId_) ](https://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/StandardFunding.sol#L505-L512)\n``` function _standardProposalState(uint256 proposalId_) internal view returns (ProposalState) {\n Proposal memory proposal = _standardFundingProposals[proposalId_];\n\n\n if (proposal.executed) return ProposalState.Executed;\n else if (_distributions[p", "vulnerable_code": " function state(\n uint256 proposalId_\n ) external view override returns (ProposalState) {\n FundingMechanism mechanism = findMechanismOfProposal(proposalId_);\n\n\n return mechanism == FundingMechanism.Standard ? _standardProposalState(proposalId_) : _getExtraordinaryProposalState(proposalId_);\n }", "fixed_code": "[_getExtraordinaryProposalState(proposalId_)](https://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/ExtraordinaryFunding.sol#L190-L199)", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/nadin-Q.md", "collected_at": "2026-01-02T18:21:37.603745+00:00", "source_hash": "99c937f770e8a5793d8b961e278fe99896c68e8aacb411f4f592f2963ff1288c", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 320, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function state(\n uint256 proposalId_\n ) external view override returns (ProposalState) {\n FundingMechanism mechanism = findMechanismOfProposal(proposalId_);\n\n\n return mechanism == FundingMechanism.Standard ? _standardProposalState(proposalId_) : _getExtraordinaryProposalState(proposalId_);\n }", "primary_code_language": "unknown", "primary_code_char_count": 320, "all_code_blocks": "// Code block 1 (unknown):\nfunction state(\n uint256 proposalId_\n ) external view override returns (ProposalState) {\n FundingMechanism mechanism = findMechanismOfProposal(proposalId_);\n\n\n return mechanism == FundingMechanism.Standard ? _standardProposalState(proposalId_) : _getExtraordinaryProposalState(proposalId_);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "GrantFund.sol#L45-L51, StandardFunding.sol#L505-L512, ExtraordinaryFunding.sol#L190-L199", "github_files_list": "StandardFunding.sol, ExtraordinaryFunding.sol, GrantFund.sol", "github_refs_count": 3, "vulnerable_code_actual": " function state(\n uint256 proposalId_\n ) external view override returns (ProposalState) {\n FundingMechanism mechanism = findMechanismOfProposal(proposalId_);\n\n\n return mechanism == FundingMechanism.Standard ? _standardProposalState(proposalId_) : _getExtraordinaryProposalState(proposalId_);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "[_getExtraordinaryProposalState(proposalId_)](https://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/ExtraordinaryFunding.sol#L190-L199)", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "07-amphora", "title": "wahedtalash77 Q", "severity_raw": "Low", "severity": "low", "description": "# Low Risk Findings\n\n## [L\u201101] Use Ownable2Step rather than Ownable\n`Ownable2Step` and `Ownable2StepUpgradeable` prevent the contract ownership from mistakenly being transferred to an address that cannot handle it (e.g. due to a typo in the address), by requiring that the recipient of the owner permissions actively accept via a contract call of its own.\n```\n23: contract VaultController is Pausable, IVaultController, ExponentialNoError, Ownable {\n```\n\n```\n20: contract UFragments is Ownable, IERC20Metadata {\n`\n```\nhttps://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/utils/UFragments.sol#L20\n\n```\ncontract ChainlinkOracleRelay is OracleRelay, Ownable {\n```\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/periphery/oracles/ChainlinkOracleRelay.sol#L11\n\n```\ncontract CTokenOracle is OracleRelay, Ownable {\n```\nhttps://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/periphery/oracles/CTokenOracle.sol#L10\n\n\n\n## [L-02] Dangerous Solidity compiler pragma range that spans breaking versions\nIn most contracts, the pragma statements are declared as pragma solidity >=0.6.0 <0.8.0;, which are unlocked and could cause the contracts to accidentally be compiled or deployed using an outdated or buggy compiler version.\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/periphery/oracles/UniswapV3OracleRelay.sol#L2C1-L2C1\n\n# Non-Ctitical findings\n## [N\u201101] Use scientific notation rather than exponentiation \nWhile the compiler knows to optimize away the exponentiation, it\u2019s still better coding practice to use idioms that do not require compiler optimization, if they exist.\n`uint256 public constant MAX_wUSDA_SUPPLY = 10_000_000 * (10 ** 18); // 10 M`\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/core/WUSDA.sol#L35C3-L35C78\n\n` ) = _peekLiquidat", "vulnerable_code": "23: contract VaultController is Pausable, IVaultController, ExponentialNoError, Ownable {", "fixed_code": "20: contract UFragments is Ownable, IERC20Metadata {\n`", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/wahedtalash77-Q.md", "collected_at": "2026-01-02T18:24:05.366640+00:00", "source_hash": "99e7e755e38dace2a2e75daf00cfc09e574988068384887fe5b2bab1b86bca67", "code_block_count": 4, "solidity_block_count": 0, "total_code_chars": 245, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "23: contract VaultController is Pausable, IVaultController, ExponentialNoError, Ownable {", "primary_code_language": "unknown", "primary_code_char_count": 89, "all_code_blocks": "// Code block 1 (unknown):\n23: contract VaultController is Pausable, IVaultController, ExponentialNoError, Ownable {\n\n// Code block 2 (unknown):\n20: contract UFragments is Ownable, IERC20Metadata {\n`\n\n// Code block 3 (unknown):\ncontract ChainlinkOracleRelay is OracleRelay, Ownable {\n\n// Code block 4 (unknown):\ncontract CTokenOracle is OracleRelay, Ownable {", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "UFragments.sol#L20, ChainlinkOracleRelay.sol#L11, CTokenOracle.sol#L10, UniswapV3OracleRelay.sol#L2-L1, WUSDA.sol#L35-L3", "github_files_list": "WUSDA.sol, UniswapV3OracleRelay.sol, UFragments.sol, ChainlinkOracleRelay.sol, CTokenOracle.sol", "github_refs_count": 5, "vulnerable_code_actual": "23: contract VaultController is Pausable, IVaultController, ExponentialNoError, Ownable {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "20: contract UFragments is Ownable, IERC20Metadata {\n`", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "10-badger", "title": "nonseodion G", "severity_raw": "Low", "severity": "low", "description": "G-1 `_formatClAggregateAnswer` can be completely replaced to save gas\n\nThe function `_formatClAggregateAnswer` can be completely replaced with:\n\n```\n function _formatClAggregateAnswer(\n int256 _ethBtcAnswer,\n int256 _stEthEthAnswer,\n uint8 _ethBtcDecimals,\n uint8 _stEthEthDecimals\n ) internal view returns (uint256) {\n\n return\n (\n uint256(_ethBtcAnswer) *\n uint256(_stEthEthAnswer) *\n EbtcMath.DECIMAL_PRECISION) / 10 ** (_ethBtcDecimals + _stEthEthDecimals);\n }\n```\n\nThe function above simply scales the price first with `EbtcMath.DECIMAL_PRECISION` and eliminates the decimals of the stEthEth and ethBtc prices with `10 ** (_ethBtcDecimals + _stEthEthDecimals)` leaving the price to have only `EbtcMath.DECIMAL_PRECISION` decimal points.\n\nGas usage of old implementation: 4519\nGas usage of suggested implementation: 3910\n\nG-2 Price Feed decimal calls can be reduced to 2 from 4\nThe Price Feed checks the decimals of the two Chainlink price feeds when it tries to get the current and previous round values from the price feeds. This amount to four calls altogether. \n\n`decimals()` called twice when previous round data is fetched\n\n```\n function _getPrevChainlinkResponse(\n uint80 _currentRoundEthBtcId,\n uint80 _currentRoundStEthEthId\n ) internal view returns (ChainlinkResponse memory prevChainlinkResponse) {\n // If first round, early return\n // Handles revert from underflow in _currentRoundEthBtcId - 1\n // and _currentRoundStEthEthId - 1\n // Behavior should be indentical to following block if this revert was caught\n if (_currentRoundEthBtcId == 0 || _currentRoundStEthEthId == 0) {\n return prevChainlinkResponse;\n }\n\n // Fetch decimals for both feeds:\n uint8 ethBtcDecimals;\n uint8 stEthEthDecimals;\n\n try ETH_BTC_CL_FEED.decimals() returns (uint8 decimals) {\n // If call to Chai", "vulnerable_code": " function _formatClAggregateAnswer(\n int256 _ethBtcAnswer,\n int256 _stEthEthAnswer,\n uint8 _ethBtcDecimals,\n uint8 _stEthEthDecimals\n ) internal view returns (uint256) {\n\n return\n (\n uint256(_ethBtcAnswer) *\n uint256(_stEthEthAnswer) *\n EbtcMath.DECIMAL_PRECISION) / 10 ** (_ethBtcDecimals + _stEthEthDecimals);\n }", "fixed_code": " function _getPrevChainlinkResponse(\n uint80 _currentRoundEthBtcId,\n uint80 _currentRoundStEthEthId\n ) internal view returns (ChainlinkResponse memory prevChainlinkResponse) {\n // If first round, early return\n // Handles revert from underflow in _currentRoundEthBtcId - 1\n // and _currentRoundStEthEthId - 1\n // Behavior should be indentical to following block if this revert was caught\n if (_currentRoundEthBtcId == 0 || _currentRoundStEthEthId == 0) {\n return prevChainlinkResponse;\n }\n\n // Fetch decimals for both feeds:\n uint8 ethBtcDecimals;\n uint8 stEthEthDecimals;\n\n try ETH_BTC_CL_FEED.decimals() returns (uint8 decimals) {\n // If call to Chainlink succeeds, record the current decimal precision\n ethBtcDecimals = decimals;\n } catch {\n // If call to Chainlink aggregator reverts, return a zero response with success = false\n return prevChainlinkResponse;\n }\n\n try STETH_ETH_CL_FEED.decimals() returns (uint8 decimals) {\n // If call to Chainlink succeeds, record the current decimal precision\n stEthEthDecimals = decimals;\n } catch {\n // If call to Chainlink aggregator reverts, return a zero response with success = false\n return prevChainlinkResponse;\n }", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/nonseodion-G.md", "collected_at": "2026-01-02T18:26:57.828661+00:00", "source_hash": "9a0817dbe4cf2133a355cdf4eccf1618354d8da8e093aa784fbf9cd689c9558f", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 410, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _formatClAggregateAnswer(\n int256 _ethBtcAnswer,\n int256 _stEthEthAnswer,\n uint8 _ethBtcDecimals,\n uint8 _stEthEthDecimals\n ) internal view returns (uint256) {\n\n return\n (\n uint256(_ethBtcAnswer) *\n uint256(_stEthEthAnswer) *\n EbtcMath.DECIMAL_PRECISION) / 10 ** (_ethBtcDecimals + _stEthEthDecimals);\n }", "primary_code_language": "unknown", "primary_code_char_count": 410, "all_code_blocks": "// Code block 1 (unknown):\nfunction _formatClAggregateAnswer(\n int256 _ethBtcAnswer,\n int256 _stEthEthAnswer,\n uint8 _ethBtcDecimals,\n uint8 _stEthEthDecimals\n ) internal view returns (uint256) {\n\n return\n (\n uint256(_ethBtcAnswer) *\n uint256(_stEthEthAnswer) *\n EbtcMath.DECIMAL_PRECISION) / 10 ** (_ethBtcDecimals + _stEthEthDecimals);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function _formatClAggregateAnswer(\n int256 _ethBtcAnswer,\n int256 _stEthEthAnswer,\n uint8 _ethBtcDecimals,\n uint8 _stEthEthDecimals\n ) internal view returns (uint256) {\n\n return\n (\n uint256(_ethBtcAnswer) *\n uint256(_stEthEthAnswer) *\n EbtcMath.DECIMAL_PRECISION) / 10 ** (_ethBtcDecimals + _stEthEthDecimals);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function _getPrevChainlinkResponse(\n uint80 _currentRoundEthBtcId,\n uint80 _currentRoundStEthEthId\n ) internal view returns (ChainlinkResponse memory prevChainlinkResponse) {\n // If first round, early return\n // Handles revert from underflow in _currentRoundEthBtcId - 1\n // and _currentRoundStEthEthId - 1\n // Behavior should be indentical to following block if this revert was caught\n if (_currentRoundEthBtcId == 0 || _currentRoundStEthEthId == 0) {\n return prevChainlinkResponse;\n }\n\n // Fetch decimals for both feeds:\n uint8 ethBtcDecimals;\n uint8 stEthEthDecimals;\n\n try ETH_BTC_CL_FEED.decimals() returns (uint8 decimals) {\n // If call to Chainlink succeeds, record the current decimal precision\n ethBtcDecimals = decimals;\n } catch {\n // If call to Chainlink aggregator reverts, return a zero response with success = false\n return prevChainlinkResponse;\n }\n\n try STETH_ETH_CL_FEED.decimals() returns (uint8 decimals) {\n // If call to Chainlink succeeds, record the current decimal precision\n stEthEthDecimals = decimals;\n } catch {\n // If call to Chainlink aggregator reverts, return a zero response with success = false\n return prevChainlinkResponse;\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-salty", "title": "hassanshakeel13 Analysis", "severity_raw": "Critical", "severity": "critical", "description": "### Project Overview:\n\nThe decentralized financial ecosystem under analysis demonstrates a robust and intricate structure designed to facilitate transparent governance, decentralized decision-making, and comprehensive token reward mechanisms. At its core lies the DAO, DAO.sol, governing the entire ecosystem through a series of well-thought-out proposals and voting mechanisms. The project encompasses a suite of smart contracts managing stablecoins, native tokens, collateral, liquidity, and staking processes. Notable features include the integration of external systems through Chainlink and Uniswap, emphasizing adaptability and interoperability. The codebase reflects a commitment to security, modularity, and adherence to industry best practices.\n\n\n### Governance and DAO Architecture:\nThe core of the ecosystem is anchored in DAO.sol, comprising 251 lines of code and reflecting a robust framework for decentralized governance. Proposals.sol, with 267 lines, complements DAO.sol, handling the intricacies of proposals and voting within the decentralized autonomous organization. This structure emphasizes transparency, accountability, and participatory decision-making.\n\n### Reward Systems and Emissions:\nThe reward mechanisms are well-structured and decentralized. Emissions.sol, with 35 lines, seems dedicated to managing emissions, indicating a conscious effort to control token supply dynamics. RewardsEmitter.sol, encompassing 89 lines, orchestrates the distribution of rewards across the ecosystem. SaltRewards.sol, spanning 88 lines, emerges as a pivotal contract, intricately managing the allocation of rewards to staking and liquidity providers.\n\n### Stablecoins and Token Management:\nUSDS.sol, with its 33 lines, serves as the bedrock for the stablecoin within the ecosystem. StableConfig.sol, standing at 104 lines, is indicative of a thorough approach to managing stability within the protocol. On the native token front, Salt.sol (16 lines) showcases an elegant and concise imple", "vulnerable_code": "// Example Multi-Signature Implementation\nfunction executeMultiSig(address[] memory signers, bytes memory transaction) external {\n require(validateSignatures(signers, transaction), \"Invalid signatures\");\n // Execute the transaction\n}", "fixed_code": "// Example Parameterized Timelock Implementation\nfunction proposeTimelock(uint256 newTimelock) external onlyAdmin {\n // Additional checks and validations\n activeTimelock = block.timestamp + newTimelock;\n}", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/hassanshakeel13-Analysis.md", "collected_at": "2026-01-02T19:01:42.599807+00:00", "source_hash": "9a3089ae22492b203c4d98f78364dad33d5d5bfbc092d038177abf0d4803d32f", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "// Example Multi-Signature Implementation\nfunction executeMultiSig(address[] memory signers, bytes memory transaction) external {\n require(validateSignatures(signers, transaction), \"Invalid signatures\");\n // Execute the transaction\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "// Example Parameterized Timelock Implementation\nfunction proposeTimelock(uint256 newTimelock) external onlyAdmin {\n // Additional checks and validations\n activeTimelock = block.timestamp + newTimelock;\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-biconomy", "title": "Rickard Q", "severity_raw": "Low", "severity": "low", "description": "# USE A MORE RECENT VERSION OF SOLIDITY\nUse a solidity version of at least 0.8.2 to get simple compiler automatic inclining.\nUse a solidity version of at least 0.8.3 to get better struct packing and cheaper multiple storage reads.\nUse a solidity version of at least 0.8.4 to get custom errors, which are cheaper than revert() / require().\nUse a solidity version of at least 0.8.10 to have external calls skip contract existence checks if the call has a return value.\nUse a solidity version of at least 0.8.12 to get string.concat() to be used instead of abi.encodePacked(,)\nUse at least 0.8.13 to adopt using for with a list of free functions. \n\n- BaseSmartAccount.sol\n- Proxy.sol\n- SmartAccount.sol\n- SmartAccountFactory.sol\n- IAggregator.sol\n- Executor.sol\n- FallbackManager.sol\n- ModuleManager.sol\n- Enum.sol\n- SecuredTokenTransfer.sol\n- SignatureDecoder.sol\n- Singleton.sol\n- DefaultCallbackHandler.sol\n- ERC721TokenReceiver.sol\n- ERC777TokensRecipient.sol\n- ERC1155TokenReceiver.sol\n- IERC165.sol\n- IERC1271Wallet.sol\n- ISignatureValidator.sol\n- LibAddress.sol\n- Math.sol\n- MultiSend.sol\n- MultiSendCallOnly.sol\n\nThere are 23 instances of this issue:\n```\npragma solidity 0.8.12;\n```\n# USE CUSTOM IMPORTS INSTEAD OF THE PLAIN \u201cIMPORT\u201d \u201cFILE.SOL\u201d\nThere are 38 instances of this issue:\nBaseSmartAccount.sol\n```\n10\t-\timport \"./common/Enum.sol\";\n10\t+\timport {Enum} from \"./common/Enum.sol\";\n```\nSmartAccount.sol\n```\n4\t-\timport \"./libs/LibAddress.sol\";\n8\t-\timport \"./BaseSmartAccount.sol\";\n9\t-\timport \"./common/Singleton.sol\"; \n10\t-\timport \"./base/ModuleManager.sol\"; \n11\t-\timport \"./base/FallbackManager.sol\"; \n12\t-\timport \"./common/SignatureDecoder.sol\"; \n13\t-\timport \"./common/SecuredTokenTransfer.sol\";\n14\t-\timport \"./interfaces/ISignatureValidator.sol\";\n15\t-\timport \"./interfaces/IERC165.sol\";\n\n4\t+\timport {LibAddress} from \"./libs/LibAddress.sol\";\n8\t+\timport {BaseSmartAccount} from \"./BaseSmartAccount.sol\";\n9\t+\timport {Singleton} from \"./common/Singleton.sol\"; \n10\t+\timport {ModuleMa", "vulnerable_code": "pragma solidity 0.8.12;", "fixed_code": "10\t-\timport \"./common/Enum.sol\";\n10\t+\timport {Enum} from \"./common/Enum.sol\";", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/Rickard-Q.md", "collected_at": "2026-01-02T18:13:16.551220+00:00", "source_hash": "9abe31e19589bf7eac0a7f537ce6b910e35ad69d298110688bc45ef15f227d6c", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 100, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "pragma solidity 0.8.12;", "primary_code_language": "unknown", "primary_code_char_count": 23, "all_code_blocks": "// Code block 1 (unknown):\npragma solidity 0.8.12;\n\n// Code block 2 (unknown):\n10\t-\timport \"./common/Enum.sol\";\n10\t+\timport {Enum} from \"./common/Enum.sol\";", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "pragma solidity 0.8.12;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "10\t-\timport \"./common/Enum.sol\";\n10\t+\timport {Enum} from \"./common/Enum.sol\";", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "09-ondo", "title": "gkrastenov Q", "severity_raw": "Critical", "severity": "critical", "description": "# Low issues\n\n## [L-01] Elapsed time should be % day == 0\n### Impact \nWhen setting a new range, the elapsed time between the start and end of the period should be % DAY == 0 to minimize precision errors in the calculation of elapsed days.\n\n### Recommended Mitigation Steps\nAdd an additional check for `(lastRange.end - endTimestamp) % day == 0` in the `setRange` function.\n\n## [L-02] Incorrect events\n### Impact \nWhen `Transfer` and `TransferShares` events are emitted, the wrong value is set. The USDY amount should be multiplied by `BPS_DENOMINATOR`.\n\n### Recommended Mitigation Steps\nMake the following changes:\n\n```solidity\nemit Transfer(address(0), msg.sender, getRUSDYByShares(_USDYAmount * BPS_DENOMINATOR));\n\nemit TransferShares(address(0), msg.sender, _USDYAmount * BPS_DENOMINATOR);\n```\n\n## [L-03] Missing check for sharesAmount >= BPS_DENOMINATOR in transferShares\nIn the `transferShares` function, a check for `sharesAmount >= BPS_DENOMINATOR` is missing,it should be similar to `unwrap` function. Small share amounts may result in precision errors.\n\n\n## [L-04] setThresholds should not accept empty arrays\n### Impact \nIf the `setThresholds` function receives empty arrays for `amounts` and `numOfApprovers`, it will delete `chainToThresholds[srcChain]` and the `_attachThreshold` function will fail.\n\n### Recommended Mitigation Steps\nAdd an additional check for that:\n\n```\nf (amounts.length == 0) {\n revert ArrayLengthIsZero();\n }\n```\n\n## [L-05] if numOfApprovers[i] <= 2 than tx will be approved everytime\n### Impact \nIf `numOfApprovers[i] <= 2`, every transaction for this amount will be approved only for one approver.\n\n### Recommended Mitigation Steps\nAdd an additional check for that:\n```\nif(numOfApprovers[i] <= 2){\n revert SmallNumOfApprovers\n}\n```\n\n## [L-06] if numOfApprovers[i] <= 2 than tx will be approved everytime\n### Impact \nIf `numOfApprovers[i] <= 2`, every transaction for this amount will be approved only for one approver.\n\n### Recommended Mitigation Steps", "vulnerable_code": "emit Transfer(address(0), msg.sender, getRUSDYByShares(_USDYAmount * BPS_DENOMINATOR));\n\nemit TransferShares(address(0), msg.sender, _USDYAmount * BPS_DENOMINATOR);", "fixed_code": "f (amounts.length == 0) {\n revert ArrayLengthIsZero();\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/gkrastenov-Q.md", "collected_at": "2026-01-02T18:25:56.489756+00:00", "source_hash": "9b4a54c92dc497179a5226a241a64f6ddab4507182f0e4e07deb73d66545a92a", "code_block_count": 3, "solidity_block_count": 1, "total_code_chars": 289, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "emit Transfer(address(0), msg.sender, getRUSDYByShares(_USDYAmount * BPS_DENOMINATOR));\n\nemit TransferShares(address(0), msg.sender, _USDYAmount * BPS_DENOMINATOR);", "primary_code_language": "solidity", "primary_code_char_count": 164, "all_code_blocks": "// Code block 1 (solidity):\nemit Transfer(address(0), msg.sender, getRUSDYByShares(_USDYAmount * BPS_DENOMINATOR));\n\nemit TransferShares(address(0), msg.sender, _USDYAmount * BPS_DENOMINATOR);\n\n// Code block 2 (unknown):\nf (amounts.length == 0) {\n revert ArrayLengthIsZero();\n }\n\n// Code block 3 (unknown):\nif(numOfApprovers[i] <= 2){\n revert SmallNumOfApprovers\n}", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "emit Transfer(address(0), msg.sender, getRUSDYByShares(_USDYAmount * BPS_DENOMINATOR));\n\nemit TransferShares(address(0), msg.sender, _USDYAmount * BPS_DENOMINATOR);", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "emit Transfer(address(0), msg.sender, getRUSDYByShares(_USDYAmount * BPS_DENOMINATOR));\n\nemit TransferShares(address(0), msg.sender, _USDYAmount * BPS_DENOMINATOR);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "f (amounts.length == 0) {\n revert ArrayLengthIsZero();\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "03-asymmetry", "title": "CodeFoxInc G", "severity_raw": "Low", "severity": "low", "description": "# Gas Optimization\n\n## Gas-01 The `onlyOwner` functions can be set as `payable` to save gas\n\n### Context\n\n[https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L165-L244](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L165-L244)\n\nThe `onlyOwner` functions can be set as `payable` to save gas. Also it is the same for `adjustWeight` and `addDerivative` functions. \n\n```diff\n- function rebalanceToWeights() external onlyOwner {\n+ function rebalanceToWeights() external onlyOwner payable {\n\n...\n\nfunction adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n+ ) external onlyOwner payable {\n- ) external onlyOwner {\n\n...\n\nfunction addDerivative(\n address _contractAddress,\n uint256 _weight\n- ) external onlyOwner {\n+ ) external onlyOwner payable {\n\n...\n\nfunction setMaxSlippage(\n uint _derivativeIndex,\n uint _slippage\n- ) external onlyOwner { \n+ ) external onlyOwner payable { // @audit the previleged owner should be documented for users to understand the risks\n derivatives[_derivativeIndex].setMaxSlippage(_slippage);\n emit SetMaxSlippage(_derivativeIndex, _slippage);\n }\n\n /**\n @notice - Sets the minimum amount a user is allowed to stake\n @param _minAmount - amount to set as minimum stake value\n */\n- function setMinAmount(uint256 _minAmount) external onlyOwner {\n+ function setMinAmount(uint256 _minAmount) external onlyOwner payable {\n minAmount = _minAmount;\n emit ChangeMinAmount(minAmount);\n }\n\n /**\n @notice - Owner only function that sets the maximum amount a user is allowed to stake\n @param _maxAmount - amount to set as maximum stake value\n */\n- function setMaxAmount(uint256 _maxAmount) external onlyOwner {\n+ function setMaxAmount(uint256 _maxAmount) external onlyOwner payable {\n ma", "vulnerable_code": "### Proof of Concept\n\nBefore: \n", "fixed_code": "After: \n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/CodeFoxInc-G.md", "collected_at": "2026-01-02T18:17:57.514885+00:00", "source_hash": "9b66143789d578b191bcc877fed0406a03522b2bea45504c4272965f4b328600", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol#L165-L244", "github_files_list": "SafEth.sol", "github_refs_count": 1, "vulnerable_code_actual": "### Proof of Concept\n\nBefore: \n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "After: \n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "03-asymmetry", "title": "bin2chen Q", "severity_raw": "Low", "severity": "low", "description": "L-01:`maxSlippage` Slippage does not provide real protection\nCurrently individual `derivatives` are protected against slippage when exchanging, but the estimated prices are all from the `pool price` of the same transaction\nWhen the price drops sharply, the estimated price also drops sharply, and `minOut` also drops sharply, resulting in very limited protection from slippage\nIt is recommended to calculate `minOut` without adding `pool price` to the calculation, and to calculate `minOut` directly based on the expected eth\n\n```solidity\ncontract SfrxEth is IDerivative, Initializable, OwnableUpgradeable {\n function withdraw(uint256 _amount) external onlyOwner {\n...\n- uint256 minOut = (((ethPerDerivative(_amount) * _amount) / 10 ** 18) *\n- (10 ** 18 - maxSlippage)) / 10 ** 18; \n+ uint256 minOut = (_amount / 10 ** 18 *\n+ (10 ** 18 - maxSlippage)) / 10 ** 18; \n\n```\n```solidity\ncontract Reth is IDerivative, Initializable, OwnableUpgradeable {\n...\n function deposit() external payable onlyOwner returns (uint256) {\n- uint256 minOut = ((((rethPerEth * msg.value) / 10 ** 18) *\n+ uint256 minOut = (((msg.value / 10 ** 18) *\n ((10 ** 18 - maxSlippage))) / 10 ** 18); \n``` \n\nL-02:stake()/unstake() minAmount/maxAmount Problem\n1. take() only determines maxAmount for this time, and does not add how many shares the current user already has\n2. unstake() does not limit `_safEthAmount`, so after unstake, the value of the user's remaining shares may be less than minAmount.\n\nIt is recommended to add a judgment to the existing shares, but not this minAmount/maxAmount does not work\n\nL-03:adjustWeight() lacks the judgment _derivativeIndex < derivativeCount\nIf _derivativeIndex > derivativeCount, the adjustment is invalid\nSuggestion.\n```solidity\n function adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n ) external onlyOwner {\n\n+ require(_derivativeIndex 0, \"User does not have any collateral\" );\n```\n\n[https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/stable/CollateralAndLiquidity.sol#L83](https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/stable/CollateralAndLiquidity.sol#L83C12-L83C28)\n\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/stable/CollateralAndLiquidity.sol#L98\n\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/stable/CollateralAndLiquidity.sol#L98\n\n```jsx\nrequire( poolIDs.length == profitsForPools.length, \"Incompatible array lengths\" );\n```\n\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/rewards/SaltRewards.sol#L60\n\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/rewards/SaltRewards.sol#L120\n\n```jsx\nrequire( bytes(country).length == 2, \"Country must be an ISO 3166 Alpha-2 Code\" );\n```\n\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/dao/Proposals.sol#L224\n\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/dao/Proposals.sol#L233\n\n```jsx\nrequire( block.timestamp >= user.cooldownExpiration, \"Must wait for the cooldown to expire\" );\n```\n\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/staking/StakingRewards.sol#L67\n\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/staking/StakingRewards.sol#L107", "vulnerable_code": "[https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/stable/CollateralAndLiquidity.sol#L83](https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/stable/CollateralAndLiquidity.sol#L83C12-L83C28)\n\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/stable/CollateralAndLiquidity.sol#L98\n\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/stable/CollateralAndLiquidity.sol#L98\n", "fixed_code": "https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/rewards/SaltRewards.sol#L60\n\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/rewards/SaltRewards.sol#L120\n", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/lilizhu-G.md", "collected_at": "2026-01-02T19:01:50.707451+00:00", "source_hash": "9bd55e9652f3a99a6502dc5dab0671597aed825f1605fb4296f25ffc9875ac0f", "code_block_count": 4, "solidity_block_count": 0, "total_code_chars": 359, "github_ref_count": 8, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "require( userShareForPool( msg.sender, collateralPoolID ) > 0, \"User does not have any collateral\" );", "primary_code_language": "jsx", "primary_code_char_count": 101, "all_code_blocks": "// Code block 1 (jsx):\nrequire( userShareForPool( msg.sender, collateralPoolID ) > 0, \"User does not have any collateral\" );\n\n// Code block 2 (jsx):\nrequire( poolIDs.length == profitsForPools.length, \"Incompatible array lengths\" );\n\n// Code block 3 (jsx):\nrequire( bytes(country).length == 2, \"Country must be an ISO 3166 Alpha-2 Code\" );\n\n// Code block 4 (jsx):\nrequire( block.timestamp >= user.cooldownExpiration, \"Must wait for the cooldown to expire\" );", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CollateralAndLiquidity.sol#L83, CollateralAndLiquidity.sol#L98, SaltRewards.sol#L60, SaltRewards.sol#L120, Proposals.sol#L224, Proposals.sol#L233, StakingRewards.sol#L67, StakingRewards.sol#L107", "github_files_list": "CollateralAndLiquidity.sol, StakingRewards.sol, Proposals.sol, SaltRewards.sol", "github_refs_count": 8, "vulnerable_code_actual": "[https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/stable/CollateralAndLiquidity.sol#L83](https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/stable/CollateralAndLiquidity.sol#L83C12-L83C28)\n\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/stable/CollateralAndLiquidity.sol#L98\n\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/stable/CollateralAndLiquidity.sol#L98\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 9} {"source": "c4", "protocol": "08-dopex", "title": "SBSecurity Q", "severity_raw": "Critical", "severity": "critical", "description": "### [Low Risk](#low-risk)\n\n| Count | Title |\n| --- | --- |\n| [L-01] | When contract is not paused `emergencywithdraw` is not possible |\n\n| Total Low Risk Issues | 1 |\n| --- | --- |\n\n### [Non-Critical](#non-critical)\n\n| Count | Title |\n| --- | --- |\n| [NC-01] | Typos |\n| [NC-02] | Place commonly used strings in constants |\n\n| Total Non-Critical Issues | 2 |\n| --- | --- |\n\n## Low Risk\n\n## [L-01] When contract is not paused `emergencywithdraw` is not possible\n\n## Impact\n\nEmergencyWithdraw is intended to be used when there is a vulnerability in the protocol and funds are at risk. There are scenarios when immediate actions are needed and protocol admins should react without the need to trigger `Pause()` first.\nHowever the current implementation of `emergencyWithdraw` function in most of the protocol\u2019s contracts, this is not possible.\nDespite the fact it doesn\u2019t open any additional vulnerabilities, such a check is unnecessary in that types of functions\nThere can be scenarios where withdrawing all the user funds without the need to pause the protocol first can be critical for the good image of the protocol.\n\nFor example, `UniswapV2LiquidityAmo` and `UniswapV3LiquidityAmo` contracts `emergencyWithdraw` functions don\u2019t have such a check.\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/reserve/RdpxReserve.sol#L67\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/decaying-bonds/RdpxDecayingBonds.sol#L96\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/perp-vault/PerpetualAtlanticVault.sol#L222\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/core/RdpxV2Core.sol#L164\n\n## Non-Critical\n\n## **[N\u201101] Typos**\n\n```solidity\nFile: contracts/amo/UniV3LiquidityAmo.sol\n\n/// @audit Uniswap\n11: // Uniswamp V3\n```\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/b174dcd7b68a5372d7b9", "vulnerable_code": "File: contracts/amo/UniV3LiquidityAmo.sol\n\n/// @audit Uniswap\n11: // Uniswamp V3", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/SBSecurity-Q.md", "collected_at": "2026-01-02T18:25:02.712344+00:00", "source_hash": "9c13ab7bd46abae8397d7e2de5610d4305569a23fd11047155bfa7b15a5e3d41", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 84, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/amo/UniV3LiquidityAmo.sol\n\n/// @audit Uniswap\n11: // Uniswamp V3", "primary_code_language": "solidity", "primary_code_char_count": 84, "all_code_blocks": "// Code block 1 (solidity):\nFile: contracts/amo/UniV3LiquidityAmo.sol\n\n/// @audit Uniswap\n11: // Uniswamp V3", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: contracts/amo/UniV3LiquidityAmo.sol\n\n/// @audit Uniswap\n11: // Uniswamp V3", "github_refs_formatted": "RdpxReserve.sol#L67, RdpxDecayingBonds.sol#L96, PerpetualAtlanticVault.sol#L222, RdpxV2Core.sol#L164", "github_files_list": "PerpetualAtlanticVault.sol, RdpxV2Core.sol, RdpxDecayingBonds.sol, RdpxReserve.sol", "github_refs_count": 4, "vulnerable_code_actual": "File: contracts/amo/UniV3LiquidityAmo.sol\n\n/// @audit Uniswap\n11: // Uniswamp V3", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "11-kelp", "title": "shaflow2 Q", "severity_raw": "Low", "severity": "low", "description": "## [01]Avoid using deprecated methods\n\nChainlinkPriceOracle used the latestAnswer() function when requesting a price. But this method has already been enabled, consider using latestRoundData instead.\n\nFile:ChainlinkPriceOracle.sol\nGitHub:[[37](https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/oracles/ChainlinkPriceOracle.sol#L37)]\n```solidity\n function getAssetPrice(address asset) external view onlySupportedAsset(asset) returns (uint256) {\n return AggregatorInterface(assetPriceFeed[asset]).latestAnswer();\n }\n```\n\n## [02]Return value type mismatch\n\nIn the chainlink contract AggregatorProxy, calling latestAnswer() returns the int256 type, while the project requests lastAnswer() and returns the uint256 type. \nAlthough this will not cause security issues, consider maintaining consistent return value types.\nFile:ChainlinkPriceOracle.sol\nGitHub:[[37](https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/oracles/ChainlinkPriceOracle.sol#L37)]\n```solidity\n function getAssetPrice(address asset) external view onlySupportedAsset(asset) returns (uint256) {\n return AggregatorInterface(assetPriceFeed[asset]).latestAnswer();\n }\n```\n\nFile:chainlink/contracts/src/v0.7/dev/AggregatorProxy.sol\nGitHub:[[41](https://github.com/smartcontractkit/chainlink/blob/66d9e23219831c8ecd937431ead528dc0e9afcbb/contracts/src/v0.7/dev/AggregatorProxy.sol#L41C15-L41C15)]\n```solidity\n function latestAnswer() public view virtual override returns (int256 answer) {\n return s_currentPhase.aggregator.latestAnswer();\n }\n```\n\n\n", "vulnerable_code": " function getAssetPrice(address asset) external view onlySupportedAsset(asset) returns (uint256) {\n return AggregatorInterface(assetPriceFeed[asset]).latestAnswer();\n }", "fixed_code": " function getAssetPrice(address asset) external view onlySupportedAsset(asset) returns (uint256) {\n return AggregatorInterface(assetPriceFeed[asset]).latestAnswer();\n }", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/shaflow2-Q.md", "collected_at": "2026-01-02T18:28:27.431715+00:00", "source_hash": "9c289380be142f4a8a74c6bb58272126099b7d2c8c000e601afbe9ed8cbdeb7e", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 495, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function getAssetPrice(address asset) external view onlySupportedAsset(asset) returns (uint256) {\n return AggregatorInterface(assetPriceFeed[asset]).latestAnswer();\n }", "primary_code_language": "solidity", "primary_code_char_count": 177, "all_code_blocks": "// Code block 1 (solidity):\nfunction getAssetPrice(address asset) external view onlySupportedAsset(asset) returns (uint256) {\n return AggregatorInterface(assetPriceFeed[asset]).latestAnswer();\n }\n\n// Code block 2 (solidity):\nfunction getAssetPrice(address asset) external view onlySupportedAsset(asset) returns (uint256) {\n return AggregatorInterface(assetPriceFeed[asset]).latestAnswer();\n }\n\n// Code block 3 (solidity):\nfunction latestAnswer() public view virtual override returns (int256 answer) {\n return s_currentPhase.aggregator.latestAnswer();\n }", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function getAssetPrice(address asset) external view onlySupportedAsset(asset) returns (uint256) {\n return AggregatorInterface(assetPriceFeed[asset]).latestAnswer();\n }\n\nfunction getAssetPrice(address asset) external view onlySupportedAsset(asset) returns (uint256) {\n return AggregatorInterface(assetPriceFeed[asset]).latestAnswer();\n }\n\nfunction latestAnswer() public view virtual override returns (int256 answer) {\n return s_currentPhase.aggregator.latestAnswer();\n }", "github_refs_formatted": "ChainlinkPriceOracle.sol#L37, AggregatorProxy.sol#L41-L15", "github_files_list": "ChainlinkPriceOracle.sol, AggregatorProxy.sol", "github_refs_count": 2, "vulnerable_code_actual": " function getAssetPrice(address asset) external view onlySupportedAsset(asset) returns (uint256) {\n return AggregatorInterface(assetPriceFeed[asset]).latestAnswer();\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function getAssetPrice(address asset) external view onlySupportedAsset(asset) returns (uint256) {\n return AggregatorInterface(assetPriceFeed[asset]).latestAnswer();\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "03-asymmetry", "title": "ArbitraryExecution G", "severity_raw": "Low", "severity": "low", "description": "### Redundant external `balanceOf` call\n\nGas savings in the [`deposit`](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol#L94) function in `SfrxEth.sol` can be had by returning the return value from the [`submitAndDeposit`](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol#L101) external call. This would eliminate two external `balanceOf` external calls, as well as the [subtraction operation](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol#L105).\n\n### Redundant external `balanceOf` call\n\nGas savings in the [`withdraw`](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol#L56) function in `WstEth.sol` can be had by saving off the return value of the [`unwrap`](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol#L57) call and using that return value instead of making an additional [`balanceOf`](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol#L58) external call to the `STETH_TOKEN` address.\n\n### Use an Array instead of a mapping\n\nThe following loop could be made more gas efficient by changing the `derivatives` variable type:\n\n```\n for (uint i = 0; i < derivativeCount; i++)\n underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;\n```\n\nA storage pointer can't be used here because its a mapping so the elements won't be contiguous. \nIf the `derivatives` variable is changed from a mapping to an array a storage pointer could be used and would result in significant gas savings.\n\n", "vulnerable_code": " for (uint i = 0; i < derivativeCount; i++)\n underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/ArbitraryExecution-G.md", "collected_at": "2026-01-02T18:17:50.369430+00:00", "source_hash": "9ce2c46a6fa5e91bbe731cd95d61172ed8e6283c559f74c4c9f8a1897cc95d08", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 208, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "for (uint i = 0; i < derivativeCount; i++)\n underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;", "primary_code_language": "unknown", "primary_code_char_count": 208, "all_code_blocks": "// Code block 1 (unknown):\nfor (uint i = 0; i < derivativeCount; i++)\n underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SfrxEth.sol#L94, SfrxEth.sol#L101, SfrxEth.sol#L105, WstEth.sol#L56, WstEth.sol#L57, WstEth.sol#L58", "github_files_list": "SfrxEth.sol, WstEth.sol", "github_refs_count": 6, "vulnerable_code_actual": " for (uint i = 0; i < derivativeCount; i++)\n underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "04-caviar", "title": "IceBear Q", "severity_raw": "Critical", "severity": "critical", "description": "## Non Critical Issues\n\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [N-1](#N-1) | Missing checks for `address(0)` when assigning values to address state variables | 2 |\n| [N-2](#N-2) | Use of block.timestamp | 4 |\n| [N-3](#N-3) | Maximum Line Length | 103 |\n| [N-4](#N-4) | `require()`\u00a0/\u00a0`revert()`\u00a0statements should have descriptive reason strings | 1 |\n| [N-5](#N-5) | Event is missing `indexed` fields | 12 |\n| [N-6](#N-6) | Functions not used internally could be marked external | 22 |\n### [N-1] Missing checks for `address(0)` when assigning values to address state variables \n\n*Find (2) instance(s) in contracts*:\n```solidity\nFile: Factory.sol\n\n130: privatePoolMetadata = _privatePoolMetadata;\n\n136: privatePoolImplementation = _privatePoolImplementation;\n\n```\n[Factory.sol](https://github.com/code-423n4/2023-04-caviar/blob/main/src/Factory.sol)\n\n### [N-2] Use of block.timestamp\nBlock timestamps have historically been used for a variety of applications, such as entropy for random numbers (see the Entropy Illusion for further details), locking funds for periods of time, and various state-changing conditional statements that are time-dependent. Miners have the ability to adjust timestamps slightly, which can prove to be dangerous if block timestamps are used incorrectly in smart contracts.\n#### Recommended Mitigation Steps\nBlock timestamps should not be used for entropy or generating random numbers \u2014 i.e., they should not be the deciding factor (either directly or through some derivation) for winning a game or changing an important state.\n\nTime-sensitive logic is sometimes required; e.g., for unlocking contracts (time-locking), completing an ICO after a few weeks, or enforcing expiry dates. It is sometimes recommended to use block.number and an average block time to estimate times; with a 10 second block time, 1 week equates to approximately, 60480 blocks. Thus, specifying a block number at which to change a contract state can be more secure, as miners are unable", "vulnerable_code": "File: Factory.sol\n\n130: privatePoolMetadata = _privatePoolMetadata;\n\n136: privatePoolImplementation = _privatePoolImplementation;\n", "fixed_code": "File: EthRouter.sol\n\n101: if (block.timestamp > deadline && deadline != 0) {\n\n154: if (block.timestamp > deadline && deadline != 0) {\n\n228: if (block.timestamp > deadline && deadline != 0) {\n\n256: if (block.timestamp > deadline && deadline != 0) {\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/IceBear-Q.md", "collected_at": "2026-01-02T18:19:41.911175+00:00", "source_hash": "9ce3d06cc34ca1a2acfc4c68ddd019fbc9b75d6af05175d056849d9c9b96af22", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 145, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: Factory.sol\n\n130: privatePoolMetadata = _privatePoolMetadata;\n\n136: privatePoolImplementation = _privatePoolImplementation;", "primary_code_language": "solidity", "primary_code_char_count": 145, "all_code_blocks": "// Code block 1 (solidity):\nFile: Factory.sol\n\n130: privatePoolMetadata = _privatePoolMetadata;\n\n136: privatePoolImplementation = _privatePoolImplementation;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: Factory.sol\n\n130: privatePoolMetadata = _privatePoolMetadata;\n\n136: privatePoolImplementation = _privatePoolImplementation;", "github_refs_formatted": "Factory.sol", "github_files_list": "Factory.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: Factory.sol\n\n130: privatePoolMetadata = _privatePoolMetadata;\n\n136: privatePoolImplementation = _privatePoolImplementation;\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: EthRouter.sol\n\n101: if (block.timestamp > deadline && deadline != 0) {\n\n154: if (block.timestamp > deadline && deadline != 0) {\n\n228: if (block.timestamp > deadline && deadline != 0) {\n\n256: if (block.timestamp > deadline && deadline != 0) {\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-asymmetry", "title": "ayden Q", "severity_raw": "Unknown", "severity": "unknown", "description": "1.When there is no limit to the range when setting the maxSlippage, if the slippage set exceeds a reasonable range, it may cause losses to the investor's funds\nRecommended setting range\uff1amaxSlippage %0.5 ~ %2\n\n2.When the weights are set improperly, it may cause losses to investors. Improper weightings can cause the value of the derivative to deviate from the underlying asset, which may result in a lack of liquidity or inaccurate pricing for investors seeking to enter or exit positions. This may lead to losses for investors who have not properly assessed the risks and have invested in the derivative. It is important to properly set the weights and perform rigorous risk management to avoid such negative consequences.\n\n3.When unstaking, it is necessary to check whether the user has a sufficient safEth balance.\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L108#L129\n\n```solidity\n+ require(balanceOf(msg.sender)>=_safEthAmount, \"insufficient balance\");\n```", "vulnerable_code": "+ require(balanceOf(msg.sender)>=_safEthAmount, \"insufficient balance\");", "fixed_code": "", "recommendation": "", "category": "slippage", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/ayden-Q.md", "collected_at": "2026-01-02T18:18:50.382410+00:00", "source_hash": "9cecd40ac622fc5e0a6049e1a2d27c410c024859617543a4c46c46678c013e0e", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 72, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "+ require(balanceOf(msg.sender)>=_safEthAmount, \"insufficient balance\");", "primary_code_language": "solidity", "primary_code_char_count": 72, "all_code_blocks": "// Code block 1 (solidity):\n+ require(balanceOf(msg.sender)>=_safEthAmount, \"insufficient balance\");", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "+ require(balanceOf(msg.sender)>=_safEthAmount, \"insufficient balance\");", "github_refs_formatted": "SafEth.sol#L108", "github_files_list": "SafEth.sol", "github_refs_count": 1, "vulnerable_code_actual": "+ require(balanceOf(msg.sender)>=_safEthAmount, \"insufficient balance\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5.01} {"source": "c4", "protocol": "08-dopex", "title": "SAQ G", "severity_raw": "High", "severity": "high", "description": "## Summary\n\n### Gas Optimization\n\nno | Issue |Instances||\n|-|:-|:-:|:-:|\n| [G-01] | Add unchecked{} for subtractions where the operands cannot underflow because of a previous require() or if statement | 2 | - |\n| [G-02] | keccak256() should only need to be called on a specific string literal once | 2 | - |\n| [G-03] | Usage of uints/ints smaller than 32 bytes (256 bits) incurs overhead | 1 | - |\n| [G-04] | Using fixed bytes is cheaper than using string | 8 | - |\n| [G-05] | Expressions for constant values such as a call to keccak256(), should use immutable rather than constant | 5 | - |\n| [G-06] | Can make the variable outside the loop to save gas | 5 | - |\n| [G-07] | Using calldata instead of memory for read-only arguments in external functions, saves gas | 5 | - |\n| [G-08] | Should use arguments instead of state variable | 4 | - |\n| [G-09] | Use assembly to check for address(0) | 26 | - |\n| [G-10] | Before transfer of some functions, we should check some variables for possible gas save | 6 | - |\n| [G-11] | Use bitmap to save gas | 5 | - |\n| [G-12] | Require() or revert() statements that check input arguments should be at the top of the function | 1 | - |\n| [G-13] | Empty blocks should be removed or emit something | 1 | - |\n| [G-14] | Don't initialize variables with default value | 1 | - |\n| [G-15] | With assembly, .call (bool success) transfer can be done gas-optimized | 2 | - |\n| [G-16] | Duplicated require()/if() checks should be refactored to a modifier or function | 1 | - |\n| [G-17] | Use constants instead of type(uintx).max | 7 | - |\n| [G-18] | Use assembly to write address storage values | 3 | - |\n| [G-19] | Multiple accesses of a mapping/array should use a local variable cache | 2 | - |\n| [G-20] | Caching global variables is more expensive than using the actual variable (use msg.sender or block.timestamp instead of caching it) | 1 | - |\n| [G-21] | A modifier used only once and not being inherited should be inlined to save gas | 1 | - |\n| [G-22] | Do not c", "vulnerable_code": "file: /contracts/core/RdpxV2Core.sol\n\n670 uint256 discountReceivedInWeth = _bondAmount -\n671 _wethAmount -\n672 rdpxAmountInWeth;\n\n1002 balance = balance - totalWethDelegated;\n", "fixed_code": "file: /contracts/perp-vault/PerpetualAtlanticVault.sol\n\n467 uint256 startTime = lastUpdateTime == 0\n ? (nextFundingPaymentTimestamp() - fundingDuration)\n469 : lastUpdateTime;\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/SAQ-G.md", "collected_at": "2026-01-02T18:25:01.828769+00:00", "source_hash": "9d4abe5a5f0c5216a990a233fd5a9fe2536d5fb1d1a634fc97fb0522afd1eb50", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "file: /contracts/core/RdpxV2Core.sol\n\n670 uint256 discountReceivedInWeth = _bondAmount -\n671 _wethAmount -\n672 rdpxAmountInWeth;\n\n1002 balance = balance - totalWethDelegated;\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "file: /contracts/perp-vault/PerpetualAtlanticVault.sol\n\n467 uint256 startTime = lastUpdateTime == 0\n ? (nextFundingPaymentTimestamp() - fundingDuration)\n469 : lastUpdateTime;\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-asymmetry", "title": "Dewaxindo Q", "severity_raw": "High", "severity": "high", "description": "## Potential Impact\nThis exploit allowed an attacker to \u201cdouble exercise\u201d ETH value and steal the collateral posted by certain users.\n\n## Proof of Concept\n1. In `SafEth.sol` Contract allows anyone to stake their ETH.\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L63-L101\n\n2. However inside the `stake()` function there is `msg.value` used inside a loop.\n```Solidity\nfor (uint i = 0; i < derivativeCount; i++) {\n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight == 0) continue;\n uint256 ethAmount = (msg.value * weight) / totalWeight;\n\n // This is slightly less than ethAmount because slippage\n uint256 depositAmount = derivative.deposit{value: ethAmount}();\n uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n depositAmount\n ) * depositAmount) / 10 ** 18;\n totalStakeValueEth += derivativeReceivedEthValue;\n }\n```\n```Solidity\nuint256 ethAmount = (msg.value * weight) / totalWeight;\n```\n3. As shown in the above code snippet, the loop function getting total amount of derivatives worth of ETH in system\n\n4. This leads to the same `msg.value` amount of ETH would be re-used in the second or further `stake()` calls in the same transaction. But, only the first batch of ETH is received.\n\nReferences(Past Incident):\n- https://peckshield.medium.com/opyn-hacks-root-cause-analysis-c65f3fe249db\n- https://blog.trailofbits.com/2021/12/16/detecting-miso-and-opyns-msg-value-reuse-vulnerability-with-slither/\n- https://medium.com/opyn/opyn-eth-put-exploit-c5565c528ad2\n\n## Tools Used\n\nSlither\n\n## Recommended Mitigation Steps\n\n1. Use a local variable `msgValue` to keep the amount of `msg.value` in Solidity. This allows to calculate and book-keep how much ETH had been staked. \n2. In addition, `address(this).balance` could be used to check if the smart contract ", "vulnerable_code": "for (uint i = 0; i < derivativeCount; i++) {\n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight == 0) continue;\n uint256 ethAmount = (msg.value * weight) / totalWeight;\n\n // This is slightly less than ethAmount because slippage\n uint256 depositAmount = derivative.deposit{value: ethAmount}();\n uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n depositAmount\n ) * depositAmount) / 10 ** 18;\n totalStakeValueEth += derivativeReceivedEthValue;\n }", "fixed_code": "uint256 ethAmount = (msg.value * weight) / totalWeight;", "recommendation": "", "category": "slippage", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Dewaxindo-Q.md", "collected_at": "2026-01-02T18:18:01.567511+00:00", "source_hash": "9d61637e938df7b0ae623649cb02a021ae22bb7f65d02455bb8fdb57fd179511", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 667, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "for (uint i = 0; i < derivativeCount; i++) {\n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight == 0) continue;\n uint256 ethAmount = (msg.value * weight) / totalWeight;\n\n // This is slightly less than ethAmount because slippage\n uint256 depositAmount = derivative.deposit{value: ethAmount}();\n uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n depositAmount\n ) * depositAmount) / 10 ** 18;\n totalStakeValueEth += derivativeReceivedEthValue;\n }", "primary_code_language": "Solidity", "primary_code_char_count": 612, "all_code_blocks": "// Code block 1 (Solidity):\nfor (uint i = 0; i < derivativeCount; i++) {\n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight == 0) continue;\n uint256 ethAmount = (msg.value * weight) / totalWeight;\n\n // This is slightly less than ethAmount because slippage\n uint256 depositAmount = derivative.deposit{value: ethAmount}();\n uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n depositAmount\n ) * depositAmount) / 10 ** 18;\n totalStakeValueEth += derivativeReceivedEthValue;\n }\n\n// Code block 2 (Solidity):\nuint256 ethAmount = (msg.value * weight) / totalWeight;", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "for (uint i = 0; i < derivativeCount; i++) {\n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight == 0) continue;\n uint256 ethAmount = (msg.value * weight) / totalWeight;\n\n // This is slightly less than ethAmount because slippage\n uint256 depositAmount = derivative.deposit{value: ethAmount}();\n uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n depositAmount\n ) * depositAmount) / 10 ** 18;\n totalStakeValueEth += derivativeReceivedEthValue;\n }\n\nuint256 ethAmount = (msg.value * weight) / totalWeight;", "github_refs_formatted": "SafEth.sol#L63-L101", "github_files_list": "SafEth.sol", "github_refs_count": 1, "vulnerable_code_actual": "for (uint i = 0; i < derivativeCount; i++) {\n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight == 0) continue;\n uint256 ethAmount = (msg.value * weight) / totalWeight;\n\n // This is slightly less than ethAmount because slippage\n uint256 depositAmount = derivative.deposit{value: ethAmount}();\n uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n depositAmount\n ) * depositAmount) / 10 ** 18;\n totalStakeValueEth += derivativeReceivedEthValue;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "uint256 ethAmount = (msg.value * weight) / totalWeight;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-biconomy", "title": "Josiah Q", "severity_raw": "Critical", "severity": "critical", "description": "## UNUTILIZED LIBRARY\nThroughout the code bases, there are instances where functions in Math.sol are re-implemented instead of getting them utilized via library import.\n\n[Math.sol](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/libs/Math.sol)\n\n```\n19: function max(uint256 a, uint256 b) internal pure returns (uint256) {\n\n26: function min(uint256 a, uint256 b) internal pure returns (uint256) {\n```\n[SmartAccount.sol](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol)\n\n```\n181: function max(uint256 a, uint256 b) internal pure returns (uint256) {\n\n224: require(gasleft() >= max((_tx.targetTxGas * 64) / 63,_tx.targetTxGas + 2500) + 500, \"BSA010\");\n```\n[UserOperation.sol](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/UserOperation.sol)\n\n```\n53: return min(maxFeePerGas, maxPriorityFeePerGas + block.basefee);\n\n77 function min(uint256 a, uint256 b) internal pure returns (uint256) {\n```\n[EntryPoint.sol](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol)\n\n```\n492: return min(maxFeePerGas, maxPriorityFeePerGas + block.basefee);\n\n496: function min(uint256 a, uint256 b) internal pure returns (uint256) {\n```\n## MISSING EVENTS ON CRITICAL OPERATIONS\nCritical operations not triggering events will make it difficult to review the correct behavior of the contracts. Users and blockchain monitoring systems will not be able to easily detect suspicious behaviors without events.\n\nHere is 1 instance found.\n\n[VerifyingSingletonPaymaster.sol#L65](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol#L65)\n\n```\n function setSigner( address _newVerifyingSigner) external on", "vulnerable_code": "19: function max(uint256 a, uint256 b) internal pure returns (uint256) {\n\n26: function min(uint256 a, uint256 b) internal pure returns (uint256) {", "fixed_code": "181: function max(uint256 a, uint256 b) internal pure returns (uint256) {\n\n224: require(gasleft() >= max((_tx.targetTxGas * 64) / 63,_tx.targetTxGas + 2500) + 500, \"BSA010\");", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/Josiah-Q.md", "collected_at": "2026-01-02T18:13:07.587220+00:00", "source_hash": "9d76e9f00099a8e262bdd8a3a10b6a658e2ace956e3b01ffb9733efcbbafacff", "code_block_count": 4, "solidity_block_count": 0, "total_code_chars": 639, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "19: function max(uint256 a, uint256 b) internal pure returns (uint256) {\n\n26: function min(uint256 a, uint256 b) internal pure returns (uint256) {", "primary_code_language": "unknown", "primary_code_char_count": 152, "all_code_blocks": "// Code block 1 (unknown):\n19: function max(uint256 a, uint256 b) internal pure returns (uint256) {\n\n26: function min(uint256 a, uint256 b) internal pure returns (uint256) {\n\n// Code block 2 (unknown):\n181: function max(uint256 a, uint256 b) internal pure returns (uint256) {\n\n224: require(gasleft() >= max((_tx.targetTxGas * 64) / 63,_tx.targetTxGas + 2500) + 500, \"BSA010\");\n\n// Code block 3 (unknown):\n53: return min(maxFeePerGas, maxPriorityFeePerGas + block.basefee);\n\n77 function min(uint256 a, uint256 b) internal pure returns (uint256) {\n\n// Code block 4 (unknown):\n492: return min(maxFeePerGas, maxPriorityFeePerGas + block.basefee);\n\n496: function min(uint256 a, uint256 b) internal pure returns (uint256) {", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Math.sol, SmartAccount.sol, UserOperation.sol, EntryPoint.sol, VerifyingSingletonPaymaster.sol#L65", "github_files_list": "VerifyingSingletonPaymaster.sol, EntryPoint.sol, Math.sol, SmartAccount.sol, UserOperation.sol", "github_refs_count": 5, "vulnerable_code_actual": "19: function max(uint256 a, uint256 b) internal pure returns (uint256) {\n\n26: function min(uint256 a, uint256 b) internal pure returns (uint256) {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "181: function max(uint256 a, uint256 b) internal pure returns (uint256) {\n\n224: require(gasleft() >= max((_tx.targetTxGas * 64) / 63,_tx.targetTxGas + 2500) + 500, \"BSA010\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "09-ondo", "title": "2997ms Q", "severity_raw": "Gas", "severity": "gas", "description": "# 1. Check the ```_amount == 0``` before executing \n\nThere are multiple places just checking address but not checking the _amount == 0 in rUSDY.sol file. If we check the amount == 0 first, it can save some gas and no need to execute then next steps.\n\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDY.sol#L245\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDY.sol#L277\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDY.sol#L304\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDY.sol#L488\n\n# 2. Refactor the codes\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/DestinationBridge.sol#L179-L183\n```\n if (t.numberOfApprovalsNeeded <= t.approvers.length) {\n return true;\n } else {\n return false;\n }\n```\nThis can be refactored to ```return t.numberOfApprovalsNeeded <= t.approvers.length```\n# 3. Refactor the codes\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/DestinationBridge.sol#L159\n```\n if (t.approvers.length > 0) {\n for (uint256 i = 0; i < t.approvers.length; ++i) {\n if (t.approvers[i] == msg.sender) {\n revert AlreadyApproved();\n }\n }\n }\n```\nRemove the line of ``` if (t.approvers.length > 0)```, there is no need for this condition.\n\n\n\n", "vulnerable_code": " if (t.numberOfApprovalsNeeded <= t.approvers.length) {\n return true;\n } else {\n return false;\n }", "fixed_code": "# 3. Refactor the codes\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/DestinationBridge.sol#L159", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/2997ms-Q.md", "collected_at": "2026-01-02T18:25:20.099040+00:00", "source_hash": "9dbfeb50e3cb1867465c0439b52eece58723f74ac94d2ebf3db7420c452661aa", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 250, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "if (t.numberOfApprovalsNeeded <= t.approvers.length) {\n return true;\n } else {\n return false;\n }", "primary_code_language": "unknown", "primary_code_char_count": 112, "all_code_blocks": "// Code block 1 (unknown):\nif (t.numberOfApprovalsNeeded <= t.approvers.length) {\n return true;\n } else {\n return false;\n }\n\n// Code block 2 (unknown):\n# 3. Refactor the codes\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/DestinationBridge.sol#L159\n\n// Code block 3 (unknown):\nRemove the line of", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "rUSDY.sol#L245, rUSDY.sol#L277, rUSDY.sol#L304, rUSDY.sol#L488, DestinationBridge.sol#L179-L183, DestinationBridge.sol#L159", "github_files_list": "rUSDY.sol, DestinationBridge.sol", "github_refs_count": 6, "vulnerable_code_actual": " if (t.numberOfApprovalsNeeded <= t.approvers.length) {\n return true;\n } else {\n return false;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "# 3. Refactor the codes\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/DestinationBridge.sol#L159", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8.68} {"source": "c4", "protocol": "06-lybra", "title": "MrPotatoMagic Q", "severity_raw": "Critical", "severity": "critical", "description": "## [N-01] Missing event emission for critical state changes \n \nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/EUSDMiningIncentives.sol#L84\nAll functions from Line 84-130 do not have events and their emissions even though they change state variables.\n```solidity\nFile: contracts/lybra/miner/EUSDMiningIncentives.sol\n84: function setToken(address _lbr, address _eslbr) external onlyOwner {\n85: LBR = _lbr;\n86: esLBR = _eslbr;\n87: }\n88: \n89: function setLBROracle(address _lbrOracle) external onlyOwner {\n90: lbrPriceFeed = AggregatorV3Interface(_lbrOracle);\n91: }\n92: \n93: function setPools(address[] memory _pools) external onlyOwner {\n94: for (uint i = 0; i < _pools.length; i++) {\n95: require(configurator.mintVault(_pools[i]), \"NOT_VAULT\");\n96: }\n97: pools = _pools;\n98: }\n99: \n100: function setBiddingCost(uint256 _biddingRatio) external onlyOwner {\n101: require(_biddingRatio <= 8000, \"BCE\");\n102: biddingFeeRatio = _biddingRatio;\n103: }\n104: \n105: function setExtraRatio(uint256 ratio) external onlyOwner {\n106: require(ratio <= 1e20, \"BCE\");\n107: extraRatio = ratio;\n108: }\n109: \n110: function setPeUSDExtraRatio(uint256 ratio) external onlyOwner {\n111: require(ratio <= 1e20, \"BCE\");\n112: peUSDExtraRatio = ratio;\n113: }\n114: \n115: function setBoost(address _boost) external onlyOwner {\n116: esLBRBoost = IesLBRBoost(_boost);\n117: }\n118: \n119: function setRewardsDuration(uint256 _duration) external onlyOwner {\n120: require(finishAt < block.timestamp, \"reward duration not finished\");\n121: duration = _duration;\n122: }\n123: \n124: function setEthlbrStakeInfo(address _pool, address _lp) external onlyOwner {\n125: ethlbrStakePool = _pool;\n126: ethlbrLpToken = _lp;\n127: }\n128: function setEUSDBuyoutAllowed", "vulnerable_code": "File: contracts/lybra/miner/EUSDMiningIncentives.sol\n84: function setToken(address _lbr, address _eslbr) external onlyOwner {\n85: LBR = _lbr;\n86: esLBR = _eslbr;\n87: }\n88: \n89: function setLBROracle(address _lbrOracle) external onlyOwner {\n90: lbrPriceFeed = AggregatorV3Interface(_lbrOracle);\n91: }\n92: \n93: function setPools(address[] memory _pools) external onlyOwner {\n94: for (uint i = 0; i < _pools.length; i++) {\n95: require(configurator.mintVault(_pools[i]), \"NOT_VAULT\");\n96: }\n97: pools = _pools;\n98: }\n99: \n100: function setBiddingCost(uint256 _biddingRatio) external onlyOwner {\n101: require(_biddingRatio <= 8000, \"BCE\");\n102: biddingFeeRatio = _biddingRatio;\n103: }\n104: \n105: function setExtraRatio(uint256 ratio) external onlyOwner {\n106: require(ratio <= 1e20, \"BCE\");\n107: extraRatio = ratio;\n108: }\n109: \n110: function setPeUSDExtraRatio(uint256 ratio) external onlyOwner {\n111: require(ratio <= 1e20, \"BCE\");\n112: peUSDExtraRatio = ratio;\n113: }\n114: \n115: function setBoost(address _boost) external onlyOwner {\n116: esLBRBoost = IesLBRBoost(_boost);\n117: }\n118: \n119: function setRewardsDuration(uint256 _duration) external onlyOwner {\n120: require(finishAt < block.timestamp, \"reward duration not finished\");\n121: duration = _duration;\n122: }\n123: \n124: function setEthlbrStakeInfo(address _pool, address _lp) external onlyOwner {\n125: ethlbrStakePool = _pool;\n126: ethlbrLpToken = _lp;\n127: }\n128: function setEUSDBuyoutAllowed(bool _bool) external onlyOwner {\n129: isEUSDBuyoutAllowed = _bool;\n130: }", "fixed_code": "File: contracts/lybra/configuration/LybraConfigurator.sol\n98: function initToken(address _eusd, address _peusd) external onlyRole(DAO) {\n99: if (address(EUSD) == address(0)) EUSD = IEUSD(_eusd);\n100: if (address(peUSD) == address(0)) peUSD = IEUSD(_peusd);\n101: }\n\n109: function setMintVault(address pool, bool isActive) external onlyRole(DAO) {\n110: mintVault[pool] = isActive;\n111: }\n\n119: function setMintVaultMaxSupply(address pool, uint256 maxSupply) external onlyRole(DAO) {\n120: mintVaultMaxSupply[pool] = maxSupply;\n121: }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/MrPotatoMagic-Q.md", "collected_at": "2026-01-02T18:22:30.060421+00:00", "source_hash": "9de7f5d716ef8403ab3516184aec016f7be0fcd8ed81e8bdd614a7f91dfd5390", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "EUSDMiningIncentives.sol#L84", "github_files_list": "EUSDMiningIncentives.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: contracts/lybra/miner/EUSDMiningIncentives.sol\n84: function setToken(address _lbr, address _eslbr) external onlyOwner {\n85: LBR = _lbr;\n86: esLBR = _eslbr;\n87: }\n88: \n89: function setLBROracle(address _lbrOracle) external onlyOwner {\n90: lbrPriceFeed = AggregatorV3Interface(_lbrOracle);\n91: }\n92: \n93: function setPools(address[] memory _pools) external onlyOwner {\n94: for (uint i = 0; i < _pools.length; i++) {\n95: require(configurator.mintVault(_pools[i]), \"NOT_VAULT\");\n96: }\n97: pools = _pools;\n98: }\n99: \n100: function setBiddingCost(uint256 _biddingRatio) external onlyOwner {\n101: require(_biddingRatio <= 8000, \"BCE\");\n102: biddingFeeRatio = _biddingRatio;\n103: }\n104: \n105: function setExtraRatio(uint256 ratio) external onlyOwner {\n106: require(ratio <= 1e20, \"BCE\");\n107: extraRatio = ratio;\n108: }\n109: \n110: function setPeUSDExtraRatio(uint256 ratio) external onlyOwner {\n111: require(ratio <= 1e20, \"BCE\");\n112: peUSDExtraRatio = ratio;\n113: }\n114: \n115: function setBoost(address _boost) external onlyOwner {\n116: esLBRBoost = IesLBRBoost(_boost);\n117: }\n118: \n119: function setRewardsDuration(uint256 _duration) external onlyOwner {\n120: require(finishAt < block.timestamp, \"reward duration not finished\");\n121: duration = _duration;\n122: }\n123: \n124: function setEthlbrStakeInfo(address _pool, address _lp) external onlyOwner {\n125: ethlbrStakePool = _pool;\n126: ethlbrLpToken = _lp;\n127: }\n128: function setEUSDBuyoutAllowed(bool _bool) external onlyOwner {\n129: isEUSDBuyoutAllowed = _bool;\n130: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/lybra/configuration/LybraConfigurator.sol\n98: function initToken(address _eusd, address _peusd) external onlyRole(DAO) {\n99: if (address(EUSD) == address(0)) EUSD = IEUSD(_eusd);\n100: if (address(peUSD) == address(0)) peUSD = IEUSD(_peusd);\n101: }\n\n109: function setMintVault(address pool, bool isActive) external onlyRole(DAO) {\n110: mintVault[pool] = isActive;\n111: }\n\n119: function setMintVaultMaxSupply(address pool, uint256 maxSupply) external onlyRole(DAO) {\n120: mintVaultMaxSupply[pool] = maxSupply;\n121: }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-ondo", "title": "Dinesh11G Q", "severity_raw": "Low", "severity": "low", "description": "\n### 1st BUG\nUnsafe ERC20 Operation(s)\n\n#### Impact\nIssue Information: [L001](https://github.com/byterocket/c4-common-issues/blob/main/2-Low-Risk.md#l001---unsafe-erc20-operations)\n\n#### Findings:\n```\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::1695 => comp.transfer(user, amount);\n```\n#### Tools used\nManual VS Code review\n\n### 2nd BUG\nUnspecific Compiler Version Pragma\n\n#### Impact\nIssue Information: \nAvoid floating pragmas for non-library contracts.\n\nWhile floating pragmas make sense for libraries to allow them to be included with multiple different versions of applications, it may be a security risk for application implementations.\n\nA known vulnerable compiler version may accidentally be selected or security tools might fall-back to an older compiler version ending up checking a different EVM compilation that is ultimately deployed on the blockchain.\n\nIt is recommended to pin to a concrete compiler version.\n\nExample\n\ud83e\udd26 Bad:\n\npragma solidity ^0.8.0;\n\ud83d\ude80 Good:\n\npragma solidity 0.8.4;\n\n#### Findings:\n```\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/access/AccessControl.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/access/AccessControlEnumerable.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/access/IAccessControl.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/access/IAccessControlEnumerable.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/access/Ownable.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/proxy/ERC1967Proxy.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/proxy/ERC1967Upgrade.sol::4 => pragma solidity ^0.8.2;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/proxy/IBeacon.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzep", "vulnerable_code": "2023-01-ondo/contracts/lending/compound/Comptroller.sol::1695 => comp.transfer(user, amount);", "fixed_code": "2023-01-ondo/contracts/cash/external/openzeppelin/contracts/access/AccessControl.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/access/AccessControlEnumerable.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/access/IAccessControl.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/access/IAccessControlEnumerable.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/access/Ownable.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/proxy/ERC1967Proxy.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/proxy/ERC1967Upgrade.sol::4 => pragma solidity ^0.8.2;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/proxy/IBeacon.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/proxy/Proxy.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/proxy/ProxyAdmin.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/proxy/TransparentUpgradeableProxy.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/proxy/draft-IERC1822.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/security/Pausable.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/security/ReentrancyGuard.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/token/ERC20.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/token/IERC20.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/token/IERC20Metadata.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/cont", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/Dinesh11G-Q.md", "collected_at": "2026-01-02T18:14:36.905005+00:00", "source_hash": "9e094d47ac9c61fff94b8bc83642f8a4df8f5f48193eb0734f38ed305a3536cc", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 93, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "2023-01-ondo/contracts/lending/compound/Comptroller.sol::1695 => comp.transfer(user, amount);", "primary_code_language": "unknown", "primary_code_char_count": 93, "all_code_blocks": "// Code block 1 (unknown):\n2023-01-ondo/contracts/lending/compound/Comptroller.sol::1695 => comp.transfer(user, amount);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "2023-01-ondo/contracts/lending/compound/Comptroller.sol::1695 => comp.transfer(user, amount);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "2023-01-ondo/contracts/cash/external/openzeppelin/contracts/access/AccessControl.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/access/AccessControlEnumerable.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/access/IAccessControl.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/access/IAccessControlEnumerable.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/access/Ownable.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/proxy/ERC1967Proxy.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/proxy/ERC1967Upgrade.sol::4 => pragma solidity ^0.8.2;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/proxy/IBeacon.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/proxy/Proxy.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/proxy/ProxyAdmin.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/proxy/TransparentUpgradeableProxy.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/proxy/draft-IERC1822.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/security/Pausable.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/security/ReentrancyGuard.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/token/ERC20.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/token/IERC20.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/contracts/token/IERC20Metadata.sol::4 => pragma solidity ^0.8.0;\n2023-01-ondo/contracts/cash/external/openzeppelin/cont", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "02-ethos", "title": "Diana Q", "severity_raw": "Medium", "severity": "medium", "description": "| S No. | Issue | Instances |\n|-----|-----|-----|\n| [01] | Best practice is to prevent signature malleability | 1\n| [02] | Large multiples of ten should use scientific notation | 6\n| [03] | Require() should be used instead of assert() | 20\n| [04] | Upgradeable contract is missing a \\_\\_gap[50] storage variable to allow for new storage variables in later versions | 3\n| [05] | Adding a return statement when the function defines a named return variable, is redundant | 18\n| [06] | Use a more recent version of solidity | 12 \n| [07] | Non-library or interface files should use fixed compiler versions, not floating ones | 4\n| [08] | Use named imports instead of plain 'import file.sol' | 110\n\n-------------\n\n## 01 Best practice is to prevent signature malleability\n\nUse OpenZeppelin\u2019s\u00a0`ECDSA`\u00a0contract rather than calling\u00a0`ecrecover()`\u00a0directly\n\n_There is 1 instance of this issue_\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol\n\n```\nFile: Ethos-Core/contracts/LUSDToken.sol\n\n287: address recoveredAddress = ecrecover(digest, v, r, s);\n```\n\n-----\n\n## 02 Large multiples of ten should use scientific notation\n\nUse (e.g. 1e12) rather than decimal literals (e.g. 1000000000000), for better code readability\n\n_There are 6 instances of this issue_\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol\n\n```\nFile: Ethos-Core/contracts/ActivePool.sol\n\n127: require(_bps <= 10_000, \"Invalid BPS value\");\n145: require(_treasurySplit + _SPSplit + _stakingSplit == 10_000, \"Splits must add up to 10000 BPS\");\n258: vars.percentOfFinalBal = vars.finalBalance == 0 ? uint256(-1) : vars.currentAllocated.mul(10_000).div(vars.finalBalance);\n262: vars.finalYieldingAmount = vars.finalBalance.mul(vars.yieldingPercentage).div(10_000);\n291: vars.treasurySplit = vars.profit.mul(yieldSplitTreasury).div(10_000);\n296: vars.stakingSplit = vars.profit.mul(yieldSplitStaking).div(10_000);\n```\n\n----------\n\n## 03 Require() should be used instead", "vulnerable_code": "File: Ethos-Core/contracts/LUSDToken.sol\n\n287: address recoveredAddress = ecrecover(digest, v, r, s);", "fixed_code": "File: Ethos-Core/contracts/ActivePool.sol\n\n127: require(_bps <= 10_000, \"Invalid BPS value\");\n145: require(_treasurySplit + _SPSplit + _stakingSplit == 10_000, \"Splits must add up to 10000 BPS\");\n258: vars.percentOfFinalBal = vars.finalBalance == 0 ? uint256(-1) : vars.currentAllocated.mul(10_000).div(vars.finalBalance);\n262: vars.finalYieldingAmount = vars.finalBalance.mul(vars.yieldingPercentage).div(10_000);\n291: vars.treasurySplit = vars.profit.mul(yieldSplitTreasury).div(10_000);\n296: vars.stakingSplit = vars.profit.mul(yieldSplitStaking).div(10_000);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/Diana-Q.md", "collected_at": "2026-01-02T18:16:09.851084+00:00", "source_hash": "9e33db528f09bd6e62bd8b1710dbd1d9fc7df898656315bc3f7cb42d59b5b356", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 663, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: Ethos-Core/contracts/LUSDToken.sol\n\n287: address recoveredAddress = ecrecover(digest, v, r, s);", "primary_code_language": "unknown", "primary_code_char_count": 101, "all_code_blocks": "// Code block 1 (unknown):\nFile: Ethos-Core/contracts/LUSDToken.sol\n\n287: address recoveredAddress = ecrecover(digest, v, r, s);\n\n// Code block 2 (unknown):\nFile: Ethos-Core/contracts/ActivePool.sol\n\n127: require(_bps <= 10_000, \"Invalid BPS value\");\n145: require(_treasurySplit + _SPSplit + _stakingSplit == 10_000, \"Splits must add up to 10000 BPS\");\n258: vars.percentOfFinalBal = vars.finalBalance == 0 ? uint256(-1) : vars.currentAllocated.mul(10_000).div(vars.finalBalance);\n262: vars.finalYieldingAmount = vars.finalBalance.mul(vars.yieldingPercentage).div(10_000);\n291: vars.treasurySplit = vars.profit.mul(yieldSplitTreasury).div(10_000);\n296: vars.stakingSplit = vars.profit.mul(yieldSplitStaking).div(10_000);", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LUSDToken.sol, ActivePool.sol", "github_files_list": "LUSDToken.sol, ActivePool.sol", "github_refs_count": 2, "vulnerable_code_actual": "File: Ethos-Core/contracts/LUSDToken.sol\n\n287: address recoveredAddress = ecrecover(digest, v, r, s);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: Ethos-Core/contracts/ActivePool.sol\n\n127: require(_bps <= 10_000, \"Invalid BPS value\");\n145: require(_treasurySplit + _SPSplit + _stakingSplit == 10_000, \"Splits must add up to 10000 BPS\");\n258: vars.percentOfFinalBal = vars.finalBalance == 0 ? uint256(-1) : vars.currentAllocated.mul(10_000).div(vars.finalBalance);\n262: vars.finalYieldingAmount = vars.finalBalance.mul(vars.yieldingPercentage).div(10_000);\n291: vars.treasurySplit = vars.profit.mul(yieldSplitTreasury).div(10_000);\n296: vars.stakingSplit = vars.profit.mul(yieldSplitStaking).div(10_000);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "03-asymmetry", "title": "IceBear Q", "severity_raw": "Critical", "severity": "critical", "description": "## Non Critical Issues\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [N-1](#N-1) | Large multiples of ten should use scientific notation rather than decimal literals, for readability | 21 |\n| [N-2](#N-2) | Unused imports | 6 |\n| [N-3](#N-3) | Unused parameters | 2 |\n| [N-4](#N-4) | For modern and more readable code; update import usages | 31 |\n\n## Low Issues\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [L-1](#L-1) |Use ownable2stepupgradeable instead of ownableupgradeable contract | 4 |\n| [L-2](#L-2) | Non-library/interface files should use fixed compiler versions, not floating ones | 4 |\n| [L-3](#L-3) | Unused/Empty RECEIVE()/FALLBACK() function | 4 |\n| [L-4](#L-4) | Use of hard-coded addresses may cause errors | 11 |\n| [L-5](#L-5) | initialize() function can be called by anybody | 7 |\n|[L-6](#L-6) | No storage gap for upgradeable contract might lead to storage slot collision | 5 |\n|[L-7](#L-7) | Lack of events emission after sensitive actions | 9 |\n\n### [N-1] Large multiples of ten should use scientific notation rather than decimal literals, for readability\n#### Recommendation\nScientific notation should be used for better code readability.\nUse scientific notation (e.g. 1e18, 1e5) rather than exponentiation (e.g. 10**18, 100000).\n\n*Find (21) instance(s) in contracts*:\n```solidity\nFile: SafEth/SafEth.sol\n\n54: minAmount = 5 * 10 ** 17; // initializing with .5 ETH as minimum\n\n55: maxAmount = 200 * 10 ** 18; // initializing with 200 ETH as maximum\n\n75: 10 ** 18;\n\n80: preDepositPrice = 10 ** 18; // initializes with a price of 1\n\n81: else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n\n94: ) * depositAmount) / 10 ** 18;\n\n98: uint256 mintAmount = (totalStakeValueEth * 10 ** 18) / preDepositPrice;\n\n```\n[SafEth/SafEth.sol](https://github.com/code-423n4/2023-03-asymmetry/tree/main/contracts/SafEth/SafEth.sol)\n\n```solidity\nFile: SafEth/derivatives/Reth.sol\n\n44: maxSlippage = (1 * 10 ** 16); // 1%\n\n171: ", "vulnerable_code": "File: SafEth/SafEth.sol\n\n54: minAmount = 5 * 10 ** 17; // initializing with .5 ETH as minimum\n\n55: maxAmount = 200 * 10 ** 18; // initializing with 200 ETH as maximum\n\n75: 10 ** 18;\n\n80: preDepositPrice = 10 ** 18; // initializes with a price of 1\n\n81: else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n\n94: ) * depositAmount) / 10 ** 18;\n\n98: uint256 mintAmount = (totalStakeValueEth * 10 ** 18) / preDepositPrice;\n", "fixed_code": "File: SafEth/derivatives/Reth.sol\n\n44: maxSlippage = (1 * 10 ** 16); // 1%\n\n171: uint rethPerEth = (10 ** 36) / poolPrice();\n\n173: uint256 minOut = ((((rethPerEth * msg.value) / 10 ** 18) *\n\n174: ((10 ** 18 - maxSlippage))) / 10 ** 18);\n\n214: RocketTokenRETHInterface(rethAddress()).getEthValue(10 ** 18);\n\n215: else return (poolPrice() * 10 ** 18) / (10 ** 18);\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/IceBear-Q.md", "collected_at": "2026-01-02T18:18:07.897507+00:00", "source_hash": "9e49d91cc5c7071624832fc7adfca85024d168f74df4b01c293eb7098b9101a0", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 504, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: SafEth/SafEth.sol\n\n54: minAmount = 5 * 10 ** 17; // initializing with .5 ETH as minimum\n\n55: maxAmount = 200 * 10 ** 18; // initializing with 200 ETH as maximum\n\n75: 10 ** 18;\n\n80: preDepositPrice = 10 ** 18; // initializes with a price of 1\n\n81: else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n\n94: ) * depositAmount) / 10 ** 18;\n\n98: uint256 mintAmount = (totalStakeValueEth * 10 ** 18) / preDepositPrice;", "primary_code_language": "solidity", "primary_code_char_count": 504, "all_code_blocks": "// Code block 1 (solidity):\nFile: SafEth/SafEth.sol\n\n54: minAmount = 5 * 10 ** 17; // initializing with .5 ETH as minimum\n\n55: maxAmount = 200 * 10 ** 18; // initializing with 200 ETH as maximum\n\n75: 10 ** 18;\n\n80: preDepositPrice = 10 ** 18; // initializes with a price of 1\n\n81: else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n\n94: ) * depositAmount) / 10 ** 18;\n\n98: uint256 mintAmount = (totalStakeValueEth * 10 ** 18) / preDepositPrice;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: SafEth/SafEth.sol\n\n54: minAmount = 5 * 10 ** 17; // initializing with .5 ETH as minimum\n\n55: maxAmount = 200 * 10 ** 18; // initializing with 200 ETH as maximum\n\n75: 10 ** 18;\n\n80: preDepositPrice = 10 ** 18; // initializes with a price of 1\n\n81: else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n\n94: ) * depositAmount) / 10 ** 18;\n\n98: uint256 mintAmount = (totalStakeValueEth * 10 ** 18) / preDepositPrice;", "github_refs_formatted": "SafEth.sol", "github_files_list": "SafEth.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: SafEth/SafEth.sol\n\n54: minAmount = 5 * 10 ** 17; // initializing with .5 ETH as minimum\n\n55: maxAmount = 200 * 10 ** 18; // initializing with 200 ETH as maximum\n\n75: 10 ** 18;\n\n80: preDepositPrice = 10 ** 18; // initializes with a price of 1\n\n81: else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n\n94: ) * depositAmount) / 10 ** 18;\n\n98: uint256 mintAmount = (totalStakeValueEth * 10 ** 18) / preDepositPrice;\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: SafEth/derivatives/Reth.sol\n\n44: maxSlippage = (1 * 10 ** 16); // 1%\n\n171: uint rethPerEth = (10 ** 36) / poolPrice();\n\n173: uint256 minOut = ((((rethPerEth * msg.value) / 10 ** 18) *\n\n174: ((10 ** 18 - maxSlippage))) / 10 ** 18);\n\n214: RocketTokenRETHInterface(rethAddress()).getEthValue(10 ** 18);\n\n215: else return (poolPrice() * 10 ** 18) / (10 ** 18);\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "11-kelp", "title": "LinKenji Q", "severity_raw": "Low", "severity": "low", "description": "## Titlte: Suboptimal Inheritance in `ChainlinkPriceOracle`.\n\n## Impact\n\nThe `ChainlinkPriceOracle` contract inherits from `IPriceFetcher` instead of directly implementing the `ILRTOracle` interface. This is confusing and doesn't fully capture the intent that this is an oracle implementation.\n\n## Proof of Concept\n\n**[ChainlinkPriceOracle.sol](https://github.com/code-423n4/2023-11-kelp/blob/4b34abc952205e2a34bff893a0de0c75b8052149/src/oracles/ChainlinkPriceOracle.sol#L15-L19)**\n\n```solidity\n/// @title ChainlinkPriceOracle Contract \n/// @notice contract that fetches the exchange rate of assets from chainlink price feeds\ncontract ChainlinkPriceOracle is IPriceFetcher, LRTConfigRoleChecker, Initializable {\n\n // ...\n\n}\n```\n\nThis shows `ChainlinkPriceOracle` inheriting from `IPriceFetcher` instead of `ILRTOracle`.\n\nThe `ChainlinkPriceOracle` contract currently inherits from:\n\n- `IPriceFetcher` \n- `LRTConfigRoleChecker`\n- `Initializable`\n\nBut since this is a specific implementation of the `ILRTOracle` interface, it would be clearer to do:\n\n```solidity\ncontract ChainlinkPriceOracle is ILRTOracle, LRTConfigRoleChecker, Initializable {\n\n // ...\n\n}\n```\n\nThe benefits:\n\n- Makes the intent more clear - this implements the oracle interface\n\n- Avoids confusing naming with `IPriceFetcher`\n\n- Allows directly implementing `ILRTOracle` methods\n\nSo in summary, changing the inheritance to directly implement the oracle interface better captures the intent and simplifies the contract API.\n\n## Recommended Mitigation\n\nChange the inheritance to:\n\n```solidity \ncontract ChainlinkPriceOracle is ILRTOracle, LRTConfigRoleChecker, Initializable {\n\n // ...\n\n}\n```\n\nDirectly inheriting from the oracle interface better conveys that this is an implementation contract.\n\n\n## Title: Unnecessary Max Token Approval in NodeDelegator.\n\n## Impact\n\nThe `maxApproveToEigenStrategyManager` function approves the EigenLayer manager contract to spend max uint256 tokens from the NodeDelegator. However, `depositAsset", "vulnerable_code": "/// @title ChainlinkPriceOracle Contract \n/// @notice contract that fetches the exchange rate of assets from chainlink price feeds\ncontract ChainlinkPriceOracle is IPriceFetcher, LRTConfigRoleChecker, Initializable {\n\n // ...\n\n}", "fixed_code": "contract ChainlinkPriceOracle is ILRTOracle, LRTConfigRoleChecker, Initializable {\n\n // ...\n\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/LinKenji-Q.md", "collected_at": "2026-01-02T18:27:30.915844+00:00", "source_hash": "9e6c0943e7ad9426ac360cf2db6d99f2a5e7b0ce263fd7e2efe3b674ecc9f5d1", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 324, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "/// @title ChainlinkPriceOracle Contract \n/// @notice contract that fetches the exchange rate of assets from chainlink price feeds\ncontract ChainlinkPriceOracle is IPriceFetcher, LRTConfigRoleChecker, Initializable {\n\n // ...\n\n}", "primary_code_language": "solidity", "primary_code_char_count": 229, "all_code_blocks": "// Code block 1 (solidity):\n/// @title ChainlinkPriceOracle Contract \n/// @notice contract that fetches the exchange rate of assets from chainlink price feeds\ncontract ChainlinkPriceOracle is IPriceFetcher, LRTConfigRoleChecker, Initializable {\n\n // ...\n\n}\n\n// Code block 2 (solidity):\ncontract ChainlinkPriceOracle is ILRTOracle, LRTConfigRoleChecker, Initializable {\n\n // ...\n\n}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "/// @title ChainlinkPriceOracle Contract \n/// @notice contract that fetches the exchange rate of assets from chainlink price feeds\ncontract ChainlinkPriceOracle is IPriceFetcher, LRTConfigRoleChecker, Initializable {\n\n // ...\n\n}\n\ncontract ChainlinkPriceOracle is ILRTOracle, LRTConfigRoleChecker, Initializable {\n\n // ...\n\n}", "github_refs_formatted": "ChainlinkPriceOracle.sol#L15-L19", "github_files_list": "ChainlinkPriceOracle.sol", "github_refs_count": 1, "vulnerable_code_actual": "/// @title ChainlinkPriceOracle Contract \n/// @notice contract that fetches the exchange rate of assets from chainlink price feeds\ncontract ChainlinkPriceOracle is IPriceFetcher, LRTConfigRoleChecker, Initializable {\n\n // ...\n\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "contract ChainlinkPriceOracle is ILRTOracle, LRTConfigRoleChecker, Initializable {\n\n // ...\n\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "04-caviar", "title": "Jorgect G", "severity_raw": "Low", "severity": "low", "description": "# GAS REPORT\n\n## G-1 Use internal functions insted of public function.\n \ninternal functions are likely to be less gas expensive than public functions. This is because internal functions can only be called from within the same contract and do not need to go through the EVM's message-passing system, which can add additional gas costs.\n\nit should change the functions below not only because internal function are more cheaper, also for security reason:\n\n\n```\ncontract Factory.sol line 136\nfunction setPrivatePoolImplementation(address _privatePoolImplementation) public onlyOwner {\n privatePoolImplementation = _privatePoolImplementation;\n }\n```\n\n```\ncontract PrivateFacotry.sol line 877\n function sumWeightsAndValidateProof(\n uint256[] memory tokenIds,\n uint256[] memory tokenWeights,\n MerkleMultiProof memory proof\n ) public view returns (uint256) \n```\n\n```\ncontract PrivateFacotry.sol line 921\n function buyQuote(\n uint256 outputAmount\n )\n public\n view\n returns (\n uint256 netInputAmount,\n uint256 feeAmount,\n uint256 protocolFeeAmount\n )\n```\n\n```\ncontract PrivateFacotry.sol line 978\n function changeFeeQuote(\n uint256 inputAmount\n ) public view returns (uint256 feeAmount, uint256 protocolFeeAmount)\n```\n\n### the next functions can be change to external\n1. contract PrivateFacotry.sol line 254 \n2. contract PrivateFacotry.sol line 507\n3. contract PrivateFacotry.sol line 385\n4. contract PrivateFacotry.sol line 655\n5. contract PrivateFacotry.sol line 699\n6. contract PrivateFacotry.sol line 734\n7. contract PrivateFacotry.sol line 752\n8. contract PrivateFacotry.sol line 764\n9. contract PrivateFacotry.sol line 778\n10. contract PrivateFacotry.sol line 791\n11. contract PrivateFacotry.sol line 807", "vulnerable_code": "contract Factory.sol line 136\nfunction setPrivatePoolImplementation(address _privatePoolImplementation) public onlyOwner {\n privatePoolImplementation = _privatePoolImplementation;\n }", "fixed_code": "contract PrivateFacotry.sol line 877\n function sumWeightsAndValidateProof(\n uint256[] memory tokenIds,\n uint256[] memory tokenWeights,\n MerkleMultiProof memory proof\n ) public view returns (uint256) ", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/Jorgect-G.md", "collected_at": "2026-01-02T18:19:44.135774+00:00", "source_hash": "9e889eb6598b1d75912e7ddf8f0ed23815059a7ace6b18b9b07b357327a30828", "code_block_count": 4, "solidity_block_count": 0, "total_code_chars": 831, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "contract Factory.sol line 136\nfunction setPrivatePoolImplementation(address _privatePoolImplementation) public onlyOwner {\n privatePoolImplementation = _privatePoolImplementation;\n }", "primary_code_language": "unknown", "primary_code_char_count": 192, "all_code_blocks": "// Code block 1 (unknown):\ncontract Factory.sol line 136\nfunction setPrivatePoolImplementation(address _privatePoolImplementation) public onlyOwner {\n privatePoolImplementation = _privatePoolImplementation;\n }\n\n// Code block 2 (unknown):\ncontract PrivateFacotry.sol line 877\n function sumWeightsAndValidateProof(\n uint256[] memory tokenIds,\n uint256[] memory tokenWeights,\n MerkleMultiProof memory proof\n ) public view returns (uint256)\n\n// Code block 3 (unknown):\ncontract PrivateFacotry.sol line 921\n function buyQuote(\n uint256 outputAmount\n )\n public\n view\n returns (\n uint256 netInputAmount,\n uint256 feeAmount,\n uint256 protocolFeeAmount\n )\n\n// Code block 4 (unknown):\ncontract PrivateFacotry.sol line 978\n function changeFeeQuote(\n uint256 inputAmount\n ) public view returns (uint256 feeAmount, uint256 protocolFeeAmount)", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "contract Factory.sol line 136\nfunction setPrivatePoolImplementation(address _privatePoolImplementation) public onlyOwner {\n privatePoolImplementation = _privatePoolImplementation;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "contract PrivateFacotry.sol line 877\n function sumWeightsAndValidateProof(\n uint256[] memory tokenIds,\n uint256[] memory tokenWeights,\n MerkleMultiProof memory proof\n ) public view returns (uint256) ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "05-ajna", "title": "Audit_Avengers G", "severity_raw": "Medium", "severity": "medium", "description": "## Gas Optimizations\n\n```markdown\n\n| | Issue | Instances | Gas |\n| :-------------: | :-----------------------------------------------------------: | :-------: | :-----: |\n| [GAS-1](#GAS-1) | Variable can be left undeclared in memory | 1 | 3 |\n| [GAS-2](#GAS-2) | Define `constant` variable instead of hardcoding in function | 3 | 5-10 |\n| [GAS-3](#GAS-3) | Multiple accesses directly to state variable | 6 | 20000 |\n| [GAS-4](#GAS-4) | Variables need not be initialized to zero | 20 | - |\n| [GAS-5](#GAS-5) | Pre-perform typecasting in `curBurnEpoch` | 1 | 3 |\n```\n\n\n\n### [GAS-1] Variable can be left undeclared in memory\n\n_Instances (1)_:\n\n```solidity\nFile: /ajna-grants/src/grants/GrantFund.sol\n45: function state(uint256 proposalId_)\n\t\t external\n\t\t view\n\t\t override\n\t\t returns (ProposalState)\n\t\t {\n\t\t FundingMechanism mechanism = findMechanismOfProposal(proposalId_);\n\t\t\n\t\t return\n\t\t mechanism == FundingMechanism.Standard\n\n```\n\n[Link to code](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/GrantFund.sol#L48)\n\n_Recommended: As `findMechanismOfProposal()` returns a struct of FundingMechanism\nIt is better to directly compare `mechanism == findMechanismOfProposal(proposalId_)` instead.\n\n
\n\n\n\n### [GAS-2] Define `constant` variable instead of hardcoding in function\n\n_Instances (3)_:\n\n```solidity\nFile: /ajna-grants/src/grants/GrantFund.sol\n208: if (_fundedExtraordinaryProposals.length == 0) {\n return 0.5 * 1e18;\n }\n else {\n return 0.5 * 1e18 + (_fundedExtraordinaryProposals.length * (0.05 * 1e18));\n }\n\n```\n\n[Link to code](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/", "vulnerable_code": "\n### [GAS-1] Variable can be left undeclared in memory\n\n_Instances (1)_:\n", "fixed_code": "[Link to code](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/GrantFund.sol#L48)\n\n_Recommended: As `findMechanismOfProposal()` returns a struct of FundingMechanism\nIt is better to directly compare `mechanism == findMechanismOfProposal(proposalId_)` instead.\n\n
\n\n\n\n### [GAS-2] Define `constant` variable instead of hardcoding in function\n\n_Instances (3)_:\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/Audit_Avengers-G.md", "collected_at": "2026-01-02T18:20:53.129575+00:00", "source_hash": "9e9a128715d25161e880bf6e34b157a7eef735f76373b982659cb1a36d869039", "code_block_count": 3, "solidity_block_count": 2, "total_code_chars": 1326, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "| | Issue | Instances | Gas |\n| :-------------: | :-----------------------------------------------------------: | :-------: | :-----: |\n| [GAS-1](#GAS-1) | Variable can be left undeclared in memory | 1 | 3 |\n| [GAS-2](#GAS-2) | Define `constant` variable instead of hardcoding in function | 3 | 5-10 |\n| [GAS-3](#GAS-3) | Multiple accesses directly to state variable | 6 | 20000 |\n| [GAS-4](#GAS-4) | Variables need not be initialized to zero | 20 | - |\n| [GAS-5](#GAS-5) | Pre-perform typecasting in `curBurnEpoch` | 1 | 3 |", "primary_code_language": "markdown", "primary_code_char_count": 741, "all_code_blocks": "// Code block 1 (markdown):\n| | Issue | Instances | Gas |\n| :-------------: | :-----------------------------------------------------------: | :-------: | :-----: |\n| [GAS-1](#GAS-1) | Variable can be left undeclared in memory | 1 | 3 |\n| [GAS-2](#GAS-2) | Define `constant` variable instead of hardcoding in function | 3 | 5-10 |\n| [GAS-3](#GAS-3) | Multiple accesses directly to state variable | 6 | 20000 |\n| [GAS-4](#GAS-4) | Variables need not be initialized to zero | 20 | - |\n| [GAS-5](#GAS-5) | Pre-perform typecasting in `curBurnEpoch` | 1 | 3 |\n\n// Code block 2 (solidity):\nFile: /ajna-grants/src/grants/GrantFund.sol\n45: function state(uint256 proposalId_)\n\t\t external\n\t\t view\n\t\t override\n\t\t returns (ProposalState)\n\t\t {\n\t\t FundingMechanism mechanism = findMechanismOfProposal(proposalId_);\n\t\t\n\t\t return\n\t\t mechanism == FundingMechanism.Standard\n\n// Code block 3 (solidity):\nFile: /ajna-grants/src/grants/GrantFund.sol\n208: if (_fundedExtraordinaryProposals.length == 0) {\n return 0.5 * 1e18;\n }\n else {\n return 0.5 * 1e18 + (_fundedExtraordinaryProposals.length * (0.05 * 1e18));\n }", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: /ajna-grants/src/grants/GrantFund.sol\n45: function state(uint256 proposalId_)\n\t\t external\n\t\t view\n\t\t override\n\t\t returns (ProposalState)\n\t\t {\n\t\t FundingMechanism mechanism = findMechanismOfProposal(proposalId_);\n\t\t\n\t\t return\n\t\t mechanism == FundingMechanism.Standard\n\nFile: /ajna-grants/src/grants/GrantFund.sol\n208: if (_fundedExtraordinaryProposals.length == 0) {\n return 0.5 * 1e18;\n }\n else {\n return 0.5 * 1e18 + (_fundedExtraordinaryProposals.length * (0.05 * 1e18));\n }", "github_refs_formatted": "GrantFund.sol#L48", "github_files_list": "GrantFund.sol", "github_refs_count": 1, "vulnerable_code_actual": "\n### [GAS-1] Variable can be left undeclared in memory\n\n_Instances (1)_:\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "[Link to code](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/GrantFund.sol#L48)\n\n_Recommended: As `findMechanismOfProposal()` returns a struct of FundingMechanism\nIt is better to directly compare `mechanism == findMechanismOfProposal(proposalId_)` instead.\n\n
\n\n\n\n### [GAS-2] Define `constant` variable instead of hardcoding in function\n\n_Instances (3)_:\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "11-kelp", "title": "leegh Q", "severity_raw": "High", "severity": "high", "description": "# [N-01] Incorrect variable comment.\nThe comment should be \"rsETH address\" instead of \"cbETH address\".\n```solidity\nFile: src/LRTConfig.sol\n\n40: /// @param rsETH_ cbETH address\n```\n[L40](https://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTConfig.sol#L40)\n\n# [N-02] Use same role limit for update asset information.\nConsider use ```onlyRole(LRTConstants.MANAGER)``` for ```updateAssetStrategy```. Because ```updateAssetDepositLimit``` limit to MANAGER role, and the two functions are both used to change asset's information.\n```solidity\nFile: src/LRTConfig.sol\n109: function updateAssetStrategy(\n110: address asset,\n111: address strategy\n112: )\n113: external\n114: onlyRole(DEFAULT_ADMIN_ROLE)\n```\n[L109-L114](https://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTConfig.sol#L109-L114)", "vulnerable_code": "File: src/LRTConfig.sol\n\n40: /// @param rsETH_ cbETH address", "fixed_code": "File: src/LRTConfig.sol\n109: function updateAssetStrategy(\n110: address asset,\n111: address strategy\n112: )\n113: external\n114: onlyRole(DEFAULT_ADMIN_ROLE)", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/leegh-Q.md", "collected_at": "2026-01-02T18:28:13.173915+00:00", "source_hash": "9ebcf889c0efd9bb41a5c3473bb6e6d0cdcdccf5259f9210a6160ab467037612", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 252, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: src/LRTConfig.sol\n\n40: /// @param rsETH_ cbETH address", "primary_code_language": "solidity", "primary_code_char_count": 63, "all_code_blocks": "// Code block 1 (solidity):\nFile: src/LRTConfig.sol\n\n40: /// @param rsETH_ cbETH address\n\n// Code block 2 (solidity):\nFile: src/LRTConfig.sol\n109: function updateAssetStrategy(\n110: address asset,\n111: address strategy\n112: )\n113: external\n114: onlyRole(DEFAULT_ADMIN_ROLE)", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: src/LRTConfig.sol\n\n40: /// @param rsETH_ cbETH address\n\nFile: src/LRTConfig.sol\n109: function updateAssetStrategy(\n110: address asset,\n111: address strategy\n112: )\n113: external\n114: onlyRole(DEFAULT_ADMIN_ROLE)", "github_refs_formatted": "LRTConfig.sol#L40, LRTConfig.sol#L109-L114", "github_files_list": "LRTConfig.sol", "github_refs_count": 2, "vulnerable_code_actual": "File: src/LRTConfig.sol\n\n40: /// @param rsETH_ cbETH address", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: src/LRTConfig.sol\n109: function updateAssetStrategy(\n110: address asset,\n111: address strategy\n112: )\n113: external\n114: onlyRole(DEFAULT_ADMIN_ROLE)", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6.67} {"source": "c4", "protocol": "11-kelp", "title": "hihen G", "severity_raw": "High", "severity": "high", "description": "# Gas Report\n\n## Summary\n\nTotal **27 instances** over **5 issues**with **27395** gas saved:\n\n|ID|Issue|Instances|Gas|\n|:--:|:---|:--:|:--:|\n| [[G-01]](#g-01-using-private-for-constants-saves-gas) | Using `private` for constants saves gas | 8 | 27248 |\n| [[G-02]](#g-02-do-not-cache-state-variables-that-are-used-only-once) | Do not cache state variables that are used only once | 1 | 3 |\n| [[G-03]](#g-03-initializers-can-be-marked-as-payable-to-save-deployment-gas) | Initializers can be marked as payable to save deployment gas | 6 | 126 |\n| [[G-04]](#g-04-using-assembly-to-check-for-zero-can-save-gas) | Using assembly to check for zero can save gas | 3 | 18 |\n| [[G-05]](#g-05-newer-versions-of-solidity-are-more-gas-efficient) | Newer versions of solidity are more gas efficient | 9 | - |\n\n## Gas Optimizations\n\n### [G-01] Using `private` for constants saves gas\n\nIf needed, the values can be read from the verified contract source code, or if there are multiple values there can be a single getter function that [returns a tuple](https://github.com/code-423n4/2022-08-frax/blob/90f55a9ce4e25bceed3a74290b854341d8de6afa/src/contracts/FraxlendPair.sol#L156-L178) of the values of all currently-public constants. Saves **3406-3606 gas** in deployment gas due to the compiler not having to create non-payable getter functions for deployment calldata, not having to store the bytes of the value outside of where it's used, and not adding another entry to the method ID table\n\nThere are 8 instances:\n\n- *RSETH.sol* ( [21](https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/RSETH.sol#L21) ):\n\n```solidity\n21: bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n```\n\n- *LRTConstants.sol* ( [7](https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/utils/LRTConstants.sol#L7), [9](https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/utils/LRTConstants.sol#L9), [11", "vulnerable_code": "21: bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");", "fixed_code": "7: bytes32 public constant R_ETH_TOKEN = keccak256(\"R_ETH_TOKEN\");\n\n9: bytes32 public constant ST_ETH_TOKEN = keccak256(\"ST_ETH_TOKEN\");\n\n11: bytes32 public constant CB_ETH_TOKEN = keccak256(\"CB_ETH_TOKEN\");\n\n14: bytes32 public constant LRT_ORACLE = keccak256(\"LRT_ORACLE\");\n\n15: bytes32 public constant LRT_DEPOSIT_POOL = keccak256(\"LRT_DEPOSIT_POOL\");\n\n16: bytes32 public constant EIGEN_STRATEGY_MANAGER = keccak256(\"EIGEN_STRATEGY_MANAGER\");\n\n19: bytes32 public constant MANAGER = keccak256(\"MANAGER\");", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/hihen-G.md", "collected_at": "2026-01-02T18:28:05.939026+00:00", "source_hash": "9ec478a5e84e27682119e79ae6f96a696ec98d260fa390987ba404238a603f57", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 71, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "21: bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");", "primary_code_language": "solidity", "primary_code_char_count": 71, "all_code_blocks": "// Code block 1 (solidity):\n21: bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "21: bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");", "github_refs_formatted": "FraxlendPair.sol#L156-L178, RSETH.sol#L21, LRTConstants.sol#L7, LRTConstants.sol#L9", "github_files_list": "FraxlendPair.sol, RSETH.sol, LRTConstants.sol", "github_refs_count": 4, "vulnerable_code_actual": "21: bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": "7: bytes32 public constant R_ETH_TOKEN = keccak256(\"R_ETH_TOKEN\");\n\n9: bytes32 public constant ST_ETH_TOKEN = keccak256(\"ST_ETH_TOKEN\");\n\n11: bytes32 public constant CB_ETH_TOKEN = keccak256(\"CB_ETH_TOKEN\");\n\n14: bytes32 public constant LRT_ORACLE = keccak256(\"LRT_ORACLE\");\n\n15: bytes32 public constant LRT_DEPOSIT_POOL = keccak256(\"LRT_DEPOSIT_POOL\");\n\n16: bytes32 public constant EIGEN_STRATEGY_MANAGER = keccak256(\"EIGEN_STRATEGY_MANAGER\");\n\n19: bytes32 public constant MANAGER = keccak256(\"MANAGER\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "05-ajna", "title": "Praise Q", "severity_raw": "Low", "severity": "low", "description": "[L-01] ## _hashProposal() doesn't check to ensure the amounts of Eth to send and calldata to send equals the number of addresses to call\n```\n function _hashProposal(\n address[] memory targets_,\n uint256[] memory values_,\n bytes[] memory calldatas_,\n bytes32 descriptionHash_\n ) internal pure returns (uint256 proposalId_) {\n proposalId_ = uint256(keccak256(abi.encode(targets_, values_, calldatas_, descriptionHash_)));\n }\n```\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/Funding.sol#L152-L159", "vulnerable_code": " function _hashProposal(\n address[] memory targets_,\n uint256[] memory values_,\n bytes[] memory calldatas_,\n bytes32 descriptionHash_\n ) internal pure returns (uint256 proposalId_) {\n proposalId_ = uint256(keccak256(abi.encode(targets_, values_, calldatas_, descriptionHash_)));\n }", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/Praise-Q.md", "collected_at": "2026-01-02T18:21:07.508923+00:00", "source_hash": "9f773bb0c09c2c94367d0abd12d0c375823cc4163fd3243ed89ae2699b774547", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 321, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function _hashProposal(\n address[] memory targets_,\n uint256[] memory values_,\n bytes[] memory calldatas_,\n bytes32 descriptionHash_\n ) internal pure returns (uint256 proposalId_) {\n proposalId_ = uint256(keccak256(abi.encode(targets_, values_, calldatas_, descriptionHash_)));\n }", "primary_code_language": "unknown", "primary_code_char_count": 321, "all_code_blocks": "// Code block 1 (unknown):\nfunction _hashProposal(\n address[] memory targets_,\n uint256[] memory values_,\n bytes[] memory calldatas_,\n bytes32 descriptionHash_\n ) internal pure returns (uint256 proposalId_) {\n proposalId_ = uint256(keccak256(abi.encode(targets_, values_, calldatas_, descriptionHash_)));\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Funding.sol#L152-L159", "github_files_list": "Funding.sol", "github_refs_count": 1, "vulnerable_code_actual": " function _hashProposal(\n address[] memory targets_,\n uint256[] memory values_,\n bytes[] memory calldatas_,\n bytes32 descriptionHash_\n ) internal pure returns (uint256 proposalId_) {\n proposalId_ = uint256(keccak256(abi.encode(targets_, values_, calldatas_, descriptionHash_)));\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.22} {"source": "c4", "protocol": "01-biconomy", "title": "saneryee G", "severity_raw": "Medium", "severity": "medium", "description": "# Gas Optimizations Report\n\n| | Issue | Instances |\n| ------- | :--------------------------------------------------------------------------------------------------------------------------------- | :-------: |\n| [G-001] | x += y or x -= y costs more gas than x = x + y or x = x - y for state variables | 22 |\n| [G-002] | Splitting require() statements that use `&&` saves gas | 3 |\n| [G-003] | `storage` pointer to a structure is cheaper than copying each value of the structure into `memory`, same for `array` and `mapping` | 33 |\n| [G-004] | Functions guaranteed to revert when called by normal users can be marked payable | 10 |\n| [G-005] | internal functions only called once can be inlined to save gas | 9 |\n| [G-006] | Use named returns for local variables where it is possible. | 17 |\n\n## [G-001] x += y or x -= y costs more gas than x = x + y or x = x - y for state variables\n\n### Impact\n\nUsing the addition operator instead of plus-equals saves 113 gas. Usually does not work with struct and mappings.\n\n### Findings\n\nTotal:22\n\n[scw-contracts/contracts/smart-contract-wallet/libs/Math.sol#L222](https://github.com/code-423n4/2023-01-biconomy/tree/main//scw-contracts/contracts/smart-contract-wallet/libs/Math.sol#L222)\n\n```solidity\n222: result += 16;\n```\n\n[scw-contracts/contracts/smart-contract-wallet/libs/Math.sol#L271](https://github.com/code-423n4/2023-01-biconomy/tree/main//scw-contracts/contracts/smart-contract-wallet/libs/Math.sol#L271)\n\n```solidity\n271: result += 16;\n```\n\n[scw-contr", "vulnerable_code": "222: result += 16;", "fixed_code": "271: result += 16;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/saneryee-G.md", "collected_at": "2026-01-02T18:14:06.527246+00:00", "source_hash": "9f977880d6579ff2fee9c0f0544707a7fccddd6044370bbe88c00561a6127ab5", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 42, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "222: result += 16;", "primary_code_language": "solidity", "primary_code_char_count": 21, "all_code_blocks": "// Code block 1 (solidity):\n222: result += 16;\n\n// Code block 2 (solidity):\n271: result += 16;", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "222: result += 16;\n\n271: result += 16;", "github_refs_formatted": "Math.sol#L222, Math.sol#L271", "github_files_list": "Math.sol", "github_refs_count": 2, "vulnerable_code_actual": "222: result += 16;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "271: result += 16;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "09-ondo", "title": "twcctop Q", "severity_raw": "QA", "severity": "qa", "description": "1: \n\nwrap:error emit message \n\n```solidity \nfunction wrap(uint256 _USDYAmount) external whenNotPaused {\n require(_USDYAmount > 0, \"rUSDY: can't wrap zero USDY tokens\");\n _mintShares(msg.sender, _USDYAmount * BPS_DENOMINATOR); \n usdy.transferFrom(msg.sender, address(this), _USDYAmount);\n@> emit Transfer(address(0), msg.sender, getRUSDYByShares(_USDYAmount));//:qa why transfer from 0\n emit TransferShares(address(0), msg.sender, _USDYAmount);\n }\n```\nshouldn't transfer from zero,should be \n```solidity \n emit Transfer(msg.sender,address(this) , getRUSDYByShares(_USDYAmount));\n```\n\n\n\n2.\n_burnShares:error emit message \nhttps://github.com/code-423n4/2023-09-ondo/blob/3362e1252f3a54943e2517460e5a7988388bc821/contracts/usdy/rUSDY.sol#L575-L610\n```solidity\n\n function _burnShares(\n address _account,\n uint256 _sharesAmount\n ) internal whenNotPaused returns (uint256) {\n require(_account != address(0), \"BURN_FROM_THE_ZERO_ADDRESS\");\n\n _beforeTokenTransfer(_account, address(0), _sharesAmount);\n\n uint256 accountShares = shares[_account];\n require(_sharesAmount <= accountShares, \"BURN_AMOUNT_EXCEEDS_BALANCE\");\n\n@> uint256 preRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\n totalShares -= _sharesAmount;\n\n shares[_account] = accountShares - _sharesAmount;\n\n@> uint256 postRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\n emit SharesBurnt(\n _account,\n preRebaseTokenAmount,\n postRebaseTokenAmount,\n _sharesAmount\n );\n\n return totalShares;\n\n // Notice: we're not emitting a Transfer event to the zero address here since shares burn\n // works by redistributing the amount of tokens corresponding to the burned shares between\n // all other token holders. The total supply of the token doesn't change as the result.\n // This is equivalent to performing a send from `address` to each other token holder address,\n // but we cannot reflect this as it would require sending an unbounded number of eve", "vulnerable_code": "function wrap(uint256 _USDYAmount) external whenNotPaused {\n require(_USDYAmount > 0, \"rUSDY: can't wrap zero USDY tokens\");\n _mintShares(msg.sender, _USDYAmount * BPS_DENOMINATOR); \n usdy.transferFrom(msg.sender, address(this), _USDYAmount);\n@> emit Transfer(address(0), msg.sender, getRUSDYByShares(_USDYAmount));//:qa why transfer from 0\n emit TransferShares(address(0), msg.sender, _USDYAmount);\n }", "fixed_code": " emit Transfer(msg.sender,address(this) , getRUSDYByShares(_USDYAmount));", "recommendation": "", "category": "dos", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/twcctop-Q.md", "collected_at": "2026-01-02T18:26:19.817786+00:00", "source_hash": "9fb0b6b7d6112e257da8722c0b8c5fd12b34980259b4e3b4bcb708f9a1fcc695", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 197, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "shouldn't transfer from zero,should be", "primary_code_language": "unknown", "primary_code_char_count": 38, "all_code_blocks": "// Code block 1 (unknown):\nshouldn't transfer from zero,should be\n\n// Code block 2 (unknown):\n2.\n_burnShares:error emit message \nhttps://github.com/code-423n4/2023-09-ondo/blob/3362e1252f3a54943e2517460e5a7988388bc821/contracts/usdy/rUSDY.sol#L575-L610", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "rUSDY.sol#L575-L610", "github_files_list": "rUSDY.sol", "github_refs_count": 1, "vulnerable_code_actual": "function wrap(uint256 _USDYAmount) external whenNotPaused {\n require(_USDYAmount > 0, \"rUSDY: can't wrap zero USDY tokens\");\n _mintShares(msg.sender, _USDYAmount * BPS_DENOMINATOR); \n usdy.transferFrom(msg.sender, address(this), _USDYAmount);\n@> emit Transfer(address(0), msg.sender, getRUSDYByShares(_USDYAmount));//:qa why transfer from 0\n emit TransferShares(address(0), msg.sender, _USDYAmount);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " emit Transfer(msg.sender,address(this) , getRUSDYByShares(_USDYAmount));", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "02-ai-arena", "title": "Benterkiii Q", "severity_raw": "Informational", "severity": "informational", "description": "# Public functions that hasn't used internally can be external\n\nInstances (4)\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/AAMintPass.sol#L145\n```solidity\n function totalSupply() public view returns (uint256) {\n return numTokensOutstanding;\n }\n```\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/AAMintPass.sol#L150\n```solidity\n function contractURI() public pure returns (string memory) {\n return \"ipfs://bafybeifdvzwsjpxrkbyhqpz3y57j7nwm3eyyc3feqppqggslea3g5kk3jq\";\n }\n```\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterOps.sol#L53\n```solidity\n function fighterCreatedEmitter(\n```\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterOps.sol#L79\n```solidity\n function viewFighterInfo(\n```", "vulnerable_code": " function totalSupply() public view returns (uint256) {\n return numTokensOutstanding;\n }", "fixed_code": " function contractURI() public pure returns (string memory) {\n return \"ipfs://bafybeifdvzwsjpxrkbyhqpz3y57j7nwm3eyyc3feqppqggslea3g5kk3jq\";\n }", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/Benterkiii-Q.md", "collected_at": "2026-01-02T19:02:17.045253+00:00", "source_hash": "9fbd9723d407f95ef5983b281c752b88ee181666310f0732be3889ad96d8e0f6", "code_block_count": 4, "solidity_block_count": 4, "total_code_chars": 304, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function totalSupply() public view returns (uint256) {\n return numTokensOutstanding;\n }", "primary_code_language": "solidity", "primary_code_char_count": 97, "all_code_blocks": "// Code block 1 (solidity):\nfunction totalSupply() public view returns (uint256) {\n return numTokensOutstanding;\n }\n\n// Code block 2 (solidity):\nfunction contractURI() public pure returns (string memory) {\n return \"ipfs://bafybeifdvzwsjpxrkbyhqpz3y57j7nwm3eyyc3feqppqggslea3g5kk3jq\";\n }\n\n// Code block 3 (solidity):\nfunction fighterCreatedEmitter(\n\n// Code block 4 (solidity):\nfunction viewFighterInfo(", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function totalSupply() public view returns (uint256) {\n return numTokensOutstanding;\n }\n\nfunction contractURI() public pure returns (string memory) {\n return \"ipfs://bafybeifdvzwsjpxrkbyhqpz3y57j7nwm3eyyc3feqppqggslea3g5kk3jq\";\n }\n\nfunction fighterCreatedEmitter(\n\nfunction viewFighterInfo(", "github_refs_formatted": "AAMintPass.sol#L145, AAMintPass.sol#L150, FighterOps.sol#L53, FighterOps.sol#L79", "github_files_list": "AAMintPass.sol, FighterOps.sol", "github_refs_count": 4, "vulnerable_code_actual": " function totalSupply() public view returns (uint256) {\n return numTokensOutstanding;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function contractURI() public pure returns (string memory) {\n return \"ipfs://bafybeifdvzwsjpxrkbyhqpz3y57j7nwm3eyyc3feqppqggslea3g5kk3jq\";\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8.86} {"source": "c4", "protocol": "02-ai-arena", "title": "Rolezn Q", "severity_raw": "High", "severity": "high", "description": "### QA Issues\n| # |Issue|\n|-|-|\n| [QA‑1](#QA‑1) | Max rerolls can be increased until max `uint8`\n| [QA‑2](#QA‑2) | Fighter generation is limited to max `uint8`\n| [QA‑3](#QA‑3) | It is not possible to remove staker after calling `FighterFarm.addStaker()`\n| [QA‑4](#QA‑4) | Missing length check for `FighterFarm.iconsTypes`\n| [QA‑5](#QA‑5) | `FighterFarm.mintFromMergingPool()` always creates fighterType 0\n| [QA‑6](#QA‑6) | Project uses an old version of `openzeppelin-contracts`\n| [QA‑7](#QA‑7) | In `FighterFarm.reRoll()` `approveSpender` should be called with 0 `amount` if `_neuronInstance.transferFrom()` fails\n| [QA‑8](#QA‑8) | `generator` has different `uint` sizes on different functions\n| [QA‑9](#QA‑9) | It is possible to `addAttributeProbabilities()` exceeding `uint8` `generation` values but unable to `deleteAttributeProbabilities()` delete anything exceeding `uint8` `generation`\n| [QA‑10](#QA‑10) | It is not possible to remove addresses from `allowedBurningAddresses` once added\n| [QA‑11](#QA‑11) | `GameItems.mint()` should be called `buyGameItem()` rather than `mint()`\n| [QA‑12](#QA‑12) | `GameItems.mint()` should emit an event when `tranferFrom` has failed and purchase was unsuccessful.\n| [QA‑13](#QA‑13) | An `event` should be emitted when winners have been picked in `MergingPool.pickWinners()`\n| [QA‑14](#QA‑14) | `RankedBattle.setStakeAtRiskAddress()` should be renamed `RankedBattle.instantiateStakeAtRiskContract()`\n| [QA‑15](#QA‑15) | `VoltageManager.useVoltageBattery()` can be set to require only the `VOLTAGE_COST` to allow players to be more efficient with their battery usage\n| [QA‑16](#QA‑16) | `VoltageManager.spendVoltage()` can be called by the player.\n| [QA‑17](#QA‑17) | Use a `constant` for `NRN` decimals\n| [QA‑18]", "vulnerable_code": "/// @notice The maximum amount of rerolls for each fighter.\n uint8[2] public maxRerollsAllowed = [3, 3];", "fixed_code": "132: maxRerollsAllowed[fighterType] += 1;\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/Rolezn-Q.md", "collected_at": "2026-01-02T19:02:41.604228+00:00", "source_hash": "9ff6df5537febb3faf48e45b9a1cbc7c75e0324a94cb3a2e4505f6a088bed9fc", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "/// @notice The maximum amount of rerolls for each fighter.\n uint8[2] public maxRerollsAllowed = [3, 3];", "has_vulnerable_code_snippet": true, "fixed_code_actual": "132: maxRerollsAllowed[fighterType] += 1;\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "09-ondo", "title": "0xta G", "severity_raw": "Medium", "severity": "medium", "description": "# Gas Optimization\n\n# Summary\n\n| Number | Gas Optimization | Context |\n| :----: | :------------------------------------------------------------------------------------------------------- | :-----: |\n| [G-01] | Use assembly to perform efficient back-to-back calls | 2 |\n| [G-02] | Functions guaranteed to revert when called by normal users can be marked payable | 27 |\n| [G-03] | Avoid emitting storage values | 2 |\n| [G-04] | Expressions for constant values such as a call to keccak256(), should use immutable rather than constant | 5 |\n| [G-05] | Use Assembly To Check For address(0) | 9 |\n| [G-06] | Avoid contract existence checks by using low level calls | 2 |\n| [G-07] | Use do while loops instead of for loops | 4 |\n| [G-08] | Stack variable used as a cheaper cache for a state variable is only used once | 1 |\n| [G-09] | Can make the variable outside the loop to save Gas | 2 |\n| [G-10] | abi.encode() is less efficient than abi.encodePacked() | 3 |\n\n## [G-01] Use assembly to perform efficient back-to-back calls\n\nIf a similar external call is performed back-to-back, we can use assembly to reuse any function signatures and function parameters that stay the same. In addition, we can also reuse the same memory space for each function call (scratch space + free memory pointer + zero slot), which can potentially allow us to avoid memory expansion costs.\nNote: In order to do this ", "vulnerable_code": "File: contracts/bridge/DestinationBridge.sol\n323 uint256 balance = IRWALike(_token).balanceOf(address(this));\n324 IRWALike(_token).transfer(owner(), balance);", "fixed_code": "File: contracts/bridge/DestinationBridge.sol\n210 function addApprover(address approver) external onlyOwner {\n\n220 function removeApprover(address approver) external onlyOwner {\n\n234 function addChainSupport(\n string calldata srcChain,\n string calldata srcContractAddress\n ) external onlyOwner {\n\n255 function setThresholds(\n string calldata srcChain,\n uint256[] calldata amounts,\n uint256[] calldata numOfApprovers\n ) external onlyOwner {\n\n286 function setMintLimit(uint256 mintLimit) external onlyOwner {\n\n295 function setMintLimitDuration(uint256 mintDuration) external onlyOwner {\n\n304 function pause() external onlyOwner {\n\n313 function unpause() external onlyOwner {\n\n322 function rescueTokens(address _token) external onlyOwner {", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/0xta-G.md", "collected_at": "2026-01-02T18:25:19.207027+00:00", "source_hash": "a024dbacae1bfb125cc38448800643c2dd356c8eb8efe6dfbb917ce1fc32b78b", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: contracts/bridge/DestinationBridge.sol\n323 uint256 balance = IRWALike(_token).balanceOf(address(this));\n324 IRWALike(_token).transfer(owner(), balance);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/bridge/DestinationBridge.sol\n210 function addApprover(address approver) external onlyOwner {\n\n220 function removeApprover(address approver) external onlyOwner {\n\n234 function addChainSupport(\n string calldata srcChain,\n string calldata srcContractAddress\n ) external onlyOwner {\n\n255 function setThresholds(\n string calldata srcChain,\n uint256[] calldata amounts,\n uint256[] calldata numOfApprovers\n ) external onlyOwner {\n\n286 function setMintLimit(uint256 mintLimit) external onlyOwner {\n\n295 function setMintLimitDuration(uint256 mintDuration) external onlyOwner {\n\n304 function pause() external onlyOwner {\n\n313 function unpause() external onlyOwner {\n\n322 function rescueTokens(address _token) external onlyOwner {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "11-kelp", "title": "tala7985 G", "severity_raw": "High", "severity": "high", "description": "## \\[G\u20111\\] Newer versions of solidity are more gas efficient\n\nThe solidity language continues to pursue more efficient gas optimization schemes. Adopting a newer version of solidity can be more gas efficient.\n\n```\npragma solidity 0.8.21;\n```\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTConfig.sol#L2\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L2\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/NodeDelegator.sol#L2\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTOracle.sol#L2\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/RSETH.sol#L2\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/RSETH.sol#L2\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/oracles/ChainlinkPriceOracle.sol#L2\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/utils/LRTConfigRoleChecker.sol#L2\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/utils/UtilLib.sol#L2\n\n## \\[G\u20112\\] Initializers can be marked as payable to save deployment gas\n\nPayable functions cost less gas to execute, because the compiler does not have to add extra checks to ensure that no payment is provided. Initializers can be safely marked as payable, because only the deployer or the factory contract would call the function without carrying any funds.\n\n```\nfunction initialize(\n```\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTConfig.sol#L41\n\n```\nfunction initialize(address lrtConfigAddr) external initializer {\n```\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L31\n\n```\nfunction initialize(address lrtConfigAddr) external initializer {\n```\n\n https://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTOracle.sol#L29\n\n```\nfunction initialize(address lrtConfigAddr) external initializer {\n```\n\n https://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTOracle.sol#L29\n\n```\nfunction initialize(address admin, address lrtConfigAddr) external initializer {\n```\n\n&nbs", "vulnerable_code": "pragma solidity 0.8.21;", "fixed_code": "function initialize(", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/tala7985-G.md", "collected_at": "2026-01-02T18:28:30.341483+00:00", "source_hash": "a02d9ecaf195ca4eec3bc218c4892c52f2c533b865c45cffc0aeeba5804e4294", "code_block_count": 6, "solidity_block_count": 0, "total_code_chars": 318, "github_ref_count": 11, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "pragma solidity 0.8.21;", "primary_code_language": "unknown", "primary_code_char_count": 23, "all_code_blocks": "// Code block 1 (unknown):\npragma solidity 0.8.21;\n\n// Code block 2 (unknown):\nfunction initialize(\n\n// Code block 3 (unknown):\nfunction initialize(address lrtConfigAddr) external initializer {\n\n// Code block 4 (unknown):\nfunction initialize(address lrtConfigAddr) external initializer {\n\n// Code block 5 (unknown):\nfunction initialize(address lrtConfigAddr) external initializer {\n\n// Code block 6 (unknown):\nfunction initialize(address admin, address lrtConfigAddr) external initializer {", "all_code_blocks_count": 6, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LRTConfig.sol#L2, LRTDepositPool.sol#L2, NodeDelegator.sol#L2, LRTOracle.sol#L2, RSETH.sol#L2, ChainlinkPriceOracle.sol#L2, LRTConfigRoleChecker.sol#L2, UtilLib.sol#L2, LRTConfig.sol#L41, LRTDepositPool.sol#L31, LRTOracle.sol#L29", "github_files_list": "LRTConfigRoleChecker.sol, LRTOracle.sol, RSETH.sol, NodeDelegator.sol, ChainlinkPriceOracle.sol, UtilLib.sol, LRTConfig.sol, LRTDepositPool.sol", "github_refs_count": 11, "vulnerable_code_actual": "pragma solidity 0.8.21;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function initialize(", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 12} {"source": "c4", "protocol": "09-ondo", "title": "bin2chen Q", "severity_raw": "Low", "severity": "low", "description": "\nL-01: _mintIfThresholdMet() A malicious ALLOWLIST can duplicate mint\n\n`_mintIfThresholdMet` does not follow the `Checks Effects Interactions` principle\nIf ALLOWLIST is a malicious contract, it is possible to repeat the mint token\nIt is recommended to clear before executing mint\n\n```solidity\n function _mintIfThresholdMet(bytes32 txnHash) internal {\n bool thresholdMet = _checkThresholdMet(txnHash);\n Transaction memory txn = txnHashToTransaction[txnHash];\n if (thresholdMet) {\n+ delete txnHashToTransaction[txnHash]; \n _checkAndUpdateInstantMintLimit(txn.amount);\n if (!ALLOWLIST.isAllowed(txn.sender)) {\n ALLOWLIST.setAccountStatus(\n txn.sender,\n ALLOWLIST.getValidTermIndexes()[0],\n true\n );\n }\n TOKEN.mint(txn.sender, txn.amount);\n- delete txnHashToTransaction[txnHash];\n emit BridgeCompleted(txn.sender, txn.amount);\n }\n```\n\nL-02: transferFrom() proposes to ignore allowances if `_sender==msg.sender`.\n\nThe current `transferFrom()` still requires an allowance if `_sender==msg.sender`.\nSome protocols that transfer out tokens use `transferFrom()` instead of `transfer()`.\nSuggest adding `_sender==msg.sender` to ignore allowances to accommodate these protocols\n\nL-03: transferFrom() Malicious Allowlist contract can reuse user's allowances \n\n`transferFrom()` does not follow the `Checks Effects Interactions` principle\n\nCurrently it would be the following steps\n1. `_transfer()` -> `_beforeTokenTransfer()` -> `_isAllowed()` -> `allowlist.isAllowed`\n2. _approve(_sender, msg.sender, currentAllowance - _amount)\n\nThis way if the allowlist is maliciously contracted, you can reenter `transferFrom()` to reuse the allowance\n\nSuggestion, modify allowances first, before executing `_transfer()`.\n\n```diff\n function transferFrom(\n address _sender,\n address _recipient,\n uint256 _amount\n ) public returns (bool) {\n uint256 currentAllowance = allowances[_sender][msg.sender];\n require(currentAll", "vulnerable_code": " function _mintIfThresholdMet(bytes32 txnHash) internal {\n bool thresholdMet = _checkThresholdMet(txnHash);\n Transaction memory txn = txnHashToTransaction[txnHash];\n if (thresholdMet) {\n+ delete txnHashToTransaction[txnHash]; \n _checkAndUpdateInstantMintLimit(txn.amount);\n if (!ALLOWLIST.isAllowed(txn.sender)) {\n ALLOWLIST.setAccountStatus(\n txn.sender,\n ALLOWLIST.getValidTermIndexes()[0],\n true\n );\n }\n TOKEN.mint(txn.sender, txn.amount);\n- delete txnHashToTransaction[txnHash];\n emit BridgeCompleted(txn.sender, txn.amount);\n }", "fixed_code": "L-04: BURNER_ROLE can't burn off blacklisted user's token\n\nAdministrators with `BURNER_ROLE` privileges can execute `burn()` to burn a user's `shares` and transfer `usdy` to themselves.\n\nCurrently execute `burn()` -> `_burnShares()` -> `_beforeTokenTransfer()` -> `_isBlocked()` -> `blocklist.isBlocked()`\n\nThis way, if the user is blacklisted, the administrator `burn` is unable to execute the\n\nSuggestion\n\n`_beforeTokenTransfer()` no longer checks `_isBlocked/_isSanctioned/_isAllowed` if `msg.sender` has `BURNER_ROLE` privileges.\n\n\n\n\nL-04: unwrap() leaves a small portion of each user in the contract\n\nThe current implementation of `unwrap()` is as follows.\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/bin2chen-Q.md", "collected_at": "2026-01-02T18:25:48.451265+00:00", "source_hash": "a04032100baa1c77998e4c045e6df953d767718118ff3c129ecd4ee98993c3f1", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 620, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _mintIfThresholdMet(bytes32 txnHash) internal {\n bool thresholdMet = _checkThresholdMet(txnHash);\n Transaction memory txn = txnHashToTransaction[txnHash];\n if (thresholdMet) {\n+ delete txnHashToTransaction[txnHash]; \n _checkAndUpdateInstantMintLimit(txn.amount);\n if (!ALLOWLIST.isAllowed(txn.sender)) {\n ALLOWLIST.setAccountStatus(\n txn.sender,\n ALLOWLIST.getValidTermIndexes()[0],\n true\n );\n }\n TOKEN.mint(txn.sender, txn.amount);\n- delete txnHashToTransaction[txnHash];\n emit BridgeCompleted(txn.sender, txn.amount);\n }", "primary_code_language": "solidity", "primary_code_char_count": 620, "all_code_blocks": "// Code block 1 (solidity):\nfunction _mintIfThresholdMet(bytes32 txnHash) internal {\n bool thresholdMet = _checkThresholdMet(txnHash);\n Transaction memory txn = txnHashToTransaction[txnHash];\n if (thresholdMet) {\n+ delete txnHashToTransaction[txnHash]; \n _checkAndUpdateInstantMintLimit(txn.amount);\n if (!ALLOWLIST.isAllowed(txn.sender)) {\n ALLOWLIST.setAccountStatus(\n txn.sender,\n ALLOWLIST.getValidTermIndexes()[0],\n true\n );\n }\n TOKEN.mint(txn.sender, txn.amount);\n- delete txnHashToTransaction[txnHash];\n emit BridgeCompleted(txn.sender, txn.amount);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function _mintIfThresholdMet(bytes32 txnHash) internal {\n bool thresholdMet = _checkThresholdMet(txnHash);\n Transaction memory txn = txnHashToTransaction[txnHash];\n if (thresholdMet) {\n+ delete txnHashToTransaction[txnHash]; \n _checkAndUpdateInstantMintLimit(txn.amount);\n if (!ALLOWLIST.isAllowed(txn.sender)) {\n ALLOWLIST.setAccountStatus(\n txn.sender,\n ALLOWLIST.getValidTermIndexes()[0],\n true\n );\n }\n TOKEN.mint(txn.sender, txn.amount);\n- delete txnHashToTransaction[txnHash];\n emit BridgeCompleted(txn.sender, txn.amount);\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function _mintIfThresholdMet(bytes32 txnHash) internal {\n bool thresholdMet = _checkThresholdMet(txnHash);\n Transaction memory txn = txnHashToTransaction[txnHash];\n if (thresholdMet) {\n+ delete txnHashToTransaction[txnHash]; \n _checkAndUpdateInstantMintLimit(txn.amount);\n if (!ALLOWLIST.isAllowed(txn.sender)) {\n ALLOWLIST.setAccountStatus(\n txn.sender,\n ALLOWLIST.getValidTermIndexes()[0],\n true\n );\n }\n TOKEN.mint(txn.sender, txn.amount);\n- delete txnHashToTransaction[txnHash];\n emit BridgeCompleted(txn.sender, txn.amount);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "L-04: BURNER_ROLE can't burn off blacklisted user's token\n\nAdministrators with `BURNER_ROLE` privileges can execute `burn()` to burn a user's `shares` and transfer `usdy` to themselves.\n\nCurrently execute `burn()` -> `_burnShares()` -> `_beforeTokenTransfer()` -> `_isBlocked()` -> `blocklist.isBlocked()`\n\nThis way, if the user is blacklisted, the administrator `burn` is unable to execute the\n\nSuggestion\n\n`_beforeTokenTransfer()` no longer checks `_isBlocked/_isSanctioned/_isAllowed` if `msg.sender` has `BURNER_ROLE` privileges.\n\n\n\n\nL-04: unwrap() leaves a small portion of each user in the contract\n\nThe current implementation of `unwrap()` is as follows.\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "06-lybra", "title": "matrix_0wl G", "severity_raw": "Medium", "severity": "medium", "description": "## Gas Optimizations\n\n| | Issue |\n| ------ | :-------------------------------------------------------------------------------------------------------------------------------------------------- |\n| GAS-1 | Use assembly to check for `address(0)` |\n| GAS-2 | BEFORE SOME FUNCTIONS, WE SHOULD CHECK SOME VARIABLES FOR POSSIBLE GAS SAVE |\n| GAS-3 | USING CALLDATA INSTEAD OF MEMORY FOR READ-ONLY ARGUMENTS IN EXTERNAL FUNCTIONS SAVES GAS |\n| GAS-4 | Setting the constructor to payable |\n| GAS-5 | DON\u2019T USE \\_MSGSENDER() IF NOT SUPPORTING EIP-2771 |\n| GAS-6 | USE FUNCTION INSTEAD OF MODIFIERS |\n| GAS-7 | IT COSTS MORE GAS TO INITIALIZE NON-CONSTANT/NON-IMMUTABLE VARIABLES TO ZERO THAN TO LET THE DEFAULT OF ZERO BE APPLIED |\n| GAS-8 | INSTEAD OF CALCULATING A STATEVAR WITH KECCAK256() EVERY TIME THE CONTRACT IS MADE PRE CALCULATE THEM BEFORE AND ONLY GIVE THE RESULT TO A CONSTANT |\n| GAS-9 | INTERNAL FUNCTIONS NOT CALLED BY THE CONTRACT SHOULD BE REMOVED TO SAVE DEPLOYMENT GAS |\n| GAS-10 | KECCAK256() SHOULD ONLY NEED TO BE CALLED ON A SPECIFIC STRING LITERAL ONCE |\n| GAS-11 | The increment in for loop postcondi", "vulnerable_code": "File: contracts/lybra/configuration/LybraConfigurator.sol\n\n99: if (address(EUSD) == address(0)) EUSD = IEUSD(_eusd);\n\n100: if (address(peUSD) == address(0)) peUSD = IEUSD(_peusd);\n", "fixed_code": "File: contracts/lybra/miner/EUSDMiningIncentives.sol\n\n76: if (_account != address(0)) {\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/matrix_0wl-G.md", "collected_at": "2026-01-02T18:23:08.229234+00:00", "source_hash": "a04e35a3c6ce0ee08648567cbad5d45398f706d5c8325bbea6f5ba05a0a6dc71", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: contracts/lybra/configuration/LybraConfigurator.sol\n\n99: if (address(EUSD) == address(0)) EUSD = IEUSD(_eusd);\n\n100: if (address(peUSD) == address(0)) peUSD = IEUSD(_peusd);\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/lybra/miner/EUSDMiningIncentives.sol\n\n76: if (_account != address(0)) {\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "10-badger", "title": "codeslide G", "severity_raw": "High", "severity": "high", "description": "### Gas Optimizations\nThere are 759 instances over 27 issues.\n| ID | Description | Count | Gas Per Instance | Gas Savings |\n| :-----------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------- | ----: | ---------------: | ----------: |\n| [G-01](#g-01) | `++i`/`i++` should be `unchecked{++i}`/`unchecked{i++}` when it is not possible for them to overflow, as is the case when used in `for`- and `while`-loops | 10 | 60 | 600 |\n| [G-02](#g-02) | `>=` costs less gas than `>` | 77 | 3 | 231 |\n| [G-03](#g-03) | Constructors can be marked `payable` | 19 | 21 | 399 |\n| [G-04](#g-04) | Don't compare boolean expressions to boolean literals | 1 | 9 | 9 |\n| [G-05](#g-05) | Events should be emitted outside of loops | 1 | 375 | 375 |\n| [G-06](#g-06) | Functions guaranteed to revert when called by normal users can be marked `payable` | 24 | 21 | 504 |\n| [G-07](#g-07) | Gas use can be reduced by using Solidity 0.8.19 or later ", "vulnerable_code": "File: packages/contracts/contracts/Governor.sol\n\n46: for (uint256 i = 0; i < users.length(); i++) {\n\n57: for (uint256 i = 0; i < _usrs.length; i++) {\n\n76: for (uint8 i = 0; i < type(uint8).max; i++) {\n\n84: for (uint8 i = 0; i < type(uint8).max; i++) {\n\n98: for (uint8 i = 0; i < type(uint8).max; i++) {\n\n107: for (uint8 i = 0; i < type(uint8).max; i++) {\n\n122: for (uint8 i = 0; i < roleIds.length; i++) {\n\n137: for (uint256 i = 0; i < _sigs.length; ++i) {", "fixed_code": "File: packages/contracts/contracts/SortedCdps.sol\n\n432: for (uint256 i = 0; i < _len; ++i) {\n\n449: for (uint i = 0; i < _len; ++i) {", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/codeslide-G.md", "collected_at": "2026-01-02T18:26:45.098583+00:00", "source_hash": "a051b06bdb93fb4f59d34c5d8d8b44c340fd5a6378ce0dff19a61715c70e2419", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: packages/contracts/contracts/Governor.sol\n\n46: for (uint256 i = 0; i < users.length(); i++) {\n\n57: for (uint256 i = 0; i < _usrs.length; i++) {\n\n76: for (uint8 i = 0; i < type(uint8).max; i++) {\n\n84: for (uint8 i = 0; i < type(uint8).max; i++) {\n\n98: for (uint8 i = 0; i < type(uint8).max; i++) {\n\n107: for (uint8 i = 0; i < type(uint8).max; i++) {\n\n122: for (uint8 i = 0; i < roleIds.length; i++) {\n\n137: for (uint256 i = 0; i < _sigs.length; ++i) {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: packages/contracts/contracts/SortedCdps.sol\n\n432: for (uint256 i = 0; i < _len; ++i) {\n\n449: for (uint i = 0; i < _len; ++i) {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-biconomy", "title": "privateconstant G", "severity_raw": "Medium", "severity": "medium", "description": "# Gas Optimizations\n\n## Summary \n\nIn total, `5` gas optimizations are found. Please also noted that the following do not inclue those included in the C4Audit output [here](https://gist.github.com/Picodes/0a53b4abfc71e0b9998e8b09aa283fb3).\n\n## [G-01] USE REQUIRE INSTEAD OF ASSERT FOR ERROR HANDLING\n\nThe `assert()` and `require()` functions are a part of error handling in Solidity. They both check conditions and throw an error if they are not met.\n\nThe main difference between the two is the way they handle gas and changes made to the contract. \n\nWhen `assert()` is used and the condition is false, all remaining gas is consumed and all changes made to the contract and any sub-calls are reversed. On the other hand, if `require()` is used and the condition is false, only changes made to the contract are reversed and any remaining gas fees are refunded.\n\n_instance (2)_:\n\n```diff\nfile: contracts/smart-contract-wallet/common/Singleton.sol, line 13\n\n+ require(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));\n- assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));\n```\n\n[Link to code](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/common/Singleton.sol#L13)\n\n```diff\nfile: contracts/smart-contract-wallet/Proxy.sol, line 16\n\n+ require(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));\n- assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));\n```\n\n[Link to code](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/Proxy.sol#L16)\n\n## [G-02] USE CALLDATA INSTEAD OF MEMORY IN `innerHandleOp()`\n\nUsing the `memory` keyword instead of `calldata` in the `innerHandleOp()` function in `EntryPoint.sol` is possible and can potenti", "vulnerable_code": "[Link to code](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/common/Singleton.sol#L13)\n", "fixed_code": "[Link to code](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/Proxy.sol#L16)\n\n## [G-02] USE CALLDATA INSTEAD OF MEMORY IN `innerHandleOp()`\n\nUsing the `memory` keyword instead of `calldata` in the `innerHandleOp()` function in `EntryPoint.sol` is possible and can potentially reduce gas costs. The recommended changes are outlined below.\n\n_instance (1)_:\n", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/privateconstant-G.md", "collected_at": "2026-01-02T18:14:04.301100+00:00", "source_hash": "a082d04bf36df85c821b904271a725f7b4f45af541d5f9cfbbaa66a41425e6b3", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 551, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "file: contracts/smart-contract-wallet/common/Singleton.sol, line 13\n\n+ require(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));\n- assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));", "primary_code_language": "diff", "primary_code_char_count": 281, "all_code_blocks": "// Code block 1 (diff):\nfile: contracts/smart-contract-wallet/common/Singleton.sol, line 13\n\n+ require(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));\n- assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));\n\n// Code block 2 (diff):\nfile: contracts/smart-contract-wallet/Proxy.sol, line 16\n\n+ require(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));\n- assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "file: contracts/smart-contract-wallet/common/Singleton.sol, line 13\n\n+ require(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));\n- assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));\n\nfile: contracts/smart-contract-wallet/Proxy.sol, line 16\n\n+ require(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));\n- assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));", "solidity_code": "", "github_refs_formatted": "Singleton.sol#L13, Proxy.sol#L16", "github_files_list": "Proxy.sol, Singleton.sol", "github_refs_count": 2, "vulnerable_code_actual": "[Link to code](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/common/Singleton.sol#L13)\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "[Link to code](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/Proxy.sol#L16)\n\n## [G-02] USE CALLDATA INSTEAD OF MEMORY IN `innerHandleOp()`\n\nUsing the `memory` keyword instead of `calldata` in the `innerHandleOp()` function in `EntryPoint.sol` is possible and can potentially reduce gas costs. The recommended changes are outlined below.\n\n_instance (1)_:\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "05-ajna", "title": "teawaterwire Q", "severity_raw": "Unknown", "severity": "unknown", "description": "In the `claimDelegateReward` function there is this line\n\n```\n// Check if Challenge Period is still active\nif(block.number < _getChallengeStageEndBlock(currentDistribution.endBlock)) revert ChallengePeriodNotEnded();\n```\n\nAfter discussing with one of the sponsors it appears to be not quite right as it should be checked against the end of the distribution period not the end of the challenge period. Was asked to report it :)\n\n\n\n", "vulnerable_code": "// Check if Challenge Period is still active\nif(block.number < _getChallengeStageEndBlock(currentDistribution.endBlock)) revert ChallengePeriodNotEnded();", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/teawaterwire-Q.md", "collected_at": "2026-01-02T18:21:49.233915+00:00", "source_hash": "a0b1f3fa1a77b2d63adb3fe71643fabc0b3b7865f39d134617451ad4932cfafe", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 154, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "// Check if Challenge Period is still active\nif(block.number < _getChallengeStageEndBlock(currentDistribution.endBlock)) revert ChallengePeriodNotEnded();", "primary_code_language": "unknown", "primary_code_char_count": 154, "all_code_blocks": "// Code block 1 (unknown):\n// Check if Challenge Period is still active\nif(block.number < _getChallengeStageEndBlock(currentDistribution.endBlock)) revert ChallengePeriodNotEnded();", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "// Check if Challenge Period is still active\nif(block.number < _getChallengeStageEndBlock(currentDistribution.endBlock)) revert ChallengePeriodNotEnded();", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 2.86} {"source": "c4", "protocol": "04-caviar", "title": "Ignite G", "severity_raw": "Medium", "severity": "medium", "description": "\n### Gas Optimizations\n| |Issue|Instances|Average Gas Saved|\n|---|---|---|---|\n| Gas-1 | ` += ` costs more gas than ` = + ` for state variables | 4 | - |\n| Gas-2 | Setting the constructor to payable | 2 | 26 |\n| Gas-3 | Optimize function names to save gas | All Contracts |- |\n| Gas-4 | Using a ternary operator instead of an \"if-else\" statement | - |\n| Gas-5 | Use assembly to check for `address(0)` | 23 | 138 |\n| Gas-6 | Using private rather than public for `immutable`, saves gas | 4 | - |\n \n### [Gas-1] ` += ` costs more gas than ` = + ` for state variables (` -= ` too) \nUsing the addition operator instead of plus-equals saves gas.\n\n#### Instances(4):\n\n```solidity\n230: virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n\n231: virtualNftReserves -= uint128(weightSum);\n\n323: virtualBaseTokenReserves -= uint128(netOutputAmount + protocolFeeAmount + feeAmount);\n\n324: virtualNftReserves += uint128(weightSum);\n```\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L230\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L231\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L323\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L324\n\n#### Recommendation\nUsing ` = + ` instead.\n\n### [Gas-2] Setting the constructor to payable\n\nSaves 13 gas per instance.\n\n#### Instances(2):\n\n```solidity\n53: constructor() ERC721(\"Caviar Private Pools\", \"POOL\") Owned(msg.sender) {}\n```\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L143\n\n```solidity\n90: constructor(address _royaltyRegistry) {\n```\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L90\n\n```solidity\n143: constructor(address _factory, address _royaltyRegistry, address _stolenNftOracle) {\n```\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/Factory.sol#L53\n\n\n####", "vulnerable_code": "230: virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n\n231: virtualNftReserves -= uint128(weightSum);\n\n323: virtualBaseTokenReserves -= uint128(netOutputAmount + protocolFeeAmount + feeAmount);\n\n324: virtualNftReserves += uint128(weightSum);", "fixed_code": "53: constructor() ERC721(\"Caviar Private Pools\", \"POOL\") Owned(msg.sender) {}", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/Ignite-G.md", "collected_at": "2026-01-02T18:19:42.452382+00:00", "source_hash": "a0e7982fbb2f839c5e071a77cb48d5b5d3224b31b88a0c4e821cce6ef22e1950", "code_block_count": 4, "solidity_block_count": 4, "total_code_chars": 485, "github_ref_count": 7, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "230: virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n\n231: virtualNftReserves -= uint128(weightSum);\n\n323: virtualBaseTokenReserves -= uint128(netOutputAmount + protocolFeeAmount + feeAmount);\n\n324: virtualNftReserves += uint128(weightSum);", "primary_code_language": "solidity", "primary_code_char_count": 277, "all_code_blocks": "// Code block 1 (solidity):\n230: virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n\n231: virtualNftReserves -= uint128(weightSum);\n\n323: virtualBaseTokenReserves -= uint128(netOutputAmount + protocolFeeAmount + feeAmount);\n\n324: virtualNftReserves += uint128(weightSum);\n\n// Code block 2 (solidity):\n53: constructor() ERC721(\"Caviar Private Pools\", \"POOL\") Owned(msg.sender) {}\n\n// Code block 3 (solidity):\n90: constructor(address _royaltyRegistry) {\n\n// Code block 4 (solidity):\n143: constructor(address _factory, address _royaltyRegistry, address _stolenNftOracle) {", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "230: virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n\n231: virtualNftReserves -= uint128(weightSum);\n\n323: virtualBaseTokenReserves -= uint128(netOutputAmount + protocolFeeAmount + feeAmount);\n\n324: virtualNftReserves += uint128(weightSum);\n\n53: constructor() ERC721(\"Caviar Private Pools\", \"POOL\") Owned(msg.sender) {}\n\n90: constructor(address _royaltyRegistry) {\n\n143: constructor(address _factory, address _royaltyRegistry, address _stolenNftOracle) {", "github_refs_formatted": "PrivatePool.sol#L230, PrivatePool.sol#L231, PrivatePool.sol#L323, PrivatePool.sol#L324, PrivatePool.sol#L143, EthRouter.sol#L90, Factory.sol#L53", "github_files_list": "EthRouter.sol, PrivatePool.sol, Factory.sol", "github_refs_count": 7, "vulnerable_code_actual": "230: virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n\n231: virtualNftReserves -= uint128(weightSum);\n\n323: virtualBaseTokenReserves -= uint128(netOutputAmount + protocolFeeAmount + feeAmount);\n\n324: virtualNftReserves += uint128(weightSum);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "53: constructor() ERC721(\"Caviar Private Pools\", \"POOL\") Owned(msg.sender) {}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "05-ajna", "title": "bytes032 Q", "severity_raw": "Medium", "severity": "medium", "description": "\n## QA REPORT\n\n| | Issue |\n| ---- |:--------------------------------------------------------------------------------------------------------------------------------------------------- |\n| [01] | Liquidity operators are unable to stake or redeem rewards on behalf of Liquidity owners |\n| [02] | Insertion sort is implemented incorrectly |\n| [03] | Comment in code is potentially misleading |\n| [04] | Possibility of overflow in Maths.wsqrt function |\n| [05] | Risk of overflow in Math.wmul function |\n| [06] | Proposal potentially overshadowed |\n| [07] | AJNA L1 Address hardcoded in the code |\n| [08] | Users with insufficient balances may not receive any voting power |\n| [09] | In the screening sorting process, the latest proposal is always first to be eliminated if it shares the same number of screening votes with others. |\n\n\n## [01] Liquidity operators are unable to stake or redeem rewards on behalf of Liquidity owners \n\nSince the operator can literally do everything with the NFT (burn it, move liquidity, mint it), it makes sense to also let them sta", "vulnerable_code": " /**\n * @inheritdoc IRewardsManagerOwnerActions\n * @dev === Revert on ===\n * @dev not owner `NotOwnerOfDeposit()`\n * @dev already claimed `AlreadyClaimed()`\n * @dev === Emit events ===\n * @dev - `ClaimRewards`\n */\n function claimRewards(\n uint256 tokenId_,\n uint256 epochToClaim_\n ) external override {\n StakeInfo storage stakeInfo = stakes[tokenId_];\n\n if (msg.sender != stakeInfo.owner) revert NotOwnerOfDeposit();\n\n if (isEpochClaimed[tokenId_][epochToClaim_]) revert AlreadyClaimed();\n\n _claimRewards(stakeInfo, tokenId_, epochToClaim_, true, stakeInfo.ajnaPool);\n }", "fixed_code": " function stake(\n uint256 tokenId_\n ) external override {\n address ajnaPool = PositionManager(address(positionManager)).poolKey(tokenId_);\n\n // check that msg.sender is owner of tokenId\n if (IERC721(address(positionManager)).ownerOf(tokenId_) != msg.sender) revert NotOwnerOfDeposit();\n\n StakeInfo storage stakeInfo = stakes[tokenId_];\n stakeInfo.owner = msg.sender;\n stakeInfo.ajnaPool = ajnaPool;\n\n uint256 curBurnEpoch = IPool(ajnaPool).currentBurnEpoch();\n\n // record the staking epoch\n stakeInfo.stakingEpoch = uint96(curBurnEpoch);\n\n // initialize last time interaction at staking epoch\n stakeInfo.lastClaimedEpoch = uint96(curBurnEpoch);\n\n uint256[] memory positionIndexes = positionManager.getPositionIndexes(tokenId_);\n\n for (uint256 i = 0; i < positionIndexes.length; ) {\n\n uint256 bucketId = positionIndexes[i];\n\n BucketState storage bucketState = stakeInfo.snapshot[bucketId];\n\n // record the number of lps in bucket at the time of staking\n bucketState.lpsAtStakeTime = uint128(positionManager.getLP(\n tokenId_,\n bucketId\n ));\n // record the bucket exchange rate at the time of staking\n bucketState.rateAtStakeTime = uint128(IPool(ajnaPool).bucketExchangeRate(bucketId));\n\n // iterations are bounded by array length (which is itself bounded), preventing overflow / underflow\n unchecked { ++i; }\n }\n\n emit Stake(msg.sender, ajnaPool, tokenId_);\n\n // transfer LP NFT to this contract\n IERC721(address(positionManager)).transferFrom(msg.sender, address(this), tokenId_);\n\n // calculate rewards for updating exchange rates, if any\n uint256 updateReward = _updateBucketExchangeRates(\n ajnaPool,\n positionIndexes\n );\n\n // transfer rewards to sender\n _transferAjnaRewards(upda", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/bytes032-Q.md", "collected_at": "2026-01-02T18:21:23.007477+00:00", "source_hash": "a19e3787cd97af2107284d45fd63a1af6159c1a2f8685189082eb17ff6a49c94", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " /**\n * @inheritdoc IRewardsManagerOwnerActions\n * @dev === Revert on ===\n * @dev not owner `NotOwnerOfDeposit()`\n * @dev already claimed `AlreadyClaimed()`\n * @dev === Emit events ===\n * @dev - `ClaimRewards`\n */\n function claimRewards(\n uint256 tokenId_,\n uint256 epochToClaim_\n ) external override {\n StakeInfo storage stakeInfo = stakes[tokenId_];\n\n if (msg.sender != stakeInfo.owner) revert NotOwnerOfDeposit();\n\n if (isEpochClaimed[tokenId_][epochToClaim_]) revert AlreadyClaimed();\n\n _claimRewards(stakeInfo, tokenId_, epochToClaim_, true, stakeInfo.ajnaPool);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function stake(\n uint256 tokenId_\n ) external override {\n address ajnaPool = PositionManager(address(positionManager)).poolKey(tokenId_);\n\n // check that msg.sender is owner of tokenId\n if (IERC721(address(positionManager)).ownerOf(tokenId_) != msg.sender) revert NotOwnerOfDeposit();\n\n StakeInfo storage stakeInfo = stakes[tokenId_];\n stakeInfo.owner = msg.sender;\n stakeInfo.ajnaPool = ajnaPool;\n\n uint256 curBurnEpoch = IPool(ajnaPool).currentBurnEpoch();\n\n // record the staking epoch\n stakeInfo.stakingEpoch = uint96(curBurnEpoch);\n\n // initialize last time interaction at staking epoch\n stakeInfo.lastClaimedEpoch = uint96(curBurnEpoch);\n\n uint256[] memory positionIndexes = positionManager.getPositionIndexes(tokenId_);\n\n for (uint256 i = 0; i < positionIndexes.length; ) {\n\n uint256 bucketId = positionIndexes[i];\n\n BucketState storage bucketState = stakeInfo.snapshot[bucketId];\n\n // record the number of lps in bucket at the time of staking\n bucketState.lpsAtStakeTime = uint128(positionManager.getLP(\n tokenId_,\n bucketId\n ));\n // record the bucket exchange rate at the time of staking\n bucketState.rateAtStakeTime = uint128(IPool(ajnaPool).bucketExchangeRate(bucketId));\n\n // iterations are bounded by array length (which is itself bounded), preventing overflow / underflow\n unchecked { ++i; }\n }\n\n emit Stake(msg.sender, ajnaPool, tokenId_);\n\n // transfer LP NFT to this contract\n IERC721(address(positionManager)).transferFrom(msg.sender, address(this), tokenId_);\n\n // calculate rewards for updating exchange rates, if any\n uint256 updateReward = _updateBucketExchangeRates(\n ajnaPool,\n positionIndexes\n );\n\n // transfer rewards to sender\n _transferAjnaRewards(upda", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "10-badger", "title": "cheatc0d3 G", "severity_raw": "Medium", "severity": "medium", "description": "## Gas Optimization Report Badger eBTC\n\n### Minimize State Variable Storage\n\nUsing smaller integer types for state variables can significantly reduce gas costs. In `ActivePool.sol`, the state variables `systemCollShares` and `feeRecipientCollShares` are declared as `uint256`. If the range of these variables permits, changing them to `uint128` can save gas.\n\n**Instances:**\n\n```solidity\nFile: https://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/ActivePool.sol#L31\n\nuint256 internal systemCollShares;\nuint256 internal feeRecipientCollShares;\n```\n\n**Proposed Changes:**\n```solidity\nuint128 internal systemCollShares;\nuint128 internal feeRecipientCollShares;\n```\n\n### Caching Results of External Functions\n\nMultiple calls to the same external function can be optimized by caching the function's result in a local variable and reusing it.\n\n**Instances:**\n```\nFile: https://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/ActivePool.sol#L104\n\nMultiple calls to collateral.getPooledEthByShares(DECIMAL_PRECISION);\n```\n\n**Proposed Changes:**\n\n```solidity\nuint256 cachedResult = collateral.getPooledEthByShares(DECIMAL_PRECISION);\nuint256 result1 = cachedResult;\nuint256 result2 = cachedResult;\n```\n\n### Using Custom Errors Instead of Revert Strings\n\nUsing custom errors instead of revert strings can save gas, as strings consume more gas.\n\n**Instances:**\n```\nFile: https://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/ActivePool.sol#L104\n\nrequire(cachedSystemCollShares >= _shares, \"!ActivePoolBal\");\n```\n\n**Proposed Changes:**\n```solidity\nerror InsufficientBalance();\n\nrequire(cachedSystemCollShares >= _shares, InsufficientBalance());\n```\n\n### Use Immutable for Constant Values\n\nImmutable variables are more gas-efficient than regular state variables. In `LeverageMacroReference.sol`, the `theOwner` variable is set once in the constructor and never changed, making it a candidate for immutable.\n\n**Instances:**\n`", "vulnerable_code": "File: https://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/ActivePool.sol#L31\n\nuint256 internal systemCollShares;\nuint256 internal feeRecipientCollShares;", "fixed_code": "uint128 internal systemCollShares;\nuint128 internal feeRecipientCollShares;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/cheatc0d3-G.md", "collected_at": "2026-01-02T18:26:44.170953+00:00", "source_hash": "a1f7647e0f2e2c0bc3c0886c0950851b8845fc05cbc0aa1c8a5ab44ad8435e1b", "code_block_count": 6, "solidity_block_count": 4, "total_code_chars": 846, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: https://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/ActivePool.sol#L31\n\nuint256 internal systemCollShares;\nuint256 internal feeRecipientCollShares;", "primary_code_language": "solidity", "primary_code_char_count": 185, "all_code_blocks": "// Code block 1 (solidity):\nFile: https://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/ActivePool.sol#L31\n\nuint256 internal systemCollShares;\nuint256 internal feeRecipientCollShares;\n\n// Code block 2 (solidity):\nuint128 internal systemCollShares;\nuint128 internal feeRecipientCollShares;\n\n// Code block 3 (unknown):\nFile: https://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/ActivePool.sol#L104\n\nMultiple calls to collateral.getPooledEthByShares(DECIMAL_PRECISION);\n\n// Code block 4 (solidity):\nuint256 cachedResult = collateral.getPooledEthByShares(DECIMAL_PRECISION);\nuint256 result1 = cachedResult;\nuint256 result2 = cachedResult;\n\n// Code block 5 (unknown):\nFile: https://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/ActivePool.sol#L104\n\nrequire(cachedSystemCollShares >= _shares, \"!ActivePoolBal\");\n\n// Code block 6 (solidity):\nerror InsufficientBalance();\n\nrequire(cachedSystemCollShares >= _shares, InsufficientBalance());", "all_code_blocks_count": 6, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: https://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/ActivePool.sol#L31\n\nuint256 internal systemCollShares;\nuint256 internal feeRecipientCollShares;\n\nuint128 internal systemCollShares;\nuint128 internal feeRecipientCollShares;\n\nuint256 cachedResult = collateral.getPooledEthByShares(DECIMAL_PRECISION);\nuint256 result1 = cachedResult;\nuint256 result2 = cachedResult;\n\nerror InsufficientBalance();\n\nrequire(cachedSystemCollShares >= _shares, InsufficientBalance());", "github_refs_formatted": "ActivePool.sol#L31, ActivePool.sol#L104", "github_files_list": "ActivePool.sol", "github_refs_count": 2, "vulnerable_code_actual": "File: https://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/ActivePool.sol#L31\n\nuint256 internal systemCollShares;\nuint256 internal feeRecipientCollShares;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "uint128 internal systemCollShares;\nuint128 internal feeRecipientCollShares;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 12} {"source": "c4", "protocol": "01-ondo", "title": "Josiah Q", "severity_raw": "High", "severity": "high", "description": "## DESCRIPTIVE TIME UNITS\nAs denoted in the link below:\n\nhttps://docs.soliditylang.org/en/v0.8.14/units-and-global-variables.html\n\n\"Suffixes like seconds, minutes, hours, days and weeks after literal numbers can be used to specify units of time where seconds are the base unit ...\"\n\nIt is recommended adopting the above method when assigning variables with time units. \n\nHere is 1 instance found.\n\n[OndoPriceOracleV2.sol#L77](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/OndoPriceOracleV2.sol#L77)\n\n```\n uint256 public maxChainlinkOracleTimeDelay = 90000; // 25 hours\n```\nSuggested fix:\n\n```\n uint256 public maxChainlinkOracleTimeDelay = 25 hours\n```\n## DOS ARISING FROM LOOP WITH CHECKS\nIterative logic involving check(s) that could revert should be embedded with `continue`, `break`, and/or `return` to skip the bad element(s) in the array. This is to ensure all qualified elements in the list get to successfully finish their calls and avoid the waste of gas. Imagine a function call involving a big loop with sizable array were to revert only at the last iteration, the caller would be grieved for the wasted efforts on top of the gas cost that could be quite significant in congested hours.\n\nHere are the 3 instances with identical logic found.\n\n[CashKYCSenderReceiverFactory.sol#L133-L143](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashKYCSenderReceiverFactory.sol#L133-L143)\n[CashFactory.sol#L123-L134](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashFactory.sol#L123-L134)\n[CashKYCSenderFactory.sol#L133-L144](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashKYCSenderFactory.sol#L133-L144)\n\n```\n function multiexcall(\n ExCallData[] calldata exCallData\n ) external payable override onlyGuardian returns (bytes[] memory results) {\n results = new bytes[](exCallData.length);\n for (uint256 i = 0; i < exCallData.length; ++i) {\n (bool success, bytes memor", "vulnerable_code": " uint256 public maxChainlinkOracleTimeDelay = 90000; // 25 hours", "fixed_code": " uint256 public maxChainlinkOracleTimeDelay = 25 hours", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/Josiah-Q.md", "collected_at": "2026-01-02T18:14:40.022597+00:00", "source_hash": "a1faae4c4ebd117c98720441ef231a85947df2478fdd5a6dd2e6938dc5b612ff", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 116, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "uint256 public maxChainlinkOracleTimeDelay = 90000; // 25 hours", "primary_code_language": "unknown", "primary_code_char_count": 63, "all_code_blocks": "// Code block 1 (unknown):\nuint256 public maxChainlinkOracleTimeDelay = 90000; // 25 hours\n\n// Code block 2 (unknown):\nuint256 public maxChainlinkOracleTimeDelay = 25 hours", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "OndoPriceOracleV2.sol#L77, CashKYCSenderReceiverFactory.sol#L133-L143, CashFactory.sol#L123-L134, CashKYCSenderFactory.sol#L133-L144", "github_files_list": "CashFactory.sol, OndoPriceOracleV2.sol, CashKYCSenderReceiverFactory.sol, CashKYCSenderFactory.sol", "github_refs_count": 4, "vulnerable_code_actual": " uint256 public maxChainlinkOracleTimeDelay = 90000; // 25 hours", "has_vulnerable_code_snippet": true, "fixed_code_actual": " uint256 public maxChainlinkOracleTimeDelay = 25 hours", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-ondo", "title": "gzeon G", "severity_raw": "Unknown", "severity": "unknown", "description": "## Uncheckable math\n\nepochDuration != 0 and (block.timestamp % epochDuration) always less than block.timestamp\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/cash/CashManager.sol#L583-L585\n\n```solidity\n currentEpochStartTimestamp =\n block.timestamp -\n (block.timestamp % epochDuration);\n```\n\n## No need to cache calldata length\n\nIt is cheaper to read length from calldata array than caching it in memory\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/cash/CashManager.sol#L749-L750\n\n```solidity\n uint256 size = redeemers.length;\n for (uint256 i = 0; i < size; ++i) {\n```", "vulnerable_code": " currentEpochStartTimestamp =\n block.timestamp -\n (block.timestamp % epochDuration);", "fixed_code": " uint256 size = redeemers.length;\n for (uint256 i = 0; i < size; ++i) {", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/gzeon-G.md", "collected_at": "2026-01-02T18:15:11.581701+00:00", "source_hash": "a218558b832c394c8934ccc0dd70ec259db2eaf4d853258a3ebd9b483218967e", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 170, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "currentEpochStartTimestamp =\n block.timestamp -\n (block.timestamp % epochDuration);", "primary_code_language": "solidity", "primary_code_char_count": 97, "all_code_blocks": "// Code block 1 (solidity):\ncurrentEpochStartTimestamp =\n block.timestamp -\n (block.timestamp % epochDuration);\n\n// Code block 2 (solidity):\nuint256 size = redeemers.length;\n for (uint256 i = 0; i < size; ++i) {", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "currentEpochStartTimestamp =\n block.timestamp -\n (block.timestamp % epochDuration);\n\nuint256 size = redeemers.length;\n for (uint256 i = 0; i < size; ++i) {", "github_refs_formatted": "CashManager.sol#L583-L585, CashManager.sol#L749-L750", "github_files_list": "CashManager.sol", "github_refs_count": 2, "vulnerable_code_actual": " currentEpochStartTimestamp =\n block.timestamp -\n (block.timestamp % epochDuration);", "has_vulnerable_code_snippet": true, "fixed_code_actual": " uint256 size = redeemers.length;\n for (uint256 i = 0; i < size; ++i) {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6.4} {"source": "c4", "protocol": "01-ondo", "title": "oyc_109 G", "severity_raw": "High", "severity": "high", "description": "## [G-01] Don't Initialize Variables with Default Value\n\nUninitialized variables are assigned with the types default value. Explicitly initializing a variable with it's default value costs unnecesary gas.\n\n```\n2023-01-ondo/contracts/cash/CashManager.sol::750 => for (uint256 i = 0; i < size; ++i) {\n2023-01-ondo/contracts/cash/CashManager.sol::786 => for (uint256 i = 0; i < size; ++i) {\n2023-01-ondo/contracts/cash/CashManager.sol::933 => for (uint256 i = 0; i < size; ++i) {\n2023-01-ondo/contracts/cash/CashManager.sol::961 => for (uint256 i = 0; i < exCallData.length; ++i) {\n2023-01-ondo/contracts/cash/factory/CashFactory.sol::127 => for (uint256 i = 0; i < exCallData.length; ++i) {\n2023-01-ondo/contracts/cash/factory/CashKYCSenderFactory.sol::137 => for (uint256 i = 0; i < exCallData.length; ++i) {\n2023-01-ondo/contracts/cash/factory/CashKYCSenderReceiverFactory.sol::137 => for (uint256 i = 0; i < exCallData.length; ++i) {\n2023-01-ondo/contracts/cash/kyc/KYCRegistry.sol::163 => for (uint256 i = 0; i < length; i++) {\n2023-01-ondo/contracts/cash/kyc/KYCRegistry.sol::180 => for (uint256 i = 0; i < length; i++) {\n2023-01-ondo/contracts/lending/CompoundLens.sol::85 => for (uint i = 0; i < cTokenCount; i++) {\n2023-01-ondo/contracts/lending/CompoundLens.sol::135 => for (uint i = 0; i < cTokenCount; i++) {\n2023-01-ondo/contracts/lending/CompoundLens.sol::167 => for (uint i = 0; i < cTokenCount; i++) {\n2023-01-ondo/contracts/lending/tokens/cCash/CTokenCash.sol::113 => uint startingAllowance = 0;\n2023-01-ondo/contracts/lending/tokens/cToken/CTokenModified.sol::113 => uint startingAllowance = 0;\n```\n\n## [G-02] Cache Array Length Outside of Loop\n\nCaching the array length outside a loop saves reading it on each iteration, as long as the array's length is not changed during the loop.\n\n```\n2023-01-ondo/contracts/cash/CashManager.sol::961 => for (uint256 i = 0; i < exCallData.length; ++i) {\n2023-01-ondo/contracts/cash/factory/CashFactory.sol::127 => for (uint256 i = 0; i < exCallData", "vulnerable_code": "2023-01-ondo/contracts/cash/CashManager.sol::750 => for (uint256 i = 0; i < size; ++i) {\n2023-01-ondo/contracts/cash/CashManager.sol::786 => for (uint256 i = 0; i < size; ++i) {\n2023-01-ondo/contracts/cash/CashManager.sol::933 => for (uint256 i = 0; i < size; ++i) {\n2023-01-ondo/contracts/cash/CashManager.sol::961 => for (uint256 i = 0; i < exCallData.length; ++i) {\n2023-01-ondo/contracts/cash/factory/CashFactory.sol::127 => for (uint256 i = 0; i < exCallData.length; ++i) {\n2023-01-ondo/contracts/cash/factory/CashKYCSenderFactory.sol::137 => for (uint256 i = 0; i < exCallData.length; ++i) {\n2023-01-ondo/contracts/cash/factory/CashKYCSenderReceiverFactory.sol::137 => for (uint256 i = 0; i < exCallData.length; ++i) {\n2023-01-ondo/contracts/cash/kyc/KYCRegistry.sol::163 => for (uint256 i = 0; i < length; i++) {\n2023-01-ondo/contracts/cash/kyc/KYCRegistry.sol::180 => for (uint256 i = 0; i < length; i++) {\n2023-01-ondo/contracts/lending/CompoundLens.sol::85 => for (uint i = 0; i < cTokenCount; i++) {\n2023-01-ondo/contracts/lending/CompoundLens.sol::135 => for (uint i = 0; i < cTokenCount; i++) {\n2023-01-ondo/contracts/lending/CompoundLens.sol::167 => for (uint i = 0; i < cTokenCount; i++) {\n2023-01-ondo/contracts/lending/tokens/cCash/CTokenCash.sol::113 => uint startingAllowance = 0;\n2023-01-ondo/contracts/lending/tokens/cToken/CTokenModified.sol::113 => uint startingAllowance = 0;", "fixed_code": "2023-01-ondo/contracts/cash/CashManager.sol::961 => for (uint256 i = 0; i < exCallData.length; ++i) {\n2023-01-ondo/contracts/cash/factory/CashFactory.sol::127 => for (uint256 i = 0; i < exCallData.length; ++i) {\n2023-01-ondo/contracts/cash/factory/CashKYCSenderFactory.sol::137 => for (uint256 i = 0; i < exCallData.length; ++i) {\n2023-01-ondo/contracts/cash/factory/CashKYCSenderReceiverFactory.sol::137 => for (uint256 i = 0; i < exCallData.length; ++i) {", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/oyc_109-G.md", "collected_at": "2026-01-02T18:15:25.942033+00:00", "source_hash": "a22a54d1bd42a7763c4efc0ac021071f27823826f16d7164869d7921b65bd17e", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 1399, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "2023-01-ondo/contracts/cash/CashManager.sol::750 => for (uint256 i = 0; i < size; ++i) {\n2023-01-ondo/contracts/cash/CashManager.sol::786 => for (uint256 i = 0; i < size; ++i) {\n2023-01-ondo/contracts/cash/CashManager.sol::933 => for (uint256 i = 0; i < size; ++i) {\n2023-01-ondo/contracts/cash/CashManager.sol::961 => for (uint256 i = 0; i < exCallData.length; ++i) {\n2023-01-ondo/contracts/cash/factory/CashFactory.sol::127 => for (uint256 i = 0; i < exCallData.length; ++i) {\n2023-01-ondo/contracts/cash/factory/CashKYCSenderFactory.sol::137 => for (uint256 i = 0; i < exCallData.length; ++i) {\n2023-01-ondo/contracts/cash/factory/CashKYCSenderReceiverFactory.sol::137 => for (uint256 i = 0; i < exCallData.length; ++i) {\n2023-01-ondo/contracts/cash/kyc/KYCRegistry.sol::163 => for (uint256 i = 0; i < length; i++) {\n2023-01-ondo/contracts/cash/kyc/KYCRegistry.sol::180 => for (uint256 i = 0; i < length; i++) {\n2023-01-ondo/contracts/lending/CompoundLens.sol::85 => for (uint i = 0; i < cTokenCount; i++) {\n2023-01-ondo/contracts/lending/CompoundLens.sol::135 => for (uint i = 0; i < cTokenCount; i++) {\n2023-01-ondo/contracts/lending/CompoundLens.sol::167 => for (uint i = 0; i < cTokenCount; i++) {\n2023-01-ondo/contracts/lending/tokens/cCash/CTokenCash.sol::113 => uint startingAllowance = 0;\n2023-01-ondo/contracts/lending/tokens/cToken/CTokenModified.sol::113 => uint startingAllowance = 0;", "primary_code_language": "unknown", "primary_code_char_count": 1399, "all_code_blocks": "// Code block 1 (unknown):\n2023-01-ondo/contracts/cash/CashManager.sol::750 => for (uint256 i = 0; i < size; ++i) {\n2023-01-ondo/contracts/cash/CashManager.sol::786 => for (uint256 i = 0; i < size; ++i) {\n2023-01-ondo/contracts/cash/CashManager.sol::933 => for (uint256 i = 0; i < size; ++i) {\n2023-01-ondo/contracts/cash/CashManager.sol::961 => for (uint256 i = 0; i < exCallData.length; ++i) {\n2023-01-ondo/contracts/cash/factory/CashFactory.sol::127 => for (uint256 i = 0; i < exCallData.length; ++i) {\n2023-01-ondo/contracts/cash/factory/CashKYCSenderFactory.sol::137 => for (uint256 i = 0; i < exCallData.length; ++i) {\n2023-01-ondo/contracts/cash/factory/CashKYCSenderReceiverFactory.sol::137 => for (uint256 i = 0; i < exCallData.length; ++i) {\n2023-01-ondo/contracts/cash/kyc/KYCRegistry.sol::163 => for (uint256 i = 0; i < length; i++) {\n2023-01-ondo/contracts/cash/kyc/KYCRegistry.sol::180 => for (uint256 i = 0; i < length; i++) {\n2023-01-ondo/contracts/lending/CompoundLens.sol::85 => for (uint i = 0; i < cTokenCount; i++) {\n2023-01-ondo/contracts/lending/CompoundLens.sol::135 => for (uint i = 0; i < cTokenCount; i++) {\n2023-01-ondo/contracts/lending/CompoundLens.sol::167 => for (uint i = 0; i < cTokenCount; i++) {\n2023-01-ondo/contracts/lending/tokens/cCash/CTokenCash.sol::113 => uint startingAllowance = 0;\n2023-01-ondo/contracts/lending/tokens/cToken/CTokenModified.sol::113 => uint startingAllowance = 0;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "2023-01-ondo/contracts/cash/CashManager.sol::750 => for (uint256 i = 0; i < size; ++i) {\n2023-01-ondo/contracts/cash/CashManager.sol::786 => for (uint256 i = 0; i < size; ++i) {\n2023-01-ondo/contracts/cash/CashManager.sol::933 => for (uint256 i = 0; i < size; ++i) {\n2023-01-ondo/contracts/cash/CashManager.sol::961 => for (uint256 i = 0; i < exCallData.length; ++i) {\n2023-01-ondo/contracts/cash/factory/CashFactory.sol::127 => for (uint256 i = 0; i < exCallData.length; ++i) {\n2023-01-ondo/contracts/cash/factory/CashKYCSenderFactory.sol::137 => for (uint256 i = 0; i < exCallData.length; ++i) {\n2023-01-ondo/contracts/cash/factory/CashKYCSenderReceiverFactory.sol::137 => for (uint256 i = 0; i < exCallData.length; ++i) {\n2023-01-ondo/contracts/cash/kyc/KYCRegistry.sol::163 => for (uint256 i = 0; i < length; i++) {\n2023-01-ondo/contracts/cash/kyc/KYCRegistry.sol::180 => for (uint256 i = 0; i < length; i++) {\n2023-01-ondo/contracts/lending/CompoundLens.sol::85 => for (uint i = 0; i < cTokenCount; i++) {\n2023-01-ondo/contracts/lending/CompoundLens.sol::135 => for (uint i = 0; i < cTokenCount; i++) {\n2023-01-ondo/contracts/lending/CompoundLens.sol::167 => for (uint i = 0; i < cTokenCount; i++) {\n2023-01-ondo/contracts/lending/tokens/cCash/CTokenCash.sol::113 => uint startingAllowance = 0;\n2023-01-ondo/contracts/lending/tokens/cToken/CTokenModified.sol::113 => uint startingAllowance = 0;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "2023-01-ondo/contracts/cash/CashManager.sol::961 => for (uint256 i = 0; i < exCallData.length; ++i) {\n2023-01-ondo/contracts/cash/factory/CashFactory.sol::127 => for (uint256 i = 0; i < exCallData.length; ++i) {\n2023-01-ondo/contracts/cash/factory/CashKYCSenderFactory.sol::137 => for (uint256 i = 0; i < exCallData.length; ++i) {\n2023-01-ondo/contracts/cash/factory/CashKYCSenderReceiverFactory.sol::137 => for (uint256 i = 0; i < exCallData.length; ++i) {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "02-ai-arena", "title": "0xMosh Q", "severity_raw": "High", "severity": "high", "description": "# L-01 :Users will loss batteries even if voltage replenish time is over if `useVoltageBattery` is called ! \n\n## Impact\nUsers will loss batteries even if voltage replenish time is over if `useVoltageBattery` is called ! \n\n## Proof of Concept\n```solidity \n function useVoltageBattery() public {\n require(ownerVoltage[msg.sender] < 100);\n require(_gameItemsContractInstance.balanceOf(msg.sender, 0) > 0);\n _gameItemsContractInstance.burn(msg.sender, 0, 1);\n ownerVoltage[msg.sender] = 100;\n emit VoltageRemaining(msg.sender, ownerVoltage[msg.sender]);\n }\n\n```\nfunction `useVoltageBattery` is for using battery to replenish Voltage . but it doesnot check if voltage replenish time is over or not . Because of this , even if voltage replenishTime is over , it will cost battery to user . \nFrom a game logical perspective , this is not a fair scenario . Voltage should be replenished every 24 hour even if user calls `useVoltageBattery` .\n\n## Tools Used\nManual review ! \n## Recommended Mitigation Steps\nCheck if voltage replenishtime is over or not : \nRe-write the function as below : \n```solidity \n function useVoltageBattery() public {\n require(ownerVoltage[msg.sender] < 100);\n if (ownerVoltageReplenishTime[spender] <= block.timestamp) {\n _replenishVoltage(spender);\n }else {\n require(_gameItemsContractInstance.balanceOf(msg.sender, 0) > 0);\n _gameItemsContractInstance.burn(msg.sender, 0, 1);\n ownerVoltage[msg.sender] = 100;\n } \n emit VoltageRemaining(msg.sender, ownerVoltage[msg.sender]);\n }\n\n```\n\n# L-02 : minter role check should be placed before supply check \nBy standard practices , access control chcecks are placed before any other check . But here its not done in this way ! \n```solidity \n function mint(address to, uint256 amount) public virtual {//@audit-issue minter role check should be placed before supply check \n require(totalSupply() + amount < MAX", "vulnerable_code": " function useVoltageBattery() public {\n require(ownerVoltage[msg.sender] < 100);\n require(_gameItemsContractInstance.balanceOf(msg.sender, 0) > 0);\n _gameItemsContractInstance.burn(msg.sender, 0, 1);\n ownerVoltage[msg.sender] = 100;\n emit VoltageRemaining(msg.sender, ownerVoltage[msg.sender]);\n }\n", "fixed_code": " function useVoltageBattery() public {\n require(ownerVoltage[msg.sender] < 100);\n if (ownerVoltageReplenishTime[spender] <= block.timestamp) {\n _replenishVoltage(spender);\n }else {\n require(_gameItemsContractInstance.balanceOf(msg.sender, 0) > 0);\n _gameItemsContractInstance.burn(msg.sender, 0, 1);\n ownerVoltage[msg.sender] = 100;\n } \n emit VoltageRemaining(msg.sender, ownerVoltage[msg.sender]);\n }\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/0xMosh-Q.md", "collected_at": "2026-01-02T19:02:03.760541+00:00", "source_hash": "a22ceaf776b89c2ea5d6a896ed7672be2476cabf79296c7f3b31b1f05647e0ac", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 705, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function `useVoltageBattery` is for using battery to replenish Voltage . but it doesnot check if voltage replenish time is over or not . Because of this , even if voltage replenishTime is over , it will cost battery to user . \nFrom a game logical perspective , this is not a fair scenario . Voltage should be replenished every 24 hour even if user calls `useVoltageBattery` .\n\n## Tools Used\nManual review ! \n## Recommended Mitigation Steps\nCheck if voltage replenishtime is over or not : \nRe-write the function as below :", "primary_code_language": "unknown", "primary_code_char_count": 522, "all_code_blocks": "// Code block 1 (unknown):\nfunction `useVoltageBattery` is for using battery to replenish Voltage . but it doesnot check if voltage replenish time is over or not . Because of this , even if voltage replenishTime is over , it will cost battery to user . \nFrom a game logical perspective , this is not a fair scenario . Voltage should be replenished every 24 hour even if user calls `useVoltageBattery` .\n\n## Tools Used\nManual review ! \n## Recommended Mitigation Steps\nCheck if voltage replenishtime is over or not : \nRe-write the function as below :\n\n// Code block 2 (unknown):\n# L-02 : minter role check should be placed before supply check \nBy standard practices , access control chcecks are placed before any other check . But here its not done in this way !", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function useVoltageBattery() public {\n require(ownerVoltage[msg.sender] < 100);\n require(_gameItemsContractInstance.balanceOf(msg.sender, 0) > 0);\n _gameItemsContractInstance.burn(msg.sender, 0, 1);\n ownerVoltage[msg.sender] = 100;\n emit VoltageRemaining(msg.sender, ownerVoltage[msg.sender]);\n }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function useVoltageBattery() public {\n require(ownerVoltage[msg.sender] < 100);\n if (ownerVoltageReplenishTime[spender] <= block.timestamp) {\n _replenishVoltage(spender);\n }else {\n require(_gameItemsContractInstance.balanceOf(msg.sender, 0) > 0);\n _gameItemsContractInstance.burn(msg.sender, 0, 1);\n ownerVoltage[msg.sender] = 100;\n } \n emit VoltageRemaining(msg.sender, ownerVoltage[msg.sender]);\n }\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-asymmetry", "title": "a3yip6 G", "severity_raw": "Gas", "severity": "gas", "description": "## [G-01] Updating weight through adding new weight and subtracting old weight to save gas\nRather than loading storage `weights` repeatedly, updating weight directly by adding new weight and subtracting old weight can save gas. There are two instances in `adjustWeight` and `addDerivative` functions.\n```\nFile: /contracts/SafEth.sol\n\n// Before \nfunction adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n) external onlyOwner {\n weights[_derivativeIndex] = _weight;\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit WeightChange(_derivativeIndex, _weight);\n}\n\n// After\nfunction adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n) external onlyOwner {\n uint256 oldWeight = weights[_derivativeIndex];\n totalWeight = totalWeight + _weight - oldWeight;\n weights[_derivativeIndex] = _weight;\n emit WeightChange(_derivativeIndex, _weight);\n}\n```\n\n```\n// Before\nfunction addDerivative(\n address _contractAddress,\n uint256 _weight\n) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n}\n\n// After\nfunction addDerivative(\n address _contractAddress,\n uint256 _weight\n) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n totalWeight = totalWeight + _weight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n}\n```\n\n## [G-02] Changing the place of the calculation of `underlyingValue` to save gas\nIn function `stake`, the underlyingValue is only used if `totalSupply` is not equal to 0,", "vulnerable_code": "File: /contracts/SafEth.sol\n\n// Before \nfunction adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n) external onlyOwner {\n weights[_derivativeIndex] = _weight;\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit WeightChange(_derivativeIndex, _weight);\n}\n\n// After\nfunction adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n) external onlyOwner {\n uint256 oldWeight = weights[_derivativeIndex];\n totalWeight = totalWeight + _weight - oldWeight;\n weights[_derivativeIndex] = _weight;\n emit WeightChange(_derivativeIndex, _weight);\n}", "fixed_code": "// Before\nfunction addDerivative(\n address _contractAddress,\n uint256 _weight\n) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n}\n\n// After\nfunction addDerivative(\n address _contractAddress,\n uint256 _weight\n) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n totalWeight = totalWeight + _weight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/a3yip6-G.md", "collected_at": "2026-01-02T18:18:41.844652+00:00", "source_hash": "a24119c75558f5d3d236474e61ad2eb9e793cb0ffa2066b89dbfcf94c701fa51", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 1509, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: /contracts/SafEth.sol\n\n// Before \nfunction adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n) external onlyOwner {\n weights[_derivativeIndex] = _weight;\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit WeightChange(_derivativeIndex, _weight);\n}\n\n// After\nfunction adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n) external onlyOwner {\n uint256 oldWeight = weights[_derivativeIndex];\n totalWeight = totalWeight + _weight - oldWeight;\n weights[_derivativeIndex] = _weight;\n emit WeightChange(_derivativeIndex, _weight);\n}", "primary_code_language": "unknown", "primary_code_char_count": 691, "all_code_blocks": "// Code block 1 (unknown):\nFile: /contracts/SafEth.sol\n\n// Before \nfunction adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n) external onlyOwner {\n weights[_derivativeIndex] = _weight;\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit WeightChange(_derivativeIndex, _weight);\n}\n\n// After\nfunction adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n) external onlyOwner {\n uint256 oldWeight = weights[_derivativeIndex];\n totalWeight = totalWeight + _weight - oldWeight;\n weights[_derivativeIndex] = _weight;\n emit WeightChange(_derivativeIndex, _weight);\n}\n\n// Code block 2 (unknown):\n// Before\nfunction addDerivative(\n address _contractAddress,\n uint256 _weight\n) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n}\n\n// After\nfunction addDerivative(\n address _contractAddress,\n uint256 _weight\n) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n totalWeight = totalWeight + _weight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: /contracts/SafEth.sol\n\n// Before \nfunction adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n) external onlyOwner {\n weights[_derivativeIndex] = _weight;\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit WeightChange(_derivativeIndex, _weight);\n}\n\n// After\nfunction adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n) external onlyOwner {\n uint256 oldWeight = weights[_derivativeIndex];\n totalWeight = totalWeight + _weight - oldWeight;\n weights[_derivativeIndex] = _weight;\n emit WeightChange(_derivativeIndex, _weight);\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "// Before\nfunction addDerivative(\n address _contractAddress,\n uint256 _weight\n) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n}\n\n// After\nfunction addDerivative(\n address _contractAddress,\n uint256 _weight\n) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n totalWeight = totalWeight + _weight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ethos", "title": "NoamYakov Q", "severity_raw": "Medium", "severity": "medium", "description": "## Summary\n\n### Low Risk Issues\n| |Issue|Instances|\n|-|:-|:-:|\n| [L‑01] | Wrong emission of events | 3 |\n| [L‑02] | Privileged addresses can accidentally set system parameters with illegal values, leading to denial-of-service (and potential gas drainage) | 2 |\n\n\n## Low Risk Issues\n\n### [L‑01] Wrong emission of events\nEvents are emitted when they aren't supposed to.\n\n*There are 3 instances of this issue:*\n\n[Ethos-Core\\contracts\\LQTY\\CommunityIssuance.sol](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/LQTY/CommunityIssuance.sol#L94)\n```solidity\n94 emit TotalOATHIssuedUpdated(totalOATHIssued);\n```\n\nThe function `CommunityIssuance.issueOath()` doesn't update the total OATH issued unless `lastIssuanceTimestamp < lastDistributionTime`. This event should only be emitted if `lastIssuanceTimestamp < lastDistributionTime`.\n\n[Ethos-Core\\contracts\\LQTY\\LQTYStaking.sol](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/LQTY/LQTYStaking.sol#L94)\n```solidity\n94 emit LQTYTokenAddressSet(_lusdTokenAddress);\n```\n\nThe function `LQTYStaking.setAddresses()` doesn't set the LQTY token address `_lusdTokenAddress`. It sets it to `_lqtyTokenAddress` - and the function indeed emits the `LQTYTokenAddressSet(_lqtyTokenAddress)` event.\n\nThis function also sets the LUSD token address to `_lusdTokenAddress`, but doesn't emit the corresponding `LUSDTokenAddressSet(_lusdTokenAddress)` event.\n\n[Ethos-Core\\contracts\\LQTY\\LQTYStaking.sol](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/LQTY/LQTYStaking.sol#L131)\n```solidity\n131 emit StakingGainsWithdrawn(msg.sender, LUSDGain, collGainAssets, collGainAmounts);\n```\n\nThe function `LQTYStaking.stake()` doesn't withdraw staking gains unless `currentStake != 0`. This event should only be emitted if `currentStake != 0`.\n\n### ", "vulnerable_code": "94 emit TotalOATHIssuedUpdated(totalOATHIssued);", "fixed_code": "94 emit LQTYTokenAddressSet(_lusdTokenAddress);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/NoamYakov-Q.md", "collected_at": "2026-01-02T18:16:24.348287+00:00", "source_hash": "a241b3b9d63f6ae5d669f5f79a6c0498606227b40ae6ebaa60b5a0e6ec8f5543", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 207, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "94 emit TotalOATHIssuedUpdated(totalOATHIssued);", "primary_code_language": "solidity", "primary_code_char_count": 57, "all_code_blocks": "// Code block 1 (solidity):\n94 emit TotalOATHIssuedUpdated(totalOATHIssued);\n\n// Code block 2 (solidity):\n94 emit LQTYTokenAddressSet(_lusdTokenAddress);\n\n// Code block 3 (solidity):\n131 emit StakingGainsWithdrawn(msg.sender, LUSDGain, collGainAssets, collGainAmounts);", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "94 emit TotalOATHIssuedUpdated(totalOATHIssued);\n\n94 emit LQTYTokenAddressSet(_lusdTokenAddress);\n\n131 emit StakingGainsWithdrawn(msg.sender, LUSDGain, collGainAssets, collGainAmounts);", "github_refs_formatted": "CommunityIssuance.sol#L94, LQTYStaking.sol#L94, LQTYStaking.sol#L131", "github_files_list": "LQTYStaking.sol, CommunityIssuance.sol", "github_refs_count": 3, "vulnerable_code_actual": "94 emit TotalOATHIssuedUpdated(totalOATHIssued);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "94 emit LQTYTokenAddressSet(_lusdTokenAddress);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "04-caviar", "title": "cyberinn G", "severity_raw": "High", "severity": "high", "description": "# Gas Optimizations Report\n\n## [G-1] x += y or x -= y costs more gas than x = x + y or x = x - y for state variables\n\n### Impact\nUsing the addition operator instead of plus-equals saves 113 gas. Usually does not work with struct and mappings.\n\n### Findings\nTotal:5\n\n[src/PrivatePool.sol#L247-L678](https://github.com/code-423n4/2023-04-caviar/tree/main//src/PrivatePool.sol#L247-L678)\n```solidity\n247: royaltyFeeAmount += royaltyFee;\n\n252: netInputAmount += royaltyFeeAmount;\n\n341: royaltyFeeAmount += royaltyFee;\n\n355: netOutputAmount -= royaltyFeeAmount;\n\n678: sum += tokenWeights[i];\n```\n\n## [G-2] ++i/i++ should be unchecked{++i}/unchecked{i++} when it is not possible for them to overflow, as is the case when used in for- and while-loops\n\n### Impact\nThe unchecked keyword is new in solidity version 0.8.0, so this only applies to that version or higher, which these instances are. This saves 30-40 gas [per loop](https://gist.github.com/hrkrshnn/ee8fabd532058307229d65dcd5836ddc#the-increment-in-for-loop-post-condition-can-be-made-unchecked). \n\n### Findings\nTotal:19\n\n\n[src/EthRouter.sol#L284](https://github.com/code-423n4/2023-04-caviar/tree/main//src/EthRouter.sol#L284)\n```solidity\n106: for (uint256 i = 0; i < buys.length; i++) {\n\n116: for (uint256 j = 0; j < buys[i].tokenIds.length; j++) {\n\n134: for (uint256 j = 0; j < buys[i].tokenIds.length; j++) {\n\n159: for (uint256 i = 0; i < sells.length; i++) {\n\n161: for (uint256 j = 0; j < sells[i].tokenIds.length; j++) {\n\n183: for (uint256 j = 0; j < sells[i].tokenIds.length; j++) {\n\n239: for (uint256 i = 0; i < tokenIds.length; i++) {\n\n261: for (uint256 i = 0; i < changes.length; i++) {\n\n265: for (uint256 j = 0; j < changes[i].inputTokenIds.length; j++) {\n\n```\n\n[src/PrivatePool.sol#L238-L446](https://github.com/code-423n4/2023-04-caviar/tree/main//src/PrivatePool.sol#L238-L446)\n```solidity\n\n238: for (uint256 i = 0; i < tokenIds.length; i++) {\n\n272: for (uint256 i = 0; i < tokenIds.le", "vulnerable_code": "247: royaltyFeeAmount += royaltyFee;\n\n252: netInputAmount += royaltyFeeAmount;\n\n341: royaltyFeeAmount += royaltyFee;\n\n355: netOutputAmount -= royaltyFeeAmount;\n\n678: sum += tokenWeights[i];", "fixed_code": "106: for (uint256 i = 0; i < buys.length; i++) {\n\n116: for (uint256 j = 0; j < buys[i].tokenIds.length; j++) {\n\n134: for (uint256 j = 0; j < buys[i].tokenIds.length; j++) {\n\n159: for (uint256 i = 0; i < sells.length; i++) {\n\n161: for (uint256 j = 0; j < sells[i].tokenIds.length; j++) {\n\n183: for (uint256 j = 0; j < sells[i].tokenIds.length; j++) {\n\n239: for (uint256 i = 0; i < tokenIds.length; i++) {\n\n261: for (uint256 i = 0; i < changes.length; i++) {\n\n265: for (uint256 j = 0; j < changes[i].inputTokenIds.length; j++) {\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/cyberinn-G.md", "collected_at": "2026-01-02T18:20:27.191456+00:00", "source_hash": "a260c1025b5f7e78e90bdeeafdb8645140b3d18c536b8eb5759c6b67d6586d3f", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 757, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "247: royaltyFeeAmount += royaltyFee;\n\n252: netInputAmount += royaltyFeeAmount;\n\n341: royaltyFeeAmount += royaltyFee;\n\n355: netOutputAmount -= royaltyFeeAmount;\n\n678: sum += tokenWeights[i];", "primary_code_language": "solidity", "primary_code_char_count": 204, "all_code_blocks": "// Code block 1 (solidity):\n247: royaltyFeeAmount += royaltyFee;\n\n252: netInputAmount += royaltyFeeAmount;\n\n341: royaltyFeeAmount += royaltyFee;\n\n355: netOutputAmount -= royaltyFeeAmount;\n\n678: sum += tokenWeights[i];\n\n// Code block 2 (solidity):\n106: for (uint256 i = 0; i < buys.length; i++) {\n\n116: for (uint256 j = 0; j < buys[i].tokenIds.length; j++) {\n\n134: for (uint256 j = 0; j < buys[i].tokenIds.length; j++) {\n\n159: for (uint256 i = 0; i < sells.length; i++) {\n\n161: for (uint256 j = 0; j < sells[i].tokenIds.length; j++) {\n\n183: for (uint256 j = 0; j < sells[i].tokenIds.length; j++) {\n\n239: for (uint256 i = 0; i < tokenIds.length; i++) {\n\n261: for (uint256 i = 0; i < changes.length; i++) {\n\n265: for (uint256 j = 0; j < changes[i].inputTokenIds.length; j++) {", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "247: royaltyFeeAmount += royaltyFee;\n\n252: netInputAmount += royaltyFeeAmount;\n\n341: royaltyFeeAmount += royaltyFee;\n\n355: netOutputAmount -= royaltyFeeAmount;\n\n678: sum += tokenWeights[i];\n\n106: for (uint256 i = 0; i < buys.length; i++) {\n\n116: for (uint256 j = 0; j < buys[i].tokenIds.length; j++) {\n\n134: for (uint256 j = 0; j < buys[i].tokenIds.length; j++) {\n\n159: for (uint256 i = 0; i < sells.length; i++) {\n\n161: for (uint256 j = 0; j < sells[i].tokenIds.length; j++) {\n\n183: for (uint256 j = 0; j < sells[i].tokenIds.length; j++) {\n\n239: for (uint256 i = 0; i < tokenIds.length; i++) {\n\n261: for (uint256 i = 0; i < changes.length; i++) {\n\n265: for (uint256 j = 0; j < changes[i].inputTokenIds.length; j++) {", "github_refs_formatted": "PrivatePool.sol#L247-L678, EthRouter.sol#L284, PrivatePool.sol#L238-L446", "github_files_list": "EthRouter.sol, PrivatePool.sol", "github_refs_count": 3, "vulnerable_code_actual": "247: royaltyFeeAmount += royaltyFee;\n\n252: netInputAmount += royaltyFeeAmount;\n\n341: royaltyFeeAmount += royaltyFee;\n\n355: netOutputAmount -= royaltyFeeAmount;\n\n678: sum += tokenWeights[i];", "has_vulnerable_code_snippet": true, "fixed_code_actual": "106: for (uint256 i = 0; i < buys.length; i++) {\n\n116: for (uint256 j = 0; j < buys[i].tokenIds.length; j++) {\n\n134: for (uint256 j = 0; j < buys[i].tokenIds.length; j++) {\n\n159: for (uint256 i = 0; i < sells.length; i++) {\n\n161: for (uint256 j = 0; j < sells[i].tokenIds.length; j++) {\n\n183: for (uint256 j = 0; j < sells[i].tokenIds.length; j++) {\n\n239: for (uint256 i = 0; i < tokenIds.length; i++) {\n\n261: for (uint256 i = 0; i < changes.length; i++) {\n\n265: for (uint256 j = 0; j < changes[i].inputTokenIds.length; j++) {\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "06-lybra", "title": "mgf15 G", "severity_raw": "High", "severity": "high", "description": "\n## Summary\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [GAS-1](#GAS-1) | Use assembly to check for `address(0)` | 23 |\n| [GAS-2](#GAS-2) | Functions guaranteed to revert when called by normal users can be marked payable | 25 |\n| [GAS-3](#GAS-3) | `keccak256()` EXPRESSIONS WHICH ARE FIXED, CAN BE PRECALCULATED AND ASSIGNED TO THE CONSTANT VARIABLES. | 7 |\n| [GAS-4](#GAS-4) | Long revert strings | 39 |\n| [GAS-5](#GAS-5) | `>=` costs less gas than `>` | 60 |\n| [GAS-6](#GAS-6) | Use nested if and, avoid multiple check combinations | 4 |\n| [GAS-7](#GAS-7) | Using `private` rather than `public` for constants, saves gas | 7 |\n| [GAS-8](#GAS-8) | Splitting `require()` statements that use && saves gas | 3 |\n| [GAS-9](#GAS-9) | Inverting the condition of an if-else-statement wastes gas | 9 |\n| [GAS-10](#GAS-10) | Use double `if` statements instead of `&&` | 7 |\n| [GAS-11](#GAS-11) | Use constants instead of `type(uintx).max` | 1 |\n| [GAS-12](#GAS-12) | Use shift Right/Left instead of division/multiplication if possible | 81 |\n| [GAS-13](#GAS-13) | Don't compare boolean expressions to boolean literals | 1 |\n| [GAS-14](#GAS-14) | Write direct outcome, instead of performing mathematical operations | 3 |\n| [GAS-15](#GAS-15) | USE BYTES32 INSTEAD OF STRING | 5 |\n| [GAS-16](#GAS-16) | Compute known value `off-chain` | 7 |\n| [GAS-17](#GAS-17) | Part of the code can be pre calculated | 9 |\n| [GAS-18](#GAS-18) | Ternary operation is cheaper than if-else statement | 15 |\n| [GAS-19](#GAS-19) | Sort Solidity operations using short-circuit mode | 2 |\n\n\n### **[GAS-1]** Use assembly to check for `address(0)`\n\nSaves 6 gas per instance if using assembly to check for address(0)\n#### Proof Of Concept\n\n```solidity\nFile:2023-06-lybra/contracts/lybra/token/PeUSD.sol\n46: if (_from != address(this) && _from != spender)\n```\n\n#### Code Snippet\nhttps://github.com/code-423n4/2023-06-lybra/contracts/lybra/token/PeUSD.sol#L46\n```solidity\nFile:2023-06-lybra/contracts/lybra/token/LBR.so", "vulnerable_code": "File:2023-06-lybra/contracts/lybra/token/PeUSD.sol\n46: if (_from != address(this) && _from != spender)", "fixed_code": "File:2023-06-lybra/contracts/lybra/token/LBR.sol\n64: if (_from != address(this) && _from != spender)", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/mgf15-G.md", "collected_at": "2026-01-02T18:23:09.548457+00:00", "source_hash": "a2834142ad381ac0df25d3d9ad27162e0b19a952f2ac482529688ef2dcb42c92", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 109, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File:2023-06-lybra/contracts/lybra/token/PeUSD.sol\n46: if (_from != address(this) && _from != spender)", "primary_code_language": "solidity", "primary_code_char_count": 109, "all_code_blocks": "// Code block 1 (solidity):\nFile:2023-06-lybra/contracts/lybra/token/PeUSD.sol\n46: if (_from != address(this) && _from != spender)", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File:2023-06-lybra/contracts/lybra/token/PeUSD.sol\n46: if (_from != address(this) && _from != spender)", "github_refs_formatted": "PeUSD.sol#L46", "github_files_list": "PeUSD.sol", "github_refs_count": 1, "vulnerable_code_actual": "File:2023-06-lybra/contracts/lybra/token/PeUSD.sol\n46: if (_from != address(this) && _from != spender)", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File:2023-06-lybra/contracts/lybra/token/LBR.sol\n64: if (_from != address(this) && _from != spender)", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ai-arena", "title": "Nyxaris Q", "severity_raw": "Low", "severity": "low", "description": "## Title: \nLack of Event Emission on Ownership Transfer\n\n## Description:\n\n The [`transferOwnership`](https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/AiArenaHelper.sol#L61) function in the `AiArenaHelper` contract allows the current owner to transfer ownership to a new address. However, the function does not emit an event when ownership is transferred. In Solidity, events are crucial for tracking changes to the contract state, especially for off-chain monitoring and indexing services. The absence of an event for ownership transfer makes it difficult to observe and verify changes in ownership through external tools and user interfaces.\n\n## Recommendation: \nIt is recommended to define an event, such as [`OwnershipTransferred`](https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/AiArenaHelper.sol#L61), and emit it within the transferOwnership function to log the change of ownership. The event should include the address of the previous owner and the address of the new owner. This will enhance transparency and allow users and external applications to react to changes in contract ownership.\n\n```diff\n+ event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\nfunction transferOwnership(address newOwnerAddress) external {\n require(msg.sender == _ownerAddress, \"Only the owner can transfer ownership\");\n+ emit OwnershipTransferred(_ownerAddress, newOwnerAddress);\n _ownerAddress = newOwnerAddress;\n}\n\n\n```", "vulnerable_code": "", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/Nyxaris-Q.md", "collected_at": "2026-01-02T19:02:37.158811+00:00", "source_hash": "a2994a9e7e007f2541b8c7872462148f9bf324466757cc5decf723bc61b25487", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 337, "github_ref_count": 1, "vulnerable_code_is_url": true, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "+ event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\nfunction transferOwnership(address newOwnerAddress) external {\n require(msg.sender == _ownerAddress, \"Only the owner can transfer ownership\");\n+ emit OwnershipTransferred(_ownerAddress, newOwnerAddress);\n _ownerAddress = newOwnerAddress;\n}", "primary_code_language": "diff", "primary_code_char_count": 337, "all_code_blocks": "// Code block 1 (diff):\n+ event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\nfunction transferOwnership(address newOwnerAddress) external {\n require(msg.sender == _ownerAddress, \"Only the owner can transfer ownership\");\n+ emit OwnershipTransferred(_ownerAddress, newOwnerAddress);\n _ownerAddress = newOwnerAddress;\n}", "all_code_blocks_count": 1, "has_diff_blocks": true, "diff_code": "+ event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\nfunction transferOwnership(address newOwnerAddress) external {\n require(msg.sender == _ownerAddress, \"Only the owner can transfer ownership\");\n+ emit OwnershipTransferred(_ownerAddress, newOwnerAddress);\n _ownerAddress = newOwnerAddress;\n}", "solidity_code": "", "github_refs_formatted": "AiArenaHelper.sol#L61", "github_files_list": "AiArenaHelper.sol", "github_refs_count": 1, "vulnerable_code_actual": "", "has_vulnerable_code_snippet": false, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6.95} {"source": "c4", "protocol": "11-kelp", "title": "0xMosh Q", "severity_raw": "High", "severity": "high", "description": "# L-01 : `shares ` are not returned ! \n\nWhile depositing into strategy , `eigenlayerStrategyManagerAddress` contracts returns the amount of shares minted for that particular deposit . However catching that return value got skipped here in this line : \n```solidity \n IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);\n```\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/NodeDelegator.sol#L67\n## recommendation : \nI recommend to catch the returned amount and return to the user for better transparency . \n```diff\n- function depositAssetIntoStrategy(address asset)\n- //...\n- {\n\n+ function depositAssetIntoStrategy(address asset)\n+ //...\n+ returns (uint256 shares ) \n+ {\n\n //....\n\n- IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);\n+ return IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);\n\n\n```\n\n\n# L-02 : ", "vulnerable_code": " IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/0xMosh-Q.md", "collected_at": "2026-01-02T18:27:10.953968+00:00", "source_hash": "a2d8f9b74a779f6948910e39b7cb3d2d1b912761fcd887dee91eb670247cd9b2", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 189, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "https://github.com/code-423n4/2023-11-kelp/blob/main/src/NodeDelegator.sol#L67\n## recommendation : \nI recommend to catch the returned amount and return to the user for better transparency .", "primary_code_language": "unknown", "primary_code_char_count": 189, "all_code_blocks": "// Code block 1 (unknown):\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/NodeDelegator.sol#L67\n## recommendation : \nI recommend to catch the returned amount and return to the user for better transparency .", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "NodeDelegator.sol#L67", "github_files_list": "NodeDelegator.sol", "github_refs_count": 1, "vulnerable_code_actual": " IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5.11} {"source": "c4", "protocol": "02-ethos", "title": "RaymondFam G", "severity_raw": "High", "severity": "high", "description": "## Unneeded `assert()`\nThe following assertion of `vars.compositeDebt != 0` is unnecessary. Even if `_LUSDAmount` has accidentally been inputted as `0` making `vars.LUSDFee == 0` too, [`_getCompositeDebt()`](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/Dependencies/LiquityBase.sol#L41-L43) is going to have the constant `LUSD_GAS_COMPENSATION` which is `10e18` added to `vars.compositeDebt`.\n\nConsider removing it from `openTrove()` to save gas on function call and also contract deployment:\n\n[File: BorrowerOperations.sol#L197](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L197)\n\n```diff\n- assert(vars.compositeDebt > 0);\n```\nSimilarly, asserting `MIN_NET_DEBT` greater than zero in `setAddresses()` of BorrowerOperations.sol is unnecessary since the constant has been assigned [90e18](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/Dependencies/LiquityBase.sol#L25) in LiquityBase.sol:\n\n[File: BorrowerOperations.sol#L128](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L128)\n\n```diff\n- assert(MIN_NET_DEBT > 0);\n```\n## Use smaller uint128 or smaller type and pack structs variables to use lesser amount of storage slots\nAs the solidity EVM works with 32 bytes, most variables work fine with less than 32 bytes and may be packed inside a struct when sitting next to each other so that they can be stored in the same slot, this saves gas when writing to storage ~2000 gas.\n\nFor instance, struct `LocalVariables_OuterLiquidationFunction` of TroveManager.sol may be refactored as follows:\n\n[File: TroveManager.sol#L129-L138](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L129-L138)\n\n```diff\n struct LocalVariables_OuterLiquidationFunction {\n- uint256 collDecimals;\n+ uint128 collDecimals;\n+ bool recoveryModeAtStart;\n- uint256 collCCR;\n- ui", "vulnerable_code": "Similarly, asserting `MIN_NET_DEBT` greater than zero in `setAddresses()` of BorrowerOperations.sol is unnecessary since the constant has been assigned [90e18](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/Dependencies/LiquityBase.sol#L25) in LiquityBase.sol:\n\n[File: BorrowerOperations.sol#L128](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L128)\n", "fixed_code": "## Use smaller uint128 or smaller type and pack structs variables to use lesser amount of storage slots\nAs the solidity EVM works with 32 bytes, most variables work fine with less than 32 bytes and may be packed inside a struct when sitting next to each other so that they can be stored in the same slot, this saves gas when writing to storage ~2000 gas.\n\nFor instance, struct `LocalVariables_OuterLiquidationFunction` of TroveManager.sol may be refactored as follows:\n\n[File: TroveManager.sol#L129-L138](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L129-L138)\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/RaymondFam-G.md", "collected_at": "2026-01-02T18:16:32.840243+00:00", "source_hash": "a33aaf73358160008ae3ccf8aefc8e7fcd5b4a431485cd20d4dca8821e71a976", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 74, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "- assert(vars.compositeDebt > 0);", "primary_code_language": "diff", "primary_code_char_count": 40, "all_code_blocks": "// Code block 1 (diff):\n- assert(vars.compositeDebt > 0);\n\n// Code block 2 (diff):\n- assert(MIN_NET_DEBT > 0);", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "- assert(vars.compositeDebt > 0);\n\n- assert(MIN_NET_DEBT > 0);", "solidity_code": "", "github_refs_formatted": "LiquityBase.sol#L41-L43, BorrowerOperations.sol#L197, LiquityBase.sol#L25, BorrowerOperations.sol#L128, TroveManager.sol#L129-L138", "github_files_list": "TroveManager.sol, BorrowerOperations.sol, LiquityBase.sol", "github_refs_count": 5, "vulnerable_code_actual": "Similarly, asserting `MIN_NET_DEBT` greater than zero in `setAddresses()` of BorrowerOperations.sol is unnecessary since the constant has been assigned [90e18](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/Dependencies/LiquityBase.sol#L25) in LiquityBase.sol:\n\n[File: BorrowerOperations.sol#L128](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L128)\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## Use smaller uint128 or smaller type and pack structs variables to use lesser amount of storage slots\nAs the solidity EVM works with 32 bytes, most variables work fine with less than 32 bytes and may be packed inside a struct when sitting next to each other so that they can be stored in the same slot, this saves gas when writing to storage ~2000 gas.\n\nFor instance, struct `LocalVariables_OuterLiquidationFunction` of TroveManager.sol may be refactored as follows:\n\n[File: TroveManager.sol#L129-L138](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L129-L138)\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "02-ethos", "title": "Morraez Q", "severity_raw": "Medium", "severity": "medium", "description": "## Low Risk\n\n ERC20 operations can be unsafe due to different implementations and vulnerabilities in the standard. To account for this, either use OpenZeppelin's SafeERC20 library or wrap each operation in a require statement.\n Additionally, ERC20's approve functions have a known race-condition vulnerability. To account for this, use OpenZeppelin's SafeERC20 library's `safeIncrease` or `safeDecrease` Allowance functions.\n \n #### Unsafe Transfer\n ```js\n IERC20(token).transfer(msg.sender, amount);\n ```\n #### OpenZeppelin SafeTransfer\n ```js \n import {SafeERC20} from \"openzeppelin/token/utils/SafeERC20.sol\";\n //--snip--\n \n IERC20(token).safeTransfer(msg.sender, address(this), amount);\n ```\n\n #### Safe Transfer with require statement.\n ```js\n bool success = IERC20(token).transfer(msg.sender, amount);\n require(success, \"ERC20 transfer failed\");\n ```\n\n #### Unsafe TransferFrom\n ```js\n IERC20(token).transferFrom(msg.sender, address(this), amount);\n ```\n #### OpenZeppelin SafeTransferFrom\n ```js \n import {SafeERC20} from \"openzeppelin/token/utils/SafeERC20.sol\";\n //--snip--\n \n IERC20(token).safeTransferFrom(msg.sender, address(this), amount);\n ```\n\n #### Safe TransferFrom with require statement.\n ```js\n bool success = IERC20(token).transferFrom(msg.sender, address(this), amount);\n require(success, \"ERC20 transfer failed\");\n ```\n \n \n### Lines\n- EchidnaProxy.sol:105\n- EchidnaProxy.sol:109\n- EchidnaProxy.sol:113\n\n\n\n\n# Gas Optimizations - (Total Optimizations 326)\n\nThe following sections detail the gas optimizations found throughout the codebase. \nEach optimization is documented with the setup, an explainer for the optimization, a gas report and line identifiers for each optimization across the codebase. For each sect", "vulnerable_code": " IERC20(token).transfer(msg.sender, amount);\n ```\n #### OpenZeppelin SafeTransfer\n ```js \n import {SafeERC20} from \"openzeppelin/token/utils/SafeERC20.sol\";\n //--snip--\n \n IERC20(token).safeTransfer(msg.sender, address(this), amount);\n ```\n\n #### Safe Transfer with require statement.\n ```js\n bool success = IERC20(token).transfer(msg.sender, amount);\n require(success, \"ERC20 transfer failed\");\n ```\n\n #### Unsafe TransferFrom\n ```js\n IERC20(token).transferFrom(msg.sender, address(this), amount);\n ```\n #### OpenZeppelin SafeTransferFrom\n ```js \n import {SafeERC20} from \"openzeppelin/token/utils/SafeERC20.sol\";\n //--snip--\n \n IERC20(token).safeTransferFrom(msg.sender, address(this), amount);\n ```\n\n #### Safe TransferFrom with require statement.\n ```js\n bool success = IERC20(token).transferFrom(msg.sender, address(this), amount);\n require(success, \"ERC20 transfer failed\");\n ```\n \n \n### Lines\n- EchidnaProxy.sol:105\n- EchidnaProxy.sol:109\n- EchidnaProxy.sol:113\n\n\n\n\n# Gas Optimizations - (Total Optimizations 326)\n\nThe following sections detail the gas optimizations found throughout the codebase. \nEach optimization is documented with the setup, an explainer for the optimization, a gas report and line identifiers for each optimization across the codebase. For each section's gas report, the optimizer was turned on and set to 10000 runs. \nYou can replicate any tests/gas reports by heading to [0xKitsune/gas-lab](https://github.com/0xKitsune/gas-lab) and cloning the repo. Then, simply copy/paste the contract examples from any section and run `forge test --gas-report`. \nYou can also easily update the optimizer runs in the `foundry.toml`.\n\n
\n\n\n## Mark storage variables as `immutable` if they never change after contract initialization.\n\nState variables c", "fixed_code": "### Gas Report", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/Morraez-Q.md", "collected_at": "2026-01-02T18:16:23.445548+00:00", "source_hash": "a3e90ac4d837156f8e6b554597eedaf42c7a67906815bfee3e72cfe1a1d6baee", "code_block_count": 5, "solidity_block_count": 0, "total_code_chars": 189, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "IERC20(token).transfer(msg.sender, amount);", "primary_code_language": "js", "primary_code_char_count": 43, "all_code_blocks": "// Code block 1 (js):\nIERC20(token).transfer(msg.sender, amount);\n\n// Code block 2 (unknown):\n#### Safe Transfer with require statement.\n\n// Code block 3 (unknown):\n#### Unsafe TransferFrom\n\n// Code block 4 (unknown):\n#### OpenZeppelin SafeTransferFrom\n\n// Code block 5 (unknown):\n#### Safe TransferFrom with require statement.", "all_code_blocks_count": 5, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " IERC20(token).transfer(msg.sender, amount);\n ```\n #### OpenZeppelin SafeTransfer\n ```js \n import {SafeERC20} from \"openzeppelin/token/utils/SafeERC20.sol\";\n //--snip--\n \n IERC20(token).safeTransfer(msg.sender, address(this), amount);\n ```\n\n #### Safe Transfer with require statement.\n ```js\n bool success = IERC20(token).transfer(msg.sender, amount);\n require(success, \"ERC20 transfer failed\");\n ```\n\n #### Unsafe TransferFrom\n ```js\n IERC20(token).transferFrom(msg.sender, address(this), amount);\n ```\n #### OpenZeppelin SafeTransferFrom\n ```js \n import {SafeERC20} from \"openzeppelin/token/utils/SafeERC20.sol\";\n //--snip--\n \n IERC20(token).safeTransferFrom(msg.sender, address(this), amount);\n ```\n\n #### Safe TransferFrom with require statement.\n ```js\n bool success = IERC20(token).transferFrom(msg.sender, address(this), amount);\n require(success, \"ERC20 transfer failed\");\n ```\n \n \n### Lines\n- EchidnaProxy.sol:105\n- EchidnaProxy.sol:109\n- EchidnaProxy.sol:113\n\n\n\n\n# Gas Optimizations - (Total Optimizations 326)\n\nThe following sections detail the gas optimizations found throughout the codebase. \nEach optimization is documented with the setup, an explainer for the optimization, a gas report and line identifiers for each optimization across the codebase. For each section's gas report, the optimizer was turned on and set to 10000 runs. \nYou can replicate any tests/gas reports by heading to [0xKitsune/gas-lab](https://github.com/0xKitsune/gas-lab) and cloning the repo. Then, simply copy/paste the contract examples from any section and run `forge test --gas-report`. \nYou can also easily update the optimizer runs in the `foundry.toml`.\n\n
\n\n\n## Mark storage variables as `immutable` if they never change after contract initialization.\n\nState variables c", "has_vulnerable_code_snippet": true, "fixed_code_actual": "### Gas Report", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "03-asymmetry", "title": "fyvgsk Q", "severity_raw": "High", "severity": "high", "description": "## Impact\nSlippage is the difference between a trade's expected or requested price and the price at which the trade is effectively executed. It typically occurs in markets experiencing high volatility or low liquidity.\n\nIn this protocol, users cannot control the splippage when staking or unstaking derivatives. This value is set and controlled by the owner of the contracts (which can allow another issues).\n\n## Proof of Concept\nwhen users unstake their safETH, the `unstake()` function calls `withdraw()` on each derivative.\n```\nfunction unstake(uint256 _safEthAmount) external {\n[...]\n for (uint256 i = 0; i < derivativeCount; i++) {\n // withdraw a percentage of each asset based on the amount of safETH\n uint256 derivativeAmount = (derivatives[i].balance() *\n _safEthAmount) / safEthTotalSupply;\n if (derivativeAmount == 0) continue; // if derivative empty ignore\n derivatives[i].withdraw(derivativeAmount);\n[...]\n```\nThis `withdraw()` functions apply some `maxSlippage` when exchanging the derivative to ETH.\n```\nfunction withdraw(uint256 _amount) external onlyOwner {\n IWStETH(WST_ETH).unwrap(_amount);\n uint256 stEthBal = IERC20(STETH_TOKEN).balanceOf(address(this));\n IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);\n uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n }\n```\nThe mentioned `maxSlippage` value is set with a 1% in the constructor and it could be modified only by the contract owner to any other value. \n```\nfunction setMaxSlippage(uint256 _slippage) external onlyOwner {\n maxSlippage = _slippage;\n }\n```\n\n## Tools Used\nManual testing\n\n## Recommended Mitigation Steps\nAllow users to set a", "vulnerable_code": "function unstake(uint256 _safEthAmount) external {\n[...]\n for (uint256 i = 0; i < derivativeCount; i++) {\n // withdraw a percentage of each asset based on the amount of safETH\n uint256 derivativeAmount = (derivatives[i].balance() *\n _safEthAmount) / safEthTotalSupply;\n if (derivativeAmount == 0) continue; // if derivative empty ignore\n derivatives[i].withdraw(derivativeAmount);\n[...]", "fixed_code": "function withdraw(uint256 _amount) external onlyOwner {\n IWStETH(WST_ETH).unwrap(_amount);\n uint256 stEthBal = IERC20(STETH_TOKEN).balanceOf(address(this));\n IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);\n uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/fyvgsk-Q.md", "collected_at": "2026-01-02T18:19:08.417948+00:00", "source_hash": "a441a8c4f96848aca40888250bfb306519dc2dbea29fb04558aed82095389192", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 1128, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function unstake(uint256 _safEthAmount) external {\n[...]\n for (uint256 i = 0; i < derivativeCount; i++) {\n // withdraw a percentage of each asset based on the amount of safETH\n uint256 derivativeAmount = (derivatives[i].balance() *\n _safEthAmount) / safEthTotalSupply;\n if (derivativeAmount == 0) continue; // if derivative empty ignore\n derivatives[i].withdraw(derivativeAmount);\n[...]", "primary_code_language": "unknown", "primary_code_char_count": 452, "all_code_blocks": "// Code block 1 (unknown):\nfunction unstake(uint256 _safEthAmount) external {\n[...]\n for (uint256 i = 0; i < derivativeCount; i++) {\n // withdraw a percentage of each asset based on the amount of safETH\n uint256 derivativeAmount = (derivatives[i].balance() *\n _safEthAmount) / safEthTotalSupply;\n if (derivativeAmount == 0) continue; // if derivative empty ignore\n derivatives[i].withdraw(derivativeAmount);\n[...]\n\n// Code block 2 (unknown):\nfunction withdraw(uint256 _amount) external onlyOwner {\n IWStETH(WST_ETH).unwrap(_amount);\n uint256 stEthBal = IERC20(STETH_TOKEN).balanceOf(address(this));\n IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);\n uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n }\n\n// Code block 3 (unknown):\nfunction setMaxSlippage(uint256 _slippage) external onlyOwner {\n maxSlippage = _slippage;\n }", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function unstake(uint256 _safEthAmount) external {\n[...]\n for (uint256 i = 0; i < derivativeCount; i++) {\n // withdraw a percentage of each asset based on the amount of safETH\n uint256 derivativeAmount = (derivatives[i].balance() *\n _safEthAmount) / safEthTotalSupply;\n if (derivativeAmount == 0) continue; // if derivative empty ignore\n derivatives[i].withdraw(derivativeAmount);\n[...]", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function withdraw(uint256 _amount) external onlyOwner {\n IWStETH(WST_ETH).unwrap(_amount);\n uint256 stEthBal = IERC20(STETH_TOKEN).balanceOf(address(this));\n IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);\n uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "03-asymmetry", "title": "chaduke Q", "severity_raw": "Low", "severity": "low", "description": "QA1. The protocol lacks the method ``removeDerivative()``. Setting the weight for a derivative contract to ZERO will not do it since a user can still unstake from a derivative contract with zero weight.\n\nMitigation: 1) Call ``rebalanceToWeights()`` after any weight of the derivative contract is adjusted. \nIn this way, zero-weight derivative contract will have zero asset in it; or 2) explicitly implement a new method ``removeDerivative()``. The later is preferred. \n\n\nQA2. The protocol assumes that each derivative has 18 decimals, so the protocol will break when the underlying derivative has different decimals. \n\nFor example, the following code for ``stake()`` assumes a 18 decimals for the underlying derivative:\n```javascript\n uint256 underlyingValue = 0;\n\n // Getting underlying value in terms of ETH for each derivative\n for (uint i = 0; i < derivativeCount; i++)\n underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;\n```\n\nMitigation: add a function decimals() for each derivative contract and use it to calculate different quantities such as ``underlyingValue``.\n\nQA3. The ``stake()`` function has a precision loss issue due to the use of divide-before-multiplication.\n\n(https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L63-L101](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L63-L101)\n\nFirst, it calculates ``preDepositPrice`` as L81:\n```javascript\npreDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n```\n\nThen, it calculates the number of shares of ``safETH`` as:\n```javascript\n uint256 mintAmount = (totalStakeValueEth * 10 ** 18) / preDepositPrice;\n```\n\nMitigation: \nTo avoid larger precision loss and twice divisions, the correct formula should be\n```javascript\n uint256 mintAmount;\n", "vulnerable_code": " uint256 underlyingValue = 0;\n\n // Getting underlying value in terms of ETH for each derivative\n for (uint i = 0; i < derivativeCount; i++)\n underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;", "fixed_code": "preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/chaduke-Q.md", "collected_at": "2026-01-02T18:18:57.136472+00:00", "source_hash": "a441d39679341e858a960c2bf2c199fcce2c8c4a0015b2243577c8a1bbd05a2f", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 466, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "uint256 underlyingValue = 0;\n\n // Getting underlying value in terms of ETH for each derivative\n for (uint i = 0; i < derivativeCount; i++)\n underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;", "primary_code_language": "javascript", "primary_code_char_count": 334, "all_code_blocks": "// Code block 1 (javascript):\nuint256 underlyingValue = 0;\n\n // Getting underlying value in terms of ETH for each derivative\n for (uint i = 0; i < derivativeCount; i++)\n underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;\n\n// Code block 2 (javascript):\npreDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n\n// Code block 3 (javascript):\nuint256 mintAmount = (totalStakeValueEth * 10 ** 18) / preDepositPrice;", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol#L63-L101", "github_files_list": "SafEth.sol", "github_refs_count": 1, "vulnerable_code_actual": " uint256 underlyingValue = 0;\n\n // Getting underlying value in terms of ETH for each derivative\n for (uint i = 0; i < derivativeCount; i++)\n underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "02-ai-arena", "title": "0xSmartContract Analysis", "severity_raw": "Critical", "severity": "critical", "description": "# \ud83d\udee0\ufe0f Analysis - AI Arena Audit \n### Summary\n| List |Head |Details|\n|:--|:----------------|:------|\n|a) |The approach I followed when reviewing the code | Stages in my code review and analysis |\n|b) |Analysis of the code base | What is unique? How are the existing patterns used? \"Solidity-metrics\" was used |\n|c) |Test analysis | Test scope of the project and quality of tests |\n|d) |Security Approach of the Project | Audit approach of the Project |\n|e) |Other Audit Reports and Automated Findings | What are the previous Audit reports and their analysis |\n|f) |Packages and Dependencies Analysis | Details about the project Packages |\n|g) |Other recommendations | What is unique? How are the existing patterns used? |\n|h) |New insights and learning from this audit | Things learned from the project |\n\n\n## a) The approach I followed when reviewing the code\n\nFirst, by examining the scope of the code, I determined my code review and analysis strategy.\nhttps://github.com/code-423n4/2024-02-ai-arena\n\nAccordingly, I analyzed and audited the subject in the following steps;\n\n| Number |Stage |Details|Information|\n|:--|:----------------|:------|:------|\n|1|Compile and Run Test|[Installation](https://github.com/code-423n4/2024-02-ai-arena?tab=readme-ov-file#tests)|Test and installation structure is simple, cleanly designed|\n|2|Architecture Review| [AI Arena](https://docs.aiarena.io/gaming-competition) |Provides a basic architectural teaching for General Architecture|\n|3|Graphical Analysis |Graphical Analysis with [Solidity-metrics](https://github.com/ConsenSys/solidity-metrics)|A visual view has been made to dominate the general structure of the codes of the project.|\n|4|Slither Analysis | [Slither Report](https://github.com/code-423n4/2024-02-ai-arena/blob/main/slither.txt)| |\n|5|Test Suits|[Tests](https://github.com/code-423n4/2024-02-ai-arena?tab=readme-ov-file#tests)|In this section, the scope and content of the tests of the project are analyzed.|\n|6|Manuel Code Review|[Scope](h", "vulnerable_code": "/// @notice Returns the URI where the contract metadata is stored.\n /// @return URI where the contract metadata is stored.\n function contractURI() public pure returns (string memory) {\n return \"ipfs://bafybeih3witscmml3padf4qxbea5jh4rl2xp67aydqvqsxmyuzipwtpnii\";\n }\n\n\nfunction return value;\n{\n \"name\": \"AI Arena Game Items\",\n \"description\": \"In-game items to be used while playing AI Arena\",\n \"image\": \"https://ipfs.fleek.co/ipfs/bafybeic3p46ben4yqgwikt5bnz4qmqasbmrnnd6jrgamth7jk47xjwfq7q\",\n \"external_link\": \"https://gaming.aiarena.io/\",\n \"seller_fee_basis_points\": 800,\n \"fee_recipient\": \"0xd82F671a08DBb96Fff1334EE7992ce2E1A219c7C\"\n}", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/0xSmartContract-Analysis.md", "collected_at": "2026-01-02T19:02:05.123813+00:00", "source_hash": "a44726b1bbcfd55b637050d2b5da2131f2336739738f10ebfef9903a4be8f5a4", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "/// @notice Returns the URI where the contract metadata is stored.\n /// @return URI where the contract metadata is stored.\n function contractURI() public pure returns (string memory) {\n return \"ipfs://bafybeih3witscmml3padf4qxbea5jh4rl2xp67aydqvqsxmyuzipwtpnii\";\n }\n\n\nfunction return value;\n{\n \"name\": \"AI Arena Game Items\",\n \"description\": \"In-game items to be used while playing AI Arena\",\n \"image\": \"https://ipfs.fleek.co/ipfs/bafybeic3p46ben4yqgwikt5bnz4qmqasbmrnnd6jrgamth7jk47xjwfq7q\",\n \"external_link\": \"https://gaming.aiarena.io/\",\n \"seller_fee_basis_points\": 800,\n \"fee_recipient\": \"0xd82F671a08DBb96Fff1334EE7992ce2E1A219c7C\"\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4} {"source": "c4", "protocol": "03-asymmetry", "title": "MatricksDeCoder G", "severity_raw": "Critical", "severity": "critical", "description": "#### Gas-1 Use Assembly for Simple Getter and Setter functions \n\nIt may be possible to save on gas costs by using Yul assembly. Although generally this can be applied to all functions. This is not ideal as it can hinder readability, auditability of code, introduce errors or harm code as Yul Assembly will lack in-build safety checks. \n\nHowever simple getter and setter functions normally have 1 line code, touch storage with not much critical error raising issues and can be rewritten in yul without impacting readability. e.g \n(a) https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/Reth.sol#L44\n(b) https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/Reth.sol#L59\n(c) https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/SfrxEth.sol#L38\n(d) https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/SfrxEth.sol#L52\n(e) https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/WstEth.sol#L49\nAbove used to show examples where state variable is set using \nmaxSlippage = (1 * 10 ** 16); which can be rewritten \nassembly {\n sstore(maxSlippage.slot,1e16);\n}\n```\nfunction setMaxSlippage(uint256 _slippage) external onlyOwner {\n maxSlippage = _slippage;\n }\nCan be rewritten \nfunction setMaxSlippage(uint256 _slippage) external onlyOwner {\n assembly {\n sstore(maxSlippage.slot,_slippage);\n }\n}\n```\nAbove don't impact readability or prone to assembly errors \n\n#### Gas-2 Save hashed values as constants \n\nHashing is very expensive in Solidity keccak256 e.g 30 gas plus additional cost per each word of input data. There are many instances where values are hashed that are non changing strings, sometimes \n(a) https://github.c", "vulnerable_code": "function setMaxSlippage(uint256 _slippage) external onlyOwner {\n maxSlippage = _slippage;\n }\nCan be rewritten \nfunction setMaxSlippage(uint256 _slippage) external onlyOwner {\n assembly {\n sstore(maxSlippage.slot,_slippage);\n }\n}", "fixed_code": "keccak256(abi.encodePacked(\"contract.address\", \"rocketTokenRETH\"))\nCan be saved as e.g ->\nbytes32 private constant ROCKET_TOKEN_ETH = 0xe3744443225bff7cc22028be036b80de58057d65a3fdca0a3df329f525e31ccc;\nSo that part were used is\nRocketStorageInterface(ROCKET_STORAGE_ADDRESS).getAddress(ROCKET_TOKEN_ETH)", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/MatricksDeCoder-G.md", "collected_at": "2026-01-02T18:18:19.807095+00:00", "source_hash": "a461eb86285dc5d12cff8890101c9e5b5cf13cbe1ddb05ac3d305008c8b580a1", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 262, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function setMaxSlippage(uint256 _slippage) external onlyOwner {\n maxSlippage = _slippage;\n }\nCan be rewritten \nfunction setMaxSlippage(uint256 _slippage) external onlyOwner {\n assembly {\n sstore(maxSlippage.slot,_slippage);\n }\n}", "primary_code_language": "unknown", "primary_code_char_count": 262, "all_code_blocks": "// Code block 1 (unknown):\nfunction setMaxSlippage(uint256 _slippage) external onlyOwner {\n maxSlippage = _slippage;\n }\nCan be rewritten \nfunction setMaxSlippage(uint256 _slippage) external onlyOwner {\n assembly {\n sstore(maxSlippage.slot,_slippage);\n }\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Reth.sol#L44, Reth.sol#L59, SfrxEth.sol#L38, SfrxEth.sol#L52, WstEth.sol#L49", "github_files_list": "SfrxEth.sol, Reth.sol, WstEth.sol", "github_refs_count": 5, "vulnerable_code_actual": "function setMaxSlippage(uint256 _slippage) external onlyOwner {\n maxSlippage = _slippage;\n }\nCan be rewritten \nfunction setMaxSlippage(uint256 _slippage) external onlyOwner {\n assembly {\n sstore(maxSlippage.slot,_slippage);\n }\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "keccak256(abi.encodePacked(\"contract.address\", \"rocketTokenRETH\"))\nCan be saved as e.g ->\nbytes32 private constant ROCKET_TOKEN_ETH = 0xe3744443225bff7cc22028be036b80de58057d65a3fdca0a3df329f525e31ccc;\nSo that part were used is\nRocketStorageInterface(ROCKET_STORAGE_ADDRESS).getAddress(ROCKET_TOKEN_ETH)", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ai-arena", "title": "PoeAudits Q", "severity_raw": "Low", "severity": "low", "description": "# Low Issues:\n\n## Approve Function Race-Condition in Neuron.sol\nIssue Type: Error\nLink: https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/Neuron.sol#L171-177\n https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/Neuron.sol#L184-190\n https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/Neuron.sol#L196-204\n\n#### Impact\nUsers with a non-zero approval balance can frontrun approval transactions to exceed their intended allowance. \n\n#### Proof of Concept\nThis is a well documented vulnerability regarding race-conditions. \nhttps://github.com/crytic/not-so-smart-contracts/tree/master/race_condition\n\nThe approve function is vulnerable to frontrunning attacks where the target of the approval first spends their approval balance, before spending their newly approved balance. Quoting Crytic's \"not-so-smart-contracts\": \n\n\"The ERC20 standard's approve and transferFrom functions are vulnerable to a race condition. Suppose Alice has approved Bob to spend 100 tokens on her behalf. She then decides to only approve him for 50 tokens and sends a second approve transaction. However, Bob sees that he's about to be downgraded and quickly submits a transferFrom for the original 100 tokens he was approved for. If this transaction gets mined before Alice's second approve, Bob will be able to spend 150 of Alice's tokens.\"\n\nThe increaseAllowance and decreaseAllowance in the Openzeppelin implementation explicity mention this:\n ```\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n ```\n \n#### Tools Used\nManual Review\n\n#### Recommended Mitigation Steps\nUse increaseAllowance/decreaseAllowance instead of approve. \n\n\n## Minting Enables Public Use of _replenishDailyAllowance\nIssue Type: Input Validation\n\nLink: https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/GameItems.sol#L165-L", "vulnerable_code": " * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n ```\n \n#### Tools Used\nManual Review\n\n#### Recommended Mitigation Steps\nUse increaseAllowance/decreaseAllowance instead of approve. \n\n\n## Minting Enables Public Use of _replenishDailyAllowance\nIssue Type: Input Validation\n\nLink: https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/GameItems.sol#L165-L172\n\n#### Impact\nPublic use of private function _replenishDailyAllowance for no Neuron cost. Could have minor interactions with future items. \n\n#### Proof of Concept\nThe mint function has no check for minting zero items, which normally does not serve a purpose. Viable inputs with no real purpose or usecase are generally avoided. The mint function calls the private function _replenishDailyAllowance to replenish the user's allowance if enough time has passed. By minting zero game items, it costs the user zero Neuron, and updates the state variables allowanceRemaining and dailyAllowanceReplenishTime. This effectively makes the _replenishDailyAllowance function public instead of private while costing the user extra gas used by the mint logic. A PoC is included which adds extra logic to the test/GameItems.t.sol function testMintGameItem which demonstrates how the user can invoke the private function at no Neuron cost. \n", "fixed_code": "```\nLogs:\n[PASS] testMintGameItem() (gas: 204574)\nLogs:\n Total Battery Allowance: 10\n Remaining Allowance After Mint: 8\n Remaining Allowance Next Day: 8\n Remaining Allowance After Zero Mint: 10\n Owner Balance Before Zero Mint: 3998000000000000000000\n Owner Balance After Zero Mint: 3998000000000000000000", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/PoeAudits-Q.md", "collected_at": "2026-01-02T19:02:39.368049+00:00", "source_hash": "a4ab1da910e5090bde64a30c9880c60d844092c37b41db76c52951671f9f52cc", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 211, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "* @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.", "primary_code_language": "unknown", "primary_code_char_count": 211, "all_code_blocks": "// Code block 1 (unknown):\n* @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Neuron.sol#L171-L177, Neuron.sol#L184-L190, Neuron.sol#L196-L204, GameItems.sol#L165", "github_files_list": "GameItems.sol, Neuron.sol", "github_refs_count": 4, "vulnerable_code_actual": " * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n ```\n \n#### Tools Used\nManual Review\n\n#### Recommended Mitigation Steps\nUse increaseAllowance/decreaseAllowance instead of approve. \n\n\n## Minting Enables Public Use of _replenishDailyAllowance\nIssue Type: Input Validation\n\nLink: https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/GameItems.sol#L165-L172\n\n#### Impact\nPublic use of private function _replenishDailyAllowance for no Neuron cost. Could have minor interactions with future items. \n\n#### Proof of Concept\nThe mint function has no check for minting zero items, which normally does not serve a purpose. Viable inputs with no real purpose or usecase are generally avoided. The mint function calls the private function _replenishDailyAllowance to replenish the user's allowance if enough time has passed. By minting zero game items, it costs the user zero Neuron, and updates the state variables allowanceRemaining and dailyAllowanceReplenishTime. This effectively makes the _replenishDailyAllowance function public instead of private while costing the user extra gas used by the mint logic. A PoC is included which adds extra logic to the test/GameItems.t.sol function testMintGameItem which demonstrates how the user can invoke the private function at no Neuron cost. \n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "```\nLogs:\n[PASS] testMintGameItem() (gas: 204574)\nLogs:\n Total Battery Allowance: 10\n Remaining Allowance After Mint: 8\n Remaining Allowance Next Day: 8\n Remaining Allowance After Zero Mint: 10\n Owner Balance Before Zero Mint: 3998000000000000000000\n Owner Balance After Zero Mint: 3998000000000000000000", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "08-dopex", "title": "0xhacksmithh G", "severity_raw": "High", "severity": "high", "description": "### [Gas-01] 'constant` should be a value rather than a expression\nValue should directly assign to constant state variable, and a comment mentioned how that value calculated from expression\n```solidity\n- bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n\n+ bytes32 public constant MINTER_ROLE = 0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6 // keccak256(\"MINTER_ROLE\")\n```\n```solidity\n // Create a new role identifier for the minter role\n bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\"); \n\n // Create a new role identifier for the Rdpx v2 core role\n bytes32 public constant RDPXV2CORE_ROLE = keccak256(\"RDPXV2CORE_ROLE\");\n```\n```solidity\n bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\"); // @audit\n bytes32 public constant BURNER_ROLE = keccak256(\"BURNER_ROLE\");\n```\n```solidity\n uint256 public constant RDPX_RATIO_PERCENTAGE = 25 * DEFAULT_PRECISION;\n\n uint256 public constant ETH_RATIO_PERCENTAGE = 75 * DEFAULT_PRECISION;\n```\n\n*Instances(8)*\n```\nFile: contracts/core/RdpxV2Bond.sol\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Bond.sol#L22\n```\n```\nfile: contracts/decaying-bonds/RdpxDecayingBonds.sol\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/decaying-bonds/RdpxDecayingBonds.sol#L31\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/decaying-bonds/RdpxDecayingBonds.sol#L34\n```\n```\nfile: contracts/dpxETH/DpxEthToken.sol\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/dpxETH/DpxEthToken.sol#L19\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/dpxETH/DpxEthToken.sol#L20\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/dpxETH/DpxEthToken.sol#L21\n```\n```\nfile: contracts/core/RdpxV2Core.sol\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L88\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contrac", "vulnerable_code": "- bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n\n+ bytes32 public constant MINTER_ROLE = 0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6 // keccak256(\"MINTER_ROLE\")", "fixed_code": " // Create a new role identifier for the minter role\n bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\"); \n\n // Create a new role identifier for the Rdpx v2 core role\n bytes32 public constant RDPXV2CORE_ROLE = keccak256(\"RDPXV2CORE_ROLE\");", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/0xhacksmithh-G.md", "collected_at": "2026-01-02T18:24:24.504203+00:00", "source_hash": "a4ae070c401c740633e78e3f72ff8e5795c3f4387a5413ca63f0349b5b0ad1dd", "code_block_count": 7, "solidity_block_count": 4, "total_code_chars": 1504, "github_ref_count": 7, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "- bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n\n+ bytes32 public constant MINTER_ROLE = 0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6 // keccak256(\"MINTER_ROLE\")", "primary_code_language": "solidity", "primary_code_char_count": 205, "all_code_blocks": "// Code block 1 (solidity):\n- bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n\n+ bytes32 public constant MINTER_ROLE = 0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6 // keccak256(\"MINTER_ROLE\")\n\n// Code block 2 (solidity):\n// Create a new role identifier for the minter role\n bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\"); \n\n // Create a new role identifier for the Rdpx v2 core role\n bytes32 public constant RDPXV2CORE_ROLE = keccak256(\"RDPXV2CORE_ROLE\");\n\n// Code block 3 (solidity):\nbytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\"); // @audit\n bytes32 public constant BURNER_ROLE = keccak256(\"BURNER_ROLE\");\n\n// Code block 4 (solidity):\nuint256 public constant RDPX_RATIO_PERCENTAGE = 25 * DEFAULT_PRECISION;\n\n uint256 public constant ETH_RATIO_PERCENTAGE = 75 * DEFAULT_PRECISION;\n\n// Code block 5 (unknown):\nFile: contracts/core/RdpxV2Bond.sol\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Bond.sol#L22\n\n// Code block 6 (unknown):\nfile: contracts/decaying-bonds/RdpxDecayingBonds.sol\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/decaying-bonds/RdpxDecayingBonds.sol#L31\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/decaying-bonds/RdpxDecayingBonds.sol#L34\n\n// Code block 7 (unknown):\nfile: contracts/dpxETH/DpxEthToken.sol\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/dpxETH/DpxEthToken.sol#L19\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/dpxETH/DpxEthToken.sol#L20\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/dpxETH/DpxEthToken.sol#L21", "all_code_blocks_count": 7, "has_diff_blocks": false, "diff_code": "", "solidity_code": "- bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n\n+ bytes32 public constant MINTER_ROLE = 0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6 // keccak256(\"MINTER_ROLE\")\n\n// Create a new role identifier for the minter role\n bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\"); \n\n // Create a new role identifier for the Rdpx v2 core role\n bytes32 public constant RDPXV2CORE_ROLE = keccak256(\"RDPXV2CORE_ROLE\");\n\nbytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\"); // @audit\n bytes32 public constant BURNER_ROLE = keccak256(\"BURNER_ROLE\");\n\nuint256 public constant RDPX_RATIO_PERCENTAGE = 25 * DEFAULT_PRECISION;\n\n uint256 public constant ETH_RATIO_PERCENTAGE = 75 * DEFAULT_PRECISION;", "github_refs_formatted": "RdpxV2Bond.sol#L22, RdpxDecayingBonds.sol#L31, RdpxDecayingBonds.sol#L34, DpxEthToken.sol#L19, DpxEthToken.sol#L20, DpxEthToken.sol#L21, RdpxV2Core.sol#L88", "github_files_list": "DpxEthToken.sol, RdpxV2Core.sol, RdpxV2Bond.sol, RdpxDecayingBonds.sol", "github_refs_count": 7, "vulnerable_code_actual": "- bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n\n+ bytes32 public constant MINTER_ROLE = 0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6 // keccak256(\"MINTER_ROLE\")", "has_vulnerable_code_snippet": true, "fixed_code_actual": " // Create a new role identifier for the minter role\n bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\"); \n\n // Create a new role identifier for the Rdpx v2 core role\n bytes32 public constant RDPXV2CORE_ROLE = keccak256(\"RDPXV2CORE_ROLE\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 13} {"source": "c4", "protocol": "03-asymmetry", "title": "anodaram G", "severity_raw": "Medium", "severity": "medium", "description": "# Dynamic updating of `totalWeight`\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L169-L173\n```\n weights[_derivativeIndex] = _weight;\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n```\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L187-L193\n```\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n```\nIt seems like current code assume that `derivativeCount` is not big.\nBut in case of `derivativeCount` is big, we need to optimize these for loops.\nLike this:\n```\n// in adjustWeight(L169-L173)\n totalWeight -= weights[_derivativeIndex];\n weights[_derivativeIndex] = _weight;\n totalWeight += weights[_derivativeIndex];\n\n// in addDerivative(L187-L193)\n weights[derivativeCount] = _weight;\n derivativeCount++;\n totalWeight += weights[_derivativeIndex];\n```\n\n# We can move `ethAmountToRebalance = 0` before the for loop\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L147-L153\n```\n for (uint i = 0; i < derivativeCount; i++) {\n if (weights[i] == 0 || ethAmountToRebalance == 0) continue;\n uint256 ethAmount = (ethAmountToRebalance * weights[i]) /\n totalWeight;\n // Price will change due to slippage\n derivatives[i].deposit{value: ethAmount}();\n }\n```\nOptimized Code by avoiding multiple checking of `ethAmountToRebalance != 0`.\n```\n if (ethAmountToRebalance != 0) {\n for (uint i = 0; i < derivativeCount; i++) {\n ", "vulnerable_code": " weights[_derivativeIndex] = _weight;\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;", "fixed_code": " weights[derivativeCount] = _weight;\n derivativeCount++;\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;", "recommendation": "", "category": "slippage", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/anodaram-G.md", "collected_at": "2026-01-02T18:18:47.690309+00:00", "source_hash": "a4bbd299a3f7f2b558dd9ba485c495d52ecb2cf936f1d8fba49bf707a8a64cf3", "code_block_count": 4, "solidity_block_count": 0, "total_code_chars": 1108, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "weights[_derivativeIndex] = _weight;\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;", "primary_code_language": "unknown", "primary_code_char_count": 212, "all_code_blocks": "// Code block 1 (unknown):\nweights[_derivativeIndex] = _weight;\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n\n// Code block 2 (unknown):\nweights[derivativeCount] = _weight;\n derivativeCount++;\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n\n// Code block 3 (unknown):\n// in adjustWeight(L169-L173)\n totalWeight -= weights[_derivativeIndex];\n weights[_derivativeIndex] = _weight;\n totalWeight += weights[_derivativeIndex];\n\n// in addDerivative(L187-L193)\n weights[derivativeCount] = _weight;\n derivativeCount++;\n totalWeight += weights[_derivativeIndex];\n\n// Code block 4 (unknown):\nfor (uint i = 0; i < derivativeCount; i++) {\n if (weights[i] == 0 || ethAmountToRebalance == 0) continue;\n uint256 ethAmount = (ethAmountToRebalance * weights[i]) /\n totalWeight;\n // Price will change due to slippage\n derivatives[i].deposit{value: ethAmount}();\n }", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol#L169-L173, SafEth.sol#L187-L193, SafEth.sol#L147-L153", "github_files_list": "SafEth.sol", "github_refs_count": 3, "vulnerable_code_actual": " weights[_derivativeIndex] = _weight;\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;", "has_vulnerable_code_snippet": true, "fixed_code_actual": " weights[derivativeCount] = _weight;\n derivativeCount++;\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "08-dopex", "title": "RED LOTUS REACH Analysis", "severity_raw": "Critical", "severity": "critical", "description": "# Table Of Contents\n\n- [Architectural Review and Feedback](#Architectural-Review-and-Feedback)\n- [Attack Vectors to Depeg dpxETH-ETH](#Attack-Vectors-to-Depeg-dpxETH-ETH)\n- [Discussion of Access Control & Centralization Risks](#Discussion-of-Access-Control-&-Centralization-Risks)\n- [Market and Protocol Efficacy Risk Scenarios](#Market-and-Protocol-Efficacy-Risk-Scenarios)\n- [Technical Architecture Documents and Diagrams](#Technical-Architecture-Documents-and-Diagrams)\n\n# Introduction\n\nThis analysis report delves into various sections and modules of the rDPX V2 Product that the RED-LOTUS team audited, specific sections covered are listed within the table of contents above. \n\nOur approach included a thorough examination and testing of the codebase, research on wider security implications applicable to the protocol and expanded discussion of potential out of scope/known issues from the audit contest. \n\nA number of potential issues were identified related to centralization and systemic market risks applicable to the protocol were explored. Furthermore, as the Project Team specifically asked for Wardens to explore ways to break the dpxETH-ETH peg, the RED-LOTUS team explored a number of attack vectors and gave detailed description in the corresponding section of the report.\n\nThe team also supplied feedback on the rDPX V2 Product Specification from an Architectural perspective and demonstrated that there were inconsistencies between the supplied documentation and the production codebase. We hope that the Project Team will gain value from our Analysis to update their documentation where applicable.\n\nThroughout our analysis, we aimed to provide a comprehensive understanding of the codebase, suggesting areas for possible improvement. To validate our insights, we supplemented our explanations with illustrative figures, demonstrating robust comprehension of Dopex's internal code functionality.\n\nOver the course of the 14-day contest, we dedicated approximately 300+ hours to aud", "vulnerable_code": "[L100] collateralSymbol = _collateralSymbol;\n...\n[L104] symbol = string.concat(_collateralSymbol, \"-LP\");", "fixed_code": "constructor(\n\tstring memory _name,\n\tstring memory _symbol,\n\taddress _collateralToken,\n\tuint256 _gensis\n) ERC721(_name, _symbol) {\n\t_validate(_collateralToken != address (0), 1);\n\n\tcollateralToken = IERC20WithBurn(_collateralToken);\n\tunderlyingSymbol = collateralToken.symbol();\n\tcollateralPrecision = 10 ** collateralToken.decimals();\n\tgenesis = _genesis;\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/RED-LOTUS-REACH-Analysis.md", "collected_at": "2026-01-02T18:24:57.345085+00:00", "source_hash": "a4c12a060960f529c9391f1ffa61e7edd27faf8e3ffa1c6bc8927aec63b8ead4", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "[L100] collateralSymbol = _collateralSymbol;\n...\n[L104] symbol = string.concat(_collateralSymbol, \"-LP\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": "constructor(\n\tstring memory _name,\n\tstring memory _symbol,\n\taddress _collateralToken,\n\tuint256 _gensis\n) ERC721(_name, _symbol) {\n\t_validate(_collateralToken != address (0), 1);\n\n\tcollateralToken = IERC20WithBurn(_collateralToken);\n\tunderlyingSymbol = collateralToken.symbol();\n\tcollateralPrecision = 10 ** collateralToken.decimals();\n\tgenesis = _genesis;\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "02-ai-arena", "title": "MatricksDeCoder Q", "severity_raw": "Critical", "severity": "critical", "description": "#### L-1 Missing events for critical function and parameter updates especially admin/owner-controlled functions \n\nOwnership transfer by the owner \nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/AiArenaHelper.sol#L61\n\nattributeDivisors by owner \nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/AiArenaHelper.sol#L68\n\naddAttributeProbabilities by owner \nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/AiArenaHelper.sol#L131\n\ndeleteAttributeProbabilities \nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/AiArenaHelper.sol#L144\n\nownership transfer by the owner \nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L120\n\nincrementGeneration by owner \nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L129\n\naddStaker by owner \nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L139\n\ninstantiateAIArenaHelperContract by owner \nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L147\n\ninstantiateMintpassContract by owner \nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L155\n\ninstantiateNeuronContract by owner \nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L163\n\nsetMergingPoolAddress by owner \nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L171\n\nsetTokenURI by owner \nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L180\n\ntransferOwnership by owner \nhttps://github.com/code-423n4/2024-02-ai-ar", "vulnerable_code": " _safeMint(to, newId);\nFighterOps.fighterCreatedEmitter(newId, weight, element, generation[fighterType]);", "fixed_code": " require(msg.sender == _ownerAddress);\nor \nrequire(isAdmin[msg.sender]);", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/MatricksDeCoder-Q.md", "collected_at": "2026-01-02T19:02:33.609721+00:00", "source_hash": "a58fd3625eb6d96f5ebd1f40ccb525e159fac047a8a4c52090c4de380858e862", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 12, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "AiArenaHelper.sol#L61, AiArenaHelper.sol#L68, AiArenaHelper.sol#L131, AiArenaHelper.sol#L144, FighterFarm.sol#L120, FighterFarm.sol#L129, FighterFarm.sol#L139, FighterFarm.sol#L147, FighterFarm.sol#L155, FighterFarm.sol#L163, FighterFarm.sol#L171, FighterFarm.sol#L180", "github_files_list": "AiArenaHelper.sol, FighterFarm.sol", "github_refs_count": 12, "vulnerable_code_actual": " _safeMint(to, newId);\nFighterOps.fighterCreatedEmitter(newId, weight, element, generation[fighterType]);", "has_vulnerable_code_snippet": true, "fixed_code_actual": " require(msg.sender == _ownerAddress);\nor \nrequire(isAdmin[msg.sender]);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "05-ajna", "title": "14si2o_Flint Q", "severity_raw": "Critical", "severity": "critical", "description": "\n### Non-Critical Issues List\n| Number |Issues Details|Context|\n|:--:|:-------|:--:|\n| [N-01]|Incorrect Error with Overflow | 1 |\n| [N-02] |NatSpec Typo's |4|\n| [N-03] |Wrong Natspec |1|\n\nTotal 3 issues\n\n### [N-01] Incorrect Error with Overflow\n\nAn error specific to overflow should be used, not one for InsufficientVotingPower.\n\n```solidity\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/StandardFunding.sol#L657-L660\n\n // and check that attempted votes cast doesn't overflow uint128\n uint256 sumOfTheSquareOfVotesCast = _sumSquareOfVotesCast(votesCast);\n if (sumOfTheSquareOfVotesCast > type(uint128).max) revert InsufficientVotingPower();\n uint128 cumulativeVotePowerUsed = SafeCast.toUint128(sumOfTheSquareOfVotesCast);\n\n```\n\nRecommended Mitigation Steps\n\nCreate an Error specific to Overflow. \n\n### [N-02] NatSpec Typo's\n\nSeveral minor NatSpec Typo's\n\n\n```solidity\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/StandardFunding.sol#L270\n * @param currentDistribution_ Struct of the distribution period to calculat rewards for.\n```\nShould be: \"period to calculate rewards for.\"\n\n\n\n```solidity\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/StandardFunding.sol#LL540C41-L540C41\n // calculate the voting power available to the voting power in this funding stage\n```\nShould be: \"calculate the voting power available to the voter in this funding stage\"\n\n```solidity\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/interfaces/IStandardFunding.sol#L175\n * @param distributionId_ Id of distribution from whinch delegatee wants to claim his reward.\n```\nShould be: \"Id of distribution from which the delegatee wants to claim his reward\"\n\n\n```solidity\nhttps://github.com/code-423", "vulnerable_code": "https://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/StandardFunding.sol#L657-L660\n\n // and check that attempted votes cast doesn't overflow uint128\n uint256 sumOfTheSquareOfVotesCast = _sumSquareOfVotesCast(votesCast);\n if (sumOfTheSquareOfVotesCast > type(uint128).max) revert InsufficientVotingPower();\n uint128 cumulativeVotePowerUsed = SafeCast.toUint128(sumOfTheSquareOfVotesCast);\n", "fixed_code": "https://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/StandardFunding.sol#L270\n * @param currentDistribution_ Struct of the distribution period to calculat rewards for.", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/14si2o_Flint-Q.md", "collected_at": "2026-01-02T18:20:52.181981+00:00", "source_hash": "a5a9b402a61649f370406b91b0f967f48e96f855e716e2fabe7e16c63bf8b485", "code_block_count": 4, "solidity_block_count": 4, "total_code_chars": 1209, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "https://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/StandardFunding.sol#L657-L660\n\n // and check that attempted votes cast doesn't overflow uint128\n uint256 sumOfTheSquareOfVotesCast = _sumSquareOfVotesCast(votesCast);\n if (sumOfTheSquareOfVotesCast > type(uint128).max) revert InsufficientVotingPower();\n uint128 cumulativeVotePowerUsed = SafeCast.toUint128(sumOfTheSquareOfVotesCast);", "primary_code_language": "solidity", "primary_code_char_count": 479, "all_code_blocks": "// Code block 1 (solidity):\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/StandardFunding.sol#L657-L660\n\n // and check that attempted votes cast doesn't overflow uint128\n uint256 sumOfTheSquareOfVotesCast = _sumSquareOfVotesCast(votesCast);\n if (sumOfTheSquareOfVotesCast > type(uint128).max) revert InsufficientVotingPower();\n uint128 cumulativeVotePowerUsed = SafeCast.toUint128(sumOfTheSquareOfVotesCast);\n\n// Code block 2 (solidity):\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/StandardFunding.sol#L270\n * @param currentDistribution_ Struct of the distribution period to calculat rewards for.\n\n// Code block 3 (solidity):\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/StandardFunding.sol#LL540C41-L540C41\n // calculate the voting power available to the voting power in this funding stage\n\n// Code block 4 (solidity):\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/interfaces/IStandardFunding.sol#L175\n * @param distributionId_ Id of distribution from whinch delegatee wants to claim his reward.", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "https://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/StandardFunding.sol#L657-L660\n\n // and check that attempted votes cast doesn't overflow uint128\n uint256 sumOfTheSquareOfVotesCast = _sumSquareOfVotesCast(votesCast);\n if (sumOfTheSquareOfVotesCast > type(uint128).max) revert InsufficientVotingPower();\n uint128 cumulativeVotePowerUsed = SafeCast.toUint128(sumOfTheSquareOfVotesCast);\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/StandardFunding.sol#L270\n * @param currentDistribution_ Struct of the distribution period to calculat rewards for.\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/StandardFunding.sol#LL540C41-L540C41\n // calculate the voting power available to the voting power in this funding stage\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/interfaces/IStandardFunding.sol#L175\n * @param distributionId_ Id of distribution from whinch delegatee wants to claim his reward.", "github_refs_formatted": "StandardFunding.sol#L657-L660, StandardFunding.sol#L270, StandardFunding.sol, IStandardFunding.sol#L175", "github_files_list": "StandardFunding.sol, IStandardFunding.sol", "github_refs_count": 4, "vulnerable_code_actual": "https://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/StandardFunding.sol#L657-L660\n\n // and check that attempted votes cast doesn't overflow uint128\n uint256 sumOfTheSquareOfVotesCast = _sumSquareOfVotesCast(votesCast);\n if (sumOfTheSquareOfVotesCast > type(uint128).max) revert InsufficientVotingPower();\n uint128 cumulativeVotePowerUsed = SafeCast.toUint128(sumOfTheSquareOfVotesCast);\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "https://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/StandardFunding.sol#L270\n * @param currentDistribution_ Struct of the distribution period to calculat rewards for.", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "10-badger", "title": "jamshed G", "severity_raw": "High", "severity": "high", "description": " \n\n## \\[G\u201101\\] Save gas by preventing zero amount in mint() and burn()[](https://github.com/code-423n4/2023-09-maia/blob/main/src/token/ERC20hTokenRoot.sol#L57C4-L72C6)\n\n```\nfunction mint(address _account, uint256 _amount) external override {\n _requireCallerIsBOorCdpMOrAuth();\n _mint(_account, _amount);\n }\n\n /// @notice Burn existing tokens\n /// @dev Internal system function - only callable by BorrowerOperations or CDPManager\n /// @dev Governance can also expand the list of approved burners to enable other systems to burn tokens\n /// @param _account The address to burn tokens from\n /// @param _amount The amount of tokens to burn\n function burn(address _account, uint256 _amount) external override {\n _requireCallerIsBOorCdpMOrAuth();\n _burn(_account, _amount);\n }\n\n /// @notice Burn existing tokens from caller\n /// @dev Internal system function - only callable by BorrowerOperations or CDPManager\n /// @dev Governance can also expand the list of approved burners to enable other systems to burn tokens\n /// @param _amount The amount of tokens to burn\n function burn(uint256 _amount) external {\n _requireCallerIsBOorCdpMOrAuth();\n _burn(msg.sender, _amount);\n }\n```\n\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/EBTCToken.sol#L85C3-L107C6\n\n## \\[G-02\\] Use hardcode address instead `address(this)`\n\nInstead of using `address(this)`, it is more gas-efficient to pre-calculate and use the hardcoded `address`. Foundry\u2019s script.sol and solmate\u2019s `LibRlp.sol` contracts can help achieve this.\n\nReferences: https://book.getfoundry.sh/reference/forge-std/compute-create-address\n\nhttps://twitter.com/transmissions11/status/1518507047943245824[](https://github.com/code-423n4/2023-09-maia/blob/main/src/VirtualAccount.sol#L61C5-L63C6)\n\n```\ncollateral.transferFrom(address(receiver), address(this), amountWithFee);\n```\n\nhttps://github.com/code-423n4/20", "vulnerable_code": "function mint(address _account, uint256 _amount) external override {\n _requireCallerIsBOorCdpMOrAuth();\n _mint(_account, _amount);\n }\n\n /// @notice Burn existing tokens\n /// @dev Internal system function - only callable by BorrowerOperations or CDPManager\n /// @dev Governance can also expand the list of approved burners to enable other systems to burn tokens\n /// @param _account The address to burn tokens from\n /// @param _amount The amount of tokens to burn\n function burn(address _account, uint256 _amount) external override {\n _requireCallerIsBOorCdpMOrAuth();\n _burn(_account, _amount);\n }\n\n /// @notice Burn existing tokens from caller\n /// @dev Internal system function - only callable by BorrowerOperations or CDPManager\n /// @dev Governance can also expand the list of approved burners to enable other systems to burn tokens\n /// @param _amount The amount of tokens to burn\n function burn(uint256 _amount) external {\n _requireCallerIsBOorCdpMOrAuth();\n _burn(msg.sender, _amount);\n }", "fixed_code": "collateral.transferFrom(address(receiver), address(this), amountWithFee);", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/jamshed-G.md", "collected_at": "2026-01-02T18:26:51.555688+00:00", "source_hash": "a5bf53ccf968d7b602a3dcc4ed5149f0f2c7d7a62475168bbaaf7119d480c8c4", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 1152, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function mint(address _account, uint256 _amount) external override {\n _requireCallerIsBOorCdpMOrAuth();\n _mint(_account, _amount);\n }\n\n /// @notice Burn existing tokens\n /// @dev Internal system function - only callable by BorrowerOperations or CDPManager\n /// @dev Governance can also expand the list of approved burners to enable other systems to burn tokens\n /// @param _account The address to burn tokens from\n /// @param _amount The amount of tokens to burn\n function burn(address _account, uint256 _amount) external override {\n _requireCallerIsBOorCdpMOrAuth();\n _burn(_account, _amount);\n }\n\n /// @notice Burn existing tokens from caller\n /// @dev Internal system function - only callable by BorrowerOperations or CDPManager\n /// @dev Governance can also expand the list of approved burners to enable other systems to burn tokens\n /// @param _amount The amount of tokens to burn\n function burn(uint256 _amount) external {\n _requireCallerIsBOorCdpMOrAuth();\n _burn(msg.sender, _amount);\n }", "primary_code_language": "unknown", "primary_code_char_count": 1079, "all_code_blocks": "// Code block 1 (unknown):\nfunction mint(address _account, uint256 _amount) external override {\n _requireCallerIsBOorCdpMOrAuth();\n _mint(_account, _amount);\n }\n\n /// @notice Burn existing tokens\n /// @dev Internal system function - only callable by BorrowerOperations or CDPManager\n /// @dev Governance can also expand the list of approved burners to enable other systems to burn tokens\n /// @param _account The address to burn tokens from\n /// @param _amount The amount of tokens to burn\n function burn(address _account, uint256 _amount) external override {\n _requireCallerIsBOorCdpMOrAuth();\n _burn(_account, _amount);\n }\n\n /// @notice Burn existing tokens from caller\n /// @dev Internal system function - only callable by BorrowerOperations or CDPManager\n /// @dev Governance can also expand the list of approved burners to enable other systems to burn tokens\n /// @param _amount The amount of tokens to burn\n function burn(uint256 _amount) external {\n _requireCallerIsBOorCdpMOrAuth();\n _burn(msg.sender, _amount);\n }\n\n// Code block 2 (unknown):\ncollateral.transferFrom(address(receiver), address(this), amountWithFee);", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ERC20hTokenRoot.sol#L57-L4, EBTCToken.sol#L85-L3, VirtualAccount.sol#L61-L5", "github_files_list": "EBTCToken.sol, ERC20hTokenRoot.sol, VirtualAccount.sol", "github_refs_count": 3, "vulnerable_code_actual": "function mint(address _account, uint256 _amount) external override {\n _requireCallerIsBOorCdpMOrAuth();\n _mint(_account, _amount);\n }\n\n /// @notice Burn existing tokens\n /// @dev Internal system function - only callable by BorrowerOperations or CDPManager\n /// @dev Governance can also expand the list of approved burners to enable other systems to burn tokens\n /// @param _account The address to burn tokens from\n /// @param _amount The amount of tokens to burn\n function burn(address _account, uint256 _amount) external override {\n _requireCallerIsBOorCdpMOrAuth();\n _burn(_account, _amount);\n }\n\n /// @notice Burn existing tokens from caller\n /// @dev Internal system function - only callable by BorrowerOperations or CDPManager\n /// @dev Governance can also expand the list of approved burners to enable other systems to burn tokens\n /// @param _amount The amount of tokens to burn\n function burn(uint256 _amount) external {\n _requireCallerIsBOorCdpMOrAuth();\n _burn(msg.sender, _amount);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "collateral.transferFrom(address(receiver), address(this), amountWithFee);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "02-ethos", "title": "bitsurfer Q", "severity_raw": "Critical", "severity": "critical", "description": "# No Maximum (or Minimum) on distribution period value\n\n In `CommunityIssuance.sol`, the `distributionPeriod` is not being having a minimum and maximum value (or range limitation). \n\nRecommendation is to have a range value (min - max) to ensure the distribution period is in valid and meaningful value.\n\n```js\nFile: CommunityIssuance.sol\n120: function updateDistributionPeriod(uint256 _newDistributionPeriod) external onlyOwner {\n121: distributionPeriod = _newDistributionPeriod;\n122: }\n```\n\n# Usage of `ecrecover` allows signature malleability\n\nThe `permit` function of LUSDToken contract use the Solidity ecrecover function directly to verify the given signatures. However, the ecrecover EVM opcode allows malleable (non-unique) signatures and thus is susceptible to replay attacks.\n\nAlthough a replay attack seems not possible here since the nonce is increased each time, ensuring the signatures are not malleable is considered a best practice (and so is checking `recoveredAddress != address(0)`, where `address(0)` means an invalid signature).\n\nIt's recommended to use the `recover` function from [OpenZeppelin\u2019s ECDSA library](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/ECDSA.sol) for signature verification.\n\n```js\nFile: LUSDToken.sol\n262: function permit\n263: (\n264: address owner, \n265: address spender, \n266: uint amount, \n267: uint deadline, \n268: uint8 v, \n269: bytes32 r, \n270: bytes32 s\n271: ) \n272: external \n273: override \n274: {\n275: // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n276: // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n277: // the valid range for s in (301): 0 < s < secp256k1n \u00f7 2 + 1, and for v in (302): v \u2208 {27, 28}. Most\n278: // signatures from curr", "vulnerable_code": "File: CommunityIssuance.sol\n120: function updateDistributionPeriod(uint256 _newDistributionPeriod) external onlyOwner {\n121: distributionPeriod = _newDistributionPeriod;\n122: }", "fixed_code": "File: LUSDToken.sol\n262: function permit\n263: (\n264: address owner, \n265: address spender, \n266: uint amount, \n267: uint deadline, \n268: uint8 v, \n269: bytes32 r, \n270: bytes32 s\n271: ) \n272: external \n273: override \n274: {\n275: // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n276: // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n277: // the valid range for s in (301): 0 < s < secp256k1n \u00f7 2 + 1, and for v in (302): v \u2208 {27, 28}. Most\n278: // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n279: if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n280: revert('LUSD: Invalid s value');\n281: }\n282: require(deadline >= now, 'LUSD: expired deadline');\n283: bytes32 digest = keccak256(abi.encodePacked('\\x19\\x01', \n284: domainSeparator(), keccak256(abi.encode(\n285: _PERMIT_TYPEHASH, owner, spender, amount, \n286: _nonces[owner]++, deadline))));\n287: address recoveredAddress = ecrecover(digest, v, r, s);\n288: require(recoveredAddress == owner, 'LUSD: invalid signature');\n289: _approve(owner, spender, amount);\n290: }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/bitsurfer-Q.md", "collected_at": "2026-01-02T18:16:52.174811+00:00", "source_hash": "a6009e0404ff157404832cec7bf9653f34053328032fd2b7bdf250fe01f6b472", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 192, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: CommunityIssuance.sol\n120: function updateDistributionPeriod(uint256 _newDistributionPeriod) external onlyOwner {\n121: distributionPeriod = _newDistributionPeriod;\n122: }", "primary_code_language": "js", "primary_code_char_count": 192, "all_code_blocks": "// Code block 1 (js):\nFile: CommunityIssuance.sol\n120: function updateDistributionPeriod(uint256 _newDistributionPeriod) external onlyOwner {\n121: distributionPeriod = _newDistributionPeriod;\n122: }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ECDSA.sol", "github_files_list": "ECDSA.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: CommunityIssuance.sol\n120: function updateDistributionPeriod(uint256 _newDistributionPeriod) external onlyOwner {\n121: distributionPeriod = _newDistributionPeriod;\n122: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: LUSDToken.sol\n262: function permit\n263: (\n264: address owner, \n265: address spender, \n266: uint amount, \n267: uint deadline, \n268: uint8 v, \n269: bytes32 r, \n270: bytes32 s\n271: ) \n272: external \n273: override \n274: {\n275: // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n276: // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n277: // the valid range for s in (301): 0 < s < secp256k1n \u00f7 2 + 1, and for v in (302): v \u2208 {27, 28}. Most\n278: // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n279: if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n280: revert('LUSD: Invalid s value');\n281: }\n282: require(deadline >= now, 'LUSD: expired deadline');\n283: bytes32 digest = keccak256(abi.encodePacked('\\x19\\x01', \n284: domainSeparator(), keccak256(abi.encode(\n285: _PERMIT_TYPEHASH, owner, spender, amount, \n286: _nonces[owner]++, deadline))));\n287: address recoveredAddress = ecrecover(digest, v, r, s);\n288: require(recoveredAddress == owner, 'LUSD: invalid signature');\n289: _approve(owner, spender, amount);\n290: }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "07-amphora", "title": "SM3_SS Q", "severity_raw": "Critical", "severity": "critical", "description": "\n\n\n## Low Risk Issues\n\n| NO |Issue | Instances |\n|:----:|:-----:|:---------:|\n| L-01 | External call recipient may consume all transaction gas | 1 |\n| L-02 | Allowed fees/rates should be capped by smart contracts | 3 |\n| L-03 | address shouldn't be hard-coded | 4 |\n| L-04 | State variables not capped at reasonable values | 3 |\n| L-05 | Consider implementing two-step procedure for updating protocol addresses | 6 |\n| L-06 | Burn functions should be protected with a modifier | 12 |\n| L-07 | Using zero as a parameter | 2 |\n| L-08 | Project has vulnarable NPM dependency version | 2 |\n| L-09 | Use safeApprove instead of approve | 3 |\n| L-10 | Unsafe ERC20 operation(s) | 4 |\n| L-11 | Array lengths not checked | 2 |\n| L-12 | Emitting storage values instead of the memory one. | 16 |\n\n \n\n## [L\u201101] External call recipient may consume all transaction gas\n\nThere is no limit specified on the amount of gas used, so the recipient can use up all of the transaction's gas, causing it to revert. Use addr.call{gas: }(\"\") or this library instead.\n\n\n```solidity\nfile: contracts/governance/GovernorCharlie.sol\n\n350 (bool _success, /*bytes memory returnData*/ ) = _target.call{value: _value}(_callData);\n\n```\nhttps://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/governance/GovernorCharlie.sol#L350\n\n\n## [L\u201102] Allowed fees/rates should be capped by smart contracts\n\nFees/rates should be required to be below 100%, preferably at a much lower limit, to ensure users don't have to monitor the blockchain for changes prior to using the protocol\n\nHere's an example to illustrate this concept using a simplified lending protocol:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ncontract LendingProtocol {\n uint256 public constant MAX_FEE_PERCENT = 1; // 1% maximum fee allowed\n\n function lend(uint256 amount) external payable {\n ", "vulnerable_code": "file: contracts/governance/GovernorCharlie.sol\n\n350 (bool _success, /*bytes memory returnData*/ ) = _target.call{value: _value}(_callData);\n", "fixed_code": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ncontract LendingProtocol {\n uint256 public constant MAX_FEE_PERCENT = 1; // 1% maximum fee allowed\n\n function lend(uint256 amount) external payable {\n uint256 fee = (amount * MAX_FEE_PERCENT) / 100;\n require(msg.value >= fee, \"Insufficient fee\");\n \n // Perform lending logic and transfer funds\n // ...\n\n // Refund any excess funds to the sender\n if (msg.value > fee) {\n payable(msg.sender).transfer(msg.value - fee);\n }\n }\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/SM3_SS-Q.md", "collected_at": "2026-01-02T18:23:35.415387+00:00", "source_hash": "a679552d05ea9e8091d5d09519e90d8ab6f099cd0f6c8d8e25e093d2f40479ba", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 143, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "file: contracts/governance/GovernorCharlie.sol\n\n350 (bool _success, /*bytes memory returnData*/ ) = _target.call{value: _value}(_callData);", "primary_code_language": "solidity", "primary_code_char_count": 143, "all_code_blocks": "// Code block 1 (solidity):\nfile: contracts/governance/GovernorCharlie.sol\n\n350 (bool _success, /*bytes memory returnData*/ ) = _target.call{value: _value}(_callData);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "file: contracts/governance/GovernorCharlie.sol\n\n350 (bool _success, /*bytes memory returnData*/ ) = _target.call{value: _value}(_callData);", "github_refs_formatted": "GovernorCharlie.sol#L350", "github_files_list": "GovernorCharlie.sol", "github_refs_count": 1, "vulnerable_code_actual": "file: contracts/governance/GovernorCharlie.sol\n\n350 (bool _success, /*bytes memory returnData*/ ) = _target.call{value: _value}(_callData);\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ncontract LendingProtocol {\n uint256 public constant MAX_FEE_PERCENT = 1; // 1% maximum fee allowed\n\n function lend(uint256 amount) external payable {\n uint256 fee = (amount * MAX_FEE_PERCENT) / 100;\n require(msg.value >= fee, \"Insufficient fee\");\n \n // Perform lending logic and transfer funds\n // ...\n\n // Refund any excess funds to the sender\n if (msg.value > fee) {\n payable(msg.sender).transfer(msg.value - fee);\n }\n }\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "04-caviar", "title": "catellatech G", "severity_raw": "High", "severity": "high", "description": "# Summary\n|ID | Optimization Details| Gas saved |Instances|\n|:----: | :--- | :----: |:----: |\n| [G-01] | DUPLICATED REQUIRE()/IF() CHECKS SHOULD BE REFACTORED TO A MODIFIER OR FUNCTION | 688 | 12 |\n| [G-02] | += COSTS MORE GAS THAN = + FOR STATE VARIABLES (-= TOO)| 1017 | 9 |\n| [G-03] | EMPTY BLOCKS SHOULD BE REMOVED OR EMIT SOMETHING | - | 3 |\n| [G-04] | OPTIMIZING EVENT PARAMETERS: INDEXING WHERE POSSIBLE | 1059 | 8 |\n| [G-05] | USE DOBLE IF INSTEAD && | 4 | 7 |\n| [G-06] | USE SHIFT RIGHT/LEFT INSTEAD OF DIVISION/MULTIPLICATION | 350 | 2 |\n| [G-07] | USE NESTED IF AND, AVOID MULTIPLE CHECK COMBINATIONS | 550 | 11 |\n| [G-08] | USE ASSEMBLY TO CHECK FOR ADDRESS(0) | 340 | 20 |\n| [G-09] | SETTING THE CONSTRUCTOR TO PAYABLE | 39 | 3 |\n| [G-10] | FUNCTIONS GUARANTEED TO REVERT WHEN CALLED BY NORMAL USERS CAN BE MARKED PAYABLE | 231 | 11 |\n| [G-11] | USE HARDCODED ADDRESS INSTEAD OF ADDRESS(THIS) | - | 24 |\n| [G-12] | OPTIMIZE NAMES TO SAVE GAS | 110 | 5 |\n| [G-13] | PUBLIC FUNCTIONS TO EXTERNAL | - | 34 |\n\n| Gas saved | 4384 | Total Instances | 140 |\n|:--:|:--:|:--:|--:|\n\n# Detailed Findings\n## [G-01] DUPLICATED REQUIRE()/IF() CHECKS SHOULD BE REFACTORED TO A MODIFIER OR FUNCTION \n```solidity\nmain/src/EthRouter.sol\n\n// @audit Add a modifier\n\n 101: if (block.timestamp > deadline && deadline != 0) {\n 154: if (block.timestamp > deadline && deadline != 0) {\n 228: if (block.timestamp > deadline && deadline != 0) {\n 256: if (block.timestamp > deadline && deadline != 0) {\n```\n- [EthRouter.sol#L101](https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L101) \n- [EthRouter.sol#L154](https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L154)\n- [EthRouter.sol#L228](https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L228)\n- [EthRouter.sol#L228](https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L256)\n\n```solidity\nmain/src/PrivatePool.sol\n\n// @", "vulnerable_code": "main/src/EthRouter.sol\n\n// @audit Add a modifier\n\n 101: if (block.timestamp > deadline && deadline != 0) {\n 154: if (block.timestamp > deadline && deadline != 0) {\n 228: if (block.timestamp > deadline && deadline != 0) {\n 256: if (block.timestamp > deadline && deadline != 0) {", "fixed_code": "main/src/PrivatePool.sol\n\n// @audit Add a modifier\n\n 225: if (baseToken != address(0) && msg.value > 0)\n 397: if (baseToken != address(0) && msg.value > 0)\n\n 254: if (baseToken != address(0)) {\n 278: if (baseToken != address(0)) {\n 345: if (baseToken != address(0)) {\n 421: if (baseToken != address(0)) {\n 500: if (baseToken != address(0)) {\n 651: if (baseToken != address(0)) ", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/catellatech-G.md", "collected_at": "2026-01-02T18:20:20.689805+00:00", "source_hash": "a6b3838e22c9fa4733d2f763a1841b69b1f3ce8671e6813f681e9560263a3b72", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 281, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "main/src/EthRouter.sol\n\n// @audit Add a modifier\n\n 101: if (block.timestamp > deadline && deadline != 0) {\n 154: if (block.timestamp > deadline && deadline != 0) {\n 228: if (block.timestamp > deadline && deadline != 0) {\n 256: if (block.timestamp > deadline && deadline != 0) {", "primary_code_language": "solidity", "primary_code_char_count": 281, "all_code_blocks": "// Code block 1 (solidity):\nmain/src/EthRouter.sol\n\n// @audit Add a modifier\n\n 101: if (block.timestamp > deadline && deadline != 0) {\n 154: if (block.timestamp > deadline && deadline != 0) {\n 228: if (block.timestamp > deadline && deadline != 0) {\n 256: if (block.timestamp > deadline && deadline != 0) {", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "main/src/EthRouter.sol\n\n// @audit Add a modifier\n\n 101: if (block.timestamp > deadline && deadline != 0) {\n 154: if (block.timestamp > deadline && deadline != 0) {\n 228: if (block.timestamp > deadline && deadline != 0) {\n 256: if (block.timestamp > deadline && deadline != 0) {", "github_refs_formatted": "EthRouter.sol#L101, EthRouter.sol#L154, EthRouter.sol#L228, EthRouter.sol#L256", "github_files_list": "EthRouter.sol", "github_refs_count": 4, "vulnerable_code_actual": "main/src/EthRouter.sol\n\n// @audit Add a modifier\n\n 101: if (block.timestamp > deadline && deadline != 0) {\n 154: if (block.timestamp > deadline && deadline != 0) {\n 228: if (block.timestamp > deadline && deadline != 0) {\n 256: if (block.timestamp > deadline && deadline != 0) {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "main/src/PrivatePool.sol\n\n// @audit Add a modifier\n\n 225: if (baseToken != address(0) && msg.value > 0)\n 397: if (baseToken != address(0) && msg.value > 0)\n\n 254: if (baseToken != address(0)) {\n 278: if (baseToken != address(0)) {\n 345: if (baseToken != address(0)) {\n 421: if (baseToken != address(0)) {\n 500: if (baseToken != address(0)) {\n 651: if (baseToken != address(0)) ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-salty", "title": "Giorgio Q", "severity_raw": "High", "severity": "high", "description": "## The minimum collateral value can be bypassed, no liquidation incentive for \n small borrows\n\n## Summary \n\n`minimumCollateralValueForBorrowing` can be bypassed allowing for small position with small collateral.\n\n## Details\n\nA `minimumCollateralValueForBorrowing` is set at a base of 2500 usd. \nThe reason for this value is to * help prevent saturation of the contract with small amounts of positions and to ensure that liquidating the position yields non-trivial rewards *. However this value can be bypassed if we the user if he withdraws the collateral after \n\n## POC\n\n```sol\n// SPDX-License-Identifier: BUSL 1.1\npragma solidity =0.8.22;\n\nimport \"../../dev/Deployment.sol\";\nimport \"../../price_feed/tests/ForcedPriceFeed.sol\";\n\n\ncontract TestCollateral is Deployment\n\t{\n\t// User wallets for testing\n address public constant alice = address(0x1111);\n address public constant bob = address(0x2222);\n address public constant charlie = address(0x3333);\n\n\tbytes32 public collateralPoolID;\n\n\n\tconstructor()\n\t\t{\n\t\t// If $COVERAGE=yes, create an instance of the contract so that coverage testing can work\n\t\t// Otherwise, what is tested is the actual deployed contract on the blockchain (as specified in Deployment.sol)\n\t\tif ( keccak256(bytes(vm.envString(\"COVERAGE\" ))) == keccak256(bytes(\"yes\" )))\n\t\t\tinitializeContracts();\n\n\t\tgrantAccessAlice();\n\t\tgrantAccessBob();\n\t\tgrantAccessCharlie();\n\t\tgrantAccessDeployer();\n\t\tgrantAccessDefault();\n\n\t\tfinalizeBootstrap();\n\n\t\tvm.prank(address(daoVestingWallet));\n\t\tsalt.transfer(DEPLOYER, 1000000 ether);\n\n\n\t\tcollateralPoolID = PoolUtils._poolID( wbtc, weth );\n\n\t\t// Mint some USDS to the DEPLOYER\n\t\tvm.prank( address(collateralAndLiquidity) );\n\t\tusds.mintTo( DEPLOYER, 2000000 ether );\n\t\t}\n\n\n\tfunction _userHasCollateral( address user ) internal view returns (bool)\n\t\t{\n\t\treturn collateralAndLiquidity.userShareForPool( user, collateralPoolID ) > 0;\n\t\t}\n\n\n\tfunction _readyUser( address user ) internal\n\t\t{\n\t\tuint256 addedWBTC = 1000 * 10 ** 8 / 4;\n\t\tu", "vulnerable_code": "// SPDX-License-Identifier: BUSL 1.1\npragma solidity =0.8.22;\n\nimport \"../../dev/Deployment.sol\";\nimport \"../../price_feed/tests/ForcedPriceFeed.sol\";\n\n\ncontract TestCollateral is Deployment\n\t{\n\t// User wallets for testing\n address public constant alice = address(0x1111);\n address public constant bob = address(0x2222);\n address public constant charlie = address(0x3333);\n\n\tbytes32 public collateralPoolID;\n\n\n\tconstructor()\n\t\t{\n\t\t// If $COVERAGE=yes, create an instance of the contract so that coverage testing can work\n\t\t// Otherwise, what is tested is the actual deployed contract on the blockchain (as specified in Deployment.sol)\n\t\tif ( keccak256(bytes(vm.envString(\"COVERAGE\" ))) == keccak256(bytes(\"yes\" )))\n\t\t\tinitializeContracts();\n\n\t\tgrantAccessAlice();\n\t\tgrantAccessBob();\n\t\tgrantAccessCharlie();\n\t\tgrantAccessDeployer();\n\t\tgrantAccessDefault();\n\n\t\tfinalizeBootstrap();\n\n\t\tvm.prank(address(daoVestingWallet));\n\t\tsalt.transfer(DEPLOYER, 1000000 ether);\n\n\n\t\tcollateralPoolID = PoolUtils._poolID( wbtc, weth );\n\n\t\t// Mint some USDS to the DEPLOYER\n\t\tvm.prank( address(collateralAndLiquidity) );\n\t\tusds.mintTo( DEPLOYER, 2000000 ether );\n\t\t}\n\n\n\tfunction _userHasCollateral( address user ) internal view returns (bool)\n\t\t{\n\t\treturn collateralAndLiquidity.userShareForPool( user, collateralPoolID ) > 0;\n\t\t}\n\n\n\tfunction _readyUser( address user ) internal\n\t\t{\n\t\tuint256 addedWBTC = 1000 * 10 ** 8 / 4;\n\t\tuint256 addedWETH = 1000000 ether / 4;\n\n // Deployer holds all the test tokens\n\t\tvm.startPrank( DEPLOYER );\n\t\twbtc.transfer( user, addedWBTC );\n\t\tweth.transfer( user, addedWETH );\n\t\tvm.stopPrank();\n\n//\t\tconsole.log( \"WBTC0: \", wbtc.balanceOf( user ) );\n\n\t\tvm.startPrank( user );\n\t\twbtc.approve( address(collateralAndLiquidity), type(uint256).max );\n weth.approve( address(collateralAndLiquidity), type(uint256).max );\n\t\tusds.approve( address(collateralAndLiquidity), type(uint256).max );\n\t\tsalt.approve( address(collateralAndLiquidity), type(uint256).max );\n\t\tusds.app", "fixed_code": "\t\tuint256 rewardedWBTC = (reclaimedWBTC * rewardPercent) / 100; \n\t\tuint256 rewardedWETH = (reclaimedWETH * rewardPercent) / 100; \n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/Giorgio-Q.md", "collected_at": "2026-01-02T19:01:16.532206+00:00", "source_hash": "a6ce60950658bdec7ec3e88da8449526f8b9c56562e69eba0c136683ad22005c", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "// SPDX-License-Identifier: BUSL 1.1\npragma solidity =0.8.22;\n\nimport \"../../dev/Deployment.sol\";\nimport \"../../price_feed/tests/ForcedPriceFeed.sol\";\n\n\ncontract TestCollateral is Deployment\n\t{\n\t// User wallets for testing\n address public constant alice = address(0x1111);\n address public constant bob = address(0x2222);\n address public constant charlie = address(0x3333);\n\n\tbytes32 public collateralPoolID;\n\n\n\tconstructor()\n\t\t{\n\t\t// If $COVERAGE=yes, create an instance of the contract so that coverage testing can work\n\t\t// Otherwise, what is tested is the actual deployed contract on the blockchain (as specified in Deployment.sol)\n\t\tif ( keccak256(bytes(vm.envString(\"COVERAGE\" ))) == keccak256(bytes(\"yes\" )))\n\t\t\tinitializeContracts();\n\n\t\tgrantAccessAlice();\n\t\tgrantAccessBob();\n\t\tgrantAccessCharlie();\n\t\tgrantAccessDeployer();\n\t\tgrantAccessDefault();\n\n\t\tfinalizeBootstrap();\n\n\t\tvm.prank(address(daoVestingWallet));\n\t\tsalt.transfer(DEPLOYER, 1000000 ether);\n\n\n\t\tcollateralPoolID = PoolUtils._poolID( wbtc, weth );\n\n\t\t// Mint some USDS to the DEPLOYER\n\t\tvm.prank( address(collateralAndLiquidity) );\n\t\tusds.mintTo( DEPLOYER, 2000000 ether );\n\t\t}\n\n\n\tfunction _userHasCollateral( address user ) internal view returns (bool)\n\t\t{\n\t\treturn collateralAndLiquidity.userShareForPool( user, collateralPoolID ) > 0;\n\t\t}\n\n\n\tfunction _readyUser( address user ) internal\n\t\t{\n\t\tuint256 addedWBTC = 1000 * 10 ** 8 / 4;\n\t\tuint256 addedWETH = 1000000 ether / 4;\n\n // Deployer holds all the test tokens\n\t\tvm.startPrank( DEPLOYER );\n\t\twbtc.transfer( user, addedWBTC );\n\t\tweth.transfer( user, addedWETH );\n\t\tvm.stopPrank();\n\n//\t\tconsole.log( \"WBTC0: \", wbtc.balanceOf( user ) );\n\n\t\tvm.startPrank( user );\n\t\twbtc.approve( address(collateralAndLiquidity), type(uint256).max );\n weth.approve( address(collateralAndLiquidity), type(uint256).max );\n\t\tusds.approve( address(collateralAndLiquidity), type(uint256).max );\n\t\tsalt.approve( address(collateralAndLiquidity), type(uint256).max );\n\t\tusds.app", "has_vulnerable_code_snippet": true, "fixed_code_actual": "\t\tuint256 rewardedWBTC = (reclaimedWBTC * rewardPercent) / 100; \n\t\tuint256 rewardedWETH = (reclaimedWETH * rewardPercent) / 100; \n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "04-caviar", "title": "coryli Q", "severity_raw": "Low", "severity": "low", "description": "## Pragma version `^0.8.19` is too recent to be trusted.\n\nUnexpected bugs may come up over time. It's better to choose a lower more battle-tested version. `0.8.10` is recommended.\n### Instances\n`PrivatePool.sol#L2` `Factory.sol#L2` `EthRouter.sol#L2` `IStolenNftOracle.sol#L2` `PrivatePoolMetadata.sol#L2`\n\n## Use `safeTransfer/safeTransferFrom` instead of `transfer/transferFrom` consistently\n`transfer` function may cause silent failures and affect token accounting in the contract.\n### Instances\n`Factory.sol#L152` `Factory.sol#L115` `Factory.sol#L651` `PrivatePool.sol#L365` `PrivatePool.sol#L527`\n\n## Missing `@return` and `@param` in NatSpec comments\nMissing description of `_payRoyalties` parameter\n`PrivatePool.sol#L156`\nMissing description of `protocolFeeAmount` return var\n`PrivatePool.sol#L210` `PrivatePool.sol#L300` `PrivatePool.sol#L697` `PrivatePool.sol#L712`\nMissing description of return variables. \n`PrivatePool.sol#L384`\n\n## Any user can withdraw eth stuck in `EthRouter` contract\nA user can call `buy()` with an empty `Buy[]` array to drain all eth stuck in EthRouter contract.\n### Instances\n`EthRouter.sol#L142`\n\n## Tokens accidentally sent to the pool contract cannot be recovered\n\n### Recommendation\nAdd recovery code: \n``` /**\n * @notice Sends ERC20 tokens trapped in contract to external address\n * @dev onlyowner is allowed to make this function call\n * @param account is the receiving address\n * @param token is the token being sent\n * @param amount is the quantity being sent\n * @return boolean value indicating whether the operation succeeded.\n *\n */\n function rescueERC20(address account, address token, uint256 amount) public onlyOwner returns (bool) {\n IERC20(token).transfer(account, amount);\n return true;\n }\n} \n```\nThis does arguably give a lot of power to the owner though since they can basically drain the pool at any moment. Proceed with caution...\n## Pool events missing parameters.\n\nContracts or web pages listening to events cannot react to us", "vulnerable_code": "This does arguably give a lot of power to the owner though since they can basically drain the pool at any moment. Proceed with caution...\n## Pool events missing parameters.\n\nContracts or web pages listening to events cannot react to users' activity since emit does not include the original sender of the transaction.\n\n### Instances\n`PrivatePool.sol#L59-L63`\n\n### Recommendation", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/coryli-Q.md", "collected_at": "2026-01-02T18:20:24.696673+00:00", "source_hash": "a715afe3fd179b81d7c8981a66f600fe4b4fdf501a9549f3bc18edd095587c85", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "This does arguably give a lot of power to the owner though since they can basically drain the pool at any moment. Proceed with caution...\n## Pool events missing parameters.\n\nContracts or web pages listening to events cannot react to users' activity since emit does not include the original sender of the transaction.\n\n### Instances\n`PrivatePool.sol#L59-L63`\n\n### Recommendation", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4} {"source": "c4", "protocol": "01-biconomy", "title": "__141345__ Q", "severity_raw": "Gas", "severity": "gas", "description": "#### Unused/empty `receive()/fallback()` function\n\nIf the intention is for the Ether to be used, the function should call another function, otherwise it should revert (e.g. require(msg.sender == address(weth))). Having no access control on the function means that someone may send Ether to the contract, and have no way to get anything back out, which is a loss of funds\n\n```solidity\nFile: scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n550: receive() external payable {}\n551: }\n\nFile: scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol\n540: receive() external payable {}\n541: }\n\nFile: scw-contracts/contracts/smart-contract-wallet/aa-4337/samples/SimpleAccount.sol\n41: receive() external payable {}\n```\n\n\n#### return value not checked\n\nWhen there\u2019s a failure in the `_actualWallet.call(_data)`, the function will still proceed, potentially fund could be lost.\n\n```solidity\nFile: scw-contracts/contracts/smart-contract-wallet/utils/GasEstimatorSmartAccount.sol\n21: (success, result) = _actualWallet.call(_data);\n22: gas = initialGas - gasleft();\n```\nRecommendation: Add return value checks.", "vulnerable_code": "File: scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n550: receive() external payable {}\n551: }\n\nFile: scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol\n540: receive() external payable {}\n541: }\n\nFile: scw-contracts/contracts/smart-contract-wallet/aa-4337/samples/SimpleAccount.sol\n41: receive() external payable {}", "fixed_code": "File: scw-contracts/contracts/smart-contract-wallet/utils/GasEstimatorSmartAccount.sol\n21: (success, result) = _actualWallet.call(_data);\n22: gas = initialGas - gasleft();", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/__141345__-Q.md", "collected_at": "2026-01-02T18:13:28.357899+00:00", "source_hash": "a760b36f52fb50fe35df9dbcc253302a1a08d5c03890d3985aa2bf4bd67c2676", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 540, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n550: receive() external payable {}\n551: }\n\nFile: scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol\n540: receive() external payable {}\n541: }\n\nFile: scw-contracts/contracts/smart-contract-wallet/aa-4337/samples/SimpleAccount.sol\n41: receive() external payable {}", "primary_code_language": "solidity", "primary_code_char_count": 361, "all_code_blocks": "// Code block 1 (solidity):\nFile: scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n550: receive() external payable {}\n551: }\n\nFile: scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol\n540: receive() external payable {}\n541: }\n\nFile: scw-contracts/contracts/smart-contract-wallet/aa-4337/samples/SimpleAccount.sol\n41: receive() external payable {}\n\n// Code block 2 (solidity):\nFile: scw-contracts/contracts/smart-contract-wallet/utils/GasEstimatorSmartAccount.sol\n21: (success, result) = _actualWallet.call(_data);\n22: gas = initialGas - gasleft();", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n550: receive() external payable {}\n551: }\n\nFile: scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol\n540: receive() external payable {}\n541: }\n\nFile: scw-contracts/contracts/smart-contract-wallet/aa-4337/samples/SimpleAccount.sol\n41: receive() external payable {}\n\nFile: scw-contracts/contracts/smart-contract-wallet/utils/GasEstimatorSmartAccount.sol\n21: (success, result) = _actualWallet.call(_data);\n22: gas = initialGas - gasleft();", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n550: receive() external payable {}\n551: }\n\nFile: scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol\n540: receive() external payable {}\n541: }\n\nFile: scw-contracts/contracts/smart-contract-wallet/aa-4337/samples/SimpleAccount.sol\n41: receive() external payable {}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: scw-contracts/contracts/smart-contract-wallet/utils/GasEstimatorSmartAccount.sol\n21: (success, result) = _actualWallet.call(_data);\n22: gas = initialGas - gasleft();", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6.29} {"source": "c4", "protocol": "02-ethos", "title": "NoamYakov G", "severity_raw": "Low", "severity": "low", "description": "\n## Summary\n\n### Gas Optimizations\n| |Issue|Instances|Total Gas Saved|\n|-|:-|:-:|:-:|\n| [G‑01] | Multiple `address`/ID mappings can be combined into a single `mapping` of an `address`/ID to a `struct`, where appropriate | 1 | 87,330 |\n| [G‑02] | State variables can be packed into fewer storage slots | 2 | 21,200 |\n| [G‑03] | Avoid contract existence checks by using low level calls | 101 | 18,500 |\n| [G‑04] | Functions guaranteed to revert when called by normal users can be marked `payable` | 56 | 1,260 |\n\nTotal: 160 instances over 4 issues with **128,290 gas** saved.\n\nGas totals are only calculated for `public`/`external` functions, use lower bounds of ranges and count two iterations of each `for`-loop. All values above are runtime, not deployment, values; deployment values are listed in the individual issue descriptions.\n\n## Gas Optimizations\n\n### [G‑01] Multiple `address`/ID mappings can be combined into a single `mapping` of an `address`/ID to a `struct`, where appropriate\nSaves a storage slot for the mapping. Depending on the circumstances and sizes of types, can avoid a Gsset (**20000 gas**) per mapping combined. Reads and subsequent writes can also be cheaper when a function requires both values and they both fit in the same storage slot. Finally, if both fields are accessed in the same function, can save **~42 gas per access** due to [not having to recalculate the key's keccak256 hash](https://gist.github.com/IllIllI000/ec23a57daa30a8f8ca8b9681c8ccefb0) (Gkeccak256 - 30 gas) and that calculation's associated stack operations.\n\n*There is 1 instance of this issue:*\n\n[Ethos-Core\\contracts\\LUSDToken.sol](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/LUSDToken.sol#L62-L64)\n```solidity\n/// @audit can be a mapping of an address to a struct of 3 bools\n62 mapping (address => bool) public troveManagers;\n63 mapping (address => bool) public stabilityPools;\n6", "vulnerable_code": "/// @audit can be a mapping of an address to a struct of 3 bools\n62 mapping (address => bool) public troveManagers;\n63 mapping (address => bool) public stabilityPools;\n64 mapping (address => bool) public borrowerOperations;", "fixed_code": "/// @audit can be packed into 1 storage slot\n37 bool public mintingPaused = false;\n69 address public borrowerOperationsAddress;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/NoamYakov-G.md", "collected_at": "2026-01-02T18:16:23.897120+00:00", "source_hash": "a773b41388956b615d3f1e9ee6546606a8ebf0dfc1dd6d5408c3314d9a09abad", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LUSDToken.sol#L62-L64", "github_files_list": "LUSDToken.sol", "github_refs_count": 1, "vulnerable_code_actual": "/// @audit can be a mapping of an address to a struct of 3 bools\n62 mapping (address => bool) public troveManagers;\n63 mapping (address => bool) public stabilityPools;\n64 mapping (address => bool) public borrowerOperations;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "/// @audit can be packed into 1 storage slot\n37 bool public mintingPaused = false;\n69 address public borrowerOperationsAddress;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "02-ai-arena", "title": "McToady G", "severity_raw": "Medium", "severity": "medium", "description": "### [G-01] Structs in `FightersOps` can be better packed to save number of SSTOREs used when setting\nThe structs `FighterPhysicalAttributes` and `Fighter` can both be reorded and/or use smaller uint types to save users gas when these structs are saved in storage.\n\n## FighterPhysicalAttributes\nCurrently when this struct is created for a fighter in `FighterFarm::_createNewFighter` it requires storing data a separate storage slot for each of the 6 fields of the array. However when the values of this struct struct are set in `AiArenaHelper::createPhysicalAttributes` the maximum a value will be set to is 99. Therefore a uint8 would be enough to store each fo these values meaning only one storage slot would be required.\n\n## Fighter\nThe fighter struct can similarly be optimised for large gas savings.\nAs this struct includes the above `FighterPhysicalAttributes` struct, those changes will be part of the changes here too.\nAs for the other fields of the array:\n`weight` has a range between 65-95, so this can safely be set as a uint8.\n`element` is initialised to 3 for generation 1 so it seems probably that this number won't inflate past 255 in future rounds, so can also be set as a uint8. `id` is the token id of the fighter, it seems reasonable that this number will safely never supass the maximum uint16 (65,535).\n\nThe fields of the struct can then be reordered to ensure the minimum storage slots are used.\n```solidity\n struct Fighter {\n uint8 weight;\n uint8 element;\n uint16 id;\n uint8 generation;\n uint8 iconsType;\n bool dendroidBool;\n FighterPhysicalAttributes physicalAttributes;\n string modelHash;\n string modelType;\n }\n```\n\n**Recommendation**\n\nThis results in the following gas savings when minting fighters:\n```diff\n | Function Name | min | avg | median | max | # calls |\n- | claimFighters | 16108 | 350552 | 517775 | 517775 | 3 |\n+ | claimFighters | 16096 | 274958 | 4", "vulnerable_code": " struct Fighter {\n uint8 weight;\n uint8 element;\n uint16 id;\n uint8 generation;\n uint8 iconsType;\n bool dendroidBool;\n FighterPhysicalAttributes physicalAttributes;\n string modelHash;\n string modelType;\n }", "fixed_code": "## [G-02] `RankedBattle::claimFighters` could use a struct for `nftsClaimed` to reduce the number of SSTORE's required\n\nCurrently it requires two SSTOREs to update the number of fighters & dendroids minted by a user.\nHowever it would be possible to reduce this to one by creating a `FightersMinted` struct.\n\nSee the following snippet from the original function:", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/McToady-G.md", "collected_at": "2026-01-02T19:02:34.502691+00:00", "source_hash": "a8712fc15816751804df7128a9100e4863bf36434575c8442a4f295817625afd", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 270, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "struct Fighter {\n uint8 weight;\n uint8 element;\n uint16 id;\n uint8 generation;\n uint8 iconsType;\n bool dendroidBool;\n FighterPhysicalAttributes physicalAttributes;\n string modelHash;\n string modelType;\n }", "primary_code_language": "solidity", "primary_code_char_count": 270, "all_code_blocks": "// Code block 1 (solidity):\nstruct Fighter {\n uint8 weight;\n uint8 element;\n uint16 id;\n uint8 generation;\n uint8 iconsType;\n bool dendroidBool;\n FighterPhysicalAttributes physicalAttributes;\n string modelHash;\n string modelType;\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "struct Fighter {\n uint8 weight;\n uint8 element;\n uint16 id;\n uint8 generation;\n uint8 iconsType;\n bool dendroidBool;\n FighterPhysicalAttributes physicalAttributes;\n string modelHash;\n string modelType;\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " struct Fighter {\n uint8 weight;\n uint8 element;\n uint16 id;\n uint8 generation;\n uint8 iconsType;\n bool dendroidBool;\n FighterPhysicalAttributes physicalAttributes;\n string modelHash;\n string modelType;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## [G-02] `RankedBattle::claimFighters` could use a struct for `nftsClaimed` to reduce the number of SSTORE's required\n\nCurrently it requires two SSTOREs to update the number of fighters & dendroids minted by a user.\nHowever it would be possible to reduce this to one by creating a `FightersMinted` struct.\n\nSee the following snippet from the original function:", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "10-badger", "title": "hihen G", "severity_raw": "Critical", "severity": "critical", "description": "# Gas Report\n\n## Summary\n\nTotal **722 instances** over **46 issues**with **358776** gas saved:\n\n|ID|Issue|Instances|Gas|\n|:--:|:---|:--:|:--:|\n| [[G‑01]](#g01-use-storage-instead-of-memory-for-structsarrays) | Use `storage` instead of `memory` for structs/arrays | 1 | 4200 |\n| [[G‑02]](#g02-constructors-can-be-marked-as-payable-to-save-deployment-gas) | Constructors can be marked as payable to save deployment gas | 19 | 399 |\n| [[G‑03]](#g03-state-variables-only-set-in-their-definitions-should-be-declared-constant) | State variables only set in their definitions should be declared `constant` | 12 | 25164 |\n| [[G‑04]](#g04-splitting-require-statements-that-use-) | Splitting `require()` statements that use `&&` | 8 | 24 |\n| [[G‑05]](#g05-unnecessary-event-parameters-should-be-removed) | Unnecessary event parameters should be removed | 3 | 1074 |\n| [[G‑06]](#g06-unnecessary-ternary-operator) | Unnecessary ternary operator | 3 | 54 |\n| [[G‑07]](#g07-use-unchecked-block-for-safe-subtractions) | Use `unchecked` block for safe subtractions | 19 | 1615 |\n| [[G‑08]](#g08-comparing-booleans-to-true-or-false) | Comparing booleans to `true` or `false` | 1 | 9 |\n| [[G‑09]](#g09-using-constants-directly-is-more-gas-efficient) | Using `constant`s directly is more gas efficient | 1 | - |\n| [[G‑10]](#g10-do-not-cache-state-variables-that-are-used-only-once) | Do not cache state variables that are used only once | 4 | 12 |\n| [[G‑11]](#g11-do-not-calculate-constants) | Do not calculate constants | 1 | - |\n| [[G‑12]](#g12-use-of-emit-inside-a-loop) | Use of `emit` inside a loop | 1 | 375 |\n| [[G‑13]](#g13-initializing-mutable-state-variables-with-default-value-wastes-gas) | Initializing mutable state variables with default value wastes gas | 1 | 2900 |\n| [[G‑14]](#g14-use-local-variables-for-emitting) | Use local variables for emitting | 6 | 600 |\n| [[G‑15]](#g15-contract-storage-ca", "vulnerable_code": "522: Node memory _node = data.nodes[_id];", "fixed_code": "46: constructor(\n47: address _borrowerOperationsAddress,\n48: address _cdpManagerAddress,\n49: address _collTokenAddress,\n50: address _collSurplusAddress,\n51: address _feeRecipientAddress\n52: ) {", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/hihen-G.md", "collected_at": "2026-01-02T18:26:49.642577+00:00", "source_hash": "a8c8a7c128932a71b966e67e6a2142d075ab8c9d38ea8203506d182b0bd2312f", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "522: Node memory _node = data.nodes[_id];", "has_vulnerable_code_snippet": true, "fixed_code_actual": "46: constructor(\n47: address _borrowerOperationsAddress,\n48: address _cdpManagerAddress,\n49: address _collTokenAddress,\n50: address _collSurplusAddress,\n51: address _feeRecipientAddress\n52: ) {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-asymmetry", "title": "Rolezn G", "severity_raw": "Medium", "severity": "medium", "description": "## Summary\n\n### Gas Optimizations\n| |Issue|Contexts|Estimated Gas Saved|\n|-|:-|:-|:-:|\n| [GAS‑1](#GAS‑1) | Setting the `constructor` to `payable` | 4 | 52 |\n| [GAS‑2](#GAS‑2) | Duplicated `require()`/`revert()` Checks Should Be Refactored To A Modifier Or Function | 2 | 56 |\n| [GAS‑3](#GAS‑3) | Empty Blocks Should Be Removed Or Emit Something | 4 | - |\n| [GAS‑4](#GAS‑4) | Using `delete` statement can save gas | 3 | - |\n| [GAS‑5](#GAS‑5) | Functions guaranteed to revert when called by normal users can be marked `payable` | 17 | 357 |\n| [GAS‑6](#GAS‑6) | Use hardcoded address instead `address(this)` | 22 | - |\n| [GAS‑7](#GAS‑7) | Optimize names to save gas | 3 | 66 |\n| [GAS‑8](#GAS‑8) | ` += ` Costs More Gas Than ` = + ` For State Variables | 4 | - |\n| [GAS‑9](#GAS‑9) | Public Functions To External | 9 | - |\n| [GAS‑10](#GAS‑10) | Save gas with the use of specific import statements | 22 | - |\n| [GAS‑11](#GAS‑11) | Using `unchecked` blocks to save gas | 6 | 120 |\n| [GAS‑12](#GAS‑12) | Use functions instead of modifiers | 1 | 100 |\n| [GAS‑13](#GAS‑13) | Use solidity version 0.8.19 to gain some gas boost | 4 | 352 |\n| [GAS‑14](#GAS‑14) | Save loop calls | 3 | - |\n\nTotal: 104 contexts over 14 issues\n\n## Gas Optimizations\n\n\n### [GAS‑1] Setting the `constructor` to `payable`\n\nSaves ~13 gas per instance\n\n#### Proof Of Concept\n\n```solidity\n38: constructor()\n```\n\nhttps://github.com/code-423n4/2023-03-asymmetry/tree/main/contracts/SafEth/SafEth.sol#L38\n\n```solidity\n33: constructor()\n```\n\nhttps://github.com/code-423n4/2023-03-asymmetry/tree/main/contracts/SafEth/derivatives/Reth.sol#L33\n\n```solidity\n27: constructor()\n```\n\nhttps://github.com/code-423n4/2023-03-asymmetry/tree/main/contracts/Sa", "vulnerable_code": "38: constructor()", "fixed_code": "33: constructor()", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Rolezn-G.md", "collected_at": "2026-01-02T18:18:29.667629+00:00", "source_hash": "a8cea345da14ddd296aa66f679d871d03575d7fc7f4bbf3cd8a996486a2f78e1", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 51, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "38: constructor()", "primary_code_language": "solidity", "primary_code_char_count": 17, "all_code_blocks": "// Code block 1 (solidity):\n38: constructor()\n\n// Code block 2 (solidity):\n33: constructor()\n\n// Code block 3 (solidity):\n27: constructor()", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "38: constructor()\n\n33: constructor()\n\n27: constructor()", "github_refs_formatted": "SafEth.sol#L38, Reth.sol#L33", "github_files_list": "Reth.sol, SafEth.sol", "github_refs_count": 2, "vulnerable_code_actual": "38: constructor()", "has_vulnerable_code_snippet": true, "fixed_code_actual": "33: constructor()", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "01-biconomy", "title": "peanuts Q", "severity_raw": "Low", "severity": "low", "description": "### [L-01] Initializers can be frontrunnable\n\nIf the initializer is not executed in the same transaction as the constructor, a malicious user can front-run the initialize() call, forcing the contract to be redeployed. \n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L166-L176\n\n### [L-02] Contract should adhere to two-step ownership process\n\nSetting the owner within one function can be dangerous if the address of the owner in the parameter is not set properly. Consider using a two-step process whereby the owner has to acknowledge the change before changing the ownership.\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L109-L125\n\n### [L-03] Unused/Empty receive()/fallback() function\n\nIf the intention is for the Ether to be used, the function should call another function, otherwise it should revert (e.g. require(msg.sender == address(weth)). Having no access control on the function means that someone may send Ether to the contract, and have no way to get anything back out, which is a loss of funds\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L550\n\n### [L-04] OpenZeppelin's ECDSA is imported but not utilized\n\nUse OpenZeppelin\u2019s ECDSA contract rather than calling ecrecover() directly\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L347 \n\n### [L-05] Import exact functions instead of the whole contract itself \n\nExample: \n```\nimport {ReentrancyGuardUpgradeable} from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\n```\ninstead of \n```\nimport \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.s", "vulnerable_code": "import {ReentrancyGuardUpgradeable} from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";", "fixed_code": "import \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/peanuts-Q.md", "collected_at": "2026-01-02T18:14:01.596017+00:00", "source_hash": "a91231035b43f2d388f32e5d1cac386b5c9c8768ac28c398fed2441f6c5209e3", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 119, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "import {ReentrancyGuardUpgradeable} from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";", "primary_code_language": "unknown", "primary_code_char_count": 119, "all_code_blocks": "// Code block 1 (unknown):\nimport {ReentrancyGuardUpgradeable} from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SmartAccount.sol#L166-L176, SmartAccount.sol#L109-L125, SmartAccount.sol#L550, SmartAccount.sol#L347", "github_files_list": "SmartAccount.sol", "github_refs_count": 4, "vulnerable_code_actual": "import {ReentrancyGuardUpgradeable} from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";", "has_vulnerable_code_snippet": true, "fixed_code_actual": "import \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-asymmetry", "title": "c3phas G", "severity_raw": "High", "severity": "high", "description": "### Table of Contents\n- [FINDINGS](#findings)\n- [Cache storage values in memory to minimize SLOADs](#cache-storage-values-in-memory-to-minimize-sloads)\n - [SafEth.sol.stake(): derivativeCount being a storage variable should not be looped into as it's too costly,consider caching it](#safethsolstake-derivativecount-being-a-storage-variable-should-not-be-looped-into-as-its-too-costlyconsider-caching-it)\n - [SafEth.sol.unstake(): derivativeCount should be cached especially because it's being used in a for loop](#safethsolunstake-derivativecount-should-be-cached-especially-because-its-being-used-in-a-for-loop)\n - [SafEth.sol.rebalanceToWeights(): derivativeCount should be cached](#safethsolrebalancetoweights-derivativecount-should-be-cached)\n - [SafEth.sol.addDerivative(): derivativeCount should be cached](#safethsoladdderivative-derivativecount-should-be-cached)\n- [Emitting storage values instead of the memory one.](#emitting-storage-values-instead-of-the-memory-one)\n- [Usage of uints/ints smaller than 32 bytes (256 bits) incurs overhead](#usage-of-uintsints-smaller-than-32-bytes-256-bits-incurs-overhead)\n- [Using unchecked blocks to save gas](#using-unchecked-blocks-to-save-gas)\n- [`keccak256()` should only need to be called on a specific string literal once](#keccak256-should-only-need-to-be-called-on-a-specific-string-literal-once)\n- [Functions guaranteed to revert when called by normal users can be marked `payable`](#functions-guaranteed-to-revert-when-called-by-normal-users-can-be-marked-payable)\n\n## FINDINGS\nNB: Some functions have been truncated where necessary to just show affected parts of the code\nThrough out the report some places might be denoted with audit tags to show the actual place affected.\n\n## Cache storage values in memory to minimize SLOADs\nThe code can be optimized by minimizing the number of SLOADs.\n\nSLOADs are expensive (100 gas after the 1st one) compared to MLOADs/MSTOREs (3 gas each). Storage values read multiple times should instead be ca", "vulnerable_code": "File: /contracts/SafEth/SafEth.sol\n63: function stake() external payable {\n\n70: // Getting underlying value in terms of ETH for each derivative\n71: for (uint i = 0; i < derivativeCount; i++)\n\n84: for (uint i = 0; i < derivativeCount; i++) {", "fixed_code": "https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L108-L129\n### SafEth.sol.unstake(): derivativeCount should be cached especially because it's being used in a for loop", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/c3phas-G.md", "collected_at": "2026-01-02T18:18:53.070934+00:00", "source_hash": "a9211afc7db9d148ef6448044ccda3a4d74fce7cb732409dd09bae928a2e38f1", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol#L108-L129", "github_files_list": "SafEth.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: /contracts/SafEth/SafEth.sol\n63: function stake() external payable {\n\n70: // Getting underlying value in terms of ETH for each derivative\n71: for (uint i = 0; i < derivativeCount; i++)\n\n84: for (uint i = 0; i < derivativeCount; i++) {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L108-L129\n### SafEth.sol.unstake(): derivativeCount should be cached especially because it's being used in a for loop", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "06-lybra", "title": "koxuan Q", "severity_raw": "Critical", "severity": "critical", "description": "# Report\n\n\n## Non Critical Issues\n\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [NC-1](#NC-1) | Expressions for constant values such as a call to keccak256(), should use immutable rather than constant | 7 |\n| [NC-2](#NC-2) | Constants in comparisons should appear on the left side | 31 |\n| [NC-3](#NC-3) | delete keyword can be used instead of setting to 0 | 9 |\n| [NC-4](#NC-4) | Lines are too long | 74 |\n| [NC-5](#NC-5) | `require()`\u00a0/\u00a0`revert()`\u00a0statements should have descriptive reason strings | 3 |\n| [NC-6](#NC-6) | Return values of `approve()` not checked | 14 |\n| [NC-7](#NC-7) | Event is missing `indexed` fields | 59 |\n| [NC-8](#NC-8) | Constants should be defined rather than using magic numbers | 17 |\n| [NC-9](#NC-9) | Functions not used internally could be marked external | 47 |\n| [NC-10](#NC-10) | Variable names don't follow the Solidity style guide | 9 |\n| [NC-11](#NC-11) | Variables need not be initialized to zero | 2 |\n### [NC-1] Expressions for constant values such as a call to keccak256(), should use immutable rather than constant\nconstants should be used for literal values written into the code, and immutable variables should be used for expressions, or values calculated in, or passed into the constructor.\n\n*Instances (7)*:\n```solidity\nFile: lybra/configuration/LybraConfigurator.sol\n\n76: bytes32 public constant DAO = keccak256(\"DAO\");\n\n77: bytes32 public constant TIMELOCK = keccak256(\"TIMELOCK\");\n\n78: bytes32 public constant ADMIN = keccak256(\"ADMIN\");\n\n```\n\n```solidity\nFile: lybra/governance/GovernanceTimelock.sol\n\n10: bytes32 public constant DAO = keccak256(\"DAO\");\n\n11: bytes32 public constant TIMELOCK = keccak256(\"TIMELOCK\");\n\n12: bytes32 public constant ADMIN = keccak256(\"ADMIN\");\n\n13: bytes32 public constant GOV = keccak256(\"GOV\");\n\n```\n\n### [NC-2] Constants in comparisons should appear on the left side\nConstants should appear on the left side of comparisons, to avoid accidental assignment\n\n*I", "vulnerable_code": "File: lybra/configuration/LybraConfigurator.sol\n\n76: bytes32 public constant DAO = keccak256(\"DAO\");\n\n77: bytes32 public constant TIMELOCK = keccak256(\"TIMELOCK\");\n\n78: bytes32 public constant ADMIN = keccak256(\"ADMIN\");\n", "fixed_code": "File: lybra/governance/GovernanceTimelock.sol\n\n10: bytes32 public constant DAO = keccak256(\"DAO\");\n\n11: bytes32 public constant TIMELOCK = keccak256(\"TIMELOCK\");\n\n12: bytes32 public constant ADMIN = keccak256(\"ADMIN\");\n\n13: bytes32 public constant GOV = keccak256(\"GOV\");\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/koxuan-Q.md", "collected_at": "2026-01-02T18:23:05.115719+00:00", "source_hash": "a9384a9c46944559f1e1412127db47593d9b824a33547f98f75885cad8683ed2", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 519, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: lybra/configuration/LybraConfigurator.sol\n\n76: bytes32 public constant DAO = keccak256(\"DAO\");\n\n77: bytes32 public constant TIMELOCK = keccak256(\"TIMELOCK\");\n\n78: bytes32 public constant ADMIN = keccak256(\"ADMIN\");", "primary_code_language": "solidity", "primary_code_char_count": 232, "all_code_blocks": "// Code block 1 (solidity):\nFile: lybra/configuration/LybraConfigurator.sol\n\n76: bytes32 public constant DAO = keccak256(\"DAO\");\n\n77: bytes32 public constant TIMELOCK = keccak256(\"TIMELOCK\");\n\n78: bytes32 public constant ADMIN = keccak256(\"ADMIN\");\n\n// Code block 2 (solidity):\nFile: lybra/governance/GovernanceTimelock.sol\n\n10: bytes32 public constant DAO = keccak256(\"DAO\");\n\n11: bytes32 public constant TIMELOCK = keccak256(\"TIMELOCK\");\n\n12: bytes32 public constant ADMIN = keccak256(\"ADMIN\");\n\n13: bytes32 public constant GOV = keccak256(\"GOV\");", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: lybra/configuration/LybraConfigurator.sol\n\n76: bytes32 public constant DAO = keccak256(\"DAO\");\n\n77: bytes32 public constant TIMELOCK = keccak256(\"TIMELOCK\");\n\n78: bytes32 public constant ADMIN = keccak256(\"ADMIN\");\n\nFile: lybra/governance/GovernanceTimelock.sol\n\n10: bytes32 public constant DAO = keccak256(\"DAO\");\n\n11: bytes32 public constant TIMELOCK = keccak256(\"TIMELOCK\");\n\n12: bytes32 public constant ADMIN = keccak256(\"ADMIN\");\n\n13: bytes32 public constant GOV = keccak256(\"GOV\");", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: lybra/configuration/LybraConfigurator.sol\n\n76: bytes32 public constant DAO = keccak256(\"DAO\");\n\n77: bytes32 public constant TIMELOCK = keccak256(\"TIMELOCK\");\n\n78: bytes32 public constant ADMIN = keccak256(\"ADMIN\");\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: lybra/governance/GovernanceTimelock.sol\n\n10: bytes32 public constant DAO = keccak256(\"DAO\");\n\n11: bytes32 public constant TIMELOCK = keccak256(\"TIMELOCK\");\n\n12: bytes32 public constant ADMIN = keccak256(\"ADMIN\");\n\n13: bytes32 public constant GOV = keccak256(\"GOV\");\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-salty", "title": "TarunRao0 Q", "severity_raw": "Medium", "severity": "medium", "description": "## [L-6] Additional Instance of Division before Multiplication \n\n**Description** :\n\nFound another instance where multiplication is performed on the result of division in `PoolMath::_zapSwapAmount` \n\n**Impact** : \nPrecision loss from rounding errors \n\n**Proof of Code** :\n\n```javascript\nuint256 C = r0 * ( r1 * z0 - r0 * z1 ) / ( r1 + z1 );\n```\n\n*github permalink*:\n\nhttps://github.com/code-423n4/2024-01-salty/blob/6a9942091392866c674104dd4b7a12a2d14fcbf5/src/pools/PoolMath.sol#L192\n\n", "vulnerable_code": "uint256 C = r0 * ( r1 * z0 - r0 * z1 ) / ( r1 + z1 );", "fixed_code": "", "recommendation": "", "category": "rounding", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/TarunRao0-Q.md", "collected_at": "2026-01-02T19:01:29.560297+00:00", "source_hash": "a99218b06b6fdc7a52dfaf6df2fcfd6952f2b91669ea5cde162ff5a93f2f7dd0", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 53, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "uint256 C = r0 * ( r1 * z0 - r0 * z1 ) / ( r1 + z1 );", "primary_code_language": "javascript", "primary_code_char_count": 53, "all_code_blocks": "// Code block 1 (javascript):\nuint256 C = r0 * ( r1 * z0 - r0 * z1 ) / ( r1 + z1 );", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "PoolMath.sol#L192", "github_files_list": "PoolMath.sol", "github_refs_count": 1, "vulnerable_code_actual": "uint256 C = r0 * ( r1 * z0 - r0 * z1 ) / ( r1 + z1 );", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 3.97} {"source": "c4", "protocol": "11-kelp", "title": "joaovwfreire Q", "severity_raw": "High", "severity": "high", "description": "## lo-01 LRTConfig doesn't remove supported assets\nThe contract only allows the manager to add new supported assets by calling addNewSupportedAsset, but there is not function to remove an asset.\n\n## lo-02 No upper limits on the amount of supported assets can lead to DOS\n[Reference](https://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTConfig.sol#L80-L89)\n### Impact \nThe lack of upper bounds on the amount of supported assets can lead to getRSETHPrice reversion and lock the contract's minting functionalities.\n### Proof of concept\nThere's no upper limit on the amount of supported assets that can be added at the LRTConfig contract. \n```solidity\n\u00a0 \u00a0 function _addNewSupportedAsset(address asset, uint256 depositLimit) private {\n\u00a0 \u00a0 \u00a0 \u00a0 UtilLib.checkNonZeroAddress(asset);\n\u00a0 \u00a0 \u00a0 \u00a0 if (isSupportedAsset[asset]) {\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 revert AssetAlreadySupported();\n\u00a0 \u00a0 \u00a0 \u00a0 }\n\u00a0 \u00a0 \u00a0 \u00a0 isSupportedAsset[asset] = true;\n\u00a0 \u00a0 \u00a0 \u00a0 supportedAssetList.push(asset);\n\u00a0 \u00a0 \u00a0 \u00a0 depositLimitByAsset[asset] = depositLimit;\n\u00a0 \u00a0 \u00a0 \u00a0 emit AddedNewSupportedAsset(asset, depositLimit);\n\n\u00a0 \u00a0 }\n```\n\nIf too many assets are supported, getRSETHPrice at the LRTOracle will revert due to the following code snippet, that represents a loop which iterations amount is determined by the total supported assets:\n```solidity\n\u00a0 \u00a0 \u00a0 \u00a0uint256 supportedAssetCount = supportedAssets.length;\n\u00a0 \u00a0 \u00a0 \u00a0 for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 address asset = supportedAssets[asset_idx];\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 uint256 assetER = getAssetPrice(asset);\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 uint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 totalETHInPool += totalAssetAmt * assetER;\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 unchecked {\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ++asset_idx;\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }\n\u00a0 \u00a0 \u00a0 \u00a0 }\n```\n### Mitigation\nIntroduce a check on the total amount of supported assets in order to protect the function from running loops iterate too many times.\n\n## lo-03 getAssetPrice at the ChainlinkPriceOracle contract assumes all Chainlink Dat", "vulnerable_code": "\u00a0 \u00a0 function _addNewSupportedAsset(address asset, uint256 depositLimit) private {\n\u00a0 \u00a0 \u00a0 \u00a0 UtilLib.checkNonZeroAddress(asset);\n\u00a0 \u00a0 \u00a0 \u00a0 if (isSupportedAsset[asset]) {\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 revert AssetAlreadySupported();\n\u00a0 \u00a0 \u00a0 \u00a0 }\n\u00a0 \u00a0 \u00a0 \u00a0 isSupportedAsset[asset] = true;\n\u00a0 \u00a0 \u00a0 \u00a0 supportedAssetList.push(asset);\n\u00a0 \u00a0 \u00a0 \u00a0 depositLimitByAsset[asset] = depositLimit;\n\u00a0 \u00a0 \u00a0 \u00a0 emit AddedNewSupportedAsset(asset, depositLimit);\n\n\u00a0 \u00a0 }", "fixed_code": "\u00a0 \u00a0 \u00a0 \u00a0uint256 supportedAssetCount = supportedAssets.length;\n\u00a0 \u00a0 \u00a0 \u00a0 for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 address asset = supportedAssets[asset_idx];\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 uint256 assetER = getAssetPrice(asset);\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 uint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 totalETHInPool += totalAssetAmt * assetER;\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 unchecked {\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ++asset_idx;\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }\n\u00a0 \u00a0 \u00a0 \u00a0 }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/joaovwfreire-Q.md", "collected_at": "2026-01-02T18:28:11.344557+00:00", "source_hash": "aa1543fa81fdce0b4c896a46a318a03433d498bc3f098723848a9afa7ded18b7", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 872, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _addNewSupportedAsset(address asset, uint256 depositLimit) private {\n\u00a0 \u00a0 \u00a0 \u00a0 UtilLib.checkNonZeroAddress(asset);\n\u00a0 \u00a0 \u00a0 \u00a0 if (isSupportedAsset[asset]) {\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 revert AssetAlreadySupported();\n\u00a0 \u00a0 \u00a0 \u00a0 }\n\u00a0 \u00a0 \u00a0 \u00a0 isSupportedAsset[asset] = true;\n\u00a0 \u00a0 \u00a0 \u00a0 supportedAssetList.push(asset);\n\u00a0 \u00a0 \u00a0 \u00a0 depositLimitByAsset[asset] = depositLimit;\n\u00a0 \u00a0 \u00a0 \u00a0 emit AddedNewSupportedAsset(asset, depositLimit);\n\n\u00a0 \u00a0 }", "primary_code_language": "solidity", "primary_code_char_count": 410, "all_code_blocks": "// Code block 1 (solidity):\nfunction _addNewSupportedAsset(address asset, uint256 depositLimit) private {\n\u00a0 \u00a0 \u00a0 \u00a0 UtilLib.checkNonZeroAddress(asset);\n\u00a0 \u00a0 \u00a0 \u00a0 if (isSupportedAsset[asset]) {\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 revert AssetAlreadySupported();\n\u00a0 \u00a0 \u00a0 \u00a0 }\n\u00a0 \u00a0 \u00a0 \u00a0 isSupportedAsset[asset] = true;\n\u00a0 \u00a0 \u00a0 \u00a0 supportedAssetList.push(asset);\n\u00a0 \u00a0 \u00a0 \u00a0 depositLimitByAsset[asset] = depositLimit;\n\u00a0 \u00a0 \u00a0 \u00a0 emit AddedNewSupportedAsset(asset, depositLimit);\n\n\u00a0 \u00a0 }\n\n// Code block 2 (solidity):\nuint256 supportedAssetCount = supportedAssets.length;\n\u00a0 \u00a0 \u00a0 \u00a0 for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 address asset = supportedAssets[asset_idx];\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 uint256 assetER = getAssetPrice(asset);\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 uint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 totalETHInPool += totalAssetAmt * assetER;\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 unchecked {\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ++asset_idx;\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }\n\u00a0 \u00a0 \u00a0 \u00a0 }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function _addNewSupportedAsset(address asset, uint256 depositLimit) private {\n\u00a0 \u00a0 \u00a0 \u00a0 UtilLib.checkNonZeroAddress(asset);\n\u00a0 \u00a0 \u00a0 \u00a0 if (isSupportedAsset[asset]) {\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 revert AssetAlreadySupported();\n\u00a0 \u00a0 \u00a0 \u00a0 }\n\u00a0 \u00a0 \u00a0 \u00a0 isSupportedAsset[asset] = true;\n\u00a0 \u00a0 \u00a0 \u00a0 supportedAssetList.push(asset);\n\u00a0 \u00a0 \u00a0 \u00a0 depositLimitByAsset[asset] = depositLimit;\n\u00a0 \u00a0 \u00a0 \u00a0 emit AddedNewSupportedAsset(asset, depositLimit);\n\n\u00a0 \u00a0 }\n\nuint256 supportedAssetCount = supportedAssets.length;\n\u00a0 \u00a0 \u00a0 \u00a0 for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 address asset = supportedAssets[asset_idx];\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 uint256 assetER = getAssetPrice(asset);\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 uint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 totalETHInPool += totalAssetAmt * assetER;\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 unchecked {\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ++asset_idx;\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }\n\u00a0 \u00a0 \u00a0 \u00a0 }", "github_refs_formatted": "LRTConfig.sol#L80-L89", "github_files_list": "LRTConfig.sol", "github_refs_count": 1, "vulnerable_code_actual": "\u00a0 \u00a0 function _addNewSupportedAsset(address asset, uint256 depositLimit) private {\n\u00a0 \u00a0 \u00a0 \u00a0 UtilLib.checkNonZeroAddress(asset);\n\u00a0 \u00a0 \u00a0 \u00a0 if (isSupportedAsset[asset]) {\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 revert AssetAlreadySupported();\n\u00a0 \u00a0 \u00a0 \u00a0 }\n\u00a0 \u00a0 \u00a0 \u00a0 isSupportedAsset[asset] = true;\n\u00a0 \u00a0 \u00a0 \u00a0 supportedAssetList.push(asset);\n\u00a0 \u00a0 \u00a0 \u00a0 depositLimitByAsset[asset] = depositLimit;\n\u00a0 \u00a0 \u00a0 \u00a0 emit AddedNewSupportedAsset(asset, depositLimit);\n\n\u00a0 \u00a0 }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "\u00a0 \u00a0 \u00a0 \u00a0uint256 supportedAssetCount = supportedAssets.length;\n\u00a0 \u00a0 \u00a0 \u00a0 for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 address asset = supportedAssets[asset_idx];\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 uint256 assetER = getAssetPrice(asset);\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 uint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 totalETHInPool += totalAssetAmt * assetER;\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 unchecked {\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ++asset_idx;\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }\n\u00a0 \u00a0 \u00a0 \u00a0 }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "07-amphora", "title": "excalibor G", "severity_raw": "Low", "severity": "low", "description": "# Gas Report\n**All gas tables are gotten from the repositories tests, and they do not implement the general design changes unless stated otherwise**\n## General Design\n1. For loops we should always write them as such\n```solidity\nfor(uint256 i; i\\[G-02\\] Events are not indexed\n\nThe emitted events are not indexed, making off-chain scripts such as front-ends of dApps difficult to filter the events efficiently.\n\nRecommend adding the `indexed` keyword in each event,\n\n```\nevent ApproverRemoved(address approver);\n\n /**\n * @notice event emitted when an address is added as an approver\n *\n * @param approver The address to add\n */\n event ApproverAdded(address approver);\n\n /**\n * @notice event emitted when a new contract is whitelisted as an approved\n * message passer.\n *\n * @param srcChain The chain for the approved address\n * @param approvedSource The address corresponding to the source bridge contract\n */\n event ChainIdSupported(string srcChain, string approvedSource);\n\n /**\n * @notice event emitted when a threshold has been set\n *\n * @param chain The chain for which the t", "vulnerable_code": "bytes memory payload = abi.encode(VERSION, msg.sender, amount, nonce++);", "fixed_code": "event ApproverRemoved(address approver);\n\n /**\n * @notice event emitted when an address is added as an approver\n *\n * @param approver The address to add\n */\n event ApproverAdded(address approver);\n\n /**\n * @notice event emitted when a new contract is whitelisted as an approved\n * message passer.\n *\n * @param srcChain The chain for the approved address\n * @param approvedSource The address corresponding to the source bridge contract\n */\n event ChainIdSupported(string srcChain, string approvedSource);\n\n /**\n * @notice event emitted when a threshold has been set\n *\n * @param chain The chain for which the threshold was set\n * @param amounts The amount of tokens to reach this threshold\n * @param numOfApprovers The number of approvals needed\n */\n event ThresholdSet(string chain, uint256[] amounts, uint256[] numOfApprovers);\n\n /**\n * @notice event emitted when the user has been minted their tokens on the dst chain\n *\n * @param user The recipient address of the newly minted tokens\n * @param amount The amount of tokens that have been minted\n */\n event BridgeCompleted(address user, uint256 amount);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/wahedtalash77-G.md", "collected_at": "2026-01-02T18:26:21.148528+00:00", "source_hash": "aa389ca334d6169b3e7c2c6bfcfcbbb14b7faba749de496582b270284b1aa017", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 72, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "bytes memory payload = abi.encode(VERSION, msg.sender, amount, nonce++);", "primary_code_language": "unknown", "primary_code_char_count": 72, "all_code_blocks": "// Code block 1 (unknown):\nbytes memory payload = abi.encode(VERSION, msg.sender, amount, nonce++);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SourceBridge.sol#L79", "github_files_list": "SourceBridge.sol", "github_refs_count": 1, "vulnerable_code_actual": "bytes memory payload = abi.encode(VERSION, msg.sender, amount, nonce++);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "event ApproverRemoved(address approver);\n\n /**\n * @notice event emitted when an address is added as an approver\n *\n * @param approver The address to add\n */\n event ApproverAdded(address approver);\n\n /**\n * @notice event emitted when a new contract is whitelisted as an approved\n * message passer.\n *\n * @param srcChain The chain for the approved address\n * @param approvedSource The address corresponding to the source bridge contract\n */\n event ChainIdSupported(string srcChain, string approvedSource);\n\n /**\n * @notice event emitted when a threshold has been set\n *\n * @param chain The chain for which the threshold was set\n * @param amounts The amount of tokens to reach this threshold\n * @param numOfApprovers The number of approvals needed\n */\n event ThresholdSet(string chain, uint256[] amounts, uint256[] numOfApprovers);\n\n /**\n * @notice event emitted when the user has been minted their tokens on the dst chain\n *\n * @param user The recipient address of the newly minted tokens\n * @param amount The amount of tokens that have been minted\n */\n event BridgeCompleted(address user, uint256 amount);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "06-lybra", "title": "Kaysoft G", "severity_raw": "Gas", "severity": "gas", "description": "## [G-1] Refactor to avoid emitting already available data in the transaction - block.timestamp.\n\nRefactor code to remove `block.timestamp` from the emitted events because it is already available in the transaction. \nThis would save loading data into memory (potentially avoiding memory expansion costs) and Glogdata (8 gas) * bytes emitted.\n\nFiles: Almost all events emitted in the codebase contain block.timestamp which is not necessary.\n- https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/pools/LybraRETHVault.sol#L38\n- https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/configuration/LybraConfigurator.sol#L139\n- https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/configuration/LybraConfigurator.sol#L149\n- https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/ProtocolRewardsPool.sol#L106\n- https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/ProtocolRewardsPool.sol#L97\n- https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/ProtocolRewardsPool.sol#L146\n- https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/ProtocolRewardsPool.sol#L214\n- https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/pools/LybraRETHVault.sol#L38\n- https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/pools/LybraStETHVault.sol#L89\n- https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/pools/LybraWbETHVault.sol#L31\n- https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/pools/LybraWstETHVault.sol#L45\n- ", "vulnerable_code": "emit DepositEther(msg.sender, address(collateralAsset), msg.value, balance - preBalance, block.timestamp); ", "fixed_code": "function notifyRewardAmount(uint256 amount, uint256 tokenType) external {\n require(msg.sender == address(configurator));\n if (totalStaked() == 0) return;\n require(amount > 0, \"amount = 0\"); //@audit require statement should be at the top\n if (tokenType == 0) {\n uint256 share = IEUSD(configurator.getEUSDAddress()).getSharesByMintedEUSD(amount);\n rewardPerTokenStored = rewardPerTokenStored + (share * 1e18) / totalStaked();\n } else if (tokenType == 1) {\n ERC20 token = ERC20(configurator.stableToken());\n rewardPerTokenStored = rewardPerTokenStored + (amount * 1e36 / token.decimals()) / totalStaked();\n } else {\n rewardPerTokenStored = rewardPerTokenStored + (amount * 1e18) / totalStaked();\n }\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/Kaysoft-G.md", "collected_at": "2026-01-02T18:22:25.067478+00:00", "source_hash": "aa39af7fe65a49ec6714ecfb9da2e5d31ae1623fe5fd20dcb165e21afe23699b", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 10, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LybraRETHVault.sol#L38, LybraConfigurator.sol#L139, LybraConfigurator.sol#L149, ProtocolRewardsPool.sol#L106, ProtocolRewardsPool.sol#L97, ProtocolRewardsPool.sol#L146, ProtocolRewardsPool.sol#L214, LybraStETHVault.sol#L89, LybraWbETHVault.sol#L31, LybraWstETHVault.sol#L45", "github_files_list": "LybraConfigurator.sol, LybraWstETHVault.sol, ProtocolRewardsPool.sol, LybraRETHVault.sol, LybraStETHVault.sol, LybraWbETHVault.sol", "github_refs_count": 10, "vulnerable_code_actual": "emit DepositEther(msg.sender, address(collateralAsset), msg.value, balance - preBalance, block.timestamp); ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function notifyRewardAmount(uint256 amount, uint256 tokenType) external {\n require(msg.sender == address(configurator));\n if (totalStaked() == 0) return;\n require(amount > 0, \"amount = 0\"); //@audit require statement should be at the top\n if (tokenType == 0) {\n uint256 share = IEUSD(configurator.getEUSDAddress()).getSharesByMintedEUSD(amount);\n rewardPerTokenStored = rewardPerTokenStored + (share * 1e18) / totalStaked();\n } else if (tokenType == 1) {\n ERC20 token = ERC20(configurator.stableToken());\n rewardPerTokenStored = rewardPerTokenStored + (amount * 1e36 / token.decimals()) / totalStaked();\n } else {\n rewardPerTokenStored = rewardPerTokenStored + (amount * 1e18) / totalStaked();\n }\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "04-caviar", "title": "KrisApostolov G", "severity_raw": "Low", "severity": "low", "description": "## Low severity findings\n\n## Table of contents\n\n| | Issue | Instances |\n| --- | --- | --- |\n| [L-01] | mulDivUp always produces a more precise output than division | 1 |\n| [L-02] | No 0 length check for tokenIds arrays leads to strange behavior | 9 |\n\n## [L-01] **`mulDivUp`** always produces a more precise output than division\n\n[https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L719](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L719)\n\nReplace the aforementioned line with the following:\n\n```solidity\nFixedPointMathLib.mulDivUp(inputAmount, virtualBaseTokenReserves, (virtualNftReserves+ inputAmount));\n```\n\nFor smaller quantities, this line of code will consistently generate greater precision. Moreover, the addition of 1 will always favor the pool.\n\n\n## [L-02] No 0 length check for **`tokenIds`** arrays leads to strange behavior\n\nCalling the following\n\n[https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L211-L289](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L211-L289)\n\n[https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L301-L373](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L301-L373)\n\n[https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L385-L452](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L385-L452)\n\n[https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L484-L507](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L484-L507)\n\n[https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L514-L532](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L514-L532)\n\nwith empty arrays will not result in errors and will instead emit their corresponding events with empty payloads.\n\n\nThe following\n\n[https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L99-L144", "vulnerable_code": "FixedPointMathLib.mulDivUp(inputAmount, virtualBaseTokenReserves, (virtualNftReserves+ inputAmount));", "fixed_code": "EthRouter.sol\n\nERC721(nft).setApprovalForAll(privatePool, true);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/KrisApostolov-G.md", "collected_at": "2026-01-02T18:19:47.863475+00:00", "source_hash": "ab441d711ddcc26128395876117c8ae4ebe14dce4b8f5f8521ef297dd0ffc5e4", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 101, "github_ref_count": 7, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "FixedPointMathLib.mulDivUp(inputAmount, virtualBaseTokenReserves, (virtualNftReserves+ inputAmount));", "primary_code_language": "solidity", "primary_code_char_count": 101, "all_code_blocks": "// Code block 1 (solidity):\nFixedPointMathLib.mulDivUp(inputAmount, virtualBaseTokenReserves, (virtualNftReserves+ inputAmount));", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "FixedPointMathLib.mulDivUp(inputAmount, virtualBaseTokenReserves, (virtualNftReserves+ inputAmount));", "github_refs_formatted": "PrivatePool.sol#L719, PrivatePool.sol#L211-L289, PrivatePool.sol#L301-L373, PrivatePool.sol#L385-L452, PrivatePool.sol#L484-L507, PrivatePool.sol#L514-L532, EthRouter.sol#L99-L144", "github_files_list": "EthRouter.sol, PrivatePool.sol", "github_refs_count": 7, "vulnerable_code_actual": "FixedPointMathLib.mulDivUp(inputAmount, virtualBaseTokenReserves, (virtualNftReserves+ inputAmount));", "has_vulnerable_code_snippet": true, "fixed_code_actual": "EthRouter.sol\n\nERC721(nft).setApprovalForAll(privatePool, true);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "09-ondo", "title": "klau5 Q", "severity_raw": "Gas", "severity": "gas", "description": "# `TransferShares` event parameter is not correct\n\n## Links to affected code\n\n[https://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L439](https://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L439)\n\n## Impact\n\nEmit `TransferShares` with wrong value at `wrap` function.\n\n## Proof of Concept\n\n`TransferShares` should emit `sharesValue` . But at `wrap` function, `TransferShares` emits `_USDYAmount` .\n\n```solidity\nevent TransferShares(\n address indexed from,\n address indexed to,\n uint256 sharesValue\n);\n\nfunction wrap(uint256 _USDYAmount) external whenNotPaused {\n require(_USDYAmount > 0, \"rUSDY: can't wrap zero USDY tokens\");\n _mintShares(msg.sender, _USDYAmount * BPS_DENOMINATOR);\n usdy.transferFrom(msg.sender, address(this), _USDYAmount);\n emit Transfer(address(0), msg.sender, getRUSDYByShares(_USDYAmount));\n emit TransferShares(address(0), msg.sender, _USDYAmount);\n}\n```\n\n## Tools Used\n\nManual Review\n\n## Recommended Mitigation Steps\n\n```diff\nfunction wrap(uint256 _USDYAmount) external whenNotPaused {\n require(_USDYAmount > 0, \"rUSDY: can't wrap zero USDY tokens\");\n _mintShares(msg.sender, _USDYAmount * BPS_DENOMINATOR);\n usdy.transferFrom(msg.sender, address(this), _USDYAmount);\n emit Transfer(address(0), msg.sender, getRUSDYByShares(_USDYAmount));\n- emit TransferShares(address(0), msg.sender, _USDYAmount);\n+ emit TransferShares(address(0), msg.sender, _USDYAmount * BPS_DENOMINATOR);\n}\n```\n\n# Remove useless inheritance\n\n## Links to affected code\n\n[https://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L21](https://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L21)\n\n[https://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L59](https://github.com/code-423n4/2023-09-", "vulnerable_code": "event TransferShares(\n address indexed from,\n address indexed to,\n uint256 sharesValue\n);\n\nfunction wrap(uint256 _USDYAmount) external whenNotPaused {\n require(_USDYAmount > 0, \"rUSDY: can't wrap zero USDY tokens\");\n _mintShares(msg.sender, _USDYAmount * BPS_DENOMINATOR);\n usdy.transferFrom(msg.sender, address(this), _USDYAmount);\n emit Transfer(address(0), msg.sender, getRUSDYByShares(_USDYAmount));\n emit TransferShares(address(0), msg.sender, _USDYAmount);\n}", "fixed_code": "# Remove useless inheritance\n\n## Links to affected code\n\n[https://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L21](https://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L21)\n\n[https://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L59](https://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L59)\n\n## Impact\n\nImports and inherits useless contract\n\n## Proof of Concept\n\nrUSDY contract imports and inherits ContextUpgradeable contract, but there is no usage of this. There is no code using `_msgData()` or `_msgSender()` . This only increase deploy gas, so it would be better to remove unused import/inheritance.\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/klau5-Q.md", "collected_at": "2026-01-02T18:26:02.318707+00:00", "source_hash": "ab64bc42adedec64d8182789e79f9350003485af813e438056dbfaf6a7a1428f", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 928, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "event TransferShares(\n address indexed from,\n address indexed to,\n uint256 sharesValue\n);\n\nfunction wrap(uint256 _USDYAmount) external whenNotPaused {\n require(_USDYAmount > 0, \"rUSDY: can't wrap zero USDY tokens\");\n _mintShares(msg.sender, _USDYAmount * BPS_DENOMINATOR);\n usdy.transferFrom(msg.sender, address(this), _USDYAmount);\n emit Transfer(address(0), msg.sender, getRUSDYByShares(_USDYAmount));\n emit TransferShares(address(0), msg.sender, _USDYAmount);\n}", "primary_code_language": "solidity", "primary_code_char_count": 472, "all_code_blocks": "// Code block 1 (solidity):\nevent TransferShares(\n address indexed from,\n address indexed to,\n uint256 sharesValue\n);\n\nfunction wrap(uint256 _USDYAmount) external whenNotPaused {\n require(_USDYAmount > 0, \"rUSDY: can't wrap zero USDY tokens\");\n _mintShares(msg.sender, _USDYAmount * BPS_DENOMINATOR);\n usdy.transferFrom(msg.sender, address(this), _USDYAmount);\n emit Transfer(address(0), msg.sender, getRUSDYByShares(_USDYAmount));\n emit TransferShares(address(0), msg.sender, _USDYAmount);\n}\n\n// Code block 2 (diff):\nfunction wrap(uint256 _USDYAmount) external whenNotPaused {\n require(_USDYAmount > 0, \"rUSDY: can't wrap zero USDY tokens\");\n _mintShares(msg.sender, _USDYAmount * BPS_DENOMINATOR);\n usdy.transferFrom(msg.sender, address(this), _USDYAmount);\n emit Transfer(address(0), msg.sender, getRUSDYByShares(_USDYAmount));\n- emit TransferShares(address(0), msg.sender, _USDYAmount);\n+ emit TransferShares(address(0), msg.sender, _USDYAmount * BPS_DENOMINATOR);\n}", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "function wrap(uint256 _USDYAmount) external whenNotPaused {\n require(_USDYAmount > 0, \"rUSDY: can't wrap zero USDY tokens\");\n _mintShares(msg.sender, _USDYAmount * BPS_DENOMINATOR);\n usdy.transferFrom(msg.sender, address(this), _USDYAmount);\n emit Transfer(address(0), msg.sender, getRUSDYByShares(_USDYAmount));\n- emit TransferShares(address(0), msg.sender, _USDYAmount);\n+ emit TransferShares(address(0), msg.sender, _USDYAmount * BPS_DENOMINATOR);\n}", "solidity_code": "event TransferShares(\n address indexed from,\n address indexed to,\n uint256 sharesValue\n);\n\nfunction wrap(uint256 _USDYAmount) external whenNotPaused {\n require(_USDYAmount > 0, \"rUSDY: can't wrap zero USDY tokens\");\n _mintShares(msg.sender, _USDYAmount * BPS_DENOMINATOR);\n usdy.transferFrom(msg.sender, address(this), _USDYAmount);\n emit Transfer(address(0), msg.sender, getRUSDYByShares(_USDYAmount));\n emit TransferShares(address(0), msg.sender, _USDYAmount);\n}", "github_refs_formatted": "rUSDY.sol#L439, rUSDY.sol#L21, rUSDY.sol#L59", "github_files_list": "rUSDY.sol", "github_refs_count": 3, "vulnerable_code_actual": "event TransferShares(\n address indexed from,\n address indexed to,\n uint256 sharesValue\n);\n\nfunction wrap(uint256 _USDYAmount) external whenNotPaused {\n require(_USDYAmount > 0, \"rUSDY: can't wrap zero USDY tokens\");\n _mintShares(msg.sender, _USDYAmount * BPS_DENOMINATOR);\n usdy.transferFrom(msg.sender, address(this), _USDYAmount);\n emit Transfer(address(0), msg.sender, getRUSDYByShares(_USDYAmount));\n emit TransferShares(address(0), msg.sender, _USDYAmount);\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "# Remove useless inheritance\n\n## Links to affected code\n\n[https://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L21](https://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L21)\n\n[https://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L59](https://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L59)\n\n## Impact\n\nImports and inherits useless contract\n\n## Proof of Concept\n\nrUSDY contract imports and inherits ContextUpgradeable contract, but there is no usage of this. There is no code using `_msgData()` or `_msgSender()` . This only increase deploy gas, so it would be better to remove unused import/inheritance.\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "02-ethos", "title": "matrix_0wl Q", "severity_raw": "Critical", "severity": "critical", "description": "# Summary\n\n## Low Risk and Non-Critical Issues\n\n## Non-Critical Issues\n\n| | Issue |\n| ----- | :----------------------------------------------------------------------------------------------------- |\n| NC-1 | ADD TO INDEXED PARAMETER FOR COUNTABLE EVENTS |\n| NC-2 | ADD A TIMELOCK TO CRITICAL FUNCTIONS |\n| NC-3 | BE EXPLICIT DECLARING TYPES |\n| NC-4 | GENERATE PERFECT CODE HEADERS EVERY TIME |\n| NC-5 | SAME CONSTANT REDEFINED ELSEWHERE |\n| NC-6 | USE A SINGLE FILE FOR ALL SYSTEM-WIDE CONSTANTS |\n| NC-7 | SOLIDITY COMPILER VERSIONS MISMATCH |\n| NC-8 | SIGNATURE MALLEABILITY OF EVM\u2019S `ECRECOVER()` |\n| NC-9 | FOR MODERN AND MORE READABLE CODE; UPDATE IMPORT USAGES |\n| NC-10 | MARK VISIBILITY OF `INITIALIZE(\u2026)` FUNCTIONS AS EXTERNAL |\n| NC-11 | CONSTANT VALUES SUCH AS A CALL `TO KECCAK256()`, SHOULD USE IMMUTABLE RATHER THAN CONSTANT |\n| NC-12 | LACK OF EVENT EMISSION AFTER CRITICAL `INITIALIZE()` FUNCTIONS |\n| NC-13 | LACK OF CHECKS SUPPORTSINTERFACE |\n| NC-14 | LARGE MULTIPLES OF TEN SHOULD USE SCIENTIFIC NOTATION |\n| NC-15 | FOR EXTENDED \u201cUSING-FOR\u201d USAGE, USE THE LATEST PRAGMA VERSION ", "vulnerable_code": "File: Ethos-Core/contracts/ActivePool.sol\n\n62: event ActivePoolLUSDDebtUpdated(address _collateral, uint _LUSDDebt);\n", "fixed_code": "File: Ethos-Core/contracts/ActivePool.sol\n\n71: function setAddresses(\n\n125: function setYieldingPercentage(address _collateral, uint256 _bps) external onlyOwner {\n\n132: function setYieldingPercentageDrift(uint256 _driftBps) external onlyOwner {\n\n138: function setYieldClaimThreshold(address _collateral, uint256 _threshold) external onlyOwner {\n\n144: function setYieldDistributionParams(uint256 _treasurySplit, uint256 _SPSplit, uint256 _stakingSplit) external onlyOwner {\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/matrix_0wl-Q.md", "collected_at": "2026-01-02T18:17:23.990241+00:00", "source_hash": "ab82516c9bc30c8ebda0543493620887ea141d978336e565a27a946ce8521533", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: Ethos-Core/contracts/ActivePool.sol\n\n62: event ActivePoolLUSDDebtUpdated(address _collateral, uint _LUSDDebt);\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: Ethos-Core/contracts/ActivePool.sol\n\n71: function setAddresses(\n\n125: function setYieldingPercentage(address _collateral, uint256 _bps) external onlyOwner {\n\n132: function setYieldingPercentageDrift(uint256 _driftBps) external onlyOwner {\n\n138: function setYieldClaimThreshold(address _collateral, uint256 _threshold) external onlyOwner {\n\n144: function setYieldDistributionParams(uint256 _treasurySplit, uint256 _SPSplit, uint256 _stakingSplit) external onlyOwner {\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "05-ajna", "title": "MohammedRizwan Q", "severity_raw": "Critical", "severity": "critical", "description": "## Summary\n\n### Low Risk Issues\n|Number|Issue|Instances| |\n|-|:-|:-:|:-:|\n| [L‑01] | GrantFund.fundTreasury( ) function does not check sender token balance | 1 |\n| [L‑02] | For immutable variables, Zero address checks are missing in constructor | 2 |\n| [L‑03] | In PositionManager.sol, modifier mayInteract( ) lacks validation checks | 1 |\n\n### Non-Critical Issues\n|Number|Issue|Instances| |\n|-|:-|:-:|:-:|\n| [N‑01] | Use named parameters for mapping type declarations | 19 |\n| [N‑02] | Solidity compiler version should be exactly same in all smart contracts | All Contracts |\n| [N‑03] | Use a more recent version of Solidity | All Contracts |\n\n\n### Low Risk Issues\n### [L‑01] GrantFund.fundTreasury( ) function does not check sender token balance\nIn GrantFund.sol, fundTreasury( ) function does not check whether the sender has token balance to transfer to treasury or not. It even does not check minimum balance or zero value check which can prevent wastage of gas to users.\n\n```solidity\nFile: ajna-grants/src/grants/GrantFund.sol\n\n58 function fundTreasury(uint256 fundingAmount_) external override {\n59 IERC20 token = IERC20(ajnaTokenAddress);\n60\n61 // update treasury accounting\n62 treasury += fundingAmount_;\n63\n64 emit FundTreasury(fundingAmount_, treasury);\n65\n66 // transfer ajna tokens to the treasury\n67 token.safeTransferFrom(msg.sender, address(this), fundingAmount_);\n68 }\n```\n[Link to code](https://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/GrantFund.sol#L58-L68)\n\n### Recommended Mitigation steps\n\n```solidity\nFile: ajna-grants/src/grants/GrantFund.sol\n\n function fundTreasury(uint256 fundingAmount_) external override {\n+ require(fundingAmount_ > 0, \"Funding amount must be greater than 0\");\n IERC20 token = IERC20(ajnaTokenAddress);\n\n+ require(token.balanceOf(msg.sender) >= fundingAmount_, \"Insuffici", "vulnerable_code": "File: ajna-grants/src/grants/GrantFund.sol\n\n58 function fundTreasury(uint256 fundingAmount_) external override {\n59 IERC20 token = IERC20(ajnaTokenAddress);\n60\n61 // update treasury accounting\n62 treasury += fundingAmount_;\n63\n64 emit FundTreasury(fundingAmount_, treasury);\n65\n66 // transfer ajna tokens to the treasury\n67 token.safeTransferFrom(msg.sender, address(this), fundingAmount_);\n68 }", "fixed_code": "File: ajna-grants/src/grants/GrantFund.sol\n\n function fundTreasury(uint256 fundingAmount_) external override {\n+ require(fundingAmount_ > 0, \"Funding amount must be greater than 0\");\n IERC20 token = IERC20(ajnaTokenAddress);\n\n+ require(token.balanceOf(msg.sender) >= fundingAmount_, \"Insufficient token balance\");\n\n // update treasury accounting\n treasury += fundingAmount_;\n\n emit FundTreasury(fundingAmount_, treasury);\n\n // transfer ajna tokens to the treasury\n token.safeTransferFrom(msg.sender, address(this), fundingAmount_);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/MohammedRizwan-Q.md", "collected_at": "2026-01-02T18:21:06.576807+00:00", "source_hash": "ab85eb0794fbd514e3432ce486acde4f65471647cd8746a394630c137c682486", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 443, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: ajna-grants/src/grants/GrantFund.sol\n\n58 function fundTreasury(uint256 fundingAmount_) external override {\n59 IERC20 token = IERC20(ajnaTokenAddress);\n60\n61 // update treasury accounting\n62 treasury += fundingAmount_;\n63\n64 emit FundTreasury(fundingAmount_, treasury);\n65\n66 // transfer ajna tokens to the treasury\n67 token.safeTransferFrom(msg.sender, address(this), fundingAmount_);\n68 }", "primary_code_language": "solidity", "primary_code_char_count": 443, "all_code_blocks": "// Code block 1 (solidity):\nFile: ajna-grants/src/grants/GrantFund.sol\n\n58 function fundTreasury(uint256 fundingAmount_) external override {\n59 IERC20 token = IERC20(ajnaTokenAddress);\n60\n61 // update treasury accounting\n62 treasury += fundingAmount_;\n63\n64 emit FundTreasury(fundingAmount_, treasury);\n65\n66 // transfer ajna tokens to the treasury\n67 token.safeTransferFrom(msg.sender, address(this), fundingAmount_);\n68 }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: ajna-grants/src/grants/GrantFund.sol\n\n58 function fundTreasury(uint256 fundingAmount_) external override {\n59 IERC20 token = IERC20(ajnaTokenAddress);\n60\n61 // update treasury accounting\n62 treasury += fundingAmount_;\n63\n64 emit FundTreasury(fundingAmount_, treasury);\n65\n66 // transfer ajna tokens to the treasury\n67 token.safeTransferFrom(msg.sender, address(this), fundingAmount_);\n68 }", "github_refs_formatted": "GrantFund.sol#L58-L68", "github_files_list": "GrantFund.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: ajna-grants/src/grants/GrantFund.sol\n\n58 function fundTreasury(uint256 fundingAmount_) external override {\n59 IERC20 token = IERC20(ajnaTokenAddress);\n60\n61 // update treasury accounting\n62 treasury += fundingAmount_;\n63\n64 emit FundTreasury(fundingAmount_, treasury);\n65\n66 // transfer ajna tokens to the treasury\n67 token.safeTransferFrom(msg.sender, address(this), fundingAmount_);\n68 }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: ajna-grants/src/grants/GrantFund.sol\n\n function fundTreasury(uint256 fundingAmount_) external override {\n+ require(fundingAmount_ > 0, \"Funding amount must be greater than 0\");\n IERC20 token = IERC20(ajnaTokenAddress);\n\n+ require(token.balanceOf(msg.sender) >= fundingAmount_, \"Insufficient token balance\");\n\n // update treasury accounting\n treasury += fundingAmount_;\n\n emit FundTreasury(fundingAmount_, treasury);\n\n // transfer ajna tokens to the treasury\n token.safeTransferFrom(msg.sender, address(this), fundingAmount_);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "06-lybra", "title": "matrix_0wl Q", "severity_raw": "Critical", "severity": "critical", "description": "## Non Critical Issues\n\n| | Issue |\n| ----- | :----------------------------------------------------------------------------------------------------- |\n| NC-1 | Be explicit declaring types |\n| NC-2 | Boolean equality |\n| NC-3 | GENERATE PERFECT CODE HEADERS EVERY TIME |\n| NC-4 | USE A SINGLE FILE FOR ALL SYSTEM-WIDE CONSTANTS |\n| NC-5 | INCONSISTENT SOLIDITY VERSIONS |\n| NC-6 | Use camel case for all functions, parameters and variables and snake case for constants |\n| NC-7 | LARGE MULTIPLES OF TEN SHOULD USE SCIENTIFIC NOTATION |\n| NC-8 | FOR EXTENDED \u201cUSING-FOR\u201d USAGE, USE THE LATEST PRAGMA VERSION |\n| NC-9 | NO SAME VALUE INPUT CONTROL |\n| NC-10 | Add parameter to event-emit |\n| NC-11 | SOLIDITY COMPILER OPTIMIZATIONS CAN BE PROBLEMATIC |\n| NC-12 | USE A MORE RECENT VERSION OF SOLIDITY |\n| NC-13 | `require()`\u00a0/\u00a0`revert()`\u00a0statements should have descriptive reason strings |\n| NC-14 | FOR FUNCTIONS AND VARIABLES FOLLOW SOLIDITY STANDARD NAMING CONVENTIONS |\n| NC-15 | Functions not used internally could be marked external |\n| NC-16 | VARIABLE NA", "vulnerable_code": "File: contracts/lybra/miner/EUSDMiningIncentives.sol\n\n94: for (uint i = 0; i < _pools.length; i++) {\n\n138: for (uint i = 0; i < pools.length; i++) {\n\n140: uint borrowed = pool.getBorrowedOf(user);\n\n153: uint256 etherInLp = (IEUSD(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2).balanceOf(ethlbrLpToken) * uint(etherPrice)) / 1e8;\n\n154: uint256 lbrInLp = (IEUSD(LBR).balanceOf(ethlbrLpToken) * uint(lbrPrice)) / 1e8;\n", "fixed_code": "File: contracts/lybra/miner/ProtocolRewardsPool.sol\n\n31: uint public rewardPerTokenStored;\n\n33: mapping(address => uint) public userRewardPerTokenPaid;\n\n35: mapping(address => uint) public rewards;\n\n36: mapping(address => uint) public time2fullRedemption;\n\n37: mapping(address => uint) public unstakeRatio;\n\n38: mapping(address => uint) public lastWithdrawTime;\n\n167: function earned(address _account) public view returns (uint) {\n\n191: uint reward = rewards[msg.sender];\n\n227: function notifyRewardAmount(uint amount, uint tokenType) external {\n\n227: function notifyRewardAmount(uint amount, uint tokenType) external {\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/matrix_0wl-Q.md", "collected_at": "2026-01-02T18:23:08.672431+00:00", "source_hash": "ab9318d2b8c78b21ecdbf5cf88654602f34df0fd1f8d3c2ff543a712c757716d", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: contracts/lybra/miner/EUSDMiningIncentives.sol\n\n94: for (uint i = 0; i < _pools.length; i++) {\n\n138: for (uint i = 0; i < pools.length; i++) {\n\n140: uint borrowed = pool.getBorrowedOf(user);\n\n153: uint256 etherInLp = (IEUSD(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2).balanceOf(ethlbrLpToken) * uint(etherPrice)) / 1e8;\n\n154: uint256 lbrInLp = (IEUSD(LBR).balanceOf(ethlbrLpToken) * uint(lbrPrice)) / 1e8;\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/lybra/miner/ProtocolRewardsPool.sol\n\n31: uint public rewardPerTokenStored;\n\n33: mapping(address => uint) public userRewardPerTokenPaid;\n\n35: mapping(address => uint) public rewards;\n\n36: mapping(address => uint) public time2fullRedemption;\n\n37: mapping(address => uint) public unstakeRatio;\n\n38: mapping(address => uint) public lastWithdrawTime;\n\n167: function earned(address _account) public view returns (uint) {\n\n191: uint reward = rewards[msg.sender];\n\n227: function notifyRewardAmount(uint amount, uint tokenType) external {\n\n227: function notifyRewardAmount(uint amount, uint tokenType) external {\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "08-dopex", "title": "JrNet Q", "severity_raw": "Low", "severity": "low", "description": "# [L-01] `removeLiquidity()` always emit 0 for tokenId\n\n```solidity\n FILE: 2023-08-dopex/contracts/amo/UniV3LiquidityAmo.sol\n \n 263: delete positions_mapping[pos.token_id];\n\n 265: // send tokens to rdpxV2Core\n 266: _sendTokensToRdpxV2Core(tokenA, tokenB);\n\n 268: emit log(positions_array.length);\n 269: emit log(positions_mapping[pos.token_id].token_id); // @audit emitting deleted mapping value\n```\n[UniV3LiquidityAmo.sol#L263-L269](https://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/amo/UniV3LiquidityAmo.sol#L263-L269)\n\n# [N-01] Check implemented twice to check role\n```solidity\n FILE: 2023-08-dopex/contracts/decaying-bonds/RdpxDecayingBonds.sol\n 118: ) external onlyRole(MINTER_ROLE) {\n 119: _whenNotPaused();\n 120: require(hasRole(MINTER_ROLE, msg.sender), \"Caller is not a minter\");\n```\n\n[RdpxDecayingBonds.sol#L118-L120](https://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/decaying-bonds/RdpxDecayingBonds.sol#L118-L120)", "vulnerable_code": " FILE: 2023-08-dopex/contracts/amo/UniV3LiquidityAmo.sol\n \n 263: delete positions_mapping[pos.token_id];\n\n 265: // send tokens to rdpxV2Core\n 266: _sendTokensToRdpxV2Core(tokenA, tokenB);\n\n 268: emit log(positions_array.length);\n 269: emit log(positions_mapping[pos.token_id].token_id); // @audit emitting deleted mapping value", "fixed_code": " FILE: 2023-08-dopex/contracts/decaying-bonds/RdpxDecayingBonds.sol\n 118: ) external onlyRole(MINTER_ROLE) {\n 119: _whenNotPaused();\n 120: require(hasRole(MINTER_ROLE, msg.sender), \"Caller is not a minter\");", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/JrNet-Q.md", "collected_at": "2026-01-02T18:24:45.253405+00:00", "source_hash": "abc2bc42ba6c6a2c5502389d0901086633ea72c2c41736171e64a9082f1efa3f", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 555, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "FILE: 2023-08-dopex/contracts/amo/UniV3LiquidityAmo.sol\n \n 263: delete positions_mapping[pos.token_id];\n\n 265: // send tokens to rdpxV2Core\n 266: _sendTokensToRdpxV2Core(tokenA, tokenB);\n\n 268: emit log(positions_array.length);\n 269: emit log(positions_mapping[pos.token_id].token_id); // @audit emitting deleted mapping value", "primary_code_language": "solidity", "primary_code_char_count": 344, "all_code_blocks": "// Code block 1 (solidity):\nFILE: 2023-08-dopex/contracts/amo/UniV3LiquidityAmo.sol\n \n 263: delete positions_mapping[pos.token_id];\n\n 265: // send tokens to rdpxV2Core\n 266: _sendTokensToRdpxV2Core(tokenA, tokenB);\n\n 268: emit log(positions_array.length);\n 269: emit log(positions_mapping[pos.token_id].token_id); // @audit emitting deleted mapping value\n\n// Code block 2 (solidity):\nFILE: 2023-08-dopex/contracts/decaying-bonds/RdpxDecayingBonds.sol\n 118: ) external onlyRole(MINTER_ROLE) {\n 119: _whenNotPaused();\n 120: require(hasRole(MINTER_ROLE, msg.sender), \"Caller is not a minter\");", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "FILE: 2023-08-dopex/contracts/amo/UniV3LiquidityAmo.sol\n \n 263: delete positions_mapping[pos.token_id];\n\n 265: // send tokens to rdpxV2Core\n 266: _sendTokensToRdpxV2Core(tokenA, tokenB);\n\n 268: emit log(positions_array.length);\n 269: emit log(positions_mapping[pos.token_id].token_id); // @audit emitting deleted mapping value\n\nFILE: 2023-08-dopex/contracts/decaying-bonds/RdpxDecayingBonds.sol\n 118: ) external onlyRole(MINTER_ROLE) {\n 119: _whenNotPaused();\n 120: require(hasRole(MINTER_ROLE, msg.sender), \"Caller is not a minter\");", "github_refs_formatted": "UniV3LiquidityAmo.sol#L263-L269, RdpxDecayingBonds.sol#L118-L120", "github_files_list": "UniV3LiquidityAmo.sol, RdpxDecayingBonds.sol", "github_refs_count": 2, "vulnerable_code_actual": " FILE: 2023-08-dopex/contracts/amo/UniV3LiquidityAmo.sol\n \n 263: delete positions_mapping[pos.token_id];\n\n 265: // send tokens to rdpxV2Core\n 266: _sendTokensToRdpxV2Core(tokenA, tokenB);\n\n 268: emit log(positions_array.length);\n 269: emit log(positions_mapping[pos.token_id].token_id); // @audit emitting deleted mapping value", "has_vulnerable_code_snippet": true, "fixed_code_actual": " FILE: 2023-08-dopex/contracts/decaying-bonds/RdpxDecayingBonds.sol\n 118: ) external onlyRole(MINTER_ROLE) {\n 119: _whenNotPaused();\n 120: require(hasRole(MINTER_ROLE, msg.sender), \"Caller is not a minter\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7.1} {"source": "c4", "protocol": "09-ondo", "title": "castle_chain Analysis", "severity_raw": "Critical", "severity": "critical", "description": "# bridge overview \n## Architecture improvments\n## 1) implement a minimum limit to amount of token burnt on the source chain . \nthe protocol use a bridge between two chains , source and destination chain .\nOn the destination chain, there is a limit for the amount of tokens that can be minted over a specified duration, causing the mint function to revert if this limit is exceeded. Conversely, the **source chain imposes no such limit**, allowing users to burn and bridge an unlimited quantity of tokens without reversion. As a result, if a user burns and bridges tokens exceeding the destination chain's minting limit, the call will revert on the destination chain or the message will reaches the destination chain but the user will not get his minted tokens even if the number of approvers exceeds the threshold so the user will not be able to mint his tokens because of the limit on minting amount of tokens . \n### **Recommendation**\nimplement the same limit of minting and burning tokens on the source and destination chains to prevent such an issue . \n\n## 2) pre-determined quantity of gas \nThe primary issue revolves around the lack of predetermined gas limits, which allows users to specify any gas amount, leading to transaction failures and unrecoverable token burns.\n according to [axelar docs](https://docs.axelar.dev/dev/general-message-passing/monitoring) , the way to recover the transaction if it has an insufficient gas issue is to use the UI or the SDK which need the transaction hash to determine which transaction to be recovered , but it will not be a good solution to force the user to moniter the transaction maually , and it is better to predetermine the gas amount to get it from the user \n### **Recommendations**\n 1) using external oracle such as [chainLink fast gas oracle](https://data.chain.link/ethereum/mainnet/gas/fast-gas-gwei) which provide the gas price on chain and will allow the protocol to pre-determine the gas cost and take them from the user , which will red", "vulnerable_code": "These relayer services are a free, operational convenience Axelar provides , anyone can create his own relayer", "fixed_code": "currentPrice = (Range.dailyInterestRate ** (Days Elapsed + 1)) * Range.lastSetPrice", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/castle_chain-Analysis.md", "collected_at": "2026-01-02T18:25:49.787476+00:00", "source_hash": "ac1d1327b56582ebf394c64e5f75bd77cdbce644b5ee859db170b35161d5417d", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "These relayer services are a free, operational convenience Axelar provides , anyone can create his own relayer", "has_vulnerable_code_snippet": true, "fixed_code_actual": "currentPrice = (Range.dailyInterestRate ** (Days Elapsed + 1)) * Range.lastSetPrice", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-asymmetry", "title": "Sathish9098 Q", "severity_raw": "Critical", "severity": "critical", "description": "# LOW FINDINGS \n## LOW\n| | Issues| Instances|\n|---------|-----|--------|\n| [L-1] | UNUSED RECEIVE() functions | 4|\n| [L-2] | Imports can be grouped together | 3|\n| [L-3] | Sanity/Threshold/Limit Checks | 6|\n| [L-4] | LOSS OF PRECISION DUE TO ROUNDING | 9|\n| [L-5] | A single point of failure | 17|\n| [L-6] | Use safe variant of _mint() function | 1|\n| [L-7] | No Storage Gap for SafEth contract | 7|\n| [L-8] | Prevent division by 0 | 5|\n| [L-9] | Consider using OpenZeppelin\u2019s SafeCast library to prevent unexpected behavior when casting uint | 1|\n| [L-10] | abi.encodePacked() should not be used with dynamic types when passing the result to a hash function such as keccak256() | 6|\n| [L-11] | Missing Event for critical parameters init and change | 4|\n| [L-12] | Gas griefing/theft is possible on unsafe external call | 3|\n| [L-13] | Front running attacks by the onlyOwner | 2|\n| [L-14] | Function Calls in Loop Could Lead to Denial of Service | 4|\n| [L-15] | Use safeTransferOwnership instead of transferOwnership function | 4|\n\n##\n## NON CRITICAL\n\n| | Issues| Instances|\n|---------|-----|--------|\n| [NC-1] | For modern and more readable code; update import usages | 34 |\n| [NC-2] | Imports can be grouped together | - |\n| [NC-3] | AVOID HARDCODED VALUES | 11 |\n| [NC-4] | Shorter the inheritance | 1 |\n| [NC-5] | EMPTY BLOCKS SHOULD BE REMOVED OR EMIT SOMETHING | 5 |\n| [NC-6] | ADD PARAMETER TO EVENT-EMIT | 1 |\n| [NC-7] | Pragma float | 7 |\n| [NC-8] | Interchangeable usage of uint and uint256 | 4 |\n| [NC-9] | TYPOS | 1 |\n| [NC-10] | Include (@param and @return) parameters in NatSpec comments | - |\n| [NC-11] | NatSpec comments should be increased in contracts | - |\n| [NC-12] | Function writing that does not comply with the Solidity Style Guide | - |\n| [NC-13] | Add a timelock to critical functions | 4 |\n| [NC-14] | For functions, follow Solidi", "vulnerable_code": "97: receive() external payable {}", "fixed_code": "126: receive() external payable {}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Sathish9098-Q.md", "collected_at": "2026-01-02T18:18:33.714726+00:00", "source_hash": "ac847b7747d88bffb48a813f013280ce9a259f84aecfbe1ce6354d8e7ff49acb", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "97: receive() external payable {}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "126: receive() external payable {}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-biconomy", "title": "0x1f8b G", "severity_raw": "Medium", "severity": "medium", "description": "- [Gas](#gas)\n - [**1. Remove unnecessary variables**](#1-remove-unnecessary-variables)\n - [**2. Optimize internalIncrementDeposit**](#2-optimize-internalincrementdeposit)\n - [**3. Optimize unlockStake**](#3-optimize-unlockstake)\n - [**4. Reorder structure layout**](#4-reorder-structure-layout)\n - [**5. Use the unchecked keyword**](#5-use-the-unchecked-keyword)\n\n# Gas\n\n## **1. Remove unnecessary variables**\n\nThe following state variables can be removed without affecting the logic of the contract since they are not used and/or are redundant because they could be used inline.\n\n**Affected source code:**\n\n- In the following case is used, but also is added: [VerifyingSingletonPaymaster.sol:99](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol#L99)\n- [BasePaymaster.sol:50](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L50)\n- [VerifyingSingletonPaymaster.sol:124](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol#L124)\n\n## **2. Optimize `internalIncrementDeposit`**\n\nIt's possible to optimize the `internalIncrementDeposit` method like follows:\n\n```diff\n- function internalIncrementDeposit(address account, uint256 amount) internal {\n+ function internalIncrementDeposit(address account, uint256 amount) internal returns (uint112 ret) {\n DepositInfo storage info = deposits[account];\n uint256 newAmount = info.deposit + amount;\n require(newAmount <= type(uint112).max, \"deposit overflow\");\n+ ret = uint112(newAmount);\n+ info.deposit = ret;\n- info.deposit = uint112(newAmount);\n }\n function depositTo(addre", "vulnerable_code": "**Gas diff:**\n\nIn red the old version, in green with the applied changes:\n", "fixed_code": "**Affected source code:**\n\n- [StakeManager.sol:38-43](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/StakeManager.sol#L38-L43)\n\n## **3. Optimize `unlockStake`**\n\nYou can use `withdrawTime != 0` as a `staked` flag, so you could remove that field from the `DepositInfo` structure, saving space and gas.\n\n**Affected source code:**\n\n- [StakeManager.sol:86](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/StakeManager.sol#L86)\n\n## **4. Reorder structure layout**\n\nThe following structures could be optimized moving the position of certain values in order to save some storage slots:\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/0x1f8b-G.md", "collected_at": "2026-01-02T18:12:44.978418+00:00", "source_hash": "aca45e84416e5b8c8915aa1120101761901cfb601e93f68df16959a6c4415553", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "VerifyingSingletonPaymaster.sol#L99, BasePaymaster.sol#L50, VerifyingSingletonPaymaster.sol#L124, StakeManager.sol#L38-L43, StakeManager.sol#L86", "github_files_list": "VerifyingSingletonPaymaster.sol, StakeManager.sol, BasePaymaster.sol", "github_refs_count": 5, "vulnerable_code_actual": "**Gas diff:**\n\nIn red the old version, in green with the applied changes:\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "**Affected source code:**\n\n- [StakeManager.sol:38-43](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/StakeManager.sol#L38-L43)\n\n## **3. Optimize `unlockStake`**\n\nYou can use `withdrawTime != 0` as a `staked` flag, so you could remove that field from the `DepositInfo` structure, saving space and gas.\n\n**Affected source code:**\n\n- [StakeManager.sol:86](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/StakeManager.sol#L86)\n\n## **4. Reorder structure layout**\n\nThe following structures could be optimized moving the position of certain values in order to save some storage slots:\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "11-kelp", "title": "owadez Q", "severity_raw": "Low", "severity": "low", "description": "From the `LRTDepositPool` contract , the amount sent should be checked and revert early if not enough.\n```\n function transferAssetToNodeDelegator(\n uint256 ndcIndex,\n address asset,\n uint256 amount\n )\n external\n nonReentrant\n onlyLRTManager\n onlySupportedAsset(asset)\n {\n address nodeDelegator = nodeDelegatorQueue[ndcIndex];\n if (!IERC20(asset).transfer(nodeDelegator, amount)) {\n revert TokenTransferFailed();\n }\n }\n```\nThe following can be added to achieve the result\n```\nrequire(IERC20(asset).balanceOf(address(this) > 0),\"error\")\n```", "vulnerable_code": " function transferAssetToNodeDelegator(\n uint256 ndcIndex,\n address asset,\n uint256 amount\n )\n external\n nonReentrant\n onlyLRTManager\n onlySupportedAsset(asset)\n {\n address nodeDelegator = nodeDelegatorQueue[ndcIndex];\n if (!IERC20(asset).transfer(nodeDelegator, amount)) {\n revert TokenTransferFailed();\n }\n }", "fixed_code": "require(IERC20(asset).balanceOf(address(this) > 0),\"error\")", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/owadez-Q.md", "collected_at": "2026-01-02T18:28:21.197521+00:00", "source_hash": "acac068b3510be553001bacb3a9505f384dd7d0d630621bef01b0d8e73b357a9", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 458, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function transferAssetToNodeDelegator(\n uint256 ndcIndex,\n address asset,\n uint256 amount\n )\n external\n nonReentrant\n onlyLRTManager\n onlySupportedAsset(asset)\n {\n address nodeDelegator = nodeDelegatorQueue[ndcIndex];\n if (!IERC20(asset).transfer(nodeDelegator, amount)) {\n revert TokenTransferFailed();\n }\n }", "primary_code_language": "unknown", "primary_code_char_count": 399, "all_code_blocks": "// Code block 1 (unknown):\nfunction transferAssetToNodeDelegator(\n uint256 ndcIndex,\n address asset,\n uint256 amount\n )\n external\n nonReentrant\n onlyLRTManager\n onlySupportedAsset(asset)\n {\n address nodeDelegator = nodeDelegatorQueue[ndcIndex];\n if (!IERC20(asset).transfer(nodeDelegator, amount)) {\n revert TokenTransferFailed();\n }\n }\n\n// Code block 2 (unknown):\nrequire(IERC20(asset).balanceOf(address(this) > 0),\"error\")", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function transferAssetToNodeDelegator(\n uint256 ndcIndex,\n address asset,\n uint256 amount\n )\n external\n nonReentrant\n onlyLRTManager\n onlySupportedAsset(asset)\n {\n address nodeDelegator = nodeDelegatorQueue[ndcIndex];\n if (!IERC20(asset).transfer(nodeDelegator, amount)) {\n revert TokenTransferFailed();\n }\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "require(IERC20(asset).balanceOf(address(this) > 0),\"error\")", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5.26} {"source": "c4", "protocol": "03-asymmetry", "title": "ck Q", "severity_raw": "Low", "severity": "low", "description": "## Pausing functionality can be done with just one function\n\nThere are currently separate functions for pausing and unpausing\n\n```solidity\n function setPauseStaking(bool _pause) external onlyOwner {\n pauseStaking = _pause;\n emit StakingPaused(pauseStaking);\n }\n\n /**\n @notice - Owner only function that enables/disables the unstake function\n @param _pause - true disables unstaking / false enables unstaking\n */\n function setPauseUnstaking(bool _pause) external onlyOwner {\n pauseUnstaking = _pause;\n emit UnstakingPaused(pauseUnstaking);\n }\n```\n\nThis is unnecessary as one function is enough, the `stakingPaused` variable alone can be used to check were staking is paused or unpaused.\n\n\n## Validate minimum and maximum values when setting slippage\n\n```solidity\n function setMaxSlippage(uint256 _slippage) external onlyOwner {\n maxSlippage = _slippage;\n }\n```\n\nCurrently there are no restrictions on the amount of slippage that can be set. To prevent unintended effects, the input should be validated for acceptable minimum and maximum slippage.\n\n## Validate that `totalWeight` should never be 0\n\n```soldity\n function adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n ) external onlyOwner {\n weights[_derivativeIndex] = _weight;\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit WeightChange(_derivativeIndex, _weight);\n }\n```\n\nWhen the weights are being set or adjusted, it would be good practice to ensure the `totalWeight` isn't 0 in a scenario where either by malice or mistake, all weights are set to 0.\n\n## Validate that the `_contractAddress` of a derivative cannot be set to 0\n\n```solidity\n function addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = ID", "vulnerable_code": " function setPauseStaking(bool _pause) external onlyOwner {\n pauseStaking = _pause;\n emit StakingPaused(pauseStaking);\n }\n\n /**\n @notice - Owner only function that enables/disables the unstake function\n @param _pause - true disables unstaking / false enables unstaking\n */\n function setPauseUnstaking(bool _pause) external onlyOwner {\n pauseUnstaking = _pause;\n emit UnstakingPaused(pauseUnstaking);\n }", "fixed_code": " function setMaxSlippage(uint256 _slippage) external onlyOwner {\n maxSlippage = _slippage;\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/ck-Q.md", "collected_at": "2026-01-02T18:18:59.372737+00:00", "source_hash": "acb41e620367dae86190cf787d1843f3dfd33090bc450440279f7ce0768e715a", "code_block_count": 3, "solidity_block_count": 2, "total_code_chars": 948, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function setPauseStaking(bool _pause) external onlyOwner {\n pauseStaking = _pause;\n emit StakingPaused(pauseStaking);\n }\n\n /**\n @notice - Owner only function that enables/disables the unstake function\n @param _pause - true disables unstaking / false enables unstaking\n */\n function setPauseUnstaking(bool _pause) external onlyOwner {\n pauseUnstaking = _pause;\n emit UnstakingPaused(pauseUnstaking);\n }", "primary_code_language": "solidity", "primary_code_char_count": 458, "all_code_blocks": "// Code block 1 (solidity):\nfunction setPauseStaking(bool _pause) external onlyOwner {\n pauseStaking = _pause;\n emit StakingPaused(pauseStaking);\n }\n\n /**\n @notice - Owner only function that enables/disables the unstake function\n @param _pause - true disables unstaking / false enables unstaking\n */\n function setPauseUnstaking(bool _pause) external onlyOwner {\n pauseUnstaking = _pause;\n emit UnstakingPaused(pauseUnstaking);\n }\n\n// Code block 2 (solidity):\nfunction setMaxSlippage(uint256 _slippage) external onlyOwner {\n maxSlippage = _slippage;\n }\n\n// Code block 3 (soldity):\nfunction adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n ) external onlyOwner {\n weights[_derivativeIndex] = _weight;\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit WeightChange(_derivativeIndex, _weight);\n }", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function setPauseStaking(bool _pause) external onlyOwner {\n pauseStaking = _pause;\n emit StakingPaused(pauseStaking);\n }\n\n /**\n @notice - Owner only function that enables/disables the unstake function\n @param _pause - true disables unstaking / false enables unstaking\n */\n function setPauseUnstaking(bool _pause) external onlyOwner {\n pauseUnstaking = _pause;\n emit UnstakingPaused(pauseUnstaking);\n }\n\nfunction setMaxSlippage(uint256 _slippage) external onlyOwner {\n maxSlippage = _slippage;\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function setPauseStaking(bool _pause) external onlyOwner {\n pauseStaking = _pause;\n emit StakingPaused(pauseStaking);\n }\n\n /**\n @notice - Owner only function that enables/disables the unstake function\n @param _pause - true disables unstaking / false enables unstaking\n */\n function setPauseUnstaking(bool _pause) external onlyOwner {\n pauseUnstaking = _pause;\n emit UnstakingPaused(pauseUnstaking);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function setMaxSlippage(uint256 _slippage) external onlyOwner {\n maxSlippage = _slippage;\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "04-caviar", "title": "nemveer G", "severity_raw": "Gas", "severity": "gas", "description": "## 1. Can set the owner in the state itself instead of calling the external function every time\nThe current implementation of PrivatePool retrieves the owner by calling the Factory.ownerOf(address(PrivatePool))\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L127-L132\n```\n modifier onlyOwner() virtual {\n if (msg.sender != Factory(factory).ownerOf(uint160(address(this)))) {\n revert Unauthorized();\n }\n _;\n }\n```\nBut it can be set in initialization itself in the state of the contract which saves the extra gas cost of calling an external contract.\n\n## 2. Common memory variables created in each iteration can be set outside of the loop\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L329-L352\n```\n for (uint256 i = 0; i < tokenIds.length; i++) {\n // transfer each nft from the caller\n ERC721(nft).safeTransferFrom(msg.sender, address(this), tokenIds[i]);\n\n\n if (payRoyalties) {\n // calculate the sale price (assume it's the same for each NFT even if weights differ)\n uint256 salePrice = (netOutputAmount + feeAmount + protocolFeeAmount) / tokenIds.length;\n\n\n // get the royalty fee for the NFT\n (uint256 royaltyFee, address recipient) = _getRoyalty(tokenIds[i], salePrice);\n\n\n // tally the royalty fee amount\n royaltyFeeAmount += royaltyFee;\n\n\n // transfer the royalty fee to the recipient if it's greater than 0\n if (royaltyFee > 0 && recipient != address(0)) {\n if (baseToken != address(0)) {\n ERC20(baseToken).safeTransfer(recipient, royaltyFee);\n } else {\n recipient.safeTransferETH(royaltyFee);\n }\n }\n }\n }\n```\nHere `salePrice` is c", "vulnerable_code": " modifier onlyOwner() virtual {\n if (msg.sender != Factory(factory).ownerOf(uint160(address(this)))) {\n revert Unauthorized();\n }\n _;\n }", "fixed_code": " for (uint256 i = 0; i < tokenIds.length; i++) {\n // transfer each nft from the caller\n ERC721(nft).safeTransferFrom(msg.sender, address(this), tokenIds[i]);\n\n\n if (payRoyalties) {\n // calculate the sale price (assume it's the same for each NFT even if weights differ)\n uint256 salePrice = (netOutputAmount + feeAmount + protocolFeeAmount) / tokenIds.length;\n\n\n // get the royalty fee for the NFT\n (uint256 royaltyFee, address recipient) = _getRoyalty(tokenIds[i], salePrice);\n\n\n // tally the royalty fee amount\n royaltyFeeAmount += royaltyFee;\n\n\n // transfer the royalty fee to the recipient if it's greater than 0\n if (royaltyFee > 0 && recipient != address(0)) {\n if (baseToken != address(0)) {\n ERC20(baseToken).safeTransfer(recipient, royaltyFee);\n } else {\n recipient.safeTransferETH(royaltyFee);\n }\n }\n }\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/nemveer-G.md", "collected_at": "2026-01-02T18:20:44.423696+00:00", "source_hash": "acb610a97d70da8c01f02123a924284bfe9d13f67c6d5ef21e1c7150dd732806", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 1272, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "modifier onlyOwner() virtual {\n if (msg.sender != Factory(factory).ownerOf(uint160(address(this)))) {\n revert Unauthorized();\n }\n _;\n }", "primary_code_language": "unknown", "primary_code_char_count": 170, "all_code_blocks": "// Code block 1 (unknown):\nmodifier onlyOwner() virtual {\n if (msg.sender != Factory(factory).ownerOf(uint160(address(this)))) {\n revert Unauthorized();\n }\n _;\n }\n\n// Code block 2 (unknown):\nfor (uint256 i = 0; i < tokenIds.length; i++) {\n // transfer each nft from the caller\n ERC721(nft).safeTransferFrom(msg.sender, address(this), tokenIds[i]);\n\n\n if (payRoyalties) {\n // calculate the sale price (assume it's the same for each NFT even if weights differ)\n uint256 salePrice = (netOutputAmount + feeAmount + protocolFeeAmount) / tokenIds.length;\n\n\n // get the royalty fee for the NFT\n (uint256 royaltyFee, address recipient) = _getRoyalty(tokenIds[i], salePrice);\n\n\n // tally the royalty fee amount\n royaltyFeeAmount += royaltyFee;\n\n\n // transfer the royalty fee to the recipient if it's greater than 0\n if (royaltyFee > 0 && recipient != address(0)) {\n if (baseToken != address(0)) {\n ERC20(baseToken).safeTransfer(recipient, royaltyFee);\n } else {\n recipient.safeTransferETH(royaltyFee);\n }\n }\n }\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "PrivatePool.sol#L127-L132, PrivatePool.sol#L329-L352", "github_files_list": "PrivatePool.sol", "github_refs_count": 2, "vulnerable_code_actual": " modifier onlyOwner() virtual {\n if (msg.sender != Factory(factory).ownerOf(uint160(address(this)))) {\n revert Unauthorized();\n }\n _;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " for (uint256 i = 0; i < tokenIds.length; i++) {\n // transfer each nft from the caller\n ERC721(nft).safeTransferFrom(msg.sender, address(this), tokenIds[i]);\n\n\n if (payRoyalties) {\n // calculate the sale price (assume it's the same for each NFT even if weights differ)\n uint256 salePrice = (netOutputAmount + feeAmount + protocolFeeAmount) / tokenIds.length;\n\n\n // get the royalty fee for the NFT\n (uint256 royaltyFee, address recipient) = _getRoyalty(tokenIds[i], salePrice);\n\n\n // tally the royalty fee amount\n royaltyFeeAmount += royaltyFee;\n\n\n // transfer the royalty fee to the recipient if it's greater than 0\n if (royaltyFee > 0 && recipient != address(0)) {\n if (baseToken != address(0)) {\n ERC20(baseToken).safeTransfer(recipient, royaltyFee);\n } else {\n recipient.safeTransferETH(royaltyFee);\n }\n }\n }\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "03-asymmetry", "title": "EvanW G", "severity_raw": "Gas", "severity": "gas", "description": "[G-01] Merge the two for-loop as one in stake()\n\nIn SafEth.sol, the stake() method is running the same for-loop twice which is unecessary. Do all the things in 1 loop could save 132 gas.\n\n```solidity\ncontracts/SafEth/SafEth.sol\n71: for (uint i = 0; i < derivativeCount; i++)\n underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;\n\n84: for (uint i = 0; i < derivativeCount; i++) {\n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight == 0) continue;\n uint256 ethAmount = (msg.value * weight) / totalWeight;\n\n // This is slightly less than ethAmount because slippage\n uint256 depositAmount = derivative.deposit{value: ethAmount}();\n uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n depositAmount\n ) * depositAmount) / 10 ** 18;\n totalStakeValueEth += derivativeReceivedEthValue;\n }\n```\n\nRecommandation:\n\n```solidity\nfor (uint i = 0; i < derivativeCount; i++) {\n underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;\n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight != 0) {\n\t uint256 ethAmount = (msg.value * weight) / totalWeight;\n\t\n\t // This is slightly less than ethAmount because slippage\n\t uint256 depositAmount = derivative.deposit{value: ethAmount}();\n\t uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n\t depositAmount\n\t ) * depositAmount) / 10 ** 18;\n\t totalStakeValueEth += derivativeReceivedEthValue;\n\t\t\t\t\t\t};\n }\n```\n\n[G-02] zero value checking of \u201c_safEthAmount\u201d\n\nAdd a require statement for checkin", "vulnerable_code": "contracts/SafEth/SafEth.sol\n71: for (uint i = 0; i < derivativeCount; i++)\n underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;\n\n84: for (uint i = 0; i < derivativeCount; i++) {\n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight == 0) continue;\n uint256 ethAmount = (msg.value * weight) / totalWeight;\n\n // This is slightly less than ethAmount because slippage\n uint256 depositAmount = derivative.deposit{value: ethAmount}();\n uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n depositAmount\n ) * depositAmount) / 10 ** 18;\n totalStakeValueEth += derivativeReceivedEthValue;\n }", "fixed_code": "for (uint i = 0; i < derivativeCount; i++) {\n underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;\n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight != 0) {\n\t uint256 ethAmount = (msg.value * weight) / totalWeight;\n\t\n\t // This is slightly less than ethAmount because slippage\n\t uint256 depositAmount = derivative.deposit{value: ethAmount}();\n\t uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n\t depositAmount\n\t ) * depositAmount) / 10 ** 18;\n\t totalStakeValueEth += derivativeReceivedEthValue;\n\t\t\t\t\t\t};\n }", "recommendation": "", "category": "slippage", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/EvanW-G.md", "collected_at": "2026-01-02T18:18:04.271615+00:00", "source_hash": "acbdb361395ee82550493e55b0847d7668d53eec6354a2d059cd7a66c0a8bb4a", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 1677, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "contracts/SafEth/SafEth.sol\n71: for (uint i = 0; i < derivativeCount; i++)\n underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;\n\n84: for (uint i = 0; i < derivativeCount; i++) {\n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight == 0) continue;\n uint256 ethAmount = (msg.value * weight) / totalWeight;\n\n // This is slightly less than ethAmount because slippage\n uint256 depositAmount = derivative.deposit{value: ethAmount}();\n uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n depositAmount\n ) * depositAmount) / 10 ** 18;\n totalStakeValueEth += derivativeReceivedEthValue;\n }", "primary_code_language": "solidity", "primary_code_char_count": 874, "all_code_blocks": "// Code block 1 (solidity):\ncontracts/SafEth/SafEth.sol\n71: for (uint i = 0; i < derivativeCount; i++)\n underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;\n\n84: for (uint i = 0; i < derivativeCount; i++) {\n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight == 0) continue;\n uint256 ethAmount = (msg.value * weight) / totalWeight;\n\n // This is slightly less than ethAmount because slippage\n uint256 depositAmount = derivative.deposit{value: ethAmount}();\n uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n depositAmount\n ) * depositAmount) / 10 ** 18;\n totalStakeValueEth += derivativeReceivedEthValue;\n }\n\n// Code block 2 (solidity):\nfor (uint i = 0; i < derivativeCount; i++) {\n underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;\n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight != 0) {\n\t uint256 ethAmount = (msg.value * weight) / totalWeight;\n\t\n\t // This is slightly less than ethAmount because slippage\n\t uint256 depositAmount = derivative.deposit{value: ethAmount}();\n\t uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n\t depositAmount\n\t ) * depositAmount) / 10 ** 18;\n\t totalStakeValueEth += derivativeReceivedEthValue;\n\t\t\t\t\t\t};\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "contracts/SafEth/SafEth.sol\n71: for (uint i = 0; i < derivativeCount; i++)\n underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;\n\n84: for (uint i = 0; i < derivativeCount; i++) {\n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight == 0) continue;\n uint256 ethAmount = (msg.value * weight) / totalWeight;\n\n // This is slightly less than ethAmount because slippage\n uint256 depositAmount = derivative.deposit{value: ethAmount}();\n uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n depositAmount\n ) * depositAmount) / 10 ** 18;\n totalStakeValueEth += derivativeReceivedEthValue;\n }\n\nfor (uint i = 0; i < derivativeCount; i++) {\n underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;\n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight != 0) {\n\t uint256 ethAmount = (msg.value * weight) / totalWeight;\n\t\n\t // This is slightly less than ethAmount because slippage\n\t uint256 depositAmount = derivative.deposit{value: ethAmount}();\n\t uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n\t depositAmount\n\t ) * depositAmount) / 10 ** 18;\n\t totalStakeValueEth += derivativeReceivedEthValue;\n\t\t\t\t\t\t};\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "contracts/SafEth/SafEth.sol\n71: for (uint i = 0; i < derivativeCount; i++)\n underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;\n\n84: for (uint i = 0; i < derivativeCount; i++) {\n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight == 0) continue;\n uint256 ethAmount = (msg.value * weight) / totalWeight;\n\n // This is slightly less than ethAmount because slippage\n uint256 depositAmount = derivative.deposit{value: ethAmount}();\n uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n depositAmount\n ) * depositAmount) / 10 ** 18;\n totalStakeValueEth += derivativeReceivedEthValue;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "for (uint i = 0; i < derivativeCount; i++) {\n underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;\n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight != 0) {\n\t uint256 ethAmount = (msg.value * weight) / totalWeight;\n\t\n\t // This is slightly less than ethAmount because slippage\n\t uint256 depositAmount = derivative.deposit{value: ethAmount}();\n\t uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n\t depositAmount\n\t ) * depositAmount) / 10 ** 18;\n\t totalStakeValueEth += derivativeReceivedEthValue;\n\t\t\t\t\t\t};\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "05-ajna", "title": "DadeKuma Q", "severity_raw": "Critical", "severity": "critical", "description": "\n## Summary\n\n---\n\n### Low Risk Issues\n|Id|Title|Instances|\n|:--:|:-------|:--:|\n|[L-01]| Revert by undeflow when extraordinary proposals exceeds the maximum amount | 1 |\n|[L-02]| Wasteful/redundant operations when calculating the votes squared | 1 |\n|[L-03]| Anyone can `memorialize` other users' position if the owner approves `PositionManager` | 1 |\n\nTotal: 3 instances over 3 issues.\n\n### Non Critical Issues\n|Id|Title|Instances|\n|:--:|:-------|:--:|\n|[NC-01]| `newTopSlate_` condition can be simplified | 1 |\n\nTotal: 1 instances over 1 issues.\n\n## Low Risk Issues\n\n---\n\n### [L-01] Revert by undeflow when extraordinary proposals exceeds the maximum amount\n\n\nAdd a custom revert when proposals exceed the maximum, as it's possible to send only 9 proposals, to avoid an underflow error. Check if `_getMinimumThresholdPercentage() >= Maths.WAD`, and revert if that's the case.\n\n\n*There is 1 instance of this issue.*\n\n\n```solidity\nFile: ajna-grants/src/grants/base/ExtraordinaryFunding.sol\n\n105: \t\t if (uint256(totalTokensRequested) > _getSliceOfTreasury(Maths.WAD - _getMinimumThresholdPercentage())) revert InvalidProposal();\n\n```\n[ajna-grants/src/grants/base/ExtraordinaryFunding.sol#L105](https://github.com/code-423n4/2023-05-ajna/blob/a51de1f0119a8175a5656a2ff9d48bbbcb4436e7/ajna-grants/src/grants/base/ExtraordinaryFunding.sol#L105)\n\n\n---\n\n### [L-02] Wasteful/redundant operations when calculating the votes squared\n\n\nThe power of `n` with an exponent of 2 is always positive, regardless of `n` (it can be either positive or negative), so calculating the absolute value is wasteful (`Maths.abs`)\n\n\n*There is 1 instance of this issue.*\n\n\n```solidity\nFile: ajna-grants/src/grants/base/StandardFunding.sol\n\n849: \t\t votesCastSumSquared_ += Maths.wpow(SafeCast.toUint256(Maths.abs(votesCast_[i].votesUsed)), 2);\n\n```\n[ajna-grants/src/grants/base/StandardFunding.sol#L849](https://github.com/code-423n4/2023-05-ajna/blob/a51de1f0119a8175a5656a2ff9d48bbbcb4436e7/ajna-grants/src/gr", "vulnerable_code": "File: ajna-grants/src/grants/base/ExtraordinaryFunding.sol\n\n105: \t\t if (uint256(totalTokensRequested) > _getSliceOfTreasury(Maths.WAD - _getMinimumThresholdPercentage())) revert InvalidProposal();\n", "fixed_code": "File: ajna-grants/src/grants/base/StandardFunding.sol\n\n849: \t\t votesCastSumSquared_ += Maths.wpow(SafeCast.toUint256(Maths.abs(votesCast_[i].votesUsed)), 2);\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/DadeKuma-Q.md", "collected_at": "2026-01-02T18:20:57.964604+00:00", "source_hash": "ad3109cf1b3f617de75572bc8001dd04c7e66b579facfdee73439917aa3955ee", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 371, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: ajna-grants/src/grants/base/ExtraordinaryFunding.sol\n\n105: \t\t if (uint256(totalTokensRequested) > _getSliceOfTreasury(Maths.WAD - _getMinimumThresholdPercentage())) revert InvalidProposal();", "primary_code_language": "solidity", "primary_code_char_count": 203, "all_code_blocks": "// Code block 1 (solidity):\nFile: ajna-grants/src/grants/base/ExtraordinaryFunding.sol\n\n105: \t\t if (uint256(totalTokensRequested) > _getSliceOfTreasury(Maths.WAD - _getMinimumThresholdPercentage())) revert InvalidProposal();\n\n// Code block 2 (solidity):\nFile: ajna-grants/src/grants/base/StandardFunding.sol\n\n849: \t\t votesCastSumSquared_ += Maths.wpow(SafeCast.toUint256(Maths.abs(votesCast_[i].votesUsed)), 2);", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: ajna-grants/src/grants/base/ExtraordinaryFunding.sol\n\n105: \t\t if (uint256(totalTokensRequested) > _getSliceOfTreasury(Maths.WAD - _getMinimumThresholdPercentage())) revert InvalidProposal();\n\nFile: ajna-grants/src/grants/base/StandardFunding.sol\n\n849: \t\t votesCastSumSquared_ += Maths.wpow(SafeCast.toUint256(Maths.abs(votesCast_[i].votesUsed)), 2);", "github_refs_formatted": "ExtraordinaryFunding.sol#L105", "github_files_list": "ExtraordinaryFunding.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: ajna-grants/src/grants/base/ExtraordinaryFunding.sol\n\n105: \t\t if (uint256(totalTokensRequested) > _getSliceOfTreasury(Maths.WAD - _getMinimumThresholdPercentage())) revert InvalidProposal();\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: ajna-grants/src/grants/base/StandardFunding.sol\n\n849: \t\t votesCastSumSquared_ += Maths.wpow(SafeCast.toUint256(Maths.abs(votesCast_[i].votesUsed)), 2);\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-biconomy", "title": "Diana G", "severity_raw": "Medium", "severity": "medium", "description": "\n## G-01 Increments can be unchecked\n\nIn Solidity 0.8+, there\u2019s a default overflow check on unsigned integers. It\u2019s possible to uncheck this in for-loops and save some gas at each iteration, but at the cost of some code readability, as this uncheck cannot be made inline\n\nPrior to Solidity 0.8.0, arithmetic operations would always wrap in case of under- or overflow leading to widespread use of libraries that introduce additional checks.\n\nSince Solidity 0.8.0, all arithmetic operations revert on over- and underflow by default, thus making the use of these libraries unnecessary.\n\nTo obtain the previous behaviour, an unchecked block can be used. It saves **30-40 gas** per loop.\n\n_There are 5 instances of this issue_\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol\n\n```\nFile: contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol\n\n100: for (uint256 i = 0; i < opasLen; i++) {\n107: for (uint256 a = 0; a < opasLen; a++) {\n112: for (uint256 i = 0; i < opslen; i++) {\n128: for (uint256 a = 0; a < opasLen; a++) {\n134: for (uint256 i = 0; i < opslen; i++) {\n```\n\n---------------\n\n## G-02 x += y costs more gas than x = x + y for state variables (same applies for x -= y , x = x - y ; x \\*=y ; x /= y)\n\nUsing the addition operator instead of plus-equals saves\u00a0**[113 gas](https://gist.github.com/IllIllI000/cbbfb267425b898e5be734d4008d4fe8)**.\n\n_There are 40 instances of this issue_\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol\n\n```\nFile: contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol\n\n81: collected += _executeUserOp(i, ops[i], opInfos[i]);\n101: totalOps += opsPerAggregator[i].userOps.length;\n135:\u00a0collected += _executeUserOp(opIndex, ops[i], opInfos[opIndex]);\n468: actualGas += preGas - gasleft();\n```\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-walle", "vulnerable_code": "File: contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol\n\n100: for (uint256 i = 0; i < opasLen; i++) {\n107: for (uint256 a = 0; a < opasLen; a++) {\n112: for (uint256 i = 0; i < opslen; i++) {\n128: for (uint256 a = 0; a < opasLen; a++) {\n134: for (uint256 i = 0; i < opslen; i++) {", "fixed_code": "File: contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol\n\n81: collected += _executeUserOp(i, ops[i], opInfos[i]);\n101: totalOps += opsPerAggregator[i].userOps.length;\n135:\u00a0collected += _executeUserOp(opIndex, ops[i], opInfos[opIndex]);\n468: actualGas += preGas - gasleft();", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/Diana-G.md", "collected_at": "2026-01-02T18:13:02.651029+00:00", "source_hash": "ad4c1f304396a26b11ab09ac3b72e6a0408c3d741c3b52063f5423e9dfd97296", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 571, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol\n\n100: for (uint256 i = 0; i < opasLen; i++) {\n107: for (uint256 a = 0; a < opasLen; a++) {\n112: for (uint256 i = 0; i < opslen; i++) {\n128: for (uint256 a = 0; a < opasLen; a++) {\n134: for (uint256 i = 0; i < opslen; i++) {", "primary_code_language": "unknown", "primary_code_char_count": 289, "all_code_blocks": "// Code block 1 (unknown):\nFile: contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol\n\n100: for (uint256 i = 0; i < opasLen; i++) {\n107: for (uint256 a = 0; a < opasLen; a++) {\n112: for (uint256 i = 0; i < opslen; i++) {\n128: for (uint256 a = 0; a < opasLen; a++) {\n134: for (uint256 i = 0; i < opslen; i++) {\n\n// Code block 2 (unknown):\nFile: contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol\n\n81: collected += _executeUserOp(i, ops[i], opInfos[i]);\n101: totalOps += opsPerAggregator[i].userOps.length;\n135:\u00a0collected += _executeUserOp(opIndex, ops[i], opInfos[opIndex]);\n468: actualGas += preGas - gasleft();", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "EntryPoint.sol", "github_files_list": "EntryPoint.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol\n\n100: for (uint256 i = 0; i < opasLen; i++) {\n107: for (uint256 a = 0; a < opasLen; a++) {\n112: for (uint256 i = 0; i < opslen; i++) {\n128: for (uint256 a = 0; a < opasLen; a++) {\n134: for (uint256 i = 0; i < opslen; i++) {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol\n\n81: collected += _executeUserOp(i, ops[i], opInfos[i]);\n101: totalOps += opsPerAggregator[i].userOps.length;\n135:\u00a0collected += _executeUserOp(opIndex, ops[i], opInfos[opIndex]);\n468: actualGas += preGas - gasleft();", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-salty", "title": "hunter_w3b G", "severity_raw": "High", "severity": "high", "description": "## [G-01] Add unchecked{} for subtraction where the operands can't underflow becasue of previous IF-STATEMENT\n\n**Issue Description**\\\nThe subtraction operation `uint256 remainingSALT = claimedSALT - amountToSendToTeam;` does not have an unchecked block, even though underflow is not possible due to the previous check `if ( claimedSALT == 0 )` return. Adding an unchecked block helps avoid unnecessary checks.\n\n**Proposed Optimization**\\\nAdd an unchecked block around the subtraction:\n\n```solidity\nunchecked {\n uint256 remainingSALT = claimedSALT - amountToSendToTeam;\n}\n```\n\n**Estimated Gas Savings**\\\nAdding an unchecked block for a subtraction that cannot underflow due to a previous check saves approximately 3 gas per subtraction. With many such subtractions occurring across interactions, the total gas savings could be significant.\n\n**Attachments**\n\n- **Code Snippets**\n\n```solidity\nFile: src/dao/DAO.sol\n\n337\t\tif ( claimedSALT == 0 ) // @audit Because of this check can't overflow remainingSALT\n\n345\t\tuint256 remainingSALT = claimedSALT - amountToSendToTeam;\n```\n\nhttps://github.com/code-423n4/2024-01-salty/blob/main/src/dao/DAO.sol#L337\n\n```solidity\nFile: src/staking/Liquidity.sol\n\n110\t\tif ( addedAmountA < maxAmountA )\n111\t\t\ttokenA.safeTransfer( msg.sender, maxAmountA - addedAmountA );\n\n\n\n113\t\tif ( addedAmountB < maxAmountB )\n114\t\t\ttokenB.safeTransfer( msg.sender, maxAmountB - addedAmountB );\n```\n\nhttps://github.com/code-423n4/2024-01-salty/blob/main/src/staking/Liquidity.sol#L110\n\n```solidity\nFile: src/pools/PoolMath.sol\n\n161\t\tif ( maximumMSB > 80 )\n162\t\t\tshift = maximumMSB - 80;\n```\n\nhttps://github.com/code-423n4/2024-01-salty/blob/main/src/pools/PoolMath.sol#L161\n\n```solidity\nFile: src/price_feed/PriceAggregator.sol\n\n101\t\tif ( x > y )\n102\t\t\treturn x - y;\n103\n104\t\treturn y - x;\n105\t\t}\n```\n\nhttps://github.com/code-423n4/2024-01-salty/blob/main/src/price_feed/PriceAggregator.sol#L101\n\n```solidity\nFile: src/rewards/RewardsConfig.sol\n\n40 if (rewardsEmitterDaily", "vulnerable_code": "unchecked {\n uint256 remainingSALT = claimedSALT - amountToSendToTeam;\n}", "fixed_code": "File: src/dao/DAO.sol\n\n337\t\tif ( claimedSALT == 0 ) // @audit Because of this check can't overflow remainingSALT\n\n345\t\tuint256 remainingSALT = claimedSALT - amountToSendToTeam;", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/hunter_w3b-G.md", "collected_at": "2026-01-02T19:01:43.554576+00:00", "source_hash": "ad5d8318f24eaa9e9eb7f73951ed72d6476c23290a453e3999b0b5c17c8a909a", "code_block_count": 5, "solidity_block_count": 5, "total_code_chars": 696, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "unchecked {\n uint256 remainingSALT = claimedSALT - amountToSendToTeam;\n}", "primary_code_language": "solidity", "primary_code_char_count": 73, "all_code_blocks": "// Code block 1 (solidity):\nunchecked {\n uint256 remainingSALT = claimedSALT - amountToSendToTeam;\n}\n\n// Code block 2 (solidity):\nFile: src/dao/DAO.sol\n\n337\t\tif ( claimedSALT == 0 ) // @audit Because of this check can't overflow remainingSALT\n\n345\t\tuint256 remainingSALT = claimedSALT - amountToSendToTeam;\n\n// Code block 3 (solidity):\nFile: src/staking/Liquidity.sol\n\n110\t\tif ( addedAmountA < maxAmountA )\n111\t\t\ttokenA.safeTransfer( msg.sender, maxAmountA - addedAmountA );\n\n\n\n113\t\tif ( addedAmountB < maxAmountB )\n114\t\t\ttokenB.safeTransfer( msg.sender, maxAmountB - addedAmountB );\n\n// Code block 4 (solidity):\nFile: src/pools/PoolMath.sol\n\n161\t\tif ( maximumMSB > 80 )\n162\t\t\tshift = maximumMSB - 80;\n\n// Code block 5 (solidity):\nFile: src/price_feed/PriceAggregator.sol\n\n101\t\tif ( x > y )\n102\t\t\treturn x - y;\n103\n104\t\treturn y - x;\n105\t\t}", "all_code_blocks_count": 5, "has_diff_blocks": false, "diff_code": "", "solidity_code": "unchecked {\n uint256 remainingSALT = claimedSALT - amountToSendToTeam;\n}\n\nFile: src/dao/DAO.sol\n\n337\t\tif ( claimedSALT == 0 ) // @audit Because of this check can't overflow remainingSALT\n\n345\t\tuint256 remainingSALT = claimedSALT - amountToSendToTeam;\n\nFile: src/staking/Liquidity.sol\n\n110\t\tif ( addedAmountA < maxAmountA )\n111\t\t\ttokenA.safeTransfer( msg.sender, maxAmountA - addedAmountA );\n\n\n\n113\t\tif ( addedAmountB < maxAmountB )\n114\t\t\ttokenB.safeTransfer( msg.sender, maxAmountB - addedAmountB );\n\nFile: src/pools/PoolMath.sol\n\n161\t\tif ( maximumMSB > 80 )\n162\t\t\tshift = maximumMSB - 80;\n\nFile: src/price_feed/PriceAggregator.sol\n\n101\t\tif ( x > y )\n102\t\t\treturn x - y;\n103\n104\t\treturn y - x;\n105\t\t}", "github_refs_formatted": "DAO.sol#L337, Liquidity.sol#L110, PoolMath.sol#L161, PriceAggregator.sol#L101", "github_files_list": "PoolMath.sol, Liquidity.sol, PriceAggregator.sol, DAO.sol", "github_refs_count": 4, "vulnerable_code_actual": "unchecked {\n uint256 remainingSALT = claimedSALT - amountToSendToTeam;\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: src/dao/DAO.sol\n\n337\t\tif ( claimedSALT == 0 ) // @audit Because of this check can't overflow remainingSALT\n\n345\t\tuint256 remainingSALT = claimedSALT - amountToSendToTeam;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 11} {"source": "c4", "protocol": "10-badger", "title": "Shahen Q", "severity_raw": "Critical", "severity": "critical", "description": "## Make only the _borrower or _positionManager to call the `permitPositionManagerApproval()` function.\n\n- So in the `permitPositionManagerApproval()` function, It's to grant approval for a positionManager, Suppose the (_borrower,_positionManager) calls the `permitPositionManagerApproval()` function with the parameters, Anyone who watches the mempool could frontrun the function call, Ofcourse this is not a medium or any critical issue but when someone else frontruns the function call, the nonce will be incremented and when the actual (_borrower,_positionManager) call gets processed it'll return him the error `\"BorrowerOperations: Invalid signature\"`. I mean he might not know the approval was granted to the positionManager already because of the frontrun call. As i have mentioned this is not a big issue but its better to have a require in the function that only the _borrower or _positionManager address can call so no one else will be able to mess as said above.\n\n```\nrequire(msg.sender == _borrower); // or _positionManager\n```\n\nhttps://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/BorrowerOperations.sol#L706", "vulnerable_code": "require(msg.sender == _borrower); // or _positionManager", "fixed_code": "", "recommendation": "", "category": "front-running", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/Shahen-Q.md", "collected_at": "2026-01-02T18:26:37.889650+00:00", "source_hash": "ad6033b9c8e9c857b4c646584adeb995f56c71a1d530d0320a64e982eeedfe7c", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 56, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "require(msg.sender == _borrower); // or _positionManager", "primary_code_language": "unknown", "primary_code_char_count": 56, "all_code_blocks": "// Code block 1 (unknown):\nrequire(msg.sender == _borrower); // or _positionManager", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "BorrowerOperations.sol#L706", "github_files_list": "BorrowerOperations.sol", "github_refs_count": 1, "vulnerable_code_actual": "require(msg.sender == _borrower); // or _positionManager", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5.38} {"source": "c4", "protocol": "03-revert-lend", "title": "popeye Analysis", "severity_raw": "Critical", "severity": "critical", "description": "| Serial No. | Topic |\n|------------|--------------------------------------------------|\n| 01 | Overview of Revert Lend |\n| 02 | Scope |\n| 03 | Architecture view (Sequence Diagram) |\n| 04 | Protocol Roles |\n| 05 | Approach Taken in auditing Revert Lend |\n| 06 | Contract Analysis |\n| 07 | Codebase Quality (Table) |\n| 08 | Centralization Risks |\n| 09 | Systematic Risks |\n| 10 | Architectural Improvement |\n| 11 | Time spent |\n\n\n\n# Overview of Revert Lend\nRevert Lend is a decentralized lending protocol designed specifically for Automated Market Maker (AMM) Liquidity Providers (LPs) on Uniswap v3. The protocol allows LPs to collateralize their Uniswap v3 LP positions, represented as NFTs, and obtain loans in a specified ERC-20 token. The key feature of Revert Lend is that it enables LPs to maintain control over their capital in the Uniswap v3 pools while simultaneously using their positions as collateral for loans.\n\n`Collateralization of Uniswap v3 LP Positions:` LPs can deposit their Uniswap v3 LP position NFTs into the protocol's Collateralized Debt Position (CDP) vaults. Each LP position is treated as a separate collateral, allowing for granular risk management and loan accounting.\n\n`Borrowing and Loan Management:` LPs can borrow tokens from the lending pool by collateralizing their LP positions. Loans are subject to a minimum collateral ratio, determined by the collateral factors of the underlying tokens in the LP position. Interest rates for loans are dynamically adjusted based on the supply and demand within the lending pool.\n\n`Flexi", "vulnerable_code": "# Protocol Roles:\n\nRevert Lend protocol involves several key roles/actors, each with specific responsibilities and interactions within the system.\n\n**Liquidity Providers (LPs):**\n - LPs are Uniswap v3 liquidity providers who supply liquidity to Uniswap v3 pools and receive LP position NFTs in return.\n - In the context of Revert Lend, LPs can collateralize their LP position NFTs to borrow tokens from the lending pool.\n - LPs retain control over their collateralized positions and can manage them by adjusting liquidity, collecting fees, or changing the position's price range.\n ```solidity\n // LP deposits LP position NFT into the CDP vault\n function create(uint256 tokenId, address recipient) external {\n nonfungiblePositionManager.safeTransferFrom(msg.sender, address(this), tokenId, abi.encode(recipient));\n }\n ```\n\n**Borrowers:**\n - Borrowers are users who borrow tokens from the Revert Lend lending pool by collateralizing their LP position NFTs.\n - They are subject to maintaining a minimum collateral ratio based on the collateral factors of the underlying tokens in their LP positions.\n - Borrowers can borrow up to a certain percentage of their collateral value and are obligated to repay the borrowed amount along with accrued interest.\n ```solidity\n // Borrower borrows tokens against the collateralized position\n function borrow(uint256 tokenId, uint256 amount) external {\n require(positionOwner[tokenId] == msg.sender, \"Not position owner\");\n require(isPositionHealthy(tokenId, amount), \"Insufficient collateral\");\n \n loanAmount[tokenId] += amount;\n IERC20(borrowToken).safeTransfer(msg.sender, amount);\n }\n ```\n\n**Lenders:**\n - Lenders are users who supply tokens to the Revert Lend lending pool to earn interest.\n - They receive rTokens (e.g., rUSDC) in exchange for their supplied assets, representing their share of the lending pool.\n - Lenders can redeem their rTokens to w", "fixed_code": "**Key function's functionality:**\n\na. `create(uint256 tokenId, address recipient)`:\nThis function creates a new collateralized position by transferring an approved Uniswap V3 LP position (NFT) to the vault. The `tokenId` represents the LP position, and the `recipient` is the address that will receive the position in the vault. The function adds the token to the owner's list of owned tokens and initializes a new loan with zero debt shares.", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/popeye-Analysis.md", "collected_at": "2026-01-02T19:03:15.905648+00:00", "source_hash": "ae666b296eb25b6e8c99061fa842bc973deeefd580c28a88c882aa0f8ecf7020", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "# Protocol Roles:\n\nRevert Lend protocol involves several key roles/actors, each with specific responsibilities and interactions within the system.\n\n**Liquidity Providers (LPs):**\n - LPs are Uniswap v3 liquidity providers who supply liquidity to Uniswap v3 pools and receive LP position NFTs in return.\n - In the context of Revert Lend, LPs can collateralize their LP position NFTs to borrow tokens from the lending pool.\n - LPs retain control over their collateralized positions and can manage them by adjusting liquidity, collecting fees, or changing the position's price range.\n ```solidity\n // LP deposits LP position NFT into the CDP vault\n function create(uint256 tokenId, address recipient) external {\n nonfungiblePositionManager.safeTransferFrom(msg.sender, address(this), tokenId, abi.encode(recipient));\n }\n ```\n\n**Borrowers:**\n - Borrowers are users who borrow tokens from the Revert Lend lending pool by collateralizing their LP position NFTs.\n - They are subject to maintaining a minimum collateral ratio based on the collateral factors of the underlying tokens in their LP positions.\n - Borrowers can borrow up to a certain percentage of their collateral value and are obligated to repay the borrowed amount along with accrued interest.\n ```solidity\n // Borrower borrows tokens against the collateralized position\n function borrow(uint256 tokenId, uint256 amount) external {\n require(positionOwner[tokenId] == msg.sender, \"Not position owner\");\n require(isPositionHealthy(tokenId, amount), \"Insufficient collateral\");\n \n loanAmount[tokenId] += amount;\n IERC20(borrowToken).safeTransfer(msg.sender, amount);\n }\n ```\n\n**Lenders:**\n - Lenders are users who supply tokens to the Revert Lend lending pool to earn interest.\n - They receive rTokens (e.g., rUSDC) in exchange for their supplied assets, representing their share of the lending pool.\n - Lenders can redeem their rTokens to w", "has_vulnerable_code_snippet": true, "fixed_code_actual": "**Key function's functionality:**\n\na. `create(uint256 tokenId, address recipient)`:\nThis function creates a new collateralized position by transferring an approved Uniswap V3 LP position (NFT) to the vault. The `tokenId` represents the LP position, and the `recipient` is the address that will receive the position in the vault. The function adds the token to the owner's list of owned tokens and initializes a new loan with zero debt shares.", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-asymmetry", "title": "8olidity Q", "severity_raw": "Low", "severity": "low", "description": "## The maxSlippage should be limited\n\nThe administrator can set the value of `maxSlippage` through the `setMaxSlippage()` function, but there is no validation here. If `maxSlippage` is greater than `10 ** 18`, it will cause an overflow and make it impossible to `withdraw()`. This problem exists in several contracts.\n\n```\nuint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n\n```\n\n```\ncontracts/SafEth/derivatives/Reth.sol:\n 57 */\n 58: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n 59 maxSlippage = _slippage;\n\ncontracts/SafEth/derivatives/SfrxEth.sol:\n 50 */\n 51: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n 52 maxSlippage = _slippage;\n\ncontracts/SafEth/derivatives/WstEth.sol:\n 47 */\n 48: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n 49 maxSlippage = _slippage;\n\n```\n\nSuggestion\n\n```\nfunction setMaxSlippage(uint256 _slippage) external onlyOwner {\n require(_slippage <= 10 ** 18);\n maxSlippage = _slippage;\n}\n\n```\n\n## Code and comments do not match\n\nIn the `safeETH::adjustWeight()` function, the function should update the value corresponding to `_derivativeIndex` in the weights array and calculate the new `totalWeight` value.\n\nHowever, the comment for the function is\n\n```\n/**\n @notice - Adds new derivative to the index fund\n\t.....\n*/\n\n```\n\nThis comment is the same as the comment in the `addDerivative()` function.\n\nSuggestion\n\nRevise the comment.", "vulnerable_code": "uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n", "fixed_code": "contracts/SafEth/derivatives/Reth.sol:\n 57 */\n 58: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n 59 maxSlippage = _slippage;\n\ncontracts/SafEth/derivatives/SfrxEth.sol:\n 50 */\n 51: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n 52 maxSlippage = _slippage;\n\ncontracts/SafEth/derivatives/WstEth.sol:\n 47 */\n 48: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n 49 maxSlippage = _slippage;\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/8olidity-Q.md", "collected_at": "2026-01-02T18:17:48.570668+00:00", "source_hash": "aecc2fb1bd94cfb216a592d1f75103aca6ba2d419c1a75d3f948b47b199373c8", "code_block_count": 4, "solidity_block_count": 0, "total_code_chars": 760, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;", "primary_code_language": "unknown", "primary_code_char_count": 66, "all_code_blocks": "// Code block 1 (unknown):\nuint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n\n// Code block 2 (unknown):\ncontracts/SafEth/derivatives/Reth.sol:\n 57 */\n 58: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n 59 maxSlippage = _slippage;\n\ncontracts/SafEth/derivatives/SfrxEth.sol:\n 50 */\n 51: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n 52 maxSlippage = _slippage;\n\ncontracts/SafEth/derivatives/WstEth.sol:\n 47 */\n 48: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n 49 maxSlippage = _slippage;\n\n// Code block 3 (unknown):\nfunction setMaxSlippage(uint256 _slippage) external onlyOwner {\n require(_slippage <= 10 ** 18);\n maxSlippage = _slippage;\n}\n\n// Code block 4 (unknown):\n/**\n @notice - Adds new derivative to the index fund\n\t.....\n*/", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "uint256 minOut = (stEthBal * (10 ** 18 - maxSlippage)) / 10 ** 18;\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "contracts/SafEth/derivatives/Reth.sol:\n 57 */\n 58: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n 59 maxSlippage = _slippage;\n\ncontracts/SafEth/derivatives/SfrxEth.sol:\n 50 */\n 51: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n 52 maxSlippage = _slippage;\n\ncontracts/SafEth/derivatives/WstEth.sol:\n 47 */\n 48: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n 49 maxSlippage = _slippage;\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "11-kelp", "title": "supersizer0x Q", "severity_raw": "High", "severity": "high", "description": "###### An attacker can grief users with large amounts of funds \nAn attacker can grief hard by depositing funds before a call is made making the \nexample:\nprice = 100 eth = 50 rseth \nattacker deposits 25 eth \nprice =100 eth = 35 rseth \nThere is no slippage check so it can harm users.\n```solidity\n rsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();\n```\n###### If there are some delegators that are not contracts it will revert \nThe sponsor says that there will be delegators to transfer the funds to the strategy.\nIf an admin adds an eoa to the [delegators array](https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTDepositPool.sol#L81C5-L84C101) it will revert\n```solidity\n uint256 ndcsCount = nodeDelegatorQueue.length;\n for (uint256 i; i < ndcsCount;) {\n assetLyingInNDCs += IERC20(asset).balanceOf(nodeDelegatorQueue[i]);\n assetStakedInEigenLayer += INodeDelegator(nodeDelegatorQueue[i]).getAssetBalance(asset);\n```\n###### Their can be an issue with a user transferring x token but getting the price for x,y,b tokens \nSince the rsETh price is computed using all the supported assets, if some of them are overpriced or underpriced it will affect how many eth are in the contract which can cause txs to fail when the price rises or when it lowers more funds can be deposited.\n###### comment is wrong the function is called by Admin not the [manager](https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTDepositPool.sol#L160)\n```solidity\n/// @notice add new node delegator contract addresses/// @dev only callable by LRT manager/// @param nodeDelegatorContracts Array of NodeDelegator contract addresses function addNodeDelegatorContractToQueue(address[] calldata nodeDelegatorContracts) external onlyLRTAdmin {\n```\n###### Their is no check for the heartbeat of the oracle which can return stale prices \nMost of the supported tokens, upda", "vulnerable_code": " rsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();", "fixed_code": " uint256 ndcsCount = nodeDelegatorQueue.length;\n for (uint256 i; i < ndcsCount;) {\n assetLyingInNDCs += IERC20(asset).balanceOf(nodeDelegatorQueue[i]);\n assetStakedInEigenLayer += INodeDelegator(nodeDelegatorQueue[i]).getAssetBalance(asset);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/supersizer0x-Q.md", "collected_at": "2026-01-02T18:28:29.806304+00:00", "source_hash": "aeec760f5a6cc101c989264cb9e698cdc5731791455e0b1f5f088bde238baa49", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 632, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "rsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();", "primary_code_language": "solidity", "primary_code_char_count": 90, "all_code_blocks": "// Code block 1 (solidity):\nrsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();\n\n// Code block 2 (solidity):\nuint256 ndcsCount = nodeDelegatorQueue.length;\n for (uint256 i; i < ndcsCount;) {\n assetLyingInNDCs += IERC20(asset).balanceOf(nodeDelegatorQueue[i]);\n assetStakedInEigenLayer += INodeDelegator(nodeDelegatorQueue[i]).getAssetBalance(asset);\n\n// Code block 3 (solidity):\n/// @notice add new node delegator contract addresses/// @dev only callable by LRT manager/// @param nodeDelegatorContracts Array of NodeDelegator contract addresses function addNodeDelegatorContractToQueue(address[] calldata nodeDelegatorContracts) external onlyLRTAdmin {", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "rsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();\n\nuint256 ndcsCount = nodeDelegatorQueue.length;\n for (uint256 i; i < ndcsCount;) {\n assetLyingInNDCs += IERC20(asset).balanceOf(nodeDelegatorQueue[i]);\n assetStakedInEigenLayer += INodeDelegator(nodeDelegatorQueue[i]).getAssetBalance(asset);\n\n/// @notice add new node delegator contract addresses/// @dev only callable by LRT manager/// @param nodeDelegatorContracts Array of NodeDelegator contract addresses function addNodeDelegatorContractToQueue(address[] calldata nodeDelegatorContracts) external onlyLRTAdmin {", "github_refs_formatted": "LRTDepositPool.sol#L81-L5, LRTDepositPool.sol#L160", "github_files_list": "LRTDepositPool.sol", "github_refs_count": 2, "vulnerable_code_actual": " rsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();", "has_vulnerable_code_snippet": true, "fixed_code_actual": " uint256 ndcsCount = nodeDelegatorQueue.length;\n for (uint256 i; i < ndcsCount;) {\n assetLyingInNDCs += IERC20(asset).balanceOf(nodeDelegatorQueue[i]);\n assetStakedInEigenLayer += INodeDelegator(nodeDelegatorQueue[i]).getAssetBalance(asset);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "02-ethos", "title": "Kaysoft Q", "severity_raw": "Critical", "severity": "critical", "description": "## [L-01] REMOVE UNSED IMPORT `./Dependencies/console.sol` in `BorrowerOperations.sol`\nconsole.sol is imported in `BorrowerOperations.sol` and it is not used.\nFile:\n- [Ethos-Core/contracts/BorrowerOperations.sol#L15](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/BorrowerOperations.sol#L15)\n\n#### Recommended Mitigation Steps\nConsider removing unused import of console.sol in `BorrowerOperations.sol`\n\n## [L-02] UNUSED VARIABLES.\nRemove all unused variables.\nFiles: \n- [Ethos-Core/contracts/StabilityPool.sol#L384](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/StabilityPool.sol#L384)\n- [Ethos-Core/contracts/StabilityPool.sol#L339](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/StabilityPool.sol#L339)\n\n## [L-03] USE LATEST COMPILER STABLE VERSION\nThe EThos-Core project uses the Solidity version 0.6.11 while the Ethos-Vault version uses the version 0.80. It is best practice to use the latest Solidity stable version as there will have been some security bug fixes and updates.\nsee: https://swcregistry.io/docs/SWC-102\n\nFiles: All files\n\n#### Recommended Mitigation Step\nConsider using latest Solidity stable compiler version 0.8.17 for all the contracts.\n\n## [L-04] AVOID FLOATING PRAGMA\nConsider locking compiler versions by using `pragma solidity 0.8.17;` instead of `pragma solidity ^0.8.0;` in order not to deploy the contract with a different compiler version that is used to test the contract thereby introducing compiler bugs.\nsee: https://swcregistry.io/docs/SWC-103\nFiles: \nAll files in the Ethos-Vault project\n\n#### Recommended Mitigation Steps\nConsider locking the pragma version by replacing `pragma solidity ^0.8.0;` with `pragma solidity 0.8.17;`\n\n## [L-05] ENABLING SOLIDITY COMPILER OPTIMIZATION CAN BE BUGGY\nThe compiler optimization is enabled in the project since it is set to true.", "vulnerable_code": "/** @type import('hardhat/config').HardhatUserConfig */\nmodule.exports = {\n solidity: {\n compilers: [\n {\n version: \"0.8.11\",\n settings: {\n optimizer: {\n enabled: true,\n runs: 200,\n },\n },\n },\n ],\n },\n", "fixed_code": " /**\n * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual override onlyOwner {\n _pendingOwner = newOwner;\n emit OwnershipTransferStarted(owner(), newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual override {\n delete _pendingOwner;\n super._transferOwnership(newOwner);\n }\n\n /**\n * @dev The new owner accepts the ownership transfer.\n */\n function acceptOwnership() public virtual {\n address sender = _msgSender();\n require(pendingOwner() == sender, \"Ownable2Step: caller is not the new owner\");\n _transferOwnership(sender);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/Kaysoft-Q.md", "collected_at": "2026-01-02T18:16:18.451952+00:00", "source_hash": "aeecf776c3f89ed30c8a0cd4b6ffc0b7046147e63605e0e2c8457c31fb293be8", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "BorrowerOperations.sol#L15, StabilityPool.sol#L384, StabilityPool.sol#L339", "github_files_list": "BorrowerOperations.sol, StabilityPool.sol", "github_refs_count": 3, "vulnerable_code_actual": "/** @type import('hardhat/config').HardhatUserConfig */\nmodule.exports = {\n solidity: {\n compilers: [\n {\n version: \"0.8.11\",\n settings: {\n optimizer: {\n enabled: true,\n runs: 200,\n },\n },\n },\n ],\n },\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": " /**\n * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual override onlyOwner {\n _pendingOwner = newOwner;\n emit OwnershipTransferStarted(owner(), newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual override {\n delete _pendingOwner;\n super._transferOwnership(newOwner);\n }\n\n /**\n * @dev The new owner accepts the ownership transfer.\n */\n function acceptOwnership() public virtual {\n address sender = _msgSender();\n require(pendingOwner() == sender, \"Ownable2Step: caller is not the new owner\");\n _transferOwnership(sender);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "04-caviar", "title": "RaymondFam G", "severity_raw": "High", "severity": "high", "description": "## Combining for loops in `buy()` of PrivatePool\nLike it has been implemented in [`sell()`](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L328-L351), consider combining the two [for loops](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L242) involving [`if (payRoyalties)`](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L271) in [`buy()`](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L211-L289) to save gas both on function calls and contract size. \n\n## Identical arithmetic operation can be cached\nIn PrivatePool, the two identical arithmetic operations of `buy()` can be cached into a local variable to save gas on function call as follows:\n\n[File: PrivatePool.sol#L229-L237](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L229-L237)\n\n```diff\n+ trimmedNetInputAmount = netInputAmount - feeAmount - protocolFeeAmount;\n\n // update the virtual reserves\n- virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n+ virtualBaseTokenReserves += uint128(trimmedNetInputAmount);\n virtualNftReserves -= uint128(weightSum);\n\n // ~~~ Interactions ~~~ //\n\n // calculate the sale price (assume it's the same for each NFT even if weights differ)\n- uint256 salePrice = (netInputAmount - feeAmount - protocolFeeAmount) / tokenIds.length;\n+ uint256 salePrice = trimmedNetInputAmount / tokenIds.length;\n uint256 royaltyFeeAmount = 0; \n```\n## Unneeded `flashFeeToken()`\n`baseToken` is already evidently used in [line 635](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L635) and [line 651](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L651) of `flashLoan()`. Additionally, `baseToken` comes with a free [public getter](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L82). Hence, consider r", "vulnerable_code": "## Unneeded `flashFeeToken()`\n`baseToken` is already evidently used in [line 635](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L635) and [line 651](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L651) of `flashLoan()`. Additionally, `baseToken` comes with a free [public getter](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L82). Hence, consider removing the unneeded [`flashFeeToken()`](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L754-L757) to reduce the contract size. \n\n## Use of named returns for local variables saves gas\nYou can have further advantages in term of gas cost by simply using named return values as temporary local variable.\n\nFor instance, the code block below may be refactored as follows:\n\n[File: PrivatePool.sol#L742-L746](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L742-L746)\n", "fixed_code": "## += and -= cost more gas\n`+=` and `-=` generally cost 22 more gas than writing out the assigned equation explicitly. The amount of gas wasted can be quite sizable when repeatedly operated in a loop.\n\nFor example, the `+=` instance below may be refactored as follows:\n\n[File: PrivatePool.sol#L247](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L247)\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/RaymondFam-G.md", "collected_at": "2026-01-02T18:20:00.392098+00:00", "source_hash": "aef0b9e2c584ccf46e4827a25bed50be584bb925cd0283e782c5a164a047ac1b", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 670, "github_ref_count": 11, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "+ trimmedNetInputAmount = netInputAmount - feeAmount - protocolFeeAmount;\n\n // update the virtual reserves\n- virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n+ virtualBaseTokenReserves += uint128(trimmedNetInputAmount);\n virtualNftReserves -= uint128(weightSum);\n\n // ~~~ Interactions ~~~ //\n\n // calculate the sale price (assume it's the same for each NFT even if weights differ)\n- uint256 salePrice = (netInputAmount - feeAmount - protocolFeeAmount) / tokenIds.length;\n+ uint256 salePrice = trimmedNetInputAmount / tokenIds.length;\n uint256 royaltyFeeAmount = 0;", "primary_code_language": "diff", "primary_code_char_count": 670, "all_code_blocks": "// Code block 1 (diff):\n+ trimmedNetInputAmount = netInputAmount - feeAmount - protocolFeeAmount;\n\n // update the virtual reserves\n- virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n+ virtualBaseTokenReserves += uint128(trimmedNetInputAmount);\n virtualNftReserves -= uint128(weightSum);\n\n // ~~~ Interactions ~~~ //\n\n // calculate the sale price (assume it's the same for each NFT even if weights differ)\n- uint256 salePrice = (netInputAmount - feeAmount - protocolFeeAmount) / tokenIds.length;\n+ uint256 salePrice = trimmedNetInputAmount / tokenIds.length;\n uint256 royaltyFeeAmount = 0;", "all_code_blocks_count": 1, "has_diff_blocks": true, "diff_code": "+ trimmedNetInputAmount = netInputAmount - feeAmount - protocolFeeAmount;\n\n // update the virtual reserves\n- virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n+ virtualBaseTokenReserves += uint128(trimmedNetInputAmount);\n virtualNftReserves -= uint128(weightSum);\n\n // ~~~ Interactions ~~~ //\n\n // calculate the sale price (assume it's the same for each NFT even if weights differ)\n- uint256 salePrice = (netInputAmount - feeAmount - protocolFeeAmount) / tokenIds.length;\n+ uint256 salePrice = trimmedNetInputAmount / tokenIds.length;\n uint256 royaltyFeeAmount = 0;", "solidity_code": "", "github_refs_formatted": "PrivatePool.sol#L328-L351, PrivatePool.sol#L242, PrivatePool.sol#L271, PrivatePool.sol#L211-L289, PrivatePool.sol#L229-L237, PrivatePool.sol#L635, PrivatePool.sol#L651, PrivatePool.sol#L82, PrivatePool.sol#L754-L757, PrivatePool.sol#L742-L746, PrivatePool.sol#L247", "github_files_list": "PrivatePool.sol", "github_refs_count": 11, "vulnerable_code_actual": "## Unneeded `flashFeeToken()`\n`baseToken` is already evidently used in [line 635](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L635) and [line 651](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L651) of `flashLoan()`. Additionally, `baseToken` comes with a free [public getter](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L82). Hence, consider removing the unneeded [`flashFeeToken()`](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L754-L757) to reduce the contract size. \n\n## Use of named returns for local variables saves gas\nYou can have further advantages in term of gas cost by simply using named return values as temporary local variable.\n\nFor instance, the code block below may be refactored as follows:\n\n[File: PrivatePool.sol#L742-L746](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L742-L746)\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## += and -= cost more gas\n`+=` and `-=` generally cost 22 more gas than writing out the assigned equation explicitly. The amount of gas wasted can be quite sizable when repeatedly operated in a loop.\n\nFor example, the `+=` instance below may be refactored as follows:\n\n[File: PrivatePool.sol#L247](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L247)\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "09-ondo", "title": "castle_chain G", "severity_raw": "Low", "severity": "low", "description": "# Gas optimization report \n# DestinationBridge \n\n## 1) unnecessary check inside the for loop that waste gas can be optimized . \nthe function `setThresholds()` uses for loop to assign the thresholds to the amounts , the for loop always check \n```\n for (uint256 i = 0; i < amounts.length; ++i) {\n if (i == 0) {\n chainToThresholds[srcChain].push(\n Threshold(amounts[i], numOfApprovers[i])\n );\n }\n```\n, and this condition will be true only once in the loop , so it can be executed outside of the loop to avoid unnecessary check and save much gas . \n**the optimized code should be**\n```diff\n function setThresholds(\n string calldata srcChain,\n uint256[] calldata amounts,\n uint256[] calldata numOfApprovers\n ) external onlyOwner {\n if (amounts.length != numOfApprovers.length) {\n revert ArrayLengthMismatch();\n }\n delete chainToThresholds[srcChain];\n\n- for (uint256 i = 0; i < amounts.length; ++i) {\n- if (i == 0) {\n- chainToThresholds[srcChain].push(\n- Threshold(amounts[i], numOfApprovers[i])\n- );\n- } else {\n+ chainToThresholds[srcChain].push(\n+ Threshold(amounts[0], numOfApprovers[0])\n+ );\n+ for (uint256 i = 1; i < amounts.length; ++i) {\n if (chainToThresholds[srcChain][i - 1].amount > amounts[i]) {\n revert ThresholdsNotInAscendingOrder();\n }\n chainToThresholds[srcChain].push(\n Threshold(amounts[i], numOfApprovers[i])\n );\n }\n }\n emit ThresholdSet(srcChain, amounts, numOfApprovers);\n }\n\n```\n**code snippet**\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/bridge/DestinationBridge.sol#L255-L279\n\n\n## 2) read from the storage and make a copy of the struct to the memory before the check will waste gas in case the check did not pass . \n\nthe function `_mintIfThresholdMet()` read from the storage to get the `Transaction` struct corresponding to the `txnHash` and then create a copy on t", "vulnerable_code": " for (uint256 i = 0; i < amounts.length; ++i) {\n if (i == 0) {\n chainToThresholds[srcChain].push(\n Threshold(amounts[i], numOfApprovers[i])\n );\n }", "fixed_code": "**code snippet**\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/bridge/DestinationBridge.sol#L255-L279\n\n\n## 2) read from the storage and make a copy of the struct to the memory before the check will waste gas in case the check did not pass . \n\nthe function `_mintIfThresholdMet()` read from the storage to get the `Transaction` struct corresponding to the `txnHash` and then create a copy on the memory , then checks if the threshold is met or not , in case of the threshold has not been met yet ,the function will not use the copy of the struct , so it is considered wasting gas . ", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/castle_chain-G.md", "collected_at": "2026-01-02T18:25:50.238268+00:00", "source_hash": "aef439cbf1207dac617a22adc238e8e07b3b687e57e6f889df62332d5dc0bc9f", "code_block_count": 2, "solidity_block_count": 1, "total_code_chars": 1104, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "for (uint256 i = 0; i < amounts.length; ++i) {\n if (i == 0) {\n chainToThresholds[srcChain].push(\n Threshold(amounts[i], numOfApprovers[i])\n );\n }", "primary_code_language": "unknown", "primary_code_char_count": 178, "all_code_blocks": "// Code block 1 (unknown):\nfor (uint256 i = 0; i < amounts.length; ++i) {\n if (i == 0) {\n chainToThresholds[srcChain].push(\n Threshold(amounts[i], numOfApprovers[i])\n );\n }\n\n// Code block 2 (diff):\nfunction setThresholds(\n string calldata srcChain,\n uint256[] calldata amounts,\n uint256[] calldata numOfApprovers\n ) external onlyOwner {\n if (amounts.length != numOfApprovers.length) {\n revert ArrayLengthMismatch();\n }\n delete chainToThresholds[srcChain];\n\n- for (uint256 i = 0; i < amounts.length; ++i) {\n- if (i == 0) {\n- chainToThresholds[srcChain].push(\n- Threshold(amounts[i], numOfApprovers[i])\n- );\n- } else {\n+ chainToThresholds[srcChain].push(\n+ Threshold(amounts[0], numOfApprovers[0])\n+ );\n+ for (uint256 i = 1; i < amounts.length; ++i) {\n if (chainToThresholds[srcChain][i - 1].amount > amounts[i]) {\n revert ThresholdsNotInAscendingOrder();\n }\n chainToThresholds[srcChain].push(\n Threshold(amounts[i], numOfApprovers[i])\n );\n }\n }\n emit ThresholdSet(srcChain, amounts, numOfApprovers);\n }", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "function setThresholds(\n string calldata srcChain,\n uint256[] calldata amounts,\n uint256[] calldata numOfApprovers\n ) external onlyOwner {\n if (amounts.length != numOfApprovers.length) {\n revert ArrayLengthMismatch();\n }\n delete chainToThresholds[srcChain];\n\n- for (uint256 i = 0; i < amounts.length; ++i) {\n- if (i == 0) {\n- chainToThresholds[srcChain].push(\n- Threshold(amounts[i], numOfApprovers[i])\n- );\n- } else {\n+ chainToThresholds[srcChain].push(\n+ Threshold(amounts[0], numOfApprovers[0])\n+ );\n+ for (uint256 i = 1; i < amounts.length; ++i) {\n if (chainToThresholds[srcChain][i - 1].amount > amounts[i]) {\n revert ThresholdsNotInAscendingOrder();\n }\n chainToThresholds[srcChain].push(\n Threshold(amounts[i], numOfApprovers[i])\n );\n }\n }\n emit ThresholdSet(srcChain, amounts, numOfApprovers);\n }", "solidity_code": "", "github_refs_formatted": "DestinationBridge.sol#L255-L279", "github_files_list": "DestinationBridge.sol", "github_refs_count": 1, "vulnerable_code_actual": " for (uint256 i = 0; i < amounts.length; ++i) {\n if (i == 0) {\n chainToThresholds[srcChain].push(\n Threshold(amounts[i], numOfApprovers[i])\n );\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "**code snippet**\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/bridge/DestinationBridge.sol#L255-L279\n\n\n## 2) read from the storage and make a copy of the struct to the memory before the check will waste gas in case the check did not pass . \n\nthe function `_mintIfThresholdMet()` read from the storage to get the `Transaction` struct corresponding to the `txnHash` and then create a copy on the memory , then checks if the threshold is met or not , in case of the threshold has not been met yet ,the function will not use the copy of the struct , so it is considered wasting gas . ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "01-salty", "title": "lanyi2023 Q", "severity_raw": "Unknown", "severity": "unknown", "description": "```\nfunction vote( bool voteStartExchangeYes, bytes calldata signature ) external nonReentrant\n```\nAfter block.timestamp >= completionTimestamp, you can continue to call the vote function to vote\n\n\n", "vulnerable_code": "function vote( bool voteStartExchangeYes, bytes calldata signature ) external nonReentrant", "fixed_code": "", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/lanyi2023-Q.md", "collected_at": "2026-01-02T19:01:50.264372+00:00", "source_hash": "aef858bddff77f2378d9753c7460e0f51609ed8e06845bc31489ca2a7c9136b6", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 90, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function vote( bool voteStartExchangeYes, bytes calldata signature ) external nonReentrant", "primary_code_language": "unknown", "primary_code_char_count": 90, "all_code_blocks": "// Code block 1 (unknown):\nfunction vote( bool voteStartExchangeYes, bytes calldata signature ) external nonReentrant", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function vote( bool voteStartExchangeYes, bytes calldata signature ) external nonReentrant", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 2.4} {"source": "c4", "protocol": "11-kelp", "title": "0xVolcano G", "severity_raw": "High", "severity": "high", "description": "# Gas report\n\n## Table of Contents\n\n- [Gas report](#gas-report)\n - [Table of Contents](#table-of-contents)\n - [Avoid zero to none zero storage writes](#avoid-zero-to-none-zero-storage-writes)\n - [We can optimize the function `updateLRTConfig()`](#we-can-optimize-the-function-updatelrtconfig)\n - [Emit local variables instead of state variables(not found by bot)](#emit-local-variables-instead-of-state-variablesnot-found-by-bot)\n - [Don't cache calls/variables if using them once](#dont-cache-callsvariables--if-using-them-once)\n - [No need to cache `lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER)`](#no-need-to-cache-lrtconfiggetcontractlrtconstantseigen_strategy_manager)\n - [No need to cache `lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER)`](#no-need-to-cache-lrtconfiggetcontractlrtconstantseigen_strategy_manager-1)\n - [No need to cache `lrtConfig.getContract(LRTConstants.LRT_DEPOSIT_POOL)`](#no-need-to-cache-lrtconfiggetcontractlrtconstantslrt_deposit_pool)\n - [No need to cache `lrtConfig.assetStrategy(asset)`](#no-need-to-cache-lrtconfigassetstrategyasset)\n - [No need to cache `nodeDelegatorQueue[ndcIndex]`](#no-need-to-cache-nodedelegatorqueuendcindex)\n - [Caching the length of calldata increases gas cost instead of reducing it](#caching-the-length-of-calldata-increases-gas-cost-instead-of-reducing-it)\n\n\n## Avoid zero to none zero storage writes\n\nWhen a storage variable goes from zero to non-zero, the user must pay 22,100 gas total (20,000 gas for a zero to non-zero write and 2,100 for a cold storage access).\n\nThis is why the Openzeppelin reentrancy guard registers functions as active or not with 1 and 2 rather than 0 and 1. It only costs 5,000 gas to alter a storage variable from non-zero to non-zero.\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTDepositPool.sol#L19-L38\n```solidity\nFile: /src/LRTDepositPool.sol\n19:contract LRTDepositPool is ILRTDepositPool, LRTConfigRoleCh", "vulnerable_code": "File: /src/LRTDepositPool.sol\n19:contract LRTDepositPool is ILRTDepositPool, LRTConfigRoleChecker, PausableUpgradeable, ReentrancyGuardUpgradeable {\n20: uint256 public maxNodeDelegatorCount;\n\n29: /// @dev Initializes the contract\n30: /// @param lrtConfigAddr LRT config address\n31: function initialize(address lrtConfigAddr) external initializer {\n32: UtilLib.checkNonZeroAddress(lrtConfigAddr);\n33: __Pausable_init();\n34: __ReentrancyGuard_init();\n35: maxNodeDelegatorCount = 10;\n36: lrtConfig = ILRTConfig(lrtConfigAddr);\n37: emit UpdatedLRTConfig(lrtConfigAddr);\n38: }", "fixed_code": "## We can optimize the function `updateLRTConfig()`\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/utils/LRTConfigRoleChecker.sol#L47-L51", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/0xVolcano-G.md", "collected_at": "2026-01-02T18:27:11.851827+00:00", "source_hash": "af3d46e27b5b3c42d97638d0099c4f9878391e8a84dc81733f961083da69cfe7", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LRTDepositPool.sol#L19-L38, LRTConfigRoleChecker.sol#L47-L51", "github_files_list": "LRTDepositPool.sol, LRTConfigRoleChecker.sol", "github_refs_count": 2, "vulnerable_code_actual": "File: /src/LRTDepositPool.sol\n19:contract LRTDepositPool is ILRTDepositPool, LRTConfigRoleChecker, PausableUpgradeable, ReentrancyGuardUpgradeable {\n20: uint256 public maxNodeDelegatorCount;\n\n29: /// @dev Initializes the contract\n30: /// @param lrtConfigAddr LRT config address\n31: function initialize(address lrtConfigAddr) external initializer {\n32: UtilLib.checkNonZeroAddress(lrtConfigAddr);\n33: __Pausable_init();\n34: __ReentrancyGuard_init();\n35: maxNodeDelegatorCount = 10;\n36: lrtConfig = ILRTConfig(lrtConfigAddr);\n37: emit UpdatedLRTConfig(lrtConfigAddr);\n38: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## We can optimize the function `updateLRTConfig()`\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/utils/LRTConfigRoleChecker.sol#L47-L51", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-biconomy", "title": "SleepingBugs Q", "severity_raw": "Critical", "severity": "critical", "description": "\n## Single-step process for critical ownership transfer/renounce is risky\n### Impact\nGiven that `BasePaymaster.sol` is derived from `Ownable`, the ownership management of this contract defaults to `Ownable` \u2019s `transferOwnership()` and `renounceOwnership()` methods which are not overridden here. \n\nSuch critical address transfer/renouncing in one-step is very risky because it is irrecoverable from any mistakes\n\nScenario: If an incorrect address, e.g. for which the private key is not known, is used accidentally then it prevents the use of all the `onlyOwner()` functions forever, which includes the changing of various critical addresses and parameters. This use of incorrect address may not even be immediately apparent given that these functions are probably not used immediately. \n\nWhen noticed, due to a failing `onlyOwner()` function call, it will force the redeployment of these contracts and require appropriate changes and notifications for switching from the old to new address. This will diminish trust in the protocol and incur a significant reputational damage.\n\n### Code Snippet\nhttps://github.com/code-423n4/2023-01-biconomy/blob/721e2afb493d8bc0bc9488b84eaf2deb14c8b43f/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L16\n\n### Recommended steps\nConsider using OZ Ownable2Step library:\nhttps://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable2Step.sol\n\nOr do it manually. I recommend overriding the inherited methods to null functions and use separate functions for a two-step address change:\n1. Approve a new address as a `pendingOwner`\n2. A transaction from the `pendingOwner` address claims the pending ownership change.\n\nThis mitigates risk because if an incorrect address is used in step (1) then it can be fixed by re-approving the correct address. Only after a correct address is used in step (1) can step (2) happen and complete the address/ownership change.\n\nAlso, consider adding a time-delay for such sensitiv", "vulnerable_code": "contract SmartAccount is \n Singleton,\n BaseSmartAccount,\n IERC165,\n ModuleManager,\n SignatureDecoder,\n SecuredTokenTransfer,\n ISignatureValidatorConstants,\n FallbackManager,\n Initializable,\n ReentrancyGuardUpgradeable\n{", "fixed_code": "", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/SleepingBugs-Q.md", "collected_at": "2026-01-02T18:13:21.077606+00:00", "source_hash": "af621b6ebd536a9502569e1f12ff5611557f60c9eb15b508dbaa6bb79ff86d1d", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "BasePaymaster.sol#L16, Ownable2Step.sol", "github_files_list": "Ownable2Step.sol, BasePaymaster.sol", "github_refs_count": 2, "vulnerable_code_actual": "contract SmartAccount is \n Singleton,\n BaseSmartAccount,\n IERC165,\n ModuleManager,\n SignatureDecoder,\n SecuredTokenTransfer,\n ISignatureValidatorConstants,\n FallbackManager,\n Initializable,\n ReentrancyGuardUpgradeable\n{", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "02-ethos", "title": "0xm1ck G", "severity_raw": "High", "severity": "high", "description": "## Gas Optimizations\n\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [GAS-1](#GAS-1) | Bytes constants are more efficient than string constants | 8 |\n| [GAS-2](#GAS-2) | Incrementing with a smaller type than `uint256` incurs overhead | 3 |\n| [GAS-3](#GAS-3) | Use `storage` instead of `memory` for structs/arrays | 16 |\n| [GAS-4](#GAS-4) | Increments can be `unchecked` in for-loops | 14 |\n| [GAS-5](#GAS-5) | Pre-increments and pre-decrements are cheaper than post-increments and post-decrements | 15 |\n| [GAS-6](#GAS-6) | Use shift Right/Left instead of division/multiplication if possible | 1 |\n| [GAS-7](#GAS-7) | Use assembly to check for `address(0)` | 8 |\n| [GAS-8](#GAS-8) | Using bools for storage incurs overhead | 7 |\n| [GAS-9](#GAS-9) | Cache array length outside of loop | 7 |\n| [GAS-10](#GAS-10) | State variables should be cached in stack variables rather than re-reading them from storage | 10 |\n| [GAS-11](#GAS-11) | Use calldata instead of memory for function arguments that do not get mutated | 1 |\n| [GAS-12](#GAS-12) | Use Custom Errors | 58 |\n| [GAS-13](#GAS-13) | Don't initialize variables with default value | 18 |\n| [GAS-14](#GAS-14) | Long revert strings | 34 |\n| [GAS-15](#GAS-15) | Using `private` rather than `public` for constants, saves gas | 21 |\n| [GAS-16](#GAS-16) | Use != 0 instead of > 0 for unsigned integer comparison | 27 |\n| [GAS-17](#GAS-17) | `internal` functions not called by the contract should be removed | 1 |\n### [GAS-1] Bytes constants are more efficient than string constants\n\n*Instances (8)*:\n```solidity\nFile: ActivePool.sol\n\n30: string constant public NAME = \"ActivePool\";\n\n```\n\n```solidity\nFile: BorrowerOperations.sol\n\n21: string constant public NAME = \"BorrowerOperations\";\n\n```\n\n```solidity\nFile: LQTY/CommunityIssuance.sol\n\n19: string constant public NAME = \"CommunityIssuance\";\n\n```\n\n```solidity\nFile: LQTY/LQTYStaking.sol\n\n23: string constant public NAME = \"LQTYStaking\";\n\n```\n\n```solidity\nFile: LUSDToken.sol\n\n32: ", "vulnerable_code": "File: ActivePool.sol\n\n30: string constant public NAME = \"ActivePool\";\n", "fixed_code": "File: BorrowerOperations.sol\n\n21: string constant public NAME = \"BorrowerOperations\";\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/0xm1ck-G.md", "collected_at": "2026-01-02T18:15:51.849032+00:00", "source_hash": "af9f8f6f4c2af374009b8024129d44aa871c0b25ce94645edc97ec76f24f67de", "code_block_count": 4, "solidity_block_count": 4, "total_code_chars": 334, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: ActivePool.sol\n\n30: string constant public NAME = \"ActivePool\";", "primary_code_language": "solidity", "primary_code_char_count": 73, "all_code_blocks": "// Code block 1 (solidity):\nFile: ActivePool.sol\n\n30: string constant public NAME = \"ActivePool\";\n\n// Code block 2 (solidity):\nFile: BorrowerOperations.sol\n\n21: string constant public NAME = \"BorrowerOperations\";\n\n// Code block 3 (solidity):\nFile: LQTY/CommunityIssuance.sol\n\n19: string constant public NAME = \"CommunityIssuance\";\n\n// Code block 4 (solidity):\nFile: LQTY/LQTYStaking.sol\n\n23: string constant public NAME = \"LQTYStaking\";", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: ActivePool.sol\n\n30: string constant public NAME = \"ActivePool\";\n\nFile: BorrowerOperations.sol\n\n21: string constant public NAME = \"BorrowerOperations\";\n\nFile: LQTY/CommunityIssuance.sol\n\n19: string constant public NAME = \"CommunityIssuance\";\n\nFile: LQTY/LQTYStaking.sol\n\n23: string constant public NAME = \"LQTYStaking\";", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: ActivePool.sol\n\n30: string constant public NAME = \"ActivePool\";\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: BorrowerOperations.sol\n\n21: string constant public NAME = \"BorrowerOperations\";\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "01-biconomy", "title": "giovannidisiena G", "severity_raw": "Low", "severity": "low", "description": "### **Gas Optimisations**\n#### **[G-01] Variable Assignment in Event**\n5 gas can be saved by assigning `owner` within the event. This also follows checks-effects-interactions due to right-to-left evaluation.\n\n*There is 1 instance of this issue:*\n\n```\nFile: contracts/smart-contract-wallet/SmartAccount.sol\n\n function setOwner(address _newOwner) external mixedAuth {\n require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n address oldOwner = owner;\n owner = _newOwner;\n emit EOAChanged(address(this), oldOwner, _newOwner);\n }\n```\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L109-L114\n\n#### **[G-02] Use Global Address Code Length**\n10 gas can be saved by using the built-in `
.code.length > 0`.\n\n*There are 2 instances of this issue:*\n\n```\nFile: contracts/smart-contract-wallet/libs/LibAddress.sol\n\n /**\n * @notice Will return true if provided address is a contract\n * @param account Address to verify if contract or not\n * @dev This contract will return false if called within the constructor of\n * a contract's deployment, as the code is not yet stored on-chain.\n */\n function isContract(address account) internal view returns (bool) {\n uint256 csize;\n // solhint-disable-next-line no-inline-assembly\n assembly { csize := extcodesize(account) }\n return csize != 0;\n }\n```\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/libs/LibAddress.sol#LL5C3-L16C4\n\n```\nFile: contracts/smart-contract-wallet/paymasters/verifying/VerifyingSingletonPaymaster.sol\n\n import \"@openzeppelin/contracts/utils/Address.sol\";\n ...\n require(!Address.isContract(paymasterId), \"Paymaster Id can not be smart contract address\");\n```\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/", "vulnerable_code": "File: contracts/smart-contract-wallet/SmartAccount.sol\n\n function setOwner(address _newOwner) external mixedAuth {\n require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n address oldOwner = owner;\n owner = _newOwner;\n emit EOAChanged(address(this), oldOwner, _newOwner);\n }", "fixed_code": "File: contracts/smart-contract-wallet/libs/LibAddress.sol\n\n /**\n * @notice Will return true if provided address is a contract\n * @param account Address to verify if contract or not\n * @dev This contract will return false if called within the constructor of\n * a contract's deployment, as the code is not yet stored on-chain.\n */\n function isContract(address account) internal view returns (bool) {\n uint256 csize;\n // solhint-disable-next-line no-inline-assembly\n assembly { csize := extcodesize(account) }\n return csize != 0;\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/giovannidisiena-G.md", "collected_at": "2026-01-02T18:13:45.903063+00:00", "source_hash": "afa445caf45881a8f25f30c440cfdc5026a9961cfa06b0f4fd72873760939c6b", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 1186, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/smart-contract-wallet/SmartAccount.sol\n\n function setOwner(address _newOwner) external mixedAuth {\n require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n address oldOwner = owner;\n owner = _newOwner;\n emit EOAChanged(address(this), oldOwner, _newOwner);\n }", "primary_code_language": "unknown", "primary_code_char_count": 343, "all_code_blocks": "// Code block 1 (unknown):\nFile: contracts/smart-contract-wallet/SmartAccount.sol\n\n function setOwner(address _newOwner) external mixedAuth {\n require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n address oldOwner = owner;\n owner = _newOwner;\n emit EOAChanged(address(this), oldOwner, _newOwner);\n }\n\n// Code block 2 (unknown):\nFile: contracts/smart-contract-wallet/libs/LibAddress.sol\n\n /**\n * @notice Will return true if provided address is a contract\n * @param account Address to verify if contract or not\n * @dev This contract will return false if called within the constructor of\n * a contract's deployment, as the code is not yet stored on-chain.\n */\n function isContract(address account) internal view returns (bool) {\n uint256 csize;\n // solhint-disable-next-line no-inline-assembly\n assembly { csize := extcodesize(account) }\n return csize != 0;\n }\n\n// Code block 3 (unknown):\nFile: contracts/smart-contract-wallet/paymasters/verifying/VerifyingSingletonPaymaster.sol\n\n import \"@openzeppelin/contracts/utils/Address.sol\";\n ...\n require(!Address.isContract(paymasterId), \"Paymaster Id can not be smart contract address\");", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SmartAccount.sol#L109-L114, LibAddress.sol", "github_files_list": "LibAddress.sol, SmartAccount.sol", "github_refs_count": 2, "vulnerable_code_actual": "File: contracts/smart-contract-wallet/SmartAccount.sol\n\n function setOwner(address _newOwner) external mixedAuth {\n require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n address oldOwner = owner;\n owner = _newOwner;\n emit EOAChanged(address(this), oldOwner, _newOwner);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/smart-contract-wallet/libs/LibAddress.sol\n\n /**\n * @notice Will return true if provided address is a contract\n * @param account Address to verify if contract or not\n * @dev This contract will return false if called within the constructor of\n * a contract's deployment, as the code is not yet stored on-chain.\n */\n function isContract(address account) internal view returns (bool) {\n uint256 csize;\n // solhint-disable-next-line no-inline-assembly\n assembly { csize := extcodesize(account) }\n return csize != 0;\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "02-ethos", "title": "Brenzee Q", "severity_raw": "Gas", "severity": "gas", "description": "## Use `require()` instead of `assert()`\nBorrowerOperations.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L128\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L197\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L301\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L331\n\nLUSDToken.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L312-L313\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L321\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L329\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L337-L338\n\nRedemptionHelper.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L337-L338\n\nStabilityPool.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/StabilityPool.sol#L526\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/StabilityPool.sol#L551\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/StabilityPool.sol#L591\n\nTroveManager.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L417\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L1224\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L1279\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L1342-L1348\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L1414\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L1489\n\n\n### Explanation\n\nThe Solidity `assert()` function is meant to assert invaria", "vulnerable_code": "### Recommendation\nChange `assert()` to `require()` \n\n## Inconsistent `uint` and `uint256` usage\nTroveManager.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L129-L138\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L146-L158\n\nBorrowerOperations.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L47-L78\n\n### Explanation\n`uint` and `uint256` are the same types. Mixing `uint256` and `uint` is not a good code style.\n\n### Recommendation\nEither use `uint256` or `uint` across all of the contracts.\n\n## Call to `keccak256()` should use `immutable` rather than `constant`\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L73-L76\n\n### Recommendation\nChange `constant` to `immutable`\n", "fixed_code": "## Avoid setting time variables with integer values\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L48\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/Brenzee-Q.md", "collected_at": "2026-01-02T18:16:02.188340+00:00", "source_hash": "afc51554367b27fc0848c18b4357b3225d1c1060010f31fac0e2530ecccf0028", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 22, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "BorrowerOperations.sol#L128, BorrowerOperations.sol#L197, BorrowerOperations.sol#L301, BorrowerOperations.sol#L331, LUSDToken.sol#L312-L313, LUSDToken.sol#L321, LUSDToken.sol#L329, LUSDToken.sol#L337-L338, StabilityPool.sol#L526, StabilityPool.sol#L551, StabilityPool.sol#L591, TroveManager.sol#L417, TroveManager.sol#L1224, TroveManager.sol#L1279, TroveManager.sol#L1342-L1348, TroveManager.sol#L1414, TroveManager.sol#L1489, TroveManager.sol#L129-L138, TroveManager.sol#L146-L158, BorrowerOperations.sol#L47-L78, ReaperVaultV2.sol#L73-L76, TroveManager.sol#L48", "github_files_list": "StabilityPool.sol, TroveManager.sol, BorrowerOperations.sol, ReaperVaultV2.sol, LUSDToken.sol", "github_refs_count": 22, "vulnerable_code_actual": "### Recommendation\nChange `assert()` to `require()` \n\n## Inconsistent `uint` and `uint256` usage\nTroveManager.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L129-L138\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L146-L158\n\nBorrowerOperations.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L47-L78\n\n### Explanation\n`uint` and `uint256` are the same types. Mixing `uint256` and `uint` is not a good code style.\n\n### Recommendation\nEither use `uint256` or `uint` across all of the contracts.\n\n## Call to `keccak256()` should use `immutable` rather than `constant`\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L73-L76\n\n### Recommendation\nChange `constant` to `immutable`\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## Avoid setting time variables with integer values\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L48\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "02-ethos", "title": "UdarTeam Q", "severity_raw": "Critical", "severity": "critical", "description": "### Issues Template\n| Letter | Name | Description |\n|:--:|:-------:|:-------:|\n| L | Low risk | Potential risk |\n| NC | Non-critical | Non risky findings |\n| R | Refactor | Changing the code |\n| O | Ordinary | Often found issues |\n\n| Total Found Issues | 16 |\n|:--:|:--:|\n\n\n### Non-Critical Issues Template\n| Count | Explanation | Instances |\n|:--:|:-------|:--:|\n| [N-01] | Explicitly mark state variables visibility | 5 |\n| [N-02] | Explicitly mark uint type size | 557 |\n| [N-03] | Create your own import names instead of using the regular ones | 97 |\n| [N-04] | Insufficient coverage | - |\n\n\n| Total Non-Critical Issues | 4 |\n|:--:|:--:|\n\n### Refactor Issues Template\n| Count | Explanation | Instances |\n|:--:|:-------|:--:|\n| [R-01] | Use require instead of assert | 18 |\n| [R-02] | Some number values can be refactored with _ | 2 |\n| [R-03] | Validate input before storage reads | 1 |\n| [R-04] | Remove unused variables | 2 |\n| [R-05] | Function state mutability can be restricted to pure | 1 |\n| [R-06] | For functions, follow solidity standard naming conventions | 1 |\n| [R-07] | Enum values should start with capital letter by convention | 1 |\n\n| Total Refactor Issues | 7 |\n|:--:|:--:|\n\n### Ordinary Issues Template\n| Count | Explanation | Instances |\n|:--:|:-------|:--:|\n| [O-01] | Remove TODOs in code | 2 |\n| [O-02] | Commented out code | 3 |\n| [O-03] | Use a more recent pragma version | 15 |\n| [O-04] | Locking pragma | 4 |\n| [O-05] | Increase NatSpec comments | 103 |\n\n\n| Total Ordinary Issues | 5 |\n|:--:|:--:|\n\n### [N-01] Explicitly mark state variables visibility\n\nExplicitly marking state variables visibility improves code readability and consistency.\n\n```solidity\nEthos-Core/contracts/BorrowerOperations.sol\n\n28: address stabilityPoolAddress;\n30: address gasPoolAddress;\n32: ICollSurplusPool collSurplusPool;\n```\n\n```solidity\nEthos-Core/contracts/TroveManager.sol\n\n31: address gasPoolAddress;\n33: ICollSurplusPool collSurplusPool;\n```\n\n### [N-02] Explicitly mark uint type s", "vulnerable_code": "Ethos-Core/contracts/BorrowerOperations.sol\n\n28: address stabilityPoolAddress;\n30: address gasPoolAddress;\n32: ICollSurplusPool collSurplusPool;", "fixed_code": "Ethos-Core/contracts/TroveManager.sol\n\n31: address gasPoolAddress;\n33: ICollSurplusPool collSurplusPool;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/UdarTeam-Q.md", "collected_at": "2026-01-02T18:16:41.863567+00:00", "source_hash": "aff3b75370fd142de7105b904e11c4a6488cc68904062751e7022fb2430668af", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 248, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "Ethos-Core/contracts/BorrowerOperations.sol\n\n28: address stabilityPoolAddress;\n30: address gasPoolAddress;\n32: ICollSurplusPool collSurplusPool;", "primary_code_language": "solidity", "primary_code_char_count": 144, "all_code_blocks": "// Code block 1 (solidity):\nEthos-Core/contracts/BorrowerOperations.sol\n\n28: address stabilityPoolAddress;\n30: address gasPoolAddress;\n32: ICollSurplusPool collSurplusPool;\n\n// Code block 2 (solidity):\nEthos-Core/contracts/TroveManager.sol\n\n31: address gasPoolAddress;\n33: ICollSurplusPool collSurplusPool;", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "Ethos-Core/contracts/BorrowerOperations.sol\n\n28: address stabilityPoolAddress;\n30: address gasPoolAddress;\n32: ICollSurplusPool collSurplusPool;\n\nEthos-Core/contracts/TroveManager.sol\n\n31: address gasPoolAddress;\n33: ICollSurplusPool collSurplusPool;", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "Ethos-Core/contracts/BorrowerOperations.sol\n\n28: address stabilityPoolAddress;\n30: address gasPoolAddress;\n32: ICollSurplusPool collSurplusPool;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "Ethos-Core/contracts/TroveManager.sol\n\n31: address gasPoolAddress;\n33: ICollSurplusPool collSurplusPool;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "07-amphora", "title": "koxuan Q", "severity_raw": "Medium", "severity": "medium", "description": "### [L‑1] ERC20 tokens that do not implement optional decimals method cannot be used\n\nUnderlying token that does not implement optional decimals method cannot be used\n\n > [EIP-20](https://eips.ethereum.org/EIPS/eip-20#decimals) OPTIONAL - This method can be used to improve usability, but interfaces and other contracts MUST NOT expect these values to be present.\n\n*Instances (7)*:\n```solidity\nFile: /core/solidity/contracts/core/VaultController.sol\n\n341: uint8 _tokenDecimals = IERC20Metadata(_tokenAddress).decimals();\n\n```\nhttps://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/VaultController.sol#L341\n\n```solidity\nFile: /core/solidity/contracts/periphery/oracles/CTokenOracle.sol\n\n25: uint256 _underlyingDecimals = cETH_ADDRESS == _cToken ? 18 : IERC20Metadata(cToken.underlying()).decimals();\n\n28: div = 10 ** (18 + _underlyingDecimals - cToken.decimals());\n\n```\nhttps://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/periphery/oracles/CTokenOracle.sol#L25\n\n```solidity\nFile: /core/solidity/contracts/periphery/oracles/UniswapV3OracleRelay.sol\n\n50: BASE_TOKEN_DECIMALS = IERC20Metadata(BASE_TOKEN).decimals();\n\n51: QUOTE_TOKEN_DECIMALS = IERC20Metadata(QUOTE_TOKEN).decimals();\n\n```\nhttps://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/periphery/oracles/UniswapV3OracleRelay.sol#L50\n\n```solidity\nFile: /core/solidity/scripts/fakes/MintableToken.sol\n\n20: function decimals() public view virtual override returns (uint8) {\n\n```\nhttps://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/scripts/fakes/MintableToken.sol#L20\n\n```solidity\nFile: /core/solidity/interfaces/periphery/ICToken.sol\n\n9: function decimals() external view returns (uint8 _decimals);\n\n```\nhttps://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/interfaces/periphery/ICToken.sol#L9\n\n\n### [L‑2] Divide before Multiplication\n\nUnnecessary loss of precision caused by divide before multiplica", "vulnerable_code": "File: /core/solidity/contracts/core/VaultController.sol\n\n341: uint8 _tokenDecimals = IERC20Metadata(_tokenAddress).decimals();\n", "fixed_code": "File: /core/solidity/contracts/periphery/oracles/CTokenOracle.sol\n\n25: uint256 _underlyingDecimals = cETH_ADDRESS == _cToken ? 18 : IERC20Metadata(cToken.underlying()).decimals();\n\n28: div = 10 ** (18 + _underlyingDecimals - cToken.decimals());\n", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/koxuan-Q.md", "collected_at": "2026-01-02T18:23:53.258188+00:00", "source_hash": "affb42bd182f64ff0cd2eb863471c75fdd659c6ee4b3b22e5b634370bc36de7d", "code_block_count": 5, "solidity_block_count": 5, "total_code_chars": 836, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: /core/solidity/contracts/core/VaultController.sol\n\n341: uint8 _tokenDecimals = IERC20Metadata(_tokenAddress).decimals();", "primary_code_language": "solidity", "primary_code_char_count": 129, "all_code_blocks": "// Code block 1 (solidity):\nFile: /core/solidity/contracts/core/VaultController.sol\n\n341: uint8 _tokenDecimals = IERC20Metadata(_tokenAddress).decimals();\n\n// Code block 2 (solidity):\nFile: /core/solidity/contracts/periphery/oracles/CTokenOracle.sol\n\n25: uint256 _underlyingDecimals = cETH_ADDRESS == _cToken ? 18 : IERC20Metadata(cToken.underlying()).decimals();\n\n28: div = 10 ** (18 + _underlyingDecimals - cToken.decimals());\n\n// Code block 3 (solidity):\nFile: /core/solidity/contracts/periphery/oracles/UniswapV3OracleRelay.sol\n\n50: BASE_TOKEN_DECIMALS = IERC20Metadata(BASE_TOKEN).decimals();\n\n51: QUOTE_TOKEN_DECIMALS = IERC20Metadata(QUOTE_TOKEN).decimals();\n\n// Code block 4 (solidity):\nFile: /core/solidity/scripts/fakes/MintableToken.sol\n\n20: function decimals() public view virtual override returns (uint8) {\n\n// Code block 5 (solidity):\nFile: /core/solidity/interfaces/periphery/ICToken.sol\n\n9: function decimals() external view returns (uint8 _decimals);", "all_code_blocks_count": 5, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: /core/solidity/contracts/core/VaultController.sol\n\n341: uint8 _tokenDecimals = IERC20Metadata(_tokenAddress).decimals();\n\nFile: /core/solidity/contracts/periphery/oracles/CTokenOracle.sol\n\n25: uint256 _underlyingDecimals = cETH_ADDRESS == _cToken ? 18 : IERC20Metadata(cToken.underlying()).decimals();\n\n28: div = 10 ** (18 + _underlyingDecimals - cToken.decimals());\n\nFile: /core/solidity/contracts/periphery/oracles/UniswapV3OracleRelay.sol\n\n50: BASE_TOKEN_DECIMALS = IERC20Metadata(BASE_TOKEN).decimals();\n\n51: QUOTE_TOKEN_DECIMALS = IERC20Metadata(QUOTE_TOKEN).decimals();\n\nFile: /core/solidity/scripts/fakes/MintableToken.sol\n\n20: function decimals() public view virtual override returns (uint8) {\n\nFile: /core/solidity/interfaces/periphery/ICToken.sol\n\n9: function decimals() external view returns (uint8 _decimals);", "github_refs_formatted": "VaultController.sol#L341, CTokenOracle.sol#L25, UniswapV3OracleRelay.sol#L50, MintableToken.sol#L20, ICToken.sol#L9", "github_files_list": "UniswapV3OracleRelay.sol, ICToken.sol, VaultController.sol, MintableToken.sol, CTokenOracle.sol", "github_refs_count": 5, "vulnerable_code_actual": "File: /core/solidity/contracts/core/VaultController.sol\n\n341: uint8 _tokenDecimals = IERC20Metadata(_tokenAddress).decimals();\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: /core/solidity/contracts/periphery/oracles/CTokenOracle.sol\n\n25: uint256 _underlyingDecimals = cETH_ADDRESS == _cToken ? 18 : IERC20Metadata(cToken.underlying()).decimals();\n\n28: div = 10 ** (18 + _underlyingDecimals - cToken.decimals());\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 11} {"source": "c4", "protocol": "02-ethos", "title": "Go Langer Q", "severity_raw": "Low", "severity": "low", "description": "### No revert messages in TroveManager.sol\n\nIn TroveManager there are no revert messages within the require statements.\n\n1530: function _requireCallerIsBorrowerOperationsOrRedemptionHelper() internal view {\n require(msg.sender == borrowerOperationsAddress || msg.sender == address(redemptionHelper));\n }\n\nRevert messages help us understand why a transaction has failed if called by parties other than,\nfor example borrowerOperationsAddress or redemptionHelper.\n\nRefactored code:\n\n```\nfunction _requireCallerIsBorrowerOperationsOrRedemptionHelper() internal view {\n require(msg.sender == borrowerOperationsAddress || msg.sender == address(redemptionHelper), \"Only borrowerOperationsAddress or redemptionHelper can call this function\");\n}\n```\n\nAlso on lines:\n\n1538 function _requireMoreThanOneTroveInSystem\n1535 function _requireTroveIsActive\n1530 function _requireCallerIsBorrowerOperationsOrRedemptionHelper\n1526 function _requireCallerIsRedemptionHelper\n1523 function _requireCallerIsBorrowerOperations\n1450 function _calcRedemptionFee\n754 function batchLiquidateTroves\n716 function batchLiquidateTroves\n551 function liquidateTroves\n250 function setAddresses\n\n### Remove comments from zombie code\n\nIn ReaperBaseStrategyv4, there is a comment that the DEFAULT_ADMIN_ROLE will be granted to a multisig requiring 4 signatures. \nHowever, the code only grants 3 multisig roles.\n\n\n * The DEFAULT_ADMIN_ROLE (in-built access control role) will be granted to a multisig requiring 4\n * signatures. This role would have upgrading capability, as well as the ability to grant any other\n * roles.\n \n ```\n function __ReaperBaseStrategy_init(\n address _vault,\n address _want,\n address[] memory _strategists,\n address[] memory _multisigRoles\n ) internal onlyInitializing {\n __UUPSUpgradeable_init();\n __AccessControlEnumerable_init();\n\n vault = _vault;\n want = _want;\n IERC20Upgradeable(want).safeApprove(vault, t", "vulnerable_code": "function _requireCallerIsBorrowerOperationsOrRedemptionHelper() internal view {\n require(msg.sender == borrowerOperationsAddress || msg.sender == address(redemptionHelper), \"Only borrowerOperationsAddress or redemptionHelper can call this function\");\n}", "fixed_code": " function __ReaperBaseStrategy_init(\n address _vault,\n address _want,\n address[] memory _strategists,\n address[] memory _multisigRoles\n ) internal onlyInitializing {\n __UUPSUpgradeable_init();\n __AccessControlEnumerable_init();\n\n vault = _vault;\n want = _want;\n IERC20Upgradeable(want).safeApprove(vault, type(uint256).max);\n\n uint256 numStrategists = _strategists.length;\n for (uint256 i = 0; i < numStrategists; i = i.uncheckedInc()) {\n _grantRole(STRATEGIST, _strategists[i]);\n }\n\n require(_multisigRoles.length == 3, \"Invalid number of multisig roles\");\n _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);\n _grantRole(DEFAULT_ADMIN_ROLE, _multisigRoles[0]);\n _grantRole(ADMIN, _multisigRoles[1]);\n _grantRole(GUARDIAN, _multisigRoles[2]);\n\n clearUpgradeCooldown();\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/Go-Langer-Q.md", "collected_at": "2026-01-02T18:16:13.434108+00:00", "source_hash": "b0495228fe9625a6f78bc95a5ab03516939a9e1b910abb7afe989fc87a35e47e", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 255, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _requireCallerIsBorrowerOperationsOrRedemptionHelper() internal view {\n require(msg.sender == borrowerOperationsAddress || msg.sender == address(redemptionHelper), \"Only borrowerOperationsAddress or redemptionHelper can call this function\");\n}", "primary_code_language": "unknown", "primary_code_char_count": 255, "all_code_blocks": "// Code block 1 (unknown):\nfunction _requireCallerIsBorrowerOperationsOrRedemptionHelper() internal view {\n require(msg.sender == borrowerOperationsAddress || msg.sender == address(redemptionHelper), \"Only borrowerOperationsAddress or redemptionHelper can call this function\");\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function _requireCallerIsBorrowerOperationsOrRedemptionHelper() internal view {\n require(msg.sender == borrowerOperationsAddress || msg.sender == address(redemptionHelper), \"Only borrowerOperationsAddress or redemptionHelper can call this function\");\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function __ReaperBaseStrategy_init(\n address _vault,\n address _want,\n address[] memory _strategists,\n address[] memory _multisigRoles\n ) internal onlyInitializing {\n __UUPSUpgradeable_init();\n __AccessControlEnumerable_init();\n\n vault = _vault;\n want = _want;\n IERC20Upgradeable(want).safeApprove(vault, type(uint256).max);\n\n uint256 numStrategists = _strategists.length;\n for (uint256 i = 0; i < numStrategists; i = i.uncheckedInc()) {\n _grantRole(STRATEGIST, _strategists[i]);\n }\n\n require(_multisigRoles.length == 3, \"Invalid number of multisig roles\");\n _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);\n _grantRole(DEFAULT_ADMIN_ROLE, _multisigRoles[0]);\n _grantRole(ADMIN, _multisigRoles[1]);\n _grantRole(GUARDIAN, _multisigRoles[2]);\n\n clearUpgradeCooldown();\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "06-lybra", "title": "Sathish9098 Analysis", "severity_raw": "Critical", "severity": "critical", "description": "# Lybra Finance - Analysis \n\n|Head |Details|\n|:----------------|:------|\n| Approach taken in evaluating the codebase | What is unique? How are the existing patterns used? |\n|Codebase quality analysis| its structure, readability, maintainability, and adherence to best practices|\n|Centralization risks| power, control, or decision-making authority is concentrated in a single entity|\n|Bug Fix|process of identifying and resolving issues or errors|\n|Gas Optimization|process of reducing the amount of gas consumed by a smart contract or transaction on a blockchain network|\n|Other recommendations| Recommendations for improving the quality of your codebase|\n|Time spent on analysis | Time detail of individual stages in my code review and analysis |\n\n## Approach taken in evaluating the codebase\n\nSteps:\n\n- ``Use a static code analysis tool``: Static code analysis tools can scan the code for potential bugs and vulnerabilities. These tools can be used to identify a wide range of issues, including:\n\n - Insecure coding practices\n - Common vulnerabilities\n - Code that is not compliant with security standards\n\n- ``Read the documentation``: The documentation for Lybra Finance should provide a detailed overview of the protocol and its codebase. This documentation can be used to understand the purpose of the code and to identify potential areas of concern.\n\n- ``Scope the analysis``: Once you have a basic understanding of the protocol and its codebase, you can start to scope the analysis. This involves identifying the specific areas of code that you want to focus on. For example, you may want to focus on the code that handles user input, the code that interacts with external APIs, or the code that stores sensitive data.\n\n- ``Manually review the code``: Once you have scoped the analysis, you can start to manually review the code. This involves reading the code line-by-line and looking for potential problems. Some of the things you should look for include:\n\n - Unvalidated user in", "vulnerable_code": "FILE: 2023-06-lybra/contracts/lybra/miner/EUSDMiningIncentives.sol\n\n84: function setToken(address _lbr, address _eslbr) external onlyOwner {\n89: function setLBROracle(address _lbrOracle) external onlyOwner {\n93: function setPools(address[] memory _pools) external onlyOwner {\n100:function setBiddingCost(uint256 _biddingRatio) external onlyOwner {\n105:function setExtraRatio(uint256 ratio) external onlyOwner {\n110: function setPeUSDExtraRatio(uint256 ratio) external onlyOwner {\n115: function setBoost(address _boost) external onlyOwner {\n119: function setRewardsDuration(uint256 _duration) external onlyOwner {\n124: function setEthlbrStakeInfo(address _pool, address _lp) external onlyOwner {\n128: function setEUSDBuyoutAllowed(bool _bool) external onlyOwner {\n\n\nFILE: 2023-06-lybra/contracts/lybra/miner/ProtocolRewardsPool.sol\n\n52: function setTokenAddress(address _eslbr, address _lbr, address _boost) external onlyOwner {\n58: function setGrabCost(uint256 _ratio) external onlyOwner {\n\nFILE: Breadcrumbs2023-06-lybra/contracts/lybra/miner/stakerewardV2pool.sol\n\n121: function setRewardsDuration(uint256 _duration) external onlyOwner {\n127: function setBoost(address _boost) external onlyOwner {\n132: function notifyRewardAmount(uint256 _amount) external onlyOwner updateReward(address(0)) {\n", "fixed_code": "", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/Sathish9098-Analysis.md", "collected_at": "2026-01-02T18:22:43.557207+00:00", "source_hash": "b05a716897f633d046e4fa3b51117f153c1e8a19cc69a8469f0ad257cb7cd572", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "FILE: 2023-06-lybra/contracts/lybra/miner/EUSDMiningIncentives.sol\n\n84: function setToken(address _lbr, address _eslbr) external onlyOwner {\n89: function setLBROracle(address _lbrOracle) external onlyOwner {\n93: function setPools(address[] memory _pools) external onlyOwner {\n100:function setBiddingCost(uint256 _biddingRatio) external onlyOwner {\n105:function setExtraRatio(uint256 ratio) external onlyOwner {\n110: function setPeUSDExtraRatio(uint256 ratio) external onlyOwner {\n115: function setBoost(address _boost) external onlyOwner {\n119: function setRewardsDuration(uint256 _duration) external onlyOwner {\n124: function setEthlbrStakeInfo(address _pool, address _lp) external onlyOwner {\n128: function setEUSDBuyoutAllowed(bool _bool) external onlyOwner {\n\n\nFILE: 2023-06-lybra/contracts/lybra/miner/ProtocolRewardsPool.sol\n\n52: function setTokenAddress(address _eslbr, address _lbr, address _boost) external onlyOwner {\n58: function setGrabCost(uint256 _ratio) external onlyOwner {\n\nFILE: Breadcrumbs2023-06-lybra/contracts/lybra/miner/stakerewardV2pool.sol\n\n121: function setRewardsDuration(uint256 _duration) external onlyOwner {\n127: function setBoost(address _boost) external onlyOwner {\n132: function notifyRewardAmount(uint256 _amount) external onlyOwner updateReward(address(0)) {\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4} {"source": "c4", "protocol": "04-caviar", "title": "mgf15 G", "severity_raw": "High", "severity": "high", "description": "\n## Gas Optimizations\n\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [GAS-1](#GAS-1) | Using bools for storage incurs overhead | 3 |\n| [GAS-2](#GAS-2) | Cache array length outside of loop | 19 |\n| [GAS-3](#GAS-3) | Don't initialize variables with default value | 21 |\n| [GAS-4](#GAS-4) | Functions guaranteed to revert when called by normal users can be marked `payable` | 10 |\n| [GAS-5](#GAS-5) | `++i` costs less gas than `i++`, especially when it's used in `for`-loops (`--i`/`i--` too) | 19 |\n| [GAS-6](#GAS-6) | Use != 0 instead of > 0 for unsigned integer comparison | 17 |\n| [GAS-7](#GAS-7) | += costs more gas than = + for state variables (-= too) | 9 |\n| [GAS-8](#GAS-8) | Setting the constructor to payable | 3 |\n| [GAS-9](#GAS-9) | Structs can be packed into fewer storage slots | 5 |\n\n\n### [GAS-1] Using bools for storage incurs overhead\nUse uint256(1) and uint256(2) for true/false to avoid a Gwarmaccess (100 gas), and to avoid Gsset (20000 gas) when changing from \u2018false\u2019 to \u2018true\u2019, after having been \u2018true\u2019 in the past. See [source](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/58f635312aa21f947cae5f8578638a85aa2519f5/contracts/security/ReentrancyGuard.sol#L23-L27).\n\n*Instances (3)*:\n```solidity\nFile: 2023-04-caviar/src/PrivatePool.sol\n\n94: bool public initialized;\n\n97: bool public payRoyalties;\n\n100: bool public useStolenNftOracle;\n\n```\n\n### [GAS-2] Cache array length outside of loop\nIf not cached, the solidity compiler will always read the length of the array during each iteration. That is, if it is a storage array, this is an extra sload operation (100 additional extra gas for each iteration except for the first) and if it is a memory array, this is an extra mload operation (3 additional gas for each iteration except for the first).\n\n*Instances (19)*:\n```solidity\nFile: 2023-04-caviar/src/EthRouter.sol\n\n106: for (uint256 i = 0; i < buys.length; i++) {\n\n116: for (uint256 j = 0; j < buys[i].tokenIds.lengt", "vulnerable_code": "File: 2023-04-caviar/src/PrivatePool.sol\n\n94: bool public initialized;\n\n97: bool public payRoyalties;\n\n100: bool public useStolenNftOracle;\n", "fixed_code": "File: 2023-04-caviar/src/EthRouter.sol\n\n106: for (uint256 i = 0; i < buys.length; i++) {\n\n116: for (uint256 j = 0; j < buys[i].tokenIds.length; j++) {\n\n134: for (uint256 j = 0; j < buys[i].tokenIds.length; j++) {\n\n159: for (uint256 i = 0; i < sells.length; i++) {\n\n161: for (uint256 j = 0; j < sells[i].tokenIds.length; j++) {\n\n183: for (uint256 j = 0; j < sells[i].tokenIds.length; j++) {\n\n239: for (uint256 i = 0; i < tokenIds.length; i++) {\n\n261: for (uint256 i = 0; i < changes.length; i++) {\n\n265: for (uint256 j = 0; j < changes[i].inputTokenIds.length; j++) {\n\n284: for (uint256 j = 0; j < changes[i].outputTokenIds.length; j++) {\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/mgf15-G.md", "collected_at": "2026-01-02T18:20:43.010225+00:00", "source_hash": "b0718b1c551c5d251b72558cc62daeb353d0f4dcea1f90923ffadd4decd3720f", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 151, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: 2023-04-caviar/src/PrivatePool.sol\n\n94: bool public initialized;\n\n97: bool public payRoyalties;\n\n100: bool public useStolenNftOracle;", "primary_code_language": "solidity", "primary_code_char_count": 151, "all_code_blocks": "// Code block 1 (solidity):\nFile: 2023-04-caviar/src/PrivatePool.sol\n\n94: bool public initialized;\n\n97: bool public payRoyalties;\n\n100: bool public useStolenNftOracle;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: 2023-04-caviar/src/PrivatePool.sol\n\n94: bool public initialized;\n\n97: bool public payRoyalties;\n\n100: bool public useStolenNftOracle;", "github_refs_formatted": "ReentrancyGuard.sol#L23-L27", "github_files_list": "ReentrancyGuard.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: 2023-04-caviar/src/PrivatePool.sol\n\n94: bool public initialized;\n\n97: bool public payRoyalties;\n\n100: bool public useStolenNftOracle;\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: 2023-04-caviar/src/EthRouter.sol\n\n106: for (uint256 i = 0; i < buys.length; i++) {\n\n116: for (uint256 j = 0; j < buys[i].tokenIds.length; j++) {\n\n134: for (uint256 j = 0; j < buys[i].tokenIds.length; j++) {\n\n159: for (uint256 i = 0; i < sells.length; i++) {\n\n161: for (uint256 j = 0; j < sells[i].tokenIds.length; j++) {\n\n183: for (uint256 j = 0; j < sells[i].tokenIds.length; j++) {\n\n239: for (uint256 i = 0; i < tokenIds.length; i++) {\n\n261: for (uint256 i = 0; i < changes.length; i++) {\n\n265: for (uint256 j = 0; j < changes[i].inputTokenIds.length; j++) {\n\n284: for (uint256 j = 0; j < changes[i].outputTokenIds.length; j++) {\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "08-dopex", "title": "0xWagmi Q", "severity_raw": "Critical", "severity": "critical", "description": "### Q/A Report \n\n| Letter | Name | Description |\n|:--:|:-------:|:-------:|\n| L | Low risk | Potential risk |\n| NC | Non-critical | Non risky findings |\n| R | Refactor | Changing the code |\n| O | Ordinary | Often found issues |\n\n| Total Found Issues | 3 |\n|:--:|:--:|\n\n\n---\n\n \n## Low[0] `calculateFunding()` function could be bypassed by passing a array with a length 0 ;\n\nCODE : https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/perp-vault/PerpetualAtlanticVault.sol#L405\n\n\n### Vulnerability details \n\nIn `PerpetualAtlanticVault::calculateFunding()` it takes an array of `strikes` then it checks `_isEligibleSender()`;\n```js\n function _isEligibleSender() internal view {\n // the below condition checks whether the caller is a contract or not\n if (msg.sender != tx.origin) {\n require(whitelistedContracts[msg.sender], \"Contract must be whitelisted\");\n }\n }\n```\nConsider this also another low severity vulnerability . we should avoid using `tx.origin` much as possible, https://twitter.com/pashovkrum/status/1692151232503144578 \n\nOk , so we have ` for (uint256 i = 0; i < strikes.length; i++) {` which takes a strikes array and calculate the `fundingAccrued` \nbased on that.But it never checks that `array.length > 0` so the whole logic inside the for loop could be bypassed ,\n\n\n### POC \n`copy this test into /tests/perp-vault/Integration.sol`\n`forge test --match-path ./tests/perp-vault/Integration.t.sol -vvvv`\n\n```js\nfunction test_strike_bypass_checks() public {\n uint256[] memory strikes = new uint256[](0);\n uint256 fundingAccrued = vault.calculateFunding(strikes);\n}\n\n```\n\n### Tools Used\nManual Review / foundry \n\n### Mitigation steps \nConsider checking the length of the array is greater than 0 else revert the function \n\n---\n\n\n## Low[1] Re-assignable `assetSymbol` result in pointing to a invalid reserveAsset \n\n### Vulnerability details \nIn `rdpxV2Core::addAssetTotokenReserves` it isn't checked that the token symbol i", "vulnerable_code": " function _isEligibleSender() internal view {\n // the below condition checks whether the caller is a contract or not\n if (msg.sender != tx.origin) {\n require(whitelistedContracts[msg.sender], \"Contract must be whitelisted\");\n }\n }", "fixed_code": "function test_strike_bypass_checks() public {\n uint256[] memory strikes = new uint256[](0);\n uint256 fundingAccrued = vault.calculateFunding(strikes);\n}\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/0xWagmi-Q.md", "collected_at": "2026-01-02T18:24:20.451580+00:00", "source_hash": "b07ba779aa78f5e436a2300ab50462d86ef3a032770392e8247dccd3872484c2", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 422, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _isEligibleSender() internal view {\n // the below condition checks whether the caller is a contract or not\n if (msg.sender != tx.origin) {\n require(whitelistedContracts[msg.sender], \"Contract must be whitelisted\");\n }\n }", "primary_code_language": "js", "primary_code_char_count": 264, "all_code_blocks": "// Code block 1 (js):\nfunction _isEligibleSender() internal view {\n // the below condition checks whether the caller is a contract or not\n if (msg.sender != tx.origin) {\n require(whitelistedContracts[msg.sender], \"Contract must be whitelisted\");\n }\n }\n\n// Code block 2 (js):\nfunction test_strike_bypass_checks() public {\n uint256[] memory strikes = new uint256[](0);\n uint256 fundingAccrued = vault.calculateFunding(strikes);\n}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "PerpetualAtlanticVault.sol#L405", "github_files_list": "PerpetualAtlanticVault.sol", "github_refs_count": 1, "vulnerable_code_actual": " function _isEligibleSender() internal view {\n // the below condition checks whether the caller is a contract or not\n if (msg.sender != tx.origin) {\n require(whitelistedContracts[msg.sender], \"Contract must be whitelisted\");\n }\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function test_strike_bypass_checks() public {\n uint256[] memory strikes = new uint256[](0);\n uint256 fundingAccrued = vault.calculateFunding(strikes);\n}\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "04-caviar", "title": "hunter_w3b G", "severity_raw": "High", "severity": "high", "description": "# Gas Optimization\n\n# Summary\n\n| Number | Optimization Details | Context |\n| :----: | :------------------------------------------------------------------------------------------- | :-----: |\n| [G-01] | FUNCTIONS GUARANTEED TO REVERT WHEN CALLED BY NORMAL USERS CAN BE MARKED\u00a0PAYABLE | 10 |\n| [G-02] | \u00a0 += \u00a0COSTS MORE GAS THAN\u00a0 = + \u00a0FOR STATE VARIABLES | 4 |\n| [G-03] | PUBLIC FUNCTIONS NOT CALLED BY THE CONTRACT SHOULD BE DECLARED EXTERNAL INSTEAD | 9 |\n| [G-04] | SETTING THE\u00a0CONSTRUCTOR TO PAYABLE | 3 |\n| [G-05] | STATE VARIABLES SHOULD BE CACHED IN STACK VARIABLES RATHER THAN RE-READING THEM FROM STORAGE | 14 |\n| [G-06] | NOT USING THE NAMED RETURN VARIABLES WHEN A FUNCTION RETURNS, WASTES DEPLOYMENT GAS | 9 |\n| [G-07] | USING\u00a0CALLDATA\u00a0INSTEAD OF\u00a0MEMORY\u00a0FOR READ-ONLY ARGUMENTS IN EXTERNAL FUNCTIONS SAVES GAS | 8 |\n| [G-08] | USE ASSEMBLY TO CHECK FOR\u00a0ADDRESS(0) | 19 |\n| [G-09] | The result of function calls should be cached rather than re-calling the function | 3 |\n| [G-10] | REORDER STRUCTURE LAYOUT | 1 |\n| [G-11] | With assembly,\u00a0.call (bool success) \u00a0transfer can be done gas-optimized | 1 |\n| [G-12] | Duplicated require()/if() checks should be refactored to a modifier or function | 29 |\n| [G-13] | Use nested if and, avoid multiple check combinations | 11 |\n| [G-14] | Use\u00a0assembly\u00a0to write\u00a0address storage values | 8 |\n| [G-15] | abi.encodePacked() efficient then abi.encode() | 1 ", "vulnerable_code": "File: /src/Factory.sol\n\n129 function setPrivatePoolMetadata(address _privatePoolMetadata) public onlyOwner {\n\n135 function setPrivatePoolImplementation(address _privatePoolImplementation) public onlyOwner {\n\n141 function setProtocolFeeRate(uint16 _protocolFeeRate) public onlyOwner {\n\n148 function withdraw(address token, uint256 amount) public onlyOwner {\n", "fixed_code": "File: /src/PrivatePool.sol\n\n514 function withdraw(address _nft, uint256[] calldata tokenIds, address token, uint256 tokenAmount) public onlyOwner {\n\n538 function setVirtualReserves(uint128 newVirtualBaseTokenReserves, uint128 newVirtualNftReserves) public onlyOwner {\n\n550 function setMerkleRoot(bytes32 newMerkleRoot) public onlyOwner {\n\n562 function setFeeRate(uint16 newFeeRate) public onlyOwner {\n\n576 function setUseStolenNftOracle(bool newUseStolenNftOracle) public onlyOwner {\n\n587 function setPayRoyalties(bool newPayRoyalties) public onlyOwner {", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/hunter_w3b-G.md", "collected_at": "2026-01-02T18:20:35.021069+00:00", "source_hash": "b08e11584a75c260181121befbd32c0c75d579a99548f2aecfcbb085148f689b", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: /src/Factory.sol\n\n129 function setPrivatePoolMetadata(address _privatePoolMetadata) public onlyOwner {\n\n135 function setPrivatePoolImplementation(address _privatePoolImplementation) public onlyOwner {\n\n141 function setProtocolFeeRate(uint16 _protocolFeeRate) public onlyOwner {\n\n148 function withdraw(address token, uint256 amount) public onlyOwner {\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: /src/PrivatePool.sol\n\n514 function withdraw(address _nft, uint256[] calldata tokenIds, address token, uint256 tokenAmount) public onlyOwner {\n\n538 function setVirtualReserves(uint128 newVirtualBaseTokenReserves, uint128 newVirtualNftReserves) public onlyOwner {\n\n550 function setMerkleRoot(bytes32 newMerkleRoot) public onlyOwner {\n\n562 function setFeeRate(uint16 newFeeRate) public onlyOwner {\n\n576 function setUseStolenNftOracle(bool newUseStolenNftOracle) public onlyOwner {\n\n587 function setPayRoyalties(bool newPayRoyalties) public onlyOwner {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-asymmetry", "title": "Haipls G", "severity_raw": "Low", "severity": "low", "description": "## Derivative never deleting\nEven when the weight for the `derivative` was set to 0, it still affects the price of transactions\n*Instances:*\n```\ncontracts\\SafEth\\derivatives\\SafEth.sol\n\n71: for (uint i = 0; i < derivativeCount; i++)\n72: underlyingValue +=\n73: (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n74: derivatives[i].balance()) /\n75: 10 ** 18;\n\n84: for (uint i = 0; i < derivativeCount; i++) {\n85: uint256 weight = weights[i];\n86: IDerivative derivative = derivatives[i];\n87: if (weight == 0) continue;\n\n113: for (uint256 i = 0; i < derivativeCount; i++) {\n114: // withdraw a percentage of each asset based on the amount of safETH\n115: uint256 derivativeAmount = (derivatives[i].balance() *\n116: _safEthAmount) / safEthTotalSupply;\n117: if (derivativeAmount == 0) continue; // if derivative empty ignore\n118: derivatives[i].withdraw(derivativeAmount);\n\n```\n\n## Duplicate code should be extracted into a separate internal function.\nIn the contracts, there are duplicates of identical pieces of code that should be extracted into internal functions for optimizing contract size, gas usage, and readability.\n\n*Instances:*\n```\ncontracts\\SafEth\\derivatives\\Reth.sol\n\n121: address rocketDepositPoolAddress = RocketStorageInterface(\n122: ROCKET_STORAGE_ADDRESS\n123: ).getAddress(\n124: keccak256(\n125: abi.encodePacked(\"contract.address\", \"rocketDepositPool\")\n126: )\n127: );\n128: RocketDepositPoolInterface rocketDepositPool = RocketDepositPoolInterface(\n129: rocketDepositPoolAddress\n130: );\n\n158: address rocketDepositPoolAddress = RocketStorageInterface(\n159: ROCKET_STORAGE_ADDRESS\n160: ).getAddress(\n161: keccak256(\n162: ", "vulnerable_code": "contracts\\SafEth\\derivatives\\SafEth.sol\n\n71: for (uint i = 0; i < derivativeCount; i++)\n72: underlyingValue +=\n73: (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n74: derivatives[i].balance()) /\n75: 10 ** 18;\n\n84: for (uint i = 0; i < derivativeCount; i++) {\n85: uint256 weight = weights[i];\n86: IDerivative derivative = derivatives[i];\n87: if (weight == 0) continue;\n\n113: for (uint256 i = 0; i < derivativeCount; i++) {\n114: // withdraw a percentage of each asset based on the amount of safETH\n115: uint256 derivativeAmount = (derivatives[i].balance() *\n116: _safEthAmount) / safEthTotalSupply;\n117: if (derivativeAmount == 0) continue; // if derivative empty ignore\n118: derivatives[i].withdraw(derivativeAmount);\n", "fixed_code": "contracts\\SafEth\\derivatives\\Reth.sol\n\n121: address rocketDepositPoolAddress = RocketStorageInterface(\n122: ROCKET_STORAGE_ADDRESS\n123: ).getAddress(\n124: keccak256(\n125: abi.encodePacked(\"contract.address\", \"rocketDepositPool\")\n126: )\n127: );\n128: RocketDepositPoolInterface rocketDepositPool = RocketDepositPoolInterface(\n129: rocketDepositPoolAddress\n130: );\n\n158: address rocketDepositPoolAddress = RocketStorageInterface(\n159: ROCKET_STORAGE_ADDRESS\n160: ).getAddress(\n161: keccak256(\n162: abi.encodePacked(\"contract.address\", \"rocketDepositPool\")\n163: )\n164: );\n165: \n166: RocketDepositPoolInterface rocketDepositPool = RocketDepositPoolInterface(\n167: rocketDepositPoolAddress\n168: );", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Haipls-G.md", "collected_at": "2026-01-02T18:18:06.541737+00:00", "source_hash": "b0a9664a9beafb5fdde459f60c53d53e7f7c56c8c4d14e661947178b4c20195e", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 917, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "contracts\\SafEth\\derivatives\\SafEth.sol\n\n71: for (uint i = 0; i < derivativeCount; i++)\n72: underlyingValue +=\n73: (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n74: derivatives[i].balance()) /\n75: 10 ** 18;\n\n84: for (uint i = 0; i < derivativeCount; i++) {\n85: uint256 weight = weights[i];\n86: IDerivative derivative = derivatives[i];\n87: if (weight == 0) continue;\n\n113: for (uint256 i = 0; i < derivativeCount; i++) {\n114: // withdraw a percentage of each asset based on the amount of safETH\n115: uint256 derivativeAmount = (derivatives[i].balance() *\n116: _safEthAmount) / safEthTotalSupply;\n117: if (derivativeAmount == 0) continue; // if derivative empty ignore\n118: derivatives[i].withdraw(derivativeAmount);", "primary_code_language": "unknown", "primary_code_char_count": 917, "all_code_blocks": "// Code block 1 (unknown):\ncontracts\\SafEth\\derivatives\\SafEth.sol\n\n71: for (uint i = 0; i < derivativeCount; i++)\n72: underlyingValue +=\n73: (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n74: derivatives[i].balance()) /\n75: 10 ** 18;\n\n84: for (uint i = 0; i < derivativeCount; i++) {\n85: uint256 weight = weights[i];\n86: IDerivative derivative = derivatives[i];\n87: if (weight == 0) continue;\n\n113: for (uint256 i = 0; i < derivativeCount; i++) {\n114: // withdraw a percentage of each asset based on the amount of safETH\n115: uint256 derivativeAmount = (derivatives[i].balance() *\n116: _safEthAmount) / safEthTotalSupply;\n117: if (derivativeAmount == 0) continue; // if derivative empty ignore\n118: derivatives[i].withdraw(derivativeAmount);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "contracts\\SafEth\\derivatives\\SafEth.sol\n\n71: for (uint i = 0; i < derivativeCount; i++)\n72: underlyingValue +=\n73: (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n74: derivatives[i].balance()) /\n75: 10 ** 18;\n\n84: for (uint i = 0; i < derivativeCount; i++) {\n85: uint256 weight = weights[i];\n86: IDerivative derivative = derivatives[i];\n87: if (weight == 0) continue;\n\n113: for (uint256 i = 0; i < derivativeCount; i++) {\n114: // withdraw a percentage of each asset based on the amount of safETH\n115: uint256 derivativeAmount = (derivatives[i].balance() *\n116: _safEthAmount) / safEthTotalSupply;\n117: if (derivativeAmount == 0) continue; // if derivative empty ignore\n118: derivatives[i].withdraw(derivativeAmount);\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "contracts\\SafEth\\derivatives\\Reth.sol\n\n121: address rocketDepositPoolAddress = RocketStorageInterface(\n122: ROCKET_STORAGE_ADDRESS\n123: ).getAddress(\n124: keccak256(\n125: abi.encodePacked(\"contract.address\", \"rocketDepositPool\")\n126: )\n127: );\n128: RocketDepositPoolInterface rocketDepositPool = RocketDepositPoolInterface(\n129: rocketDepositPoolAddress\n130: );\n\n158: address rocketDepositPoolAddress = RocketStorageInterface(\n159: ROCKET_STORAGE_ADDRESS\n160: ).getAddress(\n161: keccak256(\n162: abi.encodePacked(\"contract.address\", \"rocketDepositPool\")\n163: )\n164: );\n165: \n166: RocketDepositPoolInterface rocketDepositPool = RocketDepositPoolInterface(\n167: rocketDepositPoolAddress\n168: );", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "02-ai-arena", "title": "0xKowalski Q", "severity_raw": "High", "severity": "high", "description": "[L-1] Potential DoS from High `roundId`/`winnerAddresses` in [`MergingPool::claimRewards`](https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/MergingPool.sol#L134-L167)\n\nWith increased round counts and/or `winnerAddresses`, users might face a DoS scenario when claiming large amounts of overdue rewards, due to the nested loops.\n\n```\n uint32 lowerBound = numRoundsClaimed[msg.sender];\n for (uint32 currentRound = lowerBound; currentRound < roundId; currentRound++) {\n numRoundsClaimed[msg.sender] += 1;\n winnersLength = winnerAddresses[currentRound].length;\n for (uint32 j = 0; j < winnersLength; j++) {\n if (msg.sender == winnerAddresses[currentRound][j]) {\n _fighterFarmInstance.mintFromMergingPool(\n msg.sender,\n modelURIs[claimIndex],\n modelTypes[claimIndex],\n customAttributes[claimIndex]\n );\n claimIndex += 1;\n }\n }\n }\n```\n\nConsider a user who has participated in 100 bi-weekly rounds over four years without claiming any rewards. Over this period, the platform's user base\u2014and consequently, the number of `winnerAddresses`\u2014has grown significantly. Initially, the user could have easily claimed rewards when the number of winners per round was low. However, as the platform expanded, each round's `winnerAddresses` array became substantially larger, due to admins increasing the size to account for new players.\n\nNow imagine the user attempts to claim rewards from these 100 rounds. The transaction has to navigate through the much larger `winnerAddresses` for each round. This translates to higher gas costs, which, assuming the user mints in some of these rounds, might surpass the block's gas limit. As a result, the user could find themselves unable to claim their rewards.\n\nDue to it being unlikely a use", "vulnerable_code": " uint32 lowerBound = numRoundsClaimed[msg.sender];\n for (uint32 currentRound = lowerBound; currentRound < roundId; currentRound++) {\n numRoundsClaimed[msg.sender] += 1;\n winnersLength = winnerAddresses[currentRound].length;\n for (uint32 j = 0; j < winnersLength; j++) {\n if (msg.sender == winnerAddresses[currentRound][j]) {\n _fighterFarmInstance.mintFromMergingPool(\n msg.sender,\n modelURIs[claimIndex],\n modelTypes[claimIndex],\n customAttributes[claimIndex]\n );\n claimIndex += 1;\n }\n }\n }", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/0xKowalski-Q.md", "collected_at": "2026-01-02T19:02:02.876433+00:00", "source_hash": "b0b18b470c855ab82854f2ad54aa75101b1f20bf82bff30c2797aa56e9bbcf18", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 726, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "uint32 lowerBound = numRoundsClaimed[msg.sender];\n for (uint32 currentRound = lowerBound; currentRound < roundId; currentRound++) {\n numRoundsClaimed[msg.sender] += 1;\n winnersLength = winnerAddresses[currentRound].length;\n for (uint32 j = 0; j < winnersLength; j++) {\n if (msg.sender == winnerAddresses[currentRound][j]) {\n _fighterFarmInstance.mintFromMergingPool(\n msg.sender,\n modelURIs[claimIndex],\n modelTypes[claimIndex],\n customAttributes[claimIndex]\n );\n claimIndex += 1;\n }\n }\n }", "primary_code_language": "unknown", "primary_code_char_count": 726, "all_code_blocks": "// Code block 1 (unknown):\nuint32 lowerBound = numRoundsClaimed[msg.sender];\n for (uint32 currentRound = lowerBound; currentRound < roundId; currentRound++) {\n numRoundsClaimed[msg.sender] += 1;\n winnersLength = winnerAddresses[currentRound].length;\n for (uint32 j = 0; j < winnersLength; j++) {\n if (msg.sender == winnerAddresses[currentRound][j]) {\n _fighterFarmInstance.mintFromMergingPool(\n msg.sender,\n modelURIs[claimIndex],\n modelTypes[claimIndex],\n customAttributes[claimIndex]\n );\n claimIndex += 1;\n }\n }\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "MergingPool.sol#L134-L167", "github_files_list": "MergingPool.sol", "github_refs_count": 1, "vulnerable_code_actual": " uint32 lowerBound = numRoundsClaimed[msg.sender];\n for (uint32 currentRound = lowerBound; currentRound < roundId; currentRound++) {\n numRoundsClaimed[msg.sender] += 1;\n winnersLength = winnerAddresses[currentRound].length;\n for (uint32 j = 0; j < winnersLength; j++) {\n if (msg.sender == winnerAddresses[currentRound][j]) {\n _fighterFarmInstance.mintFromMergingPool(\n msg.sender,\n modelURIs[claimIndex],\n modelTypes[claimIndex],\n customAttributes[claimIndex]\n );\n claimIndex += 1;\n }\n }\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "10-badger", "title": "jasonxiale Q", "severity_raw": "Low", "severity": "low", "description": "# [L-01] `ActivePool.feeRecipientAddress` lacks of check that `feeRecipientAddress` should be greater than address(0)\nFile:\nhttps://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/ActivePool.sol#L57\nhttps://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/ActivePool.sol#L286C2-L286C2\nhttps://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/ActivePool.sol#L362\nhttps://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/ActivePool.sol#L381\nImpact:\n`ActivePool.feeRecipientAddress` lacks of check > address(0) in `constructor` function. If `ActivePool.feeRecipientAddress` is set to `address(0)`, any stETH transfer (like ActivePool.flashLoan, ActivePool.claimFeeRecipientCollShares, ActivePool.sweepToken) before calling `ActivePool.setFeeRecipientAddress` will be sent to address(0)\n\n# [L-02] Sanity check in BorrowerOperations.sol#L463 can be removed\nFile:\nhttps://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/BorrowerOperations.sol#L463\nImpact:\nThe [sanity check](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/BorrowerOperations.sol#L463) can be removed because the check has been done in [BorrowerOperations.sol#L454](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/BorrowerOperations.sol#L454)\n\n# [L-03] comments don't comform with code in BorrowerOperations.sol\nFile:\nhttps://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/BorrowerOperations.sol#L865\nhttps://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/con", "vulnerable_code": " 881 if (_isRecoveryMode) {\n 882 _requireNoStEthBalanceDecrease(_stEthBalanceDecrease);\n 883 if (_isDebtIncrease) {\n 884 _requireICRisNotBelowCCR(_vars.newICR); <<<--------- here\n 885 _requireNoDecreaseOfICR(_vars.newICR, _vars.oldICR);\n 886 }\n 887\n ...", "fixed_code": "", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/jasonxiale-Q.md", "collected_at": "2026-01-02T18:26:52.450019+00:00", "source_hash": "b0c908eebf7960d9d841b06da94f1134843af7df1099002d76d450c5f99a8cc6", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 7, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ActivePool.sol#L57, ActivePool.sol#L286-L2, ActivePool.sol#L362, ActivePool.sol#L381, BorrowerOperations.sol#L463, BorrowerOperations.sol#L454, BorrowerOperations.sol#L865", "github_files_list": "BorrowerOperations.sol, ActivePool.sol", "github_refs_count": 7, "vulnerable_code_actual": " 881 if (_isRecoveryMode) {\n 882 _requireNoStEthBalanceDecrease(_stEthBalanceDecrease);\n 883 if (_isDebtIncrease) {\n 884 _requireICRisNotBelowCCR(_vars.newICR); <<<--------- here\n 885 _requireNoDecreaseOfICR(_vars.newICR, _vars.oldICR);\n 886 }\n 887\n ...", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "03-asymmetry", "title": "favelanky G", "severity_raw": "Low", "severity": "low", "description": "\n## [G-01] Setting the\u00a0`constructor`\u00a0to\u00a0`payable` can save gas \n\nSetting constructor to payable will save ~13 gas per instance.\n\nThere are 3 instance of this issue:\n\n```diff\n\u00a0 \u00a0 constructor() {\n\u00a0 \u00a0 \u00a0 \u00a0 _disableInitializers();\n\u00a0 \u00a0 }\n```\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol#L24-L26\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L38-L40\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L33-L35\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol#L27-L29\n\n## [G-02] Save gas with saving variables to memory\n\nThe instances below point to the second access of a storage variable within a function.\n\nThere are 2 instance of this issue:\n\n```solidity\nFile: SafEth.sol\n\t// derivativeCount can be saved in memory\n\t{\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n\t}\n\nfor (uint i = 0; i < derivativeCount; i++) {\n\t// store external call derivatives[i].balance() in memory\n\tunderlyingValue += (derivatives[i].ethPerDerivative(derivatives[i].balance()) * derivatives[i].balance()) / 10 ** 18;\n} \n```\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L186-L194\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L72-L75\n\n## [G-03] Using bools for storage incurs overhead\n\nBooleans are more expensive than uint256 or any type that takes up a full word because each write operation emits an extra SLOAD to first read the slot\u2019s contents, replace the bits taken up by the boolean, and then write back. Thi", "vulnerable_code": "https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol#L24-L26\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L38-L40\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L33-L35\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol#L27-L29\n\n## [G-02] Save gas with saving variables to memory\n\nThe instances below point to the second access of a storage variable within a function.\n\nThere are 2 instance of this issue:\n", "fixed_code": "https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L186-L194\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L72-L75\n\n## [G-03] Using bools for storage incurs overhead\n\nBooleans are more expensive than uint256 or any type that takes up a full word because each write operation emits an extra SLOAD to first read the slot\u2019s contents, replace the bits taken up by the boolean, and then write back. This is the compiler\u2019s defense against contract upgrades and pointer aliasing, and it cannot be disabled. Use uint256(1) and uint256(2) for true/false instead.\n\nThere are 2 instance of this issue:\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/favelanky-G.md", "collected_at": "2026-01-02T18:19:07.503180+00:00", "source_hash": "b0faced1ac3b4453cf0490097333d8a29ae9617ed10f47b6059b1ecb57f8eac2", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 735, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "constructor() {\n\u00a0 \u00a0 \u00a0 \u00a0 _disableInitializers();\n\u00a0 \u00a0 }", "primary_code_language": "diff", "primary_code_char_count": 53, "all_code_blocks": "// Code block 1 (diff):\nconstructor() {\n\u00a0 \u00a0 \u00a0 \u00a0 _disableInitializers();\n\u00a0 \u00a0 }\n\n// Code block 2 (solidity):\nFile: SafEth.sol\n\t// derivativeCount can be saved in memory\n\t{\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n\t}\n\nfor (uint i = 0; i < derivativeCount; i++) {\n\t// store external call derivatives[i].balance() in memory\n\tunderlyingValue += (derivatives[i].ethPerDerivative(derivatives[i].balance()) * derivatives[i].balance()) / 10 ** 18;\n}", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "constructor() {\n\u00a0 \u00a0 \u00a0 \u00a0 _disableInitializers();\n\u00a0 \u00a0 }", "solidity_code": "File: SafEth.sol\n\t// derivativeCount can be saved in memory\n\t{\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n\t}\n\nfor (uint i = 0; i < derivativeCount; i++) {\n\t// store external call derivatives[i].balance() in memory\n\tunderlyingValue += (derivatives[i].ethPerDerivative(derivatives[i].balance()) * derivatives[i].balance()) / 10 ** 18;\n}", "github_refs_formatted": "WstEth.sol#L24-L26, SafEth.sol#L38-L40, Reth.sol#L33-L35, SfrxEth.sol#L27-L29, SafEth.sol#L186-L194, SafEth.sol#L72-L75", "github_files_list": "SfrxEth.sol, Reth.sol, WstEth.sol, SafEth.sol", "github_refs_count": 6, "vulnerable_code_actual": "https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol#L24-L26\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L38-L40\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L33-L35\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol#L27-L29\n\n## [G-02] Save gas with saving variables to memory\n\nThe instances below point to the second access of a storage variable within a function.\n\nThere are 2 instance of this issue:\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L186-L194\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L72-L75\n\n## [G-03] Using bools for storage incurs overhead\n\nBooleans are more expensive than uint256 or any type that takes up a full word because each write operation emits an extra SLOAD to first read the slot\u2019s contents, replace the bits taken up by the boolean, and then write back. This is the compiler\u2019s defense against contract upgrades and pointer aliasing, and it cannot be disabled. Use uint256(1) and uint256(2) for true/false instead.\n\nThere are 2 instance of this issue:\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "07-amphora", "title": "SY_S G", "severity_raw": "Low", "severity": "low", "description": "## Summary\n\n### Gas Optimization\n\nno | Issue |Instances||\n|-|:-|:-:|:-:|\n| [G-01] | Use nested if and, avoid multiple check combinations | 6 | \n| [G-02] | Use\u00a0assembly\u00a0to write\u00a0address storage values | 4 | \n| [G-03] |Use hardcode address instead of address(this) | 9 | \n| [G-04] | Expressions for constant values such as a call to keccak256(), should use immutable rather than constant | 4 | \n| [G-05] |State variable can be packed into fewer storage slots | 1 | \n| [G-06] | Variable names that consist of all capital letters should be reserved for constant/immutable variables| 1 | \n| [G-07] | Non efficient zero initialization| 3 | \n| [G-08] |Duplicated require()/if() checks should be refactored to a modifier or function | 6 | \n| [G-09] |Do not calculate constant | 7 | \n| [G-10] |Should use arguments instead of state variable | 7 | \n\n\n\n\n## Gas Optimizations \n\n## [G-1] Use nested if and, avoid multiple check combinations\n\nUsing nested if is cheaper than using && multiple check combinations. There are more advantages, such as easier to read code and better coverage reports.\n\n\n```solidity\nfile: /contracts/core/Vault.sol\n\n158 if (_poolId != 0 && balances[_token] != 0 && !isTokenStaked[_token]) _canStake = true;\n\n```\nhttps://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/Vault.sol#L158\n\n\n```solidity\nfile: /contracts/core/VaultController.sol\n\n1018 if (_increase && (_collateral.totalDeposited + _amount) > _collateral.cap) revert VaultController_CapReached();\n\n```\nhttps://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/VaultController.sol#L1018\n\n\n```solidity\nfile: /contracts/governance/GovernorCharlie.sol\n\n170 if (amph.getPriorVotes(msg.sender, (block.number - 1)) < proposalThreshold && !isWhitelisted(msg.sender)) {\n\n\n469 else if (\n470 (_whitelisted && _proposal.againstVotes > _proposal.quorumVotes)\n471 || (!_whitelisted && _proposal.forVotes <= _proposal.againstVotes)\n472 || (!_whiteli", "vulnerable_code": "file: /contracts/core/Vault.sol\n\n158 if (_poolId != 0 && balances[_token] != 0 && !isTokenStaked[_token]) _canStake = true;\n", "fixed_code": "file: /contracts/core/VaultController.sol\n\n1018 if (_increase && (_collateral.totalDeposited + _amount) > _collateral.cap) revert VaultController_CapReached();\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/SY_S-G.md", "collected_at": "2026-01-02T18:23:35.872217+00:00", "source_hash": "b1dd7708219a1f478f91998b0c2f5d4c248ea60b4e21b291ba84ceda70622f90", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 288, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "file: /contracts/core/Vault.sol\n\n158 if (_poolId != 0 && balances[_token] != 0 && !isTokenStaked[_token]) _canStake = true;", "primary_code_language": "solidity", "primary_code_char_count": 126, "all_code_blocks": "// Code block 1 (solidity):\nfile: /contracts/core/Vault.sol\n\n158 if (_poolId != 0 && balances[_token] != 0 && !isTokenStaked[_token]) _canStake = true;\n\n// Code block 2 (solidity):\nfile: /contracts/core/VaultController.sol\n\n1018 if (_increase && (_collateral.totalDeposited + _amount) > _collateral.cap) revert VaultController_CapReached();", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "file: /contracts/core/Vault.sol\n\n158 if (_poolId != 0 && balances[_token] != 0 && !isTokenStaked[_token]) _canStake = true;\n\nfile: /contracts/core/VaultController.sol\n\n1018 if (_increase && (_collateral.totalDeposited + _amount) > _collateral.cap) revert VaultController_CapReached();", "github_refs_formatted": "Vault.sol#L158, VaultController.sol#L1018", "github_files_list": "VaultController.sol, Vault.sol", "github_refs_count": 2, "vulnerable_code_actual": "file: /contracts/core/Vault.sol\n\n158 if (_poolId != 0 && balances[_token] != 0 && !isTokenStaked[_token]) _canStake = true;\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "file: /contracts/core/VaultController.sol\n\n1018 if (_increase && (_collateral.totalDeposited + _amount) > _collateral.cap) revert VaultController_CapReached();\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "03-asymmetry", "title": "IgorZuk G", "severity_raw": "Low", "severity": "low", "description": "## Pack global storage variables of SafETH\n\nThe current storage takes 5 slots:\n```solidity\nbool public pauseStaking;\nbool public pauseUnstaking;\nuint256 public derivativeCount;\nuint256 public totalWeight;\nuint256 public minAmount;\nuint256 public maxAmount;\n```\n\nThis is excessive, the types can be much smaller:\n- `derivativeCount` can be `uint16` there won't be more than 65 thousand derivatives\n- `totalWeight` can be `uint32`, the weights scale of 4 billion should be accurate enough\n- `minAmount` and `maxAmount` can be `uint96`, the total supply of ETH in the ecosystem is a number that can fit in 87 bits, using 96 is more than safe.\n\nThe optimized storage fits exactly in 256 bits and takes only 1 slot:\n```solidity\nbool public pauseStaking;\nbool public pauseUnstaking;\nuint16 public derivativeCount;\nuint32 public totalWeight;\nuint96 public minAmount;\nuint96 public maxAmount;\n```\nIf it's necessary, the storage can be reduced by 1 more byte if `pause` variables are merged into a bitmap.\n\n## Pack per-derivative storage variables of SafETH\n\nEach derivative takes at least 3 slots:\n```solidity\nmapping(uint256 => IDerivative) public derivatives; // derivatives in the system\nmapping(uint256 => uint256) public weights; // weights for each derivative\n```\nThe third slot is the `maxSlippage` variable stored by each derivative.\n\n- `weights` can be reduced to `uint32` as mentioned in the global storage packing finding\n- `maxSlippage` can be reduced to `uint64`, because it only deals with numbers on a scale from `0` (no slippage allowed) to `10^18` (any slippage allowed), which needs just 60 bits. Going further this value doesn't need to be stored in each derivative separately, it can be passed in `deposit` and `withdraw` functions. It's more flexible this way, keeps the configuration in one place, simplifies the derivatives implementation and makes events cleaner, currently derivatives don't emit anything even though their internal state is changed.\n\nThe optimized per-derivative sto", "vulnerable_code": "bool public pauseStaking;\nbool public pauseUnstaking;\nuint256 public derivativeCount;\nuint256 public totalWeight;\nuint256 public minAmount;\nuint256 public maxAmount;", "fixed_code": "bool public pauseStaking;\nbool public pauseUnstaking;\nuint16 public derivativeCount;\nuint32 public totalWeight;\nuint96 public minAmount;\nuint96 public maxAmount;", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/IgorZuk-G.md", "collected_at": "2026-01-02T18:18:09.286766+00:00", "source_hash": "b1e7377e42fc7ef66b7611d3a4acc4dd23a29fced96afe58d8d9528b5eb5552c", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 481, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "bool public pauseStaking;\nbool public pauseUnstaking;\nuint256 public derivativeCount;\nuint256 public totalWeight;\nuint256 public minAmount;\nuint256 public maxAmount;", "primary_code_language": "solidity", "primary_code_char_count": 165, "all_code_blocks": "// Code block 1 (solidity):\nbool public pauseStaking;\nbool public pauseUnstaking;\nuint256 public derivativeCount;\nuint256 public totalWeight;\nuint256 public minAmount;\nuint256 public maxAmount;\n\n// Code block 2 (solidity):\nbool public pauseStaking;\nbool public pauseUnstaking;\nuint16 public derivativeCount;\nuint32 public totalWeight;\nuint96 public minAmount;\nuint96 public maxAmount;\n\n// Code block 3 (solidity):\nmapping(uint256 => IDerivative) public derivatives; // derivatives in the system\nmapping(uint256 => uint256) public weights; // weights for each derivative", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "bool public pauseStaking;\nbool public pauseUnstaking;\nuint256 public derivativeCount;\nuint256 public totalWeight;\nuint256 public minAmount;\nuint256 public maxAmount;\n\nbool public pauseStaking;\nbool public pauseUnstaking;\nuint16 public derivativeCount;\nuint32 public totalWeight;\nuint96 public minAmount;\nuint96 public maxAmount;\n\nmapping(uint256 => IDerivative) public derivatives; // derivatives in the system\nmapping(uint256 => uint256) public weights; // weights for each derivative", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "bool public pauseStaking;\nbool public pauseUnstaking;\nuint256 public derivativeCount;\nuint256 public totalWeight;\nuint256 public minAmount;\nuint256 public maxAmount;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "bool public pauseStaking;\nbool public pauseUnstaking;\nuint16 public derivativeCount;\nuint32 public totalWeight;\nuint96 public minAmount;\nuint96 public maxAmount;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "05-ajna", "title": "Rageur G", "severity_raw": "High", "severity": "high", "description": "## GAS-1: 10 ** X can be changed to 1eX\n\n### Affected file\n\n* Maths.sol (Line: 30, 34, 38, 47)\n\n## GAS-2: += costs more gas than = + for state variables\n\n### Description\n\nUsing the addition operator instead of plus-equals saves gas.\n\n### Affected file\n\n* ExtraordinaryFunding.sol (Line: 145)\n* PositionManager.sol (Line: 320, 321)\n\n## GAS-3: <= costs more gas than < + 1\n\n### Description\n\nIn Solididy, the opcode 'less or equal' doesn't exist. So the EVM will translate this by two distinct operation, first the inferior, and then the equal which cost more gas then a strict less.\n\n### Affected file\n\n* ExtraordinaryFunding.sol (Line: 173, 176, 196)\n* Maths.sol (Line: 9, 42)\n* PositionManager.sol (Line: 285, 442)\n\n## GAS-4: Cache the mapping values rather than fetch it every time\n\n### Affected file\n\n* ExtraordinaryFunding.sol (Line: 286, 287, 288, 289, 290, 291)\n* PositionManager.sol (Line: 265, 317, 493, 494, 522, 523, 529)\n\n## GAS-5: Do not calculate constants\n\n### Description\n\nDue to how constant variables are implemented (replacements at compile-time), an expression assigned to a constant variable is recomputed each time that the variable is used, which wastes some gas.\n\n### Affected file\n\n* ExtraordinaryFunding.sol (Line: 28)\n* Maths.sol (Line: 6)\n\n## GAS-6: Duplicated require()/revert() checks should be refactored to a modifier or function\n\n### Description\n\nThis saves deployment gas.\n\n### Affected file\n\n* ExtraordinaryFunding.sol (Line: 70, 139, 195)\n* PositionManager.sol (Line: 195, 372)\n\n## GAS-7: Internal functions not called by the contract should be removed to save deployment gas\n\n### Description\n\nIf the functions are required by an interface, the contract should inherit from that interface and use the override keyword.\n\n### Affected file\n\n* ExtraordinaryFunding.sol (Line: 190)\n* Funding.sol (Line: 52, 76, 103, 152)\n* Maths.sol (Line: 8, 18, 37, 41, 46)\n* PositionManager.sol (Line: 404)\n\n## GAS-8: Prefix increments cheaper than", "vulnerable_code": "### Affected file\n\n* GrantFund.sol (Line: 67)\n* PositionManager.sol (Line: 213, 390)\n\n## GAS-14: Use nested if and avoid multiple check combinations\n\n### Description\n\nUsing nested is cheaper than using && multiple check combinations. There are more advantages, such as easier to read code and better coverage reports.\n\n### Affected file\n\n* ExtraordinaryFunding.sol (Line: 196)\n\n## GAS-15: Using Solidity version 0.8.19 will provide an overall gas optimization\n\n### Description\n\nUse a solidity version of at least 0.8.0 to get overflow protection without SafeMath.\nUse a solidity version of at least 0.8.2 to get simple compiler automatic inlining.\nUse a solidity version of at least 0.8.3 to get better struct packing and cheaper multiple storage reads.\nUse a solidity version of at least 0.8.4 to get custom errors, which are cheaper at deployment than revert()/require() strings.\nUse a solidity version of at least 0.8.10 to have external calls skip contract existence checks if the external call has a return value.\n\n### Affected file\n\n* ExtraordinaryFunding.sol (Line: 3)\n* Funding.sol (Line: 3)\n* GrantFund.sol (Line: 3)\n* IExtraordinaryFunding.sol (Line: 4)\n* IFunding.sol (Line: 4)\n* IGrantFund.sol (Line: 3)\n* IStandardFunding.sol (Line: 4)\n* Maths.sol (Line: 2)\n* PositionManager.sol (Line: 3)\n\n## GAS-16: Using bools for storage incurs overhead\n\n### Description\n\nBooleans are more expensive than uint256 or any type that takes up a full word because each write operation emits an extra SLOAD to first read the slot\u2019s contents, replace the bits taken up by the boolean, and then write back. This is the compiler\u2019s defense against contract upgrades and pointer aliasing, and it cannot be disabled. Use uint256(1) and uint256(2) for true/false instead.\n\n### Affected file\n\n* ExtraordinaryFunding.sol (Line: 49)\n\n## GAS-17: Using immutable on variables that are only set in the constructor and never after (2.1k gas per var)\n\n### Description\n\nUse immutable if you want to assign a permanent val", "fixed_code": "", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/Rageur-G.md", "collected_at": "2026-01-02T18:21:08.938949+00:00", "source_hash": "b1f685cd92f9e821fbffff063ef3cc93ad282c9ab6c6691e9f9f09a7e4131506", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "### Affected file\n\n* GrantFund.sol (Line: 67)\n* PositionManager.sol (Line: 213, 390)\n\n## GAS-14: Use nested if and avoid multiple check combinations\n\n### Description\n\nUsing nested is cheaper than using && multiple check combinations. There are more advantages, such as easier to read code and better coverage reports.\n\n### Affected file\n\n* ExtraordinaryFunding.sol (Line: 196)\n\n## GAS-15: Using Solidity version 0.8.19 will provide an overall gas optimization\n\n### Description\n\nUse a solidity version of at least 0.8.0 to get overflow protection without SafeMath.\nUse a solidity version of at least 0.8.2 to get simple compiler automatic inlining.\nUse a solidity version of at least 0.8.3 to get better struct packing and cheaper multiple storage reads.\nUse a solidity version of at least 0.8.4 to get custom errors, which are cheaper at deployment than revert()/require() strings.\nUse a solidity version of at least 0.8.10 to have external calls skip contract existence checks if the external call has a return value.\n\n### Affected file\n\n* ExtraordinaryFunding.sol (Line: 3)\n* Funding.sol (Line: 3)\n* GrantFund.sol (Line: 3)\n* IExtraordinaryFunding.sol (Line: 4)\n* IFunding.sol (Line: 4)\n* IGrantFund.sol (Line: 3)\n* IStandardFunding.sol (Line: 4)\n* Maths.sol (Line: 2)\n* PositionManager.sol (Line: 3)\n\n## GAS-16: Using bools for storage incurs overhead\n\n### Description\n\nBooleans are more expensive than uint256 or any type that takes up a full word because each write operation emits an extra SLOAD to first read the slot\u2019s contents, replace the bits taken up by the boolean, and then write back. This is the compiler\u2019s defense against contract upgrades and pointer aliasing, and it cannot be disabled. Use uint256(1) and uint256(2) for true/false instead.\n\n### Affected file\n\n* ExtraordinaryFunding.sol (Line: 49)\n\n## GAS-17: Using immutable on variables that are only set in the constructor and never after (2.1k gas per var)\n\n### Description\n\nUse immutable if you want to assign a permanent val", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4} {"source": "c4", "protocol": "01-biconomy", "title": "Diana Q", "severity_raw": "Critical", "severity": "critical", "description": "\n## 01 require() should be used instead of assert()\n\nAssert should not be used except for tests,\u00a0`require`\u00a0should be used\n\nPrior to Solidity 0.8.0, pressing a confirm consumes the remainder of the process\u2019s available gas instead of returning it, as request()/revert() did.\n\nAssertion() should be avoided even after solidity version 0.8.0, because its documentation states \u201cThe Assert function generates an error of type Panic(uint256). Code that works properly should never Panic, even on invalid external input. If this happens, you need to fix it in your contract. there\u2019s a mistake\u201d.\n\n_There are 2 instances of this issue_\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/Proxy.sol\n\n```\nFile: contracts/smart-contract-wallet/Proxy.sol\n\n16:\u00a0assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));\n```\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/common/Singleton.sol\n\n```\nFile: contracts/smart-contract-wallet/common/Singleton.sol\n\n13: assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));\n```\n\n------\n\n## 02 Avoid using tx.origin\n\n`tx.origin`\u00a0is a global variable in Solidity that returns the address of the account that sent the transaction.\n\nUsing the variable could make a contract vulnerable if an authorized account calls a malicious contract. You can impersonate a user using a third party contract.\n\nThis can make it easier to create a vault on behalf of another user with an external administrator (by receiving it as an argument).\n\n_There are 3 instances of this issue_\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n\n```\nFile: contracts/smart-contract-wallet/SmartAccount.sol\n\n257: address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\n281: address payable receive", "vulnerable_code": "File: contracts/smart-contract-wallet/Proxy.sol\n\n16:\u00a0assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));", "fixed_code": "File: contracts/smart-contract-wallet/common/Singleton.sol\n\n13: assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/Diana-Q.md", "collected_at": "2026-01-02T18:13:03.104579+00:00", "source_hash": "b285cf067ce54e7c69c1db0778b947a4141c501a358dcfd3b3485629b5a97548", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 319, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/smart-contract-wallet/Proxy.sol\n\n16:\u00a0assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));", "primary_code_language": "unknown", "primary_code_char_count": 154, "all_code_blocks": "// Code block 1 (unknown):\nFile: contracts/smart-contract-wallet/Proxy.sol\n\n16:\u00a0assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));\n\n// Code block 2 (unknown):\nFile: contracts/smart-contract-wallet/common/Singleton.sol\n\n13: assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Proxy.sol, Singleton.sol, SmartAccount.sol", "github_files_list": "SmartAccount.sol, Proxy.sol, Singleton.sol", "github_refs_count": 3, "vulnerable_code_actual": "File: contracts/smart-contract-wallet/Proxy.sol\n\n16:\u00a0assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/smart-contract-wallet/common/Singleton.sol\n\n13: assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "09-ondo", "title": "ast3ros Q", "severity_raw": "Low", "severity": "low", "description": "# [L-1] PausableUpgradeable contract is not initialized\n\nContract that inherit from PausableUpgradeable should call the `__Pausable_init()` function in their initialize function. This is not done in the rUSDY contract.\n\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/b88271d64112234b7a7273cd7f3cea73c350e6a7/contracts/usdy/rUSDY.sol#L128-L131\n\n## Recommended Mitigation Steps:\n\n```diff\n ) internal onlyInitializing {\n __BlocklistClientInitializable_init(blocklist);\n __AllowlistClientInitializable_init(allowlist);\n __SanctionsListClientInitializable_init(sanctionsList);\n __rUSDY_init_unchained(_usdy, guardian, _oracle);\n+ __Pausable_init(); \n }\n```\n\n# [L-2] Number of approve needed is always minus 1\n\nIn the DestinationBridge, the number of approvals needed is always one less than the threshold. This is because there is an automatic approval when `_execute` function is called.\n\n _approve(txnHash);\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/b88271d64112234b7a7273cd7f3cea73c350e6a7/contracts/bridge/DestinationBridge.sol#L111\n\nThis means that the number of approvals needed is always reduced by one. For example, if the threshold is 2, then the number of approvals needed is 1. If the threshold is 3, then the number of approvals needed is 2.\n\n# [NC-1] Unnecessary overflow checking\n\nIn `_rmul` function, the x * y operation is executed in the _mul(x, y) function. The _mul function performs the overflow checking by `require(y == 0 || (z = x * y) / y == x);`. However since solidity 0.8, overflow checking is done by default. Therefore, the overflow checking in _mul function is unnecessary and can be removed.\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/b88271d64112234b7a7273cd7f3cea73c350e6a7/contracts/rwaOracles/RWADynamicOracle.sol#L405-L407\n\n# [NC-2] State is not cleared for the executed transaction\n\nIn the destination bridge, after the transaction is executed, not all the state variables related to the transaction", "vulnerable_code": "", "fixed_code": "", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/ast3ros-Q.md", "collected_at": "2026-01-02T18:25:47.557988+00:00", "source_hash": "b28742ca7a2e4e7b548d2c6873c23f664f0c01293da6f039c3199e5b099b4025", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 304, "github_ref_count": 3, "vulnerable_code_is_url": true, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": ") internal onlyInitializing {\n __BlocklistClientInitializable_init(blocklist);\n __AllowlistClientInitializable_init(allowlist);\n __SanctionsListClientInitializable_init(sanctionsList);\n __rUSDY_init_unchained(_usdy, guardian, _oracle);\n+ __Pausable_init(); \n }", "primary_code_language": "diff", "primary_code_char_count": 304, "all_code_blocks": "// Code block 1 (diff):\n) internal onlyInitializing {\n __BlocklistClientInitializable_init(blocklist);\n __AllowlistClientInitializable_init(allowlist);\n __SanctionsListClientInitializable_init(sanctionsList);\n __rUSDY_init_unchained(_usdy, guardian, _oracle);\n+ __Pausable_init(); \n }", "all_code_blocks_count": 1, "has_diff_blocks": true, "diff_code": ") internal onlyInitializing {\n __BlocklistClientInitializable_init(blocklist);\n __AllowlistClientInitializable_init(allowlist);\n __SanctionsListClientInitializable_init(sanctionsList);\n __rUSDY_init_unchained(_usdy, guardian, _oracle);\n+ __Pausable_init(); \n }", "solidity_code": "", "github_refs_formatted": "rUSDY.sol#L128-L131, DestinationBridge.sol#L111, RWADynamicOracle.sol#L405-L407", "github_files_list": "rUSDY.sol, RWADynamicOracle.sol, DestinationBridge.sol", "github_refs_count": 3, "vulnerable_code_actual": "", "has_vulnerable_code_snippet": false, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 7} {"source": "c4", "protocol": "04-caviar", "title": "ayden G", "severity_raw": "Gas", "severity": "gas", "description": "https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L94#L100\nUsing bools for storage incurs overhead\nUse uint256(1) and uint256(2) for true/false to avoid a Gwarmaccess (100 gas), and to avoid Gsset (20000 gas) when changing from \u2018false\u2019 to \u2018true\u2019, after having been \u2018true\u2019 in the past\n\nuse assembly to check for address(0) save more gas\n\n```solidity\nerror ZeroAddress();\nfunction assembly_notZero(address toCheck) public pure returns(bool success) {\n assembly {\n if iszero(toCheck) {\n let ptr := mload(0x40)\n mstore(ptr, 0xd92e233d00000000000000000000000000000000000000000000000000000000) // selector for `ZeroAddress()`\n revert(ptr, 0x4)\n }\n }\n return true;\n}\n```\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L484#L507\nOptimize code logic by reducing the check for zero address when dealing with 'baseToken', storing the length of 'tokenIds' as a local variable, and moving the 'i++' incrementation inside the 'unchecked' statement.\n\n```solidity\n // ~~~ Checks ~~~ //\n\n if((baseToken == address(0))){\n //eth\n if(msg.value != baseTokenAmount) revert InvalidEthAmount();\n }else{\n //erc20\n if(msg.value > 0) revert InvalidEthAmount();\n ERC20(baseToken).safeTransferFrom(msg.sender, address(this), baseTokenAmount);\n }\n\n // ~~~ Interactions ~~~ //\n\n // transfer the nfts from the caller\n uint256 tokenIdsLength = tokenIds.length;\n for (uint256 i = 0; i < tokenIdsLength;) {\n ERC721(nft).safeTransferFrom(msg.sender, address(this), tokenIds[i]);\n unchecked{i++;}\n }\n\n // emit the deposit event\n emit Deposit(tokenIds, baseTokenAmount);\n }\n```\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L221\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L306\nhttps://github.com/code-423n4/2", "vulnerable_code": "error ZeroAddress();\nfunction assembly_notZero(address toCheck) public pure returns(bool success) {\n assembly {\n if iszero(toCheck) {\n let ptr := mload(0x40)\n mstore(ptr, 0xd92e233d00000000000000000000000000000000000000000000000000000000) // selector for `ZeroAddress()`\n revert(ptr, 0x4)\n }\n }\n return true;\n}", "fixed_code": " // ~~~ Checks ~~~ //\n\n if((baseToken == address(0))){\n //eth\n if(msg.value != baseTokenAmount) revert InvalidEthAmount();\n }else{\n //erc20\n if(msg.value > 0) revert InvalidEthAmount();\n ERC20(baseToken).safeTransferFrom(msg.sender, address(this), baseTokenAmount);\n }\n\n // ~~~ Interactions ~~~ //\n\n // transfer the nfts from the caller\n uint256 tokenIdsLength = tokenIds.length;\n for (uint256 i = 0; i < tokenIdsLength;) {\n ERC721(nft).safeTransferFrom(msg.sender, address(this), tokenIds[i]);\n unchecked{i++;}\n }\n\n // emit the deposit event\n emit Deposit(tokenIds, baseTokenAmount);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/ayden-G.md", "collected_at": "2026-01-02T18:20:16.236967+00:00", "source_hash": "b29fce6861cd00a8fcf0bb33614beb47015d25d02ef621e808fa9fce3142f76e", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 1103, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "error ZeroAddress();\nfunction assembly_notZero(address toCheck) public pure returns(bool success) {\n assembly {\n if iszero(toCheck) {\n let ptr := mload(0x40)\n mstore(ptr, 0xd92e233d00000000000000000000000000000000000000000000000000000000) // selector for `ZeroAddress()`\n revert(ptr, 0x4)\n }\n }\n return true;\n}", "primary_code_language": "solidity", "primary_code_char_count": 366, "all_code_blocks": "// Code block 1 (solidity):\nerror ZeroAddress();\nfunction assembly_notZero(address toCheck) public pure returns(bool success) {\n assembly {\n if iszero(toCheck) {\n let ptr := mload(0x40)\n mstore(ptr, 0xd92e233d00000000000000000000000000000000000000000000000000000000) // selector for `ZeroAddress()`\n revert(ptr, 0x4)\n }\n }\n return true;\n}\n\n// Code block 2 (solidity):\n// ~~~ Checks ~~~ //\n\n if((baseToken == address(0))){\n //eth\n if(msg.value != baseTokenAmount) revert InvalidEthAmount();\n }else{\n //erc20\n if(msg.value > 0) revert InvalidEthAmount();\n ERC20(baseToken).safeTransferFrom(msg.sender, address(this), baseTokenAmount);\n }\n\n // ~~~ Interactions ~~~ //\n\n // transfer the nfts from the caller\n uint256 tokenIdsLength = tokenIds.length;\n for (uint256 i = 0; i < tokenIdsLength;) {\n ERC721(nft).safeTransferFrom(msg.sender, address(this), tokenIds[i]);\n unchecked{i++;}\n }\n\n // emit the deposit event\n emit Deposit(tokenIds, baseTokenAmount);\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "error ZeroAddress();\nfunction assembly_notZero(address toCheck) public pure returns(bool success) {\n assembly {\n if iszero(toCheck) {\n let ptr := mload(0x40)\n mstore(ptr, 0xd92e233d00000000000000000000000000000000000000000000000000000000) // selector for `ZeroAddress()`\n revert(ptr, 0x4)\n }\n }\n return true;\n}\n\n// ~~~ Checks ~~~ //\n\n if((baseToken == address(0))){\n //eth\n if(msg.value != baseTokenAmount) revert InvalidEthAmount();\n }else{\n //erc20\n if(msg.value > 0) revert InvalidEthAmount();\n ERC20(baseToken).safeTransferFrom(msg.sender, address(this), baseTokenAmount);\n }\n\n // ~~~ Interactions ~~~ //\n\n // transfer the nfts from the caller\n uint256 tokenIdsLength = tokenIds.length;\n for (uint256 i = 0; i < tokenIdsLength;) {\n ERC721(nft).safeTransferFrom(msg.sender, address(this), tokenIds[i]);\n unchecked{i++;}\n }\n\n // emit the deposit event\n emit Deposit(tokenIds, baseTokenAmount);\n }", "github_refs_formatted": "PrivatePool.sol#L94, PrivatePool.sol#L484, PrivatePool.sol#L221, PrivatePool.sol#L306", "github_files_list": "PrivatePool.sol", "github_refs_count": 4, "vulnerable_code_actual": "error ZeroAddress();\nfunction assembly_notZero(address toCheck) public pure returns(bool success) {\n assembly {\n if iszero(toCheck) {\n let ptr := mload(0x40)\n mstore(ptr, 0xd92e233d00000000000000000000000000000000000000000000000000000000) // selector for `ZeroAddress()`\n revert(ptr, 0x4)\n }\n }\n return true;\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": " // ~~~ Checks ~~~ //\n\n if((baseToken == address(0))){\n //eth\n if(msg.value != baseTokenAmount) revert InvalidEthAmount();\n }else{\n //erc20\n if(msg.value > 0) revert InvalidEthAmount();\n ERC20(baseToken).safeTransferFrom(msg.sender, address(this), baseTokenAmount);\n }\n\n // ~~~ Interactions ~~~ //\n\n // transfer the nfts from the caller\n uint256 tokenIdsLength = tokenIds.length;\n for (uint256 i = 0; i < tokenIdsLength;) {\n ERC721(nft).safeTransferFrom(msg.sender, address(this), tokenIds[i]);\n unchecked{i++;}\n }\n\n // emit the deposit event\n emit Deposit(tokenIds, baseTokenAmount);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "07-amphora", "title": "uzay Q", "severity_raw": "Low", "severity": "low", "description": "# Some functions revert on failure even though they are expected to return false instead\n\nIn the `UFragments.sol` contract, the transfer and approval functions return `true` on success and `revert` on failure. However, according to the natspec comments written by the protocol developers, these functions are expected to return `false` on failure.\n\n## PoC\n```javascript\n/**\n* @notice Transfer tokens to a specified address.\n* @param _to The address to transfer to.\n* @param _value The amount to be transferred.\n* @return _success True on success, false otherwise. @audit function never returns false\n*/\nfunction transfer(address _to, uint256 _value) external override validRecipient(_to) returns (bool _success) {\n\tuint256 _gonValue = _value * _gonsPerFragment;\n\t\n\t_gonBalances[msg.sender] = _gonBalances[msg.sender] - _gonValue;\n\t_gonBalances[_to] = _gonBalances[_to] + _gonValue;\n\t\n\temit Transfer(msg.sender, _to, _value);\n\treturn true;\n}\n```\n\n## Affected functions\n`transfer()`\n`transferAll()`\n`transferFrom()`\n`transferAllFrom()`\n`approve()`\n`increaseAllowance()`\n`decreaseAllowance()`\n\n## Recommendation\nIf the comments in the code were a mistake, you can remove the related comments. However, if the comments accurately state the intended behavior, you should modify the function in a way that it returns false when the execution fails.", "vulnerable_code": "/**\n* @notice Transfer tokens to a specified address.\n* @param _to The address to transfer to.\n* @param _value The amount to be transferred.\n* @return _success True on success, false otherwise. @audit function never returns false\n*/\nfunction transfer(address _to, uint256 _value) external override validRecipient(_to) returns (bool _success) {\n\tuint256 _gonValue = _value * _gonsPerFragment;\n\t\n\t_gonBalances[msg.sender] = _gonBalances[msg.sender] - _gonValue;\n\t_gonBalances[_to] = _gonBalances[_to] + _gonValue;\n\t\n\temit Transfer(msg.sender, _to, _value);\n\treturn true;\n}", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/uzay-Q.md", "collected_at": "2026-01-02T18:24:04.463373+00:00", "source_hash": "b2b610e29cf36112fe9ca6cbb8f7e0a0a3a50586e71bc1fd753478f4fb4e1f48", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 572, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "/**\n* @notice Transfer tokens to a specified address.\n* @param _to The address to transfer to.\n* @param _value The amount to be transferred.\n* @return _success True on success, false otherwise. @audit function never returns false\n*/\nfunction transfer(address _to, uint256 _value) external override validRecipient(_to) returns (bool _success) {\n\tuint256 _gonValue = _value * _gonsPerFragment;\n\t\n\t_gonBalances[msg.sender] = _gonBalances[msg.sender] - _gonValue;\n\t_gonBalances[_to] = _gonBalances[_to] + _gonValue;\n\t\n\temit Transfer(msg.sender, _to, _value);\n\treturn true;\n}", "primary_code_language": "javascript", "primary_code_char_count": 572, "all_code_blocks": "// Code block 1 (javascript):\n/**\n* @notice Transfer tokens to a specified address.\n* @param _to The address to transfer to.\n* @param _value The amount to be transferred.\n* @return _success True on success, false otherwise. @audit function never returns false\n*/\nfunction transfer(address _to, uint256 _value) external override validRecipient(_to) returns (bool _success) {\n\tuint256 _gonValue = _value * _gonsPerFragment;\n\t\n\t_gonBalances[msg.sender] = _gonBalances[msg.sender] - _gonValue;\n\t_gonBalances[_to] = _gonBalances[_to] + _gonValue;\n\t\n\temit Transfer(msg.sender, _to, _value);\n\treturn true;\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "/**\n* @notice Transfer tokens to a specified address.\n* @param _to The address to transfer to.\n* @param _value The amount to be transferred.\n* @return _success True on success, false otherwise. @audit function never returns false\n*/\nfunction transfer(address _to, uint256 _value) external override validRecipient(_to) returns (bool _success) {\n\tuint256 _gonValue = _value * _gonsPerFragment;\n\t\n\t_gonBalances[msg.sender] = _gonBalances[msg.sender] - _gonValue;\n\t_gonBalances[_to] = _gonBalances[_to] + _gonValue;\n\t\n\temit Transfer(msg.sender, _to, _value);\n\treturn true;\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.69} {"source": "c4", "protocol": "05-ajna", "title": "Jerry0x Q", "severity_raw": "Unknown", "severity": "unknown", "description": "## Impact\nCalldata length must be greater than 68\n\n## Proof of Concept\n[mload(add(tokenDataWithSig, 68))](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/Funding.sol#L133)\n```\nrequire(tokenDataWithSig.length >68, \"invalid calldata\");\nassembly {\n tokensRequested := mload(add(tokenDataWithSig, 68))\n}\n```", "vulnerable_code": "require(tokenDataWithSig.length >68, \"invalid calldata\");\nassembly {\n tokensRequested := mload(add(tokenDataWithSig, 68))\n}", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/Jerry0x-Q.md", "collected_at": "2026-01-02T18:21:00.814354+00:00", "source_hash": "b2da531fc5bda09a5c49eaa74d738c757bf0315a90604a32af77c1b13d14e0da", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 124, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "require(tokenDataWithSig.length >68, \"invalid calldata\");\nassembly {\n tokensRequested := mload(add(tokenDataWithSig, 68))\n}", "primary_code_language": "unknown", "primary_code_char_count": 124, "all_code_blocks": "// Code block 1 (unknown):\nrequire(tokenDataWithSig.length >68, \"invalid calldata\");\nassembly {\n tokensRequested := mload(add(tokenDataWithSig, 68))\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Funding.sol#L133", "github_files_list": "Funding.sol", "github_refs_count": 1, "vulnerable_code_actual": "require(tokenDataWithSig.length >68, \"invalid calldata\");\nassembly {\n tokensRequested := mload(add(tokenDataWithSig, 68))\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 3.67} {"source": "c4", "protocol": "03-asymmetry", "title": "Dug Q", "severity_raw": "Low", "severity": "low", "description": "# `Unstaked` event data can be manipulated\n\nWhen the `unstake()` function is called, `withdraw()` is called on each derivative. At the end of each, the derivative sends its full ether balance to the `SafEth` contract. \n\n```solidity\n(bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n);\n```\n\nAfter receiving ether from each derivative, `unstake()` sends the total received ether to the user and then emits the `Unstaked` event. \n\n```solidity\nemit Unstaked(msg.sender, ethAmountToWithdraw, _safEthAmount);\n```\n\nBecause of how this works, a user could send ether to a derivative contract ahead of calling unstake(). This would cause the derivative to send more ether to the `SafEth` contract than it normally would as it would include the amount just sent to the derivative.\n\nThe funds would ultimately be returned to the user and the `Unstaked` event would store this manipulated `ethAmountToWithdraw` amount instead of the amount that was actually related to the unstaking of safETH.\n\nAs a result, event data and any dependent reporting/analytics would be compromised.\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L108-L129\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/Reth.sol#L107-L114\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/SfrxEth.sol#L60-L88\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/WstEth.sol#L56-L67\n\n# Funds are lost if `stake()` is called before the first derivative added\n\nThe `stake()` function will successfully execute even if no derivatives are added. This means that a user could stake safETH and lose all of their funds sent with the call.\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e98726", "vulnerable_code": "(bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n);", "fixed_code": "emit Unstaked(msg.sender, ethAmountToWithdraw, _safEthAmount);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Dug-Q.md", "collected_at": "2026-01-02T18:18:02.919845+00:00", "source_hash": "b30017538e6d3530d2840b1d79c984872658fdff18eaeec8221fa1602f090496", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 143, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "(bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n);", "primary_code_language": "solidity", "primary_code_char_count": 81, "all_code_blocks": "// Code block 1 (solidity):\n(bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n);\n\n// Code block 2 (solidity):\nemit Unstaked(msg.sender, ethAmountToWithdraw, _safEthAmount);", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "(bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n);\n\nemit Unstaked(msg.sender, ethAmountToWithdraw, _safEthAmount);", "github_refs_formatted": "SafEth.sol#L108-L129, Reth.sol#L107-L114, SfrxEth.sol#L60-L88, WstEth.sol#L56-L67", "github_files_list": "SfrxEth.sol, Reth.sol, WstEth.sol, SafEth.sol", "github_refs_count": 4, "vulnerable_code_actual": "(bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "emit Unstaked(msg.sender, ethAmountToWithdraw, _safEthAmount);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "11-kelp", "title": "hunter_w3b Analysis", "severity_raw": "Critical", "severity": "critical", "description": "# Analysis - Kelp DAO | rsETH Contest\n\n![Kelp DAO | rsETH](https://code4rena.com/_next/image?url=https%3A%2F%2Fstorage.googleapis.com%2Fcdn-c4-uploads-v0%2Fuploads%2F3LECGwvBspH.0&w=256&q=75)\n\n## Description overview of Kelp DAO Contest\n\n![Kelp DAO](https://i.im.ge/2023/11/15/AOVmfz.kepl-Dao.png)\n\nKelp DAO aims to unlock liquidity, DeFi opportunities, and higher rewards for restaked assets. As a DAO, Kelp operates in a decentralized manner driven by its community. The core focus of Kelp is the development of rsETH (Liquid Restaked ETH), its flagship project. RsETH provides liquid staking for ETH deposited in the EigenLayer proof-of-stake platform. It acts as a liquid token that represents the staked ETH. This innovative approach allows holders to retain ongoing staking yields while gaining liquidity and usability of their assets in decentralized finance applications.\n\n**The key contracts of Kelp DAO | rsETH protocol for this Audit are**:\n\n- **LRTDepositPool.sol**: It is the main contract that users interact with to deposit assets into the Kelp DAO protocol, allowing users to easily deposit assets and receive rsETH tokens, while properly distributing those assets across contracts, the LRTDepositPool contract forms the core user interface and asset management layer for the protocol.\n\n- **LRTConfig.sol**: The LRTConfig contract centralizes all the important configuration details of the Kelp DAO protocol.\n\n It stores information like:\n\n - Supported assets and their deposit limits\n - Contract addresses for key components\n - Token and strategy mappings\n\n- **NodeDelegator.sol**: This contract handles the actual deposit of assets into the strategies on EigenLayer.By acting as an intermediary that directly interacts with the EigenLayer strategies, the NodeDelegator contract enables assets to flow from the deposit pool into yield/liquidity generating strategies. This is a core part of realizing the liquid staking functionality that Kelp DAO aims to provide through integra", "vulnerable_code": " modifier onlyLRTManager() {\n if (!IAccessControl(address(lrtConfig)).hasRole(LRTConstants.MANAGER, msg.sender)) {\n revert ILRTConfig.CallerNotLRTConfigManager();\n }\n _;\n }", "fixed_code": " modifier onlyLRTAdmin() {\n bytes32 DEFAULT_ADMIN_ROLE = 0x00;\n if (!IAccessControl(address(lrtConfig)).hasRole(DEFAULT_ADMIN_ROLE, msg.sender)) {\n revert ILRTConfig.CallerNotLRTConfigAdmin();\n }\n _;\n }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/hunter_w3b-Analysis.md", "collected_at": "2026-01-02T18:28:06.848947+00:00", "source_hash": "b304ab6db777c7485d45cf9cd8335bc85b1852c4e7a976971aa8d820c0731ef5", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " modifier onlyLRTManager() {\n if (!IAccessControl(address(lrtConfig)).hasRole(LRTConstants.MANAGER, msg.sender)) {\n revert ILRTConfig.CallerNotLRTConfigManager();\n }\n _;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " modifier onlyLRTAdmin() {\n bytes32 DEFAULT_ADMIN_ROLE = 0x00;\n if (!IAccessControl(address(lrtConfig)).hasRole(DEFAULT_ADMIN_ROLE, msg.sender)) {\n revert ILRTConfig.CallerNotLRTConfigAdmin();\n }\n _;\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "11-kelp", "title": "mxuse Q", "severity_raw": "QA", "severity": "qa", "description": "QA (4 in total) \n\n1. GetAssetCurrentLimit\n``` javascript\nfunction getAssetCurrentLimit(address asset) public view override returns (uint256) {\n\nreturn lrtConfig.depositLimitByAsset(asset) - getTotalAssetDeposits(asset);\n\n}\n```\nThis function can be viewed by everyone and returns the Currentlimit from an asset. \n\n``` javascript\nif (depositAmount > getAssetCurrentLimit(asset)) {\n\nrevert MaximumDepositLimitReached();\n\n}\n```\nThis section of the `depositAsset` function checks whether the deposit amount exceeds the current limit obtained from `getAssetCurrentLimit(asset)`. A malicious user could monitor the asset's limit using the public function and, as it approaches the limit, intentionally causes pending transactions from honest users to fail by depositing an amount that triggers the `revert ExceededMaximumDepositLimit()` condition. This could lead to a frustrating experience for users and eventually a loss of clients. Solution: You could change the `GetAssetCurrentLimit` function to `private` instead of public\n\n2. It is recommended to include the `pause` and `unpause` functions in the `LRTConfig.sol`. While the project incorporates the pause and unpause functions in most of the \"scope.txt\" contracts, the `LRTConfig.sol` contract currently lacks this feature. For safety and user reassurance, it would be prudent to enable pausing and unpausing for this contract as well.\n\nCertainly! Here's a revised version with improved wording:\n\n3. Consider adding `onlyLRTAdmin` to the `UpdatePriceOracleFor` function so that the admin has the capability to update the price oracle.\n\n4. It's redundant to use both `onlyLRTAdmin` and `DEFAULT_ADMIN_ROLE` in the codebase while both terms have the same meaning. Choose one term for clarity and simplicity. For example, in the `updateAssetStrategy` function, you can replace `onlyRole(DEFAULT_ADMIN_ROLE)` with `onlyLRTAdmin` for consistency:\n\n```javascript\nfunction updateAssetStrategy(\n\naddress asset,\n\naddress strategy\n\n)\n\nexternal\n\nonlyRole(DE", "vulnerable_code": "This function can be viewed by everyone and returns the Currentlimit from an asset. \n", "fixed_code": "This section of the `depositAsset` function checks whether the deposit amount exceeds the current limit obtained from `getAssetCurrentLimit(asset)`. A malicious user could monitor the asset's limit using the public function and, as it approaches the limit, intentionally causes pending transactions from honest users to fail by depositing an amount that triggers the `revert ExceededMaximumDepositLimit()` condition. This could lead to a frustrating experience for users and eventually a loss of clients. Solution: You could change the `GetAssetCurrentLimit` function to `private` instead of public\n\n2. It is recommended to include the `pause` and `unpause` functions in the `LRTConfig.sol`. While the project incorporates the pause and unpause functions in most of the \"scope.txt\" contracts, the `LRTConfig.sol` contract currently lacks this feature. For safety and user reassurance, it would be prudent to enable pausing and unpausing for this contract as well.\n\nCertainly! Here's a revised version with improved wording:\n\n3. Consider adding `onlyLRTAdmin` to the `UpdatePriceOracleFor` function so that the admin has the capability to update the price oracle.\n\n4. It's redundant to use both `onlyLRTAdmin` and `DEFAULT_ADMIN_ROLE` in the codebase while both terms have the same meaning. Choose one term for clarity and simplicity. For example, in the `updateAssetStrategy` function, you can replace `onlyRole(DEFAULT_ADMIN_ROLE)` with `onlyLRTAdmin` for consistency:\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/mxuse-Q.md", "collected_at": "2026-01-02T18:28:17.193307+00:00", "source_hash": "b313059e69b18a1fae23c1111bd3920c623237d2aa611e5004ea1755692bb4bb", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 1554, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "This function can be viewed by everyone and returns the Currentlimit from an asset.", "primary_code_language": "unknown", "primary_code_char_count": 83, "all_code_blocks": "// Code block 1 (unknown):\nThis function can be viewed by everyone and returns the Currentlimit from an asset.\n\n// Code block 2 (unknown):\nThis section of the `depositAsset` function checks whether the deposit amount exceeds the current limit obtained from `getAssetCurrentLimit(asset)`. A malicious user could monitor the asset's limit using the public function and, as it approaches the limit, intentionally causes pending transactions from honest users to fail by depositing an amount that triggers the `revert ExceededMaximumDepositLimit()` condition. This could lead to a frustrating experience for users and eventually a loss of clients. Solution: You could change the `GetAssetCurrentLimit` function to `private` instead of public\n\n2. It is recommended to include the `pause` and `unpause` functions in the `LRTConfig.sol`. While the project incorporates the pause and unpause functions in most of the \"scope.txt\" contracts, the `LRTConfig.sol` contract currently lacks this feature. For safety and user reassurance, it would be prudent to enable pausing and unpausing for this contract as well.\n\nCertainly! Here's a revised version with improved wording:\n\n3. Consider adding `onlyLRTAdmin` to the `UpdatePriceOracleFor` function so that the admin has the capability to update the price oracle.\n\n4. It's redundant to use both `onlyLRTAdmin` and `DEFAULT_ADMIN_ROLE` in the codebase while both terms have the same meaning. Choose one term for clarity and simplicity. For example, in the `updateAssetStrategy` function, you can replace `onlyRole(DEFAULT_ADMIN_ROLE)` with `onlyLRTAdmin` for consistency:", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "This function can be viewed by everyone and returns the Currentlimit from an asset. \n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "This section of the `depositAsset` function checks whether the deposit amount exceeds the current limit obtained from `getAssetCurrentLimit(asset)`. A malicious user could monitor the asset's limit using the public function and, as it approaches the limit, intentionally causes pending transactions from honest users to fail by depositing an amount that triggers the `revert ExceededMaximumDepositLimit()` condition. This could lead to a frustrating experience for users and eventually a loss of clients. Solution: You could change the `GetAssetCurrentLimit` function to `private` instead of public\n\n2. It is recommended to include the `pause` and `unpause` functions in the `LRTConfig.sol`. While the project incorporates the pause and unpause functions in most of the \"scope.txt\" contracts, the `LRTConfig.sol` contract currently lacks this feature. For safety and user reassurance, it would be prudent to enable pausing and unpausing for this contract as well.\n\nCertainly! Here's a revised version with improved wording:\n\n3. Consider adding `onlyLRTAdmin` to the `UpdatePriceOracleFor` function so that the admin has the capability to update the price oracle.\n\n4. It's redundant to use both `onlyLRTAdmin` and `DEFAULT_ADMIN_ROLE` in the codebase while both terms have the same meaning. Choose one term for clarity and simplicity. For example, in the `updateAssetStrategy` function, you can replace `onlyRole(DEFAULT_ADMIN_ROLE)` with `onlyLRTAdmin` for consistency:\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "08-dopex", "title": "MatricksDeCoder Q", "severity_raw": "Medium", "severity": "medium", "description": "#### NC-1 Use named return values consistently \n\n**Description** => There are contracts that have functions that make use of named return values e.g returns (uint256 premium) in the majority of cases for functions but some functions do not use this without any logical reasoning, policy, guide or documentation as to why some use named return variables and others do not. \n\nIt is important for code to be consistent. Other contracts do not use named return variables at all whereas others do and within same contract some functions use named returns others do not.\n\nExamples below:\n\n[Majority functions in UniV2LiquidityAmo.sol use named return variables ](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/amo/UniV2LiquidityAmo.sol)\nHowever, below functions do not:\n[function getLpPrice() public view returns (uint256) { ..line 381 ](https://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/amo/UniV2LiquidityAmo.sol#L381C3-L381C56)\n[function getLpTokenBalanceInWeth() external view returns (uint256) { ..line 372 ](https://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/amo/UniV2LiquidityAmo.sol#L372) \n\n[UniV3LiquidityAmo.sol does not use named return variables at all](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/amo/UniV3LiquidityAmo.sol)\n\n[Majority functions in RdpxV2Core.sol use named return variables ](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol)\nHowever, below functions do not:\n[....) external returns (uint256) { { ..RdpxV2Core.sol line 944 ](https://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/core/RdpxV2Core.sol#L944)\n[public view returns (address, uint256, string memory) { ..RdpxV2Core.sol line 1137 ](https://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/core/RdpxV2Core.sol#L1137C5-L1137C60) \n[..function getEthPrice() publi", "vulnerable_code": " // ================================ PUBLIC VIEW FUNCTIONS ================================ //\n\n /// @notice Returns the amount of collateral and rdpx per share\n function redeemPreview(\n uint256 shares\n ) public view returns (uint256, uint256) {\n return _convertToAssets(shares);\n }\n\n /// @notice Returns the amount of shares recieved for a given amount of assets\n function previewDeposit(uint256 assets) public view returns (uint256) {\n return convertToShares(assets);\n }\n\n /// @notice Returns the amount of shares recieved for a given amount of assets\n function convertToShares(\n uint256 assets\n ) public view returns (uint256 shares) {\n uint256 supply = totalSupply;\n uint256 rdpxPriceInAlphaToken = perpetualAtlanticVault.getUnderlyingPrice();", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/MatricksDeCoder-Q.md", "collected_at": "2026-01-02T18:24:52.443267+00:00", "source_hash": "b3283ab1815d683933b8c2157306af4a7fa840942f9f19d4813727a1a8636d7d", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 7, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "UniV2LiquidityAmo.sol, UniV2LiquidityAmo.sol#L381-L3, UniV2LiquidityAmo.sol#L372, UniV3LiquidityAmo.sol, RdpxV2Core.sol, RdpxV2Core.sol#L944, RdpxV2Core.sol#L1137-L5", "github_files_list": "RdpxV2Core.sol, UniV2LiquidityAmo.sol, UniV3LiquidityAmo.sol", "github_refs_count": 7, "vulnerable_code_actual": " // ================================ PUBLIC VIEW FUNCTIONS ================================ //\n\n /// @notice Returns the amount of collateral and rdpx per share\n function redeemPreview(\n uint256 shares\n ) public view returns (uint256, uint256) {\n return _convertToAssets(shares);\n }\n\n /// @notice Returns the amount of shares recieved for a given amount of assets\n function previewDeposit(uint256 assets) public view returns (uint256) {\n return convertToShares(assets);\n }\n\n /// @notice Returns the amount of shares recieved for a given amount of assets\n function convertToShares(\n uint256 assets\n ) public view returns (uint256 shares) {\n uint256 supply = totalSupply;\n uint256 rdpxPriceInAlphaToken = perpetualAtlanticVault.getUnderlyingPrice();", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "09-ondo", "title": "InAllHonesty Q", "severity_raw": "Low", "severity": "low", "description": "### [L01] Function addChainSupport from DestinationBridge.sol should check if the chain to support is already supported to avoid gas waste or other unintended consequences.\n\n```solidity\n function addChainSupport(\n string calldata srcChain,\n string calldata srcContractAddress\n ) external onlyOwner {\n+ if (chainToApprovedSender[srcChain] != bytes32(0)) {\n+ revert ChainAlreadySupported();\n+ }\n chainToApprovedSender[srcChain] = keccak256(abi.encode(srcContractAddress));\n emit ChainIdSupported(srcChain, srcContractAddress);\n }\n\n\n// In the Structs, Events, Errors section\n+error ChainAlreadySupported();\n```\n\n### [QA01] In DestinationBridge.sol there is a comment section that marks `Public Functions`\n[Link to the bad comments](https://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/bridge/DestinationBridge.sol#L327-L329)\nNone of the functions below the comments are public, which is a bit confusing.\n\n", "vulnerable_code": " function addChainSupport(\n string calldata srcChain,\n string calldata srcContractAddress\n ) external onlyOwner {\n+ if (chainToApprovedSender[srcChain] != bytes32(0)) {\n+ revert ChainAlreadySupported();\n+ }\n chainToApprovedSender[srcChain] = keccak256(abi.encode(srcContractAddress));\n emit ChainIdSupported(srcChain, srcContractAddress);\n }\n\n\n// In the Structs, Events, Errors section\n+error ChainAlreadySupported();", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/InAllHonesty-Q.md", "collected_at": "2026-01-02T18:25:29.518531+00:00", "source_hash": "b36b072906523a9b81324b3e60d66ab3fbb537d9cd3ccff0c33f33d75ecd1a03", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 440, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function addChainSupport(\n string calldata srcChain,\n string calldata srcContractAddress\n ) external onlyOwner {\n+ if (chainToApprovedSender[srcChain] != bytes32(0)) {\n+ revert ChainAlreadySupported();\n+ }\n chainToApprovedSender[srcChain] = keccak256(abi.encode(srcContractAddress));\n emit ChainIdSupported(srcChain, srcContractAddress);\n }\n\n\n// In the Structs, Events, Errors section\n+error ChainAlreadySupported();", "primary_code_language": "solidity", "primary_code_char_count": 440, "all_code_blocks": "// Code block 1 (solidity):\nfunction addChainSupport(\n string calldata srcChain,\n string calldata srcContractAddress\n ) external onlyOwner {\n+ if (chainToApprovedSender[srcChain] != bytes32(0)) {\n+ revert ChainAlreadySupported();\n+ }\n chainToApprovedSender[srcChain] = keccak256(abi.encode(srcContractAddress));\n emit ChainIdSupported(srcChain, srcContractAddress);\n }\n\n\n// In the Structs, Events, Errors section\n+error ChainAlreadySupported();", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function addChainSupport(\n string calldata srcChain,\n string calldata srcContractAddress\n ) external onlyOwner {\n+ if (chainToApprovedSender[srcChain] != bytes32(0)) {\n+ revert ChainAlreadySupported();\n+ }\n chainToApprovedSender[srcChain] = keccak256(abi.encode(srcContractAddress));\n emit ChainIdSupported(srcChain, srcContractAddress);\n }\n\n\n// In the Structs, Events, Errors section\n+error ChainAlreadySupported();", "github_refs_formatted": "DestinationBridge.sol#L327-L329", "github_files_list": "DestinationBridge.sol", "github_refs_count": 1, "vulnerable_code_actual": " function addChainSupport(\n string calldata srcChain,\n string calldata srcContractAddress\n ) external onlyOwner {\n+ if (chainToApprovedSender[srcChain] != bytes32(0)) {\n+ revert ChainAlreadySupported();\n+ }\n chainToApprovedSender[srcChain] = keccak256(abi.encode(srcContractAddress));\n emit ChainIdSupported(srcChain, srcContractAddress);\n }\n\n\n// In the Structs, Events, Errors section\n+error ChainAlreadySupported();", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.95} {"source": "c4", "protocol": "03-asymmetry", "title": "ch0bu G", "severity_raw": "Low", "severity": "low", "description": "## 1. Using unchecked blocks to save gas - increments in for loop can be unchecked\n\nThe majority of Solidity for loops increment a uint256 variable that starts at 0. These increment operations never need to be checked for overflow/underflow because the variable will never reach the max number of uint256 (will run out of gas long before that happens). The default overflow/underflow check wastes gas in every iteration of virtually every for loop.\n\nThis saves 30-40 gas per loop iteration.\n\ne.g Let\u2019s work with a sample loop below.\n```\nfor(uint256 i; i < 10; i++){\n//doSomething\n}\n```\ncan be written as shown below.\n```\nfor(uint256 i; i < 10;) {\n // loop logic\n unchecked { i++; }\n}\n```\n\n\n```\n71 for (uint i = 0; i < derivativeCount; i++)\n84 for (uint i = 0; i < derivativeCount; i++) {\n113 for (uint256 i = 0; i < derivativeCount; i++) {\n140 for (uint i = 0; i < derivativeCount; i++) {\n147 for (uint i = 0; i < derivativeCount; i++) {\n171 for (uint256 i = 0; i < derivativeCount; i++)\n191 for (uint256 i = 0; i < derivativeCount; i++)\n```\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol\n\n\n\n## 2. Empty blocks should be removed or emit something\n\nThe code should be refactored such that they no longer exist, or the block should do something useful, such as emitting an event or reverting. If the contract is meant to be extended, the contract should be abstract and the function signatures be added without any default implementation. \n- If the block is an empty if-statement block to avoid doing subsequent checks in the else-if/else conditions, the else-if/else conditions should be nested under the negation of the if-statement, because they involve different classes of checks, which may lead to the introduction of errors when the code is later modified `(if(x){}else if(y){...}else{...} => if(!x){if(y){...}else{...}})`. \n- Empty `receive()`/`fallback()` payable functions that are not used, can be removed to save", "vulnerable_code": "for(uint256 i; i < 10; i++){\n//doSomething\n}", "fixed_code": "for(uint256 i; i < 10;) {\n // loop logic\n unchecked { i++; }\n}", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/ch0bu-G.md", "collected_at": "2026-01-02T18:18:55.773251+00:00", "source_hash": "b38008bf3476321a239db1851670a65bf96d29bbb98b83fdfffb4f50b7053d39", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 488, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "for(uint256 i; i < 10; i++){\n//doSomething\n}", "primary_code_language": "unknown", "primary_code_char_count": 44, "all_code_blocks": "// Code block 1 (unknown):\nfor(uint256 i; i < 10; i++){\n//doSomething\n}\n\n// Code block 2 (unknown):\nfor(uint256 i; i < 10;) {\n // loop logic\n unchecked { i++; }\n}\n\n// Code block 3 (unknown):\n71 for (uint i = 0; i < derivativeCount; i++)\n84 for (uint i = 0; i < derivativeCount; i++) {\n113 for (uint256 i = 0; i < derivativeCount; i++) {\n140 for (uint i = 0; i < derivativeCount; i++) {\n147 for (uint i = 0; i < derivativeCount; i++) {\n171 for (uint256 i = 0; i < derivativeCount; i++)\n191 for (uint256 i = 0; i < derivativeCount; i++)", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol", "github_files_list": "SafEth.sol", "github_refs_count": 1, "vulnerable_code_actual": "for(uint256 i; i < 10; i++){\n//doSomething\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "for(uint256 i; i < 10;) {\n // loop logic\n unchecked { i++; }\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "01-salty", "title": "bengyles Q", "severity_raw": "High", "severity": "high", "description": "# QA report\n\n## Function that modifies the state has no access control\n\n### lines\n\n\n\n### Impact\n\nContracts inheriting from this abstract contract have a public function available which changes the state and can be called by anyone. There are no parameters for this function that can be exploited but there should be no reason for a user to call this function as the indices only have to be updated after adding a token to the whitelist or removing a token from the whitelist.\n\n### Proof of Concept\n\nAdd the following test to `src/pools/tests/Pools.t.sol`\n\n```javascript\n function testUpdateArbitrageIndicies(address user) public {\n // anyone can call this function\n vm.prank(user);\n pools.updateArbitrageIndicies();\n }\n```\n\n### Tools Used\n\nvsCodium, Foundry\n\n### Recommended Mitigation Steps\n\nadd the onlyOwner modifier to the function, which might need to be imported\n\n```diff\n+ function updateArbitrageIndicies() public onlyOwner {\n bytes32[] memory poolIDs = poolsConfig.whitelistedPools();\n\n for (uint256 i = 0; i < poolIDs.length; i++) {\n bytes32 poolID = poolIDs[i];\n (IERC20 arbToken2, IERC20 arbToken3) = poolsConfig\n .underlyingTokenPair(poolID);\n\n // The middle two tokens can never be WETH in a valid arbitrage path as the path is WETH->arbToken2->arbToken3->WETH.\n if ((arbToken2 != _weth) && (arbToken3 != _weth)) {\n uint64 poolIndex1 = _poolIndex(_weth, arbToken2, poolIDs);\n uint64 poolIndex2 = _poolIndex(arbToken2, arbToken3, poolIDs);\n uint64 poolIndex3 = _poolIndex(arbToken3, _weth, poolIDs);\n\n // Check if the indicies in storage have the correct values - and if not then update them\n ArbitrageIndicies memory indicies = _arbitrageIndicies[poolID];\n if (\n ", "vulnerable_code": " function testUpdateArbitrageIndicies(address user) public {\n // anyone can call this function\n vm.prank(user);\n pools.updateArbitrageIndicies();\n }", "fixed_code": "Or add a custom check for specified contracts or addresses that are allowed to call this function, this is just an example though and depends on which roles contracts the developer thinks should have this permission.\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/bengyles-Q.md", "collected_at": "2026-01-02T19:01:33.608307+00:00", "source_hash": "b3f6326f0d94383cc414000da76cafabfe34d2141ab98853acfc27bee4349c97", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 171, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function testUpdateArbitrageIndicies(address user) public {\n // anyone can call this function\n vm.prank(user);\n pools.updateArbitrageIndicies();\n }", "primary_code_language": "javascript", "primary_code_char_count": 171, "all_code_blocks": "// Code block 1 (javascript):\nfunction testUpdateArbitrageIndicies(address user) public {\n // anyone can call this function\n vm.prank(user);\n pools.updateArbitrageIndicies();\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "PoolStats.sol#L77", "github_files_list": "PoolStats.sol", "github_refs_count": 1, "vulnerable_code_actual": " function testUpdateArbitrageIndicies(address user) public {\n // anyone can call this function\n vm.prank(user);\n pools.updateArbitrageIndicies();\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "Or add a custom check for specified contracts or addresses that are allowed to call this function, this is just an example though and depends on which roles contracts the developer thinks should have this permission.\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-revert-lend", "title": "JCK Analysis", "severity_raw": "Critical", "severity": "critical", "description": "\n\n\n## System Overview\n\n This system is designed to manage lending and borrowing operations using Uniswap V3 LP positions as collateral, with a focus on automation, liquidity management,\n\n1. V3Vault: Manages lending and borrowing operations, integrating with Uniswap V3 for liquidity management. It implements the ERC20 standard for representing shares in the lending pool and handles deposits, lending, borrowing, repayments, and liquidations.\n2. V3Oracle: Provides accurate price feeds for Uniswap V3 positions using Chainlink Feeds and Uniswap V3 TWAPs, ensuring system reliability and resilience. It manages token price fetching, verification, and configurations.\n3. InterestRateModel: Calculates interest rates for the Vault, adjusting rates based on utilization and incorporating a kink mechanism for competitive rates.\n4. FlashloanLiquidator: Facilitates atomic liquidations using Uniswap V3 Flashloans, ensuring prompt and efficient liquidation of undercollateralized loans.\n5. Swapper: Adds logic for executing swaps with different routing protocols, supporting complex swap operations within DeFi applications.\n6. V3Utils: Manages atomic swaps and liquidity functions for Uniswap V3 positions, supporting Permit2 for enhanced security and flexibility.\n7. LeverageTransformer: Enables leveraging and deleveraging of positions atomically, supporting both up and down leveraging.\n8. AutoRange: Automatically adjusts the range of positions within a vault, managing risk and optimizing returns based on market conditions.\n9. AutoCompound: Automatically compounds positions within a vault, maximizing returns based on market conditions.\n10. Automator: Serves as a base class for automator contracts, handling operator roles, fees, and permissions.\n11. AutoExit: Automatically exits positions in a v3 pool when certain conditions are met, managing risk and optimizing returns.\n\n\n## Approach Taken to the Code Base\n\nModularity: The system imports and utilizes several external libraries and interfac", "vulnerable_code": "mapping(address => bool) public transformerAllowList;", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/JCK-Analysis.md", "collected_at": "2026-01-02T19:02:59.720445+00:00", "source_hash": "b425757306f0b9e0547afd9a7e1e9a6148ab606fa8593afc0ff0b841fc3ce21c", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "mapping(address => bool) public transformerAllowList;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4} {"source": "c4", "protocol": "10-badger", "title": "JCK Q", "severity_raw": "Medium", "severity": "medium", "description": "\n\n## LOW Risk\n\n| Number | Issue | Instances |\n|--------|-------|-----------|\n|[L-01]| Use of transfer instead of safeTransfer | 4 |\n|[L-02]| Use descriptive constant instead of 0 as a parameter | 27 |\n|[L-03]| Execution at deadlines should be allowed | 3 |\n|[L-04]| Constant array index within iteration | 2 |\n|[L-05]| payable function does not transfer ETH | 2 |\n|[L-06]| Functions calling contracts with transfer hooks are missing reentrancy guards | 1 |\n|[L-07]| Subtraction may underflow if multiplication is too large | 3 |\n|[L-08]| Use of abi.encodePacked with dynamic types inside keccak256 | 1 |\n|[L-09]| Loss of precision on division | 10 |\n|[L-10]| No access control on receive/payable fallback | 2 |\n|[L-11]| Array is push()ed but not pop()ed | 1 |\n|[L-12]| Missing checks for address(0) when updating state variables | 5 |\n|[L-13]| Array lengths not checked | 7 |\n|[L-14]| Unused/empty receive/fallback | 1 |\n|[L-15]| Missing checks for address(0) in constructor | 14 |\n|[L-16]| Return values of approve not checked | 6 |\n|[L-17]| Use of ecrecover is susceptible to signature malleability | 2 |\n|[L-18]| Missing zero address check in initializer | 2 |\n|[L-19]| Named return variable used before assignment | 1 |\n|[L-20]| Revert on transfer to the zero address | 2 |\n\n\n## [L-01] Use of transfer instead of safeTransfer\n\nIt is good to add a require statement that checks the return value of token transfers, or to use something like OpenZeppelin's safeTransfer/safeTransferFrom, even if one is sure that the given token reverts in case of a failure.\n\nThis reduces the risk to zero even if these contracts are upgreadable, and it also helps with security reviews, as the auditor will not have to check this specific edge case.\n\n```solidity\nfile: main/packages/contracts/contracts/ActivePool.sol\n\n381 IERC20(token).safeTransfer(cachedFeeRecipientAddress, amount);\n\n```\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contrac", "vulnerable_code": "file: main/packages/contracts/contracts/ActivePool.sol\n\n381 IERC20(token).safeTransfer(cachedFeeRecipientAddress, amount);\n", "fixed_code": "file: main/packages/contracts/contracts/CollSurplusPool.sol\n\n148 IERC20(token).safeTransfer(feeRecipientAddress, amount);\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/JCK-Q.md", "collected_at": "2026-01-02T18:26:32.774076+00:00", "source_hash": "b44451944402f5c099f03e2832ba31250bf6d038eb33970f0f821de551aa2fdf", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 126, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "file: main/packages/contracts/contracts/ActivePool.sol\n\n381 IERC20(token).safeTransfer(cachedFeeRecipientAddress, amount);", "primary_code_language": "solidity", "primary_code_char_count": 126, "all_code_blocks": "// Code block 1 (solidity):\nfile: main/packages/contracts/contracts/ActivePool.sol\n\n381 IERC20(token).safeTransfer(cachedFeeRecipientAddress, amount);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "file: main/packages/contracts/contracts/ActivePool.sol\n\n381 IERC20(token).safeTransfer(cachedFeeRecipientAddress, amount);", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "file: main/packages/contracts/contracts/ActivePool.sol\n\n381 IERC20(token).safeTransfer(cachedFeeRecipientAddress, amount);\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "file: main/packages/contracts/contracts/CollSurplusPool.sol\n\n148 IERC20(token).safeTransfer(feeRecipientAddress, amount);\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-salty", "title": "0xSmartContractSamurai G", "severity_raw": "Low", "severity": "low", "description": "CHECKS TO HELP ME:\n\n- [ ] Gas Optimization checks\n\n - [ ] Cache read variables in memory\n - [ ] Use `calldata` instead of `memory` if not modifying the function parameter passed\n - [ ] Don't call `view` function inside of another function\n - [ ] Use `++i` instead of `i++` (gas consumption order `i+=1` > `i=i+1` > `i++` > `++i`). Same for `--i`.\n - [ ] Use `unchecked` to not check for integer overflow and underflow if not required\n - [ ] Use `constant` and `immutable` for variables that don't change\n - [ ] Use `revert` instead of `require`\n - [ ] Create custom errors rather than `revert()`/`require()` strings to save gas\n - [ ] Put `require` statements on top in a function\n - [ ] Use `indexed` if less than three arguments are there in events for faster access\n - [ ] Use `!= 0` instead of `> 0` for unsigned integer comparison\n - [ ] `internal` functions not called by the contract should be removed\n - [ ] Cache array length outside of loop\n - [ ] Use `bytes` instead of `string`. Bytes constants are more efficient than string constants\n - [ ] Use external function modifier.\n - [ ] Use full 256 bit types unless packing with other variables.\n - [ ] Splitting `require` statements that use && saves gas.\n - [ ] State variables can be packed into fewer storage slots.\n - [ ] Use scratch space for keccak.\n - [ ] No Need to Allocate Unused Variable.\n - [ ] Use basis points for ratios.\n - [ ] Skip initializing default values.\n - [ ] Non-strict inequalities are cheaper than strict ones\n - [ ] Usage of `uint8` may increase gas cost\n - [ ] Use bytesN instead of bytes[]\n - [ ] Inline a modifier that\u2019s only used once.\n - [ ] Inverting the condition of an [if-else-statement](https://gist.github.com/IllIllI000/44da6fbe9d12b9ab21af82f14add56b9) wastes gas.\n - [ ] [Consider having short revert strings.](https://gist.github.com/hrkrshnn/ee8fabd532058307229d65dcd5836ddc#consider-having-short-revert-strings)\n", "vulnerable_code": "1. should cache the length of the state variable struct, as well as some other gas optimizations.\n\nhttps://github.com/code-423n4/2024-01-salty/blob/ce719503b43ebf086f5147c0f6efc3c0890bf0f9/src/dao/Proposals.sol#L423\n", "fixed_code": "2. can do `msb = msb + 128` instead as it uses less gas...same for all below...\n\nhttps://github.com/code-423n4/2024-01-salty/blob/ce719503b43ebf086f5147c0f6efc3c0890bf0f9/src/pools/PoolMath.sol#L117-L127\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/0xSmartContractSamurai-G.md", "collected_at": "2026-01-02T19:01:07.024240+00:00", "source_hash": "b4518fe6b8c2f8a2448bf561a79cf24112ad4acecc5addc015adb606d5911852", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Proposals.sol#L423, PoolMath.sol#L117-L127", "github_files_list": "PoolMath.sol, Proposals.sol", "github_refs_count": 2, "vulnerable_code_actual": "1. should cache the length of the state variable struct, as well as some other gas optimizations.\n\nhttps://github.com/code-423n4/2024-01-salty/blob/ce719503b43ebf086f5147c0f6efc3c0890bf0f9/src/dao/Proposals.sol#L423\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "2. can do `msb = msb + 128` instead as it uses less gas...same for all below...\n\nhttps://github.com/code-423n4/2024-01-salty/blob/ce719503b43ebf086f5147c0f6efc3c0890bf0f9/src/pools/PoolMath.sol#L117-L127\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "03-asymmetry", "title": "0xnev G", "severity_raw": "Low", "severity": "low", "description": "### Summary\n\n### Gas Optimizations\n| |Issue|Instances|Total Gas Saved|\n|-|:-|:-:|:-:|\n| [G-01] | Multiple accesses of a storage variable should use a local variable cache | 1 | - |\n| [G-02] | Emit memory value instead of state variable | 4 | 388 |\n| [G-03] | Sort solidity operations using short-circuit mode | 43 | at least 4171 |\n| [G-04] | Functions guaranteed to revert when called by normal users can be marked payable | 17 | 357 |\n| [G-05] | Refactor functions `adjustWeight` and `addDerivative` | 2 | - |\n| [G-06] | Shift checks before declaration for possible gas savings | 1 | - |\n| [G-07] | Consider declaring stack variables outside loop to save gas | 1 | ~6 gas per loop |\n\n| Total Possible Gas Savings | at least 4916 |\n|:--:|:--:|\n\n### [G-01] Multiple accesses of a storage variable should use a local variable cache\n\n### Cache `STETH_TOKEN` in local variable\n```solidity\n2 results - 1 file\n\n/WstEth.sol\n56: function withdraw(uint256 _amount) external onlyOwner \n58: uint256 stEthBal = IERC20(STETH_TOKEN).balanceOf(address(this));\n59: IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);\n```\n\n### Cache `LIDO_CRV_POOL` in local variable\n```solidity\n2 results - 1 file\n\n/WstEth.sol\n56: function withdraw(uint256 _amount) external onlyOwner \n59: IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);\n61: IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);\n```\n\n### Cache `WST_ETH` in local variable\n```solidity\n3 results - 1 file\n\n/WstEth.sol\n73: function deposit() external payable onlyOwner returns (uint256)\n74: uint256 wstEthBalancePre = IWStETH(WST_ETH).balanceOf(address(this));\n76: (bool sent, ) = WST_ETH.call{value: msg.value}(\"\");\n78: uint256 wstEthBalancePost = IWStETH(WST_ETH).balanceOf(address(this));\n```\n\n### Cache `FRX_ETH_ADDRESS` in local variable\n```solidity\n/SfrxEth.sol\n2 results - 1 file\n\n60: function withdraw(uint256 _amount) external onlyOwner\n66: uint256 frxEthBalance = IE", "vulnerable_code": "2 results - 1 file\n\n/WstEth.sol\n56: function withdraw(uint256 _amount) external onlyOwner \n58: uint256 stEthBal = IERC20(STETH_TOKEN).balanceOf(address(this));\n59: IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);", "fixed_code": "2 results - 1 file\n\n/WstEth.sol\n56: function withdraw(uint256 _amount) external onlyOwner \n59: IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);\n61: IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/0xnev-G.md", "collected_at": "2026-01-02T18:17:44.509111+00:00", "source_hash": "b539ffba2b604eae15c50c8ba4ef98ee709aa6b2e5f2221451717314f78efe82", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 794, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "2 results - 1 file\n\n/WstEth.sol\n56: function withdraw(uint256 _amount) external onlyOwner \n58: uint256 stEthBal = IERC20(STETH_TOKEN).balanceOf(address(this));\n59: IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);", "primary_code_language": "solidity", "primary_code_char_count": 234, "all_code_blocks": "// Code block 1 (solidity):\n2 results - 1 file\n\n/WstEth.sol\n56: function withdraw(uint256 _amount) external onlyOwner \n58: uint256 stEthBal = IERC20(STETH_TOKEN).balanceOf(address(this));\n59: IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);\n\n// Code block 2 (solidity):\n2 results - 1 file\n\n/WstEth.sol\n56: function withdraw(uint256 _amount) external onlyOwner \n59: IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);\n61: IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);\n\n// Code block 3 (solidity):\n3 results - 1 file\n\n/WstEth.sol\n73: function deposit() external payable onlyOwner returns (uint256)\n74: uint256 wstEthBalancePre = IWStETH(WST_ETH).balanceOf(address(this));\n76: (bool sent, ) = WST_ETH.call{value: msg.value}(\"\");\n78: uint256 wstEthBalancePost = IWStETH(WST_ETH).balanceOf(address(this));", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "2 results - 1 file\n\n/WstEth.sol\n56: function withdraw(uint256 _amount) external onlyOwner \n58: uint256 stEthBal = IERC20(STETH_TOKEN).balanceOf(address(this));\n59: IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);\n\n2 results - 1 file\n\n/WstEth.sol\n56: function withdraw(uint256 _amount) external onlyOwner \n59: IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);\n61: IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);\n\n3 results - 1 file\n\n/WstEth.sol\n73: function deposit() external payable onlyOwner returns (uint256)\n74: uint256 wstEthBalancePre = IWStETH(WST_ETH).balanceOf(address(this));\n76: (bool sent, ) = WST_ETH.call{value: msg.value}(\"\");\n78: uint256 wstEthBalancePost = IWStETH(WST_ETH).balanceOf(address(this));", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "2 results - 1 file\n\n/WstEth.sol\n56: function withdraw(uint256 _amount) external onlyOwner \n58: uint256 stEthBal = IERC20(STETH_TOKEN).balanceOf(address(this));\n59: IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "2 results - 1 file\n\n/WstEth.sol\n56: function withdraw(uint256 _amount) external onlyOwner \n59: IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);\n61: IStEthEthPool(LIDO_CRV_POOL).exchange(1, 0, stEthBal, minOut);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "03-asymmetry", "title": "0xpanicError Q", "severity_raw": "Low", "severity": "low", "description": "https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol\n\n# Low Issues\n\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [L-1](#L-1) | Truncation errors due to division | 2 |\n### [L-1] Truncation errors due to division\nVariables that represent value of ERC20 tokens should always have 18 decimal places. There is no need to divide\n`underlyingValue` and `derivativeReceivedEthValue` by `10**18` as they are remultiplied in later lines anyways. Doing this\ncauses rounding errors which can lead to unwanted concequences.\n\n*Instances (2)*:\n```solidity\nFile: contracts/SafEth/SafEth.sol\n\n72: underlyingValue +=\n\n73: (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n\n74: derivatives[i].balance()) /\n\n75 10 ** 18;\n\n81: else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n\n\n```\n\n```solidity\nFile: contracts/SafEth/SafEth.sol\n\n92: uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n\n93: depositAmount\n\n94: ) * depositAmount) / 10 ** 18;\n\n95 totalStakeValueEth += derivativeReceivedEthValue;\n\n98: uint256 mintAmount = (totalStakeValueEth * 10 ** 18) / preDepositPrice;\n\n```\n\n", "vulnerable_code": "File: contracts/SafEth/SafEth.sol\n\n72: underlyingValue +=\n\n73: (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n\n74: derivatives[i].balance()) /\n\n75 10 ** 18;\n\n81: else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n\n", "fixed_code": "File: contracts/SafEth/SafEth.sol\n\n92: uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n\n93: depositAmount\n\n94: ) * depositAmount) / 10 ** 18;\n\n95 totalStakeValueEth += derivativeReceivedEthValue;\n\n98: uint256 mintAmount = (totalStakeValueEth * 10 ** 18) / preDepositPrice;\n", "recommendation": "", "category": "rounding", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/0xpanicError-Q.md", "collected_at": "2026-01-02T18:17:45.895939+00:00", "source_hash": "b560c63ea7e1a8a5da6805217107a88664ee55f38ccbeae33b0713e65ed6bbfd", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 567, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/SafEth/SafEth.sol\n\n72: underlyingValue +=\n\n73: (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n\n74: derivatives[i].balance()) /\n\n75 10 ** 18;\n\n81: else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;", "primary_code_language": "solidity", "primary_code_char_count": 266, "all_code_blocks": "// Code block 1 (solidity):\nFile: contracts/SafEth/SafEth.sol\n\n72: underlyingValue +=\n\n73: (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n\n74: derivatives[i].balance()) /\n\n75 10 ** 18;\n\n81: else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n\n// Code block 2 (solidity):\nFile: contracts/SafEth/SafEth.sol\n\n92: uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n\n93: depositAmount\n\n94: ) * depositAmount) / 10 ** 18;\n\n95 totalStakeValueEth += derivativeReceivedEthValue;\n\n98: uint256 mintAmount = (totalStakeValueEth * 10 ** 18) / preDepositPrice;", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: contracts/SafEth/SafEth.sol\n\n72: underlyingValue +=\n\n73: (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n\n74: derivatives[i].balance()) /\n\n75 10 ** 18;\n\n81: else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n\nFile: contracts/SafEth/SafEth.sol\n\n92: uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n\n93: depositAmount\n\n94: ) * depositAmount) / 10 ** 18;\n\n95 totalStakeValueEth += derivativeReceivedEthValue;\n\n98: uint256 mintAmount = (totalStakeValueEth * 10 ** 18) / preDepositPrice;", "github_refs_formatted": "SafEth.sol", "github_files_list": "SafEth.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: contracts/SafEth/SafEth.sol\n\n72: underlyingValue +=\n\n73: (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n\n74: derivatives[i].balance()) /\n\n75 10 ** 18;\n\n81: else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/SafEth/SafEth.sol\n\n92: uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n\n93: depositAmount\n\n94: ) * depositAmount) / 10 ** 18;\n\n95 totalStakeValueEth += derivativeReceivedEthValue;\n\n98: uint256 mintAmount = (totalStakeValueEth * 10 ** 18) / preDepositPrice;\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7.31} {"source": "c4", "protocol": "01-biconomy", "title": "tsvetanovv G", "severity_raw": "Low", "severity": "low", "description": "## [G-01] `x = x - y` costs less gas than `x -= y`, same for addition\n`EntryPoint.sol:`\n```\n81: \tcollected += _executeUserOp(i, ops[i], opInfos[i]);\n101: \ttotalOps += opsPerAggregator[i].userOps.length;\n135: \tcollected += _executeUserOp(opIndex, ops[i], opInfos[opIndex]);\n468: \tactualGas += preGas - gasleft();\n```\n`VerifyingSingletonPaymaster.sol`:\n```\n51: \tpaymasterIdBalances[paymasterId] += msg.value;\n58: \tpaymasterIdBalances[msg.sender] -= amount;\n128: \tpaymasterIdBalances[extractedPaymasterId] -= actualGasCost;\n```\nYou can replace all `-=` and `+=` occurrences to save gas\n\n***\n\n## [G-02] UNCHECKING ARITHMETICS OPERATIONS THAT CAN\u2019T UNDERFLOW/OVERFLOW\n\nSolidity version 0.8+ comes with implicit overflow and underflow checks on unsigned integers. When an overflow or an underflow isn\u2019t possible (as an example, when a comparison is made before the arithmetic operation), some gas can be saved by using an unchecked block.\n[Reference](https://docs.soliditylang.org/en/v0.8.10/control-structures.html#checked-or-unchecked-arithmetic)\n\n`EntryPoint.sol:`\n```\n100: \tfor (uint256 i = 0; i < opasLen; i++) {\n107: \tfor (uint256 a = 0; a < opasLen; a++) {\n112: \tfor (uint256 i = 0; i < opslen; i++) {\n128: \tfor (uint256 a = 0; a < opasLen; a++) {\n134: \tfor (uint256 i = 0; i < opslen; i++) {\n```\n\n## [G-03] SPLITTING REQUIRE() STATEMENTS THAT USE `&&` SAVES GAS\n`ModuleManager.sol`\n```\n34: \trequire(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");\n49: \trequire(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");\n68: \trequire(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \"BSA104\");\n```", "vulnerable_code": "81: \tcollected += _executeUserOp(i, ops[i], opInfos[i]);\n101: \ttotalOps += opsPerAggregator[i].userOps.length;\n135: \tcollected += _executeUserOp(opIndex, ops[i], opInfos[opIndex]);\n468: \tactualGas += preGas - gasleft();", "fixed_code": "51: \tpaymasterIdBalances[paymasterId] += msg.value;\n58: \tpaymasterIdBalances[msg.sender] -= amount;\n128: \tpaymasterIdBalances[extractedPaymasterId] -= actualGasCost;", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/tsvetanovv-G.md", "collected_at": "2026-01-02T18:14:14.125849+00:00", "source_hash": "b597c01ef4545a553ba4926d5f33993fc5a230bdfe275b86f8f4e8bd1426d63c", "code_block_count": 4, "solidity_block_count": 0, "total_code_chars": 855, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "81: \tcollected += _executeUserOp(i, ops[i], opInfos[i]);\n101: \ttotalOps += opsPerAggregator[i].userOps.length;\n135: \tcollected += _executeUserOp(opIndex, ops[i], opInfos[opIndex]);\n468: \tactualGas += preGas - gasleft();", "primary_code_language": "unknown", "primary_code_char_count": 219, "all_code_blocks": "// Code block 1 (unknown):\n81: \tcollected += _executeUserOp(i, ops[i], opInfos[i]);\n101: \ttotalOps += opsPerAggregator[i].userOps.length;\n135: \tcollected += _executeUserOp(opIndex, ops[i], opInfos[opIndex]);\n468: \tactualGas += preGas - gasleft();\n\n// Code block 2 (unknown):\n51: \tpaymasterIdBalances[paymasterId] += msg.value;\n58: \tpaymasterIdBalances[msg.sender] -= amount;\n128: \tpaymasterIdBalances[extractedPaymasterId] -= actualGasCost;\n\n// Code block 3 (unknown):\n100: \tfor (uint256 i = 0; i < opasLen; i++) {\n107: \tfor (uint256 a = 0; a < opasLen; a++) {\n112: \tfor (uint256 i = 0; i < opslen; i++) {\n128: \tfor (uint256 a = 0; a < opasLen; a++) {\n134: \tfor (uint256 i = 0; i < opslen; i++) {\n\n// Code block 4 (unknown):\n34: \trequire(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");\n49: \trequire(module != address(0) && module != SENTINEL_MODULES, \"BSA101\");\n68: \trequire(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), \"BSA104\");", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "81: \tcollected += _executeUserOp(i, ops[i], opInfos[i]);\n101: \ttotalOps += opsPerAggregator[i].userOps.length;\n135: \tcollected += _executeUserOp(opIndex, ops[i], opInfos[opIndex]);\n468: \tactualGas += preGas - gasleft();", "has_vulnerable_code_snippet": true, "fixed_code_actual": "51: \tpaymasterIdBalances[paymasterId] += msg.value;\n58: \tpaymasterIdBalances[msg.sender] -= amount;\n128: \tpaymasterIdBalances[extractedPaymasterId] -= actualGasCost;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "01-ondo", "title": "kodyvim G", "severity_raw": "Medium", "severity": "medium", "description": "## Gas Optimization\n Add unchecked block to line 630 on `CashManager.sol` since its value cannot overflow/underflow because of the Mintlimit check.\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L630\n```js\n//before\nif (collateralAmountIn > mintLimit - currentMintAmount) {\n revert MintExceedsRateLimit();\n }\n\n currentMintAmount += collateralAmountIn;\n\n//after\nif (collateralAmountIn > mintLimit - currentMintAmount) {\n revert MintExceedsRateLimit();\n }\n\n unchecked { currentMintAmount += collateralAmountIn; }\n```\nAdd unchecked block to line 649 on `CashManager.sol` since its value cannot overflow/underflow because of the redeemLimit check.\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L649\n```js\n//before\nif (amount > redeemLimit - currentRedeemAmount) {\n revert RedeemExceedsRateLimit();\n }\n\n currentRedeemAmount += amount;\n//after\nif (amount > redeemLimit - currentRedeemAmount) {\n revert RedeemExceedsRateLimit();\n }\n\n unchecked { currentRedeemAmount += amount; }\n```\n", "vulnerable_code": "//before\nif (collateralAmountIn > mintLimit - currentMintAmount) {\n revert MintExceedsRateLimit();\n }\n\n currentMintAmount += collateralAmountIn;\n\n//after\nif (collateralAmountIn > mintLimit - currentMintAmount) {\n revert MintExceedsRateLimit();\n }\n\n unchecked { currentMintAmount += collateralAmountIn; }", "fixed_code": "//before\nif (amount > redeemLimit - currentRedeemAmount) {\n revert RedeemExceedsRateLimit();\n }\n\n currentRedeemAmount += amount;\n//after\nif (amount > redeemLimit - currentRedeemAmount) {\n revert RedeemExceedsRateLimit();\n }\n\n unchecked { currentRedeemAmount += amount; }", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/kodyvim-G.md", "collected_at": "2026-01-02T18:15:16.102402+00:00", "source_hash": "b59bc224bec778cd443db8fca5d37f386facabf9924fbf50ec11856502ee7f90", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 616, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "//before\nif (collateralAmountIn > mintLimit - currentMintAmount) {\n revert MintExceedsRateLimit();\n }\n\n currentMintAmount += collateralAmountIn;\n\n//after\nif (collateralAmountIn > mintLimit - currentMintAmount) {\n revert MintExceedsRateLimit();\n }\n\n unchecked { currentMintAmount += collateralAmountIn; }", "primary_code_language": "js", "primary_code_char_count": 324, "all_code_blocks": "// Code block 1 (js):\n//before\nif (collateralAmountIn > mintLimit - currentMintAmount) {\n revert MintExceedsRateLimit();\n }\n\n currentMintAmount += collateralAmountIn;\n\n//after\nif (collateralAmountIn > mintLimit - currentMintAmount) {\n revert MintExceedsRateLimit();\n }\n\n unchecked { currentMintAmount += collateralAmountIn; }\n\n// Code block 2 (js):\n//before\nif (amount > redeemLimit - currentRedeemAmount) {\n revert RedeemExceedsRateLimit();\n }\n\n currentRedeemAmount += amount;\n//after\nif (amount > redeemLimit - currentRedeemAmount) {\n revert RedeemExceedsRateLimit();\n }\n\n unchecked { currentRedeemAmount += amount; }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CashManager.sol#L630, CashManager.sol#L649", "github_files_list": "CashManager.sol", "github_refs_count": 2, "vulnerable_code_actual": "//before\nif (collateralAmountIn > mintLimit - currentMintAmount) {\n revert MintExceedsRateLimit();\n }\n\n currentMintAmount += collateralAmountIn;\n\n//after\nif (collateralAmountIn > mintLimit - currentMintAmount) {\n revert MintExceedsRateLimit();\n }\n\n unchecked { currentMintAmount += collateralAmountIn; }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "//before\nif (amount > redeemLimit - currentRedeemAmount) {\n revert RedeemExceedsRateLimit();\n }\n\n currentRedeemAmount += amount;\n//after\nif (amount > redeemLimit - currentRedeemAmount) {\n revert RedeemExceedsRateLimit();\n }\n\n unchecked { currentRedeemAmount += amount; }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7.19} {"source": "c4", "protocol": "11-kelp", "title": "ZanyBonzy Q", "severity_raw": "Critical", "severity": "critical", "description": "1. Unnecessary cast in [`getRSETHPrice`](https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTOracle.sol#L66) should be avoided \n```\n function getRSETHPrice() external view returns (uint256 rsETHPrice) {\n ...\n\n for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n address asset = supportedAssets[asset_idx];\n uint256 assetER = getAssetPrice(asset);\n\n uint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);\n totalETHInPool += totalAssetAmt * assetER;\n\n unchecked {\n ++asset_idx;\n }\n }\n\n return totalETHInPool / rsEthSupply;\n }\n```\nThe `asset_idx` counter is a uint16 value and is being compared to the uint256 `supportedAssetCount` variable. In making this comparison, the `asset_idx` is repeatedly casted into uint256, which is unnecessary. \nAlso, in the rare case that the `supportedAssetCount` is greater than `type(uint16).max`, the constant unchecked increment in the loop might cause the `asset_idx` value to wrap around and start over from 0 when it reaches its max value. This results in an infinite loop which can dos system. \nIf the uint16 type is desired, then consider implementing a safeCast library to protect against overflows. \n\n2. [`updatePriceOracleFor`](https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTOracle.sol#L66) function doesn't check if oracle already exists.\n ```\n function updatePriceOracleFor(\n address asset,\n address priceOracle\n )\n external\n onlyLRTManager\n onlySupportedAsset(asset)\n {\n UtilLib.checkNonZeroAddress(priceOracle);\n assetPriceOracle[asset] = priceOracle;\n emit AssetPriceOracleUpdate(asset, priceOracle);\n }\n ```\n\n3. [`updatePriceFeedFor`](https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src", "vulnerable_code": " function getRSETHPrice() external view returns (uint256 rsETHPrice) {\n ...\n\n for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n address asset = supportedAssets[asset_idx];\n uint256 assetER = getAssetPrice(asset);\n\n uint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);\n totalETHInPool += totalAssetAmt * assetER;\n\n unchecked {\n ++asset_idx;\n }\n }\n\n return totalETHInPool / rsEthSupply;\n }", "fixed_code": " function updatePriceOracleFor(\n address asset,\n address priceOracle\n )\n external\n onlyLRTManager\n onlySupportedAsset(asset)\n {\n UtilLib.checkNonZeroAddress(priceOracle);\n assetPriceOracle[asset] = priceOracle;\n emit AssetPriceOracleUpdate(asset, priceOracle);\n }\n ```\n\n3. [`updatePriceFeedFor`](https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/oracles/ChainlinkPriceOracle.sol#L45) function doesn't check if priceFeed already exists.\n ```\n function updatePriceFeedFor(address asset, address priceFeed) external onlyLRTManager onlySupportedAsset(asset) {\n UtilLib.checkNonZeroAddress(priceFeed);\n assetPriceFeed[asset] = priceFeed;\n emit AssetPriceFeedUpdate(asset, priceFeed);\n }\n\n4. The [`RSETH`](https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/RSETH.sol#L54) contract implements a `burnFrom` function.\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/ZanyBonzy-Q.md", "collected_at": "2026-01-02T18:27:45.695216+00:00", "source_hash": "b5f9ba0813564f1e97f6bdde995df89596d98d8baae03967c2590570c5ddd7a2", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 871, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function getRSETHPrice() external view returns (uint256 rsETHPrice) {\n ...\n\n for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n address asset = supportedAssets[asset_idx];\n uint256 assetER = getAssetPrice(asset);\n\n uint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);\n totalETHInPool += totalAssetAmt * assetER;\n\n unchecked {\n ++asset_idx;\n }\n }\n\n return totalETHInPool / rsEthSupply;\n }", "primary_code_language": "unknown", "primary_code_char_count": 544, "all_code_blocks": "// Code block 1 (unknown):\nfunction getRSETHPrice() external view returns (uint256 rsETHPrice) {\n ...\n\n for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n address asset = supportedAssets[asset_idx];\n uint256 assetER = getAssetPrice(asset);\n\n uint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);\n totalETHInPool += totalAssetAmt * assetER;\n\n unchecked {\n ++asset_idx;\n }\n }\n\n return totalETHInPool / rsEthSupply;\n }\n\n// Code block 2 (unknown):\nfunction updatePriceOracleFor(\n address asset,\n address priceOracle\n )\n external\n onlyLRTManager\n onlySupportedAsset(asset)\n {\n UtilLib.checkNonZeroAddress(priceOracle);\n assetPriceOracle[asset] = priceOracle;\n emit AssetPriceOracleUpdate(asset, priceOracle);\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LRTOracle.sol#L66, ChainlinkPriceOracle.sol#L45, RSETH.sol#L54", "github_files_list": "LRTOracle.sol, RSETH.sol, ChainlinkPriceOracle.sol", "github_refs_count": 3, "vulnerable_code_actual": " function getRSETHPrice() external view returns (uint256 rsETHPrice) {\n ...\n\n for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n address asset = supportedAssets[asset_idx];\n uint256 assetER = getAssetPrice(asset);\n\n uint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);\n totalETHInPool += totalAssetAmt * assetER;\n\n unchecked {\n ++asset_idx;\n }\n }\n\n return totalETHInPool / rsEthSupply;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function updatePriceOracleFor(\n address asset,\n address priceOracle\n )\n external\n onlyLRTManager\n onlySupportedAsset(asset)\n {\n UtilLib.checkNonZeroAddress(priceOracle);\n assetPriceOracle[asset] = priceOracle;\n emit AssetPriceOracleUpdate(asset, priceOracle);\n }\n ```\n\n3. [`updatePriceFeedFor`](https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/oracles/ChainlinkPriceOracle.sol#L45) function doesn't check if priceFeed already exists.\n ```\n function updatePriceFeedFor(address asset, address priceFeed) external onlyLRTManager onlySupportedAsset(asset) {\n UtilLib.checkNonZeroAddress(priceFeed);\n assetPriceFeed[asset] = priceFeed;\n emit AssetPriceFeedUpdate(asset, priceFeed);\n }\n\n4. The [`RSETH`](https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/RSETH.sol#L54) contract implements a `burnFrom` function.\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "03-asymmetry", "title": "0xGordita G", "severity_raw": "Unknown", "severity": "unknown", "description": "# [G-01] Cache the balance retrieval to avoid retrieving it twice.\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L73-L74\nBefore 532939 After 524794\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L141-L142\nBefore 729728 722422\n# [G-02] Maintain running totals instead of looping for adjustWeights and addDerivative\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L165-L175\nExample update\n```\nfunction addDerivative(address _contractAddress, uint256 _weight) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\t\t \n totalWeight += _weight; // Maintain a running total of weights\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n}\n```\nBefore 102462 After 99501\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L182-L195\nExample update\n```\nfunction adjustWeight(uint256 _derivativeIndex, uint256 _newWeight) external onlyOwner {\n require(_derivativeIndex < derivativeCount, \"Invalid derivative index\");\n\t\t \n uint256 _oldWeight = weights[_derivativeIndex];\n weights[_derivativeIndex] = _newWeight;\n\t\t \n // Update totalWeight using the difference between the new and old weights\n totalWeight = totalWeight - _oldWeight + _newWeight;\n\t\t \n emit WeightChange(_derivativeIndex, _newWeight);\n }\n```\nBefore 46507 after 41294", "vulnerable_code": "function addDerivative(address _contractAddress, uint256 _weight) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\t\t \n totalWeight += _weight; // Maintain a running total of weights\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n}", "fixed_code": "function adjustWeight(uint256 _derivativeIndex, uint256 _newWeight) external onlyOwner {\n require(_derivativeIndex < derivativeCount, \"Invalid derivative index\");\n\t\t \n uint256 _oldWeight = weights[_derivativeIndex];\n weights[_derivativeIndex] = _newWeight;\n\t\t \n // Update totalWeight using the difference between the new and old weights\n totalWeight = totalWeight - _oldWeight + _newWeight;\n\t\t \n emit WeightChange(_derivativeIndex, _newWeight);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/0xGordita-G.md", "collected_at": "2026-01-02T18:17:34.583400+00:00", "source_hash": "b67d01c5a2b96780470b89a0b6027a825d42c0637eaa462b91e159c78838e9e2", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 830, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function addDerivative(address _contractAddress, uint256 _weight) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\t\t \n totalWeight += _weight; // Maintain a running total of weights\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n}", "primary_code_language": "unknown", "primary_code_char_count": 359, "all_code_blocks": "// Code block 1 (unknown):\nfunction addDerivative(address _contractAddress, uint256 _weight) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\t\t \n totalWeight += _weight; // Maintain a running total of weights\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n}\n\n// Code block 2 (unknown):\nfunction adjustWeight(uint256 _derivativeIndex, uint256 _newWeight) external onlyOwner {\n require(_derivativeIndex < derivativeCount, \"Invalid derivative index\");\n\t\t \n uint256 _oldWeight = weights[_derivativeIndex];\n weights[_derivativeIndex] = _newWeight;\n\t\t \n // Update totalWeight using the difference between the new and old weights\n totalWeight = totalWeight - _oldWeight + _newWeight;\n\t\t \n emit WeightChange(_derivativeIndex, _newWeight);\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol#L73-L74, SafEth.sol#L141-L142, SafEth.sol#L165-L175, SafEth.sol#L182-L195", "github_files_list": "SafEth.sol", "github_refs_count": 4, "vulnerable_code_actual": "function addDerivative(address _contractAddress, uint256 _weight) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\t\t \n totalWeight += _weight; // Maintain a running total of weights\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function adjustWeight(uint256 _derivativeIndex, uint256 _newWeight) external onlyOwner {\n require(_derivativeIndex < derivativeCount, \"Invalid derivative index\");\n\t\t \n uint256 _oldWeight = weights[_derivativeIndex];\n weights[_derivativeIndex] = _newWeight;\n\t\t \n // Update totalWeight using the difference between the new and old weights\n totalWeight = totalWeight - _oldWeight + _newWeight;\n\t\t \n emit WeightChange(_derivativeIndex, _newWeight);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "03-asymmetry", "title": "0xRajkumar Q", "severity_raw": "Low", "severity": "low", "description": "# 1.Wrong index passed \"DerivativeAdded()\"\n## In SafEth contract we have \"addDerivative()\" function which emits event \"DerivativeAdded()\" and this event expect index of newly derivative. \n## In \"addDerivative()\" function we always add new derivative and increases derivativeCount by one and this same variable is always passed into event \"DerivativeAdded()\" that's why we always pass wrong index which is index of next derivative. \n#### References\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L194\n#### Mitigation step\nWe should pass derivativeCount-- instead of derivativeCount\n````\n function addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount--);\n }\n\n````\n# 2.Contract Owner Has Too Many Privileges\n## The owner of the contracts has too many privileges relative to standard users. The consequence is disastrous if the contract owner\u2019s private key has been compromised. And, in the event the key was lost or unrecoverable, no implementation upgrades and system parameter updates will ever be possible. For a project this grand, it increases the likelihood that the owner will be targeted by an attacker, especially given the insufficient protection on sensitive owner private keys. The concentration of privileges creates a single point of failure; and, here are some of the incidents that could possibly transpire:\n### Transfer ownership and mess up with all the setter functions, hijacking the entire protocol.\n\n#### Consider:\n\nsplitting privileges (e.g. via the multisig option) to ensure that no one address h", "vulnerable_code": " function addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount--);\n }\n", "fixed_code": " for (uint i = 0; i < derivativeCount; i++)\n underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;\n\n uint256 totalSupply = totalSupply();\n uint256 preDepositPrice; // rice of safETH in regards to ETH\n if (totalSupply == 0)\n preDepositPrice = 10 ** 18; // initializes with a price of 1\n else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/0xRajkumar-Q.md", "collected_at": "2026-01-02T18:17:35.951236+00:00", "source_hash": "b683fd96be16d4db2af8806ec72e1c9b98d36a36da377f3e84c157bc76258e5c", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 508, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount--);\n }", "primary_code_language": "unknown", "primary_code_char_count": 508, "all_code_blocks": "// Code block 1 (unknown):\nfunction addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount--);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol#L194", "github_files_list": "SafEth.sol", "github_refs_count": 1, "vulnerable_code_actual": " function addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount--);\n }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": " for (uint i = 0; i < derivativeCount; i++)\n underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;\n\n uint256 totalSupply = totalSupply();\n uint256 preDepositPrice; // rice of safETH in regards to ETH\n if (totalSupply == 0)\n preDepositPrice = 10 ** 18; // initializes with a price of 1\n else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "11-kelp", "title": "hunter_w3b G", "severity_raw": "High", "severity": "high", "description": "# Gas-Optmization for Kelp DAO | rsETH Protocol\n\n## [G-01] Avoid contract existence checks by using low level calls\n\n**Issue Description**\\\nPrior to Solidity 0.8.10, the compiler would insert extra code to check for contract existence before external function calls, even if the call had a return value. This wasted gas by performing a check that wasn't necessary.\n\n**Proposed Optimization**\\\nFor functions that make external calls with return values in Solidity <0.8.10, optimize the code to use low-level calls instead of regular calls. Low-level calls skip the unnecessary contract existence check.\n\nExample:\n\n```solidity\n//Before:\n\ncontract C {\n function f() external returns(uint) {\n address(otherContract).call(abi.encodeWithSignature(\"func()\"));\n }\n}\n\n\n//After:\n\ncontract C {\n function f() external returns(uint) {\n (bool success,) = address(otherContract).call(abi.encodeWithSignature(\"func()\"));\n require(success);\n return decodeReturnValue();\n }\n}\n```\n\n**Estimated Gas Savings**\\\nEach avoided EXTCODESIZE check saves 100 gas. If 10 external calls are made in a common function, this would save 1000 gas total.\n\n**Attachments**\n\n- **Code Snippets**\n\n```solidity\nFile: src/oracles/ChainlinkPriceOracle.sol\n\n38 return AggregatorInterface(assetPriceFeed[asset]).latestAnswer();\n```\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/oracles/ChainlinkPriceOracle.sol#L38\n\n```solidity\nFile: src/utils/LRTConfigRoleChecker.sol\n\n21 if (!IAccessControl(address(lrtConfig)).hasRole(LRTConstants.MANAGER, msg.sender)) {\n\n29 if (!IAccessControl(address(lrtConfig)).hasRole(DEFAULT_ADMIN_ROLE, msg.sender)) {\n\n36 if (!IAccessControl(address(lrtConfig)).hasRole(DEFAULT_ADMIN_ROLE, msg.sender)) {\n```\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/utils/LRTConfigRoleChecker.sol#L21\n\n```solidity\nFile: src/LRTDepositPool.sol\n\n79 assetLyingInDepositPool = IERC20(asset).balanceOf(address(this));\n\n83 assetLyingInNDCs += IERC", "vulnerable_code": "//Before:\n\ncontract C {\n function f() external returns(uint) {\n address(otherContract).call(abi.encodeWithSignature(\"func()\"));\n }\n}\n\n\n//After:\n\ncontract C {\n function f() external returns(uint) {\n (bool success,) = address(otherContract).call(abi.encodeWithSignature(\"func()\"));\n require(success);\n return decodeReturnValue();\n }\n}", "fixed_code": "File: src/oracles/ChainlinkPriceOracle.sol\n\n38 return AggregatorInterface(assetPriceFeed[asset]).latestAnswer();", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/hunter_w3b-G.md", "collected_at": "2026-01-02T18:28:07.309122+00:00", "source_hash": "b6ae3c372cc6a42b2ff997d9de3fd1f38dc46cfc64199b8ab87bdcd1cc222610", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 792, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "//Before:\n\ncontract C {\n function f() external returns(uint) {\n address(otherContract).call(abi.encodeWithSignature(\"func()\"));\n }\n}\n\n\n//After:\n\ncontract C {\n function f() external returns(uint) {\n (bool success,) = address(otherContract).call(abi.encodeWithSignature(\"func()\"));\n require(success);\n return decodeReturnValue();\n }\n}", "primary_code_language": "solidity", "primary_code_char_count": 348, "all_code_blocks": "// Code block 1 (solidity):\n//Before:\n\ncontract C {\n function f() external returns(uint) {\n address(otherContract).call(abi.encodeWithSignature(\"func()\"));\n }\n}\n\n\n//After:\n\ncontract C {\n function f() external returns(uint) {\n (bool success,) = address(otherContract).call(abi.encodeWithSignature(\"func()\"));\n require(success);\n return decodeReturnValue();\n }\n}\n\n// Code block 2 (solidity):\nFile: src/oracles/ChainlinkPriceOracle.sol\n\n38 return AggregatorInterface(assetPriceFeed[asset]).latestAnswer();\n\n// Code block 3 (solidity):\nFile: src/utils/LRTConfigRoleChecker.sol\n\n21 if (!IAccessControl(address(lrtConfig)).hasRole(LRTConstants.MANAGER, msg.sender)) {\n\n29 if (!IAccessControl(address(lrtConfig)).hasRole(DEFAULT_ADMIN_ROLE, msg.sender)) {\n\n36 if (!IAccessControl(address(lrtConfig)).hasRole(DEFAULT_ADMIN_ROLE, msg.sender)) {", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "//Before:\n\ncontract C {\n function f() external returns(uint) {\n address(otherContract).call(abi.encodeWithSignature(\"func()\"));\n }\n}\n\n\n//After:\n\ncontract C {\n function f() external returns(uint) {\n (bool success,) = address(otherContract).call(abi.encodeWithSignature(\"func()\"));\n require(success);\n return decodeReturnValue();\n }\n}\n\nFile: src/oracles/ChainlinkPriceOracle.sol\n\n38 return AggregatorInterface(assetPriceFeed[asset]).latestAnswer();\n\nFile: src/utils/LRTConfigRoleChecker.sol\n\n21 if (!IAccessControl(address(lrtConfig)).hasRole(LRTConstants.MANAGER, msg.sender)) {\n\n29 if (!IAccessControl(address(lrtConfig)).hasRole(DEFAULT_ADMIN_ROLE, msg.sender)) {\n\n36 if (!IAccessControl(address(lrtConfig)).hasRole(DEFAULT_ADMIN_ROLE, msg.sender)) {", "github_refs_formatted": "ChainlinkPriceOracle.sol#L38, LRTConfigRoleChecker.sol#L21", "github_files_list": "ChainlinkPriceOracle.sol, LRTConfigRoleChecker.sol", "github_refs_count": 2, "vulnerable_code_actual": "//Before:\n\ncontract C {\n function f() external returns(uint) {\n address(otherContract).call(abi.encodeWithSignature(\"func()\"));\n }\n}\n\n\n//After:\n\ncontract C {\n function f() external returns(uint) {\n (bool success,) = address(otherContract).call(abi.encodeWithSignature(\"func()\"));\n require(success);\n return decodeReturnValue();\n }\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: src/oracles/ChainlinkPriceOracle.sol\n\n38 return AggregatorInterface(assetPriceFeed[asset]).latestAnswer();", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "06-lybra", "title": "0xn006e7 G", "severity_raw": "High", "severity": "high", "description": "# Table of Contents\n\n| S.N. | Issues | Instances | Gas Savings |\n|:---- | :---- | :----: | :----: |\n| [G-01](#g-01--varaibles-which-are-assigned-only-onceat-the-compile-time-in-the-contract-and-then-never-changed-thereafter-should-be-declared-constant) | Varaibles which are assigned only once(at the compile time) in the contract and then never changed thereafter should be declared constant | 2 | 4000 |\n| [G-02](#g-02--dont-calculate-constants) | Don't calculate constants | 2 | - |\n| [G-03](#g-03--use-assembly-to-write-contract-typeaddress-storage-varibales) | Use assembly to write contract type(address) storage varibales | 33 | - |\n| [G-04](#g-04--avoid-caching-the-result-of-a-function-call-when-that-result-is-being-used-only-once) | Avoid caching the result of a function call when that result is being used only once | 18 | - |\n| [G-05](#g-05--members-of-struct-can-be-packed-into-fewer-storage-slots) | Members of struct can be packed into fewer storage slots | 5 | 10000 |\n| [G-06](#g-06--state-variables-can-be-packed-into-fewer-storage-slots) | state variables can be packed into fewer storage slots | 8 | 16000 |\n| [G-07](#g-07--cache-calldatamemory-pointers-for-complex-types-to-avoid-complex-offset-calculations) | Cache calldata/memory pointers for complex types to avoid complex offset calculations | 1 | - |\n\n## [G-01] : Varaibles which are assigned only once(at the compile time) in the contract and then never changed thereafter should be declared constant \n\nConstant variables are stored directly in bytecode rather than storage unlike state variables and thus are much cheaper to read from(costing 3 gas via `PUSH32` opcode usage).\n\nNote : These are the instances missed by automated finding(the exact issue found in automated finding is \"variables only set in the constructor should be declared immutables\" which is a bit different from this one)\n\n2 instances in 2 files\n\n### 1) contracts/lybra/token/esLBR.sol :: Line 20 \n\n#### Estimated gas savings : 1 storage s", "vulnerable_code": "File: contracts/lybra/token/esLBR.sol\n20: uint256 maxSupply = 100_000_000 * 1e18;", "fixed_code": "File: contracts/lybra/token/LBR.sol\n15: uint256 maxSupply = 100_000_000 * 1e18;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/0xn006e7-G.md", "collected_at": "2026-01-02T18:22:04.997127+00:00", "source_hash": "b7155a30de0907b6b55946326503de24c5f587b43b4a10aa04c65e377c8f0ebf", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: contracts/lybra/token/esLBR.sol\n20: uint256 maxSupply = 100_000_000 * 1e18;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/lybra/token/LBR.sol\n15: uint256 maxSupply = 100_000_000 * 1e18;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-biconomy", "title": "lukris02 Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA Report for Biconomy - Smart Contract Wallet contest\n## Overview\nDuring the audit, 4 low and 14 non-critical issues were found.\n\u2116 | Title | Risk Rating | Instance Count\n--- | --- | --- | ---\nL-1 | Review is needed | Low | 10\nL-2 | The require for not being a smart contract can be passed | Low | 1\nL-3 | Use the two-step-transfer of ownership | Low | 1\nL-4 | Misleading comment | Low | 1\nNC-1 | Order of Functions | Non-Critical | 5\nNC-2 | Order of Layout | Non-Critical | 6\nNC-3 | Open TODOs | Non-Critical | 1\nNC-4 | Typos | Non-Critical | 6\nNC-5 | Unused named return variables | Non-Critical | 4\nNC-6 | Commented code | Non-Critical | 12\nNC-7 | Empty function body | Non-Critical | 1\nNC-8 | Duplicate comment | Non-Critical | 1\nNC-9 | Variables with similar names | Non-Critical | 4\nNC-10 | No space between the control structures | Non-Critical | 2\nNC-11 | \"nice to have\" | Non-Critical | 1\nNC-12 | Missing NatSpec | Non-Critical | 6\nNC-13 | Missing leading underscores | Non-Critical | 18\nNC-14 | Maximum line length exceeded | Non-Critical | 65\n\n## Low Risk Findings(5)\n### L-1. Review is needed\n##### Description\nThere are many places in the code that have questions and require further review.\n##### Instances\n- [```// review virtual```](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/BaseSmartAccount.sol#L59)\n- [```// Review if we need to make view function```](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/BaseSmartAccount.sol#L86) \n- [```// review? if rename wallet to account is must```](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L44) \n- [```// review IEntryPoint private _entryPoint;```](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L58) \n- [```//@review getNonce specific to EntryPoint requirements```](https://g", "vulnerable_code": " function setOwner(address _newOwner) external mixedAuth {\n require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n address oldOwner = owner;\n owner = _newOwner;\n emit EOAChanged(address(this), oldOwner, _newOwner);\n }", "fixed_code": "#\n## Non-Critical Risk Findings(14)\n### NC-1. Order of Functions\n##### Description\nAccording to [Style Guide](https://docs.soliditylang.org/en/v0.8.16/style-guide.html#order-of-functions), ordering helps readers identify which functions they can call and to find the constructor and fallback definitions easier. \nFunctions should be grouped according to their visibility and ordered:\n1) constructor\n2) receive function (if exists)\n3) fallback function (if exists)\n4) external\n5) public\n6) internal\n7) private\n##### Instances\nExternal functions should be placed before public:\n- https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/BaseSmartAccount.sol#L61\n- https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L109\n- https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L28\n- https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol#L65\n\nreceive() function should be placed before fallback():\n- https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/Proxy.sol#L36\n\n##### Recommendation\nReorder functions where possible.\n#\n### NC-2. Order of Layout\n##### Description\nAccording to [Order of Layout](https://docs.soliditylang.org/en/v0.8.16/style-guide.html#order-of-layout), inside each contract, library or interface, use the following order:\n1) Type declarations\n2) State variables\n3) Events\n4) Modifiers\n5) Functions\n##### Instances\nState variables should be placed before events:\n- https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/base/ModuleManager.sol#L16-L18 \n- https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/base/FallbackManager.", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/lukris02-Q.md", "collected_at": "2026-01-02T18:13:53.974940+00:00", "source_hash": "b73a65e61f4d8c6167a81c4d78c8488867fd77ff323740d9dc82394879089a4b", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 10, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "BaseSmartAccount.sol#L59, BaseSmartAccount.sol#L86, SmartAccount.sol#L44, SmartAccount.sol#L58, BaseSmartAccount.sol#L61, SmartAccount.sol#L109, BasePaymaster.sol#L28, VerifyingSingletonPaymaster.sol#L65, Proxy.sol#L36, ModuleManager.sol#L16-L18", "github_files_list": "VerifyingSingletonPaymaster.sol, BaseSmartAccount.sol, BasePaymaster.sol, Proxy.sol, ModuleManager.sol, SmartAccount.sol", "github_refs_count": 10, "vulnerable_code_actual": " function setOwner(address _newOwner) external mixedAuth {\n require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n address oldOwner = owner;\n owner = _newOwner;\n emit EOAChanged(address(this), oldOwner, _newOwner);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "#\n## Non-Critical Risk Findings(14)\n### NC-1. Order of Functions\n##### Description\nAccording to [Style Guide](https://docs.soliditylang.org/en/v0.8.16/style-guide.html#order-of-functions), ordering helps readers identify which functions they can call and to find the constructor and fallback definitions easier. \nFunctions should be grouped according to their visibility and ordered:\n1) constructor\n2) receive function (if exists)\n3) fallback function (if exists)\n4) external\n5) public\n6) internal\n7) private\n##### Instances\nExternal functions should be placed before public:\n- https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/BaseSmartAccount.sol#L61\n- https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L109\n- https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L28\n- https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol#L65\n\nreceive() function should be placed before fallback():\n- https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/Proxy.sol#L36\n\n##### Recommendation\nReorder functions where possible.\n#\n### NC-2. Order of Layout\n##### Description\nAccording to [Order of Layout](https://docs.soliditylang.org/en/v0.8.16/style-guide.html#order-of-layout), inside each contract, library or interface, use the following order:\n1) Type declarations\n2) State variables\n3) Events\n4) Modifiers\n5) Functions\n##### Instances\nState variables should be placed before events:\n- https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/base/ModuleManager.sol#L16-L18 \n- https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/base/FallbackManager.", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-biconomy", "title": "cryptostellar5 Q", "severity_raw": "Critical", "severity": "critical", "description": "\n### 01 REPLACE INLINE ASSEMBLY WITH ACCOUNT.CODE.LENGTH\n\n*Number of Instances Identified: 1*\n\n`
.code.length`\u00a0can be used in Solidity >= 0.8.0 to access an account\u2019s code size and check if it is a contract without inline assembly.\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/libs/LibAddress.sol\n\n```\n14: assembly { csize := extcodesize(account)\n```\n\n\n### 02 AVOID USING TX.ORIGIN\n\n*Number of Instances Identified: 3*\n\n`tx.origin`\u00a0is a global variable in Solidity that returns the address of the account that sent the transaction.\n\nUsing the variable could make a contract vulnerable if an authorized account calls a malicious contract. You can impersonate a user using a third party contract.\n\nThis can make it easier to create a vault on behalf of another user with an external administrator (by receiving it as an argument).\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n\n```\n257: address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\n281: address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\n511: require(owner == hash.recover(userOp.signature) || tx.origin == address(0), \"account: wrong signature\");\n```\n\n\n### 03 REQUIRE() SHOULD BE USED INSTEAD OF ASSERT()\n\n*Number of Instances Identified: 2*\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/Proxy.sol\n\n```\n16: assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));\n```\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/common/Singleton.sol\n\n```\n13: assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));\n```\n\n\n### 04 FOR MODERN AND MORE READABLE CODE; UPDATE IMPORT USAGES\n\nAll the contracts in scope should upd", "vulnerable_code": "14: assembly { csize := extcodesize(account)", "fixed_code": "257: address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\n281: address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\n511: require(owner == hash.recover(userOp.signature) || tx.origin == address(0), \"account: wrong signature\");", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/cryptostellar5-Q.md", "collected_at": "2026-01-02T18:13:38.674848+00:00", "source_hash": "b73ed295808c15da52d178eafc858643b4c3d541dd294411b1108bd655340850", "code_block_count": 4, "solidity_block_count": 0, "total_code_chars": 563, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "14: assembly { csize := extcodesize(account)", "primary_code_language": "unknown", "primary_code_char_count": 44, "all_code_blocks": "// Code block 1 (unknown):\n14: assembly { csize := extcodesize(account)\n\n// Code block 2 (unknown):\n257: address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\n281: address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\n511: require(owner == hash.recover(userOp.signature) || tx.origin == address(0), \"account: wrong signature\");\n\n// Code block 3 (unknown):\n16: assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));\n\n// Code block 4 (unknown):\n13: assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LibAddress.sol, SmartAccount.sol, Proxy.sol, Singleton.sol", "github_files_list": "LibAddress.sol, SmartAccount.sol, Proxy.sol, Singleton.sol", "github_refs_count": 4, "vulnerable_code_actual": "14: assembly { csize := extcodesize(account)", "has_vulnerable_code_snippet": true, "fixed_code_actual": "257: address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\n281: address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\n511: require(owner == hash.recover(userOp.signature) || tx.origin == address(0), \"account: wrong signature\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "11-kelp", "title": "MiniGlome G", "severity_raw": "Medium", "severity": "medium", "description": "## Gas Optimizations\n| |Issue|Instances|\n|-|:-|:-:|\n| [GAS-01] | Zero address check is done twice on same value | 2 | \n| [GAS-02] | Remove unused pause functionality | 1 | \n\n### [GAS-01] Zero address check is done twice on same value\nIn `LRTConfig.sol`, the zero address checks are performed inside the private functions with `UtilLib.checkNonZeroAddress(val)`. However the initializer already performs these zero address checks on all the parameters, thus, these checks are performed twice.\nConsider moving the following checks to their respective external functions so that the checks are not performed twice during the initialization.\n\n*Instances (2)*:\n```solidity\nFile: src/LRTConfig.sol\n81: UtilLib.checkNonZeroAddress(asset);\n\n157: UtilLib.checkNonZeroAddress(val);\n\n```\nhttps://github.com/code-423n4/2023-11-kelp/blob/c5fdc2e62c5e1d78769f44d6e34a6fb9e40c00f0/src/LRTConfig.sol#L81\nhttps://github.com/code-423n4/2023-11-kelp/blob/c5fdc2e62c5e1d78769f44d6e34a6fb9e40c00f0/src/LRTConfig.sol#L157\n\n### [GAS-02] Remove unused pause functionality\nThe `LRTOracle` contract inherits from `PausableUpgradeable` and implements a `pause()` and `unpause()` functions. However the \"pausing\" has no effect because the `whenNotPaused` modifier is never used.\nConsider removing the `PausableUpgradeable` inherited contract to save gas.\n\n*Instances (1)*:\n```solidity\nFile: src/LRTOracle.sol\n19: contract LRTOracle is ILRTOracle, LRTConfigRoleChecker, PausableUpgradeable {\n\n102: function pause() external onlyLRTManager { //@audit [GAS] Pause has no effect\n _pause();\n }\n\n107: function unpause() external onlyLRTAdmin {\n _unpause();\n }\n\n```\nhttps://github.com/code-423n4/2023-11-kelp/blob/c5fdc2e62c5e1d78769f44d6e34a6fb9e40c00f0/src/LRTOracle.sol#L19\nhttps://github.com/code-423n4/2023-11-kelp/blob/c5fdc2e62c5e1d78769f44d6e34a6fb9e40c00f0/src/LRTOracle.sol#L102-L109\n", "vulnerable_code": "File: src/LRTConfig.sol\n81: UtilLib.checkNonZeroAddress(asset);\n\n157: UtilLib.checkNonZeroAddress(val);\n", "fixed_code": "File: src/LRTOracle.sol\n19: contract LRTOracle is ILRTOracle, LRTConfigRoleChecker, PausableUpgradeable {\n\n102: function pause() external onlyLRTManager { //@audit [GAS] Pause has no effect\n _pause();\n }\n\n107: function unpause() external onlyLRTAdmin {\n _unpause();\n }\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/MiniGlome-G.md", "collected_at": "2026-01-02T18:27:32.695652+00:00", "source_hash": "b7512e0fc583b73604c8869d7dc57573d7e0c86288a4e1c065449bc7d589f74b", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 412, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: src/LRTConfig.sol\n81: UtilLib.checkNonZeroAddress(asset);\n\n157: UtilLib.checkNonZeroAddress(val);", "primary_code_language": "solidity", "primary_code_char_count": 117, "all_code_blocks": "// Code block 1 (solidity):\nFile: src/LRTConfig.sol\n81: UtilLib.checkNonZeroAddress(asset);\n\n157: UtilLib.checkNonZeroAddress(val);\n\n// Code block 2 (solidity):\nFile: src/LRTOracle.sol\n19: contract LRTOracle is ILRTOracle, LRTConfigRoleChecker, PausableUpgradeable {\n\n102: function pause() external onlyLRTManager { //@audit [GAS] Pause has no effect\n _pause();\n }\n\n107: function unpause() external onlyLRTAdmin {\n _unpause();\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: src/LRTConfig.sol\n81: UtilLib.checkNonZeroAddress(asset);\n\n157: UtilLib.checkNonZeroAddress(val);\n\nFile: src/LRTOracle.sol\n19: contract LRTOracle is ILRTOracle, LRTConfigRoleChecker, PausableUpgradeable {\n\n102: function pause() external onlyLRTManager { //@audit [GAS] Pause has no effect\n _pause();\n }\n\n107: function unpause() external onlyLRTAdmin {\n _unpause();\n }", "github_refs_formatted": "LRTConfig.sol#L81, LRTConfig.sol#L157, LRTOracle.sol#L19, LRTOracle.sol#L102-L109", "github_files_list": "LRTConfig.sol, LRTOracle.sol", "github_refs_count": 4, "vulnerable_code_actual": "File: src/LRTConfig.sol\n81: UtilLib.checkNonZeroAddress(asset);\n\n157: UtilLib.checkNonZeroAddress(val);\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: src/LRTOracle.sol\n19: contract LRTOracle is ILRTOracle, LRTConfigRoleChecker, PausableUpgradeable {\n\n102: function pause() external onlyLRTManager { //@audit [GAS] Pause has no effect\n _pause();\n }\n\n107: function unpause() external onlyLRTAdmin {\n _unpause();\n }\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "09-ondo", "title": "alymurtazamemon Q", "severity_raw": "Critical", "severity": "critical", "description": "# Ondo Finance - Quality Assurance Report\n\n# Low Risk Findings\n\n## Table Of Content\n\n| Number | Issue | Instances |\n| :--------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------- | --------: |\n| [L-01](#l-01---contracts-should-use-the-latest-version-of-solidity-to-be-safe-from-bug-fixes) | Contracts should use the `latest version` of solidity to be safe from `bug fixes` | 6 |\n| [L-02](#l-02---missing-validation-for-address0-in-the-constructors-or-in-the-functions-changing-state-variables) | Missing validation for `address(0)` in the constructors or in the functions changing state variables | 12 |\n| [L-03](#l-03---shadow-variables) | Shadow Variables | 7 |\n| [L-04](#l-04---unsafe-low-level-call) | Unsafe `low-level` call | 2 |\n| [L-05](#l-05---division-by-zero-value-will-revert-the-transaction) | `Division` by zero value will revert the transaction | 3 |\n| [L-06](#l-06---multiplication-with-zero-value-will-make-the-whole-calculation-zero) | `Multiplication` with zero value will make the whole calculation zero | 6 |\n| [L-07](#l-07---emitting-incorrect-event-information) ", "vulnerable_code": "`Findings Links`\n\n[DestinationBridge.sol - Line 16](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/DestinationBridge.sol#L16)\n\n[SourceBridge.sol - Line 01](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/SourceBridge.sol#L1)\n\n[IRWADynamicOracle.sol - Line 16](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/rwaOracles/IRWADynamicOracle.sol#L16)\n\n[RWADynamicOracle.sol - Line 16](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/rwaOracles/RWADynamicOracle.sol#L16)\n\n[rUSDYFactory.sol - Line 16](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDYFactory.sol#L16)\n\n[rUSDY.sol - Line 16](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDY.sol#L16)\n\n
\n\n**Recommended Mitigation Steps**\n\nUpdate the contracts version to be safe from minor bug fixes between the used version and current solidity version.\n\n### [L-02] - Missing validation for `address(0)` in the constructors or in the functions changing state variables.\n\n**Details**\n\nIt is recommended to check for `address(0)` when updating state variables through constructor or functions. This can save the protocol from accidental updates.\n\n
\n Spotted Findings\n

\n\n`Example`\n", "fixed_code": "`Findings Links`\n\n[DestinationBridge.sol - Line 56 - 60](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/DestinationBridge.sol#L56-L60)\n\n[DestinationBridge.sol - Line 210](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/DestinationBridge.sol#L210)\n\n[DestinationBridge.sol - Line 220](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/DestinationBridge.sol#L220)\n\n[SourceBridge.sol - Line 41 - 44](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/SourceBridge.sol#L41-L44)\n\n[RWADynamicOracle.sol - Line 31 - 33](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/rwaOracles/RWADynamicOracle.sol#L31-L33)\n\n[rUSDYFactory.sol - Line 52](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDYFactory.sol#L52)\n\n[rUSDYFactory.sol - Line 76 - 80](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDYFactory.sol#L76-L80)\n\n[rUSDY.sol - Line 110 - 115](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDY.sol#L110-L115)\n\n[rUSDY.sol - Line 663](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDY.sol#L663)\n\n[rUSDY.sol - Line 701](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDY.sol#L701)\n\n[rUSDY.sol - Line 712](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDY.sol#L712)\n\n[rUSDY.sol - Line 723](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDY.sol#L723)\n\n
\n\n### [L-03] - Shadow Variables.\n\n**Details**\n\nConsider the compiler warnings into consideration and avoid the variable shadowing.\n\n
\n Spotted Findings\n

\n\n`Example`\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/alymurtazamemon-Q.md", "collected_at": "2026-01-02T18:25:47.096801+00:00", "source_hash": "b75dae0875060bc913f1a366962d78bfe0967974b24e62e128b646116f7ad7c2", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 18, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "DestinationBridge.sol#L16, SourceBridge.sol#L1, IRWADynamicOracle.sol#L16, RWADynamicOracle.sol#L16, rUSDYFactory.sol#L16, rUSDY.sol#L16, DestinationBridge.sol#L56-L60, DestinationBridge.sol#L210, DestinationBridge.sol#L220, SourceBridge.sol#L41-L44, RWADynamicOracle.sol#L31-L33, rUSDYFactory.sol#L52, rUSDYFactory.sol#L76-L80, rUSDY.sol#L110-L115, rUSDY.sol#L663, rUSDY.sol#L701, rUSDY.sol#L712, rUSDY.sol#L723", "github_files_list": "rUSDYFactory.sol, RWADynamicOracle.sol, rUSDY.sol, IRWADynamicOracle.sol, SourceBridge.sol, DestinationBridge.sol", "github_refs_count": 18, "vulnerable_code_actual": "`Findings Links`\n\n[DestinationBridge.sol - Line 16](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/DestinationBridge.sol#L16)\n\n[SourceBridge.sol - Line 01](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/SourceBridge.sol#L1)\n\n[IRWADynamicOracle.sol - Line 16](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/rwaOracles/IRWADynamicOracle.sol#L16)\n\n[RWADynamicOracle.sol - Line 16](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/rwaOracles/RWADynamicOracle.sol#L16)\n\n[rUSDYFactory.sol - Line 16](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDYFactory.sol#L16)\n\n[rUSDY.sol - Line 16](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDY.sol#L16)\n\n
\n\n**Recommended Mitigation Steps**\n\nUpdate the contracts version to be safe from minor bug fixes between the used version and current solidity version.\n\n### [L-02] - Missing validation for `address(0)` in the constructors or in the functions changing state variables.\n\n**Details**\n\nIt is recommended to check for `address(0)` when updating state variables through constructor or functions. This can save the protocol from accidental updates.\n\n
\n Spotted Findings\n

\n\n`Example`\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "`Findings Links`\n\n[DestinationBridge.sol - Line 56 - 60](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/DestinationBridge.sol#L56-L60)\n\n[DestinationBridge.sol - Line 210](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/DestinationBridge.sol#L210)\n\n[DestinationBridge.sol - Line 220](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/DestinationBridge.sol#L220)\n\n[SourceBridge.sol - Line 41 - 44](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/SourceBridge.sol#L41-L44)\n\n[RWADynamicOracle.sol - Line 31 - 33](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/rwaOracles/RWADynamicOracle.sol#L31-L33)\n\n[rUSDYFactory.sol - Line 52](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDYFactory.sol#L52)\n\n[rUSDYFactory.sol - Line 76 - 80](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDYFactory.sol#L76-L80)\n\n[rUSDY.sol - Line 110 - 115](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDY.sol#L110-L115)\n\n[rUSDY.sol - Line 663](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDY.sol#L663)\n\n[rUSDY.sol - Line 701](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDY.sol#L701)\n\n[rUSDY.sol - Line 712](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDY.sol#L712)\n\n[rUSDY.sol - Line 723](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDY.sol#L723)\n\n
\n\n### [L-03] - Shadow Variables.\n\n**Details**\n\nConsider the compiler warnings into consideration and avoid the variable shadowing.\n\n
\n Spotted Findings\n

\n\n`Example`\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "11-kelp", "title": "crack the kelp Q", "severity_raw": "Low", "severity": "low", "description": "## Impact\nAsset price is fetched from `assetPriceOracle[asset]`. If it is not set, `depositAsset` function will not work as following call [will revert](https://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTOracle.sol#L46) due to call to `address(0)`.\n```\nIPriceFetcher(assetPriceOracle[asset]).getAssetPrice(asset);\n```\n\n\n## Proof of Concept\n\n```\ncontract LRTDepositPoolTest is BaseTest, RSETHTest {\n LRTDepositPool public lrtDepositPool;\n LRTOracle public lrtOracle;\n NodeDelegator public nodeDelegator;\n ILRTConfig public ilrtConfig;\n MockEigenStrategyManager public mockEigenStraregyManager;\n MockStrategy public mockStrategy1;\n MockStrategy public mockStrategy2;\n\n function setUp() public virtual override(RSETHTest, BaseTest) {\n super.setUp();\n // deploy LRTDepositPool\n ProxyAdmin proxyAdmin = new ProxyAdmin();\n LRTDepositPool contractImpl = new LRTDepositPool();\n TransparentUpgradeableProxy contractProxy = new TransparentUpgradeableProxy(\n address(contractImpl),\n address(proxyAdmin),\n \"\"\n );\n lrtDepositPool = LRTDepositPool(address(contractProxy));\n\n //deploy rsETH\n proxyAdmin = new ProxyAdmin();\n RSETH tokenImpl = new RSETH();\n TransparentUpgradeableProxy tokenProxy = new TransparentUpgradeableProxy(\n address(tokenImpl),\n address(proxyAdmin),\n \"\"\n );\n rseth = RSETH(address(tokenProxy));\n\n //deploy lrtConfig\n proxyAdmin = new ProxyAdmin();\n LRTConfig lrtConfigImpl = new LRTConfig();\n TransparentUpgradeableProxy lrtConfigProxy = new TransparentUpgradeableProxy(\n address(lrtConfigImpl),\n address(proxyAdmin),\n \"\"\n );\n\n lrtConfig = LRTConfig(address(lrtConfigProxy));\n\n // initialize RSETH. LRTCOnfig is already initialized in RSETHTest\n // rseth.initialize", "vulnerable_code": "IPriceFetcher(assetPriceOracle[asset]).getAssetPrice(asset);", "fixed_code": "contract LRTDepositPoolTest is BaseTest, RSETHTest {\n LRTDepositPool public lrtDepositPool;\n LRTOracle public lrtOracle;\n NodeDelegator public nodeDelegator;\n ILRTConfig public ilrtConfig;\n MockEigenStrategyManager public mockEigenStraregyManager;\n MockStrategy public mockStrategy1;\n MockStrategy public mockStrategy2;\n\n function setUp() public virtual override(RSETHTest, BaseTest) {\n super.setUp();\n // deploy LRTDepositPool\n ProxyAdmin proxyAdmin = new ProxyAdmin();\n LRTDepositPool contractImpl = new LRTDepositPool();\n TransparentUpgradeableProxy contractProxy = new TransparentUpgradeableProxy(\n address(contractImpl),\n address(proxyAdmin),\n \"\"\n );\n lrtDepositPool = LRTDepositPool(address(contractProxy));\n\n //deploy rsETH\n proxyAdmin = new ProxyAdmin();\n RSETH tokenImpl = new RSETH();\n TransparentUpgradeableProxy tokenProxy = new TransparentUpgradeableProxy(\n address(tokenImpl),\n address(proxyAdmin),\n \"\"\n );\n rseth = RSETH(address(tokenProxy));\n\n //deploy lrtConfig\n proxyAdmin = new ProxyAdmin();\n LRTConfig lrtConfigImpl = new LRTConfig();\n TransparentUpgradeableProxy lrtConfigProxy = new TransparentUpgradeableProxy(\n address(lrtConfigImpl),\n address(proxyAdmin),\n \"\"\n );\n\n lrtConfig = LRTConfig(address(lrtConfigProxy));\n\n // initialize RSETH. LRTCOnfig is already initialized in RSETHTest\n // rseth.initialize(address(admin), address(lrtConfig));\n // add rsETH to LRT config\n // lrtConfig.setRSETH(address(rseth));\n // add oracle to LRT config\n\n // deploy LRTOracle\n ProxyAdmin proxyAdmin1 = new ProxyAdmin();\n lrtOracle = new LRTOracle();\n TransparentUpgradeableProxy contractProxy1 = new TransparentUpgradeablePr", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/crack-the-kelp-Q.md", "collected_at": "2026-01-02T18:27:55.131131+00:00", "source_hash": "b7712890763566553619dbc7ad752cfa7709c5e664d18fc5c813d32cde6efc91", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 60, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "IPriceFetcher(assetPriceOracle[asset]).getAssetPrice(asset);", "primary_code_language": "unknown", "primary_code_char_count": 60, "all_code_blocks": "// Code block 1 (unknown):\nIPriceFetcher(assetPriceOracle[asset]).getAssetPrice(asset);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LRTOracle.sol#L46", "github_files_list": "LRTOracle.sol", "github_refs_count": 1, "vulnerable_code_actual": "IPriceFetcher(assetPriceOracle[asset]).getAssetPrice(asset);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "contract LRTDepositPoolTest is BaseTest, RSETHTest {\n LRTDepositPool public lrtDepositPool;\n LRTOracle public lrtOracle;\n NodeDelegator public nodeDelegator;\n ILRTConfig public ilrtConfig;\n MockEigenStrategyManager public mockEigenStraregyManager;\n MockStrategy public mockStrategy1;\n MockStrategy public mockStrategy2;\n\n function setUp() public virtual override(RSETHTest, BaseTest) {\n super.setUp();\n // deploy LRTDepositPool\n ProxyAdmin proxyAdmin = new ProxyAdmin();\n LRTDepositPool contractImpl = new LRTDepositPool();\n TransparentUpgradeableProxy contractProxy = new TransparentUpgradeableProxy(\n address(contractImpl),\n address(proxyAdmin),\n \"\"\n );\n lrtDepositPool = LRTDepositPool(address(contractProxy));\n\n //deploy rsETH\n proxyAdmin = new ProxyAdmin();\n RSETH tokenImpl = new RSETH();\n TransparentUpgradeableProxy tokenProxy = new TransparentUpgradeableProxy(\n address(tokenImpl),\n address(proxyAdmin),\n \"\"\n );\n rseth = RSETH(address(tokenProxy));\n\n //deploy lrtConfig\n proxyAdmin = new ProxyAdmin();\n LRTConfig lrtConfigImpl = new LRTConfig();\n TransparentUpgradeableProxy lrtConfigProxy = new TransparentUpgradeableProxy(\n address(lrtConfigImpl),\n address(proxyAdmin),\n \"\"\n );\n\n lrtConfig = LRTConfig(address(lrtConfigProxy));\n\n // initialize RSETH. LRTCOnfig is already initialized in RSETHTest\n // rseth.initialize(address(admin), address(lrtConfig));\n // add rsETH to LRT config\n // lrtConfig.setRSETH(address(rseth));\n // add oracle to LRT config\n\n // deploy LRTOracle\n ProxyAdmin proxyAdmin1 = new ProxyAdmin();\n lrtOracle = new LRTOracle();\n TransparentUpgradeableProxy contractProxy1 = new TransparentUpgradeablePr", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ethos", "title": "0xackermann G", "severity_raw": "High", "severity": "high", "description": "# Gas Report \n\n[Exclusive findings](#exclusive-findings) is below the [automated findings](#automated-findings).\n\n---\n\n## Automated Findings\nAutomated findings output for the [Ethos-Core package](https://docs.reaper.farm/ethos-reserve-bounty-hunter-documentation/useful-information/slither-output-ethos-core) and [Ethos-Vault package](https://docs.reaper.farm/ethos-reserve-bounty-hunter-documentation/useful-information/slither-output-ethos-vault). \n\n## Gas Optimizations\n\n\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [GAS-1](#GAS-1) | Use assembly to check for `address(0)` | 8 |\n| [GAS-2](#GAS-2) | Using bools for storage incurs overhead | 9 |\n| [GAS-3](#GAS-3) | Cache array length outside of loop | 8 |\n| [GAS-4](#GAS-4) | State variables should be cached in stack variables rather than re-reading them from storage | 10 |\n| [GAS-5](#GAS-5) | Use calldata instead of memory for function arguments that do not get mutated | 1 |\n| [GAS-6](#GAS-6) | Use Custom Errors | 73 |\n| [GAS-7](#GAS-7) | Don't initialize variables with default value | 23 |\n| [GAS-8](#GAS-8) | Long revert strings | 35 |\n| [GAS-9](#GAS-9) | Functions guaranteed to revert when called by normal users can be marked `payable` | 7 |\n| [GAS-10](#GAS-10) | `++i` costs less gas than `i++`, especially when it's used in `for`-loops (`--i`/`i--` too) | 17 |\n| [GAS-11](#GAS-11) | Using `private` rather than `public` for constants, saves gas | 30 |\n| [GAS-12](#GAS-12) | Use != 0 instead of > 0 for unsigned integer comparison | 27 |\n| [GAS-13](#GAS-13) | `internal` functions not called by the contract should be removed | 1 |\n### [GAS-1] Use assembly to check for `address(0)`\n*Saves 6 gas per instance*\n\n*Instances (8)*:\n```solidity\nFile: Ethos-Core/contracts/ActivePool.sol\n\n93: require(_treasuryAddress != address(0), \"Treasury cannot be 0 address\");\n\n```\n[Link to code](https://github.com/code-423n4/2023-02-ethos/tree/main/Ethos-Core/contracts/ActivePool.sol)\n\n```solidity\nFile: Ethos-Core/contracts/LUSDT", "vulnerable_code": "File: Ethos-Core/contracts/ActivePool.sol\n\n93: require(_treasuryAddress != address(0), \"Treasury cannot be 0 address\");\n", "fixed_code": "File: Ethos-Core/contracts/LUSDToken.sol\n\n312: assert(sender != address(0));\n\n313: assert(recipient != address(0));\n\n321: assert(account != address(0));\n\n329: assert(account != address(0));\n\n337: assert(owner != address(0));\n\n338: assert(spender != address(0));\n\n348: _recipient != address(0) && \n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/0xackermann-G.md", "collected_at": "2026-01-02T18:15:48.708628+00:00", "source_hash": "b7744e90c85b294f2e5890f33568a91a3693a512a8c4847529f3a59e0752725d", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 127, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: Ethos-Core/contracts/ActivePool.sol\n\n93: require(_treasuryAddress != address(0), \"Treasury cannot be 0 address\");", "primary_code_language": "solidity", "primary_code_char_count": 127, "all_code_blocks": "// Code block 1 (solidity):\nFile: Ethos-Core/contracts/ActivePool.sol\n\n93: require(_treasuryAddress != address(0), \"Treasury cannot be 0 address\");", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: Ethos-Core/contracts/ActivePool.sol\n\n93: require(_treasuryAddress != address(0), \"Treasury cannot be 0 address\");", "github_refs_formatted": "ActivePool.sol", "github_files_list": "ActivePool.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: Ethos-Core/contracts/ActivePool.sol\n\n93: require(_treasuryAddress != address(0), \"Treasury cannot be 0 address\");\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: Ethos-Core/contracts/LUSDToken.sol\n\n312: assert(sender != address(0));\n\n313: assert(recipient != address(0));\n\n321: assert(account != address(0));\n\n329: assert(account != address(0));\n\n337: assert(owner != address(0));\n\n338: assert(spender != address(0));\n\n348: _recipient != address(0) && \n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ethos", "title": "martin Q", "severity_raw": "Critical", "severity": "critical", "description": "## Introduction\n\nEthos QA report was done by martin, with a main focus on the low severity and non-critical security aspects of the implementaion and logic of the project.\n\n## Findings Summary\n\nThe following issues were found, categorized by their severity:\n\n### L-01 Consider implementing Two-Factor `updateCollateralRatios` with pending and approve functions\n\nBecause of admin human error it\u2019s possible to set a new `_MCR` and `_CCR` invalid values. When you want to change these values, it\u2019s better to propose a change, and then approve this changes.\n\n_There are **1** instances of this issue:_\n\n```solidity\n85: function updateCollateralRatios(\n```\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol\n\n### L-02 `revert()` should be used instead of `assert()`\n\nThe comment above clarifies that it is impossible to open a trove with zero withdrawn LUSD, in such case it's better to add the check and revert providing a description of necessary.\n\n_There are **2** instances of this issue:_\n\n```solidity\n128: assert(MIN_NET_DEBT > 0);\n\n197: assert(vars.compositeDebt > 0);\n```\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol\n\n### L-03 `_safeMint()` should be used rather than `_mint()` wherever possible\n\nWhen minting NFTs, the code uses `_safeMint` function of the OZ reference implementation. This function is safe because it checks whether the receiver can receive ERC721 tokens. The can prevent the case that a NFT will be minted to a contract that cannot handle ERC721 tokens. However, this external function call creates a security loophole. Specifically, the attacker can perform a reentrant call inside the onERC721Received callback. More detailed information why a reeentrancy can occur - https://blocksecteam.medium.com/when-safemint-becomes-unsafe-lessons-from-the-hypebears-security-incident-2965209bda2a.\n\n_There are **2** instances of this issue:_\n\n```solidity\n427: _lusdToken.mint(lqtyStaki", "vulnerable_code": "85: function updateCollateralRatios(", "fixed_code": "128: assert(MIN_NET_DEBT > 0);\n\n197: assert(vars.compositeDebt > 0);", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/martin-Q.md", "collected_at": "2026-01-02T18:17:23.060093+00:00", "source_hash": "b78f890bf7c5fea409d398966903166190b11cf0f4a91282dd65cf07d1b6a128", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 104, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "85: function updateCollateralRatios(", "primary_code_language": "solidity", "primary_code_char_count": 36, "all_code_blocks": "// Code block 1 (solidity):\n85: function updateCollateralRatios(\n\n// Code block 2 (solidity):\n128: assert(MIN_NET_DEBT > 0);\n\n197: assert(vars.compositeDebt > 0);", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "85: function updateCollateralRatios(\n\n128: assert(MIN_NET_DEBT > 0);\n\n197: assert(vars.compositeDebt > 0);", "github_refs_formatted": "CollateralConfig.sol, BorrowerOperations.sol", "github_files_list": "BorrowerOperations.sol, CollateralConfig.sol", "github_refs_count": 2, "vulnerable_code_actual": "85: function updateCollateralRatios(", "has_vulnerable_code_snippet": true, "fixed_code_actual": "128: assert(MIN_NET_DEBT > 0);\n\n197: assert(vars.compositeDebt > 0);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "02-ethos", "title": "chrisdior4 G", "severity_raw": "Medium", "severity": "medium", "description": "# Gas Optimization report\n\n| G-O |Issue|\n|:------:|:----|\n| [G‑01] | Using private rather than public for constants, saves gas | 9 |\n| [G‑02] | There's no need to set default values for variables | 9 |\n| [G‑03] | Consider using custom errors instead of require statements with string error | 9 |\n| [G‑04] | ++i costs less gas than i++, especially when it's used in for-loops (--i/i-- too) | 9 |\n| [G‑05] | Cache array length outside of loop | 9 |\n| [G‑06] | Bytes constants are more efficient than string constants | 9 |\n| [G‑07] | Use require instead of assert | 9 |\n| [G‑08] | Use x != 0 instead of x > 0 for uint types | 9 |\n| [G‑09] | Long revert strings | 9 |\n| [G‑10] | x = x - y costs less gas than x -= y, same for addition | 9 |\n| [G‑11] | Using storage instead of memory for structs/arrays saves gas | 9 |\n| [G‑12] | `internal` functions only called once can be inlined to save gas | 9 |\n| [G‑13] | Splitting require() statements that use && saves gas | 9 |\n\nTotal: 13 issues\n\n## [G-01] Using private rather than public for constants, saves gas\n\nFile: `CollateralConfig.sol`\n\nIf needed, the values can be read from the verified contract source code, or if there are multiple values there can be a single getter function that returns a tuple of the values of all currently-public constants. Saves 3406-3606 gas in deployment gas due to the compiler not having to create non-payable getter functions for deployment calldata, not having to store the bytes of the value outside of where it's used, and not adding another entry to the method ID table.\n\n```solidity\nuint256 constant public MIN_ALLOWED_MCR = 1.1 ether; // 110%\n...\nuint256 constant public MIN_ALLOWED_CCR = 1.5 ether; // 150%\n```\n\nLines of code:\n\n- https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/CollateralConfig.sol#L21\n\n- https://github.com/code-423n4/2023-02-ethos/blob", "vulnerable_code": "uint256 constant public MIN_ALLOWED_MCR = 1.1 ether; // 110%\n...\nuint256 constant public MIN_ALLOWED_CCR = 1.5 ether; // 150%", "fixed_code": "Lines of code:\n\n- https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/CollateralConfig.sol#L18\n\nFile: `ActivePool.sol`\n\nIf a variable is not set/initialized, the default value is assumed (0, false, 0x0 \u2026 depending on the data type). You are simply wasting gas if you directly initialize it with its default value.\n", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/chrisdior4-G.md", "collected_at": "2026-01-02T18:16:56.659203+00:00", "source_hash": "b7f1617e02da4fb9e5f16de18f5dcf0b04f061aa63b6549f6d3b29ac51640c6f", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 125, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "uint256 constant public MIN_ALLOWED_MCR = 1.1 ether; // 110%\n...\nuint256 constant public MIN_ALLOWED_CCR = 1.5 ether; // 150%", "primary_code_language": "solidity", "primary_code_char_count": 125, "all_code_blocks": "// Code block 1 (solidity):\nuint256 constant public MIN_ALLOWED_MCR = 1.1 ether; // 110%\n...\nuint256 constant public MIN_ALLOWED_CCR = 1.5 ether; // 150%", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "uint256 constant public MIN_ALLOWED_MCR = 1.1 ether; // 110%\n...\nuint256 constant public MIN_ALLOWED_CCR = 1.5 ether; // 150%", "github_refs_formatted": "CollateralConfig.sol#L21, CollateralConfig.sol#L18", "github_files_list": "CollateralConfig.sol", "github_refs_count": 2, "vulnerable_code_actual": "uint256 constant public MIN_ALLOWED_MCR = 1.1 ether; // 110%\n...\nuint256 constant public MIN_ALLOWED_CCR = 1.5 ether; // 150%", "has_vulnerable_code_snippet": true, "fixed_code_actual": "Lines of code:\n\n- https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/CollateralConfig.sol#L18\n\nFile: `ActivePool.sol`\n\nIf a variable is not set/initialized, the default value is assumed (0, false, 0x0 \u2026 depending on the data type). You are simply wasting gas if you directly initialize it with its default value.\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ethos", "title": "0xhacksmithh Q", "severity_raw": "High", "severity": "high", "description": "### [Low-01]```approve``` could be front-runned\n*instances()*\n```\nFile: Ethos-Core/contracts/LUSDToken.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L230\n```\n\n\n### [NC-01] OMISSIONS In Events\n*instances(Multiple Instances as shown in folling links)*\n```\nFile: Ethos-Core/contracts/BorrowerOperations.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L92-L106\n```\n```\nFile: Ethos-Core/contracts/TroveManager.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L186-L223\n```\n```\nFile: Ethos-Core/contracts/ActivePool.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol#L58-L67\n```\n```\nFile: Ethos-Core/contracts/StabilityPool.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/StabilityPool.sol#L233-L257\n```\n```\nFile: Ethos-Core/contracts/LUSDToken.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L78-L82\n```\n```\nFile: Ethos-Core/contracts/LQTY/LQTYStaking.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LQTY/LQTYStaking.sol#L49-L62\n```\n\n### [NC-02] No ```Natspec``` for external or public fnctions\n*instances(6)*\n```\nFile: Ethos-Core/contracts/TroveManager.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L310\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L513\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L939\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L962\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L982\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L1016\n```\n\n### [NC-03] ```constant``` values such as a call to ```keccak", "vulnerable_code": "File: Ethos-Core/contracts/LUSDToken.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L230", "fixed_code": "File: Ethos-Core/contracts/BorrowerOperations.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L92-L106", "recommendation": "", "category": "front-running", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/0xhacksmithh-Q.md", "collected_at": "2026-01-02T18:15:51.382084+00:00", "source_hash": "b8b5fc61ea7a597eabe2dcce0d9ef2077e245bbf9f517fc87b7c066d7ce2211e", "code_block_count": 8, "solidity_block_count": 0, "total_code_chars": 1635, "github_ref_count": 13, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: Ethos-Core/contracts/LUSDToken.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L230", "primary_code_language": "unknown", "primary_code_char_count": 134, "all_code_blocks": "// Code block 1 (unknown):\nFile: Ethos-Core/contracts/LUSDToken.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L230\n\n// Code block 2 (unknown):\nFile: Ethos-Core/contracts/BorrowerOperations.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L92-L106\n\n// Code block 3 (unknown):\nFile: Ethos-Core/contracts/TroveManager.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L186-L223\n\n// Code block 4 (unknown):\nFile: Ethos-Core/contracts/ActivePool.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol#L58-L67\n\n// Code block 5 (unknown):\nFile: Ethos-Core/contracts/StabilityPool.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/StabilityPool.sol#L233-L257\n\n// Code block 6 (unknown):\nFile: Ethos-Core/contracts/LUSDToken.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L78-L82\n\n// Code block 7 (unknown):\nFile: Ethos-Core/contracts/LQTY/LQTYStaking.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LQTY/LQTYStaking.sol#L49-L62\n\n// Code block 8 (unknown):\nFile: Ethos-Core/contracts/TroveManager.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L310\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L513\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L939\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L962\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L982\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L1016", "all_code_blocks_count": 8, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LUSDToken.sol#L230, BorrowerOperations.sol#L92-L106, TroveManager.sol#L186-L223, ActivePool.sol#L58-L67, StabilityPool.sol#L233-L257, LUSDToken.sol#L78-L82, LQTYStaking.sol#L49-L62, TroveManager.sol#L310, TroveManager.sol#L513, TroveManager.sol#L939, TroveManager.sol#L962, TroveManager.sol#L982, TroveManager.sol#L1016", "github_files_list": "StabilityPool.sol, TroveManager.sol, BorrowerOperations.sol, LQTYStaking.sol, LUSDToken.sol, ActivePool.sol", "github_refs_count": 13, "vulnerable_code_actual": "File: Ethos-Core/contracts/LUSDToken.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L230", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: Ethos-Core/contracts/BorrowerOperations.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L92-L106", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 14} {"source": "c4", "protocol": "05-ajna", "title": "yjrwkk Q", "severity_raw": "QA", "severity": "qa", "description": "### [QA-001] Unsafe ERC721 operations\n\nIt is recommended to use OpenZeppelin's safeTransferFrom. \n\n[ajna-core/src/RewardsManager.sol#L250](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/RewardsManager.sol#L250) \n```\nIERC721(address(positionManager)).transferFrom(msg.sender, address(this), tokenId_);\n```\n[ajna-core/src/RewardsManager.sol#L302](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/RewardsManager.sol#L302) \n\n### [QA-002] Use scientific notation rather than exponentiation\n\nE.g. `1e18` instead of `10 ** 18`. While the compiler knows to optimize away the exponentiation, it is a better coding practice to use idioms that do not require compiler optimization, if they exist. \n\n[ajna-grants/src/grants/libraries/Maths.sol#L6](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/libraries/Maths.sol#L6) \n```\nuint256 public constant WAD = 10**18;\n```\n[ajna-grants/src/grants/libraries/Maths.sol#L30](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/libraries/Maths.sol#L30) \n[ajna-grants/src/grants/libraries/Maths.sol#L34](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/libraries/Maths.sol#L34) \n[ajna-grants/src/grants/libraries/Maths.sol#L38](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/libraries/Maths.sol#L38) \n[ajna-grants/src/grants/libraries/Maths.sol#L47](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/libraries/Maths.sol#L47) \n\n### [QA-003] Numeric values having to do with time should use time units for readability\n\nSuffixes like `seconds`, `minutes`, `hours`, `days` and `weeks` after literal numbers can be used to specify units of time. \n\n[ajna-grants/src/grants/base/StandardFunding.sol#L34](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L34) \n```\nuint256 internal constant CHALLENGE_PERIOD_LENGTH = 50400;\n```\n[ajna-grants/src/gr", "vulnerable_code": "IERC721(address(positionManager)).transferFrom(msg.sender, address(this), tokenId_);", "fixed_code": "uint256 public constant WAD = 10**18;", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/yjrwkk-Q.md", "collected_at": "2026-01-02T18:21:53.227410+00:00", "source_hash": "b8bb90360455c26d81c4e123c1ccd23e043b4fe19d9b5d8f6bbd59b743ce5923", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 179, "github_ref_count": 8, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "IERC721(address(positionManager)).transferFrom(msg.sender, address(this), tokenId_);", "primary_code_language": "unknown", "primary_code_char_count": 84, "all_code_blocks": "// Code block 1 (unknown):\nIERC721(address(positionManager)).transferFrom(msg.sender, address(this), tokenId_);\n\n// Code block 2 (unknown):\nuint256 public constant WAD = 10**18;\n\n// Code block 3 (unknown):\nuint256 internal constant CHALLENGE_PERIOD_LENGTH = 50400;", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "RewardsManager.sol#L250, RewardsManager.sol#L302, Maths.sol#L6, Maths.sol#L30, Maths.sol#L34, Maths.sol#L38, Maths.sol#L47, StandardFunding.sol#L34", "github_files_list": "RewardsManager.sol, Maths.sol, StandardFunding.sol", "github_refs_count": 8, "vulnerable_code_actual": "IERC721(address(positionManager)).transferFrom(msg.sender, address(this), tokenId_);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "uint256 public constant WAD = 10**18;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "05-ajna", "title": "Shogoki G", "severity_raw": "Gas", "severity": "gas", "description": "# GAS Savings Report\n\n## GAS-001 - unfitting data type\n\nIn [Positionmanager:62](https://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-core/src/PositionManager.sol#L62) the internal member `_nextId` is defined as `uint176` as, together with the rest of the variables, this does not make up a full storage slot, it would be more efficient to occupy a full slot by using ?uint256` instead.\n\n## GAS-002 - declare loop var outside of the loop\n\nIt is more gas efficient to put the declaration of the counter variable outside of the for loop:\n\n```solidity\nuint i;\nfor( ; i< numProposals;) {\n ...\n```\n\n### Occurences\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/Funding.sol#L62\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/Funding.sol#L112\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/StandardFunding.sol#L208\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/StandardFunding.sol#L324\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/StandardFunding.sol#L434\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/StandardFunding.sol#L468\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/StandardFunding.sol#L469\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/StandardFunding.sol#L491\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-grants/src/grants/base/StandardFunding.sol#L549\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edcea", "vulnerable_code": "uint i;\nfor( ; i< numProposals;) {\n ...", "fixed_code": " function _findProposalIndex(\n uint256 proposalId_,\n uint256[] memory array_\n ) internal pure returns (int256 index_) {\n \n index_ = -1; // default value indicating proposalId not in the array\n uint256 arrayLength = array_.length;\n require(arrayLength <= type(int256).max, \"array too long\");\n uint256 i;\n for (; i < arrayLength;) {\n //slither-disable-next-line incorrect-equality\n if (array_[i] == proposalId_) {\n index_ = int256(i); // cast only in one case\n break;\n }\n\n unchecked { ++i; }\n }\n }", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/Shogoki-G.md", "collected_at": "2026-01-02T18:21:13.345021+00:00", "source_hash": "b8c3e579a85e2a75b1db83dea12bcbec41aec28f33dd67d216aa89edccbde990", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 42, "github_ref_count": 10, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "uint i;\nfor( ; i< numProposals;) {\n ...", "primary_code_language": "solidity", "primary_code_char_count": 42, "all_code_blocks": "// Code block 1 (solidity):\nuint i;\nfor( ; i< numProposals;) {\n ...", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "uint i;\nfor( ; i< numProposals;) {\n ...", "github_refs_formatted": "PositionManager.sol#L62, Funding.sol#L62, Funding.sol#L112, StandardFunding.sol#L208, StandardFunding.sol#L324, StandardFunding.sol#L434, StandardFunding.sol#L468, StandardFunding.sol#L469, StandardFunding.sol#L491, StandardFunding.sol#L549", "github_files_list": "StandardFunding.sol, Funding.sol, PositionManager.sol", "github_refs_count": 10, "vulnerable_code_actual": "uint i;\nfor( ; i< numProposals;) {\n ...", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function _findProposalIndex(\n uint256 proposalId_,\n uint256[] memory array_\n ) internal pure returns (int256 index_) {\n \n index_ = -1; // default value indicating proposalId not in the array\n uint256 arrayLength = array_.length;\n require(arrayLength <= type(int256).max, \"array too long\");\n uint256 i;\n for (; i < arrayLength;) {\n //slither-disable-next-line incorrect-equality\n if (array_[i] == proposalId_) {\n index_ = int256(i); // cast only in one case\n break;\n }\n\n unchecked { ++i; }\n }\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "04-caviar", "title": "0xnev Q", "severity_raw": "Critical", "severity": "critical", "description": "### Issues Template\n| Letter | Name | Description |\n|:--:|:-------:|:-------:|\n| L | Low risk | Potential risk |\n| NC | Non-critical | Non risky findings |\n| R | Refactor | Code changes |\n| O | Ordinary | Commonly found issues |\n\n| Total Found Issues | 5 |\n|:--:|:--:|\n\n### Low Risk Template\n| Count | Title | Instances |\n|:--:|:-------|:--:|\n| [L-01] | Remove unecessary `receive() payable` function in EthRouter | 1 |\n| [L-02] | Solmate\u2019s `SafeTransferLib `doesn\u2019t check whether the ERC20 contract exists| 21 |\n| [L-03] | Confusing deadline comments| 4 |\n\n| Total Low Risk Issues | 3 |\n|:--:|:--:|\n\n### Non-Critical Template\n| Count | Title | Instances |\n|:--:|:-------|:--:|\n| [N-01] | Missing event for critical parameters init and change | 3 |\n| [N-02] | Add timelock to critical functions | 3 |\n\n| Total Non-Critical Issues | 2 |\n|:--:|:--:|\n\n### [L-01] Remove unecessary `receive() payable` function in EthRouter.sol\n[EthRouter.sol#L88](https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L88)\n```solidity\n/EthRouter.sol\n88: receive() external payable {}\n```\nThere is no means of withdrawing ether sent to the `EthRouter.sol` contract in the event where ether is accidentally sent to it. This can lead to accidental locking of funds. Suggest removing unecessary `receive() external payable{}` function or implement withdrawal mechanism. \n \n### [L-02] Solmate\u2019s `SafeTransferLib `doesn\u2019t check whether the ERC20 contract exists\n[Factory.sol#L120](https://github.com/code-423n4/2023-04-caviar/blob/main/src/Factory.sol#L120)\n```solidity\n21 results - 3 files\n\n/Factory.sol\n120: ERC721(_nft).safeTransferFrom(msg.sender, address(privatePool), tokenIds[i]);\n```\n[EthRouter.sol#L136](https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L136)\n[EthRouter.sol#L162](https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L162)\n[EthRouter.sol#L266](https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L266", "vulnerable_code": "/EthRouter.sol\n88: receive() external payable {}", "fixed_code": "21 results - 3 files\n\n/Factory.sol\n120: ERC721(_nft).safeTransferFrom(msg.sender, address(privatePool), tokenIds[i]);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/0xnev-Q.md", "collected_at": "2026-01-02T18:19:25.295249+00:00", "source_hash": "b8f45d9e506ead68b7f888c4bf6cf0f6b0bf10c54ad23d24036fcbacc1524599", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 179, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "/EthRouter.sol\n88: receive() external payable {}", "primary_code_language": "solidity", "primary_code_char_count": 51, "all_code_blocks": "// Code block 1 (solidity):\n/EthRouter.sol\n88: receive() external payable {}\n\n// Code block 2 (solidity):\n21 results - 3 files\n\n/Factory.sol\n120: ERC721(_nft).safeTransferFrom(msg.sender, address(privatePool), tokenIds[i]);", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "/EthRouter.sol\n88: receive() external payable {}\n\n21 results - 3 files\n\n/Factory.sol\n120: ERC721(_nft).safeTransferFrom(msg.sender, address(privatePool), tokenIds[i]);", "github_refs_formatted": "EthRouter.sol#L88, Factory.sol#L120, EthRouter.sol#L136, EthRouter.sol#L162, EthRouter.sol#L266", "github_files_list": "EthRouter.sol, Factory.sol", "github_refs_count": 5, "vulnerable_code_actual": "/EthRouter.sol\n88: receive() external payable {}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "21 results - 3 files\n\n/Factory.sol\n120: ERC721(_nft).safeTransferFrom(msg.sender, address(privatePool), tokenIds[i]);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "03-asymmetry", "title": "alexzoid Q", "severity_raw": "Low", "severity": "low", "description": "## [01] Floating Pragma\n\nThe compiler version is not locked, which may lead to deploying contracts with different or bugged versions:\n\n- https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L2\n- https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L2\n- https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol#L2\n- https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol#L2\n```solidity\npragma solidity ^0.8.13;\n```\nTo avoid potential issues, lock the pragma version and ensure that the chosen compiler version is free of known bugs:\n```solidity\npragma solidity 0.8.19;\n```\n\n## [02] Unused Import\n\nAn import statement is present in the source file, but the imported file is not used:\n\n- https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L4-L8\n```solidity\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"../interfaces/IWETH.sol\";\nimport \"../interfaces/uniswap/ISwapRouter.sol\";\nimport \"../interfaces/lido/IWStETH.sol\";\nimport \"../interfaces/lido/IstETH.sol\";\n```\n- https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L5-L6\n```solidity\nimport \"../../interfaces/frax/IsFrxEth.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n```\n- https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol#L6\n```solidity\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n```\n\nTo optimize the code and avoid redundancy, remove the unnecessary import.\n\n## [03] Redundant Contract Inheritance\n\nThe `Initializable` contract is already inherited through the parent contract `OwnableUpgradeable`:\n- https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L16\n```solidity\ncontract SafEth is\n Initializable,\n ERC20Upgradeable,\n OwnableUpgradeable,\n SafEthStorage\n```\n- ", "vulnerable_code": "pragma solidity ^0.8.13;", "fixed_code": "pragma solidity 0.8.19;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/alexzoid-Q.md", "collected_at": "2026-01-02T18:18:46.797690+00:00", "source_hash": "b9179aa3a186b40288e7aa2213ef07b6938a25fb43bc87fdb7a5a8df5c7c118f", "code_block_count": 6, "solidity_block_count": 6, "total_code_chars": 524, "github_ref_count": 8, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "pragma solidity ^0.8.13;", "primary_code_language": "solidity", "primary_code_char_count": 24, "all_code_blocks": "// Code block 1 (solidity):\npragma solidity ^0.8.13;\n\n// Code block 2 (solidity):\npragma solidity 0.8.19;\n\n// Code block 3 (solidity):\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"../interfaces/IWETH.sol\";\nimport \"../interfaces/uniswap/ISwapRouter.sol\";\nimport \"../interfaces/lido/IWStETH.sol\";\nimport \"../interfaces/lido/IstETH.sol\";\n\n// Code block 4 (solidity):\nimport \"../../interfaces/frax/IsFrxEth.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\n// Code block 5 (solidity):\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\n// Code block 6 (solidity):\ncontract SafEth is\n Initializable,\n ERC20Upgradeable,\n OwnableUpgradeable,\n SafEthStorage", "all_code_blocks_count": 6, "has_diff_blocks": false, "diff_code": "", "solidity_code": "pragma solidity ^0.8.13;\n\npragma solidity 0.8.19;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"../interfaces/IWETH.sol\";\nimport \"../interfaces/uniswap/ISwapRouter.sol\";\nimport \"../interfaces/lido/IWStETH.sol\";\nimport \"../interfaces/lido/IstETH.sol\";\n\nimport \"../../interfaces/frax/IsFrxEth.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ncontract SafEth is\n Initializable,\n ERC20Upgradeable,\n OwnableUpgradeable,\n SafEthStorage", "github_refs_formatted": "SafEth.sol#L2, Reth.sol#L2, SfrxEth.sol#L2, WstEth.sol#L2, SafEth.sol#L4-L8, Reth.sol#L5-L6, WstEth.sol#L6, SafEth.sol#L16", "github_files_list": "SfrxEth.sol, Reth.sol, WstEth.sol, SafEth.sol", "github_refs_count": 8, "vulnerable_code_actual": "pragma solidity ^0.8.13;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "pragma solidity 0.8.19;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 12} {"source": "c4", "protocol": "03-revert-lend", "title": "Myd Analysis", "severity_raw": "Critical", "severity": "critical", "description": "## Table of Contents\n1. Introduction\n2. Approach\n3. Architecture Overview\n4. Codebase Quality Analysis\n 4.1. Code Structure and Readability\n 4.2. Use of Libraries and Standards\n 4.3. Error Handling and Validation\n 4.4. Test Coverage and Documentation\n5. Contract Analysis\n 5.1. V3Vault\n 5.2. InterestRateModel\n 5.3. V3Oracle\n 5.4. Swapper\n 5.5. AutoCompound\n 5.6. AutoRange\n 5.7. LeverageTransformer\n 5.8. V3Utils\n6. Centralization Risks\n7. Mechanism Review\n 7.1. Interest Rate Model\n 7.2. Collateralization and Liquidation\n 7.3. Oracle System\n8. Systemic Risks\n9. Recommendations\n10. Conclusion\n\n## 1. Introduction\nRevert Lend is a decentralized lending protocol designed for Uniswap V3 liquidity providers (LPs). It allows LPs to collateralize their Uniswap V3 positions (NFTs) to borrow assets while retaining control over their LP positions. This report provides an in-depth analysis of the Revert Lend smart contracts, focusing on the architecture, code quality, potential issues, and risks.\n\n## 2. Approach\nThe analysis of the Revert Lend codebase involved a thorough review of the smart contracts, including:\n- Reading the whitepaper and technical documentation to understand the protocol's intended behavior and architecture.\n- Reviewing the smart contract code line by line to identify potential vulnerabilities, code quality issues, and adherence to best practices.\n- Analyzing the protocol's architecture and design choices to assess their soundness and potential risks.\n- Examining the protocol's integration with external systems, such as Chainlink oracles and Uniswap V3 contracts.\n- Considering the protocol's resilience to various attack vectors and potential exploits.\n\n## 3. Architecture Overview\nThe Revert Lend protocol consists of several key components:\n- V3Vault: The main contract that manages the lending and borrowing functionality, as well as the collateralization of Uniswap V3 positions.\n- InterestRateModel: Responsible for calculating the ", "vulnerable_code": "1. ", "fixed_code": "2. ", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/Myd-Analysis.md", "collected_at": "2026-01-02T19:03:02.383287+00:00", "source_hash": "b91f985d474da00b3ce3f48bd6aec816c294494df1154027b7fdf6245e73d8e2", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "1. ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "2. ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-revert-lend", "title": "0x11singh99 G", "severity_raw": "High", "severity": "high", "description": "# Gas Optimizations\n\n**Note : _G-01_ and _G-12_ contains only those instances which were missed by bot. Since they are major gas savings so I included those missed instances. Gas Mentioned in these findings title is total gas saved by all instances of that finding covered in this report.**\n\n## Table of Contents\n\n- [G-01] [State variables can be packed into fewer storage slot by reducing their size (**Gas Saved: ~8000 Gas**)(Instances missed by bot)](#g-01-state-variables-can-be-packed-into-fewer-storage-slots-by-reducing-their-sizes-gas-saved-8000-gasinstances-missed-by-bot)\n\n- [G-02] [State variable can be packed into fewer storage slots by truncating timestamp(**Gas Saved: ~2000 Gas**)](#g-02-state-variable-can-be-packed-into-fewer-storage-slots-by-truncating-timestampgas-saved-2000-gas)\n\n- [G-03] [Pack the struct variable into fewer storage slots by re-ordering the variables(**Gas Saved: ~2000 Gas**)](#g-03-pack-the-struct-variables-into-fewer-storage-slots-by-re-ordering-the-variablesgas-saved-2000-gas)\n\n- [G-04] [Refactor `borrow` function to avoid 1 sload](#g-04-refactor-borrow-function-to-avoid-1-sload)\n\n- [G-05] [Refactor `configToken` function to fail early and `saves 1 external call` on failing](#g-05-refactor-configtoken-function-to-fail-early-and-saves-1-external-call-on-failing)\n- [G-06] [Cache state variable outside of the else block to save 1 sload(**Gas Saved: ~100 Gas**)](#g-06-cache-state-variable-outside-of-the-else-block-to-save-1-sloadgas-saved-100-gas)\n- [G-07] [Use direct global msg.sender instead of taking it as function parameter](#g-07-use-direct-global-msgsender-instead-of-taking-it-as-function-parameter)\n- [G-08] [Cache calculations instead of re-calculating saves 3 checked subtraction(**Gas Saved: ~540 Gas**)](#g-08-cache-calculations-instead-of-re-calculating-saves-3-checked-subtraction)\n- [G-09] [Struct can be packed into fewer storage slot by truncating time(**Gas Saved: ~4000 Gas**)](#g-09-struct-can-be-packed-into-fewer-storage-slot", "vulnerable_code": "File : InterestRateModel.sol\n\n23: uint256 public multiplierPerSecondX96;\n24: uint256 public baseRatePerSecondX96;\n25: uint256 public jumpMultiplierPerSecondX96;\n", "fixed_code": "File : InterestRateModel.sol\n\n13: uint256 public constant YEAR_SECS = 31557600; // taking into account leap years\n14:\n15: uint256 public constant MAX_BASE_RATE_X96 = Q96 / 10; // 10%\n16: uint256 public constant MAX_MULTIPLIER_X96 = Q96 * 2; // 200%\n...\n...\n\n82: function setValues(\n uint256 baseRatePerYearX96,\n uint256 multiplierPerYearX96,\n uint256 jumpMultiplierPerYearX96,\n uint256 _kinkX96\n87: ) public onlyOwner {\n88: if (\n89: baseRatePerYearX96 > MAX_BASE_RATE_X96 || multiplierPerYearX96 > MAX_MULTIPLIER_X96\n90: || jumpMultiplierPerYearX96 > MAX_MULTIPLIER_X96\n91: ) {\n92: revert InvalidConfig();\n93: }\n94:\n95: baseRatePerSecondX96 = baseRatePerYearX96 / YEAR_SECS;\n96: multiplierPerSecondX96 = multiplierPerYearX96 / YEAR_SECS;\n97: jumpMultiplierPerSecondX96 = jumpMultiplierPerYearX96 / YEAR_SECS;\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/0x11singh99-G.md", "collected_at": "2026-01-02T19:02:50.807791+00:00", "source_hash": "b967f96eb6a64700ac3bf05724872922401d15fc7bac0f078d552b8bdb4b2650", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File : InterestRateModel.sol\n\n23: uint256 public multiplierPerSecondX96;\n24: uint256 public baseRatePerSecondX96;\n25: uint256 public jumpMultiplierPerSecondX96;\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File : InterestRateModel.sol\n\n13: uint256 public constant YEAR_SECS = 31557600; // taking into account leap years\n14:\n15: uint256 public constant MAX_BASE_RATE_X96 = Q96 / 10; // 10%\n16: uint256 public constant MAX_MULTIPLIER_X96 = Q96 * 2; // 200%\n...\n...\n\n82: function setValues(\n uint256 baseRatePerYearX96,\n uint256 multiplierPerYearX96,\n uint256 jumpMultiplierPerYearX96,\n uint256 _kinkX96\n87: ) public onlyOwner {\n88: if (\n89: baseRatePerYearX96 > MAX_BASE_RATE_X96 || multiplierPerYearX96 > MAX_MULTIPLIER_X96\n90: || jumpMultiplierPerYearX96 > MAX_MULTIPLIER_X96\n91: ) {\n92: revert InvalidConfig();\n93: }\n94:\n95: baseRatePerSecondX96 = baseRatePerYearX96 / YEAR_SECS;\n96: multiplierPerSecondX96 = multiplierPerYearX96 / YEAR_SECS;\n97: jumpMultiplierPerSecondX96 = jumpMultiplierPerYearX96 / YEAR_SECS;\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "05-ajna", "title": "pontifex Q", "severity_raw": "Critical", "severity": "critical", "description": "\n## Non Critical\n### N-1 PositionManager.sol#L54_Incorrect comment about `positions` mapping\nIt is obviously that the comment in the #L54 is incorrect. It should be replaced with correct information.\n```solidity\n54: /// @dev Mapping of `token id => ajna pool address` for which token was minted.\n55: mapping(uint256 => mapping(uint256 => Position)) internal positions;\n```\nhttps://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-core/src/PositionManager.sol#L54\n\n\n### N-2 PositionManager.sol_Incorrect comments with `LiquidityNotRemoved()` error\nLines [L#166](https://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-core/src/PositionManager.sol#LL166C1-L166C78) and [L#258](https://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-core/src/PositionManager.sol#LL258C1-L258C80) contain wrong information about handled errors. The code below the comments doesn't revert with the `LiquidityNotRemoved()` error. These comments should be replaced with correct information.\n```solidity\n166: * @dev positions token to burn has liquidity `LiquidityNotRemoved()`\n\n\n258: * @dev - positions token to burn has liquidity `LiquidityNotRemoved()`\n```\n\n\n### N-3 PositionManager.sol_Typo in comments\nThe line [L#348](https://github.com/code-423n4/2023-05-ajna/blob/276942bc2f97488d07b887c8edceaaab7a5c3964/ajna-core/src/PositionManager.sol#L348) contains wrong information about the `RemoveLiquidityFailed()` error. There aren't this type errors in the code. It is possible that it is just a typo.\n```solidity\n348: * @dev - position not tracked `RemoveLiquidityFailed()`\n\n\n369: if (position.depositTime == 0 || position.lps == 0) revert RemovePositionFailed();\n\n\n375: if (!positionIndex.remove(index)) revert RemovePositionFailed();\n```\n### N-4 StandardFunding.sol#L619_Variable `support` need not be initialized to `1`\nThe `support` variable can be in", "vulnerable_code": "54: /// @dev Mapping of `token id => ajna pool address` for which token was minted.\n55: mapping(uint256 => mapping(uint256 => Position)) internal positions;", "fixed_code": "166: * @dev positions token to burn has liquidity `LiquidityNotRemoved()`\n\n\n258: * @dev - positions token to burn has liquidity `LiquidityNotRemoved()`", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/pontifex-Q.md", "collected_at": "2026-01-02T18:21:43.995202+00:00", "source_hash": "b99c44e130582a9eb9ef549a36ede702f4c24dbce7199aca0d8330eae41bb85a", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 581, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "54: /// @dev Mapping of `token id => ajna pool address` for which token was minted.\n55: mapping(uint256 => mapping(uint256 => Position)) internal positions;", "primary_code_language": "solidity", "primary_code_char_count": 162, "all_code_blocks": "// Code block 1 (solidity):\n54: /// @dev Mapping of `token id => ajna pool address` for which token was minted.\n55: mapping(uint256 => mapping(uint256 => Position)) internal positions;\n\n// Code block 2 (solidity):\n166: * @dev positions token to burn has liquidity `LiquidityNotRemoved()`\n\n\n258: * @dev - positions token to burn has liquidity `LiquidityNotRemoved()`\n\n// Code block 3 (solidity):\n348: * @dev - position not tracked `RemoveLiquidityFailed()`\n\n\n369: if (position.depositTime == 0 || position.lps == 0) revert RemovePositionFailed();\n\n\n375: if (!positionIndex.remove(index)) revert RemovePositionFailed();", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "54: /// @dev Mapping of `token id => ajna pool address` for which token was minted.\n55: mapping(uint256 => mapping(uint256 => Position)) internal positions;\n\n166: * @dev positions token to burn has liquidity `LiquidityNotRemoved()`\n\n\n258: * @dev - positions token to burn has liquidity `LiquidityNotRemoved()`\n\n348: * @dev - position not tracked `RemoveLiquidityFailed()`\n\n\n369: if (position.depositTime == 0 || position.lps == 0) revert RemovePositionFailed();\n\n\n375: if (!positionIndex.remove(index)) revert RemovePositionFailed();", "github_refs_formatted": "PositionManager.sol#L54, PositionManager.sol, PositionManager.sol#L348", "github_files_list": "PositionManager.sol", "github_refs_count": 3, "vulnerable_code_actual": "54: /// @dev Mapping of `token id => ajna pool address` for which token was minted.\n55: mapping(uint256 => mapping(uint256 => Position)) internal positions;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "166: * @dev positions token to burn has liquidity `LiquidityNotRemoved()`\n\n\n258: * @dev - positions token to burn has liquidity `LiquidityNotRemoved()`", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "01-biconomy", "title": "elolpuer G", "severity_raw": "Unknown", "severity": "unknown", "description": "## contracts\\smart-contract-wallet\\SmartAccount.sol\n\n[Link to function in github.com](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L460)\n\n### Description\n\nThere is no point in the ```onlyOwner``` modifier, because we check the owner in ```_requireFromEntryPointOrOwner()```.\n\n### Code w/o onlyOwner\n\n```\n\nfunction execute(address dest, uint value, bytes calldata func) external {\n _requireFromEntryPointOrOwner();\n _call(dest, value, func);\n}\n\nfunction executeBatch(address[] calldata dest, bytes[] calldata func) external {\n _requireFromEntryPointOrOwner();\n require(dest.length == func.length, \"wrong array lengths\");\n for (uint i = 0; i < dest.length;) {\n _call(dest[i], 0, func[i]);\n unchecked {\n ++i;\n }\n }\n}\n\n```\n\n", "vulnerable_code": "function execute(address dest, uint value, bytes calldata func) external {\n _requireFromEntryPointOrOwner();\n _call(dest, value, func);\n}\n\nfunction executeBatch(address[] calldata dest, bytes[] calldata func) external {\n _requireFromEntryPointOrOwner();\n require(dest.length == func.length, \"wrong array lengths\");\n for (uint i = 0; i < dest.length;) {\n _call(dest[i], 0, func[i]);\n unchecked {\n ++i;\n }\n }\n}\n", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/elolpuer-G.md", "collected_at": "2026-01-02T18:13:43.209299+00:00", "source_hash": "b99eced80d769efa7d34cfea70d90058d68920bf1594047fab5660cadf4fb780", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 458, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function execute(address dest, uint value, bytes calldata func) external {\n _requireFromEntryPointOrOwner();\n _call(dest, value, func);\n}\n\nfunction executeBatch(address[] calldata dest, bytes[] calldata func) external {\n _requireFromEntryPointOrOwner();\n require(dest.length == func.length, \"wrong array lengths\");\n for (uint i = 0; i < dest.length;) {\n _call(dest[i], 0, func[i]);\n unchecked {\n ++i;\n }\n }\n}", "primary_code_language": "unknown", "primary_code_char_count": 458, "all_code_blocks": "// Code block 1 (unknown):\nfunction execute(address dest, uint value, bytes calldata func) external {\n _requireFromEntryPointOrOwner();\n _call(dest, value, func);\n}\n\nfunction executeBatch(address[] calldata dest, bytes[] calldata func) external {\n _requireFromEntryPointOrOwner();\n require(dest.length == func.length, \"wrong array lengths\");\n for (uint i = 0; i < dest.length;) {\n _call(dest[i], 0, func[i]);\n unchecked {\n ++i;\n }\n }\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SmartAccount.sol#L460", "github_files_list": "SmartAccount.sol", "github_refs_count": 1, "vulnerable_code_actual": "function execute(address dest, uint value, bytes calldata func) external {\n _requireFromEntryPointOrOwner();\n _call(dest, value, func);\n}\n\nfunction executeBatch(address[] calldata dest, bytes[] calldata func) external {\n _requireFromEntryPointOrOwner();\n require(dest.length == func.length, \"wrong array lengths\");\n for (uint i = 0; i < dest.length;) {\n _call(dest[i], 0, func[i]);\n unchecked {\n ++i;\n }\n }\n}\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.76} {"source": "c4", "protocol": "03-asymmetry", "title": "chaduke G", "severity_raw": "Gas", "severity": "gas", "description": "G1. adjustWeight() can save gas by eliminating the for loop:\n```diff\n function adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n ) external onlyOwner {\n+ if(_derivativeIndex >= derivativeCount) CannotAdjustWeightForNonExistingDerivative();\n+ uint256 localTotalWeight = totalWeight-weights[_derivativeIndex];\n weights[_derivativeIndex] = _weight;\n+ uint256 localTotalWeight += _weight; \n- uint256 localTotalWeight = 0;\n- for (uint256 i = 0; i < derivativeCount; i++)\n- localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n \n\n emit WeightChange(_derivativeIndex, _weight);\n }\n```\n\nG2. We can save gas for addDerivative() by eliminating the for loop.\n```diff\nfunction addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n- uint256 localTotalWeight = 0;\n- for (uint256 i = 0; i < derivativeCount; i++)\n- localTotalWeight += weights[i];\n- totalWeight = localTotalWeight;\n+ totalWeight = totalWeight+_weight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n }\n```\nG3. One can simply return poolPrice() here:\n```diff\n function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n if (poolCanDeposit(_amount))\n return\n RocketTokenRETHInterface(rethAddress()).getEthValue(10 ** 18);\n- else return (poolPrice() * 10 ** 18) / (10 ** 18);\n+ else return poolPrice();\n }\n```\n", "vulnerable_code": "G2. We can save gas for addDerivative() by eliminating the for loop.", "fixed_code": "G3. One can simply return poolPrice() here:", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/chaduke-G.md", "collected_at": "2026-01-02T18:18:56.676285+00:00", "source_hash": "b9cd2ca1005011f6f7de7880f860f65b22411b9ca7d5b89406edb6f8609f9c11", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 1482, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n ) external onlyOwner {\n+ if(_derivativeIndex >= derivativeCount) CannotAdjustWeightForNonExistingDerivative();\n+ uint256 localTotalWeight = totalWeight-weights[_derivativeIndex];\n weights[_derivativeIndex] = _weight;\n+ uint256 localTotalWeight += _weight; \n- uint256 localTotalWeight = 0;\n- for (uint256 i = 0; i < derivativeCount; i++)\n- localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n \n\n emit WeightChange(_derivativeIndex, _weight);\n }", "primary_code_language": "diff", "primary_code_char_count": 619, "all_code_blocks": "// Code block 1 (diff):\nfunction adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n ) external onlyOwner {\n+ if(_derivativeIndex >= derivativeCount) CannotAdjustWeightForNonExistingDerivative();\n+ uint256 localTotalWeight = totalWeight-weights[_derivativeIndex];\n weights[_derivativeIndex] = _weight;\n+ uint256 localTotalWeight += _weight; \n- uint256 localTotalWeight = 0;\n- for (uint256 i = 0; i < derivativeCount; i++)\n- localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n \n\n emit WeightChange(_derivativeIndex, _weight);\n }\n\n// Code block 2 (diff):\nfunction addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n- uint256 localTotalWeight = 0;\n- for (uint256 i = 0; i < derivativeCount; i++)\n- localTotalWeight += weights[i];\n- totalWeight = localTotalWeight;\n+ totalWeight = totalWeight+_weight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n }\n\n// Code block 3 (diff):\nfunction ethPerDerivative(uint256 _amount) public view returns (uint256) {\n if (poolCanDeposit(_amount))\n return\n RocketTokenRETHInterface(rethAddress()).getEthValue(10 ** 18);\n- else return (poolPrice() * 10 ** 18) / (10 ** 18);\n+ else return poolPrice();\n }", "all_code_blocks_count": 3, "has_diff_blocks": true, "diff_code": "function adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n ) external onlyOwner {\n+ if(_derivativeIndex >= derivativeCount) CannotAdjustWeightForNonExistingDerivative();\n+ uint256 localTotalWeight = totalWeight-weights[_derivativeIndex];\n weights[_derivativeIndex] = _weight;\n+ uint256 localTotalWeight += _weight; \n- uint256 localTotalWeight = 0;\n- for (uint256 i = 0; i < derivativeCount; i++)\n- localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n \n\n emit WeightChange(_derivativeIndex, _weight);\n }\n\nfunction addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n- uint256 localTotalWeight = 0;\n- for (uint256 i = 0; i < derivativeCount; i++)\n- localTotalWeight += weights[i];\n- totalWeight = localTotalWeight;\n+ totalWeight = totalWeight+_weight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n }\n\nfunction ethPerDerivative(uint256 _amount) public view returns (uint256) {\n if (poolCanDeposit(_amount))\n return\n RocketTokenRETHInterface(rethAddress()).getEthValue(10 ** 18);\n- else return (poolPrice() * 10 ** 18) / (10 ** 18);\n+ else return poolPrice();\n }", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "G2. We can save gas for addDerivative() by eliminating the for loop.", "has_vulnerable_code_snippet": true, "fixed_code_actual": "G3. One can simply return poolPrice() here:", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "07-amphora", "title": "sm stack Q", "severity_raw": "Critical", "severity": "critical", "description": "## Low Risk\n### [L-1] approve can revert if the current approval is not zero\n\n\n**Description:**\n\n`Vault::_depositAndStakeOnConvex` must fail if previous allowance exists.\n\n**Proof of Concept:**\n\nCurve LP token is designed to revert if current allowance is not zero. Reference is in [this link](https://github.com/curvefi/curve-contract/blob/b0bbf77f8f93c9c5f4e415bce9cd71f0cdee960e/contracts/tokens/CurveTokenV1.vy#L117C69-L117C69).\n\n\n**Recommended Mitigation:**\n\nApprove zero amount before the current approval part.\n\n```diff\ndiff --git a/core/solidity/contracts/core/Vault.sol b/core/solidity/contracts/core/Vault.sol\nindex 62bc9ad..af75436 100644\n--- a/core/solidity/contracts/core/Vault.sol\n+++ b/core/solidity/contracts/core/Vault.sol\n@@ -318,6 +318,7 @@ contract Vault is IVault, Context {\n \n /// @dev Internal function for depositing and staking on convex\n function _depositAndStakeOnConvex(address _token, IBooster _booster, uint256 _amount, uint256 _poolId) internal {\n+ IERC20(_token).approve(address(_booster), 0);\n IERC20(_token).approve(address(_booster), _amount);\n if (!_booster.deposit(_poolId, _amount, true)) revert Vault_DepositAndStakeOnConvexFailed();\n }\n```\n\n## Non-Critical Issue\n### [NC-1] No Reason to use `ERC20VotesComp` to `AmphoraProtocolToken`.\n\n\n**Description:**\n\n`AmphoraProtocolToken.sol` inherits `ERC20VotesComp` from Openzeppelin, which is deprecated and [removed](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/CHANGELOG.md) at the repository now.\n\n**Proof of Concept:**\n\nSee the top part of [CHANGELOG.md](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/CHANGELOG.md) at Openzeppelin. \n\n**Recommended Mitigation:**\n\nChange `ERC20VotesComp` to `ERC20Votes` at [`AmphoraProtocolToken.sol`](https://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/AmphoraProtocolToken.sol#L6), the type of votes from `uint96 ` to `uint256`, and `amph.getP", "vulnerable_code": "", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/sm-stack-Q.md", "collected_at": "2026-01-02T18:24:03.114186+00:00", "source_hash": "ba7521af375712c07659fd91bcf90c3cdcca4b69697fddd264b75b6f1c3a1316", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 665, "github_ref_count": 1, "vulnerable_code_is_url": true, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "diff --git a/core/solidity/contracts/core/Vault.sol b/core/solidity/contracts/core/Vault.sol\nindex 62bc9ad..af75436 100644\n--- a/core/solidity/contracts/core/Vault.sol\n+++ b/core/solidity/contracts/core/Vault.sol\n@@ -318,6 +318,7 @@ contract Vault is IVault, Context {\n \n /// @dev Internal function for depositing and staking on convex\n function _depositAndStakeOnConvex(address _token, IBooster _booster, uint256 _amount, uint256 _poolId) internal {\n+ IERC20(_token).approve(address(_booster), 0);\n IERC20(_token).approve(address(_booster), _amount);\n if (!_booster.deposit(_poolId, _amount, true)) revert Vault_DepositAndStakeOnConvexFailed();\n }", "primary_code_language": "diff", "primary_code_char_count": 665, "all_code_blocks": "// Code block 1 (diff):\ndiff --git a/core/solidity/contracts/core/Vault.sol b/core/solidity/contracts/core/Vault.sol\nindex 62bc9ad..af75436 100644\n--- a/core/solidity/contracts/core/Vault.sol\n+++ b/core/solidity/contracts/core/Vault.sol\n@@ -318,6 +318,7 @@ contract Vault is IVault, Context {\n \n /// @dev Internal function for depositing and staking on convex\n function _depositAndStakeOnConvex(address _token, IBooster _booster, uint256 _amount, uint256 _poolId) internal {\n+ IERC20(_token).approve(address(_booster), 0);\n IERC20(_token).approve(address(_booster), _amount);\n if (!_booster.deposit(_poolId, _amount, true)) revert Vault_DepositAndStakeOnConvexFailed();\n }", "all_code_blocks_count": 1, "has_diff_blocks": true, "diff_code": "diff --git a/core/solidity/contracts/core/Vault.sol b/core/solidity/contracts/core/Vault.sol\nindex 62bc9ad..af75436 100644\n--- a/core/solidity/contracts/core/Vault.sol\n+++ b/core/solidity/contracts/core/Vault.sol\n@@ -318,6 +318,7 @@ contract Vault is IVault, Context {\n \n /// @dev Internal function for depositing and staking on convex\n function _depositAndStakeOnConvex(address _token, IBooster _booster, uint256 _amount, uint256 _poolId) internal {\n+ IERC20(_token).approve(address(_booster), 0);\n IERC20(_token).approve(address(_booster), _amount);\n if (!_booster.deposit(_poolId, _amount, true)) revert Vault_DepositAndStakeOnConvexFailed();\n }", "solidity_code": "", "github_refs_formatted": "AmphoraProtocolToken.sol#L6", "github_files_list": "AmphoraProtocolToken.sol", "github_refs_count": 1, "vulnerable_code_actual": "", "has_vulnerable_code_snippet": false, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 7} {"source": "c4", "protocol": "08-dopex", "title": "0xAnah G", "severity_raw": "High", "severity": "high", "description": "# DOPEX GAS OPTIMISATIONS\n\n## INTRODUCTION \nThe majority of optimizations underwent benchmarking using the protocol's tests, specifically employing the following configuration: `solc version 0.8.19`, optimizer enabled, and `200` runs. For optimizations that were not subjected to benchmarking, their rationale is elucidated through EVM gas expenses and opcodes.\n\nHighlighted below are optimizations exclusively targeting state-mutating functions and view/pure functions invoked by state-mutating functions. In the discussion that follows, only runtime gas is emphasized, given its inevitable dominance over deployment gas costs throughout the protocol's lifetime. Additionally, certain code excerpts may be abbreviated for brevity, and comments within the code snippets may include @audit tags to facilitate the explanation of issues.\n\n\n## TABLE OF FINDINGS\n| Number |Issue|Instances|Total Gas Saved|\n|-|:-|:-:|:-:|\n| G-01| Using calldata instead of memory for read-only arguments in external functions saves gas | 7 | 2797 |\n| G-02| Private functions only called once can be inlined to save gas | 1 | 46 |\n| G-03| Redundant state variable getters | 1 | |\n| G-04| Use the existing Local variable/global variable when equal to a state variable to avoid reading from state | 4 | 1410 |\n| G-05| Avoid using state variable in emit | 4 | 2341 |\n| G-06| Structs can be modified to fit in fewer storage slots | 1 | 2000 |\n| G-07| Unnecessary require statements | 1 | 317 |\n| G-08| Declaring Unnecessary variables | 1 | 3 |\n| G-09| Why emitting two events when you can emit one | 1 | 427 |\n| G-10| Use constants for state variables whose value is known beforehand and is never changed | 1 | 2194 |\n| G-11| State variables only set in the constructor should be declared immutable | 2 | 60964 |\n| G-12| Unchecked block for addition that cannot overflow | 6 | 826 |\n| G-13| Unbounded Gas Consumption Risk Due to External Call Recipients | 1 | |\n| G-14| Refactor external/internal function to avoid unn", "vulnerable_code": "file: contracts/core/RdpxV2Core.sol\n\n240: function addAssetTotokenReserves(\n241: address _asset,\n242: string memory _assetSymbol @audit change memory to calldata\n243: ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n .\n .\n . \n264: }", "fixed_code": "#### Gas saving for `addAssetTotokenReserves()` function obtained via protocol test: Avg 318 gas\n| | Min | Max | Avg | # Calls |\n|----------|----------|----------|----------|----------|\n| Before | 96795 | 118125 | 104095 | 48 |\n| After | 96477 | 117807 | 103777 | 48 |\n\n2. #### Make the `_assetSymbol` parameter of `RdpxV2Core.removeAssetFromtokenReserves()` `calldata`\n- https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L271", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/0xAnah-G.md", "collected_at": "2026-01-02T18:24:13.676809+00:00", "source_hash": "bad856dfa20985c0450db4492c3b77c8e10d66dee66ddf9e5d543a12c30bc455", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "RdpxV2Core.sol#L271", "github_files_list": "RdpxV2Core.sol", "github_refs_count": 1, "vulnerable_code_actual": "file: contracts/core/RdpxV2Core.sol\n\n240: function addAssetTotokenReserves(\n241: address _asset,\n242: string memory _assetSymbol @audit change memory to calldata\n243: ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n .\n .\n . \n264: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "#### Gas saving for `addAssetTotokenReserves()` function obtained via protocol test: Avg 318 gas\n| | Min | Max | Avg | # Calls |\n|----------|----------|----------|----------|----------|\n| Before | 96795 | 118125 | 104095 | 48 |\n| After | 96477 | 117807 | 103777 | 48 |\n\n2. #### Make the `_assetSymbol` parameter of `RdpxV2Core.removeAssetFromtokenReserves()` `calldata`\n- https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L271", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "05-ajna", "title": "Shubham G", "severity_raw": "High", "severity": "high", "description": "## Gas Optimizations\n\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [GAS-01](#GAS-01) | Sort Solidity operations using short-circuit mode | 2 |\n| [GAS-02](#GAS-02) | bytes constants are more efficient than string constants| 1 |\n| [GAS-03](#GAS-03) | Using bools for storage incurs overhead | 4 |\n| [GAS-04](#GAS-04) | Inverting the condition of an if-else-statement saves gas | 2 |\n| [GAS-05](#GAS-05) | Use ERC721A instead ERC721 variables | 1 |\n| [GAS-06](#GAS-06) | Unused cached variable inside the same function | 2 |\n\n## [GAS-01] Sort Solidity operations using short-circuit mode\n\nShort-circuiting is a solidity contract development model that uses OR/AND logic to sequence different cost operations. It puts low gas cost operations in the front and high gas cost operations in the back, so that if the front is low If the cost operation is feasible, you can skip (short-circuit) the subsequent high-cost Ethereum virtual machine operation.\n\n```solidity\nFile: main/ajna-grants/src/grants/base/ExtraordinaryFunding.sol\n\nL:139 if (proposal.startBlock > block.number || proposal.endBlock < block.number || proposal.executed) {\n```\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/ExtraordinaryFunding.sol#L139\n\n\n```solidity\nFile: /main/ajna-grants/src/grants/base/StandardFunding.sol\n\nL:358 if (!_standardFundingVoteSucceeded(proposalId_) || proposal.executed) revert ProposalNotSuccessful();\n```\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L358\n\n### Recommended\n\n`proposal.executed` should be the 1st parameter inside the `if` condition.\n\n```solidity\nL:139 if (proposal.executed || proposal.startBlock > block.number || proposal.endBlock < block.number) {\n```\n\n\n## [GAS-02] bytes constants are more efficient than string constants\n\nIf the data can fit in 32 bytes, the bytes32 data type can be used instead of bytes or strings, as it is less robust in terms of robustness.\n\n```solidity\nFile: main/ajna", "vulnerable_code": "File: main/ajna-grants/src/grants/base/ExtraordinaryFunding.sol\n\nL:139 if (proposal.startBlock > block.number || proposal.endBlock < block.number || proposal.executed) {", "fixed_code": "File: /main/ajna-grants/src/grants/base/StandardFunding.sol\n\nL:358 if (!_standardFundingVoteSucceeded(proposalId_) || proposal.executed) revert ProposalNotSuccessful();", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/Shubham-G.md", "collected_at": "2026-01-02T18:21:14.368360+00:00", "source_hash": "bb14721b50602b3f18691f083087f2ac71718a4b2cb1d60706b35e16677ad2be", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 459, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: main/ajna-grants/src/grants/base/ExtraordinaryFunding.sol\n\nL:139 if (proposal.startBlock > block.number || proposal.endBlock < block.number || proposal.executed) {", "primary_code_language": "solidity", "primary_code_char_count": 175, "all_code_blocks": "// Code block 1 (solidity):\nFile: main/ajna-grants/src/grants/base/ExtraordinaryFunding.sol\n\nL:139 if (proposal.startBlock > block.number || proposal.endBlock < block.number || proposal.executed) {\n\n// Code block 2 (solidity):\nFile: /main/ajna-grants/src/grants/base/StandardFunding.sol\n\nL:358 if (!_standardFundingVoteSucceeded(proposalId_) || proposal.executed) revert ProposalNotSuccessful();\n\n// Code block 3 (solidity):\nL:139 if (proposal.executed || proposal.startBlock > block.number || proposal.endBlock < block.number) {", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: main/ajna-grants/src/grants/base/ExtraordinaryFunding.sol\n\nL:139 if (proposal.startBlock > block.number || proposal.endBlock < block.number || proposal.executed) {\n\nFile: /main/ajna-grants/src/grants/base/StandardFunding.sol\n\nL:358 if (!_standardFundingVoteSucceeded(proposalId_) || proposal.executed) revert ProposalNotSuccessful();\n\nL:139 if (proposal.executed || proposal.startBlock > block.number || proposal.endBlock < block.number) {", "github_refs_formatted": "ExtraordinaryFunding.sol#L139, StandardFunding.sol#L358", "github_files_list": "ExtraordinaryFunding.sol, StandardFunding.sol", "github_refs_count": 2, "vulnerable_code_actual": "File: main/ajna-grants/src/grants/base/ExtraordinaryFunding.sol\n\nL:139 if (proposal.startBlock > block.number || proposal.endBlock < block.number || proposal.executed) {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: /main/ajna-grants/src/grants/base/StandardFunding.sol\n\nL:358 if (!_standardFundingVoteSucceeded(proposalId_) || proposal.executed) revert ProposalNotSuccessful();", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "11-kelp", "title": "cheatc0d3 Q", "severity_raw": "Low", "severity": "low", "description": "### `addNewSupportedAsset` function can be more optimized\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTConfig.sol#L80\n\nAdd more comprehensive checks for the `asset` address.\n\n```solidity\nfunction addNewSupportedAsset(address asset, uint256 depositLimit) external onlyRole(LRTConstants.MANAGER) {\n require(asset != address(0), \"LRTConfig: Asset is zero address\");\n require(asset != address(this), \"LRTConfig: Asset cannot be this contract\");\n // Additional checks specific to asset properties\n // ...\n}\n```\n\n### `addNewSupportedAsset` function can be more optimized\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTConfig.sol#L80\n\nInclude validation for `depositLimit` to handle edge cases.\n\n```solidity\nfunction addNewSupportedAsset(address asset, uint256 depositLimit) external onlyRole(LRTConstants.MANAGER) {\n require(depositLimit > 0, \"LRTConfig: Deposit limit must be positive\");\n require(depositLimit <= MAX_DEPOSIT_LIMIT, \"LRTConfig: Deposit limit exceeds maximum allowed\");\n // ...\n}\n```\n\n### Check Return Values of External Calls\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L71\n\nFailure to check the return values of external contract calls could lead to unexpected behavior.\n\n```solidity\nfunction getAssetDistributionData(address asset)\n // ... existing function signature\n{\n // ... existing validations\n uint256 ndcsCount = nodeDelegatorQueue.length;\n for (uint256 i = 0; i < ndcsCount; ++i) {\n address ndc = nodeDelegatorQueue[i];\n // ... existing checks\n\n uint256 ndcBalance = IERC20(asset).balanceOf(ndc);\n require(ndcBalance >= 0, \"LRTDepositPool: Balance query failed\");\n\n uint256 stakedBalance = INodeDelegator(ndc).getAssetBalance(asset);\n require(stakedBalance >= 0, \"LRTDepositPool: Staked balance query failed\");\n\n assetLyingInNDCs += ndcBalance;\n assetStakedInEigenLayer += stakedBalance;\n }\n}\n\n}\n```\n\n### `transferAssetToNod", "vulnerable_code": "function addNewSupportedAsset(address asset, uint256 depositLimit) external onlyRole(LRTConstants.MANAGER) {\n require(asset != address(0), \"LRTConfig: Asset is zero address\");\n require(asset != address(this), \"LRTConfig: Asset cannot be this contract\");\n // Additional checks specific to asset properties\n // ...\n}", "fixed_code": "function addNewSupportedAsset(address asset, uint256 depositLimit) external onlyRole(LRTConstants.MANAGER) {\n require(depositLimit > 0, \"LRTConfig: Deposit limit must be positive\");\n require(depositLimit <= MAX_DEPOSIT_LIMIT, \"LRTConfig: Deposit limit exceeds maximum allowed\");\n // ...\n}", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/cheatc0d3-Q.md", "collected_at": "2026-01-02T18:27:54.240329+00:00", "source_hash": "bb498395b03bcc291f99121bb4a0e09da6d63fbf174bde6e7a3fbb02c663b65f", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 1314, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function addNewSupportedAsset(address asset, uint256 depositLimit) external onlyRole(LRTConstants.MANAGER) {\n require(asset != address(0), \"LRTConfig: Asset is zero address\");\n require(asset != address(this), \"LRTConfig: Asset cannot be this contract\");\n // Additional checks specific to asset properties\n // ...\n}", "primary_code_language": "solidity", "primary_code_char_count": 326, "all_code_blocks": "// Code block 1 (solidity):\nfunction addNewSupportedAsset(address asset, uint256 depositLimit) external onlyRole(LRTConstants.MANAGER) {\n require(asset != address(0), \"LRTConfig: Asset is zero address\");\n require(asset != address(this), \"LRTConfig: Asset cannot be this contract\");\n // Additional checks specific to asset properties\n // ...\n}\n\n// Code block 2 (solidity):\nfunction addNewSupportedAsset(address asset, uint256 depositLimit) external onlyRole(LRTConstants.MANAGER) {\n require(depositLimit > 0, \"LRTConfig: Deposit limit must be positive\");\n require(depositLimit <= MAX_DEPOSIT_LIMIT, \"LRTConfig: Deposit limit exceeds maximum allowed\");\n // ...\n}\n\n// Code block 3 (solidity):\nfunction getAssetDistributionData(address asset)\n // ... existing function signature\n{\n // ... existing validations\n uint256 ndcsCount = nodeDelegatorQueue.length;\n for (uint256 i = 0; i < ndcsCount; ++i) {\n address ndc = nodeDelegatorQueue[i];\n // ... existing checks\n\n uint256 ndcBalance = IERC20(asset).balanceOf(ndc);\n require(ndcBalance >= 0, \"LRTDepositPool: Balance query failed\");\n\n uint256 stakedBalance = INodeDelegator(ndc).getAssetBalance(asset);\n require(stakedBalance >= 0, \"LRTDepositPool: Staked balance query failed\");\n\n assetLyingInNDCs += ndcBalance;\n assetStakedInEigenLayer += stakedBalance;\n }\n}\n\n}", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function addNewSupportedAsset(address asset, uint256 depositLimit) external onlyRole(LRTConstants.MANAGER) {\n require(asset != address(0), \"LRTConfig: Asset is zero address\");\n require(asset != address(this), \"LRTConfig: Asset cannot be this contract\");\n // Additional checks specific to asset properties\n // ...\n}\n\nfunction addNewSupportedAsset(address asset, uint256 depositLimit) external onlyRole(LRTConstants.MANAGER) {\n require(depositLimit > 0, \"LRTConfig: Deposit limit must be positive\");\n require(depositLimit <= MAX_DEPOSIT_LIMIT, \"LRTConfig: Deposit limit exceeds maximum allowed\");\n // ...\n}\n\nfunction getAssetDistributionData(address asset)\n // ... existing function signature\n{\n // ... existing validations\n uint256 ndcsCount = nodeDelegatorQueue.length;\n for (uint256 i = 0; i < ndcsCount; ++i) {\n address ndc = nodeDelegatorQueue[i];\n // ... existing checks\n\n uint256 ndcBalance = IERC20(asset).balanceOf(ndc);\n require(ndcBalance >= 0, \"LRTDepositPool: Balance query failed\");\n\n uint256 stakedBalance = INodeDelegator(ndc).getAssetBalance(asset);\n require(stakedBalance >= 0, \"LRTDepositPool: Staked balance query failed\");\n\n assetLyingInNDCs += ndcBalance;\n assetStakedInEigenLayer += stakedBalance;\n }\n}\n\n}", "github_refs_formatted": "LRTConfig.sol#L80, LRTDepositPool.sol#L71", "github_files_list": "LRTConfig.sol, LRTDepositPool.sol", "github_refs_count": 2, "vulnerable_code_actual": "function addNewSupportedAsset(address asset, uint256 depositLimit) external onlyRole(LRTConstants.MANAGER) {\n require(asset != address(0), \"LRTConfig: Asset is zero address\");\n require(asset != address(this), \"LRTConfig: Asset cannot be this contract\");\n // Additional checks specific to asset properties\n // ...\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function addNewSupportedAsset(address asset, uint256 depositLimit) external onlyRole(LRTConstants.MANAGER) {\n require(depositLimit > 0, \"LRTConfig: Deposit limit must be positive\");\n require(depositLimit <= MAX_DEPOSIT_LIMIT, \"LRTConfig: Deposit limit exceeds maximum allowed\");\n // ...\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "05-ajna", "title": "Aymen0909 Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA Report\n\n## Summary\n\n| | Issue | Risk | Instances |\n| :-------------: |:-------------|:-------------:|:-------------:|\n| 1 | Many functions not reverting when they are supposed to in `PositionManager` | Low | 2 |\n| 2 | arrays length not checked in the `_execute` function | Low | 1 |\n| 3 | Immutable state variables lack zero address checks | Low | 3 |\n| 4 | `constant` should be used instead of `immutable` | NC | 1 |\n\n## Findings\n\n### 1- Many functions not reverting when they are supposed to in `PositionManager` :\n\n#### Risk : Low\n\nThe comments of each function indicates the conditions for which the function should revert but there are many functions in the `PositionManager` contract that do not revert when they are supposed to, If this is an error in the comments then they should be rewitten to correspand to the code but if the functions are really supposed to revert as specified in the comments then the functions code should be reviewed and required checks must be added.\n\n#### Proof of Concept\nInstances include :\n\nFile: PositionManager.sol [Line 157-216](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/PositionManager.sol#L157-L216)\n\nIn the code linked above the function `memorializePositions` is supposed to revert when the positions token to burn has liquidity but it does not.\n\nFile: PositionManager.sol [Line 243-333](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/PositionManager.sol#L243-L333)\n\nIn the code linked above the function `moveLiquidity` is supposed to revert when the positions token to burn has liquidity but it does not.\n\n#### Mitigation\nReview the code of the aferomentioned functions and add the required checks if necessary\n\n### 2- arrays length not checked in the `_execute` function :\n\n#### Risk : Low\n\nThe `_execute` function is used to excute the calldata of the passed proposals, for the function to work correctely all the array passed as arguments must have the same length and ", "vulnerable_code": "function _execute(\n uint256 proposalId_,\n address[] memory targets_,\n uint256[] memory values_,\n bytes[] memory calldatas_\n) internal {\n // use common event name to maintain consistency with tally\n emit ProposalExecuted(proposalId_);\n\n string memory errorMessage = \"Governor: call reverted without message\";\n for (uint256 i = 0; i < targets_.length; ++i) {\n (bool success, bytes memory returndata) = targets_[i].call{value: values_[i]}(calldatas_[i]);\n Address.verifyCallResult(success, returndata, errorMessage);\n }\n}", "fixed_code": "erc20PoolFactory = erc20Factory_;\nerc721PoolFactory = erc721Factory_;", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/Aymen0909-Q.md", "collected_at": "2026-01-02T18:20:54.649410+00:00", "source_hash": "bb9bad5134d0b0725f993fe0e6cf86e1a80cb422734f0ea0e82ebf6d6e6c3658", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "PositionManager.sol#L157-L216, PositionManager.sol#L243-L333", "github_files_list": "PositionManager.sol", "github_refs_count": 2, "vulnerable_code_actual": "function _execute(\n uint256 proposalId_,\n address[] memory targets_,\n uint256[] memory values_,\n bytes[] memory calldatas_\n) internal {\n // use common event name to maintain consistency with tally\n emit ProposalExecuted(proposalId_);\n\n string memory errorMessage = \"Governor: call reverted without message\";\n for (uint256 i = 0; i < targets_.length; ++i) {\n (bool success, bytes memory returndata) = targets_[i].call{value: values_[i]}(calldatas_[i]);\n Address.verifyCallResult(success, returndata, errorMessage);\n }\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "erc20PoolFactory = erc20Factory_;\nerc721PoolFactory = erc721Factory_;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "02-ethos", "title": "fs0c Q", "severity_raw": "Critical", "severity": "critical", "description": "| Letter | Name | Description |\n| --- | --- | --- |\n| L | Low | Low severity/Potentially risky |\n| N | Non-critical | Non-risky findings |\n\n## [L-01] No restrictions on minting to invalid recipients.\n\n### Impact and POC\n\nCertain transfer restrictions imposed in the LUSDToken are not properly handled during the minting.\nThe LUSDToken forbids any transfer to a special set of addresses specified in the `_requireValidRecipient` function:\n\n```solidity\nfunction _requireValidRecipient(address _recipient) internal view {\n require(\n _recipient != address(0) && \n _recipient != address(this),\n \"LUSD: Cannot transfer tokens directly to the LUSD token contract or the zero address\"\n );\n require(\n !stabilityPools[_recipient] &&\n !troveManagers[_recipient] &&\n !borrowerOperations[_recipient],\n \"LUSD: Cannot transfer tokens directly to the StabilityPool, TroveManager or BorrowerOps\"\n );\n }\n```\n\nBut these restrictions are not followed in minting. This could lead to the minting of tokens to invalid recipient addresses.\n\n### Recommendation\n\nAdd _requireValidRecipient(account) before any state changing operations in `_mint`\n\n## [L-02] **Incorrect TCR calculation in batchLiquidateTroves() during Recovery Mode.**\n\n### Impact and POC\n\nTCR is temporarily miscalculated in **batchLiquidateTroves.** \n\nWhen calculating system's entire collateral, we should also exclude the liquidated trove's surplus collateral, since liquidation closes the trove and makes the surplus collateral claimable by the trove owner. This means, this line of code should look like this:\n\n```solidity\nvars.entireSystemColl = vars.entireSystemColl.\n sub(singleLiquidation.collToSendToSP).\n sub(singleLiquidation.collSurplus);\n```\n\nThe miscalculated entire collateral is used only to calculate the TCR and check if the system has been able to exit Recovery Mode. The miscalculation only ", "vulnerable_code": "function _requireValidRecipient(address _recipient) internal view {\n require(\n _recipient != address(0) && \n _recipient != address(this),\n \"LUSD: Cannot transfer tokens directly to the LUSD token contract or the zero address\"\n );\n require(\n !stabilityPools[_recipient] &&\n !troveManagers[_recipient] &&\n !borrowerOperations[_recipient],\n \"LUSD: Cannot transfer tokens directly to the StabilityPool, TroveManager or BorrowerOps\"\n );\n }", "fixed_code": "vars.entireSystemColl = vars.entireSystemColl.\n sub(singleLiquidation.collToSendToSP).\n sub(singleLiquidation.collSurplus);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/fs0c-Q.md", "collected_at": "2026-01-02T18:17:12.309809+00:00", "source_hash": "bbea274b3d6d187ca5a0a3c40ab75991b17d6262e0521ad1250589f548263dc4", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 703, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _requireValidRecipient(address _recipient) internal view {\n require(\n _recipient != address(0) && \n _recipient != address(this),\n \"LUSD: Cannot transfer tokens directly to the LUSD token contract or the zero address\"\n );\n require(\n !stabilityPools[_recipient] &&\n !troveManagers[_recipient] &&\n !borrowerOperations[_recipient],\n \"LUSD: Cannot transfer tokens directly to the StabilityPool, TroveManager or BorrowerOps\"\n );\n }", "primary_code_language": "solidity", "primary_code_char_count": 542, "all_code_blocks": "// Code block 1 (solidity):\nfunction _requireValidRecipient(address _recipient) internal view {\n require(\n _recipient != address(0) && \n _recipient != address(this),\n \"LUSD: Cannot transfer tokens directly to the LUSD token contract or the zero address\"\n );\n require(\n !stabilityPools[_recipient] &&\n !troveManagers[_recipient] &&\n !borrowerOperations[_recipient],\n \"LUSD: Cannot transfer tokens directly to the StabilityPool, TroveManager or BorrowerOps\"\n );\n }\n\n// Code block 2 (solidity):\nvars.entireSystemColl = vars.entireSystemColl.\n sub(singleLiquidation.collToSendToSP).\n sub(singleLiquidation.collSurplus);", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function _requireValidRecipient(address _recipient) internal view {\n require(\n _recipient != address(0) && \n _recipient != address(this),\n \"LUSD: Cannot transfer tokens directly to the LUSD token contract or the zero address\"\n );\n require(\n !stabilityPools[_recipient] &&\n !troveManagers[_recipient] &&\n !borrowerOperations[_recipient],\n \"LUSD: Cannot transfer tokens directly to the StabilityPool, TroveManager or BorrowerOps\"\n );\n }\n\nvars.entireSystemColl = vars.entireSystemColl.\n sub(singleLiquidation.collToSendToSP).\n sub(singleLiquidation.collSurplus);", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function _requireValidRecipient(address _recipient) internal view {\n require(\n _recipient != address(0) && \n _recipient != address(this),\n \"LUSD: Cannot transfer tokens directly to the LUSD token contract or the zero address\"\n );\n require(\n !stabilityPools[_recipient] &&\n !troveManagers[_recipient] &&\n !borrowerOperations[_recipient],\n \"LUSD: Cannot transfer tokens directly to the StabilityPool, TroveManager or BorrowerOps\"\n );\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "vars.entireSystemColl = vars.entireSystemColl.\n sub(singleLiquidation.collToSendToSP).\n sub(singleLiquidation.collSurplus);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ethos", "title": "gabriel G", "severity_raw": "High", "severity": "high", "description": "Using && operators inside require statements contribute to a higher execution cost as it tests both sides of the AND operation before reverting.\n\nThis means that every time we find && statements we should think about which one of the predicaments is the most probable fail cause for the specific function. As seen on `TroveManager.sol`:\n\n```\nfunction _requireMoreThanOneTroveInSystem(uint TroveOwnersArrayLength, address _collateral) internal view {\n require (TroveOwnersArrayLength > 1 && sortedTroves.getSize(_collateral) > 1);\n }\n```\nCould be replaced by:\n\n```\nfunction _requireMoreThanOneTroveInSystem(uint TroveOwnersArrayLength, address _collateral) external view {\n require (TroveOwnersArrayLength > 1);\n require (getSize(_collateral) > 1);\n } \n```\n\nThis way, in case TroveOwnersArrayLength is <= 1, we revert the execution before accessing the `data` map. I've developed a oversimplified example contract to illustrate this issue:\n\n```\n// SPDX-License-Identifier: MIT\n// Creator: gabriel\n\npragma solidity ^0.8.4;\n\n\ncontract Example {\n\n // Information for the list\n struct Data {\n uint256 size; // Current size of the list\n }\n\n // Each collateral has its own list of sorted troves\n mapping (address => Data) public data;\n\n function addToList(address _collateral) external {\n data[_collateral].size += 1;\n }\n\n function getSize(address _collateral) public view returns (uint256) {\n return data[_collateral].size;\n }\n\n function _requireMoreThanOneTroveInSystem1(uint TroveOwnersArrayLength, address _collateral) external view {\n require (TroveOwnersArrayLength > 1);\n require(getSize(_collateral) > 1);\n }\n function _requireMoreThanOneTroveInSystem2(uint TroveOwnersArrayLength, address _collateral) external view {\n require (TroveOwnersArrayLength > 1);\n require (getSize(_collateral) > 1);\n } \n}\n```\n\nIn the contract above, calling the _requireMoreThanOneTroveInS", "vulnerable_code": "function _requireMoreThanOneTroveInSystem(uint TroveOwnersArrayLength, address _collateral) internal view {\n require (TroveOwnersArrayLength > 1 && sortedTroves.getSize(_collateral) > 1);\n }", "fixed_code": "function _requireMoreThanOneTroveInSystem(uint TroveOwnersArrayLength, address _collateral) external view {\n require (TroveOwnersArrayLength > 1);\n require (getSize(_collateral) > 1);\n } ", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/gabriel-G.md", "collected_at": "2026-01-02T18:17:12.753574+00:00", "source_hash": "bbed00ae39f45f1670e8540059002ce4768faaab3b8826e641ca6b036f234076", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 1364, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _requireMoreThanOneTroveInSystem(uint TroveOwnersArrayLength, address _collateral) internal view {\n require (TroveOwnersArrayLength > 1 && sortedTroves.getSize(_collateral) > 1);\n }", "primary_code_language": "unknown", "primary_code_char_count": 200, "all_code_blocks": "// Code block 1 (unknown):\nfunction _requireMoreThanOneTroveInSystem(uint TroveOwnersArrayLength, address _collateral) internal view {\n require (TroveOwnersArrayLength > 1 && sortedTroves.getSize(_collateral) > 1);\n }\n\n// Code block 2 (unknown):\nfunction _requireMoreThanOneTroveInSystem(uint TroveOwnersArrayLength, address _collateral) external view {\n require (TroveOwnersArrayLength > 1);\n require (getSize(_collateral) > 1);\n }\n\n// Code block 3 (unknown):\n// SPDX-License-Identifier: MIT\n// Creator: gabriel\n\npragma solidity ^0.8.4;\n\n\ncontract Example {\n\n // Information for the list\n struct Data {\n uint256 size; // Current size of the list\n }\n\n // Each collateral has its own list of sorted troves\n mapping (address => Data) public data;\n\n function addToList(address _collateral) external {\n data[_collateral].size += 1;\n }\n\n function getSize(address _collateral) public view returns (uint256) {\n return data[_collateral].size;\n }\n\n function _requireMoreThanOneTroveInSystem1(uint TroveOwnersArrayLength, address _collateral) external view {\n require (TroveOwnersArrayLength > 1);\n require(getSize(_collateral) > 1);\n }\n function _requireMoreThanOneTroveInSystem2(uint TroveOwnersArrayLength, address _collateral) external view {\n require (TroveOwnersArrayLength > 1);\n require (getSize(_collateral) > 1);\n } \n}", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function _requireMoreThanOneTroveInSystem(uint TroveOwnersArrayLength, address _collateral) internal view {\n require (TroveOwnersArrayLength > 1 && sortedTroves.getSize(_collateral) > 1);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function _requireMoreThanOneTroveInSystem(uint TroveOwnersArrayLength, address _collateral) external view {\n require (TroveOwnersArrayLength > 1);\n require (getSize(_collateral) > 1);\n } ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "10-badger", "title": "albahaca Q", "severity_raw": "Low", "severity": "low", "description": "## [L-01] _safeMint() should be used rather than _mint() wherever possible\n_mint() is [discouraged](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/d4d8d2ed9798cc3383912a23b5e8d5cb602f7d4b/contracts/token/ERC721/ERC721.sol#L271) in favor of _safeMint() which ensures that the recipient is either an EOA or implements IERC721Receiver. Both open [OpenZeppelin](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/d4d8d2ed9798cc3383912a23b5e8d5cb602f7d4b/contracts/token/ERC721/ERC721.sol#L238-L250) and [solmate](https://github.com/Rari-Capital/solmate/blob/4eaf6b68202e36f67cab379768ac6be304c8ebde/src/tokens/ERC721.sol#L180) have versions of this function so that NFTs aren\u2019t lost if they\u2019re minted to contracts that cannot transfer them back out.\n\n```solidity\nFile: packages/contracts/contracts/EBTCToken.sol\n87 _mint(_account, _amount);\n```\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/EBTCToken.sol#L87\n\n\n## [L\u201102] Use Ownable2Step instead of Ownable\nOwnable2Step and Ownable2StepUpgradeable prevent the contract ownership from mistakenly being transferred to an address that cannot handle it (e.g. due to a typo in the address), by requiring that the recipient of the owner permissions actively accept via a contract call of its own.\n\n```solidity\nFile: packages/contracts/contracts/BorrowerOperations.sol\n13 import \"./Dependencies/Ownable.sol\";\n```\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/BorrowerOperations.sol#L13\n\n## [L-03] no check if the burn amount is zero or not\nif the amount is zero so the unhecked block will divided zero on 3 and we use gas for nothing ! if we set zero we may pass the _burn checks, i know it is passed by only permit but it's better to avoid this happen because it's seting by human and it means it can be set with 0 balance to burn !\n\n```solidity\nFile: packages/contracts/contracts/BorrowerOperations.sol\n798 ebtcToken.burn(_account, _debt);\n\n1103 ebtcTok", "vulnerable_code": "File: packages/contracts/contracts/EBTCToken.sol\n87 _mint(_account, _amount);", "fixed_code": "File: packages/contracts/contracts/BorrowerOperations.sol\n13 import \"./Dependencies/Ownable.sol\";", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/albahaca-Q.md", "collected_at": "2026-01-02T18:26:41.047471+00:00", "source_hash": "bc2f81226b3c321402a75562fd421690a0c284657e79756adc36eb58149b9c04", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 179, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: packages/contracts/contracts/EBTCToken.sol\n87 _mint(_account, _amount);", "primary_code_language": "solidity", "primary_code_char_count": 80, "all_code_blocks": "// Code block 1 (solidity):\nFile: packages/contracts/contracts/EBTCToken.sol\n87 _mint(_account, _amount);\n\n// Code block 2 (solidity):\nFile: packages/contracts/contracts/BorrowerOperations.sol\n13 import \"./Dependencies/Ownable.sol\";", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: packages/contracts/contracts/EBTCToken.sol\n87 _mint(_account, _amount);\n\nFile: packages/contracts/contracts/BorrowerOperations.sol\n13 import \"./Dependencies/Ownable.sol\";", "github_refs_formatted": "ERC721.sol#L271, ERC721.sol#L238-L250, ERC721.sol#L180, EBTCToken.sol#L87, BorrowerOperations.sol#L13", "github_files_list": "EBTCToken.sol, BorrowerOperations.sol, ERC721.sol", "github_refs_count": 5, "vulnerable_code_actual": "File: packages/contracts/contracts/EBTCToken.sol\n87 _mint(_account, _amount);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: packages/contracts/contracts/BorrowerOperations.sol\n13 import \"./Dependencies/Ownable.sol\";", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "04-caviar", "title": "coryli G", "severity_raw": "Medium", "severity": "medium", "description": "## Calculations should be cached.\nSLOADs are expensive (~100 gas) compared to MLOAD/MSTORE(~3gas).\n### Instances\n`PrivatePool.sol#L230`, `PrivatePool.sol#L236`, `PrivatePool.sol#L323`, `PrivatePool.sol#L335`\n\n## Using Bools for storage incurs overhead\nUse `uint256` for true/false to avoid a Gwarmaccess (100 gas) for the extra SLOAD, and to avoid Gsset (20000 gas) when changing from \u2018false\u2019 to \u2018true\u2019, after having been \u2018true\u2019 in the past.\n### Instances\n`PrivatePool.sol#L94` `PrivatePool.sol#L97` `PrivatePool.sol#L100`\n\n## `abi.encode()` is less efficient than `abi.encodePacked()`\nChanging abi.encode function to abi.encodePacked can save gas since the abi.encode function pads extra null bytes at the end of the call data, which is unnecessary. Also, in general, abi.encodePacked is more gas-efficient (see Solidity-Encode-Gas-Comparison).\n### Instances\n`EthRouter.sol#L177` `EthRouter.sol#L675`\n\n## No need to explicitly initialize variables with default values\nIf a variable is not set/initialized, it is assumed to have the default value (0 for uint, false for bool, address(0) for address\u2026). Explicitly initializing it with its default value is an anti-pattern and wastes gas.\n### Instances\n`PrivatePool.sol#L237`, `PrivatePool.sol#L328` also every `for` loop counter.\n\n## Increments can be unchecked\n\n### Instances\n`PrivatePool.sol#L238` `PrivatePool.sol#L272` `PrivatePool.sol#L329` `PrivatePool.sol#L441` `PrivatePool.sol#L446` `EthRouter.sol#L106` `EthRouter.sol#L116` `EthRouter.sol#L134` `EthRouter.sol#L159`\n### Recommendation\n```\nfor (uint256 i; i < tokenIds.length;) { \n // ... \n unchecked { ++i; }\n}\n```\n\n## Public functions to external saves gas\n### Instances\n`PrivatePool.sol#L167` `PrivatePool.sol#L212` `PrivatePool.sol#L306` `PrivatePool.sol#L393` `PrivatePool.sol#L459` `EthRouter.sol#L99` `EthRouter.sol#L152` `EthRouter.sol#L226` `EthRouter.sol#L254` `EthRouter.sol/L302`\n`Factory.sol#L84` `Factory.sol#L129` `Factory.sol#L135` `Factory.sol#L141` `Factory.sol#L148` `Fac", "vulnerable_code": "for (uint256 i; i < tokenIds.length;) { \n // ... \n unchecked { ++i; }\n}", "fixed_code": "bytes32 public constant ON_FLASH_LOAN_SELECTOR = keccak256(\"ERC3156FlashBorrower.onFlashLoan\");", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/coryli-G.md", "collected_at": "2026-01-02T18:20:24.214071+00:00", "source_hash": "bc3611e8ea3c252c6693003bf5273e7b78ec95f94c993c154e838a7ef1dbbd6c", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 73, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "for (uint256 i; i < tokenIds.length;) { \n // ... \n unchecked { ++i; }\n}", "primary_code_language": "unknown", "primary_code_char_count": 73, "all_code_blocks": "// Code block 1 (unknown):\nfor (uint256 i; i < tokenIds.length;) { \n // ... \n unchecked { ++i; }\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "for (uint256 i; i < tokenIds.length;) { \n // ... \n unchecked { ++i; }\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "bytes32 public constant ON_FLASH_LOAN_SELECTOR = keccak256(\"ERC3156FlashBorrower.onFlashLoan\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "03-asymmetry", "title": "SunSec Q", "severity_raw": "Critical", "severity": "critical", "description": "# asymmetry\n\n### [L1] one step owner transferRole transfer actions done in a single-step manner are dangerous\n\n## Impact\nInheriting from OpenZeppelin's Ownable contract means you are using a single-step ownership transfer pattern. If an admin provides an incorrect address for the new owner this will result in none of the onlyOwner marked methods being callable again. The better way to do this is to use a two-step ownership transfer approach, where the new owner should first claim its new rights before they are transferred.\n\n## Proof of Concept\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol#L5\n\n`import \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";`\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol#L6\n`import \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";`\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L9\n\n```\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\n```\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L13\n```\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\n```\n\n## Tools Used\nManual Review\n## Recommended Mitigation Steps\nUse OpenZeppelin's Ownable2Step instead of Ownable\n\n### [L2] Missing admin input sanitization admin\n\n## Impact\nMissing maximum value check that is set by the contract owner. This issue can allow the contract owner to set big sllippage or big weight even over 100. It will cause unexpected operactions in protocol.\n\n## Proof of Concept\n1.https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L165-L174\n\nFor example, total weight should be 100 = 50/25/25 (3 derivatives). But there is no maximum threshold validation.\n```\n function adjustWeight(\n uint256 _derivativeIndex,\n uint256 _weight\n ) external onlyOwner {\n ", "vulnerable_code": "import \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";", "fixed_code": "import \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/SunSec-Q.md", "collected_at": "2026-01-02T18:18:36.000684+00:00", "source_hash": "bc567ea586d6cc0f191ae2893aebf489e1ccc424a6c2948a48136aa5be7e1af5", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 150, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "import \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";", "primary_code_language": "unknown", "primary_code_char_count": 75, "all_code_blocks": "// Code block 1 (unknown):\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\n\n// Code block 2 (unknown):\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "WstEth.sol#L5, SfrxEth.sol#L6, SafEth.sol#L9, Reth.sol#L13, SafEth.sol#L165-L174", "github_files_list": "SfrxEth.sol, Reth.sol, WstEth.sol, SafEth.sol", "github_refs_count": 5, "vulnerable_code_actual": "import \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";", "has_vulnerable_code_snippet": true, "fixed_code_actual": "import \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "02-ai-arena", "title": "Bube Q", "severity_raw": "Medium", "severity": "medium", "description": "# QA report\n\n## Content\n\n| Number | Severity | Issue Title |\n| --------| ------------|-------------------------------------------------------------------------------------------|\n| [1] | Low | Missing two-step procedure for ownership transfer |\n| [2] | Low | Missing check for token existence in `RankedBattle::getBattleRecord` function |\n| [3] | Low | Missing check for token existence in `RankedBattle::getNrnDistribution` function |\n| [4] | Low | Incorrect `require` statement in ``Neuron::mint` function. |\n| [5] | Low | Some important events are missing in `Neuron` contract |\n| [6] | Low | Unsafe `transferFrom` in `Neuron` contract |\n| [7] | Low | The `attributeProbabilities` mapping is initialized twice in the `AiArenaHelper` contract |\n\n## [1] Low\n\n## Title \n\nMissing two-step procedure for ownership transfer\n\n## Links\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/AiArenaHelper.sol#L61-L64\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L120-L123\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/GameItems.sol#L108-L111\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/MergingPool.sol#L89-L92\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/Neuron.sol#L85-L88\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/RankedBattle.sol#L167-L170\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/Vol", "vulnerable_code": " function transferOwnership(address newOwnerAddress) external {\n require(msg.sender == _ownerAddress);\n _ownerAddress = newOwnerAddress;\n }\n", "fixed_code": " function getBattleRecord(uint256 tokenId) external view returns(uint32, uint32, uint32) {\n return (\n fighterBattleRecord[tokenId].wins, \n fighterBattleRecord[tokenId].ties, \n fighterBattleRecord[tokenId].loses\n );\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/Bube-Q.md", "collected_at": "2026-01-02T19:02:19.796058+00:00", "source_hash": "bc7e78893758405ff736d267a35248e36aafa6d556d009420593efa52350547d", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "AiArenaHelper.sol#L61-L64, FighterFarm.sol#L120-L123, GameItems.sol#L108-L111, MergingPool.sol#L89-L92, Neuron.sol#L85-L88, RankedBattle.sol#L167-L170", "github_files_list": "GameItems.sol, Neuron.sol, RankedBattle.sol, FighterFarm.sol, MergingPool.sol, AiArenaHelper.sol", "github_refs_count": 6, "vulnerable_code_actual": " function transferOwnership(address newOwnerAddress) external {\n require(msg.sender == _ownerAddress);\n _ownerAddress = newOwnerAddress;\n }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function getBattleRecord(uint256 tokenId) external view returns(uint32, uint32, uint32) {\n return (\n fighterBattleRecord[tokenId].wins, \n fighterBattleRecord[tokenId].ties, \n fighterBattleRecord[tokenId].loses\n );\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "03-asymmetry", "title": "0x6020c0 G", "severity_raw": "Gas", "severity": "gas", "description": "In `SafEth.sol` in the function `rebalanceToWeights()` putting the `ethAmountToRebalance == 0` check outside of the for loop saves gas on each loop iteration and skips loop iterations if no rebalancing is needed.\n\nSuggested fix:\n```\nif (ethAmountToRebalance == 0){\n emit Rebalanced();\n return;\n}\nfor (uint i = 0; i < derivativeCount; i++) {\n if (weights[i] == 0) continue;\n uint256 ethAmount = (ethAmountToRebalance * weights[i]) / totalWeight; // Price will change due to slippage\n derivatives[i].deposit{value: ethAmount}();\n}\n```\nGas usage difference from test cases:\n\n``` \nBefore = | SafEth \u00b7 rebalanceToWeights \u00b7 669450 \u00b7 821670 \u00b7 727618 \u00b7 8 \u00b7 - \u2502\nAfter = | SafEth \u00b7 rebalanceToWeights \u00b7 669406 \u00b7 821618 \u00b7 727570 \u00b7 8 \u00b7 - \u2502\n```", "vulnerable_code": "if (ethAmountToRebalance == 0){\n emit Rebalanced();\n return;\n}\nfor (uint i = 0; i < derivativeCount; i++) {\n if (weights[i] == 0) continue;\n uint256 ethAmount = (ethAmountToRebalance * weights[i]) / totalWeight; // Price will change due to slippage\n derivatives[i].deposit{value: ethAmount}();\n}", "fixed_code": "Before = | SafEth \u00b7 rebalanceToWeights \u00b7 669450 \u00b7 821670 \u00b7 727618 \u00b7 8 \u00b7 - \u2502\nAfter = | SafEth \u00b7 rebalanceToWeights \u00b7 669406 \u00b7 821618 \u00b7 727570 \u00b7 8 \u00b7 - \u2502", "recommendation": "", "category": "slippage", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/0x6020c0-G.md", "collected_at": "2026-01-02T18:17:32.339404+00:00", "source_hash": "bca3ec614f557cc2eeb2ddefc45216d9f089f00af61f4ccbc36f0ddeac2965d7", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 303, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "if (ethAmountToRebalance == 0){\n emit Rebalanced();\n return;\n}\nfor (uint i = 0; i < derivativeCount; i++) {\n if (weights[i] == 0) continue;\n uint256 ethAmount = (ethAmountToRebalance * weights[i]) / totalWeight; // Price will change due to slippage\n derivatives[i].deposit{value: ethAmount}();\n}", "primary_code_language": "unknown", "primary_code_char_count": 303, "all_code_blocks": "// Code block 1 (unknown):\nif (ethAmountToRebalance == 0){\n emit Rebalanced();\n return;\n}\nfor (uint i = 0; i < derivativeCount; i++) {\n if (weights[i] == 0) continue;\n uint256 ethAmount = (ethAmountToRebalance * weights[i]) / totalWeight; // Price will change due to slippage\n derivatives[i].deposit{value: ethAmount}();\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "if (ethAmountToRebalance == 0){\n emit Rebalanced();\n return;\n}\nfor (uint i = 0; i < derivativeCount; i++) {\n if (weights[i] == 0) continue;\n uint256 ethAmount = (ethAmountToRebalance * weights[i]) / totalWeight; // Price will change due to slippage\n derivatives[i].deposit{value: ethAmount}();\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "Before = | SafEth \u00b7 rebalanceToWeights \u00b7 669450 \u00b7 821670 \u00b7 727618 \u00b7 8 \u00b7 - \u2502\nAfter = | SafEth \u00b7 rebalanceToWeights \u00b7 669406 \u00b7 821618 \u00b7 727570 \u00b7 8 \u00b7 - \u2502", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 4.5} {"source": "c4", "protocol": "11-kelp", "title": "0xvj Q", "severity_raw": "Unknown", "severity": "unknown", "description": "## No event emission when funds are transferred to nodeDelegatorContract\n`transferAssetToNodeDelegator()` function of LRTDepositPool contract didn't emit and event when funds are tranferred to nodeDelegatorContract.\n\n```\nfunction transferAssetToNodeDelegator(\n uint256 ndcIndex,\n address asset,\n uint256 amount\n )\n external\n nonReentrant\n onlyLRTManager\n onlySupportedAsset(asset)\n {\n address nodeDelegator = nodeDelegatorQueue[ndcIndex];\n if (!IERC20(asset).transfer(nodeDelegator, amount)) {\n revert TokenTransferFailed();\n }\n // @audit-issue add event emission\n}\n```\n\nImportant operations like this should emit events for off-chain accouting purposes\n\n\n", "vulnerable_code": "function transferAssetToNodeDelegator(\n uint256 ndcIndex,\n address asset,\n uint256 amount\n )\n external\n nonReentrant\n onlyLRTManager\n onlySupportedAsset(asset)\n {\n address nodeDelegator = nodeDelegatorQueue[ndcIndex];\n if (!IERC20(asset).transfer(nodeDelegator, amount)) {\n revert TokenTransferFailed();\n }\n // @audit-issue add event emission\n}", "fixed_code": "", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/0xvj-Q.md", "collected_at": "2026-01-02T18:27:16.882549+00:00", "source_hash": "bcad5e5b45d431c7fe9dca0f60cbc14f650b3c03f1e52fd2f4cbd58bdbff35a1", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 438, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function transferAssetToNodeDelegator(\n uint256 ndcIndex,\n address asset,\n uint256 amount\n )\n external\n nonReentrant\n onlyLRTManager\n onlySupportedAsset(asset)\n {\n address nodeDelegator = nodeDelegatorQueue[ndcIndex];\n if (!IERC20(asset).transfer(nodeDelegator, amount)) {\n revert TokenTransferFailed();\n }\n // @audit-issue add event emission\n}", "primary_code_language": "unknown", "primary_code_char_count": 438, "all_code_blocks": "// Code block 1 (unknown):\nfunction transferAssetToNodeDelegator(\n uint256 ndcIndex,\n address asset,\n uint256 amount\n )\n external\n nonReentrant\n onlyLRTManager\n onlySupportedAsset(asset)\n {\n address nodeDelegator = nodeDelegatorQueue[ndcIndex];\n if (!IERC20(asset).transfer(nodeDelegator, amount)) {\n revert TokenTransferFailed();\n }\n // @audit-issue add event emission\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function transferAssetToNodeDelegator(\n uint256 ndcIndex,\n address asset,\n uint256 amount\n )\n external\n nonReentrant\n onlyLRTManager\n onlySupportedAsset(asset)\n {\n address nodeDelegator = nodeDelegatorQueue[ndcIndex];\n if (!IERC20(asset).transfer(nodeDelegator, amount)) {\n revert TokenTransferFailed();\n }\n // @audit-issue add event emission\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 3.5} {"source": "c4", "protocol": "04-caviar", "title": "ihtishamsudo G", "severity_raw": "Low", "severity": "low", "description": "\n# [G-01]\n\n## Use double IF Statements instead of && \n\nif the IF Statement has a logical AND (&&) Operation but is not followed by the else statement, it can be replaced with 2 if statements to reduce gas cost\n\n###### Before\n\n```\nif (block.timestamp > deadline && deadline != 0) \n{\n revert DeadlinePassed();\n}\n```\n\n**It consumes more gas than**\n\n###### After\n\n```\nif (block.timestamp > deadline) {\n if (deadline != 0) {\n revert DeadlinePassed();\n }\n}\n```\n\n##### References\n\n[EthRouter.sol#L101](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L101)\n[EthRouter.sol#L154](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L154)\n[EthRouter.sol#L228](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L228)\n[EthRouter.sol#L256](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L256)\n\n# [G-02]\n\n## x += y costs more gas than x = x + y & same for x -= y\n\n##### References\n\n[PrivatePool.sol#L230](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L230)\n[PrivatePool.sol#L231](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L231)\n[PrivatePool.sol#L247](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L247)\n[PrivatePool.sol#L252](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L252)\n[PrivatePool.sol#L324](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L324)\n[PrivatePool.sol#L341](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L341)\n[PrivatePool.sol#L678](https://github.", "vulnerable_code": "if (block.timestamp > deadline && deadline != 0) \n{\n revert DeadlinePassed();\n}", "fixed_code": "if (block.timestamp > deadline) {\n if (deadline != 0) {\n revert DeadlinePassed();\n }\n}", "recommendation": "", "category": "slippage", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/ihtishamsudo-G.md", "collected_at": "2026-01-02T18:20:35.457817+00:00", "source_hash": "bd0dd85a4a4a78742422ca47d9f913035e57cbbe3d52d706db2da98e1e315c1d", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 181, "github_ref_count": 10, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "if (block.timestamp > deadline && deadline != 0) \n{\n revert DeadlinePassed();\n}", "primary_code_language": "unknown", "primary_code_char_count": 82, "all_code_blocks": "// Code block 1 (unknown):\nif (block.timestamp > deadline && deadline != 0) \n{\n revert DeadlinePassed();\n}\n\n// Code block 2 (unknown):\nif (block.timestamp > deadline) {\n if (deadline != 0) {\n revert DeadlinePassed();\n }\n}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "EthRouter.sol#L101, EthRouter.sol#L154, EthRouter.sol#L228, EthRouter.sol#L256, PrivatePool.sol#L230, PrivatePool.sol#L231, PrivatePool.sol#L247, PrivatePool.sol#L252, PrivatePool.sol#L324, PrivatePool.sol#L341", "github_files_list": "EthRouter.sol, PrivatePool.sol", "github_refs_count": 10, "vulnerable_code_actual": "if (block.timestamp > deadline && deadline != 0) \n{\n revert DeadlinePassed();\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "if (block.timestamp > deadline) {\n if (deadline != 0) {\n revert DeadlinePassed();\n }\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "05-ajna", "title": "BRONZEDISC Q", "severity_raw": "Medium", "severity": "medium", "description": "## QA\n---\n\n### Layout Order [1]\n\n- The best-practices for layout within a contract is the following order: state variables, events, modifiers, constructor and functions.\n\n\n---\n\n### Function Visibility [2]\n\n- Order of Functions: Ordering helps readers identify which functions they can call and to find the constructor and fallback definitions easier. Functions should be grouped according to their visibility and ordered: constructor, receive function (if exists), fallback function (if exists), public, external, internal, private. Within a grouping, place the view and pure functions last.\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol\n\n```solidity\n// these external functions should come before private and internal functions\n119: function startNewDistributionPeriod() external override returns (uint24 newDistributionId_) {\n236: function claimDelegateReward(\n300: function updateSlate(\n343: function executeStandard(\n366: function proposeStandard(\n519: function fundingVote(\n572: function screeningVote(\n917: function getDelegateReward(\n928: function getDistributionId() external view override returns (uint24) {\n933: function getDistributionPeriodInfo(\n947: function getFundedProposalSlate(\n954: function getFundingPowerVotes(\n961: function getFundingVotesCast(uint24 distributionId_, address account_) external view override returns (FundingVoteParams[] memory) {\n966: function getProposalInfo(\n980: function getSlateHash(\n987: function getTopTenProposals(\n994: function getVoterInfo(\n1006: function getVotesFunding(\n1019: function getVotesScreening(\n\n// private functions should come last\n197: function _updateTreasury(\n227: function _setNewDistributionId() private returns (uint24 newId_) {\n```\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/PositionManager.sol\n\n```solidity\n// internal functions coming before external ones\n404: function _getAndInc", "vulnerable_code": "// these external functions should come before private and internal functions\n119: function startNewDistributionPeriod() external override returns (uint24 newDistributionId_) {\n236: function claimDelegateReward(\n300: function updateSlate(\n343: function executeStandard(\n366: function proposeStandard(\n519: function fundingVote(\n572: function screeningVote(\n917: function getDelegateReward(\n928: function getDistributionId() external view override returns (uint24) {\n933: function getDistributionPeriodInfo(\n947: function getFundedProposalSlate(\n954: function getFundingPowerVotes(\n961: function getFundingVotesCast(uint24 distributionId_, address account_) external view override returns (FundingVoteParams[] memory) {\n966: function getProposalInfo(\n980: function getSlateHash(\n987: function getTopTenProposals(\n994: function getVoterInfo(\n1006: function getVotesFunding(\n1019: function getVotesScreening(\n\n// private functions should come last\n197: function _updateTreasury(\n227: function _setNewDistributionId() private returns (uint24 newId_) {", "fixed_code": "// internal functions coming before external ones\n404: function _getAndIncrementNonce(\n416: function _isAjnaPool(\n436: function _bucketBankruptAfterDeposit(\n\n// public function coming after all the other ones\n517: function tokenURI(", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/BRONZEDISC-Q.md", "collected_at": "2026-01-02T18:20:55.592549+00:00", "source_hash": "bd305d1a38c095f6a6ec55b2dbd1ea874ecc1b3c6f9f966690827f242fbab760", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 1110, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "// these external functions should come before private and internal functions\n119: function startNewDistributionPeriod() external override returns (uint24 newDistributionId_) {\n236: function claimDelegateReward(\n300: function updateSlate(\n343: function executeStandard(\n366: function proposeStandard(\n519: function fundingVote(\n572: function screeningVote(\n917: function getDelegateReward(\n928: function getDistributionId() external view override returns (uint24) {\n933: function getDistributionPeriodInfo(\n947: function getFundedProposalSlate(\n954: function getFundingPowerVotes(\n961: function getFundingVotesCast(uint24 distributionId_, address account_) external view override returns (FundingVoteParams[] memory) {\n966: function getProposalInfo(\n980: function getSlateHash(\n987: function getTopTenProposals(\n994: function getVoterInfo(\n1006: function getVotesFunding(\n1019: function getVotesScreening(\n\n// private functions should come last\n197: function _updateTreasury(\n227: function _setNewDistributionId() private returns (uint24 newId_) {", "primary_code_language": "solidity", "primary_code_char_count": 1110, "all_code_blocks": "// Code block 1 (solidity):\n// these external functions should come before private and internal functions\n119: function startNewDistributionPeriod() external override returns (uint24 newDistributionId_) {\n236: function claimDelegateReward(\n300: function updateSlate(\n343: function executeStandard(\n366: function proposeStandard(\n519: function fundingVote(\n572: function screeningVote(\n917: function getDelegateReward(\n928: function getDistributionId() external view override returns (uint24) {\n933: function getDistributionPeriodInfo(\n947: function getFundedProposalSlate(\n954: function getFundingPowerVotes(\n961: function getFundingVotesCast(uint24 distributionId_, address account_) external view override returns (FundingVoteParams[] memory) {\n966: function getProposalInfo(\n980: function getSlateHash(\n987: function getTopTenProposals(\n994: function getVoterInfo(\n1006: function getVotesFunding(\n1019: function getVotesScreening(\n\n// private functions should come last\n197: function _updateTreasury(\n227: function _setNewDistributionId() private returns (uint24 newId_) {", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "// these external functions should come before private and internal functions\n119: function startNewDistributionPeriod() external override returns (uint24 newDistributionId_) {\n236: function claimDelegateReward(\n300: function updateSlate(\n343: function executeStandard(\n366: function proposeStandard(\n519: function fundingVote(\n572: function screeningVote(\n917: function getDelegateReward(\n928: function getDistributionId() external view override returns (uint24) {\n933: function getDistributionPeriodInfo(\n947: function getFundedProposalSlate(\n954: function getFundingPowerVotes(\n961: function getFundingVotesCast(uint24 distributionId_, address account_) external view override returns (FundingVoteParams[] memory) {\n966: function getProposalInfo(\n980: function getSlateHash(\n987: function getTopTenProposals(\n994: function getVoterInfo(\n1006: function getVotesFunding(\n1019: function getVotesScreening(\n\n// private functions should come last\n197: function _updateTreasury(\n227: function _setNewDistributionId() private returns (uint24 newId_) {", "github_refs_formatted": "StandardFunding.sol, PositionManager.sol", "github_files_list": "StandardFunding.sol, PositionManager.sol", "github_refs_count": 2, "vulnerable_code_actual": "// these external functions should come before private and internal functions\n119: function startNewDistributionPeriod() external override returns (uint24 newDistributionId_) {\n236: function claimDelegateReward(\n300: function updateSlate(\n343: function executeStandard(\n366: function proposeStandard(\n519: function fundingVote(\n572: function screeningVote(\n917: function getDelegateReward(\n928: function getDistributionId() external view override returns (uint24) {\n933: function getDistributionPeriodInfo(\n947: function getFundedProposalSlate(\n954: function getFundingPowerVotes(\n961: function getFundingVotesCast(uint24 distributionId_, address account_) external view override returns (FundingVoteParams[] memory) {\n966: function getProposalInfo(\n980: function getSlateHash(\n987: function getTopTenProposals(\n994: function getVoterInfo(\n1006: function getVotesFunding(\n1019: function getVotesScreening(\n\n// private functions should come last\n197: function _updateTreasury(\n227: function _setNewDistributionId() private returns (uint24 newId_) {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "// internal functions coming before external ones\n404: function _getAndIncrementNonce(\n416: function _isAjnaPool(\n436: function _bucketBankruptAfterDeposit(\n\n// public function coming after all the other ones\n517: function tokenURI(", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "08-dopex", "title": "DavidGiladi G", "severity_raw": "High", "severity": "high", "description": "\n### Gas Optimization Issues\n|Title|Issue|Instances|Total Gas Saved|\n|-|:-|:-:|:-:|\n|[G-1] Avoid unnecessary storage updates | [Avoid unnecessary storage updates](#avoid-unnecessary-storage-updates) | 15 | 12000 |\n|[G-2] Check Arguments Early | [Check Arguments Early](#check-arguments-early) | 1 | - |\n|[G-3] Modulus operations that could be unchecked | [Modulus operations that could be unchecked](#modulus-operations-that-could-be-unchecked) | 1 | 85 |\n|[G-4] State variables that could be declared constant | [State variables that could be declared constant](#state-variables-that-could-be-declared-constant) | 3 | 6291 |\n|[G-5] State variables that could be declared immutable | [State variables that could be declared immutable](#state-variables-that-could-be-declared-immutable) | 3 | 6291 |\n|[G-6] Avoid duplicate keccak256 calls | [Avoid duplicate keccak256 calls](#avoid-duplicate-keccak256-calls) | 2 | 84 |\n|[G-7] Use of emit inside a loop | [Use of emit inside a loop](#use-of-emit-inside-a-loop) | 3 | 3078 |\n|[G-8] Cache External Calls in Loops | [Cache External Calls in Loops](#cache-external-calls-in-loops) | 7 | 700 |\n|[G-9] Optimal State Variable Order | [Optimal State Variable Order](#optimal-state-variable-order) | 1 | 5000 |\n|[G-10] Redundant Bool Comparison | [Redundant Bool Comparison](#redundant-bool-comparison) | 1 | 9 |\n|[G-11] Cache Frequently Called Functions in stack Variables to Reduce Gas Costs | [Cache Frequently Called Functions in stack Variables to Reduce Gas Costs](#cache-frequently-called-functions-in-stack-variables-to-reduce-gas-costs) | 3 | - |\n|[G-12] Safe Subtraction Should Be Unchecked | [Safe Subtraction Should Be Unchecked](#safe-subtraction-should-be-unchecked) | 2 | 170 |\n|[G-13] Unnecessary Casting of Variables | [Unnecessary Casting of Variables](#unnecessary-casting-of-variables) | 2 | - |\n|[G-14] Avoid Unnecessary Computation Inside Loops | [Avoid Unnecessary Computation Inside Loops](#avoid-unnecessary-computation-inside-loops) |", "vulnerable_code": "Line: 33 contract RdpxV2Core is\n IRdpxV2Core,\n AccessControl,\n ContractWhitelist,\n ERC721Holder,\n Pausable\n", "fixed_code": "Line: 69 address public rdpx", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/DavidGiladi-G.md", "collected_at": "2026-01-02T18:24:34.864016+00:00", "source_hash": "bd56248d827db1e778246499d8822c503d28af7b05c9de19f42d7082626a2ba5", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "Line: 33 contract RdpxV2Core is\n IRdpxV2Core,\n AccessControl,\n ContractWhitelist,\n ERC721Holder,\n Pausable\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "Line: 69 address public rdpx", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-biconomy", "title": "prady Q", "severity_raw": "Critical", "severity": "critical", "description": "## [L-01] SIGNATURE LENGTH VERIFICATION MISSING\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L196\n\nThe `execTransaction` does not verify that the parameter `signature` length is a valid signature length or not, as the signature param consists of 32 bytes `s` and 32 bytes `r` and 1 byte of `v,` which means the signature length should be equal to 65. \n\n### Recommended mitigation step\n\nAdd this before line [SmartAccount-L198](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L198)\n```solidity\ncontracts/smart-contract-wallet/SmartAccount: \n require(_signature.length == 65, \"invalid signature length\");\n```\n\n## [L-02] INIT() FUNCTION CAN BE CALLED BY ANYBODY\nThe `init()` function can be called by anybody when the contract is not initialized.\n```solidity\n function init(\n address _owner,\n address _entryPointAddress,\n address _handler\n ) public override initializer {\n require(owner == address(0), \"Already initialized\");\n require(address(_entryPoint) == address(0), \"Already initialized\");\n require(_owner != address(0), \"Invalid owner\");\n require(_entryPointAddress != address(0), \"Invalid Entrypoint\");\n require(_handler != address(0), \"Invalid Entrypoint\");\n owner = _owner;\n _entryPoint = IEntryPoint(payable(_entryPointAddress));\n if (_handler != address(0)) internalSetFallbackHandler(_handler);\n setupModules(address(0), bytes(\"\"));\n }\n```\nMore importantly, if someone else runs this function, they will have full authority as it sets the `owner` variable. \n\n### Recommended mitigation step \nAdd a check that `init()` can only be called by the deployer. \n```solidity\naddress internal immutable deployer;\nconstructor() {\n deployer = msg.sender;\n}\n...\n\nfunction init(...) {\n if (msg.sender != DEPLOYER_ADDRESS) { revert NotDeployer(); }\n ", "vulnerable_code": "contracts/smart-contract-wallet/SmartAccount: \n require(_signature.length == 65, \"invalid signature length\");", "fixed_code": " function init(\n address _owner,\n address _entryPointAddress,\n address _handler\n ) public override initializer {\n require(owner == address(0), \"Already initialized\");\n require(address(_entryPoint) == address(0), \"Already initialized\");\n require(_owner != address(0), \"Invalid owner\");\n require(_entryPointAddress != address(0), \"Invalid Entrypoint\");\n require(_handler != address(0), \"Invalid Entrypoint\");\n owner = _owner;\n _entryPoint = IEntryPoint(payable(_entryPointAddress));\n if (_handler != address(0)) internalSetFallbackHandler(_handler);\n setupModules(address(0), bytes(\"\"));\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/prady-Q.md", "collected_at": "2026-01-02T18:14:02.958966+00:00", "source_hash": "bd8bb89fa8574152fe4786c48b76e44b8def5ef370429735cc84bb1f1c63dea9", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 789, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "contracts/smart-contract-wallet/SmartAccount: \n require(_signature.length == 65, \"invalid signature length\");", "primary_code_language": "solidity", "primary_code_char_count": 112, "all_code_blocks": "// Code block 1 (solidity):\ncontracts/smart-contract-wallet/SmartAccount: \n require(_signature.length == 65, \"invalid signature length\");\n\n// Code block 2 (solidity):\nfunction init(\n address _owner,\n address _entryPointAddress,\n address _handler\n ) public override initializer {\n require(owner == address(0), \"Already initialized\");\n require(address(_entryPoint) == address(0), \"Already initialized\");\n require(_owner != address(0), \"Invalid owner\");\n require(_entryPointAddress != address(0), \"Invalid Entrypoint\");\n require(_handler != address(0), \"Invalid Entrypoint\");\n owner = _owner;\n _entryPoint = IEntryPoint(payable(_entryPointAddress));\n if (_handler != address(0)) internalSetFallbackHandler(_handler);\n setupModules(address(0), bytes(\"\"));\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "contracts/smart-contract-wallet/SmartAccount: \n require(_signature.length == 65, \"invalid signature length\");\n\nfunction init(\n address _owner,\n address _entryPointAddress,\n address _handler\n ) public override initializer {\n require(owner == address(0), \"Already initialized\");\n require(address(_entryPoint) == address(0), \"Already initialized\");\n require(_owner != address(0), \"Invalid owner\");\n require(_entryPointAddress != address(0), \"Invalid Entrypoint\");\n require(_handler != address(0), \"Invalid Entrypoint\");\n owner = _owner;\n _entryPoint = IEntryPoint(payable(_entryPointAddress));\n if (_handler != address(0)) internalSetFallbackHandler(_handler);\n setupModules(address(0), bytes(\"\"));\n }", "github_refs_formatted": "SmartAccount.sol#L196, SmartAccount.sol#L198", "github_files_list": "SmartAccount.sol", "github_refs_count": 2, "vulnerable_code_actual": "contracts/smart-contract-wallet/SmartAccount: \n require(_signature.length == 65, \"invalid signature length\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function init(\n address _owner,\n address _entryPointAddress,\n address _handler\n ) public override initializer {\n require(owner == address(0), \"Already initialized\");\n require(address(_entryPoint) == address(0), \"Already initialized\");\n require(_owner != address(0), \"Invalid owner\");\n require(_entryPointAddress != address(0), \"Invalid Entrypoint\");\n require(_handler != address(0), \"Invalid Entrypoint\");\n owner = _owner;\n _entryPoint = IEntryPoint(payable(_entryPointAddress));\n if (_handler != address(0)) internalSetFallbackHandler(_handler);\n setupModules(address(0), bytes(\"\"));\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "02-ai-arena", "title": "Fitro Q", "severity_raw": "Unknown", "severity": "unknown", "description": "## [01] AiArenaHelper.sol the constructor initializes the attributeProbabilities() for generation 0 twice.\nIn the constructor of **`AiArenaHelper.sol`**, the initialization of **`attributeProbabilities()`** of generation 0 is duplicated.\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/AiArenaHelper.sol#L41-L52\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/AiArenaHelper.sol#L137\n```Solidity\nconstructor(uint8[][] memory probabilities) {\n _ownerAddress = msg.sender;\n\n // Initialize the probabilities for each attribute\n@> addAttributeProbabilities(0, probabilities);\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n@> attributeProbabilities[0][attributes[i]] = probabilities[i];\n attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n }\n} \n```\n```Solidity\nfunction addAttributeProbabilities(uint256 generation, uint8[][] memory probabilities) public {\n require(msg.sender == _ownerAddress);\n require(probabilities.length == 6, \"Invalid number of attribute arrays\");\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n@> attributeProbabilities[generation][attributes[i]] = probabilities[i];\n }\n}\n```\nRemove one of the two initializations.", "vulnerable_code": "constructor(uint8[][] memory probabilities) {\n _ownerAddress = msg.sender;\n\n // Initialize the probabilities for each attribute\n@> addAttributeProbabilities(0, probabilities);\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n@> attributeProbabilities[0][attributes[i]] = probabilities[i];\n attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n }\n} ", "fixed_code": "function addAttributeProbabilities(uint256 generation, uint8[][] memory probabilities) public {\n require(msg.sender == _ownerAddress);\n require(probabilities.length == 6, \"Invalid number of attribute arrays\");\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n@> attributeProbabilities[generation][attributes[i]] = probabilities[i];\n }\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/Fitro-Q.md", "collected_at": "2026-01-02T19:02:24.659140+00:00", "source_hash": "bdc9e9615e60612f75c0ee6f5cfa21bd0249133c12ed11ca168da035ebd15c21", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 835, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "constructor(uint8[][] memory probabilities) {\n _ownerAddress = msg.sender;\n\n // Initialize the probabilities for each attribute\n@> addAttributeProbabilities(0, probabilities);\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n@> attributeProbabilities[0][attributes[i]] = probabilities[i];\n attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n }\n}", "primary_code_language": "Solidity", "primary_code_char_count": 431, "all_code_blocks": "// Code block 1 (Solidity):\nconstructor(uint8[][] memory probabilities) {\n _ownerAddress = msg.sender;\n\n // Initialize the probabilities for each attribute\n@> addAttributeProbabilities(0, probabilities);\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n@> attributeProbabilities[0][attributes[i]] = probabilities[i];\n attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n }\n}\n\n// Code block 2 (Solidity):\nfunction addAttributeProbabilities(uint256 generation, uint8[][] memory probabilities) public {\n require(msg.sender == _ownerAddress);\n require(probabilities.length == 6, \"Invalid number of attribute arrays\");\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n@> attributeProbabilities[generation][attributes[i]] = probabilities[i];\n }\n}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "constructor(uint8[][] memory probabilities) {\n _ownerAddress = msg.sender;\n\n // Initialize the probabilities for each attribute\n@> addAttributeProbabilities(0, probabilities);\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n@> attributeProbabilities[0][attributes[i]] = probabilities[i];\n attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n }\n}\n\nfunction addAttributeProbabilities(uint256 generation, uint8[][] memory probabilities) public {\n require(msg.sender == _ownerAddress);\n require(probabilities.length == 6, \"Invalid number of attribute arrays\");\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n@> attributeProbabilities[generation][attributes[i]] = probabilities[i];\n }\n}", "github_refs_formatted": "AiArenaHelper.sol#L41-L52, AiArenaHelper.sol#L137", "github_files_list": "AiArenaHelper.sol", "github_refs_count": 2, "vulnerable_code_actual": "constructor(uint8[][] memory probabilities) {\n _ownerAddress = msg.sender;\n\n // Initialize the probabilities for each attribute\n@> addAttributeProbabilities(0, probabilities);\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n@> attributeProbabilities[0][attributes[i]] = probabilities[i];\n attributeToDnaDivisor[attributes[i]] = defaultAttributeDivisor[i];\n }\n} ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function addAttributeProbabilities(uint256 generation, uint8[][] memory probabilities) public {\n require(msg.sender == _ownerAddress);\n require(probabilities.length == 6, \"Invalid number of attribute arrays\");\n\n uint256 attributesLength = attributes.length;\n for (uint8 i = 0; i < attributesLength; i++) {\n@> attributeProbabilities[generation][attributes[i]] = probabilities[i];\n }\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7.78} {"source": "c4", "protocol": "02-ethos", "title": "0xm1ck Q", "severity_raw": "Critical", "severity": "critical", "description": "## Non Critical Issues\n\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [NC-1](#NC-1) | Missing checks for `address(0)` when assigning values to address state variables | 26 |\n| [NC-2](#NC-2) | `require()`\u00a0/\u00a0`revert()`\u00a0statements should have descriptive reason strings | 10 |\n| [NC-3](#NC-3) | Return values of `approve()` not checked | 5 |\n| [NC-4](#NC-4) | TODO Left in the code | 2 |\n| [NC-5](#NC-5) | Event is missing `indexed` fields | 91 |\n| [NC-6](#NC-6) | Functions not used internally could be marked external | 2 |\n### [NC-1] Missing checks for `address(0)` when assigning values to address state variables\n\n*Instances (26)*:\n```solidity\nFile: ActivePool.sol\n\n96: collateralConfigAddress = _collateralConfigAddress;\n\n97: borrowerOperationsAddress = _borrowerOperationsAddress;\n\n98: troveManagerAddress = _troveManagerAddress;\n\n99: stabilityPoolAddress = _stabilityPoolAddress;\n\n100: defaultPoolAddress = _defaultPoolAddress;\n\n101: collSurplusPoolAddress = _collSurplusPoolAddress;\n\n103: lqtyStakingAddress = _lqtyStakingAddress;\n\n```\n\n```solidity\nFile: BorrowerOperations.sol\n\n146: stabilityPoolAddress = _stabilityPoolAddress;\n\n147: gasPoolAddress = _gasPoolAddress;\n\n152: lqtyStakingAddress = _lqtyStakingAddress;\n\n```\n\n```solidity\nFile: LQTY/CommunityIssuance.sol\n\n75: stabilityPoolAddress = _stabilityPoolAddress;\n\n```\n\n```solidity\nFile: LQTY/LQTYStaking.sol\n\n88: troveManagerAddress = _troveManagerAddress;\n\n89: borrowerOperationsAddress = _borrowerOperationsAddress;\n\n90: activePoolAddress = _activePoolAddress;\n\n```\n\n```solidity\nFile: LUSDToken.sol\n\n102: troveManagerAddress = _troveManagerAddress;\n\n106: stabilityPoolAddress = _stabilityPoolAddress;\n\n110: borrowerOperationsAddress = _borrowerOperationsAddress;\n\n114: governanceAddress = _governanceAddress;\n\n117: guardianAddress = _guardianAddress;\n\n149: governance", "vulnerable_code": "File: ActivePool.sol\n\n96: collateralConfigAddress = _collateralConfigAddress;\n\n97: borrowerOperationsAddress = _borrowerOperationsAddress;\n\n98: troveManagerAddress = _troveManagerAddress;\n\n99: stabilityPoolAddress = _stabilityPoolAddress;\n\n100: defaultPoolAddress = _defaultPoolAddress;\n\n101: collSurplusPoolAddress = _collSurplusPoolAddress;\n\n103: lqtyStakingAddress = _lqtyStakingAddress;\n", "fixed_code": "File: BorrowerOperations.sol\n\n146: stabilityPoolAddress = _stabilityPoolAddress;\n\n147: gasPoolAddress = _gasPoolAddress;\n\n152: lqtyStakingAddress = _lqtyStakingAddress;\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/0xm1ck-Q.md", "collected_at": "2026-01-02T18:15:52.295343+00:00", "source_hash": "bde8e095dd56d4bbe82d7da71b38f9800fcb0e517dbd069b940df6a5fcf40d6f", "code_block_count": 4, "solidity_block_count": 4, "total_code_chars": 934, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: ActivePool.sol\n\n96: collateralConfigAddress = _collateralConfigAddress;\n\n97: borrowerOperationsAddress = _borrowerOperationsAddress;\n\n98: troveManagerAddress = _troveManagerAddress;\n\n99: stabilityPoolAddress = _stabilityPoolAddress;\n\n100: defaultPoolAddress = _defaultPoolAddress;\n\n101: collSurplusPoolAddress = _collSurplusPoolAddress;\n\n103: lqtyStakingAddress = _lqtyStakingAddress;", "primary_code_language": "solidity", "primary_code_char_count": 446, "all_code_blocks": "// Code block 1 (solidity):\nFile: ActivePool.sol\n\n96: collateralConfigAddress = _collateralConfigAddress;\n\n97: borrowerOperationsAddress = _borrowerOperationsAddress;\n\n98: troveManagerAddress = _troveManagerAddress;\n\n99: stabilityPoolAddress = _stabilityPoolAddress;\n\n100: defaultPoolAddress = _defaultPoolAddress;\n\n101: collSurplusPoolAddress = _collSurplusPoolAddress;\n\n103: lqtyStakingAddress = _lqtyStakingAddress;\n\n// Code block 2 (solidity):\nFile: BorrowerOperations.sol\n\n146: stabilityPoolAddress = _stabilityPoolAddress;\n\n147: gasPoolAddress = _gasPoolAddress;\n\n152: lqtyStakingAddress = _lqtyStakingAddress;\n\n// Code block 3 (solidity):\nFile: LQTY/CommunityIssuance.sol\n\n75: stabilityPoolAddress = _stabilityPoolAddress;\n\n// Code block 4 (solidity):\nFile: LQTY/LQTYStaking.sol\n\n88: troveManagerAddress = _troveManagerAddress;\n\n89: borrowerOperationsAddress = _borrowerOperationsAddress;\n\n90: activePoolAddress = _activePoolAddress;", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: ActivePool.sol\n\n96: collateralConfigAddress = _collateralConfigAddress;\n\n97: borrowerOperationsAddress = _borrowerOperationsAddress;\n\n98: troveManagerAddress = _troveManagerAddress;\n\n99: stabilityPoolAddress = _stabilityPoolAddress;\n\n100: defaultPoolAddress = _defaultPoolAddress;\n\n101: collSurplusPoolAddress = _collSurplusPoolAddress;\n\n103: lqtyStakingAddress = _lqtyStakingAddress;\n\nFile: BorrowerOperations.sol\n\n146: stabilityPoolAddress = _stabilityPoolAddress;\n\n147: gasPoolAddress = _gasPoolAddress;\n\n152: lqtyStakingAddress = _lqtyStakingAddress;\n\nFile: LQTY/CommunityIssuance.sol\n\n75: stabilityPoolAddress = _stabilityPoolAddress;\n\nFile: LQTY/LQTYStaking.sol\n\n88: troveManagerAddress = _troveManagerAddress;\n\n89: borrowerOperationsAddress = _borrowerOperationsAddress;\n\n90: activePoolAddress = _activePoolAddress;", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: ActivePool.sol\n\n96: collateralConfigAddress = _collateralConfigAddress;\n\n97: borrowerOperationsAddress = _borrowerOperationsAddress;\n\n98: troveManagerAddress = _troveManagerAddress;\n\n99: stabilityPoolAddress = _stabilityPoolAddress;\n\n100: defaultPoolAddress = _defaultPoolAddress;\n\n101: collSurplusPoolAddress = _collSurplusPoolAddress;\n\n103: lqtyStakingAddress = _lqtyStakingAddress;\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: BorrowerOperations.sol\n\n146: stabilityPoolAddress = _stabilityPoolAddress;\n\n147: gasPoolAddress = _gasPoolAddress;\n\n152: lqtyStakingAddress = _lqtyStakingAddress;\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "05-ajna", "title": "ayden G", "severity_raw": "Medium", "severity": "medium", "description": "1.Using bools for storage incurs overhead\nIf you don't use boolean for storage you will avoid Gwarmaccess 100 gas. In addition, state changes of boolean from\u00a0true\nto\u00a0false can cost up to ~20000 gas rather than\u00a0uint256(2) to\u00a0uint256(1) that would cost significantly less.\n\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L100\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L106\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/RewardsManager.sol#L70\n\n2.Multiple access to storage mapping should use local variable cache.\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/PositionManager.sol#L517#L535\n\n```solidity\nfunction tokenURI(\n uint256 tokenId_\n) public view override(ERC721) returns (string memory) {\n require(_exists(tokenId_));\n\n+ address poolAddress = poolKey[tokenId_];\n- address collateralTokenAddress = IPool(poolKey[tokenId_]).collateralAddress();\n- address quoteTokenAddress = IPool(poolKey[tokenId_]).quoteTokenAddress();\n+ address collateralTokenAddress = IPool(poolAddress).collateralAddress();\n+ address quoteTokenAddress = IPool(poolAddress).quoteTokenAddress();\n\n PositionNFTSVG.ConstructTokenURIParams memory params = PositionNFTSVG.ConstructTokenURIParams({\n collateralTokenSymbol: tokenSymbol(collateralTokenAddress),\n quoteTokenSymbol: tokenSymbol(quoteTokenAddress),\n tokenId: tokenId_,\n- pool: poolKey[tokenId_],\n+ pool: poolAddress,\n owner: ownerOf(tokenId_),\n indexes: positionIndexes[tokenId_].values()\n });\n\n return PositionNFTSVG.constructTokenURI(params);\n}\n```\n\n3.Moving the check that verifies whether the owner of the tokenId is the same as the msg.sender to the beginning of the function could save some gas fees.\nhttps://github.com/code-423n4/2023-05-ajna/", "vulnerable_code": "function tokenURI(\n uint256 tokenId_\n) public view override(ERC721) returns (string memory) {\n require(_exists(tokenId_));\n\n+ address poolAddress = poolKey[tokenId_];\n- address collateralTokenAddress = IPool(poolKey[tokenId_]).collateralAddress();\n- address quoteTokenAddress = IPool(poolKey[tokenId_]).quoteTokenAddress();\n+ address collateralTokenAddress = IPool(poolAddress).collateralAddress();\n+ address quoteTokenAddress = IPool(poolAddress).quoteTokenAddress();\n\n PositionNFTSVG.ConstructTokenURIParams memory params = PositionNFTSVG.ConstructTokenURIParams({\n collateralTokenSymbol: tokenSymbol(collateralTokenAddress),\n quoteTokenSymbol: tokenSymbol(quoteTokenAddress),\n tokenId: tokenId_,\n- pool: poolKey[tokenId_],\n+ pool: poolAddress,\n owner: ownerOf(tokenId_),\n indexes: positionIndexes[tokenId_].values()\n });\n\n return PositionNFTSVG.constructTokenURI(params);\n}", "fixed_code": "function stake(\n uint256 tokenId_\n) external override {\n+ // check that msg.sender is owner of tokenId\n+ if (IERC721(address(positionManager)).ownerOf(tokenId_) != msg.sender) revert NotOwnerOfDeposit(); //@audit check should in the front of this function .\n address ajnaPool = PositionManager(address(positionManager)).poolKey(tokenId_);\n\n- // check that msg.sender is owner of tokenId\n- if (IERC721(address(positionManager)).ownerOf(tokenId_) != msg.sender) revert NotOwnerOfDeposit(); //@audit check should in the front of this function .", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/ayden-G.md", "collected_at": "2026-01-02T18:21:21.086800+00:00", "source_hash": "bded9a2cd18ba16b30e9080a9db474ef95eb62295961c59be498faff714f7407", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 1041, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function tokenURI(\n uint256 tokenId_\n) public view override(ERC721) returns (string memory) {\n require(_exists(tokenId_));\n\n+ address poolAddress = poolKey[tokenId_];\n- address collateralTokenAddress = IPool(poolKey[tokenId_]).collateralAddress();\n- address quoteTokenAddress = IPool(poolKey[tokenId_]).quoteTokenAddress();\n+ address collateralTokenAddress = IPool(poolAddress).collateralAddress();\n+ address quoteTokenAddress = IPool(poolAddress).quoteTokenAddress();\n\n PositionNFTSVG.ConstructTokenURIParams memory params = PositionNFTSVG.ConstructTokenURIParams({\n collateralTokenSymbol: tokenSymbol(collateralTokenAddress),\n quoteTokenSymbol: tokenSymbol(quoteTokenAddress),\n tokenId: tokenId_,\n- pool: poolKey[tokenId_],\n+ pool: poolAddress,\n owner: ownerOf(tokenId_),\n indexes: positionIndexes[tokenId_].values()\n });\n\n return PositionNFTSVG.constructTokenURI(params);\n}", "primary_code_language": "solidity", "primary_code_char_count": 1041, "all_code_blocks": "// Code block 1 (solidity):\nfunction tokenURI(\n uint256 tokenId_\n) public view override(ERC721) returns (string memory) {\n require(_exists(tokenId_));\n\n+ address poolAddress = poolKey[tokenId_];\n- address collateralTokenAddress = IPool(poolKey[tokenId_]).collateralAddress();\n- address quoteTokenAddress = IPool(poolKey[tokenId_]).quoteTokenAddress();\n+ address collateralTokenAddress = IPool(poolAddress).collateralAddress();\n+ address quoteTokenAddress = IPool(poolAddress).quoteTokenAddress();\n\n PositionNFTSVG.ConstructTokenURIParams memory params = PositionNFTSVG.ConstructTokenURIParams({\n collateralTokenSymbol: tokenSymbol(collateralTokenAddress),\n quoteTokenSymbol: tokenSymbol(quoteTokenAddress),\n tokenId: tokenId_,\n- pool: poolKey[tokenId_],\n+ pool: poolAddress,\n owner: ownerOf(tokenId_),\n indexes: positionIndexes[tokenId_].values()\n });\n\n return PositionNFTSVG.constructTokenURI(params);\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function tokenURI(\n uint256 tokenId_\n) public view override(ERC721) returns (string memory) {\n require(_exists(tokenId_));\n\n+ address poolAddress = poolKey[tokenId_];\n- address collateralTokenAddress = IPool(poolKey[tokenId_]).collateralAddress();\n- address quoteTokenAddress = IPool(poolKey[tokenId_]).quoteTokenAddress();\n+ address collateralTokenAddress = IPool(poolAddress).collateralAddress();\n+ address quoteTokenAddress = IPool(poolAddress).quoteTokenAddress();\n\n PositionNFTSVG.ConstructTokenURIParams memory params = PositionNFTSVG.ConstructTokenURIParams({\n collateralTokenSymbol: tokenSymbol(collateralTokenAddress),\n quoteTokenSymbol: tokenSymbol(quoteTokenAddress),\n tokenId: tokenId_,\n- pool: poolKey[tokenId_],\n+ pool: poolAddress,\n owner: ownerOf(tokenId_),\n indexes: positionIndexes[tokenId_].values()\n });\n\n return PositionNFTSVG.constructTokenURI(params);\n}", "github_refs_formatted": "StandardFunding.sol#L100, StandardFunding.sol#L106, RewardsManager.sol#L70, PositionManager.sol#L517", "github_files_list": "RewardsManager.sol, StandardFunding.sol, PositionManager.sol", "github_refs_count": 4, "vulnerable_code_actual": "function tokenURI(\n uint256 tokenId_\n) public view override(ERC721) returns (string memory) {\n require(_exists(tokenId_));\n\n+ address poolAddress = poolKey[tokenId_];\n- address collateralTokenAddress = IPool(poolKey[tokenId_]).collateralAddress();\n- address quoteTokenAddress = IPool(poolKey[tokenId_]).quoteTokenAddress();\n+ address collateralTokenAddress = IPool(poolAddress).collateralAddress();\n+ address quoteTokenAddress = IPool(poolAddress).quoteTokenAddress();\n\n PositionNFTSVG.ConstructTokenURIParams memory params = PositionNFTSVG.ConstructTokenURIParams({\n collateralTokenSymbol: tokenSymbol(collateralTokenAddress),\n quoteTokenSymbol: tokenSymbol(quoteTokenAddress),\n tokenId: tokenId_,\n- pool: poolKey[tokenId_],\n+ pool: poolAddress,\n owner: ownerOf(tokenId_),\n indexes: positionIndexes[tokenId_].values()\n });\n\n return PositionNFTSVG.constructTokenURI(params);\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function stake(\n uint256 tokenId_\n) external override {\n+ // check that msg.sender is owner of tokenId\n+ if (IERC721(address(positionManager)).ownerOf(tokenId_) != msg.sender) revert NotOwnerOfDeposit(); //@audit check should in the front of this function .\n address ajnaPool = PositionManager(address(positionManager)).poolKey(tokenId_);\n\n- // check that msg.sender is owner of tokenId\n- if (IERC721(address(positionManager)).ownerOf(tokenId_) != msg.sender) revert NotOwnerOfDeposit(); //@audit check should in the front of this function .", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "06-lybra", "title": "Kaysoft Q", "severity_raw": "Medium", "severity": "medium", "description": "## [L-1] Refactor `_countVote` function to remove the unnamed parameter.\n\nThe last parameter of `_countVote` function in LibraGovernance.sol is unnamed.\nRefactor code to remove unnamed parameter.\n\nFile: https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/governance/LybraGovernance.sol#L76\n\n```\nfunction _countVote(uint256 proposalId, address account, uint8 support, uint256 weight, bytes memory) internal override {\n \n require(state(proposalId) == ProposalState.Active, \"GovernorBravo::castVoteInternal: voting is closed\");\n require(support <= 2, \"GovernorBravo::castVoteInternal: invalid vote type\");\n ProposalExtraData storage proposalExtraData = proposalData[proposalId];\n Receipt storage receipt = proposalExtraData.receipts[account];\n require(receipt.hasVoted == false, \"GovernorBravo::castVoteInternal: voter already voted\");\n \n proposalExtraData.supportVotes[support] += weight;\n \n\n receipt.hasVoted = true;\n receipt.support = support;\n receipt.votes = weight;\n proposalExtraData.totalVotes += weight;\n \n }\n```\n\n## [L-2] Refactor code to remove commented variable\nThe `proposalId` parameter of the `_execute` function in LibraGovernance.sol is commented out. Refactor code to remove commented parameter.\n\nFile: https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/governance/LybraGovernance.sol#L106\n```\nfunction _execute(uint256 /* proposalId */, address[] memory targets, uint256[] memory values, bytes[] memory calldatas, bytes32 descriptionHash) internal virtual override {\n require(GovernanceTimelock.checkOnlyRole(keccak256(\"TIMELOCK\"), msg.sender), \"not authorized\");\n super._execute(1, targets, values, calldatas, descriptionHash);\n // _timelock.executeBatch{value: msg.value}(targets, values, calldatas, 0, descriptionHash);//@audit commented code.\n }\n`", "vulnerable_code": "function _countVote(uint256 proposalId, address account, uint8 support, uint256 weight, bytes memory) internal override {\n \n require(state(proposalId) == ProposalState.Active, \"GovernorBravo::castVoteInternal: voting is closed\");\n require(support <= 2, \"GovernorBravo::castVoteInternal: invalid vote type\");\n ProposalExtraData storage proposalExtraData = proposalData[proposalId];\n Receipt storage receipt = proposalExtraData.receipts[account];\n require(receipt.hasVoted == false, \"GovernorBravo::castVoteInternal: voter already voted\");\n \n proposalExtraData.supportVotes[support] += weight;\n \n\n receipt.hasVoted = true;\n receipt.support = support;\n receipt.votes = weight;\n proposalExtraData.totalVotes += weight;\n \n }", "fixed_code": "function _execute(uint256 /* proposalId */, address[] memory targets, uint256[] memory values, bytes[] memory calldatas, bytes32 descriptionHash) internal virtual override {\n require(GovernanceTimelock.checkOnlyRole(keccak256(\"TIMELOCK\"), msg.sender), \"not authorized\");\n super._execute(1, targets, values, calldatas, descriptionHash);\n // _timelock.executeBatch{value: msg.value}(targets, values, calldatas, 0, descriptionHash);//@audit commented code.\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/Kaysoft-Q.md", "collected_at": "2026-01-02T18:22:25.683445+00:00", "source_hash": "be0f78970ec6a27cafee440d86e08c02f5ec0bf0dae65baf3078bd60a55669ca", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 817, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _countVote(uint256 proposalId, address account, uint8 support, uint256 weight, bytes memory) internal override {\n \n require(state(proposalId) == ProposalState.Active, \"GovernorBravo::castVoteInternal: voting is closed\");\n require(support <= 2, \"GovernorBravo::castVoteInternal: invalid vote type\");\n ProposalExtraData storage proposalExtraData = proposalData[proposalId];\n Receipt storage receipt = proposalExtraData.receipts[account];\n require(receipt.hasVoted == false, \"GovernorBravo::castVoteInternal: voter already voted\");\n \n proposalExtraData.supportVotes[support] += weight;\n \n\n receipt.hasVoted = true;\n receipt.support = support;\n receipt.votes = weight;\n proposalExtraData.totalVotes += weight;\n \n }", "primary_code_language": "unknown", "primary_code_char_count": 817, "all_code_blocks": "// Code block 1 (unknown):\nfunction _countVote(uint256 proposalId, address account, uint8 support, uint256 weight, bytes memory) internal override {\n \n require(state(proposalId) == ProposalState.Active, \"GovernorBravo::castVoteInternal: voting is closed\");\n require(support <= 2, \"GovernorBravo::castVoteInternal: invalid vote type\");\n ProposalExtraData storage proposalExtraData = proposalData[proposalId];\n Receipt storage receipt = proposalExtraData.receipts[account];\n require(receipt.hasVoted == false, \"GovernorBravo::castVoteInternal: voter already voted\");\n \n proposalExtraData.supportVotes[support] += weight;\n \n\n receipt.hasVoted = true;\n receipt.support = support;\n receipt.votes = weight;\n proposalExtraData.totalVotes += weight;\n \n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LybraGovernance.sol#L76, LybraGovernance.sol#L106", "github_files_list": "LybraGovernance.sol", "github_refs_count": 2, "vulnerable_code_actual": "function _countVote(uint256 proposalId, address account, uint8 support, uint256 weight, bytes memory) internal override {\n \n require(state(proposalId) == ProposalState.Active, \"GovernorBravo::castVoteInternal: voting is closed\");\n require(support <= 2, \"GovernorBravo::castVoteInternal: invalid vote type\");\n ProposalExtraData storage proposalExtraData = proposalData[proposalId];\n Receipt storage receipt = proposalExtraData.receipts[account];\n require(receipt.hasVoted == false, \"GovernorBravo::castVoteInternal: voter already voted\");\n \n proposalExtraData.supportVotes[support] += weight;\n \n\n receipt.hasVoted = true;\n receipt.support = support;\n receipt.votes = weight;\n proposalExtraData.totalVotes += weight;\n \n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function _execute(uint256 /* proposalId */, address[] memory targets, uint256[] memory values, bytes[] memory calldatas, bytes32 descriptionHash) internal virtual override {\n require(GovernanceTimelock.checkOnlyRole(keccak256(\"TIMELOCK\"), msg.sender), \"not authorized\");\n super._execute(1, targets, values, calldatas, descriptionHash);\n // _timelock.executeBatch{value: msg.value}(targets, values, calldatas, 0, descriptionHash);//@audit commented code.\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ethos", "title": "CodingNameKiki Q", "severity_raw": "Critical", "severity": "critical", "description": "### Issues Template\n| Letter | Name | Description |\n|:--:|:-------:|:-------:|\n| L | Low risk | Potential risk |\n| NC | Non-critical | Non risky findings |\n| R | Refactor | Changing the code |\n| O | Ordinary | Often found issues |\n\n| Total Found Issues | 22 |\n|:--:|:--:|\n\n### Low Risk Template\n| Count | Explanation | Instances |\n|:--:|:-------|:--:|\n| [L-1] | The function `updateDistributionPeriod` should not allow distributionPeriod to be set as zero. This problem leads to the wrong calculation of rewardPerSecond in the function `fund` duo to division by zero. As rewardPerSecond is zero, this will lead to the wrong calculation of issuance in the function `issueOath` and here the function will actually issue a wrong amount of Oath to the stability pool. | 1 |\n| [L-2] | The function `setAddresses` in CommunityIssuance is one time callable and the given addresses can't be changed after that, as there is no other function to change the address of the `stabilityPool` on a later plan. | 1 |\n\n\n| Total Low Risk Issues | 2 |\n|:--:|:--:|\n\n### Non-Critical Template\n| Count | Explanation | Instances |\n|:----:|:-------|:--:|\n| [N-1] | Both of the functions `transfer` and `transferFrom` does two address(0) checks on the recipient | 1 |\n| [N-2] | Imported console in `LUSDToken.sol` | 1 |\n| [N-3] | State variable `mintingPaused` is applied with its default value | 2 |\n| [N-4] | A simple check can be applied, instead of creating a whole function doing its purpose | 2 |\n| [N-5] | The function `sendOath` should check, if the contract has the balance of Oath tokens to do the transfer | 1 |\n| [N-6] | The executed code in the function `setAddresses` can be moved in the constructor, as once called the function can't be called a second time | 1 |\n| [N-7] | TODO applied in the contracts | 2 |\n| [N-8] | Constructor lacks address(0) check | 2 |\n\n\n| Total Non-Critical Issues | 8 |\n|:--:|:--:|\n\n### Refactor Issues Template\n| Count | Explanation | Instances |\n|:--:|:-------|:--:|\n| [R-1] | U", "vulnerable_code": "Ethos-Core/contracts/LQTY/CommunityIssuance.sol\n\n120: function updateDistributionPeriod(uint256 _newDistributionPeriod) external onlyOwner {\n121: distributionPeriod = _newDistributionPeriod;\n122: }", "fixed_code": "Ethos-Core/contracts/LQTY/CommunityIssuance.sol\n\n101: function fund(uint amount) external onlyOwner {\n102: require(amount != 0, \"cannot fund 0\");\n103: OathToken.transferFrom(msg.sender, address(this), amount);\n104:\n105: // roll any unissued OATH into new distribution\n106: if (lastIssuanceTimestamp < lastDistributionTime) {\n107: uint timeLeft = lastDistributionTime.sub(lastIssuanceTimestamp);\n108: uint notIssued = timeLeft.mul(rewardPerSecond);\n109: amount = amount.add(notIssued);\n110: }\n111:\n112: rewardPerSecond = amount.div(distributionPeriod);\n113: lastDistributionTime = block.timestamp.add(distributionPeriod);\n114: lastIssuanceTimestamp = block.timestamp;\n115:\n116: emit LogRewardPerSecond(rewardPerSecond);\n117: }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/CodingNameKiki-Q.md", "collected_at": "2026-01-02T18:16:04.894511+00:00", "source_hash": "be2e2a584a89ff24d6ebba9612cdec220dcbc1623c95a2bf61da2f2e47618835", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "Ethos-Core/contracts/LQTY/CommunityIssuance.sol\n\n120: function updateDistributionPeriod(uint256 _newDistributionPeriod) external onlyOwner {\n121: distributionPeriod = _newDistributionPeriod;\n122: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "Ethos-Core/contracts/LQTY/CommunityIssuance.sol\n\n101: function fund(uint amount) external onlyOwner {\n102: require(amount != 0, \"cannot fund 0\");\n103: OathToken.transferFrom(msg.sender, address(this), amount);\n104:\n105: // roll any unissued OATH into new distribution\n106: if (lastIssuanceTimestamp < lastDistributionTime) {\n107: uint timeLeft = lastDistributionTime.sub(lastIssuanceTimestamp);\n108: uint notIssued = timeLeft.mul(rewardPerSecond);\n109: amount = amount.add(notIssued);\n110: }\n111:\n112: rewardPerSecond = amount.div(distributionPeriod);\n113: lastDistributionTime = block.timestamp.add(distributionPeriod);\n114: lastIssuanceTimestamp = block.timestamp;\n115:\n116: emit LogRewardPerSecond(rewardPerSecond);\n117: }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-biconomy", "title": "bin2chen Q", "severity_raw": "Unknown", "severity": "unknown", "description": "1.\nSmartAccount._validateSignature()\nAccording to protocol eip-4337, the _validateSignature() signature error should return \"sigFailure\", not the current direct revert.\n```solidity\n function _validateSignature(UserOperation calldata userOp, bytes32 userOpHash, address)\n internal override virtual returns (uint256 deadline) {\n... \nrequire(owner == hash.recover(userOp.signature) || tx.origin == address(0), \"account: wrong signature\");\n...\n```\n\nhttps://eips.ethereum.org/EIPS/eip-4337\n\"\"\"\nThe return value is packed of sigFailure, validUntil and validAfter timestamps.\nsigFailure is 1 byte value of \u201c1\u201d the signature check failed (should not revert on signature failure, to support estimate)\nvalidUntil is 8-byte timestamp value, or zero for \u201cinfinite\u201d. The UserOp is valid only up to this time.\nvalidAfter is 8-byte timestamp. The UserOp is valid only after this time.\n\"\"\"\n\n2.\nSmartAccount.execute()/executeBatch\uff08\uff09has been limited to onlyOwner, no need to verify _requireFromEntryPointOrOwner();\nSmartAccount.sol suggest remove onlyOwner:\n```solidity\n- function execute(address dest, uint value, bytes calldata func) external onlyOwner{\n+ function execute(address dest, uint value, bytes calldata func) external {\n _requireFromEntryPointOrOwner();\n _call(dest, value, func);\n }\n\n- function executeBatch(address[] calldata dest, bytes[] calldata func) external onlyOwner{\n+ function executeBatch(address[] calldata dest, bytes[] calldata func) external { \n _requireFromEntryPointOrOwner();\n require(dest.length == func.length, \"wrong array lengths\");\n for (uint i = 0; i < dest.length;) {\n _call(dest[i], 0, func[i]);\n unchecked {\n ++i;\n }\n }\n }\n``` ", "vulnerable_code": " function _validateSignature(UserOperation calldata userOp, bytes32 userOpHash, address)\n internal override virtual returns (uint256 deadline) {\n... \nrequire(owner == hash.recover(userOp.signature) || tx.origin == address(0), \"account: wrong signature\");\n...", "fixed_code": "- function execute(address dest, uint value, bytes calldata func) external onlyOwner{\n+ function execute(address dest, uint value, bytes calldata func) external {\n _requireFromEntryPointOrOwner();\n _call(dest, value, func);\n }\n\n- function executeBatch(address[] calldata dest, bytes[] calldata func) external onlyOwner{\n+ function executeBatch(address[] calldata dest, bytes[] calldata func) external { \n _requireFromEntryPointOrOwner();\n require(dest.length == func.length, \"wrong array lengths\");\n for (uint i = 0; i < dest.length;) {\n _call(dest[i], 0, func[i]);\n unchecked {\n ++i;\n }\n }\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/bin2chen-Q.md", "collected_at": "2026-01-02T18:13:33.726684+00:00", "source_hash": "be3ae1983ecd663acf04ef867786a3040f801acaf8d20614e54b0e2b11f39bf5", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 963, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _validateSignature(UserOperation calldata userOp, bytes32 userOpHash, address)\n internal override virtual returns (uint256 deadline) {\n... \nrequire(owner == hash.recover(userOp.signature) || tx.origin == address(0), \"account: wrong signature\");\n...", "primary_code_language": "solidity", "primary_code_char_count": 263, "all_code_blocks": "// Code block 1 (solidity):\nfunction _validateSignature(UserOperation calldata userOp, bytes32 userOpHash, address)\n internal override virtual returns (uint256 deadline) {\n... \nrequire(owner == hash.recover(userOp.signature) || tx.origin == address(0), \"account: wrong signature\");\n...\n\n// Code block 2 (solidity):\n- function execute(address dest, uint value, bytes calldata func) external onlyOwner{\n+ function execute(address dest, uint value, bytes calldata func) external {\n _requireFromEntryPointOrOwner();\n _call(dest, value, func);\n }\n\n- function executeBatch(address[] calldata dest, bytes[] calldata func) external onlyOwner{\n+ function executeBatch(address[] calldata dest, bytes[] calldata func) external { \n _requireFromEntryPointOrOwner();\n require(dest.length == func.length, \"wrong array lengths\");\n for (uint i = 0; i < dest.length;) {\n _call(dest[i], 0, func[i]);\n unchecked {\n ++i;\n }\n }\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function _validateSignature(UserOperation calldata userOp, bytes32 userOpHash, address)\n internal override virtual returns (uint256 deadline) {\n... \nrequire(owner == hash.recover(userOp.signature) || tx.origin == address(0), \"account: wrong signature\");\n...\n\n- function execute(address dest, uint value, bytes calldata func) external onlyOwner{\n+ function execute(address dest, uint value, bytes calldata func) external {\n _requireFromEntryPointOrOwner();\n _call(dest, value, func);\n }\n\n- function executeBatch(address[] calldata dest, bytes[] calldata func) external onlyOwner{\n+ function executeBatch(address[] calldata dest, bytes[] calldata func) external { \n _requireFromEntryPointOrOwner();\n require(dest.length == func.length, \"wrong array lengths\");\n for (uint i = 0; i < dest.length;) {\n _call(dest[i], 0, func[i]);\n unchecked {\n ++i;\n }\n }\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function _validateSignature(UserOperation calldata userOp, bytes32 userOpHash, address)\n internal override virtual returns (uint256 deadline) {\n... \nrequire(owner == hash.recover(userOp.signature) || tx.origin == address(0), \"account: wrong signature\");\n...", "has_vulnerable_code_snippet": true, "fixed_code_actual": "- function execute(address dest, uint value, bytes calldata func) external onlyOwner{\n+ function execute(address dest, uint value, bytes calldata func) external {\n _requireFromEntryPointOrOwner();\n _call(dest, value, func);\n }\n\n- function executeBatch(address[] calldata dest, bytes[] calldata func) external onlyOwner{\n+ function executeBatch(address[] calldata dest, bytes[] calldata func) external { \n _requireFromEntryPointOrOwner();\n require(dest.length == func.length, \"wrong array lengths\");\n for (uint i = 0; i < dest.length;) {\n _call(dest[i], 0, func[i]);\n unchecked {\n ++i;\n }\n }\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-asymmetry", "title": "P7N8ZK Q", "severity_raw": "Unknown", "severity": "unknown", "description": "#\n\n# [1] Function `adjustWeight` should check if the derivative corresponding to the index exists\n\n```\nFile: contracts/SafEth/SafEth.sol\n\n165: function adjustWeight(\n166: uint256 _derivativeIndex,\n167: uint256 _weight\n168: ) external onlyOwner {\n169: weights[_derivativeIndex] = _weight;\n170: uint256 localTotalWeight = 0;\n171: for (uint256 i = 0; i < derivativeCount; i++)\n172: localTotalWeight += weights[i];\n173: totalWeight = localTotalWeight;\n174: emit WeightChange(_derivativeIndex, _weight);\n175: }\n```\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L165-L175\n\n```\ndiff --git forkSrcPrefix/contracts/SafEth/SafEth.sol forkDstPrefix/contracts/SafEth/SafEth.sol\nindex ebadb4bbf2b55e7a28b0334c5dd3ea40aa163456..b26b68119acd1ecbfe7294bf050423d77e361799 100644\n--- forkSrcPrefix/contracts/SafEth/SafEth.sol\n+++ forkDstPrefix/contracts/SafEth/SafEth.sol\n@@ -166,6 +166,7 @@ contract SafEth is\n uint256 _derivativeIndex,\n uint256 _weight\n ) external onlyOwner {\n+ require(_derivativeIndex < derivativeCount, \"Invalid derivativeIndex\");\n weights[_derivativeIndex] = _weight;\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n```\n\n# [2] Function `setMaxSlippage` should check if the derivative corresponding to the index exists\n```\nFile: contracts/SafEth/SafEth.sol\n\n202: function setMaxSlippage(\n203: uint _derivativeIndex,\n204: uint _slippage\n205: ) external onlyOwner {\n206: derivatives[_derivativeIndex].setMaxSlippage(_slippage);\n207: emit SetMaxSlippage(_derivativeIndex, _slippage);\n208: }\n```\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L202-L208\n\n```\ndiff --git forkSrcPrefix/contracts/SafEth/SafEth.sol forkDstPrefix/contracts/SafEth/SafEth.sol\nindex ebadb4bbf2b55e7a28b0334c5dd3ea40aa163456..0c579a70b83d225448f66d3e9323aa0ea", "vulnerable_code": "File: contracts/SafEth/SafEth.sol\n\n165: function adjustWeight(\n166: uint256 _derivativeIndex,\n167: uint256 _weight\n168: ) external onlyOwner {\n169: weights[_derivativeIndex] = _weight;\n170: uint256 localTotalWeight = 0;\n171: for (uint256 i = 0; i < derivativeCount; i++)\n172: localTotalWeight += weights[i];\n173: totalWeight = localTotalWeight;\n174: emit WeightChange(_derivativeIndex, _weight);\n175: }", "fixed_code": "diff --git forkSrcPrefix/contracts/SafEth/SafEth.sol forkDstPrefix/contracts/SafEth/SafEth.sol\nindex ebadb4bbf2b55e7a28b0334c5dd3ea40aa163456..b26b68119acd1ecbfe7294bf050423d77e361799 100644\n--- forkSrcPrefix/contracts/SafEth/SafEth.sol\n+++ forkDstPrefix/contracts/SafEth/SafEth.sol\n@@ -166,6 +166,7 @@ contract SafEth is\n uint256 _derivativeIndex,\n uint256 _weight\n ) external onlyOwner {\n+ require(_derivativeIndex < derivativeCount, \"Invalid derivativeIndex\");\n weights[_derivativeIndex] = _weight;\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/P7N8ZK-Q.md", "collected_at": "2026-01-02T18:18:23.399580+00:00", "source_hash": "be48e3d72f59e70fe5b61c9032ff64dac9fbd0cbc378bc6469e31d8e3f8344da", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 1402, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/SafEth/SafEth.sol\n\n165: function adjustWeight(\n166: uint256 _derivativeIndex,\n167: uint256 _weight\n168: ) external onlyOwner {\n169: weights[_derivativeIndex] = _weight;\n170: uint256 localTotalWeight = 0;\n171: for (uint256 i = 0; i < derivativeCount; i++)\n172: localTotalWeight += weights[i];\n173: totalWeight = localTotalWeight;\n174: emit WeightChange(_derivativeIndex, _weight);\n175: }", "primary_code_language": "unknown", "primary_code_char_count": 471, "all_code_blocks": "// Code block 1 (unknown):\nFile: contracts/SafEth/SafEth.sol\n\n165: function adjustWeight(\n166: uint256 _derivativeIndex,\n167: uint256 _weight\n168: ) external onlyOwner {\n169: weights[_derivativeIndex] = _weight;\n170: uint256 localTotalWeight = 0;\n171: for (uint256 i = 0; i < derivativeCount; i++)\n172: localTotalWeight += weights[i];\n173: totalWeight = localTotalWeight;\n174: emit WeightChange(_derivativeIndex, _weight);\n175: }\n\n// Code block 2 (unknown):\ndiff --git forkSrcPrefix/contracts/SafEth/SafEth.sol forkDstPrefix/contracts/SafEth/SafEth.sol\nindex ebadb4bbf2b55e7a28b0334c5dd3ea40aa163456..b26b68119acd1ecbfe7294bf050423d77e361799 100644\n--- forkSrcPrefix/contracts/SafEth/SafEth.sol\n+++ forkDstPrefix/contracts/SafEth/SafEth.sol\n@@ -166,6 +166,7 @@ contract SafEth is\n uint256 _derivativeIndex,\n uint256 _weight\n ) external onlyOwner {\n+ require(_derivativeIndex < derivativeCount, \"Invalid derivativeIndex\");\n weights[_derivativeIndex] = _weight;\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n\n// Code block 3 (unknown):\nFile: contracts/SafEth/SafEth.sol\n\n202: function setMaxSlippage(\n203: uint _derivativeIndex,\n204: uint _slippage\n205: ) external onlyOwner {\n206: derivatives[_derivativeIndex].setMaxSlippage(_slippage);\n207: emit SetMaxSlippage(_derivativeIndex, _slippage);\n208: }", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol#L165-L175, SafEth.sol#L202-L208", "github_files_list": "SafEth.sol", "github_refs_count": 2, "vulnerable_code_actual": "File: contracts/SafEth/SafEth.sol\n\n165: function adjustWeight(\n166: uint256 _derivativeIndex,\n167: uint256 _weight\n168: ) external onlyOwner {\n169: weights[_derivativeIndex] = _weight;\n170: uint256 localTotalWeight = 0;\n171: for (uint256 i = 0; i < derivativeCount; i++)\n172: localTotalWeight += weights[i];\n173: totalWeight = localTotalWeight;\n174: emit WeightChange(_derivativeIndex, _weight);\n175: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "diff --git forkSrcPrefix/contracts/SafEth/SafEth.sol forkDstPrefix/contracts/SafEth/SafEth.sol\nindex ebadb4bbf2b55e7a28b0334c5dd3ea40aa163456..b26b68119acd1ecbfe7294bf050423d77e361799 100644\n--- forkSrcPrefix/contracts/SafEth/SafEth.sol\n+++ forkDstPrefix/contracts/SafEth/SafEth.sol\n@@ -166,6 +166,7 @@ contract SafEth is\n uint256 _derivativeIndex,\n uint256 _weight\n ) external onlyOwner {\n+ require(_derivativeIndex < derivativeCount, \"Invalid derivativeIndex\");\n weights[_derivativeIndex] = _weight;\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "07-amphora", "title": "Kaysoft Q", "severity_raw": "Unknown", "severity": "unknown", "description": "## [NC-1] Use more descriptive and related variable names instead of `_foo` and `_bar`\nVariable names `_foo` and `_bar` are used in the `_getRate` function of the AMPHClaimer.sol contract.\nFile: https://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/core/AMPHClaimer.sol#L195\n\n```\nfunction _getRate(uint256 _distributedAmph) internal pure returns (uint256 _rate) {\n uint256 _foo = (_TWENTY_FIVE_THOUSANDS * BASE_SUPPLY_PER_CLIFF) / Math.max(_distributedAmph, _FIFTY_MILLIONS);\n uint256 _bar = (_distributedAmph * 1e12) / (BASE_SUPPLY_PER_CLIFF * _FIFTY); //@audit div before mul.\n//@audit use meaningful variable name.\n _rate = 1e6 + (_foo - _bar);\n }\n```\n\n#### Recommended Mitigation Steps\nUse more descriptive variable names other than `_foo` and `_bar`.\n\n## [NC-2] Admin can mint large amount of AmphoraProtocolToken since there is no maximum cap\n\nThe mint function has no maximum totalsupply cap, so admin can mint large amount of token.\n\n```\nfunction mint(address _dst, uint256 _rawAmount) public onlyOwner {\n _mint(_dst, _rawAmount);\n }//@audit totalsupply should have a cap.\n```\n#### Recommended Mitigation Step\nimplement the max supply cap", "vulnerable_code": "function _getRate(uint256 _distributedAmph) internal pure returns (uint256 _rate) {\n uint256 _foo = (_TWENTY_FIVE_THOUSANDS * BASE_SUPPLY_PER_CLIFF) / Math.max(_distributedAmph, _FIFTY_MILLIONS);\n uint256 _bar = (_distributedAmph * 1e12) / (BASE_SUPPLY_PER_CLIFF * _FIFTY); //@audit div before mul.\n//@audit use meaningful variable name.\n _rate = 1e6 + (_foo - _bar);\n }", "fixed_code": "function mint(address _dst, uint256 _rawAmount) public onlyOwner {\n _mint(_dst, _rawAmount);\n }//@audit totalsupply should have a cap.", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/Kaysoft-Q.md", "collected_at": "2026-01-02T18:23:27.339950+00:00", "source_hash": "bea1655faf7fdf8cb97a5256a9880ba3383ed616d0136c59183ad567ee40aa99", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 518, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _getRate(uint256 _distributedAmph) internal pure returns (uint256 _rate) {\n uint256 _foo = (_TWENTY_FIVE_THOUSANDS * BASE_SUPPLY_PER_CLIFF) / Math.max(_distributedAmph, _FIFTY_MILLIONS);\n uint256 _bar = (_distributedAmph * 1e12) / (BASE_SUPPLY_PER_CLIFF * _FIFTY); //@audit div before mul.\n//@audit use meaningful variable name.\n _rate = 1e6 + (_foo - _bar);\n }", "primary_code_language": "unknown", "primary_code_char_count": 380, "all_code_blocks": "// Code block 1 (unknown):\nfunction _getRate(uint256 _distributedAmph) internal pure returns (uint256 _rate) {\n uint256 _foo = (_TWENTY_FIVE_THOUSANDS * BASE_SUPPLY_PER_CLIFF) / Math.max(_distributedAmph, _FIFTY_MILLIONS);\n uint256 _bar = (_distributedAmph * 1e12) / (BASE_SUPPLY_PER_CLIFF * _FIFTY); //@audit div before mul.\n//@audit use meaningful variable name.\n _rate = 1e6 + (_foo - _bar);\n }\n\n// Code block 2 (unknown):\nfunction mint(address _dst, uint256 _rawAmount) public onlyOwner {\n _mint(_dst, _rawAmount);\n }//@audit totalsupply should have a cap.", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "AMPHClaimer.sol#L195", "github_files_list": "AMPHClaimer.sol", "github_refs_count": 1, "vulnerable_code_actual": "function _getRate(uint256 _distributedAmph) internal pure returns (uint256 _rate) {\n uint256 _foo = (_TWENTY_FIVE_THOUSANDS * BASE_SUPPLY_PER_CLIFF) / Math.max(_distributedAmph, _FIFTY_MILLIONS);\n uint256 _bar = (_distributedAmph * 1e12) / (BASE_SUPPLY_PER_CLIFF * _FIFTY); //@audit div before mul.\n//@audit use meaningful variable name.\n _rate = 1e6 + (_foo - _bar);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function mint(address _dst, uint256 _rawAmount) public onlyOwner {\n _mint(_dst, _rawAmount);\n }//@audit totalsupply should have a cap.", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7.44} {"source": "c4", "protocol": "09-ondo", "title": "nirlin Q", "severity_raw": "Medium", "severity": "medium", "description": "## NC 1 : Use the uniswap multicall implementation that returns that exact error code, instead of the error code of multicall contract itself\nOndo use the following implementation of multicall in factory and source bridge:\n\n```solidity\n function multiexcall(\n ExCallData[] calldata exCallData\n ) external payable override onlyOwner returns (bytes[] memory results) {\n results = new bytes[](exCallData.length);\n for (uint256 i = 0; i < exCallData.length; ++i) {\n (bool success, bytes memory ret) = address(exCallData[i].target).call{\n value: exCallData[i].value\n }(exCallData[i].data);\n require(success, \"Call Failed\");\n results[i] = ret;\n }\n }\n ```\n\nwhich simply returns the `Call Failed` error on !success, but use the uniswap impementation which returns the exact error code. Implementation is as follow:\nhttps://github.com/Uniswap/v3-periphery/blob/b13f9d9d9868b98b765c4f1d8d7f486b00b22488/contracts/base/Multicall.sol#L11-L28\n\n```solidity\n function multicall(bytes[] calldata data) public payable override returns (bytes[] memory results) {\n results = new bytes[](data.length);\n for (uint256 i = 0; i < data.length; i++) {\n (bool success, bytes memory result) = address(this).delegatecall(data[i]);\n\n if (!success) {\n // Next 5 lines from https://ethereum.stackexchange.com/a/83577\n if (result.length < 68) revert();\n assembly {\n result := add(result, 0x04)\n }\n revert(abi.decode(result, (string)));\n }\n\n results[i] = result;\n }\n }\n}\n```\n\n## NC 2 : No need to use this much assembly in _rpow\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/rwaOracles/RWADynamicOracle.sol#L345-L398\n`_rpow` function us copied from the following repositery,\n\nhttps://github.com/makerdao/dss/blob/master/src/jug.sol\n\nwhich is written in very old solidity ve", "vulnerable_code": " function multiexcall(\n ExCallData[] calldata exCallData\n ) external payable override onlyOwner returns (bytes[] memory results) {\n results = new bytes[](exCallData.length);\n for (uint256 i = 0; i < exCallData.length; ++i) {\n (bool success, bytes memory ret) = address(exCallData[i].target).call{\n value: exCallData[i].value\n }(exCallData[i].data);\n require(success, \"Call Failed\");\n results[i] = ret;\n }\n }\n ```\n\nwhich simply returns the `Call Failed` error on !success, but use the uniswap impementation which returns the exact error code. Implementation is as follow:\nhttps://github.com/Uniswap/v3-periphery/blob/b13f9d9d9868b98b765c4f1d8d7f486b00b22488/contracts/base/Multicall.sol#L11-L28\n", "fixed_code": "## NC 2 : No need to use this much assembly in _rpow\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/rwaOracles/RWADynamicOracle.sol#L345-L398\n`_rpow` function us copied from the following repositery,\n\nhttps://github.com/makerdao/dss/blob/master/src/jug.sol\n\nwhich is written in very old solidity version 0.6.12 when there was no native way to take power in solidity but now that is not the case.\n\nSo as the _rpow represents the following formula given by dev:\n\nresult = (prevRangeClose * [(numerator/ ONE) ** (elapsedDays + 1)])\n\nThis can be easily done using simple solidity instead use that.\n\n\n## NC 3: Use the mul functions copied as it is\n`_rmul` and `_mul` function have been copied from following file:\n\nhttps://github.com/makerdao/dss/blob/master/src/jug.sol\n\nBut developers have split it instead for which there is no need to do so, instead use it as or not use it at all. Making changing is susceptible to error\n\n## NC 4 : No need for underflow check in _mul function\nThe codebase from where the following function is copied \n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/nirlin-Q.md", "collected_at": "2026-01-02T18:26:10.417761+00:00", "source_hash": "bf01d79ace6424f2bfef2b8e85ce50ebd1da625d52fcab8ba6851518f3f12b1b", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 1102, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function multiexcall(\n ExCallData[] calldata exCallData\n ) external payable override onlyOwner returns (bytes[] memory results) {\n results = new bytes[](exCallData.length);\n for (uint256 i = 0; i < exCallData.length; ++i) {\n (bool success, bytes memory ret) = address(exCallData[i].target).call{\n value: exCallData[i].value\n }(exCallData[i].data);\n require(success, \"Call Failed\");\n results[i] = ret;\n }\n }", "primary_code_language": "solidity", "primary_code_char_count": 447, "all_code_blocks": "// Code block 1 (solidity):\nfunction multiexcall(\n ExCallData[] calldata exCallData\n ) external payable override onlyOwner returns (bytes[] memory results) {\n results = new bytes[](exCallData.length);\n for (uint256 i = 0; i < exCallData.length; ++i) {\n (bool success, bytes memory ret) = address(exCallData[i].target).call{\n value: exCallData[i].value\n }(exCallData[i].data);\n require(success, \"Call Failed\");\n results[i] = ret;\n }\n }\n\n// Code block 2 (solidity):\nfunction multicall(bytes[] calldata data) public payable override returns (bytes[] memory results) {\n results = new bytes[](data.length);\n for (uint256 i = 0; i < data.length; i++) {\n (bool success, bytes memory result) = address(this).delegatecall(data[i]);\n\n if (!success) {\n // Next 5 lines from https://ethereum.stackexchange.com/a/83577\n if (result.length < 68) revert();\n assembly {\n result := add(result, 0x04)\n }\n revert(abi.decode(result, (string)));\n }\n\n results[i] = result;\n }\n }\n}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function multiexcall(\n ExCallData[] calldata exCallData\n ) external payable override onlyOwner returns (bytes[] memory results) {\n results = new bytes[](exCallData.length);\n for (uint256 i = 0; i < exCallData.length; ++i) {\n (bool success, bytes memory ret) = address(exCallData[i].target).call{\n value: exCallData[i].value\n }(exCallData[i].data);\n require(success, \"Call Failed\");\n results[i] = ret;\n }\n }\n\nfunction multicall(bytes[] calldata data) public payable override returns (bytes[] memory results) {\n results = new bytes[](data.length);\n for (uint256 i = 0; i < data.length; i++) {\n (bool success, bytes memory result) = address(this).delegatecall(data[i]);\n\n if (!success) {\n // Next 5 lines from https://ethereum.stackexchange.com/a/83577\n if (result.length < 68) revert();\n assembly {\n result := add(result, 0x04)\n }\n revert(abi.decode(result, (string)));\n }\n\n results[i] = result;\n }\n }\n}", "github_refs_formatted": "Multicall.sol#L11-L28, RWADynamicOracle.sol#L345-L398, jug.sol", "github_files_list": "Multicall.sol, RWADynamicOracle.sol, jug.sol", "github_refs_count": 3, "vulnerable_code_actual": " function multiexcall(\n ExCallData[] calldata exCallData\n ) external payable override onlyOwner returns (bytes[] memory results) {\n results = new bytes[](exCallData.length);\n for (uint256 i = 0; i < exCallData.length; ++i) {\n (bool success, bytes memory ret) = address(exCallData[i].target).call{\n value: exCallData[i].value\n }(exCallData[i].data);\n require(success, \"Call Failed\");\n results[i] = ret;\n }\n }\n ```\n\nwhich simply returns the `Call Failed` error on !success, but use the uniswap impementation which returns the exact error code. Implementation is as follow:\nhttps://github.com/Uniswap/v3-periphery/blob/b13f9d9d9868b98b765c4f1d8d7f486b00b22488/contracts/base/Multicall.sol#L11-L28\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## NC 2 : No need to use this much assembly in _rpow\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/rwaOracles/RWADynamicOracle.sol#L345-L398\n`_rpow` function us copied from the following repositery,\n\nhttps://github.com/makerdao/dss/blob/master/src/jug.sol\n\nwhich is written in very old solidity version 0.6.12 when there was no native way to take power in solidity but now that is not the case.\n\nSo as the _rpow represents the following formula given by dev:\n\nresult = (prevRangeClose * [(numerator/ ONE) ** (elapsedDays + 1)])\n\nThis can be easily done using simple solidity instead use that.\n\n\n## NC 3: Use the mul functions copied as it is\n`_rmul` and `_mul` function have been copied from following file:\n\nhttps://github.com/makerdao/dss/blob/master/src/jug.sol\n\nBut developers have split it instead for which there is no need to do so, instead use it as or not use it at all. Making changing is susceptible to error\n\n## NC 4 : No need for underflow check in _mul function\nThe codebase from where the following function is copied \n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "02-ai-arena", "title": "Giorgio Q", "severity_raw": "Low", "severity": "low", "description": "## the `MergingPools::getFighterPoints` will revert when input is > 0\n\n## Vulnerability details\n\nThe function attempts to fetch the points of fighters 0-maxId, but can actually only fetch the points of fighter id 0, because the length of the points array is set to 0. So if we input 1 it will revert with array out of bonds error\n\n## Impact\n\nThe impact is not severe as this function is a view function that doesn't impact any logic in the contracts. The function will not display the different fighter points as expected\n\n## POC\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/5b2ab9f9fadd0b91268ff6f22b4ae0fd5b79ec09/src/MergingPool.sol#L207-L211\n\n```solidity\n function getFighterPoints(uint256 maxId) public view returns(uint256[] memory) {\n @> uint256[] memory points = new uint256[](1);\n for (uint256 i = 0; i < maxId; i++) {\n @> points[i] = fighterPoints[i];\n }\n```\n\nTo prove this I slightly modified the `testGetFighterPoints()` in MegingPool.t.sol.\n\n```\n function testGetFighterPoints() public {\n // owner mints a fighter by claiming\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_ownerAddress);\n address owner = _fighterFarmContract.ownerOf(0);\n assertEq(owner, _ownerAddress);\n\n // rankedeBattle contract adds points\n vm.startPrank(address(_rankedBattleContract));\n _mergingPoolContract.addPoints(0, 100);\n _mergingPoolContract.addPoints(1, 100);\n _mergingPoolContract.addPoints(2, 100);\n _mergingPoolContract.addPoints(3, 100);\n _mergingPoolContract.addPoints(4, 100);\n _mergingPoolContract.addPoints(5, 100);\n _mergingPoolContract.addPoints(6, 100);\n _mergingP", "vulnerable_code": " function getFighterPoints(uint256 maxId) public view returns(uint256[] memory) {\n @> uint256[] memory points = new uint256[](1);\n for (uint256 i = 0; i < maxId; i++) {\n @> points[i] = fighterPoints[i];\n }", "fixed_code": " function testGetFighterPoints() public {\n // owner mints a fighter by claiming\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_ownerAddress);\n address owner = _fighterFarmContract.ownerOf(0);\n assertEq(owner, _ownerAddress);\n\n // rankedeBattle contract adds points\n vm.startPrank(address(_rankedBattleContract));\n _mergingPoolContract.addPoints(0, 100);\n _mergingPoolContract.addPoints(1, 100);\n _mergingPoolContract.addPoints(2, 100);\n _mergingPoolContract.addPoints(3, 100);\n _mergingPoolContract.addPoints(4, 100);\n _mergingPoolContract.addPoints(5, 100);\n _mergingPoolContract.addPoints(6, 100);\n _mergingPoolContract.addPoints(7, 100);\n assertEq(_mergingPoolContract.totalPoints(), 100);\n // getFighterPoints for owners fighter\n uint256[] memory fighterPoints = _mergingPoolContract.getFighterPoints(8);\n // assertEq(fighterPoints.length >= 1 && fighterPoints[0] == 100, true);\n // getFighterPoints for non existent fighter\n // vm.expectRevert(stdError.indexOOBError);\n // _mergingPoolContract.getFighterPoints(1000);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/Giorgio-Q.md", "collected_at": "2026-01-02T19:02:25.541963+00:00", "source_hash": "bf1751048bf68480c6197c9cd6d1c3c3a492305f898f927929946e6b975df1bd", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 232, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function getFighterPoints(uint256 maxId) public view returns(uint256[] memory) {\n @> uint256[] memory points = new uint256[](1);\n for (uint256 i = 0; i < maxId; i++) {\n @> points[i] = fighterPoints[i];\n }", "primary_code_language": "solidity", "primary_code_char_count": 232, "all_code_blocks": "// Code block 1 (solidity):\nfunction getFighterPoints(uint256 maxId) public view returns(uint256[] memory) {\n @> uint256[] memory points = new uint256[](1);\n for (uint256 i = 0; i < maxId; i++) {\n @> points[i] = fighterPoints[i];\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function getFighterPoints(uint256 maxId) public view returns(uint256[] memory) {\n @> uint256[] memory points = new uint256[](1);\n for (uint256 i = 0; i < maxId; i++) {\n @> points[i] = fighterPoints[i];\n }", "github_refs_formatted": "MergingPool.sol#L207-L211", "github_files_list": "MergingPool.sol", "github_refs_count": 1, "vulnerable_code_actual": " function getFighterPoints(uint256 maxId) public view returns(uint256[] memory) {\n @> uint256[] memory points = new uint256[](1);\n for (uint256 i = 0; i < maxId; i++) {\n @> points[i] = fighterPoints[i];\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function testGetFighterPoints() public {\n // owner mints a fighter by claiming\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_ownerAddress);\n address owner = _fighterFarmContract.ownerOf(0);\n assertEq(owner, _ownerAddress);\n\n // rankedeBattle contract adds points\n vm.startPrank(address(_rankedBattleContract));\n _mergingPoolContract.addPoints(0, 100);\n _mergingPoolContract.addPoints(1, 100);\n _mergingPoolContract.addPoints(2, 100);\n _mergingPoolContract.addPoints(3, 100);\n _mergingPoolContract.addPoints(4, 100);\n _mergingPoolContract.addPoints(5, 100);\n _mergingPoolContract.addPoints(6, 100);\n _mergingPoolContract.addPoints(7, 100);\n assertEq(_mergingPoolContract.totalPoints(), 100);\n // getFighterPoints for owners fighter\n uint256[] memory fighterPoints = _mergingPoolContract.getFighterPoints(8);\n // assertEq(fighterPoints.length >= 1 && fighterPoints[0] == 100, true);\n // getFighterPoints for non existent fighter\n // vm.expectRevert(stdError.indexOOBError);\n // _mergingPoolContract.getFighterPoints(1000);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "11-kelp", "title": "Rickard Q", "severity_raw": "Medium", "severity": "medium", "description": "## [L-01] The `@dev` NatSpec comment in `UtilLib.checkNonZeroAddress` is incorrect\nThe NatSpec for the `checkNonZeroAddress()` function should indicate that it is a function, not a modifier.\n````diff\nsrc/utils/UtilLib.sol\n- /// @dev zero address check modifier\n+ /// @dev zero address check function\n /// @param address_ address to check\n function checkNonZeroAddress(address address_) internal pure {\n if (address_ == address(0)) revert ZeroAddressNotAllowed();\n }\n````\n## [L-02] Use underscore prefix for internal functions\nFor functions such as [checkNonZeroAddress](https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/utils/UtilLib.sol#L11), it is more readable to have this function be named `_checkNonZeroAddress` so readers know it is an internal function. A similarly opinionated recommendation is to use `s_` for storage variables and `i_` for immutable variables.\n````solidity\n11: function checkNonZeroAddress(address address_) internal pure {\n12: if (address_ == address(0)) revert ZeroAddressNotAllowed();\n13: }\n````\n[https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/utils/UtilLib.sol#L11-L13](https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/utils/UtilLib.sol#L11-L13)", "vulnerable_code": "## [L-02] Use underscore prefix for internal functions\nFor functions such as [checkNonZeroAddress](https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/utils/UtilLib.sol#L11), it is more readable to have this function be named `_checkNonZeroAddress` so readers know it is an internal function. A similarly opinionated recommendation is to use `s_` for storage variables and `i_` for immutable variables.", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/Rickard-Q.md", "collected_at": "2026-01-02T18:27:36.746358+00:00", "source_hash": "bf39b29c5e9598cb687b864511eccff59ce8674ceaca100f9ff0024677689db3", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 434, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "src/utils/UtilLib.sol\n- /// @dev zero address check modifier\n+ /// @dev zero address check function\n /// @param address_ address to check\n function checkNonZeroAddress(address address_) internal pure {\n if (address_ == address(0)) revert ZeroAddressNotAllowed();\n }", "primary_code_language": "diff", "primary_code_char_count": 285, "all_code_blocks": "// Code block 1 (diff):\nsrc/utils/UtilLib.sol\n- /// @dev zero address check modifier\n+ /// @dev zero address check function\n /// @param address_ address to check\n function checkNonZeroAddress(address address_) internal pure {\n if (address_ == address(0)) revert ZeroAddressNotAllowed();\n }\n\n// Code block 2 (solidity):\n11: function checkNonZeroAddress(address address_) internal pure {\n12: if (address_ == address(0)) revert ZeroAddressNotAllowed();\n13: }", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "src/utils/UtilLib.sol\n- /// @dev zero address check modifier\n+ /// @dev zero address check function\n /// @param address_ address to check\n function checkNonZeroAddress(address address_) internal pure {\n if (address_ == address(0)) revert ZeroAddressNotAllowed();\n }", "solidity_code": "11: function checkNonZeroAddress(address address_) internal pure {\n12: if (address_ == address(0)) revert ZeroAddressNotAllowed();\n13: }", "github_refs_formatted": "UtilLib.sol#L11", "github_files_list": "UtilLib.sol", "github_refs_count": 1, "vulnerable_code_actual": "## [L-02] Use underscore prefix for internal functions\nFor functions such as [checkNonZeroAddress](https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/utils/UtilLib.sol#L11), it is more readable to have this function be named `_checkNonZeroAddress` so readers know it is an internal function. A similarly opinionated recommendation is to use `s_` for storage variables and `i_` for immutable variables.", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 8.69} {"source": "c4", "protocol": "01-salty", "title": "ZanyBonzy Q", "severity_raw": "High", "severity": "high", "description": "\n# 1. Consider checking for similarities in current and proposed wallets\nLinks to affected code *\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/ManagedWallet.sol#L42\n## Impact\nImproves decentralization, prevents loss of funds needed to accept proposals in case same wallet updates (Updating wallets to the same addresses requires sending ether to accept, or else new wallet proposals cannot be made). \n\n## Recommended Mitigation Steps\nConsider including checks\nproposedMainWallet != proposedConfirmationWallet\nmainWalllet != proposedMainWallet\nconfirmationWallet != proposedConfirmationWallet\n\n***\n\n\n# 2. Protocol is highly vulnerable to WBTC pausable property. \nLinks to affected code *\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/stable/CollateralAndLiquidity.sol#L70\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/stable/CollateralAndLiquidity.sol#L140\nhttps://etherscan.io/token/0x2260fac5e5542a773aa44fbcfedf7c193bc2c599#code\n## Impact\n\nThe protocol relies in WBTC as one of the main collateral tokens for the protocol. Users looking to repay their USDS debt, or improve their collateral share, might need to deposit more WBTC/WETH collateral. \n\nThis process fails if WBTC is paused as transfers will not be executable thus causing such borrowers to fall below the required liquidation threshold.\n\nAt the other end, liquidators will also not be able to liquidate these users as the wbtc liquidity removal from the pools will fail. This will cause a host of bad debt to be accrued up in the protocol.\n\nWhenever the token gets unpaused, liquidators using MEV bots can also frontrun the borrowers' repayments leading to a host of unfair liquidations. \n\n## Recommended Mitigation Steps\nRecommend introducing support for other types of tokens, to serve as collateral for USDS in the `CollateralAndLiquidity` contract. A more standard ERC20 token can be us", "vulnerable_code": "// Convert the 8 decimals from the Chainlink price to 18 decimals\n\t\treturn uint256(price) * 10**10;", "fixed_code": "", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/ZanyBonzy-Q.md", "collected_at": "2026-01-02T19:01:32.270466+00:00", "source_hash": "bf774163efac0b5620186c41375ee4c826f9fab9ac38d8e92850e908416bb437", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ManagedWallet.sol#L42, CollateralAndLiquidity.sol#L70, CollateralAndLiquidity.sol#L140", "github_files_list": "CollateralAndLiquidity.sol, ManagedWallet.sol", "github_refs_count": 3, "vulnerable_code_actual": "// Convert the 8 decimals from the Chainlink price to 18 decimals\n\t\treturn uint256(price) * 10**10;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "02-ai-arena", "title": "Nyxaris G", "severity_raw": "Gas", "severity": "gas", "description": "## Title: \nPotential Gas Optimization in [`createPhysicalAttributes`](https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/AiArenaHelper.sol#L83) Function.\n\n## Description: \nThe [`createPhysicalAttributes`](https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/AiArenaHelper.sol#L83) function currently uses a dynamic array to store attribute probability indexes. While this does not incur gas costs when called externally due to its view modifier, it is a point of gas inefficiency because the function is used internally by state-changing functions.\n\n## Recommendation:\n Consider refactoring the function to use a fixed-size array if the maximum size of the array is known and unchanging. This would preemptively optimize the function for any future internal use within transactions, potentially reducing gas costs.\n\n```javascript\nfinalAttributeProbabilityIndexes\nuint256[6] memory finalAttributeProbabilityIndexes;\n```", "vulnerable_code": "finalAttributeProbabilityIndexes\nuint256[6] memory finalAttributeProbabilityIndexes;", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/Nyxaris-G.md", "collected_at": "2026-01-02T19:02:36.714692+00:00", "source_hash": "bf8bf5569a9f49b1e1006eeeb59999b32cee06aa3d640e903c3f92f81546bd98", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 84, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "finalAttributeProbabilityIndexes\nuint256[6] memory finalAttributeProbabilityIndexes;", "primary_code_language": "javascript", "primary_code_char_count": 84, "all_code_blocks": "// Code block 1 (javascript):\nfinalAttributeProbabilityIndexes\nuint256[6] memory finalAttributeProbabilityIndexes;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "AiArenaHelper.sol#L83", "github_files_list": "AiArenaHelper.sol", "github_refs_count": 1, "vulnerable_code_actual": "finalAttributeProbabilityIndexes\nuint256[6] memory finalAttributeProbabilityIndexes;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.88} {"source": "c4", "protocol": "08-dopex", "title": "0x11singh99 G", "severity_raw": "High", "severity": "high", "description": "## Gas Optimizations\n| Number |Issue|Instances|\n|-|:-|:-:|\n| [[G-01](#g-01-structs-can-be-packed-into-fewer-storage-slots)] | `Structs` can be packed into fewer storage slots. | 1 | \n| [[G-02](#g-02-cache-state-variables-outside-of-loop-to-avoid-readingwriting-storage-on-every-iteration)] | Cache `state variables` outside of loop to avoid reading/writing storage on every iteration. | 1 |\n| [[G-03](#g-03-using-storage-instead-of-memory-for-structsarrays-saves-gas)] | Using `storage` instead of memory for structs/arrays saves gas. | 3 |\n| [[G-04](#g-04-use-calldata-instead-of-memory-for-function-arguments-that-do-not-get-mutated)] | Use `calldata` instead of memory for function arguments that do not get mutated. | 3 |\n| [[G-05](#g-05-state-variables-can-be-cached-instead-of-re-reading-them-from-storage)] | State variables can be cached instead of re-reading them from storage. | 17 |\n| [[G-06](#g-06-multiple-accesses-of-a-mappingarray-should-use-a-local-variable-cache)] | Multiple accesses of a mapping/array should use a local variable cache. | 5 |\n| [[G-07](#g-07-state-variables-only-set-during-construction-should-be-declared-constant)]| State variables only set during construction should be declared `constant`. | 2 |\n| [[G-08](#g-08-state-variables-can-be-packed-into-fewer-storage-slots)] | State variables can be `packed` into fewer storage slots. | 3 |\n| [[G-09](#g-09-use-constants-instead-of-typeuintxmax)] | Use `constants` instead of type(uintx).max. | 17 |\n| [[G-10](#g-10-use-hardcode-address-instead-addressthis)] | Use `hardcode address` instead address(this). | 40 |\n| [[G-11](#g-11-do-not-calculate-constants-to-save-gas)] | Do not calculate `constants` to save gas. | 2 |\n| [[G-12](#g-12-amounts-should-be-checked-for-0-before-calling-a-transfer)] | Amounts should be checked for 0 before calling a transfer. | 3 |\n| [[G-13](#g-13-do-not-initialize-state-variables-with-their-default-value)] | Do not initialize state variables with their default value. | 1 |\n| [[G-1", "vulnerable_code": "[40-44](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/decaying-bonds/RdpxDecayingBonds.sol#L40C2-L44C4)\n", "fixed_code": "## [G-02] Cache state variables outside of loop to avoid reading/writing storage on every iteration.\n\nReading from storage should always try to be avoided within loops. In the following instances, we are able to cache state variables outside of the loop to save a Gwarmaccess (100 gas) per loop iteration. In addition, update the storage variable outside the loop to save 1 SSTORE per loop iteration.\n\n**Note: These are instances missed by the Bot Race.**\n\n**_1 Instances - 1 File_**\n\n### Cache `totalActiveOptions` outside of the loop to save 1 SSTORE and 1 SLOAD per iteration, update it's state variable after the loop ended.\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/0x11singh99-G.md", "collected_at": "2026-01-02T18:24:08.760261+00:00", "source_hash": "bf94abeeff6d9ddfb3d0408e5ef96734897dfc478fd2d1073bd37d7a39366762", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "RdpxDecayingBonds.sol#L40-L2", "github_files_list": "RdpxDecayingBonds.sol", "github_refs_count": 1, "vulnerable_code_actual": "[40-44](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/decaying-bonds/RdpxDecayingBonds.sol#L40C2-L44C4)\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## [G-02] Cache state variables outside of loop to avoid reading/writing storage on every iteration.\n\nReading from storage should always try to be avoided within loops. In the following instances, we are able to cache state variables outside of the loop to save a Gwarmaccess (100 gas) per loop iteration. In addition, update the storage variable outside the loop to save 1 SSTORE per loop iteration.\n\n**Note: These are instances missed by the Bot Race.**\n\n**_1 Instances - 1 File_**\n\n### Cache `totalActiveOptions` outside of the loop to save 1 SSTORE and 1 SLOAD per iteration, update it's state variable after the loop ended.\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "08-dopex", "title": "DavidGiladi Q", "severity_raw": "Critical", "severity": "critical", "description": "\n### Low Issues\n|Title|Issue|Instances|\n|-|:-|:-:|\n|[L-1] Burn functions must be protected with a modifier | [Burn functions must be protected with a modifier](#burn-functions-must-be-protected-with-a-modifier) | 1 |\n|[L-2] Missing contract-existence checks before low-level calls | [Missing contract-existence checks before low-level calls](#missing-contract-existence-checks-before-low-level-calls) | 1 |\n|[L-3] Direct `supportsInterface()` calls | [Direct `supportsInterface()` calls](#direct-supportsinterface-calls) | 3 |\n|[L-4] Fee/Rate Caps Missing in Smart Contracts | [Fee/Rate Caps Missing in Smart Contracts](#feerate-caps-missing-in-smart-contracts) | 1 |\n|[L-5] Reentrancy vulnerabilities | [Reentrancy vulnerabilities](#reentrancy-vulnerabilities) | 18 |\n|[L-6] Solmate SafeTransferLib Usage Detection | [Solmate SafeTransferLib Usage Detection](#solmate-safetransferlib-usage-detection) | 1 |\n|[L-7] Unsafe Cast Unsigned to Signed | [Unsafe Cast Unsigned to Signed](#unsafe-cast-unsigned-to-signed) | 2 |\n\nTotal: 7 issues\n\n### Non-Critical Issues\n|Title|Issue|Instances|\n|-|:-|:-:|\n|[N-1] Do not calculate constants | [Do not calculate constants](#do-not-calculate-constants) | 2 |\n|[N-2] Contract Ordering Violation Style Guide | [Contract Ordering Violation Style Guide](#contract-ordering-violation-style-guide) | 1 |\n|[N-3] Control structures do not follow the Solidity Style Guide | [Control structures do not follow the Solidity Style Guide](#control-structures-do-not-follow-the-solidity-style-guide) | 29 |\n|[N-4] Avoid double casting | [Avoid double casting](#avoid-double-casting) | 2 |\n|[N-5] Consider move Msg.sender checks to modifier | [Consider move Msg.sender checks to modifier](#consider-move-msgsender-checks-to-modifier) | 1 |\n|[N-6] Redundant Inheritance | [Redundant Inheritance](#redundant-inheritance) | 4 |\n|[N-7] Should Declare as View | [Should Declare as View](#should-declare-as-view) | 6 |\n|[N-8] Variable names too similar | [Variable names too similar](", "vulnerable_code": "Line: 98 (bool success, ) = to.call{ value: amount, gas: gas }(\"\")", "fixed_code": "Line: 197 rdpxFeePercentage = _rdpxFeePercentage", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/DavidGiladi-Q.md", "collected_at": "2026-01-02T18:24:35.316794+00:00", "source_hash": "c01436ced6d1e8e942bbe32758e663fb7f0428365846357b8a200a54e90a8f3f", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "Line: 98 (bool success, ) = to.call{ value: amount, gas: gas }(\"\")", "has_vulnerable_code_snippet": true, "fixed_code_actual": "Line: 197 rdpxFeePercentage = _rdpxFeePercentage", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-biconomy", "title": "csanuragjain Q", "severity_raw": "Medium", "severity": "medium", "description": "## Funds can stuck\n\nContract:\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/StakeManager.sol#L35\n\nIssue:\nFunds can stuck if withdraw address is contract itself\n\nPOC:\n\n1. User calls `withdrawTo` function with `withdrawAddress` as StakeManager.sol contract itself\n\n```\nfunction withdrawTo(address payable withdrawAddress, uint256 withdrawAmount) external {\n DepositInfo storage info = deposits[msg.sender];\n require(withdrawAmount <= info.deposit, \"Withdraw amount too large\");\n info.deposit = uint112(info.deposit - withdrawAmount);\n emit Withdrawn(msg.sender, withdrawAddress, withdrawAmount);\n (bool success,) = withdrawAddress.call{value : withdrawAmount}(\"\");\n require(success, \"failed to withdraw\");\n }\n```\n\n2. This transfer all User deposited ETH to the contract which process it via `receive` function\n\n```\nreceive() external payable {\n depositTo(msg.sender);\n }\n```\n\n3. Since in this case msg.sender is contract itself so deposit is made for StakeManager.sol contract\n\n4. Now there is no way to withdraw these funds\n\nRecommendation:\nKindly revise the receive function to disallow deposit by contract itself\n\n```\nreceive() external payable {\nrequire(msg.sender!=address(this), \"Incorrect sender\");\n depositTo(msg.sender);\n }\n```\n\n## Stake condition can be revised to allow type(uint112).max\n\nContract:\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/StakeManager.sol#L65\n\nIssue:\nIt seems that currently Staking amount is capped to `type(uint112).max` even though deposit cap is set to `type(uint112).max`. This means the Staking cap could be revised to also allow `type(uint112).max`\n\nRecommendation:\nKindly revise the `addStake` function\n\n```\nfunction addStake(uint32 _unstakeDelaySec) public payable {\n...\n require(stake <= type(uint112).max, \"stake overflow\");\n...\n}\n```\n\n## No way", "vulnerable_code": "function withdrawTo(address payable withdrawAddress, uint256 withdrawAmount) external {\n DepositInfo storage info = deposits[msg.sender];\n require(withdrawAmount <= info.deposit, \"Withdraw amount too large\");\n info.deposit = uint112(info.deposit - withdrawAmount);\n emit Withdrawn(msg.sender, withdrawAddress, withdrawAmount);\n (bool success,) = withdrawAddress.call{value : withdrawAmount}(\"\");\n require(success, \"failed to withdraw\");\n }", "fixed_code": "receive() external payable {\n depositTo(msg.sender);\n }", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/csanuragjain-Q.md", "collected_at": "2026-01-02T18:13:39.121643+00:00", "source_hash": "c01fe91f10eedfeca917ecfa020199586660903d6aa9ba0601fb9a3416187055", "code_block_count": 4, "solidity_block_count": 0, "total_code_chars": 802, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function withdrawTo(address payable withdrawAddress, uint256 withdrawAmount) external {\n DepositInfo storage info = deposits[msg.sender];\n require(withdrawAmount <= info.deposit, \"Withdraw amount too large\");\n info.deposit = uint112(info.deposit - withdrawAmount);\n emit Withdrawn(msg.sender, withdrawAddress, withdrawAmount);\n (bool success,) = withdrawAddress.call{value : withdrawAmount}(\"\");\n require(success, \"failed to withdraw\");\n }", "primary_code_language": "unknown", "primary_code_char_count": 484, "all_code_blocks": "// Code block 1 (unknown):\nfunction withdrawTo(address payable withdrawAddress, uint256 withdrawAmount) external {\n DepositInfo storage info = deposits[msg.sender];\n require(withdrawAmount <= info.deposit, \"Withdraw amount too large\");\n info.deposit = uint112(info.deposit - withdrawAmount);\n emit Withdrawn(msg.sender, withdrawAddress, withdrawAmount);\n (bool success,) = withdrawAddress.call{value : withdrawAmount}(\"\");\n require(success, \"failed to withdraw\");\n }\n\n// Code block 2 (unknown):\nreceive() external payable {\n depositTo(msg.sender);\n }\n\n// Code block 3 (unknown):\nreceive() external payable {\nrequire(msg.sender!=address(this), \"Incorrect sender\");\n depositTo(msg.sender);\n }\n\n// Code block 4 (unknown):\nfunction addStake(uint32 _unstakeDelaySec) public payable {\n...\n require(stake <= type(uint112).max, \"stake overflow\");\n...\n}", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "StakeManager.sol#L35, StakeManager.sol#L65", "github_files_list": "StakeManager.sol", "github_refs_count": 2, "vulnerable_code_actual": "function withdrawTo(address payable withdrawAddress, uint256 withdrawAmount) external {\n DepositInfo storage info = deposits[msg.sender];\n require(withdrawAmount <= info.deposit, \"Withdraw amount too large\");\n info.deposit = uint112(info.deposit - withdrawAmount);\n emit Withdrawn(msg.sender, withdrawAddress, withdrawAmount);\n (bool success,) = withdrawAddress.call{value : withdrawAmount}(\"\");\n require(success, \"failed to withdraw\");\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "receive() external payable {\n depositTo(msg.sender);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "06-lybra", "title": "Timenov Q", "severity_raw": "Unknown", "severity": "unknown", "description": "# Lybra Finance report by Timenov\n\n## Summary\nI-01 Empty lines should be removed for better code readability.\nI-02 Incorrect naming of interfaces.\nI-03 Incorrect naming of modifiers.\nI-04 Incorrect naming of event.\nI-05 Incorrect naming of function.\nI-06 Wrong contract address in comment.\nI-07 Use functions instead of modifiers.\n\n### [I-01] Empty lines should be removed for better code readability.\n*There are 7 instances of this issue.*\n\nIn the `LybraGovernance` contract there are some places where unnecessary empty lines are left. They should be removed for better code readability.\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/governance/LybraGovernance.sol#L25C5-L25C5\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/governance/LybraGovernance.sol#L34-L36\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/governance/LybraGovernance.sol#L54C1-L54C1\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/governance/LybraGovernance.sol#L77C7-L77C7\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/governance/LybraGovernance.sol#L85\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/governance/LybraGovernance.sol#L91C9-L91C9\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/governance/LybraGovernance.sol#L204-L205\n\n### [I-02] Incorrect naming of interfaces.\n*There is 1 instance of this issue.*\n\nSome of the interfaces do not use to correct naming convention for interfaces. I have included only 1, because it is the only one is scope, however there is also one with wrong naming in `contracts/lybra/interfaces/Iconfigurator`\n\n```solidity\nFile: contracts/lybra/pools/LybraStETHVault.sol\n\n8: int", "vulnerable_code": "File: contracts/lybra/pools/LybraStETHVault.sol\n\n8: interface Ilido // should be ILido", "fixed_code": "File: contracts/lybra/token/EUSD.sol\n\n83: modifier MintPaused() // should be mintPaused()", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/Timenov-Q.md", "collected_at": "2026-01-02T18:22:48.077270+00:00", "source_hash": "c03c686c4c9a81754305804d66992bff3816acc2c36e73380129033cf1fd97b4", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 7, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LybraGovernance.sol#L25-L5, LybraGovernance.sol#L34-L36, LybraGovernance.sol#L54-L1, LybraGovernance.sol#L77-L7, LybraGovernance.sol#L85, LybraGovernance.sol#L91-L9, LybraGovernance.sol#L204-L205", "github_files_list": "LybraGovernance.sol", "github_refs_count": 7, "vulnerable_code_actual": "File: contracts/lybra/pools/LybraStETHVault.sol\n\n8: interface Ilido // should be ILido", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/lybra/token/EUSD.sol\n\n83: modifier MintPaused() // should be mintPaused()", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "11-kelp", "title": "invitedtea Q", "severity_raw": "High", "severity": "high", "description": "# L1. Dynamic array used in `LRTConfig.sol`\n## Title\nUnbounded loops used in `LRTConfig.sol`\n## Impact\nDescription: The `getSupportedAssetList` function in the provided smart contract returns a dynamic array containing the list of supported assets. This function currently does not limit the number of assets it can return. In scenarios where the number of supported assets grows large, calling this function could require more gas than is available in a block. This situation would make the function fail and could potentially make parts of the contract unusable or cause issues for interfaces and other contracts that depend on this data.\n\nLine Number: Not directly present but implied in functions that may iterate over `getSupportedAssetList`.\nRecommended Fix: Consider implementing a pattern to limit the size of this list or handle large lists in a gas-efficient manner. https://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTConfig.sol#L135\n```\nfunction getSupportedAssetList() external view override returns (address[] memory) {\n return supportedAssetList;\n }\n```\n\n## Proof of Concept\nWith amount array length of 15 and above, it is highly likely to hit the gasLimit.\n## Tools Used\nManual Review\n\n## Recommended Mitigation Steps\nPagination: Modify the getSupportedAssetList function to return a subset of the supported assets based on pagination parameters (e.g., start index and count). This approach allows callers to retrieve all assets in smaller, manageable chunks.\n\nExample Implementation:\n\n```solidity\nfunction getSupportedAssetList(uint start, uint count) external view returns (address[] memory) {\n uint totalAssets = supportedAssetList.length;\n if (start >= totalAssets) {\n return new address[](0);\n }\n\n uint end = start + count;\n if (end > totalAssets) {\n end = totalAssets;\n }\n\n address[] memory assets = new address[](end - start);\n for (uint i = start; i < end; i++) {\n assets[i - start] = supportedAssetList[i];\n ", "vulnerable_code": "function getSupportedAssetList() external view override returns (address[] memory) {\n return supportedAssetList;\n }", "fixed_code": "function getSupportedAssetList(uint start, uint count) external view returns (address[] memory) {\n uint totalAssets = supportedAssetList.length;\n if (start >= totalAssets) {\n return new address[](0);\n }\n\n uint end = start + count;\n if (end > totalAssets) {\n end = totalAssets;\n }\n\n address[] memory assets = new address[](end - start);\n for (uint i = start; i < end; i++) {\n assets[i - start] = supportedAssetList[i];\n }\n return assets;\n}\n\n\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/invitedtea-Q.md", "collected_at": "2026-01-02T18:28:09.994279+00:00", "source_hash": "c08fc6b7a03547edee4b9c94b016c515f596dd04269aef4bb9ca901ff2e88c63", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 125, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function getSupportedAssetList() external view override returns (address[] memory) {\n return supportedAssetList;\n }", "primary_code_language": "unknown", "primary_code_char_count": 125, "all_code_blocks": "// Code block 1 (unknown):\nfunction getSupportedAssetList() external view override returns (address[] memory) {\n return supportedAssetList;\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LRTConfig.sol#L135", "github_files_list": "LRTConfig.sol", "github_refs_count": 1, "vulnerable_code_actual": "function getSupportedAssetList() external view override returns (address[] memory) {\n return supportedAssetList;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function getSupportedAssetList(uint start, uint count) external view returns (address[] memory) {\n uint totalAssets = supportedAssetList.length;\n if (start >= totalAssets) {\n return new address[](0);\n }\n\n uint end = start + count;\n if (end > totalAssets) {\n end = totalAssets;\n }\n\n address[] memory assets = new address[](end - start);\n for (uint i = start; i < end; i++) {\n assets[i - start] = supportedAssetList[i];\n }\n return assets;\n}\n\n\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "09-ondo", "title": "tofunmi Q", "severity_raw": "Low", "severity": "low", "description": "(1) :- `transferShares` implemented but `transferSharesFrom` isn't like lido's stEth in rUSDY.sol https://etherscan.io/address/0x17144556fd3424edc8fc8a4c940b2d04936d17eb#code#F27#L353\n-> this would make $rUSDY's shares easy to use in dapps in the future, that's why there's is a _transferShares() internal function in the first place \n```solidity\n function transferSharesFrom(\n address _sender, address _recipient, uint256 _sharesAmount\n ) external returns (bool) {\n uint256 currentAllowance = allowances[_sender][msg.sender];\n require(currentAllowance >= _amount, \"TRANSFER_AMOUNT_EXCEEDS_ALLOWANCE\");\n _transferShares(_sender, _recipient, _sharesAmount);\n emit TransferShares(_sender, _recipient, _sharesAmount);\n uint256 tokensAmount = getRUSDYByShares(_sharesAmount);\n emit Transfer(msg.sender, _recipient, tokensAmount);\n _approve(_sender, msg.sender, currentAllowance - _amount);\n return true;\n }\n```", "vulnerable_code": " function transferSharesFrom(\n address _sender, address _recipient, uint256 _sharesAmount\n ) external returns (bool) {\n uint256 currentAllowance = allowances[_sender][msg.sender];\n require(currentAllowance >= _amount, \"TRANSFER_AMOUNT_EXCEEDS_ALLOWANCE\");\n _transferShares(_sender, _recipient, _sharesAmount);\n emit TransferShares(_sender, _recipient, _sharesAmount);\n uint256 tokensAmount = getRUSDYByShares(_sharesAmount);\n emit Transfer(msg.sender, _recipient, tokensAmount);\n _approve(_sender, msg.sender, currentAllowance - _amount);\n return true;\n }", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/tofunmi-Q.md", "collected_at": "2026-01-02T18:26:18.030977+00:00", "source_hash": "c0f3a45dff5fbb1565ec43e9c7f7a986c209ed26ab0f47ba81df5fe5aa97cf32", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 623, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function transferSharesFrom(\n address _sender, address _recipient, uint256 _sharesAmount\n ) external returns (bool) {\n uint256 currentAllowance = allowances[_sender][msg.sender];\n require(currentAllowance >= _amount, \"TRANSFER_AMOUNT_EXCEEDS_ALLOWANCE\");\n _transferShares(_sender, _recipient, _sharesAmount);\n emit TransferShares(_sender, _recipient, _sharesAmount);\n uint256 tokensAmount = getRUSDYByShares(_sharesAmount);\n emit Transfer(msg.sender, _recipient, tokensAmount);\n _approve(_sender, msg.sender, currentAllowance - _amount);\n return true;\n }", "primary_code_language": "solidity", "primary_code_char_count": 623, "all_code_blocks": "// Code block 1 (solidity):\nfunction transferSharesFrom(\n address _sender, address _recipient, uint256 _sharesAmount\n ) external returns (bool) {\n uint256 currentAllowance = allowances[_sender][msg.sender];\n require(currentAllowance >= _amount, \"TRANSFER_AMOUNT_EXCEEDS_ALLOWANCE\");\n _transferShares(_sender, _recipient, _sharesAmount);\n emit TransferShares(_sender, _recipient, _sharesAmount);\n uint256 tokensAmount = getRUSDYByShares(_sharesAmount);\n emit Transfer(msg.sender, _recipient, tokensAmount);\n _approve(_sender, msg.sender, currentAllowance - _amount);\n return true;\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function transferSharesFrom(\n address _sender, address _recipient, uint256 _sharesAmount\n ) external returns (bool) {\n uint256 currentAllowance = allowances[_sender][msg.sender];\n require(currentAllowance >= _amount, \"TRANSFER_AMOUNT_EXCEEDS_ALLOWANCE\");\n _transferShares(_sender, _recipient, _sharesAmount);\n emit TransferShares(_sender, _recipient, _sharesAmount);\n uint256 tokensAmount = getRUSDYByShares(_sharesAmount);\n emit Transfer(msg.sender, _recipient, tokensAmount);\n _approve(_sender, msg.sender, currentAllowance - _amount);\n return true;\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function transferSharesFrom(\n address _sender, address _recipient, uint256 _sharesAmount\n ) external returns (bool) {\n uint256 currentAllowance = allowances[_sender][msg.sender];\n require(currentAllowance >= _amount, \"TRANSFER_AMOUNT_EXCEEDS_ALLOWANCE\");\n _transferShares(_sender, _recipient, _sharesAmount);\n emit TransferShares(_sender, _recipient, _sharesAmount);\n uint256 tokensAmount = getRUSDYByShares(_sharesAmount);\n emit Transfer(msg.sender, _recipient, tokensAmount);\n _approve(_sender, msg.sender, currentAllowance - _amount);\n return true;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 3.96} {"source": "c4", "protocol": "09-ondo", "title": "0x6980 Q", "severity_raw": "Critical", "severity": "critical", "description": "# Report\n\n## Low Risk Issues\n\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [L-01](#L-01) | Using zero as a parameter | 1 | \n| [L-02](#L-02) | Re-org attack | 3 | \n| [L-03](#L-03) | `require()` should be used instead of `assert()` | 1 | \n| [L-04](#L-04) | TransferOwnership Should Be Two Step | 2 | \n\nTotal: 2 instances over 2 issues.\n\n## Non-critical Issues\n\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [N-01](#N-01) | Adding a `return` statement when the function defines a named return variable, is redundant | 1 | \n| [N-02](#N-02) | `assembly` blocks should have extensive comments | 1 | \n| [N-03](#N-03) | Do not calculate constants | 9 | \n| [N-04](#N-04) | Function can be declared as `pure` | 1 | \n| [N-05](#N-05) | Named imports of parent contracts are missing | 20 | \n| [N-06](#N-06) | Not using the named return variables anywhere in the function is confusing | 4 | \n| [N-07](#N-07) | Strings should use double quotes rather than single quotes | 9 | \n| [N-08](#N-08) | Some contract names don't follow the Solidity naming conventions | 2 | \n| [N-09](#N-09) | Unused structs | 2 | \n| [N-10](#N-10) | Functions not used internally could be marked external | 14 | \n| [N-11](#N-11) | OpenZeppelin libraries should be upgraded to a newer version | 13 | \n| [N-12](#N-12) | Non-usage of specific imports | 32 | \n\nTotal: 841 instances over 94 issues.\n\n## Low Risk Issues\n\n### [L-01] Using zero as a parameter\nTaking `0` as a valid argument in Solidity without checks can lead to severe security issues. A historical example is the infamous `0x0` address bug where numerous tokens were lost. This happens because `0` can be interpreted as an uninitialized `address`, leading to transfers to the `0x0` `address`, effectively burning tokens. Moreover, `0` as a denominator in division operations would cause a runtime exception. It's also often indicative of a logical error in the caller's code. It's important to always validate input and handle edge cases like `0` appropriately. Use `require()` state", "vulnerable_code": "File: contracts/bridge/DestinationBridge.sol\n\n/// @audit 1 parameter\n139: new address[](0)\n", "fixed_code": "File: contracts/usdy/rUSDYFactory.sol\n\n82: rUSDYImplementation = new rUSDY();\n\n83: rUSDYProxyAdmin = new ProxyAdmin();\n\n84: rUSDYProxy = new TokenProxy(\n85: address(rUSDYImplementation),\n86: address(rUSDYProxyAdmin),\n87: \"\"\n88: );\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/0x6980-Q.md", "collected_at": "2026-01-02T18:25:12.583417+00:00", "source_hash": "c10b7cfab06ec670496259e6ba666ad727eda18742d29493d103a238b4f9305b", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: contracts/bridge/DestinationBridge.sol\n\n/// @audit 1 parameter\n139: new address[](0)\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/usdy/rUSDYFactory.sol\n\n82: rUSDYImplementation = new rUSDY();\n\n83: rUSDYProxyAdmin = new ProxyAdmin();\n\n84: rUSDYProxy = new TokenProxy(\n85: address(rUSDYImplementation),\n86: address(rUSDYProxyAdmin),\n87: \"\"\n88: );\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-revert-lend", "title": "slvDev Q", "severity_raw": "Critical", "severity": "critical", "description": "## Low Findings\n\n| | Issue | Instances |\n|----|-------|:---------:|\n| [L-01] | Centralization risk for privileged functions | 15 |\n| [L-02] | Subtraction may underflow if multiplication is too large | 1 |\n| [L-03] | `decimals()` is not part of the ERC20 standard | 4 |\n| [L-04] | `type(uint256).max` Approvals Aren't Universal in All Tokens | 2 |\n| [L-05] | Some tokens may revert on large transfers | 23 |\n| [L-06] | Code does not follow the best practice of check-effects-interaction | 5 |\n| [L-07] | Use `abi.encodeCall()` instead of `abi.encodeWithSignature()`/`abi.encodeWithSelector()` | 2 |\n| [L-08] | `internal/private` Function calls within for loops | 2 |\n| [L-09] | Upgradable contracts not taken into account | 94 |\n| [L-10] | Lack of index element validation in external/public function | 31 |\n| [L-11] | Consider checking that transfer to `address(this)` is disabled | 1 |\n| [L-12] | Use `forceApprove/safeIncreaseAllowance` from SafeERC20 instead of `approve/safeApprove` | 7 |\n| [L-13] | Potential Gas Griefing Due to Non-Handling of Return Data in External Calls | 3 |\n| [L-14] | Low Level Calls to Custom Addresses | 3 |\n| [L-15] | Prevent Division by Zero | 4 |\n| [L-16] | Solidity version 0.8.20 may not work on other chains due to `PUSH0` | 11 |\n| [L-17] | Missing checks for `address(0x0)` when updating address state variables | 2 |\n| [L-18] | Lack of Parameter Validation in Constructor/Initializer | 10 |\n| [L-19] | Owner can renounce Ownership | 4 |\n| [L-20] | State variables are not limited to a reasonable range | 11 |\n| [L-21] | Missing Contract-Existence Checks Before Low-Level Calls | 3 |\n| [L-22] | Events may be emitted out of order due to reentrancy | 13 |\n| [L-23] | External calls in an un-bounded `for-`loop may result in a DOS | 1 |\n| [L-24] | For loops in public or external functions should be avoided due to high gas costs and possible DOS | 2 |\n| [L-25] | Critical functions should be a two step procedure | 16 |\n| [L-26] | Deprecated Function `safeAppr", "vulnerable_code": "File: src/V3Vault.sol\n\n765: function withdrawReserves(uint256 amount, address receiver) external onlyOwner\n788: function setTransformer(address transformer, bool active) external onlyOwner\n837: function setReserveFactor(uint32 _reserveFactorX32) external onlyOwner\n844: function setReserveProtectionFactor(uint32 _reserveProtectionFactorX32) external onlyOwner\n856: function setTokenConfig(address token, uint32 collateralFactorX32, uint32 collateralValueLimitFactorX32)\n external\n onlyOwner\n870: function setEmergencyAdmin(address admin) external onlyOwner", "fixed_code": "File: src/V3Oracle.sol\n\n185: function setMaxPoolPriceDifference(uint16 _maxPoolPriceDifference) external onlyOwner\n201: function setTokenConfig(\n address token,\n AggregatorV3Interface feed,\n uint32 maxFeedAge,\n IUniswapV3Pool pool,\n uint32 twapSeconds,\n Mode mode,\n uint16 maxDifference\n ) external onlyOwner\n265: function setEmergencyAdmin(address admin) external onlyOwner", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/slvDev-Q.md", "collected_at": "2026-01-02T19:03:18.229967+00:00", "source_hash": "c11224504db1f69241913106a7b071ef68bffcf66734d16d2effa4f3ff32c999", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: src/V3Vault.sol\n\n765: function withdrawReserves(uint256 amount, address receiver) external onlyOwner\n788: function setTransformer(address transformer, bool active) external onlyOwner\n837: function setReserveFactor(uint32 _reserveFactorX32) external onlyOwner\n844: function setReserveProtectionFactor(uint32 _reserveProtectionFactorX32) external onlyOwner\n856: function setTokenConfig(address token, uint32 collateralFactorX32, uint32 collateralValueLimitFactorX32)\n external\n onlyOwner\n870: function setEmergencyAdmin(address admin) external onlyOwner", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: src/V3Oracle.sol\n\n185: function setMaxPoolPriceDifference(uint16 _maxPoolPriceDifference) external onlyOwner\n201: function setTokenConfig(\n address token,\n AggregatorV3Interface feed,\n uint32 maxFeedAge,\n IUniswapV3Pool pool,\n uint32 twapSeconds,\n Mode mode,\n uint16 maxDifference\n ) external onlyOwner\n265: function setEmergencyAdmin(address admin) external onlyOwner", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "02-ethos", "title": "cryptostellar5 Q", "severity_raw": "High", "severity": "high", "description": "\n### 01. UPGRADEABLE CONTRACT IS MISSING A\u00a0`__GAP[50]`\u00a0STORAGE VARIABLE TO ALLOW FOR NEW STORAGE VARIABLES IN LATER VERSIONS\n\n*Number of Instances Identified: 2*\n\nSee\u00a0[this](https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps)\u00a0link for a description of this storage variable. While some contracts may not currently be sub-classed, adding the variable now protects against forgetting to add it in the future.\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol\n\n```\n19-21: contract ReaperStrategyGranarySupplyOnly is ReaperBaseStrategyv4, VeloSolidMixin {\n using ReaperMathUtils for uint256;\n using SafeERC20Upgradeable for IERC20Upgradeable;\n \n```\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/abstract/ReaperBaseStrategyv4.sol\n\n```\n14-18: contract ReaperBaseStrategyv4 is\n ReaperAccessControl,\n IStrategy,\n UUPSUpgradeable,\n AccessControlEnumerableUpgradeable\n```\n\n\n### 02. NOW IS DEPRECATED\n\n*Number of Instances Identified: 1*\n\nUse\u00a0`block.timestamp`\u00a0instead\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol\n\n```\n282: require(deadline >= now, 'LUSD: expired deadline');\n```\n\n\n\n### 03. CONSTANTS SHOULD BE DEFINED RATHER THAN USING MAGIC NUMBERS\n\n*Number of Instances Identified: 7*\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol\n\n```\n127: require(_bps <= 10_000, \"Invalid BPS value\");\n133: require(_driftBps <= 500, \"Exceeds max allowed value of 500 BPS\");\n145: require(_treasurySplit + _SPSplit + _stakingSplit == 10_000, \"Splits must add up to 10000 BPS\");\n258: vars.percentOfFinalBal = vars.finalBalance == 0 ? uint256(-1) : vars.currentAllocated.mul(10_000).div(vars.finalBalance);\n262: vars.finalYieldingAmount = vars.finalBalance.mul(vars.yieldingPercentage).div(10_000);\n291: vars.treasurySplit = vars.profit.mul(yieldSplitTreasury).div(10_000);\n296: vars.stakingSplit = vars.p", "vulnerable_code": "19-21: contract ReaperStrategyGranarySupplyOnly is ReaperBaseStrategyv4, VeloSolidMixin {\n using ReaperMathUtils for uint256;\n using SafeERC20Upgradeable for IERC20Upgradeable;\n ", "fixed_code": "14-18: contract ReaperBaseStrategyv4 is\n ReaperAccessControl,\n IStrategy,\n UUPSUpgradeable,\n AccessControlEnumerableUpgradeable", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/cryptostellar5-Q.md", "collected_at": "2026-01-02T18:17:01.113850+00:00", "source_hash": "c12cf72f5449135710ddeea6c8f74d36419a2951179bca0381336b6b141873fc", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 377, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "19-21: contract ReaperStrategyGranarySupplyOnly is ReaperBaseStrategyv4, VeloSolidMixin {\n using ReaperMathUtils for uint256;\n using SafeERC20Upgradeable for IERC20Upgradeable;", "primary_code_language": "unknown", "primary_code_char_count": 182, "all_code_blocks": "// Code block 1 (unknown):\n19-21: contract ReaperStrategyGranarySupplyOnly is ReaperBaseStrategyv4, VeloSolidMixin {\n using ReaperMathUtils for uint256;\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n// Code block 2 (unknown):\n14-18: contract ReaperBaseStrategyv4 is\n ReaperAccessControl,\n IStrategy,\n UUPSUpgradeable,\n AccessControlEnumerableUpgradeable\n\n// Code block 3 (unknown):\n282: require(deadline >= now, 'LUSD: expired deadline');", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ReaperStrategyGranarySupplyOnly.sol, ReaperBaseStrategyv4.sol, LUSDToken.sol, ActivePool.sol", "github_files_list": "LUSDToken.sol, ReaperStrategyGranarySupplyOnly.sol, ReaperBaseStrategyv4.sol, ActivePool.sol", "github_refs_count": 4, "vulnerable_code_actual": "19-21: contract ReaperStrategyGranarySupplyOnly is ReaperBaseStrategyv4, VeloSolidMixin {\n using ReaperMathUtils for uint256;\n using SafeERC20Upgradeable for IERC20Upgradeable;\n ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "14-18: contract ReaperBaseStrategyv4 is\n ReaperAccessControl,\n IStrategy,\n UUPSUpgradeable,\n AccessControlEnumerableUpgradeable", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "08-dopex", "title": "0x3b G", "severity_raw": "Low", "severity": "low", "description": "| *Issue* | *Description* |\n|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **[G-01]** | Call functions directly |\n| **[G-02]** | Save strike in memory earlier |\n| **[G-03]** | Save equation in memory earlier |\n| **[G-04]** | Instead of calling it multiple times [nextFundingPaymentTimestamp](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/perp-vault/PerpetualAtlanticVault.sol#L563-L569) save it in memory |\n| **[G-05]** | [_curveSwap](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L515-L542) input parameter `validate` is useless |\n| **[G-06]** | Check is not need |\n\n### **[G-01]** Call functions directly \nUnder [deposit](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/perp-vault/PerpetualAtlanticVaultLP.sol#L118-L135) you can skip [previewDeposit](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/perp-vault/Per", "vulnerable_code": "### **[G-03]** Save equation in memory earlier \nUnder [updateFunding](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/perp-vault/PerpetualAtlanticVault.sol#L462-L496) this equation bellow is used 3 times in a row. ", "fixed_code": "This is not needed as the result can be saved in memory. and accessed at will for a minimum gas cost.\n\n### **[G-04]** Instead of calling it multiple times [nextFundingPaymentTimestamp](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/perp-vault/PerpetualAtlanticVault.sol#L563-L569) save it in memory\nUnder [_updateFundingRate](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/perp-vault/PerpetualAtlanticVault.sol#L594-L614) you can save [nextFundingPaymentTimestamp](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/perp-vault/PerpetualAtlanticVault.sol#L602) before the `if` or `else`, saving a few calls to this function. After it you can use the variable [endTime](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/perp-vault/PerpetualAtlanticVault.sol#L602) in the calculations much more cheaply than doing multiple function calls.\n\n### **[G-05]** [_curveSwap](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L515-L542) input parameter `validate` is useless \n[_curveSwap](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L515-L542) is used in 2 places ( [upperDepeg](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L1051-L1070) and [lowerDepeg](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L1080-L1124) ), where they each input `validate` as true, meaning that there is no need for this parameter as it can be hard-coded to constantly validate.\n\n### **[G-06]** Check is not need\n[_transfer](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L624-L685) currently checks if [msg.sender matches the owner of the bondID](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L638-L641), unfortunately this is done in the gas expensive way as the previous call to [IRdpxDecayingBonds.bonds(bondID)](https://github.com/code-423n4/2", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/0x3b-G.md", "collected_at": "2026-01-02T18:24:10.545597+00:00", "source_hash": "c15b83b402572c63ba9d5f21a42909a118e661da7f03193145bdbc60db4125cc", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 10, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "PerpetualAtlanticVault.sol#L563-L569, RdpxV2Core.sol#L515-L542, PerpetualAtlanticVaultLP.sol#L118-L135, PerpetualAtlanticVault.sol#L462-L496, PerpetualAtlanticVault.sol#L594-L614, PerpetualAtlanticVault.sol#L602, RdpxV2Core.sol#L1051-L1070, RdpxV2Core.sol#L1080-L1124, RdpxV2Core.sol#L624-L685, RdpxV2Core.sol#L638-L641", "github_files_list": "PerpetualAtlanticVault.sol, RdpxV2Core.sol, PerpetualAtlanticVaultLP.sol", "github_refs_count": 10, "vulnerable_code_actual": "### **[G-03]** Save equation in memory earlier \nUnder [updateFunding](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/perp-vault/PerpetualAtlanticVault.sol#L462-L496) this equation bellow is used 3 times in a row. ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "This is not needed as the result can be saved in memory. and accessed at will for a minimum gas cost.\n\n### **[G-04]** Instead of calling it multiple times [nextFundingPaymentTimestamp](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/perp-vault/PerpetualAtlanticVault.sol#L563-L569) save it in memory\nUnder [_updateFundingRate](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/perp-vault/PerpetualAtlanticVault.sol#L594-L614) you can save [nextFundingPaymentTimestamp](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/perp-vault/PerpetualAtlanticVault.sol#L602) before the `if` or `else`, saving a few calls to this function. After it you can use the variable [endTime](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/perp-vault/PerpetualAtlanticVault.sol#L602) in the calculations much more cheaply than doing multiple function calls.\n\n### **[G-05]** [_curveSwap](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L515-L542) input parameter `validate` is useless \n[_curveSwap](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L515-L542) is used in 2 places ( [upperDepeg](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L1051-L1070) and [lowerDepeg](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L1080-L1124) ), where they each input `validate` as true, meaning that there is no need for this parameter as it can be hard-coded to constantly validate.\n\n### **[G-06]** Check is not need\n[_transfer](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L624-L685) currently checks if [msg.sender matches the owner of the bondID](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L638-L641), unfortunately this is done in the gas expensive way as the previous call to [IRdpxDecayingBonds.bonds(bondID)](https://github.com/code-423n4/2", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "11-kelp", "title": "fouzantanveer Analysis", "severity_raw": "Critical", "severity": "critical", "description": "## Any comments for the judge to contextualize your findings\nKelp DAO is actively developing rsETH, a Liquid Restaked Token (LRT) designed to provide seamless liquidity and flexibility within the DeFi landscape. The project, already live on the testnet, introduces a novel approach to Ethereum staking and restaking rewards while preserving liquidity for active participation in DeFi protocols.\n\n*Key Components and Functionality:*\n\n1. *Deposit Pool:* The deposit pool acts as a streamlined vault for restakers, facilitating the transfer of liquid staked tokens to receive rsETH tokens based on the current exchange rate. It abstracts complexities related to rewards and validator delegation, simplifying the overall process.\n\n2. *Node Delegator:* This module is pivotal in managing the movement of deposited liquid staked assets. Each node delegator is responsible for delegating assets to a specific operator, ensuring economic security across nodes operated by that operator for various Adaptive Validator Sets (AVSes). It also automates reward redemption through prescribed strategies, leading to substantial gas savings for restakers.\n\n3. *Reward Market:* Governed by the DAO through governance mechanisms, the reward market offers diverse strategies tailored to different rewards. This strategic flexibility allows AVSes to optimize returns for restakers while avoiding undesirable token activities.\n\n4. *Withdrawal Manager:* The Withdrawal Manager module facilitates rsETH holders in converting their tokens into a share of all assets managed by the protocol. Redeemers can expect to receive a comprehensive set of rewards accrued by Node Delegators, reflecting the rewards from operators subscribed to various AVSes.\n\nBy integrating these components, rsETH seeks to bridge the gap between staking rewards and DeFi liquidity, providing users with a comprehensive solution for maximizing their returns while actively participating in decentralized finance.\n\n\n## Approach taken in evaluating the", "vulnerable_code": "// Consider adding an event for role changes in LRTConfigRoleChecker\nevent RoleUpdated(bytes32 indexed role, address indexed account, bool indexed granted);\n\nmodifier onlyLRTManager() {\n if (!IAccessControl(address(lrtConfig)).hasRole(LRTConstants.MANAGER, msg.sender)) {\n emit RoleUpdated(LRTConstants.MANAGER, msg.sender, false);\n revert ILRTConfig.CallerNotLRTConfigManager();\n }\n emit RoleUpdated(LRTConstants.MANAGER, msg.sender, true);\n _;\n}", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/fouzantanveer-Analysis.md", "collected_at": "2026-01-02T18:28:01.897416+00:00", "source_hash": "c18d19e73ece75b07e173e4bd941a72cbb54625d639ac5166aea2ef453412ff8", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "// Consider adding an event for role changes in LRTConfigRoleChecker\nevent RoleUpdated(bytes32 indexed role, address indexed account, bool indexed granted);\n\nmodifier onlyLRTManager() {\n if (!IAccessControl(address(lrtConfig)).hasRole(LRTConstants.MANAGER, msg.sender)) {\n emit RoleUpdated(LRTConstants.MANAGER, msg.sender, false);\n revert ILRTConfig.CallerNotLRTConfigManager();\n }\n emit RoleUpdated(LRTConstants.MANAGER, msg.sender, true);\n _;\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4} {"source": "c4", "protocol": "02-ethos", "title": "catellatech Q", "severity_raw": "Critical", "severity": "critical", "description": "`Dear Ethos Team, as we have gone through each contract within the scope, we have noticed good practices that have been implemented. However, we have identified some inconsistencies that we recommend addressing. We understand that every team has a different level of good practices, but we believe that at least 90% of the recommendations in the following report should be applied for better gas efficiency, readability, and most importantly, safety.`\n\n`Note: We have provided a description of the situation and recommendations to follow, including articles and resources we have created to help identify the problem and address it quickly, and to implement them in future projects.`\n\n### Issues \n| Letter | Name | Description |\n|:--:|:-------:|:-------:|\n| L | Low risk | Potential risk |\n| NC | Non-critical | Non risky findings |\n| R | Refactor | Changing the code |\n| O | Ordinary | Often found issues |\n\n| Total Found Issues | 34 |\n|:--:|:--:|\n\n\n### Low Risk\n| Count | Explanation | Instances |\n|:--:|:-------|:--:|\n| [L-01] | USER FACING BORROWEROPERATIONS AND TROVEMANAGER MISS EMERGENCY LEVER | 2 |\n| [L-02] | MULTIPLE ADDRESS MAPPINGS CAN BE COMBINED INTO A SINGLE MAPPING OF AN ADDRESS TO A STRUCT, WHERE APPROPRIATE | 19 |\n| [L-03] | PRAGMA EXPERIMENTAL ABIECODERV2 IS DEPRECATED | 2 |\n| [L-04] | ERC20UPGRADEABLE SAFEAPPROVE() IS DEPRECATED | 1 |\n| [L-05] | Open TODOs | 2 |\n| [L-06] | DIVISION BEFORE MULTIPLICATION CAN LEAD TO PRECISION ERRORS | 2 |\n| [L-07] | IMMUTABLE ADDRESSES LACK ZERO-ADDRESS CHECK | 1 |\n| [L-08] | USE OF FLOATING PRAGMA | 17 |\n| [L-09] | CRITICAL CHANGES SHOULD USE TWO-STEP PROCEDURE | 3 |\n\n| Total Low Risk Issues | 9 | Total Instances | 49 |\n|:--:|:--:|:--:|--:|\n\n### Non-Critical\n| Count | Explanation | Instances |\n|:--:|:-------|:--:|\n| [N-01] | TOO MANY BITS TO DESCRIBE SMALL QUANTITIES | MULTIPLE INSTANCES |\n| [N-02] | MANDATORY CHECKS FOR EXTRA SAFETY IN THE SETTERS | 1 |\n| [N-03] | RACE CONDITION ON ERC20 APPROVAL | 1 |\n| [N-04] | CREATE YOUR O", "vulnerable_code": "Ethos-Core/contracts/ActivePool.sol\n\n41: mapping (address => uint256) internal collAmount; \n42: mapping (address => uint256) internal LUSDDebt; \n44: mapping (address => uint256) public yieldingPercentage; \n45: mapping (address => uint256) public yieldingAmount; \n46: mapping (address => address) public yieldGenerator;\n47: mapping (address => uint256) public yieldClaimThreshold; ", "fixed_code": "Ethos-Vault/contracts/libraries/DistributionTypes.sol\n\n3: pragma experimental ABIEncoderV2;\n\nEthos-Vault/contracts/interfaces/IRewardsController.sol\n\n3: pragma experimental ABIEncoderV2;\n\nEthos-Vault/contracts/interfaces/IRewardsDistributor.sol\n\n3: pragma experimental ABIEncoderV2;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/catellatech-Q.md", "collected_at": "2026-01-02T18:16:54.444676+00:00", "source_hash": "c19635b6127b431cadf3d71b4b05edd3f842fff3e615a4392e4f90fb28332453", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "Ethos-Core/contracts/ActivePool.sol\n\n41: mapping (address => uint256) internal collAmount; \n42: mapping (address => uint256) internal LUSDDebt; \n44: mapping (address => uint256) public yieldingPercentage; \n45: mapping (address => uint256) public yieldingAmount; \n46: mapping (address => address) public yieldGenerator;\n47: mapping (address => uint256) public yieldClaimThreshold; ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "Ethos-Vault/contracts/libraries/DistributionTypes.sol\n\n3: pragma experimental ABIEncoderV2;\n\nEthos-Vault/contracts/interfaces/IRewardsController.sol\n\n3: pragma experimental ABIEncoderV2;\n\nEthos-Vault/contracts/interfaces/IRewardsDistributor.sol\n\n3: pragma experimental ABIEncoderV2;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "08-dopex", "title": "SBSecurity G", "severity_raw": "Gas", "severity": "gas", "description": "## Gas Optimizations\n| Number |Issue|Instances| Estimated Gas Saved |\n|-|:-|:-:|:-:| \n| [G-01](#g-01-use-calldata-instead-of-memory-for-function-arguments-that-do-not-get-mutated) | Use `calldata` instead of `memory` for function arguments that do not get mutated | 1 | 580 |\n\n*Total Estimated Gas Saved: 580*\n\n# [G-01] Use `calldata` instead of `memory` for function arguments that do not get mutated\n\nWhen you specify a data location as `memory`, that value will be copied into memory. When you specify the location as calldata, the value will stay static within calldata. If the value is a large, complex type, using memory may result in extra memory expansion costs.\n\nTotal instances: `2`\n\nGas Savings for `RdpxV2Core.bondWithDelegate`, obtained via protocol\u2019s tests: Avg 580 gas\n\n|||\n|-|-|\n| Memory | 788179 |\n| Calldata | 787599 |\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/core/RdpxV2Core.sol#L819-L824\n\n```solidity\nFile: contracts/core/RdpxV2Core.sol.sol\n819: function bondWithDelegate(\n820: address _to,\n821: uint256[] memory _amounts,\n822: uint256[] memory _delegateIds,\n823: uint256 rdpxBondId\n824: ) public returns (uint256 receiptTokenAmount, uint256[] memory) { {\n```\n\n```diff\nfunction bondWithDelegate(\n address _to,\n- uint256[] memory _amounts,\n- uint256[] memory _delegateIds,\n+ uint256[] calldata _amounts,\n+ uint256[] calldata _delegateIds,\n uint256 rdpxBondId\n) public returns (uint256 receiptTokenAmount, uint256[] memory) {\n\n```", "vulnerable_code": "File: contracts/core/RdpxV2Core.sol.sol\n819: function bondWithDelegate(\n820: address _to,\n821: uint256[] memory _amounts,\n822: uint256[] memory _delegateIds,\n823: uint256 rdpxBondId\n824: ) public returns (uint256 receiptTokenAmount, uint256[] memory) { {", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/SBSecurity-G.md", "collected_at": "2026-01-02T18:25:02.265327+00:00", "source_hash": "c22abaa43edd4beda1095d27a775724408f709cbf67b472f08f995ecb2fd61d4", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 570, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/core/RdpxV2Core.sol.sol\n819: function bondWithDelegate(\n820: address _to,\n821: uint256[] memory _amounts,\n822: uint256[] memory _delegateIds,\n823: uint256 rdpxBondId\n824: ) public returns (uint256 receiptTokenAmount, uint256[] memory) { {", "primary_code_language": "solidity", "primary_code_char_count": 302, "all_code_blocks": "// Code block 1 (solidity):\nFile: contracts/core/RdpxV2Core.sol.sol\n819: function bondWithDelegate(\n820: address _to,\n821: uint256[] memory _amounts,\n822: uint256[] memory _delegateIds,\n823: uint256 rdpxBondId\n824: ) public returns (uint256 receiptTokenAmount, uint256[] memory) { {\n\n// Code block 2 (diff):\nfunction bondWithDelegate(\n address _to,\n- uint256[] memory _amounts,\n- uint256[] memory _delegateIds,\n+ uint256[] calldata _amounts,\n+ uint256[] calldata _delegateIds,\n uint256 rdpxBondId\n) public returns (uint256 receiptTokenAmount, uint256[] memory) {", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "function bondWithDelegate(\n address _to,\n- uint256[] memory _amounts,\n- uint256[] memory _delegateIds,\n+ uint256[] calldata _amounts,\n+ uint256[] calldata _delegateIds,\n uint256 rdpxBondId\n) public returns (uint256 receiptTokenAmount, uint256[] memory) {", "solidity_code": "File: contracts/core/RdpxV2Core.sol.sol\n819: function bondWithDelegate(\n820: address _to,\n821: uint256[] memory _amounts,\n822: uint256[] memory _delegateIds,\n823: uint256 rdpxBondId\n824: ) public returns (uint256 receiptTokenAmount, uint256[] memory) { {", "github_refs_formatted": "RdpxV2Core.sol#L819-L824", "github_files_list": "RdpxV2Core.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: contracts/core/RdpxV2Core.sol.sol\n819: function bondWithDelegate(\n820: address _to,\n821: uint256[] memory _amounts,\n822: uint256[] memory _delegateIds,\n823: uint256 rdpxBondId\n824: ) public returns (uint256 receiptTokenAmount, uint256[] memory) { {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 9} {"source": "c4", "protocol": "02-ethos", "title": "dec3ntraliz3d G", "severity_raw": "High", "severity": "high", "description": "## Gas report\n### G-01 \n\nIncorrect use of storage variable in _harvestCore() function of `ReaperStrategyGranarySupplyOnly` contract .\n\n[Link to the code on github](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol#L117-L124)\n\n### Summary:\nThe current implementation of the function uses the storage keyword to create a pointer to an array in the contract's storage. However, this is unnecessary and will lead to higher gas costs . Using memory instead of storage would be more appropriate and efficient.\n\nCode changes:\n\n```solidity\nfor (uint256 i = 0; i < numSteps; i = i.uncheckedInc()) {\n address[2] storage step = steps[i]; // Should be memory variable\n IERC20Upgradeable startToken = IERC20Upgradeable(step[0]);\n uint256 amount = startToken.balanceOf(address(this));\n if (amount == 0) {\n continue;\n }\n _swapVelo(step[0], step[1], amount, VELO_ROUTER);\n }\n}\n```\n\nshould be changed to:\n\n```solidity\nfor (uint256 i = 0; i < numSteps; i = i.uncheckedInc()) {\n // Changed to memory since this storage pointer is not used to update value\n address[2] memory step = steps[i]; \n IERC20Upgradeable startToken = IERC20Upgradeable(step[0]);\n uint256 amount = startToken.balanceOf(address(this));\n if (amount == 0) {\n continue;\n }\n _swapVelo(step[0], step[1], amount, VELO_ROUTER);\n }\n```\n\n### G-02\n\nThe `_cascadingAccessRoles()` function in `ReaperVaultV2.sol` can be optimized by changing its state mutability from `view` to `pure` since the function does not access any storage variables. This change will not only make the function more efficient but also reduce gas costs.\n\n[Link to the code on github](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Vault/contracts/Reap", "vulnerable_code": "for (uint256 i = 0; i < numSteps; i = i.uncheckedInc()) {\n address[2] storage step = steps[i]; // Should be memory variable\n IERC20Upgradeable startToken = IERC20Upgradeable(step[0]);\n uint256 amount = startToken.balanceOf(address(this));\n if (amount == 0) {\n continue;\n }\n _swapVelo(step[0], step[1], amount, VELO_ROUTER);\n }\n}", "fixed_code": "for (uint256 i = 0; i < numSteps; i = i.uncheckedInc()) {\n // Changed to memory since this storage pointer is not used to update value\n address[2] memory step = steps[i]; \n IERC20Upgradeable startToken = IERC20Upgradeable(step[0]);\n uint256 amount = startToken.balanceOf(address(this));\n if (amount == 0) {\n continue;\n }\n _swapVelo(step[0], step[1], amount, VELO_ROUTER);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/dec3ntraliz3d-G.md", "collected_at": "2026-01-02T18:17:03.776789+00:00", "source_hash": "c23168745e729444d918ba0fa24db7172c829d0e0fe0135ea7d66553bbc706ac", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 889, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "for (uint256 i = 0; i < numSteps; i = i.uncheckedInc()) {\n address[2] storage step = steps[i]; // Should be memory variable\n IERC20Upgradeable startToken = IERC20Upgradeable(step[0]);\n uint256 amount = startToken.balanceOf(address(this));\n if (amount == 0) {\n continue;\n }\n _swapVelo(step[0], step[1], amount, VELO_ROUTER);\n }\n}", "primary_code_language": "solidity", "primary_code_char_count": 416, "all_code_blocks": "// Code block 1 (solidity):\nfor (uint256 i = 0; i < numSteps; i = i.uncheckedInc()) {\n address[2] storage step = steps[i]; // Should be memory variable\n IERC20Upgradeable startToken = IERC20Upgradeable(step[0]);\n uint256 amount = startToken.balanceOf(address(this));\n if (amount == 0) {\n continue;\n }\n _swapVelo(step[0], step[1], amount, VELO_ROUTER);\n }\n}\n\n// Code block 2 (solidity):\nfor (uint256 i = 0; i < numSteps; i = i.uncheckedInc()) {\n // Changed to memory since this storage pointer is not used to update value\n address[2] memory step = steps[i]; \n IERC20Upgradeable startToken = IERC20Upgradeable(step[0]);\n uint256 amount = startToken.balanceOf(address(this));\n if (amount == 0) {\n continue;\n }\n _swapVelo(step[0], step[1], amount, VELO_ROUTER);\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "for (uint256 i = 0; i < numSteps; i = i.uncheckedInc()) {\n address[2] storage step = steps[i]; // Should be memory variable\n IERC20Upgradeable startToken = IERC20Upgradeable(step[0]);\n uint256 amount = startToken.balanceOf(address(this));\n if (amount == 0) {\n continue;\n }\n _swapVelo(step[0], step[1], amount, VELO_ROUTER);\n }\n}\n\nfor (uint256 i = 0; i < numSteps; i = i.uncheckedInc()) {\n // Changed to memory since this storage pointer is not used to update value\n address[2] memory step = steps[i]; \n IERC20Upgradeable startToken = IERC20Upgradeable(step[0]);\n uint256 amount = startToken.balanceOf(address(this));\n if (amount == 0) {\n continue;\n }\n _swapVelo(step[0], step[1], amount, VELO_ROUTER);\n }", "github_refs_formatted": "ReaperStrategyGranarySupplyOnly.sol#L117-L124", "github_files_list": "ReaperStrategyGranarySupplyOnly.sol", "github_refs_count": 1, "vulnerable_code_actual": "for (uint256 i = 0; i < numSteps; i = i.uncheckedInc()) {\n address[2] storage step = steps[i]; // Should be memory variable\n IERC20Upgradeable startToken = IERC20Upgradeable(step[0]);\n uint256 amount = startToken.balanceOf(address(this));\n if (amount == 0) {\n continue;\n }\n _swapVelo(step[0], step[1], amount, VELO_ROUTER);\n }\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "for (uint256 i = 0; i < numSteps; i = i.uncheckedInc()) {\n // Changed to memory since this storage pointer is not used to update value\n address[2] memory step = steps[i]; \n IERC20Upgradeable startToken = IERC20Upgradeable(step[0]);\n uint256 amount = startToken.balanceOf(address(this));\n if (amount == 0) {\n continue;\n }\n _swapVelo(step[0], step[1], amount, VELO_ROUTER);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "10-badger", "title": "tala7985 G", "severity_raw": "Critical", "severity": "critical", "description": " \n\n## \\[G-1\\] Avoiding the creation of an intermediate variable `cachedSystemDebt` and updating the `systemDebt`\n\nan additional read operation is performed to load the `systemDebt` value into the `cachedSystemDebt` variable. This read operation incurs a gas cost. This cost is typically around 2100 gas for a simple storage variable.\n\n```diff\nfunction increaseSystemDebt(uint256 _amount) external override {\n _requireCallerIsBOorCdpM();\n\n\n- uint256 cachedSystemDebt = systemDebt + _amount;\n+ systemDebt =systemDebt + _amount;\n \n\n- systemDebt = cachedSystemDebt;\n- emit ActivePoolEBTCDebtUpdated(cachedSystemDebt);\n+ emit ActivePoolEBTCDebtUpdated(systemDebt);\n }\n```\n\n https://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/ActivePool.sol#L194C5-L202C1\n\n```diff\nfunction decreaseSystemDebt(uint256 _amount) external override {\n _requireCallerIsBOorCdpM();\n\n\n- uint256 cachedSystemDebt = systemDebt - _amount;\n+ systemDebt -= _amount;\n \n\n- systemDebt = cachedSystemDebt;\n- emit ActivePoolEBTCDebtUpdated(cachedSystemDebt);\n+ emit ActivePoolEBTCDebtUpdated(systemDebt);\n }\n```\n\n https://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/ActivePool.sol#L207C4-L214C6\n\n```\nfunction increaseSystemCollShares(uint256 _value) external override {\n _requireCallerIsBorrowerOperations();\n\n+ systemCollShares += _value;\n- uint256 cachedSystemCollShares = systemCollShares + _value;\n- systemCollShares = cachedSystemCollShares;\n- emit SystemCollSharesUpdated(cachedSystemCollShares);\n+ emit SystemCollSharesUpdated(systemCollShares);\n }\n```\n\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/ActivePool.sol#L242C5-L249C1\n\n## \\[G-2\\] Avoid duplicate `msg.sender` use assembly to check `msg.sender`\n\nYou can use assembly to optimize the `require` statement to avoid duplicate `msg.sender` checks and save some", "vulnerable_code": " https://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/ActivePool.sol#L194C5-L202C1\n", "fixed_code": " https://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/ActivePool.sol#L207C4-L214C6\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/tala7985-G.md", "collected_at": "2026-01-02T18:27:04.171512+00:00", "source_hash": "c24157d0fb9c1d5377cc14217cb5d6b7b20166ccb776b89d2a0d1341774efd98", "code_block_count": 3, "solidity_block_count": 2, "total_code_chars": 1083, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function increaseSystemDebt(uint256 _amount) external override {\n _requireCallerIsBOorCdpM();\n\n\n- uint256 cachedSystemDebt = systemDebt + _amount;\n+ systemDebt =systemDebt + _amount;\n \n\n- systemDebt = cachedSystemDebt;\n- emit ActivePoolEBTCDebtUpdated(cachedSystemDebt);\n+ emit ActivePoolEBTCDebtUpdated(systemDebt);\n }", "primary_code_language": "diff", "primary_code_char_count": 349, "all_code_blocks": "// Code block 1 (diff):\nfunction increaseSystemDebt(uint256 _amount) external override {\n _requireCallerIsBOorCdpM();\n\n\n- uint256 cachedSystemDebt = systemDebt + _amount;\n+ systemDebt =systemDebt + _amount;\n \n\n- systemDebt = cachedSystemDebt;\n- emit ActivePoolEBTCDebtUpdated(cachedSystemDebt);\n+ emit ActivePoolEBTCDebtUpdated(systemDebt);\n }\n\n// Code block 2 (diff):\nfunction decreaseSystemDebt(uint256 _amount) external override {\n _requireCallerIsBOorCdpM();\n\n\n- uint256 cachedSystemDebt = systemDebt - _amount;\n+ systemDebt -= _amount;\n \n\n- systemDebt = cachedSystemDebt;\n- emit ActivePoolEBTCDebtUpdated(cachedSystemDebt);\n+ emit ActivePoolEBTCDebtUpdated(systemDebt);\n }\n\n// Code block 3 (unknown):\nfunction increaseSystemCollShares(uint256 _value) external override {\n _requireCallerIsBorrowerOperations();\n\n+ systemCollShares += _value;\n- uint256 cachedSystemCollShares = systemCollShares + _value;\n- systemCollShares = cachedSystemCollShares;\n- emit SystemCollSharesUpdated(cachedSystemCollShares);\n+ emit SystemCollSharesUpdated(systemCollShares);\n }", "all_code_blocks_count": 3, "has_diff_blocks": true, "diff_code": "function increaseSystemDebt(uint256 _amount) external override {\n _requireCallerIsBOorCdpM();\n\n\n- uint256 cachedSystemDebt = systemDebt + _amount;\n+ systemDebt =systemDebt + _amount;\n \n\n- systemDebt = cachedSystemDebt;\n- emit ActivePoolEBTCDebtUpdated(cachedSystemDebt);\n+ emit ActivePoolEBTCDebtUpdated(systemDebt);\n }\n\nfunction decreaseSystemDebt(uint256 _amount) external override {\n _requireCallerIsBOorCdpM();\n\n\n- uint256 cachedSystemDebt = systemDebt - _amount;\n+ systemDebt -= _amount;\n \n\n- systemDebt = cachedSystemDebt;\n- emit ActivePoolEBTCDebtUpdated(cachedSystemDebt);\n+ emit ActivePoolEBTCDebtUpdated(systemDebt);\n }", "solidity_code": "", "github_refs_formatted": "ActivePool.sol#L194-L5, ActivePool.sol#L207-L4, ActivePool.sol#L242-L5", "github_files_list": "ActivePool.sol", "github_refs_count": 3, "vulnerable_code_actual": " https://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/ActivePool.sol#L194C5-L202C1\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": " https://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/ActivePool.sol#L207C4-L214C6\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 11} {"source": "c4", "protocol": "09-ondo", "title": "gumgumzum Q", "severity_raw": "Medium", "severity": "medium", "description": "## Minor precision loss in `rUSDY@unwrap`\nVery small quantities of shares (up to `BPS_DENOMINATOR - 1`) can be burned.\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L453C33-L453C33\n\n### Test \n```solidity\n function testPrecisionLoss() public dealAndWrapAlice {\n _setOraclePrice(1.05e18);\n \n uint256 rUSDYAmount = 3e18;\n\n uint256 usdyAmount = rUSDYToken.getSharesByRUSDY(rUSDYAmount);\n uint256 remainder = usdyAmount % rUSDYToken.BPS_DENOMINATOR();\n uint256 sharesOfAliceBefore = rUSDYToken.sharesOf(alice);\n \n\n vm.startPrank(alice);\n rUSDYToken.unwrap(rUSDYAmount);\n vm.stopPrank();\n\n assertEq(rUSDYToken.sharesOf(alice), sharesOfAliceBefore - usdyAmount + remainder);\n }\n```\n\n## Potentially unnecessary computation in `rUSDY@_burnShares`\nThe result of `rUSDY@getRUSDYByShares` shouldn't change between https://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L586 and \nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L592\n\n## Array access can be simplified in `RWADynamicOracle@overrideRange`\n\n```solidity\ndiff --git a/contracts/rwaOracles/RWADynamicOracle.sol b/contracts/rwaOracles/RWADynamicOracle.sol\nindex 03aa7d6..bc1b8d0 100644\n--- a/contracts/rwaOracles/RWADynamicOracle.sol\n+++ b/contracts/rwaOracles/RWADynamicOracle.sol\n@@ -198,7 +198,7 @@ contract RWADynamicOracle is IRWAOracle, AccessControlEnumerable, Pausable {\n if (indexToModify == 0) {\n // If the length of ranges is greater than 1,\n // Ensure that the newEnd time is not greater than the start time of the next range\n- if (rangeLength > 1 && newEnd > ranges[indexToModify + 1].start)\n+ if (rangeLength > 1 && newEnd > ranges[1].start)\n revert InvalidRange();\n }\n // Case 2: The range being modified is the last range\n```\n", "vulnerable_code": " function testPrecisionLoss() public dealAndWrapAlice {\n _setOraclePrice(1.05e18);\n \n uint256 rUSDYAmount = 3e18;\n\n uint256 usdyAmount = rUSDYToken.getSharesByRUSDY(rUSDYAmount);\n uint256 remainder = usdyAmount % rUSDYToken.BPS_DENOMINATOR();\n uint256 sharesOfAliceBefore = rUSDYToken.sharesOf(alice);\n \n\n vm.startPrank(alice);\n rUSDYToken.unwrap(rUSDYAmount);\n vm.stopPrank();\n\n assertEq(rUSDYToken.sharesOf(alice), sharesOfAliceBefore - usdyAmount + remainder);\n }", "fixed_code": "diff --git a/contracts/rwaOracles/RWADynamicOracle.sol b/contracts/rwaOracles/RWADynamicOracle.sol\nindex 03aa7d6..bc1b8d0 100644\n--- a/contracts/rwaOracles/RWADynamicOracle.sol\n+++ b/contracts/rwaOracles/RWADynamicOracle.sol\n@@ -198,7 +198,7 @@ contract RWADynamicOracle is IRWAOracle, AccessControlEnumerable, Pausable {\n if (indexToModify == 0) {\n // If the length of ranges is greater than 1,\n // Ensure that the newEnd time is not greater than the start time of the next range\n- if (rangeLength > 1 && newEnd > ranges[indexToModify + 1].start)\n+ if (rangeLength > 1 && newEnd > ranges[1].start)\n revert InvalidRange();\n }\n // Case 2: The range being modified is the last range", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/gumgumzum-Q.md", "collected_at": "2026-01-02T18:25:56.948600+00:00", "source_hash": "c272602247de07542601980624602d20d2fc7c536d96d37b2fc29d54518959fc", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 1221, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function testPrecisionLoss() public dealAndWrapAlice {\n _setOraclePrice(1.05e18);\n \n uint256 rUSDYAmount = 3e18;\n\n uint256 usdyAmount = rUSDYToken.getSharesByRUSDY(rUSDYAmount);\n uint256 remainder = usdyAmount % rUSDYToken.BPS_DENOMINATOR();\n uint256 sharesOfAliceBefore = rUSDYToken.sharesOf(alice);\n \n\n vm.startPrank(alice);\n rUSDYToken.unwrap(rUSDYAmount);\n vm.stopPrank();\n\n assertEq(rUSDYToken.sharesOf(alice), sharesOfAliceBefore - usdyAmount + remainder);\n }", "primary_code_language": "solidity", "primary_code_char_count": 499, "all_code_blocks": "// Code block 1 (solidity):\nfunction testPrecisionLoss() public dealAndWrapAlice {\n _setOraclePrice(1.05e18);\n \n uint256 rUSDYAmount = 3e18;\n\n uint256 usdyAmount = rUSDYToken.getSharesByRUSDY(rUSDYAmount);\n uint256 remainder = usdyAmount % rUSDYToken.BPS_DENOMINATOR();\n uint256 sharesOfAliceBefore = rUSDYToken.sharesOf(alice);\n \n\n vm.startPrank(alice);\n rUSDYToken.unwrap(rUSDYAmount);\n vm.stopPrank();\n\n assertEq(rUSDYToken.sharesOf(alice), sharesOfAliceBefore - usdyAmount + remainder);\n }\n\n// Code block 2 (solidity):\ndiff --git a/contracts/rwaOracles/RWADynamicOracle.sol b/contracts/rwaOracles/RWADynamicOracle.sol\nindex 03aa7d6..bc1b8d0 100644\n--- a/contracts/rwaOracles/RWADynamicOracle.sol\n+++ b/contracts/rwaOracles/RWADynamicOracle.sol\n@@ -198,7 +198,7 @@ contract RWADynamicOracle is IRWAOracle, AccessControlEnumerable, Pausable {\n if (indexToModify == 0) {\n // If the length of ranges is greater than 1,\n // Ensure that the newEnd time is not greater than the start time of the next range\n- if (rangeLength > 1 && newEnd > ranges[indexToModify + 1].start)\n+ if (rangeLength > 1 && newEnd > ranges[1].start)\n revert InvalidRange();\n }\n // Case 2: The range being modified is the last range", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function testPrecisionLoss() public dealAndWrapAlice {\n _setOraclePrice(1.05e18);\n \n uint256 rUSDYAmount = 3e18;\n\n uint256 usdyAmount = rUSDYToken.getSharesByRUSDY(rUSDYAmount);\n uint256 remainder = usdyAmount % rUSDYToken.BPS_DENOMINATOR();\n uint256 sharesOfAliceBefore = rUSDYToken.sharesOf(alice);\n \n\n vm.startPrank(alice);\n rUSDYToken.unwrap(rUSDYAmount);\n vm.stopPrank();\n\n assertEq(rUSDYToken.sharesOf(alice), sharesOfAliceBefore - usdyAmount + remainder);\n }\n\ndiff --git a/contracts/rwaOracles/RWADynamicOracle.sol b/contracts/rwaOracles/RWADynamicOracle.sol\nindex 03aa7d6..bc1b8d0 100644\n--- a/contracts/rwaOracles/RWADynamicOracle.sol\n+++ b/contracts/rwaOracles/RWADynamicOracle.sol\n@@ -198,7 +198,7 @@ contract RWADynamicOracle is IRWAOracle, AccessControlEnumerable, Pausable {\n if (indexToModify == 0) {\n // If the length of ranges is greater than 1,\n // Ensure that the newEnd time is not greater than the start time of the next range\n- if (rangeLength > 1 && newEnd > ranges[indexToModify + 1].start)\n+ if (rangeLength > 1 && newEnd > ranges[1].start)\n revert InvalidRange();\n }\n // Case 2: The range being modified is the last range", "github_refs_formatted": "rUSDY.sol#L453-L33, rUSDY.sol#L586, rUSDY.sol#L592", "github_files_list": "rUSDY.sol", "github_refs_count": 3, "vulnerable_code_actual": " function testPrecisionLoss() public dealAndWrapAlice {\n _setOraclePrice(1.05e18);\n \n uint256 rUSDYAmount = 3e18;\n\n uint256 usdyAmount = rUSDYToken.getSharesByRUSDY(rUSDYAmount);\n uint256 remainder = usdyAmount % rUSDYToken.BPS_DENOMINATOR();\n uint256 sharesOfAliceBefore = rUSDYToken.sharesOf(alice);\n \n\n vm.startPrank(alice);\n rUSDYToken.unwrap(rUSDYAmount);\n vm.stopPrank();\n\n assertEq(rUSDYToken.sharesOf(alice), sharesOfAliceBefore - usdyAmount + remainder);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "diff --git a/contracts/rwaOracles/RWADynamicOracle.sol b/contracts/rwaOracles/RWADynamicOracle.sol\nindex 03aa7d6..bc1b8d0 100644\n--- a/contracts/rwaOracles/RWADynamicOracle.sol\n+++ b/contracts/rwaOracles/RWADynamicOracle.sol\n@@ -198,7 +198,7 @@ contract RWADynamicOracle is IRWAOracle, AccessControlEnumerable, Pausable {\n if (indexToModify == 0) {\n // If the length of ranges is greater than 1,\n // Ensure that the newEnd time is not greater than the start time of the next range\n- if (rangeLength > 1 && newEnd > ranges[indexToModify + 1].start)\n+ if (rangeLength > 1 && newEnd > ranges[1].start)\n revert InvalidRange();\n }\n // Case 2: The range being modified is the last range", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "11-kelp", "title": "0x11singh99 G", "severity_raw": "Low", "severity": "low", "description": "## Gas Optimizations\n\n| Number | Issue | Instances |\n| ------------------------------------------------------------------------------------------------------ | :-------------------------------------------------------------------------------------- | :-------: |\n| [[G-01](#g-01-multiple-mappings-that-share-an-id-can-be-combined-into-a-single-mapping-of-id--struct)] | Multiple mappings that share an ID can be combined into a single mapping of ID / struct | 3 |\n| [[G-02](#g-02-can-make-the-variable-outside-the-loop-to-save-gas)] | Can Make The Variable Outside The Loop To Save Gas | 3 |\n| [[G-03](#g-03-do-not-cache-function-call-if-used-only-once)] | Do not cache function call if used only once | 1 |\n\n## [G-01] Multiple mappings that share an ID can be combined into a single mapping of ID / struct\n\nThis can avoid a Gsset (20000 Gas) per mapping combined. Reads and writes will also be cheaper when a function requires both values as they both can fit in the same storage slot.\n\nFinally, if both fields are accessed in the same function, this can save ~42 gas per access due to not having to recalculate the key's keccak256 hash (Gkeccak256 - 30 Gas) and that calculation's associated stack operations.\n\n**3 Instances**\n\nSince all these 3 mappings shares same key so their value can be combined into one struct that is mapped by that same key. Even further those struct variables can be packed ie. `address strategy` will be packed with `bool isSupported` into one slot and it can save 1 SLOT whenever new entry comes into newly updated mapping.\n\n```solidity\nFile : src/LRTConfig.sol\n\n15: mapping(address token => bool isSupporte", "vulnerable_code": "File : src/LRTConfig.sol\n\n15: mapping(address token => bool isSupported) public isSupportedAsset;\n16: mapping(address token => uint256 amount) public depositLimitByAsset;\n17: mapping(address token => address strategy) public override assetStrategy;\n", "fixed_code": "## [G-02] Can Make The Variable Outside The Loop To Save Gas\n\nWhen you declare a variable inside a loop, Solidity creates a new instance of the variable for each iteration of the loop. This can lead to unnecessary gas costs, especially if the loop is executed frequently or iterates over a large number of elements. By declaring the variable outside the loop, you can avoid the creation of multiple instances of the variable and reduce the gas cost of your contract\n\n**3 Instances**\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/0x11singh99-G.md", "collected_at": "2026-01-02T18:27:08.707194+00:00", "source_hash": "c2748fb91c38d96dfab36cbae9f4a9cd9e509d970c99c21c581cdc7d6bac70c5", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File : src/LRTConfig.sol\n\n15: mapping(address token => bool isSupported) public isSupportedAsset;\n16: mapping(address token => uint256 amount) public depositLimitByAsset;\n17: mapping(address token => address strategy) public override assetStrategy;\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## [G-02] Can Make The Variable Outside The Loop To Save Gas\n\nWhen you declare a variable inside a loop, Solidity creates a new instance of the variable for each iteration of the loop. This can lead to unnecessary gas costs, especially if the loop is executed frequently or iterates over a large number of elements. By declaring the variable outside the loop, you can avoid the creation of multiple instances of the variable and reduce the gas cost of your contract\n\n**3 Instances**\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "06-lybra", "title": "Raihan G", "severity_raw": "High", "severity": "high", "description": "# GAS OPTIMIZATION\n\n# SUMMERY\n\n| | issue | Instance |\n|------|---------|----------|\n|[G-01]| Avoid contract existence checks by using low level calls | 11 |\n|[G-02]| Use\u00a0calldata\u00a0instead of\u00a0memory | 2 |\n|[G-03]| Use assembly to write address storage values | 12 |\n|[G-04]| A modifier used only once and not being inherited should be inlined to save gas | 3\n|[G-05]| Use nested if statements instead of && | 4 |\n|[G-06]| Can Make The Variable Outside The Loop To Save Gas | 1 |\n|[G-07]| internal functions not called by the contract should be removed to save deployment gas | 4 |\n|[G-08]| Amounts should be checked for\u00a00\u00a0before calling a transfer | 5 |\n|[G-09]| Use hardcode address instead address(this)| 25 |\n|[G-10]| Use Assembly To Check For\u00a0address(0)|4|\n|[G-11]| Use constants instead of type(uintx).max|1|\n|[G-12]| State variables can be packed into fewer storage slots|1|\n|[G-13]| Make 3 event parameters indexed when possible | 8 |\n|[G-14]| Using fixed bytes is cheaper than using string|4|\n\n\n## [G\u201101] Avoid contract existence checks by using low level calls\nPrior to 0.8.10 the compiler inserted extra code, including EXTCODESIZE (100 gas), to check for contract existence for external function calls. In more recent solidity versions, the compiler will not insert these checks if the external call has a return value. Similar behavior can be achieved in earlier versions by using low-level calls, since low level calls never check for contract existence.\n\n```solidity\nFile: /contracts/lybra/configuration/LybraConfigurator.sol\n199 if(IVault(pool).vaultType() == 0) {\n\n304 IEUSD(stableToken).transfer(address(lybraProtocolRewardsPool), amount); \n```\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/configuration/LybraConfigurator.sol#L199\n\n\n```solidity\nFile: /contracts/lybra/miner/ProtocolRewardsPool.sol\n172 amount = IEUSD(configurator.getEUSDAddress()).getMintedEUSDByShares(earned(user));\n\n232 uint256 share = IEUSD(configurator.getEUSDAddr", "vulnerable_code": "File: /contracts/lybra/configuration/LybraConfigurator.sol\n199 if(IVault(pool).vaultType() == 0) {\n\n304 IEUSD(stableToken).transfer(address(lybraProtocolRewardsPool), amount); ", "fixed_code": "File: /contracts/lybra/miner/ProtocolRewardsPool.sol\n172 amount = IEUSD(configurator.getEUSDAddress()).getMintedEUSDByShares(earned(user));\n\n232 uint256 share = IEUSD(configurator.getEUSDAddress()).getSharesByMintedEUSD(amount);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/Raihan-G.md", "collected_at": "2026-01-02T18:22:36.390804+00:00", "source_hash": "c2aecf5d9b8f5231881e166587aab896a892d37fcb4a1152edb874bbbd640643", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 183, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: /contracts/lybra/configuration/LybraConfigurator.sol\n199 if(IVault(pool).vaultType() == 0) {\n\n304 IEUSD(stableToken).transfer(address(lybraProtocolRewardsPool), amount);", "primary_code_language": "solidity", "primary_code_char_count": 183, "all_code_blocks": "// Code block 1 (solidity):\nFile: /contracts/lybra/configuration/LybraConfigurator.sol\n199 if(IVault(pool).vaultType() == 0) {\n\n304 IEUSD(stableToken).transfer(address(lybraProtocolRewardsPool), amount);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: /contracts/lybra/configuration/LybraConfigurator.sol\n199 if(IVault(pool).vaultType() == 0) {\n\n304 IEUSD(stableToken).transfer(address(lybraProtocolRewardsPool), amount);", "github_refs_formatted": "LybraConfigurator.sol#L199", "github_files_list": "LybraConfigurator.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: /contracts/lybra/configuration/LybraConfigurator.sol\n199 if(IVault(pool).vaultType() == 0) {\n\n304 IEUSD(stableToken).transfer(address(lybraProtocolRewardsPool), amount); ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: /contracts/lybra/miner/ProtocolRewardsPool.sol\n172 amount = IEUSD(configurator.getEUSDAddress()).getMintedEUSDByShares(earned(user));\n\n232 uint256 share = IEUSD(configurator.getEUSDAddress()).getSharesByMintedEUSD(amount);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-revert-lend", "title": "shamsulhaq123 G", "severity_raw": "Critical", "severity": "critical", "description": "## Gas Optimization\n\n## Summary\n\n\n|No|Issue|Instence|\n|:-|:-|:-|\n|[G-01]|Change public function visibility to external|10|\n|[G-02]|Setting the constructor to payable|11|\n|[G-03]|Use hardcode address instead address(this)|41|\n|[G-04]|Use\u00a0selfbalance()\u00a0instead of\u00a0address(this).balance|1|\n|[G-05]|+= costs more gas than = + for state variables|13|\n|[G-06]| Use assembly for loops|2|\n|[G-07]|Using mappings instead of arrays to avoid length checks save gas|5|\n|[G-08]| Unnecessary look up in if condition|19|\n|[G-09]|address(this) can be stored in state variable that will ultimately cost less|41|\n|[G-10]| Use constants instead of type(uintx).max|12|\n|[G-11]|Default value initialization|11|\n|[G-12]|Use assembly in place of abi.decode to extract calldata values more efficiently|13|\n|[G-13]| Emitting constants wastes gas|43|\n|[G-14]|Use of Custom Errors Instead of String|15|\n|[G-15]| Do not calculate constants|4|\n|[G-16]| Empty Blocks Should Be Removed Or Emit Something|3|\n|[G-17]|Consider using OZ EnumerateSet in place of nested mappings|1|\n|[G-18]|Multiple address/ID mappings can be combined into a single mapping of an address/ID to a struct, where appropriate|9|\n|[G-19]| Use nested if and, avoid multiple check combinations|24|\n|[G-20]|Using bools for storage incurs overhead|9|\n|[G-21]|Use assembly to emit events|43|\n|[G-22]|Superfluous event fields|9|\n|[G-23]| >= costs less gas than >|28|\n|[G-24]| Use assembly to check for address(0) |13|\n\n\n## [G-01] Change public function visibility to external\nSince the following public functions are not called from within the contract, their visibility can be made external for gas optimization.\n\n```solidity\n\nfile: V3Vault.sol\n\n277 function decimals() public view override(IERC20Metadata, ERC20) returns (uint8) {\n return assetDecimals;\n }\n\n284 function totalAssets() public view override returns (uint256) {\n return IERC20(asset).balanceOf(address(this));\n }\n\n334 function previewDeposit(uint256 assets) public view o", "vulnerable_code": "file: V3Vault.sol\n\n277 function decimals() public view override(IERC20Metadata, ERC20) returns (uint8) {\n return assetDecimals;\n }\n\n284 function totalAssets() public view override returns (uint256) {\n return IERC20(asset).balanceOf(address(this));\n }\n\n334 function previewDeposit(uint256 assets) public view override returns (uint256) {\n (, uint256 lendExchangeRateX96) = _calculateGlobalInterest();\n return _convertToShares(assets, lendExchangeRateX96, Math.Rounding.Down);\n }\n\n /// @inheritdoc IERC4626\n function previewMint(uint256 shares) public view override returns (uint256) {\n (, uint256 lendExchangeRateX96) = _calculateGlobalInterest();\n return _convertToAssets(shares, lendExchangeRateX96, Math.Rounding.Up);\n }\n\n /// @inheritdoc IERC4626\n function previewWithdraw(uint256 assets) public view override returns (uint256) {\n (, uint256 lendExchangeRateX96) = _calculateGlobalInterest();\n return _convertToShares(assets, lendExchangeRateX96, Math.Rounding.Up);\n }\n\n /// @inheritdoc IERC4626\n352 function previewRedeem(uint256 shares) public view override returns (uint256) {\n (, uint256 lendExchangeRateX96) = _calculateGlobalInterest();\n return _convertToAssets(shares, lendExchangeRateX96, Math.Rounding.Down);\n }", "fixed_code": "file: V3Oracle.sol\n\n162 function getPositionBreakdown(uint256 tokenId)\n public\n view\n override\n returns (\n address token0,\n address token1,\n uint24 fee,\n uint128 liquidity,\n uint256 amount0,\n uint256 amount1,\n uint128 fees0,\n uint128 fees1\n )", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/shamsulhaq123-G.md", "collected_at": "2026-01-02T19:03:16.807374+00:00", "source_hash": "c34d1c541520bfbc67ac9f710a9716984058d275aa79e800266fb70210075d3d", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "file: V3Vault.sol\n\n277 function decimals() public view override(IERC20Metadata, ERC20) returns (uint8) {\n return assetDecimals;\n }\n\n284 function totalAssets() public view override returns (uint256) {\n return IERC20(asset).balanceOf(address(this));\n }\n\n334 function previewDeposit(uint256 assets) public view override returns (uint256) {\n (, uint256 lendExchangeRateX96) = _calculateGlobalInterest();\n return _convertToShares(assets, lendExchangeRateX96, Math.Rounding.Down);\n }\n\n /// @inheritdoc IERC4626\n function previewMint(uint256 shares) public view override returns (uint256) {\n (, uint256 lendExchangeRateX96) = _calculateGlobalInterest();\n return _convertToAssets(shares, lendExchangeRateX96, Math.Rounding.Up);\n }\n\n /// @inheritdoc IERC4626\n function previewWithdraw(uint256 assets) public view override returns (uint256) {\n (, uint256 lendExchangeRateX96) = _calculateGlobalInterest();\n return _convertToShares(assets, lendExchangeRateX96, Math.Rounding.Up);\n }\n\n /// @inheritdoc IERC4626\n352 function previewRedeem(uint256 shares) public view override returns (uint256) {\n (, uint256 lendExchangeRateX96) = _calculateGlobalInterest();\n return _convertToAssets(shares, lendExchangeRateX96, Math.Rounding.Down);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "file: V3Oracle.sol\n\n162 function getPositionBreakdown(uint256 tokenId)\n public\n view\n override\n returns (\n address token0,\n address token1,\n uint24 fee,\n uint128 liquidity,\n uint256 amount0,\n uint256 amount1,\n uint128 fees0,\n uint128 fees1\n )", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "11-kelp", "title": "ZanyBonzy G", "severity_raw": "Gas", "severity": "gas", "description": "### 1. Use uint256(1)/uint256(2) instead of true/false to save gas for changes\nAvoids a Gsset (20000 gas) when changing from false to true, after having been true in the past. \n```\nmapping(address token => bool isSupported) public isSupportedAsset;\n```\nLRTConfig.sol [L15](https://github.com/code-423n4/2023-11-kelp/blob/4b34abc952205e2a34bff893a0de0c75b8052149/src/LRTConfig.sol#L15)\n\n### 2. Initializers can be marked payable\n\n```\n function initialize(\n```\nLRTConfig.sol [L41](https://github.com/code-423n4/2023-11-kelp/blob/4b34abc952205e2a34bff893a0de0c75b8052149/src/LRTConfig.sol#L41)\n```\n function initialize(address lrtConfigAddr) external initializer {\n```\nLRTDepositPool.sol [L31](https://github.com/code-423n4/2023-11-kelp/blob/4b34abc952205e2a34bff893a0de0c75b8052149/src/LRTDepositPool.sol#L31)\n\n```\n function initialize(address lrtConfigAddr) external initializer {\n```\nLRTOracle.sol [L29](https://github.com/code-423n4/2023-11-kelp/blob/4b34abc952205e2a34bff893a0de0c75b8052149/src/LRTOracle.sol#L29)\n\n```\n function initialize(address lrtConfigAddr) external initializer {\n```\nNodeDelegator.sol [L26](https://github.com/code-423n4/2023-11-kelp/blob/4b34abc952205e2a34bff893a0de0c75b8052149/src/NodeDelegator.sol#L26)\n\n```\n function initialize(address admin, address lrtConfigAddr) external initializer {\n```\nRSETH.sol [L32](https://github.com/code-423n4/2023-11-kelp/blob/4b34abc952205e2a34bff893a0de0c75b8052149/src/RSETH.sol#L32)\n\n```\n function initialize(address lrtConfig_) external initializer {\n```\nChainlinkPriceOracle.sol [L27](https://github.com/code-423n4/2023-11-kelp/blob/4b34abc952205e2a34bff893a0de0c75b8052149/src/oracles/ChainlinkPriceOracle.sol#L27)\n\n\n### 3. Instead of using address(this), it is more gas-efficient to pre-calculate and use the hardcoded address, especially if you need to use the same address multiple times in your contract.\n\nThe reason for this, is that using address(this) requires an additional EXTCODESIZE operation to retrieve th", "vulnerable_code": "mapping(address token => bool isSupported) public isSupportedAsset;", "fixed_code": " function initialize(", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/ZanyBonzy-G.md", "collected_at": "2026-01-02T18:27:45.249937+00:00", "source_hash": "c3cc76b39307db7d6694c7c2a19e553b05bf01fd04113e122e240bf6bf6ad468", "code_block_count": 7, "solidity_block_count": 0, "total_code_chars": 424, "github_ref_count": 7, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "mapping(address token => bool isSupported) public isSupportedAsset;", "primary_code_language": "unknown", "primary_code_char_count": 67, "all_code_blocks": "// Code block 1 (unknown):\nmapping(address token => bool isSupported) public isSupportedAsset;\n\n// Code block 2 (unknown):\nfunction initialize(\n\n// Code block 3 (unknown):\nfunction initialize(address lrtConfigAddr) external initializer {\n\n// Code block 4 (unknown):\nfunction initialize(address lrtConfigAddr) external initializer {\n\n// Code block 5 (unknown):\nfunction initialize(address lrtConfigAddr) external initializer {\n\n// Code block 6 (unknown):\nfunction initialize(address admin, address lrtConfigAddr) external initializer {\n\n// Code block 7 (unknown):\nfunction initialize(address lrtConfig_) external initializer {", "all_code_blocks_count": 7, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LRTConfig.sol#L15, LRTConfig.sol#L41, LRTDepositPool.sol#L31, LRTOracle.sol#L29, NodeDelegator.sol#L26, RSETH.sol#L32, ChainlinkPriceOracle.sol#L27", "github_files_list": "LRTOracle.sol, RSETH.sol, NodeDelegator.sol, ChainlinkPriceOracle.sol, LRTConfig.sol, LRTDepositPool.sol", "github_refs_count": 7, "vulnerable_code_actual": "mapping(address token => bool isSupported) public isSupportedAsset;", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function initialize(", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 13} {"source": "c4", "protocol": "03-revert-lend", "title": "0xhacksmithh G", "severity_raw": "High", "severity": "high", "description": "### [Gas-01] `tokenConfigs[token]` could be used as `storage` rather than re-calling it again\n```diff\n function setTokenConfig(address token, uint32 collateralFactorX32, uint32 collateralValueLimitFactorX32)\n external\n onlyOwner\n {\n if (collateralFactorX32 > MAX_COLLATERAL_FACTOR_X32) {\n revert CollateralFactorExceedsMax();\n }\n+ TokenConfig storage config = tokenConfigs[token];\n\n- tokenConfigs[token].collateralFactorX32 = collateralFactorX32; \n- tokenConfigs[token].collateralValueLimitFactorX32 = collateralValueLimitFactorX32;\n\n+ config.collateralFactorX32 = collateralFactorX32; \n+ config.collateralValueLimitFactorX32 = collateralValueLimitFactorX32;\n emit SetTokenConfig(token, collateralFactorX32, collateralValueLimitFactorX32);\n }\n```\n```\nhttps://github.com/code-423n4/2024-03-revert-lend/blob/main/src/V3Vault.sol#L863-L864\n```\n\n### [Gas-02] Some state varible could be cached in memory rather than calling it again and again in same function\n\n#### `nonfungiblePositionManager` could be cached in multiple functions and in multiple contracts\n```diff\n function _sendPositionValue(\n uint256 tokenId,\n .....\n.......\n+ INonfungiblePositionManager _nonfungiblePositionManager = nonfungiblePositionManager;\n // if full position is liquidated - no analysis needed\n if (liquidationValue == fullValue) {\n- (,,,,,,, liquidity,,,,) = nonfungiblePositionManager.positions(tokenId);\n\n+ (,,,,,,, liquidity,,,,) = _nonfungiblePositionManager.positions(tokenId);\n fees0 = type(uint128).max;\n fees1 = type(uint128).max;\n } \n....\n....\n\n if (liquidity > 0) {\n- nonfungiblePositionManager.decreaseLiquidity( \n\n+ _nonfungiblePositionManager.decreaseLiquidity( \n INonfungiblePositionManager.DecreaseLiquidityParams(tokenId, liquidity, 0, 0, block.timestamp)\n );\n }\n\n- (amount0, ", "vulnerable_code": "```\nhttps://github.com/code-423n4/2024-03-revert-lend/blob/main/src/V3Vault.sol#L863-L864", "fixed_code": "```File: V3Vault.sol```", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/0xhacksmithh-G.md", "collected_at": "2026-01-02T19:02:55.676636+00:00", "source_hash": "c3d69d870111c735d073af2e59849879b4a21aeaf0f2772e0d27bc5327fe6e47", "code_block_count": 2, "solidity_block_count": 1, "total_code_chars": 806, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function setTokenConfig(address token, uint32 collateralFactorX32, uint32 collateralValueLimitFactorX32)\n external\n onlyOwner\n {\n if (collateralFactorX32 > MAX_COLLATERAL_FACTOR_X32) {\n revert CollateralFactorExceedsMax();\n }\n+ TokenConfig storage config = tokenConfigs[token];\n\n- tokenConfigs[token].collateralFactorX32 = collateralFactorX32; \n- tokenConfigs[token].collateralValueLimitFactorX32 = collateralValueLimitFactorX32;\n\n+ config.collateralFactorX32 = collateralFactorX32; \n+ config.collateralValueLimitFactorX32 = collateralValueLimitFactorX32;\n emit SetTokenConfig(token, collateralFactorX32, collateralValueLimitFactorX32);\n }", "primary_code_language": "diff", "primary_code_char_count": 721, "all_code_blocks": "// Code block 1 (diff):\nfunction setTokenConfig(address token, uint32 collateralFactorX32, uint32 collateralValueLimitFactorX32)\n external\n onlyOwner\n {\n if (collateralFactorX32 > MAX_COLLATERAL_FACTOR_X32) {\n revert CollateralFactorExceedsMax();\n }\n+ TokenConfig storage config = tokenConfigs[token];\n\n- tokenConfigs[token].collateralFactorX32 = collateralFactorX32; \n- tokenConfigs[token].collateralValueLimitFactorX32 = collateralValueLimitFactorX32;\n\n+ config.collateralFactorX32 = collateralFactorX32; \n+ config.collateralValueLimitFactorX32 = collateralValueLimitFactorX32;\n emit SetTokenConfig(token, collateralFactorX32, collateralValueLimitFactorX32);\n }\n\n// Code block 2 (unknown):\nhttps://github.com/code-423n4/2024-03-revert-lend/blob/main/src/V3Vault.sol#L863-L864", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "function setTokenConfig(address token, uint32 collateralFactorX32, uint32 collateralValueLimitFactorX32)\n external\n onlyOwner\n {\n if (collateralFactorX32 > MAX_COLLATERAL_FACTOR_X32) {\n revert CollateralFactorExceedsMax();\n }\n+ TokenConfig storage config = tokenConfigs[token];\n\n- tokenConfigs[token].collateralFactorX32 = collateralFactorX32; \n- tokenConfigs[token].collateralValueLimitFactorX32 = collateralValueLimitFactorX32;\n\n+ config.collateralFactorX32 = collateralFactorX32; \n+ config.collateralValueLimitFactorX32 = collateralValueLimitFactorX32;\n emit SetTokenConfig(token, collateralFactorX32, collateralValueLimitFactorX32);\n }", "solidity_code": "", "github_refs_formatted": "V3Vault.sol#L863-L864", "github_files_list": "V3Vault.sol", "github_refs_count": 1, "vulnerable_code_actual": "```\nhttps://github.com/code-423n4/2024-03-revert-lend/blob/main/src/V3Vault.sol#L863-L864", "has_vulnerable_code_snippet": true, "fixed_code_actual": "```File: V3Vault.sol```", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "01-biconomy", "title": "chaduke G", "severity_raw": "Low", "severity": "low", "description": "G1. https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol#L58\nAdding unchecked to save gas since overflow is not possible due to previous check.\n```\nunchecked{\n paymasterIdBalances[msg.sender] -= amount;\n}\n\n```\n\nG2. https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/StakeManager.sol#L118\nAdding unchecked to save gas since overflow is not possible due to previous check.\n```\nunchecked{\n info.deposit = uint112(info.deposit - withdrawAmount);\n \n}\n```\n\nG3. https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol#L58\nAdding unchecked to save gas since overflow is not possible due to previous check.\n```\nunchecked{\n paymasterIdBalances[msg.sender] -= amount;\n}\n```\nG4. https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol#L81\nUsing ``userOp.sender`` can save gas.\n```\n\nfunction getHash(UserOperation calldata userOp)\n public pure returns (bytes32) {\n //can't use userOp.hash(), since it contains also the paymasterAndData itself.\n return keccak256(abi.encode(\n userOp.sender,\n userOp.nonce,\n keccak256(userOp.initCode),\n keccak256(userOp.callData),\n userOp.callGasLimit,\n userOp.verificationGasLimit,\n userOp.preVerificationGas,\n userOp.maxFeePerGas,\n userOp.maxPriorityFeePerGas\n ));\n }\n\n```\n\nG5. https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa8124", "vulnerable_code": "unchecked{\n paymasterIdBalances[msg.sender] -= amount;\n}\n", "fixed_code": "unchecked{\n info.deposit = uint112(info.deposit - withdrawAmount);\n \n}", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/chaduke-G.md", "collected_at": "2026-01-02T18:13:36.429441+00:00", "source_hash": "c3e05f2116f7b46277cf2b6e9788be534f3e88efe64f56843c51045282354f19", "code_block_count": 4, "solidity_block_count": 0, "total_code_chars": 774, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "unchecked{\n paymasterIdBalances[msg.sender] -= amount;\n}", "primary_code_language": "unknown", "primary_code_char_count": 60, "all_code_blocks": "// Code block 1 (unknown):\nunchecked{\n paymasterIdBalances[msg.sender] -= amount;\n}\n\n// Code block 2 (unknown):\nunchecked{\n info.deposit = uint112(info.deposit - withdrawAmount);\n \n}\n\n// Code block 3 (unknown):\nunchecked{\n paymasterIdBalances[msg.sender] -= amount;\n}\n\n// Code block 4 (unknown):\nfunction getHash(UserOperation calldata userOp)\n public pure returns (bytes32) {\n //can't use userOp.hash(), since it contains also the paymasterAndData itself.\n return keccak256(abi.encode(\n userOp.sender,\n userOp.nonce,\n keccak256(userOp.initCode),\n keccak256(userOp.callData),\n userOp.callGasLimit,\n userOp.verificationGasLimit,\n userOp.preVerificationGas,\n userOp.maxFeePerGas,\n userOp.maxPriorityFeePerGas\n ));\n }", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "VerifyingSingletonPaymaster.sol#L58, StakeManager.sol#L118, VerifyingSingletonPaymaster.sol#L81", "github_files_list": "VerifyingSingletonPaymaster.sol, StakeManager.sol", "github_refs_count": 3, "vulnerable_code_actual": "unchecked{\n paymasterIdBalances[msg.sender] -= amount;\n}\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "unchecked{\n info.deposit = uint112(info.deposit - withdrawAmount);\n \n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "03-asymmetry", "title": "YY G", "severity_raw": "High", "severity": "high", "description": "# Potential gas optimization in the `addDerivative` function which related to the loop used to calculate the totalWeight of all derivatives.\n\n## Affected Code\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L182-L195\n\n```\n function addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n }\n```\n\n## Description and Impact\n\nThe issue is related to the loop used to calculate the totalWeight of all derivatives. \nEvery time a new derivative is added, the loop iterates over all the derivatives in the weights array to calculate the totalWeight. As the number of derivatives increases, this loop becomes more expensive to execute, which can result in higher gas costs. \n\n\n\n", "vulnerable_code": " function addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n }", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/YY-G.md", "collected_at": "2026-01-02T18:18:40.509128+00:00", "source_hash": "c49e6f5f4abf8e935c01e873d5f9fd3b95b47e391c6d18d46daa6746003174f4", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 506, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n }", "primary_code_language": "unknown", "primary_code_char_count": 506, "all_code_blocks": "// Code block 1 (unknown):\nfunction addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol#L182-L195", "github_files_list": "SafEth.sol", "github_refs_count": 1, "vulnerable_code_actual": " function addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5.29} {"source": "c4", "protocol": "03-asymmetry", "title": "Koko1912 Q", "severity_raw": "High", "severity": "high", "description": "### Table Of Issues\n| ID | Details of the issue |\n|:---|:------|\n| Low | Owner can add a new compromised derivative |\n| Low | Events exist but aren't emitted on important contract changes |\n| Low | The function \"rebalanceToWeights\" leads to bad slippage and should not be recommended for use |\n| Low | Every derivative fallback function could check the upcoming ether value is either from core contract \"SafEth\" or from the allocated deposit pool |\n| Non | The function \"ethPerDerivative\" in SfrxEth and WstEth takes an inputted value, but doesn't used it anywhere |\n| Non | The function \"addDerivative\" lacks an address zero check |\n| Non | Use a more recent pragma version |\n| Non | If derivative has a zero balance of funds, it should continue the loop instead of adding a zero amount of underlying value |\n| Non | The three require statements in the function \"stake\" can be refactored into one |\n| Non | Create your own import names | \n| Non | Floating pragma | \n\n## Low - Owner can add a compromised derivative\nThe function \"addDerivative\" is used for adding new derivatives, which will interact with the core contract SafEth. The problem here is that this function may be abused by the owner, as a result the owner is able to add a new compromised derivative which might be used for stealing user's funds.\n\n```js\nfunction addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n }\n```\n## Low - Events exist but aren't emitted on important contract changes\nThe initializing function in both the core contract and other derivative, set an amount of minAmoun", "vulnerable_code": "function addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n }", "fixed_code": "function initialize(\n string memory _tokenName,\n string memory _tokenSymbol\n ) external initializer {\n ERC20Upgradeable.__ERC20_init(_tokenName, _tokenSymbol);\n _transferOwnership(msg.sender);\n minAmount = 5 * 10 ** 17; // initializing with .5 ETH as minimum\n maxAmount = 200 * 10 ** 18; // initializing with 200 ETH as maximum\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Koko1912-Q.md", "collected_at": "2026-01-02T18:18:15.243957+00:00", "source_hash": "c4f0583852dbfa65e0a399d2938a5fc8ba08e530570b145e48fc42ff29bd64d7", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 506, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n }", "primary_code_language": "js", "primary_code_char_count": 506, "all_code_blocks": "// Code block 1 (js):\nfunction addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function initialize(\n string memory _tokenName,\n string memory _tokenSymbol\n ) external initializer {\n ERC20Upgradeable.__ERC20_init(_tokenName, _tokenSymbol);\n _transferOwnership(msg.sender);\n minAmount = 5 * 10 ** 17; // initializing with .5 ETH as minimum\n maxAmount = 200 * 10 ** 18; // initializing with 200 ETH as maximum\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "07-amphora", "title": "Rolezn G", "severity_raw": "Medium", "severity": "medium", "description": "## GAS Summary\n\n### Gas Optimizations\n| |Issue|Contexts|Estimated Gas Saved|\n|-|:-|:-|:-:|\n| [GAS‑1](#gas1-counting-down-in-for-statements-is-more-gas-efficient) | Counting down in `for` statements is more gas efficient | 5 | 1285 |\n| [GAS‑2](#gas2-multiple-accesses-of-a-mappingarray-should-use-a-local-variable-cache) | Multiple accesses of a mapping/array should use a local variable cache | 43 | 3440 |\n| [GAS‑3](#gas3-the-result-of-a-function-call-should-be-cached-rather-than-recalling-the-function) | The result of a function call should be cached rather than re-calling the function | 33 | 1650 |\n| [GAS‑4](#gas4-use-v492-openzeppelin-contracts) | Use v4.9.2 OpenZeppelin contracts | 1 | 28 |\n| [GAS‑5](#gas5-use-nested-if-and-avoid-multiple-check-combinations) | Use nested `if` and avoid multiple check combinations | 5 | 30 |\n| [GAS‑6](#gas6-using-xor-^-and-and-&-bitwise-equivalents) | Using XOR (^) and AND (&) bitwise equivalents | 46 | 598 |\n\nTotal: 187 contexts over 6 issues\n\n## Gas Optimizations\n\n\n\n\n### [GAS‑1] Counting down in `for` statements is more gas efficient\n\nCounting down is more gas efficient than counting up because neither we are making zero variable to non-zero variable and also we will get gas refund in the last transaction when making non-zero to zero variable.\n\n#### Proof Of Concept\n\n
\n\n```solidity\nFile: VaultController.sol\n\n868: for (uint192 _i; _i < enabledTokens.length; ++_i) {\n\n```\n\nhttps://github.com/code-423n4/2023-07-amphora/tree/main/core/solidity/contracts/core/VaultController.sol#L868\n\n```solidity\nFile: VaultController.sol\n\n896: for (uint192 _i; _i < enabledTokens.length; ++_i) {\n\n```\n\nhttps://github.com/code-423n4/2023-07-amphora/tree/main/core/solidity/contracts/core/VaultController.sol#L896\n\n```solidity\nFile: GovernorCharlie.sol\n\n259: for (uint256 _i = 0; _i < _proposal.targets.length; _i++) {\n\n``", "vulnerable_code": "File: VaultController.sol\n\n868: for (uint192 _i; _i < enabledTokens.length; ++_i) {\n", "fixed_code": "File: VaultController.sol\n\n896: for (uint192 _i; _i < enabledTokens.length; ++_i) {\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/Rolezn-G.md", "collected_at": "2026-01-02T18:23:32.279533+00:00", "source_hash": "c4f3f8c6c961222c5d472a7813feb2b12b2d56c5351e52115634bfb9f5b16696", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 166, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: VaultController.sol\n\n868: for (uint192 _i; _i < enabledTokens.length; ++_i) {", "primary_code_language": "solidity", "primary_code_char_count": 83, "all_code_blocks": "// Code block 1 (solidity):\nFile: VaultController.sol\n\n868: for (uint192 _i; _i < enabledTokens.length; ++_i) {\n\n// Code block 2 (solidity):\nFile: VaultController.sol\n\n896: for (uint192 _i; _i < enabledTokens.length; ++_i) {", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: VaultController.sol\n\n868: for (uint192 _i; _i < enabledTokens.length; ++_i) {\n\nFile: VaultController.sol\n\n896: for (uint192 _i; _i < enabledTokens.length; ++_i) {", "github_refs_formatted": "VaultController.sol#L868, VaultController.sol#L896", "github_files_list": "VaultController.sol", "github_refs_count": 2, "vulnerable_code_actual": "File: VaultController.sol\n\n868: for (uint192 _i; _i < enabledTokens.length; ++_i) {\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: VaultController.sol\n\n896: for (uint192 _i; _i < enabledTokens.length; ++_i) {\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "03-asymmetry", "title": "0xWaitress Q", "severity_raw": "Unknown", "severity": "unknown", "description": "1. In WstEth.sol, the `ethPerDerivative` is hardcoded to return 1 while both rETH and sfrxETH is using a more native conversion within their corresponding protocol.\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol#L86\n\nActually price of stETH can be fetched from the curveAMM too using the get_dy.\n\nUpdated Approach\n\n```\nfunction ethPerDerivative(uint256 _amount) public view returns (uint256) {\n return 10 ** 18 * (IStEthEthPool(LIDO_CRV_POOL).get_dy(1, 0, stEthBal) / stEthBal);\n }\n```\n\nCurrent Approach\n``` \nfunction ethPerDerivative(uint256 _amount) public view returns (uint256) {\n return IWStETH(WST_ETH).getStETHByWstETH(10 ** 18);\n }\n```\n\n2. \n`unstake()` in safETH would be blocked if any derivative gets blocked during `withdraw`\nThe system essentially comes to a halt if any of stETH/frxETH/rETH stops their withdrawal.\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L108\n\n```\n function unstake(uint256 _safEthAmount) external {\n require(pauseUnstaking == false, \"unstaking is paused\");\n uint256 safEthTotalSupply = totalSupply();\n uint256 ethAmountBefore = address(this).balance;\n\n for (uint256 i = 0; i < derivativeCount; i++) {\n // withdraw a percentage of each asset based on the amount of safETH\n uint256 derivativeAmount = (derivatives[i].balance() *\n _safEthAmount) / safEthTotalSupply;\n if (derivativeAmount == 0) continue; // if derivative empty ignore\n derivatives[i].withdraw(derivativeAmount);\n }\n```\n\n", "vulnerable_code": "function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n return 10 ** 18 * (IStEthEthPool(LIDO_CRV_POOL).get_dy(1, 0, stEthBal) / stEthBal);\n }", "fixed_code": "function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n return IWStETH(WST_ETH).getStETHByWstETH(10 ** 18);\n }", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/0xWaitress-Q.md", "collected_at": "2026-01-02T18:17:38.690299+00:00", "source_hash": "c51cc2d32aedf311b755ec58878b5c40e25a4e3966c5e3dc8d067a6df73c42bf", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 445, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n return 10 ** 18 * (IStEthEthPool(LIDO_CRV_POOL).get_dy(1, 0, stEthBal) / stEthBal);\n }", "primary_code_language": "unknown", "primary_code_char_count": 172, "all_code_blocks": "// Code block 1 (unknown):\nfunction ethPerDerivative(uint256 _amount) public view returns (uint256) {\n return 10 ** 18 * (IStEthEthPool(LIDO_CRV_POOL).get_dy(1, 0, stEthBal) / stEthBal);\n }\n\n// Code block 2 (unknown):\n2. \n`unstake()` in safETH would be blocked if any derivative gets blocked during `withdraw`\nThe system essentially comes to a halt if any of stETH/frxETH/rETH stops their withdrawal.\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L108", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "WstEth.sol#L86, SafEth.sol#L108", "github_files_list": "WstEth.sol, SafEth.sol", "github_refs_count": 2, "vulnerable_code_actual": "function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n return 10 ** 18 * (IStEthEthPool(LIDO_CRV_POOL).get_dy(1, 0, stEthBal) / stEthBal);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function ethPerDerivative(uint256 _amount) public view returns (uint256) {\n return IWStETH(WST_ETH).getStETHByWstETH(10 ** 18);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-ondo", "title": "Aymen0909 G", "severity_raw": "Medium", "severity": "medium", "description": "# Gas Optimizations\n\n## Summary\n\n| | Issue | Instances |\n| :-------------: |:-------------|:-------------:|\n| 1 | Multiple address/IDs mappings can be combined into a single mapping of an address/id to a struct | 5 |\n| 2 | State variables only set in the constructor should be declared `immutable` | 1 |\n| 3 | `storage` variable should be cached into `memory` variables instead of re-reading them | 4 |\n| 4 | Use `unchecked` blocks to save gas | 4 |\n| 5 | Unecessary initialization of `currentEpoch` in the constructor | 1 |\n| 6 | `x += y/x -= y` costs more gas than `x = x + y/x = x - y` for state variables | 8 |\n| 7 | `require()` strings longer than 32 bytes cost extra gas | 9 |\n| 8 | Splitting `require()` statements that uses && saves gas | 1 |\n| 9 | `++i/i++` should be `unchecked{++i}`/`unchecked{i++}` when it is not possible for them to overflow (for & while loops) | 9 |\n\n\n## Findings\n\n### 1- Multiple address/IDs mappings can be combined into a single mapping of an address/id to a struct :\n\nSaves a storage slot for the mapping. Depending on the circumstances and sizes of types, can avoid a Gsset (20000 gas) per mapping combined. Reads and subsequent writes can also be cheaper when a function requires both values and they both fit in the same storage slot. Finally, if both fields are accessed in the same function, can save ~42 gas per access due to not having to recalculate the key's keccak256 hash (Gkeccak256 - 30 gas) and that calculation's associated stack operations.\n\nThere are 5 instances of this issue :\n\nFile: lending/OndoPriceOracleV2.sol [Line 55-73](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/OndoPriceOracleV2.sol#L55-L73)\n\n```\n55 mapping(address => OracleType) public fTokenToOracleType;\n58 mapping(address => uint256) public fTokenToUnderlyingPrice;\n62 mapping(address => address) public fTokenToCToken;\n70 mapping(address => ChainlinkOracleInfo) public fTokenToChainlinkOracle;\n73 ", "vulnerable_code": "55 mapping(address => OracleType) public fTokenToOracleType;\n58 mapping(address => uint256) public fTokenToUnderlyingPrice;\n62 mapping(address => address) public fTokenToCToken;\n70 mapping(address => ChainlinkOracleInfo) public fTokenToChainlinkOracle;\n73 mapping(address => uint256) public fTokenToUnderlyingPriceCap;", "fixed_code": "struct fToken {\n OracleType fTokenToOracleType;\n uint256 fTokenToUnderlyingPrice;\n address fTokenToCToken;\n ChainlinkOracleInfo fTokenToChainlinkOracle;\n uint256 fTokenToUnderlyingPriceCap;\n}\n \nmapping(address => fToken) public _fTokens;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/Aymen0909-G.md", "collected_at": "2026-01-02T18:14:27.938623+00:00", "source_hash": "c5205c6088d8e7500e645d6500d492aaad10edd1260df590bd26d9306bc62073", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "OndoPriceOracleV2.sol#L55-L73", "github_files_list": "OndoPriceOracleV2.sol", "github_refs_count": 1, "vulnerable_code_actual": "55 mapping(address => OracleType) public fTokenToOracleType;\n58 mapping(address => uint256) public fTokenToUnderlyingPrice;\n62 mapping(address => address) public fTokenToCToken;\n70 mapping(address => ChainlinkOracleInfo) public fTokenToChainlinkOracle;\n73 mapping(address => uint256) public fTokenToUnderlyingPriceCap;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "struct fToken {\n OracleType fTokenToOracleType;\n uint256 fTokenToUnderlyingPrice;\n address fTokenToCToken;\n ChainlinkOracleInfo fTokenToChainlinkOracle;\n uint256 fTokenToUnderlyingPriceCap;\n}\n \nmapping(address => fToken) public _fTokens;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "11-kelp", "title": "adeolu Q", "severity_raw": "Low", "severity": "low", "description": "## [LOW -01] - getRsETHAmountToMint() should check that asset address suplied is a supported asset \n\n### Description\nin `getRsETHAmountToMint()` there are no checks to see that the address supplied as `asset` is a supported asset. A unsupported asset can be supplied to the function logic, This can be misleading to users who use the function to predict the amounts of RsETH they can mint. Thus this is an incomplete validation of inputs to the view function. \n\n```\n function getRsETHAmountToMint(\n address asset,\n uint256 amount\n )\n public\n view\n override\n returns (uint256 rsethAmountToMint)\n {\n // setup oracle contract\n address lrtOracleAddress = lrtConfig.getContract(LRTConstants.LRT_ORACLE);\n ILRTOracle lrtOracle = ILRTOracle(lrtOracleAddress);\n\n // calculate rseth amount to mint based on asset amount and asset exchange rate\n // 2e18 * 998918684011422300 / 1.998e+18 = 0.9999186e+18 ; \n rsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();\n }\n```\n\n### Recommended Mitigation\nadd the modifier `onlySupportedAsset(asset)` to the function code.\n", "vulnerable_code": " function getRsETHAmountToMint(\n address asset,\n uint256 amount\n )\n public\n view\n override\n returns (uint256 rsethAmountToMint)\n {\n // setup oracle contract\n address lrtOracleAddress = lrtConfig.getContract(LRTConstants.LRT_ORACLE);\n ILRTOracle lrtOracle = ILRTOracle(lrtOracleAddress);\n\n // calculate rseth amount to mint based on asset amount and asset exchange rate\n // 2e18 * 998918684011422300 / 1.998e+18 = 0.9999186e+18 ; \n rsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();\n }", "fixed_code": "", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/adeolu-Q.md", "collected_at": "2026-01-02T18:27:47.066486+00:00", "source_hash": "c544371d77545907100e25fcc54c0d20b7e1122ef8e5dadb6642a51a393bc4e1", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 617, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function getRsETHAmountToMint(\n address asset,\n uint256 amount\n )\n public\n view\n override\n returns (uint256 rsethAmountToMint)\n {\n // setup oracle contract\n address lrtOracleAddress = lrtConfig.getContract(LRTConstants.LRT_ORACLE);\n ILRTOracle lrtOracle = ILRTOracle(lrtOracleAddress);\n\n // calculate rseth amount to mint based on asset amount and asset exchange rate\n // 2e18 * 998918684011422300 / 1.998e+18 = 0.9999186e+18 ; \n rsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();\n }", "primary_code_language": "unknown", "primary_code_char_count": 617, "all_code_blocks": "// Code block 1 (unknown):\nfunction getRsETHAmountToMint(\n address asset,\n uint256 amount\n )\n public\n view\n override\n returns (uint256 rsethAmountToMint)\n {\n // setup oracle contract\n address lrtOracleAddress = lrtConfig.getContract(LRTConstants.LRT_ORACLE);\n ILRTOracle lrtOracle = ILRTOracle(lrtOracleAddress);\n\n // calculate rseth amount to mint based on asset amount and asset exchange rate\n // 2e18 * 998918684011422300 / 1.998e+18 = 0.9999186e+18 ; \n rsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function getRsETHAmountToMint(\n address asset,\n uint256 amount\n )\n public\n view\n override\n returns (uint256 rsethAmountToMint)\n {\n // setup oracle contract\n address lrtOracleAddress = lrtConfig.getContract(LRTConstants.LRT_ORACLE);\n ILRTOracle lrtOracle = ILRTOracle(lrtOracleAddress);\n\n // calculate rseth amount to mint based on asset amount and asset exchange rate\n // 2e18 * 998918684011422300 / 1.998e+18 = 0.9999186e+18 ; \n rsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.38} {"source": "c4", "protocol": "05-ajna", "title": "descharre Q", "severity_raw": "Critical", "severity": "critical", "description": "# Summary\n## Low Risk\n|ID | Finding| Instances |\n|:----: | :--- | :----: |\n|L-01 |Treasury can be wrong if funded proposal is not executed|1|\n|L-02 |Proposal parameters are not correctly checked|1|\n\n\n\n## Non critical\n|ID | Finding| Instances |\n|:----: | :--- | :----: |\n|N-01 | Use a more recent version of solidity | 1|\n|N-02 | `startNewDistributionPeriod()` will likely be called everytime before challenge period ends| 1|\n|N-03 | Typos| 3|\n|N-04 | Require or if statements that check input arguments should be at the top of the function| 1|\n|N-05 | Unnecessary code| 1|\n|N-06 | Don't use msg.sender as a parameter for an internal function that's only used once| 2|\n|N-07 | Remove block.number from events| 2|\n\n# Details\n## Low Risk\n## [L-01] Treasury can be wrong if funded proposal is not executed\nThe function [`_updateTreasury()`](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L197-L214) doesn't check if a proposal is executed. It updates it's amount by all the tokens requested from the distributions slate. However when a proposal is gonna be [executed](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/Funding.sol#L52-L66) it's still possible to revert for various reasons. For example the contract that the proposal want to use reverts on \n_beforeTokenTransfer. Or the contract is paused and doesn't allow any tokens to be sent to the contract.\n\nWhen this proposal will not be executed in the future, the treasury will be forever wrong. Resulting in more tokens in the treasury than the `treasury` variable is.\n\nA mitigation for this is to check if a proposal is executed and then decrement the treasury with the tokens requested from said proposal. \n\n## [L-02] Proposal parameters are not correctly checked\nThe function [`_validateCallDatas()`](https://github.com/code-423n4/2023-05-ajna/blob/main/a", "vulnerable_code": "## Non critical\n## [N-01] Use a more recent version of solidity \nThe contracts in ajna-core use solidity version 0.8.14. Later release versions have new features and bug fixes. Consider using a later version.\n\n## [N-02] `startNewDistributionPeriod()` will likely be called everytime before challenge period ends\nThe challenge period is a period of 7 days after the funding stage has ended. However the [`startNewDistributionPeriod()`](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L119-L164) can be called by everyone immeditaly after the funding stage has ended. This means the function most likely will not be called after the challenge stage has ended and the first if statement will never be true. This isn't a big problem because it will just be called the next time the distribution gets incremented, so the first if statement to update the treasury can be removed.\n", "fixed_code": "## [N-03] Typos\n- [StandardFunding.sol#L216](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L216): `// readd non distributed tokens to the treasury`: readd\n- [StandardFunding.sol#L632](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L632): `// check that the voter hasn't already voted on a proposal by seeing if it's already in the votesCast array`: should be this proposal\n- [PositionManager.sol#L352](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/PositionManager.sol#L352): `function reedemPositions(`: should be redeem\n## [N-04] Require or if statements that check input arguments should be at the top of the function\n[StandardFunding.sol#L423-L425](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L423-L425): check for challenge period should be in the [`updateSlate()`](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L300-L340) function, this also saves an extra function parameter.\n## [N-05] Unnecessary code\n[StandardFunding.sol#L317-L318](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L317-L318):", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/descharre-Q.md", "collected_at": "2026-01-02T18:21:25.383492+00:00", "source_hash": "c57b1108385dde75cf991b38e0a6dbd3e964c20ca3878387b70953efd7d4790c", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 9, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "StandardFunding.sol#L197-L214, Funding.sol#L52-L66, StandardFunding.sol#L119-L164, StandardFunding.sol#L216, StandardFunding.sol#L632, PositionManager.sol#L352, StandardFunding.sol#L423-L425, StandardFunding.sol#L300-L340, StandardFunding.sol#L317-L318", "github_files_list": "Funding.sol, StandardFunding.sol, PositionManager.sol", "github_refs_count": 9, "vulnerable_code_actual": "## Non critical\n## [N-01] Use a more recent version of solidity \nThe contracts in ajna-core use solidity version 0.8.14. Later release versions have new features and bug fixes. Consider using a later version.\n\n## [N-02] `startNewDistributionPeriod()` will likely be called everytime before challenge period ends\nThe challenge period is a period of 7 days after the funding stage has ended. However the [`startNewDistributionPeriod()`](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L119-L164) can be called by everyone immeditaly after the funding stage has ended. This means the function most likely will not be called after the challenge stage has ended and the first if statement will never be true. This isn't a big problem because it will just be called the next time the distribution gets incremented, so the first if statement to update the treasury can be removed.\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## [N-03] Typos\n- [StandardFunding.sol#L216](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L216): `// readd non distributed tokens to the treasury`: readd\n- [StandardFunding.sol#L632](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L632): `// check that the voter hasn't already voted on a proposal by seeing if it's already in the votesCast array`: should be this proposal\n- [PositionManager.sol#L352](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/PositionManager.sol#L352): `function reedemPositions(`: should be redeem\n## [N-04] Require or if statements that check input arguments should be at the top of the function\n[StandardFunding.sol#L423-L425](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L423-L425): check for challenge period should be in the [`updateSlate()`](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L300-L340) function, this also saves an extra function parameter.\n## [N-05] Unnecessary code\n[StandardFunding.sol#L317-L318](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L317-L318):", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "11-kelp", "title": "mgf15 G", "severity_raw": "Medium", "severity": "medium", "description": "## **G-1** | Use do while loops instead of for loops\nA do while loop will cost less gas since the condition is not being checked for the first iteration. \n\n```diff\ndiff --git a/LRTDepositPool.sol b/aLRTDepositPool.sol\nindex 29ea4d2..84a3c0b 100644\n--- a/LRTDepositPool.sol\n+++ b/aLRTDepositPool.sol\n@@ -160,19 +161,21 @@ contract LRTDepositPool is ILRTDepositPool, LRTConfigRoleChecker, PausableUpgrad\n /// @dev only callable by LRT manager\n /// @param nodeDelegatorContracts Array of NodeDelegator contract addresses\n function addNodeDelegatorContractToQueue(address[] calldata nodeDelegatorContracts) external onlyLRTAdmin {\n- uint256 length = nodeDelegatorContracts.length;\n- if (nodeDelegatorQueue.length + length > maxNodeDelegatorCount) {\n+ //uint256 length = nodeDelegatorContracts.length;\n+ //@audit use do while\n+ if (nodeDelegatorQueue.length + nodeDelegatorContracts.length > maxNodeDelegatorCount) {\n revert MaximumNodeDelegatorCountReached();\n }\n-\n- for (uint256 i; i < length;) {\n+ uint256 i;\n+ do{\n+ //for (uint256 i; i < nodeDelegatorContracts.length;) {\n UtilLib.checkNonZeroAddress(nodeDelegatorContracts[i]);\n nodeDelegatorQueue.push(nodeDelegatorContracts[i]);\n emit NodeDelegatorAddedinQueue(nodeDelegatorContracts[i]);\n unchecked {\n ++i;\n }\n- }\n+ }while(i Gas diff\n\n```diff\n | src/LRTDepositPool.sol:LRTDepositPool contract | | | | | |\n |------------------------------------------------|-----------------|-------|--------|--------|---------|\n | Deployment Cost | Deployment Size | | | | |\n-| 1686453 | 8550 | | | | |\n+| 1684453 ", "vulnerable_code": "> Gas diff\n", "fixed_code": "```diff\ndiff --git a/LRTOracle.sol b/aLRTOracle.sol\nindex 48c981a..8fef1e3 100644\n--- a/LRTOracle.sol\n+++ b/aLRTOracle.sol\n@@ -62,8 +62,9 @@ contract LRTOracle is ILRTOracle, LRTConfigRoleChecker, PausableUpgradeable {\n \n address[] memory supportedAssets = lrtConfig.getSupportedAssetList();\n uint256 supportedAssetCount = supportedAssets.length;\n-\n- for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n+ //@audit use do while\n+ uint16 asset_idx;\n+ do{//for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n address asset = supportedAssets[asset_idx];\n uint256 assetER = getAssetPrice(asset);\n \n@@ -73,7 +74,7 @@ contract LRTOracle is ILRTOracle, LRTConfigRoleChecker, PausableUpgradeable {\n unchecked {\n ++asset_idx;\n }\n- }\n+ }while(asset_idx < supportedAssetCount);\n \n return totalETHInPool / rsEthSupply;\n }\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/mgf15-G.md", "collected_at": "2026-01-02T18:28:16.559167+00:00", "source_hash": "c5851e7ca8b5402a26a3b1d4ddcfed337bd6dc9a9ac404725cb4a1d5bab113d4", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 1337, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "diff --git a/LRTDepositPool.sol b/aLRTDepositPool.sol\nindex 29ea4d2..84a3c0b 100644\n--- a/LRTDepositPool.sol\n+++ b/aLRTDepositPool.sol\n@@ -160,19 +161,21 @@ contract LRTDepositPool is ILRTDepositPool, LRTConfigRoleChecker, PausableUpgrad\n /// @dev only callable by LRT manager\n /// @param nodeDelegatorContracts Array of NodeDelegator contract addresses\n function addNodeDelegatorContractToQueue(address[] calldata nodeDelegatorContracts) external onlyLRTAdmin {\n- uint256 length = nodeDelegatorContracts.length;\n- if (nodeDelegatorQueue.length + length > maxNodeDelegatorCount) {\n+ //uint256 length = nodeDelegatorContracts.length;\n+ //@audit use do while\n+ if (nodeDelegatorQueue.length + nodeDelegatorContracts.length > maxNodeDelegatorCount) {\n revert MaximumNodeDelegatorCountReached();\n }\n-\n- for (uint256 i; i < length;) {\n+ uint256 i;\n+ do{\n+ //for (uint256 i; i < nodeDelegatorContracts.length;) {\n UtilLib.checkNonZeroAddress(nodeDelegatorContracts[i]);\n nodeDelegatorQueue.push(nodeDelegatorContracts[i]);\n emit NodeDelegatorAddedinQueue(nodeDelegatorContracts[i]);\n unchecked {\n ++i;\n }\n- }\n+ }while(i maxNodeDelegatorCount) {\n+ //uint256 length = nodeDelegatorContracts.length;\n+ //@audit use do while\n+ if (nodeDelegatorQueue.length + nodeDelegatorContracts.length > maxNodeDelegatorCount) {\n revert MaximumNodeDelegatorCountReached();\n }\n-\n- for (uint256 i; i < length;) {\n+ uint256 i;\n+ do{\n+ //for (uint256 i; i < nodeDelegatorContracts.length;) {\n UtilLib.checkNonZeroAddress(nodeDelegatorContracts[i]);\n nodeDelegatorQueue.push(nodeDelegatorContracts[i]);\n emit NodeDelegatorAddedinQueue(nodeDelegatorContracts[i]);\n unchecked {\n ++i;\n }\n- }\n+ }while(i maxNodeDelegatorCount) {\n+ //uint256 length = nodeDelegatorContracts.length;\n+ //@audit use do while\n+ if (nodeDelegatorQueue.length + nodeDelegatorContracts.length > maxNodeDelegatorCount) {\n revert MaximumNodeDelegatorCountReached();\n }\n-\n- for (uint256 i; i < length;) {\n+ uint256 i;\n+ do{\n+ //for (uint256 i; i < nodeDelegatorContracts.length;) {\n UtilLib.checkNonZeroAddress(nodeDelegatorContracts[i]);\n nodeDelegatorQueue.push(nodeDelegatorContracts[i]);\n emit NodeDelegatorAddedinQueue(nodeDelegatorContracts[i]);\n unchecked {\n ++i;\n }\n- }\n+ }while(i Gas diff\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "```diff\ndiff --git a/LRTOracle.sol b/aLRTOracle.sol\nindex 48c981a..8fef1e3 100644\n--- a/LRTOracle.sol\n+++ b/aLRTOracle.sol\n@@ -62,8 +62,9 @@ contract LRTOracle is ILRTOracle, LRTConfigRoleChecker, PausableUpgradeable {\n \n address[] memory supportedAssets = lrtConfig.getSupportedAssetList();\n uint256 supportedAssetCount = supportedAssets.length;\n-\n- for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n+ //@audit use do while\n+ uint16 asset_idx;\n+ do{//for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n address asset = supportedAssets[asset_idx];\n uint256 assetER = getAssetPrice(asset);\n \n@@ -73,7 +74,7 @@ contract LRTOracle is ILRTOracle, LRTConfigRoleChecker, PausableUpgradeable {\n unchecked {\n ++asset_idx;\n }\n- }\n+ }while(asset_idx < supportedAssetCount);\n \n return totalETHInPool / rsEthSupply;\n }\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "11-kelp", "title": "glcanvas Analysis", "severity_raw": "High", "severity": "high", "description": "# Approach taken in evaluating the codebase\n\nTo understand protocol was used EigenLayer documentation.\n\nFlow:\n1) Start with understanding linked protocol. This protocol is EigenLayer. Read whitepaper and linked documentation first.\n2) Then determine which part of EigenLayer protocol used by Kelp DAO. The audited protocol uses only Strategy Manager and Strategy. Current implementation of Kelp DAO doesn't support withdrawn.\n3) Then proceed to manual code review.\n\n# Architecture recommendations\n\nCurrent architecture is well designed.\n\nIt's absolutely correct to separate DepositPool and NodeDelagator into two different contracts. Because, if one of these contract will be hacked, then protocol lost only one part. \n\n**But here is one detail, which is important to highlight.**\nWithdraws. \nCurrent implementation doesn't support withdraws. \nDevs told that it will be added later. \nBut, when we deposit some asset (like stETH and rETH) to Kelp -- we erase the boundaries of these tokens and after that moment it becomes unclear who contributed which tokens.\nFor example:\n* Alice deposits 1 stETH, he got 1 rsETH;\n* Bob deposits 1 rETH, he got 1 rsETH;\n* Now we have 2 rsETH and 1 stETH and 1 rETH, but don't know who initial depositor.\n\n**Moreover, if you go to prod right now, it will be impossible to determine later who deposit which tokens.**\n\nNeed to support additional mapping of: `user => asset => initial asset amount`.\n\n# Codebase quality analysis\n\nCodebase is really good, all cases are handled correctly. \nDev team writes good and clear comments and uses meaningful named-attributes in mapping.\n\nHowever, devs uses transfer, transferFrom and approve instead of safe version of these functions. Better to use safe implementation by OppenZeppelin, because tokens, which will be added in future may return nothing in `transfer`.\n\n*Additional notice:*\nLRTConfig has `tokenMap` which is used for clarity description of what address responsible for. \nBut current implementation gives possibi", "vulnerable_code": " User\n |\n | User's funds\n \u2228\n--------------- transfer assets ----------------- enter into strategy --------------\n| DepositPool | <============> | NodeDelegator | =====> | EigenLayer |\n--------------- ----------------- --------------\n ^\n | \n | Request Price\n \u2228\n ---------- \n | Oracle |\n ----------", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/glcanvas-Analysis.md", "collected_at": "2026-01-02T18:28:04.575770+00:00", "source_hash": "c5cb62e8621885a5849279c4add22064dbe4855d225ff5b38c80bb31f6d18278", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " User\n |\n | User's funds\n \u2228\n--------------- transfer assets ----------------- enter into strategy --------------\n| DepositPool | <============> | NodeDelegator | =====> | EigenLayer |\n--------------- ----------------- --------------\n ^\n | \n | Request Price\n \u2228\n ---------- \n | Oracle |\n ----------", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4} {"source": "c4", "protocol": "01-ondo", "title": "RaymondFam G", "severity_raw": "High", "severity": "high", "description": "## Early checks\nChecks via require statement in a function logic should be as early as possible to minimize gas waste in case of a revert.\n\nFor instance, the code block below can be refactored as follows:\n\n[File: Cash.sol#L29-L40](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/token/Cash.sol#L29-L40)\n\n```diff\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal override {\n- super._beforeTokenTransfer(from, to, amount);\n\n require(\n hasRole(TRANSFER_ROLE, _msgSender()),\n \"Cash: must have TRANSFER_ROLE to transfer\"\n );\n\n+ super._beforeTokenTransfer(from, to, amount);\n }\n```\nAll other instances entailed:\n\n[File: CashKYCSenderReceiver.sol#L63-L66](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/token/CashKYCSenderReceiver.sol#L63-L66)\n\n[File: CashKYCSender.sol#L63-L66](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/token/CashKYCSender.sol#L63-L66)\n\n## Use of named returns for local variables saves gas\nYou can have further advantages in term of gas cost by simply using named return values as temporary local variable.\n\nFor instance, the code block below may be refactored as follows:\n\n[File: CashFactory.sol#L75-L110](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashFactory.sol#L75-L110)\n\n```diff\n function deployCash(\n string calldata name,\n string calldata ticker\n- ) external onlyGuardian returns (address, address, address) {\n+ ) external onlyGuardian returns (address cashProxiedAddr, address cashProxyAdminAddr, address cashImplementationAddr) {\n\n [ ... ]\n\n- return (\n+ (cashProxiedAddr, cashProxyAdminAddr, cashImplementationAddr) =\n address(cashProxied),\n address(cashProxyAdmin),\n address(cashImplementation)\n );\n```\n## Use `break` or `continue` in for loop \nFor loop entailing large array with reverting logic should incorporate `break` or `continue` to cater for element(s) failing", "vulnerable_code": "All other instances entailed:\n\n[File: CashKYCSenderReceiver.sol#L63-L66](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/token/CashKYCSenderReceiver.sol#L63-L66)\n\n[File: CashKYCSender.sol#L63-L66](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/token/CashKYCSender.sol#L63-L66)\n\n## Use of named returns for local variables saves gas\nYou can have further advantages in term of gas cost by simply using named return values as temporary local variable.\n\nFor instance, the code block below may be refactored as follows:\n\n[File: CashFactory.sol#L75-L110](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashFactory.sol#L75-L110)\n", "fixed_code": "## Use `break` or `continue` in for loop \nFor loop entailing large array with reverting logic should incorporate `break` or `continue` to cater for element(s) failing to get through the iteration(s). This will tremendously save gas on instances where the loop specifically fails to execute at the end of the iterations.\n\nHere are the three instances unanimously using the same/identical function logic:\n\n[File: CashFactory.sol#L123-L134](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashFactory.sol#L123-L134) \n[File: CashKYCSenderFactory.sol#L133-L144](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashKYCSenderFactory.sol#L133-L144)\n[File: CashKYCSenderReceiverFactory.sol#L133-L143](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashKYCSenderReceiverFactory.sol#L133-L143)\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/RaymondFam-G.md", "collected_at": "2026-01-02T18:14:44.413728+00:00", "source_hash": "c60476874ecc438ffad2fd9ae1d2e93e567914f5e713204fb5757dcf1a254ee6", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 787, "github_ref_count": 7, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal override {\n- super._beforeTokenTransfer(from, to, amount);\n\n require(\n hasRole(TRANSFER_ROLE, _msgSender()),\n \"Cash: must have TRANSFER_ROLE to transfer\"\n );\n\n+ super._beforeTokenTransfer(from, to, amount);\n }", "primary_code_language": "diff", "primary_code_char_count": 329, "all_code_blocks": "// Code block 1 (diff):\nfunction _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal override {\n- super._beforeTokenTransfer(from, to, amount);\n\n require(\n hasRole(TRANSFER_ROLE, _msgSender()),\n \"Cash: must have TRANSFER_ROLE to transfer\"\n );\n\n+ super._beforeTokenTransfer(from, to, amount);\n }\n\n// Code block 2 (diff):\nfunction deployCash(\n string calldata name,\n string calldata ticker\n- ) external onlyGuardian returns (address, address, address) {\n+ ) external onlyGuardian returns (address cashProxiedAddr, address cashProxyAdminAddr, address cashImplementationAddr) {\n\n [ ... ]\n\n- return (\n+ (cashProxiedAddr, cashProxyAdminAddr, cashImplementationAddr) =\n address(cashProxied),\n address(cashProxyAdmin),\n address(cashImplementation)\n );", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal override {\n- super._beforeTokenTransfer(from, to, amount);\n\n require(\n hasRole(TRANSFER_ROLE, _msgSender()),\n \"Cash: must have TRANSFER_ROLE to transfer\"\n );\n\n+ super._beforeTokenTransfer(from, to, amount);\n }\n\nfunction deployCash(\n string calldata name,\n string calldata ticker\n- ) external onlyGuardian returns (address, address, address) {\n+ ) external onlyGuardian returns (address cashProxiedAddr, address cashProxyAdminAddr, address cashImplementationAddr) {\n\n [ ... ]\n\n- return (\n+ (cashProxiedAddr, cashProxyAdminAddr, cashImplementationAddr) =\n address(cashProxied),\n address(cashProxyAdmin),\n address(cashImplementation)\n );", "solidity_code": "", "github_refs_formatted": "Cash.sol#L29-L40, CashKYCSenderReceiver.sol#L63-L66, CashKYCSender.sol#L63-L66, CashFactory.sol#L75-L110, CashFactory.sol#L123-L134, CashKYCSenderFactory.sol#L133-L144, CashKYCSenderReceiverFactory.sol#L133-L143", "github_files_list": "CashKYCSenderFactory.sol, CashKYCSenderReceiver.sol, CashFactory.sol, CashKYCSender.sol, Cash.sol, CashKYCSenderReceiverFactory.sol", "github_refs_count": 7, "vulnerable_code_actual": "All other instances entailed:\n\n[File: CashKYCSenderReceiver.sol#L63-L66](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/token/CashKYCSenderReceiver.sol#L63-L66)\n\n[File: CashKYCSender.sol#L63-L66](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/token/CashKYCSender.sol#L63-L66)\n\n## Use of named returns for local variables saves gas\nYou can have further advantages in term of gas cost by simply using named return values as temporary local variable.\n\nFor instance, the code block below may be refactored as follows:\n\n[File: CashFactory.sol#L75-L110](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashFactory.sol#L75-L110)\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## Use `break` or `continue` in for loop \nFor loop entailing large array with reverting logic should incorporate `break` or `continue` to cater for element(s) failing to get through the iteration(s). This will tremendously save gas on instances where the loop specifically fails to execute at the end of the iterations.\n\nHere are the three instances unanimously using the same/identical function logic:\n\n[File: CashFactory.sol#L123-L134](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashFactory.sol#L123-L134) \n[File: CashKYCSenderFactory.sol#L133-L144](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashKYCSenderFactory.sol#L133-L144)\n[File: CashKYCSenderReceiverFactory.sol#L133-L143](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashKYCSenderReceiverFactory.sol#L133-L143)\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "03-asymmetry", "title": "dec3ntraliz3d Q", "severity_raw": "QA", "severity": "qa", "description": "## QA Report\n\n## N-01\n\nCreate a single function to get all `rocketPool` contract addresses for code clarity.\n\n## Summary\n\nRocketPool requires us to retrieve active deployed contract addresses from the RocketStorage contract. We can combine all of these retrievals into one function in the Reth.sol contract. This will make the code cleaner and easier to understand.\n\n[Link to the code on Github]( https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/Reth.sol#L121-L141)\n\n### Recommended `getAddress()` function\n\n```solidity\n\n /**\n @notice - Get contract address\n @dev - per RocketPool Docs query addresses each time it is used\n @param _contractName - name of the rocketpool contract\n */\n\n function getAddress(\n string memory _contractName\n ) private view returns (address) {\n return\n RocketStorageInterface(ROCKET_STORAGE_ADDRESS).getAddress(\n keccak256(abi.encodePacked(\"contract.address\", _contractName))\n );\n }\n\n\n```\n\n### `diff` \n\n```diff\n@@ -59,19 +59,6 @@ contract Reth is IDerivative, Initializable, OwnableUpgradeable {\n maxSlippage = _slippage;\n }\n \n- /**\n- @notice - Get rETH address\n- @dev - per RocketPool Docs query addresses each time it is used\n- */\n- function rethAddress() private view returns (address) {\n- return\n- RocketStorageInterface(ROCKET_STORAGE_ADDRESS).getAddress(\n- keccak256(\n- abi.encodePacked(\"contract.address\", \"rocketTokenRETH\")\n- )\n- );\n- }\n-\n /**\n @notice - Swap tokens through Uniswap\n @param _tokenIn - token to swap from\n@@ -105,7 +92,7 @@ contract Reth is IDerivative, Initializable, OwnableUpgradeable {\n @notice - Convert derivative into ETH\n */\n function withdraw(uint256 amount) external onlyOwner {\n- RocketTokenRETHInterface(rethAddress", "vulnerable_code": " /**\n @notice - Get contract address\n @dev - per RocketPool Docs query addresses each time it is used\n @param _contractName - name of the rocketpool contract\n */\n\n function getAddress(\n string memory _contractName\n ) private view returns (address) {\n return\n RocketStorageInterface(ROCKET_STORAGE_ADDRESS).getAddress(\n keccak256(abi.encodePacked(\"contract.address\", _contractName))\n );\n }\n\n", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/dec3ntraliz3d-Q.md", "collected_at": "2026-01-02T18:19:03.432339+00:00", "source_hash": "c609fc494250400edd62e8f227edb7524fa3e93fb77d2b6bd2f0de4322781f40", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 472, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "/**\n @notice - Get contract address\n @dev - per RocketPool Docs query addresses each time it is used\n @param _contractName - name of the rocketpool contract\n */\n\n function getAddress(\n string memory _contractName\n ) private view returns (address) {\n return\n RocketStorageInterface(ROCKET_STORAGE_ADDRESS).getAddress(\n keccak256(abi.encodePacked(\"contract.address\", _contractName))\n );\n }", "primary_code_language": "solidity", "primary_code_char_count": 472, "all_code_blocks": "// Code block 1 (solidity):\n/**\n @notice - Get contract address\n @dev - per RocketPool Docs query addresses each time it is used\n @param _contractName - name of the rocketpool contract\n */\n\n function getAddress(\n string memory _contractName\n ) private view returns (address) {\n return\n RocketStorageInterface(ROCKET_STORAGE_ADDRESS).getAddress(\n keccak256(abi.encodePacked(\"contract.address\", _contractName))\n );\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "/**\n @notice - Get contract address\n @dev - per RocketPool Docs query addresses each time it is used\n @param _contractName - name of the rocketpool contract\n */\n\n function getAddress(\n string memory _contractName\n ) private view returns (address) {\n return\n RocketStorageInterface(ROCKET_STORAGE_ADDRESS).getAddress(\n keccak256(abi.encodePacked(\"contract.address\", _contractName))\n );\n }", "github_refs_formatted": "Reth.sol#L121-L141", "github_files_list": "Reth.sol", "github_refs_count": 1, "vulnerable_code_actual": " /**\n @notice - Get contract address\n @dev - per RocketPool Docs query addresses each time it is used\n @param _contractName - name of the rocketpool contract\n */\n\n function getAddress(\n string memory _contractName\n ) private view returns (address) {\n return\n RocketStorageInterface(ROCKET_STORAGE_ADDRESS).getAddress(\n keccak256(abi.encodePacked(\"contract.address\", _contractName))\n );\n }\n\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "02-ai-arena", "title": "0xDetermination G", "severity_raw": "Medium", "severity": "medium", "description": "# Gas report by 0xDetermination\n\n|Issue number|Description|\n|:-|:-|\n|[G-1](#g-1)|`Neuron.claim()` allowance check is not necessary because `transferFrom()` also checks allowance|\n|[G-2](#g-2)|`Neuron.claim()` can call code in `transferFrom()` implementation directly instead of calling `transferFrom()`|\n|[G-3](#g-3)|`Neuron.burnFrom()` allowance check is not necessary|\n|[G-4](#g-4)|`RankedBattle._getStakingFactor()` accesses the same storage variable a second time whenever it's called (in `stakeNRN()`, `unstakeNRN()`, and `updateBattleRecord()`)|\n|[G-5](#g-5)|NRN `success` checks are unnecessary because the OZ implementation will not fail without reverting|\n|[G-6](#g-6)|`RankedBattle.claimNRN()` is gas inefficient for addresses that don't have any points in previous rounds|\n|[G-7](#g-7)|`RankedBattle.updateBattleRecord()` doesn't need to check voltage since `VoltageManager.spendVoltage()` will revert if voltage is too low|\n|[G-8](#g-8)|`RankedBattle._addResultPoints()` can put code inside an existing conditional statement to avoid incrementing storage variables by zero|\n|[G-9](#g-9)|`RankedBattle._addResultPoints()` executes unnecessary lines of code in case of a tie|\n|[G-10](#g-10)|Unnecessary equality comparison in `RankedBattle._updateRecord()`|\n|[G-11](#g-11)|`FighterFarm.sol` inherits `ERC721Enumerable` but the codebase doesn't use any of the enumerable methods|\n|[G-12](#g-12)|Storing variable types smaller than 32 bytes costs more gas than types with 32 bytes and doesn't save cold SLOAD gas in `FighterFarm.sol`|\n|[G-13](#g-13)|Balance check in `FighterFarm.reRoll()` is not necessary since `transferFrom()` will revert in case of insufficient balance|\n|[G-14](#g-14)|`FighterFarm._beforeTokenTransfer()` can be deleted to save an extra function call|\n|[G-15](#g-15)|`FighterFarm._createFighterBase()` performs unnecessary check when minting dendroid|\n|[G-16](#g-16)|`MergingPool.claimRewards()` should update `numRoundsClaimed` after the loop ends instead of incrementi", "vulnerable_code": " function claim(uint256 amount) external {\n require(\n allowance(treasuryAddress, msg.sender) >= amount, \n \"ERC20: claim amount exceeds allowance\"\n );\n transferFrom(treasuryAddress, msg.sender, amount);\n emit TokensClaimed(msg.sender, amount);\n }", "fixed_code": " function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/0xDetermination-G.md", "collected_at": "2026-01-02T19:02:01.530926+00:00", "source_hash": "c62c47de97c2938261a04ad7fd68f488b398302fee9d1da2be8307503d0d9ff4", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function claim(uint256 amount) external {\n require(\n allowance(treasuryAddress, msg.sender) >= amount, \n \"ERC20: claim amount exceeds allowance\"\n );\n transferFrom(treasuryAddress, msg.sender, amount);\n emit TokensClaimed(msg.sender, amount);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "04-caviar", "title": "mgf15 Q", "severity_raw": "Critical", "severity": "critical", "description": "\n## Non Critical Issues\n\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [NC-1](#NC-1) | Constants should be defined rather than using magic numbers | 1 |\n| [NC-2](#NC-2) | FLOATING PRAGMAS | 5 |\n| [NC-3](#NC-3) | Missing checks for `address(0)` when assigning values to address state variables | 6 |\n| [NC-4](#NC-4) | Order of Functions | * |\n| [NC-5](#NC-5) | Some Function Missing events | 3 |\n| [NC-6](#NC-6) | Functions guaranteed to revert when called by normal users can be marked payable | 10 |\n| [NC-7](#NC-7) | Function Calls in Loop Could Lead to Denial of Service | 19 |\n\n### [NC-1] Constants should be defined rather than using magic numbers\n\n*Instances (1)*:\n```solidity\nFile: 2023-04-caviar/src/PrivatePool.sol\n\n744: uint256 exponent = baseToken == address(0) ? 18 : (36 - ERC20(baseToken).decimals());\n\n```\n### [NC-2] FLOATING PRAGMAS\n\nIt is a best practice to lock pragmas instead of using floating pragmas to ensure that contracts are tested and deployed with the intended compiler version. Accidentally deploying contracts with different compiler versions can lead to unexpected risks and undiscovered bugs. Please consider locking pragmas for the following files.\n\n*Instances (5)*:\n```solidity\nFile: 2023-04-caviar/blob/main/src/Factory.sol\n\n2: pragma solidity ^0.8.19;\n```\n\n```solidity\nFile: 2023-04-caviar/blob/main/src/PrivatePoolMetadata.sol\n\n2: pragma solidity ^0.8.19;\n```\n\n```solidity\nFile: 2023-04-caviar/blob/main/src/EthRouter.sol\n\n2: pragma solidity ^0.8.19;\n```\n\n```solidity\nFile: 2023-04-caviar/blob/main/src/PrivatePool.sol\n\n2: pragma solidity ^0.8.19;\n```\n\n### [NC-3] Missing checks for `address(0)` when assigning values to address state variables \n\nZero-address check should be used in the constructors, to avoid the risk of setting a storage variable as address(0) at deploying time.\n\n*Instances (6)*:\n```solidity\nFile: 2023-04-caviar/blob/main/src/EthRouter.sol\n\n90: constructor(address _royaltyRegistry) {\n91: royaltyRegistry = _royaltyRegistry;\n92: }\n`", "vulnerable_code": "File: 2023-04-caviar/src/PrivatePool.sol\n\n744: uint256 exponent = baseToken == address(0) ? 18 : (36 - ERC20(baseToken).decimals());\n", "fixed_code": "File: 2023-04-caviar/blob/main/src/Factory.sol\n\n2: pragma solidity ^0.8.19;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/mgf15-Q.md", "collected_at": "2026-01-02T18:20:43.472963+00:00", "source_hash": "c6420154705b06560666ff0311885279bab55402a9ac53ae4587fe482f3c1e05", "code_block_count": 5, "solidity_block_count": 5, "total_code_chars": 458, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: 2023-04-caviar/src/PrivatePool.sol\n\n744: uint256 exponent = baseToken == address(0) ? 18 : (36 - ERC20(baseToken).decimals());", "primary_code_language": "solidity", "primary_code_char_count": 140, "all_code_blocks": "// Code block 1 (solidity):\nFile: 2023-04-caviar/src/PrivatePool.sol\n\n744: uint256 exponent = baseToken == address(0) ? 18 : (36 - ERC20(baseToken).decimals());\n\n// Code block 2 (solidity):\nFile: 2023-04-caviar/blob/main/src/Factory.sol\n\n2: pragma solidity ^0.8.19;\n\n// Code block 3 (solidity):\nFile: 2023-04-caviar/blob/main/src/PrivatePoolMetadata.sol\n\n2: pragma solidity ^0.8.19;\n\n// Code block 4 (solidity):\nFile: 2023-04-caviar/blob/main/src/EthRouter.sol\n\n2: pragma solidity ^0.8.19;\n\n// Code block 5 (solidity):\nFile: 2023-04-caviar/blob/main/src/PrivatePool.sol\n\n2: pragma solidity ^0.8.19;", "all_code_blocks_count": 5, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: 2023-04-caviar/src/PrivatePool.sol\n\n744: uint256 exponent = baseToken == address(0) ? 18 : (36 - ERC20(baseToken).decimals());\n\nFile: 2023-04-caviar/blob/main/src/Factory.sol\n\n2: pragma solidity ^0.8.19;\n\nFile: 2023-04-caviar/blob/main/src/PrivatePoolMetadata.sol\n\n2: pragma solidity ^0.8.19;\n\nFile: 2023-04-caviar/blob/main/src/EthRouter.sol\n\n2: pragma solidity ^0.8.19;\n\nFile: 2023-04-caviar/blob/main/src/PrivatePool.sol\n\n2: pragma solidity ^0.8.19;", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: 2023-04-caviar/src/PrivatePool.sol\n\n744: uint256 exponent = baseToken == address(0) ? 18 : (36 - ERC20(baseToken).decimals());\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: 2023-04-caviar/blob/main/src/Factory.sol\n\n2: pragma solidity ^0.8.19;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "01-ondo", "title": "Praise Q", "severity_raw": "Low", "severity": "low", "description": "function _processRedemption() in CashManager.sol lacks the 'unchecked' keyword. \nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/cash/CashManager.sol#L743-L770\n\nOne reason you might use unchecked is when looping through the elements of an array. Consider for example:\n```\nuint256 length = array.length;\nfor(uint256 i = 0; i < length; i++) {\n doSomething(array[i]);\n}\n```\nEach time i++ is called under/overflow checks are made. But we're already constraining i by length, i < length, making those under/overflow checks unnecessary. So, we can rewrite the loop like this and potentially save significant gas:\n```\nuint256 length = array.length;\nfor(uint256 i = 0; i < length;) {\n doSomething(array[i]);\n unchecked{ i++; }\n}\n```", "vulnerable_code": "uint256 length = array.length;\nfor(uint256 i = 0; i < length; i++) {\n doSomething(array[i]);\n}", "fixed_code": "uint256 length = array.length;\nfor(uint256 i = 0; i < length;) {\n doSomething(array[i]);\n unchecked{ i++; }\n}", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/Praise-Q.md", "collected_at": "2026-01-02T18:14:42.213910+00:00", "source_hash": "c68e6d7b5306444f757f7f02efc767c85946ddad49e8d7d035d383dbfd6b6454", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 206, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "uint256 length = array.length;\nfor(uint256 i = 0; i < length; i++) {\n doSomething(array[i]);\n}", "primary_code_language": "unknown", "primary_code_char_count": 95, "all_code_blocks": "// Code block 1 (unknown):\nuint256 length = array.length;\nfor(uint256 i = 0; i < length; i++) {\n doSomething(array[i]);\n}\n\n// Code block 2 (unknown):\nuint256 length = array.length;\nfor(uint256 i = 0; i < length;) {\n doSomething(array[i]);\n unchecked{ i++; }\n}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CashManager.sol#L743-L770", "github_files_list": "CashManager.sol", "github_refs_count": 1, "vulnerable_code_actual": "uint256 length = array.length;\nfor(uint256 i = 0; i < length; i++) {\n doSomething(array[i]);\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "uint256 length = array.length;\nfor(uint256 i = 0; i < length;) {\n doSomething(array[i]);\n unchecked{ i++; }\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6.56} {"source": "c4", "protocol": "11-kelp", "title": "Raihan G", "severity_raw": "High", "severity": "high", "description": "# GAS OPTIMIZATION\n\n# SUMMARY\n| | issue | instance |\n|------|---------|------------|\n|[G\u201101]|Avoid contract existence checks by using low level calls|5|\n|[G\u201102]|Optimize External Calls with Assembly for Memory Efficiency|2|\n|[G\u201103]|Cache external calls outside of loop to avoid re-calling function on each iteration|2|\n|[G\u201104]|Can Make The Variable Outside The Loop To Save Gas |3|\n|[G\u201105]|Expressions for constant values such as a call to\u00ac\u2020keccak256(), should use immutable rather than constant|2|\n|[G\u201106]|Amounts should be checked for 0 before calling a transfer|2|\n|[G\u201107]|Use constants instead of type(uintx).max|1|\n|[G\u201108]|Avoid emitting storage values|1|\n\n\n\n## [G\u201101] Avoid contract existence checks by using low level calls\nPrior to 0.8.10 the compiler inserted extra code, including\u00a0EXTCODESIZE\u00a0(100 gas), to check for contract existence for external function calls. In more recent solidity versions, the compiler will not insert these checks if the external call has a return value. Similar behavior can be achieved in earlier versions by using low-level calls, since low level calls never check for contract existence.\n\nThere are 5 instances of this issue:\n\nsave gas with this change : 5 * 100 = 500\ntotoal save gas = 500\n```solidity\nFile: src/LRTDepositPool.sol\n83 assetLyingInNDCs += IERC20(asset).balanceOf(nodeDelegatorQueue[i]);\n```\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L83\n\n```solidity\nFile: src/LRTOracle.sol\n54 uint256 rsEthSupply = IRSETH(rsETHTokenAddress).totalSupply();\n\n70 uint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);\n```\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTOracle.sol#L54\n\n```solidity\nFile: src/NodeDelegator.sol\n102 (IStrategy[] memory strategies,) =\n IEigenStrategyManager(eigenlayerStrategyManagerAddress).getDeposits(address(this));\n\n123 return IStrategy(strategy).userUnderlyingView(address(this)); \n```\nhttps://", "vulnerable_code": "File: src/LRTDepositPool.sol\n83 assetLyingInNDCs += IERC20(asset).balanceOf(nodeDelegatorQueue[i]);", "fixed_code": "File: src/LRTOracle.sol\n54 uint256 rsEthSupply = IRSETH(rsETHTokenAddress).totalSupply();\n\n70 uint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/Raihan-G.md", "collected_at": "2026-01-02T18:27:34.952110+00:00", "source_hash": "c6906a0e578aee3fe8d0af60b20fba519ce015a2c7f3f2518fdc880633f1773f", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 529, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: src/LRTDepositPool.sol\n83 assetLyingInNDCs += IERC20(asset).balanceOf(nodeDelegatorQueue[i]);", "primary_code_language": "solidity", "primary_code_char_count": 102, "all_code_blocks": "// Code block 1 (solidity):\nFile: src/LRTDepositPool.sol\n83 assetLyingInNDCs += IERC20(asset).balanceOf(nodeDelegatorQueue[i]);\n\n// Code block 2 (solidity):\nFile: src/LRTOracle.sol\n54 uint256 rsEthSupply = IRSETH(rsETHTokenAddress).totalSupply();\n\n70 uint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);\n\n// Code block 3 (solidity):\nFile: src/NodeDelegator.sol\n102 (IStrategy[] memory strategies,) =\n IEigenStrategyManager(eigenlayerStrategyManagerAddress).getDeposits(address(this));\n\n123 return IStrategy(strategy).userUnderlyingView(address(this));", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: src/LRTDepositPool.sol\n83 assetLyingInNDCs += IERC20(asset).balanceOf(nodeDelegatorQueue[i]);\n\nFile: src/LRTOracle.sol\n54 uint256 rsEthSupply = IRSETH(rsETHTokenAddress).totalSupply();\n\n70 uint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);\n\nFile: src/NodeDelegator.sol\n102 (IStrategy[] memory strategies,) =\n IEigenStrategyManager(eigenlayerStrategyManagerAddress).getDeposits(address(this));\n\n123 return IStrategy(strategy).userUnderlyingView(address(this));", "github_refs_formatted": "LRTDepositPool.sol#L83, LRTOracle.sol#L54", "github_files_list": "LRTDepositPool.sol, LRTOracle.sol", "github_refs_count": 2, "vulnerable_code_actual": "File: src/LRTDepositPool.sol\n83 assetLyingInNDCs += IERC20(asset).balanceOf(nodeDelegatorQueue[i]);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: src/LRTOracle.sol\n54 uint256 rsEthSupply = IRSETH(rsETHTokenAddress).totalSupply();\n\n70 uint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "08-dopex", "title": "MiniGlome G", "severity_raw": "Low", "severity": "low", "description": "## Gas Optimizations\n| |Issue|Instances|\n|-|:-|:-:| \n| [GAS-01] | Remove unused logic | 3 | \n| [GAS-02] | Access control is checked twice | 5 | \n| [GAS-03] | Value used only in if statement should be computed only in the if statement | 2 | \n\n### [GAS-01] Remove unused logic\n*Instances (3)*:\nThe `slippageTolerance` variable is not used in `UniV2LiquidityAMO.sol`. Thus, it can be removed alongside the `setSlippageTolerance()` function.\n```solidity\nFile: amo/UniV2LiquidityAMO.sol\n\n50: /// @notice The slippage tolernce in swaps in 1e8 precision\n uint256 public slippageTolerance = 5e5; // 0.5%\n\n109: function setSlippageTolerance( //@audit [GAS] slippageTolerance is never used\n uint256 _slippageTolerance\n ) external onlyRole(DEFAULT_ADMIN_ROLE) { //@audit can be frontrun\n require(\n _slippageTolerance > 0,\n \"reLPContract: slippage tolerance must be greater than 0\"\n );\n slippageTolerance = _slippageTolerance;\n }\n```\n\n```solidity\nFile: core/RdpxV2Core.sol\n\n732: uint256 bondAmountForUser = amount1; //@audit [GAS] useless variable, used only once\n```\n\n\n### [GAS-02] Access control is checked twice\n*Instances (5)*:\nThe `mint()` function of `RdpxDecayingBonds.sol` checks that the sender has the `MINTER_ROLE` in the modifier and again in the function body.\n```solidity\nFile: decaying-bonds/RdpxDecayingBonds.sol\n\n114: function mint(\n address to,\n uint256 expiry,\n uint256 rdpxAmount\n ) external onlyRole(MINTER_ROLE) {\n _whenNotPaused();\n require(hasRole(MINTER_ROLE, msg.sender), \"Caller is not a minter\"); //@audit [GAS] role is already checked by modifier\n```\nThe `DEFAULT_ADMIN_ROLE` is already cheched in the modifier, there is no need to check `_isEligibleSender()` because the `DEFAULT_ADMIN_ROLE` can set himself as an \"eligible sender\".\n```solidity\nFile: core/RdpxV2Core.sol\n\n1051: function upperDepeg(\n uint256 _amount,\n uint256 minOut\n ) external onlyRole(DEFAULT_ADMIN_ROLE) returns (uint256 wethReceived) {\n _isEligibleSender()", "vulnerable_code": "File: amo/UniV2LiquidityAMO.sol\n\n50: /// @notice The slippage tolernce in swaps in 1e8 precision\n uint256 public slippageTolerance = 5e5; // 0.5%\n\n109: function setSlippageTolerance( //@audit [GAS] slippageTolerance is never used\n uint256 _slippageTolerance\n ) external onlyRole(DEFAULT_ADMIN_ROLE) { //@audit can be frontrun\n require(\n _slippageTolerance > 0,\n \"reLPContract: slippage tolerance must be greater than 0\"\n );\n slippageTolerance = _slippageTolerance;\n }", "fixed_code": "File: core/RdpxV2Core.sol\n\n732: uint256 bondAmountForUser = amount1; //@audit [GAS] useless variable, used only once", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/MiniGlome-G.md", "collected_at": "2026-01-02T18:24:53.785848+00:00", "source_hash": "c6ff576ddf01f45a5bbc05e9fc2928b6308edff6a2eb00f3baf26c0ee99369dd", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 916, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: amo/UniV2LiquidityAMO.sol\n\n50: /// @notice The slippage tolernce in swaps in 1e8 precision\n uint256 public slippageTolerance = 5e5; // 0.5%\n\n109: function setSlippageTolerance( //@audit [GAS] slippageTolerance is never used\n uint256 _slippageTolerance\n ) external onlyRole(DEFAULT_ADMIN_ROLE) { //@audit can be frontrun\n require(\n _slippageTolerance > 0,\n \"reLPContract: slippage tolerance must be greater than 0\"\n );\n slippageTolerance = _slippageTolerance;\n }", "primary_code_language": "solidity", "primary_code_char_count": 493, "all_code_blocks": "// Code block 1 (solidity):\nFile: amo/UniV2LiquidityAMO.sol\n\n50: /// @notice The slippage tolernce in swaps in 1e8 precision\n uint256 public slippageTolerance = 5e5; // 0.5%\n\n109: function setSlippageTolerance( //@audit [GAS] slippageTolerance is never used\n uint256 _slippageTolerance\n ) external onlyRole(DEFAULT_ADMIN_ROLE) { //@audit can be frontrun\n require(\n _slippageTolerance > 0,\n \"reLPContract: slippage tolerance must be greater than 0\"\n );\n slippageTolerance = _slippageTolerance;\n }\n\n// Code block 2 (solidity):\nFile: core/RdpxV2Core.sol\n\n732: uint256 bondAmountForUser = amount1; //@audit [GAS] useless variable, used only once\n\n// Code block 3 (solidity):\nFile: decaying-bonds/RdpxDecayingBonds.sol\n\n114: function mint(\n address to,\n uint256 expiry,\n uint256 rdpxAmount\n ) external onlyRole(MINTER_ROLE) {\n _whenNotPaused();\n require(hasRole(MINTER_ROLE, msg.sender), \"Caller is not a minter\"); //@audit [GAS] role is already checked by modifier", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: amo/UniV2LiquidityAMO.sol\n\n50: /// @notice The slippage tolernce in swaps in 1e8 precision\n uint256 public slippageTolerance = 5e5; // 0.5%\n\n109: function setSlippageTolerance( //@audit [GAS] slippageTolerance is never used\n uint256 _slippageTolerance\n ) external onlyRole(DEFAULT_ADMIN_ROLE) { //@audit can be frontrun\n require(\n _slippageTolerance > 0,\n \"reLPContract: slippage tolerance must be greater than 0\"\n );\n slippageTolerance = _slippageTolerance;\n }\n\nFile: core/RdpxV2Core.sol\n\n732: uint256 bondAmountForUser = amount1; //@audit [GAS] useless variable, used only once\n\nFile: decaying-bonds/RdpxDecayingBonds.sol\n\n114: function mint(\n address to,\n uint256 expiry,\n uint256 rdpxAmount\n ) external onlyRole(MINTER_ROLE) {\n _whenNotPaused();\n require(hasRole(MINTER_ROLE, msg.sender), \"Caller is not a minter\"); //@audit [GAS] role is already checked by modifier", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: amo/UniV2LiquidityAMO.sol\n\n50: /// @notice The slippage tolernce in swaps in 1e8 precision\n uint256 public slippageTolerance = 5e5; // 0.5%\n\n109: function setSlippageTolerance( //@audit [GAS] slippageTolerance is never used\n uint256 _slippageTolerance\n ) external onlyRole(DEFAULT_ADMIN_ROLE) { //@audit can be frontrun\n require(\n _slippageTolerance > 0,\n \"reLPContract: slippage tolerance must be greater than 0\"\n );\n slippageTolerance = _slippageTolerance;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: core/RdpxV2Core.sol\n\n732: uint256 bondAmountForUser = amount1; //@audit [GAS] useless variable, used only once", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-salty", "title": "naman1778 G", "severity_raw": "High", "severity": "high", "description": "## [G-01] Using XOR (^) and AND (&) bitwise equivalents\n\nGiven 4 variables a, b, c and d represented as such:\n\n 0 0 0 0 0 1 1 0 <- a\n 0 1 1 0 0 1 1 0 <- b\n 0 0 0 0 0 0 0 0 <- c\n 1 1 1 1 1 1 1 1 <- d\n\nTo have a == b means that every 0 and 1 match on both variables. Meaning that a XOR (operator ^) would evaluate to 0 ((a ^ b) == 0), as it excludes by definition any equalities.Now, if a != b, this means that there\u2019s at least somewhere a 1 and a 0 not matching between a and b, making (a ^ b) != 0.Both formulas are logically equivalent and using the XOR bitwise operator costs actually the same amount of gas.However, it is much cheaper to use the bitwise OR operator (|) than comparing the truthy or falsy values.These are logically equivalent too, as the OR bitwise operator (|) would result in a 1 somewhere if any value is not 0 between the XOR (^) statements, meaning if any XOR (^) statement verifies that its arguments are different.\n\nThere are 6 instances of this issue in 4 files:\n\n```\nFile: Proposals.sol\t\n\n268: require( (vote == Vote.INCREASE) || (vote == Vote.DECREASE) || (vote == Vote.NO_CHANGE), \"Invalid VoteType for Parameter Ballot\" );\n\n270: require( (vote == Vote.YES) || (vote == Vote.NO), \"Invalid VoteType for Approval Ballot\" );\n\n325: else if ( ( ballotType == BallotType.WHITELIST_TOKEN ) || ( ballotType == BallotType.UNWHITELIST_TOKEN ) )\n``` \n diff --git a/src/dao/Proposals.sol b/src/dao/Proposals.sol\n index 40ebd17..6958891 100644\n --- a/src/dao/Proposals.sol\n +++ b/src/dao/Proposals.sol\n @@ -265,9 +265,9 @@ contract Proposals is IProposals, ReentrancyGuard\n\n // Make sure that the vote type is valid for the given ballot\n if ( ballot.ballotType == BallotType.PARAMETER )\n - require( (vote == Vote.INCREASE) || (vote == Vote.DECREASE) || (vote == Vote.NO_CHANGE), \"Invalid VoteType for Parameter Ballot\" );\n + require( ((vote ^ Vote.INCREASE) & (vote ^", "vulnerable_code": "File: Proposals.sol\t\n\n268: require( (vote == Vote.INCREASE) || (vote == Vote.DECREASE) || (vote == Vote.NO_CHANGE), \"Invalid VoteType for Parameter Ballot\" );\n\n270: require( (vote == Vote.YES) || (vote == Vote.NO), \"Invalid VoteType for Approval Ballot\" );\n\n325: else if ( ( ballotType == BallotType.WHITELIST_TOKEN ) || ( ballotType == BallotType.UNWHITELIST_TOKEN ) )", "fixed_code": "File: PoolStats.sol\t\n\n95: if ( ( poolIndex1 != indicies.index1 ) || ( poolIndex2 != indicies.index2 ) || ( poolIndex3 != indicies.index3 ) )", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/naman1778-G.md", "collected_at": "2026-01-02T19:01:53.885533+00:00", "source_hash": "c714a36092c8ffdae92ac72756d6a69a7242ccd94e60e53ed7092cf8fc03b176", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 369, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: Proposals.sol\t\n\n268: require( (vote == Vote.INCREASE) || (vote == Vote.DECREASE) || (vote == Vote.NO_CHANGE), \"Invalid VoteType for Parameter Ballot\" );\n\n270: require( (vote == Vote.YES) || (vote == Vote.NO), \"Invalid VoteType for Approval Ballot\" );\n\n325: else if ( ( ballotType == BallotType.WHITELIST_TOKEN ) || ( ballotType == BallotType.UNWHITELIST_TOKEN ) )", "primary_code_language": "unknown", "primary_code_char_count": 369, "all_code_blocks": "// Code block 1 (unknown):\nFile: Proposals.sol\t\n\n268: require( (vote == Vote.INCREASE) || (vote == Vote.DECREASE) || (vote == Vote.NO_CHANGE), \"Invalid VoteType for Parameter Ballot\" );\n\n270: require( (vote == Vote.YES) || (vote == Vote.NO), \"Invalid VoteType for Approval Ballot\" );\n\n325: else if ( ( ballotType == BallotType.WHITELIST_TOKEN ) || ( ballotType == BallotType.UNWHITELIST_TOKEN ) )", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: Proposals.sol\t\n\n268: require( (vote == Vote.INCREASE) || (vote == Vote.DECREASE) || (vote == Vote.NO_CHANGE), \"Invalid VoteType for Parameter Ballot\" );\n\n270: require( (vote == Vote.YES) || (vote == Vote.NO), \"Invalid VoteType for Approval Ballot\" );\n\n325: else if ( ( ballotType == BallotType.WHITELIST_TOKEN ) || ( ballotType == BallotType.UNWHITELIST_TOKEN ) )", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: PoolStats.sol\t\n\n95: if ( ( poolIndex1 != indicies.index1 ) || ( poolIndex2 != indicies.index2 ) || ( poolIndex3 != indicies.index3 ) )", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "11-kelp", "title": "Sathish9098 G", "severity_raw": "Informational", "severity": "informational", "description": "# GAS OPTIMIZATIONS\n\n##\n\n## [G-1] Consolidating Multiple Address/ID Mappings into a Single Struct-Based Mapping for Efficiency\n\nSaves a storage slot for the mapping. Depending on the circumstances and sizes of types, can avoid a Gsset (20000 gas) per mapping combined. Reads and subsequent writes can also be cheaper when a function requires both values and they both fit in the same storage slot. Finally, if both fields are accessed in the same function, can save ~42 gas per access due to not having to recalculate the key\u2019s keccak256 hash (Gkeccak256 - 30 gas) and that calculation\u2019s associated stack operations.\n\nBy consolidating the mappings into a single struct-based mapping, potentially save ``1 SLOT`` and ``2000 GAS`` per token address. This reduction can lead to significant gas savings, especially in contracts with many entries.\n\n```diff\nFILE: 2023-11-kelp/src/LRTConfig.sol\n\n- 15: mapping(address token => bool isSupported) public isSupportedAsset;\n- 16: mapping(address token => uint256 amount) public depositLimitByAsset;\n- 17: mapping(address token => address strategy) public override assetStrategy;\n\n+ struct AssetInfo {\n+ bool isSupported;\n+ address strategy;\n+ uint256 depositLimit;\n+ }\n\n+ mapping(address => AssetInfo) public assetInfo;\n\n```\nhttps://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTConfig.sol#L13-L14\n\n##\n\n## [G-2] Don't cache state variables or function calls only used once \n\n```diff\nFILE: Breadcrumbs2023-11-kelp/src/LRTDepositPool.sol\n\nfunction _mintRsETH(address _asset, uint256 _amount) private returns (uint256 rsethAmountToMint) {\n (rsethAmountToMint) = getRsETHAmountToMint(_asset, _amount);\n\n- address rsethToken = lrtConfig.rsETH();\n // mint rseth for user\n- IRSETH(rsethToken).mint(msg.sender, rsethAmountToMint);\n+ IRSETH(lrtConfig.rsETH()).mint(msg.sender, rsethAmountToMint);\n }\n\n\n\n- 193: address nodeDelegator = nodeDelegatorQueue[ndcIndex];\n- if (!I", "vulnerable_code": "https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTConfig.sol#L13-L14\n\n##\n\n## [G-2] Don't cache state variables or function calls only used once \n", "fixed_code": "https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTDepositPool.sol#L154\n\n##\n\n## [G-3] Don't declare variables inside the loop\n\nDeclare outside the loop and only use inside\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/Sathish9098-G.md", "collected_at": "2026-01-02T18:27:39.861712+00:00", "source_hash": "c724fdc0cbaa40668a4504df0dfc23a958c9f7d9a9981a5ddf3079e765681288", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 416, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "FILE: 2023-11-kelp/src/LRTConfig.sol\n\n- 15: mapping(address token => bool isSupported) public isSupportedAsset;\n- 16: mapping(address token => uint256 amount) public depositLimitByAsset;\n- 17: mapping(address token => address strategy) public override assetStrategy;\n\n+ struct AssetInfo {\n+ bool isSupported;\n+ address strategy;\n+ uint256 depositLimit;\n+ }\n\n+ mapping(address => AssetInfo) public assetInfo;", "primary_code_language": "diff", "primary_code_char_count": 416, "all_code_blocks": "// Code block 1 (diff):\nFILE: 2023-11-kelp/src/LRTConfig.sol\n\n- 15: mapping(address token => bool isSupported) public isSupportedAsset;\n- 16: mapping(address token => uint256 amount) public depositLimitByAsset;\n- 17: mapping(address token => address strategy) public override assetStrategy;\n\n+ struct AssetInfo {\n+ bool isSupported;\n+ address strategy;\n+ uint256 depositLimit;\n+ }\n\n+ mapping(address => AssetInfo) public assetInfo;", "all_code_blocks_count": 1, "has_diff_blocks": true, "diff_code": "FILE: 2023-11-kelp/src/LRTConfig.sol\n\n- 15: mapping(address token => bool isSupported) public isSupportedAsset;\n- 16: mapping(address token => uint256 amount) public depositLimitByAsset;\n- 17: mapping(address token => address strategy) public override assetStrategy;\n\n+ struct AssetInfo {\n+ bool isSupported;\n+ address strategy;\n+ uint256 depositLimit;\n+ }\n\n+ mapping(address => AssetInfo) public assetInfo;", "solidity_code": "", "github_refs_formatted": "LRTConfig.sol#L13-L14, LRTDepositPool.sol#L154", "github_files_list": "LRTConfig.sol, LRTDepositPool.sol", "github_refs_count": 2, "vulnerable_code_actual": "https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTConfig.sol#L13-L14\n\n##\n\n## [G-2] Don't cache state variables or function calls only used once \n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTDepositPool.sol#L154\n\n##\n\n## [G-3] Don't declare variables inside the loop\n\nDeclare outside the loop and only use inside\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "01-ondo", "title": "zaskoh Q", "severity_raw": "Critical", "severity": "critical", "description": "## Summary\n\n### Low Risk Issues\n| |Issue|Instances|\n|-|:-|:-:|\n| L-01 | Check for a max percent for fees in completeRedemptions | 1 |\n| L-02 | Token factories can only hold the last deployed addresses | 3 |\n| L-03 | Cashmanager will not work for collaterals with more than 18 decimals | 1 |\n\nTotal: 5 instances over 3 issues\n\n\n### Non-critical Issues\n| |Issue|Instances|\n|-|:-|:-:|\n| NC-01 | _beforeTokenTransfer will not fail if transaction was initiated by a sanctioned user but routed through an approved proxy | 2 |\n| NC-02 | Token factories don't need to implement the IMulticall | 3 |\n| NC-03 | Consider a not so strict versioning for your main interfaces | 6 |\n| NC-04 | Move owner checks to a modifier | 15 |\n| NC-05 | Use specific imports instead of just a global import | 24 |\n| NC-06 | Solidity pragma versioning | 8 |\n| NC-07 | Unnecessarily imports | 3 |\n\nTotal: 61 instances over 7 issues\n\n\n### Informational\n| |Issue|Instances|\n|-|:-|:-:|\n| I-01 | Remove unneccessary state allocation | 1 |\n| I-02 | Don't mix uint and uint256 | 9 |\n| I-03 | Add a license for JumpRateModelV2 | 1 |\n| I-04 | Layout of a Solidity Source File | 3 |\n| I-05 | Typos | 7 |\n| I-06 | Missing documentation | 87 |\n\nTotal: 108 instances over 6 issues\n\n---\n\n## Low Risk Issues\n\n### L-01 Check for a max percent for fees in completeRedemptions\nAt the moment the fees for completeRedemptions in contracts/cash/CashManager.sol can bet set arbitrarily. You should consider a check for the fees that they are not more than x% in the beginning of the function. The user redemptions could be tempered with a too high fee here.\n\n```solidity\nFile: contracts/cash/CashManager.sol\n707: function completeRedemptions(\n708: address[] calldata redeemers,\n709: address[] calldata refundees,\n710: uint256 collateralAmountToDist,\n711: uint256 epochToService,\n712: uint256 fees\n713: ) external override updateEpoch onlyRole(MANAGER_ADMIN) {\n```\n\n### L-02 Token factories can only hold the last deployed addr", "vulnerable_code": "File: contracts/cash/CashManager.sol\n707: function completeRedemptions(\n708: address[] calldata redeemers,\n709: address[] calldata refundees,\n710: uint256 collateralAmountToDist,\n711: uint256 epochToService,\n712: uint256 fees\n713: ) external override updateEpoch onlyRole(MANAGER_ADMIN) {", "fixed_code": "File: contracts/cash/factory/CashFactory.sol\n63: struct Deployment {\n64: Cash implementation;\n65: ProxyAdmin proxyAdmin;\n66: TokenProxy tokenProxy;\n67: }\n68: uint256 currentDeployment;\n69: mapping(uint256 => Deployment) deployments;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/zaskoh-Q.md", "collected_at": "2026-01-02T18:15:38.518915+00:00", "source_hash": "c72f3424756aac45f5aa265011b85a7d7415e6e4265a274a99bfe223490fe64b", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 312, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/cash/CashManager.sol\n707: function completeRedemptions(\n708: address[] calldata redeemers,\n709: address[] calldata refundees,\n710: uint256 collateralAmountToDist,\n711: uint256 epochToService,\n712: uint256 fees\n713: ) external override updateEpoch onlyRole(MANAGER_ADMIN) {", "primary_code_language": "solidity", "primary_code_char_count": 312, "all_code_blocks": "// Code block 1 (solidity):\nFile: contracts/cash/CashManager.sol\n707: function completeRedemptions(\n708: address[] calldata redeemers,\n709: address[] calldata refundees,\n710: uint256 collateralAmountToDist,\n711: uint256 epochToService,\n712: uint256 fees\n713: ) external override updateEpoch onlyRole(MANAGER_ADMIN) {", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: contracts/cash/CashManager.sol\n707: function completeRedemptions(\n708: address[] calldata redeemers,\n709: address[] calldata refundees,\n710: uint256 collateralAmountToDist,\n711: uint256 epochToService,\n712: uint256 fees\n713: ) external override updateEpoch onlyRole(MANAGER_ADMIN) {", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: contracts/cash/CashManager.sol\n707: function completeRedemptions(\n708: address[] calldata redeemers,\n709: address[] calldata refundees,\n710: uint256 collateralAmountToDist,\n711: uint256 epochToService,\n712: uint256 fees\n713: ) external override updateEpoch onlyRole(MANAGER_ADMIN) {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/cash/factory/CashFactory.sol\n63: struct Deployment {\n64: Cash implementation;\n65: ProxyAdmin proxyAdmin;\n66: TokenProxy tokenProxy;\n67: }\n68: uint256 currentDeployment;\n69: mapping(uint256 => Deployment) deployments;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "05-ajna", "title": "lfzkoala G", "severity_raw": "Medium", "severity": "medium", "description": "#Issue: Inefficient use of storage: (Gas Optimization)\nProblem: The `memorializePositions()` function reads from and writes to the storage multiple times, which can be expensive in terms of gas costs.\n\nSolution: Optimize storage reads and writes by using local variables in the loop and writing the updated positions to the storage only once at the end:\n\n```solidity\nfunction memorializePositions(MemorializePositionsParams calldata params_) external override mayInteract(poolKey[params_.tokenId], params_.tokenId) {\n ...\n for (uint256 i = 0; i < indexesLength; ) {\n ...\n Position storage position = positions[params_.tokenId][index];\n ...\n // Save position in storage only once at the end of the loop\n if (i == indexesLength - 1) {\n positions[params_.tokenId][index] = position;\n }\n ...\n }\n ...\n}\n```\n\n#Issue: Gas Optimization\nIn the `_getBurnEpochsClaimed` function, there is a `while` loop that runs from `lastClaimedEpoch_ + 1` to `burnEpochToStartClaim_`. The number of iterations that this loop will make is equal to `burnEpochToStartClaim_ - lastClaimedEpoch_`.\n\nHere is the potential issue: if the difference between `burnEpochToStartClaim_` and `lastClaimedEpoch_` is very large, the loop could run a large number of times. Each iteration of the loop consumes some gas, so if there are many iterations, the function could consume a lot of gas. If the total gas consumed by the function exceeds the gas limit for a block, then the function cannot be successfully called in a transaction because it would always run out of gas.\n\nThis is why it's generally a good idea to avoid unbounded loops in smart contracts, or at least to be very careful with them. In practice, it might be unlikely that the difference between `burnEpochToStartClaim_` and `lastClaimedEpoch_` would be so large as to cause a problem, but without knowing more about the specific use case and how these variables are managed, it's hard to say for sur", "vulnerable_code": "function memorializePositions(MemorializePositionsParams calldata params_) external override mayInteract(poolKey[params_.tokenId], params_.tokenId) {\n ...\n for (uint256 i = 0; i < indexesLength; ) {\n ...\n Position storage position = positions[params_.tokenId][index];\n ...\n // Save position in storage only once at the end of the loop\n if (i == indexesLength - 1) {\n positions[params_.tokenId][index] = position;\n }\n ...\n }\n ...\n}", "fixed_code": "", "recommendation": "", "category": "dos", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/lfzkoala-G.md", "collected_at": "2026-01-02T18:21:34.184420+00:00", "source_hash": "c75f0a6e42bf7a727051adc8321a2f229c5c63ab27417de3157828f1eabf7a4b", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 502, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function memorializePositions(MemorializePositionsParams calldata params_) external override mayInteract(poolKey[params_.tokenId], params_.tokenId) {\n ...\n for (uint256 i = 0; i < indexesLength; ) {\n ...\n Position storage position = positions[params_.tokenId][index];\n ...\n // Save position in storage only once at the end of the loop\n if (i == indexesLength - 1) {\n positions[params_.tokenId][index] = position;\n }\n ...\n }\n ...\n}", "primary_code_language": "solidity", "primary_code_char_count": 502, "all_code_blocks": "// Code block 1 (solidity):\nfunction memorializePositions(MemorializePositionsParams calldata params_) external override mayInteract(poolKey[params_.tokenId], params_.tokenId) {\n ...\n for (uint256 i = 0; i < indexesLength; ) {\n ...\n Position storage position = positions[params_.tokenId][index];\n ...\n // Save position in storage only once at the end of the loop\n if (i == indexesLength - 1) {\n positions[params_.tokenId][index] = position;\n }\n ...\n }\n ...\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function memorializePositions(MemorializePositionsParams calldata params_) external override mayInteract(poolKey[params_.tokenId], params_.tokenId) {\n ...\n for (uint256 i = 0; i < indexesLength; ) {\n ...\n Position storage position = positions[params_.tokenId][index];\n ...\n // Save position in storage only once at the end of the loop\n if (i == indexesLength - 1) {\n positions[params_.tokenId][index] = position;\n }\n ...\n }\n ...\n}", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function memorializePositions(MemorializePositionsParams calldata params_) external override mayInteract(poolKey[params_.tokenId], params_.tokenId) {\n ...\n for (uint256 i = 0; i < indexesLength; ) {\n ...\n Position storage position = positions[params_.tokenId][index];\n ...\n // Save position in storage only once at the end of the loop\n if (i == indexesLength - 1) {\n positions[params_.tokenId][index] = position;\n }\n ...\n }\n ...\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "01-ondo", "title": "erictee G", "severity_raw": "High", "severity": "high", "description": "### [G-01] ```abi.encode()``` is less efficient than ```abi.encodePacked()```\n\n\n#### Impact\nConsider using ```abi.encodePacked()``` instead for efficieny.\n\n\n#### Findings:\n```\ncontracts/cash/kyc/KYCRegistry.sol:L94 abi.encode(_APPROVAL_TYPEHASH, kycRequirementGroup, user, deadline)\n```\n\n### [G-02] Empty blocks should be removed or emit something\n\n\n#### Impact\nThe code should be refactored such that they no longer exist, or the block should do something useful, such as emitting an event or reverting.\n\n\n#### Findings:\n```\ncontracts/lending/tokens/cCash/CCashDelegate.sol:L15 constructor() {}\n\ncontracts/lending/tokens/cToken/CTokenDelegate.sol:L15 constructor() {}\n\ncontracts/cash/Proxy.sol:L25 ) TransparentUpgradeableProxy(_logic, _admin, _data) {}\n\n```\n \n### [G-03] Use a more recent version of solidity.\n\n\n#### Impact\nUse a solidity version of at least 0.8.2 to get simple compiler automatic inlining \nUse a solidity version of at least 0.8.3 to get better struct packing and cheaper multiple storage reads \nUse a solidity version of at least 0.8.4 to get custom errors, which are cheaper at deployment than revert()/require() strings \nUse a solidity version of at least 0.8.10 to have external calls skip contract existence checks if the external call has a return value.\n\n\n#### Findings:\n```\ncontracts/lending/JumpRateModelV2.sol:L1 pragma solidity ^0.5.16;\n\ncontracts/lending/tokens/cErc20ModifiedDelegator.sol:L7 pragma solidity ^0.5.12;\n\ncontracts/lending/tokens/cErc20ModifiedDelegator.sol:L138 pragma solidity ^0.5.12;\n\ncontracts/lending/tokens/cErc20ModifiedDelegator.sol:L181 pragma solidity ^0.5.12;\n\ncontracts/lending/tokens/cErc20ModifiedDelegator.sol:L296 pragma solidity ^0.5.16;\n\ncontracts/lending/tokens/cErc20ModifiedDelegator.sol:L302 pragma solidity ^0.5.16;\n\ncontracts/lending/tokens/cErc20ModifiedDelegator.sol:L324 pragma solidity ^0.5.16;\n\ncontracts/lending/tokens/cErc20ModifiedDelegator.sol:L647 pragma solidity ^0.", "vulnerable_code": "#### Impact\nConsider using ```abi.encodePacked()``` instead for efficieny.\n\n\n#### Findings:", "fixed_code": "### [G-02] Empty blocks should be removed or emit something\n\n\n#### Impact\nThe code should be refactored such that they no longer exist, or the block should do something useful, such as emitting an event or reverting.\n\n\n#### Findings:", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/erictee-G.md", "collected_at": "2026-01-02T18:15:07.012173+00:00", "source_hash": "c7776ee57081e0f31dd27a852296152a6f394247dfd818e7376dffece2e8fcae", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 368, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "#### Impact\nConsider using", "primary_code_language": "unknown", "primary_code_char_count": 26, "all_code_blocks": "// Code block 1 (unknown):\n#### Impact\nConsider using\n\n// Code block 2 (unknown):\ncontracts/cash/kyc/KYCRegistry.sol:L94 abi.encode(_APPROVAL_TYPEHASH, kycRequirementGroup, user, deadline)\n\n// Code block 3 (unknown):\ncontracts/lending/tokens/cCash/CCashDelegate.sol:L15 constructor() {}\n\ncontracts/lending/tokens/cToken/CTokenDelegate.sol:L15 constructor() {}\n\ncontracts/cash/Proxy.sol:L25 ) TransparentUpgradeableProxy(_logic, _admin, _data) {}", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "#### Impact\nConsider using ```abi.encodePacked()``` instead for efficieny.\n\n\n#### Findings:", "has_vulnerable_code_snippet": true, "fixed_code_actual": "### [G-02] Empty blocks should be removed or emit something\n\n\n#### Impact\nThe code should be refactored such that they no longer exist, or the block should do something useful, such as emitting an event or reverting.\n\n\n#### Findings:", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "12-autonolas", "title": "0x11singh99 Q", "severity_raw": "Critical", "severity": "critical", "description": "# Quality Assurance Report\n\n| QA Issues | Issues | Instances |\n| ------------------------------------------------------------------------------------ | -------------------------------------------------------------------------- | --------- |\n| [[L-01](#l-01-address0-check-missed-in-constructor)] | `address(0)` check missed in `constructor` | 1 |\n| [[L-02](#l-02-check-value-for-zero-before-dividing)] | Check value for `zero` before dividing | 2 |\n| [[N-01](#n-01-public-function-should-be-make-external-if-it-is-not-used-internally)] | `Public` Function should be make `external` if it is not used `internally` | 1 |\n| [[N-02](#n-02-use-delete-instead-of-assigning-zero)] | Use `delete` instead of assigning `zero` | 3 |\n| [[N-03](#n-03-unnecessary-type-casting)] | Unnecessary Type casting | 1 |\n\n# Low-Severity\n\n## [L-01] `address(0)` check missed in `constructor`\n\nIn a smart contract, an address might be empty or \"zero\" at the start. If you don't check whether an address is empty before using it, the contract might get confused or make mistakes.\n\n**Note: Missed by bot-report**\n\n_1 instance_\n\n```solidity\nFile : governance/contracts/veOLAS.sol\n\n132: constructor(address _token, string memory _name, string memory _symbol)\n133: {\n134: token = _token; //@audit Check _token for address(0)\n135: name = _name;\n136: symbol = _symbol;\n137: // Create initial point such that default timestamp and block number are not zero\n138: // See cast specification in the PointVoting str", "vulnerable_code": "File : governance/contracts/veOLAS.sol\n\n132: constructor(address _token, string memory _name, string memory _symbol)\n133: {\n134: token = _token; //@audit Check _token for address(0)\n135: name = _name;\n136: symbol = _symbol;\n137: // Create initial point such that default timestamp and block number are not zero\n138: // See cast specification in the PointVoting structure\n139: mapSupplyPoints[0] = PointVoting(0, 0, uint64(block.timestamp), uint64(block.number), 0);\n140: }\n", "fixed_code": "File : tokenomics/contracts/Tokenomics.sol\n\n //@audit Check `sumUnitIncentives` for 0\n675: totalIncentives = mapUnitIncentives[unitType][unitId].topUp + totalIncentives / sumUnitIncentives;\n\n //@audit Check `sumUnitIncentives` for 0\n1224: topUp += totalIncentives / sumUnitIncentives;\n", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-12-autonolas-findings/blob/main/data/0x11singh99-Q.md", "collected_at": "2026-01-02T18:28:35.425954+00:00", "source_hash": "c793b73802f997ece0b50353ecd4673efc9caf5e762a1819156b8a85abcb2ac7", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File : governance/contracts/veOLAS.sol\n\n132: constructor(address _token, string memory _name, string memory _symbol)\n133: {\n134: token = _token; //@audit Check _token for address(0)\n135: name = _name;\n136: symbol = _symbol;\n137: // Create initial point such that default timestamp and block number are not zero\n138: // See cast specification in the PointVoting structure\n139: mapSupplyPoints[0] = PointVoting(0, 0, uint64(block.timestamp), uint64(block.number), 0);\n140: }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File : tokenomics/contracts/Tokenomics.sol\n\n //@audit Check `sumUnitIncentives` for 0\n675: totalIncentives = mapUnitIncentives[unitType][unitId].topUp + totalIncentives / sumUnitIncentives;\n\n //@audit Check `sumUnitIncentives` for 0\n1224: topUp += totalIncentives / sumUnitIncentives;\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "07-amphora", "title": "albertwh1te Q", "severity_raw": "Low", "severity": "low", "description": "## no access control on liquidate function \n```solidity \nfunction liquidate(\n uint96 _id,\n address _assetAddress,\n uint256 _tokensToLiquidate\n) external {\n (uint256 _actualTokensToLiquidate, uint256 _badFillPrice) = _liquidationMath(_id, _assetAddress, _tokensToLiquidate);\n\n _doLiquidation(_id, _assetAddress, _tokensToLiquidate, _badFillPrice);\n\n emit LogLiquidation(_id, _assetAddress, _tokensToLiquidate);\n}\n```\nThe potential vulnerability here is that there is no access control on the liquidate function. Any external entity can call this function and initiate a liquidation process, provided that the vault is insolvent.\n\nAlthough this is not necessarily a bug, and in fact could be a design choice to allow for open liquidation, it can potentially lead to \"griefing\" attacks where users spam the function with no intention of completing the liquidation process. This could cause unnecessary gas costs for the contract and interfere with the proper functioning of the system.\n\nA solution to this could be to implement a simple form of access control to limit who can initiate the liquidation process, such as requiring the caller to hold a certain number of a specific token, or to have previously interacted with the contract in a certain way.\n", "vulnerable_code": "function liquidate(\n uint96 _id,\n address _assetAddress,\n uint256 _tokensToLiquidate\n) external {\n (uint256 _actualTokensToLiquidate, uint256 _badFillPrice) = _liquidationMath(_id, _assetAddress, _tokensToLiquidate);\n\n _doLiquidation(_id, _assetAddress, _tokensToLiquidate, _badFillPrice);\n\n emit LogLiquidation(_id, _assetAddress, _tokensToLiquidate);\n}", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/albertwh1te-Q.md", "collected_at": "2026-01-02T18:23:40.362181+00:00", "source_hash": "c7e6ddc859a5796ebd9dd20b3ca551b190fced0ad22e81c86a050afc3c14051d", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function liquidate(\n uint96 _id,\n address _assetAddress,\n uint256 _tokensToLiquidate\n) external {\n (uint256 _actualTokensToLiquidate, uint256 _badFillPrice) = _liquidationMath(_id, _assetAddress, _tokensToLiquidate);\n\n _doLiquidation(_id, _assetAddress, _tokensToLiquidate, _badFillPrice);\n\n emit LogLiquidation(_id, _assetAddress, _tokensToLiquidate);\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 3.52} {"source": "c4", "protocol": "02-ai-arena", "title": "JCN Q", "severity_raw": "High", "severity": "high", "description": "## Findings Summary\n\n| ID | Description | Severity |\n| :-: | - | :-: |\n| [L-01](#l-01-users-can-prevent-losses-for-ranked-battles-that-they-initiated) | Users can prevent losses for ranked battles that they initiated | Low |\n| [L-02](#l-02-users-can-avoid-the-economic-effects-of-losses-at-least-once-per-round) | Users can avoid the economic effects of losses at least once per round | Low |\n| [L-03](#l-03-users-with-mintpasses-can-ensure-that-they-only-mint-dendroids-which-are-more-valuable-than-champions) | Users with mintpasses can ensure that they only mint dendroids, which are more valuable than champions | Low |\n| [L-04](#l-04-signature-can-be-reused-if-the-game-is-deployed-on-another-chain) | Signature can be reused if the game is deployed on another chain | Low |\n\n**Note to Lookout and Judge**: \n\nIssues `L-01` and `L-02` are dependent on \"frontrunning\" capabilities. I understand that Arbitrum will be the initial chain in which this game will launch (frontrunning is not currently feasible), however the sponsors have stated in public channels that their decision to launch on another chain is `undecided`. That being said, frontrunning *may* be a possibility in the future if they choose to launch on a chain where that action is feasible. For this reason I have chosen to submit these issues so that the sponsors could be made aware of potential vulnerabilities that could arise if they choose to launch on such a chain. I am placing this disclaimer here in the event that the information I just provided makes these issues invalid (exploit currently infeasible on initial chain), in which case the Lookout/Judge would not need to spend time reading these issues in their entirety.\n\n## [L-01] Users can prevent losses for ranked battles that they initiated\n\n### Bug Description\nWhen two players enter into a ranked battle one of the players must initiate the battle. The player who initiates the battle must spend voltage in order to do so. This \"spending\" of voltage actually oc", "vulnerable_code": "322: function updateBattleRecord(\n323: uint256 tokenId, \n324: uint256 mergingPortion,\n325: uint8 battleResult,\n326: uint256 eloFactor,\n327: bool initiatorBool\n328: ) \n329: external \n330: { \n331: require(msg.sender == _gameServerAddress);\n332: require(mergingPortion <= 100);\n333: address fighterOwner = _fighterFarmInstance.ownerOf(tokenId);\n334: require(\n335: !initiatorBool ||\n336: _voltageManagerInstance.ownerVoltageReplenishTime(fighterOwner) <= block.timestamp || \n337: _voltageManagerInstance.ownerVoltage(fighterOwner) >= VOLTAGE_COST // @audit: ensures the initiator has enough voltage to spend\n338: );\n...\n345: if (initiatorBool) {\n346: _voltageManagerInstance.spendVoltage(fighterOwner, VOLTAGE_COST); // @audit: voltage spent here\n347: }", "fixed_code": "105: function spendVoltage(address spender, uint8 voltageSpent) public {\n106: require(spender == msg.sender || allowedVoltageSpenders[msg.sender]); // @audit: users can spend their own voltage\n107: if (ownerVoltageReplenishTime[spender] <= block.timestamp) {\n108: _replenishVoltage(spender);\n109: }\n110: ownerVoltage[spender] -= voltageSpent; \n111: emit VoltageRemaining(spender, ownerVoltage[spender]);\n112: }\n113:\n114: /// @notice Replenishes voltage and sets the replenish time to 1 day from now\n115: /// @dev This function is called internally to replenish the voltage for the owner.\n116: /// @param owner The address of the owner\n117: function _replenishVoltage(address owner) private {\n118: ownerVoltage[owner] = 100;\n119: ownerVoltageReplenishTime[owner] = uint32(block.timestamp + 1 days); \n120: } ", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/JCN-Q.md", "collected_at": "2026-01-02T19:02:26.890284+00:00", "source_hash": "c835a6a23173379df9cc03ab7fd19d0e7e43688a67698af38be9ec1405d8851a", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "322: function updateBattleRecord(\n323: uint256 tokenId, \n324: uint256 mergingPortion,\n325: uint8 battleResult,\n326: uint256 eloFactor,\n327: bool initiatorBool\n328: ) \n329: external \n330: { \n331: require(msg.sender == _gameServerAddress);\n332: require(mergingPortion <= 100);\n333: address fighterOwner = _fighterFarmInstance.ownerOf(tokenId);\n334: require(\n335: !initiatorBool ||\n336: _voltageManagerInstance.ownerVoltageReplenishTime(fighterOwner) <= block.timestamp || \n337: _voltageManagerInstance.ownerVoltage(fighterOwner) >= VOLTAGE_COST // @audit: ensures the initiator has enough voltage to spend\n338: );\n...\n345: if (initiatorBool) {\n346: _voltageManagerInstance.spendVoltage(fighterOwner, VOLTAGE_COST); // @audit: voltage spent here\n347: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "105: function spendVoltage(address spender, uint8 voltageSpent) public {\n106: require(spender == msg.sender || allowedVoltageSpenders[msg.sender]); // @audit: users can spend their own voltage\n107: if (ownerVoltageReplenishTime[spender] <= block.timestamp) {\n108: _replenishVoltage(spender);\n109: }\n110: ownerVoltage[spender] -= voltageSpent; \n111: emit VoltageRemaining(spender, ownerVoltage[spender]);\n112: }\n113:\n114: /// @notice Replenishes voltage and sets the replenish time to 1 day from now\n115: /// @dev This function is called internally to replenish the voltage for the owner.\n116: /// @param owner The address of the owner\n117: function _replenishVoltage(address owner) private {\n118: ownerVoltage[owner] = 100;\n119: ownerVoltageReplenishTime[owner] = uint32(block.timestamp + 1 days); \n120: } ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-asymmetry", "title": "DevABDee Q", "severity_raw": "Critical", "severity": "critical", "description": "# Qualitative Analysis:\n| Metric | Rating |\n| :-----: | :-----: |\n| Test Coverage | Great |\n| Best Practices | Followed |\n| Documentation | Poor |\n| NatSpec Comments | Great |\n| Decentralization | Not Fully Decentralized |\n| Code Quality & Complexity | Excellent |\n\nIn general, the codebase appears to be impressive. It is notably absent of code complexity and boasts excellent code quality. Best practices and NatSpec have also been utilized effectively, and test coverage is commendable at over 90%. However, given the relatively small size of the codebase, achieving 100% test coverage is expected and would be beneficial for further improvements. Regrettably, there is currently no developer documentation available. It is strongly recommended that the project team prioritize the addition of documentation as soon as possible. It is also worth noting that the protocol is not fully decentralized, with main functions such as stake and unstake being pausable. This presents a risk of a central point of failure, and measures should be taken to address this potential vulnerability.\n\n# Findings Summary:\n| No | Issue |\n| :-----: | :-----: |\n| L-01 | Users will lose funds if `totalWeight` will remained uninitialzed |\n| L-01 | No Storage Gap for Upgradeable Contract Might Lead to Storage Slot Collision |\n| L-01 | Unbounded loop |\n| NC-1 | Dangerous Maths - Loss of precision due to rounding |\n| NC-1 | Ignored return values |\n| NC-1 | Boolean Equality - Compares to a boolean |\n| NC-1 | Unlocked Pragma |\n| NC-1 | Unspecific Imports |\n| NC-1 | Unused function parameter/argument |\n| NC-1 | Solidity Function Ordering Guidelines not followed |\n| BONUS | Goerli & Rinkeby deprecated |\n\n# Low Findings:\n## L-01: Users will lose funds if `totalWeight` will remained uninitialized\n`totalWeight` is initiated to the default value (zero) in [SafEthStorage.sol](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEthStorage.sol#L19)\n```soli", "vulnerable_code": " uint256 public totalWeight;", "fixed_code": " require(totalWeight != 0, \"ERROR\");", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/DevABDee-Q.md", "collected_at": "2026-01-02T18:18:01.114429+00:00", "source_hash": "c880e6d791b4768f838b74b76e20b50181e7bf620b6aa1789bff3619ecef5e77", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEthStorage.sol#L19", "github_files_list": "SafEthStorage.sol", "github_refs_count": 1, "vulnerable_code_actual": " uint256 public totalWeight;", "has_vulnerable_code_snippet": true, "fixed_code_actual": " require(totalWeight != 0, \"ERROR\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "05-ajna", "title": "hals G", "severity_raw": "Gas", "severity": "gas", "description": "# Gas Optimization\n\n## [G-01]\n\nfundingAmount\\_ input is not checked if ==0\n\n## Vulnerability Details\n\nfundingAmount\\_ input is not checked if ==0: if it equals to zero then gas will be wasted on \u201cupdating\u201d the treasure state variable, emitting FundTreasury event & transfer.\n\n## Impact\n\ngas optimization\n\n## Proof of Concept\n\nInstances: 1\n\n```solidity\nFile: 2023-05-ajna/ajna-grants/src/grants/GrantFund.sol\nLine 58: fundTreasury function\n```\n\n## Tools Used\n\nManual Testing.\n\n## Recommended Mitigation Steps\n\ncheck if fundingAmount\\_ input ==0 to save gas when it equals to zero.\n\n#\n\n## [G-02]\n\nfundTreasury function:\ngas will be wasted on \u201cupdating\u201d the treasure state variable, emitting FundTreasury event if the token.balanceOf(msg.sender) >= fundingAmount\\_\n\n## Vulnerability Details\n\nfundTreasury function doesn't check if the balance of the sender of ajnaTokens is >= fundingAmount\\_ from the start which will result in wasted gas used for \u201cupdating\u201d the treasure state variable, emitting FundTreasury event\n\n## Impact\n\ngas optimization\n\n## Proof of Concept\n\nInstances: 1\n\n```solidity\nFile: 2023-05-ajna/ajna-grants/src/grants/GrantFund.sol\nLine 58: fundTreasury function\n```\n\n## Tools Used\n\nManual Testing.\n\n## Recommended Mitigation Steps\n\ncheck if token.balanceOf(msg.sender) >= fundingAmount\\_\n\n#", "vulnerable_code": "File: 2023-05-ajna/ajna-grants/src/grants/GrantFund.sol\nLine 58: fundTreasury function", "fixed_code": "File: 2023-05-ajna/ajna-grants/src/grants/GrantFund.sol\nLine 58: fundTreasury function", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/hals-G.md", "collected_at": "2026-01-02T18:21:28.365250+00:00", "source_hash": "c888c1fb94abb635d18269e2a3145a573169e2de8b5ca6656a059e2d2e92c375", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 172, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: 2023-05-ajna/ajna-grants/src/grants/GrantFund.sol\nLine 58: fundTreasury function", "primary_code_language": "solidity", "primary_code_char_count": 86, "all_code_blocks": "// Code block 1 (solidity):\nFile: 2023-05-ajna/ajna-grants/src/grants/GrantFund.sol\nLine 58: fundTreasury function\n\n// Code block 2 (solidity):\nFile: 2023-05-ajna/ajna-grants/src/grants/GrantFund.sol\nLine 58: fundTreasury function", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: 2023-05-ajna/ajna-grants/src/grants/GrantFund.sol\nLine 58: fundTreasury function\n\nFile: 2023-05-ajna/ajna-grants/src/grants/GrantFund.sol\nLine 58: fundTreasury function", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: 2023-05-ajna/ajna-grants/src/grants/GrantFund.sol\nLine 58: fundTreasury function", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: 2023-05-ajna/ajna-grants/src/grants/GrantFund.sol\nLine 58: fundTreasury function", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6.61} {"source": "c4", "protocol": "01-salty", "title": "Ephraim Q", "severity_raw": "Medium", "severity": "medium", "description": "- Inconsistency of Code Implementation and the Code Comments\n\nThere is a code comment in the PoolUtils.sol that explains how token reserves less than DUST (100) would be disregarded.\n\n```\n// Token reserves less than dust are treated as if they don't exist at all.\n// With the 18 decimals that are used for most tokens, DUST has a value of 0.0000000000000001\n\nuint256 constant public DUST = 100;\n```\n\nHowever, in Abritrage.sol, the _bisectionSearch function implements a check that requires that token reserves is less than or equal to DUST (100).\n\n```\nif ( reservesA0 <= PoolUtils.DUST || reservesA1 <= PoolUtils.DUST || reservesB0 <= PoolUtils.DUST || reservesB1 <= PoolUtils.DUST || reservesC0 <= PoolUtils.DUST || reservesC1 <= PoolUtils.DUST )\nreturn 0;\n```\n\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/arbitrage/ArbitrageSearch.sol#L107\n\nRemediation:\nCorrect checks of token reserves to be less than DUST only.", "vulnerable_code": "// Token reserves less than dust are treated as if they don't exist at all.\n// With the 18 decimals that are used for most tokens, DUST has a value of 0.0000000000000001\n\nuint256 constant public DUST = 100;", "fixed_code": "if ( reservesA0 <= PoolUtils.DUST || reservesA1 <= PoolUtils.DUST || reservesB0 <= PoolUtils.DUST || reservesB1 <= PoolUtils.DUST || reservesC0 <= PoolUtils.DUST || reservesC1 <= PoolUtils.DUST )\nreturn 0;", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/Ephraim-Q.md", "collected_at": "2026-01-02T19:01:16.079228+00:00", "source_hash": "c88a4f9eeca2748e8c9a9af1695e2752eda356290a4f6da7e549a0c3352e01c5", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 411, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "// Token reserves less than dust are treated as if they don't exist at all.\n// With the 18 decimals that are used for most tokens, DUST has a value of 0.0000000000000001\n\nuint256 constant public DUST = 100;", "primary_code_language": "unknown", "primary_code_char_count": 206, "all_code_blocks": "// Code block 1 (unknown):\n// Token reserves less than dust are treated as if they don't exist at all.\n// With the 18 decimals that are used for most tokens, DUST has a value of 0.0000000000000001\n\nuint256 constant public DUST = 100;\n\n// Code block 2 (unknown):\nif ( reservesA0 <= PoolUtils.DUST || reservesA1 <= PoolUtils.DUST || reservesB0 <= PoolUtils.DUST || reservesB1 <= PoolUtils.DUST || reservesC0 <= PoolUtils.DUST || reservesC1 <= PoolUtils.DUST )\nreturn 0;", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ArbitrageSearch.sol#L107", "github_files_list": "ArbitrageSearch.sol", "github_refs_count": 1, "vulnerable_code_actual": "// Token reserves less than dust are treated as if they don't exist at all.\n// With the 18 decimals that are used for most tokens, DUST has a value of 0.0000000000000001\n\nuint256 constant public DUST = 100;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "if ( reservesA0 <= PoolUtils.DUST || reservesA1 <= PoolUtils.DUST || reservesB0 <= PoolUtils.DUST || reservesB1 <= PoolUtils.DUST || reservesC0 <= PoolUtils.DUST || reservesC1 <= PoolUtils.DUST )\nreturn 0;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6.93} {"source": "c4", "protocol": "06-lybra", "title": "kutugu Q", "severity_raw": "Critical", "severity": "critical", "description": "# Findings Summary\n\n| ID | Title | Severity |\n| ------ | ------------------------------------------------------------------------------------- | ------------ |\n| [L-01] | The collateralAmount and getClaimAbleLBR have an accuracy error | Low |\n| [L-02] | The extraRatio and rewardRatio updates should pass through the time lock | Low |\n| [L-03] | StakedLBRLpValue value can be manipulated | Low |\n| [L-04] | There are accuracy problems in EUSD internal accounting calculations | Low |\n| [N-01] | Decimals for collateral and USD may not be equal | Non-Critical |\n| [N-02] | ProtocolRewardsPool getReward event parameter miscalculation | Non-Critical |\n\n# [L-01] The collateralAmount and getClaimAbleLBR have an accuracy error\n\n## Description\n\n```solidity\nuint256 collateralAmount = (((eusdAmount * 1e18) / assetPrice) * (10000 - configurator.redemptionFee())) / 10000;\n```\n\n```solidity\n function getClaimAbleLBR(address user) public view returns (uint256 amount) {\n if (time2fullRedemption[user] > lastWithdrawTime[user]) {\n amount = block.timestamp > time2fullRedemption[user] ? unstakeRatio[user] * (time2fullRedemption[user] - lastWithdrawTime[user]) : unstakeRatio[user] * (block.timestamp - lastWithdrawTime[user]);\n }\n }\n```\n\nThe collateralAmount and getClaimAbleLBR have precision error in dividing before multiplying.\n\n## Recommendations\n\nMultiply before divide\n\n# [L-02] The extraRatio and rewardRatio updates should pass through the time lock\n\n## Description\n\nThe calculation of incentives in EUSDMiningIncentives relies on extraRatio and rewardRatio, whose updates depend on the owner instead of the time lock. \nIf the owner updates the extraRatio and rewardRatio in an insta", "vulnerable_code": "uint256 collateralAmount = (((eusdAmount * 1e18) / assetPrice) * (10000 - configurator.redemptionFee())) / 10000;", "fixed_code": " function getClaimAbleLBR(address user) public view returns (uint256 amount) {\n if (time2fullRedemption[user] > lastWithdrawTime[user]) {\n amount = block.timestamp > time2fullRedemption[user] ? unstakeRatio[user] * (time2fullRedemption[user] - lastWithdrawTime[user]) : unstakeRatio[user] * (block.timestamp - lastWithdrawTime[user]);\n }\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/kutugu-Q.md", "collected_at": "2026-01-02T18:23:06.015973+00:00", "source_hash": "c8e824e6e443d0f9658c279ba91b75453f6eb159d7e97ae786f0b52ae8d82c4b", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 480, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "uint256 collateralAmount = (((eusdAmount * 1e18) / assetPrice) * (10000 - configurator.redemptionFee())) / 10000;", "primary_code_language": "solidity", "primary_code_char_count": 113, "all_code_blocks": "// Code block 1 (solidity):\nuint256 collateralAmount = (((eusdAmount * 1e18) / assetPrice) * (10000 - configurator.redemptionFee())) / 10000;\n\n// Code block 2 (solidity):\nfunction getClaimAbleLBR(address user) public view returns (uint256 amount) {\n if (time2fullRedemption[user] > lastWithdrawTime[user]) {\n amount = block.timestamp > time2fullRedemption[user] ? unstakeRatio[user] * (time2fullRedemption[user] - lastWithdrawTime[user]) : unstakeRatio[user] * (block.timestamp - lastWithdrawTime[user]);\n }\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "uint256 collateralAmount = (((eusdAmount * 1e18) / assetPrice) * (10000 - configurator.redemptionFee())) / 10000;\n\nfunction getClaimAbleLBR(address user) public view returns (uint256 amount) {\n if (time2fullRedemption[user] > lastWithdrawTime[user]) {\n amount = block.timestamp > time2fullRedemption[user] ? unstakeRatio[user] * (time2fullRedemption[user] - lastWithdrawTime[user]) : unstakeRatio[user] * (block.timestamp - lastWithdrawTime[user]);\n }\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "uint256 collateralAmount = (((eusdAmount * 1e18) / assetPrice) * (10000 - configurator.redemptionFee())) / 10000;", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function getClaimAbleLBR(address user) public view returns (uint256 amount) {\n if (time2fullRedemption[user] > lastWithdrawTime[user]) {\n amount = block.timestamp > time2fullRedemption[user] ? unstakeRatio[user] * (time2fullRedemption[user] - lastWithdrawTime[user]) : unstakeRatio[user] * (block.timestamp - lastWithdrawTime[user]);\n }\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ai-arena", "title": "Bauchibred Analysis", "severity_raw": "Medium", "severity": "medium", "description": "# Analysis Report for AI Arena\n\n## Table of Contents\n\n- [Approach](#approach)\n- [Brief Overview](#brief-overview)\n- [Scope and Architecture Overview](#scope-and-architecture-overview)\n- [Centralization Risks](#centralization-risks)\n- [Systemic Risks](#systemic-risks)\n- [Recommendations](#recommendations)\n- [Security Researcher Logistics](#security-researcher-logistics)\n- [Conclusion](#conclusion)\n- [Resources](#resources)\n\n## Approach\n\nStarted with a comprehensive analysis of the provided docs to understand protocol functionality and key points, ambiguities were discussed with the sponsors(deva), and possible risk areas were outlined.\n\nFollowed by a manual review of each contract in scope, testing function behavior, protocol logic against expectations, and working out potential attack vectors. Vulnerabilities related to dependencies and inheritances, were also assessed. Comparisons with similar protocols was also performed to identify recurring issues and evaluate fix effectiveness.\n\nFinally, issues identified during the security review were compiled into a comprehensive audit report.\n\n## Brief Overview\n\nAI Arena introduces a player-versus-player combat game set in a realm where human-trained AI fighters clash for supremacy. In the Web3 adaptation of AI Arena, these fighters are represented as NFTs through the` FighterFarm.sol` contract, where each NFT fighter is characterized by:\n\n- Physical Attributes: Shape the visual aesthetics of the fighter.\n- Generation: Also influences the fighter's visual traits.\n- Weight: Impacts the combat capabilities.\n- Element: Bestows unique special powers.\n- Fighter Type: Distinguishes between a standard Champion or a Dendroid.\n- Model Data: Includes the model type and its corresponding hash.\n\n## Scope and Architecture Overview\n\n### AIArenaHelper.sol\n\nThis contract helps generate and manage the AI Arena fighters physical attributes, having it's constructor initializing the contract with the attribute probabilities for gen 0.\n**State ", "vulnerable_code": "### FighterFarm.sol\n\n**Purpose:**\n\n- Manages AI Arena Fighter NFTs (ERC721 tokens).\n- Also handles creation, ownership, transfers, redemption of mint passes, merging pool interactions, fighter staking, rerolling, model updates, and metadata retrieval.\n\n**Key Roles and Permissions:**\n\n- **Owner:** Privileged address with full control over contract functions (e.g., ownership transfer, generation increment).\n- **Delegated Address:** Authorized to set token URIs and sign fighter claim messages.\n- **Stakers:** Addresses allowed to stake fighters on behalf of users.\n\n**NFT Creation and Management:**\n\n- **Minting:**\n - Occurs through claiming (with signature verification), mint pass redemption, or merging pool minting.\n- **Rerolling:**\n - Regenerates a fighter's traits with a Neuron token (NRN) cost, limited by a maximum reroll count.\n- **Model Updates:**\n - Allows owners to update the ML model associated with their fighters.\n- **Staking:**\n - Controls a fighter's ability to be transferred.\n\n**Interactions with Other Contracts:**\n\n- **AIArenaHelper:**\n - Assists with physical attribute generation.\n- **AAMintPass:**\n - Interacts with mint pass redemption.\n- **Neuron:**\n - Handles NRN token transfers for rerolling.\n- **Merging Pool:**\n - Facilitates minting from the merging pool.\n\n**Additional Features:**\n\n- **URI Storage:**\n - Stores contract and token metadata on IPFS.\n- **Fighter Information Retrieval:**\n - Provides a function to access comprehensive fighter data.\n", "fixed_code": "### GameItems.sol\n\n**Purpose:**\n\nThis contract manages a collection of in-game items used in AI Arena, allowing users to:\n\n- Buy items with the Neuron (NRN) token.\n- Mint items with finite or infinite supply.\n- Burn items (only authorized addresses).\n- Transfer items (if allowed), with admin control over transferability.\n- Manage item attributes (name, price, daily allowance, etc.) by admins.\n\n**Key Features:**\n\n- **ERC1155 compliant:** Manages multiple item types with a single contract.\n- **Daily allowance:** Limits the number of items a user can buy per day.\n- **Transferable/locked:** Admins can control if items can be traded.\n- **Admin roles:** Defines addresses with special permissions.\n- **Metadata storage:** Stores item data on IPFS.\n\n**Contract Structure:**\n\n- **State Variables:** Store contract data like item attributes, treasury address, owner address, etc.\n- **Mappings:** Track user allowances, replenish times, burning/admin permissions, and token URIs.\n- **Events:** Emit signals for item purchases, locking/unlocking, and more.\n- **Functions:**\n - **External:** Public functions for buying, transferring, burning, and managing items (admins only).\n - **Public:** View information about items and allowances.\n - **Private:** Internal functions for managing allowances and metadata.\n\n**Additional Notes:**\n\n- The contract interacts with the `Neuron` contract for NRN token transfers.\n- Only authorized addresses can burn items.\n- Admins have full control over item creation, attributes, and transferability.\n- The contract uses an ERC1155 base for efficient management of multiple item types.\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/Bauchibred-Analysis.md", "collected_at": "2026-01-02T19:02:15.226843+00:00", "source_hash": "c947639fb03e5aab008692eb53ad624d01eccb9645854c41a076a43d3483164b", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "### FighterFarm.sol\n\n**Purpose:**\n\n- Manages AI Arena Fighter NFTs (ERC721 tokens).\n- Also handles creation, ownership, transfers, redemption of mint passes, merging pool interactions, fighter staking, rerolling, model updates, and metadata retrieval.\n\n**Key Roles and Permissions:**\n\n- **Owner:** Privileged address with full control over contract functions (e.g., ownership transfer, generation increment).\n- **Delegated Address:** Authorized to set token URIs and sign fighter claim messages.\n- **Stakers:** Addresses allowed to stake fighters on behalf of users.\n\n**NFT Creation and Management:**\n\n- **Minting:**\n - Occurs through claiming (with signature verification), mint pass redemption, or merging pool minting.\n- **Rerolling:**\n - Regenerates a fighter's traits with a Neuron token (NRN) cost, limited by a maximum reroll count.\n- **Model Updates:**\n - Allows owners to update the ML model associated with their fighters.\n- **Staking:**\n - Controls a fighter's ability to be transferred.\n\n**Interactions with Other Contracts:**\n\n- **AIArenaHelper:**\n - Assists with physical attribute generation.\n- **AAMintPass:**\n - Interacts with mint pass redemption.\n- **Neuron:**\n - Handles NRN token transfers for rerolling.\n- **Merging Pool:**\n - Facilitates minting from the merging pool.\n\n**Additional Features:**\n\n- **URI Storage:**\n - Stores contract and token metadata on IPFS.\n- **Fighter Information Retrieval:**\n - Provides a function to access comprehensive fighter data.\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "### GameItems.sol\n\n**Purpose:**\n\nThis contract manages a collection of in-game items used in AI Arena, allowing users to:\n\n- Buy items with the Neuron (NRN) token.\n- Mint items with finite or infinite supply.\n- Burn items (only authorized addresses).\n- Transfer items (if allowed), with admin control over transferability.\n- Manage item attributes (name, price, daily allowance, etc.) by admins.\n\n**Key Features:**\n\n- **ERC1155 compliant:** Manages multiple item types with a single contract.\n- **Daily allowance:** Limits the number of items a user can buy per day.\n- **Transferable/locked:** Admins can control if items can be traded.\n- **Admin roles:** Defines addresses with special permissions.\n- **Metadata storage:** Stores item data on IPFS.\n\n**Contract Structure:**\n\n- **State Variables:** Store contract data like item attributes, treasury address, owner address, etc.\n- **Mappings:** Track user allowances, replenish times, burning/admin permissions, and token URIs.\n- **Events:** Emit signals for item purchases, locking/unlocking, and more.\n- **Functions:**\n - **External:** Public functions for buying, transferring, burning, and managing items (admins only).\n - **Public:** View information about items and allowances.\n - **Private:** Internal functions for managing allowances and metadata.\n\n**Additional Notes:**\n\n- The contract interacts with the `Neuron` contract for NRN token transfers.\n- Only authorized addresses can burn items.\n- Admins have full control over item creation, attributes, and transferability.\n- The contract uses an ERC1155 base for efficient management of multiple item types.\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "04-panoptic", "title": "report", "severity_raw": "Critical", "severity": "critical", "description": "---\nsponsor: \"Panoptic\"\nslug: \"2024-04-panoptic\"\ndate: \"2024-06-24\"\ntitle: \"Panoptic\"\nfindings: \"https://github.com/code-423n4/2024-04-panoptic-findings/issues\"\ncontest: 354\n---\n\n# Overview\n\n## About C4\n\nCode4rena (C4) is an open organization consisting of security researchers, auditors, developers, and individuals with domain expertise in smart contracts.\n\nA C4 audit is an event in which community participants, referred to as Wardens, review, audit, or analyze smart contract logic in exchange for a bounty provided by sponsoring projects.\n\nDuring the audit outlined in this document, C4 conducted an analysis of the Panoptic smart contract system written in Solidity. The audit took place between April 1\u2014April 22 2024.\n\n## Wardens\n\n60 Wardens contributed reports to Panoptic:\n\n 1. [0xLogos](https://code4rena.com/@0xLogos)\n 2. [bin2chen](https://code4rena.com/@bin2chen)\n 3. [KupiaSec](https://code4rena.com/@KupiaSec)\n 4. [rbserver](https://code4rena.com/@rbserver)\n 5. [Kalogerone](https://code4rena.com/@Kalogerone)\n 6. [0xdice91](https://code4rena.com/@0xdice91)\n 7. [pkqs90](https://code4rena.com/@pkqs90)\n 8. [petro\\_1912](https://code4rena.com/@petro_1912)\n 9. [Aymen0909](https://code4rena.com/@Aymen0909)\n 10. [0xStalin](https://code4rena.com/@0xStalin)\n 11. [DanielArmstrong](https://code4rena.com/@DanielArmstrong)\n 12. [Joshuajee](https://code4rena.com/@Joshuajee)\n 13. [JecikPo](https://code4rena.com/@JecikPo)\n 14. [Udsen](https://code4rena.com/@Udsen)\n 15. [FastChecker](https://code4rena.com/@FastChecker)\n 16. [DadeKuma](https://code4rena.com/@DadeKuma)\n 17. [Dup1337](https://code4rena.com/@Dup1337) ([ChaseTheLight](https://code4rena.com/@ChaseTheLight), [sorrynotsorry](https://code4rena.com/@sorrynotsorry), and [deliriusz](https://code4rena.com/@deliriusz))\n 18. [Bauchibred](https://code4rena.com/@Bauchibred)\n 19. [sammy](https://code4rena.com/@sammy)\n 20. [jesjupyter](https://code4rena.com/@jesjupyter)\n 21. [99Crits](https://code4rena.com/@99Cri", "vulnerable_code": " accumulatedPremium = LeftRightUnsigned\n .wrap(0)\n .toRightSlot(premiumAccumulator0)\n .toLeftSlot(premiumAccumulator1);\n\n // update the premium accumulator for the long position to the latest value\n // (the entire premia delta will be settled)\n LeftRightUnsigned premiumAccumulatorsLast = s_options[owner][tokenId][legIndex];\n s_options[owner][tokenId][legIndex] = accumulatedPremium;\n\n> accumulatedPremium = accumulatedPremium.sub(premiumAccumulatorsLast);\n }\n\n uint256 liquidity = PanopticMath\n .getLiquidityChunk(tokenId, legIndex, s_positionBalance[owner][tokenId].rightSlot())\n .liquidity();\n\n unchecked {\n // update the realized premia\n> LeftRightSigned realizedPremia = LeftRightSigned\n> .wrap(0)\n> .toRightSlot(int128(int256((accumulatedPremium.rightSlot() * liquidity) / 2 ** 64)))\n> .toLeftSlot(int128(int256((accumulatedPremium.leftSlot() * liquidity) / 2 ** 64)));\n\n // deduct the paid premium tokens from the owner's balance and add them to the cumulative settled token delta\n s_collateralToken0.exercise(owner, 0, 0, 0, realizedPremia.rightSlot());\n s_collateralToken1.exercise(owner, 0, 0, 0, realizedPremia.leftSlot());", "fixed_code": " function exercise(\n address optionOwner,\n int128 longAmount,\n int128 shortAmount,\n int128 swappedAmount,\n int128 realizedPremium\n ) external onlyPanopticPool returns (int128) {\n unchecked {\n // current available assets belonging to PLPs (updated after settlement) excluding any premium paid\n int256 updatedAssets = int256(uint256(s_poolAssets)) - swappedAmount;\n\n // add premium to be paid/collected on position close\n> int256 tokenToPay = -realizedPremium;\n\n // if burning ITM and swap occurred, compute tokens to be paid through exercise and add swap fees\n int256 intrinsicValue = swappedAmount - (longAmount - shortAmount);\n\n if ((intrinsicValue != 0) && ((shortAmount != 0) || (longAmount != 0))) {\n // intrinsic value is the amount that need to be exchanged due to burning in-the-money\n\n // add the intrinsic value to the tokenToPay\n tokenToPay += intrinsicValue;\n }\n\n> if (tokenToPay > 0) {\n // if user must pay tokens, burn them from user balance (revert if balance too small)\n uint256 sharesToBurn = Math.mulDivRoundingUp(\n uint256(tokenToPay),\n totalSupply,\n totalAssets()\n );\n _burn(optionOwner, sharesToBurn);\n> } else if (tokenToPay < 0) {\n // if user must receive tokens, mint them\n uint256 sharesToMint = convertToShares(uint256(-tokenToPay));\n _mint(optionOwner, sharesToMint);\n }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-04-panoptic-findings/blob/main/report.md", "collected_at": "2026-01-02T19:03:22.146552+00:00", "source_hash": "ca8d564b41d42371582ca13106948273c94e2e7ebc9faac0bac7011f1986d905", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " accumulatedPremium = LeftRightUnsigned\n .wrap(0)\n .toRightSlot(premiumAccumulator0)\n .toLeftSlot(premiumAccumulator1);\n\n // update the premium accumulator for the long position to the latest value\n // (the entire premia delta will be settled)\n LeftRightUnsigned premiumAccumulatorsLast = s_options[owner][tokenId][legIndex];\n s_options[owner][tokenId][legIndex] = accumulatedPremium;\n\n> accumulatedPremium = accumulatedPremium.sub(premiumAccumulatorsLast);\n }\n\n uint256 liquidity = PanopticMath\n .getLiquidityChunk(tokenId, legIndex, s_positionBalance[owner][tokenId].rightSlot())\n .liquidity();\n\n unchecked {\n // update the realized premia\n> LeftRightSigned realizedPremia = LeftRightSigned\n> .wrap(0)\n> .toRightSlot(int128(int256((accumulatedPremium.rightSlot() * liquidity) / 2 ** 64)))\n> .toLeftSlot(int128(int256((accumulatedPremium.leftSlot() * liquidity) / 2 ** 64)));\n\n // deduct the paid premium tokens from the owner's balance and add them to the cumulative settled token delta\n s_collateralToken0.exercise(owner, 0, 0, 0, realizedPremia.rightSlot());\n s_collateralToken1.exercise(owner, 0, 0, 0, realizedPremia.leftSlot());", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function exercise(\n address optionOwner,\n int128 longAmount,\n int128 shortAmount,\n int128 swappedAmount,\n int128 realizedPremium\n ) external onlyPanopticPool returns (int128) {\n unchecked {\n // current available assets belonging to PLPs (updated after settlement) excluding any premium paid\n int256 updatedAssets = int256(uint256(s_poolAssets)) - swappedAmount;\n\n // add premium to be paid/collected on position close\n> int256 tokenToPay = -realizedPremium;\n\n // if burning ITM and swap occurred, compute tokens to be paid through exercise and add swap fees\n int256 intrinsicValue = swappedAmount - (longAmount - shortAmount);\n\n if ((intrinsicValue != 0) && ((shortAmount != 0) || (longAmount != 0))) {\n // intrinsic value is the amount that need to be exchanged due to burning in-the-money\n\n // add the intrinsic value to the tokenToPay\n tokenToPay += intrinsicValue;\n }\n\n> if (tokenToPay > 0) {\n // if user must pay tokens, burn them from user balance (revert if balance too small)\n uint256 sharesToBurn = Math.mulDivRoundingUp(\n uint256(tokenToPay),\n totalSupply,\n totalAssets()\n );\n _burn(optionOwner, sharesToBurn);\n> } else if (tokenToPay < 0) {\n // if user must receive tokens, mint them\n uint256 sharesToMint = convertToShares(uint256(-tokenToPay));\n _mint(optionOwner, sharesToMint);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "04-caviar", "title": "codeslide Q", "severity_raw": "Critical", "severity": "critical", "description": "### Low Risk Issues List\n\n| Number | Issue | Instances |\n| :----: | :---- | :-------: |\n| [L-01] | Unspecific compiler version pragma | 5 |\n| [L-02] | Unsafe casting of uints | 4 |\n\n#### [L-01] Unspecific compiler version pragma\nThe compiler version specified for a contract should be locked to the version it has been tested the most with. Locking the pragma helps ensure that contracts do not accidentally get deployed using, for example, the latest compiler which may have higher risks of undiscovered bugs. Contracts may also be deployed by others and the pragma indicates the compiler version intended by the original authors. [locking-pragmas](https://consensys.github.io/smart-contract-best-practices/development-recommendations/solidity-specific/locking-pragmas/)\n\nFor example:\n\n```solidity\n// bad\npragma solidity ^0.8.9;\n\n// good\npragma solidity 0.8.9;\n```\n\n```solidity\nFile: src/Factory.sol\n\n2: pragma solidity ^0.8.19;\n```\n\n```solidity\nFile: src/PrivatePoolMetadata.sol\n\n2: pragma solidity ^0.8.19;\n```\n\n```solidity\nFile: src/EthRouter.sol\n\n2: pragma solidity ^0.8.19;\n```\n\n```solidity\nFile: src/PrivatePool.sol\n\n2: pragma solidity ^0.8.19;\n```\n\n```solidity\nFile: interfaces/IStolenNftOracle.sol\n\n2: pragma solidity ^0.8.19;\n```\n\n#### [L-02] Unsafe casting of uints\n\nDowncasting from uint256 in Solidity does not revert on overflow. This can easily result in undesired exploitation or bugs, since developers usually assume that overflows raise errors. [OpenZeppelin's SafeCast](https://docs.openzeppelin.com/contracts/3.x/api/utils#SafeCast) restores this intuition by reverting the transaction when such an operation overflows. Using this library instead of the unchecked operations eliminates an entire class of bugs, so it\u2019s recommended to use it always.\n\nFor example:\n\n```solidity\n// Before\nvirtualNftReserves -= uint128(weightSum);\n```\n\n```solidity\n// After\nvirtualNftReserves -= toUint128(weightSum);\n```\n\n```solidity\nFile: src/PrivatePool.sol\n\n230: virt", "vulnerable_code": "// bad\npragma solidity ^0.8.9;\n\n// good\npragma solidity 0.8.9;", "fixed_code": "File: src/Factory.sol\n\n2: pragma solidity ^0.8.19;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/codeslide-Q.md", "collected_at": "2026-01-02T18:20:22.722332+00:00", "source_hash": "cab3b9ff94c80e78359a58217b102d206a520722e39009e0b4570f2dc21c67bd", "code_block_count": 8, "solidity_block_count": 8, "total_code_chars": 464, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "// bad\npragma solidity ^0.8.9;\n\n// good\npragma solidity 0.8.9;", "primary_code_language": "solidity", "primary_code_char_count": 62, "all_code_blocks": "// Code block 1 (solidity):\n// bad\npragma solidity ^0.8.9;\n\n// good\npragma solidity 0.8.9;\n\n// Code block 2 (solidity):\nFile: src/Factory.sol\n\n2: pragma solidity ^0.8.19;\n\n// Code block 3 (solidity):\nFile: src/PrivatePoolMetadata.sol\n\n2: pragma solidity ^0.8.19;\n\n// Code block 4 (solidity):\nFile: src/EthRouter.sol\n\n2: pragma solidity ^0.8.19;\n\n// Code block 5 (solidity):\nFile: src/PrivatePool.sol\n\n2: pragma solidity ^0.8.19;\n\n// Code block 6 (solidity):\nFile: interfaces/IStolenNftOracle.sol\n\n2: pragma solidity ^0.8.19;\n\n// Code block 7 (solidity):\n// Before\nvirtualNftReserves -= uint128(weightSum);\n\n// Code block 8 (solidity):\n// After\nvirtualNftReserves -= toUint128(weightSum);", "all_code_blocks_count": 8, "has_diff_blocks": false, "diff_code": "", "solidity_code": "// bad\npragma solidity ^0.8.9;\n\n// good\npragma solidity 0.8.9;\n\nFile: src/Factory.sol\n\n2: pragma solidity ^0.8.19;\n\nFile: src/PrivatePoolMetadata.sol\n\n2: pragma solidity ^0.8.19;\n\nFile: src/EthRouter.sol\n\n2: pragma solidity ^0.8.19;\n\nFile: src/PrivatePool.sol\n\n2: pragma solidity ^0.8.19;\n\nFile: interfaces/IStolenNftOracle.sol\n\n2: pragma solidity ^0.8.19;\n\n// Before\nvirtualNftReserves -= uint128(weightSum);\n\n// After\nvirtualNftReserves -= toUint128(weightSum);", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "// bad\npragma solidity ^0.8.9;\n\n// good\npragma solidity 0.8.9;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: src/Factory.sol\n\n2: pragma solidity ^0.8.19;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 13} {"source": "c4", "protocol": "02-ethos", "title": "Co0nan Q", "severity_raw": "Critical", "severity": "critical", "description": "Total of 33 issue Low and NC.\n---------\n1 - delete doesn\u2019t delete mapping in struct\n\nThe _updateDepositAndSnapshots() function in SP contract deletes a depositSnapshots struct, but the mapping in the Snapshots struct is not deleted. Values from this \u201cdeleted\u201d mapping can still be accessed and there are no comments, function names, or other indicators that this is known. This issue is documented in Solidity\u2019s security considerations documentation:\nhttps://docs.soliditylang.org/en/v0.8.10/security-considerations.html#clearing-mappings\n\nThe delete operation occurs on \nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/StabilityPool.sol#L813\n\n```\n if (_newValue == 0) {\n for (uint i = 0; i < collaterals.length; i++) {\n delete depositSnapshots[_depositor].S[collaterals[i]];\n }\n delete depositSnapshots[_depositor];\n emit DepositSnapshotUpdated(_depositor, 0, collaterals, amounts, 0);\n return;\n }\n```\n\nThe mapping that still exists after the delete on:\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/StabilityPool.sol#L179\n\n```\nstruct Snapshots {\n mapping (address => uint) S;\n uint P;\n uint G;\n uint128 scale;\n uint128 epoch;\n }\n\n```\n2 - Improper emit for events.\n\n2.1 - The function \"stake\" inside LQTYStaking.sol emit the event \"StakingGainsWithdrawn\" before actually sending the accumulated LUSD and collateral gains to the caller. In case of transfer failure, this event will be emit already which is misleading.\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LQTY/LQTYStaking.sol#L131\n\n```\n lqtyToken.safeTransferFrom(msg.sender, address(this), _LQTYamount);\n\n emit StakeChanged(msg.sender, newStake);\n emit StakingGainsWithdrawn(msg.sender, LUSDGain, collGainAssets, collGainAmounts);\n\n // Send accumulated LUSD and collateral gains to the caller\n i", "vulnerable_code": " if (_newValue == 0) {\n for (uint i = 0; i < collaterals.length; i++) {\n delete depositSnapshots[_depositor].S[collaterals[i]];\n }\n delete depositSnapshots[_depositor];\n emit DepositSnapshotUpdated(_depositor, 0, collaterals, amounts, 0);\n return;\n }", "fixed_code": "struct Snapshots {\n mapping (address => uint) S;\n uint P;\n uint G;\n uint128 scale;\n uint128 epoch;\n }\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/Co0nan-Q.md", "collected_at": "2026-01-02T18:16:03.549192+00:00", "source_hash": "cacd6acfab0ce29a58e90bc71c24a6ceef2e123a5553307819ca0999b6b204a0", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 465, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "if (_newValue == 0) {\n for (uint i = 0; i < collaterals.length; i++) {\n delete depositSnapshots[_depositor].S[collaterals[i]];\n }\n delete depositSnapshots[_depositor];\n emit DepositSnapshotUpdated(_depositor, 0, collaterals, amounts, 0);\n return;\n }", "primary_code_language": "unknown", "primary_code_char_count": 326, "all_code_blocks": "// Code block 1 (unknown):\nif (_newValue == 0) {\n for (uint i = 0; i < collaterals.length; i++) {\n delete depositSnapshots[_depositor].S[collaterals[i]];\n }\n delete depositSnapshots[_depositor];\n emit DepositSnapshotUpdated(_depositor, 0, collaterals, amounts, 0);\n return;\n }\n\n// Code block 2 (unknown):\nstruct Snapshots {\n mapping (address => uint) S;\n uint P;\n uint G;\n uint128 scale;\n uint128 epoch;\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "StabilityPool.sol#L813, StabilityPool.sol#L179, LQTYStaking.sol#L131", "github_files_list": "LQTYStaking.sol, StabilityPool.sol", "github_refs_count": 3, "vulnerable_code_actual": " if (_newValue == 0) {\n for (uint i = 0; i < collaterals.length; i++) {\n delete depositSnapshots[_depositor].S[collaterals[i]];\n }\n delete depositSnapshots[_depositor];\n emit DepositSnapshotUpdated(_depositor, 0, collaterals, amounts, 0);\n return;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "struct Snapshots {\n mapping (address => uint) S;\n uint P;\n uint G;\n uint128 scale;\n uint128 epoch;\n }\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "09-ondo", "title": "orion Q", "severity_raw": "Unknown", "severity": "unknown", "description": "usage of transfer and transferFrom without check of returned bool, the usdy token if ever upgraded to another ERC20 that returns false for transfer failure of tokens some of Ondo's function will works in unintended way,\n\nconsider the wrapping function at : https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDY.sol#L434\n\nit uses usdy.transferFrom without check, if usdy.transferFrom returns false on transfer failures, users will get the shares minted without transfering any tokens\n\nConsider using safetransferFrom, or \n\n```\n(,bool s) = usdy.transferFrom(msg.sender, address(this), _USDYAmount);\nrequire(s,\"failed\");\n```\n", "vulnerable_code": "(,bool s) = usdy.transferFrom(msg.sender, address(this), _USDYAmount);\nrequire(s,\"failed\");", "fixed_code": "", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/orion-Q.md", "collected_at": "2026-01-02T18:26:11.302203+00:00", "source_hash": "caf5f60ebeffed28268d8eddda8153bdfef8ab49b2843edd183b100d0de567cb", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 91, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "(,bool s) = usdy.transferFrom(msg.sender, address(this), _USDYAmount);\nrequire(s,\"failed\");", "primary_code_language": "unknown", "primary_code_char_count": 91, "all_code_blocks": "// Code block 1 (unknown):\n(,bool s) = usdy.transferFrom(msg.sender, address(this), _USDYAmount);\nrequire(s,\"failed\");", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "rUSDY.sol#L434", "github_files_list": "rUSDY.sol", "github_refs_count": 1, "vulnerable_code_actual": "(,bool s) = usdy.transferFrom(msg.sender, address(this), _USDYAmount);\nrequire(s,\"failed\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.28} {"source": "c4", "protocol": "01-ondo", "title": "shark G", "severity_raw": "Medium", "severity": "medium", "description": "## 1. Functions that can only be called by users with correct permissions/roles can be marked `payable`\n\nFunctions with access control will cost less gas when marked as `payable` (assuming the caller has correct permissions). This is because the compiler doesn't need to check for `msg.value`, which saves approximately **20 gas** per call.\n\nFor example, the following functions may be marked `payable` to save gas:\n\n- File: `CashManager.sol` [Line 336-350](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L336-L350)\n- File: `CashManager.sol` [Line 526-528](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L526-L528)\n- File: `CashManager.sol` [Line 533-535](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L533-L535)\n- File: `KYCRegistry.sol` [Line 144-150](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistry.sol#L144-L150)\n\n## 2. Using `storage` instead of `memory` for structs/arrays saves gas\n\nWhen retrieving data from a `storage` location, assigning the data to a `memory` variable will cause all fields of the struct/array to be read from storage, which incurs a Gcoldsload (2100 gas) for each field of the struct/array. If the fields are read from the new `memory` variable, they incur an additional MLOAD rather than a cheap stack read. Instead of declaring the variable with the memory keyword, declaring the variable with the `storage` keyword and caching any fields that need to be re-read in stack variables, will be much cheaper, only incurring the Gcoldsload for the fields actually read. The only time it makes sense to read the whole struct/array into a `memory` variable, is if the full struct/array is being returned by the function, is being passed to a function that requires `memory`, or if the array/struct is being read from another `memory` array/struct\n\nHere are some instances of this issue:\n\nFile: `CTokenCash.sol` ([Line 221](https", "vulnerable_code": "221: Exp memory exchangeRate = Exp({mantissa: exchangeRateCurrent()});\n...\n433: Exp memory simpleInterestFactor = mul_(\n...\n506: Exp memory exchangeRate = Exp({mantissa: exchangeRateStoredInternal()});\n...\n590: Exp memory exchangeRate = Exp({mantissa: exchangeRateStoredInternal()});\n...\n1027: Exp memory exchangeRate = Exp({mantissa: exchangeRateStoredInternal()});", "fixed_code": " require(\n (answeredInRound >= roundId) &&\n (updatedAt >= block.timestamp - maxChainlinkOracleTimeDelay),\n \"Chainlink oracle price is stale\"\n );", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/shark-G.md", "collected_at": "2026-01-02T18:15:33.142346+00:00", "source_hash": "cb11a77d80965614f091d467ab93b2352b1cac53eb592b6a656bcdad56057d1f", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CashManager.sol#L336-L350, CashManager.sol#L526-L528, CashManager.sol#L533-L535, KYCRegistry.sol#L144-L150", "github_files_list": "CashManager.sol, KYCRegistry.sol", "github_refs_count": 4, "vulnerable_code_actual": "221: Exp memory exchangeRate = Exp({mantissa: exchangeRateCurrent()});\n...\n433: Exp memory simpleInterestFactor = mul_(\n...\n506: Exp memory exchangeRate = Exp({mantissa: exchangeRateStoredInternal()});\n...\n590: Exp memory exchangeRate = Exp({mantissa: exchangeRateStoredInternal()});\n...\n1027: Exp memory exchangeRate = Exp({mantissa: exchangeRateStoredInternal()});", "has_vulnerable_code_snippet": true, "fixed_code_actual": " require(\n (answeredInRound >= roundId) &&\n (updatedAt >= block.timestamp - maxChainlinkOracleTimeDelay),\n \"Chainlink oracle price is stale\"\n );", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "06-lybra", "title": "Rolezn G", "severity_raw": "Medium", "severity": "medium", "description": "## GAS Summary\n\n### Gas Optimizations\n| |Issue|Contexts|Estimated Gas Saved|\n|-|:-|:-|:-:|\n| [GAS‑1](#GAS‑1) | Consider activating `via-ir` for deploying | 1 | - |\n| [GAS‑2](#GAS‑2) | Use assembly to emit events | 53 | 2014 |\n| [GAS‑3](#GAS‑3) | Use `assembly` to write address storage values | 4 | - |\n| [GAS‑4](#GAS‑4) | Structs can be packed into fewer storage slots by editing time variables | 1 | 2000 |\n| [GAS‑5](#GAS‑5) | State variables can be packed into fewer storage slots | 3 | 6000 |\n| [GAS‑6](#GAS‑6) | Use solidity version 0.8.20 to gain some gas boost | 21 | 1848 |\n\nTotal: 83 contexts over 6 issues\n\n## Gas Optimizations\n\n### [GAS‑1] Consider activating `via-ir` for deploying\n\nThe IR-based code generator was introduced with an aim to not only allow code generation to be more transparent and auditable but also to enable more powerful optimization passes that span across functions.\n\nYou can enable it on the command line using `--via-ir` or with the option `{\"viaIR\": true}`.\n\nThis will take longer to compile, but you can just simple test it before deploying and if you got a better benchmark then you can add --via-ir to your deploy command\n\nMore on: https://docs.soliditylang.org/en/v0.8.17/ir-breaking-changes.html\n\n\n\n\n### [GAS‑2] Use assembly to emit events\n\nWe can use assembly to emit events efficiently by utilizing `scratch space` and the `free memory pointer`. This will allow us to potentially avoid memory expansion costs.\nNote: In order to do this optimization safely, we will need to cache and restore the free memory pointer.\n\nFor example, for a generic `emit` event for `eventSentAmountExample`:\n```solidity\n// uint256 id, uint256 value, uint256 amount\nemit eventSentAmountExample(id, value, amount);\n```\n\nWe can use the following assembly emit", "vulnerable_code": "// uint256 id, uint256 value, uint256 amount\nemit eventSentAmountExample(id, value, amount);", "fixed_code": " assembly {\n let memptr := mload(0x40)\n mstore(0x00, calldataload(0x44))\n mstore(0x20, calldataload(0xa4))\n mstore(0x40, amount)\n log1(\n 0x00,\n 0x60,\n // keccak256(\"eventSentAmountExample(uint256,uint256,uint256)\")\n 0xa622cf392588fbf2cd020ff96b2f4ebd9c76d7a4bc7f3e6b2f18012312e76bc3\n )\n mstore(0x40, memptr)\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/Rolezn-G.md", "collected_at": "2026-01-02T18:22:39.978695+00:00", "source_hash": "cb339f81577af1a19ec96f3d5a27d61df0dadf3b878e3081ed09ec859b56f3a6", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 92, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "// uint256 id, uint256 value, uint256 amount\nemit eventSentAmountExample(id, value, amount);", "primary_code_language": "solidity", "primary_code_char_count": 92, "all_code_blocks": "// Code block 1 (solidity):\n// uint256 id, uint256 value, uint256 amount\nemit eventSentAmountExample(id, value, amount);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "// uint256 id, uint256 value, uint256 amount\nemit eventSentAmountExample(id, value, amount);", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "// uint256 id, uint256 value, uint256 amount\nemit eventSentAmountExample(id, value, amount);", "has_vulnerable_code_snippet": true, "fixed_code_actual": " assembly {\n let memptr := mload(0x40)\n mstore(0x00, calldataload(0x44))\n mstore(0x20, calldataload(0xa4))\n mstore(0x40, amount)\n log1(\n 0x00,\n 0x60,\n // keccak256(\"eventSentAmountExample(uint256,uint256,uint256)\")\n 0xa622cf392588fbf2cd020ff96b2f4ebd9c76d7a4bc7f3e6b2f18012312e76bc3\n )\n mstore(0x40, memptr)\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "03-asymmetry", "title": "Aymen0909 G", "severity_raw": "Low", "severity": "low", "description": "# Gas Optimizations\n\n## Summary\n\n| | Issue | Instances |\n| :-------------: |:-------------|:-------------:|\n| 1 | Multiple address/IDs mappings can be combined into a single mapping of an address/id to a struct | 2 |\n| 2 | `storage` variable should be cached into `memory` variables instead of re-reading them | 5 |\n| 3 | Use `unchecked` blocks to save gas | 1 |\n| 4 | `derivatives[i].balance()` should be cached into memory | 2 |\n| 5 | `derivativeCount` should not be read at each loop iteration | 7 |\n| 6 | `memory` values should be emitted in events instead of `storage` ones | 4 |\n| 7 | `public` functions not called by the contract should be declared `external` instead | 8 |\n\n\n## Findings\n\n### 1- Multiple address/IDs mappings can be combined into a single mapping of an address/id to a struct :\n\nSaves a storage slot for the mapping. Depending on the circumstances and sizes of types, can avoid a Gsset (20000 gas) per mapping combined. Reads and subsequent writes can also be cheaper when a function requires both values and they both fit in the same storage slot. Finally, if both fields are accessed in the same function, can save ~42 gas per access due to not having to recalculate the key's keccak256 hash (Gkeccak256 - 30 gas) and that calculation's associated stack operations.\n\nThere are 2 instances of this issue :\n\nFile: SafEth.sol [Line 22-23](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEthStorage.sol#L22-L23)\n```\nmapping(uint256 => IDerivative) public derivatives; // derivatives in the system\nmapping(uint256 => uint256) public weights; // weights for each derivative\n```\n\nThese mappings could be refactored into the following struct and mapping for example :\n\n```\nstruct Derivative {\n uint256 weight;\n IDerivative derivative;\n}\n \nmapping(uint256 => Derivative) public derivatives;\n```\n\n\n### 2- `storage` variable should be cached into `memory` variables instead of re-reading them :\n\nThe instance", "vulnerable_code": "mapping(uint256 => IDerivative) public derivatives; // derivatives in the system\nmapping(uint256 => uint256) public weights; // weights for each derivative", "fixed_code": "struct Derivative {\n uint256 weight;\n IDerivative derivative;\n}\n \nmapping(uint256 => Derivative) public derivatives;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Aymen0909-G.md", "collected_at": "2026-01-02T18:17:51.706541+00:00", "source_hash": "cb662ac5e0629345d575f98a151e3fba901ee42cea0d3db0fb02f417156c0087", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 280, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "mapping(uint256 => IDerivative) public derivatives; // derivatives in the system\nmapping(uint256 => uint256) public weights; // weights for each derivative", "primary_code_language": "unknown", "primary_code_char_count": 155, "all_code_blocks": "// Code block 1 (unknown):\nmapping(uint256 => IDerivative) public derivatives; // derivatives in the system\nmapping(uint256 => uint256) public weights; // weights for each derivative\n\n// Code block 2 (unknown):\nstruct Derivative {\n uint256 weight;\n IDerivative derivative;\n}\n \nmapping(uint256 => Derivative) public derivatives;", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEthStorage.sol#L22-L23", "github_files_list": "SafEthStorage.sol", "github_refs_count": 1, "vulnerable_code_actual": "mapping(uint256 => IDerivative) public derivatives; // derivatives in the system\nmapping(uint256 => uint256) public weights; // weights for each derivative", "has_vulnerable_code_snippet": true, "fixed_code_actual": "struct Derivative {\n uint256 weight;\n IDerivative derivative;\n}\n \nmapping(uint256 => Derivative) public derivatives;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "04-caviar", "title": "Raihan G", "severity_raw": "High", "severity": "high", "description": "# Gas Optimization \n\n# Summary\n\n| | Issue | Instance \n| - | ----- | -------\n|[G-01]| Use double if statements instead of && | 11\n|[G-02]| Make 3 event parameters indexed when possible | 3\n|[G-03]| public functions to external | 1\n|[G-04]| Access mappings directly rather than using accessor functions | 2\n|[G-05]| Amounts should be checked for 0 before calling a transfer | 2\n|[G-06]| abi.encode() is less efficient than abi.encodePacked() | 2\n|[G-07]| Functions guaranteed to revert when called by normal users can be marked\u00a0payable | 9\n|[G-08]| Change public state variable visibility to private | 2\n|[G-09]|\u00a0 += \u00a0COSTS MORE GAS THAN\u00a0 = + \u00a0FOR STATE VARIABLES | 4\n|[G-10]| Use of Bit shift operators | 12\n|[G-11]| Usage of\u00a0uints/ints\u00a0smaller than 32 bytes (256 bits) incurs overhead | 4\n|[G-12]| Setting the\u00a0constructor\u00a0to\u00a0payable | 3\n\n## [G-01] Use double if statements instead of &&\n If the if statement has a logical AND and is not followed by an else statement, it can be replaced with 2 if statements.\n\n```solidity\nFile: /tree/main/src/EthRouter.sol\n\n101 if (block.timestamp > deadline && deadline != 0) {\n154 if (block.timestamp > deadline && deadline != 0) {\n228 if (block.timestamp > deadline && deadline != 0) {\n256 if (block.timestamp > deadline && deadline != 0) { \n``` \nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol\n\n```solidity\nFile: /tree/main/src/Factory.sol\n\n87 if ((_baseToken == address(0) && msg.value != baseTokenAmount) || (_baseToken != address(0) && msg.value > 0)) { \n\n``` \nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/Factory.sol#L87\n\n```solidity\nFile: /tree/main/src/PrivatePool.sol\n\n225 if (baseToken != address(0) && msg.value > 0) revert InvalidEthAmount();\n\n277 if (royaltyFee > 0 && recipient != address(0)) {\n\n344 if (royaltyFee > 0 && recipient != address(0)) {\n\n397 if (baseToken != address(0) && msg.value > 0) revert InvalidEthAmount();\n\n489 if ((bas", "vulnerable_code": "File: /tree/main/src/EthRouter.sol\n\n101 if (block.timestamp > deadline && deadline != 0) {\n154 if (block.timestamp > deadline && deadline != 0) {\n228 if (block.timestamp > deadline && deadline != 0) {\n256 if (block.timestamp > deadline && deadline != 0) { ", "fixed_code": "File: /tree/main/src/Factory.sol\n\n87 if ((_baseToken == address(0) && msg.value != baseTokenAmount) || (_baseToken != address(0) && msg.value > 0)) { \n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/Raihan-G.md", "collected_at": "2026-01-02T18:19:59.851512+00:00", "source_hash": "cb9064b1dc6c11d16ac30f608bcd1f01cfce5940b5003ee2941f86254f48828f", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 426, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: /tree/main/src/EthRouter.sol\n\n101 if (block.timestamp > deadline && deadline != 0) {\n154 if (block.timestamp > deadline && deadline != 0) {\n228 if (block.timestamp > deadline && deadline != 0) {\n256 if (block.timestamp > deadline && deadline != 0) {", "primary_code_language": "solidity", "primary_code_char_count": 271, "all_code_blocks": "// Code block 1 (solidity):\nFile: /tree/main/src/EthRouter.sol\n\n101 if (block.timestamp > deadline && deadline != 0) {\n154 if (block.timestamp > deadline && deadline != 0) {\n228 if (block.timestamp > deadline && deadline != 0) {\n256 if (block.timestamp > deadline && deadline != 0) {\n\n// Code block 2 (solidity):\nFile: /tree/main/src/Factory.sol\n\n87 if ((_baseToken == address(0) && msg.value != baseTokenAmount) || (_baseToken != address(0) && msg.value > 0)) {", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: /tree/main/src/EthRouter.sol\n\n101 if (block.timestamp > deadline && deadline != 0) {\n154 if (block.timestamp > deadline && deadline != 0) {\n228 if (block.timestamp > deadline && deadline != 0) {\n256 if (block.timestamp > deadline && deadline != 0) {\n\nFile: /tree/main/src/Factory.sol\n\n87 if ((_baseToken == address(0) && msg.value != baseTokenAmount) || (_baseToken != address(0) && msg.value > 0)) {", "github_refs_formatted": "EthRouter.sol, Factory.sol#L87", "github_files_list": "EthRouter.sol, Factory.sol", "github_refs_count": 2, "vulnerable_code_actual": "File: /tree/main/src/EthRouter.sol\n\n101 if (block.timestamp > deadline && deadline != 0) {\n154 if (block.timestamp > deadline && deadline != 0) {\n228 if (block.timestamp > deadline && deadline != 0) {\n256 if (block.timestamp > deadline && deadline != 0) { ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: /tree/main/src/Factory.sol\n\n87 if ((_baseToken == address(0) && msg.value != baseTokenAmount) || (_baseToken != address(0) && msg.value > 0)) { \n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "06-lybra", "title": "lsaudit G", "severity_raw": "Low", "severity": "low", "description": "# [G-01] Using a SafeMath library, where substraction can be unchecked.\n\n```\nFile: contracts/lybra/token/EUSD.sol\n\n396: require(_sharesAmount <= currentSenderShares, \"TRANSFER_AMOUNT_EXCEEDS_BALANCE\");\n397:\n398: shares[_sender] = currentSenderShares.sub(_sharesAmount);\n```\n\nLine 396 requires that `_sharesAmount <= currentSenderShares`, thus `currentSenderShares - (_sharesAmount)` will never underflow. This operation can be `unchecked`, instead of being calculated with a help of SafeMath `sub` function.", "vulnerable_code": "File: contracts/lybra/token/EUSD.sol\n\n396: require(_sharesAmount <= currentSenderShares, \"TRANSFER_AMOUNT_EXCEEDS_BALANCE\");\n397:\n398: shares[_sender] = currentSenderShares.sub(_sharesAmount);", "fixed_code": "", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/lsaudit-G.md", "collected_at": "2026-01-02T18:23:06.907871+00:00", "source_hash": "cbc1189bf430c38236f574320de3eb3f7293eab46442ad6bef0f52bc01c0e406", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 203, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "File: contracts/lybra/token/EUSD.sol\n\n396: require(_sharesAmount <= currentSenderShares, \"TRANSFER_AMOUNT_EXCEEDS_BALANCE\");\n397:\n398: shares[_sender] = currentSenderShares.sub(_sharesAmount);", "primary_code_language": "unknown", "primary_code_char_count": 203, "all_code_blocks": "// Code block 1 (unknown):\nFile: contracts/lybra/token/EUSD.sol\n\n396: require(_sharesAmount <= currentSenderShares, \"TRANSFER_AMOUNT_EXCEEDS_BALANCE\");\n397:\n398: shares[_sender] = currentSenderShares.sub(_sharesAmount);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: contracts/lybra/token/EUSD.sol\n\n396: require(_sharesAmount <= currentSenderShares, \"TRANSFER_AMOUNT_EXCEEDS_BALANCE\");\n397:\n398: shares[_sender] = currentSenderShares.sub(_sharesAmount);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 3.04} {"source": "c4", "protocol": "06-lybra", "title": "HE1M Q", "severity_raw": "High", "severity": "high", "description": "#### Q1\nThe comment states that:\n`amount Must be higher than 0. Individual mint amount shouldn't surpass 10% when the circulation reaches 10_000_000`\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/pools/base/LybraEUSDVaultBase.sol#L124C10-L124C126\nBut it is not implemented same as what the comment suggests.\nThis amount is limited to `mintVaultMaxSupply` set in the `LybraConfigurator`:\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/pools/base/LybraEUSDVaultBase.sol#L260\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/configuration/LybraConfigurator.sol#L119\n##### Recommendation\nWhether remove this comment or implement such functionality in `mint(...)`:\n```\n if (\n (borrowed[msg.sender] * 100) / poolTotalEUSDCirculation > 10 &&\n poolTotalEUSDCirculation > 10_000_000 * 1e18\n ) revert(\"Mint Amount cannot be more than 10% of total circulation\");\n```\n\n#### Q2\nWrong error message in require-statement. `EUSD` should be changed to `PeUSD`.\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L131\n\n\n\n\n", "vulnerable_code": " if (\n (borrowed[msg.sender] * 100) / poolTotalEUSDCirculation > 10 &&\n poolTotalEUSDCirculation > 10_000_000 * 1e18\n ) revert(\"Mint Amount cannot be more than 10% of total circulation\");", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/HE1M-Q.md", "collected_at": "2026-01-02T18:22:19.749793+00:00", "source_hash": "cc2f14cb3825c249665b0016c65ec15b82405842c7bc541cafc34e5ce663a7a1", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 216, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "if (\n (borrowed[msg.sender] * 100) / poolTotalEUSDCirculation > 10 &&\n poolTotalEUSDCirculation > 10_000_000 * 1e18\n ) revert(\"Mint Amount cannot be more than 10% of total circulation\");", "primary_code_language": "unknown", "primary_code_char_count": 216, "all_code_blocks": "// Code block 1 (unknown):\nif (\n (borrowed[msg.sender] * 100) / poolTotalEUSDCirculation > 10 &&\n poolTotalEUSDCirculation > 10_000_000 * 1e18\n ) revert(\"Mint Amount cannot be more than 10% of total circulation\");", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LybraEUSDVaultBase.sol#L124-L10, LybraEUSDVaultBase.sol#L260, LybraConfigurator.sol#L119, LybraPeUSDVaultBase.sol#L131", "github_files_list": "LybraEUSDVaultBase.sol, LybraConfigurator.sol, LybraPeUSDVaultBase.sol", "github_refs_count": 4, "vulnerable_code_actual": " if (\n (borrowed[msg.sender] * 100) / poolTotalEUSDCirculation > 10 &&\n poolTotalEUSDCirculation > 10_000_000 * 1e18\n ) revert(\"Mint Amount cannot be more than 10% of total circulation\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5.61} {"source": "c4", "protocol": "03-asymmetry", "title": "0xAgro Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA Report\n## Finding Summary\n\n[**Low Severity**](#Low-Severity)\n1. [**Compiler With Known Bug May Be Used**](#1-Compiler-With-Known-Bug-May-Be-Used)\n2. [**minAmount maxAmount Input Sanitization**](#2-minAmount-maxAmount-Input-Sanitization)\n3. [**Single Step Owner Transfer**](#3-Single-Step-Owner-Transfer)\n4. [**Gas Grief If Relayed**](#4-Gas-Grief-If-Relayed)\n5. [**Owner Can Bypass setPauseStaking**](#5-Owner-Can-Bypass-setPauseStaking)\n\n[**Non-Critical**](#Non-Critical)\n1. [**Explicit Variable Not Used**](#1-Explicit-Variable-Not-Used)\n2. [**bytes.concat() Can Be Used Over abi.encodePacked()**](#2-bytesconcat-can-be-used-over-abiencodepacked)\n3. [**Inconsistent Named Returns**](#3-Inconsistent-Named-Returns)\n4. [**Spelling Mistake**](#4-Spelling-Mistake)\n5. [**Unnecessary Collapsed Code**](#5-Unnecessary-Collapsed-Code)\n6. [**Inconsistent Single Line If Style**](#6-Inconsistent-Single-Line-If-Style)\n7. [**Inconsistent Trailing Period**](#7-inconsistent-trailing-period)\n8. [**Inconsistent Comment Capitalization**](#8-Inconsistent-Comment-Capitalization)\n9. [**Constant Not Used**](#9-Constant-Not-Used)\n10. [**Inconsistent Exponentiation Style**](#10-Inconsistent-Exponentiation-Style)\n11. [**Mimicked ERC20 Names**](#11-Mimicked-ERC20-Names)\n12. [**ERC20 Token Recovery**](#12-ERC20-Token-Recovery)\n13. [**Unbounded Compiler Version**](#13-Unbounded-Compiler-Version)\n\n[**Style Guide Violations**](#Style-Guide-Violations)\n1. [**Maximum Line Length**](#1-Maximum-Line-Length)\n2. [**Order of Functions**](#2-Order-of-Functions)\n3. [**Whitespace in Expressions**](#3-Whitespace-in-Expressions)\n4. [**Function Declaration Style**](#4-Function-Declaration-Style)\n\n# Low Severity\n\n## 1. Compiler With Known Bug May Be Used\n\nAll contracts in scope ([ex](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L2)) use a Solidity version of `^0.8.13`. There is [a known bug](https://medium.com/certora/overly-optimistic-optimizer-certora-bug-disclosure-2101", "vulnerable_code": "214: function setMinAmount(uint256 _minAmount) external onlyOwner {\n215: minAmount = _minAmount;\n216: emit ChangeMinAmount(minAmount);\n217: }", "fixed_code": "223: function setMaxAmount(uint256 _minAmount) external onlyOwner {\n224: maxAmount = _maxAmount;\n225: emit ChangeMaxAmount(maxAmount);\n226: }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/0xAgro-Q.md", "collected_at": "2026-01-02T18:17:33.240317+00:00", "source_hash": "cc8ef573b36a1484dac4651d0d26a6612d455b41ed2bbac52f916956a05a2dd0", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol#L2", "github_files_list": "SafEth.sol", "github_refs_count": 1, "vulnerable_code_actual": "214: function setMinAmount(uint256 _minAmount) external onlyOwner {\n215: minAmount = _minAmount;\n216: emit ChangeMinAmount(minAmount);\n217: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "223: function setMaxAmount(uint256 _minAmount) external onlyOwner {\n224: maxAmount = _maxAmount;\n225: emit ChangeMaxAmount(maxAmount);\n226: }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-biconomy", "title": "8olidity Q", "severity_raw": "Gas", "severity": "gas", "description": "## There is no need to specify gas, call() is originally unlimited gas\n\n\nThere is no need to specify gas as type(uint256).max in call()\n```solidity\nFile: scw-contracts/contracts/smart-contract-wallet/BaseSmartAccount.sol\n\n function _payPrefund(uint256 missingAccountFunds) internal virtual {\n if (missingAccountFunds != 0) {\n (bool success,) = payable(msg.sender).call{value : missingAccountFunds, gas : type(uint256).max}(\"\"); //@audit \n (success);\n //ignore failure (its EntryPoint's job to verify, not account.)\n }\n }\n```\n\n## Transfer permissions require two-step authentication\nTransferring the owner's permission requires the newowner address to accept it, rather than directly transferring the permission to the new address\n\n\n```solidity\nFile: scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n\n function setOwner(address _newOwner) external mixedAuth { //@audit \n require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n address oldOwner = owner;\n owner = _newOwner;\n emit EOAChanged(address(this), oldOwner, _newOwner);\n }\n```\n\n## updateImplementation() should check if the `_implementation address` is 0\n\nIn the updateImplementation() function, directly assign the incoming _implementation address to _IMPLEMENTATION_SLOT without any judgment\n\n```solidity\nFile: scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n\n function updateImplementation(address _implementation) external mixedAuth {\n require(_implementation.isContract(), \"INVALID_IMPLEMENTATION\"); //@audit \n _setImplementation(_implementation);\n // EOA + Version tracking\n emit ImplementationUpdated(address(this), VERSION, _implementation);\n }\n```\n\n\n\n## `_validateSignature()` return deadline is always 0\n\n\n\n```solidity\nFile: scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n\n function _validateSignature(UserOperation calldata use", "vulnerable_code": "File: scw-contracts/contracts/smart-contract-wallet/BaseSmartAccount.sol\n\n function _payPrefund(uint256 missingAccountFunds) internal virtual {\n if (missingAccountFunds != 0) {\n (bool success,) = payable(msg.sender).call{value : missingAccountFunds, gas : type(uint256).max}(\"\"); //@audit \n (success);\n //ignore failure (its EntryPoint's job to verify, not account.)\n }\n }", "fixed_code": "File: scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n\n function setOwner(address _newOwner) external mixedAuth { //@audit \n require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n address oldOwner = owner;\n owner = _newOwner;\n emit EOAChanged(address(this), oldOwner, _newOwner);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/8olidity-Q.md", "collected_at": "2026-01-02T18:12:53.099722+00:00", "source_hash": "ccc17192c70fd8751c677e75af052cf5c05928e848b2420553d20b2bbc45dea7", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 1188, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: scw-contracts/contracts/smart-contract-wallet/BaseSmartAccount.sol\n\n function _payPrefund(uint256 missingAccountFunds) internal virtual {\n if (missingAccountFunds != 0) {\n (bool success,) = payable(msg.sender).call{value : missingAccountFunds, gas : type(uint256).max}(\"\"); //@audit \n (success);\n //ignore failure (its EntryPoint's job to verify, not account.)\n }\n }", "primary_code_language": "solidity", "primary_code_char_count": 425, "all_code_blocks": "// Code block 1 (solidity):\nFile: scw-contracts/contracts/smart-contract-wallet/BaseSmartAccount.sol\n\n function _payPrefund(uint256 missingAccountFunds) internal virtual {\n if (missingAccountFunds != 0) {\n (bool success,) = payable(msg.sender).call{value : missingAccountFunds, gas : type(uint256).max}(\"\"); //@audit \n (success);\n //ignore failure (its EntryPoint's job to verify, not account.)\n }\n }\n\n// Code block 2 (solidity):\nFile: scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n\n function setOwner(address _newOwner) external mixedAuth { //@audit \n require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n address oldOwner = owner;\n owner = _newOwner;\n emit EOAChanged(address(this), oldOwner, _newOwner);\n }\n\n// Code block 3 (solidity):\nFile: scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n\n function updateImplementation(address _implementation) external mixedAuth {\n require(_implementation.isContract(), \"INVALID_IMPLEMENTATION\"); //@audit \n _setImplementation(_implementation);\n // EOA + Version tracking\n emit ImplementationUpdated(address(this), VERSION, _implementation);\n }", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: scw-contracts/contracts/smart-contract-wallet/BaseSmartAccount.sol\n\n function _payPrefund(uint256 missingAccountFunds) internal virtual {\n if (missingAccountFunds != 0) {\n (bool success,) = payable(msg.sender).call{value : missingAccountFunds, gas : type(uint256).max}(\"\"); //@audit \n (success);\n //ignore failure (its EntryPoint's job to verify, not account.)\n }\n }\n\nFile: scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n\n function setOwner(address _newOwner) external mixedAuth { //@audit \n require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n address oldOwner = owner;\n owner = _newOwner;\n emit EOAChanged(address(this), oldOwner, _newOwner);\n }\n\nFile: scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n\n function updateImplementation(address _implementation) external mixedAuth {\n require(_implementation.isContract(), \"INVALID_IMPLEMENTATION\"); //@audit \n _setImplementation(_implementation);\n // EOA + Version tracking\n emit ImplementationUpdated(address(this), VERSION, _implementation);\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: scw-contracts/contracts/smart-contract-wallet/BaseSmartAccount.sol\n\n function _payPrefund(uint256 missingAccountFunds) internal virtual {\n if (missingAccountFunds != 0) {\n (bool success,) = payable(msg.sender).call{value : missingAccountFunds, gas : type(uint256).max}(\"\"); //@audit \n (success);\n //ignore failure (its EntryPoint's job to verify, not account.)\n }\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n\n function setOwner(address _newOwner) external mixedAuth { //@audit \n require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n address oldOwner = owner;\n owner = _newOwner;\n emit EOAChanged(address(this), oldOwner, _newOwner);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "07-amphora", "title": "mojito_auditor Q", "severity_raw": "Low", "severity": "low", "description": "# Summary\n\n| Id | Title |\n| --- | --- |\n| L-1 | VaultDeployer constructor is payable but there is no way to get ETH out |\n| L-2 | Code and comment do not match in function GovernorCharlie.cancel() |\n| L-3 | Incorrect Collateral Type When Owner Uses `updateRegisteredErc20()` |\n\n# L-1. VaultDeployer constructor is payable but there is no way to get ETH out\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/41cf810b02a150bb168698ff1eeb1f768d6bdcb0/core/solidity/contracts/core/VaultDeployer.sol#L18\n\n## Detail\n\nIn the `VaultDeployer` contract, the constructor is `payable` and can receive ETH. However, ETH is not used anywhere in the contract and there is no function to withdraw it either.\n\n```solidity\n/// @param _cvx The address of the CVX token\n/// @param _crv The address of the CRV token\nconstructor(IERC20 _cvx, IERC20 _crv) payable { // @audit payable but no way to get ETH out\n CVX = _cvx;\n CRV = _crv;\n}\n\n```\n\n## Recommendation\n\nConsider removing `payable` or adding a function to withdraw ETH.\n\n# L-2. Code and comment do not match in function `GovernorCharlie.cancel()`\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/41cf810b02a150bb168698ff1eeb1f768d6bdcb0/core/solidity/contracts/governance/GovernorCharlie.sol#L361-L379\n\n## Detail\n\nIn the function `cancel()`, the comment says:\n\n> Whitelisted proposers can't be canceled for falling below proposal threshold.\n> \n\nHowever, the code still allows the whitelisted proposals to be cancelled:\n\n```solidity\n// Whitelisted proposers can't be canceled for falling below proposal threshold\nif (isWhitelisted(_proposal.proposer)) {\n // @audit Contradict with the comment above.\n // If it falls below proposal threshold, it won't revert and will be allowed to be cancelled\n if (\n (amph.getPriorVotes(_proposal.proposer, (block.number - 1)) >= proposalThreshold)\n || msg.sender != whitelistGuardian\n ) revert GovernorCharlie_WhitelistedProposer();\n}\n\n```\n\n## Recommendation\n\nConsider fixing the code or upda", "vulnerable_code": "/// @param _cvx The address of the CVX token\n/// @param _crv The address of the CRV token\nconstructor(IERC20 _cvx, IERC20 _crv) payable { // @audit payable but no way to get ETH out\n CVX = _cvx;\n CRV = _crv;\n}\n", "fixed_code": "// Whitelisted proposers can't be canceled for falling below proposal threshold\nif (isWhitelisted(_proposal.proposer)) {\n // @audit Contradict with the comment above.\n // If it falls below proposal threshold, it won't revert and will be allowed to be cancelled\n if (\n (amph.getPriorVotes(_proposal.proposer, (block.number - 1)) >= proposalThreshold)\n || msg.sender != whitelistGuardian\n ) revert GovernorCharlie_WhitelistedProposer();\n}\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/mojito_auditor-Q.md", "collected_at": "2026-01-02T18:23:55.478856+00:00", "source_hash": "cce49f3e4f83ba729d0ef176e6f7c8461c40d501a1ad008b3a2ef1b11418898b", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 678, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "/// @param _cvx The address of the CVX token\n/// @param _crv The address of the CRV token\nconstructor(IERC20 _cvx, IERC20 _crv) payable { // @audit payable but no way to get ETH out\n CVX = _cvx;\n CRV = _crv;\n}", "primary_code_language": "solidity", "primary_code_char_count": 211, "all_code_blocks": "// Code block 1 (solidity):\n/// @param _cvx The address of the CVX token\n/// @param _crv The address of the CRV token\nconstructor(IERC20 _cvx, IERC20 _crv) payable { // @audit payable but no way to get ETH out\n CVX = _cvx;\n CRV = _crv;\n}\n\n// Code block 2 (solidity):\n// Whitelisted proposers can't be canceled for falling below proposal threshold\nif (isWhitelisted(_proposal.proposer)) {\n // @audit Contradict with the comment above.\n // If it falls below proposal threshold, it won't revert and will be allowed to be cancelled\n if (\n (amph.getPriorVotes(_proposal.proposer, (block.number - 1)) >= proposalThreshold)\n || msg.sender != whitelistGuardian\n ) revert GovernorCharlie_WhitelistedProposer();\n}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "/// @param _cvx The address of the CVX token\n/// @param _crv The address of the CRV token\nconstructor(IERC20 _cvx, IERC20 _crv) payable { // @audit payable but no way to get ETH out\n CVX = _cvx;\n CRV = _crv;\n}\n\n// Whitelisted proposers can't be canceled for falling below proposal threshold\nif (isWhitelisted(_proposal.proposer)) {\n // @audit Contradict with the comment above.\n // If it falls below proposal threshold, it won't revert and will be allowed to be cancelled\n if (\n (amph.getPriorVotes(_proposal.proposer, (block.number - 1)) >= proposalThreshold)\n || msg.sender != whitelistGuardian\n ) revert GovernorCharlie_WhitelistedProposer();\n}", "github_refs_formatted": "VaultDeployer.sol#L18, GovernorCharlie.sol#L361-L379", "github_files_list": "GovernorCharlie.sol, VaultDeployer.sol", "github_refs_count": 2, "vulnerable_code_actual": "/// @param _cvx The address of the CVX token\n/// @param _crv The address of the CRV token\nconstructor(IERC20 _cvx, IERC20 _crv) payable { // @audit payable but no way to get ETH out\n CVX = _cvx;\n CRV = _crv;\n}\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "// Whitelisted proposers can't be canceled for falling below proposal threshold\nif (isWhitelisted(_proposal.proposer)) {\n // @audit Contradict with the comment above.\n // If it falls below proposal threshold, it won't revert and will be allowed to be cancelled\n if (\n (amph.getPriorVotes(_proposal.proposer, (block.number - 1)) >= proposalThreshold)\n || msg.sender != whitelistGuardian\n ) revert GovernorCharlie_WhitelistedProposer();\n}\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "02-ethos", "title": "ddimitrov22 Q", "severity_raw": "Low", "severity": "low", "description": "## Summary\n\n| Number | Issues Details |\n| ------ | ------------------------------------------------------- |\n| [L-01] | Outdated compiler version |\n| [N-01] | Lock `pragma` to specific compiler version |\n| [N-02] | Assert statements should not be used |\n| [N-03] | Using vulnerable dependency of OpenZeppelin |\n| [N-04] | For modern and more readable code; update import usages |\n\n## [L-01] Outdated compiler version\n\nVery old compiler version is used inside the contracts of Ethos-Core. There are a lot of major improvements and bug fixes in the new compiler versions which the protocol will be missing on.\n\n**Context**\n5 results - 5 files\n\n Ethos-Core/contracts/ActivePool.sol:\n 3: pragma solidity 0.6.11;\n\n Ethos-Core/contracts/LUSDToken.sol:\n 3: pragma solidity 0.6.11;\n\n Ethos-Core/contracts/StabilityPool.sol:\n 3: pragma solidity 0.6.11;\n\n Ethos-Core/contracts/LQTY/CommunityIssuance.sol:\n 3: pragma solidity 0.6.11;\n\n Ethos-Core/contracts/LQTY/LQTYStaking.sol:\n 3: pragma solidity 0.6.11;\n\n**Recommendation:**\n\nUse a more recent version of the compiler. The latest compiler version available is 0.8.18.\n\n## [N-01] Lock `pragma` to specific compiler version\n\nPragma statements can be allowed to float when a contract is intended for consumption by other developers, as in the case with contracts in a library or EthPM package. Otherwise, the developer would need to manually update the pragma in order to compile locally. All of the contracts inside Ethos-Vault which are in scope use floatable pragma.\n\n**Recommendation:**\nEthereum Smart Contract Best Practices - Lock pragmas to specific compiler version.\n\n[solidity-specific/locking-pragmas](https://consensys.github.io/smart-contract-best-practices/development-recommendations/solidity-specific/locking-pragmas/)\n\n## [N-02] Assert statements should not be used\n\nProperly functioning code should ", "vulnerable_code": "import {Owned} from \"solmate/auth/Owned.sol\";\nimport {ERC721} from \"solmate/tokens/ERC721.sol\";\nimport {LibString} from \"solmate/utils/LibString.sol\";\nimport {MerkleProofLib} from \"solmate/utils/MerkleProofLib.sol\";\nimport {FixedPointMathLib} from \"solmate/utils/FixedPointMathLib.sol\";\nimport {ERC1155, ERC1155TokenReceiver} from \"solmate/tokens/ERC1155.sol\";\nimport {toWadUnsafe, toDaysWadUnsafe} from \"solmate/utils/SignedWadMath.sol\";", "fixed_code": "", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/ddimitrov22-Q.md", "collected_at": "2026-01-02T18:17:03.331970+00:00", "source_hash": "cd0f51ba04610029c9cca9355825203ba8a39338551ffe7e6801f5f8413343ec", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "import {Owned} from \"solmate/auth/Owned.sol\";\nimport {ERC721} from \"solmate/tokens/ERC721.sol\";\nimport {LibString} from \"solmate/utils/LibString.sol\";\nimport {MerkleProofLib} from \"solmate/utils/MerkleProofLib.sol\";\nimport {FixedPointMathLib} from \"solmate/utils/FixedPointMathLib.sol\";\nimport {ERC1155, ERC1155TokenReceiver} from \"solmate/tokens/ERC1155.sol\";\nimport {toWadUnsafe, toDaysWadUnsafe} from \"solmate/utils/SignedWadMath.sol\";", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4} {"source": "c4", "protocol": "11-kelp", "title": "fr33rh Analysis", "severity_raw": "High", "severity": "high", "description": "## Systemic risks\n`RSETH` represents the total price of different assets, and if one asset experiences significant fluctuations, other assets will also be affected.\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTDepositPool.sol#L91-L110\n```\n /// @notice View amount of rsETH to mint for given asset amount\n /// @param asset Asset address\n /// @param amount Asset amount\n /// @return rsethAmountToMint Amount of rseth to mint\n function getRsETHAmountToMint(\n address asset,\n uint256 amount\n )\n public\n view\n override\n returns (uint256 rsethAmountToMint)\n {\n // setup oracle contract\n address lrtOracleAddress = lrtConfig.getContract(LRTConstants.LRT_ORACLE);\n ILRTOracle lrtOracle = ILRTOracle(lrtOracleAddress);\n\n // calculate rseth amount to mint based on asset amount and asset exchange rate\n rsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();\n }\n```\n## Other recommendations\nDue to design, there is currently no withdraw function, which results in a significant reduction in attack surface area.\nAfter improving the relevant functions, it is strongly recommended to hold another contest.\n\n## learnings from the audit\n\n`LST` has great potential,and `Eignelayer` is very interesting,I will continue to study after the contest.\n```\nhttps://github.com/Layr-Labs/eigenlayer-contracts\n```\n\n\n### Time spent:\n28 hours", "vulnerable_code": " /// @notice View amount of rsETH to mint for given asset amount\n /// @param asset Asset address\n /// @param amount Asset amount\n /// @return rsethAmountToMint Amount of rseth to mint\n function getRsETHAmountToMint(\n address asset,\n uint256 amount\n )\n public\n view\n override\n returns (uint256 rsethAmountToMint)\n {\n // setup oracle contract\n address lrtOracleAddress = lrtConfig.getContract(LRTConstants.LRT_ORACLE);\n ILRTOracle lrtOracle = ILRTOracle(lrtOracleAddress);\n\n // calculate rseth amount to mint based on asset amount and asset exchange rate\n rsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();\n }", "fixed_code": "https://github.com/Layr-Labs/eigenlayer-contracts", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/fr33rh-Analysis.md", "collected_at": "2026-01-02T18:28:02.783663+00:00", "source_hash": "cd30dfc242eb59904668ba1dc6c7d931898afa22851a22b88d5c84e95021bfa8", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 793, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "/// @notice View amount of rsETH to mint for given asset amount\n /// @param asset Asset address\n /// @param amount Asset amount\n /// @return rsethAmountToMint Amount of rseth to mint\n function getRsETHAmountToMint(\n address asset,\n uint256 amount\n )\n public\n view\n override\n returns (uint256 rsethAmountToMint)\n {\n // setup oracle contract\n address lrtOracleAddress = lrtConfig.getContract(LRTConstants.LRT_ORACLE);\n ILRTOracle lrtOracle = ILRTOracle(lrtOracleAddress);\n\n // calculate rseth amount to mint based on asset amount and asset exchange rate\n rsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();\n }", "primary_code_language": "unknown", "primary_code_char_count": 744, "all_code_blocks": "// Code block 1 (unknown):\n/// @notice View amount of rsETH to mint for given asset amount\n /// @param asset Asset address\n /// @param amount Asset amount\n /// @return rsethAmountToMint Amount of rseth to mint\n function getRsETHAmountToMint(\n address asset,\n uint256 amount\n )\n public\n view\n override\n returns (uint256 rsethAmountToMint)\n {\n // setup oracle contract\n address lrtOracleAddress = lrtConfig.getContract(LRTConstants.LRT_ORACLE);\n ILRTOracle lrtOracle = ILRTOracle(lrtOracleAddress);\n\n // calculate rseth amount to mint based on asset amount and asset exchange rate\n rsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();\n }\n\n// Code block 2 (unknown):\nhttps://github.com/Layr-Labs/eigenlayer-contracts", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LRTDepositPool.sol#L91-L110", "github_files_list": "LRTDepositPool.sol", "github_refs_count": 1, "vulnerable_code_actual": " /// @notice View amount of rsETH to mint for given asset amount\n /// @param asset Asset address\n /// @param amount Asset amount\n /// @return rsethAmountToMint Amount of rseth to mint\n function getRsETHAmountToMint(\n address asset,\n uint256 amount\n )\n public\n view\n override\n returns (uint256 rsethAmountToMint)\n {\n // setup oracle contract\n address lrtOracleAddress = lrtConfig.getContract(LRTConstants.LRT_ORACLE);\n ILRTOracle lrtOracle = ILRTOracle(lrtOracleAddress);\n\n // calculate rseth amount to mint based on asset amount and asset exchange rate\n rsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 7} {"source": "c4", "protocol": "02-ethos", "title": "CodeFoxInc Q", "severity_raw": "Critical", "severity": "critical", "description": "# Low Risk and Non-Critical Issues\n\n## ****Codebase Impressions & Summary****\n\nThe core contracts extended the functionality of the collaterals categories, with not only Ether can be added as collateral. And the protocol added a Vault function besides it to make the collateral assets\u2019 efficiency better so that the stable coin\u2019s backing assets generate interest as well. \n\nA single Liquity code base can already be a good example of project to get audited. The Ethos protocol was built upon it and added several customized functions. These functionalities combined with each other makes the protocol more complex. \n\nThis audit contest partially does not include the Liquity protocol code base but a good understanding of it is needed. And Ethos Reserve expanded the functionality over it. As a result, the code base is quite large. \n\nThe overall quality of the code is good, inline comments provided are helpful in describing the function of the code. But in terms of documentations, there are improvements can be made, e.g., natspec documentation style is recommended in my opinion. Tests ran without issues and can be modified to run POCs easily. \n\nThe findings are made mainly focused on the best practice and code quality, documentations, etc. At the same time, there are some low-risk issues about the upgradeability and function arguments\u2019 validations. \n\n## L-01 `_treasuryAddress` is not `checkContract`ed\n\nIn the ActivePool contract, the `_treasuryAddress` is not `checkContract`ed. I understand it can be an EOA, but as a big protocol which is going to generate millions of revenue and fees. I suggest put the `checkContract` function and make sure it is a multi-sig wallet. \n\n[https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/ActivePool.sol#L93](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/ActivePool.sol#L93)\n\n```diff\n+ checkContract(_treasuryAddress);", "vulnerable_code": "## L-02 Consider mitigating the centralization risk\n\nThe code base includes quite a lot of `renounceOwnership()` function to make sure the protocol is decentralized enough to be permission-less and trusted. \n\nAt the same time, `priceFeed` contract is quite an important feature and it should not be controlled by a single entity. Price feed can be updated by the owner address in this the current situation. \n\nTeam should consider set it as `guardianAddress` or `governanceAddress` instead like what is done in the `LUSDToken` contract. Or you can make the transition into a community governable feature. \n\n[https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/PriceFeed.sol#L143-L146](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/PriceFeed.sol#L143-L146)\n\n[https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/PriceFeed.sol#L24](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/PriceFeed.sol#L24)\n\nAnd same thing can also happen in `CommunityIssuance` contract. \n\n## L-03 Should check the `token` address and make sure it is a contract address\n\nShould check the address to make sure it is a contract address or zero address. \n\n[https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Vault/contracts/ReaperVaultV2.sol#L120](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Vault/contracts/ReaperVaultV2.sol#L120)\n\n### Recommendation\n\nShould import the `checkContract` function and use it as a checker for `_token`. \n", "fixed_code": "## L-04 The `tvlCap` should be initialized as a reasonable value\n\nThe `tvlCap` value is set to zero when the input of it is zero. This makes the Vault not usable at the beginning. When the `tvlCap` is zero usually it means there is no limit, so it is reasonable to set the value as unlimited value(`type(uint256).max`). If the dev wants to set the vault as unusable in the beginning it also can be done by setting the value extremely low, e.g. 1 wei. Anyways, if dev deploys the contract it is supposed to work in the first place. \n\n[https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Vault/contracts/ReaperVaultV2.sol#L123](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Vault/contracts/ReaperVaultV2.sol#L123)\n\n### Recommendation\n\nMake a change as below: \n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/CodeFoxInc-Q.md", "collected_at": "2026-01-02T18:16:04.450515+00:00", "source_hash": "cd34094659d8a27e0c3f00405bee7470ef51ea84d3ffdef08a1bdb92e7a16d88", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ActivePool.sol#L93, PriceFeed.sol#L143-L146, PriceFeed.sol#L24, ReaperVaultV2.sol#L120, ReaperVaultV2.sol#L123", "github_files_list": "ActivePool.sol, PriceFeed.sol, ReaperVaultV2.sol", "github_refs_count": 5, "vulnerable_code_actual": "## L-02 Consider mitigating the centralization risk\n\nThe code base includes quite a lot of `renounceOwnership()` function to make sure the protocol is decentralized enough to be permission-less and trusted. \n\nAt the same time, `priceFeed` contract is quite an important feature and it should not be controlled by a single entity. Price feed can be updated by the owner address in this the current situation. \n\nTeam should consider set it as `guardianAddress` or `governanceAddress` instead like what is done in the `LUSDToken` contract. Or you can make the transition into a community governable feature. \n\n[https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/PriceFeed.sol#L143-L146](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/PriceFeed.sol#L143-L146)\n\n[https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/PriceFeed.sol#L24](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/PriceFeed.sol#L24)\n\nAnd same thing can also happen in `CommunityIssuance` contract. \n\n## L-03 Should check the `token` address and make sure it is a contract address\n\nShould check the address to make sure it is a contract address or zero address. \n\n[https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Vault/contracts/ReaperVaultV2.sol#L120](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Vault/contracts/ReaperVaultV2.sol#L120)\n\n### Recommendation\n\nShould import the `checkContract` function and use it as a checker for `_token`. \n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## L-04 The `tvlCap` should be initialized as a reasonable value\n\nThe `tvlCap` value is set to zero when the input of it is zero. This makes the Vault not usable at the beginning. When the `tvlCap` is zero usually it means there is no limit, so it is reasonable to set the value as unlimited value(`type(uint256).max`). If the dev wants to set the vault as unusable in the beginning it also can be done by setting the value extremely low, e.g. 1 wei. Anyways, if dev deploys the contract it is supposed to work in the first place. \n\n[https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Vault/contracts/ReaperVaultV2.sol#L123](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Vault/contracts/ReaperVaultV2.sol#L123)\n\n### Recommendation\n\nMake a change as below: \n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "04-caviar", "title": "abiih Q", "severity_raw": "High", "severity": "high", "description": "# Report\n\n---\n\n## Low Risks\n\n---\n\n| | Issue |\n| --- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| 1 | [Add non-zero address checks for address arguments in constructors](#usage-of-uintsints-smaller-than-32-bytes-256-bits-incurs-overhead) |\n| 2 | [Fix flash loan fee is unfair to the pool owner as well as to the user ](#fix-flash-loan-fee-is-unfair-to-the-pool-owner-as-well-as-to-the-user) |\n| 3 | [Royalty receiver will not get correct royalty as saleprice is not calculated properly](#royalty-receiver-will-not-get-correct-royalty-as-saleprice-is-not-calculated-properly) |\n\n---\n\n1. ### Add non-zero address checks for address arguments in constructors\n\n check address value for zero\n\n - https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L143\n - https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L90\n\n2. ### Fix flash loan fee is unfair to the pool owner as well as to the user\n\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L632\n- https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L750\n\n```\nHere the changeFee is used as the flash loan fee whenever the user initiates the flash loan. This is unfair to both the pool owner as well as to the user.\nDifferent NFT has different rarity as well as value. When the flash loan fee is fixed then pool owner will not be able to collect the proper fee and also the user who want to use the NFT with less rarity and usefulness has to pay the same price as that of the NFT of higher price.\n```\n\n3. ### Royalty receiver will not get correct royalty as saleprice i", "vulnerable_code": "Here the changeFee is used as the flash loan fee whenever the user initiates the flash loan. This is unfair to both the pool owner as well as to the user.\nDifferent NFT has different rarity as well as value. When the flash loan fee is fixed then pool owner will not be able to collect the proper fee and also the user who want to use the NFT with less rarity and usefulness has to pay the same price as that of the NFT of higher price.", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/abiih-Q.md", "collected_at": "2026-01-02T18:20:13.336852+00:00", "source_hash": "cdf37af55be51b1d7a7efdcf35da948278a15f8663ab69b918daac712d4bc57d", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 435, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "Here the changeFee is used as the flash loan fee whenever the user initiates the flash loan. This is unfair to both the pool owner as well as to the user.\nDifferent NFT has different rarity as well as value. When the flash loan fee is fixed then pool owner will not be able to collect the proper fee and also the user who want to use the NFT with less rarity and usefulness has to pay the same price as that of the NFT of higher price.", "primary_code_language": "unknown", "primary_code_char_count": 435, "all_code_blocks": "// Code block 1 (unknown):\nHere the changeFee is used as the flash loan fee whenever the user initiates the flash loan. This is unfair to both the pool owner as well as to the user.\nDifferent NFT has different rarity as well as value. When the flash loan fee is fixed then pool owner will not be able to collect the proper fee and also the user who want to use the NFT with less rarity and usefulness has to pay the same price as that of the NFT of higher price.", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "PrivatePool.sol#L143, EthRouter.sol#L90, PrivatePool.sol#L632, PrivatePool.sol#L750", "github_files_list": "EthRouter.sol, PrivatePool.sol", "github_refs_count": 4, "vulnerable_code_actual": "Here the changeFee is used as the flash loan fee whenever the user initiates the flash loan. This is unfair to both the pool owner as well as to the user.\nDifferent NFT has different rarity as well as value. When the flash loan fee is fixed then pool owner will not be able to collect the proper fee and also the user who want to use the NFT with less rarity and usefulness has to pay the same price as that of the NFT of higher price.", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "02-ethos", "title": "ch0bu Q", "severity_raw": "Critical", "severity": "critical", "description": "# Non-critical\n\n## 1. Use a more recent version of Solidity\n\n- Use a solidity version of at least 0.8.0 to get overflow/underflow protection without `SafeMath` \n- Use a solidity version of at least 0.8.2 to get compiler automatic inlining \n- Use a solidity version of at least 0.8.3 to get better struct packing and cheaper multiple storage reads \n- Use a solidity version of at least 0.8.4 to get custom errors, which are cheaper at deployment than `revert()/require()` strings \n- Use a solidity version of at least 0.8.10 to have external calls skip contract existence checks if the external call has a return value\n- Use a solidity version of at least 0.8.12 to get `string.concat()` to be used instead of `abi.encodePacked(,)`\n- Use a solidity version of at least 0.8.13 to get the ability to use `using for` with a list of free functions\n- Use a solidity version of 0.8.15 where conditions necessary for inlining are relaxed. It shows significant dicrease in the bytecode size (and thus reduced deployment cost)\n- Use a solidity version of 0.8.17 to prevent the incorrect removal of storage writes before calls to Yul functions that conditionally terminate the external EVM call; Simplify the starting offset of zero-length operations to zero; More efficient overflow checks for multiplication\n\n```\nAll contracts\n```\n\n\n## 2. Empty blocks should be removed or emit something\n\nThe code should be refactored such that they no longer exist, or the block should do something useful, such as emitting an event or reverting. If the contract is meant to be extended, the contract should be abstract and the function signatures be added without any default implementation. \n- If the block is an empty if-statement block to avoid doing subsequent checks in the else-if/else conditions, the else-if/else conditions should be nested under the negation of the if-statement, because they involve different classes of checks, which may lead to the introduction of errors when the code is later mo", "vulnerable_code": "All contracts", "fixed_code": "61 constructor() initializer {}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/ch0bu-Q.md", "collected_at": "2026-01-02T18:16:55.328147+00:00", "source_hash": "ce04b0404d4d26425a2623c17e6bb34fb4292e00e86034e30190267f75b65697", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 13, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "All contracts", "primary_code_language": "unknown", "primary_code_char_count": 13, "all_code_blocks": "// Code block 1 (unknown):\nAll contracts", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "All contracts", "has_vulnerable_code_snippet": true, "fixed_code_actual": "61 constructor() initializer {}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "11-kelp", "title": "cartlex_ Q", "severity_raw": "Critical", "severity": "critical", "description": "| ID | Description | Severity |\n| :-: | - | :-: |\n| [L-01](#l-01-admin-can-use-renouncerole-for-self) | Admin can use `renounceRole` for self | Low |\n| [L-02](#l-02-transferassettonodedelegator-function-can-be-used-when-contract-is-paused)| `transferAssetToNodeDelegator()` function can be used when contract is paused. | Low |\n| [L-03](#l-03-burnfrom-function-burn-tokens-without-an-allowance)| `burnFrom` function burn tokens without an allowance. | Low |\n| [NC-01](#nc-01-updateassetstrategy-doesnt-used-in-constructor)| `updateAssetStrategy()` doesn't used in constructor. | Non-critical |\n| [NC-02](#nc-02-lack-of-check-in-getassetcurrentlimit)| Lack of check in `getAssetCurrentLimit()`. | Non-critical |\n\n\n# [L-01] Admin can use `renounceRole` for self.\n\n## Description\n`LRTConfig.sol` and `RSETH.sol` contracts inherited from `AccessControlUpgradeable.sol`.\n\nAdmin can renounce role to self, for example, if there is only one account with `DEFAULT_ADMIN_ROLE` role, after admin renounce it, some important functionality can't be used.\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTConfig.sol\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/RSETH.sol\n\n## Recommended Mitigation Steps\nConsider to override `renounceRole` so the admin can't renounce `DEFAULT_ADMIN_ROLE` for self.\n\n\n# [L-02] `transferAssetToNodeDelegator()` function can be used when contract is paused.\n\n## Description\nManager still can use `transferAssetToNodeDelegator()` function when `LRTDepositPool.sol` contract is paused due to lack of `whenNotPaused` modifier.\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTDepositPool.sol#L183-L197\n\n\ne.g. `transferBackToLRTDepositPool()` function does the opposite operation and it has `whenNotPaused` modifier.\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/NodeDelegator.sol#L79\n\n## Reco", "vulnerable_code": "# [L-03] `burnFrom` function burn tokens without an allowance.\n\n## Description\n`burnFrom` function can burn user tokens without an allowance. Despite this function can be called by trusted `BURNER_ROLE` this function can be unexpectedly called by mistake.\n", "fixed_code": "https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/RSETH.sol#L54-L56\n\n## Recommended Mitigation Steps\nConsider implement the next changes:\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/cartlex_-Q.md", "collected_at": "2026-01-02T18:27:51.990275+00:00", "source_hash": "ce3ea8b4e4be9de9c60879799c45b2ef0c61dbef165357d25505b8eb32721d44", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LRTConfig.sol, RSETH.sol, LRTDepositPool.sol#L183-L197, NodeDelegator.sol#L79, RSETH.sol#L54-L56", "github_files_list": "LRTConfig.sol, LRTDepositPool.sol, RSETH.sol, NodeDelegator.sol", "github_refs_count": 5, "vulnerable_code_actual": "# [L-03] `burnFrom` function burn tokens without an allowance.\n\n## Description\n`burnFrom` function can burn user tokens without an allowance. Despite this function can be called by trusted `BURNER_ROLE` this function can be unexpectedly called by mistake.\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/RSETH.sol#L54-L56\n\n## Recommended Mitigation Steps\nConsider implement the next changes:\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-salty", "title": "dharma09 Q", "severity_raw": "Medium", "severity": "medium", "description": "\n### [L-01] Wrong condition check violates the rule of liquidity pool\n\n**Details:**\nThe condition `require((reserves.reserve0 >= PoolUtils.DUST) && (reserves.reserve1 >= PoolUtils.DUST), \"Insufficient reserves after liquidity removal\");` checks whether both reserve0 and reserve1 are greater than or equal to the value specified by PoolUtils.DUST. This condition is intended to ensure that the removal of liquidity does not deplete the reserves below a certain threshold, defined by PoolUtils.DUST. The purpose is to prevent the reserves from becoming too low, which could potentially Details the stability and functionality of the liquidity pool.\n**Proof of Code:**\n- [Pools.sol#L170](https://github.com/code-423n4/2024-01-salty/blob/main/src/pools/Pools.sol#L170C2-L194C1)\n```solidity\nfunction removeLiquidity( IERC20 tokenA, IERC20 tokenB, uint256 liquidityToRemove, uint256 minReclaimedA, uint256 minReclaimedB, uint256 totalLiquidity ) external nonReentrant returns (uint256 reclaimedA, uint256 reclaimedB)\n\t\t{\n\t\trequire( msg.sender == address(collateralAndLiquidity), \"Pools.removeLiquidity is only callable from the CollateralAndLiquidity contract\" );\n\t\trequire( liquidityToRemove > 0, \"The amount of liquidityToRemove cannot be zero\" );\n\n\t\t(bytes32 poolID, bool flipped) = PoolUtils._poolIDAndFlipped(tokenA, tokenB);\n\n\t\t// Determine how much liquidity is being withdrawn and round down in favor of the protocol\n\t\tPoolReserves storage reserves = _poolReserves[poolID];\n\t\treclaimedA = ( reserves.reserve0 * liquidityToRemove ) / totalLiquidity;\n\t\treclaimedB = ( reserves.reserve1 * liquidityToRemove ) / totalLiquidity;\n\n\t\treserves.reserve0 -= uint128(reclaimedA);\n\t\treserves.reserve1 -= uint128(reclaimedB);\n\n\t\t// Make sure that removing liquidity doesn't drive either of the reserves below DUST.\n\t\t// This is to ensure that ratios remain relatively constant even after a maximum withdrawal.\n require((reserves.reserve0 >= PoolUtils.DUST) && (reserves.reserve0 >= PoolUtils.DUST), \"Ins", "vulnerable_code": "function removeLiquidity( IERC20 tokenA, IERC20 tokenB, uint256 liquidityToRemove, uint256 minReclaimedA, uint256 minReclaimedB, uint256 totalLiquidity ) external nonReentrant returns (uint256 reclaimedA, uint256 reclaimedB)\n\t\t{\n\t\trequire( msg.sender == address(collateralAndLiquidity), \"Pools.removeLiquidity is only callable from the CollateralAndLiquidity contract\" );\n\t\trequire( liquidityToRemove > 0, \"The amount of liquidityToRemove cannot be zero\" );\n\n\t\t(bytes32 poolID, bool flipped) = PoolUtils._poolIDAndFlipped(tokenA, tokenB);\n\n\t\t// Determine how much liquidity is being withdrawn and round down in favor of the protocol\n\t\tPoolReserves storage reserves = _poolReserves[poolID];\n\t\treclaimedA = ( reserves.reserve0 * liquidityToRemove ) / totalLiquidity;\n\t\treclaimedB = ( reserves.reserve1 * liquidityToRemove ) / totalLiquidity;\n\n\t\treserves.reserve0 -= uint128(reclaimedA);\n\t\treserves.reserve1 -= uint128(reclaimedB);\n\n\t\t// Make sure that removing liquidity doesn't drive either of the reserves below DUST.\n\t\t// This is to ensure that ratios remain relatively constant even after a maximum withdrawal.\n require((reserves.reserve0 >= PoolUtils.DUST) && (reserves.reserve0 >= PoolUtils.DUST), \"Insufficient reserves after liquidity removal\"); //@audit require check wrong check reserve0 -> reserve1\n\n\t\t// Switch reclaimed amounts back to the order that was specified in the call arguments so they make sense to the caller\n\t\tif (flipped)\n\t\t\t(reclaimedA,reclaimedB) = (reclaimedB,reclaimedA);\n\n\t\trequire( (reclaimedA >= minReclaimedA) && (reclaimedB >= minReclaimedB), \"Insufficient underlying tokens returned\" );\n\n\t\t// Send the reclaimed tokens to the user\n\t\ttokenA.safeTransfer( msg.sender, reclaimedA );\n\t\ttokenB.safeTransfer( msg.sender, reclaimedB );\n\n\t\temit LiquidityRemoved(tokenA, tokenB, reclaimedA, reclaimedB, liquidityToRemove);\n\t\t}", "fixed_code": "### [L-02] potential arithmetic underflow in `_arbitrage()`\n\n**Details:**\nSubtraction operation where arbitrageAmountIn is subtracted from amountOut. If amountOut is less than arbitrageAmountIn, it can lead to an underflow, and the result would wrap around to a very large positive number.\n\nAssuming the amountOut is greater than arbitrageAmountIn, the function continues with depositing the arbitrage profit to the DAO and updating stats related to the pools involved in the arbitrage.\nThese actions, if successfully executed, could indirectly affect the state of the liquidity pool. For example, depositing arbitrage profits to the DAO might Details the available liquidity in the pool or influence the distribution of rewards.\n\n**Proof of Code:**\n- [Pools.sol#L283](https://github.com/code-423n4/2024-01-salty/blob/main/src/pools/Pools.sol#L283C2-L298C4)", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/dharma09-Q.md", "collected_at": "2026-01-02T19:01:38.587052+00:00", "source_hash": "ce422c8d03e212dbaeb4eedd4299c04d3a4745344c3f381bb32f8f634d062aea", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Pools.sol#L170-L2, Pools.sol#L283-L2", "github_files_list": "Pools.sol", "github_refs_count": 2, "vulnerable_code_actual": "function removeLiquidity( IERC20 tokenA, IERC20 tokenB, uint256 liquidityToRemove, uint256 minReclaimedA, uint256 minReclaimedB, uint256 totalLiquidity ) external nonReentrant returns (uint256 reclaimedA, uint256 reclaimedB)\n\t\t{\n\t\trequire( msg.sender == address(collateralAndLiquidity), \"Pools.removeLiquidity is only callable from the CollateralAndLiquidity contract\" );\n\t\trequire( liquidityToRemove > 0, \"The amount of liquidityToRemove cannot be zero\" );\n\n\t\t(bytes32 poolID, bool flipped) = PoolUtils._poolIDAndFlipped(tokenA, tokenB);\n\n\t\t// Determine how much liquidity is being withdrawn and round down in favor of the protocol\n\t\tPoolReserves storage reserves = _poolReserves[poolID];\n\t\treclaimedA = ( reserves.reserve0 * liquidityToRemove ) / totalLiquidity;\n\t\treclaimedB = ( reserves.reserve1 * liquidityToRemove ) / totalLiquidity;\n\n\t\treserves.reserve0 -= uint128(reclaimedA);\n\t\treserves.reserve1 -= uint128(reclaimedB);\n\n\t\t// Make sure that removing liquidity doesn't drive either of the reserves below DUST.\n\t\t// This is to ensure that ratios remain relatively constant even after a maximum withdrawal.\n require((reserves.reserve0 >= PoolUtils.DUST) && (reserves.reserve0 >= PoolUtils.DUST), \"Insufficient reserves after liquidity removal\"); //@audit require check wrong check reserve0 -> reserve1\n\n\t\t// Switch reclaimed amounts back to the order that was specified in the call arguments so they make sense to the caller\n\t\tif (flipped)\n\t\t\t(reclaimedA,reclaimedB) = (reclaimedB,reclaimedA);\n\n\t\trequire( (reclaimedA >= minReclaimedA) && (reclaimedB >= minReclaimedB), \"Insufficient underlying tokens returned\" );\n\n\t\t// Send the reclaimed tokens to the user\n\t\ttokenA.safeTransfer( msg.sender, reclaimedA );\n\t\ttokenB.safeTransfer( msg.sender, reclaimedB );\n\n\t\temit LiquidityRemoved(tokenA, tokenB, reclaimedA, reclaimedB, liquidityToRemove);\n\t\t}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "### [L-02] potential arithmetic underflow in `_arbitrage()`\n\n**Details:**\nSubtraction operation where arbitrageAmountIn is subtracted from amountOut. If amountOut is less than arbitrageAmountIn, it can lead to an underflow, and the result would wrap around to a very large positive number.\n\nAssuming the amountOut is greater than arbitrageAmountIn, the function continues with depositing the arbitrage profit to the DAO and updating stats related to the pools involved in the arbitrage.\nThese actions, if successfully executed, could indirectly affect the state of the liquidity pool. For example, depositing arbitrage profits to the DAO might Details the available liquidity in the pool or influence the distribution of rewards.\n\n**Proof of Code:**\n- [Pools.sol#L283](https://github.com/code-423n4/2024-01-salty/blob/main/src/pools/Pools.sol#L283C2-L298C4)", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-ondo", "title": "cryptostellar5 Q", "severity_raw": "Critical", "severity": "critical", "description": "\n### 1. REQUIRE() SHOULD BE USED INSTEAD OF ASSERT()\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashFactory.sol\n\n```\n97: assert(cashProxyAdmin.owner() == guardian);\n```\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashKYCSenderFactory.sol\n\n```\n106: assert(cashKYCSenderProxyAdmin.owner() == guardian);\n```\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashKYCSenderReceiverFactory.sol\n\n```\n106: assert(cashKYCSenderReceiverProxyAdmin.owner() == guardian);\n```\n\n\n### 2. UPGRADEABLE CONTRACT IS MISSING A\u00a0`__GAP[50]`\u00a0STORAGE VARIABLE TO ALLOW FOR NEW STORAGE VARIABLES IN LATER VERSIONS\n\n*Number of Instances Identified: 4*\n\nSee\u00a0[this](https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps)\u00a0link for a description of this storage variable. While some contracts may not currently be sub-classed, adding the variable now protects against forgetting to add it in the future.\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/Proxy.sol\n\n```\n20-26: contract TokenProxy is TransparentUpgradeableProxy {\n constructor(\n address _logic,\n address _admin,\n bytes memory _data\n ) TransparentUpgradeableProxy(_logic, _admin, _data) {}\n}\n```\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/token/Cash.sol\n\n```\n21: contract Cash is ERC20PresetMinterPauserUpgradeable\n```\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/token/CashKYCSender.sol\n\n```\n22-24: contract CashKYCSender is\n ERC20PresetMinterPauserUpgradeable,\n KYCRegistryClientInitializable\n```\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/token/CashKYCSenderReceiver.sol\n\n```\n22-24: contract CashKYCSenderReceiver is\n ERC20PresetMinterPauserUpgradeable,\n KYCRegistryClientInitializable\n```\n\n\n### 3. MISSING EVENTS FOR FUNCTIONS THAT CHANGE CRITICAL PARAMETERS\n\nThe functions that change critical parameters should emit events. Events allow captu", "vulnerable_code": "97: assert(cashProxyAdmin.owner() == guardian);", "fixed_code": "106: assert(cashKYCSenderProxyAdmin.owner() == guardian);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/cryptostellar5-Q.md", "collected_at": "2026-01-02T18:15:02.789396+00:00", "source_hash": "ce52b9746043db646c3f082eedb7c36c69ce71dd421adb56b7a4999378a1d926", "code_block_count": 7, "solidity_block_count": 0, "total_code_chars": 635, "github_ref_count": 7, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "97: assert(cashProxyAdmin.owner() == guardian);", "primary_code_language": "unknown", "primary_code_char_count": 47, "all_code_blocks": "// Code block 1 (unknown):\n97: assert(cashProxyAdmin.owner() == guardian);\n\n// Code block 2 (unknown):\n106: assert(cashKYCSenderProxyAdmin.owner() == guardian);\n\n// Code block 3 (unknown):\n106: assert(cashKYCSenderReceiverProxyAdmin.owner() == guardian);\n\n// Code block 4 (unknown):\n20-26: contract TokenProxy is TransparentUpgradeableProxy {\n constructor(\n address _logic,\n address _admin,\n bytes memory _data\n ) TransparentUpgradeableProxy(_logic, _admin, _data) {}\n}\n\n// Code block 5 (unknown):\n21: contract Cash is ERC20PresetMinterPauserUpgradeable\n\n// Code block 6 (unknown):\n22-24: contract CashKYCSender is\n ERC20PresetMinterPauserUpgradeable,\n KYCRegistryClientInitializable\n\n// Code block 7 (unknown):\n22-24: contract CashKYCSenderReceiver is\n ERC20PresetMinterPauserUpgradeable,\n KYCRegistryClientInitializable", "all_code_blocks_count": 7, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CashFactory.sol, CashKYCSenderFactory.sol, CashKYCSenderReceiverFactory.sol, Proxy.sol, Cash.sol, CashKYCSender.sol, CashKYCSenderReceiver.sol", "github_files_list": "CashKYCSenderFactory.sol, CashKYCSenderReceiver.sol, CashFactory.sol, Proxy.sol, CashKYCSender.sol, Cash.sol, CashKYCSenderReceiverFactory.sol", "github_refs_count": 7, "vulnerable_code_actual": "97: assert(cashProxyAdmin.owner() == guardian);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "106: assert(cashKYCSenderProxyAdmin.owner() == guardian);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 13} {"source": "c4", "protocol": "11-kelp", "title": "0xMilenov Q", "severity_raw": "Unknown", "severity": "unknown", "description": "## Heading\nRole mismatch in addNodeDelegatorContractToQueue function\n\n## Context\n[LRTDepositPool.sol](https://github.com/code-423n4/2023-11-kelp/blob/c5fdc2e62c5e1d78769f44d6e34a6fb9e40c00f0/src/LRTDepositPool.sol#L191-L211)\n\n## Impact\nThe addNodeDelegatorContractToQueue function's control by onlyLRTAdmin, contrary to its NatSpec comment indicating onlyLRTManager access, may lead to administrative overreach and operational inefficiencies.\n\n## Description\nAt addNodeDelegatorContractToQueue function has a role mismatch. It is currently restricted to LRT Admins but is documented as being accessible only by LRT Managers. This discrepancy can lead to administrative errors and potential security issues, as the admin role might not be intended for operational tasks like updating node delegator contracts.\n\n```solidity\n/// @notice add new node delegator contract addresses\n /// @dev only callable by LRT manager\n /// @param nodeDelegatorContracts Array of NodeDelegator contract addresses\n function addNodeDelegatorContractToQueue(\n address[] calldata nodeDelegatorContracts\n ) external onlyLRTAdmin {\n // @audit onlyLRTManager!\n uint256 length = nodeDelegatorContracts.length;\n if (nodeDelegatorQueue.length + length > maxNodeDelegatorCount) {\n revert MaximumNodeDelegatorCountReached();\n }\n\n for (uint256 i; i < length; ) {\n UtilLib.checkNonZeroAddress(nodeDelegatorContracts[i]);\n nodeDelegatorQueue.push(nodeDelegatorContracts[i]);\n emit NodeDelegatorAddedinQueue(nodeDelegatorContracts[i]);\n unchecked {\n ++i;\n }\n }\n }\n```\n\n## Recommendation\nChange the modifier to onlyLRTManager.", "vulnerable_code": "/// @notice add new node delegator contract addresses\n /// @dev only callable by LRT manager\n /// @param nodeDelegatorContracts Array of NodeDelegator contract addresses\n function addNodeDelegatorContractToQueue(\n address[] calldata nodeDelegatorContracts\n ) external onlyLRTAdmin {\n // @audit onlyLRTManager!\n uint256 length = nodeDelegatorContracts.length;\n if (nodeDelegatorQueue.length + length > maxNodeDelegatorCount) {\n revert MaximumNodeDelegatorCountReached();\n }\n\n for (uint256 i; i < length; ) {\n UtilLib.checkNonZeroAddress(nodeDelegatorContracts[i]);\n nodeDelegatorQueue.push(nodeDelegatorContracts[i]);\n emit NodeDelegatorAddedinQueue(nodeDelegatorContracts[i]);\n unchecked {\n ++i;\n }\n }\n }", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/0xMilenov-Q.md", "collected_at": "2026-01-02T18:27:10.492705+00:00", "source_hash": "cfe4f27112cfd9046f44917f46d5ec753fcff4465777068b4754c3fc361f9083", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 849, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "/// @notice add new node delegator contract addresses\n /// @dev only callable by LRT manager\n /// @param nodeDelegatorContracts Array of NodeDelegator contract addresses\n function addNodeDelegatorContractToQueue(\n address[] calldata nodeDelegatorContracts\n ) external onlyLRTAdmin {\n // @audit onlyLRTManager!\n uint256 length = nodeDelegatorContracts.length;\n if (nodeDelegatorQueue.length + length > maxNodeDelegatorCount) {\n revert MaximumNodeDelegatorCountReached();\n }\n\n for (uint256 i; i < length; ) {\n UtilLib.checkNonZeroAddress(nodeDelegatorContracts[i]);\n nodeDelegatorQueue.push(nodeDelegatorContracts[i]);\n emit NodeDelegatorAddedinQueue(nodeDelegatorContracts[i]);\n unchecked {\n ++i;\n }\n }\n }", "primary_code_language": "solidity", "primary_code_char_count": 849, "all_code_blocks": "// Code block 1 (solidity):\n/// @notice add new node delegator contract addresses\n /// @dev only callable by LRT manager\n /// @param nodeDelegatorContracts Array of NodeDelegator contract addresses\n function addNodeDelegatorContractToQueue(\n address[] calldata nodeDelegatorContracts\n ) external onlyLRTAdmin {\n // @audit onlyLRTManager!\n uint256 length = nodeDelegatorContracts.length;\n if (nodeDelegatorQueue.length + length > maxNodeDelegatorCount) {\n revert MaximumNodeDelegatorCountReached();\n }\n\n for (uint256 i; i < length; ) {\n UtilLib.checkNonZeroAddress(nodeDelegatorContracts[i]);\n nodeDelegatorQueue.push(nodeDelegatorContracts[i]);\n emit NodeDelegatorAddedinQueue(nodeDelegatorContracts[i]);\n unchecked {\n ++i;\n }\n }\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "/// @notice add new node delegator contract addresses\n /// @dev only callable by LRT manager\n /// @param nodeDelegatorContracts Array of NodeDelegator contract addresses\n function addNodeDelegatorContractToQueue(\n address[] calldata nodeDelegatorContracts\n ) external onlyLRTAdmin {\n // @audit onlyLRTManager!\n uint256 length = nodeDelegatorContracts.length;\n if (nodeDelegatorQueue.length + length > maxNodeDelegatorCount) {\n revert MaximumNodeDelegatorCountReached();\n }\n\n for (uint256 i; i < length; ) {\n UtilLib.checkNonZeroAddress(nodeDelegatorContracts[i]);\n nodeDelegatorQueue.push(nodeDelegatorContracts[i]);\n emit NodeDelegatorAddedinQueue(nodeDelegatorContracts[i]);\n unchecked {\n ++i;\n }\n }\n }", "github_refs_formatted": "LRTDepositPool.sol#L191-L211", "github_files_list": "LRTDepositPool.sol", "github_refs_count": 1, "vulnerable_code_actual": "/// @notice add new node delegator contract addresses\n /// @dev only callable by LRT manager\n /// @param nodeDelegatorContracts Array of NodeDelegator contract addresses\n function addNodeDelegatorContractToQueue(\n address[] calldata nodeDelegatorContracts\n ) external onlyLRTAdmin {\n // @audit onlyLRTManager!\n uint256 length = nodeDelegatorContracts.length;\n if (nodeDelegatorQueue.length + length > maxNodeDelegatorCount) {\n revert MaximumNodeDelegatorCountReached();\n }\n\n for (uint256 i; i < length; ) {\n UtilLib.checkNonZeroAddress(nodeDelegatorContracts[i]);\n nodeDelegatorQueue.push(nodeDelegatorContracts[i]);\n emit NodeDelegatorAddedinQueue(nodeDelegatorContracts[i]);\n unchecked {\n ++i;\n }\n }\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "01-ondo", "title": "arialblack14 G", "severity_raw": "High", "severity": "high", "description": "# GAS OPTIMIZATION REPORT \u26fd\n\n## [G-1] Use shift right/left instead of division/multiplication if possible.\n\n### Description\nA division/multiplication by any number `x` being a power of 2 can be calculated by shifting `log2(x)` to the right/left.\nWhile the `DIV` opcode uses 5 gas, the `SHR` opcode only uses 3 gas.\nurthermore, Solidity's division operation also includes a division-by-0 prevention which is bypassed using shifting.\n\n### \u2705 Recommendation\nYou should change multiplication and division with powers of two to bit shift.\n\n#### *Instances(1):*\nFile: [2023-01-ondo/contracts/cash/CashManager.sol](https://github.com/code-423n4/2023-01-ondo/tree/main/contracts/cash/CashManager.sol#L491 )\n```solidity\n491: uint256 amountE24 = _scaleUp(collateralAmountIn) * 1e6;\n```\n\n## [G-2] `++i/i++` should be `unchecked{++i}`/`unchecked{i++}` when it is not possible for them to overflow, for example when used in `for` and `while` loops\n\n### Description\nIn Solidity 0.8+, there\u2019s a default overflow check on unsigned integers. It\u2019s possible to uncheck this in for-loops and save some gas at each iteration, but at the cost of some code readability, as this uncheck [cannot be made inline](https://github.com/ethereum/solidity/issues/10695). \n\t\t\tExample for loop:\n\n```Solidity\nfor (uint i = 0; i < length; i++) {\n// do something that doesn't change the value of i\n}\n```\n\nIn this example, the for loop post condition, i.e., `i++` involves checked arithmetic, which is not required. This is because the value of i is always strictly less than `length <= 2**256 - 1`. Therefore, the theoretical maximum value of i to enter the for-loop body `is 2**256 - 2`. This means that the `i++` in the for loop can never overflow. Regardless, the overflow checks are performed by the compiler.\n\nUnfortunately, the Solidity optimizer is not smart enough to detect this and remove the checks. You should manually do this by:\n\n```Solidity\nfor (uint i = 0; i < length; i = unchecked_inc(i)) {\n\t// do something that doesn'", "vulnerable_code": "491: uint256 amountE24 = _scaleUp(collateralAmountIn) * 1e6;", "fixed_code": "for (uint i = 0; i < length; i++) {\n// do something that doesn't change the value of i\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/arialblack14-G.md", "collected_at": "2026-01-02T18:14:54.696244+00:00", "source_hash": "cfffba23c10141dbe8ef5331a629ef2b552ee5e8650a34f7258d07c476e124d4", "code_block_count": 2, "solidity_block_count": 1, "total_code_chars": 148, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "491: uint256 amountE24 = _scaleUp(collateralAmountIn) * 1e6;", "primary_code_language": "solidity", "primary_code_char_count": 60, "all_code_blocks": "// Code block 1 (solidity):\n491: uint256 amountE24 = _scaleUp(collateralAmountIn) * 1e6;\n\n// Code block 2 (Solidity):\nfor (uint i = 0; i < length; i++) {\n// do something that doesn't change the value of i\n}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "491: uint256 amountE24 = _scaleUp(collateralAmountIn) * 1e6;\n\nfor (uint i = 0; i < length; i++) {\n// do something that doesn't change the value of i\n}", "github_refs_formatted": "CashManager.sol#L491", "github_files_list": "CashManager.sol", "github_refs_count": 1, "vulnerable_code_actual": "491: uint256 amountE24 = _scaleUp(collateralAmountIn) * 1e6;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "for (uint i = 0; i < length; i++) {\n// do something that doesn't change the value of i\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "11-kelp", "title": "rumen G", "severity_raw": "Medium", "severity": "medium", "description": "### GAS 01 - NodeDelegator.sol:110 -> cache **IStrategy(strategies[i])**: (Saves 118 gas)\n\n```solidity\n110: assets[i] = address(IStrategy(strategies[i]).underlyingToken());\n111: assetBalances[i] = IStrategy(strategies[i]).userUnderlyingView(address(this));\n```\n**Suggested edit:**\n\n```solidity\nIStrategy strategy = IStrategy(strategies[i]);\nassets[i] = address(strategy.underlyingToken());\nassetBalances[i] = strategy.userUnderlyingView(address(this));\n```\n\n| Function Name | min | avg | median | max | # calls |\n|----------------------------------------------|-----------------|-------|--------|--------|---------|\n| getAssetBalances (Before) | 24953 | 24953 | 24953 | 24953 | 1 |\n| getAssetBalances (After) | 24835 | 24835 | 24835 | 24835 | 1 |\n\n### GAS 02 - LRTDepositPool.sol:83 -> cache **nodeDelegatorQueue[i]** as a variable (Saves 837 gas)\n\n```solidity\n83: assetLyingInNDCs += IERC20(asset).balanceOf(nodeDelegatorQueue[i]);\n84: assetStakedInEigenLayer += INodeDelegator(nodeDelegatorQueue[i]).getAssetBalance(asset);\n```\n\n**Suggested edit:**\n```solidity\naddress currentNdc = nodeDelegatorQueue[i];\nassetLyingInNDCs += IERC20(asset).balanceOf(nodeDelegatorQueue[i]);\nassetStakedInEigenLayer += INodeDelegator(nodeDelegatorQueue[i]).getAssetBalance(asset);\n```\n\n\n| Function Name | min | avg | median | max | # calls |\n|------------------------------------------------|-----------------|-------|--------|--------|---------|\n| getAssetDistributionData (Before) | 10153 | 10153 | 10153 | 10153 | 1 |\n| getAssetDistributionData (After) | 9316 | 9316 | 9316 | 9316 | 1 |\n\n### GAS 03 - LRTOracle.sol:68 -> directly use **getAssetPrice(asset)** and **ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset)** instead of declaring variables **(assetER,", "vulnerable_code": "110: assets[i] = address(IStrategy(strategies[i]).underlyingToken());\n111: assetBalances[i] = IStrategy(strategies[i]).userUnderlyingView(address(this));", "fixed_code": "IStrategy strategy = IStrategy(strategies[i]);\nassets[i] = address(strategy.underlyingToken());\nassetBalances[i] = strategy.userUnderlyingView(address(this));", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/rumen-G.md", "collected_at": "2026-01-02T18:28:25.758361+00:00", "source_hash": "d06bc33e9f2de018246343f8abb32bce545896e7aab4a62462671612ea6b85ce", "code_block_count": 4, "solidity_block_count": 4, "total_code_chars": 675, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "110: assets[i] = address(IStrategy(strategies[i]).underlyingToken());\n111: assetBalances[i] = IStrategy(strategies[i]).userUnderlyingView(address(this));", "primary_code_language": "solidity", "primary_code_char_count": 153, "all_code_blocks": "// Code block 1 (solidity):\n110: assets[i] = address(IStrategy(strategies[i]).underlyingToken());\n111: assetBalances[i] = IStrategy(strategies[i]).userUnderlyingView(address(this));\n\n// Code block 2 (solidity):\nIStrategy strategy = IStrategy(strategies[i]);\nassets[i] = address(strategy.underlyingToken());\nassetBalances[i] = strategy.userUnderlyingView(address(this));\n\n// Code block 3 (solidity):\n83: assetLyingInNDCs += IERC20(asset).balanceOf(nodeDelegatorQueue[i]);\n84: assetStakedInEigenLayer += INodeDelegator(nodeDelegatorQueue[i]).getAssetBalance(asset);\n\n// Code block 4 (solidity):\naddress currentNdc = nodeDelegatorQueue[i];\nassetLyingInNDCs += IERC20(asset).balanceOf(nodeDelegatorQueue[i]);\nassetStakedInEigenLayer += INodeDelegator(nodeDelegatorQueue[i]).getAssetBalance(asset);", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "110: assets[i] = address(IStrategy(strategies[i]).underlyingToken());\n111: assetBalances[i] = IStrategy(strategies[i]).userUnderlyingView(address(this));\n\nIStrategy strategy = IStrategy(strategies[i]);\nassets[i] = address(strategy.underlyingToken());\nassetBalances[i] = strategy.userUnderlyingView(address(this));\n\n83: assetLyingInNDCs += IERC20(asset).balanceOf(nodeDelegatorQueue[i]);\n84: assetStakedInEigenLayer += INodeDelegator(nodeDelegatorQueue[i]).getAssetBalance(asset);\n\naddress currentNdc = nodeDelegatorQueue[i];\nassetLyingInNDCs += IERC20(asset).balanceOf(nodeDelegatorQueue[i]);\nassetStakedInEigenLayer += INodeDelegator(nodeDelegatorQueue[i]).getAssetBalance(asset);", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "110: assets[i] = address(IStrategy(strategies[i]).underlyingToken());\n111: assetBalances[i] = IStrategy(strategies[i]).userUnderlyingView(address(this));", "has_vulnerable_code_snippet": true, "fixed_code_actual": "IStrategy strategy = IStrategy(strategies[i]);\nassets[i] = address(strategy.underlyingToken());\nassetBalances[i] = strategy.userUnderlyingView(address(this));", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "02-ai-arena", "title": "0xweb3boy Analysis", "severity_raw": "Low", "severity": "low", "description": "\n![aiA](https://github.com/0xWeb3boy/photo/assets/113019033/4d4d3c03-0c92-4e41-a09b-06db1da133a6)\n\n# AI Arena Analysis\n\n## Overview\nIn the AI Arena - Gaming Competition, participants engage in a dynamic gaming environment where they have the opportunity to purchase, train, and engage in battles with AI-enabled Non-Fungible Tokens (NFTs) within a Player versus Player (PvP) fighting game.\n\nThis gaming platform offers a multifaceted experience, where users can acquire NFTs equipped with artificial intelligence capabilities. These NFTs serve as virtual entities that can be nurtured and customized through various training mechanisms, enabling gamers to enhance their abilities and strategize for competitive battles.\n\nOnce equipped with their trained NFTs, participants enter the PvP arena, where they engage in thrilling battles against opponents. These battles are characterized by strategic maneuvers, real-time decision-making, and the utilization of unique AI-driven abilities embedded within each NFT.\n\nThe AI Arena fosters a competitive gaming atmosphere, where players can showcase their skills, develop effective battle strategies, and strive for victory in exhilarating PvP encounters. Through the integration of AI technology and NFT mechanics, the AI Arena offers a dynamic and immersive gaming experience for enthusiasts seeking engaging and strategic gameplay.\n\n``Smart Contracts``: Utilizes contracts like RankedBattle.sol which enables users to stake NRN tokens on fighters, monitors battle records, computes and disburses rewards based on battle results and staked quantities, and permits the claiming of accumulated rewards.\n\n``Neuron Token``:Within the platform, the Neuron token serves multiple purposes, including but not limited to staking, governance participation, and reward distribution..\n\n``Risk Management``: With the help of StakeAtRisk this smart contract enables the RankedBattle functionality to oversee the staking process of NRN tokens during battle engagements", "vulnerable_code": "function updateAtRiskRecords(\n uint256 nrnToPlaceAtRisk, \n uint256 fighterId, \n address fighterOwner\n ) \n external \n {\n require(msg.sender == _rankedBattleAddress, \"Call must be from RankedBattle contract\");\n stakeAtRisk[roundId][fighterId] += nrnToPlaceAtRisk;\n totalStakeAtRisk[roundId] += nrnToPlaceAtRisk;\n amountLost[fighterOwner] += nrnToPlaceAtRisk;\n emit IncreasedStakeAtRisk(fighterId, nrnToPlaceAtRisk);\n } \n", "fixed_code": " function updateBattleRecord(\n uint256 tokenId, \n uint256 mergingPortion,\n uint8 battleResult,\n uint256 eloFactor,\n bool initiatorBool\n ) \n external \n { \n require(msg.sender == _gameServerAddress);\n require(mergingPortion <= 100);\n address fighterOwner = _fighterFarmInstance.ownerOf(tokenId);\n require(\n !initiatorBool ||\n _voltageManagerInstance.ownerVoltageReplenishTime(fighterOwner) <= block.timestamp || \n _voltageManagerInstance.ownerVoltage(fighterOwner) >= VOLTAGE_COST\n );\n\n _updateRecord(tokenId, battleResult);\n uint256 stakeAtRisk = _stakeAtRiskInstance.getStakeAtRisk(tokenId);\n if (amountStaked[tokenId] + stakeAtRisk > 0) {\n _addResultPoints(battleResult, tokenId, eloFactor, mergingPortion, fighterOwner);\n }\n if (initiatorBool) {\n _voltageManagerInstance.spendVoltage(fighterOwner, VOLTAGE_COST);\n }\n totalBattles += 1;\n }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/0xweb3boy-Analysis.md", "collected_at": "2026-01-02T19:02:10.540880+00:00", "source_hash": "d06e7e246be8f9f159dbb0091858962714d922e5db6129352c21a38c841fc267", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function updateAtRiskRecords(\n uint256 nrnToPlaceAtRisk, \n uint256 fighterId, \n address fighterOwner\n ) \n external \n {\n require(msg.sender == _rankedBattleAddress, \"Call must be from RankedBattle contract\");\n stakeAtRisk[roundId][fighterId] += nrnToPlaceAtRisk;\n totalStakeAtRisk[roundId] += nrnToPlaceAtRisk;\n amountLost[fighterOwner] += nrnToPlaceAtRisk;\n emit IncreasedStakeAtRisk(fighterId, nrnToPlaceAtRisk);\n } \n", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function updateBattleRecord(\n uint256 tokenId, \n uint256 mergingPortion,\n uint8 battleResult,\n uint256 eloFactor,\n bool initiatorBool\n ) \n external \n { \n require(msg.sender == _gameServerAddress);\n require(mergingPortion <= 100);\n address fighterOwner = _fighterFarmInstance.ownerOf(tokenId);\n require(\n !initiatorBool ||\n _voltageManagerInstance.ownerVoltageReplenishTime(fighterOwner) <= block.timestamp || \n _voltageManagerInstance.ownerVoltage(fighterOwner) >= VOLTAGE_COST\n );\n\n _updateRecord(tokenId, battleResult);\n uint256 stakeAtRisk = _stakeAtRiskInstance.getStakeAtRisk(tokenId);\n if (amountStaked[tokenId] + stakeAtRisk > 0) {\n _addResultPoints(battleResult, tokenId, eloFactor, mergingPortion, fighterOwner);\n }\n if (initiatorBool) {\n _voltageManagerInstance.spendVoltage(fighterOwner, VOLTAGE_COST);\n }\n totalBattles += 1;\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "02-ai-arena", "title": "Timenov Q", "severity_raw": "High", "severity": "high", "description": "# AI Arena QA report by Timenov\n\n## Summary\n\n| |Issue|Instances|\n |-|:-|:-:|\n| I-01 | State variable can be set in constructor. | 6 |\n| I-02 | Process failed transfers. | 7 |\n| I-03 | No way to change _neuronInstance. | 1 |\n| L-01 | Wrong ERC1155 uri. | 1 |\n| L-02 | Function will return wrong value if item has infinite supply. | 1 |\n| L-03 | Mint will never get to the MAX_SUPPLY. | 1 |\n\n### [I-01] State variables can be set in constructor.\nIn some contracts, state variable that are referencing other contracts are set in functions(usually their names start with `instantiate`). This can be removed so that the deployer will not need to call these functions on deployment, but only when these variables need to be updated. How each contract can be optimized:\n\n- FighterFarm.sol -> Set `_aiArenaHelperInstance` and `_neuronInstance` in the constructor.\n- GameItems.sol -> Set `_neuronInstance` in the constructor.\n- MergingPool.sol -> Set `_fighterFarmInstance` in the constructor(this must be deployed after `FighterFarm` contract).\n- RankedBattle.sol -> Set `_neuronInstance` and `_mergingPoolInstance` in the constructor.\n\nThe other contracts have done this already. Also consider renaming all the functions that will be affected from these changes. Currently they start with `instantiate`. A better naming will be `set` or `update`. All these changes will increase the code readability, remove deployment errors and cost less gas on deployment.\n\n### [I-02] Process failed transfers.\nThe boolean `success` is taken after `NRN` transfer. However only the `true` value is processed. Consider reverting when the result is `false` so that the users are notified when the token transfer has failed.\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L376\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/GameItems.sol#L164\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b4", "vulnerable_code": " // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json\n string private _uri;", "fixed_code": " function remainingSupply(uint256 tokenId) public view returns (uint256) {\n return allGameItemAttributes[tokenId].itemsRemaining;\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/Timenov-Q.md", "collected_at": "2026-01-02T19:02:47.859931+00:00", "source_hash": "d096f265e0207ca65175ac28d41a0ed5e6d75b8dd6c27301ec4bcd1c767e30b5", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "FighterFarm.sol#L376, GameItems.sol#L164", "github_files_list": "GameItems.sol, FighterFarm.sol", "github_refs_count": 2, "vulnerable_code_actual": " // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json\n string private _uri;", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function remainingSupply(uint256 tokenId) public view returns (uint256) {\n return allGameItemAttributes[tokenId].itemsRemaining;\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-salty", "title": "Beepidibop Q", "severity_raw": "Informational", "severity": "informational", "description": "## [INFO-1] `CollateralAndLiquidity`: Inconsistent Sources for Immutable Assignment in the Constructor\n\nSome immutable states take assignment from `exchangeConfig` while others take assignment from `_exchangeConfig`.\n\ne.g.\n\n```\n\u00a0 \u00a0 \u00a0 \u00a0 usds = _exchangeConfig.usds();\n\n\u00a0 \u00a0 \u00a0 \u00a0 wbtc = exchangeConfig.wbtc();\n\n\u00a0 \u00a0 \u00a0 \u00a0 weth = exchangeConfig.weth();\n```\n\nIt doesn't really matter In practise since `exchangeConfig` is immutable. But it's more professional to stay consistent.\n\n### Recommendation\n\nChange all immutable assignment sources to `_exchangeConfig`.\n\n### Link To Affected Code\n\nhttps://github.com/code-423n4/2024-01-salty/blob/f742b554e18ae1a07cb8d4617ec8aa50db037c1c/src/stable/CollateralAndLiquidity.sol#L59-L61", "vulnerable_code": "\u00a0 \u00a0 \u00a0 \u00a0 usds = _exchangeConfig.usds();\n\n\u00a0 \u00a0 \u00a0 \u00a0 wbtc = exchangeConfig.wbtc();\n\n\u00a0 \u00a0 \u00a0 \u00a0 weth = exchangeConfig.weth();", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/Beepidibop-Q.md", "collected_at": "2026-01-02T19:01:14.093058+00:00", "source_hash": "d0b44b201c1706526c8e1b49b4fe9caa002cfaef58a87fa3281b3ecf0b85a5c0", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 108, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "usds = _exchangeConfig.usds();\n\n\u00a0 \u00a0 \u00a0 \u00a0 wbtc = exchangeConfig.wbtc();\n\n\u00a0 \u00a0 \u00a0 \u00a0 weth = exchangeConfig.weth();", "primary_code_language": "unknown", "primary_code_char_count": 108, "all_code_blocks": "// Code block 1 (unknown):\nusds = _exchangeConfig.usds();\n\n\u00a0 \u00a0 \u00a0 \u00a0 wbtc = exchangeConfig.wbtc();\n\n\u00a0 \u00a0 \u00a0 \u00a0 weth = exchangeConfig.weth();", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CollateralAndLiquidity.sol#L59-L61", "github_files_list": "CollateralAndLiquidity.sol", "github_refs_count": 1, "vulnerable_code_actual": "\u00a0 \u00a0 \u00a0 \u00a0 usds = _exchangeConfig.usds();\n\n\u00a0 \u00a0 \u00a0 \u00a0 wbtc = exchangeConfig.wbtc();\n\n\u00a0 \u00a0 \u00a0 \u00a0 weth = exchangeConfig.weth();", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.43} {"source": "c4", "protocol": "10-badger", "title": "unique Q", "severity_raw": "Critical", "severity": "critical", "description": "## \\[L-01\\] Stop Using Solidity's transfer() Now\n\n**Proof Of Concept** \n[https://consensys.io/diligence/blog/2019/09/stop-using-soliditys-transfer-now/\\[\\](https://github.com/Tapioca-DAO/tapioca-bar-audit/blob/master/contracts/markets/singularity/SGLCommon.sol#L215)](https://consensys.io/diligence/blog/2019/09/stop-using-soliditys-transfer-now/%5B%5D%28https://github.com/Tapioca-DAO/tapioca-bar-audit/blob/master/contracts/markets/singularity/SGLCommon.sol#L215%29 \"https://consensys.io/diligence/blog/2019/09/stop-using-soliditys-transfer-now/%5B%5D(https://github.com/Tapioca-DAO/tapioca-bar-audit/blob/master/contracts/markets/singularity/SGLCommon.sol#L215)\")\n\n```\ncollateral.transfer(address(receiver), amount);\n```\n\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/ActivePool.sol#L274\n\n```\ncollateral.transfer(feeRecipientAddress, fee);\n```\n\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/ActivePool.sol#L286\n\n## \\[L-02\\] Function Calls in Loop Could Lead to Denial of Service\n\nFunction calls made in unbounded loop are error-prone with potential resource exhaustion as it can trap the contract due to the gas limitations or failed transactions. Here are some of the instances entailed:\n\n```\nfunction getRolesForUser(address user) external view returns (uint8[] memory rolesForUser) {\n```\n\n https://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/Governor.sol#L73\n\nConsider bounding the loop where possible to avoid unnecessary gas wastage and denial of service.\n\n## \\[L-03\\] Insufficient coverage\n\nDescription \nThe test coverage rate of the project is ~99%. Testing all functions is best practice in terms of security criteria.\n\nDue to its capacity, test coverage is expected to be 100%.\n\n# Non- Critical\n\n## \\[N-01\\] For modern and more readable code; update import usages\n\nSolidity code is also cleaner in another way that might not be noticeable: the struct Point. We were importi", "vulnerable_code": "collateral.transfer(address(receiver), amount);", "fixed_code": "collateral.transfer(feeRecipientAddress, fee);", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/unique-Q.md", "collected_at": "2026-01-02T18:27:05.097982+00:00", "source_hash": "d0c83289c0448afe52e42f309da9f67742e1f1fb621051a7800546ecf4d5fa61", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 185, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "collateral.transfer(address(receiver), amount);", "primary_code_language": "unknown", "primary_code_char_count": 47, "all_code_blocks": "// Code block 1 (unknown):\ncollateral.transfer(address(receiver), amount);\n\n// Code block 2 (unknown):\ncollateral.transfer(feeRecipientAddress, fee);\n\n// Code block 3 (unknown):\nfunction getRolesForUser(address user) external view returns (uint8[] memory rolesForUser) {", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SGLCommon.sol#L215, ActivePool.sol#L274, ActivePool.sol#L286, Governor.sol#L73", "github_files_list": "SGLCommon.sol, Governor.sol, ActivePool.sol", "github_refs_count": 4, "vulnerable_code_actual": "collateral.transfer(address(receiver), amount);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "collateral.transfer(feeRecipientAddress, fee);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "09-ondo", "title": "wahedtalash77 Q", "severity_raw": "Critical", "severity": "critical", "description": "# Non-Critical Findings\n\n## [N-01] NatSpec comments should be increased in contracts\n\nhttps://docs.soliditylang.org/en/v0.8.15/natspec-format.html\n\n## [N-02] Function writing that does not comply with the Solidity Style Guide\n\nhttps://docs.soliditylang.org/en/v0.8.17/style-guide.html\n\n## [N\u201103] Use scientific notation (e.g. 1e27) rather than exponentiation (e.g. 10**27)\n\nWhile the compiler knows to optimize away the exponentiation, it\u2019s still better coding practice to use idioms that do not require compiler optimization, if they exist.\n\n```\nuint256 private constant ONE = 10 ** 27;\n```\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/rwaOracles/RWADynamicOracle.sol#L343\n\n## [N-04] Showing the actual values of numbers in NatSpec comments makes checking and reading code easier\n\n## [N-05] Use constants for numbers\n\n==In several locations in the code, numbers like 1e36, 100e18, 1e27 are used...==\nhttps://github.com/code-423n4/2021-05-yield-findings/issues/3#issuecomment-852039791\n\n## [N-06] Use SMTChecker\n\nThe highest tier of smart contract behavior assurance is formal mathematical verification. All assertions that are made are guaranteed to be true across all inputs \u2192 The quality of your asserts is the quality of your verification.\n\nhttps://twitter.com/0xOwenThurm/status/1614359896350425088?t=dbG9gHFigBX85Rv29lOjIQ&s=19\n\n## [N-07] For modern and more readable code; update import usages\n\nSolidity code is also cleaner in another way that might not be noticeable: the struct Point. We were importing it previously with global import but not using it. The Point struct polluted the source code with an unnecessary object we were not using because we did not need it.\nThis was breaking the rule of modularity and modular programming: only import what you need Specific imports with curly braces allow us to apply this rule better.\n*Recommendation*\n`import {contract1 , contract2} from \"filename.sol\";`\n\n## [N-07] Assembly Codes Specif", "vulnerable_code": "uint256 private constant ONE = 10 ** 27;", "fixed_code": "", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/wahedtalash77-Q.md", "collected_at": "2026-01-02T18:26:21.596871+00:00", "source_hash": "d0dc50e5556b7c5fc8af93f43b4b27d9c4833e15d9cfe4754b4597e2d0fa185e", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 40, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "uint256 private constant ONE = 10 ** 27;", "primary_code_language": "unknown", "primary_code_char_count": 40, "all_code_blocks": "// Code block 1 (unknown):\nuint256 private constant ONE = 10 ** 27;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "RWADynamicOracle.sol#L343", "github_files_list": "RWADynamicOracle.sol", "github_refs_count": 1, "vulnerable_code_actual": "uint256 private constant ONE = 10 ** 27;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "02-ethos", "title": "codeislight G", "severity_raw": "Low", "severity": "low", "description": "# Summary\n## Gas Optimizations List:\n| Number |Issues Details|Instances|Gas Saved|\n|:--:|:-------|:--:|:--:|\n|[G-1]| Reconstructing mapping struct would save on extra storage slots | 4 | 198900 |\n|[G-2]| One time set variables can be defined as immutable | 64 | 134400 |\n|[G-3]| LUSDToken can be optimized using ERC20 solmate implementation | 1 | ~ |\n|[G-4]| Extra unecessary check overflow, when having a require or if check | 1 | 200 |\n|[G-5]| Caching reused storage variables | 33 | 3300 |\n|[G-6]| Using return variable area to assign returned value | 45 | 135 |\n|[G-7]| Reordering if checks to save on extra check | 1 | 3 |\n|[G-8]| Define variables outside of the for loop | 11 | ~ |\n|[G-9]| Operations safe to be unchecked | 18 | 981 |\n\n **~ refers to the fact that the Gas Saved would vary**\n\n### [G-1] Reconstructing mapping struct would save on extra storage slots\n\nIn multiple cases, the mappings with the same key are not being efficiently packed, due to the fact that they are being defined seperately. by combining them together in a single mapping, we would be able to tightly pack them together, saving a couple of Gsset storage slots.\n\n\n3 instances - 3 files\n\n1. ReaperVaultV2.sol: (Saving 3 (Gsset+Gcoldsload) = 3 * (20000+2100) = 66300 gas)\n```solidity\n // from:\n struct StrategyParams {\n uint256 activation; // Activation block.timestamp // uint64 is enough\n uint256 feeBPS; // Performance fee taken from profit, in BPS // max value is 2000 uint16\n uint256 allocBPS; // Allocation in BPS of vault's total assets // max value is 10000 uint16\n uint256 allocated; // Amount of capital allocated to this strategy\n uint256 gains; // Total returns that Strategy has realized for Vault\n uint256 losses; // Total losses that Strategy has realized for Vault\n uint256 lastReport; // block.timestamp of the last time a report occured // uint64 is enough\n }\n mapping(address => StrategyParams) public strategies;\n\n // to:\n stru", "vulnerable_code": " // from:\n struct StrategyParams {\n uint256 activation; // Activation block.timestamp // uint64 is enough\n uint256 feeBPS; // Performance fee taken from profit, in BPS // max value is 2000 uint16\n uint256 allocBPS; // Allocation in BPS of vault's total assets // max value is 10000 uint16\n uint256 allocated; // Amount of capital allocated to this strategy\n uint256 gains; // Total returns that Strategy has realized for Vault\n uint256 losses; // Total losses that Strategy has realized for Vault\n uint256 lastReport; // block.timestamp of the last time a report occured // uint64 is enough\n }\n mapping(address => StrategyParams) public strategies;\n\n // to:\n struct StrategyParams {\n uint64 activation; // Activation block.timestamp // it's a timestamp <=> uint64\n uint64 lastReport; // block.timestamp of the last time a report occured // it's a timestamp <=> uint64\n uint64 feeBPS; // Performance fee taken from profit, in BPS // max value is 2000 therefore uint16\n uint64 allocBPS; // Allocation in BPS of vault's total assets // max value is 10000 therefore uint16\n uint256 allocated; // Amount of capital allocated to this strategy\n uint256 gains; // Total returns that Strategy has realized for Vault\n uint256 losses; // Total losses that Strategy has realized for Vault\n }\n mapping(address => StrategyParams) public strategies;", "fixed_code": " // from\n mapping (address => bytes32) public tellorQueryId; // collateral => Tellor query ID\n mapping (address => uint) public lastGoodPrice;\n mapping (address => AggregatorV3Interface) public priceAggregator; // collateral => Mainnet Chainlink aggregator\n mapping (address => Status) public status;\n\n // to\n struct PriceFeedParams {\n bytes32 tellorQueryId; // 256 bits\n uint256 lastGoodPrice; // 256 bits\n address aggregator; // 160 bits\n Status status; // 8 bits\n }\n mapping (address => PriceFeedParams) public priceFeed;", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/codeislight-G.md", "collected_at": "2026-01-02T18:16:57.563511+00:00", "source_hash": "d0dff3ee7e5e0e53251dea7729e1a6662711fed7726e0a4b6afd9cef29863885", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " // from:\n struct StrategyParams {\n uint256 activation; // Activation block.timestamp // uint64 is enough\n uint256 feeBPS; // Performance fee taken from profit, in BPS // max value is 2000 uint16\n uint256 allocBPS; // Allocation in BPS of vault's total assets // max value is 10000 uint16\n uint256 allocated; // Amount of capital allocated to this strategy\n uint256 gains; // Total returns that Strategy has realized for Vault\n uint256 losses; // Total losses that Strategy has realized for Vault\n uint256 lastReport; // block.timestamp of the last time a report occured // uint64 is enough\n }\n mapping(address => StrategyParams) public strategies;\n\n // to:\n struct StrategyParams {\n uint64 activation; // Activation block.timestamp // it's a timestamp <=> uint64\n uint64 lastReport; // block.timestamp of the last time a report occured // it's a timestamp <=> uint64\n uint64 feeBPS; // Performance fee taken from profit, in BPS // max value is 2000 therefore uint16\n uint64 allocBPS; // Allocation in BPS of vault's total assets // max value is 10000 therefore uint16\n uint256 allocated; // Amount of capital allocated to this strategy\n uint256 gains; // Total returns that Strategy has realized for Vault\n uint256 losses; // Total losses that Strategy has realized for Vault\n }\n mapping(address => StrategyParams) public strategies;", "has_vulnerable_code_snippet": true, "fixed_code_actual": " // from\n mapping (address => bytes32) public tellorQueryId; // collateral => Tellor query ID\n mapping (address => uint) public lastGoodPrice;\n mapping (address => AggregatorV3Interface) public priceAggregator; // collateral => Mainnet Chainlink aggregator\n mapping (address => Status) public status;\n\n // to\n struct PriceFeedParams {\n bytes32 tellorQueryId; // 256 bits\n uint256 lastGoodPrice; // 256 bits\n address aggregator; // 160 bits\n Status status; // 8 bits\n }\n mapping (address => PriceFeedParams) public priceFeed;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-biconomy", "title": "adriro Q", "severity_raw": "Low", "severity": "low", "description": "## Upgradeable contract is missing a __gap[50] storage variable to allow for new storage variables in later versions\t\n\nAdd some storage gap to base contracts to allow adding storage variables in future upgrades.\n\nOccurrences:\n\n- BaseSmartAccount (used by SmartAccount)\n\nAlso the following mixins are used in the SmartAccount contract\n\n- Singleton\n- ModuleManager\n- SignatureDecoder\n- SecuredTokenTransfer\n- FallbackManager\n\n## Move setters to the \"setters\" section in SmartAccount contract\n\nSetters defined between lines 94-103 should be placed after line 107.\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L93-L103\n\n## Use `block.chainid` instead of assembly\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L140-L147\n\nIn Solidity 0.8 `block.chainid` can be used to retrieve the chain id value.\n\n## Duplicated getter `getNonce` in SmartAccount contract\n\nThe getter `getNonce` is already defined by the `nonce(uint256 _batchId)` function.\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L155-L159\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L97-L99\n\n## Wrong require description in SmartAccount contract\n\nLine 171 reads \"Invalid Entrypoint\", but the check belongs to the \"handler\" variable.\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L171\n\n\n## Dedupe code between `handlePayment` and `handlePaymentRevert` functions\n\nMost of the code is duplicated in both functions. Consider extracting common functionality to an internal function.\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L247-L269\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-", "vulnerable_code": "bytes memory deploymentData = abi.encodePacked(type(Proxy).creationCode, abi.encode(_defaultImpl));", "fixed_code": "function onERC721Received(\n address,\n address,\n uint256,\n bytes calldata\n) external pure override returns (bytes4) {\n return ERC721TokenReceiver.onERC721Received.selector;\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/adriro-Q.md", "collected_at": "2026-01-02T18:13:29.247780+00:00", "source_hash": "d1384aba70c744d7347ff5cea460e003dab8debf48e50963afe7be2bf663151f", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SmartAccount.sol#L93-L103, SmartAccount.sol#L140-L147, SmartAccount.sol#L155-L159, SmartAccount.sol#L97-L99, SmartAccount.sol#L171, SmartAccount.sol#L247-L269", "github_files_list": "SmartAccount.sol", "github_refs_count": 6, "vulnerable_code_actual": "bytes memory deploymentData = abi.encodePacked(type(Proxy).creationCode, abi.encode(_defaultImpl));", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function onERC721Received(\n address,\n address,\n uint256,\n bytes calldata\n) external pure override returns (bytes4) {\n return ERC721TokenReceiver.onERC721Received.selector;\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "08-dopex", "title": "0xAadi Q", "severity_raw": "Critical", "severity": "critical", "description": "# [L-01] Checking `MINTER` access control twice in `mint()` function\n\nThe `mint()` function performs a double verification of the MINTER access control. This is by through the use of both the `onlyRole(MINTER_ROLE)` modifier and the `require(hasRole(MINTER_ROLE, msg.sender))` statement. Consequently, the message \"Caller is not a minter\" will never be triggered. \n\nThere is 1 instances of this issue:\n\nFile: contracts/decaying-bonds/RdpxDecayingBonds.sol\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/decaying-bonds/RdpxDecayingBonds.sol#L114C3-L125C4\n\n```solidity\n function mint(\n address to,\n uint256 expiry,\n uint256 rdpxAmount\n ) external onlyRole(MINTER_ROLE) {\n _whenNotPaused();\n require(hasRole(MINTER_ROLE, msg.sender), \"Caller is not a minter\");\n uint256 bondId = _mintToken(to);\n bonds[bondId] = Bond(to, expiry, rdpxAmount);\n\n\n emit BondMinted(to, bondId, expiry, rdpxAmount);\n }\n```\n\n### Tool Used\n\nManual Review\n\n### Recommendation\n\nThe require statement can be removed.\n\n# [L-02] `emergencyWithdraw()` can be reverted if `to` address is a contract that does not implement the `receive()`\n\nThe `emergencyWithdraw()` function will be reverted the native coin transfer if the recipient `to` address is a contract that does not implement the `receive()` function. This restriction, in turn, limits the emergency withdrawal of ERC20 coins from the `RdpxDecayingBonds` contract.\n\nThere is 1 instance of this issue:\n\nFile: contracts/decaying-bonds/RdpxDecayingBonds.sol\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/decaying-bonds/RdpxDecayingBonds.sol#L89C1-L107C4\n\n### Tool Used\n\nManual Review\n\n### Recommendation\n\nImplement code to check the `to` address is contract address or not\n\n# [L-03] There are several setter functions that do not check if the amount is greater than 100%.\n\nThere is 8 instance of this issue:\n\nFile: contracts/core/RdpxV2Core.s", "vulnerable_code": " function mint(\n address to,\n uint256 expiry,\n uint256 rdpxAmount\n ) external onlyRole(MINTER_ROLE) {\n _whenNotPaused();\n require(hasRole(MINTER_ROLE, msg.sender), \"Caller is not a minter\");\n uint256 bondId = _mintToken(to);\n bonds[bondId] = Bond(to, expiry, rdpxAmount);\n\n\n emit BondMinted(to, bondId, expiry, rdpxAmount);\n }", "fixed_code": "emit LogBond(rdpxRequired, wethRequired, receiptTokenAmount);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/0xAadi-Q.md", "collected_at": "2026-01-02T18:24:13.233755+00:00", "source_hash": "d1460a83b176c54134db2bbd619a1b835c473acd3dbbd26c9c9854ecaf4dcdb0", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 351, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function mint(\n address to,\n uint256 expiry,\n uint256 rdpxAmount\n ) external onlyRole(MINTER_ROLE) {\n _whenNotPaused();\n require(hasRole(MINTER_ROLE, msg.sender), \"Caller is not a minter\");\n uint256 bondId = _mintToken(to);\n bonds[bondId] = Bond(to, expiry, rdpxAmount);\n\n\n emit BondMinted(to, bondId, expiry, rdpxAmount);\n }", "primary_code_language": "solidity", "primary_code_char_count": 351, "all_code_blocks": "// Code block 1 (solidity):\nfunction mint(\n address to,\n uint256 expiry,\n uint256 rdpxAmount\n ) external onlyRole(MINTER_ROLE) {\n _whenNotPaused();\n require(hasRole(MINTER_ROLE, msg.sender), \"Caller is not a minter\");\n uint256 bondId = _mintToken(to);\n bonds[bondId] = Bond(to, expiry, rdpxAmount);\n\n\n emit BondMinted(to, bondId, expiry, rdpxAmount);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function mint(\n address to,\n uint256 expiry,\n uint256 rdpxAmount\n ) external onlyRole(MINTER_ROLE) {\n _whenNotPaused();\n require(hasRole(MINTER_ROLE, msg.sender), \"Caller is not a minter\");\n uint256 bondId = _mintToken(to);\n bonds[bondId] = Bond(to, expiry, rdpxAmount);\n\n\n emit BondMinted(to, bondId, expiry, rdpxAmount);\n }", "github_refs_formatted": "RdpxDecayingBonds.sol#L114-L3, RdpxDecayingBonds.sol#L89-L1", "github_files_list": "RdpxDecayingBonds.sol", "github_refs_count": 2, "vulnerable_code_actual": " function mint(\n address to,\n uint256 expiry,\n uint256 rdpxAmount\n ) external onlyRole(MINTER_ROLE) {\n _whenNotPaused();\n require(hasRole(MINTER_ROLE, msg.sender), \"Caller is not a minter\");\n uint256 bondId = _mintToken(to);\n bonds[bondId] = Bond(to, expiry, rdpxAmount);\n\n\n emit BondMinted(to, bondId, expiry, rdpxAmount);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "emit LogBond(rdpxRequired, wethRequired, receiptTokenAmount);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "11-kelp", "title": "Shawon Q", "severity_raw": "Gas", "severity": "gas", "description": "# Use a hardcoded address instead of address(this)\n\nIt can be more gas-efficient to use a hardcoded address instead of the address(this) expression, \nespecially if you need to use the same address multiple times in your contract.\n\nThe reason for this is that using address(this) requires an additional EXTCODESIZE operation to retrieve the contract\u2019s address from its bytecode,\n which can increase the gas cost of your contract. By pre-calculating and using a hardcoded address,\n you can avoid this additional operation and reduce the overall gas cost of your contract.\n\n``` solidity\nfile: src/NodeDelegator.sol\n\n63 uint256 balance = token.balanceOf(address(this));\n\n103 IEigenStrategyManager(eigenlayerStrategyManagerAddress).getDeposits(address(this));\n\n111 assetBalances[i] = IStrategy(strategies[i]).userUnderlyingView(address(this));\n \n123 return IStrategy(strategy).userUnderlyingView(address(this));\n\n```\n\n # If already paused/unpaused, revert.\n\n``` solidity\nfile: utils/LRTDeposit.sol \n\n 207 /// @dev Triggers stopped state. Contract must not be paused.\n 208 function pause() external onlyLRTManager {\n 209 _pause();\n 210 }\n\n 212 /// @dev Returns to normal state. Contract must be paused\n 213 function unpause() external onlyLRTAdmin {\n 214 _unpause();\n 215 }\n\n```\nthe dev comments states that the paused function must be called when it is not already paused, Same with the unpaused function.\nBut we see no such checks inside those functions to check if the contracted has already been paused by another LRTManager before\nexecuting the function.\n\nRecommending to add :\n\n``` solidity\nfunction pause() external onlyLRTManager {\n if (paused=true){\nrevert };\n... \n\n```\n\n``` solidity\n function unpause() external onlyLRTAdmin {\n if (unpaused=true){\nrevert };\n...\n\n```\n\nInstances: `NodeDelegator.sol` , `LRTOracle.sol` , `RSETH.sols`", "vulnerable_code": " # If already paused/unpaused, revert.\n", "fixed_code": "the dev comments states that the paused function must be called when it is not already paused, Same with the unpaused function.\nBut we see no such checks inside those functions to check if the contracted has already been paused by another LRTManager before\nexecuting the function.\n\nRecommending to add :\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/Shawon-Q.md", "collected_at": "2026-01-02T18:27:40.752309+00:00", "source_hash": "d146733b894beb72960b40667222fb7c7640820ae43f8b0cfb59b133934d99e6", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 340, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "# If already paused/unpaused, revert.", "primary_code_language": "unknown", "primary_code_char_count": 37, "all_code_blocks": "// Code block 1 (unknown):\n# If already paused/unpaused, revert.\n\n// Code block 2 (unknown):\nthe dev comments states that the paused function must be called when it is not already paused, Same with the unpaused function.\nBut we see no such checks inside those functions to check if the contracted has already been paused by another LRTManager before\nexecuting the function.\n\nRecommending to add :", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " # If already paused/unpaused, revert.\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "the dev comments states that the paused function must be called when it is not already paused, Same with the unpaused function.\nBut we see no such checks inside those functions to check if the contracted has already been paused by another LRTManager before\nexecuting the function.\n\nRecommending to add :\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "12-autonolas", "title": "0x11singh99 G", "severity_raw": "High", "severity": "high", "description": "**Note:** I've removed all findings instances appearing in the bot and 4naly3er reports and have only kept the ones that they missed.\n\n# Gas-Optimization for Olas Protocol\n\n## Gas Optimizations\n\n| Number | Issue | Instances |\n| ----------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------- | :-------: |\n| [[G-01](#g-01-change-the-order-of-declaration-of-state-variables-to-save-storage-slots-by-packing-tightly)] | Change the order of declaration of state variables to save storage slots by packing tightly | 1 |\n| [[G-02](#g-02-state-variables-can-be-packed-into-fewer-storage-slot-by-reducing-their-size)] | State variables can be packed into fewer storage slot by reducing their size | 1 |\n| [[G-03](#g-03-state-variables-only-set-in-the-constructor-should-be-declared-immutablemissed-by-bot)] | `State` variables only set in the `constructor` should be declared `immutable` (Missed by bot) | 1 |\n| [[G-04](#g-04-state-variables-can-be-cached-instead-of-re-reading-them-from-storage)] | `State` variables can be cached instead of re-reading them from storage | 2 |\n| [[G-05](#g-05-here-no-need-to-check-for-address0-in-constructor)] | Here no need to check for `address(0)` in `constructor` | 3 |\n| [[G-06](#g-06-cache-value-in-a-local-variable-instead-of-re-calculate)] | `Cache` value in a local variable instead of `re-calculate` | 1 |\n| [[G-07](#g-07-use-calldata-instead", "vulnerable_code": "File : lockbox-solana/solidity/liquidity_lockbox.sol\n\n27: // Current program owned PDA account address\n28: address public pdaProgram;\n29: // Bridged token mint address\n30: address public bridgedTokenMint;\n31: // PDA bridged token account address\n32: address public pdaBridgedTokenAccount;\n33: // PDA header for position account\n34: uint64 public pdaHeader = 0xd0f7407ae48fbcaa;\n35: // Program PDA seed\n36: bytes public constant pdaProgramSeed = \"pdaProgram\";\n37: // Program PDA bump\n38: bytes1 public pdaBump;\n39: int32 public constant minTickLowerIndex = -443632;\n40: int32 public constant maxTickLowerIndex = 443632;\n41:\n42: // Total number of token accounts (even those that hold no positions anymore)\n43: uint32 public numPositionAccounts;//@audit\n44: // First available account index in the set of accounts;\n45: uint32 public firstAvailablePositionAccountIndex;//@audit\n46: // Total liquidity in a lockbox\n47: uint64 public totalLiquidity;//@audit\n", "fixed_code": "## [G-02] State variables can be packed into fewer storage slot by reducing their size\n\nThe EVM works with 32 byte words. Variables less than 32 bytes can be declared next to each other in storage and this\nwill pack the values together into a single 32 byte storage slot (if the values combined are <= 32 bytes). If the\nvariables packed together are retrieved together in functions, we will effectively save ~2000 gas with every subsequent\nSLOAD for that storage slot. This is due to us incurring a Gwarmaccess (100 gas) versus a Gcoldsload (2100 gas).\n\nIf variables occupying the same slot are both written the same function or by the constructor, avoids a separate Gsset\n(20000 gas). Reads of the variables can also be cheaper\n\n_1 Instance_\n\n### After reducing size of `_locked` from `uint256` to `uint8`, it can be packed with `address manager` in single SLOT :`SAVES 2000 GAS`, `1 SLOT`\n\nReduce uint type of `_locked` from `uint256` to `uint8` and pack with `address manager` because `_locked` can have only two values `1` and `2` assigned in `UnitRegistry::create` function at the [line-56](https://github.com/code-423n4/2023-12-autonolas/blob/main/registries/contracts/UnitRegistry.sol#L56) and at [line-113](https://github.com/code-423n4/2023-12-autonolas/blob/main/registries/contracts/UnitRegistry.sol#L113) . Since `GenericRegistry.sol` is inherited by `UnitRegistry.sol`. At the time of declaration also 1 is assigned in `_locked`.\n\n### So `uint8` is more than enough to hold these values\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-12-autonolas-findings/blob/main/data/0x11singh99-G.md", "collected_at": "2026-01-02T18:28:34.867767+00:00", "source_hash": "d14dd736e001ee5ba08e69708551c6827d413d67004b11eca37c078812286f6f", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "UnitRegistry.sol#L56, UnitRegistry.sol#L113", "github_files_list": "UnitRegistry.sol", "github_refs_count": 2, "vulnerable_code_actual": "File : lockbox-solana/solidity/liquidity_lockbox.sol\n\n27: // Current program owned PDA account address\n28: address public pdaProgram;\n29: // Bridged token mint address\n30: address public bridgedTokenMint;\n31: // PDA bridged token account address\n32: address public pdaBridgedTokenAccount;\n33: // PDA header for position account\n34: uint64 public pdaHeader = 0xd0f7407ae48fbcaa;\n35: // Program PDA seed\n36: bytes public constant pdaProgramSeed = \"pdaProgram\";\n37: // Program PDA bump\n38: bytes1 public pdaBump;\n39: int32 public constant minTickLowerIndex = -443632;\n40: int32 public constant maxTickLowerIndex = 443632;\n41:\n42: // Total number of token accounts (even those that hold no positions anymore)\n43: uint32 public numPositionAccounts;//@audit\n44: // First available account index in the set of accounts;\n45: uint32 public firstAvailablePositionAccountIndex;//@audit\n46: // Total liquidity in a lockbox\n47: uint64 public totalLiquidity;//@audit\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## [G-02] State variables can be packed into fewer storage slot by reducing their size\n\nThe EVM works with 32 byte words. Variables less than 32 bytes can be declared next to each other in storage and this\nwill pack the values together into a single 32 byte storage slot (if the values combined are <= 32 bytes). If the\nvariables packed together are retrieved together in functions, we will effectively save ~2000 gas with every subsequent\nSLOAD for that storage slot. This is due to us incurring a Gwarmaccess (100 gas) versus a Gcoldsload (2100 gas).\n\nIf variables occupying the same slot are both written the same function or by the constructor, avoids a separate Gsset\n(20000 gas). Reads of the variables can also be cheaper\n\n_1 Instance_\n\n### After reducing size of `_locked` from `uint256` to `uint8`, it can be packed with `address manager` in single SLOT :`SAVES 2000 GAS`, `1 SLOT`\n\nReduce uint type of `_locked` from `uint256` to `uint8` and pack with `address manager` because `_locked` can have only two values `1` and `2` assigned in `UnitRegistry::create` function at the [line-56](https://github.com/code-423n4/2023-12-autonolas/blob/main/registries/contracts/UnitRegistry.sol#L56) and at [line-113](https://github.com/code-423n4/2023-12-autonolas/blob/main/registries/contracts/UnitRegistry.sol#L113) . Since `GenericRegistry.sol` is inherited by `UnitRegistry.sol`. At the time of declaration also 1 is assigned in `_locked`.\n\n### So `uint8` is more than enough to hold these values\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "03-revert-lend", "title": "albahaca G", "severity_raw": "High", "severity": "high", "description": "## Use assembly for math (add, sub, mul, div)\nUse assembly for math instead of Solidity. You can check for overflow/underflow in assembly to ensure safety.\n\n\n### Befor\n| src/InterestRateModel.sol:InterestRateModel contract | | | | | |\n|------------------------------------------------------|-----------------|------|--------|------|---------|\n| Deployment Cost | Deployment Size | | | | |\n| 415204 | 2390 | | | | |\n| Function Name | min | avg | median | max | # calls |\n| getUtilizationRateX96 | 387 | 535 | 609 | 609 | 3 |\n```solidity\n50 return debt * Q96 / (cash + debt);\n```\nhttps://github.com/code-423n4/2024-03-revert-lend/blob/main/src/InterestRateModel.sol#L50\n\n\n### After\n| src/InterestRateModel.sol:InterestRateModel contract | | | | | |\n|------------------------------------------------------|-----------------|------|--------|------|---------|\n| Deployment Cost | Deployment Size | | | | |\n| 410404 | 2366 | | | | |\n| Function Name | min | avg | median | max | # calls |\n| getUtilizationRateX96 | 387 | 399 | 405 | 405 | 3 |\n\n\n```diff\n function getUtilizationRateX96(uint256 cash, uint256 debt) public pure returns (uint256) {\n if (debt == 0) {\n return 0;\n }\n- return debt * Q96 / (cash + debt);\n+ uint256 result;\n+ assembly {\n+ // Calculate debt * Q96\n+ let debtQ96 := mul(debt, Q96)\n\n+ // Calculate cash + debt\n+ let", "vulnerable_code": "50 return debt * Q96 / (cash + debt);", "fixed_code": "### Befor\n| src/InterestRateModel.sol:InterestRateModel contract | | | | | |\n|------------------------------------------------------|-----------------|------|--------|------|---------|\n| Deployment Cost | Deployment Size | | | | |\n| 410404 | 2366 | | | | |\n| Function Name | min | avg | median | max | # calls |\n| getRatesPerSecondX96 | 1251 | 3766 | 1251 | 7251 | 44 |\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/albahaca-G.md", "collected_at": "2026-01-02T19:03:06.868333+00:00", "source_hash": "d1b9c481b775e97c3aae1f37e1ca06f294140c1a3fda0ca55be23b2cff2f84c8", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 39, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "50 return debt * Q96 / (cash + debt);", "primary_code_language": "solidity", "primary_code_char_count": 39, "all_code_blocks": "// Code block 1 (solidity):\n50 return debt * Q96 / (cash + debt);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "50 return debt * Q96 / (cash + debt);", "github_refs_formatted": "InterestRateModel.sol#L50", "github_files_list": "InterestRateModel.sol", "github_refs_count": 1, "vulnerable_code_actual": "50 return debt * Q96 / (cash + debt);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "### Befor\n| src/InterestRateModel.sol:InterestRateModel contract | | | | | |\n|------------------------------------------------------|-----------------|------|--------|------|---------|\n| Deployment Cost | Deployment Size | | | | |\n| 410404 | 2366 | | | | |\n| Function Name | min | avg | median | max | # calls |\n| getRatesPerSecondX96 | 1251 | 3766 | 1251 | 7251 | 44 |\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "04-caviar", "title": "DadeKuma Q", "severity_raw": "Critical", "severity": "critical", "description": "\n## Summary\n\n---\n\n### Low Findings\n|Id|Title|Instances|\n|:--:|:-------|:--:|\n|[L-01]| Solmate's SafeTransferLib doesn't check whether the ERC20 contract exists | 24 |\n|[L-02]| Lack of two-step update for critical addresses | 2 |\n|[L-03]| Loss of precision on division | 1 |\n|[L-04]| Missing events in sensitive functions | 4 |\n|[L-05]| Gas griefing/theft is possible on an unsafe external call | 1 |\n|[L-06]| Unused/empty `receive()`/`fallback()` function | 3 |\n\nTotal: 35 instances over 6 issues.\n\n### Non Critical Findings\n|Id|Title|Instances|\n|:--:|:-------|:--:|\n|[NC-01]| Use of `abi.encodePacked` instead of `bytes.concat` | 7 |\n|[NC-02]| Parameter omission in events | 5 |\n|[NC-03]| Some functions don't follow the Solidity naming conventions | 1 |\n|[NC-04]| Use of floating pragma | 5 |\n\nTotal: 18 instances over 4 issues.\n\n## Low Findings\n\n---\n\n### [L-01] Solmate's SafeTransferLib doesn't check whether the ERC20 contract exists\n\nSolmate's SafeTransferLib, which is often used to interact with non-compliant/unsafe ERC20 tokens, does not check whether the ERC20 contract exists. The following code will not revert in case the token doesn\u2019t exist (yet).\nThis is stated in the [Solmate library](https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol#L9).\n\n*There are 24 instances of this issue.*\n\n
\nExpand findings\n\n[src/EthRouter.sol#L123](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L123)\n\n[src/EthRouter.sol#L142](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L142)\n\n[src/EthRouter.sol#L190](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L190)\n\n[src/EthRouter.sol#L208](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L208)\n\n[src/EthRouter.sol#L291](https://github.com/code-423n4/20", "vulnerable_code": "File: src/EthRouter.sol\n\n123: \t\t royaltyRecipient.safeTransferETH(royaltyFee);\n\n142: \t\t msg.sender.safeTransferETH(address(this).balance);\n\n190: \t\t royaltyRecipient.safeTransferETH(royaltyFee);\n\n208: \t\t msg.sender.safeTransferETH(address(this).balance);\n\n291: \t\t msg.sender.safeTransferETH(address(this).balance);\n", "fixed_code": "File: src/Factory.sol\n\n112: \t\t address(privatePool).safeTransferETH(baseTokenAmount);\n\n150: \t\t msg.sender.safeTransferETH(amount);\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/DadeKuma-Q.md", "collected_at": "2026-01-02T18:19:35.892738+00:00", "source_hash": "d1f861713d7be4cce8b256bc177a7021d43b331a23ba0554919560ef24fb5692", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafeTransferLib.sol#L9, EthRouter.sol#L123, EthRouter.sol#L142, EthRouter.sol#L190, EthRouter.sol#L208", "github_files_list": "EthRouter.sol, SafeTransferLib.sol", "github_refs_count": 5, "vulnerable_code_actual": "File: src/EthRouter.sol\n\n123: \t\t royaltyRecipient.safeTransferETH(royaltyFee);\n\n142: \t\t msg.sender.safeTransferETH(address(this).balance);\n\n190: \t\t royaltyRecipient.safeTransferETH(royaltyFee);\n\n208: \t\t msg.sender.safeTransferETH(address(this).balance);\n\n291: \t\t msg.sender.safeTransferETH(address(this).balance);\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: src/Factory.sol\n\n112: \t\t address(privatePool).safeTransferETH(baseTokenAmount);\n\n150: \t\t msg.sender.safeTransferETH(amount);\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "11-kelp", "title": "0xbrett8571 Analysis", "severity_raw": "Critical", "severity": "critical", "description": "\n![kel](https://github.com/code-423n4/2023-11-canto/assets/125544245/8468335f-eaf2-4fb8-856d-0a697886bc50)\n\nKelp aims to provide liquidity rewards for staked ETH assets by integrating with the EigenLayer protocol. It consists of core contracts for configuration, deposits, delegating to strategies, pricing, and receipt tokens. \n\nI reviewed the contracts through manual analysis, focused on security, intended behavior, and integration.\n\n[LRTConfig](https://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTConfig.sol): An upgradeable contract which is responsible for storing the configuration of the Kelp product. It is also responsible for storing the addresses of the other contracts in the Kelp product.\n\n[LRTDepositPool](https://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol): An upgradeable contract which receives the funds deposited by users into the Kelp product. From here, the funds are transferred to [NodeDelegator](https://github.com/code-423n4/2023-11-kelp/blob/main/src/NodeDelegator.sol)s contracts.\n\nNodeDelegator: These are contracts that receive funds from the LRDepositPool and delegate them to the EigenLayer strategy. The funds are then used to provide liquidity on the EigenLayer protocol. It is also an upgradeable contract.\n\n[LRTOracle](https://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTOracle.sol): An upgradeable contract which is responsible for fetching the price of Liquid Stasking Tokens tokens from oracle services.\n\n[RSETH](https://github.com/code-423n4/2023-11-kelp/blob/main/src/RSETH.sol): Receipt token for depositing into the Kelp product. It is an upgradeable ERC20 token contract.\n\n**Scope**\n\n| Contract | Purpose | SLOC | Libraries Used |\n|-----------------------|----------------------------------------------------------------|------|----------------------------|\n| [LRTConfig](https://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTCon", "vulnerable_code": "**Key Points**\n\n- LRTConfig stores addresses and parameters for other contracts\n- LRTDepositPool is the frontend for user deposits \n- It mints RSETH tokens in sync with deposits\n- NodeDelegator receives assets from LRTDepositPool and delegates to strategies\n- LRTOracle provides pricing data to the system\n- Modular architecture allows flexibility and separation of concerns\n\nThe core dependency is the unified configuration in LRTConfig, which must be secure and authorize only valid contract addresses.\n\n**LRTConfig**\n\nThe LRTConfig contract is relied upon by other contracts for address lookups via the [`getContract`](https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTConfig.sol#L131-L133) and `getToken` functions:\n", "fixed_code": "```js\n// Example usage in LRTDepositPool\naddress lrtOracle = LRTConfig.getContract(LRT_ORACLE);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/0xbrett8571-Analysis.md", "collected_at": "2026-01-02T18:27:13.660904+00:00", "source_hash": "d2083364578dc6592f6ce7d6c6f78d01abc6f58d6c680e2c0058dfe94a25ed3e", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LRTConfig.sol, LRTDepositPool.sol, NodeDelegator.sol, LRTOracle.sol, RSETH.sol, LRTConfig.sol#L131-L133", "github_files_list": "LRTOracle.sol, RSETH.sol, NodeDelegator.sol, LRTConfig.sol, LRTDepositPool.sol", "github_refs_count": 6, "vulnerable_code_actual": "**Key Points**\n\n- LRTConfig stores addresses and parameters for other contracts\n- LRTDepositPool is the frontend for user deposits \n- It mints RSETH tokens in sync with deposits\n- NodeDelegator receives assets from LRTDepositPool and delegates to strategies\n- LRTOracle provides pricing data to the system\n- Modular architecture allows flexibility and separation of concerns\n\nThe core dependency is the unified configuration in LRTConfig, which must be secure and authorize only valid contract addresses.\n\n**LRTConfig**\n\nThe LRTConfig contract is relied upon by other contracts for address lookups via the [`getContract`](https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTConfig.sol#L131-L133) and `getToken` functions:\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "```js\n// Example usage in LRTDepositPool\naddress lrtOracle = LRTConfig.getContract(LRT_ORACLE);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "11-kelp", "title": "ABAIKUNANBAEV Q", "severity_raw": "Low", "severity": "low", "description": "# Low-level issues\n\n## Finding Summary \n\n| ID | Description | Severity |\n| - | - | :-: |\n| [L-01](#l-01-relience-on-total-supply) | Reliance on `totalSupply()` in `getRSETHPrice()` makes it susceptible to front-running attacks and manipulations | Low |\n\n\n## [L-01] Reliance on `totalSupply()` in `getRSETHPrice()` makes it susceptible to front-running attacks and manipulations\n\nInside of `LRTOracle.sol` the price of rsETH is determined by `totalETHInPool and `rsEthSupply`:\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTOracle.sol#L78\n```\nreturn totalETHInPool / rsEthSupply;\n\n```\n\nThe problem is that the `rsEthSupply` can be easily manipulated and, therefore, the `getRsETHAmountToMint()` will be influenced as well:\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L109\n\n```\nrsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();\n```\n\nPossible mitigation: consider using already existing oracles instead of implementing the new one.", "vulnerable_code": "return totalETHInPool / rsEthSupply;\n", "fixed_code": "rsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/ABAIKUNANBAEV-Q.md", "collected_at": "2026-01-02T18:27:18.709554+00:00", "source_hash": "d209d6bdd9f99350ef9dde23b17c2e1f7d3388b0811cb1566d4a1132d074080f", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 126, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "return totalETHInPool / rsEthSupply;", "primary_code_language": "unknown", "primary_code_char_count": 36, "all_code_blocks": "// Code block 1 (unknown):\nreturn totalETHInPool / rsEthSupply;\n\n// Code block 2 (unknown):\nrsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LRTOracle.sol#L78, LRTDepositPool.sol#L109", "github_files_list": "LRTOracle.sol, LRTDepositPool.sol", "github_refs_count": 2, "vulnerable_code_actual": "return totalETHInPool / rsEthSupply;\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "rsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7.03} {"source": "c4", "protocol": "01-ondo", "title": "immeas Q", "severity_raw": "Low", "severity": "low", "description": "# low\n\n## L-1 incorrect comment or check\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L408\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L413\n\n```javascript\nFile: cash/CashManager.sol\n\n408: * @dev The maximum fee that can be set is 10_000 bps, or 100%\n```\n\nIf you look at the check it does `_mintFee >= BPS_DENOMINATOR`:\n\n```javascript\nFile: cash/CashManager.sol\n\n413: if (_mintFee >= BPS_DENOMINATOR) {\n414: revert MintFeeTooLarge();\n415: }\n```\n\nSo the maximum `mintFee` is `9999`, 99.99%", "vulnerable_code": "File: cash/CashManager.sol\n\n408: * @dev The maximum fee that can be set is 10_000 bps, or 100%", "fixed_code": "File: cash/CashManager.sol\n\n413: if (_mintFee >= BPS_DENOMINATOR) {\n414: revert MintFeeTooLarge();\n415: }", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/immeas-Q.md", "collected_at": "2026-01-02T18:15:14.745381+00:00", "source_hash": "d23c8c24a63382dd5c528b55fe17172811bd2222e33064f6c0044929461ecd54", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 213, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: cash/CashManager.sol\n\n408: * @dev The maximum fee that can be set is 10_000 bps, or 100%", "primary_code_language": "javascript", "primary_code_char_count": 97, "all_code_blocks": "// Code block 1 (javascript):\nFile: cash/CashManager.sol\n\n408: * @dev The maximum fee that can be set is 10_000 bps, or 100%\n\n// Code block 2 (javascript):\nFile: cash/CashManager.sol\n\n413: if (_mintFee >= BPS_DENOMINATOR) {\n414: revert MintFeeTooLarge();\n415: }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CashManager.sol#L408, CashManager.sol#L413", "github_files_list": "CashManager.sol", "github_refs_count": 2, "vulnerable_code_actual": "File: cash/CashManager.sol\n\n408: * @dev The maximum fee that can be set is 10_000 bps, or 100%", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: cash/CashManager.sol\n\n413: if (_mintFee >= BPS_DENOMINATOR) {\n414: revert MintFeeTooLarge();\n415: }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6.16} {"source": "c4", "protocol": "06-lybra", "title": "Timenov G", "severity_raw": "Unknown", "severity": "unknown", "description": "# Lybra Finance report by Timenov\n\n## Summary\nG-01 Use `constant` for variables that will not be changed in the future.\n\n### [G-01] Use `constant` for variables that will not be changed in the future.\n*There are 2 instances of this issue.*\n\n```solidity\nFile: contracts/lybra/token/esLBR.sol\n\n20: uint256 maxSupply = 100_000_000 * 1e18;\n```\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/token/esLBR.sol#L20C5-L20C44\n\n```solidity\nFile: contracts/lybra/token/LBR.sol\n\n15: uint256 maxSupply = 100_000_000 * 1e18;\n```\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/token/LBR.sol#L15", "vulnerable_code": "File: contracts/lybra/token/esLBR.sol\n\n20: uint256 maxSupply = 100_000_000 * 1e18;", "fixed_code": "File: contracts/lybra/token/LBR.sol\n\n15: uint256 maxSupply = 100_000_000 * 1e18;", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/Timenov-G.md", "collected_at": "2026-01-02T18:22:47.637401+00:00", "source_hash": "d2489bae613a4edd34ad184e020e948d0759562119b95f3d927b960193ee3eb9", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 162, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/lybra/token/esLBR.sol\n\n20: uint256 maxSupply = 100_000_000 * 1e18;", "primary_code_language": "solidity", "primary_code_char_count": 82, "all_code_blocks": "// Code block 1 (solidity):\nFile: contracts/lybra/token/esLBR.sol\n\n20: uint256 maxSupply = 100_000_000 * 1e18;\n\n// Code block 2 (solidity):\nFile: contracts/lybra/token/LBR.sol\n\n15: uint256 maxSupply = 100_000_000 * 1e18;", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: contracts/lybra/token/esLBR.sol\n\n20: uint256 maxSupply = 100_000_000 * 1e18;\n\nFile: contracts/lybra/token/LBR.sol\n\n15: uint256 maxSupply = 100_000_000 * 1e18;", "github_refs_formatted": "esLBR.sol#L20-L5, LBR.sol#L15", "github_files_list": "esLBR.sol, LBR.sol", "github_refs_count": 2, "vulnerable_code_actual": "File: contracts/lybra/token/esLBR.sol\n\n20: uint256 maxSupply = 100_000_000 * 1e18;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/lybra/token/LBR.sol\n\n15: uint256 maxSupply = 100_000_000 * 1e18;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6.4} {"source": "c4", "protocol": "04-caviar", "title": "report", "severity_raw": "Critical", "severity": "critical", "description": "---\nsponsor: \"Caviar\"\nslug: \"2023-04-caviar\"\ndate: \"2023-05-18\"\ntitle: \"Caviar Private Pools\"\nfindings: \"https://github.com/code-423n4/2023-04-caviar-findings/issues\"\ncontest: 230\n---\n\n# Overview\n\n## About C4\n\nCode4rena (C4) is an open organization consisting of security researchers, auditors, developers, and individuals with domain expertise in smart contracts.\n\nA C4 audit is an event in which community participants, referred to as Wardens, review, audit, or analyze smart contract logic in exchange for a bounty provided by sponsoring projects.\n\nDuring the audit outlined in this document, C4 conducted an analysis of the Caviar Private Pools smart contract system written in Solidity. The audit took place between April 7\u2014April 13 2023.\n\nFollowing the C4 audit, 3 wardens (rvierdiiev, rbserver, and KrisApostolov) reviewed the mitigations for all identified issues; the mitigation review report is appended below the audit report.\n\n*Note: This published report was updated on August 28, 2023 to include the mitigation review results.*\n\n## Wardens\n\n127 Wardens contributed reports to the Caviar Private Pools:\n\n 1. 0x4db5362c\n 2. 0x4non\n 3. 0x5rings\n 4. [0x6980](https://twitter.com/0x6980)\n 5. [0xAgro](https://twitter.com/0xAgro)\n 6. [0xLanterns](https://twitter.com/Kiki_developer) ([kiki_dev](https://twitter.com/Kiki_developer) and [wall604](https://twitter.com/ZoumanaCisse6))\n 7. 0xNorman\n 8. 0xRobocop\n 9. [0xSmartContract](https://twitter.com/0xSmartContract)\n 10. [0xTheC0der](https://twitter.com/MarioPoneder)\n 11. 0xWeiss\n 12. 0xbepresent\n 13. [ABA](https://twitter.com/abarbatei)\n 14. [AkshaySrivastav](https://twitter.com/akshaysrivastv)\n 15. [Aymen0909](https://github.com/Aymen1001)\n 16. Bason\n 17. [Bauchibred](https://twitter.com/bauchibred?s=21&t=7sv-1qcnwtkdTA81Iog0yQ )\n 18. Bauer\n 19. BenRai\n 20. BradMoon\n 21. Brenzee\n 22. ChrisTina\n 23. CodingNameKiki\n 24. [Cryptor](https://twitter.com/DeFiCast)\n 25. [DadeKuma](https://twitter.co", "vulnerable_code": " #buy(uint256[],uint256[],MerkleMultiProof)\n\n271: if (payRoyalties) {\n ...\n274: (uint256 royaltyFee, address recipient) = _getRoyalty(tokenIds[i], salePrice);\n ...\n278: if (baseToken != address(0)) {\n279: ERC20(baseToken).safeTransfer(recipient, royaltyFee);\n280: } else {\n281: recipient.safeTransferETH(royaltyFee);\n282: }", "fixed_code": " #sell(uint256[],uint256[],MerkleMultiProof,IStolenNftOracle.Message[])\n\n329: for (uint256 i = 0; i < tokenIds.length; i++) {\n ...\n333: if (payRoyalties) {\n ...\n338: (uint256 royaltyFee, address recipient) = _getRoyalty(tokenIds[i], salePrice);\n ...\n345: if (baseToken != address(0)) {\n346: ERC20(baseToken).safeTransfer(recipient, royaltyFee);\n347: } else {\n348: recipient.safeTransferETH(royaltyFee);\n349: }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/report.md", "collected_at": "2026-01-02T18:20:46.372791+00:00", "source_hash": "d24f8513381fc3138ca3411ee6345adf7b55132daf3292315e2ab3dfc7fd75b3", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " #buy(uint256[],uint256[],MerkleMultiProof)\n\n271: if (payRoyalties) {\n ...\n274: (uint256 royaltyFee, address recipient) = _getRoyalty(tokenIds[i], salePrice);\n ...\n278: if (baseToken != address(0)) {\n279: ERC20(baseToken).safeTransfer(recipient, royaltyFee);\n280: } else {\n281: recipient.safeTransferETH(royaltyFee);\n282: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " #sell(uint256[],uint256[],MerkleMultiProof,IStolenNftOracle.Message[])\n\n329: for (uint256 i = 0; i < tokenIds.length; i++) {\n ...\n333: if (payRoyalties) {\n ...\n338: (uint256 royaltyFee, address recipient) = _getRoyalty(tokenIds[i], salePrice);\n ...\n345: if (baseToken != address(0)) {\n346: ERC20(baseToken).safeTransfer(recipient, royaltyFee);\n347: } else {\n348: recipient.safeTransferETH(royaltyFee);\n349: }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "04-caviar", "title": "decade G", "severity_raw": "Unknown", "severity": "unknown", "description": "#### 1. No need for arguments in flashFee function:\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L750-L752\n```\n function flashFee(address, uint256) public view returns (uint256) {\n return changeFee;\n }\n```\n___\n#### 2. Recursive calculation in _buy_ function can be avoided. \n (netInputAmount - feeAmount - protocolFeeAmount) can be stored in one variable instead of calculating recursively. \nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L229-L236\n```\n@@ -227,13 +227,14 @@ contract PrivatePool is ERC721TokenReceiver {\n // ~~~ Effects ~~~ //\n\n // update the virtual reserves\n- virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n+ uint addReserves = netInputAmount - feeAmount - protocolFeeAmount;\n+ virtualBaseTokenReserves += uint128(addReserves);\n virtualNftReserves -= uint128(weightSum);\n\n // ~~~ Interactions ~~~ //\n\n // calculate the sale price (assume it's the same for each NFT even if weights differ)\n- uint256 salePrice = (netInputAmount - feeAmount - protocolFeeAmount) / tokenIds.length;\n+ uint256 salePrice = (addReserves) / tokenIds.length;\n uint256 royaltyFeeAmount = 0;\n for (uint256 i = 0; i < tokenIds.length; i++) {\n // transfer the NFT to the caller\n```\n---\n#### 3. Static statement can be put outside FOR loop. \n`salePrice` calculated in `sell()` function can be put outside for loop instead of calculating on every iteration. \nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L335\n\n```\ndiff --git a/src/PrivatePool.sol b/src/PrivatePool.sol\n+ uint256 salePrice = (netOutputAmount + feeAmount + protocolFeeAmount) / tokenIds.length;\n uint256 royaltyFeeAmount = 0;\n for (uint256 i = 0; i < tokenIds.length; i++) {\n", "vulnerable_code": " function flashFee(address, uint256) public view returns (uint256) {\n return changeFee;\n }", "fixed_code": "@@ -227,13 +227,14 @@ contract PrivatePool is ERC721TokenReceiver {\n // ~~~ Effects ~~~ //\n\n // update the virtual reserves\n- virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n+ uint addReserves = netInputAmount - feeAmount - protocolFeeAmount;\n+ virtualBaseTokenReserves += uint128(addReserves);\n virtualNftReserves -= uint128(weightSum);\n\n // ~~~ Interactions ~~~ //\n\n // calculate the sale price (assume it's the same for each NFT even if weights differ)\n- uint256 salePrice = (netInputAmount - feeAmount - protocolFeeAmount) / tokenIds.length;\n+ uint256 salePrice = (addReserves) / tokenIds.length;\n uint256 royaltyFeeAmount = 0;\n for (uint256 i = 0; i < tokenIds.length; i++) {\n // transfer the NFT to the caller", "recommendation": "", "category": "flash-loan", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/decade-G.md", "collected_at": "2026-01-02T18:20:27.683926+00:00", "source_hash": "d26d43e1ab247e5a61dc398010939f6e6a0596555335126567431f6bf027f048", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 954, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function flashFee(address, uint256) public view returns (uint256) {\n return changeFee;\n }", "primary_code_language": "unknown", "primary_code_char_count": 99, "all_code_blocks": "// Code block 1 (unknown):\nfunction flashFee(address, uint256) public view returns (uint256) {\n return changeFee;\n }\n\n// Code block 2 (unknown):\n@@ -227,13 +227,14 @@ contract PrivatePool is ERC721TokenReceiver {\n // ~~~ Effects ~~~ //\n\n // update the virtual reserves\n- virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n+ uint addReserves = netInputAmount - feeAmount - protocolFeeAmount;\n+ virtualBaseTokenReserves += uint128(addReserves);\n virtualNftReserves -= uint128(weightSum);\n\n // ~~~ Interactions ~~~ //\n\n // calculate the sale price (assume it's the same for each NFT even if weights differ)\n- uint256 salePrice = (netInputAmount - feeAmount - protocolFeeAmount) / tokenIds.length;\n+ uint256 salePrice = (addReserves) / tokenIds.length;\n uint256 royaltyFeeAmount = 0;\n for (uint256 i = 0; i < tokenIds.length; i++) {\n // transfer the NFT to the caller", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "PrivatePool.sol#L750-L752, PrivatePool.sol#L229-L236, PrivatePool.sol#L335", "github_files_list": "PrivatePool.sol", "github_refs_count": 3, "vulnerable_code_actual": " function flashFee(address, uint256) public view returns (uint256) {\n return changeFee;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "@@ -227,13 +227,14 @@ contract PrivatePool is ERC721TokenReceiver {\n // ~~~ Effects ~~~ //\n\n // update the virtual reserves\n- virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n+ uint addReserves = netInputAmount - feeAmount - protocolFeeAmount;\n+ virtualBaseTokenReserves += uint128(addReserves);\n virtualNftReserves -= uint128(weightSum);\n\n // ~~~ Interactions ~~~ //\n\n // calculate the sale price (assume it's the same for each NFT even if weights differ)\n- uint256 salePrice = (netInputAmount - feeAmount - protocolFeeAmount) / tokenIds.length;\n+ uint256 salePrice = (addReserves) / tokenIds.length;\n uint256 royaltyFeeAmount = 0;\n for (uint256 i = 0; i < tokenIds.length; i++) {\n // transfer the NFT to the caller", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "11-kelp", "title": "DarkTower Q", "severity_raw": "Medium", "severity": "medium", "description": "### [L-01] Bytecode might not be compatible with all EVM-based chains\nThe pragma statement shows usage of 0.8.21 version of the Solidity compiler. This version (and every version after 0.8.19) will use the PUSH0 opcode, which is still not supported on some EVM-based chains, for example Arbitrum. Consider using version 0.8.19 so that the same deterministic bytecode can be deployed to all chains. \n\n### [L-02] Use of upgradeable tokens may result in improper accounting\nAccording to Eigenlayer [documentation](https://github.com/Layr-Labs/eigenlayer-contracts/blob/75e59432d079c6f90d48d4e950a68c15867c82b2/src/contracts/strategies/StrategyBase.sol#L20), the use of fee-on-transfer tokens may result in accounting issues. For a token like cbETH, which has a proxy and implementation contract, if the implementation behind the proxy is changed, it can introduce features which might cause these issues, like adding a fee on transfer. Any accounting issues on Eigenlayer will translate to the kelp protocol.\n\n### [L-03] Different price feeds decimals can cause accounting issues in `LRTDepositPool::getRsETHAmountToMint`\nAs of now, all of the supported assets have priceFeeds with 18 decimals. However, there is always a chance that in the future, there might be a new supported asset with a price feed with decimals =! 18. The calculation of the tokens to mint will be wrong as user will lose funds if decimals < 18. \nContext :\n```javascript\n function getRsETHAmountToMint(\n address asset,\n uint256 amount\n )\n public\n view\n override\n returns (uint256 rsethAmountToMint)\n {\n // setup oracle contract\n address lrtOracleAddress = lrtConfig.getContract(LRTConstants.LRT_ORACLE);\n ILRTOracle lrtOracle = ILRTOracle(lrtOracleAddress);\n\n // calculate rseth amount to mint based on asset amount and asset exchange rate\n@> rsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();\n }\n```\nTh", "vulnerable_code": " function getRsETHAmountToMint(\n address asset,\n uint256 amount\n )\n public\n view\n override\n returns (uint256 rsethAmountToMint)\n {\n // setup oracle contract\n address lrtOracleAddress = lrtConfig.getContract(LRTConstants.LRT_ORACLE);\n ILRTOracle lrtOracle = ILRTOracle(lrtOracleAddress);\n\n // calculate rseth amount to mint based on asset amount and asset exchange rate\n@> rsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();\n }", "fixed_code": "", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/DarkTower-Q.md", "collected_at": "2026-01-02T18:27:25.977766+00:00", "source_hash": "d2dac82d60e38db1ad8e9f3fb493a5f6257bff529bca3e5e6615715b93ca29f8", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 548, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function getRsETHAmountToMint(\n address asset,\n uint256 amount\n )\n public\n view\n override\n returns (uint256 rsethAmountToMint)\n {\n // setup oracle contract\n address lrtOracleAddress = lrtConfig.getContract(LRTConstants.LRT_ORACLE);\n ILRTOracle lrtOracle = ILRTOracle(lrtOracleAddress);\n\n // calculate rseth amount to mint based on asset amount and asset exchange rate\n@> rsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();\n }", "primary_code_language": "javascript", "primary_code_char_count": 548, "all_code_blocks": "// Code block 1 (javascript):\nfunction getRsETHAmountToMint(\n address asset,\n uint256 amount\n )\n public\n view\n override\n returns (uint256 rsethAmountToMint)\n {\n // setup oracle contract\n address lrtOracleAddress = lrtConfig.getContract(LRTConstants.LRT_ORACLE);\n ILRTOracle lrtOracle = ILRTOracle(lrtOracleAddress);\n\n // calculate rseth amount to mint based on asset amount and asset exchange rate\n@> rsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "StrategyBase.sol#L20", "github_files_list": "StrategyBase.sol", "github_refs_count": 1, "vulnerable_code_actual": " function getRsETHAmountToMint(\n address asset,\n uint256 amount\n )\n public\n view\n override\n returns (uint256 rsethAmountToMint)\n {\n // setup oracle contract\n address lrtOracleAddress = lrtConfig.getContract(LRTConstants.LRT_ORACLE);\n ILRTOracle lrtOracle = ILRTOracle(lrtOracleAddress);\n\n // calculate rseth amount to mint based on asset amount and asset exchange rate\n@> rsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "01-biconomy", "title": "Atarpara Q", "severity_raw": "Low", "severity": "low", "description": "\n### QA Report\n\n\n#### Q-01 Use ReentrancyGuard instead of ReentrancyGuardUpgradeable\n\n`ReentrancyGuardUpgradeable.sol` is recommend for the upgradble contract but `SmartAccount.sol` is the non-upgradable contract so use only `ReentrancyGuard.sol`.\n\n**FileName:** *scw-contract/contracts/smart-wallet-contract/SmartAccount.sol*\n\n```solidity=7\nimport \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\n```\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L7\n\n#### Q-02 Remove Duplicate Comment\n\n**FileName:** *scw-contract/contracts/smart-wallet-contract/base/Executor.sol*\n\n\n``` solidity=8\n // Could add a flag fromEntryPoint for AA txn\n event ExecutionFailure(address to, uint256 value, bytes data, Enum.Operation operation, uint256 txGas);\n event ExecutionSuccess(address to, uint256 value, bytes data, Enum.Operation operation, uint256 txGas);\n\n // Could add a flag fromEntryPoint for AA txn\n```\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/base/Executor.sol#L8-L12\n\n\n#### Q-03 Update Lastest Document Link \nSolidity current lastest docs link is https://docs.soliditylang.org/en/v0.8.17/internals/layout_in_memory.html#layout-in-memory. \n\n**FileName:** *scw-contract/contracts/smart-wallet-contract/common/SecuredTokenTransfer.sol*\n\n```solidity=20\n // We write the return value to scratch space.\n // See https://docs.soliditylang.org/en/v0.7.6/internals/layout_in_memory.html#layout-in-memory\n```\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/common/SecuredTokenTransfer.sol#L20-L21\n\n\n#### Q-04 Remove unimported Lib\nPlease remove unimported lib opeartion\n\n**FileName:** *scw-contract/contracts/smart-wallet-contract/BaseSmartAccount.sol*\n\n```solidity=34\n using UserOperationLib for UserOperation;\n```\nhttps://github.com/code-423n4/2023-01-bicon", "vulnerable_code": "https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L7\n\n#### Q-02 Remove Duplicate Comment\n\n**FileName:** *scw-contract/contracts/smart-wallet-contract/base/Executor.sol*\n\n", "fixed_code": "https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/base/Executor.sol#L8-L12\n\n\n#### Q-03 Update Lastest Document Link \nSolidity current lastest docs link is https://docs.soliditylang.org/en/v0.8.17/internals/layout_in_memory.html#layout-in-memory. \n\n**FileName:** *scw-contract/contracts/smart-wallet-contract/common/SecuredTokenTransfer.sol*\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/Atarpara-Q.md", "collected_at": "2026-01-02T18:12:53.546263+00:00", "source_hash": "d2f16cd7a93146932e642874f4ddbd661891f70f91c90fb0c1f2eed51bc5e354", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 929, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L7\n\n#### Q-02 Remove Duplicate Comment\n\n**FileName:** *scw-contract/contracts/smart-wallet-contract/base/Executor.sol*", "primary_code_language": "unknown", "primary_code_char_count": 238, "all_code_blocks": "// Code block 1 (unknown):\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L7\n\n#### Q-02 Remove Duplicate Comment\n\n**FileName:** *scw-contract/contracts/smart-wallet-contract/base/Executor.sol*\n\n// Code block 2 (unknown):\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/base/Executor.sol#L8-L12\n\n\n#### Q-03 Update Lastest Document Link \nSolidity current lastest docs link is https://docs.soliditylang.org/en/v0.8.17/internals/layout_in_memory.html#layout-in-memory. \n\n**FileName:** *scw-contract/contracts/smart-wallet-contract/common/SecuredTokenTransfer.sol*\n\n// Code block 3 (unknown):\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/common/SecuredTokenTransfer.sol#L20-L21\n\n\n#### Q-04 Remove unimported Lib\nPlease remove unimported lib opeartion\n\n**FileName:** *scw-contract/contracts/smart-wallet-contract/BaseSmartAccount.sol*", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SmartAccount.sol#L7, Executor.sol#L8-L12, SecuredTokenTransfer.sol#L20-L21", "github_files_list": "SmartAccount.sol, Executor.sol, SecuredTokenTransfer.sol", "github_refs_count": 3, "vulnerable_code_actual": "https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L7\n\n#### Q-02 Remove Duplicate Comment\n\n**FileName:** *scw-contract/contracts/smart-wallet-contract/base/Executor.sol*\n\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/base/Executor.sol#L8-L12\n\n\n#### Q-03 Update Lastest Document Link \nSolidity current lastest docs link is https://docs.soliditylang.org/en/v0.8.17/internals/layout_in_memory.html#layout-in-memory. \n\n**FileName:** *scw-contract/contracts/smart-wallet-contract/common/SecuredTokenTransfer.sol*\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "02-ai-arena", "title": "Myd Analysis", "severity_raw": "High", "severity": "high", "description": "## Overview\n\nAI Arena establishes an intricate gaming economy around tradable NFT fighters powered by machine learning models. Users battle their AIs in a decentralized PvP platform to earn token rewards.\n\n**Architecture**\n\nThe core gameplay logic resides off-chain in the game servers, which act as oracles submitting match results on-chain. Smart contracts enforce ownership, ratings, and incentive models.\n\n- [`FighterFarm`](https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/FighterFarm.sol) - Minting and metadata for NFT fighters \n- [`GameItems`](https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/GameItems.sol) - Purchase in-game assets\n- [`RankedBattles`](https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/RankedBattle.sol) - Staking, match adjudication, rewards distribution\n- [`Neuron`](https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/Neuron.sol) - ERC20 utility token for incentives\n\n```\n+----------------------------+\\\n| UI | \n+----------------------------+/\n| Front-End App |\n+----------------------------+\n| Oracle |\n| (Game Server) |\n+----------------------------+\n| |\n| Smart Contracts | \n| |\n+----------------------------+\n| EVM |\n+----------------------------+\n\\ /\n | Blockchain |\n/ \\\n+----------------+\n```\n\nThe game servers act as the oracle managing fight outcomes and rankings.\n\n**Design Patterns**\n\n- **Access Control** - Permissioned roles like MINTER manage capabilities\n- **Checks-Effects-Interactions** - State changes before transfers\n- **Oracle** - Game servers provide trusted match data \n- **Reentrancy Guard** - Reentry protection on external calls\n\n**Security Analysis**\n\n- **Custom Errors** - Precise error signaling for front-ends\n- **Input Validation** - Enforces match rules and eligibility checks\n- **Rate Limiting** - Voltage cost", "vulnerable_code": "+----------------------------+\\\n| UI | \n+----------------------------+/\n| Front-End App |\n+----------------------------+\n| Oracle |\n| (Game Server) |\n+----------------------------+\n| |\n| Smart Contracts | \n| |\n+----------------------------+\n| EVM |\n+----------------------------+\n\\ /\n | Blockchain |\n/ \\\n+----------------+", "fixed_code": "points = sqrt(stakeAmount + riskAmount) * eloMultiplier", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/Myd-Analysis.md", "collected_at": "2026-01-02T19:02:35.831562+00:00", "source_hash": "d33a00ea2e6a2821f9d9e75037a184bb8b03dfce2511eb22bf4914f858396fbf", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 507, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "+----------------------------+\\\n| UI | \n+----------------------------+/\n| Front-End App |\n+----------------------------+\n| Oracle |\n| (Game Server) |\n+----------------------------+\n| |\n| Smart Contracts | \n| |\n+----------------------------+\n| EVM |\n+----------------------------+\n\\ /\n | Blockchain |\n/ \\\n+----------------+", "primary_code_language": "unknown", "primary_code_char_count": 507, "all_code_blocks": "// Code block 1 (unknown):\n+----------------------------+\\\n| UI | \n+----------------------------+/\n| Front-End App |\n+----------------------------+\n| Oracle |\n| (Game Server) |\n+----------------------------+\n| |\n| Smart Contracts | \n| |\n+----------------------------+\n| EVM |\n+----------------------------+\n\\ /\n | Blockchain |\n/ \\\n+----------------+", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "FighterFarm.sol, GameItems.sol, RankedBattle.sol, Neuron.sol", "github_files_list": "GameItems.sol, Neuron.sol, FighterFarm.sol, RankedBattle.sol", "github_refs_count": 4, "vulnerable_code_actual": "+----------------------------+\\\n| UI | \n+----------------------------+/\n| Front-End App |\n+----------------------------+\n| Oracle |\n| (Game Server) |\n+----------------------------+\n| |\n| Smart Contracts | \n| |\n+----------------------------+\n| EVM |\n+----------------------------+\n\\ /\n | Blockchain |\n/ \\\n+----------------+", "has_vulnerable_code_snippet": true, "fixed_code_actual": "points = sqrt(stakeAmount + riskAmount) * eloMultiplier", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "10-badger", "title": "unique G", "severity_raw": "High", "severity": "high", "description": "## \\[G-01\\] >= costs less gas than >\n\nThe compiler uses opcodes GT and ISZERO for solidity code that uses >, but only requires LT for >=, which saves 3 gas\n\nThere are 13 instances of this issue:\n\n```\nFile: packages/contracts/contracts/CdpManagerStorage.sol\n512 if (_newIndex > _oldIndex && totalStakes > 0) {\n\n556 require(_newIndex > _prevIndex, \"CDPManager: only take fee with bigger new index\");\n\n585 require(activePool.getSystemCollShares() > _feeTaken, \"CDPManager: fee split is too big\");\n\n636 if (_scaledCdpColl > _feeSplitDistributed) {\n\n654 CdpOwnersArrayLength > 1 && sortedCdps.getSize() > 1,\n\n765 if (_newIndex > _oldIndex && totalStakes > 0) {\n```\n\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/CdpManagerStorage.sol#L512\n\n```\nFile: packages/contracts/contracts/LiquidationLibrary.sol\n476 if (_partialState.ICR > LICR) {\n\n553 if (_ICR > LICR) { \n\n578 if (_ICR > LICR) {\n```\n\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/LiquidationLibrary.sol#L476\n\n```\nFile: packages/contracts/contracts/SortedCdps.sol\n422 require(_len > 1, \"SortedCdps: batchRemove() only apply to multiple cdpIds!\");\n\n460 if (data.size > 1) { \n```\n\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/SortedCdps.sol#L422\n\n```\nFile: packages/contracts/contracts/Dependencies/EbtcMath.sol\n60 if (_minutes > 525600000) {\n```\n\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/Dependencies/EbtcMath.sol#L60\n\n## \\[G-02\\] Structs can be packed to use fewer storage slots\n\nThe EVM works with 32 byte words. Variables less than 32 bytes can be declared next to each other in storage and this will pack the values together into a single 32 byte storage slot (if values combined are <= 32 bytes). If the variables packed together are retrieved together in functions (more likely with structs) we will effectively save ~2000 gas with every subsequent", "vulnerable_code": "File: packages/contracts/contracts/CdpManagerStorage.sol\n512 if (_newIndex > _oldIndex && totalStakes > 0) {\n\n556 require(_newIndex > _prevIndex, \"CDPManager: only take fee with bigger new index\");\n\n585 require(activePool.getSystemCollShares() > _feeTaken, \"CDPManager: fee split is too big\");\n\n636 if (_scaledCdpColl > _feeSplitDistributed) {\n\n654 CdpOwnersArrayLength > 1 && sortedCdps.getSize() > 1,\n\n765 if (_newIndex > _oldIndex && totalStakes > 0) {", "fixed_code": "File: packages/contracts/contracts/LiquidationLibrary.sol\n476 if (_partialState.ICR > LICR) {\n\n553 if (_ICR > LICR) { \n\n578 if (_ICR > LICR) {", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/unique-G.md", "collected_at": "2026-01-02T18:27:04.655835+00:00", "source_hash": "d34683b4911cf2ec64e3b21aa58797f9c87aab4c518bb8ca667d372f5840b1e7", "code_block_count": 4, "solidity_block_count": 0, "total_code_chars": 880, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: packages/contracts/contracts/CdpManagerStorage.sol\n512 if (_newIndex > _oldIndex && totalStakes > 0) {\n\n556 require(_newIndex > _prevIndex, \"CDPManager: only take fee with bigger new index\");\n\n585 require(activePool.getSystemCollShares() > _feeTaken, \"CDPManager: fee split is too big\");\n\n636 if (_scaledCdpColl > _feeSplitDistributed) {\n\n654 CdpOwnersArrayLength > 1 && sortedCdps.getSize() > 1,\n\n765 if (_newIndex > _oldIndex && totalStakes > 0) {", "primary_code_language": "unknown", "primary_code_char_count": 469, "all_code_blocks": "// Code block 1 (unknown):\nFile: packages/contracts/contracts/CdpManagerStorage.sol\n512 if (_newIndex > _oldIndex && totalStakes > 0) {\n\n556 require(_newIndex > _prevIndex, \"CDPManager: only take fee with bigger new index\");\n\n585 require(activePool.getSystemCollShares() > _feeTaken, \"CDPManager: fee split is too big\");\n\n636 if (_scaledCdpColl > _feeSplitDistributed) {\n\n654 CdpOwnersArrayLength > 1 && sortedCdps.getSize() > 1,\n\n765 if (_newIndex > _oldIndex && totalStakes > 0) {\n\n// Code block 2 (unknown):\nFile: packages/contracts/contracts/LiquidationLibrary.sol\n476 if (_partialState.ICR > LICR) {\n\n553 if (_ICR > LICR) { \n\n578 if (_ICR > LICR) {\n\n// Code block 3 (unknown):\nFile: packages/contracts/contracts/SortedCdps.sol\n422 require(_len > 1, \"SortedCdps: batchRemove() only apply to multiple cdpIds!\");\n\n460 if (data.size > 1) {\n\n// Code block 4 (unknown):\nFile: packages/contracts/contracts/Dependencies/EbtcMath.sol\n60 if (_minutes > 525600000) {", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CdpManagerStorage.sol#L512, LiquidationLibrary.sol#L476, SortedCdps.sol#L422, EbtcMath.sol#L60", "github_files_list": "SortedCdps.sol, LiquidationLibrary.sol, EbtcMath.sol, CdpManagerStorage.sol", "github_refs_count": 4, "vulnerable_code_actual": "File: packages/contracts/contracts/CdpManagerStorage.sol\n512 if (_newIndex > _oldIndex && totalStakes > 0) {\n\n556 require(_newIndex > _prevIndex, \"CDPManager: only take fee with bigger new index\");\n\n585 require(activePool.getSystemCollShares() > _feeTaken, \"CDPManager: fee split is too big\");\n\n636 if (_scaledCdpColl > _feeSplitDistributed) {\n\n654 CdpOwnersArrayLength > 1 && sortedCdps.getSize() > 1,\n\n765 if (_newIndex > _oldIndex && totalStakes > 0) {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: packages/contracts/contracts/LiquidationLibrary.sol\n476 if (_partialState.ICR > LICR) {\n\n553 if (_ICR > LICR) { \n\n578 if (_ICR > LICR) {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "05-ajna", "title": "yjrwkk G", "severity_raw": "Unknown", "severity": "unknown", "description": "### [G-01] Use != 0 instead of > 0 for unsigned integer comparison\n\nWhen dealing with unsigned integer types, comparisons with != 0 are cheaper than with > 0. \n\n[2023-05-ajna/ajna-grants/src/grants/base/StandardFunding.sol#L129](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L129) \n```\nif (currentDistributionId > 0 && (block.number > _getChallengeStageEndBlock(currentDistributionEndBlock))) {\n```\n[2023-05-ajna/ajna-grants/src/grants/base/StandardFunding.sol#L641](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L641) \n", "vulnerable_code": "if (currentDistributionId > 0 && (block.number > _getChallengeStageEndBlock(currentDistributionEndBlock))) {", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/yjrwkk-G.md", "collected_at": "2026-01-02T18:21:52.668115+00:00", "source_hash": "d3603a990f178fcccef36a03720c60b532707c4961c80e18600d310a4eaf8ba0", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 108, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "if (currentDistributionId > 0 && (block.number > _getChallengeStageEndBlock(currentDistributionEndBlock))) {", "primary_code_language": "unknown", "primary_code_char_count": 108, "all_code_blocks": "// Code block 1 (unknown):\nif (currentDistributionId > 0 && (block.number > _getChallengeStageEndBlock(currentDistributionEndBlock))) {", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "StandardFunding.sol#L129, StandardFunding.sol#L641", "github_files_list": "StandardFunding.sol", "github_refs_count": 2, "vulnerable_code_actual": "if (currentDistributionId > 0 && (block.number > _getChallengeStageEndBlock(currentDistributionEndBlock))) {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.27} {"source": "c4", "protocol": "01-ondo", "title": "orion G", "severity_raw": "Low", "severity": "low", "description": "_becomeImplementation and _resignImplementation function from. the CCashDelegate contract consumes more unnecessary gas by the following code :\n\n```\nif (false) {\n implementation = address(0);\n }\n```\n\nthis will always be passed and will just consumes more gas, it's recommended to delete them", "vulnerable_code": "if (false) {\n implementation = address(0);\n }", "fixed_code": "", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/orion-G.md", "collected_at": "2026-01-02T18:15:25.053818+00:00", "source_hash": "d3685eaeb64e9c93ab0e06459f387304523a410c42b9d60a9e0d8a33ef1f283a", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 53, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "if (false) {\n implementation = address(0);\n }", "primary_code_language": "unknown", "primary_code_char_count": 53, "all_code_blocks": "// Code block 1 (unknown):\nif (false) {\n implementation = address(0);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "if (false) {\n implementation = address(0);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 2.6} {"source": "c4", "protocol": "07-amphora", "title": "debo Q", "severity_raw": "High", "severity": "high", "description": "## [L-01] SWC-120 Weak Sources of Randomness from Chain Attributes. Use of block number as source of randomness.\n\n# Vulnerable URLS\n```url\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L170\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L195\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L196\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L209\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L210\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L218\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L219\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L371\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L375\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L467\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L468\n```\n\n## Relationships\n```txt\nCWE-330: Use of Insufficiently Random Values\n```\n\n## Description\n```txt\nAbility to generate random numbers is very helpful in all kinds of applicatio", "vulnerable_code": "## Relationships", "fixed_code": "## Description", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/debo-Q.md", "collected_at": "2026-01-02T18:23:43.006468+00:00", "source_hash": "d37020662005b5e285cf45585507deb67bce2b40b3d29cb28113eacd2e4ccd53", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 1725, "github_ref_count": 11, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "https://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L170\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L195\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L196\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L209\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L210\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L218\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L219\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L371\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L375\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L467\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L468", "primary_code_language": "url", "primary_code_char_count": 1681, "all_code_blocks": "// Code block 1 (url):\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L170\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L195\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L196\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L209\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L210\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L218\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L219\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L371\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L375\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L467\n\nhttps://github.com/code-423n4/2023-07-amphora/blob/daae020331404647c661ab534d20093c875483e1/core/solidity/contracts/governance/GovernorCharlie.sol#L468\n\n// Code block 2 (txt):\nCWE-330: Use of Insufficiently Random Values", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "GovernorCharlie.sol#L170, GovernorCharlie.sol#L195, GovernorCharlie.sol#L196, GovernorCharlie.sol#L209, GovernorCharlie.sol#L210, GovernorCharlie.sol#L218, GovernorCharlie.sol#L219, GovernorCharlie.sol#L371, GovernorCharlie.sol#L375, GovernorCharlie.sol#L467, GovernorCharlie.sol#L468", "github_files_list": "GovernorCharlie.sol", "github_refs_count": 11, "vulnerable_code_actual": "## Relationships", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## Description", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "09-ondo", "title": "matrix_0wl Q", "severity_raw": "Critical", "severity": "critical", "description": "## Non Critical Issues\n\n| | Issue |\n| ----- | :--------------------------------------------------------------------------------------- |\n| NC-1 | ADD A TIMELOCK TO CRITICAL FUNCTIONS |\n| NC-2 | ADD TO BLACKLIST FUNCTION |\n| NC-3 | GENERATE PERFECT CODE HEADERS EVERY TIME |\n| NC-4 | SAME CONSTANT REDEFINED ELSEWHERE |\n| NC-5 | IMPLEMENTATION CONTRACT MAY NOT BE INITIALIZED |\n| NC-6 | MARK VISIBILITY OF INITIALIZE(\u2026) FUNCTIONS AS EXTERNAL |\n| NC-7 | CONSTANT VALUES SUCH AS A CALL TO KECCAK256(), SHOULD USE IMMUTABLE RATHER THAN CONSTANT |\n| NC-8 | LACK OF EVENT EMISSION AFTER CRITICAL INITIALIZE() FUNCTIONS |\n| NC-9 | FOR EXTENDED \u201cUSING-FOR\u201d USAGE, USE THE LATEST PRAGMA VERSION |\n| NC-10 | NO SAME VALUE INPUT CONTROL |\n| NC-11 | Add parameter to event-emit |\n| NC-12 | SOLIDITY COMPILER OPTIMIZATIONS CAN BE PROBLEMATIC |\n| NC-13 | LINES ARE TOO LONG |\n\n### [NC-1] ADD A TIMELOCK TO CRITICAL FUNCTIONS\n\n#### Description:\n\nIt is a good practice to give time for users to react and adjust to critical changes. A timelock provides more guarantees and reduces the level of trust required, thus decreasing risk for users. It also indicates that the project is legitimate (less risk of a malicious owner making a sandwich attack on a user).\n\n#### **Proof Of Concept**\n\n```solidity\nFile: contracts/bridge/DestinationBridg", "vulnerable_code": "File: contracts/bridge/DestinationBridge.sol\n\n255: function setThresholds(\n\n286: function setMintLimit(uint256 mintLimit) external onlyOwner {\n\n287: _setMintLimit(mintLimit);\n\n295: function setMintLimitDuration(uint256 mintDuration) external onlyOwner {\n\n296: _setMintLimitDuration(mintDuration);\n\n343: ALLOWLIST.setAccountStatus(\n", "fixed_code": "File: contracts/bridge/SourceBridge.sol\n\n121: function setDestinationChainContractAddress(\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/matrix_0wl-Q.md", "collected_at": "2026-01-02T18:26:05.930938+00:00", "source_hash": "d4233cbab733e1fa703573e3199cef29ff4e8ddf6895b84ce4ffd844a7bac9bb", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: contracts/bridge/DestinationBridge.sol\n\n255: function setThresholds(\n\n286: function setMintLimit(uint256 mintLimit) external onlyOwner {\n\n287: _setMintLimit(mintLimit);\n\n295: function setMintLimitDuration(uint256 mintDuration) external onlyOwner {\n\n296: _setMintLimitDuration(mintDuration);\n\n343: ALLOWLIST.setAccountStatus(\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/bridge/SourceBridge.sol\n\n121: function setDestinationChainContractAddress(\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "10-badger", "title": "jauvany Q", "severity_raw": "Critical", "severity": "critical", "description": "# LOW IMPACT VULNERABILITIES\n\n## 1: More updated version of solidity can be used\n\nVulnerability details\n\n### Context:\n\nUsing the more updated version of solidity can add new features and enhance security. Version 0.8.23 is the latest version of solidity. Which includes support for Shangai. If Optimism does not support PUSH0 at this moment, Version 0.8.19, which \u201ccontains a fix for a long-standing bug that can result in code that is only used in creation code to also be included in runtime bytecode\u201d, can also be used. \n\nFor reference, see https://github.com/ethereum/solidity/releases\n\n### Proof of Concept\n\nAll contracts in scope\n\n## Tools Used\n\nManual Analysis\n\n**Recommended Mitigation Steps**\n\nTo be more secured and future-proofed, please consider using the more updated version of Solidity for all contracts in scope.\n\n\n## 2: receive()/payable fallback() function does not authorize requests\n\nVulnerability details\n\n### Context:\n\nHaving no access control on the ```function (e.g. require(msg.sender == address(weth)))``` means that someone may send Ether to the contract, and have no way to get anything back out, which is a loss of funds. If the concern is having to spend a small amount of gas to check the sender against an immutable address, the code should at least have a function to rescue mistakenlysent Ether. \n\n### Proof of Concept\n\n> ***File: SimplifiedDiamondLike.sol***\n```\n160: receive() external payable {\n161: // PHP is my favourite language\n162: }\n```\n\n### Tools Used\n\nManual Analysis\n\n***Recommended Mitigation Steps***\n\nThe code should at least have a mechanism to rescue mistakenlysent Ether. \n\n## 3: Empty receive()/fallback() function\n\nVulnerability details\n\n### Context:\n\nIf the intention is for Ether sent by a caller to be used for an actual purpose (i.e. the function is not just a WETH withdraw() handler), the function should call another function (e.g. call weth.deposit() and use the token on the caller's behalf) or at least emit an event to tr", "vulnerable_code": "160: receive() external payable {\n161: // PHP is my favourite language\n162: }", "fixed_code": "160: receive() external payable {\n161: // PHP is my favourite language\n162: }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/jauvany-Q.md", "collected_at": "2026-01-02T18:26:52.911317+00:00", "source_hash": "d47dfecd852a131339b8acacf3ac2ea19649b7ff94c08599bde5781f8c1f49c7", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 90, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "160: receive() external payable {\n161: // PHP is my favourite language\n162: }", "primary_code_language": "unknown", "primary_code_char_count": 90, "all_code_blocks": "// Code block 1 (unknown):\n160: receive() external payable {\n161: // PHP is my favourite language\n162: }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "160: receive() external payable {\n161: // PHP is my favourite language\n162: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "160: receive() external payable {\n161: // PHP is my favourite language\n162: }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "09-ondo", "title": "naman1778 G", "severity_raw": "Medium", "severity": "medium", "description": "## [G-01] abi.encode() is less efficient than abi.encodePacked()\n\nChanging abi.encode function to abi.encodePacked can save gas since the abi.encode function pads extra null bytes at the end of the call data, which is unnecessary. Also, in general, abi.encodePacked is more gas-efficient (see [Solidity-Encode-Gas-Comparison](https://github.com/ConnorBlockchain/Solidity-Encode-Gas-Comparison)).\n\nThere are 3 instances of this issue in 2 files:\n\n```\nFile: contracts/bridge/SourceBridge.sol\n\n79: bytes memory payload = abi.encode(VERSION, msg.sender, amount, nonce++);\n```\n\n diff --git a/contracts/bridge/SourceBridge.sol b/contracts/bridge/SourceBridge.sol\n index 457bf41..637934b 100644\n --- a/contracts/bridge/SourceBridge.sol\n +++ b/contracts/bridge/SourceBridge.sol\n @@ -76,7 +76,7 @@ contract SourceBridge is Ownable, Pausable, IMulticall {\n // burn amount\n TOKEN.burnFrom(msg.sender, amount);\n\n - bytes memory payload = abi.encode(VERSION, msg.sender, amount, nonce++);\n + bytes memory payload = abi.encodePacked(VERSION, msg.sender, amount, nonce++);\n\n _payGasAndCallContract(destinationChain, destContract, payload);\n }\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/SourceBridge.sol\n\n```\nFile: contracts/bridge/DestinationBridge.sol\n\n99: if (chainToApprovedSender[srcChain] != keccak256(abi.encode(srcAddr))) {\n\n238: chainToApprovedSender[srcChain] = keccak256(abi.encode(srcContractAddress));\n```\n\n diff --git a/contracts/bridge/DestinationBridge.sol b/contracts/bridge/DestinationBridge.sol\n index 8ad410c..b79d28e 100644\n --- a/contracts/bridge/DestinationBridge.sol\n +++ b/contracts/bridge/DestinationBridge.sol\n @@ -96,7 +96,7 @@ contract DestinationBridge is\n if (chainToApprovedSender[srcChain] == bytes32(0)) {\n revert ChainNotSupported();\n }\n - if (chainToApprovedSender[srcChain] != keccak256(abi.encode(srcAddr))) {\n + if (chainToApprovedSender[s", "vulnerable_code": "File: contracts/bridge/SourceBridge.sol\n\n79: bytes memory payload = abi.encode(VERSION, msg.sender, amount, nonce++);", "fixed_code": "File: contracts/bridge/DestinationBridge.sol\n\n99: if (chainToApprovedSender[srcChain] != keccak256(abi.encode(srcAddr))) {\n\n238: chainToApprovedSender[srcChain] = keccak256(abi.encode(srcContractAddress));", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/naman1778-G.md", "collected_at": "2026-01-02T18:26:08.599471+00:00", "source_hash": "d4abdd1974375865e2d34478fb63a0211cdc6272ef01a38f87d0bad7f6a0879e", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 322, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/bridge/SourceBridge.sol\n\n79: bytes memory payload = abi.encode(VERSION, msg.sender, amount, nonce++);", "primary_code_language": "unknown", "primary_code_char_count": 117, "all_code_blocks": "// Code block 1 (unknown):\nFile: contracts/bridge/SourceBridge.sol\n\n79: bytes memory payload = abi.encode(VERSION, msg.sender, amount, nonce++);\n\n// Code block 2 (unknown):\nFile: contracts/bridge/DestinationBridge.sol\n\n99: if (chainToApprovedSender[srcChain] != keccak256(abi.encode(srcAddr))) {\n\n238: chainToApprovedSender[srcChain] = keccak256(abi.encode(srcContractAddress));", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SourceBridge.sol", "github_files_list": "SourceBridge.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: contracts/bridge/SourceBridge.sol\n\n79: bytes memory payload = abi.encode(VERSION, msg.sender, amount, nonce++);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/bridge/DestinationBridge.sol\n\n99: if (chainToApprovedSender[srcChain] != keccak256(abi.encode(srcAddr))) {\n\n238: chainToApprovedSender[srcChain] = keccak256(abi.encode(srcContractAddress));", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-ondo", "title": "Aymen0909 Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA Report\n\n## Summary\n\n| | Issue | Risk | Instances |\n| :-------------: |:-------------|:-------------:|:-------------:|\n| 1 | `getChainlinkOraclePrice` function can return null prices | Low | 1 |\n| 2 | `maxChainlinkOracleTimeDelay` is too big for some tokens price feeds | Low | 1 |\n| 3 | `owner` of `JumpRateModelV2` contract can not be changed | Low | 1 |\n| 4 | Related data should be grouped in a `struct` | NC | 5 |\n| 5 | Named return variables not used anywhere in the functions | NC | 1 |\n| 6 | Use solidity time-based units | NC | 1 |\n\n## Findings\n\n### 1- `getChainlinkOraclePrice` function can return null prices :\n\nThe function `getChainlinkOraclePrice` is used in the `OndoPriceOracleV2` contract to get a token price using the Chainlink oracle, and the function will revert if the price returned by the oracle is not greater or equal than zero, but if the returned price is zero (which can happen if there is an isssue in the Chainlink oracle for some reason) the function will not revert and still return the null price this can have a negative impact on other functions (from other contracts) that uses this price in their internal logic.\n\n### Risk : Low\n\n### Proof of Concept\n\nIssue occurs in the `getChainlinkOraclePrice` function below :\n\nFile: lending/OndoPriceOracleV2.sol [Line 277-301](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/OndoPriceOracleV2.sol#L277-L301)\n```\nfunction getChainlinkOraclePrice(\naddress fToken\n) public view returns (uint256) {\n require(\n fTokenToOracleType[fToken] == OracleType.CHAINLINK,\n \"fToken is not configured for Chainlink oracle\"\n );\n ChainlinkOracleInfo memory chainlinkInfo = fTokenToChainlinkOracle[fToken];\n (\n uint80 roundId,\n int answer,\n ,\n uint updatedAt,\n uint80 answeredInRound\n ) = chainlinkInfo.oracle.latestRoundData();\n require(\n (answeredInRound >= roundId) &&\n (updatedAt >= block.tim", "vulnerable_code": "function getChainlinkOraclePrice(\naddress fToken\n) public view returns (uint256) {\n require(\n fTokenToOracleType[fToken] == OracleType.CHAINLINK,\n \"fToken is not configured for Chainlink oracle\"\n );\n ChainlinkOracleInfo memory chainlinkInfo = fTokenToChainlinkOracle[fToken];\n (\n uint80 roundId,\n int answer,\n ,\n uint updatedAt,\n uint80 answeredInRound\n ) = chainlinkInfo.oracle.latestRoundData();\n require(\n (answeredInRound >= roundId) &&\n (updatedAt >= block.timestamp - maxChainlinkOracleTimeDelay),\n \"Chainlink oracle price is stale\"\n );\n /**\n @audit : it should be answer > 0 and not answer >= 0\n This to avoid the null price in case of chainlink oracle issue\n */\n require(answer >= 0, \"Price cannot be negative\");\n // Scale to decimals needed in Comptroller (18 decimal underlying -> 18 decimals; 6 decimal underlying -> 30 decimals)\n // Scales by same conversion factor as in Compound Oracle\n return uint256(answer) * chainlinkInfo.scaleFactor;\n}", "fixed_code": "function getChainlinkOraclePrice(\naddress fToken\n) public view returns (uint256) {\n ...\n /**\n @audit : use answer > 0 \n */\n require(answer > 0, \"Price cannot be negative\");\n // Scale to decimals needed in Comptroller (18 decimal underlying -> 18 decimals; 6 decimal underlying -> 30 decimals)\n // Scales by same conversion factor as in Compound Oracle\n return uint256(answer) * chainlinkInfo.scaleFactor;\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/Aymen0909-Q.md", "collected_at": "2026-01-02T18:14:28.381276+00:00", "source_hash": "d4b4f20a7ea3ce1c79f58036ae330923492b55042c5132108c3be309f8515fe5", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "OndoPriceOracleV2.sol#L277-L301", "github_files_list": "OndoPriceOracleV2.sol", "github_refs_count": 1, "vulnerable_code_actual": "function getChainlinkOraclePrice(\naddress fToken\n) public view returns (uint256) {\n require(\n fTokenToOracleType[fToken] == OracleType.CHAINLINK,\n \"fToken is not configured for Chainlink oracle\"\n );\n ChainlinkOracleInfo memory chainlinkInfo = fTokenToChainlinkOracle[fToken];\n (\n uint80 roundId,\n int answer,\n ,\n uint updatedAt,\n uint80 answeredInRound\n ) = chainlinkInfo.oracle.latestRoundData();\n require(\n (answeredInRound >= roundId) &&\n (updatedAt >= block.timestamp - maxChainlinkOracleTimeDelay),\n \"Chainlink oracle price is stale\"\n );\n /**\n @audit : it should be answer > 0 and not answer >= 0\n This to avoid the null price in case of chainlink oracle issue\n */\n require(answer >= 0, \"Price cannot be negative\");\n // Scale to decimals needed in Comptroller (18 decimal underlying -> 18 decimals; 6 decimal underlying -> 30 decimals)\n // Scales by same conversion factor as in Compound Oracle\n return uint256(answer) * chainlinkInfo.scaleFactor;\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function getChainlinkOraclePrice(\naddress fToken\n) public view returns (uint256) {\n ...\n /**\n @audit : use answer > 0 \n */\n require(answer > 0, \"Price cannot be negative\");\n // Scale to decimals needed in Comptroller (18 decimal underlying -> 18 decimals; 6 decimal underlying -> 30 decimals)\n // Scales by same conversion factor as in Compound Oracle\n return uint256(answer) * chainlinkInfo.scaleFactor;\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "02-ethos", "title": "0xackermann Q", "severity_raw": "Critical", "severity": "critical", "description": "### QA Report\n[Exclusive findings](#exclusive-findings) is below the [automated findings](#automated-findings).\n\n---\n\n## Automated Findings\n## Non Critical Issues\n\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [NC-1](#NC-1) | Missing checks for `address(0)` when assigning values to address state variables | 26 |\n| [NC-2](#NC-2) | `require()` / `revert()` statements should have descriptive reason strings | 10 |\n| [NC-3](#NC-3) | Return values of `approve()` not checked | 5 |\n| [NC-4](#NC-4) | TODO Left in the code | 2 |\n| [NC-5](#NC-5) | Event is missing `indexed` fields | 93 |\n| [NC-6](#NC-6) | Functions not used internally could be marked external | 2 |\n| [NC-7](#NC-7) | Typos | 32 |\n### [NC-1] Missing checks for `address(0)` when assigning values to address state variables\n\n*Instances (26)*:\n```solidity\nFile: Ethos-Core/contracts/ActivePool.sol\n\n96: collateralConfigAddress = _collateralConfigAddress;\n\n97: borrowerOperationsAddress = _borrowerOperationsAddress;\n\n98: troveManagerAddress = _troveManagerAddress;\n\n99: stabilityPoolAddress = _stabilityPoolAddress;\n\n100: defaultPoolAddress = _defaultPoolAddress;\n\n101: collSurplusPoolAddress = _collSurplusPoolAddress;\n\n103: lqtyStakingAddress = _lqtyStakingAddress;\n\n```\n[Link to code](https://github.com/code-423n4/2023-02-ethos/tree/main/Ethos-Core/contracts/ActivePool.sol)\n\n```solidity\nFile: Ethos-Core/contracts/BorrowerOperations.sol\n\n146: stabilityPoolAddress = _stabilityPoolAddress;\n\n147: gasPoolAddress = _gasPoolAddress;\n\n152: lqtyStakingAddress = _lqtyStakingAddress;\n\n```\n[Link to code](https://github.com/code-423n4/2023-02-ethos/tree/main/Ethos-Core/contracts/BorrowerOperations.sol)\n\n```solidity\nFile: Ethos-Core/contracts/LQTY/CommunityIssuance.sol\n\n75: stabilityPoolAddress = _stabilityPoolAddress;\n\n```\n[Link to code](https://github.com/code-423n4/2023-02-ethos/tree/main/Ethos-Core/contracts/LQTY/CommunityIssuance.sol)\n\n", "vulnerable_code": "File: Ethos-Core/contracts/ActivePool.sol\n\n96: collateralConfigAddress = _collateralConfigAddress;\n\n97: borrowerOperationsAddress = _borrowerOperationsAddress;\n\n98: troveManagerAddress = _troveManagerAddress;\n\n99: stabilityPoolAddress = _stabilityPoolAddress;\n\n100: defaultPoolAddress = _defaultPoolAddress;\n\n101: collSurplusPoolAddress = _collSurplusPoolAddress;\n\n103: lqtyStakingAddress = _lqtyStakingAddress;\n", "fixed_code": "File: Ethos-Core/contracts/BorrowerOperations.sol\n\n146: stabilityPoolAddress = _stabilityPoolAddress;\n\n147: gasPoolAddress = _gasPoolAddress;\n\n152: lqtyStakingAddress = _lqtyStakingAddress;\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/0xackermann-Q.md", "collected_at": "2026-01-02T18:15:49.166693+00:00", "source_hash": "d4cdbd6dba96459af227a80d3c494f55113bea01ac3b922d5bf3a55d43e486a8", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 792, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: Ethos-Core/contracts/ActivePool.sol\n\n96: collateralConfigAddress = _collateralConfigAddress;\n\n97: borrowerOperationsAddress = _borrowerOperationsAddress;\n\n98: troveManagerAddress = _troveManagerAddress;\n\n99: stabilityPoolAddress = _stabilityPoolAddress;\n\n100: defaultPoolAddress = _defaultPoolAddress;\n\n101: collSurplusPoolAddress = _collSurplusPoolAddress;\n\n103: lqtyStakingAddress = _lqtyStakingAddress;", "primary_code_language": "solidity", "primary_code_char_count": 467, "all_code_blocks": "// Code block 1 (solidity):\nFile: Ethos-Core/contracts/ActivePool.sol\n\n96: collateralConfigAddress = _collateralConfigAddress;\n\n97: borrowerOperationsAddress = _borrowerOperationsAddress;\n\n98: troveManagerAddress = _troveManagerAddress;\n\n99: stabilityPoolAddress = _stabilityPoolAddress;\n\n100: defaultPoolAddress = _defaultPoolAddress;\n\n101: collSurplusPoolAddress = _collSurplusPoolAddress;\n\n103: lqtyStakingAddress = _lqtyStakingAddress;\n\n// Code block 2 (solidity):\nFile: Ethos-Core/contracts/BorrowerOperations.sol\n\n146: stabilityPoolAddress = _stabilityPoolAddress;\n\n147: gasPoolAddress = _gasPoolAddress;\n\n152: lqtyStakingAddress = _lqtyStakingAddress;\n\n// Code block 3 (solidity):\nFile: Ethos-Core/contracts/LQTY/CommunityIssuance.sol\n\n75: stabilityPoolAddress = _stabilityPoolAddress;", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: Ethos-Core/contracts/ActivePool.sol\n\n96: collateralConfigAddress = _collateralConfigAddress;\n\n97: borrowerOperationsAddress = _borrowerOperationsAddress;\n\n98: troveManagerAddress = _troveManagerAddress;\n\n99: stabilityPoolAddress = _stabilityPoolAddress;\n\n100: defaultPoolAddress = _defaultPoolAddress;\n\n101: collSurplusPoolAddress = _collSurplusPoolAddress;\n\n103: lqtyStakingAddress = _lqtyStakingAddress;\n\nFile: Ethos-Core/contracts/BorrowerOperations.sol\n\n146: stabilityPoolAddress = _stabilityPoolAddress;\n\n147: gasPoolAddress = _gasPoolAddress;\n\n152: lqtyStakingAddress = _lqtyStakingAddress;\n\nFile: Ethos-Core/contracts/LQTY/CommunityIssuance.sol\n\n75: stabilityPoolAddress = _stabilityPoolAddress;", "github_refs_formatted": "ActivePool.sol, BorrowerOperations.sol, CommunityIssuance.sol", "github_files_list": "BorrowerOperations.sol, ActivePool.sol, CommunityIssuance.sol", "github_refs_count": 3, "vulnerable_code_actual": "File: Ethos-Core/contracts/ActivePool.sol\n\n96: collateralConfigAddress = _collateralConfigAddress;\n\n97: borrowerOperationsAddress = _borrowerOperationsAddress;\n\n98: troveManagerAddress = _troveManagerAddress;\n\n99: stabilityPoolAddress = _stabilityPoolAddress;\n\n100: defaultPoolAddress = _defaultPoolAddress;\n\n101: collSurplusPoolAddress = _collSurplusPoolAddress;\n\n103: lqtyStakingAddress = _lqtyStakingAddress;\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: Ethos-Core/contracts/BorrowerOperations.sol\n\n146: stabilityPoolAddress = _stabilityPoolAddress;\n\n147: gasPoolAddress = _gasPoolAddress;\n\n152: lqtyStakingAddress = _lqtyStakingAddress;\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "01-biconomy", "title": "dharma09 G", "severity_raw": "Low", "severity": "low", "description": "**[G-01] Empty blocks should be removed or emit something** \n\nThe code should be refactored such that they no longer exist, or the block should do something useful, such as emitting an event or reverting. If the contract is meant to be extended, the contract should be\u00a0`abstract`\u00a0and the function signatures be added without any default implementation. If the block is an empty if-statement block to avoid doing subsequent checks in the else-if/else conditions, the else-if/else conditions should be nested under the negation of the if-statement, because they involve different classes of checks, which may lead to the introduction of errors when the code is later modified (`if(x){}else if(y){...}else{...}`\u00a0=>\u00a0`if(!x){if(y){...}else{...}}`)\n\n*There are 1 instances of this issue:*\n\n```solidity\n/SmartAccount.sol\n550: receive() external payable {}\n```\n\n**[G-02]** **Defined Variables Used Only Once**\n\nCertain variables is defined even though they are used only once.Remove these unnecessary variables to save gas.For cases where it will reduce the readability, one can use comments to help describe what the code is doing.\n\n*There are 2 instances of this issue:*\n\n```solidity\n/aa-4337/core/StakeManager.sol\n48: function depositTo(address account) public payable {\n49: internalIncrementDeposit(account, msg.value);\n50: DepositInfo storage info = deposits[account];\n51: emit Deposited(account, info.deposit);\n52: }\n\n/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol\n126: PaymasterContext memory data = context.decodePaymasterContext();\n127: address extractedPaymasterId = data.paymasterId;\n```\n\n**Mitigation**\n\n```diff\n48: function depositTo(address account) public payable {\n49: internalIncrementDeposit(account, msg.value);\n-50: DepositInfo storage info = deposits[account];\n+50: emit Deposited(account, deposits[account].deposit);\n51: }\n\n-126: PaymasterContext memory data = context.decodePaymasterContext();\n+126: address extractedPaymasterId = context", "vulnerable_code": "/SmartAccount.sol\n550: receive() external payable {}", "fixed_code": "/aa-4337/core/StakeManager.sol\n48: function depositTo(address account) public payable {\n49: internalIncrementDeposit(account, msg.value);\n50: DepositInfo storage info = deposits[account];\n51: emit Deposited(account, info.deposit);\n52: }\n\n/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol\n126: PaymasterContext memory data = context.decodePaymasterContext();\n127: address extractedPaymasterId = data.paymasterId;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/dharma09-G.md", "collected_at": "2026-01-02T18:13:42.753034+00:00", "source_hash": "d4f5de29a8f18bcae2a9fcdf628659ff7a6b69e5b2439375228821cb4d5b7e54", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 492, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "/SmartAccount.sol\n550: receive() external payable {}", "primary_code_language": "solidity", "primary_code_char_count": 52, "all_code_blocks": "// Code block 1 (solidity):\n/SmartAccount.sol\n550: receive() external payable {}\n\n// Code block 2 (solidity):\n/aa-4337/core/StakeManager.sol\n48: function depositTo(address account) public payable {\n49: internalIncrementDeposit(account, msg.value);\n50: DepositInfo storage info = deposits[account];\n51: emit Deposited(account, info.deposit);\n52: }\n\n/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol\n126: PaymasterContext memory data = context.decodePaymasterContext();\n127: address extractedPaymasterId = data.paymasterId;", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "/SmartAccount.sol\n550: receive() external payable {}\n\n/aa-4337/core/StakeManager.sol\n48: function depositTo(address account) public payable {\n49: internalIncrementDeposit(account, msg.value);\n50: DepositInfo storage info = deposits[account];\n51: emit Deposited(account, info.deposit);\n52: }\n\n/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol\n126: PaymasterContext memory data = context.decodePaymasterContext();\n127: address extractedPaymasterId = data.paymasterId;", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "/SmartAccount.sol\n550: receive() external payable {}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "/aa-4337/core/StakeManager.sol\n48: function depositTo(address account) public payable {\n49: internalIncrementDeposit(account, msg.value);\n50: DepositInfo storage info = deposits[account];\n51: emit Deposited(account, info.deposit);\n52: }\n\n/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol\n126: PaymasterContext memory data = context.decodePaymasterContext();\n127: address extractedPaymasterId = data.paymasterId;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-asymmetry", "title": "Gde Q", "severity_raw": "High", "severity": "high", "description": "## Empty Event\n\nThe Rebalanced event has no parameters in it to emit anything. Consider adding parameters or removing it.\n\n```\nevent Rebalanced();\n```\n\nDeclared here: [SafEth.sol#L34](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L34)\n\n\nUsed here: [SafEth.sol#L154](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L154)\n\n## Events Associated With Setter/Update Functions\n\nConsider having events associated with setter/update functions emit both the new and old values instead of just the new value.\n\n[SafEth.sol#L216](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L216)\n```\nemit ChangeMinAmount(minAmount);\n``` \n\n[SafEth.sol#L225](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L225)\n```\nemit ChangeMaxAmount(maxAmount);\n``` \n\n[SafEth.sol#L207](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L207)\n```\nemit SetMaxSlippage(_derivativeIndex, _slippage);\n``` \n\n[SafEth.sol#L174](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L174)\n```\nemit WeightChange(_derivativeIndex, _weight);\n``` \n \n\n## Duplicated code that could be factorized\n\nIn SfrxEth.sol, at several places we use:\n\n```\nIERC20(SFRX_ETH_ADDRESS).balanceOf(address(this));\n```\n[SfrxEth.sol#L98](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol#L98) \n[SfrxEth.sol#L102](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol#L102)\n\nWhereas we could just reuse the public `balance()` method: \n[SfrxEth.sol#L122-L124](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol#L122-L124) \n \n \nIn Reth.sol\n\nWe duplicate lines to get the reth token address at different places: \n[Reth.sol#L187-L193](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contract", "vulnerable_code": "event Rebalanced();", "fixed_code": "emit ChangeMinAmount(minAmount);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Gde-Q.md", "collected_at": "2026-01-02T18:18:05.635093+00:00", "source_hash": "d51acdeb09336a2d9e11aa90e4267386cd89758dda4764e440d73679369270a6", "code_block_count": 6, "solidity_block_count": 0, "total_code_chars": 227, "github_ref_count": 9, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "event Rebalanced();", "primary_code_language": "unknown", "primary_code_char_count": 19, "all_code_blocks": "// Code block 1 (unknown):\nevent Rebalanced();\n\n// Code block 2 (unknown):\nemit ChangeMinAmount(minAmount);\n\n// Code block 3 (unknown):\nemit ChangeMaxAmount(maxAmount);\n\n// Code block 4 (unknown):\nemit SetMaxSlippage(_derivativeIndex, _slippage);\n\n// Code block 5 (unknown):\nemit WeightChange(_derivativeIndex, _weight);\n\n// Code block 6 (unknown):\nIERC20(SFRX_ETH_ADDRESS).balanceOf(address(this));", "all_code_blocks_count": 6, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol#L34, SafEth.sol#L154, SafEth.sol#L216, SafEth.sol#L225, SafEth.sol#L207, SafEth.sol#L174, SfrxEth.sol#L98, SfrxEth.sol#L102, SfrxEth.sol#L122-L124", "github_files_list": "SfrxEth.sol, SafEth.sol", "github_refs_count": 9, "vulnerable_code_actual": "event Rebalanced();", "has_vulnerable_code_snippet": true, "fixed_code_actual": "emit ChangeMinAmount(minAmount);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 12} {"source": "c4", "protocol": "02-ai-arena", "title": "DarkTower Q", "severity_raw": "Medium", "severity": "medium", "description": "## [L-01] Voltage replenishment will fail in 81.98 years\n\nIn roughly 81.98 years, assuming the AI Arena contract still functions, rather unlikely; voltage replenishment will fail for fighters in the Arena because at that point the `block.timestamp` will be too much of a value the `uint32` type can accomodate, hence leading transactions to the `spendVoltage` >> `_replenishVoltage` functions to fail.\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/VoltageManager.sol#L119\n\n```js\n/// @notice Replenishes voltage and sets the replenish time to 1 day from now\n /// @dev This function is called internally to replenish the voltage for the owner.\n /// @param owner The address of the owner\n function _replenishVoltage(address owner) private {\n ownerVoltage[owner] = 100;\n @> ownerVoltageReplenishTime[owner] = uint32(block.timestamp + 1 days); // @audit-info will fail in 81.98 years\n }\n```\n\nSwitching to a bigger datatype such as the `uint64` or more should be fine for a long time:\n\n```diff\n- ownerVoltageReplenishTime[owner] = uint32(block.timestamp + 1 days);\n+ ownerVoltageReplenishTime[owner] = uint64(block.timestamp + 1 days);\n```\n\n## [L-02] Players can burn 1 full battery even at 90% voltage\n\nThe function is called when when a voltage battery to replenish voltage for a player in AI Arena. But it allows players to burn his battery even at 90% voltage which will also lose them the `VoltageReplenishTime`.\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/VoltageManager.sol#L93\n\n```solidity\n function useVoltageBattery() public {\n require(ownerVoltage[msg.sender] < 100);\n require(_gameItemsContractInstance.balanceOf(msg.sender, 0) > 0);\n _gameItemsContractInstance.burn(msg.sender, 0, 1);\n ownerVoltage[msg.sender] = 100;\n emit VoltageRemaining(msg.sender, ownerVoltage[msg.sender]);\n }\n\n```\n\n## [L-03] Players can only claim one of two signatures given by the server using `claimFighters`\n\nThe issu", "vulnerable_code": "/// @notice Replenishes voltage and sets the replenish time to 1 day from now\n /// @dev This function is called internally to replenish the voltage for the owner.\n /// @param owner The address of the owner\n function _replenishVoltage(address owner) private {\n ownerVoltage[owner] = 100;\n @> ownerVoltageReplenishTime[owner] = uint32(block.timestamp + 1 days); // @audit-info will fail in 81.98 years\n }", "fixed_code": "## [L-02] Players can burn 1 full battery even at 90% voltage\n\nThe function is called when when a voltage battery to replenish voltage for a player in AI Arena. But it allows players to burn his battery even at 90% voltage which will also lose them the `VoltageReplenishTime`.\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/VoltageManager.sol#L93\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/DarkTower-Q.md", "collected_at": "2026-01-02T19:02:22.752898+00:00", "source_hash": "d5f82287753cc835d1e0d2dd3b45e61fd1e938872cb845d9f161314a14211ad7", "code_block_count": 3, "solidity_block_count": 2, "total_code_chars": 900, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "/// @notice Replenishes voltage and sets the replenish time to 1 day from now\n /// @dev This function is called internally to replenish the voltage for the owner.\n /// @param owner The address of the owner\n function _replenishVoltage(address owner) private {\n ownerVoltage[owner] = 100;\n @> ownerVoltageReplenishTime[owner] = uint32(block.timestamp + 1 days); // @audit-info will fail in 81.98 years\n }", "primary_code_language": "js", "primary_code_char_count": 425, "all_code_blocks": "// Code block 1 (js):\n/// @notice Replenishes voltage and sets the replenish time to 1 day from now\n /// @dev This function is called internally to replenish the voltage for the owner.\n /// @param owner The address of the owner\n function _replenishVoltage(address owner) private {\n ownerVoltage[owner] = 100;\n @> ownerVoltageReplenishTime[owner] = uint32(block.timestamp + 1 days); // @audit-info will fail in 81.98 years\n }\n\n// Code block 2 (diff):\n- ownerVoltageReplenishTime[owner] = uint32(block.timestamp + 1 days);\n+ ownerVoltageReplenishTime[owner] = uint64(block.timestamp + 1 days);\n\n// Code block 3 (solidity):\nfunction useVoltageBattery() public {\n require(ownerVoltage[msg.sender] < 100);\n require(_gameItemsContractInstance.balanceOf(msg.sender, 0) > 0);\n _gameItemsContractInstance.burn(msg.sender, 0, 1);\n ownerVoltage[msg.sender] = 100;\n emit VoltageRemaining(msg.sender, ownerVoltage[msg.sender]);\n }", "all_code_blocks_count": 3, "has_diff_blocks": true, "diff_code": "- ownerVoltageReplenishTime[owner] = uint32(block.timestamp + 1 days);\n+ ownerVoltageReplenishTime[owner] = uint64(block.timestamp + 1 days);", "solidity_code": "function useVoltageBattery() public {\n require(ownerVoltage[msg.sender] < 100);\n require(_gameItemsContractInstance.balanceOf(msg.sender, 0) > 0);\n _gameItemsContractInstance.burn(msg.sender, 0, 1);\n ownerVoltage[msg.sender] = 100;\n emit VoltageRemaining(msg.sender, ownerVoltage[msg.sender]);\n }", "github_refs_formatted": "VoltageManager.sol#L119, VoltageManager.sol#L93", "github_files_list": "VoltageManager.sol", "github_refs_count": 2, "vulnerable_code_actual": "/// @notice Replenishes voltage and sets the replenish time to 1 day from now\n /// @dev This function is called internally to replenish the voltage for the owner.\n /// @param owner The address of the owner\n function _replenishVoltage(address owner) private {\n ownerVoltage[owner] = 100;\n @> ownerVoltageReplenishTime[owner] = uint32(block.timestamp + 1 days); // @audit-info will fail in 81.98 years\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## [L-02] Players can burn 1 full battery even at 90% voltage\n\nThe function is called when when a voltage battery to replenish voltage for a player in AI Arena. But it allows players to burn his battery even at 90% voltage which will also lose them the `VoltageReplenishTime`.\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/main/src/VoltageManager.sol#L93\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 11} {"source": "c4", "protocol": "08-dopex", "title": "0xWaitress Q", "severity_raw": "Low", "severity": "low", "description": "[L-1] there is no validation that rdpxBurnPercentage and rdpxFeePercentage adds up to 100%.\n\nrdpxBurnPercentage and rdpxFeePercentage represents the two destinations of RDPX during transfer, 1 is burnt and 1 is transferred to the fee dsitributor. however they can be set separately and arbitrarily. \n\n```solidity\n /// @notice The % of rdpx to burn while bonding\n uint256 public rdpxBurnPercentage = 50 * DEFAULT_PRECISION;\n\n /// @notice The % of rdpx sent to fee distributor while bonding\n uint256 public rdpxFeePercentage = 50 * DEFAULT_PRECISION;\n\n...\n\n function setRdpxBurnPercentage(\n uint256 _rdpxBurnPercentage\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n _validate(_rdpxBurnPercentage > 0, 3);\n rdpxBurnPercentage = _rdpxBurnPercentage;\n emit LogSetRdpxBurnPercentage(_rdpxBurnPercentage);\n }\n\n /**\n * @notice Sets the rdpx fee percentage\n * @dev Can only be called by admin\n * @param _rdpxFeePercentage the fee percentage to set in 1e8 precision\n **/\n function setRdpxFeePercentage(\n uint256 _rdpxFeePercentage\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n _validate(_rdpxFeePercentage > 0, 3);\n rdpxFeePercentage = _rdpxFeePercentage;\n emit LogSetRdpxFeePercentage(_rdpxFeePercentage);\n }\n\n```\n\nRecommendation:\ncombine them into a setter and the other one gets updated automically.\n\n\n[N-1] _ammFactory is not used in ReLPContract or UniV2LiquidityAmo.\n\n```solidity\n function setAddresses(\n address _tokenA,\n address _tokenB,\n address _pair,\n address _rdpxV2Core,\n address _rdpxOracle,\n address _ammFactory,\n address _ammRouter\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n require(\n _tokenA != address(0) &&\n _tokenB != address(0) &&\n _pair != address(0) &&\n _rdpxV2Core != address(0) &&\n _rdpxOracle != address(0) &&\n _ammFactory != address(0) &&\n _ammRouter != address(0),\n \"reLPContract: address cannot be 0\"\n );\n addresses = Addresses({\n tokenA: _tokenA,\n ", "vulnerable_code": " /// @notice The % of rdpx to burn while bonding\n uint256 public rdpxBurnPercentage = 50 * DEFAULT_PRECISION;\n\n /// @notice The % of rdpx sent to fee distributor while bonding\n uint256 public rdpxFeePercentage = 50 * DEFAULT_PRECISION;\n\n...\n\n function setRdpxBurnPercentage(\n uint256 _rdpxBurnPercentage\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n _validate(_rdpxBurnPercentage > 0, 3);\n rdpxBurnPercentage = _rdpxBurnPercentage;\n emit LogSetRdpxBurnPercentage(_rdpxBurnPercentage);\n }\n\n /**\n * @notice Sets the rdpx fee percentage\n * @dev Can only be called by admin\n * @param _rdpxFeePercentage the fee percentage to set in 1e8 precision\n **/\n function setRdpxFeePercentage(\n uint256 _rdpxFeePercentage\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n _validate(_rdpxFeePercentage > 0, 3);\n rdpxFeePercentage = _rdpxFeePercentage;\n emit LogSetRdpxFeePercentage(_rdpxFeePercentage);\n }\n", "fixed_code": " function setAddresses(\n address _tokenA,\n address _tokenB,\n address _pair,\n address _rdpxV2Core,\n address _rdpxOracle,\n address _ammFactory,\n address _ammRouter\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n require(\n _tokenA != address(0) &&\n _tokenB != address(0) &&\n _pair != address(0) &&\n _rdpxV2Core != address(0) &&\n _rdpxOracle != address(0) &&\n _ammFactory != address(0) &&\n _ammRouter != address(0),\n \"reLPContract: address cannot be 0\"\n );\n addresses = Addresses({\n tokenA: _tokenA,\n tokenB: _tokenB,\n pair: _pair,\n rdpxV2Core: _rdpxV2Core,\n rdpxOracle: _rdpxOracle,\n ammFactory: _ammFactory,\n ammRouter: _ammRouter\n });\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/0xWaitress-Q.md", "collected_at": "2026-01-02T18:24:20.909245+00:00", "source_hash": "d62a0d156b351bf0f9484bdd4b9bc543918830131399914a339ff110d2b904f9", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 926, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "/// @notice The % of rdpx to burn while bonding\n uint256 public rdpxBurnPercentage = 50 * DEFAULT_PRECISION;\n\n /// @notice The % of rdpx sent to fee distributor while bonding\n uint256 public rdpxFeePercentage = 50 * DEFAULT_PRECISION;\n\n...\n\n function setRdpxBurnPercentage(\n uint256 _rdpxBurnPercentage\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n _validate(_rdpxBurnPercentage > 0, 3);\n rdpxBurnPercentage = _rdpxBurnPercentage;\n emit LogSetRdpxBurnPercentage(_rdpxBurnPercentage);\n }\n\n /**\n * @notice Sets the rdpx fee percentage\n * @dev Can only be called by admin\n * @param _rdpxFeePercentage the fee percentage to set in 1e8 precision\n **/\n function setRdpxFeePercentage(\n uint256 _rdpxFeePercentage\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n _validate(_rdpxFeePercentage > 0, 3);\n rdpxFeePercentage = _rdpxFeePercentage;\n emit LogSetRdpxFeePercentage(_rdpxFeePercentage);\n }", "primary_code_language": "solidity", "primary_code_char_count": 926, "all_code_blocks": "// Code block 1 (solidity):\n/// @notice The % of rdpx to burn while bonding\n uint256 public rdpxBurnPercentage = 50 * DEFAULT_PRECISION;\n\n /// @notice The % of rdpx sent to fee distributor while bonding\n uint256 public rdpxFeePercentage = 50 * DEFAULT_PRECISION;\n\n...\n\n function setRdpxBurnPercentage(\n uint256 _rdpxBurnPercentage\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n _validate(_rdpxBurnPercentage > 0, 3);\n rdpxBurnPercentage = _rdpxBurnPercentage;\n emit LogSetRdpxBurnPercentage(_rdpxBurnPercentage);\n }\n\n /**\n * @notice Sets the rdpx fee percentage\n * @dev Can only be called by admin\n * @param _rdpxFeePercentage the fee percentage to set in 1e8 precision\n **/\n function setRdpxFeePercentage(\n uint256 _rdpxFeePercentage\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n _validate(_rdpxFeePercentage > 0, 3);\n rdpxFeePercentage = _rdpxFeePercentage;\n emit LogSetRdpxFeePercentage(_rdpxFeePercentage);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "/// @notice The % of rdpx to burn while bonding\n uint256 public rdpxBurnPercentage = 50 * DEFAULT_PRECISION;\n\n /// @notice The % of rdpx sent to fee distributor while bonding\n uint256 public rdpxFeePercentage = 50 * DEFAULT_PRECISION;\n\n...\n\n function setRdpxBurnPercentage(\n uint256 _rdpxBurnPercentage\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n _validate(_rdpxBurnPercentage > 0, 3);\n rdpxBurnPercentage = _rdpxBurnPercentage;\n emit LogSetRdpxBurnPercentage(_rdpxBurnPercentage);\n }\n\n /**\n * @notice Sets the rdpx fee percentage\n * @dev Can only be called by admin\n * @param _rdpxFeePercentage the fee percentage to set in 1e8 precision\n **/\n function setRdpxFeePercentage(\n uint256 _rdpxFeePercentage\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n _validate(_rdpxFeePercentage > 0, 3);\n rdpxFeePercentage = _rdpxFeePercentage;\n emit LogSetRdpxFeePercentage(_rdpxFeePercentage);\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " /// @notice The % of rdpx to burn while bonding\n uint256 public rdpxBurnPercentage = 50 * DEFAULT_PRECISION;\n\n /// @notice The % of rdpx sent to fee distributor while bonding\n uint256 public rdpxFeePercentage = 50 * DEFAULT_PRECISION;\n\n...\n\n function setRdpxBurnPercentage(\n uint256 _rdpxBurnPercentage\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n _validate(_rdpxBurnPercentage > 0, 3);\n rdpxBurnPercentage = _rdpxBurnPercentage;\n emit LogSetRdpxBurnPercentage(_rdpxBurnPercentage);\n }\n\n /**\n * @notice Sets the rdpx fee percentage\n * @dev Can only be called by admin\n * @param _rdpxFeePercentage the fee percentage to set in 1e8 precision\n **/\n function setRdpxFeePercentage(\n uint256 _rdpxFeePercentage\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n _validate(_rdpxFeePercentage > 0, 3);\n rdpxFeePercentage = _rdpxFeePercentage;\n emit LogSetRdpxFeePercentage(_rdpxFeePercentage);\n }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function setAddresses(\n address _tokenA,\n address _tokenB,\n address _pair,\n address _rdpxV2Core,\n address _rdpxOracle,\n address _ammFactory,\n address _ammRouter\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n require(\n _tokenA != address(0) &&\n _tokenB != address(0) &&\n _pair != address(0) &&\n _rdpxV2Core != address(0) &&\n _rdpxOracle != address(0) &&\n _ammFactory != address(0) &&\n _ammRouter != address(0),\n \"reLPContract: address cannot be 0\"\n );\n addresses = Addresses({\n tokenA: _tokenA,\n tokenB: _tokenB,\n pair: _pair,\n rdpxV2Core: _rdpxV2Core,\n rdpxOracle: _rdpxOracle,\n ammFactory: _ammFactory,\n ammRouter: _ammRouter\n });\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "02-ai-arena", "title": "BigVeezus Q", "severity_raw": "Medium", "severity": "medium", "description": "\n## [L-1] `RankedBattle::_addResultPoints` function does not update the `globalStakedAmount` after an amount has been staked\n\n**Occurences**: 2 times\n\n1. `RankedBattle::_addResultPoints` function at line 465, RankedBattle.sol.\n2. `RankedBattle::_addResultPoints` function at line 500, RankedBattle.sol.\n\n**Impact**:\nThis could cause wrong information to users or stakeholders if the `globalStakedAmount` doesnt update as it should\n\n**Proof Of Code & Added Mitigation**:\n\n```diff\n /// If the user has stake-at-risk for their fighter, reclaim a portion\n /// Reclaiming stake-at-risk puts the NRN back into their staking pool\n if (curStakeAtRisk > 0) {\n _stakeAtRiskInstance.reclaimNRN(curStakeAtRisk, tokenId, fighterOwner);\n amountStaked[tokenId] += curStakeAtRisk;\n // Added code below as solution\n+ globalStakedAmount += curStakeAtRisk;\n }\n```\n\n```diff\n{\n /// If the fighter does not have any points for this round, NRNs become at risk of being lost\n bool success = _neuronInstance.transfer(_stakeAtRiskAddress, curStakeAtRisk);\n if (success) {\n _stakeAtRiskInstance.updateAtRiskRecords(curStakeAtRisk, tokenId, fighterOwner);\n amountStaked[tokenId] -= curStakeAtRisk;\n // Added code below as solution\n+ globalStakedAmount -= curStakeAtRisk;\n }\n }\n```\n\nglobalStakedAmount should be updated to keep proper records of the storage values\n\n## [L-2] `RankedBattle::_addResultPoints` function does not emit events `Staked` or `Unstaked` when `amountStaked[tokenId]` is increased or reduced.\n\n**Occurences**: 2 times\n\n1. `RankedBattle::_addResultPoints`, line 465 RankedBattle.sol\n2. `RankedBattle::_addResultPoints`, line 500 RankedBattle.sol\n\n**Impact**: Doesnt follow proper practices and doesnt help readability of code and loss of information\n\n```d", "vulnerable_code": "```diff\n{\n /// If the fighter does not have any points for this round, NRNs become at risk of being lost\n bool success = _neuronInstance.transfer(_stakeAtRiskAddress, curStakeAtRisk);\n if (success) {\n _stakeAtRiskInstance.updateAtRiskRecords(curStakeAtRisk, tokenId, fighterOwner);\n amountStaked[tokenId] -= curStakeAtRisk;\n // Added code below as solution\n+ globalStakedAmount -= curStakeAtRisk;\n }\n }", "fixed_code": "```diff\nelse {\n /// If the fighter does not have any points for this round, NRNs become at risk of being lost\n bool success = _neuronInstance.transfer(_stakeAtRiskAddress, curStakeAtRisk);\n if (success) {\n _stakeAtRiskInstance.updateAtRiskRecords(curStakeAtRisk, tokenId, fighterOwner);\n amountStaked[tokenId] -= curStakeAtRisk;\n+ emit unStaked(msg.sender, amount)\n }\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/BigVeezus-Q.md", "collected_at": "2026-01-02T19:02:17.498618+00:00", "source_hash": "d631d5ecd9d126f355747e44cf38af9cc465e166d124bc703cb22616f402fe48", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 996, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "/// If the user has stake-at-risk for their fighter, reclaim a portion\n /// Reclaiming stake-at-risk puts the NRN back into their staking pool\n if (curStakeAtRisk > 0) {\n _stakeAtRiskInstance.reclaimNRN(curStakeAtRisk, tokenId, fighterOwner);\n amountStaked[tokenId] += curStakeAtRisk;\n // Added code below as solution\n+ globalStakedAmount += curStakeAtRisk;\n }", "primary_code_language": "diff", "primary_code_char_count": 454, "all_code_blocks": "// Code block 1 (diff):\n/// If the user has stake-at-risk for their fighter, reclaim a portion\n /// Reclaiming stake-at-risk puts the NRN back into their staking pool\n if (curStakeAtRisk > 0) {\n _stakeAtRiskInstance.reclaimNRN(curStakeAtRisk, tokenId, fighterOwner);\n amountStaked[tokenId] += curStakeAtRisk;\n // Added code below as solution\n+ globalStakedAmount += curStakeAtRisk;\n }\n\n// Code block 2 (diff):\n{\n /// If the fighter does not have any points for this round, NRNs become at risk of being lost\n bool success = _neuronInstance.transfer(_stakeAtRiskAddress, curStakeAtRisk);\n if (success) {\n _stakeAtRiskInstance.updateAtRiskRecords(curStakeAtRisk, tokenId, fighterOwner);\n amountStaked[tokenId] -= curStakeAtRisk;\n // Added code below as solution\n+ globalStakedAmount -= curStakeAtRisk;\n }\n }", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "/// If the user has stake-at-risk for their fighter, reclaim a portion\n /// Reclaiming stake-at-risk puts the NRN back into their staking pool\n if (curStakeAtRisk > 0) {\n _stakeAtRiskInstance.reclaimNRN(curStakeAtRisk, tokenId, fighterOwner);\n amountStaked[tokenId] += curStakeAtRisk;\n // Added code below as solution\n+ globalStakedAmount += curStakeAtRisk;\n }\n\n{\n /// If the fighter does not have any points for this round, NRNs become at risk of being lost\n bool success = _neuronInstance.transfer(_stakeAtRiskAddress, curStakeAtRisk);\n if (success) {\n _stakeAtRiskInstance.updateAtRiskRecords(curStakeAtRisk, tokenId, fighterOwner);\n amountStaked[tokenId] -= curStakeAtRisk;\n // Added code below as solution\n+ globalStakedAmount -= curStakeAtRisk;\n }\n }", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "```diff\n{\n /// If the fighter does not have any points for this round, NRNs become at risk of being lost\n bool success = _neuronInstance.transfer(_stakeAtRiskAddress, curStakeAtRisk);\n if (success) {\n _stakeAtRiskInstance.updateAtRiskRecords(curStakeAtRisk, tokenId, fighterOwner);\n amountStaked[tokenId] -= curStakeAtRisk;\n // Added code below as solution\n+ globalStakedAmount -= curStakeAtRisk;\n }\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "```diff\nelse {\n /// If the fighter does not have any points for this round, NRNs become at risk of being lost\n bool success = _neuronInstance.transfer(_stakeAtRiskAddress, curStakeAtRisk);\n if (success) {\n _stakeAtRiskInstance.updateAtRiskRecords(curStakeAtRisk, tokenId, fighterOwner);\n amountStaked[tokenId] -= curStakeAtRisk;\n+ emit unStaked(msg.sender, amount)\n }\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "05-ajna", "title": "aviggiano Q", "severity_raw": "QA", "severity": "qa", "description": "| QA Issue | Description |\n| --- | --- |\n| QA-01 | PositionManager NFT operator cannot interact with RewardsManager |\n| QA-02 | PositionManager nones start at 0, which is the default value for `uint256`, and can potentially cause issues |\n| QA-03 | Anyone can memorialize LP positions from another user |\n\n\n# QA-01: PositionManager NFT operator cannot interact with RewardsManager\n\n## Description\n\nThe PositionManager NFT operator can manage pool lenders positions in whole, as can be seen with the `mayInteract` modifier on `PositionManager.sol`, through `_isApprovedOrOwner`\n\n```solidity\n /**\n * @dev Modifier used to check if sender can interact with token id.\n * @param pool_ `Ajna` pool address.\n * @param tokenId_ Id of positions `NFT`.\n */\n modifier mayInteract(address pool_, uint256 tokenId_) {\n\n // revert if token id is not a valid / minted id\n _requireMinted(tokenId_);\n\n // revert if sender is not owner of or entitled to operate on token id\n if (!_isApprovedOrOwner(msg.sender, tokenId_)) revert NoAuth();\n\n // revert if the token id is not minted for given pool address\n if (pool_ != poolKey[tokenId_]) revert WrongPool();\n\n _;\n }\n```\n\nHowever, the operator cannot stake the NFT on `RewardsManager`.\n\n```solidity\n function stake(\n uint256 tokenId_\n ) external override {\n // ...\n\n // check that msg.sender is owner of tokenId\n if (IERC721(address(positionManager)).ownerOf(tokenId_) != msg.sender) revert NotOwnerOfDeposit();\n\n // ...\n }\n```\n\nThis greatly limits the benefits of approving the positions NFT to a third party, without any upsides.\n\n## Recommendation\n\nConsider using `_isApprovedOrOwner` to validate access control on `RewardsManager`. Appropriate care must be taken with rewards, as they should always be sent to the NFT `owner`, not to the `msg.sender`.\n\n# QA-02: PositionManager nones start at 0, which is the default value for `uint256`, and", "vulnerable_code": " /**\n * @dev Modifier used to check if sender can interact with token id.\n * @param pool_ `Ajna` pool address.\n * @param tokenId_ Id of positions `NFT`.\n */\n modifier mayInteract(address pool_, uint256 tokenId_) {\n\n // revert if token id is not a valid / minted id\n _requireMinted(tokenId_);\n\n // revert if sender is not owner of or entitled to operate on token id\n if (!_isApprovedOrOwner(msg.sender, tokenId_)) revert NoAuth();\n\n // revert if the token id is not minted for given pool address\n if (pool_ != poolKey[tokenId_]) revert WrongPool();\n\n _;\n }", "fixed_code": " function stake(\n uint256 tokenId_\n ) external override {\n // ...\n\n // check that msg.sender is owner of tokenId\n if (IERC721(address(positionManager)).ownerOf(tokenId_) != msg.sender) revert NotOwnerOfDeposit();\n\n // ...\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/aviggiano-Q.md", "collected_at": "2026-01-02T18:21:20.597752+00:00", "source_hash": "d6636e7b72641ae4b1f106b415cb335152f055b70c3cbc148cb84106f4f784f0", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 897, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "/**\n * @dev Modifier used to check if sender can interact with token id.\n * @param pool_ `Ajna` pool address.\n * @param tokenId_ Id of positions `NFT`.\n */\n modifier mayInteract(address pool_, uint256 tokenId_) {\n\n // revert if token id is not a valid / minted id\n _requireMinted(tokenId_);\n\n // revert if sender is not owner of or entitled to operate on token id\n if (!_isApprovedOrOwner(msg.sender, tokenId_)) revert NoAuth();\n\n // revert if the token id is not minted for given pool address\n if (pool_ != poolKey[tokenId_]) revert WrongPool();\n\n _;\n }", "primary_code_language": "solidity", "primary_code_char_count": 633, "all_code_blocks": "// Code block 1 (solidity):\n/**\n * @dev Modifier used to check if sender can interact with token id.\n * @param pool_ `Ajna` pool address.\n * @param tokenId_ Id of positions `NFT`.\n */\n modifier mayInteract(address pool_, uint256 tokenId_) {\n\n // revert if token id is not a valid / minted id\n _requireMinted(tokenId_);\n\n // revert if sender is not owner of or entitled to operate on token id\n if (!_isApprovedOrOwner(msg.sender, tokenId_)) revert NoAuth();\n\n // revert if the token id is not minted for given pool address\n if (pool_ != poolKey[tokenId_]) revert WrongPool();\n\n _;\n }\n\n// Code block 2 (solidity):\nfunction stake(\n uint256 tokenId_\n ) external override {\n // ...\n\n // check that msg.sender is owner of tokenId\n if (IERC721(address(positionManager)).ownerOf(tokenId_) != msg.sender) revert NotOwnerOfDeposit();\n\n // ...\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "/**\n * @dev Modifier used to check if sender can interact with token id.\n * @param pool_ `Ajna` pool address.\n * @param tokenId_ Id of positions `NFT`.\n */\n modifier mayInteract(address pool_, uint256 tokenId_) {\n\n // revert if token id is not a valid / minted id\n _requireMinted(tokenId_);\n\n // revert if sender is not owner of or entitled to operate on token id\n if (!_isApprovedOrOwner(msg.sender, tokenId_)) revert NoAuth();\n\n // revert if the token id is not minted for given pool address\n if (pool_ != poolKey[tokenId_]) revert WrongPool();\n\n _;\n }\n\nfunction stake(\n uint256 tokenId_\n ) external override {\n // ...\n\n // check that msg.sender is owner of tokenId\n if (IERC721(address(positionManager)).ownerOf(tokenId_) != msg.sender) revert NotOwnerOfDeposit();\n\n // ...\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " /**\n * @dev Modifier used to check if sender can interact with token id.\n * @param pool_ `Ajna` pool address.\n * @param tokenId_ Id of positions `NFT`.\n */\n modifier mayInteract(address pool_, uint256 tokenId_) {\n\n // revert if token id is not a valid / minted id\n _requireMinted(tokenId_);\n\n // revert if sender is not owner of or entitled to operate on token id\n if (!_isApprovedOrOwner(msg.sender, tokenId_)) revert NoAuth();\n\n // revert if the token id is not minted for given pool address\n if (pool_ != poolKey[tokenId_]) revert WrongPool();\n\n _;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function stake(\n uint256 tokenId_\n ) external override {\n // ...\n\n // check that msg.sender is owner of tokenId\n if (IERC721(address(positionManager)).ownerOf(tokenId_) != msg.sender) revert NotOwnerOfDeposit();\n\n // ...\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-biconomy", "title": "joestakey Q", "severity_raw": "Critical", "severity": "critical", "description": "## Summary\n### Low Risk\n| | Issue |\n|------|---------------------------------------------------------------------------------------------|\n| L-01 | `SmartAccountFactory.deployWallet` does not fully comply with EIP-4337 |\n| L-02 | Wrong error string |\n| L-03 | The \"no smart contract\" check in `VerifyingSingletonPaymaster.depositFor()` can be bypassed |\n\n### Non critical\n| | Issue |\n|------|----------------------------------------------------------------------------------|\n| NC-01| Typos |\n| NC-02| Tautologies |\n| NC-03| Redundant check |\n| NC-04| Open TODOs |\n \n\n\n## Low\n\n### [L\u201101] `SmartAccountFactory.deployWallet` does not fully comply with EIP-4337\n\nThis function uses [CREATE](https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccountFactory.sol#L57) to deploy the account.\n\nAs per [EIP-4337](https://eips.ethereum.org/EIPS/eip-4337#first-time-account-creation):\n\n```\nThe wallet creation itself is done by a \u201cfactory\u201d contract, with wallet-specific data.\nThe factory is expected to use CREATE2 (not CREATE) to create the wallet, so that the order of creation of wallets doesn\u2019t interfere with the generated addresses\n```\n\nConsider removing this function, as `deployCounterFactualWallet()` already allows creation of wallets.\n\n### [L\u201102] Wrong error string \n\nThere is a wrong error string in `SmartAccount.init()`. This can be misleading if ", "vulnerable_code": "The wallet creation itself is done by a \u201cfactory\u201d contract, with wallet-specific data.\nThe factory is expected to use CREATE2 (not CREATE) to create the wallet, so that the order of creation of wallets doesn\u2019t interfere with the generated addresses", "fixed_code": "171: require(_handler != address(0), \"Invalid Entrypoint\");", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/joestakey-Q.md", "collected_at": "2026-01-02T18:13:50.862415+00:00", "source_hash": "d6cc19deddc99b516b970f2cbb0dfcead8b95b1c22b696b2536e46db64d17eed", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 248, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "The wallet creation itself is done by a \u201cfactory\u201d contract, with wallet-specific data.\nThe factory is expected to use CREATE2 (not CREATE) to create the wallet, so that the order of creation of wallets doesn\u2019t interfere with the generated addresses", "primary_code_language": "unknown", "primary_code_char_count": 248, "all_code_blocks": "// Code block 1 (unknown):\nThe wallet creation itself is done by a \u201cfactory\u201d contract, with wallet-specific data.\nThe factory is expected to use CREATE2 (not CREATE) to create the wallet, so that the order of creation of wallets doesn\u2019t interfere with the generated addresses", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SmartAccountFactory.sol#L57", "github_files_list": "SmartAccountFactory.sol", "github_refs_count": 1, "vulnerable_code_actual": "The wallet creation itself is done by a \u201cfactory\u201d contract, with wallet-specific data.\nThe factory is expected to use CREATE2 (not CREATE) to create the wallet, so that the order of creation of wallets doesn\u2019t interfere with the generated addresses", "has_vulnerable_code_snippet": true, "fixed_code_actual": "171: require(_handler != address(0), \"Invalid Entrypoint\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ai-arena", "title": "K42 G", "severity_raw": "High", "severity": "high", "description": "## Gas Optimization Report for [AI-Arena](https://github.com/code-423n4/2024-02-ai-arena) by K42\n\n### Possible Optimization in [AiArenaHelper.sol](https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/AiArenaHelper.sol)\n\nPossible Optimization = \n- **Issue**: Storing attribute probabilities for each generation in a nested [mapping](https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/AiArenaHelper.sol#L30) introduces significant gas costs when updating these probabilities.\n- **Optimization**: Use a single-level mapping with a composite key combining generation and attribute name. This reduces the depth of mapping access and minimizes gas costs associated with storage operations.\n\nHere is the optimized code snippet: \n\n\n\n\n```solidity\n// Before Optimization\nmapping(uint256 => mapping(string => uint8[])) public attributeProbabilities;\n\n// After Optimization\nmapping(bytes32 => uint8[]) public attributeProbabilitiesOptimized;\n\nfunction _generateCompositeKey(uint256 generation, string memory attribute) private pure returns (bytes32) {\n return keccak256(abi.encodePacked(generation, attribute));\n}\n\nfunction addAttributeProbabilitiesOptimized(uint256 generation, uint8[][] memory probabilities) public {\n require(msg.sender == _ownerAddress, \"Only owner can add probabilities\");\n require(probabilities.length == attributes.length, \"Invalid probabilities length\");\n\n for (uint8 i = 0; i < attributes.length; i++) {\n bytes32 key = _generateCompositeKey(generation, attributes[i]);\n attributeProbabilitiesOptimized[key] = probabilities[i];\n }\n}\n```\n\n\n\n\n- Estimated gas saved = This change can significantly reduce gas costs by minimizing the depth of mapping access and the number of storage slots needed. The exact savings depend on the frequency and size of updates but expect reductions in the range of 20-30% for transactions involving these mappings.\n\n### Possible Optimizations in [FighterFarm.sol](https://github.com/code-423n4/2024-02-ai-arena", "vulnerable_code": "// Before Optimization\nmapping(uint256 => mapping(string => uint8[])) public attributeProbabilities;\n\n// After Optimization\nmapping(bytes32 => uint8[]) public attributeProbabilitiesOptimized;\n\nfunction _generateCompositeKey(uint256 generation, string memory attribute) private pure returns (bytes32) {\n return keccak256(abi.encodePacked(generation, attribute));\n}\n\nfunction addAttributeProbabilitiesOptimized(uint256 generation, uint8[][] memory probabilities) public {\n require(msg.sender == _ownerAddress, \"Only owner can add probabilities\");\n require(probabilities.length == attributes.length, \"Invalid probabilities length\");\n\n for (uint8 i = 0; i < attributes.length; i++) {\n bytes32 key = _generateCompositeKey(generation, attributes[i]);\n attributeProbabilitiesOptimized[key] = probabilities[i];\n }\n}", "fixed_code": "// Before optimization\nfunction updateModel(uint256 tokenId, string calldata modelHash, string calldata modelType) external {\n require(msg.sender == ownerOf(tokenId));\n fighters[tokenId].modelHash = modelHash;\n fighters[tokenId].modelType = modelType;\n numTrained[tokenId] += 1;\n totalNumTrained += 1;\n}\n\n// After optimization\nfunction updateModel(uint256 tokenId, string calldata modelHash, string calldata modelType) external {\n require(msg.sender == ownerOf(tokenId));\n fighters[tokenId].modelHash = modelHash;\n fighters[tokenId].modelType = modelType;\n emit ModelUpdated(tokenId, modelHash, modelType); // Use an event instead of modifying state\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/K42-G.md", "collected_at": "2026-01-02T19:02:29.576899+00:00", "source_hash": "d6fb9f27fe060da177cb926b1f3199ed40a39c66c79087210b7abb661bd6db7c", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 836, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "// Before Optimization\nmapping(uint256 => mapping(string => uint8[])) public attributeProbabilities;\n\n// After Optimization\nmapping(bytes32 => uint8[]) public attributeProbabilitiesOptimized;\n\nfunction _generateCompositeKey(uint256 generation, string memory attribute) private pure returns (bytes32) {\n return keccak256(abi.encodePacked(generation, attribute));\n}\n\nfunction addAttributeProbabilitiesOptimized(uint256 generation, uint8[][] memory probabilities) public {\n require(msg.sender == _ownerAddress, \"Only owner can add probabilities\");\n require(probabilities.length == attributes.length, \"Invalid probabilities length\");\n\n for (uint8 i = 0; i < attributes.length; i++) {\n bytes32 key = _generateCompositeKey(generation, attributes[i]);\n attributeProbabilitiesOptimized[key] = probabilities[i];\n }\n}", "primary_code_language": "solidity", "primary_code_char_count": 836, "all_code_blocks": "// Code block 1 (solidity):\n// Before Optimization\nmapping(uint256 => mapping(string => uint8[])) public attributeProbabilities;\n\n// After Optimization\nmapping(bytes32 => uint8[]) public attributeProbabilitiesOptimized;\n\nfunction _generateCompositeKey(uint256 generation, string memory attribute) private pure returns (bytes32) {\n return keccak256(abi.encodePacked(generation, attribute));\n}\n\nfunction addAttributeProbabilitiesOptimized(uint256 generation, uint8[][] memory probabilities) public {\n require(msg.sender == _ownerAddress, \"Only owner can add probabilities\");\n require(probabilities.length == attributes.length, \"Invalid probabilities length\");\n\n for (uint8 i = 0; i < attributes.length; i++) {\n bytes32 key = _generateCompositeKey(generation, attributes[i]);\n attributeProbabilitiesOptimized[key] = probabilities[i];\n }\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "// Before Optimization\nmapping(uint256 => mapping(string => uint8[])) public attributeProbabilities;\n\n// After Optimization\nmapping(bytes32 => uint8[]) public attributeProbabilitiesOptimized;\n\nfunction _generateCompositeKey(uint256 generation, string memory attribute) private pure returns (bytes32) {\n return keccak256(abi.encodePacked(generation, attribute));\n}\n\nfunction addAttributeProbabilitiesOptimized(uint256 generation, uint8[][] memory probabilities) public {\n require(msg.sender == _ownerAddress, \"Only owner can add probabilities\");\n require(probabilities.length == attributes.length, \"Invalid probabilities length\");\n\n for (uint8 i = 0; i < attributes.length; i++) {\n bytes32 key = _generateCompositeKey(generation, attributes[i]);\n attributeProbabilitiesOptimized[key] = probabilities[i];\n }\n}", "github_refs_formatted": "AiArenaHelper.sol, AiArenaHelper.sol#L30", "github_files_list": "AiArenaHelper.sol", "github_refs_count": 2, "vulnerable_code_actual": "// Before Optimization\nmapping(uint256 => mapping(string => uint8[])) public attributeProbabilities;\n\n// After Optimization\nmapping(bytes32 => uint8[]) public attributeProbabilitiesOptimized;\n\nfunction _generateCompositeKey(uint256 generation, string memory attribute) private pure returns (bytes32) {\n return keccak256(abi.encodePacked(generation, attribute));\n}\n\nfunction addAttributeProbabilitiesOptimized(uint256 generation, uint8[][] memory probabilities) public {\n require(msg.sender == _ownerAddress, \"Only owner can add probabilities\");\n require(probabilities.length == attributes.length, \"Invalid probabilities length\");\n\n for (uint8 i = 0; i < attributes.length; i++) {\n bytes32 key = _generateCompositeKey(generation, attributes[i]);\n attributeProbabilitiesOptimized[key] = probabilities[i];\n }\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "// Before optimization\nfunction updateModel(uint256 tokenId, string calldata modelHash, string calldata modelType) external {\n require(msg.sender == ownerOf(tokenId));\n fighters[tokenId].modelHash = modelHash;\n fighters[tokenId].modelType = modelType;\n numTrained[tokenId] += 1;\n totalNumTrained += 1;\n}\n\n// After optimization\nfunction updateModel(uint256 tokenId, string calldata modelHash, string calldata modelType) external {\n require(msg.sender == ownerOf(tokenId));\n fighters[tokenId].modelHash = modelHash;\n fighters[tokenId].modelType = modelType;\n emit ModelUpdated(tokenId, modelHash, modelType); // Use an event instead of modifying state\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "11-kelp", "title": "SBSecurity Q", "severity_raw": "Critical", "severity": "critical", "description": "### Low Risk\n\n| Count | Title |\n| --- | --- |\n| [L-01](#l-01-no-removesupportedasset-function-in-the-lrtconfig) | No removeSupportedAsset function in the LRTConfig |\n| [L-02](#l-02-cbeth-has-blacklisting) | cbETH has blacklisting |\n| [L-03](#l-03-consider-use-stethuds-oracle) | Consider use stETH/UDS oracle |\n\n| Total Low Risk Issues | 3 |\n| --- | --- |\n\n### Non-Critical\n\n| Count | Title |\n| --- | --- |\n| [NC-01](#n01-missing-events-in-sensitive-functions) | Missing events in sensitive functions |\n| [NC-02](#n02-nodedelegatoraddedinqueue-event-does-not-follow-camalcase) | NodeDelegatorAddedinQueue event does not follow CamalCase |\n| [NC-03](#n03-istrategy-is-not-up-to-date-with-eigenlayeristrategy) | IStrategy is not up to date with EigenLayer::IStrategy |\n| [NC-04](#n04-istrategy-is-not-up-to-date-with-eigenlayeristrategy) | No withdraw functionality |\n\n| Total Non-Critical Issues | 4 |\n| --- | --- |\n\n## Low Risks\n\n## [L-01] No removeSupportedAsset function in the LRTConfig\n\n**Issue Description:** The contract provides a way to add new supported assets through the `addNewSupportedAsset()` function, but there is no corresponding function to remove supported assets.\n\nWithout the ability to remove supported assets, the contract may face challenges in adapting to changing circumstances, such as changes in the project's strategy, token ecosystem, or regulatory requirements.\n\n**Recommendation:** Consider adding a function like **`removeSupportedAsset`** that allows the contract owner or another authorized role to remove an asset from the list of supported assets\n\n## [L-02] cbETH has blacklisting\n\n**Issue Description:** The blacklisting mechanism in the `CBETH` token introduces potential complications and risks across various stages of the transaction lifecycle, from initial deposits in the LRTDepositPool to activities within the NodeDelegator and Eigen Strategy. If the `LRTDepositPool` or any of the `NodeDelegator` is blacklisted, it implies that the associated tokens wi", "vulnerable_code": "File: src/LRTDepositPool.sol\n\n183: function transferAssetToNodeDelegator(\n184: uint256 ndcIndex,\n185: address asset,\n186: uint256 amount\n187: )\n188: external\n189: nonReentrant\n190: onlyLRTManager\n191: onlySupportedAsset(asset)\n192: {\n193: address nodeDelegator = nodeDelegatorQueue[ndcIndex];\n194: if (!IERC20(asset).transfer(nodeDelegator, amount)) {\n195: revert TokenTransferFailed();\n196: }\n\n // @audit missing event\n197: }", "fixed_code": "File: src/NodeDelegator.sol\n\n38: function maxApproveToEigenStrategyManager(address asset)\n39: external\n40: override\n41: onlySupportedAsset(asset)\n42: onlyLRTManager\n43: {\n44: address eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);\n45: IERC20(asset).approve(eigenlayerStrategyManagerAddress, type(uint256).max);\n\n // @audit missing event\n46: }\n\n74: function transferBackToLRTDepositPool(\n75: address asset,\n76: uint256 amount\n77: )\n78: external\n79: whenNotPaused\n80: nonReentrant\n81: onlySupportedAsset(asset)\n82: onlyLRTManager\n83: {\n84: address lrtDepositPool = lrtConfig.getContract(LRTConstants.LRT_DEPOSIT_POOL);\n85: \n86: if (!IERC20(asset).transfer(lrtDepositPool, amount)) {\n87: revert TokenTransferFailed();\n88: }\n // @audit missing event\n89: }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/SBSecurity-Q.md", "collected_at": "2026-01-02T18:27:38.083318+00:00", "source_hash": "d7ee3420bfe3e02943a48e5d261c407fc9cd39b81cdfb871242b402857ec3a93", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: src/LRTDepositPool.sol\n\n183: function transferAssetToNodeDelegator(\n184: uint256 ndcIndex,\n185: address asset,\n186: uint256 amount\n187: )\n188: external\n189: nonReentrant\n190: onlyLRTManager\n191: onlySupportedAsset(asset)\n192: {\n193: address nodeDelegator = nodeDelegatorQueue[ndcIndex];\n194: if (!IERC20(asset).transfer(nodeDelegator, amount)) {\n195: revert TokenTransferFailed();\n196: }\n\n // @audit missing event\n197: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: src/NodeDelegator.sol\n\n38: function maxApproveToEigenStrategyManager(address asset)\n39: external\n40: override\n41: onlySupportedAsset(asset)\n42: onlyLRTManager\n43: {\n44: address eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);\n45: IERC20(asset).approve(eigenlayerStrategyManagerAddress, type(uint256).max);\n\n // @audit missing event\n46: }\n\n74: function transferBackToLRTDepositPool(\n75: address asset,\n76: uint256 amount\n77: )\n78: external\n79: whenNotPaused\n80: nonReentrant\n81: onlySupportedAsset(asset)\n82: onlyLRTManager\n83: {\n84: address lrtDepositPool = lrtConfig.getContract(LRTConstants.LRT_DEPOSIT_POOL);\n85: \n86: if (!IERC20(asset).transfer(lrtDepositPool, amount)) {\n87: revert TokenTransferFailed();\n88: }\n // @audit missing event\n89: }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-ondo", "title": "Awesome G", "severity_raw": "Low", "severity": "low", "description": "# 1. Splitting `require()` Statements That Use `&&` Saves Gas - (Saves ~`3` Gas per `&&`)\n\nInstead of using the `&&` operator in a single require statement to check multiple conditions, using various require statements with 1 condition per require statement will save ~3 GAS per `&&`.\n\nAffected lines of code:\n\n- [OndoPriceOracleV2.sol#L292-L296](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/OndoPriceOracleV2.sol#L292-L296)\n- [CTokenModified.sol#L45-L48](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cToken/CTokenModified.sol#L45-L48)\n\n# 2. Save Gas With `payable` Functions\n\nMarking functions as `payable` will be cheaper (by ~20 gas) than using non-`payable` functions because the Solidity compiler inserts a check into non-`payable` functions that requires `msg.value` to be zero.\n\nFor instance, the code at [lines 144-L150](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistry.sol#L144-L150) can be refactored as:\n\n```solidity\n function assignRoletoKYCGroup(\n uint256 kycRequirementGroup,\n bytes32 role\n ) external payable onlyRole(REGISTRY_ADMIN) {\n kycGroupRoles[kycRequirementGroup] = role;\n emit RoleAssignedToKYCGroup(kycRequirementGroup, role);\n }\n```\n\n> **Note**: Although this optimization can save gas, it is important to be aware of the security considerations involving Ether held in contracts that it introduces.\n> More information on this topic can be found in the [Solidity Compiler Discussion](https://github.com/ethereum/solidity/issues/12539).\n\nAffected line of code:\n\n- [KYCRegistry.sol#L144-L150](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistry.sol#L144-L150)\n\n# 3. Using `Storage` Instead Of `Memory` For Structs/Arrays Saves Gas\n\nWhen fetching data from a `storage` location, assigning the data to a `memory` variable causes all fields of the struct/array to be read from `storage`, which incurs a Gcoldsload (2100 gas) for each fiel", "vulnerable_code": " function assignRoletoKYCGroup(\n uint256 kycRequirementGroup,\n bytes32 role\n ) external payable onlyRole(REGISTRY_ADMIN) {\n kycGroupRoles[kycRequirementGroup] = role;\n emit RoleAssignedToKYCGroup(kycRequirementGroup, role);\n }", "fixed_code": "Line 506: Exp storage exchangeRate = Exp({mantissa: exchangeRateStoredInternal()});", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/Awesome-G.md", "collected_at": "2026-01-02T18:14:27.039298+00:00", "source_hash": "d7fd95ce60f49847b5330ef6b27472cfd2a5fac6ccf210d3455985c2c27fc248", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 239, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function assignRoletoKYCGroup(\n uint256 kycRequirementGroup,\n bytes32 role\n ) external payable onlyRole(REGISTRY_ADMIN) {\n kycGroupRoles[kycRequirementGroup] = role;\n emit RoleAssignedToKYCGroup(kycRequirementGroup, role);\n }", "primary_code_language": "solidity", "primary_code_char_count": 239, "all_code_blocks": "// Code block 1 (solidity):\nfunction assignRoletoKYCGroup(\n uint256 kycRequirementGroup,\n bytes32 role\n ) external payable onlyRole(REGISTRY_ADMIN) {\n kycGroupRoles[kycRequirementGroup] = role;\n emit RoleAssignedToKYCGroup(kycRequirementGroup, role);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function assignRoletoKYCGroup(\n uint256 kycRequirementGroup,\n bytes32 role\n ) external payable onlyRole(REGISTRY_ADMIN) {\n kycGroupRoles[kycRequirementGroup] = role;\n emit RoleAssignedToKYCGroup(kycRequirementGroup, role);\n }", "github_refs_formatted": "OndoPriceOracleV2.sol#L292-L296, CTokenModified.sol#L45-L48, KYCRegistry.sol#L144-L150", "github_files_list": "OndoPriceOracleV2.sol, CTokenModified.sol, KYCRegistry.sol", "github_refs_count": 3, "vulnerable_code_actual": " function assignRoletoKYCGroup(\n uint256 kycRequirementGroup,\n bytes32 role\n ) external payable onlyRole(REGISTRY_ADMIN) {\n kycGroupRoles[kycRequirementGroup] = role;\n emit RoleAssignedToKYCGroup(kycRequirementGroup, role);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "Line 506: Exp storage exchangeRate = Exp({mantissa: exchangeRateStoredInternal()});", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "04-caviar", "title": "niser93 G", "severity_raw": "High", "severity": "high", "description": "## GAS-01 - Use equivalent expression\n\n### Founded in [EthRouter.sol](https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol)\n* [[L101-L103]](https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L101-L103)\n* [[L154-L156]](https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L154-L156)\n* [[L228-L230]](https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L228-L230)\n* [[L256-L258]](https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L256-L258)\n```\nif (block.timestamp > deadline && deadline != 0) {\n\trevert DeadlinePassed();\n}\n```\n\n\n### Description\n```\nif (block.timestamp > deadline && deadline != 0) {\n revert DeadlinePassed();\n }\n```\nbecomes\n```\nif (!(block.timestamp <= deadline || deadline == 0)) {\n revert DeadlinePassed();\n }\n```\n\n### Proof of concept\nExpression equality (using boolean formulas)\n```\nA>B && C!=0 is equivalent to\n\n!(!(A>B && C!=0)) is equivalent to\n\n!(!(A>B) || !(C!=0)) is equivalent to\n\n!(A<=B || C==0)\n```\n\nWith Remix IDE and compiling following code using optimization with 10000:\n\n```\ncontract Attempt{\n error DeadlinePassed();\n\n function tryGas(uint256 deadline) public {\n if (block.timestamp > deadline && deadline != 0) {\n revert DeadlinePassed();\n }\n }\n}\n\nExecution cost: 290\n```\n\n```\ncontract Attempt{\n error DeadlinePassed();\n\n function tryGas(uint256 deadline) public {\n if (!(block.timestamp <= deadline || deadline == 0)) {\n revert DeadlinePassed();\n }\n }\n}\nExecution cost: 284\n```\n\n\n## GAS-02 - Require costs less gas than revert + Error\n\n### Founded in [EthRouter.sol](https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol)\n* [[L101-L103]](https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L101-L103)\n* [[L154-L156]](https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.so", "vulnerable_code": "if (block.timestamp > deadline && deadline != 0) {\n\trevert DeadlinePassed();\n}", "fixed_code": "if (block.timestamp > deadline && deadline != 0) {\n revert DeadlinePassed();\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/niser93-G.md", "collected_at": "2026-01-02T18:20:45.871453+00:00", "source_hash": "d84aa54e391f3de76e618bc1de37a5d0cb9d3efb86100e437e2a9aa38b87a186", "code_block_count": 6, "solidity_block_count": 0, "total_code_chars": 881, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "if (block.timestamp > deadline && deadline != 0) {\n\trevert DeadlinePassed();\n}", "primary_code_language": "unknown", "primary_code_char_count": 78, "all_code_blocks": "// Code block 1 (unknown):\nif (block.timestamp > deadline && deadline != 0) {\n\trevert DeadlinePassed();\n}\n\n// Code block 2 (unknown):\nif (block.timestamp > deadline && deadline != 0) {\n revert DeadlinePassed();\n }\n\n// Code block 3 (unknown):\nif (!(block.timestamp <= deadline || deadline == 0)) {\n revert DeadlinePassed();\n }\n\n// Code block 4 (unknown):\nA>B && C!=0 is equivalent to\n\n!(!(A>B && C!=0)) is equivalent to\n\n!(!(A>B) || !(C!=0)) is equivalent to\n\n!(A<=B || C==0)\n\n// Code block 5 (unknown):\ncontract Attempt{\n error DeadlinePassed();\n\n function tryGas(uint256 deadline) public {\n if (block.timestamp > deadline && deadline != 0) {\n revert DeadlinePassed();\n }\n }\n}\n\nExecution cost: 290\n\n// Code block 6 (unknown):\ncontract Attempt{\n error DeadlinePassed();\n\n function tryGas(uint256 deadline) public {\n if (!(block.timestamp <= deadline || deadline == 0)) {\n revert DeadlinePassed();\n }\n }\n}\nExecution cost: 284", "all_code_blocks_count": 6, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "EthRouter.sol, EthRouter.sol#L101-L103, EthRouter.sol#L154-L156, EthRouter.sol#L228-L230, EthRouter.sol#L256-L258", "github_files_list": "EthRouter.sol", "github_refs_count": 5, "vulnerable_code_actual": "if (block.timestamp > deadline && deadline != 0) {\n\trevert DeadlinePassed();\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "if (block.timestamp > deadline && deadline != 0) {\n revert DeadlinePassed();\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 12} {"source": "c4", "protocol": "02-ai-arena", "title": "Jean_Pierre_Polnaref G", "severity_raw": "High", "severity": "high", "description": "# c4udit Report\n\n## Files analyzed\n- 2024-02-ai-arena/src/AiArenaHelper.sol\n- 2024-02-ai-arena/src/FighterFarm.sol\n- 2024-02-ai-arena/src/GameItems.sol\n- 2024-02-ai-arena/src/MergingPool.sol\n- 2024-02-ai-arena/src/Neuron.sol\n- 2024-02-ai-arena/src/RankedBattle.sol\n- 2024-02-ai-arena/src/StakeAtRisk.sol\n- 2024-02-ai-arena/src/VoltageManager.sol\n\n## Issues found\n\n### Don't Initialize Variables with Default Value\n\n#### Impact\nIssue Information: [G001](https://github.com/byterocket/c4-common-issues/blob/main/0-Gas-Optimizations.md#g001---dont-initialize-variables-with-default-value)\n\n#### Findings:\n```\n2024-02-ai-arena/src/AiArenaHelper.sol::48 => for (uint8 i = 0; i < attributesLength; i++) {\n2024-02-ai-arena/src/AiArenaHelper.sol::73 => for (uint8 i = 0; i < attributesLength; i++) {\n2024-02-ai-arena/src/AiArenaHelper.sol::99 => for (uint8 i = 0; i < attributesLength; i++) {\n2024-02-ai-arena/src/AiArenaHelper.sol::136 => for (uint8 i = 0; i < attributesLength; i++) {\n2024-02-ai-arena/src/AiArenaHelper.sol::148 => for (uint8 i = 0; i < attributesLength; i++) {\n2024-02-ai-arena/src/AiArenaHelper.sol::176 => uint256 cumProb = 0;\n2024-02-ai-arena/src/AiArenaHelper.sol::178 => for (uint8 i = 0; i < attrProbabilitiesLength; i++) {\n2024-02-ai-arena/src/FighterFarm.sol::211 => for (uint16 i = 0; i < totalToMint; i++) {\n2024-02-ai-arena/src/FighterFarm.sol::249 => for (uint16 i = 0; i < mintpassIdsToBurn.length; i++) {\n2024-02-ai-arena/src/MergingPool.sol::124 => for (uint256 i = 0; i < winnersLength; i++) {\n2024-02-ai-arena/src/MergingPool.sol::147 => uint32 claimIndex = 0;\n2024-02-ai-arena/src/MergingPool.sol::152 => for (uint32 j = 0; j < winnersLength; j++) {\n2024-02-ai-arena/src/MergingPool.sol::174 => uint256 numRewards = 0;\n2024-02-ai-arena/src/MergingPool.sol::178 => for (uint32 j = 0; j < winnersLength; j++) {\n2024-02-ai-arena/src/MergingPool.sol::207 => for (uint256 i = 0; i < maxId; i++) {\n2024-02-ai-arena/src/Neuron.sol::131 => for (uint32 i = 0; i < recipientsLengt", "vulnerable_code": "2024-02-ai-arena/src/AiArenaHelper.sol::48 => for (uint8 i = 0; i < attributesLength; i++) {\n2024-02-ai-arena/src/AiArenaHelper.sol::73 => for (uint8 i = 0; i < attributesLength; i++) {\n2024-02-ai-arena/src/AiArenaHelper.sol::99 => for (uint8 i = 0; i < attributesLength; i++) {\n2024-02-ai-arena/src/AiArenaHelper.sol::136 => for (uint8 i = 0; i < attributesLength; i++) {\n2024-02-ai-arena/src/AiArenaHelper.sol::148 => for (uint8 i = 0; i < attributesLength; i++) {\n2024-02-ai-arena/src/AiArenaHelper.sol::176 => uint256 cumProb = 0;\n2024-02-ai-arena/src/AiArenaHelper.sol::178 => for (uint8 i = 0; i < attrProbabilitiesLength; i++) {\n2024-02-ai-arena/src/FighterFarm.sol::211 => for (uint16 i = 0; i < totalToMint; i++) {\n2024-02-ai-arena/src/FighterFarm.sol::249 => for (uint16 i = 0; i < mintpassIdsToBurn.length; i++) {\n2024-02-ai-arena/src/MergingPool.sol::124 => for (uint256 i = 0; i < winnersLength; i++) {\n2024-02-ai-arena/src/MergingPool.sol::147 => uint32 claimIndex = 0;\n2024-02-ai-arena/src/MergingPool.sol::152 => for (uint32 j = 0; j < winnersLength; j++) {\n2024-02-ai-arena/src/MergingPool.sol::174 => uint256 numRewards = 0;\n2024-02-ai-arena/src/MergingPool.sol::178 => for (uint32 j = 0; j < winnersLength; j++) {\n2024-02-ai-arena/src/MergingPool.sol::207 => for (uint256 i = 0; i < maxId; i++) {\n2024-02-ai-arena/src/Neuron.sol::131 => for (uint32 i = 0; i < recipientsLength; i++) {\n2024-02-ai-arena/src/RankedBattle.sol::296 => uint256 claimableNRN = 0;\n2024-02-ai-arena/src/RankedBattle.sol::387 => uint256 claimableNRN = 0;\n2024-02-ai-arena/src/RankedBattle.sol::427 => uint256 points = 0;", "fixed_code": "2024-02-ai-arena/src/AiArenaHelper.sol::47 => uint256 attributesLength = attributes.length;\n2024-02-ai-arena/src/AiArenaHelper.sol::70 => require(attributeDivisors.length == attributes.length);\n2024-02-ai-arena/src/AiArenaHelper.sol::72 => uint256 attributesLength = attributes.length;\n2024-02-ai-arena/src/AiArenaHelper.sol::96 => uint256[] memory finalAttributeProbabilityIndexes = new uint[](attributes.length);\n2024-02-ai-arena/src/AiArenaHelper.sol::98 => uint256 attributesLength = attributes.length;\n2024-02-ai-arena/src/AiArenaHelper.sol::133 => require(probabilities.length == 6, \"Invalid number of attribute arrays\");\n2024-02-ai-arena/src/AiArenaHelper.sol::135 => uint256 attributesLength = attributes.length;\n2024-02-ai-arena/src/AiArenaHelper.sol::147 => uint256 attributesLength = attributes.length;\n2024-02-ai-arena/src/AiArenaHelper.sol::177 => uint256 attrProbabilitiesLength = attrProbabilities.length;\n2024-02-ai-arena/src/FighterFarm.sol::208 => require(modelHashes.length == totalToMint && modelTypes.length == totalToMint);\n2024-02-ai-arena/src/FighterFarm.sol::214 => uint256(keccak256(abi.encode(msg.sender, fighters.length))),\n2024-02-ai-arena/src/FighterFarm.sol::225 => /// @dev This function requires the length of all input arrays to be equal.\n2024-02-ai-arena/src/FighterFarm.sol::244 => mintpassIdsToBurn.length == mintPassDnas.length &&\n2024-02-ai-arena/src/FighterFarm.sol::245 => mintPassDnas.length == fighterTypes.length &&\n2024-02-ai-arena/src/FighterFarm.sol::246 => fighterTypes.length == modelHashes.length &&\n2024-02-ai-arena/src/FighterFarm.sol::247 => modelHashes.length == modelTypes.length\n2024-02-ai-arena/src/FighterFarm.sol::249 => for (uint16 i = 0; i < mintpassIdsToBurn.length; i++) {\n2024-02-ai-arena/src/FighterFarm.sol::324 => uint256(keccak256(abi.encode(msg.sender, fighters.length))),\n2024-02-ai-arena/src/FighterFarm.sol::507 => uint256 newId = fighters.length;\n2024-02-ai-arena/src/GameItems.sol::258 => if (bytes(customURI).length > 0) {\n20", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/Jean_Pierre_Polnaref-G.md", "collected_at": "2026-01-02T19:02:28.686758+00:00", "source_hash": "d8f45f8ef1d2c448485333a159d1488e1d51c72826ae7f93435655ac10fe131b", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "2024-02-ai-arena/src/AiArenaHelper.sol::48 => for (uint8 i = 0; i < attributesLength; i++) {\n2024-02-ai-arena/src/AiArenaHelper.sol::73 => for (uint8 i = 0; i < attributesLength; i++) {\n2024-02-ai-arena/src/AiArenaHelper.sol::99 => for (uint8 i = 0; i < attributesLength; i++) {\n2024-02-ai-arena/src/AiArenaHelper.sol::136 => for (uint8 i = 0; i < attributesLength; i++) {\n2024-02-ai-arena/src/AiArenaHelper.sol::148 => for (uint8 i = 0; i < attributesLength; i++) {\n2024-02-ai-arena/src/AiArenaHelper.sol::176 => uint256 cumProb = 0;\n2024-02-ai-arena/src/AiArenaHelper.sol::178 => for (uint8 i = 0; i < attrProbabilitiesLength; i++) {\n2024-02-ai-arena/src/FighterFarm.sol::211 => for (uint16 i = 0; i < totalToMint; i++) {\n2024-02-ai-arena/src/FighterFarm.sol::249 => for (uint16 i = 0; i < mintpassIdsToBurn.length; i++) {\n2024-02-ai-arena/src/MergingPool.sol::124 => for (uint256 i = 0; i < winnersLength; i++) {\n2024-02-ai-arena/src/MergingPool.sol::147 => uint32 claimIndex = 0;\n2024-02-ai-arena/src/MergingPool.sol::152 => for (uint32 j = 0; j < winnersLength; j++) {\n2024-02-ai-arena/src/MergingPool.sol::174 => uint256 numRewards = 0;\n2024-02-ai-arena/src/MergingPool.sol::178 => for (uint32 j = 0; j < winnersLength; j++) {\n2024-02-ai-arena/src/MergingPool.sol::207 => for (uint256 i = 0; i < maxId; i++) {\n2024-02-ai-arena/src/Neuron.sol::131 => for (uint32 i = 0; i < recipientsLength; i++) {\n2024-02-ai-arena/src/RankedBattle.sol::296 => uint256 claimableNRN = 0;\n2024-02-ai-arena/src/RankedBattle.sol::387 => uint256 claimableNRN = 0;\n2024-02-ai-arena/src/RankedBattle.sol::427 => uint256 points = 0;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "2024-02-ai-arena/src/AiArenaHelper.sol::47 => uint256 attributesLength = attributes.length;\n2024-02-ai-arena/src/AiArenaHelper.sol::70 => require(attributeDivisors.length == attributes.length);\n2024-02-ai-arena/src/AiArenaHelper.sol::72 => uint256 attributesLength = attributes.length;\n2024-02-ai-arena/src/AiArenaHelper.sol::96 => uint256[] memory finalAttributeProbabilityIndexes = new uint[](attributes.length);\n2024-02-ai-arena/src/AiArenaHelper.sol::98 => uint256 attributesLength = attributes.length;\n2024-02-ai-arena/src/AiArenaHelper.sol::133 => require(probabilities.length == 6, \"Invalid number of attribute arrays\");\n2024-02-ai-arena/src/AiArenaHelper.sol::135 => uint256 attributesLength = attributes.length;\n2024-02-ai-arena/src/AiArenaHelper.sol::147 => uint256 attributesLength = attributes.length;\n2024-02-ai-arena/src/AiArenaHelper.sol::177 => uint256 attrProbabilitiesLength = attrProbabilities.length;\n2024-02-ai-arena/src/FighterFarm.sol::208 => require(modelHashes.length == totalToMint && modelTypes.length == totalToMint);\n2024-02-ai-arena/src/FighterFarm.sol::214 => uint256(keccak256(abi.encode(msg.sender, fighters.length))),\n2024-02-ai-arena/src/FighterFarm.sol::225 => /// @dev This function requires the length of all input arrays to be equal.\n2024-02-ai-arena/src/FighterFarm.sol::244 => mintpassIdsToBurn.length == mintPassDnas.length &&\n2024-02-ai-arena/src/FighterFarm.sol::245 => mintPassDnas.length == fighterTypes.length &&\n2024-02-ai-arena/src/FighterFarm.sol::246 => fighterTypes.length == modelHashes.length &&\n2024-02-ai-arena/src/FighterFarm.sol::247 => modelHashes.length == modelTypes.length\n2024-02-ai-arena/src/FighterFarm.sol::249 => for (uint16 i = 0; i < mintpassIdsToBurn.length; i++) {\n2024-02-ai-arena/src/FighterFarm.sol::324 => uint256(keccak256(abi.encode(msg.sender, fighters.length))),\n2024-02-ai-arena/src/FighterFarm.sol::507 => uint256 newId = fighters.length;\n2024-02-ai-arena/src/GameItems.sol::258 => if (bytes(customURI).length > 0) {\n20", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-asymmetry", "title": "Awesome Q", "severity_raw": "High", "severity": "high", "description": "# 1. Use newer versions of solidity\n\nConsider using the latest version of solidity as newer versions have bug fixes, as well as new features.\n\nTo see what the latest versions have to offer check out the [Change Log](https://github.com/ethereum/solidity/blob/develop/Changelog.md)\n\nAffected lines of code:\n\n- [WstEth.sol#L2](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/WstEth.sol#L2)\n\n- [SfrxEth.sol#L2](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/SfrxEth.sol#L2)\n\n- [SafEth.sol#L2](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L2)\n\n- [Reth.sol#L2](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/Reth.sol#L2)\n\n# 2. Improve the Readability by following modularity principles\n\nTo make your Solidity code more readable, update your import statements to only include the specific contracts or objects that you need.\n\nThis practice, known as modular programming, helps to keep the code cleaner, maintainable and more organized.\n\nAn example of this syntax is shown below:\n\n```solidity\nimport {contract1, contract2} from \"filename.sol\";\n```\n\nAffected line of code:\n\n- [WstEth.sol#L4](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/WstEth.sol#L4-L8)\n\n- [Reth.sol#L4-L15](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/Reth.sol#L4-L15)\n- [SafEth.sol#L4-L11](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L4-L11)\n- [SfrxEth.sol#L4-L9](https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/SfrxEth.sol#L4", "vulnerable_code": "import {contract1, contract2} from \"filename.sol\";", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Awesome-Q.md", "collected_at": "2026-01-02T18:17:51.264602+00:00", "source_hash": "d9041051c1e3f1cc4f2533f2c445b2363996221a3c5d8140cb96bf7284e2bb14", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 50, "github_ref_count": 8, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "import {contract1, contract2} from \"filename.sol\";", "primary_code_language": "solidity", "primary_code_char_count": 50, "all_code_blocks": "// Code block 1 (solidity):\nimport {contract1, contract2} from \"filename.sol\";", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "import {contract1, contract2} from \"filename.sol\";", "github_refs_formatted": "WstEth.sol#L2, SfrxEth.sol#L2, SafEth.sol#L2, Reth.sol#L2, WstEth.sol#L4-L8, Reth.sol#L4-L15, SafEth.sol#L4-L11, SfrxEth.sol#L4", "github_files_list": "SfrxEth.sol, Reth.sol, WstEth.sol, SafEth.sol", "github_refs_count": 8, "vulnerable_code_actual": "import {contract1, contract2} from \"filename.sol\";", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "01-salty", "title": "csanuragjain Q", "severity_raw": "High", "severity": "high", "description": "## No_change will be chosen incorrectly\n\nLines of code \nhttps://github.com/code-423n4/2024-01-salty/blob/main/src/dao/Proposals.sol#L372-L380\n\nImpact\nIn case of tie between Increase and Decrease, No change will be chosen\n\nProof of Concept\n1. The winning parameter is chosen using:\n\n```\nfunction winningParameterVote( uint256 ballotID ) external view returns (Vote)\n\t\t{\n\t\tmapping(Vote=>uint256) storage votes = _votesCastForBallot[ballotID];\n\n\t\tuint256 increaseTotal = votes[Vote.INCREASE];\n\t\tuint256 decreaseTotal = votes[Vote.DECREASE];\n\t\tuint256 noChangeTotal = votes[Vote.NO_CHANGE];\n\n\t\tif ( increaseTotal > decreaseTotal )\n\t\tif ( increaseTotal > noChangeTotal )\n\t\t\treturn Vote.INCREASE;\n\n\t\tif ( decreaseTotal > increaseTotal )\n\t\tif ( decreaseTotal > noChangeTotal )\n\t\t\treturn Vote.DECREASE;\n\n\t\treturn Vote.NO_CHANGE;\n\t\t}\n```\n\n2. Let's say INCREASE and DECREASE are both 100 and NO_CHANGE is 0. In this case below flow happens:\n\n```\nincreaseTotal > decreaseTotal which is 100>100 which is false\ndecreaseTotal > increaseTotal which is 100>100 which is false\nSo Vote.NO_CHANGE is returned\n```\n\n3. So in this case No_change is selected even though noone voted for NO_CHANGE and all votes were for Increase and Decrease\n\nRecommendation\nDocument this behavior so that Users are aware\n\n## Unfair Ballot selection\n\nLines of code\nhttps://github.com/code-423n4/2024-01-salty/blob/main/src/dao/Proposals.sol#L431\n\nImpact\nBallot with highest yes vote won't be selected right away, for token whitelisting under certain circumstances. Ballot which are created early are given preference which might not be fair always\n\nProof of Concept\n1. Lets say 3 ballots exists for token whitelisting\n2. Below are the param used\n\n```md\nquorum=100\n\nBallot 1:\nyesVotes=80\nnoVotes=30\n\nBallot 2:\nyesVotes=80\nnoVotes=20\n\nBallot 3:\nyesVotes=70\nnoVotes=30\n\n```\n\n3. Now once Ballots are finalized for whitelisting, below call sequence occurs:\n\n```\n_finalizeTokenWhitelisting -> proposals.tokenWhitelistingBallotWithTheMostVotes();\n", "vulnerable_code": "function winningParameterVote( uint256 ballotID ) external view returns (Vote)\n\t\t{\n\t\tmapping(Vote=>uint256) storage votes = _votesCastForBallot[ballotID];\n\n\t\tuint256 increaseTotal = votes[Vote.INCREASE];\n\t\tuint256 decreaseTotal = votes[Vote.DECREASE];\n\t\tuint256 noChangeTotal = votes[Vote.NO_CHANGE];\n\n\t\tif ( increaseTotal > decreaseTotal )\n\t\tif ( increaseTotal > noChangeTotal )\n\t\t\treturn Vote.INCREASE;\n\n\t\tif ( decreaseTotal > increaseTotal )\n\t\tif ( decreaseTotal > noChangeTotal )\n\t\t\treturn Vote.DECREASE;\n\n\t\treturn Vote.NO_CHANGE;\n\t\t}", "fixed_code": "increaseTotal > decreaseTotal which is 100>100 which is false\ndecreaseTotal > increaseTotal which is 100>100 which is false\nSo Vote.NO_CHANGE is returned", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/csanuragjain-Q.md", "collected_at": "2026-01-02T19:01:37.678729+00:00", "source_hash": "d91c121e1ab88f2d51bd801819b661c3c58329e06e1100f7c628328824b58afc", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 803, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function winningParameterVote( uint256 ballotID ) external view returns (Vote)\n\t\t{\n\t\tmapping(Vote=>uint256) storage votes = _votesCastForBallot[ballotID];\n\n\t\tuint256 increaseTotal = votes[Vote.INCREASE];\n\t\tuint256 decreaseTotal = votes[Vote.DECREASE];\n\t\tuint256 noChangeTotal = votes[Vote.NO_CHANGE];\n\n\t\tif ( increaseTotal > decreaseTotal )\n\t\tif ( increaseTotal > noChangeTotal )\n\t\t\treturn Vote.INCREASE;\n\n\t\tif ( decreaseTotal > increaseTotal )\n\t\tif ( decreaseTotal > noChangeTotal )\n\t\t\treturn Vote.DECREASE;\n\n\t\treturn Vote.NO_CHANGE;\n\t\t}", "primary_code_language": "unknown", "primary_code_char_count": 538, "all_code_blocks": "// Code block 1 (unknown):\nfunction winningParameterVote( uint256 ballotID ) external view returns (Vote)\n\t\t{\n\t\tmapping(Vote=>uint256) storage votes = _votesCastForBallot[ballotID];\n\n\t\tuint256 increaseTotal = votes[Vote.INCREASE];\n\t\tuint256 decreaseTotal = votes[Vote.DECREASE];\n\t\tuint256 noChangeTotal = votes[Vote.NO_CHANGE];\n\n\t\tif ( increaseTotal > decreaseTotal )\n\t\tif ( increaseTotal > noChangeTotal )\n\t\t\treturn Vote.INCREASE;\n\n\t\tif ( decreaseTotal > increaseTotal )\n\t\tif ( decreaseTotal > noChangeTotal )\n\t\t\treturn Vote.DECREASE;\n\n\t\treturn Vote.NO_CHANGE;\n\t\t}\n\n// Code block 2 (unknown):\nincreaseTotal > decreaseTotal which is 100>100 which is false\ndecreaseTotal > increaseTotal which is 100>100 which is false\nSo Vote.NO_CHANGE is returned\n\n// Code block 3 (md):\nquorum=100\n\nBallot 1:\nyesVotes=80\nnoVotes=30\n\nBallot 2:\nyesVotes=80\nnoVotes=20\n\nBallot 3:\nyesVotes=70\nnoVotes=30", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Proposals.sol#L372-L380, Proposals.sol#L431", "github_files_list": "Proposals.sol", "github_refs_count": 2, "vulnerable_code_actual": "function winningParameterVote( uint256 ballotID ) external view returns (Vote)\n\t\t{\n\t\tmapping(Vote=>uint256) storage votes = _votesCastForBallot[ballotID];\n\n\t\tuint256 increaseTotal = votes[Vote.INCREASE];\n\t\tuint256 decreaseTotal = votes[Vote.DECREASE];\n\t\tuint256 noChangeTotal = votes[Vote.NO_CHANGE];\n\n\t\tif ( increaseTotal > decreaseTotal )\n\t\tif ( increaseTotal > noChangeTotal )\n\t\t\treturn Vote.INCREASE;\n\n\t\tif ( decreaseTotal > increaseTotal )\n\t\tif ( decreaseTotal > noChangeTotal )\n\t\t\treturn Vote.DECREASE;\n\n\t\treturn Vote.NO_CHANGE;\n\t\t}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "increaseTotal > decreaseTotal which is 100>100 which is false\ndecreaseTotal > increaseTotal which is 100>100 which is false\nSo Vote.NO_CHANGE is returned", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "01-salty", "title": "ether_sky Q", "severity_raw": "High", "severity": "high", "description": "[L-1] The `ManagedWallet` is not functioning as anticipated.\n\nThe proposed `mainWallet` can confirm the change only after the `30` days timelock.\nHowever, it can be skipped.\n\n- The `confirmationWallet` is capable of sending `0.05` ether before suggesting a new `main wallet`. \nSubsequently, the `activeTimelock` is updated.\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/ManagedWallet.sol#L66\n```\nreceive() external payable {\n if ( msg.value >= .05 ether )\n activeTimelock = block.timestamp + TIMELOCK_DURATION; \n}\n```\n- After `30` days, the main wallet proposes a new wallet.\n- The newly proposed main wallet can confirm the change immediately since `30` days have elapsed.\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/ManagedWallet.sol#L77\n```\nfunction changeWallets() external {\n require( msg.sender == proposedMainWallet, \"Invalid sender\" );\n require( block.timestamp >= activeTimelock, \"Timelock not yet completed\" );\n}\n```\n\n[L-2] The parameter order in the `proposeCallContract` function is incorrect.\n\n- In the `possiblyCreateProposal` function, the parameter `string2` is associated with the `description`.\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/dao/Proposals.sol#L109\n```\nfunction _possiblyCreateProposal( string memory ballotName, BallotType ballotType, address address1, uint256 number1, string memory string1, string memory string2 ) internal returns (uint256 ballotID) {\n ballots[ballotID] = Ballot( ballotID, true, ballotType, ballotName, address1, number1, string1, string2, ballotMinimumEndTime );\n}\n```\n- However, in the `proposeCallContract` function, the `description` is inserted as parameter `string1`.\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/dao/Proposals.sol#L218\n```\nfunction proposeCallContract( address contractAddress, uint256 number, string calldat", "vulnerable_code": "receive() external payable {\n if ( msg.value >= .05 ether )\n activeTimelock = block.timestamp + TIMELOCK_DURATION; \n}", "fixed_code": "function changeWallets() external {\n require( msg.sender == proposedMainWallet, \"Invalid sender\" );\n require( block.timestamp >= activeTimelock, \"Timelock not yet completed\" );\n}", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/ether_sky-Q.md", "collected_at": "2026-01-02T19:01:39.472044+00:00", "source_hash": "d9659600c1b5a6b50e0b4aa49132c65d76f6892b4fe1d06f7fefe202d3d5bb21", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 648, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "receive() external payable {\n if ( msg.value >= .05 ether )\n activeTimelock = block.timestamp + TIMELOCK_DURATION; \n}", "primary_code_language": "unknown", "primary_code_char_count": 127, "all_code_blocks": "// Code block 1 (unknown):\nreceive() external payable {\n if ( msg.value >= .05 ether )\n activeTimelock = block.timestamp + TIMELOCK_DURATION; \n}\n\n// Code block 2 (unknown):\nfunction changeWallets() external {\n require( msg.sender == proposedMainWallet, \"Invalid sender\" );\n require( block.timestamp >= activeTimelock, \"Timelock not yet completed\" );\n}\n\n// Code block 3 (unknown):\nfunction _possiblyCreateProposal( string memory ballotName, BallotType ballotType, address address1, uint256 number1, string memory string1, string memory string2 ) internal returns (uint256 ballotID) {\n ballots[ballotID] = Ballot( ballotID, true, ballotType, ballotName, address1, number1, string1, string2, ballotMinimumEndTime );\n}", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ManagedWallet.sol#L66, ManagedWallet.sol#L77, Proposals.sol#L109, Proposals.sol#L218", "github_files_list": "Proposals.sol, ManagedWallet.sol", "github_refs_count": 4, "vulnerable_code_actual": "receive() external payable {\n if ( msg.value >= .05 ether )\n activeTimelock = block.timestamp + TIMELOCK_DURATION; \n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function changeWallets() external {\n require( msg.sender == proposedMainWallet, \"Invalid sender\" );\n require( block.timestamp >= activeTimelock, \"Timelock not yet completed\" );\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "01-ondo", "title": "Tomio G", "severity_raw": "Medium", "severity": "medium", "description": "1.\nTitle: empty `constructor`\n\nProof of Concept:\n[CCashDelegate.sol#L15](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cCash/CCashDelegate.sol#L15)\n[CTokenDelegate.sol#L15](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cToken/CTokenDelegate.sol#L15)\n\nRecommended Mitigation Steps:\nRemove if unused for gas saving\n________________________________________________________________________\n\n2.\nTitle: Expression for `constant` values such as a call to `keccak256()`, should use `immutable` rather than `constant`\n\nProof of Concept:\n[Cash.sol#L22](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/token/Cash.sol#L22)\n[CashKYCSender.sol#L26](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/token/CashKYCSender.sol#L26)\n[CashKYCSenderReceiver.sol#L26](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/token/CashKYCSenderReceiver.sol#L26)\n\nRecommended Mitigation Steps:\nChange from `constant` to `immutable`\nreference: [here](https://github.com/ethereum/solidity/issues/9232)\n________________________________________________________________________\n\n3.\nTitle: function getUnderlyingPrice() gas improvement on returning value\n\nProof of Concept:\n[OndoPriceOracleV2.sol#L95](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/OndoPriceOracleV2.sol#L95)\n\nRecommended Mitigation Steps:\nby set `prices` in returns L#94 and delete L#95 can save gas\n\n```\n) external view override returns (uint256 prices) { { //@audit-info: set here\n```\n________________________________________________________________________\n\n4.\nTitle: Using multiple `require` instead `&&` can save gas\n\nProof of Concept:\n[OndoPriceOracleV2.sol#L292-L296](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/OndoPriceOracleV2.sol#L292-L296)\n\nRecommended Mitigation Steps:\nChange to:\n\n```\n\t require((answeredInRound >= roundId),\"Chainlink oracle price is stale\");\n\n require((upda", "vulnerable_code": ") external view override returns (uint256 prices) { { //@audit-info: set here", "fixed_code": "\t require((answeredInRound >= roundId),\"Chainlink oracle price is stale\");\n\n require((updatedAt >= block.timestamp - maxChainlinkOracleTimeDelay),\"Chainlink oracle price is stale\");", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/Tomio-G.md", "collected_at": "2026-01-02T18:14:49.791298+00:00", "source_hash": "d9861b74d65f9b0a3693ad55f8f8f0ea9de6b5fc5e0c08d15559f6815ba5214e", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 77, "github_ref_count": 7, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": ") external view override returns (uint256 prices) { { //@audit-info: set here", "primary_code_language": "unknown", "primary_code_char_count": 77, "all_code_blocks": "// Code block 1 (unknown):\n) external view override returns (uint256 prices) { { //@audit-info: set here", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CCashDelegate.sol#L15, CTokenDelegate.sol#L15, Cash.sol#L22, CashKYCSender.sol#L26, CashKYCSenderReceiver.sol#L26, OndoPriceOracleV2.sol#L95, OndoPriceOracleV2.sol#L292-L296", "github_files_list": "CashKYCSenderReceiver.sol, CTokenDelegate.sol, CashKYCSender.sol, OndoPriceOracleV2.sol, Cash.sol, CCashDelegate.sol", "github_refs_count": 7, "vulnerable_code_actual": ") external view override returns (uint256 prices) { { //@audit-info: set here", "has_vulnerable_code_snippet": true, "fixed_code_actual": "\t require((answeredInRound >= roundId),\"Chainlink oracle price is stale\");\n\n require((updatedAt >= block.timestamp - maxChainlinkOracleTimeDelay),\"Chainlink oracle price is stale\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-salty", "title": "0x11singh99 G", "severity_raw": "High", "severity": "high", "description": "# Gas Optimizations\n\n| Issue | Total Gas Saved |\n| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------: |\n| [[G-01] **In `DAO.sol` refactor `finalizeBallot` function , `_finalizeParameterBallot`, `_finalizeApprovalBallot` and `_finalizeTokenWhitelisting` internal functions to avoid extra external calls.(Total Gas Saved ~7000 GAS)**](#g-01-in-daosol-refactor-finalizeballot-function--_finalizeparameterballot-_finalizeapprovalballot-and-_finalizetokenwhitelisting-internal-functions-to-avoid-extra-external-callstotal-gas-saved-7000-gas) | **~7000** |\n| [[G-02] **State variables can be packed into fewer storage slots (saves ~30000 Gas)**](#g-02-state-variables-can-be-packed-into-fewer-storage-slots-saves-30000-gas) | **~30000** |\n| [[G-03] **Change the order of `modifier` check in `functions` can save upto 23.9k gas per instance half of the time(Total Total Gas Saved ~119500)**](#g-03-change-th", "vulnerable_code": "File : src/dao/DAO.sol\n\n113: function _finalizeParameterBallot( uint256 ballotID ) internal\n\t\t{\n\t\tBallot memory ballot = proposals.ballotForID(ballotID);\n\n\n219: function _finalizeApprovalBallot( uint256 ballotID ) internal\n\t\t{\n\t\tif ( proposals.ballotIsApproved(ballotID ) )\n\t\t\t{\n\t\t\tBallot memory ballot = proposals.ballotForID(ballotID);\n\n\n235:\tfunction _finalizeTokenWhitelisting( uint256 ballotID ) internal\n\t\t{\n\t\tif ( proposals.ballotIsApproved(ballotID ) )\n\t\t\t{\n\t\t\t// The ballot is approved. Any reversions below will allow the ballot to be attemped to be finalized later - as the ballot won't be finalized on reversion.\n\t\t\tBallot memory ballot = proposals.ballotForID(ballotID);\n\n\n\n278: function finalizeBallot( uint256 ballotID ) external nonReentrant\n\t\t{\n\t\t// Checks that ballot is live, and minimumEndTime and quorum have both been reached\n\t\trequire( proposals.canFinalizeBallot(ballotID), \"The ballot is not yet able to be finalized\" );\n\n\t\tBallot memory ballot = proposals.ballotForID(ballotID);\n\n\t\tif ( ballot.ballotType == BallotType.PARAMETER )\n\t\t\t_finalizeParameterBallot(ballotID);\n\t\telse if ( ballot.ballotType == BallotType.WHITELIST_TOKEN )\n\t\t\t_finalizeTokenWhitelisting(ballotID);\n\t\telse\n\t\t\t_finalizeApprovalBallot(ballotID);\n\t\t}\n", "fixed_code": "## [G-02] State variables can be packed into fewer storage slots (saves ~30000 Gas)\n\nThe EVM works with 32 byte words. Variables less than 32 bytes can be declared next to each other in storage and this will pack the values together into a single 32 byte storage slot (if values combined are <= 32 bytes). If the variables packed together are retrieved together in functions (more likely with structs), we will effectively save ~2000 gas with every subsequent SLOAD for that storage slot. This is due to us incurring a Gwarmaccess (100 gas) versus a Gcoldsload (2100 gas).\n\n### Total `SAVE: ~30000 GAS, 15 Storage SLOT`\n\n### `bootstrappingRewards`, `percentPolRewardsBurned`, `baseBallotQuorumPercentTimes1000`, `ballotMinimumDuration`, `requiredProposalPercentStakeTimes1000`, `maxPendingTokensForWhitelisting`, `arbitrageProfitsPercentPOL` and `upkeepRewardPercent` can be packed in single SLOT :`SAVES 14000 GAS`, `7 SLOT`\n\n1. **`bootstrappingRewards`** This can be reduced to uint96(can hold up to **~7.9e28**) because `bootstrappingRewards` maximum range is between 50k-500k ether (50e18 - 500e18) so `uint96` is more than sufficient to hold this value.\n\n2. **`percentPolRewardsBurned`** This can be reduced to uint8(max value is 255) because `percentPolRewardsBurned` max value is 50 so `uint8` is more than sufficient to hold this value.\n\n3. **`baseBallotQuorumPercentTimes1000`** This can be reduced to uint16(max value is 65535) because max value of `baseBallotQuorumPercentTimes1000` can be 10000 so `uint16` is more than sufficient to hold this value.\n\n4. **`ballotMinimumDuration`** This can be reduced to uint32(max value is 4,294,967,295) because max value of `ballotMinimumDuration` can be 14 days(12,09,600 in seconds) so `uint32` is more than sufficient to hold this value.\n\n5. **`requiredProposalPercentStakeTimes1000`**: This can be reduced to uint16(max value is 65535) because max value of `requiredProposalPercentStakeTimes1000` can be 2000 so `uint16` is more than sufficient t", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/0x11singh99-G.md", "collected_at": "2026-01-02T19:01:00.921509+00:00", "source_hash": "d9d5a076a00e473df994862c6ec7edcbf04d1085ddf2908ac885946f3979fdaa", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File : src/dao/DAO.sol\n\n113: function _finalizeParameterBallot( uint256 ballotID ) internal\n\t\t{\n\t\tBallot memory ballot = proposals.ballotForID(ballotID);\n\n\n219: function _finalizeApprovalBallot( uint256 ballotID ) internal\n\t\t{\n\t\tif ( proposals.ballotIsApproved(ballotID ) )\n\t\t\t{\n\t\t\tBallot memory ballot = proposals.ballotForID(ballotID);\n\n\n235:\tfunction _finalizeTokenWhitelisting( uint256 ballotID ) internal\n\t\t{\n\t\tif ( proposals.ballotIsApproved(ballotID ) )\n\t\t\t{\n\t\t\t// The ballot is approved. Any reversions below will allow the ballot to be attemped to be finalized later - as the ballot won't be finalized on reversion.\n\t\t\tBallot memory ballot = proposals.ballotForID(ballotID);\n\n\n\n278: function finalizeBallot( uint256 ballotID ) external nonReentrant\n\t\t{\n\t\t// Checks that ballot is live, and minimumEndTime and quorum have both been reached\n\t\trequire( proposals.canFinalizeBallot(ballotID), \"The ballot is not yet able to be finalized\" );\n\n\t\tBallot memory ballot = proposals.ballotForID(ballotID);\n\n\t\tif ( ballot.ballotType == BallotType.PARAMETER )\n\t\t\t_finalizeParameterBallot(ballotID);\n\t\telse if ( ballot.ballotType == BallotType.WHITELIST_TOKEN )\n\t\t\t_finalizeTokenWhitelisting(ballotID);\n\t\telse\n\t\t\t_finalizeApprovalBallot(ballotID);\n\t\t}\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## [G-02] State variables can be packed into fewer storage slots (saves ~30000 Gas)\n\nThe EVM works with 32 byte words. Variables less than 32 bytes can be declared next to each other in storage and this will pack the values together into a single 32 byte storage slot (if values combined are <= 32 bytes). If the variables packed together are retrieved together in functions (more likely with structs), we will effectively save ~2000 gas with every subsequent SLOAD for that storage slot. This is due to us incurring a Gwarmaccess (100 gas) versus a Gcoldsload (2100 gas).\n\n### Total `SAVE: ~30000 GAS, 15 Storage SLOT`\n\n### `bootstrappingRewards`, `percentPolRewardsBurned`, `baseBallotQuorumPercentTimes1000`, `ballotMinimumDuration`, `requiredProposalPercentStakeTimes1000`, `maxPendingTokensForWhitelisting`, `arbitrageProfitsPercentPOL` and `upkeepRewardPercent` can be packed in single SLOT :`SAVES 14000 GAS`, `7 SLOT`\n\n1. **`bootstrappingRewards`** This can be reduced to uint96(can hold up to **~7.9e28**) because `bootstrappingRewards` maximum range is between 50k-500k ether (50e18 - 500e18) so `uint96` is more than sufficient to hold this value.\n\n2. **`percentPolRewardsBurned`** This can be reduced to uint8(max value is 255) because `percentPolRewardsBurned` max value is 50 so `uint8` is more than sufficient to hold this value.\n\n3. **`baseBallotQuorumPercentTimes1000`** This can be reduced to uint16(max value is 65535) because max value of `baseBallotQuorumPercentTimes1000` can be 10000 so `uint16` is more than sufficient to hold this value.\n\n4. **`ballotMinimumDuration`** This can be reduced to uint32(max value is 4,294,967,295) because max value of `ballotMinimumDuration` can be 14 days(12,09,600 in seconds) so `uint32` is more than sufficient to hold this value.\n\n5. **`requiredProposalPercentStakeTimes1000`**: This can be reduced to uint16(max value is 65535) because max value of `requiredProposalPercentStakeTimes1000` can be 2000 so `uint16` is more than sufficient t", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-salty", "title": "0xBinChook Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA Report for Salty.io\n\n| Id | Issue |\n|-----------------|------------------------------------------------------------------------------------|\n| [L-1](#l-1) | Staking configuration changes only applies to new unstake after finalization |\n| [L-2](#l-2) | hitelisting, un-whitelisting then re-whitelisting to game bootstrap rewards |\n| [L-3](#l-3) | Price feed proposal are not check to ensure feed uniqueness |\n| [L-4](#l-4) | Rounding down prevents proposals when there is between 1 and 999 xSALT |\n| [L-5](#l-5) | When xSalt is low, there is a risk of proposal spam |\n| [L-6](#l-6) | `SigningTools::_verifySignature` allows malleable (non-unique) signature |\n| [L-7](#l-7) | Salt from unclaimed airdrops will be trapped |\n| [L-8](#l-8) | `ManagedWallet` is an trap ETH |\n| [L-9](#l-9) | Control of `proposedConfirmationWallet` should be confirmed |\n| [L-10](#l-10) | Both proposed wallets can be the same |\n| [L-11](#l-11) | Upkeep has a race condition that creates an economic disincentive |\n| [NC-1](#nc-1) | When a user recasts their vote emit an event |\n| [NC-2](#nc-2) | `Proposals::userHasActiveProposal()` will be incorrect for the DAO |\n| [NC-3](#nc-3) | `Proposals::openBallots()` returns an unbounded set |\n| [NC-4](#nc-4) | Inconsistent quorum tiers between `minimumQuorum` and `requiredQuorum` |\n| [NC-5](#nc-5) | Integer rounding may leave dust in `Airdrop` |\n| [NC-6](#nc-6) | Hardcoded ETH amount for confirmation signal is brittle ", "vulnerable_code": " uint256 requiredXSalt = ( totalStaked * daoConfig.requiredProposalPercentStakeTimes1000() ) / ( 100 * 1000 );\n\n require( requiredXSalt > 0, \"requiredXSalt cannot be zero\" );", "fixed_code": " uint256 totalStaked = staking.totalShares(PoolUtils.STAKED_SALT);\n uint256 requiredXSalt = ( totalStaked * daoConfig.requiredProposalPercentStakeTimes1000() ) / ( 100 * 1000 );", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/0xBinChook-Q.md", "collected_at": "2026-01-02T19:01:02.754804+00:00", "source_hash": "d9e2c15c5700823bcf62f84786d68869d4cf4211020d5fc100783200ecb7f969", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " uint256 requiredXSalt = ( totalStaked * daoConfig.requiredProposalPercentStakeTimes1000() ) / ( 100 * 1000 );\n\n require( requiredXSalt > 0, \"requiredXSalt cannot be zero\" );", "has_vulnerable_code_snippet": true, "fixed_code_actual": " uint256 totalStaked = staking.totalShares(PoolUtils.STAKED_SALT);\n uint256 requiredXSalt = ( totalStaked * daoConfig.requiredProposalPercentStakeTimes1000() ) / ( 100 * 1000 );", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-revert-lend", "title": "t4sk Q", "severity_raw": "Low", "severity": "low", "description": "# Lock solidity version\n```\n// SPDX-License-Identifier: BUSL-1.1\npragma solidity ^0.8.0;\n```\n\n# V3Oracle._requireMaxDifference incorrect comparison\n\n```solidity\n if (differenceX10000 >= maxDifferenceX10000) {\n revert PriceDifferenceExceeded();\n }\n```\n\n`maxDifferencex1000` is max allowed price difference\n\nHere the code will revert when the price difference is exactly equal to the max allowed difference.\n\nInequality should be changed to `differenceX10000 > maxDifferenceX10000`\n\nhttps://github.com/code-423n4/2024-03-revert-lend/blob/457230945a49878eefdc1001796b10638c1e7584/src/V3Oracle.sol#L147\n\nhttps://github.com/code-423n4/2024-03-revert-lend/blob/457230945a49878eefdc1001796b10638c1e7584/src/V3Oracle.sol#L200", "vulnerable_code": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity ^0.8.0;", "fixed_code": " if (differenceX10000 >= maxDifferenceX10000) {\n revert PriceDifferenceExceeded();\n }", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/t4sk-Q.md", "collected_at": "2026-01-02T19:03:19.107676+00:00", "source_hash": "da0fed25cb330e7e80af6a9e9b6f89d0bdd889e1daff158e577855f22585ac0d", "code_block_count": 2, "solidity_block_count": 1, "total_code_chars": 162, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity ^0.8.0;", "primary_code_language": "unknown", "primary_code_char_count": 60, "all_code_blocks": "// Code block 1 (unknown):\n// SPDX-License-Identifier: BUSL-1.1\npragma solidity ^0.8.0;\n\n// Code block 2 (solidity):\nif (differenceX10000 >= maxDifferenceX10000) {\n revert PriceDifferenceExceeded();\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "if (differenceX10000 >= maxDifferenceX10000) {\n revert PriceDifferenceExceeded();\n }", "github_refs_formatted": "V3Oracle.sol#L147, V3Oracle.sol#L200", "github_files_list": "V3Oracle.sol", "github_refs_count": 2, "vulnerable_code_actual": "// SPDX-License-Identifier: BUSL-1.1\npragma solidity ^0.8.0;", "has_vulnerable_code_snippet": true, "fixed_code_actual": " if (differenceX10000 >= maxDifferenceX10000) {\n revert PriceDifferenceExceeded();\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6.48} {"source": "c4", "protocol": "03-asymmetry", "title": "BlueAlder Q", "severity_raw": "Low", "severity": "low", "description": "## [L-01] Unable to remove derivatives\n\nThere is no functionality of the contract to remove a derivative from the index\nfund. In the case where an incorrect derivative is deployed or an underlying\nderivative is compromised and is no longer wanted to be used there is no way to\nremove this from the contract.\n\nAlthough this can be mitigated by setting the weight of the derivative to 0 this\nwill become useless storage on the contract and will increase the overall cost\nof operations on the contract when it has to iterate through all derivatives.\n\n### Mitigation\n\nImplement a removeDerivative() function which will remove the derivative from\nthe contract. This will have implications on how derivatives are added the\ncontract since it uses the `derivativeCount` variable to create new entries in\nthe derivative mapping.\n\n## [L-02] Gas Griefing is possible on external calls\n\nGas griefing is possible on external calls as the return data has to be stored\neven if it is omitted, due to the EVM architecture:\n\n```sol\n(bool sent,) = address(msg.sender).call{value: ethAmountToWithdraw}(\"\");\n```\n\nTo mitigate this, perform a low level call with out and outdata size set to 0\nso that the return data is not stored. \n\n```\n@@ -108,7 +108,9 @@ contract SafEth is Initializable, ERC20Upgradeable, OwnableUpgradeable, SafEthSt\n uint256 ethAmountAfter = address(this).balance;\n uint256 ethAmountToWithdraw = ethAmountAfter - ethAmountBefore;\n // solhint-disable-next-line\n- (bool sent,) = address(msg.sender).call{value: ethAmountToWithdraw}(\"\");\n+ assembly {\n+ sent := call(gas(), caller(), ethAmountToWithdraw, 0, 0, 0, 0)\n+ }\n require(sent, \"Failed to send Ether\");\n emit Unstaked(msg.sender, ethAmountToWithdraw, _safEthAmount);\n }\n```\n\n\n\nCheck this tweet for more details:\nhttps://twitter.com/pashovkrum/status/1607024043718316032?t=xs30iD6ORWtE2bTTYsCFIQ&s=19\n\n## [L-03] Use Ownable2StepUpgradeable instead of OwnableUpgradeable\n\n", "vulnerable_code": "(bool sent,) = address(msg.sender).call{value: ethAmountToWithdraw}(\"\");", "fixed_code": "@@ -108,7 +108,9 @@ contract SafEth is Initializable, ERC20Upgradeable, OwnableUpgradeable, SafEthSt\n uint256 ethAmountAfter = address(this).balance;\n uint256 ethAmountToWithdraw = ethAmountAfter - ethAmountBefore;\n // solhint-disable-next-line\n- (bool sent,) = address(msg.sender).call{value: ethAmountToWithdraw}(\"\");\n+ assembly {\n+ sent := call(gas(), caller(), ethAmountToWithdraw, 0, 0, 0, 0)\n+ }\n require(sent, \"Failed to send Ether\");\n emit Unstaked(msg.sender, ethAmountToWithdraw, _safEthAmount);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/BlueAlder-Q.md", "collected_at": "2026-01-02T18:17:56.158357+00:00", "source_hash": "da66b2cfd7023cb4c84844c1df7238af8ef7e47e524a7fbc4fb40706620a3bb3", "code_block_count": 2, "solidity_block_count": 1, "total_code_chars": 656, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "(bool sent,) = address(msg.sender).call{value: ethAmountToWithdraw}(\"\");", "primary_code_language": "sol", "primary_code_char_count": 72, "all_code_blocks": "// Code block 1 (sol):\n(bool sent,) = address(msg.sender).call{value: ethAmountToWithdraw}(\"\");\n\n// Code block 2 (unknown):\n@@ -108,7 +108,9 @@ contract SafEth is Initializable, ERC20Upgradeable, OwnableUpgradeable, SafEthSt\n uint256 ethAmountAfter = address(this).balance;\n uint256 ethAmountToWithdraw = ethAmountAfter - ethAmountBefore;\n // solhint-disable-next-line\n- (bool sent,) = address(msg.sender).call{value: ethAmountToWithdraw}(\"\");\n+ assembly {\n+ sent := call(gas(), caller(), ethAmountToWithdraw, 0, 0, 0, 0)\n+ }\n require(sent, \"Failed to send Ether\");\n emit Unstaked(msg.sender, ethAmountToWithdraw, _safEthAmount);\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "(bool sent,) = address(msg.sender).call{value: ethAmountToWithdraw}(\"\");", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "(bool sent,) = address(msg.sender).call{value: ethAmountToWithdraw}(\"\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": "@@ -108,7 +108,9 @@ contract SafEth is Initializable, ERC20Upgradeable, OwnableUpgradeable, SafEthSt\n uint256 ethAmountAfter = address(this).balance;\n uint256 ethAmountToWithdraw = ethAmountAfter - ethAmountBefore;\n // solhint-disable-next-line\n- (bool sent,) = address(msg.sender).call{value: ethAmountToWithdraw}(\"\");\n+ assembly {\n+ sent := call(gas(), caller(), ethAmountToWithdraw, 0, 0, 0, 0)\n+ }\n require(sent, \"Failed to send Ether\");\n emit Unstaked(msg.sender, ethAmountToWithdraw, _safEthAmount);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-ondo", "title": "btk Q", "severity_raw": "Critical", "severity": "critical", "description": "### Total L issues\n\n| Number | Issues Details | Context |\n|--------|------------------------------------------------------------------------------------|---------|\n| [L-01] | Avoid shadowing inherited state variables | 4 |\n| [L-02] | `initialize()` function can be called by anybody | 3 |\n| [L-03] | No Storage Gap for Upgradeable contracts | 6 |\n| [L-04] | Low level calls with solidity version 0.8.14 and lower can result in optimiser bug | 3 |\n| [L-05] | Loss of precision due to rounding | 1 |\n\n### Total NC issues\n\n| Number | Issues Details | Context |\n|---------|-------------------------------------------------------------------------|---------------|\n| [NC-01] | Use `require()` instead of `assert()` | 3 |\n| [NC-02] | Critical changes should use-two step procedure | 3 |\n| [NC-03] | Include `@return` parameters in NatSpec comments | 14 |\n| [NC-04] | Function writing does not comply with the `Solidity Style Guide` | All Contracts |\n| [NC-05] | Solidity compiler optimizations can be problematic | 1 |\n| [NC-06] | Non-usage of specific imports | All Contracts |\n| [NC-07] | Mark visibility of `initialize()` functions as external | 6 |\n| [NC-08] | Add address(0) check for the critical changes | 3 |\n\n## [L-01] Avoid shadowing inherited state variables\n\nIn `CashKYCSenderReceiver.sol` there is a local variables named `name` `symbol` `kycRegistry` `kycRequirementGroup`, but there is functions and sta", "vulnerable_code": " __ERC20PresetMinterPauser_init(name, symbol);\n __KYCRegistryClientInitializable_init(kycRegistry, kycRequirementGroup);", "fixed_code": " function initialize(\n string memory name,\n string memory symbol,\n address kycRegistry,\n uint256 kycRequirementGroup\n ) public initializer {\n __ERC20PresetMinterPauser_init(name, symbol);\n __KYCRegistryClientInitializable_init(kycRegistry, kycRequirementGroup);\n }", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/btk-Q.md", "collected_at": "2026-01-02T18:14:57.385461+00:00", "source_hash": "da8f0190b42cd35f49d3093b10573b0e1c6ef563a38d81c0600f5e0a46970893", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " __ERC20PresetMinterPauser_init(name, symbol);\n __KYCRegistryClientInitializable_init(kycRegistry, kycRequirementGroup);", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function initialize(\n string memory name,\n string memory symbol,\n address kycRegistry,\n uint256 kycRequirementGroup\n ) public initializer {\n __ERC20PresetMinterPauser_init(name, symbol);\n __KYCRegistryClientInitializable_init(kycRegistry, kycRequirementGroup);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "04-caviar", "title": "0xSolus G", "severity_raw": "Medium", "severity": "medium", "description": "[L#271](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L271) - Redundant code: `buy()` calculates `_getRoyalty()` twice unnecessarily as the \noperation can be done in the first loop, avoiding the second one in L#272 make sure to optimize. \nGas costs old: avg -> 70884, median -> 74037, max -> 158864. \nGas costs new: avg -> 70311 , median -> 73894 , max -> 147884. \nRecommendation: \n```\nfunction buy(uint256[] calldata tokenIds, uint256[] calldata tokenWeights, MerkleMultiProof calldata proof)\n public\n payable\nreturns (uint256 netInputAmount, uint256 feeAmount, uint256 protocolFeeAmount)\n{\n // ~~~ Checks ~~~ //\n\n // calculate the sum of weights of the NFTs to buy\n uint256 weightSum = sumWeightsAndValidateProof(tokenIds, tokenWeights, proof);\n\n // calculate the required net input amount and fee amount\n (netInputAmount, feeAmount, protocolFeeAmount) = buyQuote(weightSum);\n\n // check that the caller sent 0 ETH if the base token is not ETH\n if (baseToken != address(0) && msg.value > 0) revert InvalidEthAmount();\n\n // ~~~ Effects ~~~ //\n\n // update the virtual reserves\n virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n virtualNftReserves -= uint128(weightSum);\n\n // ~~~ Interactions ~~~ //\n\n // calculate the sale price (assume it's the same for each NFT even if weights differ)\n uint256 salePrice = (netInputAmount - feeAmount - protocolFeeAmount) / tokenIds.length;\n uint256 royaltyFeeAmount = 0;\n for (uint256 i = 0; i < tokenIds.length; i++) {\n // transfer the NFT to the caller\n ERC721(nft).safeTransferFrom(address(this), msg.sender, tokenIds[i]);\n\n if (payRoyalties) {\n // get the royalty fee for the NFT\n (uint256 royaltyFee, address recipient) = _getRoyalty(tokenIds[i], salePrice);\n\n // transfer the royalty fee to the recipient if it's greater than 0\n if (royaltyFee > 0 && recipient != address(0)) {\n if (baseToken != address(0)) {\n ERC20(baseToken", "vulnerable_code": "function buy(uint256[] calldata tokenIds, uint256[] calldata tokenWeights, MerkleMultiProof calldata proof)\n public\n payable\nreturns (uint256 netInputAmount, uint256 feeAmount, uint256 protocolFeeAmount)\n{\n // ~~~ Checks ~~~ //\n\n // calculate the sum of weights of the NFTs to buy\n uint256 weightSum = sumWeightsAndValidateProof(tokenIds, tokenWeights, proof);\n\n // calculate the required net input amount and fee amount\n (netInputAmount, feeAmount, protocolFeeAmount) = buyQuote(weightSum);\n\n // check that the caller sent 0 ETH if the base token is not ETH\n if (baseToken != address(0) && msg.value > 0) revert InvalidEthAmount();\n\n // ~~~ Effects ~~~ //\n\n // update the virtual reserves\n virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n virtualNftReserves -= uint128(weightSum);\n\n // ~~~ Interactions ~~~ //\n\n // calculate the sale price (assume it's the same for each NFT even if weights differ)\n uint256 salePrice = (netInputAmount - feeAmount - protocolFeeAmount) / tokenIds.length;\n uint256 royaltyFeeAmount = 0;\n for (uint256 i = 0; i < tokenIds.length; i++) {\n // transfer the NFT to the caller\n ERC721(nft).safeTransferFrom(address(this), msg.sender, tokenIds[i]);\n\n if (payRoyalties) {\n // get the royalty fee for the NFT\n (uint256 royaltyFee, address recipient) = _getRoyalty(tokenIds[i], salePrice);\n\n // transfer the royalty fee to the recipient if it's greater than 0\n if (royaltyFee > 0 && recipient != address(0)) {\n if (baseToken != address(0)) {\n ERC20(baseToken).safeTransfer(recipient, royaltyFee);\n } else {\n recipient.safeTransferETH(royaltyFee);\n }\n }\n // add the royalty fee to the total royalty fee amount\n royaltyFeeAmount += royaltyFee;\n }\n }\n\n // add the royalty fee amount to the net input aount\n netInputAmount += royaltyFeeAmount;\n\n if (baseToken != address(0)) {\n // transfer the base token from the caller to the contr", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/0xSolus-G.md", "collected_at": "2026-01-02T18:19:19.897890+00:00", "source_hash": "dae7428a7d1a5e8d565cd26547502bd822a918afca169f83c73d8f0253de4685", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "PrivatePool.sol#L271", "github_files_list": "PrivatePool.sol", "github_refs_count": 1, "vulnerable_code_actual": "function buy(uint256[] calldata tokenIds, uint256[] calldata tokenWeights, MerkleMultiProof calldata proof)\n public\n payable\nreturns (uint256 netInputAmount, uint256 feeAmount, uint256 protocolFeeAmount)\n{\n // ~~~ Checks ~~~ //\n\n // calculate the sum of weights of the NFTs to buy\n uint256 weightSum = sumWeightsAndValidateProof(tokenIds, tokenWeights, proof);\n\n // calculate the required net input amount and fee amount\n (netInputAmount, feeAmount, protocolFeeAmount) = buyQuote(weightSum);\n\n // check that the caller sent 0 ETH if the base token is not ETH\n if (baseToken != address(0) && msg.value > 0) revert InvalidEthAmount();\n\n // ~~~ Effects ~~~ //\n\n // update the virtual reserves\n virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n virtualNftReserves -= uint128(weightSum);\n\n // ~~~ Interactions ~~~ //\n\n // calculate the sale price (assume it's the same for each NFT even if weights differ)\n uint256 salePrice = (netInputAmount - feeAmount - protocolFeeAmount) / tokenIds.length;\n uint256 royaltyFeeAmount = 0;\n for (uint256 i = 0; i < tokenIds.length; i++) {\n // transfer the NFT to the caller\n ERC721(nft).safeTransferFrom(address(this), msg.sender, tokenIds[i]);\n\n if (payRoyalties) {\n // get the royalty fee for the NFT\n (uint256 royaltyFee, address recipient) = _getRoyalty(tokenIds[i], salePrice);\n\n // transfer the royalty fee to the recipient if it's greater than 0\n if (royaltyFee > 0 && recipient != address(0)) {\n if (baseToken != address(0)) {\n ERC20(baseToken).safeTransfer(recipient, royaltyFee);\n } else {\n recipient.safeTransferETH(royaltyFee);\n }\n }\n // add the royalty fee to the total royalty fee amount\n royaltyFeeAmount += royaltyFee;\n }\n }\n\n // add the royalty fee amount to the net input aount\n netInputAmount += royaltyFeeAmount;\n\n if (baseToken != address(0)) {\n // transfer the base token from the caller to the contr", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "11-kelp", "title": "mahdirostami Q", "severity_raw": "Unknown", "severity": "unknown", "description": "# 1. Not considering Strategy deposit limit\n## Summary\nThe eigenlayer strategy contracts have deposit limitations:\n```solidity\n /// The maximum deposit (in underlyingToken) that this strategy will accept per deposit\n uint256 public maxPerDeposit;\n\n\n /// The maximum deposits (in underlyingToken) that this strategy will hold\n uint256 public maxTotalDeposits;\n```\nWhich currently are [100000000000000000000000](https://etherscan.io/address/0x54945180dB7943c0ed0FEE7EdaB2Bd24620256bc#readProxyContract#F3), the problem here is NodeDelegator doesn't consider this and send the whole balance to strategies which may cause revert.\n```solidity\n address eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);\n\n uint256 balance = token.balanceOf(address(this));//@audit add amount instead of balance\n\n emit AssetDepositIntoStrategy(asset, strategy, balance);\n\n IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);\n```\n## Recommendations\nuse amount as an argument instead of the balance of the contract\n# 2. Not considering token decimals\n## Summary\nin the share calculation, the protocol assumes that all assets have 18 decimals and oracles give a price in 18 decimals as well, for now, it doesn't have any concern, but it couldn't be true in the future, so assets with different decimals or prices with different decimals could result in wrong share calculation.\n```solidity\n rsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();\n```\n```solidity\n return IPriceFetcher(assetPriceOracle[asset]).getAssetPrice(asset);\n```\n## Recommendations\nadd checks, to check token decimals.", "vulnerable_code": " /// The maximum deposit (in underlyingToken) that this strategy will accept per deposit\n uint256 public maxPerDeposit;\n\n\n /// The maximum deposits (in underlyingToken) that this strategy will hold\n uint256 public maxTotalDeposits;", "fixed_code": " address eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);\n\n uint256 balance = token.balanceOf(address(this));//@audit add amount instead of balance\n\n emit AssetDepositIntoStrategy(asset, strategy, balance);\n\n IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/mahdirostami-Q.md", "collected_at": "2026-01-02T18:28:15.479803+00:00", "source_hash": "db0ab2025b748f08381d36093a301ef4bdf35f64af9c123df10d0310759b3076", "code_block_count": 4, "solidity_block_count": 4, "total_code_chars": 784, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "/// The maximum deposit (in underlyingToken) that this strategy will accept per deposit\n uint256 public maxPerDeposit;\n\n\n /// The maximum deposits (in underlyingToken) that this strategy will hold\n uint256 public maxTotalDeposits;", "primary_code_language": "solidity", "primary_code_char_count": 239, "all_code_blocks": "// Code block 1 (solidity):\n/// The maximum deposit (in underlyingToken) that this strategy will accept per deposit\n uint256 public maxPerDeposit;\n\n\n /// The maximum deposits (in underlyingToken) that this strategy will hold\n uint256 public maxTotalDeposits;\n\n// Code block 2 (solidity):\naddress eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);\n\n uint256 balance = token.balanceOf(address(this));//@audit add amount instead of balance\n\n emit AssetDepositIntoStrategy(asset, strategy, balance);\n\n IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);\n\n// Code block 3 (solidity):\nrsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();\n\n// Code block 4 (solidity):\nreturn IPriceFetcher(assetPriceOracle[asset]).getAssetPrice(asset);", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "/// The maximum deposit (in underlyingToken) that this strategy will accept per deposit\n uint256 public maxPerDeposit;\n\n\n /// The maximum deposits (in underlyingToken) that this strategy will hold\n uint256 public maxTotalDeposits;\n\naddress eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);\n\n uint256 balance = token.balanceOf(address(this));//@audit add amount instead of balance\n\n emit AssetDepositIntoStrategy(asset, strategy, balance);\n\n IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);\n\nrsethAmountToMint = (amount * lrtOracle.getAssetPrice(asset)) / lrtOracle.getRSETHPrice();\n\nreturn IPriceFetcher(assetPriceOracle[asset]).getAssetPrice(asset);", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " /// The maximum deposit (in underlyingToken) that this strategy will accept per deposit\n uint256 public maxPerDeposit;\n\n\n /// The maximum deposits (in underlyingToken) that this strategy will hold\n uint256 public maxTotalDeposits;", "has_vulnerable_code_snippet": true, "fixed_code_actual": " address eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);\n\n uint256 balance = token.balanceOf(address(this));//@audit add amount instead of balance\n\n emit AssetDepositIntoStrategy(asset, strategy, balance);\n\n IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "01-biconomy", "title": "martin G", "severity_raw": "Informational", "severity": "informational", "description": "# Biconomy\n\n## Gas Optimizations\n\n### G-01 Expressions for constant values such as a call to keccak256(), should use immutable rather than constant\n\nIt is expected that the value should be converted into a constant value at compile time. But actually the expression is re-calculated each time the constant is referenced.\n\n```solidity\nFile: /smart-contract-wallet/SmartAccount.sol\n\n136: return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\n\n217: txHash = keccak256(txHashData);\n\n347: _signer = ecrecover(keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", dataHash)), v - 4, r, s);\n\n416: return keccak256(enc\n\n430: keccak256(\n\n435: keccak256(_tx.data),\n```\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n\n```solidity\nFile: /smart-contract-wallet/SmartAccountFactory.sol\n\n34: bytes32 salt = keccak256(abi.encodePacked(_owner, address(uint160(_index))));\n\n70: bytes32 salt = keccak256(abi.encodePacked(_owner, address(uint160(_index))));\n\n71: bytes32 hash = keccak256(abi.encodePacked(bytes1(0xff), address(this), salt, keccak256\n(code)));\n```\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccountFactory.sol\n\n```solidity\nFile: /smart-contract-wallet/Proxy.sol\n\n16: assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));\n```\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/Proxy.sol\n\n```solidity\nFile: /smart-contract-wallet/SmartAccountNoAuth.sol\n\n136: return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\n\n217: txHash = keccak256(txHashData);\n\n342: _signer = ecrecover(keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", dataHash)), v - 4, r, s);\n\n406: return keccak256(encodeTransactionData(_tx, refundInfo, _nonce));\n\n420: keccak256(\n\n425: keccak256(_tx.data),\n```\n\nhttps://github.com/code", "vulnerable_code": "File: /smart-contract-wallet/SmartAccount.sol\n\n136: return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\n\n217: txHash = keccak256(txHashData);\n\n347: _signer = ecrecover(keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", dataHash)), v - 4, r, s);\n\n416: return keccak256(enc\n\n430: keccak256(\n\n435: keccak256(_tx.data),", "fixed_code": "File: /smart-contract-wallet/SmartAccountFactory.sol\n\n34: bytes32 salt = keccak256(abi.encodePacked(_owner, address(uint160(_index))));\n\n70: bytes32 salt = keccak256(abi.encodePacked(_owner, address(uint160(_index))));\n\n71: bytes32 hash = keccak256(abi.encodePacked(bytes1(0xff), address(this), salt, keccak256\n(code)));", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/martin-G.md", "collected_at": "2026-01-02T18:13:55.765996+00:00", "source_hash": "db8ac7296f7f2fd489010205b61dfcf6628451622c41fcd2b26d309e883c3b36", "code_block_count": 4, "solidity_block_count": 4, "total_code_chars": 1220, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: /smart-contract-wallet/SmartAccount.sol\n\n136: return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\n\n217: txHash = keccak256(txHashData);\n\n347: _signer = ecrecover(keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", dataHash)), v - 4, r, s);\n\n416: return keccak256(enc\n\n430: keccak256(\n\n435: keccak256(_tx.data),", "primary_code_language": "solidity", "primary_code_char_count": 352, "all_code_blocks": "// Code block 1 (solidity):\nFile: /smart-contract-wallet/SmartAccount.sol\n\n136: return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\n\n217: txHash = keccak256(txHashData);\n\n347: _signer = ecrecover(keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", dataHash)), v - 4, r, s);\n\n416: return keccak256(enc\n\n430: keccak256(\n\n435: keccak256(_tx.data),\n\n// Code block 2 (solidity):\nFile: /smart-contract-wallet/SmartAccountFactory.sol\n\n34: bytes32 salt = keccak256(abi.encodePacked(_owner, address(uint160(_index))));\n\n70: bytes32 salt = keccak256(abi.encodePacked(_owner, address(uint160(_index))));\n\n71: bytes32 hash = keccak256(abi.encodePacked(bytes1(0xff), address(this), salt, keccak256\n(code)));\n\n// Code block 3 (solidity):\nFile: /smart-contract-wallet/Proxy.sol\n\n16: assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));\n\n// Code block 4 (solidity):\nFile: /smart-contract-wallet/SmartAccountNoAuth.sol\n\n136: return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\n\n217: txHash = keccak256(txHashData);\n\n342: _signer = ecrecover(keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", dataHash)), v - 4, r, s);\n\n406: return keccak256(encodeTransactionData(_tx, refundInfo, _nonce));\n\n420: keccak256(\n\n425: keccak256(_tx.data),", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: /smart-contract-wallet/SmartAccount.sol\n\n136: return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\n\n217: txHash = keccak256(txHashData);\n\n347: _signer = ecrecover(keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", dataHash)), v - 4, r, s);\n\n416: return keccak256(enc\n\n430: keccak256(\n\n435: keccak256(_tx.data),\n\nFile: /smart-contract-wallet/SmartAccountFactory.sol\n\n34: bytes32 salt = keccak256(abi.encodePacked(_owner, address(uint160(_index))));\n\n70: bytes32 salt = keccak256(abi.encodePacked(_owner, address(uint160(_index))));\n\n71: bytes32 hash = keccak256(abi.encodePacked(bytes1(0xff), address(this), salt, keccak256\n(code)));\n\nFile: /smart-contract-wallet/Proxy.sol\n\n16: assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"biconomy.scw.proxy.implementation\")) - 1));\n\nFile: /smart-contract-wallet/SmartAccountNoAuth.sol\n\n136: return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\n\n217: txHash = keccak256(txHashData);\n\n342: _signer = ecrecover(keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", dataHash)), v - 4, r, s);\n\n406: return keccak256(encodeTransactionData(_tx, refundInfo, _nonce));\n\n420: keccak256(\n\n425: keccak256(_tx.data),", "github_refs_formatted": "SmartAccount.sol, SmartAccountFactory.sol, Proxy.sol", "github_files_list": "SmartAccount.sol, Proxy.sol, SmartAccountFactory.sol", "github_refs_count": 3, "vulnerable_code_actual": "File: /smart-contract-wallet/SmartAccount.sol\n\n136: return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));\n\n217: txHash = keccak256(txHashData);\n\n347: _signer = ecrecover(keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", dataHash)), v - 4, r, s);\n\n416: return keccak256(enc\n\n430: keccak256(\n\n435: keccak256(_tx.data),", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: /smart-contract-wallet/SmartAccountFactory.sol\n\n34: bytes32 salt = keccak256(abi.encodePacked(_owner, address(uint160(_index))));\n\n70: bytes32 salt = keccak256(abi.encodePacked(_owner, address(uint160(_index))));\n\n71: bytes32 hash = keccak256(abi.encodePacked(bytes1(0xff), address(this), salt, keccak256\n(code)));", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "02-ethos", "title": "GalloDaSballo G", "severity_raw": "High", "severity": "high", "description": "# Executive Summary\n\nThere's an abundant amount of opportunity for refactorings, the below report offers extremely high savings opportunity with minimal work by reducing SSTOREs and SLOADs\n\nAll benchmarks are approximations based on counting storage slots.\n\nSavings for Core are in the tens of thousands\n\nSavings for Vault are in the hundreds of thousands\n\n# Default Pool\n\n## Gas: Can be refactored to avoid giving allowance, and savings tens of thousands of gas - 20k+\nhttps://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/DefaultPool.sol#L90-L91\n\n```solidity\n IERC20(_collateral).safeIncreaseAllowance(activePool, _amount);\n IActivePool(activePoolAddress).pullCollateralFromBorrowerOperationsOrDefaultPool(_collateral, _amount);\n```\n\nCan just transfer, saving 20k gas per instance\n\n# ActivePool\n\n## Pack generator, amount and treshold into one struct by using u16 - 4.2k per balance\nhttps://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/ActivePool.sol#L246\n\nBy packing them into one struct you can save 4.2k per rebalance (2 cold SLOADs)\n\n# RedemptionHelper\n\n## Gas - By packing you can avoid doing 2 SLOADs and calls - 2.1k+\nAlso have a function \"getConfig\" or smth\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/RedemptionHelper.sol#L120-L121\n\n```solidity\n totals.collDecimals = collateralConfigCached.getCollateralDecimals(_collateral);\n totals.collMCR = collateralConfigCached.getCollateralMCR(_collateral);\n```\n\n## Gas - Cache token `lusdToken` - 100 gas\nhttps://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/RedemptionHelper.sol#L124-L128\n\n```solidity\n _requireLUSDBalanceCoversRedemption(lusdToken, _redeemer, _LUSDamount);\n\n totals.totalLUSDSupplyAtStart = getEntireSystemDebt(_collateral);\n // Confirm re", "vulnerable_code": " IERC20(_collateral).safeIncreaseAllowance(activePool, _amount);\n IActivePool(activePoolAddress).pullCollateralFromBorrowerOperationsOrDefaultPool(_collateral, _amount);", "fixed_code": " totals.collDecimals = collateralConfigCached.getCollateralDecimals(_collateral);\n totals.collMCR = collateralConfigCached.getCollateralMCR(_collateral);", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/GalloDaSballo-G.md", "collected_at": "2026-01-02T18:16:12.081949+00:00", "source_hash": "db9541deb6ad7a77e858e276daef9bf495dd27794661a27096559ce9e0c3a110", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 334, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "IERC20(_collateral).safeIncreaseAllowance(activePool, _amount);\n IActivePool(activePoolAddress).pullCollateralFromBorrowerOperationsOrDefaultPool(_collateral, _amount);", "primary_code_language": "solidity", "primary_code_char_count": 175, "all_code_blocks": "// Code block 1 (solidity):\nIERC20(_collateral).safeIncreaseAllowance(activePool, _amount);\n IActivePool(activePoolAddress).pullCollateralFromBorrowerOperationsOrDefaultPool(_collateral, _amount);\n\n// Code block 2 (solidity):\ntotals.collDecimals = collateralConfigCached.getCollateralDecimals(_collateral);\n totals.collMCR = collateralConfigCached.getCollateralMCR(_collateral);", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "IERC20(_collateral).safeIncreaseAllowance(activePool, _amount);\n IActivePool(activePoolAddress).pullCollateralFromBorrowerOperationsOrDefaultPool(_collateral, _amount);\n\ntotals.collDecimals = collateralConfigCached.getCollateralDecimals(_collateral);\n totals.collMCR = collateralConfigCached.getCollateralMCR(_collateral);", "github_refs_formatted": "DefaultPool.sol#L90-L91, ActivePool.sol#L246, RedemptionHelper.sol#L120-L121, RedemptionHelper.sol#L124-L128", "github_files_list": "RedemptionHelper.sol, ActivePool.sol, DefaultPool.sol", "github_refs_count": 4, "vulnerable_code_actual": " IERC20(_collateral).safeIncreaseAllowance(activePool, _amount);\n IActivePool(activePoolAddress).pullCollateralFromBorrowerOperationsOrDefaultPool(_collateral, _amount);", "has_vulnerable_code_snippet": true, "fixed_code_actual": " totals.collDecimals = collateralConfigCached.getCollateralDecimals(_collateral);\n totals.collMCR = collateralConfigCached.getCollateralMCR(_collateral);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "05-ajna", "title": "squeaky_cactus Q", "severity_raw": "Critical", "severity": "critical", "description": "

Anja Protocol - QA Report

\n\nJust a quick read through of the code, picking up a few NC issues.\n\n

Non-Critical

\n\n

Code

\n\n

Typographical Correctness

\n\n```\najna-core/src/PositionManager.sol:352\n\n352: function reedemPositions(\n```\nMisspelling of redeem; ``reedemPositions``-> ``redeemPositions``\n\n

NatSpec Comments

\n\n

Code Conflict

\n\n```\najna-core/src/PositionManager.sol:54\n\n51: /// @dev Mapping of `token id => ajna pool address` for which token was minted.\n52: mapping(uint256 => address) public override poolKey;\n53:\n54: /// @dev Mapping of `token id => ajna pool address` for which token was minted.\n55: mapping(uint256 => mapping(uint256 => Position)) internal positions;\n```\nThe comment on line 54 copies line 51, however it does not correctly describe the purpose of the field `positions` \non the following line.\n\nSuggestion: ``/// @dev Mapping of `token id => position by index`.``\n\n\n```\najna-grants/src/ExtraOrdinaryFunding.sol:180\n\n180: /********************************/\n181: /*** Internal View Functions ****/\n182: /********************************/\n```\nAn internal view function is above the comment block.\n\nSuggestion: move the function ``_extraordinaryProposalSucceeded`` to below the comment.\n\n\n\n```\najna-grants/src/IFunding.sol:7\n\n7: * @title Ajna Grant Coordination Fund Extraordinary Proposal flow.\n```\nTitle does not match purpose of the interface. This is the same contain in ``IExtordinaryFunding.sol``.\n\nSuggestion: remove interface level comment block.\n\n\n

Typographical Correctness

\n\n```\najna-core/src/PositionManager.sol:83\n\n83: uint256 depositTime; // lender deposit time in from bucekt\n```\nMisspelling of bucket; ``bucekt``-> ``bucket``\n\n```\najna-core/src/RewardsManager.sol:189\n\n189: // update to bucket list exchange rates, from buckets are aready updated on claim\n```\nMisspelling of already; ``aready``-> ``already``\n\n\n```\najna-grants/src/ExtraOrdinaryFunding.sol:69\n\n69: // check ", "vulnerable_code": "ajna-core/src/PositionManager.sol:352\n\n352: function reedemPositions(", "fixed_code": "ajna-core/src/PositionManager.sol:54\n\n51: /// @dev Mapping of `token id => ajna pool address` for which token was minted.\n52: mapping(uint256 => address) public override poolKey;\n53:\n54: /// @dev Mapping of `token id => ajna pool address` for which token was minted.\n55: mapping(uint256 => mapping(uint256 => Position)) internal positions;", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/squeaky_cactus-Q.md", "collected_at": "2026-01-02T18:21:48.780032+00:00", "source_hash": "dbdfd9358ee8fb030b24faf9df930591daea3fdefa86dde4049959b5aaae341a", "code_block_count": 6, "solidity_block_count": 0, "total_code_chars": 939, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "ajna-core/src/PositionManager.sol:352\n\n352: function reedemPositions(", "primary_code_language": "unknown", "primary_code_char_count": 69, "all_code_blocks": "// Code block 1 (unknown):\najna-core/src/PositionManager.sol:352\n\n352: function reedemPositions(\n\n// Code block 2 (unknown):\najna-core/src/PositionManager.sol:54\n\n51: /// @dev Mapping of `token id => ajna pool address` for which token was minted.\n52: mapping(uint256 => address) public override poolKey;\n53:\n54: /// @dev Mapping of `token id => ajna pool address` for which token was minted.\n55: mapping(uint256 => mapping(uint256 => Position)) internal positions;\n\n// Code block 3 (unknown):\najna-grants/src/ExtraOrdinaryFunding.sol:180\n\n180: /********************************/\n181: /*** Internal View Functions ****/\n182: /********************************/\n\n// Code block 4 (unknown):\najna-grants/src/IFunding.sol:7\n\n7: * @title Ajna Grant Coordination Fund Extraordinary Proposal flow.\n\n// Code block 5 (unknown):\najna-core/src/PositionManager.sol:83\n\n83: uint256 depositTime; // lender deposit time in from bucekt\n\n// Code block 6 (unknown):\najna-core/src/RewardsManager.sol:189\n\n189: // update to bucket list exchange rates, from buckets are aready updated on claim", "all_code_blocks_count": 6, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "ajna-core/src/PositionManager.sol:352\n\n352: function reedemPositions(", "has_vulnerable_code_snippet": true, "fixed_code_actual": "ajna-core/src/PositionManager.sol:54\n\n51: /// @dev Mapping of `token id => ajna pool address` for which token was minted.\n52: mapping(uint256 => address) public override poolKey;\n53:\n54: /// @dev Mapping of `token id => ajna pool address` for which token was minted.\n55: mapping(uint256 => mapping(uint256 => Position)) internal positions;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 11} {"source": "c4", "protocol": "02-ai-arena", "title": "Ryonen Q", "severity_raw": "Low", "severity": "low", "description": "https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/MergingPool.sol#L139-L167\n\n## Impact\n\nI was thinking that perhaps `claimRewards` could potentially generate issues for users who win rewards in a fairly **advanced roundId**, as claimRewards starts with a `lowerBound == 0` for new users. Additionally, it contains a loop that checks if `msg.sender == winnerAddresses[currentRound][j]`. Therefore, I created a test to understand how problematic this function can be:\n\n## POC\n\n```\n function testClaimRewardsAdvancedRoundIdWithNewUser() public {\n\n address winner = makeAddr(\"winner\");\n address player3 = makeAddr(\"player3\");\n address player4 = makeAddr(\"player4\");\n address player5 = makeAddr(\"player5\");\n address player6 = makeAddr(\"player6\");\n address player7 = makeAddr(\"player7\");\n\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_DELEGATED_ADDRESS);\n _mintFromMergingPool(winner);\n _mintFromMergingPool(player3);\n _mintFromMergingPool(player4);\n _mintFromMergingPool(player5);\n _mintFromMergingPool(player6);\n _mintFromMergingPool(player7);\n\n _mergingPoolContract.updateWinnersPerPeriod(7);\n\n string[] memory _modelURIs = new string[](2);\n _modelURIs[0] = \"ipfs://bafybeiaatcgqvzvz3wrjiqmz2ivcu2c5sqxgipv5w2hzy4pdlw7hfox42m\";\n _modelURIs[1] = \"ipfs://bafybeiaatcgqvzvz3wrjiqmz2ivcu2c5sqxgipv5w2hzy4pdlw7hfox42m\";\n string[] memory _modelTypes = new string[](2);\n _modelTypes[0] = \"original\";\n _modelTypes[1] = \"original\";\n uint256[2][] memory _customAttributes = new uint256[2][](2);\n _customAttributes[0][0] = uint256(1);\n _customAttributes[0][1] = uint256(80);\n _customAttributes[1][0] = uint256(1);\n _customAttributes[1][1] = uint256(80);\n\n uint256[] memory _winners = new uint256[](7);\n\n _winners[0] = 0;\n _winners[1] = 1;\n _winners[2] = 2;\n _winne", "vulnerable_code": " function testClaimRewardsAdvancedRoundIdWithNewUser() public {\n\n address winner = makeAddr(\"winner\");\n address player3 = makeAddr(\"player3\");\n address player4 = makeAddr(\"player4\");\n address player5 = makeAddr(\"player5\");\n address player6 = makeAddr(\"player6\");\n address player7 = makeAddr(\"player7\");\n\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_DELEGATED_ADDRESS);\n _mintFromMergingPool(winner);\n _mintFromMergingPool(player3);\n _mintFromMergingPool(player4);\n _mintFromMergingPool(player5);\n _mintFromMergingPool(player6);\n _mintFromMergingPool(player7);\n\n _mergingPoolContract.updateWinnersPerPeriod(7);\n\n string[] memory _modelURIs = new string[](2);\n _modelURIs[0] = \"ipfs://bafybeiaatcgqvzvz3wrjiqmz2ivcu2c5sqxgipv5w2hzy4pdlw7hfox42m\";\n _modelURIs[1] = \"ipfs://bafybeiaatcgqvzvz3wrjiqmz2ivcu2c5sqxgipv5w2hzy4pdlw7hfox42m\";\n string[] memory _modelTypes = new string[](2);\n _modelTypes[0] = \"original\";\n _modelTypes[1] = \"original\";\n uint256[2][] memory _customAttributes = new uint256[2][](2);\n _customAttributes[0][0] = uint256(1);\n _customAttributes[0][1] = uint256(80);\n _customAttributes[1][0] = uint256(1);\n _customAttributes[1][1] = uint256(80);\n\n uint256[] memory _winners = new uint256[](7);\n\n _winners[0] = 0;\n _winners[1] = 1;\n _winners[2] = 2;\n _winners[3] = 3;\n _winners[4] = 4;\n _winners[5] = 5;\n _winners[6] = 6;\n\n uint256[] memory _previousWinners = new uint256[](7);\n\n _previousWinners[0] = 0;\n _previousWinners[1] = 1;\n _previousWinners[2] = 3;\n _previousWinners[3] = 4;\n _previousWinners[4] = 5;\n _previousWinners[5] = 6;\n _previousWinners[6] = 7;\n\n for(uint256 i = 0; i < 6000; i++){\n _mergingPoolContract.pickWinner(_previousWinners);\n ", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/Ryonen-Q.md", "collected_at": "2026-01-02T19:02:42.045689+00:00", "source_hash": "dbf4bd4cad9dfc555eb077805d6324cd117700d0ce642737c0e89557356842c2", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "MergingPool.sol#L139-L167", "github_files_list": "MergingPool.sol", "github_refs_count": 1, "vulnerable_code_actual": " function testClaimRewardsAdvancedRoundIdWithNewUser() public {\n\n address winner = makeAddr(\"winner\");\n address player3 = makeAddr(\"player3\");\n address player4 = makeAddr(\"player4\");\n address player5 = makeAddr(\"player5\");\n address player6 = makeAddr(\"player6\");\n address player7 = makeAddr(\"player7\");\n\n _mintFromMergingPool(_ownerAddress);\n _mintFromMergingPool(_DELEGATED_ADDRESS);\n _mintFromMergingPool(winner);\n _mintFromMergingPool(player3);\n _mintFromMergingPool(player4);\n _mintFromMergingPool(player5);\n _mintFromMergingPool(player6);\n _mintFromMergingPool(player7);\n\n _mergingPoolContract.updateWinnersPerPeriod(7);\n\n string[] memory _modelURIs = new string[](2);\n _modelURIs[0] = \"ipfs://bafybeiaatcgqvzvz3wrjiqmz2ivcu2c5sqxgipv5w2hzy4pdlw7hfox42m\";\n _modelURIs[1] = \"ipfs://bafybeiaatcgqvzvz3wrjiqmz2ivcu2c5sqxgipv5w2hzy4pdlw7hfox42m\";\n string[] memory _modelTypes = new string[](2);\n _modelTypes[0] = \"original\";\n _modelTypes[1] = \"original\";\n uint256[2][] memory _customAttributes = new uint256[2][](2);\n _customAttributes[0][0] = uint256(1);\n _customAttributes[0][1] = uint256(80);\n _customAttributes[1][0] = uint256(1);\n _customAttributes[1][1] = uint256(80);\n\n uint256[] memory _winners = new uint256[](7);\n\n _winners[0] = 0;\n _winners[1] = 1;\n _winners[2] = 2;\n _winners[3] = 3;\n _winners[4] = 4;\n _winners[5] = 5;\n _winners[6] = 6;\n\n uint256[] memory _previousWinners = new uint256[](7);\n\n _previousWinners[0] = 0;\n _previousWinners[1] = 1;\n _previousWinners[2] = 3;\n _previousWinners[3] = 4;\n _previousWinners[4] = 5;\n _previousWinners[5] = 6;\n _previousWinners[6] = 7;\n\n for(uint256 i = 0; i < 6000; i++){\n _mergingPoolContract.pickWinner(_previousWinners);\n ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "02-ethos", "title": "Tomio G", "severity_raw": "Low", "severity": "low", "description": "1.\nTitle: Using bytes constant is more gas efficient\n\nReference: [Here](https://ethereum.stackexchange.com/questions/3795/why-do-solidity-examples-use-bytes32-type-instead-of-string)\n\nProof of Concept:\n[BorrowerOperations.sol#L21](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L21)\n[ActivePool.sol#L30](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol#L30)\n[CommunityIssuance.sol#L19](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LQTY/CommunityIssuance.sol#L19)\n[LQTYStaking.sol#L23](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LQTY/LQTYStaking.sol#L23)\n\nRecommended Mitigation Steps:\nChange it to `bytes(1..32) constant`\n________________________________________________________________________\n\n2.\nTitle: Gas savings for using solidity 0.8.10\n\nimpact:\nUse a solidity version of at least 0.8 to get default underflow/overflow checks, use a solidity version of at least 0.8.2 to get simple compiler automatic inlining Use a solidity version of at least 0.8.3 to get better struct packing and cheaper multiple storage reads Use a solidity version of at least 0.8.4 to get custom errors, which are cheaper at deployment than revert()/require() strings\nUse a solidity version of at least 0.8.10 to have external calls skip contract existence checks if the external call has a return value\n\nProof of Concept:\nAll contract in scope.\nby using version 0.8+ we can avoid using library safeMath in [ActivePool.sol#L27](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol#L27) , [CommunityIssuance.sol#L15](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LQTY/CommunityIssuance.sol#L15) , [LQTYStaking.sol#L20](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LQTY/LQTYStaking.sol#L20) , [LUSDToken.sol#L29](https://github.com/code-423n4/2023-02-ethos/blob/main/Etho", "vulnerable_code": "function _getCompoundedDepositFromSnapshots(\n uint initialDeposit,\n Snapshots memory snapshots\n )\n internal\n view\n returns (uint compoundedDeposit) //@audit-info: set here", "fixed_code": "\trequire(_maxFeePercentage >= BORROWING_FEE_FLOOR,\n \"Max fee percentage must be between 0.5% and 100%\");\n\trequire(_maxFeePercentage <= DECIMAL_PRECISION,\n \"Max fee percentage must be between 0.5% and 100%\");", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/Tomio-G.md", "collected_at": "2026-01-02T18:16:40.947361+00:00", "source_hash": "dc31e546cf2689872c84c6d4d7dcea25655b5a8b833ff4aa22eed6114f3b5f2b", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 7, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "BorrowerOperations.sol#L21, ActivePool.sol#L30, CommunityIssuance.sol#L19, LQTYStaking.sol#L23, ActivePool.sol#L27, CommunityIssuance.sol#L15, LQTYStaking.sol#L20", "github_files_list": "BorrowerOperations.sol, ActivePool.sol, CommunityIssuance.sol, LQTYStaking.sol", "github_refs_count": 7, "vulnerable_code_actual": "function _getCompoundedDepositFromSnapshots(\n uint initialDeposit,\n Snapshots memory snapshots\n )\n internal\n view\n returns (uint compoundedDeposit) //@audit-info: set here", "has_vulnerable_code_snippet": true, "fixed_code_actual": "\trequire(_maxFeePercentage >= BORROWING_FEE_FLOOR,\n \"Max fee percentage must be between 0.5% and 100%\");\n\trequire(_maxFeePercentage <= DECIMAL_PRECISION,\n \"Max fee percentage must be between 0.5% and 100%\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "10-badger", "title": "oualidpro Q", "severity_raw": "Critical", "severity": "critical", "description": "## Summary\n\n### Low Risk Issues\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [[L‑1](#l1-vulnerable-versions-of-packages-are-being-used)] | Vulnerable versions of packages are being used | 1 | \n| [[L‑2](#l2-missing-checks-for-address-0-when-assigning-values-to-address-state-variables)] | Missing checks for `address(0)` when assigning values to address state variables | 27 | \n| [[L‑3](#l3-for-loops-in-public-or-external-functions-should-be-avoided-due-to-high-gas-costs-and-possible-dos)] | For loops in public or external functions should be avoided due to high gas costs and possible DOS | 11 | \n| [[L‑4](#l4-missing-checks-in-constructor-initialize)] | Missing checks in constructor/initialize | 1 | \n| [[L‑5](#l5-external-calls-in-an-un-bounded-loop-may-result-in-a-dos)] | `external` calls in an un-bounded loop may result in a DOS | 14 | \n| [[L‑6](#l6-internal-function-calls-within-for-loops)] | `internal` Function calls within for loops | 17 | \n| [[L‑7](#l7-loss-of-precision)] | Loss of precision | 13 | \n| [[L‑8](#l8-require-should-be-used-instead-of-assert)] | `require()` should be used instead of `assert()` | 1 | \n| [[L‑9](#l9-consider-using-openzeppelin-s-safecast-library-to-prevent-unexpected-overflows-when-casting-from-various-type-int-uint-values)] | Consider using OpenZeppelin\u2019s SafeCast library to prevent unexpected overflows when casting from various type int/uint values | 5 | \n| [[L‑10](#l10-setters-should-have-initial-value-check)] | Setters should have initial value check | 10 | \n| [[L‑11](#l11-sweeping-may-break-accounting-if-tokens-with-multiple-addresses-are-used)] | Sweeping may break accounting if tokens with multiple addresses are used | 3 | \n| [[L‑12](#l12-int-casting-block-timestamp-can-reduce-the-lifespan-of-a-contract)] | Int casting `block.timestamp` can reduce the lifespan of a contract | 1 | \n| [[L‑13](#l13-unused-empty-receive-fallback-function)] | Unused/empty `re", "vulnerable_code": "File: package.json\n\n\n
Vulnerabilities related to `@openzeppelin/contracts`:\n\n\n- [CVE-2023-34459](https://github.com/OpenZeppelin/openzeppelin-contracts/security/advisories/GHSA-wprv-93r4-jj2p) :When the verifyMultiProof, verifyMultiProofCalldata, processMultiProof, or processMultiProofCalldata functions are in use, it is possible to construct merkle trees that allow forging a valid multiproof for an arbitrary set of leaves.\nA contract may be vulnerable if it uses multiproofs for verification and the merkle tree that is processed includes a node with value 0 at depth 1(just under the root).This could happen inadvertently for balanced trees with 3 leaves or less, if the leaves are not hashed.This could happen deliberately if a malicious tree builder includes such a node in the tree.\nA contract is not vulnerable if it uses single- leaf proving(verify, verifyCalldata, processProof, or processProofCalldata), or if it uses multiproofs with a known tree that has hashed leaves.Standard merkle trees produced or validated with the @openzeppelin/merkle-tree library are safe.\n\n\n- [CVE-2023-34234](https://github.com/OpenZeppelin/openzeppelin-contracts/security/advisories/GHSA-5h3x-9wvq-w4m2) :By frontrunning the creation of a proposal, an attacker can become the proposer and gain the ability to cancel it. The attacker can do this repeatedly to try to prevent a proposal from being proposed at all.\nThis impacts the Governor contract in v4.9.0 only, and the GovernorCompatibilityBravo contract since v4.3.0.\n\n\n- [CVE-2023-30541](https://github.com/OpenZeppelin/openzeppelin-contracts/security/advisories/GHSA-mx2q-35m2-x2rh) :A function in the implementation contract may be inaccessible if its selector clashes with one of the proxy's own selectors. Specifically, if the clashing function has a different signature with incompatible ABI encoding, the proxy could revert while attempting to decode the arguments from calldata.\nThe probability of an accidental clash", "fixed_code": "File: packages/contracts/contracts/ActivePool.sol\n\n53: borrowerOperationsAddress = _borrowerOperationsAddress;\n\n54: cdpManagerAddress = _cdpManagerAddress;\n\n56: collSurplusPoolAddress = _collSurplusAddress;\n\n57: feeRecipientAddress = _feeRecipientAddress;\n\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/oualidpro-Q.md", "collected_at": "2026-01-02T18:26:59.323640+00:00", "source_hash": "dc96f00d5d5ce769b539db563f669173ca85483a7576ea17eaca8032a368072b", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: package.json\n\n\n
Vulnerabilities related to `@openzeppelin/contracts`:\n\n\n- [CVE-2023-34459](https://github.com/OpenZeppelin/openzeppelin-contracts/security/advisories/GHSA-wprv-93r4-jj2p) :When the verifyMultiProof, verifyMultiProofCalldata, processMultiProof, or processMultiProofCalldata functions are in use, it is possible to construct merkle trees that allow forging a valid multiproof for an arbitrary set of leaves.\nA contract may be vulnerable if it uses multiproofs for verification and the merkle tree that is processed includes a node with value 0 at depth 1(just under the root).This could happen inadvertently for balanced trees with 3 leaves or less, if the leaves are not hashed.This could happen deliberately if a malicious tree builder includes such a node in the tree.\nA contract is not vulnerable if it uses single- leaf proving(verify, verifyCalldata, processProof, or processProofCalldata), or if it uses multiproofs with a known tree that has hashed leaves.Standard merkle trees produced or validated with the @openzeppelin/merkle-tree library are safe.\n\n\n- [CVE-2023-34234](https://github.com/OpenZeppelin/openzeppelin-contracts/security/advisories/GHSA-5h3x-9wvq-w4m2) :By frontrunning the creation of a proposal, an attacker can become the proposer and gain the ability to cancel it. The attacker can do this repeatedly to try to prevent a proposal from being proposed at all.\nThis impacts the Governor contract in v4.9.0 only, and the GovernorCompatibilityBravo contract since v4.3.0.\n\n\n- [CVE-2023-30541](https://github.com/OpenZeppelin/openzeppelin-contracts/security/advisories/GHSA-mx2q-35m2-x2rh) :A function in the implementation contract may be inaccessible if its selector clashes with one of the proxy's own selectors. Specifically, if the clashing function has a different signature with incompatible ABI encoding, the proxy could revert while attempting to decode the arguments from calldata.\nThe probability of an accidental clash", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: packages/contracts/contracts/ActivePool.sol\n\n53: borrowerOperationsAddress = _borrowerOperationsAddress;\n\n54: cdpManagerAddress = _cdpManagerAddress;\n\n56: collSurplusPoolAddress = _collSurplusAddress;\n\n57: feeRecipientAddress = _feeRecipientAddress;\n\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-revert-lend", "title": "0x11singh99 Q", "severity_raw": "Critical", "severity": "critical", "description": "# Low-Severity\n\n## [L-01] Check address `to` for `address(0)` before transferring ethers (*Note: Instance missed by bot*)\n\nIt's indeed a good practice to check if the destination address (`to` address) is not the zero address before transferring `ethers`. This is to ensure that accidental transfers to the zero address do not occur, which could result in the loss of funds since transactions to the zero address are typically irreversible.\n\n```solidity\nFile : src/automators/Automator.sol\n\n123: function withdrawETH(address to) external {\n if (msg.sender != withdrawer) {\n revert Unauthorized();\n }\n\n uint256 balance = address(this).balance;\n if (balance > 0) {\n (bool sent,) = to.call{value: balance}(\"\");\n if (!sent) {\n revert EtherSendFailed();\n }\n\n```\n[123-133](https://github.com/code-423n4/2024-03-revert-lend/blob/main/src/automators/Automator.sol#L123C4-L133C14)\n\n# Non-critical\n\n## [N-01] Do not use shadowed variable `owner` in `withdraw` function\n\nThis can lead to confusion when referencing the variable `owner` within the `withdraw` function because the parameter `owner` will take precedence over the inherited state variable `owner`. Shadowing can lead to bugs if the developer mistakenly references the wrong variable within the function. Shadowing can make the code less clear and readable.\n\n```solidity\nFile : src/V3Vault.sol\n\n372: function withdraw(uint256 assets, address receiver, address owner) external override returns (uint256) {\n\n```\n[372](https://github.com/code-423n4/2024-03-revert-lend/blob/main/src/V3Vault.sol#L372)\n\n## [N-02] Changing the visibility of functions from `public` to `external` when it's not intended to be called within the contract itself (*Note: Instances missed by bot*)\n\nDeclaring a function as `external` clearly communicates to developers that the function is intended to be called from outside the contract. This can improve code readability ", "vulnerable_code": "File : src/automators/Automator.sol\n\n123: function withdrawETH(address to) external {\n if (msg.sender != withdrawer) {\n revert Unauthorized();\n }\n\n uint256 balance = address(this).balance;\n if (balance > 0) {\n (bool sent,) = to.call{value: balance}(\"\");\n if (!sent) {\n revert EtherSendFailed();\n }\n", "fixed_code": "File : src/V3Vault.sol\n\n372: function withdraw(uint256 assets, address receiver, address owner) external override returns (uint256) {\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/0x11singh99-Q.md", "collected_at": "2026-01-02T19:02:51.257062+00:00", "source_hash": "dcc44fee5fa8127e5ac149eef211777c96bd5db59d61565ba777c1a946f758e4", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 533, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File : src/automators/Automator.sol\n\n123: function withdrawETH(address to) external {\n if (msg.sender != withdrawer) {\n revert Unauthorized();\n }\n\n uint256 balance = address(this).balance;\n if (balance > 0) {\n (bool sent,) = to.call{value: balance}(\"\");\n if (!sent) {\n revert EtherSendFailed();\n }", "primary_code_language": "solidity", "primary_code_char_count": 396, "all_code_blocks": "// Code block 1 (solidity):\nFile : src/automators/Automator.sol\n\n123: function withdrawETH(address to) external {\n if (msg.sender != withdrawer) {\n revert Unauthorized();\n }\n\n uint256 balance = address(this).balance;\n if (balance > 0) {\n (bool sent,) = to.call{value: balance}(\"\");\n if (!sent) {\n revert EtherSendFailed();\n }\n\n// Code block 2 (solidity):\nFile : src/V3Vault.sol\n\n372: function withdraw(uint256 assets, address receiver, address owner) external override returns (uint256) {", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File : src/automators/Automator.sol\n\n123: function withdrawETH(address to) external {\n if (msg.sender != withdrawer) {\n revert Unauthorized();\n }\n\n uint256 balance = address(this).balance;\n if (balance > 0) {\n (bool sent,) = to.call{value: balance}(\"\");\n if (!sent) {\n revert EtherSendFailed();\n }\n\nFile : src/V3Vault.sol\n\n372: function withdraw(uint256 assets, address receiver, address owner) external override returns (uint256) {", "github_refs_formatted": "Automator.sol#L123-L4, V3Vault.sol#L372", "github_files_list": "V3Vault.sol, Automator.sol", "github_refs_count": 2, "vulnerable_code_actual": "File : src/automators/Automator.sol\n\n123: function withdrawETH(address to) external {\n if (msg.sender != withdrawer) {\n revert Unauthorized();\n }\n\n uint256 balance = address(this).balance;\n if (balance > 0) {\n (bool sent,) = to.call{value: balance}(\"\");\n if (!sent) {\n revert EtherSendFailed();\n }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File : src/V3Vault.sol\n\n372: function withdraw(uint256 assets, address receiver, address owner) external override returns (uint256) {\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "08-dopex", "title": "0xgrbr G", "severity_raw": "Low", "severity": "low", "description": "## 1. Use calldata instead of memory for function parameters that don\u2019t change\nWhen you specify a data location as memory, that value will be copied into memory. When you specify the location as calldata, the value will stay static within calldata. If the value is a large, complex type, using memory may result in extra memory expansion costs.\n\nTotal Instances: 8\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/amo/UniV3LiquidityAmo.sol#L156\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L244\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L273\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L768\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L824\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L825\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/perp-vault/PerpetualAtlanticVault.sol#L316\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/perp-vault/PerpetualAtlanticVault.sol#L406\n\nChange function arguments from memory to calldata.\n\n## 2. Reorder structure layout\nThe following structures could be optimized moving the position of certain values in order to save a slot:\n\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L67\n```\n /// @notice Token address that dpxEth is pegged to\n address public weth;\n```\nMove to:\nhttps://github.com/code-423n4/2023-08-dopex/blob/main/contracts/core/RdpxV2Core.sol#L116\n```\n....\n /// @notice Token address that dpxEth is pegged to\n address public weth;\n\n /// @notice Whether reLP is active or not\n bool public isReLPActive;\n\n /// @notice Whether put options are requred\n bool public putOptionsRequired;\n....\n```\n\n## 3. Fetch variable before the loop\n\nThe current code calls getUnderlyingPrice() inside the loop, which is inefficient and consumes more gas for each iteration o", "vulnerable_code": " /// @notice Token address that dpxEth is pegged to\n address public weth;", "fixed_code": "....\n /// @notice Token address that dpxEth is pegged to\n address public weth;\n\n /// @notice Whether reLP is active or not\n bool public isReLPActive;\n\n /// @notice Whether put options are requred\n bool public putOptionsRequired;\n....", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/0xgrbr-G.md", "collected_at": "2026-01-02T18:24:23.165541+00:00", "source_hash": "dcceeafb116379861aa902a9879552d0779854230bf478ff3cf673fa9afee3d2", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 312, "github_ref_count": 10, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "/// @notice Token address that dpxEth is pegged to\n address public weth;", "primary_code_language": "unknown", "primary_code_char_count": 73, "all_code_blocks": "// Code block 1 (unknown):\n/// @notice Token address that dpxEth is pegged to\n address public weth;\n\n// Code block 2 (unknown):\n....\n /// @notice Token address that dpxEth is pegged to\n address public weth;\n\n /// @notice Whether reLP is active or not\n bool public isReLPActive;\n\n /// @notice Whether put options are requred\n bool public putOptionsRequired;\n....", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "UniV3LiquidityAmo.sol#L156, RdpxV2Core.sol#L244, RdpxV2Core.sol#L273, RdpxV2Core.sol#L768, RdpxV2Core.sol#L824, RdpxV2Core.sol#L825, PerpetualAtlanticVault.sol#L316, PerpetualAtlanticVault.sol#L406, RdpxV2Core.sol#L67, RdpxV2Core.sol#L116", "github_files_list": "PerpetualAtlanticVault.sol, RdpxV2Core.sol, UniV3LiquidityAmo.sol", "github_refs_count": 10, "vulnerable_code_actual": " /// @notice Token address that dpxEth is pegged to\n address public weth;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "....\n /// @notice Token address that dpxEth is pegged to\n address public weth;\n\n /// @notice Whether reLP is active or not\n bool public isReLPActive;\n\n /// @notice Whether put options are requred\n bool public putOptionsRequired;\n....", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "11-kelp", "title": "osmanozdemir1 Q", "severity_raw": "Medium", "severity": "medium", "description": "### Summary\n\n* \\[L-01\\] `LRTConfig::updateAssetDepositLimit()` function doesn't check if the current deposits are greater than the new limit\n \n* \\[L-02\\] `LRTDepositPool::addNodeDelegatorContractToQueue()` function should check if the inputted array includes the same addresses\n \n* \\[L-03\\] `LRTDepositPool::updateMaxNodeDelegatorCount` should check the new count is not below the current delegator count\n \n* \\[L-04\\] Deposited amounts in the EigenLayer strategy should be checked before updating the strategy for the asset\n \n* \\[L-05\\] `ChainlinkPriceOracle::getAssetPrice()` function should check the stale price\n \n* \\[NC-01\\] `ChainlinkPriceOracle.sol` contract should use AggregatorV3Interface instead of AggregatorInterface\n \n* \\[NC-02\\] It would be better to check the decimal precision of the returned values from oracles\n \n\n---\n\n### \\[L-01\\] `LRTConfig::updateAssetDepositLimit()` function doesn't check if the current deposits are greater than the new limit\n\n[https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTConfig.sol#L94C5-L104C6](https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTConfig.sol#L94C5-L104C6)\n\nEvery asset has a deposit limit and the contract managers can update these limits. The issue here is that the `updateAssetDepositLimit()` function doesn't check the current total asset deposits.\n\nIt is possible to set a new limit below the current deposits which leads to a broken invariant.\n\n**Recommendation**: I would recommend checking the current deposits before assigning the new limit.\n\n```solidity\n function updateAssetDepositLimit(\n address asset,\n uint256 depositLimit\n )\n external\n onlyRole(LRTConstants.MANAGER)\n onlySupportedAsset(asset)\n {\n+ uint256 currentDepositAmount = lrtDepositPool.getTotalAssetDeposits(asset);\n+ if (depositLimit < currentDepositAmount) {\n+ revert\n+ }\n ", "vulnerable_code": " function updateAssetDepositLimit(\n address asset,\n uint256 depositLimit\n )\n external\n onlyRole(LRTConstants.MANAGER)\n onlySupportedAsset(asset)\n {\n+ uint256 currentDepositAmount = lrtDepositPool.getTotalAssetDeposits(asset);\n+ if (depositLimit < currentDepositAmount) {\n+ revert\n+ }\n depositLimitByAsset[asset] = depositLimit;\n emit AssetDepositLimitUpdate(asset, depositLimit);\n }", "fixed_code": " function getAssetDistributionData(address asset) {\n // skipped for brevity\n\n uint256 ndcsCount = nodeDelegatorQueue.length;\n for (uint256 i; i < ndcsCount;) {\n assetLyingInNDCs += IERC20(asset).balanceOf(nodeDelegatorQueue[i]); //@audit - it the array has the same delegator address in it, calculated balance will be greater than the actual deposit\n assetStakedInEigenLayer += INodeDelegator(nodeDelegatorQueue[i]).getAssetBalance(asset);\n unchecked {\n ++i;\n }\n }\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/osmanozdemir1-Q.md", "collected_at": "2026-01-02T18:28:20.616180+00:00", "source_hash": "dcf64a4341fbeb32180e16b4aff7408c8d784172f00cfc9f220e21c7596408f5", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LRTConfig.sol#L94-L5", "github_files_list": "LRTConfig.sol", "github_refs_count": 1, "vulnerable_code_actual": " function updateAssetDepositLimit(\n address asset,\n uint256 depositLimit\n )\n external\n onlyRole(LRTConstants.MANAGER)\n onlySupportedAsset(asset)\n {\n+ uint256 currentDepositAmount = lrtDepositPool.getTotalAssetDeposits(asset);\n+ if (depositLimit < currentDepositAmount) {\n+ revert\n+ }\n depositLimitByAsset[asset] = depositLimit;\n emit AssetDepositLimitUpdate(asset, depositLimit);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function getAssetDistributionData(address asset) {\n // skipped for brevity\n\n uint256 ndcsCount = nodeDelegatorQueue.length;\n for (uint256 i; i < ndcsCount;) {\n assetLyingInNDCs += IERC20(asset).balanceOf(nodeDelegatorQueue[i]); //@audit - it the array has the same delegator address in it, calculated balance will be greater than the actual deposit\n assetStakedInEigenLayer += INodeDelegator(nodeDelegatorQueue[i]).getAssetBalance(asset);\n unchecked {\n ++i;\n }\n }\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "10-badger", "title": "nonseodion Q", "severity_raw": "Low", "severity": "low", "description": "## L-1 _PERMIT_POSITION_MANAGER_TYPEHASH hash generation and comment discrepancy\n\nhttps://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/BorrowerOperations.sol#L31-L35\n\n// keccak256(\"permitPositionManagerApproval(address borrower,address positionManager,uint8 status,uint256 nonce,uint256 deadline)\"); \n bytes32 private constant _PERMIT_POSITION_MANAGER_TYPEHASH =\n keccak256(\n \"PermitPositionManagerApproval(address borrower,address positionManager,uint8 status,uint256 nonce,uint256 deadline)\"\n );\n\nThe comment for the typehash of the position manager and the actual code are different. The keccack256 hash in the comment and the hash in the code act on different arguments which will cause the output to be different. The difference in the arguments is in the capitalisation of the first letter.\n\n### Recommended Mitigation\nChange the hash argument to \"PermitPositionManagerApproval(address borrower,address positionManager,uint8 status,uint256 nonce,uint256 deadline)\".\n\n## L-2 Chainlink feed timeouts are immutable in PriceFeed but can be changed.\nhttps://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/PriceFeed.sol#L31-L33\n\nBased on a [conversation](https://x.com/NonseOdion/status/1710950601301893320?s=20) with [ChainlinkGod](https://twitter.com/ChainLinkGod), a prominent advocate of Chainlink, on Twitter, the timeout (heartbeat) of price feeds can be changed. If this occurs it means the PriceFeed contract will be using invalid timeout values and it'll remain in that state since they are immutable. Thus it won't be able to know the right time to put the Chainlink price feeds in frozen states.\n\n### Recommended Mitigation\nAllow the heartbeats to be set by Governance. Since they aren't values enforced at the contract level.\n\n## L-3 The status values for the PriceFeed status enums are used wrongly according to their dictionar", "vulnerable_code": "When the public `status` variable of PriceFeed is called, and it returns any status starting with \"using\", it should mean that the price returned by the PriceFeed was from the oracle mentioned after `using` while the other is untrusted or frozen. E.g if it returns `usingFallbackChainlinkFrozen`, it should mean the price returned was from Fallback while Chainlink is frozen. But sometimes it returns the lastGoodPrice instead of the latest price from that oracle.\n\nE.g \n\nhttps://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/PriceFeed.sol#L120C3-L123\n", "fixed_code": "", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/nonseodion-Q.md", "collected_at": "2026-01-02T18:26:58.282878+00:00", "source_hash": "dd452156ee540146cf0420e1f640cc6cf526da6ce1fc54293526759066b0ecb8", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "BorrowerOperations.sol#L31-L35, PriceFeed.sol#L31-L33, PriceFeed.sol#L120-L3", "github_files_list": "BorrowerOperations.sol, PriceFeed.sol", "github_refs_count": 3, "vulnerable_code_actual": "When the public `status` variable of PriceFeed is called, and it returns any status starting with \"using\", it should mean that the price returned by the PriceFeed was from the oracle mentioned after `using` while the other is untrusted or frozen. E.g if it returns `usingFallbackChainlinkFrozen`, it should mean the price returned was from Fallback while Chainlink is frozen. But sometimes it returns the lastGoodPrice instead of the latest price from that oracle.\n\nE.g \n\nhttps://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/PriceFeed.sol#L120C3-L123\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "03-asymmetry", "title": "KrisApostolov Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA report\n\n## Disclaimer\n\nSome of the examples may contain truncated versions of the original code. There may also be `@audit` tags, which denote the actual place affected\n\n# Table of contents\n\n### Low severity findings\n\n| | Issue | Instances |\n| --- | --- | --- |\n| [L-1] | Lack of balance check allows the unstake function to be called without a corresponding balance or amount | 1 |\n| [L-02] | Not following the CEI pattern can lead to a reentrancy | 1 |\n| [L-03] | Slight precision loss occurring in the calculations | 2 |\n\n### [L-01] - Lack of balance check allows the `unstake` function to be called without a corresponding balance or amount\n\nThe **unstake** function in the **[SafEth](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol)** contract does not implement any balance checks whatsoever, which enables anyone to call the function with a **`_safEthAmount` = 0** without any reverts. The function will execute everything like normal thus wasting gas and opening the contract to other potential vulnerabilities.\n\n### Instances\n\n**File** **[./contracts/SafEth/SafEth.sol](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol):**\n\n**[[1]](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L108-L129) - `unstake()`**\n\n### Recommendations\n\nConsider adding 2 types of checks in the **unstake** function:\n\n1. **A** **`require(_safEthAmount \u2260 0, \u201cerror message\u201d);` statement or similar.**\n2. **A `require(balanceOf(msg.sender) \u2265 _safEthAmount, \u201cerror message\u201d)`** **statement** **or similar.**\n\n### [L-02] - Not following the CEI pattern can lead to a reentrancy\n\nThe **unstake** function in the **[SafEth](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol)** contract does not follow the checks-effects-interactions pattern and goes straight to calling an external contract (a derivative) to withdraw amount the user wants before burning the user\u2019s", "vulnerable_code": "import {Initializable} from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";", "fixed_code": "", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/KrisApostolov-Q.md", "collected_at": "2026-01-02T18:18:16.157504+00:00", "source_hash": "dd5b5c638fd9bca049e1237029390203b777e27e3749fce0ad16c0b2c8d991b6", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol, SafEth.sol#L108-L129", "github_files_list": "SafEth.sol", "github_refs_count": 2, "vulnerable_code_actual": "import {Initializable} from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "10-badger", "title": "Collinsoden G", "severity_raw": "Low", "severity": "low", "description": "# Gas Optimization\n\n## Gas 01: In contract/BorrowOperations.sol\n[Link to code](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/BorrowerOperations.sol#L564C3-L569)\n> Gas can be optimized if the call `_requireSufficientEbtcTokenBalance` is made first before `getCdpCollShares` and `getCdpLiquidatorRewardShares` as those two values may not be needed until after the check. If the `_requireSufficientEbtcTokenBalance` call fails, the gas spent on making those calls will be lost. This can save about 82,864 gas if the check fails.\n```\n uint256 collShares = cdpManager.getCdpCollShares(_cdpId);\n uint256 debt = cdpManager.getCdpDebt(_cdpId);\n uint256 liquidatorRewardShares = cdpManager.getCdpLiquidatorRewardShares(_cdpId);\n\n _requireSufficientEbtcTokenBalance(msg.sender, debt)\n```\n\n> The code can be optimized thus:\n```\n function decreaseSystemDebt(uint256 _amount) external override { \n _requireCallerIsBOorCdpM();\n uint256 debt = cdpManager.getCdpDebt(_cdpId);\n \n _requireSufficientEbtcTokenBalance(msg.sender, debt)\n \n uint256 collShares = cdpManager.getCdpCollShares(_cdpId);\n uint256 liquidatorRewardShares = cdpManager.getCdpLiquidatorRewardShares(_cdpId);\n\n```\n\n## Gas 02: In contracts/ActivePool.sol\n[Link to code](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/ActivePool.sol#L207-L214)\n> In the code below, assigning systemDebt as `systemDebt -= _amount` would save gas and a variable.\n\n> So this is recommended:\n```\nfunction decreaseSystemDebt(uint256 _amount) external override {\n _requireCallerIsBOorCdpM();\n systemDebt -= _amount\n emit ActivePoolEBTCDebtUpdated(systemDebt);\n```\n\nInstead of this: \n```\n function decreaseSystemDebt(uint256 _amount) external override { \n _requireCallerIsBOorCdpM();\n\n uint256 cachedSystemDebt = systemDebt - _amount;\n\n ", "vulnerable_code": " uint256 collShares = cdpManager.getCdpCollShares(_cdpId);\n uint256 debt = cdpManager.getCdpDebt(_cdpId);\n uint256 liquidatorRewardShares = cdpManager.getCdpLiquidatorRewardShares(_cdpId);\n\n _requireSufficientEbtcTokenBalance(msg.sender, debt)", "fixed_code": " function decreaseSystemDebt(uint256 _amount) external override { \n _requireCallerIsBOorCdpM();\n uint256 debt = cdpManager.getCdpDebt(_cdpId);\n \n _requireSufficientEbtcTokenBalance(msg.sender, debt)\n \n uint256 collShares = cdpManager.getCdpCollShares(_cdpId);\n uint256 liquidatorRewardShares = cdpManager.getCdpLiquidatorRewardShares(_cdpId);\n", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/Collinsoden-G.md", "collected_at": "2026-01-02T18:26:30.408532+00:00", "source_hash": "dd6efc7a1463e8d814823a4604f5f0c0614572780fcd6ea0635925d1db745b7f", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 810, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "uint256 collShares = cdpManager.getCdpCollShares(_cdpId);\n uint256 debt = cdpManager.getCdpDebt(_cdpId);\n uint256 liquidatorRewardShares = cdpManager.getCdpLiquidatorRewardShares(_cdpId);\n\n _requireSufficientEbtcTokenBalance(msg.sender, debt)", "primary_code_language": "unknown", "primary_code_char_count": 260, "all_code_blocks": "// Code block 1 (unknown):\nuint256 collShares = cdpManager.getCdpCollShares(_cdpId);\n uint256 debt = cdpManager.getCdpDebt(_cdpId);\n uint256 liquidatorRewardShares = cdpManager.getCdpLiquidatorRewardShares(_cdpId);\n\n _requireSufficientEbtcTokenBalance(msg.sender, debt)\n\n// Code block 2 (unknown):\nfunction decreaseSystemDebt(uint256 _amount) external override { \n _requireCallerIsBOorCdpM();\n uint256 debt = cdpManager.getCdpDebt(_cdpId);\n \n _requireSufficientEbtcTokenBalance(msg.sender, debt)\n \n uint256 collShares = cdpManager.getCdpCollShares(_cdpId);\n uint256 liquidatorRewardShares = cdpManager.getCdpLiquidatorRewardShares(_cdpId);\n\n// Code block 3 (unknown):\nfunction decreaseSystemDebt(uint256 _amount) external override {\n _requireCallerIsBOorCdpM();\n systemDebt -= _amount\n emit ActivePoolEBTCDebtUpdated(systemDebt);", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "BorrowerOperations.sol#L564-L3, ActivePool.sol#L207-L214", "github_files_list": "BorrowerOperations.sol, ActivePool.sol", "github_refs_count": 2, "vulnerable_code_actual": " uint256 collShares = cdpManager.getCdpCollShares(_cdpId);\n uint256 debt = cdpManager.getCdpDebt(_cdpId);\n uint256 liquidatorRewardShares = cdpManager.getCdpLiquidatorRewardShares(_cdpId);\n\n _requireSufficientEbtcTokenBalance(msg.sender, debt)", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function decreaseSystemDebt(uint256 _amount) external override { \n _requireCallerIsBOorCdpM();\n uint256 debt = cdpManager.getCdpDebt(_cdpId);\n \n _requireSufficientEbtcTokenBalance(msg.sender, debt)\n \n uint256 collShares = cdpManager.getCdpCollShares(_cdpId);\n uint256 liquidatorRewardShares = cdpManager.getCdpLiquidatorRewardShares(_cdpId);\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "01-ondo", "title": "BRONZEDISC Q", "severity_raw": "Medium", "severity": "medium", "description": "## QA\n---\n\n### Layout Order [1]\n\n- The best-practices for layout within a contract is the following order: state variables, events, modifiers, constructor and functions.\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cToken/CTokenModified.sol\n\n```solidity\n1437: modifier nonReentrant() {\n```\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cErc20Delegate/EIP20NonStandardInterface.sol\n\n```solidity\n// events coming after functions\n74: event Transfer(address indexed from, address indexed to, uint256 amount);\n75: event Approval(\n```\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cErc20Delegate/EIP20Interface.sol\n\n```solidity\n// events coming after functions\n76: event Transfer(address indexed from, address indexed to, uint256 amount);\n77: event Approval(\n```\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cCash/CTokenCash.sol\n\n```solidity\n// modifier coming after functions\n1434: modifier nonReentrant() {\n```\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/compound/Ownable.sol\n\n```solidity\n// modifier coming after functions\n54: modifier onlyOwner() {\n```\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/compound/Comptroller.sol\n\n```solidity\n// state variables should come before events\n114: uint224 public constant compInitialIndex = 1e36;\n117: uint internal constant closeFactorMinMantissa = 0.05e18; // 0.05\n120: uint internal constant closeFactorMaxMantissa = 0.9e18; // 0.9\n123: uint internal constant collateralFactorMaxMantissa = 0.98e18; // 0.98\n778: struct AccountLiquidityLocalVars {\n```\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/compound/uniswap/UniswapAnchoredView.sol\n\n```solidity\n// state variables should come before events\n81: bytes32 constant ethHash = keccak256(abi.encodePacked(\"ETH\"));\n```\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/main/contracts/le", "vulnerable_code": "1437: modifier nonReentrant() {", "fixed_code": "// events coming after functions\n74: event Transfer(address indexed from, address indexed to, uint256 amount);\n75: event Approval(", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/BRONZEDISC-Q.md", "collected_at": "2026-01-02T18:14:30.628669+00:00", "source_hash": "dd83748879a69d7cf44fd4c09520047f95db5c7981d471e0b0798d269eeaa6c7", "code_block_count": 7, "solidity_block_count": 7, "total_code_chars": 893, "github_ref_count": 7, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "1437: modifier nonReentrant() {", "primary_code_language": "solidity", "primary_code_char_count": 32, "all_code_blocks": "// Code block 1 (solidity):\n1437: modifier nonReentrant() {\n\n// Code block 2 (solidity):\n// events coming after functions\n74: event Transfer(address indexed from, address indexed to, uint256 amount);\n75: event Approval(\n\n// Code block 3 (solidity):\n// events coming after functions\n76: event Transfer(address indexed from, address indexed to, uint256 amount);\n77: event Approval(\n\n// Code block 4 (solidity):\n// modifier coming after functions\n1434: modifier nonReentrant() {\n\n// Code block 5 (solidity):\n// modifier coming after functions\n54: modifier onlyOwner() {\n\n// Code block 6 (solidity):\n// state variables should come before events\n114: uint224 public constant compInitialIndex = 1e36;\n117: uint internal constant closeFactorMinMantissa = 0.05e18; // 0.05\n120: uint internal constant closeFactorMaxMantissa = 0.9e18; // 0.9\n123: uint internal constant collateralFactorMaxMantissa = 0.98e18; // 0.98\n778: struct AccountLiquidityLocalVars {\n\n// Code block 7 (solidity):\n// state variables should come before events\n81: bytes32 constant ethHash = keccak256(abi.encodePacked(\"ETH\"));", "all_code_blocks_count": 7, "has_diff_blocks": false, "diff_code": "", "solidity_code": "1437: modifier nonReentrant() {\n\n// events coming after functions\n74: event Transfer(address indexed from, address indexed to, uint256 amount);\n75: event Approval(\n\n// events coming after functions\n76: event Transfer(address indexed from, address indexed to, uint256 amount);\n77: event Approval(\n\n// modifier coming after functions\n1434: modifier nonReentrant() {\n\n// modifier coming after functions\n54: modifier onlyOwner() {\n\n// state variables should come before events\n114: uint224 public constant compInitialIndex = 1e36;\n117: uint internal constant closeFactorMinMantissa = 0.05e18; // 0.05\n120: uint internal constant closeFactorMaxMantissa = 0.9e18; // 0.9\n123: uint internal constant collateralFactorMaxMantissa = 0.98e18; // 0.98\n778: struct AccountLiquidityLocalVars {\n\n// state variables should come before events\n81: bytes32 constant ethHash = keccak256(abi.encodePacked(\"ETH\"));", "github_refs_formatted": "CTokenModified.sol, EIP20NonStandardInterface.sol, EIP20Interface.sol, CTokenCash.sol, Ownable.sol, Comptroller.sol, UniswapAnchoredView.sol", "github_files_list": "Ownable.sol, EIP20Interface.sol, CTokenCash.sol, CTokenModified.sol, Comptroller.sol, UniswapAnchoredView.sol, EIP20NonStandardInterface.sol", "github_refs_count": 7, "vulnerable_code_actual": "1437: modifier nonReentrant() {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "// events coming after functions\n74: event Transfer(address indexed from, address indexed to, uint256 amount);\n75: event Approval(", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 13} {"source": "c4", "protocol": "02-ethos", "title": "atharvasama G", "severity_raw": "Medium", "severity": "medium", "description": "# Gas Optimizations list\n\n| Number | Details | Instances |\n| ------ | ------------------------------------------------------------------------------------------------------------ | --------- |\n| 1 | ```x += y``` COSTS MORE GAS THAN ```x = x + y``` FOR STATE VARIABLES | 15 |\n| 2 | CAN DECLARE VARIABLE OUTSIDE LOOP TO SAVE GAS | 23 |\n| 3 | ++i/i++ CAN BE UNCHECKED | 13 |\n| 4 | MULTIPLE ADDRESS/ID MAPPINGS CAN BE COMNBINED INTO A SINGLE MAPPING TO A STRUCT | 21 |\n| 5 | USE A MORE RECENT VERSION OF SOLIDITY | 12 |\n| 6 | AVOID CONTRACT EXISTENCE CHECKS BY USING LOW LEVEL CALLS | 6 |\n| 7 | USE ```require``` INSTEAD OF ```assert``` | 20 |\n| 8 | PUBLIC FUNCTIONS NOT CALLED BY THE CONTRACT SHOULD BE DECLARED EXTERNAL INSTEAD | 4 |\n| 9 | USE ```bytes32``` INSTEAD OF ```string``` WHEREVER POSSIBLE | 11 |\n| 10 | OPTIMIZE NAMES TO SAVE GAS | 12 |\n| 11 | INTERNAL FUNCTIONS ONLY CALLED ONCE CAN BE INLINED TO SAVE GAS | 24 |\n| 12 | STATE VARIABLES CAN BE PACKED INTO FEWER STORAGE SLOTS | 2 |\n| 13 | ```require()``` OR ```revert()``` STATEMENTS THAT CHECK INPUT ARGUMENTS SHOULD BE AT T", "vulnerable_code": "168: totalAllocBPS += _allocBPS;\n194: totalAllocBPS -= strategies[_strategy].allocBPS;\n214: totalAllocBPS -= strategies[_strategy].allocBPS;\n395: strategies[stratAddr].allocated -= actualWithdrawn;\n396: totalAllocated -= actualWithdrawn;\n444: stratParams.allocBPS -= bpsChange;\n445: totalAllocBPS -= bpsChange;\n450: stratParams.losses += loss;\n451: stratParams.allocated -= loss;\n452: totalAllocated -= loss;\n505: strategy.gains += vars.gain;\n514: strategy.allocated -= vars.debtPayment;\n515: totalAllocated -= vars.debtPayment;\n520: strategy.allocated += vars.credit;\n521: totalAllocated += vars.credit;", "fixed_code": "352: address collateral = assets[i];\n353: uint amount = amounts[i];\n398: address collateral = assets[i];\n399: uint amount = amounts[i];\n832: address collateral = collaterals[i];\n833: uint currentS = epochToScaleToSum[currentEpochCached][currentScaleCached][collateral];\n860: address collateral = collaterals[i];\n861: uint price = priceFeed.fetchPrice(collateral);\n862: address lowestTrove = sortedTroves.getLast(collateral);\n863: uint256 collMCR = collateralConfig.getCollateralMCR(collateral);\n864: uint ICR = troveManager.getCurrentICR(lowestTrove, collateral, price);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/atharvasama-G.md", "collected_at": "2026-01-02T18:16:49.942199+00:00", "source_hash": "ddb2daea48671d058f8cdeb120f69130ae798558b71e460e6eb002ad22432422", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "168: totalAllocBPS += _allocBPS;\n194: totalAllocBPS -= strategies[_strategy].allocBPS;\n214: totalAllocBPS -= strategies[_strategy].allocBPS;\n395: strategies[stratAddr].allocated -= actualWithdrawn;\n396: totalAllocated -= actualWithdrawn;\n444: stratParams.allocBPS -= bpsChange;\n445: totalAllocBPS -= bpsChange;\n450: stratParams.losses += loss;\n451: stratParams.allocated -= loss;\n452: totalAllocated -= loss;\n505: strategy.gains += vars.gain;\n514: strategy.allocated -= vars.debtPayment;\n515: totalAllocated -= vars.debtPayment;\n520: strategy.allocated += vars.credit;\n521: totalAllocated += vars.credit;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "352: address collateral = assets[i];\n353: uint amount = amounts[i];\n398: address collateral = assets[i];\n399: uint amount = amounts[i];\n832: address collateral = collaterals[i];\n833: uint currentS = epochToScaleToSum[currentEpochCached][currentScaleCached][collateral];\n860: address collateral = collaterals[i];\n861: uint price = priceFeed.fetchPrice(collateral);\n862: address lowestTrove = sortedTroves.getLast(collateral);\n863: uint256 collMCR = collateralConfig.getCollateralMCR(collateral);\n864: uint ICR = troveManager.getCurrentICR(lowestTrove, collateral, price);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "11-kelp", "title": "0xhacksmithh Q", "severity_raw": "High", "severity": "high", "description": "### [Low-01] No `minimum Amount(rsETH)` receive parameter absent in `depositAsset()`\nHere we can see that User deposit asset via `depositAsset()` which take `asset address` and `asset depositAmount` as parameter\nThen `rsethAmountMinted` calculated via `_mintRsETH()`\n - where it fetch corresponding asset price from oracle\n - then use formula (amount * assetPrice)/rsETHPrice to calculate `rsethAmountMinted`\n\nProblem here is that if something go wrong with Oracle, then fetched price is mismatched with actual value\nThen User may receive less amount than he intended, may be there a huge slippage.\n\n```diff\n function depositAsset( \n address asset,\n uint256 depositAmount,\n+ uint256 minAmount\n )\n external\n whenNotPaused\n nonReentrant\n onlySupportedAsset(asset)\n {\n // checks\n if (depositAmount == 0) {\n revert InvalidAmount();\n }\n if (depositAmount > getAssetCurrentLimit(asset)) { \n revert MaximumDepositLimitReached();\n }\n\n if (!IERC20(asset).transferFrom(msg.sender, address(this), depositAmount)) { \n revert TokenTransferFailed();\n }\n\n // interactions\n- uint256 rsethAmountMinted = _mintRsETH(asset, depositAmount); \n+ uint256 rsethAmountMinted = _mintRsETH(asset, depositAmount, minAmount); \n\n emit AssetDeposit(asset, depositAmount, rsethAmountMinted);\n }\n```\n\n```\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L151-L157\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L119-L122\n```\n\n### Mitigation\nTo Overcome that `function` should also have a another parameter like `minAmountReceived` which inputed by user where User clearly says how much (slippage he can bear) `rsEth` he wanted to mint back.\n\nAnd it should be check against `rsethAmountToMint` in `_mintRsETH()` before minting\n\n```diff\n- function _mintRsETH(address _asset, uint256 _amount) private ret", "vulnerable_code": "```\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L151-L157\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L119-L122", "fixed_code": "### [Low-02] Attacker Can target a User for DOS in `depositAsset()`\nAccording to `depositAsset()` the deposited Amount should not exceed asset Limit", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/0xhacksmithh-Q.md", "collected_at": "2026-01-02T18:27:15.055075+00:00", "source_hash": "dddf3ef6cb40b431d3f49a89678dcdc11bae4434af55d84351183a7b0649d88a", "code_block_count": 2, "solidity_block_count": 1, "total_code_chars": 989, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function depositAsset( \n address asset,\n uint256 depositAmount,\n+ uint256 minAmount\n )\n external\n whenNotPaused\n nonReentrant\n onlySupportedAsset(asset)\n {\n // checks\n if (depositAmount == 0) {\n revert InvalidAmount();\n }\n if (depositAmount > getAssetCurrentLimit(asset)) { \n revert MaximumDepositLimitReached();\n }\n\n if (!IERC20(asset).transferFrom(msg.sender, address(this), depositAmount)) { \n revert TokenTransferFailed();\n }\n\n // interactions\n- uint256 rsethAmountMinted = _mintRsETH(asset, depositAmount); \n+ uint256 rsethAmountMinted = _mintRsETH(asset, depositAmount, minAmount); \n\n emit AssetDeposit(asset, depositAmount, rsethAmountMinted);\n }", "primary_code_language": "diff", "primary_code_char_count": 818, "all_code_blocks": "// Code block 1 (diff):\nfunction depositAsset( \n address asset,\n uint256 depositAmount,\n+ uint256 minAmount\n )\n external\n whenNotPaused\n nonReentrant\n onlySupportedAsset(asset)\n {\n // checks\n if (depositAmount == 0) {\n revert InvalidAmount();\n }\n if (depositAmount > getAssetCurrentLimit(asset)) { \n revert MaximumDepositLimitReached();\n }\n\n if (!IERC20(asset).transferFrom(msg.sender, address(this), depositAmount)) { \n revert TokenTransferFailed();\n }\n\n // interactions\n- uint256 rsethAmountMinted = _mintRsETH(asset, depositAmount); \n+ uint256 rsethAmountMinted = _mintRsETH(asset, depositAmount, minAmount); \n\n emit AssetDeposit(asset, depositAmount, rsethAmountMinted);\n }\n\n// Code block 2 (unknown):\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L151-L157\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L119-L122", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "function depositAsset( \n address asset,\n uint256 depositAmount,\n+ uint256 minAmount\n )\n external\n whenNotPaused\n nonReentrant\n onlySupportedAsset(asset)\n {\n // checks\n if (depositAmount == 0) {\n revert InvalidAmount();\n }\n if (depositAmount > getAssetCurrentLimit(asset)) { \n revert MaximumDepositLimitReached();\n }\n\n if (!IERC20(asset).transferFrom(msg.sender, address(this), depositAmount)) { \n revert TokenTransferFailed();\n }\n\n // interactions\n- uint256 rsethAmountMinted = _mintRsETH(asset, depositAmount); \n+ uint256 rsethAmountMinted = _mintRsETH(asset, depositAmount, minAmount); \n\n emit AssetDeposit(asset, depositAmount, rsethAmountMinted);\n }", "solidity_code": "", "github_refs_formatted": "LRTDepositPool.sol#L151-L157, LRTDepositPool.sol#L119-L122", "github_files_list": "LRTDepositPool.sol", "github_refs_count": 2, "vulnerable_code_actual": "```\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L151-L157\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L119-L122", "has_vulnerable_code_snippet": true, "fixed_code_actual": "### [Low-02] Attacker Can target a User for DOS in `depositAsset()`\nAccording to `depositAsset()` the deposited Amount should not exceed asset Limit", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "02-ethos", "title": "coryli G", "severity_raw": "Medium", "severity": "medium", "description": "# USE FUNCTIONS INSTEAD OF MODIFIERS\n## Instances\n\n- https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol#L128\n\n# FUNCTIONS GUARANTEED TO REVERT WHEN CALLED BY NORMAL USERS CAN BE MARKED PAYABLE\nWhen using a function modifier such as `onlyOwner`, the function reverts when a normal user tries to pay the function. Marking the function `payable` lowers the gas cost for legitimate callers since the compiler will not include the extra opcodes that check for whether a payment was provided. It saves about `21` gas per call plus the extra deployment cost.\n## Instances\n\n- https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol#L50\n- https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol#L89\n- https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L110\n\n# USE A MORE RECENT VERSION OF SOLIDITY\n\n-- Use a Solidity version of at least `0.8.2` to get simple compiler automatic inlining.\n-- Use a Solidity version of at least `0.8.3` to get better struct packing and cheaper multiple storage reads.\n-- Use a Solidity version of at least `0.8.4` to get custom errors, which are cheaper at deployment than revert()/require() strings. \n-- Use a Solidity version of at least `0.8.10` to have external calls skip contract existence checks if the external call has a return value.\n\n## Instances \n- https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol#L3\n- https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L3\n- https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L3\n- https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol#L3\n- https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/StabilityPool.sol#L3\n- https://github.com/code-423n4/2023-02-ethos/blob/ma", "vulnerable_code": "for (uint256 i; i < _collateralsLength;) { \n // ... \n unchecked { ++i; }\n}", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/coryli-G.md", "collected_at": "2026-01-02T18:16:58.892667+00:00", "source_hash": "ddee0b610d869994aa6007023a9cf0d197a8c871204465e61cdcf590dee5c85c", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 9, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CollateralConfig.sol#L128, CollateralConfig.sol#L50, CollateralConfig.sol#L89, BorrowerOperations.sol#L110, CollateralConfig.sol#L3, BorrowerOperations.sol#L3, TroveManager.sol#L3, ActivePool.sol#L3, StabilityPool.sol#L3", "github_files_list": "StabilityPool.sol, TroveManager.sol, BorrowerOperations.sol, ActivePool.sol, CollateralConfig.sol", "github_refs_count": 9, "vulnerable_code_actual": "for (uint256 i; i < _collateralsLength;) { \n // ... \n unchecked { ++i; }\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "02-ai-arena", "title": "Bauchibred Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA Report\n\n## Table of Contents\n\n| Issue ID | Description |\n| --------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |\n| [QA-01](#qa-01-a-user-cant-burn-their-tokens-as-they-see-fit) | A user can't burn their tokens as they see fit |\n| [QA-02](#qa-02-an-in-game-user-should-in-all-instances-have-access-to-the-amount-of-their-current-points) | An in-game user should in all instances have access to the amount of their current points |\n| [QA-03](#qa-03-insecure-spender-approval-mechanism) | Insecure spender approval mechanism |\n| [QA-04](#qa-04-introduce-protection-against-json-attacks-on-users) | Introduce protection against JSON attacks on users |\n| [QA-05](#qa-05-somewhat-flawed-ownership-transfer-in-voltagemanager-sol) | Somewhat flawed ownership transfer in VoltageManager.sol |\n| [QA-06](#qa-06-somewhat-flawed-ownership-transfer-in-voltagemanager-sol) | `Mergingpool.sol` currently does not use the VRF which limits the randomization |\n\n## QA-01 A user can't burn their tokens as they see fit\n\n### Proof of Concept\n\nTake a look at https://github.com/code-423n4/2024-02-ai-arena/blob/befe84a9ddccba0cd0251082046e57ecabffb0cf/src/GameItems.sol#L243-L246\n\n```solidity\n function burn(address account, uint256 tokenId, uint256 amount) public {\n require(allowedBurningAddresses[msg", "vulnerable_code": " function burn(address account, uint256 tokenId, uint256 amount) public {\n require(allowedBurningAddresses[msg.sender]);\n _burn(account, tokenId, amount);\n }", "fixed_code": " function testBurnFromEligibleOwnerDoesNotWork() public {\n _fundUserWith4kNeuronByTreasury(_ownerAddress);\n _gameItemsContract.mint(0, 1);\n assertEq(_gameItemsContract.balanceOf(_ownerAddress, 0), 1);\n vm.expectRevert();\n _gameItemsContract.burn(_ownerAddress, 0, 1);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/Bauchibred-Q.md", "collected_at": "2026-01-02T19:02:15.670593+00:00", "source_hash": "de1b6dd245bceb2e5fdbc47d14f5b54151218a778aa8859105f94d8db3d900b6", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "GameItems.sol#L243-L246", "github_files_list": "GameItems.sol", "github_refs_count": 1, "vulnerable_code_actual": " function burn(address account, uint256 tokenId, uint256 amount) public {\n require(allowedBurningAddresses[msg.sender]);\n _burn(account, tokenId, amount);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function testBurnFromEligibleOwnerDoesNotWork() public {\n _fundUserWith4kNeuronByTreasury(_ownerAddress);\n _gameItemsContract.mint(0, 1);\n assertEq(_gameItemsContract.balanceOf(_ownerAddress, 0), 1);\n vm.expectRevert();\n _gameItemsContract.burn(_ownerAddress, 0, 1);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "06-lybra", "title": "RedTiger Q", "severity_raw": "Critical", "severity": "critical", "description": "# Low Risk and Non-Critical Issues\n## L01 - No part of the bounty is returned to the mining pool\nAccording to Lybra [blog post](https://medium.com/@Lybra_Finance/lybra-finance-v1-v2-and-the-future-e458d541cc0b) a percentage of the rewards bounty sold at a discount should be returned to the mining pool\n\" If the qualifier drops below the minimum 5% threshold, the user will become ineligible for subsequent esLBR emissions. Simultaneously, a bounty equal to the amount of emissions that the user has earned while ineligible will be placed. This bounty can be purchased by any user at a 50% discount in LBR.\n\n3. The LBR received will then be distributed as follows: 10% will be burned, and the remaining 90% will be returned to the mining pool.\"\n\nHowever, we can see in the code that 100% of the bounty is burned.\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/EUSDMiningIncentives.sol#L218\n ```solidity\n IesLBR(LBR).burn(msg.sender, biddingFee);\n```\n\n## L02- Error in the comments of reStake() in ProtocolRewardsPool.sol\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/ProtocolRewardsPool.sol#L139C22-L140C8\n * @dev Convert unredeemed and converting ESLBR tokens back to LBR.\nShould be \n * @dev Convert unredeemed and converting LBR tokens back to ESLBR\n\n## L03 Wrong address in the comments for WBETH\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/pools/LybraWbETHVault.sol#L16\nThe address of the WBETH contract listed in the comments for WBETH is 0xae78736Cd615f374D3085123A210448E74Fc6393. \nBut this address is the goerli RETH address. This comment should be change to the WBETH goerli address. Or mainet WBETH address.\n \n\n## L04 Allowance check could be improved\nlybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L131\nThe allowance check in the liq", "vulnerable_code": " IesLBR(LBR).burn(msg.sender, biddingFee);", "fixed_code": "uint256 maxSupply = 100_000_000 * 1e18;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/RedTiger-Q.md", "collected_at": "2026-01-02T18:22:38.181464+00:00", "source_hash": "de7535280129c253637107697296bbfb2ea68426624c16b8ce44bc173744ed31", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 41, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "IesLBR(LBR).burn(msg.sender, biddingFee);", "primary_code_language": "solidity", "primary_code_char_count": 41, "all_code_blocks": "// Code block 1 (solidity):\nIesLBR(LBR).burn(msg.sender, biddingFee);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "IesLBR(LBR).burn(msg.sender, biddingFee);", "github_refs_formatted": "EUSDMiningIncentives.sol#L218, ProtocolRewardsPool.sol#L139-L22, LybraWbETHVault.sol#L16", "github_files_list": "EUSDMiningIncentives.sol, ProtocolRewardsPool.sol, LybraWbETHVault.sol", "github_refs_count": 3, "vulnerable_code_actual": " IesLBR(LBR).burn(msg.sender, biddingFee);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "uint256 maxSupply = 100_000_000 * 1e18;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "04-caviar", "title": "ReyAdmirado G", "severity_raw": "High", "severity": "high", "description": "\n| | issue |\n| ----------- | ----------- |\n| 1 | [Structs can be packed into fewer storage slots](#1-structs-can-be-packed-into-fewer-storage-slots) |\n| 2 | [state variables should be cached in stack variables rather than re-reading them from storage](#2-state-variables-should-be-cached-in-stack-variables-rather-than-re-reading-them-from-storage) |\n| 3 | [Add `unchecked {}` for subtractions where the operands cannot underflow because of a previous `require()` or `if` statement](#3-add-unchecked--for-subtractions-where-the-operands-cannot-underflow-because-of-a-previous-require-or-if-statement) |\n| 4 | [` += ` costs more gas than ` = + ` for state variables](#4-x--y-costs-more-gas-than-x--x--y-for-state-variables) |\n| 5 | [can make the variable outside the loop to save gas](#5-can-make-the-variable-outside-the-loop-to-save-gas) |\n| 6 | [usage of uint/int smaller than 32 bytes (256 bits) incurs overhead](#6-usage-of-uintint-smaller-than-32-bytes-256-bits-incurs-overhead) |\n| 7 | [ Ternary over if ... else](#7-ternary-over-if--else) |\n| 8 | [public functions not called by the contract should be declared external instead](#8-public-functions-not-called-by-the-contract-should-be-declared-external-instead) |\n| 9 | [Use assembly to check for address(0)](#9-use-assembly-to-check-for-address0) |\n| 10 | [Functions guaranteed to revert when called by normal users can be marked `payable`](#10-functions-guaranteed-to-revert-when-called-by-normal-users-can-be-marked-payable) |\n| 11 | [Optimize names to save gas](#11-optimize-names-to-save-gas) |\n| 12 | [Setting the constructor to payable](#12-setting-the-constructor-to-payable) |\n| 13 | [part of the code can be pre calculated](#13-part-of-the-code-can-be-pre-calculated) |\n| 14 | [Use selfbalance() instead of address(this).balance](#14-use-selfbalance-instead-of-addressthisbalance) |\n| 15 | [Duplicated require()/revert() checks should be refactored to a modifier or function](#15-duplicated-requirerevert-checks-shou", "vulnerable_code": " if (block.timestamp > deadline && deadline != 0) {\n revert DeadlinePassed();\n }", "fixed_code": " baseToken != address(0)", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/ReyAdmirado-G.md", "collected_at": "2026-01-02T18:20:01.501843+00:00", "source_hash": "de8eb3d08cfb03be9b4e00cf13a3f277409e5b6ee81d756454aa5a4e8cd6e061", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " if (block.timestamp > deadline && deadline != 0) {\n revert DeadlinePassed();\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " baseToken != address(0)", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "09-ondo", "title": "naman1778 Q", "severity_raw": "Low", "severity": "low", "description": "## [N-01] Lack of address(0) checks in the constructor\n\nZero-address check should be used in the constructors, to avoid the risk of setting smth as address(0) at deploying time.\n\nThere are 4 instances of this issue in 4 files:\n\n File: contracts/bridge/SourceBridge.sol\t\n\n 40: constructor(\n 41: address _token,\n 42: address _axelarGateway,\n 43: address _gasService,\n 44: address owner\n 45: ) {\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/SourceBridge.sol\n\n File: contracts/bridge/DestinationBridge.sol\t\n\n 55: constructor(\n 56: address _token,\n 57: address _axelarGateway,\n 58: address _allowlist,\n 59: address _ondoApprover,\n 60: address _owner,\n 61: uint256 _mintLimit,\n 62: uint256 _mintDuration\n 63: )\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/DestinationBridge.sol\n\n File: contracts/usdy/rUSDYFactory.sol\t\n\n 51: constructor(address _guardian) {\n 52: guardian = _guardian;\n 53: }\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDYFactory.sol\n\n File: contracts/rwaOracles/RWADynamicOracle.sol\t\n\n 30: constructor(\n 31: address admin,\n 32: address setter,\n 33: address pauser,\n 34: uint256 firstRangeStart,\n 35: uint256 firstRangeEnd,\n 36: uint256 dailyIR,\n 37: uint256 startPrice\n 38: ) {\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/rwaOracles/RWADynamicOracle.sol\n\n## [N-02] According to the syntax rules, use `=> mapping (` instead of `=> mapping(` using spaces as keyword\n\nThere are 2 instances of this issue in 2 files:\n\n File: contracts/bridge/DestinationBridge.sol\t\n\n 45: mapping(bytes32 => mapping(uint256 => bool)) public isSpentNonce;\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/DestinationBridge.sol\n\n File: contracts/usdy/rUSDY.sol\t\n\n 79: mapping(address => mapping(address => uint256)) private allowances;\n\nhttps://git", "vulnerable_code": "626: function _beforeTokenTransfer(\n627: address from,\n628: address to,\n629: uint256\n630: ) internal view {", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/naman1778-Q.md", "collected_at": "2026-01-02T18:26:09.042830+00:00", "source_hash": "de9b843a6fbff3393b09524af6f55abc47ec4754af59a94590f9e96cdc4ff71f", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SourceBridge.sol, DestinationBridge.sol, rUSDYFactory.sol, RWADynamicOracle.sol", "github_files_list": "DestinationBridge.sol, rUSDYFactory.sol, RWADynamicOracle.sol, SourceBridge.sol", "github_refs_count": 4, "vulnerable_code_actual": "626: function _beforeTokenTransfer(\n627: address from,\n628: address to,\n629: uint256\n630: ) internal view {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "10-badger", "title": "Raihan Q", "severity_raw": "High", "severity": "high", "description": "# GAS OPTIMIZATION\n\n# SUMMARY\n| | issue | instance |\n|------|---------|------------|\n|[G\u201101]|Using storage instead of memory for structs/arrays saves gas|36|\n|[G\u201102]|Can Make The Variable Outside The Loop To Save Gas|4|\n|[G\u201103]|internal functions only called once can be inlined to save gas|18|\n|[G\u201104]|Optimize External Calls with Assembly for Memory Efficiency|112|\n|[G\u201105]|Use of\u00a0emit\u00a0inside a loop|1|\n|[G\u201106]|Do-While loops are cheaper than for loops|3|\n|[G\u201107]|Cache external calls outside of loop to avoid re-calling function on each iteration|1|\n|[G\u201108]|Use assembly to write address storage values|6|\n|[G\u201109]|Use nested if statements instead of &&|13|\n|[G\u201110]|Splitting\u00a0\u00a0Require() Statements That Use\u00a0\u00a0&& Saves Gas|8|\n|[G\u201111]|Sort Solidity operations using short-circuit mode|2|\n|[G\u201112]|Expressions for constant values such as a call to\u00ac\u2020keccak256(), should use immutable rather than constant|4|\n|[G\u201113]|Use assembly to perform efficient back-to-back calls|11|\n|[G\u201114]|Avoid contract existence checks by using low level calls|18|\n|[G\u201115]|>=\u00a0costs less gas than\u00a0>|13|\n|[G\u201116]|Amounts should be checked for 0 before calling a transfer|6|\n|[G\u201117]|Avoid updating storage when the value hasn't changed|10|\n|[G\u201118]|abi.encode()\u00a0is less efficient than\u00a0abi.encodePacked()|2|\n|[G\u201119]|Do not calculate constants|1|\n|[G\u201120]|Usage of uints/ints smaller than 32 bytes (256 bits) incurs overhead|1|\n|[G\u201121]|Use hardcode address instead address(this)|15|\n|[G\u201122]|Structs can be packed to use fewer storage slots|3|\n|[G\u201123]|Use constants instead of type(uintx).max|17|\n|[G\u201124]|Duplicated require()/if() checks should be refactored to a modifier or function|1|\n|[G\u201125]|Not using the named return variables when a function returns, wastes deployment gas|6|\n|[G\u201126]|Unnecessary computation|3|\n|[G\u201127]|Multiple Address/id Mappings Can Be Combined Into A Single Mapping Of An Address/id To A Struct, Where Appropriate|2|\n|[G\u201128]|bytes\u00a0constants are more eficient than\u00a0string\u00a0constans|11|\n|[G\u201129]|Use asse", "vulnerable_code": "File: packages/contracts/contracts/BorrowerOperations.sol\n427 MoveTokensParams memory _varMvTokens = MoveTokensParams(\n\n760 function _processTokenMovesFromAdjustment(MoveTokensParams memory _varMvTokens) internal {\n\n856 AdjustCdpLocals memory _vars\n\n987 AdjustCdpLocals memory vars,", "fixed_code": "File: packages/contracts/contracts/CdpManager.sol\n136 SingleRedemptionInputs memory _redeemColFromCdp\n\n150 CdpDebtAndCollShares memory _oldDebtAndColl = CdpDebtAndCollShares(\n\n329 RedemptionTotals memory totals;\n\n403 SingleRedemptionValues memory singleRedemption = _redeemCollateralFromCdp(", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/Raihan-Q.md", "collected_at": "2026-01-02T18:26:35.191899+00:00", "source_hash": "def6178df87d04039cbf50159d224a4923065a73bd11684612a018170357eca8", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: packages/contracts/contracts/BorrowerOperations.sol\n427 MoveTokensParams memory _varMvTokens = MoveTokensParams(\n\n760 function _processTokenMovesFromAdjustment(MoveTokensParams memory _varMvTokens) internal {\n\n856 AdjustCdpLocals memory _vars\n\n987 AdjustCdpLocals memory vars,", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: packages/contracts/contracts/CdpManager.sol\n136 SingleRedemptionInputs memory _redeemColFromCdp\n\n150 CdpDebtAndCollShares memory _oldDebtAndColl = CdpDebtAndCollShares(\n\n329 RedemptionTotals memory totals;\n\n403 SingleRedemptionValues memory singleRedemption = _redeemCollateralFromCdp(", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "02-ethos", "title": "Diana G", "severity_raw": "Medium", "severity": "medium", "description": "\n----------\n\n| S No. | Issue | Instances | Gas Savings (from provided tests) |\n|-----|-----|-----|-----|\n| [G-01] | x += y costs more gas than x = x + y for state variables (same applies for x -= y) | 22 | 2486 \n| [G-02] | Internal functions only called once can be inlined to save gas | 46 | 1840\n| [G-03] | Using both named returns and a return statement isn't necessary | 18 | 54\n| [G-04] | Increments can be unchecked | 15 | 600\n| [G-05] | Require() or revert() strings longer than 32 bytes cost extra gas | 49 | 147\n| [G-06] | Expressions for constant values such as a call to keccak256(), should use immutable rather than constant | 8 | - \n| [G-07] | Splitting require() statements that use && saves gas | 4 | 12\n| [G-08] | Use scientific notation rather than exponentiation | 1 | -\n| [G-09] | Use a more recent version of solidity | 12 | -\n\n-------------\n\n## G-01 x += y costs more gas than x = x + y for state variables (same applies for x -= y)\n\nUsing the addition operator instead of plus-equals saves\u00a0**[113 gas](https://gist.github.com/IllIllI000/cbbfb267425b898e5be734d4008d4fe8)**.\n\n_There are 22 instances of this issue_\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol\n\n```\nFile: Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol\n\n133: toFree += profit;\n141: roi -= int256(loss);\n```\n\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol\n\n```\nFile: Ethos-Vault/contracts/ReaperVaultV2.sol\n\n168: totalAllocBPS += _allocBPS;\n194: totalAllocBPS -= strategies[_strategy].allocBPS;\n196: totalAllocBPS += _allocBPS;\n214: totalAllocBPS -= strategies[_strategy].allocBPS;\n390: value -= loss;\n391: totalLoss += loss;\n395: strategies[stratAddr].allocated -= actualWithdrawn;\n396: totalAllocated -= actualWithdrawn;\n444: stratParams.allocBPS -= bpsChange;\n445: totalAllocBPS -= bpsChange;\n450: stratParams.losses += loss;\n451: stratParams.allocated -= loss;\n452: totalAllocated -= l", "vulnerable_code": "File: Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol\n\n133: toFree += profit;\n141: roi -= int256(loss);", "fixed_code": "File: Ethos-Vault/contracts/ReaperVaultV2.sol\n\n168: totalAllocBPS += _allocBPS;\n194: totalAllocBPS -= strategies[_strategy].allocBPS;\n196: totalAllocBPS += _allocBPS;\n214: totalAllocBPS -= strategies[_strategy].allocBPS;\n390: value -= loss;\n391: totalLoss += loss;\n395: strategies[stratAddr].allocated -= actualWithdrawn;\n396: totalAllocated -= actualWithdrawn;\n444: stratParams.allocBPS -= bpsChange;\n445: totalAllocBPS -= bpsChange;\n450: stratParams.losses += loss;\n451: stratParams.allocated -= loss;\n452: totalAllocated -= loss;\n505: strategy.gains += vars.gain;\n514: strategy.allocated -= vars.debtPayment;\n515: totalAllocated -= vars.debtPayment;\n516: vars.debt -= vars.debtPayment;\n520: strategy.allocated += vars.credit;\n521: totalAllocated += vars.credit;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/Diana-G.md", "collected_at": "2026-01-02T18:16:09.379416+00:00", "source_hash": "df5e7913c49641d4e4de61728a3c781de804279b778efd897870855a48baeda7", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 113, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol\n\n133: toFree += profit;\n141: roi -= int256(loss);", "primary_code_language": "unknown", "primary_code_char_count": 113, "all_code_blocks": "// Code block 1 (unknown):\nFile: Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol\n\n133: toFree += profit;\n141: roi -= int256(loss);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ReaperStrategyGranarySupplyOnly.sol, ReaperVaultV2.sol", "github_files_list": "ReaperStrategyGranarySupplyOnly.sol, ReaperVaultV2.sol", "github_refs_count": 2, "vulnerable_code_actual": "File: Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol\n\n133: toFree += profit;\n141: roi -= int256(loss);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: Ethos-Vault/contracts/ReaperVaultV2.sol\n\n168: totalAllocBPS += _allocBPS;\n194: totalAllocBPS -= strategies[_strategy].allocBPS;\n196: totalAllocBPS += _allocBPS;\n214: totalAllocBPS -= strategies[_strategy].allocBPS;\n390: value -= loss;\n391: totalLoss += loss;\n395: strategies[stratAddr].allocated -= actualWithdrawn;\n396: totalAllocated -= actualWithdrawn;\n444: stratParams.allocBPS -= bpsChange;\n445: totalAllocBPS -= bpsChange;\n450: stratParams.losses += loss;\n451: stratParams.allocated -= loss;\n452: totalAllocated -= loss;\n505: strategy.gains += vars.gain;\n514: strategy.allocated -= vars.debtPayment;\n515: totalAllocated -= vars.debtPayment;\n516: vars.debt -= vars.debtPayment;\n520: strategy.allocated += vars.credit;\n521: totalAllocated += vars.credit;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "06-lybra", "title": "0xhacksmithh G", "severity_raw": "High", "severity": "high", "description": "### [Gas-01] Multiply by 2 Should be performed using `bit shifting`\n```solidity\nrequire(assetAmount * 2 <= depositedAsset[onBehalfOf],\n```\n*Instances(2)*\n```\nFile: LybraEUSDVaultBase.sol\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/base/LybraEUSDVaultBase.sol#L159\n```\n```\nFile: LybraPeUSDVaultBase.sol\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L130\n```\n\n### [Gas-02] `_checkHealth()` could placed some step above, so that on function call fail on that step, will seve some gas of caller.\n\n```solidity\n function _mintPeUSD(address _provider, address _onBehalfOf, uint256 _mintAmount, uint256 _assetPrice) internal virtual {\n require(poolTotalPeUSDCirculation + _mintAmount <= configurator.mintVaultMaxSupply(address(this)), \"ESL\"); \n _updateFee(_provider);\n\n try configurator.refreshMintReward(_provider) {} catch {}\n\n borrowed[_provider] += _mintAmount;\n+ _checkHealth(_provider, _assetPrice);\n PeUSD.mint(_onBehalfOf, _mintAmount);\n poolTotalPeUSDCirculation += _mintAmount;\n- _checkHealth(_provider, _assetPrice); \n emit Mint(_provider, _onBehalfOf, _mintAmount, block.timestamp);\n }\n```\n*Instances(1)*\n```\nFile: LybraPeUSDVaultBase.sol\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L183\n```\n\n### [Gas-03] External Contract Calls Could Be Preformed With Low Level Calls, To Exclude Contract Exitance Check And Save Gas.\n\n```solidity\nrkPool.deposit{value: msg.value}(); \n```\n*Instances(4)*\n```\nFile: LybraRETHVault.sol\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/LybraRETHVault.sol#L30\n```\n```\nFile: LybraStETHVault.sol\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/LybraStETHVault.sol#L40\n```\n```\nFile: LybraWbETHVault.sol\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/LybraWbETHVault", "vulnerable_code": "require(assetAmount * 2 <= depositedAsset[onBehalfOf],", "fixed_code": "File: LybraEUSDVaultBase.sol\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/base/LybraEUSDVaultBase.sol#L159", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/0xhacksmithh-G.md", "collected_at": "2026-01-02T18:22:04.067375+00:00", "source_hash": "df6719f426e8fbc28301290d96b189feeee0b2cb69bca9b8e67722f8142d7e8f", "code_block_count": 8, "solidity_block_count": 3, "total_code_chars": 1400, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "require(assetAmount * 2 <= depositedAsset[onBehalfOf],", "primary_code_language": "solidity", "primary_code_char_count": 54, "all_code_blocks": "// Code block 1 (solidity):\nrequire(assetAmount * 2 <= depositedAsset[onBehalfOf],\n\n// Code block 2 (unknown):\nFile: LybraEUSDVaultBase.sol\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/base/LybraEUSDVaultBase.sol#L159\n\n// Code block 3 (unknown):\nFile: LybraPeUSDVaultBase.sol\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L130\n\n// Code block 4 (solidity):\nfunction _mintPeUSD(address _provider, address _onBehalfOf, uint256 _mintAmount, uint256 _assetPrice) internal virtual {\n require(poolTotalPeUSDCirculation + _mintAmount <= configurator.mintVaultMaxSupply(address(this)), \"ESL\"); \n _updateFee(_provider);\n\n try configurator.refreshMintReward(_provider) {} catch {}\n\n borrowed[_provider] += _mintAmount;\n+ _checkHealth(_provider, _assetPrice);\n PeUSD.mint(_onBehalfOf, _mintAmount);\n poolTotalPeUSDCirculation += _mintAmount;\n- _checkHealth(_provider, _assetPrice); \n emit Mint(_provider, _onBehalfOf, _mintAmount, block.timestamp);\n }\n\n// Code block 5 (unknown):\nFile: LybraPeUSDVaultBase.sol\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L183\n\n// Code block 6 (solidity):\nrkPool.deposit{value: msg.value}();\n\n// Code block 7 (unknown):\nFile: LybraRETHVault.sol\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/LybraRETHVault.sol#L30\n\n// Code block 8 (unknown):\nFile: LybraStETHVault.sol\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/LybraStETHVault.sol#L40", "all_code_blocks_count": 8, "has_diff_blocks": false, "diff_code": "", "solidity_code": "require(assetAmount * 2 <= depositedAsset[onBehalfOf],\n\nfunction _mintPeUSD(address _provider, address _onBehalfOf, uint256 _mintAmount, uint256 _assetPrice) internal virtual {\n require(poolTotalPeUSDCirculation + _mintAmount <= configurator.mintVaultMaxSupply(address(this)), \"ESL\"); \n _updateFee(_provider);\n\n try configurator.refreshMintReward(_provider) {} catch {}\n\n borrowed[_provider] += _mintAmount;\n+ _checkHealth(_provider, _assetPrice);\n PeUSD.mint(_onBehalfOf, _mintAmount);\n poolTotalPeUSDCirculation += _mintAmount;\n- _checkHealth(_provider, _assetPrice); \n emit Mint(_provider, _onBehalfOf, _mintAmount, block.timestamp);\n }\n\nrkPool.deposit{value: msg.value}();", "github_refs_formatted": "LybraEUSDVaultBase.sol#L159, LybraPeUSDVaultBase.sol#L130, LybraPeUSDVaultBase.sol#L183, LybraRETHVault.sol#L30, LybraStETHVault.sol#L40", "github_files_list": "LybraEUSDVaultBase.sol, LybraStETHVault.sol, LybraPeUSDVaultBase.sol, LybraRETHVault.sol", "github_refs_count": 5, "vulnerable_code_actual": "require(assetAmount * 2 <= depositedAsset[onBehalfOf],", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: LybraEUSDVaultBase.sol\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/base/LybraEUSDVaultBase.sol#L159", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 14} {"source": "c4", "protocol": "07-amphora", "title": "Rolezn Q", "severity_raw": "Critical", "severity": "critical", "description": "## QA Summary\n\n### Low Risk Issues\n| |Issue|Contexts|\n|-|:-|:-:|\n| [LOW‑1](#low1-ierc20-approve-is-deprecated) | IERC20 `approve()` Is Deprecated | 3 |\n| [LOW‑2](#low2-condition-will-not-revert-when-blocktimestamp-is--to-the-compared-variable) | Condition will not revert when `block.timestamp` is `==` to the compared variable | 2 |\n| [LOW‑3](#low3-consider-the-case-where-totalsupply-is-0) | Consider the case where `totalsupply` is 0 | 6 |\n| [LOW‑4](#low4-constant-decimal-values) | Constant decimal values | 13 |\n| [LOW‑5](#low5-function-can-risk-gas-exhaustion-on-large-receipt-calls-due-to-multiple-mandatory-loops) | Function can risk gas exhaustion on large receipt calls due to multiple mandatory loops | 1 |\n| [LOW‑6](#low6-minting-tokens-to-the-zero-address-should-be-avoided) | Minting tokens to the zero address should be avoided | 5 |\n| [LOW‑7](#low7-the-contract-should-approve0-first) | The Contract Should `approve(0)` First | 1 |\n| [LOW‑8](#low8-contracts-are-not-using-their-oz-upgradeable-counterparts) | Contracts are not using their OZ Upgradeable counterparts | 37 |\n| [LOW‑9](#low9-no-storage-gap-for-upgradeable-contracts) | No Storage Gap For Upgradeable Contracts | 1 |\n| [LOW‑10](#low10-use-safecast-to-safely-downcast-variables) | Use SafeCast to safely downcast variables | 5 |\n\nTotal: 74 contexts over 10 issues\n\n### Non-critical Issues\n| |Issue|Contexts|\n|-|:-|:-:|\n| [NC‑1](#nc1-consider-adding-a-denylist) | Consider adding a deny-list | 3 |\n| [NC‑2](#nc2-consistent-usage-of-require-vs-custom-error) | Consistent usage of require vs custom error | 4 |\n| [NC‑3](#nc3-constant-redefined-elsewhere) | Constant redefined elsewhere | 1 |\n| [NC‑4](#nc4-blocktimestamp-is-already-used-when-emitting-events-no-need-to-input-timestamp) | `block.timestamp` is already used when emitting events, no need to input timestamp | 1 |\n| [NC‑5](#nc5-mint-ev", "vulnerable_code": "File: Vault.sol\n\n212: CRV.approve(address(_amphClaimer), _takenCRV);", "fixed_code": "File: Vault.sol\n\n213: CVX.approve(address(_amphClaimer), _takenCVX);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/Rolezn-Q.md", "collected_at": "2026-01-02T18:23:32.729130+00:00", "source_hash": "e101d42f32d88babef09f4079686c56377c84989c20052d126be2c6cc5177b50", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: Vault.sol\n\n212: CRV.approve(address(_amphClaimer), _takenCRV);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: Vault.sol\n\n213: CVX.approve(address(_amphClaimer), _takenCVX);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-ondo", "title": "chrisdior4 G", "severity_raw": "Medium", "severity": "medium", "description": "## Gas Optimization\n\n| G-O |Issue| \n|:------:|:----|\n| [G‑01] | Remove public visibility from constant variables | 2 |\n| [G‑02] | Cache Array Length Outside of Loop | 6 |\n| [G‑03] | x = x - y costs less gas than x -= y, same for addition | 11 |\n| [G‑04] | USE REQUIRE INSTEAD OF ASSERT| 19 |\n| [G‑05] | Consider using custom errors instead of require statements with string error | 31 |\n| [G‑06] | REQUIRE()/REVERT() STRINGS LONGER THAN 32 BYTES COST EXTRA GAS | 2 |\n| [G‑07] | THERE\u2019S NO NEED TO SET DEFAULT VALUES FOR VARIABLES | 1 |\n| [G‑08] | USE CALLDATA INSTEAD OF MEMORY | 1 |\n\nTotal: 8 issues\n\n### [G-01] Remove public visibility from constant variables\n\nConstant variables are custom to the contract and won't need to be read on-chain - anyone can just see their values from the source code and, if needed, hardcode them into other contracts. Removing the public visibility will optimise deployment cost since no automatically generated getters will exist in the bytecode of the contract.\n\nFiles: `CashFactory.sol`\n\n```solidity\nbytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\nbytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\nbytes32 public constant DEFAULT_ADMIN_ROLE = bytes32(0);\n```\n\nLines of code:\n\n- https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/cash/factory/CashFactory.sol#L44\n- https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/cash/factory/CashFactory.sol#L45\n- https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/cash/factory/CashFactory.sol#L46\n\n### [G-02] Cache Array Length Outside of Loop\n\nCaching the array length outside a loop saves reading it on each iteration, as long as the array's length is not changed during the loop.\n\nFile: `CashFactory.sol`\n\n```solidity\nfor (uint256 i = 0; i < exCallData.length; ++i) {\n```\n\nLines of code:\n\n", "vulnerable_code": "bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\nbytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\nbytes32 public constant DEFAULT_ADMIN_ROLE = bytes32(0);", "fixed_code": "for (uint256 i = 0; i < exCallData.length; ++i) {", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/chrisdior4-G.md", "collected_at": "2026-01-02T18:15:00.547860+00:00", "source_hash": "e11b7f1eebe6ba515c095e0795cf68cd256b41afaaa9f1b788251027a5ad3465", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 233, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\nbytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\nbytes32 public constant DEFAULT_ADMIN_ROLE = bytes32(0);", "primary_code_language": "solidity", "primary_code_char_count": 184, "all_code_blocks": "// Code block 1 (solidity):\nbytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\nbytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\nbytes32 public constant DEFAULT_ADMIN_ROLE = bytes32(0);\n\n// Code block 2 (solidity):\nfor (uint256 i = 0; i < exCallData.length; ++i) {", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\nbytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\nbytes32 public constant DEFAULT_ADMIN_ROLE = bytes32(0);\n\nfor (uint256 i = 0; i < exCallData.length; ++i) {", "github_refs_formatted": "CashFactory.sol#L44, CashFactory.sol#L45, CashFactory.sol#L46", "github_files_list": "CashFactory.sol", "github_refs_count": 3, "vulnerable_code_actual": "bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\nbytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\nbytes32 public constant DEFAULT_ADMIN_ROLE = bytes32(0);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "for (uint256 i = 0; i < exCallData.length; ++i) {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "05-ajna", "title": "SAQ G", "severity_raw": "High", "severity": "high", "description": "## Summary\n\n### Gas Optimization\n\nno | Issue |Instances||\n|-|:-|:-:|:-:|\n| [G-01] | Multiple address/ID mappings can be combined into a single mapping of an address/ID to a struct, where appropriate| 2 | - |\n| [G-02] | Using storage instead of memory for structs/arrays saves gas | 6 | - |\n| [G-03] | internal functions only called once can be inlined to save gas | 18 | - |\n| [G-04] | Use more recent version of solidity | 2 | - |\n| [G-05] | += \u00a0Costs more GAS than\u00a0 = + \u00a0for State variables or ( -= ) | 2 | - |\n| [G-06] | Public fuction to External | 2 | - |\n| [G-07] | Using fixed bytes is cheaper than using String | 8 | - |\n| [G-08] | State variables should be cached in stack variables rather than re-reading them from storage | 8 | - |\n| [G-09] | Can make the variable outside the loop to save gas | 7 | - |\n| [G-10] | Using calldata instead of memory for read-only argument in external function saves gas | 29 | - |\n| [G-11] | Use assembly to check for address(0) | 1 | - |\n| [G-12] | Before some functions, we should check some variables for possible gas save | 1 | - |\n| [G-13] | Use bitmaps to save gas | 1 | - |\n| [G-14] | Store using Struct over multiple mappings | 1 | - |\n| [G-15] | Duplicated require()/if() checks should be refactored to a modifier or function | 3 | - |\n| [G-16] | Using ERC721A instead of ERC720 for more gas-efficient | 1 | - |\n| [G-17] | Use nested if and, avoid multiple check combinations | 6 | - |\n| [G-18] | Use constants instead of type(uintx).max | 1 | - |\n| [G-19] | Use assembly to write address storage values | 34 | - |\n| [G-20] | abi.encode() is less efficient than abi.encodepacked() | 7 | - |\n| [G-21] | Do not calculate constant | 5 | - |\n| [G-22] | Structs can be packed into fewer storage slots by editing time variables | 1 | - |\n| [G-23] | Using delete statement can save gas | 3 | - |\n| [G-24] | >= costs less gas than > | 8 | - |\n| [G-25] | Minimize external calls in every contruct file | All file | - |\n| [G-26] | Sort S", "vulnerable_code": "file: /ajna-grants/src/grants/base/StandardFunding.sol\n\n82 mapping(uint256 => uint256[]) internal _topTenProposals;\n83\n84 /**\n85 * @notice Mapping of a hash of a proposal slate to a list of funded proposals.\n86 * @dev slate hash => proposalId[]\n87 */\n88 mapping(bytes32 => uint256[]) internal _fundedPropo/ajna-grants/src/grants/interfaces/IStandardFunding.salSlates;\n", "fixed_code": "file: /ajna-core/src/PositionManager.sol\n\n367 Position memory position = positions[params_.tokenId][index]\n\n454 Position memory position = positions[tokenId_][index_];\n\n469 uint256[] memory indexes = positionIndexes[tokenId_].values();\n\n422 BucketState memory bucketSnapshot = stakes[tokenId_].snapshot[bucketIndex];\n\n442 BucketState memory bucketSnapshot = stakes[tokenId_].snapshot[bucketIndex];\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/SAQ-G.md", "collected_at": "2026-01-02T18:21:11.381336+00:00", "source_hash": "e16722a9c130b35b86710a7d90cf01d2eb59f9f86f4ae52c21e2ae2d0c8f71d6", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "file: /ajna-grants/src/grants/base/StandardFunding.sol\n\n82 mapping(uint256 => uint256[]) internal _topTenProposals;\n83\n84 /**\n85 * @notice Mapping of a hash of a proposal slate to a list of funded proposals.\n86 * @dev slate hash => proposalId[]\n87 */\n88 mapping(bytes32 => uint256[]) internal _fundedPropo/ajna-grants/src/grants/interfaces/IStandardFunding.salSlates;\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "file: /ajna-core/src/PositionManager.sol\n\n367 Position memory position = positions[params_.tokenId][index]\n\n454 Position memory position = positions[tokenId_][index_];\n\n469 uint256[] memory indexes = positionIndexes[tokenId_].values();\n\n422 BucketState memory bucketSnapshot = stakes[tokenId_].snapshot[bucketIndex];\n\n442 BucketState memory bucketSnapshot = stakes[tokenId_].snapshot[bucketIndex];\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "11-kelp", "title": "Im_th3AK Q", "severity_raw": "Low", "severity": "low", "description": "# Risk Rating \n- Low \n# Description\n- missing zero address validation.\nLRTConfig.setRSETH(address).rsETH_ (src/LRTConfig.sol#144) lacks a zero-check on :\n- rsETH = rsETH_ (src/LRTConfig.sol#146)\n# Impact\nLink:- https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTConfig.sol#L144-L146\n```\n function setRSETH(address rsETH_) external onlyRole(DEFAULT_ADMIN_ROLE) {\n UtilLib.checkNonZeroAddress(rsETH_);\n rsETH = rsETH_;\n }\n```\nIt lacks a zero-check on the rsETH_ parameter, which is an address type. This means that the function setRSETH could potentially accept the zero address (0x0000000000000000000000000000000000000000) as a valid input and assign it to the rsETH state variable. This could have serious consequences, such as:\n\n- The zero address could be used to bypass some access control or validation logic that relies on the rsETH variable.\n- The zero address could be used to lock funds or tokens that are sent to the rsETH variable, since the zero address is not owned by anyone and cannot be controlled.\n- The zero address could be used to cause unexpected behavior or errors in other functions that interact with the rsETH variable.\n# Tools \n- Manual\n# Recommendations\n```\nfunction setRSETH(address rsETH_) external onlyRole(DEFAULT_ADMIN_ROLE) {\n // Check that rsETH_ is not the zero address\n require(!iszero(rsETH_), \"rsETH_ cannot be the zero address\");\n UtilLib.checkNonZeroAddress(rsETH_);\n rsETH = rsETH_;\n}\n\n```\nThis code ensures that the function setRSETH will revert if rsETH_ is the zero address, and prevents any potential security or functionality risks.", "vulnerable_code": " function setRSETH(address rsETH_) external onlyRole(DEFAULT_ADMIN_ROLE) {\n UtilLib.checkNonZeroAddress(rsETH_);\n rsETH = rsETH_;\n }", "fixed_code": "function setRSETH(address rsETH_) external onlyRole(DEFAULT_ADMIN_ROLE) {\n // Check that rsETH_ is not the zero address\n require(!iszero(rsETH_), \"rsETH_ cannot be the zero address\");\n UtilLib.checkNonZeroAddress(rsETH_);\n rsETH = rsETH_;\n}\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/Im_th3AK-Q.md", "collected_at": "2026-01-02T18:27:29.117403+00:00", "source_hash": "e1a2658df5058becc28a44dd2681c4f7288eac224378f1024b648215d255cb90", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 400, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function setRSETH(address rsETH_) external onlyRole(DEFAULT_ADMIN_ROLE) {\n UtilLib.checkNonZeroAddress(rsETH_);\n rsETH = rsETH_;\n }", "primary_code_language": "unknown", "primary_code_char_count": 148, "all_code_blocks": "// Code block 1 (unknown):\nfunction setRSETH(address rsETH_) external onlyRole(DEFAULT_ADMIN_ROLE) {\n UtilLib.checkNonZeroAddress(rsETH_);\n rsETH = rsETH_;\n }\n\n// Code block 2 (unknown):\nfunction setRSETH(address rsETH_) external onlyRole(DEFAULT_ADMIN_ROLE) {\n // Check that rsETH_ is not the zero address\n require(!iszero(rsETH_), \"rsETH_ cannot be the zero address\");\n UtilLib.checkNonZeroAddress(rsETH_);\n rsETH = rsETH_;\n}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LRTConfig.sol#L144-L146", "github_files_list": "LRTConfig.sol", "github_refs_count": 1, "vulnerable_code_actual": " function setRSETH(address rsETH_) external onlyRole(DEFAULT_ADMIN_ROLE) {\n UtilLib.checkNonZeroAddress(rsETH_);\n rsETH = rsETH_;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function setRSETH(address rsETH_) external onlyRole(DEFAULT_ADMIN_ROLE) {\n // Check that rsETH_ is not the zero address\n require(!iszero(rsETH_), \"rsETH_ cannot be the zero address\");\n UtilLib.checkNonZeroAddress(rsETH_);\n rsETH = rsETH_;\n}\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "05-ajna", "title": "Koko1912 Q", "severity_raw": "Low", "severity": "low", "description": "### Table Of Issues\n| ID | Details of the issue |\n|:---|:------|\n| Non | Use a more recent pragma version |\n| Low | ERC20Rewards claiming can fail if there are no tokens |\n| Low | The project does not have a strategy if a token gets stuck |\n| Low | Not emitting event for changes in the state|\n\n\n## Non - Use a more recent pragma version \n\nThe version used in the Anjas' project is older.\n```sol\npragma solidity 0.8.14;\n```\nI recommend updating the version to the latest which is 0.8.19.\n\n## Low - ERC20Rewards claiming can fail if there are no tokens\n```sol\nThe value in the claimRewards(https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/RewardsManager.sol#L114) is not checked enough \n```\nI recommend setting new rewards periods, make sure that enough rewardsTokens are in the contract to cover the entire period.\n\n## The project does not have a strategy if a token gets stuck\nMost of the Farming Strategies interact with other protocols and for this reason they are subject to airdrops.\n\nI recommend adding a ``` TokenGetsStuck``` so that these extra tokens would not be claimable and would be lost forever.\n\n## Low - Not emitting event for changes in the state\nIn the contract ```StandardFunding.sol```. Not always the functions emit.\n\nThe function ```_updateTreasury``` needs to be emitted, because it makes change to the state variables.\n\n\n", "vulnerable_code": "pragma solidity 0.8.14;", "fixed_code": "The value in the claimRewards(https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/RewardsManager.sol#L114) is not checked enough ", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/Koko1912-Q.md", "collected_at": "2026-01-02T18:21:03.699903+00:00", "source_hash": "e1a31d59817e70a429a62b055f1b7b5a398ea1f96c1ae37fa97e5f644ad1bff6", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 166, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "pragma solidity 0.8.14;", "primary_code_language": "sol", "primary_code_char_count": 23, "all_code_blocks": "// Code block 1 (sol):\npragma solidity 0.8.14;\n\n// Code block 2 (sol):\nThe value in the claimRewards(https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/RewardsManager.sol#L114) is not checked enough", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "pragma solidity 0.8.14;\n\nThe value in the claimRewards(https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/RewardsManager.sol#L114) is not checked enough", "github_refs_formatted": "RewardsManager.sol#L114", "github_files_list": "RewardsManager.sol", "github_refs_count": 1, "vulnerable_code_actual": "pragma solidity 0.8.14;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "The value in the claimRewards(https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/RewardsManager.sol#L114) is not checked enough ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7.73} {"source": "c4", "protocol": "08-dopex", "title": "Mike_Bello90 G", "severity_raw": "Low", "severity": "low", "description": " **DOPEX CONTEST - 2023/08/21 - Gas Optimizations.**\n\n1.- To save gas you can cache some math calculations in a variable, so the compiler just does the math once and then you reuse that variable in the different places where it\u2019s needed.\n\nFor example in the function: _stake - RdpxV2Core SC\n\n```\nfunction _stake(address _to, uint256 _amount) internal returns (uint256 receiptTokenAmount) {\nUint256 midAmount = _amount / 2;\n reserveAsset[reservesIndex[\"WETH\"]].tokenBalance -= midAmount;\n\n IDpxEthToken(reserveAsset[reservesIndex[\"DPXETH\"]].tokenAddress).mint(address(this), midAmount);\n\n // deposit into the rdpxV2ReceiptToken contract\n receiptTokenAmount = IRdpxV2ReceiptToken(addresses.rdpxV2ReceiptToken).deposit(midAmount);\n\n // mint receipt token bonds\n _issueBond(_to, receiptTokenAmount);\n }\n```\nIn function: calculateBondCost - RdpxV2Core SC\n```\nfunction calculateBondCost(uint256 _amount, uint256 _rdpxBondId)\n public\n view\n returns (uint256 rdpxRequired, uint256 wethRequired)\n {\n \n ** Code omitted *\n \nuint256 bondDiscountHalf = bondDiscount / 2;\nUint256 divisor1 = (DEFAULT_PRECISION * rdpxPrice * 1e2);\nUint256 divisor2 = DEFAULT_PRECISION * 1e2;\n\n\n rdpxRequired = ((RDPX_RATIO_PERCENTAGE - (bondDiscountHalf)) * _amount * DEFAULT_PRECISION)\n / divisor1;\n\n wethRequired = ((ETH_RATIO_PERCENTAGE - (bondDiscountHalf)) * _amount) /divisor2;\n } else {\n // if rdpx decaying bonds are being used there is no discount\n rdpxRequired = (RDPX_RATIO_PERCENTAGE * _amount * DEFAULT_PRECISION) / divisor1;\n\n wethRequired = (ETH_RATIO_PERCENTAGE * _amount) / divisor2;\n }\n\n ** Code omitted **\n }\n```\n\nIn function updateFundingPaymentPointer - PerpetualAtlanticVault\n```\nfunction updateFundingPaymentPointer() public {\n while (block.timestamp >= nextFundingPaymentTimestamp()) {\n *\n\tuint256 amount = (current", "vulnerable_code": "function _stake(address _to, uint256 _amount) internal returns (uint256 receiptTokenAmount) {\nUint256 midAmount = _amount / 2;\n reserveAsset[reservesIndex[\"WETH\"]].tokenBalance -= midAmount;\n\n IDpxEthToken(reserveAsset[reservesIndex[\"DPXETH\"]].tokenAddress).mint(address(this), midAmount);\n\n // deposit into the rdpxV2ReceiptToken contract\n receiptTokenAmount = IRdpxV2ReceiptToken(addresses.rdpxV2ReceiptToken).deposit(midAmount);\n\n // mint receipt token bonds\n _issueBond(_to, receiptTokenAmount);\n }", "fixed_code": "function calculateBondCost(uint256 _amount, uint256 _rdpxBondId)\n public\n view\n returns (uint256 rdpxRequired, uint256 wethRequired)\n {\n \n ** Code omitted *\n \nuint256 bondDiscountHalf = bondDiscount / 2;\nUint256 divisor1 = (DEFAULT_PRECISION * rdpxPrice * 1e2);\nUint256 divisor2 = DEFAULT_PRECISION * 1e2;\n\n\n rdpxRequired = ((RDPX_RATIO_PERCENTAGE - (bondDiscountHalf)) * _amount * DEFAULT_PRECISION)\n / divisor1;\n\n wethRequired = ((ETH_RATIO_PERCENTAGE - (bondDiscountHalf)) * _amount) /divisor2;\n } else {\n // if rdpx decaying bonds are being used there is no discount\n rdpxRequired = (RDPX_RATIO_PERCENTAGE * _amount * DEFAULT_PRECISION) / divisor1;\n\n wethRequired = (ETH_RATIO_PERCENTAGE * _amount) / divisor2;\n }\n\n ** Code omitted **\n }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/Mike_Bello90-G.md", "collected_at": "2026-01-02T18:24:52.885087+00:00", "source_hash": "e1ed90e55e01bf1d2e8108aba4b9c9fd35e98a7df796873c6a19e78879de0f0c", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 1415, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _stake(address _to, uint256 _amount) internal returns (uint256 receiptTokenAmount) {\nUint256 midAmount = _amount / 2;\n reserveAsset[reservesIndex[\"WETH\"]].tokenBalance -= midAmount;\n\n IDpxEthToken(reserveAsset[reservesIndex[\"DPXETH\"]].tokenAddress).mint(address(this), midAmount);\n\n // deposit into the rdpxV2ReceiptToken contract\n receiptTokenAmount = IRdpxV2ReceiptToken(addresses.rdpxV2ReceiptToken).deposit(midAmount);\n\n // mint receipt token bonds\n _issueBond(_to, receiptTokenAmount);\n }", "primary_code_language": "unknown", "primary_code_char_count": 547, "all_code_blocks": "// Code block 1 (unknown):\nfunction _stake(address _to, uint256 _amount) internal returns (uint256 receiptTokenAmount) {\nUint256 midAmount = _amount / 2;\n reserveAsset[reservesIndex[\"WETH\"]].tokenBalance -= midAmount;\n\n IDpxEthToken(reserveAsset[reservesIndex[\"DPXETH\"]].tokenAddress).mint(address(this), midAmount);\n\n // deposit into the rdpxV2ReceiptToken contract\n receiptTokenAmount = IRdpxV2ReceiptToken(addresses.rdpxV2ReceiptToken).deposit(midAmount);\n\n // mint receipt token bonds\n _issueBond(_to, receiptTokenAmount);\n }\n\n// Code block 2 (unknown):\nfunction calculateBondCost(uint256 _amount, uint256 _rdpxBondId)\n public\n view\n returns (uint256 rdpxRequired, uint256 wethRequired)\n {\n \n ** Code omitted *\n \nuint256 bondDiscountHalf = bondDiscount / 2;\nUint256 divisor1 = (DEFAULT_PRECISION * rdpxPrice * 1e2);\nUint256 divisor2 = DEFAULT_PRECISION * 1e2;\n\n\n rdpxRequired = ((RDPX_RATIO_PERCENTAGE - (bondDiscountHalf)) * _amount * DEFAULT_PRECISION)\n / divisor1;\n\n wethRequired = ((ETH_RATIO_PERCENTAGE - (bondDiscountHalf)) * _amount) /divisor2;\n } else {\n // if rdpx decaying bonds are being used there is no discount\n rdpxRequired = (RDPX_RATIO_PERCENTAGE * _amount * DEFAULT_PRECISION) / divisor1;\n\n wethRequired = (ETH_RATIO_PERCENTAGE * _amount) / divisor2;\n }\n\n ** Code omitted **\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function _stake(address _to, uint256 _amount) internal returns (uint256 receiptTokenAmount) {\nUint256 midAmount = _amount / 2;\n reserveAsset[reservesIndex[\"WETH\"]].tokenBalance -= midAmount;\n\n IDpxEthToken(reserveAsset[reservesIndex[\"DPXETH\"]].tokenAddress).mint(address(this), midAmount);\n\n // deposit into the rdpxV2ReceiptToken contract\n receiptTokenAmount = IRdpxV2ReceiptToken(addresses.rdpxV2ReceiptToken).deposit(midAmount);\n\n // mint receipt token bonds\n _issueBond(_to, receiptTokenAmount);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function calculateBondCost(uint256 _amount, uint256 _rdpxBondId)\n public\n view\n returns (uint256 rdpxRequired, uint256 wethRequired)\n {\n \n ** Code omitted *\n \nuint256 bondDiscountHalf = bondDiscount / 2;\nUint256 divisor1 = (DEFAULT_PRECISION * rdpxPrice * 1e2);\nUint256 divisor2 = DEFAULT_PRECISION * 1e2;\n\n\n rdpxRequired = ((RDPX_RATIO_PERCENTAGE - (bondDiscountHalf)) * _amount * DEFAULT_PRECISION)\n / divisor1;\n\n wethRequired = ((ETH_RATIO_PERCENTAGE - (bondDiscountHalf)) * _amount) /divisor2;\n } else {\n // if rdpx decaying bonds are being used there is no discount\n rdpxRequired = (RDPX_RATIO_PERCENTAGE * _amount * DEFAULT_PRECISION) / divisor1;\n\n wethRequired = (ETH_RATIO_PERCENTAGE * _amount) / divisor2;\n }\n\n ** Code omitted **\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-asymmetry", "title": "0xhacksmithh G", "severity_raw": "High", "severity": "high", "description": "### [Gas-01] Function result should be cached in ```memory``` instead of calling it again and again.\n```solidity\nunderlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) * \n derivatives[i].balance()) /\n 10 ** 18;\n```\nHere function result of ```derivatives[i].balance()``` should be cached in ```memory``` instead of calling it again.\n```Instances(2)```\n```\nFile: contracts/SafEth/SafEth.sol\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L72-L75\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L141-L142\n```\n\n### [Gas-02] Mathematic logics for ```adjustWeight()``` could be improved to save gas.\n```solidity\n function adjustWeight(\n uint256 _derivativeIndex, \n uint256 _weight\n ) external onlyOwner { \n weights[_derivativeIndex] = _weight;\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++) \n localTotalWeight += weights[i]; \n totalWeight = localTotalWeight;\n emit WeightChange(_derivativeIndex, _weight); \n }\n```\nHere first weight set in mapping, then pointer(program pointer) itterate over whole mapping and add their corresponding weights and finally set result(```localTotalWeight```) to ```totalWeight``` state variable.\n\nHere multiple stateVariable read and addition occure to set just one derivative's weight\n\nWhich can preform with less cost i.e\n1. Whenever we change a weight\n a. first delete that much weight from ```totalWeight```\n b. Set corresponding weight with its index in ```weights``` mapping. \n b. then add new weight to ```totalWeight```\n\n```solidity\n function adjustWeight(\n uint256 _derivativeIndex, \n uint256 _weight\n ) external onlyOwner { \n+ totalWeight = totalWeight - weights[_derivativeIndex];\n weights[_derivativeIndex] = _weight;\n+ totalWeight = totalWeight + _weight;\n\n- ", "vulnerable_code": "underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) * \n derivatives[i].balance()) /\n 10 ** 18;", "fixed_code": "```\nFile: contracts/SafEth/SafEth.sol\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L72-L75\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L141-L142", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/0xhacksmithh-G.md", "collected_at": "2026-01-02T18:17:42.268742+00:00", "source_hash": "e228bac211ad59b8580ae1077fe6606789b0d3290515b151260e19a529b6a6f7", "code_block_count": 4, "solidity_block_count": 2, "total_code_chars": 644, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) * \n derivatives[i].balance()) /\n 10 ** 18;", "primary_code_language": "solidity", "primary_code_char_count": 171, "all_code_blocks": "// Code block 1 (solidity):\nunderlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) * \n derivatives[i].balance()) /\n 10 ** 18;\n\n// Code block 2 (unknown):\n### [Gas-02] Mathematic logics for\n\n// Code block 3 (solidity):\nfunction adjustWeight(\n uint256 _derivativeIndex, \n uint256 _weight\n ) external onlyOwner { \n weights[_derivativeIndex] = _weight;\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++) \n localTotalWeight += weights[i]; \n totalWeight = localTotalWeight;\n emit WeightChange(_derivativeIndex, _weight); \n }\n\n// Code block 4 (unknown):\nb. Set corresponding weight with its index in", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) * \n derivatives[i].balance()) /\n 10 ** 18;\n\nfunction adjustWeight(\n uint256 _derivativeIndex, \n uint256 _weight\n ) external onlyOwner { \n weights[_derivativeIndex] = _weight;\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++) \n localTotalWeight += weights[i]; \n totalWeight = localTotalWeight;\n emit WeightChange(_derivativeIndex, _weight); \n }", "github_refs_formatted": "SafEth.sol#L72-L75, SafEth.sol#L141-L142", "github_files_list": "SafEth.sol", "github_refs_count": 2, "vulnerable_code_actual": "underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) * \n derivatives[i].balance()) /\n 10 ** 18;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "```\nFile: contracts/SafEth/SafEth.sol\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L72-L75\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L141-L142", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "03-asymmetry", "title": "codeslide Q", "severity_raw": "Critical", "severity": "critical", "description": "### Low Risk Issues List\n\n| Number | Issues Details | Instances |\n| :----: | :--------------------------------- | :-------: |\n| [L-01] | Unspecific compiler version pragma | 4 |\n\nTotal: 1 issue\n\n#### [L-01] Unspecific compiler version pragma\n\nThe compiler version specified for a contract should be locked to the version it has been tested the most with. Locking the pragma helps ensure that contracts do not accidentally get deployed using, for example, the latest compiler which may have higher risks of undiscovered bugs. Contracts may also be deployed by others and the pragma indicates the compiler version intended by the original authors. [locking-pragmas/](https://consensys.github.io/smart-contract-best-practices/development-recommendations/solidity-specific/locking-pragmas/)\n\nFor example:\n\n```solidity\n// bad\npragma solidity ^0.8.13;\n\n// good\npragma solidity 0.8.13;\n```\n\n1. [SafEth.sol Line 2](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L2)\n2. [Reth.sol Line 2](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L2)\n3. [SfrxEth.sol Line 2](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol#L2)\n4. [WstEth.sol Line 2](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol#L2)\n\n### Non-Critical Issues List\n\n| Number | Issues Details | Instances |\n| :-: | :-- | :-: |\n| [N-01] | Readability and maintainability | 1 |\n| [N-02] | Function grouping and ordering | 3 |\n| [N-03] | Maximum Line Length | 2 |\n| [N-04] | Constants should be defined rather than using magic numbers | 1 |\n| [N-05] | Control structure style | 1 |\n\nTotal: 5 issues\n\n#### [N-01] Readability and maintainability\n\nSome code could be made easier to read and maintain by changing the syntax.\n\n```solidity\nFile: contracts/SafEth/SafEth.sol\n\n// before\n54: minAmount = 5 * 10 ** 17; // initializing with .5 ETH a", "vulnerable_code": "// bad\npragma solidity ^0.8.13;\n\n// good\npragma solidity 0.8.13;", "fixed_code": "File: contracts/SafEth/SafEth.sol\n\n// before\n54: minAmount = 5 * 10 ** 17; // initializing with .5 ETH as minimum\n55: maxAmount = 200 * 10 ** 18; // initializing with 200 ETH as maximum\n\n// after\n54: minAmount = 1 ether / 2; // initializing with .5 ETH as minimum\n55: maxAmount = 200 ether; // initializing with 200 ETH as maximum", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/codeslide-Q.md", "collected_at": "2026-01-02T18:19:01.156977+00:00", "source_hash": "e25adbd307ff3bc369111e1ab074b567d0c3dd30f26148e191b2a0655fbd2700", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 64, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "// bad\npragma solidity ^0.8.13;\n\n// good\npragma solidity 0.8.13;", "primary_code_language": "solidity", "primary_code_char_count": 64, "all_code_blocks": "// Code block 1 (solidity):\n// bad\npragma solidity ^0.8.13;\n\n// good\npragma solidity 0.8.13;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "// bad\npragma solidity ^0.8.13;\n\n// good\npragma solidity 0.8.13;", "github_refs_formatted": "SafEth.sol#L2, Reth.sol#L2, SfrxEth.sol#L2, WstEth.sol#L2", "github_files_list": "SfrxEth.sol, Reth.sol, WstEth.sol, SafEth.sol", "github_refs_count": 4, "vulnerable_code_actual": "// bad\npragma solidity ^0.8.13;\n\n// good\npragma solidity 0.8.13;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/SafEth/SafEth.sol\n\n// before\n54: minAmount = 5 * 10 ** 17; // initializing with .5 ETH as minimum\n55: maxAmount = 200 * 10 ** 18; // initializing with 200 ETH as maximum\n\n// after\n54: minAmount = 1 ether / 2; // initializing with .5 ETH as minimum\n55: maxAmount = 200 ether; // initializing with 200 ETH as maximum", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "09-ondo", "title": "MatricksDeCoder Q", "severity_raw": "Medium", "severity": "medium", "description": "### NC1 - Add interfaces to own folder\n\n[IRWAOracle.sol in /rwaOracles/ folder](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/rwaOracles/IRWAOracle.sol) given there is an /interfaces folder in the /contracts folder \n\n**Impact**-> It affects the code maintainability, readability, organization, auditability and cleanliness of folders and structure\n\n**Recommendation** -> It is recommended add all interfaces into their own /interface folder for all interfaces or create separate interfaces folders within the contract folders where interface is used\ne.g /rwaOracles/interfaces/IRWAOracle.sol\n\n### NC2 - Not using named imports\n\nImports just get entire files e.g\n```solidity\nimport \"contracts/interfaces/IAxelarGateway.sol\";\nimport \"contracts/interfaces/IAxelarGasService.sol\";\nimport \"contracts/interfaces/IMulticall.sol\";\nimport \"contracts/interfaces/IRWALike.sol\";\n```\nvs best and cleaner practise of using named imports\n```\nimport {IAxelarGateway} from \"contracts/interfaces/IAxelarGateway.sol\";\n```\n\n[SourceBridge.sol line 3-6](https://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/bridge/SourceBridge.sol#L3C1-L6C44)\n[DestinationBridge.sol line 18-22,25](https://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/bridge/DestinationBridge.sol#L18)\n[rUSDY.sol lines 18-28](https://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L18)\n[rUSDYFactory.sol lines 19-22](https://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDYFactory.sol#L19)\n[RWADynamicOracle.sol lines 18-20](https://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/rwaOracles/RWADynamicOracle.sol#L18)\n\n**Impact**-> it affects the code organization, readability, interpretability, maintainability, auditability and best practises\n\n**Recommendation** -> It is recommended to i", "vulnerable_code": "import \"contracts/interfaces/IAxelarGateway.sol\";\nimport \"contracts/interfaces/IAxelarGasService.sol\";\nimport \"contracts/interfaces/IMulticall.sol\";\nimport \"contracts/interfaces/IRWALike.sol\";", "fixed_code": "import {IAxelarGateway} from \"contracts/interfaces/IAxelarGateway.sol\";", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/MatricksDeCoder-Q.md", "collected_at": "2026-01-02T18:25:36.748771+00:00", "source_hash": "e26d6b7d73c800cccffc2a5ebaed9b79f6c3bbf947abc8330a7b6e671140bcc0", "code_block_count": 2, "solidity_block_count": 1, "total_code_chars": 263, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "import \"contracts/interfaces/IAxelarGateway.sol\";\nimport \"contracts/interfaces/IAxelarGasService.sol\";\nimport \"contracts/interfaces/IMulticall.sol\";\nimport \"contracts/interfaces/IRWALike.sol\";", "primary_code_language": "solidity", "primary_code_char_count": 192, "all_code_blocks": "// Code block 1 (solidity):\nimport \"contracts/interfaces/IAxelarGateway.sol\";\nimport \"contracts/interfaces/IAxelarGasService.sol\";\nimport \"contracts/interfaces/IMulticall.sol\";\nimport \"contracts/interfaces/IRWALike.sol\";\n\n// Code block 2 (unknown):\nimport {IAxelarGateway} from \"contracts/interfaces/IAxelarGateway.sol\";", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "import \"contracts/interfaces/IAxelarGateway.sol\";\nimport \"contracts/interfaces/IAxelarGasService.sol\";\nimport \"contracts/interfaces/IMulticall.sol\";\nimport \"contracts/interfaces/IRWALike.sol\";", "github_refs_formatted": "IRWAOracle.sol, SourceBridge.sol#L3-L1, DestinationBridge.sol#L18, rUSDY.sol#L18, rUSDYFactory.sol#L19, RWADynamicOracle.sol#L18", "github_files_list": "rUSDYFactory.sol, RWADynamicOracle.sol, rUSDY.sol, SourceBridge.sol, IRWAOracle.sol, DestinationBridge.sol", "github_refs_count": 6, "vulnerable_code_actual": "import \"contracts/interfaces/IAxelarGateway.sol\";\nimport \"contracts/interfaces/IAxelarGasService.sol\";\nimport \"contracts/interfaces/IMulticall.sol\";\nimport \"contracts/interfaces/IRWALike.sol\";", "has_vulnerable_code_snippet": true, "fixed_code_actual": "import {IAxelarGateway} from \"contracts/interfaces/IAxelarGateway.sol\";", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-biconomy", "title": "chaduke Q", "severity_raw": "High", "severity": "high", "description": "QA1. https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L397\nThere is a typo here, the comparison should be against ``type(uint128).max`` instead of ``type(uint120).max`` since the documentation says \"validate all numeric values in userOp are well below 128 bit\".\n\n```\nrequire(maxGasValues <= type(uint128).max, \"AA94 gas values overflow\");\n\n```\n\nQA2: https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L75\nThe modifier ``onlyOwner`` is not necessary, just like the ``deposit()`` function. \n\nQA3: https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L99\nZero address check is necessary for ``withdrawAddress`` to avoid losing funding to the zero address.\n\nQA4: https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/common/Singleton.sol#L2\nLock all contracts to the most recent version of Solidity, 0.8.17.\n\nQA5. https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/handler/DefaultCallbackHandler.sol#L55-L61\nThe function should also indicate that it supports the interface of ``ERC777TokensRecipient`` as well.\n\n```\nfunction supportsInterface(bytes4 interfaceId) external view virtual override returns (bool) {\n return\n interfaceId == type(ERC1155TokenReceiver).interfaceId ||\n interfaceId == type(ERC721TokenReceiver).interfaceId ||\n interfaceId == type(ERC777TokensRecipient).interfaceId || \n interfaceId == type(IERC165).interfaceId;\n }\n```\nQA6. https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529ee", "vulnerable_code": "require(maxGasValues <= type(uint128).max, \"AA94 gas values overflow\");\n", "fixed_code": "function supportsInterface(bytes4 interfaceId) external view virtual override returns (bool) {\n return\n interfaceId == type(ERC1155TokenReceiver).interfaceId ||\n interfaceId == type(ERC721TokenReceiver).interfaceId ||\n interfaceId == type(ERC777TokensRecipient).interfaceId || \n interfaceId == type(IERC165).interfaceId;\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/chaduke-Q.md", "collected_at": "2026-01-02T18:13:36.880613+00:00", "source_hash": "e29cfb7e29d345af33470fa2abe4daaeb4b9ff195c5a1594f90c0266e4a891f6", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 448, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "require(maxGasValues <= type(uint128).max, \"AA94 gas values overflow\");", "primary_code_language": "unknown", "primary_code_char_count": 71, "all_code_blocks": "// Code block 1 (unknown):\nrequire(maxGasValues <= type(uint128).max, \"AA94 gas values overflow\");\n\n// Code block 2 (unknown):\nfunction supportsInterface(bytes4 interfaceId) external view virtual override returns (bool) {\n return\n interfaceId == type(ERC1155TokenReceiver).interfaceId ||\n interfaceId == type(ERC721TokenReceiver).interfaceId ||\n interfaceId == type(ERC777TokensRecipient).interfaceId || \n interfaceId == type(IERC165).interfaceId;\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "EntryPoint.sol#L397, BasePaymaster.sol#L75, BasePaymaster.sol#L99, Singleton.sol#L2, DefaultCallbackHandler.sol#L55-L61", "github_files_list": "DefaultCallbackHandler.sol, BasePaymaster.sol, Singleton.sol, EntryPoint.sol", "github_refs_count": 5, "vulnerable_code_actual": "require(maxGasValues <= type(uint128).max, \"AA94 gas values overflow\");\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function supportsInterface(bytes4 interfaceId) external view virtual override returns (bool) {\n return\n interfaceId == type(ERC1155TokenReceiver).interfaceId ||\n interfaceId == type(ERC721TokenReceiver).interfaceId ||\n interfaceId == type(ERC777TokensRecipient).interfaceId || \n interfaceId == type(IERC165).interfaceId;\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "02-ai-arena", "title": "0xStriker Q", "severity_raw": "Critical", "severity": "critical", "description": "# Summary\n\n\n\n# Low Risk Issues \nno | Issue |Instances||\n|-|:-|:-:|:-:|\n| [L-01] | add more validation checks for the input data in the createGameItem() function | 1 |\n| [L-02] | the function call will fail if the maxId is more than one | 1 |\n| [L-03] | zero nrn distribution | 1 |\n| [L-04] | the function adjusts the unstake amount without reverting | 1 |\n| [L-05] | it is a best practice to use the safeErc20 library | 12 |\n| [L-06] | no zero address checks | 15 |\n\n# Non-critical\nno | Issue |Instances||\n|-|:-|:-:|:-:|\n| [N-01] | The values of the attributeProbabilities mapping are redundantly set| 1 |\n| [N-02] | the function name could be changed to represent it much clearer | 1 |\n| [N-03] | comment suggestion and function implementation difference | 1 |\n| [N-04] | redundant code logic | 1 |\n| [N-05] | the resetting should be skiped if the value is already set to the same value | 3 | \n\n\n## [L-01] add more validation checks for the input data in the createGameItem() function \nsince the function createGameItem() creates gemeItems that will be in the systme permanently it is a good practice to add some more validation checks for the input data, such as check if the finiteSupply is true, if yes,than the itemsRemaining should be more than zero, and the item price should be more than zero.\n```solidity\n if(itemPrice <= 0 ){ \n revert();\n }\n if (finiteSupply) {\n if(itemsRemaining <= 0 ) {\n revert();\n }\n }\n```\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/GameItems.sol#L208-L235\n\n## [l-02] the function call will fail if the maxId is more than one\nIn the getFighterPoints() function, the array points is initialized with a length of 1, which will cause the function call to fail if maxId is greater than 1. When the loop tries to access points[i] for i > 1, it will result in an out-of-bounds array access, which will cause a runtime error and rev", "vulnerable_code": " if(itemPrice <= 0 ){ \n revert();\n }\n if (finiteSupply) {\n if(itemsRemaining <= 0 ) {\n revert();\n }\n }", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/0xStriker-Q.md", "collected_at": "2026-01-02T19:02:06.483353+00:00", "source_hash": "e2e4380965767465c5140107b3d37dfe9d029b1e259859d552b65efa95a81ece", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 170, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "if(itemPrice <= 0 ){ \n revert();\n }\n if (finiteSupply) {\n if(itemsRemaining <= 0 ) {\n revert();\n }\n }", "primary_code_language": "solidity", "primary_code_char_count": 170, "all_code_blocks": "// Code block 1 (solidity):\nif(itemPrice <= 0 ){ \n revert();\n }\n if (finiteSupply) {\n if(itemsRemaining <= 0 ) {\n revert();\n }\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "if(itemPrice <= 0 ){ \n revert();\n }\n if (finiteSupply) {\n if(itemsRemaining <= 0 ) {\n revert();\n }\n }", "github_refs_formatted": "GameItems.sol#L208-L235", "github_files_list": "GameItems.sol", "github_refs_count": 1, "vulnerable_code_actual": " if(itemPrice <= 0 ){ \n revert();\n }\n if (finiteSupply) {\n if(itemsRemaining <= 0 ) {\n revert();\n }\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "04-caviar", "title": "AkshaySrivastav Q", "severity_raw": "Unknown", "severity": "unknown", "description": "1. The `Factory.create` function is susceptible to re-entrancy as it performs a `_safeMint` before initializing the pool.\n ```solidity\n function create(\n ...\n ) public payable returns (PrivatePool privatePool) {\n // ...\n privatePool = PrivatePool(payable(privatePoolImplementation.cloneDeterministic(_salt)));\n\n // mint the nft to the caller\n _safeMint(msg.sender, uint256(uint160(address(privatePool))));\n\n // initialize the pool\n privatePool.initialize(...);\n // ...\n }\n ```\n2. The `Factory.create` function performs plain transfer of funds instead of calling the `deposit` function. This way the `Deposit` event is not emitted.\n ```solidity\n function create(\n ...\n ) public payable returns (PrivatePool privatePool) {\n // ...\n privatePool.initialize(...);\n \n if (_baseToken == address(0)) {\n // transfer eth into the pool if base token is ETH\n address(privatePool).safeTransferETH(baseTokenAmount);\n } else {\n // deposit the base tokens from the caller into the pool\n ERC20(_baseToken).transferFrom(msg.sender, address(privatePool), baseTokenAmount);\n }\n\n // deposit the nfts from the caller into the pool\n for (uint256 i = 0; i < tokenIds.length; i++) {\n ERC721(_nft).safeTransferFrom(msg.sender, address(privatePool), tokenIds[i]);\n }\n\n // emit create event\n emit Create(address(privatePool), tokenIds, baseTokenAmount);\n }\n ```\n3. There is no fee cap on the `Factory.setProtocolFeeRate` function. A value greater then 10000 can break the fee calculations in private pool. Consider validating that the input is less than 10000.\n ```solidity\n function setProtocolFeeRate(uint16 _protocolFeeRate) public onlyOwner {\n protocolFeeRate = _protocolFeeRate;\n }\n ```\n4. `Factory.tokenId` does not validate the input `id` parameter. Consider validating that th", "vulnerable_code": "", "fixed_code": "", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/AkshaySrivastav-Q.md", "collected_at": "2026-01-02T18:19:27.125752+00:00", "source_hash": "e320803cd77bb9b01f09acf5fe4886c783933441935434b16535bf00fc89a4a6", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 1346, "github_ref_count": 0, "vulnerable_code_is_url": true, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function create(\n ...\n ) public payable returns (PrivatePool privatePool) {\n // ...\n privatePool = PrivatePool(payable(privatePoolImplementation.cloneDeterministic(_salt)));\n\n // mint the nft to the caller\n _safeMint(msg.sender, uint256(uint160(address(privatePool))));\n\n // initialize the pool\n privatePool.initialize(...);\n // ...\n }", "primary_code_language": "solidity", "primary_code_char_count": 397, "all_code_blocks": "// Code block 1 (solidity):\nfunction create(\n ...\n ) public payable returns (PrivatePool privatePool) {\n // ...\n privatePool = PrivatePool(payable(privatePoolImplementation.cloneDeterministic(_salt)));\n\n // mint the nft to the caller\n _safeMint(msg.sender, uint256(uint160(address(privatePool))));\n\n // initialize the pool\n privatePool.initialize(...);\n // ...\n }\n\n// Code block 2 (solidity):\nfunction create(\n ...\n ) public payable returns (PrivatePool privatePool) {\n // ...\n privatePool.initialize(...);\n \n if (_baseToken == address(0)) {\n // transfer eth into the pool if base token is ETH\n address(privatePool).safeTransferETH(baseTokenAmount);\n } else {\n // deposit the base tokens from the caller into the pool\n ERC20(_baseToken).transferFrom(msg.sender, address(privatePool), baseTokenAmount);\n }\n\n // deposit the nfts from the caller into the pool\n for (uint256 i = 0; i < tokenIds.length; i++) {\n ERC721(_nft).safeTransferFrom(msg.sender, address(privatePool), tokenIds[i]);\n }\n\n // emit create event\n emit Create(address(privatePool), tokenIds, baseTokenAmount);\n }\n\n// Code block 3 (solidity):\nfunction setProtocolFeeRate(uint16 _protocolFeeRate) public onlyOwner {\n protocolFeeRate = _protocolFeeRate;\n }", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function create(\n ...\n ) public payable returns (PrivatePool privatePool) {\n // ...\n privatePool = PrivatePool(payable(privatePoolImplementation.cloneDeterministic(_salt)));\n\n // mint the nft to the caller\n _safeMint(msg.sender, uint256(uint160(address(privatePool))));\n\n // initialize the pool\n privatePool.initialize(...);\n // ...\n }\n\nfunction create(\n ...\n ) public payable returns (PrivatePool privatePool) {\n // ...\n privatePool.initialize(...);\n \n if (_baseToken == address(0)) {\n // transfer eth into the pool if base token is ETH\n address(privatePool).safeTransferETH(baseTokenAmount);\n } else {\n // deposit the base tokens from the caller into the pool\n ERC20(_baseToken).transferFrom(msg.sender, address(privatePool), baseTokenAmount);\n }\n\n // deposit the nfts from the caller into the pool\n for (uint256 i = 0; i < tokenIds.length; i++) {\n ERC721(_nft).safeTransferFrom(msg.sender, address(privatePool), tokenIds[i]);\n }\n\n // emit create event\n emit Create(address(privatePool), tokenIds, baseTokenAmount);\n }\n\nfunction setProtocolFeeRate(uint16 _protocolFeeRate) public onlyOwner {\n protocolFeeRate = _protocolFeeRate;\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "", "has_vulnerable_code_snippet": false, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "02-ethos", "title": "csanuragjain Q", "severity_raw": "Low", "severity": "low", "description": "## Unauthorized access to Permit\n\nContract:\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L287\n\nIssue:\n\n1. The address recovery from signature is done through `ecrecover` function.\n2. This function gives address(0) in case of invalid signature\n3. There is no check to validate recoveredAddress!=address(0) which means you can approve any amount from address(0)\n\n```\n address recoveredAddress = ecrecover(digest, v, r, s);\n require(recoveredAddress == owner, 'LUSD: invalid signature');\n _approve(owner, spender, amount);\n```\n\nRecommendation:\nAdd a check to ensure that recoveredAddress!=address(0)\n\n```\n require(recoveredAddress!=address(0) && recoveredAddress == owner, 'LUSD: invalid signature');\n```\n\n\n## Duplicate strategy are allowed\n\nContract:\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L258\n\nIssue:\n\n1. Duplicate strategy can be added using `setWithdrawalQueue` function\n2. This means `withdrawalQueue` could contain multiple copies of same strategy\n3. Since `withdrawalQueue` is used to decide the strategy used to pull fund from, a duplicate strategy could cause using same strategy multiple times which was not intended\n\nRecommendation:\nIf a strategy already exist in `withdrawalQueue` then revert", "vulnerable_code": " address recoveredAddress = ecrecover(digest, v, r, s);\n require(recoveredAddress == owner, 'LUSD: invalid signature');\n _approve(owner, spender, amount);", "fixed_code": " require(recoveredAddress!=address(0) && recoveredAddress == owner, 'LUSD: invalid signature');", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/csanuragjain-Q.md", "collected_at": "2026-01-02T18:17:01.551625+00:00", "source_hash": "e32b48f6ff505522c41676e2285b65f46cebe595277019eb72a739a94ac7a55d", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 261, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "address recoveredAddress = ecrecover(digest, v, r, s);\n require(recoveredAddress == owner, 'LUSD: invalid signature');\n _approve(owner, spender, amount);", "primary_code_language": "unknown", "primary_code_char_count": 167, "all_code_blocks": "// Code block 1 (unknown):\naddress recoveredAddress = ecrecover(digest, v, r, s);\n require(recoveredAddress == owner, 'LUSD: invalid signature');\n _approve(owner, spender, amount);\n\n// Code block 2 (unknown):\nrequire(recoveredAddress!=address(0) && recoveredAddress == owner, 'LUSD: invalid signature');", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LUSDToken.sol#L287, ReaperVaultV2.sol#L258", "github_files_list": "LUSDToken.sol, ReaperVaultV2.sol", "github_refs_count": 2, "vulnerable_code_actual": " address recoveredAddress = ecrecover(digest, v, r, s);\n require(recoveredAddress == owner, 'LUSD: invalid signature');\n _approve(owner, spender, amount);", "has_vulnerable_code_snippet": true, "fixed_code_actual": " require(recoveredAddress!=address(0) && recoveredAddress == owner, 'LUSD: invalid signature');", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7.63} {"source": "c4", "protocol": "11-kelp", "title": "shamsulhaq123 G", "severity_raw": "Medium", "severity": "medium", "description": "## Gas optimizations\n\n## Sumary\n\n| No|Issue|Instances|\n|-|:-|:-:|\n|[G-01]|Change public function visibility to external|4|\n|[G-02]| Use calldata instead of memory for function parameters|3|\n|[G-03]|Use hardcode address instead address(this)|6|\n|[G-04]|Modifiers are redundant if used only once or not used at all.|1|\n|[G-05]|Use function instead of modifiers |2|\n|[G-06]|Not using the named return variable when a function returns, wastes deployment gas|1|\n|[G-07]| Use constants instead of type(uintx).max|1|\n|[G-08]|Non efficient zero initialization|1|\n|[G-09]|Should use arguments instead of state variable |17|\n|[G-10]|State Variable can be packed into fewer storage slots|4|\n|[G-11]|Expressions for constant values such as a call to\u00a0keccak256()|2|\n|[G-12]|Pre-increments and pre-decrements are cheaper than post-increments and post-decrements|4|\n|[G-13]|Use uint256(1)/uint256(2) instead for true and false boolean states|1|\n|[G-14]|Loop best practice to save gas|4|\n|[G-15]|+= costs more gas than = + for state variables|2|\n|[G-16]|Using calldata instead of memory for read-only arguments in external functions saves gas|2|\n|[G-17]|Use assembly to emit events|17|\n\n\n## [G-01] Change public function visibility to external\nSince the following public functions are not called from within the contract, their visibility can be made external for gas optimization.\n\n```solidity\n\nfile: LRTDepositPool.sol\n\n47 function getTotalAssetDeposits(address asset) public view override returns (uint256 totalAssetDeposit) \n\n56 function getAssetCurrentLimit(address asset) public view override returns (uint256) \n\n71 function getAssetDistributionData(address asset)\n public\n view\n override\n onlySupportedAsset(asset)\n returns (uint256 assetLyingInDepositPool, uint256 assetLyingInNDCs, uint256 assetStakedInEigenLayer)\n\n95 function getRsETHAmountToMint(\n address asset,\n uint256 amount\n )\n public\n view\n override\n returns (u", "vulnerable_code": "file: LRTDepositPool.sol\n\n47 function getTotalAssetDeposits(address asset) public view override returns (uint256 totalAssetDeposit) \n\n56 function getAssetCurrentLimit(address asset) public view override returns (uint256) \n\n71 function getAssetDistributionData(address asset)\n public\n view\n override\n onlySupportedAsset(asset)\n returns (uint256 assetLyingInDepositPool, uint256 assetLyingInNDCs, uint256 assetStakedInEigenLayer)\n\n95 function getRsETHAmountToMint(\n address asset,\n uint256 amount\n )\n public\n view\n override\n returns (uint256 rsethAmountToMint) ", "fixed_code": "file: LRTOracle.sol\n\n45 function getAssetPrice(address asset) public view onlySupportedAsset(asset) returns (uint256) {\n return IPriceFetcher(assetPriceOracle[asset]).getAssetPrice(asset);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/shamsulhaq123-G.md", "collected_at": "2026-01-02T18:28:28.043104+00:00", "source_hash": "e3480c9217dcf5c5b8ec610aff3bb5ed304aa6f374c105a2da762af7083105a2", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "file: LRTDepositPool.sol\n\n47 function getTotalAssetDeposits(address asset) public view override returns (uint256 totalAssetDeposit) \n\n56 function getAssetCurrentLimit(address asset) public view override returns (uint256) \n\n71 function getAssetDistributionData(address asset)\n public\n view\n override\n onlySupportedAsset(asset)\n returns (uint256 assetLyingInDepositPool, uint256 assetLyingInNDCs, uint256 assetStakedInEigenLayer)\n\n95 function getRsETHAmountToMint(\n address asset,\n uint256 amount\n )\n public\n view\n override\n returns (uint256 rsethAmountToMint) ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "file: LRTOracle.sol\n\n45 function getAssetPrice(address asset) public view onlySupportedAsset(asset) returns (uint256) {\n return IPriceFetcher(assetPriceOracle[asset]).getAssetPrice(asset);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "11-kelp", "title": "Draiakoo Q", "severity_raw": "Low", "severity": "low", "description": "## Title\nThe following invariant can be broken:\nmaxNodeDelegatorCount >= nodeDelegatorQueue.length\n\n## Explanation\nThe protocol should hold the previous exposed invariant, however it is possible to make it maxNodeDelegatorCount < nodeDelegatorQueue.length by setting a limit lower than the current number of nodes.\n\n## Proof of Concept\n```\n// SPDX-License-Identifier: UNLICENSED\n\npragma solidity 0.8.21;\n\nimport { Test } from \"forge-std/Test.sol\";\nimport \"forge-std/console.sol\";\nimport { ERC20 } from \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport { TransparentUpgradeableProxy } from \"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\";\nimport { ProxyAdmin } from \"@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol\";\nimport { LRTConfig, ILRTConfig } from \"src/LRTConfig.sol\";\nimport { RSETH } from \"src/RSETH.sol\";\nimport { LRTDepositPool } from \"src/LRTDepositPool.sol\";\n\nimport { LRTConstants } from \"src/utils/LRTConstants.sol\";\nimport { PausableUpgradeable } from \"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\";\n\ncontract MockToken is ERC20 {\n constructor(string memory name, string memory symbol) ERC20(name, symbol) { }\n\n function mint(address to, uint256 amount) external {\n _mint(to, amount);\n }\n}\n\ncontract LRTOracleMock {\n\n LRTConfig public lrtConfig;\n mapping(address asset => uint256 price) public prices;\n\n constructor(address lrtConfigAddr) {\n lrtConfig = LRTConfig(lrtConfigAddr);\n }\n\n function setAssetPrice(address asset, uint256 amount) external {\n prices[asset] = amount;\n }\n\n function getAssetPrice(address asset) public view returns (uint256) {\n return prices[asset];\n }\n\n function getRSETHPrice() external view returns (uint256 rsETHPrice) {\n address rsETHTokenAddress = lrtConfig.rsETH();\n uint256 rsEthSupply = RSETH(rsETHTokenAddress).totalSupply();\n\n if (rsEthSupply == 0) {\n return 1 ether;\n }\n\n u", "vulnerable_code": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity 0.8.21;\n\nimport { Test } from \"forge-std/Test.sol\";\nimport \"forge-std/console.sol\";\nimport { ERC20 } from \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport { TransparentUpgradeableProxy } from \"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\";\nimport { ProxyAdmin } from \"@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol\";\nimport { LRTConfig, ILRTConfig } from \"src/LRTConfig.sol\";\nimport { RSETH } from \"src/RSETH.sol\";\nimport { LRTDepositPool } from \"src/LRTDepositPool.sol\";\n\nimport { LRTConstants } from \"src/utils/LRTConstants.sol\";\nimport { PausableUpgradeable } from \"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\";\n\ncontract MockToken is ERC20 {\n constructor(string memory name, string memory symbol) ERC20(name, symbol) { }\n\n function mint(address to, uint256 amount) external {\n _mint(to, amount);\n }\n}\n\ncontract LRTOracleMock {\n\n LRTConfig public lrtConfig;\n mapping(address asset => uint256 price) public prices;\n\n constructor(address lrtConfigAddr) {\n lrtConfig = LRTConfig(lrtConfigAddr);\n }\n\n function setAssetPrice(address asset, uint256 amount) external {\n prices[asset] = amount;\n }\n\n function getAssetPrice(address asset) public view returns (uint256) {\n return prices[asset];\n }\n\n function getRSETHPrice() external view returns (uint256 rsETHPrice) {\n address rsETHTokenAddress = lrtConfig.rsETH();\n uint256 rsEthSupply = RSETH(rsETHTokenAddress).totalSupply();\n\n if (rsEthSupply == 0) {\n return 1 ether;\n }\n\n uint256 totalETHInPool;\n address lrtDepositPoolAddr = lrtConfig.getContract(LRTConstants.LRT_DEPOSIT_POOL);\n\n address[] memory supportedAssets = lrtConfig.getSupportedAssetList();\n uint256 supportedAssetCount = supportedAssets.length;\n\n for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n addre", "fixed_code": "Running 1 test for test/BaseTest.t.sol:AuditTests\n[PASS] test_NodeDelegatorLimitCanBeSetToLessThanCurrentAmountOfThem() (gas: 546943)\nTraces:\n [546943] AuditTests::test_NodeDelegatorLimitCanBeSetToLessThanCurrentAmountOfThem()\n \u251c\u2500 [0] VM::startPrank(admin: [0xaA10a84CE7d9AE517a52c6d5cA153b369Af99ecF])\n \u2502 \u2514\u2500 \u2190 ()\n \u251c\u2500 [38891] \u2192 new MockNodeDelegator@0x3Ede3eCa2a72B3aeCC820E955B36f38437D01395\n \u2502 \u2514\u2500 \u2190 194 bytes of code\n \u251c\u2500 [38891] \u2192 new MockNodeDelegator@0x6D9da78B6A5BEdcA287AA5d49613bA36b90c15C4\n \u2502 \u2514\u2500 \u2190 194 bytes of code\n \u251c\u2500 [38891] \u2192 new MockNodeDelegator@0xDDd9A038D57372934f1b9c52bd8621F5ED4268DF\n \u2502 \u2514\u2500 \u2190 194 bytes of code\n \u251c\u2500 [38891] \u2192 new MockNodeDelegator@0x32850cAd1e9170614704fF8BA37a25e498e1B832\n \u2502 \u2514\u2500 \u2190 194 bytes of code\n \u251c\u2500 [38891] \u2192 new MockNodeDelegator@0x1742F7d30605F18f097F356E1EeAfDB5e2FDe33a\n \u2502 \u2514\u2500 \u2190 194 bytes of code\n \u251c\u2500 [167505] TransparentUpgradeableProxy::addNodeDelegatorContractToQueue([0x3Ede3eCa2a72B3aeCC820E955B36f38437D01395, 0x6D9da78B6A5BEdcA287AA5d49613bA36b90c15C4, 0xDDd9A038D57372934f1b9c52bd8621F5ED4268DF, 0x32850cAd1e9170614704fF8BA37a25e498e1B832, 0x1742F7d30605F18f097F356E1EeAfDB5e2FDe33a])\n \u2502 \u251c\u2500 [160380] LRTDepositPool::addNodeDelegatorContractToQueue([0x3Ede3eCa2a72B3aeCC820E955B36f38437D01395, 0x6D9da78B6A5BEdcA287AA5d49613bA36b90c15C4, 0xDDd9A038D57372934f1b9c52bd8621F5ED4268DF, 0x32850cAd1e9170614704fF8BA37a25e498e1B832, 0x1742F7d30605F18f097F356E1EeAfDB5e2FDe33a]) [delegatecall]\n \u2502 \u2502 \u251c\u2500 [9792] TransparentUpgradeableProxy::hasRole(0x0000000000000000000000000000000000000000000000000000000000000000, admin: [0xaA10a84CE7d9AE517a52c6d5cA153b369Af99ecF]) [staticcall]\n \u2502 \u2502 \u2502 \u251c\u2500 [2694] LRTConfig::hasRole(0x0000000000000000000000000000000000000000000000000000000000000000, admin: [0xaA10a84CE7d9AE517a52c6d5cA153b369Af99ecF]) [delegatecall]\n \u2502 \u2502 \u2502 \u2502 \u2514\u2500 \u2190 true\n \u2502 \u2502 \u2502 \u2514\u2500 \u2190 true\n \u2502 \u2502 \u251c\u2500 emit NodeDelegatorAddedinQueue(prospectiveNodeDelegatorContract", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/Draiakoo-Q.md", "collected_at": "2026-01-02T18:27:27.760924+00:00", "source_hash": "e368a61a9953044040e959706f0d07789a7193faf9a7972737f2f9dfec5a37c2", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity 0.8.21;\n\nimport { Test } from \"forge-std/Test.sol\";\nimport \"forge-std/console.sol\";\nimport { ERC20 } from \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport { TransparentUpgradeableProxy } from \"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\";\nimport { ProxyAdmin } from \"@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol\";\nimport { LRTConfig, ILRTConfig } from \"src/LRTConfig.sol\";\nimport { RSETH } from \"src/RSETH.sol\";\nimport { LRTDepositPool } from \"src/LRTDepositPool.sol\";\n\nimport { LRTConstants } from \"src/utils/LRTConstants.sol\";\nimport { PausableUpgradeable } from \"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\";\n\ncontract MockToken is ERC20 {\n constructor(string memory name, string memory symbol) ERC20(name, symbol) { }\n\n function mint(address to, uint256 amount) external {\n _mint(to, amount);\n }\n}\n\ncontract LRTOracleMock {\n\n LRTConfig public lrtConfig;\n mapping(address asset => uint256 price) public prices;\n\n constructor(address lrtConfigAddr) {\n lrtConfig = LRTConfig(lrtConfigAddr);\n }\n\n function setAssetPrice(address asset, uint256 amount) external {\n prices[asset] = amount;\n }\n\n function getAssetPrice(address asset) public view returns (uint256) {\n return prices[asset];\n }\n\n function getRSETHPrice() external view returns (uint256 rsETHPrice) {\n address rsETHTokenAddress = lrtConfig.rsETH();\n uint256 rsEthSupply = RSETH(rsETHTokenAddress).totalSupply();\n\n if (rsEthSupply == 0) {\n return 1 ether;\n }\n\n uint256 totalETHInPool;\n address lrtDepositPoolAddr = lrtConfig.getContract(LRTConstants.LRT_DEPOSIT_POOL);\n\n address[] memory supportedAssets = lrtConfig.getSupportedAssetList();\n uint256 supportedAssetCount = supportedAssets.length;\n\n for (uint16 asset_idx; asset_idx < supportedAssetCount;) {\n addre", "has_vulnerable_code_snippet": true, "fixed_code_actual": "Running 1 test for test/BaseTest.t.sol:AuditTests\n[PASS] test_NodeDelegatorLimitCanBeSetToLessThanCurrentAmountOfThem() (gas: 546943)\nTraces:\n [546943] AuditTests::test_NodeDelegatorLimitCanBeSetToLessThanCurrentAmountOfThem()\n \u251c\u2500 [0] VM::startPrank(admin: [0xaA10a84CE7d9AE517a52c6d5cA153b369Af99ecF])\n \u2502 \u2514\u2500 \u2190 ()\n \u251c\u2500 [38891] \u2192 new MockNodeDelegator@0x3Ede3eCa2a72B3aeCC820E955B36f38437D01395\n \u2502 \u2514\u2500 \u2190 194 bytes of code\n \u251c\u2500 [38891] \u2192 new MockNodeDelegator@0x6D9da78B6A5BEdcA287AA5d49613bA36b90c15C4\n \u2502 \u2514\u2500 \u2190 194 bytes of code\n \u251c\u2500 [38891] \u2192 new MockNodeDelegator@0xDDd9A038D57372934f1b9c52bd8621F5ED4268DF\n \u2502 \u2514\u2500 \u2190 194 bytes of code\n \u251c\u2500 [38891] \u2192 new MockNodeDelegator@0x32850cAd1e9170614704fF8BA37a25e498e1B832\n \u2502 \u2514\u2500 \u2190 194 bytes of code\n \u251c\u2500 [38891] \u2192 new MockNodeDelegator@0x1742F7d30605F18f097F356E1EeAfDB5e2FDe33a\n \u2502 \u2514\u2500 \u2190 194 bytes of code\n \u251c\u2500 [167505] TransparentUpgradeableProxy::addNodeDelegatorContractToQueue([0x3Ede3eCa2a72B3aeCC820E955B36f38437D01395, 0x6D9da78B6A5BEdcA287AA5d49613bA36b90c15C4, 0xDDd9A038D57372934f1b9c52bd8621F5ED4268DF, 0x32850cAd1e9170614704fF8BA37a25e498e1B832, 0x1742F7d30605F18f097F356E1EeAfDB5e2FDe33a])\n \u2502 \u251c\u2500 [160380] LRTDepositPool::addNodeDelegatorContractToQueue([0x3Ede3eCa2a72B3aeCC820E955B36f38437D01395, 0x6D9da78B6A5BEdcA287AA5d49613bA36b90c15C4, 0xDDd9A038D57372934f1b9c52bd8621F5ED4268DF, 0x32850cAd1e9170614704fF8BA37a25e498e1B832, 0x1742F7d30605F18f097F356E1EeAfDB5e2FDe33a]) [delegatecall]\n \u2502 \u2502 \u251c\u2500 [9792] TransparentUpgradeableProxy::hasRole(0x0000000000000000000000000000000000000000000000000000000000000000, admin: [0xaA10a84CE7d9AE517a52c6d5cA153b369Af99ecF]) [staticcall]\n \u2502 \u2502 \u2502 \u251c\u2500 [2694] LRTConfig::hasRole(0x0000000000000000000000000000000000000000000000000000000000000000, admin: [0xaA10a84CE7d9AE517a52c6d5cA153b369Af99ecF]) [delegatecall]\n \u2502 \u2502 \u2502 \u2502 \u2514\u2500 \u2190 true\n \u2502 \u2502 \u2502 \u2514\u2500 \u2190 true\n \u2502 \u2502 \u251c\u2500 emit NodeDelegatorAddedinQueue(prospectiveNodeDelegatorContract", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "02-ai-arena", "title": "0xAnah G", "severity_raw": "High", "severity": "high", "description": "# AI ARENA GAS OPTIMIZATIONS\n\n\n## INTRODUCTION\nHighlighted below are optimizations exclusively targeting state-mutating functions and view/pure functions invoked by state-mutating functions. In the discussion that follows, only runtime gas is emphasized, given its inevitable dominance over deployment gas costs throughout the protocol's lifetime. \n\nPlease be aware that some code snippets may be shortened to conserve space, and certain code snippets may include @audit tags in comments to facilitate issue explanations.\"\n\n\n## [G-01] Same conditional in loop iterations\nSome conditionals in the loop do not depend on the loop's iterations. Having to evaluate this condition for every iteration of the loop is gas consuming and redundant rather the conditional should be evaluated before the loop, the result saved to a variable and the variable be used in the loop.\n\n### 1 Instance\n1. #### `iconsType == 2`, `iconsType > 0` and `iconsType == 3` conditionals do not depend on the loop iterations\n- https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/AiArenaHelper.sol#L110-#L104\n\nIn the `AiArenaHelper.createPhysicalAttributes()` function as shown below the conditions `iconsType == 2`, `iconsType > 0` and `iconsType == 3` were checked for every iteration of the loop but these conditionals do not depend on the loop iterations. We can make the function more gas efficient by evaluating these conditionals before the loop then save the result to their respective variable then these variables be used in the loop. The diff below shows how the code could be refactored:\n\n```solidity\nfile: src/AiArenaHelper.sol\n\n83: function createPhysicalAttributes(\n84: uint256 dna, \n85: uint8 generation, \n86: uint8 iconsType, \n87: bool dendroidBool\n88: ) \n89: external \n90: view \n91: returns (FighterOps.FighterPhysicalAttributes memory) \n92: {\n93: if (dendroidBool) {\n94: return FighterOps.FighterPhysicalAttributes", "vulnerable_code": "file: src/AiArenaHelper.sol\n\n83: function createPhysicalAttributes(\n84: uint256 dna, \n85: uint8 generation, \n86: uint8 iconsType, \n87: bool dendroidBool\n88: ) \n89: external \n90: view \n91: returns (FighterOps.FighterPhysicalAttributes memory) \n92: {\n93: if (dendroidBool) {\n94: return FighterOps.FighterPhysicalAttributes(99, 99, 99, 99, 99, 99);\n95: } else {\n96: uint256[] memory finalAttributeProbabilityIndexes = new uint[](attributes.length);\n97: \n98: uint256 attributesLength = attributes.length;\n99: for (uint8 i = 0; i < attributesLength; i++) {\n100: if (\n101: i == 0 && iconsType == 2 || // Custom icons head (beta helmet)\n102: i == 1 && iconsType > 0 || // Custom icons eyes (red diamond)\n103: i == 4 && iconsType == 3 // Custom icons hands (bowling ball)\n104: ) {\n105: finalAttributeProbabilityIndexes[i] = 50;\n106: } else {\n107: uint256 rarityRank = (dna / attributeToDnaDivisor[attributes[i]]) % 100;\n108: uint256 attributeIndex = dnaToIndex(generation, rarityRank, attributes[i]);\n109: finalAttributeProbabilityIndexes[i] = attributeIndex;\n110: }\n111: }\n112: return FighterOps.FighterPhysicalAttributes(\n113: finalAttributeProbabilityIndexes[0],\n114: finalAttributeProbabilityIndexes[1],\n115: finalAttributeProbabilityIndexes[2],\n116: finalAttributeProbabilityIndexes[3],\n117: finalAttributeProbabilityIndexes[4],\n118: finalAttributeProbabilityIndexes[5]\n119: );\n120: }\n121: }", "fixed_code": "## [G-02] Redundant state variable getters\nGetters for public state variables are automatically generated so there is no need to code\nthem manually and lose gas.\n\n### Instances\n1. #### Make `attributeProbabilities` mapping variable `private` or `internal` since a getter function was defined for it.\n- https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/AiArenaHelper.sol#L30\n\nThe solidity compiler would automatically create a getter function for the `attributeProbabilities` mapping since it is declared as a `public` variable but a getter function `getAttributeProbabilities()` was also declared in the contract for the same variable thereby making it two getter functions for the same variable in the contract. We could rectify this issue by making the `mapUnits` variable private or internal (if the variable is to be inherited). The diff below shows how the code could be refactored:\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/0xAnah-G.md", "collected_at": "2026-01-02T19:01:59.264299+00:00", "source_hash": "e36c1dea8ab18d66b911861f36744c570198262c93496d088455577f5d700147", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "AiArenaHelper.sol#L110, AiArenaHelper.sol#L30", "github_files_list": "AiArenaHelper.sol", "github_refs_count": 2, "vulnerable_code_actual": "file: src/AiArenaHelper.sol\n\n83: function createPhysicalAttributes(\n84: uint256 dna, \n85: uint8 generation, \n86: uint8 iconsType, \n87: bool dendroidBool\n88: ) \n89: external \n90: view \n91: returns (FighterOps.FighterPhysicalAttributes memory) \n92: {\n93: if (dendroidBool) {\n94: return FighterOps.FighterPhysicalAttributes(99, 99, 99, 99, 99, 99);\n95: } else {\n96: uint256[] memory finalAttributeProbabilityIndexes = new uint[](attributes.length);\n97: \n98: uint256 attributesLength = attributes.length;\n99: for (uint8 i = 0; i < attributesLength; i++) {\n100: if (\n101: i == 0 && iconsType == 2 || // Custom icons head (beta helmet)\n102: i == 1 && iconsType > 0 || // Custom icons eyes (red diamond)\n103: i == 4 && iconsType == 3 // Custom icons hands (bowling ball)\n104: ) {\n105: finalAttributeProbabilityIndexes[i] = 50;\n106: } else {\n107: uint256 rarityRank = (dna / attributeToDnaDivisor[attributes[i]]) % 100;\n108: uint256 attributeIndex = dnaToIndex(generation, rarityRank, attributes[i]);\n109: finalAttributeProbabilityIndexes[i] = attributeIndex;\n110: }\n111: }\n112: return FighterOps.FighterPhysicalAttributes(\n113: finalAttributeProbabilityIndexes[0],\n114: finalAttributeProbabilityIndexes[1],\n115: finalAttributeProbabilityIndexes[2],\n116: finalAttributeProbabilityIndexes[3],\n117: finalAttributeProbabilityIndexes[4],\n118: finalAttributeProbabilityIndexes[5]\n119: );\n120: }\n121: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## [G-02] Redundant state variable getters\nGetters for public state variables are automatically generated so there is no need to code\nthem manually and lose gas.\n\n### Instances\n1. #### Make `attributeProbabilities` mapping variable `private` or `internal` since a getter function was defined for it.\n- https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/AiArenaHelper.sol#L30\n\nThe solidity compiler would automatically create a getter function for the `attributeProbabilities` mapping since it is declared as a `public` variable but a getter function `getAttributeProbabilities()` was also declared in the contract for the same variable thereby making it two getter functions for the same variable in the contract. We could rectify this issue by making the `mapUnits` variable private or internal (if the variable is to be inherited). The diff below shows how the code could be refactored:\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "02-ethos", "title": "emmac002 G", "severity_raw": "High", "severity": "high", "description": "# Report\n\n\n## Gas Optimizations\n\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [GAS-1] | += COSTS MORE GAS THAN = + FOR STATE VARIABLES | 8 |\n| [GAS-2] | USING UNCHECKED BLOCKS TO SAVE GAS | 6 |\n| [GAS-3] | DUPLICATED REQUIRE()/REVERT() CHECKS SHOULD BE REFACTORED TO A MODIFIER OR FUNCTION | 6 |\n| [GAS-4] | SPLITTING REQUIRE() STATEMENTS THAT USE && SAVES GAS | 4 |\n| [GAS-5] | PUBLIC FUNCTIONS NOT CALLED BY THE CONTRACT SHOULD BE DECLARED EXTERNAL INSTEAD | 2 |\n| [GAS-6] | INTERNAL FUNCTIONS NOT CALLED BY THE CONTRACT SHOULD BE REMOVED TO SAVE DEPLOYMENT GAS | 1 |\n| [GAS-7] | FUNCTIONS GUARANTEED TO REVERT WHEN CALLED BY NORMAL USERS CAN BE MARKED PAYABLE | 12 |\n| [GAS-8] | EXPRESSIONS FOR CONSTANT VALUES SUCH AS A CALL TO KECCAK256(), SHOULD USE IMMUTABLE RATHER THAN CONSTANT | 8 |\n| [GAS-9] | USING BOOLS FOR STORAGE INCURS OVERHEAD | 3 |\n| [GAS-10] | STACK VARIABLE USED AS A CHEAPER CACHE FOR A STATE VARIABLE IS ONLY USED ONCE | 1 |\n| [GAS-11] | CACHE ARRAY LENGTH OUTSIDE OF LOOP | 7 |\n| [GAS-12] | USE ASSEMBLY TO CHECK FOR ADDRESS(0) | 6 |\n| [GAS-13] | USAGE OF UINT/INT SMALLER THAN 32 BYTES (256 BITS) INCURS OVERHEAD | 5 |\n| [GAS-14] | EMPTY BLOCKS SHOULD BE REMOVED OR EMIT SOMETHING | 2 |\n| [GAS-15] | USE CONSTANTS FOR VARIABLES WHOSE VALUE IS KNOWN BEFOREHAND AND IS NEVER CHANGED | 1 |\n| [GAS-16] | STATE VARIABLES SHOULD BE CACHED IN STACK VARIABLES RATHER THAN RE-READING THEM FROM STORAGE | 3 |\n\n### [GAS-1] += COSTS MORE GAS THAN = + FOR STATE VARIABLES\n\n*Instances (8)*:\n#### Proof of Concept\n```solidity\nFile: Ethos-Vault/contracts/ReaperVaultV2.sol\n\n168: totalAllocBPS += _allocBPS;\n196: totalAllocBPS += _allocBPS;\n391: totalLoss += loss; \n450: stratParams.losses += loss;\n505: strategy.gains += vars.gain;\n520: strategy.allocated += vars.credit;\n521: totalAllocated += vars.credit;\n```\nhttps://github.com/code-423n4/2023", "vulnerable_code": "File: Ethos-Vault/contracts/ReaperVaultV2.sol\n\n168: totalAllocBPS += _allocBPS;\n196: totalAllocBPS += _allocBPS;\n391: totalLoss += loss; \n450: stratParams.losses += loss;\n505: strategy.gains += vars.gain;\n520: strategy.allocated += vars.credit;\n521: totalAllocated += vars.credit;", "fixed_code": "File: Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol\n\n133: toFree += profit;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/emmac002-G.md", "collected_at": "2026-01-02T18:17:07.824997+00:00", "source_hash": "e37262243e77d97ffa93606c3f32095bb08dfc1ef1b36c6e7afd5956f2f7bdc9", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 395, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: Ethos-Vault/contracts/ReaperVaultV2.sol\n\n168: totalAllocBPS += _allocBPS;\n196: totalAllocBPS += _allocBPS;\n391: totalLoss += loss; \n450: stratParams.losses += loss;\n505: strategy.gains += vars.gain;\n520: strategy.allocated += vars.credit;\n521: totalAllocated += vars.credit;", "primary_code_language": "solidity", "primary_code_char_count": 395, "all_code_blocks": "// Code block 1 (solidity):\nFile: Ethos-Vault/contracts/ReaperVaultV2.sol\n\n168: totalAllocBPS += _allocBPS;\n196: totalAllocBPS += _allocBPS;\n391: totalLoss += loss; \n450: stratParams.losses += loss;\n505: strategy.gains += vars.gain;\n520: strategy.allocated += vars.credit;\n521: totalAllocated += vars.credit;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: Ethos-Vault/contracts/ReaperVaultV2.sol\n\n168: totalAllocBPS += _allocBPS;\n196: totalAllocBPS += _allocBPS;\n391: totalLoss += loss; \n450: stratParams.losses += loss;\n505: strategy.gains += vars.gain;\n520: strategy.allocated += vars.credit;\n521: totalAllocated += vars.credit;", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: Ethos-Vault/contracts/ReaperVaultV2.sol\n\n168: totalAllocBPS += _allocBPS;\n196: totalAllocBPS += _allocBPS;\n391: totalLoss += loss; \n450: stratParams.losses += loss;\n505: strategy.gains += vars.gain;\n520: strategy.allocated += vars.credit;\n521: totalAllocated += vars.credit;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol\n\n133: toFree += profit;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "09-ondo", "title": "ohm Q", "severity_raw": "Medium", "severity": "medium", "description": "## ACCOUNT ADDRESS WILL NOT BE ZERO \n\n```\n function _burnShares(\n address _account,\n uint256 _sharesAmount\n ) internal whenNotPaused returns (uint256) {\n require(_account != address(0), \"BURN_FROM_THE_ZERO_ADDRESS\");\n\n _beforeTokenTransfer(_account, address(0), _sharesAmount);\n\n uint256 accountShares = shares[_account];\n require(_sharesAmount <= accountShares, \"BURN_AMOUNT_EXCEEDS_BALANCE\");\n\n uint256 preRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\n totalShares -= _sharesAmount;\n\n shares[_account] = accountShares - _sharesAmount;\n\n // ISSUE ----> = postRebaseTokenAmount is not getting the post rusdy tokens\n //Because _sharesAmount is not updating.\n\n uint256 postRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n```\nIn the above function there is no possibility of becoming the address is 0.So we can avoid the require statement .\n```\n require(_account != address(0), \"BURN_FROM_THE_ZERO_ADDRESS\");\n```", "vulnerable_code": " function _burnShares(\n address _account,\n uint256 _sharesAmount\n ) internal whenNotPaused returns (uint256) {\n require(_account != address(0), \"BURN_FROM_THE_ZERO_ADDRESS\");\n\n _beforeTokenTransfer(_account, address(0), _sharesAmount);\n\n uint256 accountShares = shares[_account];\n require(_sharesAmount <= accountShares, \"BURN_AMOUNT_EXCEEDS_BALANCE\");\n\n uint256 preRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\n totalShares -= _sharesAmount;\n\n shares[_account] = accountShares - _sharesAmount;\n\n // ISSUE ----> = postRebaseTokenAmount is not getting the post rusdy tokens\n //Because _sharesAmount is not updating.\n\n uint256 postRebaseTokenAmount = getRUSDYByShares(_sharesAmount);", "fixed_code": " require(_account != address(0), \"BURN_FROM_THE_ZERO_ADDRESS\");", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/ohm-Q.md", "collected_at": "2026-01-02T18:26:10.863009+00:00", "source_hash": "e3b9bf479406a8966c8c164619cf8cb4403c4b2f184c41e6629d3fd3b0ebda50", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 788, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _burnShares(\n address _account,\n uint256 _sharesAmount\n ) internal whenNotPaused returns (uint256) {\n require(_account != address(0), \"BURN_FROM_THE_ZERO_ADDRESS\");\n\n _beforeTokenTransfer(_account, address(0), _sharesAmount);\n\n uint256 accountShares = shares[_account];\n require(_sharesAmount <= accountShares, \"BURN_AMOUNT_EXCEEDS_BALANCE\");\n\n uint256 preRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\n totalShares -= _sharesAmount;\n\n shares[_account] = accountShares - _sharesAmount;\n\n // ISSUE ----> = postRebaseTokenAmount is not getting the post rusdy tokens\n //Because _sharesAmount is not updating.\n\n uint256 postRebaseTokenAmount = getRUSDYByShares(_sharesAmount);", "primary_code_language": "unknown", "primary_code_char_count": 726, "all_code_blocks": "// Code block 1 (unknown):\nfunction _burnShares(\n address _account,\n uint256 _sharesAmount\n ) internal whenNotPaused returns (uint256) {\n require(_account != address(0), \"BURN_FROM_THE_ZERO_ADDRESS\");\n\n _beforeTokenTransfer(_account, address(0), _sharesAmount);\n\n uint256 accountShares = shares[_account];\n require(_sharesAmount <= accountShares, \"BURN_AMOUNT_EXCEEDS_BALANCE\");\n\n uint256 preRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\n totalShares -= _sharesAmount;\n\n shares[_account] = accountShares - _sharesAmount;\n\n // ISSUE ----> = postRebaseTokenAmount is not getting the post rusdy tokens\n //Because _sharesAmount is not updating.\n\n uint256 postRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\n// Code block 2 (unknown):\nrequire(_account != address(0), \"BURN_FROM_THE_ZERO_ADDRESS\");", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function _burnShares(\n address _account,\n uint256 _sharesAmount\n ) internal whenNotPaused returns (uint256) {\n require(_account != address(0), \"BURN_FROM_THE_ZERO_ADDRESS\");\n\n _beforeTokenTransfer(_account, address(0), _sharesAmount);\n\n uint256 accountShares = shares[_account];\n require(_sharesAmount <= accountShares, \"BURN_AMOUNT_EXCEEDS_BALANCE\");\n\n uint256 preRebaseTokenAmount = getRUSDYByShares(_sharesAmount);\n\n totalShares -= _sharesAmount;\n\n shares[_account] = accountShares - _sharesAmount;\n\n // ISSUE ----> = postRebaseTokenAmount is not getting the post rusdy tokens\n //Because _sharesAmount is not updating.\n\n uint256 postRebaseTokenAmount = getRUSDYByShares(_sharesAmount);", "has_vulnerable_code_snippet": true, "fixed_code_actual": " require(_account != address(0), \"BURN_FROM_THE_ZERO_ADDRESS\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5.93} {"source": "c4", "protocol": "01-ondo", "title": "codeislight Q", "severity_raw": "Low", "severity": "low", "description": "1. unecessary check for zero amount in CashManager._checkAndUpdateRedeemLimit(uint256)\n```\n if (amount == 0) {\n revert RedeemAmountCannotBeZero();\n }\n```\nin this case there is a check for zero amount which is followed by:\n```\n if (amount > redeemLimit - currentRedeemAmount) {\n revert RedeemExceedsRateLimit();\n }\n```\nwe can notice that the least value possible for the right side of \">\" operator is 0, which always would ensure that `amount` is greater than zero. therefore, we can safely remove the revert check for zero amount.\n2. check for address code size to be greater than zero, when a function has a contract address parameter.\n3. using unchecked in for loops ++i\nin CashManager:\n772: for (uint256 i = 0; i < size; ++i) {\n814: for (uint256 i = 0; i < size; ++i) {\n973: for (uint256 i = 0; i < size; ++i) {\n999: for (uint256 i = 0; i < exCallData.length; ++i) {\nin CashFactory:\n127: for (uint256 i = 0; i < exCallData.length; ++i) {\nin CashKYCSenderReceiverFactory:\n137: for (uint256 i = 0; i < exCallData.length; ++i) {\nin CashKYCSenderFactory:\n137: for (uint256 i = 0; i < exCallData.length; ++i) {\nin KYCRegistry:\n163: for (uint256 i = 0; i < length; i++) {\n180: for (uint256 i = 0; i < length; i++) {\nand in other instances ...", "vulnerable_code": " if (amount == 0) {\n revert RedeemAmountCannotBeZero();\n }", "fixed_code": " if (amount > redeemLimit - currentRedeemAmount) {\n revert RedeemExceedsRateLimit();\n }", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/codeislight-Q.md", "collected_at": "2026-01-02T18:15:01.877269+00:00", "source_hash": "e3ccb963cd27718a84fc635331fe128e5e1b2e196a4ef7e0036545b1b25722d1", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 177, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "if (amount == 0) {\n revert RedeemAmountCannotBeZero();\n }", "primary_code_language": "unknown", "primary_code_char_count": 75, "all_code_blocks": "// Code block 1 (unknown):\nif (amount == 0) {\n revert RedeemAmountCannotBeZero();\n }\n\n// Code block 2 (unknown):\nif (amount > redeemLimit - currentRedeemAmount) {\n revert RedeemExceedsRateLimit();\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " if (amount == 0) {\n revert RedeemAmountCannotBeZero();\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " if (amount > redeemLimit - currentRedeemAmount) {\n revert RedeemExceedsRateLimit();\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6.7} {"source": "c4", "protocol": "09-ondo", "title": "MohammedRizwan Q", "severity_raw": "Medium", "severity": "medium", "description": "## Summary\n\n### Low Risk Issues\n|Number|Issue|Instances| |\n|-|:-|:-:|:-:|\n| [L‑01] | The contracts has used outdated version of openzeppelin library | contracts |\n| [L‑02] | stale or misleading comment in `rUSDYFactory.sol` | 1 |\n| [L‑03] | Multicall being payable is seriously dangerous | 1 |\n| [L‑04] | Calls inside loops that may address DoS | 1 |\n\n### [L‑01] The contracts has used outdated version of openzeppelin library\nFrom package.json, It is confirmed that the contracts has used `\"@openzeppelin/contracts\": \"^4.8.3\",` which is an old version and has security issues. While using external libraries, Ensure it is of latest version.\n\n### Recommended Mitigation steps\nUpdate the openzeppelin version to v4.9.3\n\n### [L‑02] stale or misleading comment in `rUSDYFactory.sol`\nIn `rUSDYFactory.sol`, There is misleading or stale comment. When asked about it sponsor made it stale Natspec.\n\n```\n ii) Revoke the `MINTER_ROLE`, `PAUSER_ROLE` & `DEFAULT_ADMIN_ROLE` from address(this).\n```\n\n### Recommended Mitigation steps\nRemove the stale Natspec which are no longer needed in contract to prevent misleading.\n\n### [L‑03] `multiexcall()` being payable is seriously dangerous\nIn `rUSDYFactory.sol`, `multiexcall()` allows for arbitrary batched calls but it is made payable which will cause issues since `address(exCallData[i].target).call` is in a loop, it is not advisable to add payable to the existing call(). This is because msg.value may be used multiple times. \n\nThere is [1 instance](https://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDYFactory.sol#L126-L137) of this issue:\n\n```Solidity\nFile: contracts/usdy/rUSDYFactory.sol\n\n function multiexcall(\n ExCallData[] calldata exCallData\n ) external payable override onlyGuardian returns (bytes[] memory results) {\n results = new bytes[](exCallData.length);\n for (uint256 i = 0; i < exCallData.length; ++i) {\n (bool", "vulnerable_code": " ii) Revoke the `MINTER_ROLE`, `PAUSER_ROLE` & `DEFAULT_ADMIN_ROLE` from address(this).", "fixed_code": "File: contracts/usdy/rUSDYFactory.sol\n\n function multiexcall(\n ExCallData[] calldata exCallData\n ) external payable override onlyGuardian returns (bytes[] memory results) {\n results = new bytes[](exCallData.length);\n for (uint256 i = 0; i < exCallData.length; ++i) {\n (bool success, bytes memory ret) = address(exCallData[i].target).call{\n value: exCallData[i].value\n }(exCallData[i].data);\n require(success, \"Call Failed\");\n results[i] = ret;\n }\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/MohammedRizwan-Q.md", "collected_at": "2026-01-02T18:25:37.641042+00:00", "source_hash": "e3ccc9d8ed4b83310754cf2b7cfb63cead1cf8b9cd4ea3a32632db02d8c48831", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 86, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "ii) Revoke the `MINTER_ROLE`, `PAUSER_ROLE` & `DEFAULT_ADMIN_ROLE` from address(this).", "primary_code_language": "unknown", "primary_code_char_count": 86, "all_code_blocks": "// Code block 1 (unknown):\nii) Revoke the `MINTER_ROLE`, `PAUSER_ROLE` & `DEFAULT_ADMIN_ROLE` from address(this).", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "rUSDYFactory.sol#L126-L137", "github_files_list": "rUSDYFactory.sol", "github_refs_count": 1, "vulnerable_code_actual": " ii) Revoke the `MINTER_ROLE`, `PAUSER_ROLE` & `DEFAULT_ADMIN_ROLE` from address(this).", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/usdy/rUSDYFactory.sol\n\n function multiexcall(\n ExCallData[] calldata exCallData\n ) external payable override onlyGuardian returns (bytes[] memory results) {\n results = new bytes[](exCallData.length);\n for (uint256 i = 0; i < exCallData.length; ++i) {\n (bool success, bytes memory ret) = address(exCallData[i].target).call{\n value: exCallData[i].value\n }(exCallData[i].data);\n require(success, \"Call Failed\");\n results[i] = ret;\n }\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "09-ondo", "title": "Topmark G", "severity_raw": "Low", "severity": "low", "description": "## Report 1\nThe need to loop through t.approvers from the code below at every new approver update would take excess gas, using mapping is a better alternative than array, adjusting it in the whole code base now might takes extra effort but considering it might be worth it as mapping is more gas efficient\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/DestinationBridge.sol#L160\n```solidity\n function _approve(bytes32 txnHash) internal {\n // Check that the approver has not already approved\n TxnThreshold storage t = txnToThresholdSet[txnHash];\n if (t.approvers.length > 0) {\n ----> for (uint256 i = 0; i < t.approvers.length; ++i) {\n if (t.approvers[i] == msg.sender) {\n revert AlreadyApproved();\n }\n }\n }\n t.approvers.push(msg.sender);\n }\n```\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/DestinationBridge.sol#L376\n```solidity\n struct TxnThreshold {\n uint256 numberOfApprovalsNeeded;\n +++ (address => bool) approvers;\n --- address[] approvers;\n }\n```", "vulnerable_code": " function _approve(bytes32 txnHash) internal {\n // Check that the approver has not already approved\n TxnThreshold storage t = txnToThresholdSet[txnHash];\n if (t.approvers.length > 0) {\n ----> for (uint256 i = 0; i < t.approvers.length; ++i) {\n if (t.approvers[i] == msg.sender) {\n revert AlreadyApproved();\n }\n }\n }\n t.approvers.push(msg.sender);\n }", "fixed_code": " struct TxnThreshold {\n uint256 numberOfApprovalsNeeded;\n +++ (address => bool) approvers;\n --- address[] approvers;\n }", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/Topmark-G.md", "collected_at": "2026-01-02T18:25:43.076818+00:00", "source_hash": "e3d79707f391a22fd0126101f0134d865eee9629420cef945ec89ea555061533", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 518, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _approve(bytes32 txnHash) internal {\n // Check that the approver has not already approved\n TxnThreshold storage t = txnToThresholdSet[txnHash];\n if (t.approvers.length > 0) {\n ----> for (uint256 i = 0; i < t.approvers.length; ++i) {\n if (t.approvers[i] == msg.sender) {\n revert AlreadyApproved();\n }\n }\n }\n t.approvers.push(msg.sender);\n }", "primary_code_language": "solidity", "primary_code_char_count": 396, "all_code_blocks": "// Code block 1 (solidity):\nfunction _approve(bytes32 txnHash) internal {\n // Check that the approver has not already approved\n TxnThreshold storage t = txnToThresholdSet[txnHash];\n if (t.approvers.length > 0) {\n ----> for (uint256 i = 0; i < t.approvers.length; ++i) {\n if (t.approvers[i] == msg.sender) {\n revert AlreadyApproved();\n }\n }\n }\n t.approvers.push(msg.sender);\n }\n\n// Code block 2 (solidity):\nstruct TxnThreshold {\n uint256 numberOfApprovalsNeeded;\n +++ (address => bool) approvers;\n --- address[] approvers;\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function _approve(bytes32 txnHash) internal {\n // Check that the approver has not already approved\n TxnThreshold storage t = txnToThresholdSet[txnHash];\n if (t.approvers.length > 0) {\n ----> for (uint256 i = 0; i < t.approvers.length; ++i) {\n if (t.approvers[i] == msg.sender) {\n revert AlreadyApproved();\n }\n }\n }\n t.approvers.push(msg.sender);\n }\n\nstruct TxnThreshold {\n uint256 numberOfApprovalsNeeded;\n +++ (address => bool) approvers;\n --- address[] approvers;\n }", "github_refs_formatted": "DestinationBridge.sol#L160, DestinationBridge.sol#L376", "github_files_list": "DestinationBridge.sol", "github_refs_count": 2, "vulnerable_code_actual": " function _approve(bytes32 txnHash) internal {\n // Check that the approver has not already approved\n TxnThreshold storage t = txnToThresholdSet[txnHash];\n if (t.approvers.length > 0) {\n ----> for (uint256 i = 0; i < t.approvers.length; ++i) {\n if (t.approvers[i] == msg.sender) {\n revert AlreadyApproved();\n }\n }\n }\n t.approvers.push(msg.sender);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " struct TxnThreshold {\n uint256 numberOfApprovalsNeeded;\n +++ (address => bool) approvers;\n --- address[] approvers;\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7.11} {"source": "c4", "protocol": "10-badger", "title": "tabriz G", "severity_raw": "Low", "severity": "low", "description": "## [GAS-1] Splitting require() statements that use && saves gas\n\n```\n require(\n recoveredAddress != address(0) && recoveredAddress == _borrower,\n \"BorrowerOperations: Invalid signature\"\n );\n```\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/BorrowerOperations.sol#L734C8-L737C11\n\n```\n require(\n _maxFeePercentage >= redemptionFeeFloor && _maxFeePercentage <= DECIMAL_PRECISION,\n \"Max fee percentage must be between redemption fee floor and 100%\"\n );\n```\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/CdpManager.sol#L762C8-L765C11\n\n```\n require(\n closedStatus != Status.nonExistent && closedStatus != Status.active,\n \"CdpManagerStorage: close non-exist or non-active CDP!\"\n );\n```\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/CdpManagerStorage.sol#L261C8-L264C11\n\n```\n require(\n cdpStatus != Status.nonExistent && cdpStatus != Status.active,\n \"CdpManagerStorage: remove non-exist or non-active CDP!\"\n );\n\n```\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/CdpManagerStorage.sol#L466C7-L470C1\n\n```\n require(\n CdpOwnersArrayLength > 1 && sortedCdps.getSize() > 1,\n \"CdpManager: Only one cdp in the system\"\n );\n```\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/CdpManagerStorage.sol#L653C7-L656C11\n\n```\n require(\n _recipient != address(0) && _recipient != address(this),\n \"EBTC: Cannot transfer tokens directly to the EBTC token contract or the zero address\"\n );\n require(\n _recipient != cdpManagerAddress && _recipient != borrowerOperationsAddress,\n \"EBTC: Cannot transfer tokens directly to the CdpManager or BorrowerOps\"\n );\n```\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contrac", "vulnerable_code": " require(\n recoveredAddress != address(0) && recoveredAddress == _borrower,\n \"BorrowerOperations: Invalid signature\"\n );", "fixed_code": " require(\n _maxFeePercentage >= redemptionFeeFloor && _maxFeePercentage <= DECIMAL_PRECISION,\n \"Max fee percentage must be between redemption fee floor and 100%\"\n );", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/tabriz-G.md", "collected_at": "2026-01-02T18:27:03.191859+00:00", "source_hash": "e3da1de4e4d503c90e4f319922a3c6e4ce7d980e2635cbe0e73405b3541890f2", "code_block_count": 6, "solidity_block_count": 0, "total_code_chars": 1198, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "require(\n recoveredAddress != address(0) && recoveredAddress == _borrower,\n \"BorrowerOperations: Invalid signature\"\n );", "primary_code_language": "unknown", "primary_code_char_count": 148, "all_code_blocks": "// Code block 1 (unknown):\nrequire(\n recoveredAddress != address(0) && recoveredAddress == _borrower,\n \"BorrowerOperations: Invalid signature\"\n );\n\n// Code block 2 (unknown):\nrequire(\n _maxFeePercentage >= redemptionFeeFloor && _maxFeePercentage <= DECIMAL_PRECISION,\n \"Max fee percentage must be between redemption fee floor and 100%\"\n );\n\n// Code block 3 (unknown):\nrequire(\n closedStatus != Status.nonExistent && closedStatus != Status.active,\n \"CdpManagerStorage: close non-exist or non-active CDP!\"\n );\n\n// Code block 4 (unknown):\nrequire(\n cdpStatus != Status.nonExistent && cdpStatus != Status.active,\n \"CdpManagerStorage: remove non-exist or non-active CDP!\"\n );\n\n// Code block 5 (unknown):\nrequire(\n CdpOwnersArrayLength > 1 && sortedCdps.getSize() > 1,\n \"CdpManager: Only one cdp in the system\"\n );\n\n// Code block 6 (unknown):\nrequire(\n _recipient != address(0) && _recipient != address(this),\n \"EBTC: Cannot transfer tokens directly to the EBTC token contract or the zero address\"\n );\n require(\n _recipient != cdpManagerAddress && _recipient != borrowerOperationsAddress,\n \"EBTC: Cannot transfer tokens directly to the CdpManager or BorrowerOps\"\n );", "all_code_blocks_count": 6, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "BorrowerOperations.sol#L734-L8, CdpManager.sol#L762-L8, CdpManagerStorage.sol#L261-L8, CdpManagerStorage.sol#L466-L7, CdpManagerStorage.sol#L653-L7", "github_files_list": "BorrowerOperations.sol, CdpManager.sol, CdpManagerStorage.sol", "github_refs_count": 5, "vulnerable_code_actual": " require(\n recoveredAddress != address(0) && recoveredAddress == _borrower,\n \"BorrowerOperations: Invalid signature\"\n );", "has_vulnerable_code_snippet": true, "fixed_code_actual": " require(\n _maxFeePercentage >= redemptionFeeFloor && _maxFeePercentage <= DECIMAL_PRECISION,\n \"Max fee percentage must be between redemption fee floor and 100%\"\n );", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 12} {"source": "c4", "protocol": "01-biconomy", "title": "Timenov G", "severity_raw": "Low", "severity": "low", "description": "# Biconomy gas optimization report by Timenov\n\n## Summary\nG-01 Using `> 0` costs more gas than using `!= 0`\nG-02 Using `i++` costs more gas than using `++i`. Also can add `unchecked { ++i; }` in for loops where overflow is not possible\nG-03 Using `x += y` costs more gas than using `x = x + y`\n\n### [G-01] Using `> 0` costs more gas than using `!= 0`\n*There are 12 instances of this issue.*\n\n```solidity\nFile: contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol\n\n174: if (callData.length > 0)\n178: if (result.length > 0)\n212: if (paymasterAndData.length > 0)\n452: if (context.length > 0)\n```\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol\n\n```solidity\nFile: contracts/smart-contract-wallet/aa-4337/core/StakeManager.sol\n\n61: require(_unstakeDelaySec > 0, \"must specify unstake delay\")\n64: require(stake > 0, \"no stake specified\")\n99: require(stake > 0, \"No stake to withdraw\")\n100: require(info.withdrawTime > 0, \"must call unlockStake() first\")\n```\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/StakeManager.sol\n\n```solidity\nFile: contracts/smart-contract-wallet/aa-4337/samples/SimpleAccountFactory.sol\n\n31: if (codeSize > 0)\n```\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/samples/SimpleAccountFactory.sol\n\n```solidity\nFile: contracts/smart-contract-wallet/aa-4337/samples/TestAggregatedAccountFactory.sol\n\n30: if (codeSize > 0)\n```\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/samples/TestAggregatedAccountFactory.sol\n\n```solidity\nFile: contracts/smart-contract-wallet/SmartAccount.sol\n\n236: if (refundInfo.gasPrice > 0)\n```\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n\n```solidity\nFile: contracts/smart-contract-wallet/", "vulnerable_code": "File: contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol\n\n174: if (callData.length > 0)\n178: if (result.length > 0)\n212: if (paymasterAndData.length > 0)\n452: if (context.length > 0)", "fixed_code": "File: contracts/smart-contract-wallet/aa-4337/core/StakeManager.sol\n\n61: require(_unstakeDelaySec > 0, \"must specify unstake delay\")\n64: require(stake > 0, \"no stake specified\")\n99: require(stake > 0, \"No stake to withdraw\")\n100: require(info.withdrawTime > 0, \"must call unlockStake() first\")", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/Timenov-G.md", "collected_at": "2026-01-02T18:13:22.867366+00:00", "source_hash": "e3de0fef10d0b8df116e3a4bd5cfa8aba09d661af5d81a7dae4d2b106e0d2f89", "code_block_count": 5, "solidity_block_count": 5, "total_code_chars": 783, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol\n\n174: if (callData.length > 0)\n178: if (result.length > 0)\n212: if (paymasterAndData.length > 0)\n452: if (context.length > 0)", "primary_code_language": "solidity", "primary_code_char_count": 191, "all_code_blocks": "// Code block 1 (solidity):\nFile: contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol\n\n174: if (callData.length > 0)\n178: if (result.length > 0)\n212: if (paymasterAndData.length > 0)\n452: if (context.length > 0)\n\n// Code block 2 (solidity):\nFile: contracts/smart-contract-wallet/aa-4337/core/StakeManager.sol\n\n61: require(_unstakeDelaySec > 0, \"must specify unstake delay\")\n64: require(stake > 0, \"no stake specified\")\n99: require(stake > 0, \"No stake to withdraw\")\n100: require(info.withdrawTime > 0, \"must call unlockStake() first\")\n\n// Code block 3 (solidity):\nFile: contracts/smart-contract-wallet/aa-4337/samples/SimpleAccountFactory.sol\n\n31: if (codeSize > 0)\n\n// Code block 4 (solidity):\nFile: contracts/smart-contract-wallet/aa-4337/samples/TestAggregatedAccountFactory.sol\n\n30: if (codeSize > 0)\n\n// Code block 5 (solidity):\nFile: contracts/smart-contract-wallet/SmartAccount.sol\n\n236: if (refundInfo.gasPrice > 0)", "all_code_blocks_count": 5, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol\n\n174: if (callData.length > 0)\n178: if (result.length > 0)\n212: if (paymasterAndData.length > 0)\n452: if (context.length > 0)\n\nFile: contracts/smart-contract-wallet/aa-4337/core/StakeManager.sol\n\n61: require(_unstakeDelaySec > 0, \"must specify unstake delay\")\n64: require(stake > 0, \"no stake specified\")\n99: require(stake > 0, \"No stake to withdraw\")\n100: require(info.withdrawTime > 0, \"must call unlockStake() first\")\n\nFile: contracts/smart-contract-wallet/aa-4337/samples/SimpleAccountFactory.sol\n\n31: if (codeSize > 0)\n\nFile: contracts/smart-contract-wallet/aa-4337/samples/TestAggregatedAccountFactory.sol\n\n30: if (codeSize > 0)\n\nFile: contracts/smart-contract-wallet/SmartAccount.sol\n\n236: if (refundInfo.gasPrice > 0)", "github_refs_formatted": "EntryPoint.sol, StakeManager.sol, SimpleAccountFactory.sol, TestAggregatedAccountFactory.sol, SmartAccount.sol", "github_files_list": "TestAggregatedAccountFactory.sol, SimpleAccountFactory.sol, EntryPoint.sol, SmartAccount.sol, StakeManager.sol", "github_refs_count": 5, "vulnerable_code_actual": "File: contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol\n\n174: if (callData.length > 0)\n178: if (result.length > 0)\n212: if (paymasterAndData.length > 0)\n452: if (context.length > 0)", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/smart-contract-wallet/aa-4337/core/StakeManager.sol\n\n61: require(_unstakeDelaySec > 0, \"must specify unstake delay\")\n64: require(stake > 0, \"no stake specified\")\n99: require(stake > 0, \"No stake to withdraw\")\n100: require(info.withdrawTime > 0, \"must call unlockStake() first\")", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 11} {"source": "c4", "protocol": "02-ai-arena", "title": "Dee Q", "severity_raw": "QA", "severity": "qa", "description": "### QA1\n- There were numerous require statements in the codebase where there's no string argument specifying why the revert happens. I personally spent almost 24hrs debugging a revert test just because team doesnt add a string statement for the require function. It is advisable to add reasons why a function is reverting.\n\nfrom solidity doc:\n```\nIf you do not provide a string argument to require, it will revert with empty error data, not even including the error selector.\n```\n`AAMintPass.sol`\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/AAMintPass.sol#L56\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/AAMintPass.sol#L94\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/AAMintPass.sol#L116\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/AAMintPass.sol#L138\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/AAMintPass.sol#L157\n\n_...and many more examples throughout the codebase_\n\n### QA2\n\n- There are soo many places in the code where access control is needed, the team kept writing require statements repetitively. Repetition is prone to error which might be hard to debug.. it is advisable to use a modifier as best practise and to better improve the readibility of the code.\n\nRepetitive usage under `FighterFarm.sol`\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L121\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L130\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L140\n\nhttps://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L148\n\nhttps://github.com/code-423n4/2024-02-ai-aren", "vulnerable_code": "If you do not provide a string argument to require, it will revert with empty error data, not even including the error selector.", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/Dee-Q.md", "collected_at": "2026-01-02T19:02:23.773538+00:00", "source_hash": "e3f4b127ae32b85001c1b72ed4cb7de4c72a30642fdd43ec424fe52363730294", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 128, "github_ref_count": 9, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "If you do not provide a string argument to require, it will revert with empty error data, not even including the error selector.", "primary_code_language": "unknown", "primary_code_char_count": 128, "all_code_blocks": "// Code block 1 (unknown):\nIf you do not provide a string argument to require, it will revert with empty error data, not even including the error selector.", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "AAMintPass.sol#L56, AAMintPass.sol#L94, AAMintPass.sol#L116, AAMintPass.sol#L138, AAMintPass.sol#L157, FighterFarm.sol#L121, FighterFarm.sol#L130, FighterFarm.sol#L140, FighterFarm.sol#L148", "github_files_list": "FighterFarm.sol, AAMintPass.sol", "github_refs_count": 9, "vulnerable_code_actual": "If you do not provide a string argument to require, it will revert with empty error data, not even including the error selector.", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "07-amphora", "title": "banpaleo5 G", "severity_raw": "Low", "severity": "low", "description": "# Table of Contents\n| Number | Issues Details | Count |\n| :----- | :----------------------------------------------------------------------------------------------------- | :---- |\n| [G-1] | Enhance gas efficiency by constructing the `DOMAIN_TYPEHASH` within the `initialize()` function | 1 |\n| [G-2] | Leverage the rules of short-circuit evaluation for optimization benefits | 1 |\n| [G-3] | Recommended to use `assembly` for writing address storage values | 43 |\n| [G-4] | If EIP-2771 isn't being supported, avoid using the `_msgSender()` function | 17 |\n| [G-5] | Employing `unchecked` blocks can lead to gas savings when operations cannot overflow/underflow | 1 |\n\n\n## [G-1] Enhance gas efficiency by constructing the `DOMAIN_TYPEHASH` within the `initialize()` function\n\n
\nThere are 1 instances of this issue:\n\n```solidity\nFile: GovernorCharlie.sol\nbytes32 public constant DOMAIN_TYPEHASH =\n```\n
\n\n## [G-2]
Leverage the rules of short-circuit evaluation for optimization benefits\n\n
\nThere are 1 instances of this issue:\n\n```solidity\nFile: GovernorCharlie.sol\n(amph.getPriorVotes(msg.sender, (block.number - 1)) < proposalThreshold && !isWhitelisted(msg.sender))\n(_emergency && !isWhitelisted(msg.sender))\n```\n
\n\n## [G-3]
Recommended to use `assembly` for writing address storage values\n\n
\nThere are 10 instances of this issue:\n\n```solidity\nFile: CbEthEthOracle.sol\n_vp = virtualPrice;\n```\n\n```solidity\nFile: VaultController.sol\n_enabledTokens = enabledTokens;\n```\n\n```solidity\nFile: VaultController.sol\n_i = _start; _i < _end;) {\n```\n\n```solidity\nFile: VaultController.sol\n_oldClaimerContract = claimerContract;\n```\n\n```solidity\nFile: VaultController.sol\n_oldBorrowingFee = initialBorrowingFee;\n```\n\n```solidity\nFile: VaultController.s", "vulnerable_code": "File: GovernorCharlie.sol\nbytes32 public constant DOMAIN_TYPEHASH =", "fixed_code": "File: GovernorCharlie.sol\n(amph.getPriorVotes(msg.sender, (block.number - 1)) < proposalThreshold && !isWhitelisted(msg.sender))\n(_emergency && !isWhitelisted(msg.sender))", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/banpaleo5-G.md", "collected_at": "2026-01-02T18:23:41.691171+00:00", "source_hash": "e400545323d61d8fd37838bbee7ab9d534ec0a10046fb740361a3d97ead0e623", "code_block_count": 7, "solidity_block_count": 7, "total_code_chars": 520, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: GovernorCharlie.sol\nbytes32 public constant DOMAIN_TYPEHASH =", "primary_code_language": "solidity", "primary_code_char_count": 67, "all_code_blocks": "// Code block 1 (solidity):\nFile: GovernorCharlie.sol\nbytes32 public constant DOMAIN_TYPEHASH =\n\n// Code block 2 (solidity):\nFile: GovernorCharlie.sol\n(amph.getPriorVotes(msg.sender, (block.number - 1)) < proposalThreshold && !isWhitelisted(msg.sender))\n(_emergency && !isWhitelisted(msg.sender))\n\n// Code block 3 (solidity):\nFile: CbEthEthOracle.sol\n_vp = virtualPrice;\n\n// Code block 4 (solidity):\nFile: VaultController.sol\n_enabledTokens = enabledTokens;\n\n// Code block 5 (solidity):\nFile: VaultController.sol\n_i = _start; _i < _end;) {\n\n// Code block 6 (solidity):\nFile: VaultController.sol\n_oldClaimerContract = claimerContract;\n\n// Code block 7 (solidity):\nFile: VaultController.sol\n_oldBorrowingFee = initialBorrowingFee;", "all_code_blocks_count": 7, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: GovernorCharlie.sol\nbytes32 public constant DOMAIN_TYPEHASH =\n\nFile: GovernorCharlie.sol\n(amph.getPriorVotes(msg.sender, (block.number - 1)) < proposalThreshold && !isWhitelisted(msg.sender))\n(_emergency && !isWhitelisted(msg.sender))\n\nFile: CbEthEthOracle.sol\n_vp = virtualPrice;\n\nFile: VaultController.sol\n_enabledTokens = enabledTokens;\n\nFile: VaultController.sol\n_i = _start; _i < _end;) {\n\nFile: VaultController.sol\n_oldClaimerContract = claimerContract;\n\nFile: VaultController.sol\n_oldBorrowingFee = initialBorrowingFee;", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: GovernorCharlie.sol\nbytes32 public constant DOMAIN_TYPEHASH =", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: GovernorCharlie.sol\n(amph.getPriorVotes(msg.sender, (block.number - 1)) < proposalThreshold && !isWhitelisted(msg.sender))\n(_emergency && !isWhitelisted(msg.sender))", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 12} {"source": "c4", "protocol": "01-ondo", "title": "halden Q", "severity_raw": "Low", "severity": "low", "description": "## [L-01] Add additional check for setting of exchangeRateDeltaLimit\nIt should be good to add additional check for what value can be settled for exchangeRateDeltaLimit. The variable is in basis points, so some biggest value for that variable can lead to unexpected behavior.\nFile CashManager.sol: [396](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L396)\n\n## [L-02] Not good practice for adding hardcoded address for external contract\nI recomend to be given address as input in the constructor instead of hardcoded address of external contract in the code.\nFile OndoPriceOracle.sol [42](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/OndoPriceOracle.sol#L42)\n\n## [L-03] Move onlyGuardian and roles in abstract contract for Factory contract to make file smaller\nThe modifier onlyGuardian and roles can be moved in abstarct class for all factory contract. It will make file smaller and easy for reading. Other things that repeat can also be moved.\n\n## [L-04] Skip using of v!=27 && V!=28 or v==27 || v=29\nFile KYCRegistry.sol [87](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/kyc/KYCRegistry.sol#L87)\nSee this for reference:\nhttps://twitter.com/alexberegszaszi/status/1534461421454606336?s=20&t=H0Dv3ZT2bicx00hLWJk7Fg\n\nBest approach:\n```\n// Whether v is 27 or 28.\n // The magic number has the 27th and 28th bytes\n // counting from the most significant byte set to 1.\n vIsValid := byte(v, 0x0101000000)\n```", "vulnerable_code": "// Whether v is 27 or 28.\n // The magic number has the 27th and 28th bytes\n // counting from the most significant byte set to 1.\n vIsValid := byte(v, 0x0101000000)", "fixed_code": "", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/halden-Q.md", "collected_at": "2026-01-02T18:15:12.951386+00:00", "source_hash": "e4166c5f86e76f48d6f18fcb43eef70c851431ae8c7237dac9d435c27675ff21", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 208, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "// Whether v is 27 or 28.\n // The magic number has the 27th and 28th bytes\n // counting from the most significant byte set to 1.\n vIsValid := byte(v, 0x0101000000)", "primary_code_language": "unknown", "primary_code_char_count": 208, "all_code_blocks": "// Code block 1 (unknown):\n// Whether v is 27 or 28.\n // The magic number has the 27th and 28th bytes\n // counting from the most significant byte set to 1.\n vIsValid := byte(v, 0x0101000000)", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CashManager.sol#L396, OndoPriceOracle.sol#L42, KYCRegistry.sol#L87", "github_files_list": "CashManager.sol, KYCRegistry.sol, OndoPriceOracle.sol", "github_refs_count": 3, "vulnerable_code_actual": "// Whether v is 27 or 28.\n // The magic number has the 27th and 28th bytes\n // counting from the most significant byte set to 1.\n vIsValid := byte(v, 0x0101000000)", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "02-ethos", "title": "DeFiHackLabs G", "severity_raw": "Low", "severity": "low", "description": "# Report\n\n\n## Gas Optimizations\n\n| |Issue|Instances|\n|-|:-|:-:|\n|[G-1]| Setting the `constructor` to `payable` saves gas (sayan)|2|\n|[G-2]| Mark functions as payable (with discretion) |49|\n|[G-3]| Use assembly for math (add, sub, mul, div) |2|\n|[G-4]| Short Revert Strings |8|\n|[G-5]| Use assembly to write storage values |13|\n|[G-6]| Use multiple require() statments insted of require(expression && expression && \u2026) |4|\n|[G-7]| Optimal Comparison |8|\n|[G-8]| Tightly pack storage variables |2|\n|[G-9]| Instead of if(x), use assembly with iszeroiszero (x)(secoalba) |12|\n\n\n\n\n**[G-1] Setting the `constructor` to `payable` saves gas (sayan)**\n\nSaves ~13 gas per instance\n```solidity\n2 instances\n\nFile: Ethos-Vault/contracts/ReaperVaultV2.sol\n111: constructor(\n112: address _token,\n113: string memory _name,\n114: string memory _symbol,\n115: uint256 _tvlCap,\n116: address _treasury,\n117: address[] memory _strategists,\n118: address[] memory _multisigRoles\n119: ) ERC20(string(_name), string(_symbol)) {\n\n\nFile: Ethos-Vault/contracts/ReaperVaultERC4626.sol\n16: constructor(\n17: address _token,\n18: string memory _name,\n19: string memory _symbol,\n20: uint256 _tvlCap,\n21: address _treasury,\n22: address[] memory _strategists,\n23: address[] memory _multisigRoles\n24: ) ReaperVaultV2(_token, _name, _symbol, _tvlCap, _treasury, _strategists, _multisigRoles) {}\n\n```\n\n**[G-2] Mark functions as payable (with discretion)**\n\nYou can mark public or external functions as payable to save gas. Functions that are not payable have additional logic to check if there was a value sent with a call, however, making a function payable eliminates this check. This optimization should be carefully considered due to potentially unwanted behavior when a function does not need to accept ether.\n\nSaves ~24 gas per insta", "vulnerable_code": "2 instances\n\nFile: Ethos-Vault/contracts/ReaperVaultV2.sol\n111: constructor(\n112: address _token,\n113: string memory _name,\n114: string memory _symbol,\n115: uint256 _tvlCap,\n116: address _treasury,\n117: address[] memory _strategists,\n118: address[] memory _multisigRoles\n119: ) ERC20(string(_name), string(_symbol)) {\n\n\nFile: Ethos-Vault/contracts/ReaperVaultERC4626.sol\n16: constructor(\n17: address _token,\n18: string memory _name,\n19: string memory _symbol,\n20: uint256 _tvlCap,\n21: address _treasury,\n22: address[] memory _strategists,\n23: address[] memory _multisigRoles\n24: ) ReaperVaultV2(_token, _name, _symbol, _tvlCap, _treasury, _strategists, _multisigRoles) {}\n", "fixed_code": "49 instances\n\nFile; Ethos-Core/contracts/TroveManager.sol\n\n225: constructor() public {\n\n232: function setAddresses(\n\n299: function getTroveOwnersCount(address _collateral) external view override returns (uint) {\n\n303: function getTroveFromTroveOwnersArray(address _collateral, uint _index) external view override returns (address) {\n\n310: function liquidate(address _borrower, address _collateral) external override {\n\n513: function liquidateTroves(address _collateral, uint _n) external override {\n\n715: function batchLiquidateTroves(address _collateral, address[] memory _troveArray) public override {\n\n939: function redeemCloseTrove(\n\n962: function updateDebtAndCollAndStakesPostRedemption(\n\n982: function burnLUSDAndEmitRedemptionEvent(\n\n1016: function redeemCollateral(\n\n1045: function getNominalICR(address _borrower, address _collateral) public view override returns (uint) {\n\n1054: function getCurrentICR(\n\n1076: function applyPendingRewards(address _borrower, address _collateral) external override {\n\n1111: function updateTroveRewardSnapshots(address _borrower, address _collateral) external override {\n\n1123: function getPendingCollateralReward(address _borrower, address _collateral) public view override returns (uint) {\n\n1138: function getPendingLUSDDebtReward(address _borrower, address _collateral) public view override returns (uint) {\n\n1152: function hasPendingRewards(address _borrower, address _collateral) public view override returns (bool) {\n\n1164: function getEntireDebtAndColl(\n\n1183: function removeStake(address _borrower, address _collateral) external override {\n\n1195: function updateStakeAndTotalStakes(address _borrower, address _collateral) external override returns (uint) {\n\n1273: function closeTrove(address _borrower, address _collateral, uint256 _closedStatusNum) external override {\n\n1316: function addTroveOwnerToArray(address _borrower, address _collateral) external override returns (uint ", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/DeFiHackLabs-G.md", "collected_at": "2026-01-02T18:16:07.130672+00:00", "source_hash": "e4251252b17e3fc48cb7b6484ecd696f2012b8f153118e8ec44f2894652d2221", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 799, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "2 instances\n\nFile: Ethos-Vault/contracts/ReaperVaultV2.sol\n111: constructor(\n112: address _token,\n113: string memory _name,\n114: string memory _symbol,\n115: uint256 _tvlCap,\n116: address _treasury,\n117: address[] memory _strategists,\n118: address[] memory _multisigRoles\n119: ) ERC20(string(_name), string(_symbol)) {\n\n\nFile: Ethos-Vault/contracts/ReaperVaultERC4626.sol\n16: constructor(\n17: address _token,\n18: string memory _name,\n19: string memory _symbol,\n20: uint256 _tvlCap,\n21: address _treasury,\n22: address[] memory _strategists,\n23: address[] memory _multisigRoles\n24: ) ReaperVaultV2(_token, _name, _symbol, _tvlCap, _treasury, _strategists, _multisigRoles) {}", "primary_code_language": "solidity", "primary_code_char_count": 799, "all_code_blocks": "// Code block 1 (solidity):\n2 instances\n\nFile: Ethos-Vault/contracts/ReaperVaultV2.sol\n111: constructor(\n112: address _token,\n113: string memory _name,\n114: string memory _symbol,\n115: uint256 _tvlCap,\n116: address _treasury,\n117: address[] memory _strategists,\n118: address[] memory _multisigRoles\n119: ) ERC20(string(_name), string(_symbol)) {\n\n\nFile: Ethos-Vault/contracts/ReaperVaultERC4626.sol\n16: constructor(\n17: address _token,\n18: string memory _name,\n19: string memory _symbol,\n20: uint256 _tvlCap,\n21: address _treasury,\n22: address[] memory _strategists,\n23: address[] memory _multisigRoles\n24: ) ReaperVaultV2(_token, _name, _symbol, _tvlCap, _treasury, _strategists, _multisigRoles) {}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "2 instances\n\nFile: Ethos-Vault/contracts/ReaperVaultV2.sol\n111: constructor(\n112: address _token,\n113: string memory _name,\n114: string memory _symbol,\n115: uint256 _tvlCap,\n116: address _treasury,\n117: address[] memory _strategists,\n118: address[] memory _multisigRoles\n119: ) ERC20(string(_name), string(_symbol)) {\n\n\nFile: Ethos-Vault/contracts/ReaperVaultERC4626.sol\n16: constructor(\n17: address _token,\n18: string memory _name,\n19: string memory _symbol,\n20: uint256 _tvlCap,\n21: address _treasury,\n22: address[] memory _strategists,\n23: address[] memory _multisigRoles\n24: ) ReaperVaultV2(_token, _name, _symbol, _tvlCap, _treasury, _strategists, _multisigRoles) {}", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "2 instances\n\nFile: Ethos-Vault/contracts/ReaperVaultV2.sol\n111: constructor(\n112: address _token,\n113: string memory _name,\n114: string memory _symbol,\n115: uint256 _tvlCap,\n116: address _treasury,\n117: address[] memory _strategists,\n118: address[] memory _multisigRoles\n119: ) ERC20(string(_name), string(_symbol)) {\n\n\nFile: Ethos-Vault/contracts/ReaperVaultERC4626.sol\n16: constructor(\n17: address _token,\n18: string memory _name,\n19: string memory _symbol,\n20: uint256 _tvlCap,\n21: address _treasury,\n22: address[] memory _strategists,\n23: address[] memory _multisigRoles\n24: ) ReaperVaultV2(_token, _name, _symbol, _tvlCap, _treasury, _strategists, _multisigRoles) {}\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "49 instances\n\nFile; Ethos-Core/contracts/TroveManager.sol\n\n225: constructor() public {\n\n232: function setAddresses(\n\n299: function getTroveOwnersCount(address _collateral) external view override returns (uint) {\n\n303: function getTroveFromTroveOwnersArray(address _collateral, uint _index) external view override returns (address) {\n\n310: function liquidate(address _borrower, address _collateral) external override {\n\n513: function liquidateTroves(address _collateral, uint _n) external override {\n\n715: function batchLiquidateTroves(address _collateral, address[] memory _troveArray) public override {\n\n939: function redeemCloseTrove(\n\n962: function updateDebtAndCollAndStakesPostRedemption(\n\n982: function burnLUSDAndEmitRedemptionEvent(\n\n1016: function redeemCollateral(\n\n1045: function getNominalICR(address _borrower, address _collateral) public view override returns (uint) {\n\n1054: function getCurrentICR(\n\n1076: function applyPendingRewards(address _borrower, address _collateral) external override {\n\n1111: function updateTroveRewardSnapshots(address _borrower, address _collateral) external override {\n\n1123: function getPendingCollateralReward(address _borrower, address _collateral) public view override returns (uint) {\n\n1138: function getPendingLUSDDebtReward(address _borrower, address _collateral) public view override returns (uint) {\n\n1152: function hasPendingRewards(address _borrower, address _collateral) public view override returns (bool) {\n\n1164: function getEntireDebtAndColl(\n\n1183: function removeStake(address _borrower, address _collateral) external override {\n\n1195: function updateStakeAndTotalStakes(address _borrower, address _collateral) external override returns (uint) {\n\n1273: function closeTrove(address _borrower, address _collateral, uint256 _closedStatusNum) external override {\n\n1316: function addTroveOwnerToArray(address _borrower, address _collateral) external override returns (uint ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "10-badger", "title": "lsaudit Q", "severity_raw": "Medium", "severity": "medium", "description": "# [QA-01] Lack of 2-step ownership transfer\n\n[File: Auth.sol](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/Dependencies/Auth.sol#L52)\n```\n function transferOwnership(address newOwner) public virtual requiresAuth {\n owner = newOwner;\n\n emit OwnershipTransferred(msg.sender, newOwner);\n }\n```\n\nA single step ownership change is risky due to the fact that the new owner address could be wrong.\n\nInstead, consider using a contract like Ownable2Step, which provides a two-step ownership.\n\n\n# [QA-02] `_openCdpCallback()` does not emit event\n\n[File: LeverageMacroBase.sol](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/LeverageMacroBase.sol#L463)\n```\n * Open CDP and Emit event\n```\n\nAccording to comment - function `_openCdpCallback()` should emit an event. However, there's no event emitted by `_openCdpCallback()`.\n\n\n# [QA-03] Unused code should be removed\n\n[File: EbtcBase.sol](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/Dependencies/EbtcBase.sol#L35)\n```\nuint256 public constant BORROWING_FEE_FLOOR = 0; // 0.5%\n```\n\nCode-base does not use `BORROWING_FEE_FLOOR` constant. The calculation of fee floor is being performed in `_calcRedemptionRate()` in `CdpManager.sol`.\n\n# [N-01] Typos\n\n[File: ERC3156FlashLender.sol](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/Dependencies/ERC3156FlashLender.sol#L13)\n```\n// Functions to modify these variables must be included in implementing contracts if desired\n```\n\n`impelemnting` should be changed to `implementing`\n\n# [N-02] Redundant comments\nAvoid inserting comments to the code-base, which does not provide any context\n\n[File: SimplifiedDiamondLike.sol](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993", "vulnerable_code": " function transferOwnership(address newOwner) public virtual requiresAuth {\n owner = newOwner;\n\n emit OwnershipTransferred(msg.sender, newOwner);\n }", "fixed_code": " * Open CDP and Emit event", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/lsaudit-Q.md", "collected_at": "2026-01-02T18:26:55.599446+00:00", "source_hash": "e42c5cb7ceb1ff49524a9261f031827af71dbb9ed37ffea3a4a7c35ad24b4f6e", "code_block_count": 4, "solidity_block_count": 0, "total_code_chars": 337, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function transferOwnership(address newOwner) public virtual requiresAuth {\n owner = newOwner;\n\n emit OwnershipTransferred(msg.sender, newOwner);\n }", "primary_code_language": "unknown", "primary_code_char_count": 164, "all_code_blocks": "// Code block 1 (unknown):\nfunction transferOwnership(address newOwner) public virtual requiresAuth {\n owner = newOwner;\n\n emit OwnershipTransferred(msg.sender, newOwner);\n }\n\n// Code block 2 (unknown):\n* Open CDP and Emit event\n\n// Code block 3 (unknown):\nuint256 public constant BORROWING_FEE_FLOOR = 0; // 0.5%\n\n// Code block 4 (unknown):\n// Functions to modify these variables must be included in implementing contracts if desired", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Auth.sol#L52, LeverageMacroBase.sol#L463, EbtcBase.sol#L35, ERC3156FlashLender.sol#L13", "github_files_list": "EbtcBase.sol, Auth.sol, ERC3156FlashLender.sol, LeverageMacroBase.sol", "github_refs_count": 4, "vulnerable_code_actual": " function transferOwnership(address newOwner) public virtual requiresAuth {\n owner = newOwner;\n\n emit OwnershipTransferred(msg.sender, newOwner);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " * Open CDP and Emit event", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "06-lybra", "title": "0x11singh99 G", "severity_raw": "Low", "severity": "low", "description": "### Gas Optimizations List\n| Number | Optimization Details | Instances |\n|:--:|:-------| :-----:|\n| [G-01] | Do not calculate constant variables | 3 |\n| [G-02] | Use assembly for address(0) comparison |4 |\n| [G-03] | Avoid updating storage when the value hasn't changed | 3 |\n| [G-04] | Use custom errors rather than require() strings to save gas |__|\n| [G-05] | Function calls can be cached rather than re calling | 1 |\n| [G-06] | Write for loops in most gas efficient way | 3 |\n| [G-07] | Reading from calldata/memory array multiple times should be cached | 2 |\n| [G-08] | State variables should be cached in stack variables rather than re-reading them from storage | 16 |\n| [G-09] | Using storage instead of memory for structs/arrays saves gas | 2 |\n| [G-10] | Use unchecked{} whenever underflow/overflow not possible saves 130 gas each time | 10 |\n\nTotal 7 issues\n\n## [G-01] Do not calculate constant variables\nDue to how constant variables are implemented (replacements at compile-time), an expression assigned to a \nconstant variable is recomputed each time that the variable is used, which wastes some gas each time of use.\n\n*Total 3 instances - 1 files:*\n\n### Instance#1-3 :\n```solidity\nFile : contracts/lybra/configuration/LybraConfigurator.sol\n\n 76: bytes32 public constant DAO = keccak256(\"DAO\");\n 77: bytes32 public constant TIMELOCK = keccak256(\"TIMELOCK\");\n 78: bytes32 public constant ADMIN = keccak256(\"ADMIN\");\n```\n https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/configuration/LybraConfigurator.sol#L76-L78\nMake it commented and directly save hash of these strings by calculating off chain .It will save 30 gas for each time constant is used.30 Gas for calculating keccak256() each time.\n\n## [G-02] Use assembly for address(0) comparison \n### saves 65 gas each time \n\n*4 instances - 3 files:*\n\n### Instance#1-2:\n```solidity\nFile : contracts/lybra/configuration/LybraConfigurator.sol\n\n 99: if (address(EUSD) == address(0)) EUSD = IEUSD(_eusd);\n 100", "vulnerable_code": "File : contracts/lybra/configuration/LybraConfigurator.sol\n\n 76: bytes32 public constant DAO = keccak256(\"DAO\");\n 77: bytes32 public constant TIMELOCK = keccak256(\"TIMELOCK\");\n 78: bytes32 public constant ADMIN = keccak256(\"ADMIN\");", "fixed_code": "File : contracts/lybra/configuration/LybraConfigurator.sol\n\n 99: if (address(EUSD) == address(0)) EUSD = IEUSD(_eusd);\n 100: if (address(peUSD) == address(0)) peUSD = IEUSD(_peusd);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/0x11singh99-G.md", "collected_at": "2026-01-02T18:21:58.863559+00:00", "source_hash": "e47bf820890e43f288d6c08025168fc57a4b67c1ed2c29cfca2611ed49bec716", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 238, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File : contracts/lybra/configuration/LybraConfigurator.sol\n\n 76: bytes32 public constant DAO = keccak256(\"DAO\");\n 77: bytes32 public constant TIMELOCK = keccak256(\"TIMELOCK\");\n 78: bytes32 public constant ADMIN = keccak256(\"ADMIN\");", "primary_code_language": "solidity", "primary_code_char_count": 238, "all_code_blocks": "// Code block 1 (solidity):\nFile : contracts/lybra/configuration/LybraConfigurator.sol\n\n 76: bytes32 public constant DAO = keccak256(\"DAO\");\n 77: bytes32 public constant TIMELOCK = keccak256(\"TIMELOCK\");\n 78: bytes32 public constant ADMIN = keccak256(\"ADMIN\");", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File : contracts/lybra/configuration/LybraConfigurator.sol\n\n 76: bytes32 public constant DAO = keccak256(\"DAO\");\n 77: bytes32 public constant TIMELOCK = keccak256(\"TIMELOCK\");\n 78: bytes32 public constant ADMIN = keccak256(\"ADMIN\");", "github_refs_formatted": "LybraConfigurator.sol#L76-L78", "github_files_list": "LybraConfigurator.sol", "github_refs_count": 1, "vulnerable_code_actual": "File : contracts/lybra/configuration/LybraConfigurator.sol\n\n 76: bytes32 public constant DAO = keccak256(\"DAO\");\n 77: bytes32 public constant TIMELOCK = keccak256(\"TIMELOCK\");\n 78: bytes32 public constant ADMIN = keccak256(\"ADMIN\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File : contracts/lybra/configuration/LybraConfigurator.sol\n\n 99: if (address(EUSD) == address(0)) EUSD = IEUSD(_eusd);\n 100: if (address(peUSD) == address(0)) peUSD = IEUSD(_peusd);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "06-lybra", "title": "cartlex_ Q", "severity_raw": "Gas", "severity": "gas", "description": "Lost of gas when calling `InitToken` function in `LybraConfigurator.sol` contract.\n\nhttps://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/configuration/LybraConfigurator.sol#L95-L101\n\n```\n /**\n * @notice Initializes the eUSD and peUSD address. This function can only be executed once.\n */\n function initToken(address _eusd, address _peusd) external onlyRole(DAO) {\n if (address(EUSD) == address(0)) EUSD = IEUSD(_eusd);\n if (address(peUSD) == address(0)) peUSD = IEUSD(_peusd);\n }\n```\n\nIn commentary block of this function says that it can be called once, but it possible to call it again due to `else` statment doesn't check.\n\nTo restrict calling this function again it is needed to use `!=` statement and custom error.\n```\n /**\n * @notice Initializes the eUSD and peUSD address. This function can only be executed once.\n */\n function initToken(address _eusd, address _peusd) external onlyRole(DAO) {\n if (address(EUSD) != address(0)) {\n revert AddressAlreadyInit();\n }\n if (address(peUSD) != address(0)) {\n revert AddressAlreadyInit();\n }\n peUSD = IEUSD(_peusd);\n EUSD = IEUSD(_eusd);\n }\n```", "vulnerable_code": " /**\n * @notice Initializes the eUSD and peUSD address. This function can only be executed once.\n */\n function initToken(address _eusd, address _peusd) external onlyRole(DAO) {\n if (address(EUSD) == address(0)) EUSD = IEUSD(_eusd);\n if (address(peUSD) == address(0)) peUSD = IEUSD(_peusd);\n }", "fixed_code": " /**\n * @notice Initializes the eUSD and peUSD address. This function can only be executed once.\n */\n function initToken(address _eusd, address _peusd) external onlyRole(DAO) {\n if (address(EUSD) != address(0)) {\n revert AddressAlreadyInit();\n }\n if (address(peUSD) != address(0)) {\n revert AddressAlreadyInit();\n }\n peUSD = IEUSD(_peusd);\n EUSD = IEUSD(_eusd);\n }", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/cartlex_-Q.md", "collected_at": "2026-01-02T18:22:53.894862+00:00", "source_hash": "e4aacfdabb5d98dd341c83275e16eea95430ccb70ba3475f559e8d190c291761", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 760, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "/**\n * @notice Initializes the eUSD and peUSD address. This function can only be executed once.\n */\n function initToken(address _eusd, address _peusd) external onlyRole(DAO) {\n if (address(EUSD) == address(0)) EUSD = IEUSD(_eusd);\n if (address(peUSD) == address(0)) peUSD = IEUSD(_peusd);\n }", "primary_code_language": "unknown", "primary_code_char_count": 319, "all_code_blocks": "// Code block 1 (unknown):\n/**\n * @notice Initializes the eUSD and peUSD address. This function can only be executed once.\n */\n function initToken(address _eusd, address _peusd) external onlyRole(DAO) {\n if (address(EUSD) == address(0)) EUSD = IEUSD(_eusd);\n if (address(peUSD) == address(0)) peUSD = IEUSD(_peusd);\n }\n\n// Code block 2 (unknown):\n/**\n * @notice Initializes the eUSD and peUSD address. This function can only be executed once.\n */\n function initToken(address _eusd, address _peusd) external onlyRole(DAO) {\n if (address(EUSD) != address(0)) {\n revert AddressAlreadyInit();\n }\n if (address(peUSD) != address(0)) {\n revert AddressAlreadyInit();\n }\n peUSD = IEUSD(_peusd);\n EUSD = IEUSD(_eusd);\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LybraConfigurator.sol#L95-L101", "github_files_list": "LybraConfigurator.sol", "github_refs_count": 1, "vulnerable_code_actual": " /**\n * @notice Initializes the eUSD and peUSD address. This function can only be executed once.\n */\n function initToken(address _eusd, address _peusd) external onlyRole(DAO) {\n if (address(EUSD) == address(0)) EUSD = IEUSD(_eusd);\n if (address(peUSD) == address(0)) peUSD = IEUSD(_peusd);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " /**\n * @notice Initializes the eUSD and peUSD address. This function can only be executed once.\n */\n function initToken(address _eusd, address _peusd) external onlyRole(DAO) {\n if (address(EUSD) != address(0)) {\n revert AddressAlreadyInit();\n }\n if (address(peUSD) != address(0)) {\n revert AddressAlreadyInit();\n }\n peUSD = IEUSD(_peusd);\n EUSD = IEUSD(_eusd);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7.51} {"source": "c4", "protocol": "11-kelp", "title": "kodyvim Q", "severity_raw": "Medium", "severity": "medium", "description": "## Missing Invariant check on pause functions\nPause should be callable when protocol is not in paused state already and vice versa for unpaused.\nOne Instance:\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L208\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L213\n```solidity\n/// @dev Triggers stopped state. Contract must not be paused.\n function pause() external onlyLRTManager {\n _pause();\n }\n\n /// @dev Returns to normal state. Contract must be paused\n function unpause() external onlyLRTAdmin {\n _unpause();\n }\n```\nother instances:\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTOracle.sol#L102\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTOracle.sol#L107\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/NodeDelegator.sol#L127\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/NodeDelegator.sol#L132\n## Recommendation\nAdd [whenNotPaused](https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/3d4c0d5741b131c231e558d7a6213392ab3672a5/contracts/security/PausableUpgradeable.sol#L49) to `pause()` and [whenPaused](https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/3d4c0d5741b131c231e558d7a6213392ab3672a5/contracts/security/PausableUpgradeable.sol#L61) modifier to `unpause()`.\n\n## No mechanism to nonsupport assets.\nWith the current implementation, once an asset is supported it cannot be unsupported without an upgrade.\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTConfig.sol#L80\n```solidity\nfunction _addNewSupportedAsset(address asset, uint256 depositLimit) private {\n UtilLib.checkNonZeroAddress(asset);\n if (isSupportedAsset[asset]) {\n revert AssetAlreadySupported();\n }\n isSupportedAsset[asset] = true;\n supportedAssetList.push(asset);\n depositLimitByAsset[asset] = depositLimit;\n emit AddedNewSupportedAsset(asset, depositLimit);\n }\n```\n## Re", "vulnerable_code": "/// @dev Triggers stopped state. Contract must not be paused.\n function pause() external onlyLRTManager {\n _pause();\n }\n\n /// @dev Returns to normal state. Contract must be paused\n function unpause() external onlyLRTAdmin {\n _unpause();\n }", "fixed_code": "function _addNewSupportedAsset(address asset, uint256 depositLimit) private {\n UtilLib.checkNonZeroAddress(asset);\n if (isSupportedAsset[asset]) {\n revert AssetAlreadySupported();\n }\n isSupportedAsset[asset] = true;\n supportedAssetList.push(asset);\n depositLimitByAsset[asset] = depositLimit;\n emit AddedNewSupportedAsset(asset, depositLimit);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/kodyvim-Q.md", "collected_at": "2026-01-02T18:28:12.710059+00:00", "source_hash": "e4e6ce3f1888efd3b3e86e18d5af228c7459ad4f852eadc5be3e5863618cc9ad", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 677, "github_ref_count": 9, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "/// @dev Triggers stopped state. Contract must not be paused.\n function pause() external onlyLRTManager {\n _pause();\n }\n\n /// @dev Returns to normal state. Contract must be paused\n function unpause() external onlyLRTAdmin {\n _unpause();\n }", "primary_code_language": "solidity", "primary_code_char_count": 268, "all_code_blocks": "// Code block 1 (solidity):\n/// @dev Triggers stopped state. Contract must not be paused.\n function pause() external onlyLRTManager {\n _pause();\n }\n\n /// @dev Returns to normal state. Contract must be paused\n function unpause() external onlyLRTAdmin {\n _unpause();\n }\n\n// Code block 2 (solidity):\nfunction _addNewSupportedAsset(address asset, uint256 depositLimit) private {\n UtilLib.checkNonZeroAddress(asset);\n if (isSupportedAsset[asset]) {\n revert AssetAlreadySupported();\n }\n isSupportedAsset[asset] = true;\n supportedAssetList.push(asset);\n depositLimitByAsset[asset] = depositLimit;\n emit AddedNewSupportedAsset(asset, depositLimit);\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "/// @dev Triggers stopped state. Contract must not be paused.\n function pause() external onlyLRTManager {\n _pause();\n }\n\n /// @dev Returns to normal state. Contract must be paused\n function unpause() external onlyLRTAdmin {\n _unpause();\n }\n\nfunction _addNewSupportedAsset(address asset, uint256 depositLimit) private {\n UtilLib.checkNonZeroAddress(asset);\n if (isSupportedAsset[asset]) {\n revert AssetAlreadySupported();\n }\n isSupportedAsset[asset] = true;\n supportedAssetList.push(asset);\n depositLimitByAsset[asset] = depositLimit;\n emit AddedNewSupportedAsset(asset, depositLimit);\n }", "github_refs_formatted": "LRTDepositPool.sol#L208, LRTDepositPool.sol#L213, LRTOracle.sol#L102, LRTOracle.sol#L107, NodeDelegator.sol#L127, NodeDelegator.sol#L132, PausableUpgradeable.sol#L49, PausableUpgradeable.sol#L61, LRTConfig.sol#L80", "github_files_list": "LRTOracle.sol, PausableUpgradeable.sol, NodeDelegator.sol, LRTConfig.sol, LRTDepositPool.sol", "github_refs_count": 9, "vulnerable_code_actual": "/// @dev Triggers stopped state. Contract must not be paused.\n function pause() external onlyLRTManager {\n _pause();\n }\n\n /// @dev Returns to normal state. Contract must be paused\n function unpause() external onlyLRTAdmin {\n _unpause();\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function _addNewSupportedAsset(address asset, uint256 depositLimit) private {\n UtilLib.checkNonZeroAddress(asset);\n if (isSupportedAsset[asset]) {\n revert AssetAlreadySupported();\n }\n isSupportedAsset[asset] = true;\n supportedAssetList.push(asset);\n depositLimitByAsset[asset] = depositLimit;\n emit AddedNewSupportedAsset(asset, depositLimit);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "03-asymmetry", "title": "KrisApostolov G", "severity_raw": "High", "severity": "high", "description": "# Gas Report\n\n## Disclaimer\n\nSome of the examples may contain truncated versions of the original code. There may also be `@audit` tags, which denote the actual place affected\n\n## Table of contents\n\n| | Issue | Instances | Estimated savings |\n| --- | --- | --- | --- |\n| [G-01] | Functions guaranteed to revert, when called by normal users should be marked private to save on gas | 21 | 441 |\n| [G-02] | Use unchecked blocks on variables that are guaranteed to not overflow or underflow | 1 | 126 |\n| [G-03] | Unnecessary external call(s) | 2 | ^3000 |\n| [G-04] | Unnecessary variable allocation | 3 | 39 |\n| [G-05] | Hashes can be cached into into immutable variables | 6 | 2772 |\n| [G-06] | Refactor the weight calculation | 1 | ^327 |\n| [G-07] | Saving storage variable into memory saves gas when variable is called more than once | 11 | 1067 |\n| [G-08] | Saving the output of a function when possible to save on gas | 2 | ^5000 |\n| [G-09] | Optimize names to save gas | The whole protocol | ^500 |\n| [G-10] | Emitting an event with a storage variable wastes gas | 5 | 650 |\n| [G-11] | address.call can be optimized with assembly | 5 | - |\n\n### **Estimated savings: ^14500 gas**\n\n## [G-01] - Functions guaranteed to revert, when called by normal users should be marked private to save on gas\n\nIn the event that a function modifier or a \"require\" statement like `onlyOwner` is utilized, an attempt by a regular user to make a call to the function will result in the function being reverted. If the function is marked as \"payable,\" the cost of gas for legitimate callers will decrease, as the compiler will no longer need to include checks to determine if payment was provided. This means that the additional opcodes that are typically avoided, including `CALLVALUE(2)`, `DUP1(3)`, `ISZERO(3)`, `PUSH2(3)`, `JUMPI(10)`, `PUSH1(3)`, `DUP1(3)`, `REVERT(0)`, `JUMPDEST(1)`, and `POP(2)`, which typically cost an average of around **21 gas** per call to the function, will not be included. The following", "vulnerable_code": "SfrxEth.sol\nfunction withdraw(uint256 _amount) external onlyOwner {\n// The redeem function returns the withdrawn amount, which is equal to the frxEthBalance variable\n IsFrxEth(SFRX_ETH_ADDRESS).redeem(\n _amount,\n address(this),\n address(this)\n );\n uint256 frxEthBalance = IERC20(FRX_ETH_ADDRESS).balanceOf(\n address(this)\n );\n IsFrxEth(FRX_ETH_ADDRESS).approve(\n FRX_ETH_CRV_POOL_ADDRESS,\n frxEthBalance\n );\n\n uint256 minOut = (((ethPerDerivative(_amount) * _amount) / 10 ** 18) *\n (10 ** 18 - maxSlippage)) / 10 ** 18;\n\n IFrxEthEthPool(FRX_ETH_CRV_POOL_ADDRESS).exchange(\n 1,\n 0,\n frxEthBalance,\n minOut\n );\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n }", "fixed_code": "Sfrx.sol\nfunction deposit() external payable onlyOwner returns (uint256) {\n IFrxETHMinter frxETHMinterContract = IFrxETHMinter(\n FRX_ETH_MINTER_ADDRESS\n );\n uint256 sfrxBalancePre = IERC20(SFRX_ETH_ADDRESS).balanceOf(\n address(this)\n );\n frxETHMinterContract.submitAndDeposit{value: msg.value}(address(this));\n uint256 sfrxBalancePost = IERC20(SFRX_ETH_ADDRESS).balanceOf(\n address(this)\n );\n return sfrxBalancePost - sfrxBalancePre;\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/KrisApostolov-G.md", "collected_at": "2026-01-02T18:18:15.707814+00:00", "source_hash": "e4eef3c1bd7ca0317c6553aed1aeb650999865b2d93a23602315efa00d3b4bb2", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "SfrxEth.sol\nfunction withdraw(uint256 _amount) external onlyOwner {\n// The redeem function returns the withdrawn amount, which is equal to the frxEthBalance variable\n IsFrxEth(SFRX_ETH_ADDRESS).redeem(\n _amount,\n address(this),\n address(this)\n );\n uint256 frxEthBalance = IERC20(FRX_ETH_ADDRESS).balanceOf(\n address(this)\n );\n IsFrxEth(FRX_ETH_ADDRESS).approve(\n FRX_ETH_CRV_POOL_ADDRESS,\n frxEthBalance\n );\n\n uint256 minOut = (((ethPerDerivative(_amount) * _amount) / 10 ** 18) *\n (10 ** 18 - maxSlippage)) / 10 ** 18;\n\n IFrxEthEthPool(FRX_ETH_CRV_POOL_ADDRESS).exchange(\n 1,\n 0,\n frxEthBalance,\n minOut\n );\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: address(this).balance}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "Sfrx.sol\nfunction deposit() external payable onlyOwner returns (uint256) {\n IFrxETHMinter frxETHMinterContract = IFrxETHMinter(\n FRX_ETH_MINTER_ADDRESS\n );\n uint256 sfrxBalancePre = IERC20(SFRX_ETH_ADDRESS).balanceOf(\n address(this)\n );\n frxETHMinterContract.submitAndDeposit{value: msg.value}(address(this));\n uint256 sfrxBalancePost = IERC20(SFRX_ETH_ADDRESS).balanceOf(\n address(this)\n );\n return sfrxBalancePost - sfrxBalancePre;\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "02-ethos", "title": "DadeKuma Q", "severity_raw": "Critical", "severity": "critical", "description": "\n## Summary\n\n---\n\n### Low Risk Findings\n|Id|Title|Instances|\n|:--:|:-------|:--:|\n|[L-01]| Lack of input validation in ERC4626 functions | 1 |\n|[L-02]| Hardcoded addresses can be problematic | 1 |\n|[L-03]| `LUSDToken` can mint to `StabilityPool`, `TroveManager`, and `BorrowerOperation` | 1 |\n|[L-04]| `distributionPeriod` must be > 0 to avoid locked funds | 1 |\n|[L-05]| Missing `transfer` value check for ERC-20 | 2 |\n|[L-06]| Lack of two-step update for critical addresses | 15 |\n|[L-07]| Missing events in sensitive functions | 7 |\n|[L-08]| Owner can renounce ownership | 22 |\n\nTotal: 50 instances over 8 issues.\n\n### Non Critical Findings\n|Id|Title|Instances|\n|:--:|:-------|:--:|\n|[NC-01]| Low test coverage | 1 |\n|[NC-02]| Unused named `return` is confusing | 26 |\n|[NC-03]| Same constant redefined elsewhere | 8 |\n|[NC-04]| Use of `constant` variables instead of `immutable` | 8 |\n|[NC-05]| Use `require` instead of `assert` | 21 |\n|[NC-06]| `require` without any message | 18 |\n|[NC-07]| Some functions don't follow the Solidity naming conventions | 1 |\n|[NC-08]| Old Solidity version | 33 |\n|[NC-09]| Use of floating pragma | 18 |\n|[NC-10]| Missing or incomplete NatSpec | 62 |\n\nTotal: 196 instances over 10 issues.\n\n## Low Risk Findings\n\n---\n\n### [L-01] Lack of input validation in ERC4626 functions\n\n\n\nFunctions `deposit, mint, withdraw, redeem` lack a validation to check if the amount exceed the max.\n\n```solidity\n// Deposit\nrequire(assets <= maxDeposit(receiver), \"ERC4626: deposit more than max\");\n\n// Mint\nrequire(shares <= maxMint(receiver), \"ERC4626: mint more than max\");\n\n// Withdraw\nrequire(assets <= maxWithdraw(owner), \"ERC4626: withdraw more than max\");\n\n// Redeem\nrequire(shares <= maxRedeem(owner), \"ERC4626: redeem more than max\");\n```\n\n\n*There is 1 instance of this issue.*\n\n\n```solidity\nFile: Ethos-Vault/contracts/ReaperVaultERC4626.sol\n\n110: function deposit(uint256 assets, address receiver) external override returns (uint256 shares) {\n111: shares ", "vulnerable_code": "// Deposit\nrequire(assets <= maxDeposit(receiver), \"ERC4626: deposit more than max\");\n\n// Mint\nrequire(shares <= maxMint(receiver), \"ERC4626: mint more than max\");\n\n// Withdraw\nrequire(assets <= maxWithdraw(owner), \"ERC4626: withdraw more than max\");\n\n// Redeem\nrequire(shares <= maxRedeem(owner), \"ERC4626: redeem more than max\");", "fixed_code": "File: Ethos-Vault/contracts/ReaperVaultERC4626.sol\n\n110: function deposit(uint256 assets, address receiver) external override returns (uint256 shares) {\n111: shares = _deposit(assets, receiver);\n112: }\n154: function mint(uint256 shares, address receiver) external override returns (uint256 assets) {\n155: assets = previewMint(shares); // previewMint rounds up so exactly \"shares\" should be minted and not 1 wei less\n156: _deposit(assets, receiver);\n157: }\n202: function withdraw(\n203: uint256 assets,\n204: address receiver,\n205: address owner\n206: ) external override returns (uint256 shares) {\n207: shares = previewWithdraw(assets); // previewWithdraw() rounds up so exactly \"assets\" are withdrawn and not 1 wei less\n208: if (msg.sender != owner) _spendAllowance(owner, msg.sender, shares);\n209: _withdraw(shares, receiver, owner);\n210: }\n258: function redeem(\n259: uint256 shares,\n260: address receiver,\n261: address owner\n262: ) external override returns (uint256 assets) {\n263: if (msg.sender != owner) _spendAllowance(owner, msg.sender, shares);\n264: assets = _withdraw(shares, receiver, owner);\n265: }\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/DadeKuma-Q.md", "collected_at": "2026-01-02T18:16:06.237765+00:00", "source_hash": "e51897425005d812ec0d46dbe1c38aecf48c1b6d757de7af7b95ebc702994c29", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 331, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "// Deposit\nrequire(assets <= maxDeposit(receiver), \"ERC4626: deposit more than max\");\n\n// Mint\nrequire(shares <= maxMint(receiver), \"ERC4626: mint more than max\");\n\n// Withdraw\nrequire(assets <= maxWithdraw(owner), \"ERC4626: withdraw more than max\");\n\n// Redeem\nrequire(shares <= maxRedeem(owner), \"ERC4626: redeem more than max\");", "primary_code_language": "solidity", "primary_code_char_count": 331, "all_code_blocks": "// Code block 1 (solidity):\n// Deposit\nrequire(assets <= maxDeposit(receiver), \"ERC4626: deposit more than max\");\n\n// Mint\nrequire(shares <= maxMint(receiver), \"ERC4626: mint more than max\");\n\n// Withdraw\nrequire(assets <= maxWithdraw(owner), \"ERC4626: withdraw more than max\");\n\n// Redeem\nrequire(shares <= maxRedeem(owner), \"ERC4626: redeem more than max\");", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "// Deposit\nrequire(assets <= maxDeposit(receiver), \"ERC4626: deposit more than max\");\n\n// Mint\nrequire(shares <= maxMint(receiver), \"ERC4626: mint more than max\");\n\n// Withdraw\nrequire(assets <= maxWithdraw(owner), \"ERC4626: withdraw more than max\");\n\n// Redeem\nrequire(shares <= maxRedeem(owner), \"ERC4626: redeem more than max\");", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "// Deposit\nrequire(assets <= maxDeposit(receiver), \"ERC4626: deposit more than max\");\n\n// Mint\nrequire(shares <= maxMint(receiver), \"ERC4626: mint more than max\");\n\n// Withdraw\nrequire(assets <= maxWithdraw(owner), \"ERC4626: withdraw more than max\");\n\n// Redeem\nrequire(shares <= maxRedeem(owner), \"ERC4626: redeem more than max\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: Ethos-Vault/contracts/ReaperVaultERC4626.sol\n\n110: function deposit(uint256 assets, address receiver) external override returns (uint256 shares) {\n111: shares = _deposit(assets, receiver);\n112: }\n154: function mint(uint256 shares, address receiver) external override returns (uint256 assets) {\n155: assets = previewMint(shares); // previewMint rounds up so exactly \"shares\" should be minted and not 1 wei less\n156: _deposit(assets, receiver);\n157: }\n202: function withdraw(\n203: uint256 assets,\n204: address receiver,\n205: address owner\n206: ) external override returns (uint256 shares) {\n207: shares = previewWithdraw(assets); // previewWithdraw() rounds up so exactly \"assets\" are withdrawn and not 1 wei less\n208: if (msg.sender != owner) _spendAllowance(owner, msg.sender, shares);\n209: _withdraw(shares, receiver, owner);\n210: }\n258: function redeem(\n259: uint256 shares,\n260: address receiver,\n261: address owner\n262: ) external override returns (uint256 assets) {\n263: if (msg.sender != owner) _spendAllowance(owner, msg.sender, shares);\n264: assets = _withdraw(shares, receiver, owner);\n265: }\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "11-kelp", "title": "gesha17 Q", "severity_raw": "Low", "severity": "low", "description": "## [L-01] Missing input validation in `_setToken()`, token addresses in mapping should be immutable.\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTConfig.sol#L156\n\n```solidity\n mapping(bytes32 tokenKey => address tokenAddress) public tokenMap;\n .\n .\n .\n /// @dev private function to set a token\n /// @param key Token key\n /// @param val Token address\n function _setToken(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n if (tokenMap[key] == val) {\n revert ValueAlreadyInUse();\n }\n tokenMap[key] = val;\n emit SetToken(key, val);\n }\n```\n\nThe function checks if the new address `val` is already set to that value in the mapping: `if(tokenMap[key] == val)`.\nHowever this is not enough. Token addresses will not change, so values in the mapping should be immutable.\n\nThis error can occur if an admin accidentally sets the address for a future token to an existing one in the mapping like `LRTConstants.ST_ETH_TOKEN` instead of the actual token address, for example `LRTConstants.NEW_ETH_TOKEN`, constant names are easy to mistake for one another. This unwanted action can result in sending the wrong type of tokens to a contract.\n\nRecommendation is when setting the token also check if the `tokenMap[key]` is already set to a non-zero address, if it is then revert.\n\n## [L-02] Missing input validation in `_setContract()`, contract addresses in mapping should be immutable.\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTConfig.sol#L172\n\n```solidity\n mapping(bytes32 contractKey => address contractAddress) public contractMap;\n .\n .\n .\n /// @dev private function to set a contract\n /// @param key Contract key\n /// @param val Contract address\n function _setContract(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n if (contractMap[key] == val) {\n revert ValueAlreadyInUse();\n }\n contractMap[key] ", "vulnerable_code": " mapping(bytes32 tokenKey => address tokenAddress) public tokenMap;\n .\n .\n .\n /// @dev private function to set a token\n /// @param key Token key\n /// @param val Token address\n function _setToken(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n if (tokenMap[key] == val) {\n revert ValueAlreadyInUse();\n }\n tokenMap[key] = val;\n emit SetToken(key, val);\n }", "fixed_code": " mapping(bytes32 contractKey => address contractAddress) public contractMap;\n .\n .\n .\n /// @dev private function to set a contract\n /// @param key Contract key\n /// @param val Contract address\n function _setContract(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n if (contractMap[key] == val) {\n revert ValueAlreadyInUse();\n }\n contractMap[key] = val;\n emit SetContract(key, val);\n }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/gesha17-Q.md", "collected_at": "2026-01-02T18:28:03.657444+00:00", "source_hash": "e51edcad945154c99bd8cd7203d972c763798855aca2c3b45d17f025c4d44132", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 446, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "mapping(bytes32 tokenKey => address tokenAddress) public tokenMap;\n .\n .\n .\n /// @dev private function to set a token\n /// @param key Token key\n /// @param val Token address\n function _setToken(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n if (tokenMap[key] == val) {\n revert ValueAlreadyInUse();\n }\n tokenMap[key] = val;\n emit SetToken(key, val);\n }", "primary_code_language": "solidity", "primary_code_char_count": 446, "all_code_blocks": "// Code block 1 (solidity):\nmapping(bytes32 tokenKey => address tokenAddress) public tokenMap;\n .\n .\n .\n /// @dev private function to set a token\n /// @param key Token key\n /// @param val Token address\n function _setToken(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n if (tokenMap[key] == val) {\n revert ValueAlreadyInUse();\n }\n tokenMap[key] = val;\n emit SetToken(key, val);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "mapping(bytes32 tokenKey => address tokenAddress) public tokenMap;\n .\n .\n .\n /// @dev private function to set a token\n /// @param key Token key\n /// @param val Token address\n function _setToken(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n if (tokenMap[key] == val) {\n revert ValueAlreadyInUse();\n }\n tokenMap[key] = val;\n emit SetToken(key, val);\n }", "github_refs_formatted": "LRTConfig.sol#L156, LRTConfig.sol#L172", "github_files_list": "LRTConfig.sol", "github_refs_count": 2, "vulnerable_code_actual": " mapping(bytes32 tokenKey => address tokenAddress) public tokenMap;\n .\n .\n .\n /// @dev private function to set a token\n /// @param key Token key\n /// @param val Token address\n function _setToken(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n if (tokenMap[key] == val) {\n revert ValueAlreadyInUse();\n }\n tokenMap[key] = val;\n emit SetToken(key, val);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " mapping(bytes32 contractKey => address contractAddress) public contractMap;\n .\n .\n .\n /// @dev private function to set a contract\n /// @param key Contract key\n /// @param val Contract address\n function _setContract(bytes32 key, address val) private {\n UtilLib.checkNonZeroAddress(val);\n if (contractMap[key] == val) {\n revert ValueAlreadyInUse();\n }\n contractMap[key] = val;\n emit SetContract(key, val);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "04-caviar", "title": "contractcops G", "severity_raw": "Gas", "severity": "gas", "description": "## [G-01] Better variable layout in Message struct\nWe are able to re-position the current Message struct variables in a way which packs them in a more memory-efficient way:\n```\n // Current structure in the project\n struct MessageBad {\n bytes32 id;\n bytes payload;\n uint256 timestamp;\n bytes signature;\n }\n\n // Modified struct for better memory packing\n struct MessageGood {\n bytes32 id;\n uint256 timestamp;\n bytes payload;\n bytes signature;\n }\n\n // ---------------- Testing functions ------------------\n // Uses ~22888 gas\n function TestGood() external returns (MessageGood memory){\n MessageGood memory messageGood;\n messageGood.id = 0x0;\n messageGood.timestamp = 1;\n messageGood.payload = \"1\";\n messageGood.payload = \"1\";\n return messageGood;\n }\n // Uses ~22910 gas\n function TestBad() external returns (MessageBad memory){\n MessageBad memory messageBad;\n messageBad.id = 0x0;\n messageBad.timestamp = 1;\n messageBad.payload = \"1\";\n messageBad.payload = \"1\";\n return messageBad;\n }\n```\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/interfaces/IStolenNftOracle.sol#L6-L13\n\n## [G-02] x = x + y costs less then x += y (and x -= y) in PrivatePool.sol\n```230: virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n...\n231: virtualNftReserves -= uint128(weightSum);\n...\n247: royaltyFeeAmount += royaltyFee;\n...\n252: netInputAmount += royaltyFeeAmount;\n...\n323: virtualBaseTokenReserves -= uint128(netOutputAmount + protocolFeeAmount + feeAmount);\n...\n324: virtualNftReserves += uint128(weightSum);\n...\n341: royaltyFeeAmount += royaltyFee;\n...\n355: netOutputAmount -= royaltyFeeAmount;\n...\n678: sum += tokenWeights[i];\n\n```", "vulnerable_code": " // Current structure in the project\n struct MessageBad {\n bytes32 id;\n bytes payload;\n uint256 timestamp;\n bytes signature;\n }\n\n // Modified struct for better memory packing\n struct MessageGood {\n bytes32 id;\n uint256 timestamp;\n bytes payload;\n bytes signature;\n }\n\n // ---------------- Testing functions ------------------\n // Uses ~22888 gas\n function TestGood() external returns (MessageGood memory){\n MessageGood memory messageGood;\n messageGood.id = 0x0;\n messageGood.timestamp = 1;\n messageGood.payload = \"1\";\n messageGood.payload = \"1\";\n return messageGood;\n }\n // Uses ~22910 gas\n function TestBad() external returns (MessageBad memory){\n MessageBad memory messageBad;\n messageBad.id = 0x0;\n messageBad.timestamp = 1;\n messageBad.payload = \"1\";\n messageBad.payload = \"1\";\n return messageBad;\n }", "fixed_code": "", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/contractcops-G.md", "collected_at": "2026-01-02T18:20:23.229283+00:00", "source_hash": "e53640a4e2f2b049bc0f303881fd3dec9ef7d0791e7570bf7adfea11727e3f2c", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 979, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "// Current structure in the project\n struct MessageBad {\n bytes32 id;\n bytes payload;\n uint256 timestamp;\n bytes signature;\n }\n\n // Modified struct for better memory packing\n struct MessageGood {\n bytes32 id;\n uint256 timestamp;\n bytes payload;\n bytes signature;\n }\n\n // ---------------- Testing functions ------------------\n // Uses ~22888 gas\n function TestGood() external returns (MessageGood memory){\n MessageGood memory messageGood;\n messageGood.id = 0x0;\n messageGood.timestamp = 1;\n messageGood.payload = \"1\";\n messageGood.payload = \"1\";\n return messageGood;\n }\n // Uses ~22910 gas\n function TestBad() external returns (MessageBad memory){\n MessageBad memory messageBad;\n messageBad.id = 0x0;\n messageBad.timestamp = 1;\n messageBad.payload = \"1\";\n messageBad.payload = \"1\";\n return messageBad;\n }", "primary_code_language": "unknown", "primary_code_char_count": 979, "all_code_blocks": "// Code block 1 (unknown):\n// Current structure in the project\n struct MessageBad {\n bytes32 id;\n bytes payload;\n uint256 timestamp;\n bytes signature;\n }\n\n // Modified struct for better memory packing\n struct MessageGood {\n bytes32 id;\n uint256 timestamp;\n bytes payload;\n bytes signature;\n }\n\n // ---------------- Testing functions ------------------\n // Uses ~22888 gas\n function TestGood() external returns (MessageGood memory){\n MessageGood memory messageGood;\n messageGood.id = 0x0;\n messageGood.timestamp = 1;\n messageGood.payload = \"1\";\n messageGood.payload = \"1\";\n return messageGood;\n }\n // Uses ~22910 gas\n function TestBad() external returns (MessageBad memory){\n MessageBad memory messageBad;\n messageBad.id = 0x0;\n messageBad.timestamp = 1;\n messageBad.payload = \"1\";\n messageBad.payload = \"1\";\n return messageBad;\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "IStolenNftOracle.sol#L6-L13", "github_files_list": "IStolenNftOracle.sol", "github_refs_count": 1, "vulnerable_code_actual": " // Current structure in the project\n struct MessageBad {\n bytes32 id;\n bytes payload;\n uint256 timestamp;\n bytes signature;\n }\n\n // Modified struct for better memory packing\n struct MessageGood {\n bytes32 id;\n uint256 timestamp;\n bytes payload;\n bytes signature;\n }\n\n // ---------------- Testing functions ------------------\n // Uses ~22888 gas\n function TestGood() external returns (MessageGood memory){\n MessageGood memory messageGood;\n messageGood.id = 0x0;\n messageGood.timestamp = 1;\n messageGood.payload = \"1\";\n messageGood.payload = \"1\";\n return messageGood;\n }\n // Uses ~22910 gas\n function TestBad() external returns (MessageBad memory){\n MessageBad memory messageBad;\n messageBad.id = 0x0;\n messageBad.timestamp = 1;\n messageBad.payload = \"1\";\n messageBad.payload = \"1\";\n return messageBad;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "08-dopex", "title": "0x11singh99 Q", "severity_raw": "Critical", "severity": "critical", "description": "# Low-Level and Non-Critical issues\n\n## Summary\n\n### Low Level List\n\n| Number | Issue Details | Instances |\n| :----: | :----------------------------------------------------------------------------------------------------------------- | :-------: |\n| [L-01] | Amounts should be checked for 0 before calling a transfer | 2 |\n| [L-02] | Check address 0 before approving. | 5 |\n| [L-03] | Check address 0 before transferring to it or minting to it | 5 |\nTotal 3 Low Level Issues\n\n### Non Critical List\n\n| Number | Issue Details | Instances |\n| :-----: | :------------------------------------------------------------------ | :-------: |\n| [NC-01] | Some Contracts are not following proper solidity style guide layout | 4 |\n| [NC-02] | Typos | 4 |\n| [NC-03] | Getter function should not revert | 1 |\n| [NC-04] | Misleading comments | 1 |\n| [NC-05] | Check amount is NON-ZERO | 2 |\n\nTotal 5 Non Critical Issues\n\n\n# LOW FINDINGS\n\n## [L-01] Amounts should be checked for 0 before calling a transfer\n\nIn Solidity, the transfer() function is commonly used to transfer ether or tokens from one address to another. When calling the transfer() function, it is important to check the amount being transferred to ensure that it is greater than 0, as transferring 0 amounts is not necessary and can consume unnecessary gas.\nIt is a security best practice to validate that the amount being transferred is greater than zero to prevent unnecessary gas costs and ensure that transfers are only executed when there is a valid amount to send. Implementing this che", "vulnerable_code": "File : contracts/amo/UniV2LiquidityAmo.sol\n\n142: function emergencyWithdraw(\n address[] calldata tokens\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n IERC20WithBurn token;\n\n for (uint256 i = 0; i < tokens.length; i++) {\n token = IERC20WithBurn(tokens[i]);\n149: token.safeTransfer(msg.sender, token.balanceOf(address(this)));///@audit check\n }\n\n emit LogEmergencyWithdraw(msg.sender, tokens);\n153: }", "fixed_code": "File : contracts/amo/UniV3LiquidityAmo.sol\n274: function swap(\n address _tokenA,\n address _tokenB,\n uint24 _fee_tier,\n uint256 _amountAtoB,\n uint256 _amountOutMinimum,\n uint160 _sqrtPriceLimitX96\n ) public onlyRole(DEFAULT_ADMIN_ROLE) returns (uint256) {\n // transfer token from rdpx v2 core\n IERC20WithBurn(_tokenA).transferFrom(///@audit check\n rdpxV2Core,\n address(this),\n _amountAtoB\n287: );", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/0x11singh99-Q.md", "collected_at": "2026-01-02T18:24:09.205921+00:00", "source_hash": "e59ab570fa258cf5c4c78ca1565dd72da994fd351a046ef1655b5de55201aba9", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File : contracts/amo/UniV2LiquidityAmo.sol\n\n142: function emergencyWithdraw(\n address[] calldata tokens\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n IERC20WithBurn token;\n\n for (uint256 i = 0; i < tokens.length; i++) {\n token = IERC20WithBurn(tokens[i]);\n149: token.safeTransfer(msg.sender, token.balanceOf(address(this)));///@audit check\n }\n\n emit LogEmergencyWithdraw(msg.sender, tokens);\n153: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File : contracts/amo/UniV3LiquidityAmo.sol\n274: function swap(\n address _tokenA,\n address _tokenB,\n uint24 _fee_tier,\n uint256 _amountAtoB,\n uint256 _amountOutMinimum,\n uint160 _sqrtPriceLimitX96\n ) public onlyRole(DEFAULT_ADMIN_ROLE) returns (uint256) {\n // transfer token from rdpx v2 core\n IERC20WithBurn(_tokenA).transferFrom(///@audit check\n rdpxV2Core,\n address(this),\n _amountAtoB\n287: );", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-salty", "title": "The Seraphs Q", "severity_raw": "Low", "severity": "low", "description": "## [QA/Low-01] Use `flipped` in `Pools::removeLiquidity()` function so that the users do not have to order the tokens correctly in the function call, similar to how its done for all other functions\n\n### Code references\n\nhttps://github.com/code-423n4/2024-01-salty/blob/main/src/pools/Pools.sol#L175\n\n### Description\nThe function `Pools::removeLiquidity()` retrieves the pool ID and if the token IDs are flipped.\n\n```solidity\n(bytes32 poolID, bool flipped) = PoolUtils._poolIDAndFlipped(tokenA, tokenB);\n```\n\nThe pool ID is determined as follows:\n\n```solidity\nfunction _poolIDAndFlipped( IERC20 tokenA, IERC20 tokenB ) internal pure returns (bytes32 poolID, bool flipped)\n{\n // See if the token orders are flipped\n if ( uint160(address(tokenB)) < uint160(address(tokenA)) )\n return (keccak256(abi.encodePacked(address(tokenB), address(tokenA))), true);\n\n return (keccak256(abi.encodePacked(address(tokenA), address(tokenB))), false);\n}\n```\n\nFlipped is returned as true if `tokenB < tokenA`.\n\nThis ensures that the `tokenA`, `tokenB` and the corresponding amounts provided in the function call matches the tokens for `reserve0` and `reserve1` of the pool.\n\nHowever, `flipped` is not used in the function at all, and its the user's responsibility to provide the tokens in the right order.\n\nThe other functions like `Pools::addLiquidity()` use `flipped` and flip the tokens if needed.\n\n### Recommendation\n\nUse `flipped` in the code to flip the tokens if the user provides the tokens in the wrong order.\n\n---\n\n## [QA/Low-02] Add checks in `DAO::_executeSetContract()` to ensure the same price feed is not set for different price feeds\n\n### Code references\n\nhttps://github.com/code-423n4/2024-01-salty/blob/main/src/dao/DAO.sol#L135-L142\n\n### Description\n\nIn `DAO::_executeSetContract()`, based on the `nameHash`, the price feed is set to `priceFeedNum`.\n\n```solidity\nif ( nameHash == keccak256(bytes( \"setContract:priceFeed1_confirm\" )) )\n priceAggregator.setPriceFeed( 1, IPriceFeed(ba", "vulnerable_code": "(bytes32 poolID, bool flipped) = PoolUtils._poolIDAndFlipped(tokenA, tokenB);", "fixed_code": "function _poolIDAndFlipped( IERC20 tokenA, IERC20 tokenB ) internal pure returns (bytes32 poolID, bool flipped)\n{\n // See if the token orders are flipped\n if ( uint160(address(tokenB)) < uint160(address(tokenA)) )\n return (keccak256(abi.encodePacked(address(tokenB), address(tokenA))), true);\n\n return (keccak256(abi.encodePacked(address(tokenA), address(tokenB))), false);\n}", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/The-Seraphs-Q.md", "collected_at": "2026-01-02T19:01:30.019770+00:00", "source_hash": "e59ec1f447ea74c96c44cafcb0d33eef9f418c42335fa5b075440ba203198518", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 468, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "(bytes32 poolID, bool flipped) = PoolUtils._poolIDAndFlipped(tokenA, tokenB);", "primary_code_language": "solidity", "primary_code_char_count": 77, "all_code_blocks": "// Code block 1 (solidity):\n(bytes32 poolID, bool flipped) = PoolUtils._poolIDAndFlipped(tokenA, tokenB);\n\n// Code block 2 (solidity):\nfunction _poolIDAndFlipped( IERC20 tokenA, IERC20 tokenB ) internal pure returns (bytes32 poolID, bool flipped)\n{\n // See if the token orders are flipped\n if ( uint160(address(tokenB)) < uint160(address(tokenA)) )\n return (keccak256(abi.encodePacked(address(tokenB), address(tokenA))), true);\n\n return (keccak256(abi.encodePacked(address(tokenA), address(tokenB))), false);\n}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "(bytes32 poolID, bool flipped) = PoolUtils._poolIDAndFlipped(tokenA, tokenB);\n\nfunction _poolIDAndFlipped( IERC20 tokenA, IERC20 tokenB ) internal pure returns (bytes32 poolID, bool flipped)\n{\n // See if the token orders are flipped\n if ( uint160(address(tokenB)) < uint160(address(tokenA)) )\n return (keccak256(abi.encodePacked(address(tokenB), address(tokenA))), true);\n\n return (keccak256(abi.encodePacked(address(tokenA), address(tokenB))), false);\n}", "github_refs_formatted": "Pools.sol#L175, DAO.sol#L135-L142", "github_files_list": "Pools.sol, DAO.sol", "github_refs_count": 2, "vulnerable_code_actual": "(bytes32 poolID, bool flipped) = PoolUtils._poolIDAndFlipped(tokenA, tokenB);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function _poolIDAndFlipped( IERC20 tokenA, IERC20 tokenB ) internal pure returns (bytes32 poolID, bool flipped)\n{\n // See if the token orders are flipped\n if ( uint160(address(tokenB)) < uint160(address(tokenA)) )\n return (keccak256(abi.encodePacked(address(tokenB), address(tokenA))), true);\n\n return (keccak256(abi.encodePacked(address(tokenA), address(tokenB))), false);\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "02-ethos", "title": "cryptonue G", "severity_raw": "Medium", "severity": "medium", "description": "# CheckContract optimization\n\nCheckContract is used in many contracts to verify an address provided is indeed a contract, not just a random address or an EOA. This CheckContract contract is only contains a single `checkContract()` function which is a view function and could easily be implemented as an internal library call. This would result in slightly larger contract bytecode but should be far more gas efficient than an external contract call as is the current case.\n\nIf a smart contract is consuming a library which have only internal functions than EVM simply embeds library into the contract. Instead of using delegate call to call a function, it simply uses JUMP statement(normal method call). There is no need to separately deploy library in this scenario.\n\n```js\nFile: CheckContract.sol\n11: function checkContract(address _account) internal view {\n12: require(_account != address(0), \"Account cannot be zero address\");\n13:\n14: uint256 size;\n15: // solhint-disable-next-line no-inline-assembly\n16: assembly { size := extcodesize(_account) }\n17: require(size > 0, \"Account code size cannot be zero\");\n18: }\n```\n\nFurther more, if Ethos decided to use Solidity v0.8 and above, we can just use `address.code.length` > 0 to detect if an address is a contract or just EOA, this will surely will save alot of gas which the current `checkContract()` function is being called everywhere.\n\n# Remove `_scaleTellorPriceByDigits` function and just return the `_price` (its parameter)\n\nIn `PriceFeed.sol`, the `TARGET_DIGITS` and `TELLOR_DIGITS` are both a constant `18`.\nBy looking at this same value, then `_scaleTellorPriceByDigits` function is actually unnecessary, as it would just return the `_price` (it's parameter) since the conditional `if-else` statement will not being entered (nothing matched)\n\nThe `_scaleTellorPriceByDigits` function is being used in on of function which fetch a collateral price `fetchPrice()`, thus removing this function", "vulnerable_code": "File: CheckContract.sol\n11: function checkContract(address _account) internal view {\n12: require(_account != address(0), \"Account cannot be zero address\");\n13:\n14: uint256 size;\n15: // solhint-disable-next-line no-inline-assembly\n16: assembly { size := extcodesize(_account) }\n17: require(size > 0, \"Account code size cannot be zero\");\n18: }", "fixed_code": "File: PriceFeed.sol\n38: // Use to convert a price answer to an 18-digit precision uint\n39: uint constant public TARGET_DIGITS = 18;\n40: // legacy Tellor \"request IDs\" use 6 decimals, newer Tellor \"query IDs\" use 18 decimals\n41: uint constant public TELLOR_DIGITS = 18;\n...\n521: function _scaleTellorPriceByDigits(uint _price) internal pure returns (uint) {\n522: uint256 price = _price;\n523: if (TARGET_DIGITS > TELLOR_DIGITS) {\n524: price = price.mul(10**(TARGET_DIGITS - TELLOR_DIGITS));\n525: } else if (TARGET_DIGITS < TELLOR_DIGITS) {\n526: price = price.div(10**(TELLOR_DIGITS - TARGET_DIGITS));\n527: }\n528: return price;\n529: }", "recommendation": "", "category": "rounding", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/cryptonue-G.md", "collected_at": "2026-01-02T18:16:59.792802+00:00", "source_hash": "e5ccabf52e230567bafa1fe94fce7a5931fb568e5729bf0d18a91c771841bac8", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 389, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: CheckContract.sol\n11: function checkContract(address _account) internal view {\n12: require(_account != address(0), \"Account cannot be zero address\");\n13:\n14: uint256 size;\n15: // solhint-disable-next-line no-inline-assembly\n16: assembly { size := extcodesize(_account) }\n17: require(size > 0, \"Account code size cannot be zero\");\n18: }", "primary_code_language": "js", "primary_code_char_count": 389, "all_code_blocks": "// Code block 1 (js):\nFile: CheckContract.sol\n11: function checkContract(address _account) internal view {\n12: require(_account != address(0), \"Account cannot be zero address\");\n13:\n14: uint256 size;\n15: // solhint-disable-next-line no-inline-assembly\n16: assembly { size := extcodesize(_account) }\n17: require(size > 0, \"Account code size cannot be zero\");\n18: }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: CheckContract.sol\n11: function checkContract(address _account) internal view {\n12: require(_account != address(0), \"Account cannot be zero address\");\n13:\n14: uint256 size;\n15: // solhint-disable-next-line no-inline-assembly\n16: assembly { size := extcodesize(_account) }\n17: require(size > 0, \"Account code size cannot be zero\");\n18: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: PriceFeed.sol\n38: // Use to convert a price answer to an 18-digit precision uint\n39: uint constant public TARGET_DIGITS = 18;\n40: // legacy Tellor \"request IDs\" use 6 decimals, newer Tellor \"query IDs\" use 18 decimals\n41: uint constant public TELLOR_DIGITS = 18;\n...\n521: function _scaleTellorPriceByDigits(uint _price) internal pure returns (uint) {\n522: uint256 price = _price;\n523: if (TARGET_DIGITS > TELLOR_DIGITS) {\n524: price = price.mul(10**(TARGET_DIGITS - TELLOR_DIGITS));\n525: } else if (TARGET_DIGITS < TELLOR_DIGITS) {\n526: price = price.div(10**(TELLOR_DIGITS - TARGET_DIGITS));\n527: }\n528: return price;\n529: }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "11-kelp", "title": "SBSecurity Analysis", "severity_raw": "Critical", "severity": "critical", "description": "# ****\ud83d\udee0\ufe0f Analysis - KelpDAO - rsETH****\n\n---\n\n## Overview\n\n---\n\nKelpDAO aims to launch a new and advanced Liquid Restaked Token called rsETH. rsETH represents a consolidated, re-staked token that can be generated using LSTs accepted as collateral within the EigenLayer ecosystem. The idea is to make restaking and diving into DeFi super easy, playing well with other DeFi stuff. KelpDAO is here to fix tricky reward systems and those pesky high gas fees, making a big splash in the web3 scene. To break it down, the Kelp protocol takes in deposits, mainly in the form of LSTs recognized as EigenLayer collateral. In return, users receive $rsETH \u2013 KelpDAO's distinctive reward token, symbolizing each individual's deposited assets.\n\n**The key contracts of KelpDAO - $rsETH protocol for this Audit are**:\n\n- LRTConfig: This upgradeable contract plays a pivotal role in storing the configuration settings for the Kelp product. Additionally, it serves as a repository for the addresses of other contracts within the Kelp product, establishing a centralized hub for managing various aspects of the system's functionality.\n- LRTDepositPool: Operating as an upgradeable contract, LRTDepositPool functions as a receiving point for funds deposited by users into the Kelp product. Subsequently, these funds are channeled to NodeDelegator contracts, facilitating the efficient movement of resources within the Kelp ecosystem.\n- NodeDelegator: These contracts serve as intermediaries, receiving funds from the LRTDepositPool and strategically delegating them to the EigenLayer strategy. The allocated funds are then utilized to provide liquidity within the EigenLayer protocol. Notably, NodeDelegator is designed as an upgradeable contract, allowing for adaptability and future enhancements.\n- LRTOracle: Functioning as another upgradeable contract, LRTOracle is tasked with the responsibility of fetching accurate price data for Liquid Staking Tokens from external oracle services. This ensures that the Kelp pr", "vulnerable_code": "modifier onlyLRTManager() {\n if (!IAccessControl(address(lrtConfig)).hasRole(LRTConstants.MANAGER, msg.sender)) {\n revert ILRTConfig.CallerNotLRTConfigManager();\n }\n _;\n }", "fixed_code": "### Trusted Roles\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/SBSecurity-Analysis.md", "collected_at": "2026-01-02T18:27:37.642756+00:00", "source_hash": "e5ed4dc85233e16af5cae8e62a09fce926fbbbcd9332ad4216ade1b52a019c0c", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "modifier onlyLRTManager() {\n if (!IAccessControl(address(lrtConfig)).hasRole(LRTConstants.MANAGER, msg.sender)) {\n revert ILRTConfig.CallerNotLRTConfigManager();\n }\n _;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "### Trusted Roles\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "02-ai-arena", "title": "PoeAudits Analysis", "severity_raw": "High", "severity": "high", "description": "\n# Contract Overview\n\n#### AiArenaHelper:\n\nThe AiArenaHelper contract is a helper contract that generates and manages Ai Arena fighter's physical attributes. The contract includes functionality to handle ownership, attribute probabilities, and the creation of physical attributes based on a fighter's DNA. It is used in other contracts to facilitate the generation of Ai fighters.\n\n#### FighterOps:\n\nThis library manages the creation and attributes of Fighter NFTs within the game. The library is designed to be used by other contracts to retrieve the relevant data for Ai fighters. The library includes the data structures that define each fighter and includes relevant functions to expose this data publicly.\n\n#### GameItems:\n\nThe GameItems smart contract inherits from OpenZeppelin's ERC-1155 standard allowing for the creation of fungible and non-fungible tokens within a single contract. The contract is designed to manage game items for Ai Arena. The GameItems smart contract allows for trusted admins to create unique game items, and allows anyone to mint these items as long as pre-set requirements are fulfilled. When creating an item, the admin can set the transferability, price, daily allowance, and supply of the game items. The supply can be infinite if desired. The contract also defines the logic for transferring and burning game items, while complying with uri requirements set by ERC-1155. Payment for game items is done through the Neuron ERC-20 token.\n\n#### MergingPool:\n\nThe MergingPool contract includes functionality for managing points associated with fighter tokens, selecting winners, and claiming rewards. Users earn points by winning rounds through the RankedBattle contract, which calls the addPoints function of the MergingPool contract. This contract also allows admin accounts to select the winners of a round, and allows the winners to claim rewards, which are additional Ai fighters.\n\n#### Neuron:\n\nThe Neuron contract is the payment system for Ai Arena, and is an ", "vulnerable_code": " /// @notice Transfers ownership from one address to another.\n /// @dev Only the owner address is authorized to call this function.\n /// @param newOwnerAddress The address of the new owner\n function transferOwnership(address newOwnerAddress) external {\n require(msg.sender == _ownerAddress);\n _ownerAddress = newOwnerAddress;\n }\n", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/PoeAudits-Analysis.md", "collected_at": "2026-01-02T19:02:38.922275+00:00", "source_hash": "e6920cc91206cead6456d65bcd30908fd6fd0371dfc81aa9f0ab0a37a459036f", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " /// @notice Transfers ownership from one address to another.\n /// @dev Only the owner address is authorized to call this function.\n /// @param newOwnerAddress The address of the new owner\n function transferOwnership(address newOwnerAddress) external {\n require(msg.sender == _ownerAddress);\n _ownerAddress = newOwnerAddress;\n }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4} {"source": "c4", "protocol": "05-ajna", "title": "Tomio G", "severity_raw": "Gas", "severity": "gas", "description": "Title: Unnecessary variable declaration\n\nProof of Concept:\n[RewardsManager.sol#L436](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/RewardsManager.sol#L436) [RewardsManager.sol#L444](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/RewardsManager.sol#L444)\nConsider declare this variable directly instead, which can save gas costs by reducing unnecessary variable declarations.\n\nRecommended Mitigation Steps:\n\n```\nfor (uint256 i = 0; i < positionIndexes_.length; ) {\n uint256 bucketIndex = positionIndexes_[i]; //declare here\n BucketState memory bucketSnapshot = stakes[tokenId_].snapshot[bucketIndex];\n\n if (epoch_ != stakingEpoch_) {\n\n // if staked in a previous epoch then use the initial exchange rate of epoch\n uint256 bucketRate = bucketExchangeRates[ajnaPool_][bucketIndex][epoch_]; //declare here\n } else {\n```\n________________________________________________________________________\n\n", "vulnerable_code": "for (uint256 i = 0; i < positionIndexes_.length; ) {\n uint256 bucketIndex = positionIndexes_[i]; //declare here\n BucketState memory bucketSnapshot = stakes[tokenId_].snapshot[bucketIndex];\n\n if (epoch_ != stakingEpoch_) {\n\n // if staked in a previous epoch then use the initial exchange rate of epoch\n uint256 bucketRate = bucketExchangeRates[ajnaPool_][bucketIndex][epoch_]; //declare here\n } else {", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/Tomio-G.md", "collected_at": "2026-01-02T18:21:16.888743+00:00", "source_hash": "e69af5270475412aeeba8b2153a5c14424e173f01d26cfdac0fc372a2f455659", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 474, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "for (uint256 i = 0; i < positionIndexes_.length; ) {\n uint256 bucketIndex = positionIndexes_[i]; //declare here\n BucketState memory bucketSnapshot = stakes[tokenId_].snapshot[bucketIndex];\n\n if (epoch_ != stakingEpoch_) {\n\n // if staked in a previous epoch then use the initial exchange rate of epoch\n uint256 bucketRate = bucketExchangeRates[ajnaPool_][bucketIndex][epoch_]; //declare here\n } else {", "primary_code_language": "unknown", "primary_code_char_count": 474, "all_code_blocks": "// Code block 1 (unknown):\nfor (uint256 i = 0; i < positionIndexes_.length; ) {\n uint256 bucketIndex = positionIndexes_[i]; //declare here\n BucketState memory bucketSnapshot = stakes[tokenId_].snapshot[bucketIndex];\n\n if (epoch_ != stakingEpoch_) {\n\n // if staked in a previous epoch then use the initial exchange rate of epoch\n uint256 bucketRate = bucketExchangeRates[ajnaPool_][bucketIndex][epoch_]; //declare here\n } else {", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "RewardsManager.sol#L436, RewardsManager.sol#L444", "github_files_list": "RewardsManager.sol", "github_refs_count": 2, "vulnerable_code_actual": "for (uint256 i = 0; i < positionIndexes_.length; ) {\n uint256 bucketIndex = positionIndexes_[i]; //declare here\n BucketState memory bucketSnapshot = stakes[tokenId_].snapshot[bucketIndex];\n\n if (epoch_ != stakingEpoch_) {\n\n // if staked in a previous epoch then use the initial exchange rate of epoch\n uint256 bucketRate = bucketExchangeRates[ajnaPool_][bucketIndex][epoch_]; //declare here\n } else {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5.01} {"source": "c4", "protocol": "03-asymmetry", "title": "Franfran G", "severity_raw": "High", "severity": "high", "description": "## Findings summary\nName | Finding | Instances | Gas saved\n--- | --- | --- | ---\n[G-1] | Duplicated require()/revert()/assert() checks should be refactored to a modifier or an internal function | 3 | 60282\n[G-2] | Use custom errors instead of revert strings | 10 | 2540\n[G-3] | Setting the constructor to payable | 4 | 864\n[G-4] | Avoid using public for immutable/constant state variables | 11 | 272899\n[G-5] | Use calldata instead of memory for external function parameters | 2 | /\n[G-6] | Functions guaranteed to revert for normal users should be marked as `payable` | 17 | 408\n[G-7] | use ternary operators rather than `if/else` | 3 | 39\n[G-8] | No need to initialize variables to their default values | 7 | /\n[G-9] | Cache rocket-style string encoded into immutables | 6 | 864\n\n## Findings details\n### [G-1] Duplicated require()/revert()/assert() checks should be refactored to a modifier or an internal function\n\n\nDuplicated require, revert, or assert messages should be refactored to an internal or private function in order to save some gas on deployment. The more duplicated it is, the greater the savings, but this always saves gas starting from two duplication.\n\n`contracts/SafEth/derivatives/Reth.sol`\n200:12\n\nhttps://github.com/code-423n4/2023-03-asymmetry/tree/main/contracts/SafEth/derivatives/Reth.sol#L200\n\n```solidity\n uint256 rethBalance2 = rocketTokenRETH.balanceOf(address(this));\n> require(rethBalance2 > rethBalance1, \"No rETH was minted\");\n uint256 rethMinted = rethBalance2 - rethBalance1;\n```\n\n### Gas saved (per instance on deployment)\n\n20094\n\n
\nLocations\n
\n\n- https://github.com/code-423n4/2023-03-asymmetry/tree/main/contracts/SafEth/derivatives/WstEth.sol#L66\n\n- https://github.com/code-423n4/2023-03-asymmetry/tree/main/contracts/SafEth/derivatives/WstEth.sol#L77\n\n
\n\n### [G-2] Use custom errors instead of revert strings\n\n\nSolidity 0.8.4 added the custom errors functionality, which can be us", "vulnerable_code": " uint256 rethBalance2 = rocketTokenRETH.balanceOf(address(this));\n> require(rethBalance2 > rethBalance1, \"No rETH was minted\");\n uint256 rethMinted = rethBalance2 - rethBalance1;", "fixed_code": " function stake() external payable {\n> require(pauseStaking == false, \"staking is paused\");\n require(msg.value >= minAmount, \"amount too low\");", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Franfran-G.md", "collected_at": "2026-01-02T18:18:05.179887+00:00", "source_hash": "e6bdea767cc4e8e4173413e87ec52bc7a21695e5db8ee9a3111e5ae056674df0", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 202, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "uint256 rethBalance2 = rocketTokenRETH.balanceOf(address(this));\n> require(rethBalance2 > rethBalance1, \"No rETH was minted\");\n uint256 rethMinted = rethBalance2 - rethBalance1;", "primary_code_language": "solidity", "primary_code_char_count": 202, "all_code_blocks": "// Code block 1 (solidity):\nuint256 rethBalance2 = rocketTokenRETH.balanceOf(address(this));\n> require(rethBalance2 > rethBalance1, \"No rETH was minted\");\n uint256 rethMinted = rethBalance2 - rethBalance1;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "uint256 rethBalance2 = rocketTokenRETH.balanceOf(address(this));\n> require(rethBalance2 > rethBalance1, \"No rETH was minted\");\n uint256 rethMinted = rethBalance2 - rethBalance1;", "github_refs_formatted": "Reth.sol#L200, WstEth.sol#L66, WstEth.sol#L77", "github_files_list": "Reth.sol, WstEth.sol", "github_refs_count": 3, "vulnerable_code_actual": " uint256 rethBalance2 = rocketTokenRETH.balanceOf(address(this));\n> require(rethBalance2 > rethBalance1, \"No rETH was minted\");\n uint256 rethMinted = rethBalance2 - rethBalance1;", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function stake() external payable {\n> require(pauseStaking == false, \"staking is paused\");\n require(msg.value >= minAmount, \"amount too low\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-biconomy", "title": "camdengrieh G", "severity_raw": "High", "severity": "high", "description": "1) SmartAccount.sol - Require Strings More than 32 bytes - 4 instances \n\nSaves 3 gas if string length is 32 characters or less\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L77-L78\n\n```solidity\n require(msg.sender == owner, \"Smart Account:: Sender is not authorized\");\n\n```\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L110-L111\n\n```solidity\n require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n\n```\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L128-L129\n\n```solidity\n require(_newEntryPoint != address(0), \"Smart Account:: new entry point address cannot be zero\");\n require(Address.isContract(_newEntryPoint), \"Smart Account:: new entry point address must be a contract\"\n```", "vulnerable_code": " require(msg.sender == owner, \"Smart Account:: Sender is not authorized\");\n", "fixed_code": " require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/camdengrieh-G.md", "collected_at": "2026-01-02T18:13:35.084589+00:00", "source_hash": "e6c15e462464327772c42287d1ebeb98574c133920713e954f8a71402625be8a", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 371, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "require(msg.sender == owner, \"Smart Account:: Sender is not authorized\");", "primary_code_language": "solidity", "primary_code_char_count": 73, "all_code_blocks": "// Code block 1 (solidity):\nrequire(msg.sender == owner, \"Smart Account:: Sender is not authorized\");\n\n// Code block 2 (solidity):\nrequire(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n\n// Code block 3 (solidity):\nrequire(_newEntryPoint != address(0), \"Smart Account:: new entry point address cannot be zero\");\n require(Address.isContract(_newEntryPoint), \"Smart Account:: new entry point address must be a contract\"", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "require(msg.sender == owner, \"Smart Account:: Sender is not authorized\");\n\nrequire(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n\nrequire(_newEntryPoint != address(0), \"Smart Account:: new entry point address cannot be zero\");\n require(Address.isContract(_newEntryPoint), \"Smart Account:: new entry point address must be a contract\"", "github_refs_formatted": "SmartAccount.sol#L77-L78, SmartAccount.sol#L110-L111, SmartAccount.sol#L128-L129", "github_files_list": "SmartAccount.sol", "github_refs_count": 3, "vulnerable_code_actual": " require(msg.sender == owner, \"Smart Account:: Sender is not authorized\");\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": " require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8.15} {"source": "c4", "protocol": "09-ondo", "title": "0xmystery Q", "severity_raw": "Low", "severity": "low", "description": "## Gas estimate on SourceBridge.burnAndCallAxelar\nThe UI may have the gas estimate taken care of. Nonetheless, users interacting with this function have no clue what amount of estimated `msg.value` to send along with the call. Apparently, `burnAndCallAxelar()` only checks if `msg.value` is not zero. \n\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/SourceBridge.sol#L72-L74\n\n```solidity\n if (msg.value == 0) {\n revert GasFeeTooLow();\n }\n```\nWhile this prevents the latter from calling the function without sending any ether, it does not ensure the amount of ether sent is adequate to cover the gas fees.\n\nConsider implementing the [Axelar gas estimate](https://docs.axelar.dev/dev/general-message-passing/gas-services/pay-gas) to the function logic where possible.\n\n## rUSDY.approve poses a threat to unsavvy users \nThe contract already has [`increaseAllowance()`](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDY.sol#L327-L337) and [`decreaseAllowance()`](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDY.sol#L353-L364) implemented as an alternative to [`approve()`](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDY.sol#L276-L279) that can be used as a mitigation to spender frontrunning the revised allowance. Where possible, remove `approve()` since user can always use `increaseAllowance()` for the same intended purpose.\n\n## Missing crucial check in RWADynamicOracle.simulateRange\nConsider adding the following check: \n\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/rwaOracles/RWADynamicOracle.sol#L119-L128\n\n```diff\n } else {\n Range memory lastRange = ranges[ranges.length - 1];\n uint256 prevClosePrice = derivePrice(lastRange, lastRange.end - 1);\n+ // Check that the endTime is greater than the last range's end time\n+ if (lastRange.end >= endTime) revert InvalidRange();\n rangeList[length] = Range(\n lastRange.end,\n endTim", "vulnerable_code": " if (msg.value == 0) {\n revert GasFeeTooLow();\n }", "fixed_code": "This will prevent underflow on line 266 below when internally calling `derivePrice()` in the for loop above:\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/rwaOracles/RWADynamicOracle.sol#L262-L274\n", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/0xmystery-Q.md", "collected_at": "2026-01-02T18:25:17.775914+00:00", "source_hash": "e6fb2a139b84dfe86f085bb9e16b1039317bdca3860c8a7a82c8f95755d8bb01", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 56, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "if (msg.value == 0) {\n revert GasFeeTooLow();\n }", "primary_code_language": "solidity", "primary_code_char_count": 56, "all_code_blocks": "// Code block 1 (solidity):\nif (msg.value == 0) {\n revert GasFeeTooLow();\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "if (msg.value == 0) {\n revert GasFeeTooLow();\n }", "github_refs_formatted": "SourceBridge.sol#L72-L74, rUSDY.sol#L327-L337, rUSDY.sol#L353-L364, rUSDY.sol#L276-L279, RWADynamicOracle.sol#L119-L128, RWADynamicOracle.sol#L262-L274", "github_files_list": "rUSDY.sol, RWADynamicOracle.sol, SourceBridge.sol", "github_refs_count": 6, "vulnerable_code_actual": " if (msg.value == 0) {\n revert GasFeeTooLow();\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "This will prevent underflow on line 266 below when internally calling `derivePrice()` in the for loop above:\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/rwaOracles/RWADynamicOracle.sol#L262-L274\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "06-lybra", "title": "0xWaitress Q", "severity_raw": "Medium", "severity": "medium", "description": "[QA-1] redundant code at excessIncomeDistribution can be refactored\n\nthese 3 lines exist in both `if` and `else`\n```solidity\n bool success = EUSD.transferFrom(msg.sender, address(configurator), income);\n require(success, \"TF\");\n\n try configurator.distributeRewards() {} catch {}\n```\n\n## Recommendation\n```solidity\nuint256 toTransfer = payAmount > income ? income : payAmount.\nbool success = EUSD.transferFrom(msg.sender, address(configurator), toTransfer);\nrequire(success, \"TF\");\ntry configurator.distributeRewards() {} catch {}\n```\n\n\n\n2. ", "vulnerable_code": " bool success = EUSD.transferFrom(msg.sender, address(configurator), income);\n require(success, \"TF\");\n\n try configurator.distributeRewards() {} catch {}", "fixed_code": "uint256 toTransfer = payAmount > income ? income : payAmount.\nbool success = EUSD.transferFrom(msg.sender, address(configurator), toTransfer);\nrequire(success, \"TF\");\ntry configurator.distributeRewards() {} catch {}", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/0xWaitress-Q.md", "collected_at": "2026-01-02T18:22:02.502294+00:00", "source_hash": "e703c34bf796f348c7340cd7e9fb67d1b84a9efdd1455da94583c05cca595487", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 389, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "bool success = EUSD.transferFrom(msg.sender, address(configurator), income);\n require(success, \"TF\");\n\n try configurator.distributeRewards() {} catch {}", "primary_code_language": "solidity", "primary_code_char_count": 174, "all_code_blocks": "// Code block 1 (solidity):\nbool success = EUSD.transferFrom(msg.sender, address(configurator), income);\n require(success, \"TF\");\n\n try configurator.distributeRewards() {} catch {}\n\n// Code block 2 (solidity):\nuint256 toTransfer = payAmount > income ? income : payAmount.\nbool success = EUSD.transferFrom(msg.sender, address(configurator), toTransfer);\nrequire(success, \"TF\");\ntry configurator.distributeRewards() {} catch {}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "bool success = EUSD.transferFrom(msg.sender, address(configurator), income);\n require(success, \"TF\");\n\n try configurator.distributeRewards() {} catch {}\n\nuint256 toTransfer = payAmount > income ? income : payAmount.\nbool success = EUSD.transferFrom(msg.sender, address(configurator), toTransfer);\nrequire(success, \"TF\");\ntry configurator.distributeRewards() {} catch {}", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " bool success = EUSD.transferFrom(msg.sender, address(configurator), income);\n require(success, \"TF\");\n\n try configurator.distributeRewards() {} catch {}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "uint256 toTransfer = payAmount > income ? income : payAmount.\nbool success = EUSD.transferFrom(msg.sender, address(configurator), toTransfer);\nrequire(success, \"TF\");\ntry configurator.distributeRewards() {} catch {}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5.15} {"source": "c4", "protocol": "03-revert-lend", "title": "K42 Analysis", "severity_raw": "Critical", "severity": "critical", "description": "### Advanced Analysis Report for [Revert-Lend](https://github.com/code-423n4/2024-03-revert-lend) by K42\n\n#### Overview\n\n[Revert-Lend](https://github.com/code-423n4/2024-03-revert-lend) is a sophisticated non-custodial lending protocol that allows users to borrow against their Uniswap V3 LP positions. The protocol consists of the core V3Vault contract for lending/borrowing, various yield optimization strategy contracts (AutoCompound, AutoExit, AutoRange), leverage management contracts (LeverageTransformer, FlashloanLiquidator), a custom V3Oracle for price feeds, an InterestRateModel for interest rate calculations, and utility contracts (V3Utils, Swapper).\n\n#### Understanding the Ecosystem:\n\nThe V3Vault is the clear heart of the [Revert-Lend](https://github.com/code-423n4/2024-03-revert-lend) ecosystem. It integrates with the following key components:\n\n1. V3Oracle: Provides USD price feeds for the LP tokens used as collateral. Uses a combination of Chainlink oracles and Uniswap V3 TWAPs.\n2. InterestRateModel: Calculates borrow and supply interest rates based on utilization.\n3. Automator: Abstract base contract for keeper-based automations like AutoCompound, AutoExit, AutoRange, defines common functionality like configuration of keeper roles and limits, withdrawing tokens, swap helper functions etc.\n4. AutoCompound, AutoExit, AutoRange: Optionally used for yield optimization strategies on the LP tokens used as collateral.\n4. LeverageTransformer, FlashloanLiquidator: Used for managing leveraged positions and liquidations respectively.\n5. V3Utils: A utility contract for common Uniswap V3 operations like collecting fees, changing ranges etc.\n6. Swapper: A utility contract for token swaps using 0x API or Uniswap Universal Router.\n\nUsers can deposit base assets to mint vault shares (following ERC4626) and use their Uniswap V3 LP tokens as collateral to borrow base assets. The automation contracts interact with the Vault to execute yield optimization strategies on the colla", "vulnerable_code": "#### Interaction Graph for [V3Oracle](https://github.com/code-423n4/2024-03-revert-lend/blob/main/src/V3Oracle.sol):\n", "fixed_code": "#### Interaction Graph for [InterestRateModel](https://github.com/code-423n4/2024-03-revert-lend/blob/main/src/InterestRateModel.sol):\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/K42-Analysis.md", "collected_at": "2026-01-02T19:03:01.051073+00:00", "source_hash": "e70a1a809a17879a93652363926ca2ddba4344fd6b254eef304009554db6e196", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "V3Oracle.sol, InterestRateModel.sol", "github_files_list": "V3Oracle.sol, InterestRateModel.sol", "github_refs_count": 2, "vulnerable_code_actual": "#### Interaction Graph for [V3Oracle](https://github.com/code-423n4/2024-03-revert-lend/blob/main/src/V3Oracle.sol):\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "#### Interaction Graph for [InterestRateModel](https://github.com/code-423n4/2024-03-revert-lend/blob/main/src/InterestRateModel.sol):\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "04-caviar", "title": "0x4non Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA\n\n## Low\n\n### L01 Unsafe downcasting\n\nOn [PrivatePool.sol#L230-L231](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L230-L231) there are two unsafe downcasting from `uint256` to `uint128`;\n```solidity\n virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n virtualNftReserves -= uint128(weightSum);\n```\n\nI think is possible under certain cirscunstances that `weightSum > uint128.max` or `netInputAmount - feeAmount - protocolFeeAmount > uint128.max`\n\nConsider using OpenZeppelin\u2019s SafeCast library to prevent unexpected overflows/underflows when casting from other types\n\n### L02 Its possible to reenter to `PrivatePool.change` function\n\nIts factible to reenter to the `change` function if you send more ether than you supposed to, the line tha makes possible the reentrancy is on [PrivatePool.sol#L436](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L436)\n\nI think its more practical to avoid native ETH in favour of always using WETH, this will make all contracts less complex.\n\nIf you want to test it out you could reuse [this test](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/test/EthRouter/Change.t.sol#L25-L57) and add a `receive() external payable` to reenter or do any action that you want before the protocol take you nft in give you and change it for another.\n\n\n### L03 Missing `address(0)` checks\n\n- `privatePoolMetadata` can be set to `address(0)` on [Factory.sol#L129-L131](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/Factory.sol#L129-L131)\n- `privatePoolImplementation` can be set to `address(0)` on [Factory.sol#L135-L137](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/Factory.sol#L135-L137)\n\n\n### L04 Missing bound check can set variables to extremes that make", "vulnerable_code": " virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n virtualNftReserves -= uint128(weightSum);", "fixed_code": "", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/0x4non-Q.md", "collected_at": "2026-01-02T18:19:16.269981+00:00", "source_hash": "e734456ae61fcc5d7c47c4fbf631234bdefac9973ab9432fab5be440c27bae6b", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 134, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n virtualNftReserves -= uint128(weightSum);", "primary_code_language": "solidity", "primary_code_char_count": 134, "all_code_blocks": "// Code block 1 (solidity):\nvirtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n virtualNftReserves -= uint128(weightSum);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n virtualNftReserves -= uint128(weightSum);", "github_refs_formatted": "PrivatePool.sol#L230-L231, PrivatePool.sol#L436, Change.t.sol#L25-L57, Factory.sol#L129-L131, Factory.sol#L135-L137", "github_files_list": "Change.t.sol, PrivatePool.sol, Factory.sol", "github_refs_count": 5, "vulnerable_code_actual": " virtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n virtualNftReserves -= uint128(weightSum);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "03-asymmetry", "title": "dimulski G", "severity_raw": "Low", "severity": "low", "description": "## Summary\n\n### Gas Optimizations\n| |Issue|Instances|Total Gas Saved|\n|-|:-|:-:|:-:|\n| [G‑01] | ` += ` costs more gas than ` = + ` for state variables (`-=` too) | 4 | 452 |\n| [G‑02] | Functions guaranteed to revert when called by normal users can be marked `payable` | 14 | 294 |\n| [G‑03] | Setting the constructor to `payable` | 4 | - |\n\nTotal: 22 instances over 3 issues with **746 gas** saved.\n\n\n## Gas Optimizations\n\n### [G‑01] | ` += ` costs more gas than ` = + ` for state variables (`-=` too) \n\nUsing the addition operator instead of plus-equals saves **[113 gas](https://gist.github.com/IllIllI000/cbbfb267425b898e5be734d4008d4fe8)**. Subtructions act the same way.\n\n*There are 4 instances of this issue:*\n\n```solidity\nFile: contracts\\SafEth\\SafEth.sol\n72: underlyingValue += (derivatives[i].ethPerDerivative(derivatives[i].balance()) * derivatives[i].balance()) / 10 ** 18;\n\n95: totalStakeValueEth += derivativeReceivedEthValue;\n\n172: localTotalWeight += weights[i];\n\n192: localTotalWeight += weights[i];\n\n```\n\n### [G‑02] Functions guaranteed to revert when called by normal users can be marked `payable`\nIf a function modifier such as `onlyOwner` is used, the function will revert if a normal user tries to pay the function. Marking the function as `payable` will lower the gas cost for legitimate callers because the compiler will not include checks for whether a payment was provided. The extra opcodes avoided are \n`CALLVALUE`(2),`DUP1`(3),`ISZERO`(3),`PUSH2`(3),`JUMPI`(10),`PUSH1`(3),`DUP1`(3),`REVERT`(0),`JUMPDEST`(1),`POP`(2), which costs an average of about **21 gas per call** to the function, in addition to the extra deployment cost.\n\n*There are 14 instances of this issue:*\n\n```solidity\nFile: contracts\\SafEth\\SafEth.sol\n138: function rebalanceToWeights() external onlyOwner {}\n\n165: function adjustWeight(uint256 _derivativeIndex,uint256weight) external onlyOwner {}\n\n182: function addDerivative(addre", "vulnerable_code": "File: contracts\\SafEth\\SafEth.sol\n72: underlyingValue += (derivatives[i].ethPerDerivative(derivatives[i].balance()) * derivatives[i].balance()) / 10 ** 18;\n\n95: totalStakeValueEth += derivativeReceivedEthValue;\n\n172: localTotalWeight += weights[i];\n\n192: localTotalWeight += weights[i];\n", "fixed_code": "File: contracts\\SafEth\\SafEth.sol\n138: function rebalanceToWeights() external onlyOwner {}\n\n165: function adjustWeight(uint256 _derivativeIndex,uint256weight) external onlyOwner {}\n\n182: function addDerivative(address _contractAddress,uint256 _weight) external onlyOwner {}\n\n202: function setMaxSlippage(uint _derivativeIndex,uint _slippage) external onlyOwner {}\n\n214: function setMinAmount(uint256 _minAmount) external onlyOwner {}\n\n223: function setMaxAmount(uint256 _maxAmount) external onlyOwner {}\n\n232: function setPauseStaking(bool _pause) external onlyOwner {}\n\n241: function setPauseUnstaking(bool _pause) external onlyOwner {}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/dimulski-G.md", "collected_at": "2026-01-02T18:19:04.806762+00:00", "source_hash": "e7c65170e203cb82ce3a388f711c32f8824fcb22bc7e54c080ebddbb99d3cce9", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 286, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts\\SafEth\\SafEth.sol\n72: underlyingValue += (derivatives[i].ethPerDerivative(derivatives[i].balance()) * derivatives[i].balance()) / 10 ** 18;\n\n95: totalStakeValueEth += derivativeReceivedEthValue;\n\n172: localTotalWeight += weights[i];\n\n192: localTotalWeight += weights[i];", "primary_code_language": "solidity", "primary_code_char_count": 286, "all_code_blocks": "// Code block 1 (solidity):\nFile: contracts\\SafEth\\SafEth.sol\n72: underlyingValue += (derivatives[i].ethPerDerivative(derivatives[i].balance()) * derivatives[i].balance()) / 10 ** 18;\n\n95: totalStakeValueEth += derivativeReceivedEthValue;\n\n172: localTotalWeight += weights[i];\n\n192: localTotalWeight += weights[i];", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: contracts\\SafEth\\SafEth.sol\n72: underlyingValue += (derivatives[i].ethPerDerivative(derivatives[i].balance()) * derivatives[i].balance()) / 10 ** 18;\n\n95: totalStakeValueEth += derivativeReceivedEthValue;\n\n172: localTotalWeight += weights[i];\n\n192: localTotalWeight += weights[i];", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: contracts\\SafEth\\SafEth.sol\n72: underlyingValue += (derivatives[i].ethPerDerivative(derivatives[i].balance()) * derivatives[i].balance()) / 10 ** 18;\n\n95: totalStakeValueEth += derivativeReceivedEthValue;\n\n172: localTotalWeight += weights[i];\n\n192: localTotalWeight += weights[i];\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts\\SafEth\\SafEth.sol\n138: function rebalanceToWeights() external onlyOwner {}\n\n165: function adjustWeight(uint256 _derivativeIndex,uint256weight) external onlyOwner {}\n\n182: function addDerivative(address _contractAddress,uint256 _weight) external onlyOwner {}\n\n202: function setMaxSlippage(uint _derivativeIndex,uint _slippage) external onlyOwner {}\n\n214: function setMinAmount(uint256 _minAmount) external onlyOwner {}\n\n223: function setMaxAmount(uint256 _maxAmount) external onlyOwner {}\n\n232: function setPauseStaking(bool _pause) external onlyOwner {}\n\n241: function setPauseUnstaking(bool _pause) external onlyOwner {}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-ondo", "title": "codeislight G", "severity_raw": "Informational", "severity": "informational", "description": "1. reconstructing CashManager mapping variables\n\nfrom\n\n```\n // Struct representing all redemption requests in an epoch\n struct RedemptionRequests {\n // Total CASH burned in the epoch\n uint256 totalBurned;\n // Mapping from address to amount of CASH address burned\n mapping(address => uint256) addressToBurnAmt;\n }\n\n // Mapping from epoch to redemption info struct for that epoch\n mapping(uint256 => RedemptionRequests) public redemptionInfoPerEpoch;\n\n // Mapping used for getting the exchange rate during a given epoch\n mapping(uint256 => uint256) public epochToExchangeRate;\n\n // Nested mapping containing mint requests for an epoch\n // { : { : }\n mapping(uint256 => mapping(address => uint256)) public mintRequestsPerEpoch;\n```\nto:\n```\n // Struct representing all requests in an epoch\n struct Request {\n uint128 mintAmt;\n uint128 burnAmt;\n }\n // Struct representing all information in an epoch\n struct Info {\n uint128 exchangeRate;\n uint128 totalBurned;\n }\n\n mapping(uint256 => mapping(address => Request)) public requestsPerEpoch;\n\n mapping(uint256 => Info) public infoPerEpoch;\n```\n\n2. CashManager requestManager needs to check if there is any fees for feesInCollateral before transferring.\n\n```\n function requestMint(uint256 collateralAmountIn)\n\t\u2026\n uint256 feesInCollateral = _getMintFees(collateralAmountIn);\n ...\n if (feesInCollateral > 0)\n collateral.safeTransferFrom(\n msg.sender,\n feeRecipient,\n feesInCollateral\n );\n```\n3. improve on CashManager.completeRedemptions(), we have a reptetivite loops which can be merged into 1. in essence, there is _check and _process.\nBest approach would be to include the code within the check in the process to save on extra unnecessary iterations.\n```\n function completeRedemptions(\n address[] calldata redeemers,\n address[] calldata refundee", "vulnerable_code": " // Struct representing all redemption requests in an epoch\n struct RedemptionRequests {\n // Total CASH burned in the epoch\n uint256 totalBurned;\n // Mapping from address to amount of CASH address burned\n mapping(address => uint256) addressToBurnAmt;\n }\n\n // Mapping from epoch to redemption info struct for that epoch\n mapping(uint256 => RedemptionRequests) public redemptionInfoPerEpoch;\n\n // Mapping used for getting the exchange rate during a given epoch\n mapping(uint256 => uint256) public epochToExchangeRate;\n\n // Nested mapping containing mint requests for an epoch\n // { : { : }\n mapping(uint256 => mapping(address => uint256)) public mintRequestsPerEpoch;", "fixed_code": " // Struct representing all requests in an epoch\n struct Request {\n uint128 mintAmt;\n uint128 burnAmt;\n }\n // Struct representing all information in an epoch\n struct Info {\n uint128 exchangeRate;\n uint128 totalBurned;\n }\n\n mapping(uint256 => mapping(address => Request)) public requestsPerEpoch;\n\n mapping(uint256 => Info) public infoPerEpoch;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/codeislight-G.md", "collected_at": "2026-01-02T18:15:01.436239+00:00", "source_hash": "e7f93e878484aecdccb4845f43b37eb11ccb8ef82fe9dd937738f21269ed9bfe", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 1422, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "// Struct representing all redemption requests in an epoch\n struct RedemptionRequests {\n // Total CASH burned in the epoch\n uint256 totalBurned;\n // Mapping from address to amount of CASH address burned\n mapping(address => uint256) addressToBurnAmt;\n }\n\n // Mapping from epoch to redemption info struct for that epoch\n mapping(uint256 => RedemptionRequests) public redemptionInfoPerEpoch;\n\n // Mapping used for getting the exchange rate during a given epoch\n mapping(uint256 => uint256) public epochToExchangeRate;\n\n // Nested mapping containing mint requests for an epoch\n // { : { : }\n mapping(uint256 => mapping(address => uint256)) public mintRequestsPerEpoch;", "primary_code_language": "unknown", "primary_code_char_count": 718, "all_code_blocks": "// Code block 1 (unknown):\n// Struct representing all redemption requests in an epoch\n struct RedemptionRequests {\n // Total CASH burned in the epoch\n uint256 totalBurned;\n // Mapping from address to amount of CASH address burned\n mapping(address => uint256) addressToBurnAmt;\n }\n\n // Mapping from epoch to redemption info struct for that epoch\n mapping(uint256 => RedemptionRequests) public redemptionInfoPerEpoch;\n\n // Mapping used for getting the exchange rate during a given epoch\n mapping(uint256 => uint256) public epochToExchangeRate;\n\n // Nested mapping containing mint requests for an epoch\n // { : { : }\n mapping(uint256 => mapping(address => uint256)) public mintRequestsPerEpoch;\n\n// Code block 2 (unknown):\n// Struct representing all requests in an epoch\n struct Request {\n uint128 mintAmt;\n uint128 burnAmt;\n }\n // Struct representing all information in an epoch\n struct Info {\n uint128 exchangeRate;\n uint128 totalBurned;\n }\n\n mapping(uint256 => mapping(address => Request)) public requestsPerEpoch;\n\n mapping(uint256 => Info) public infoPerEpoch;\n\n// Code block 3 (unknown):\nfunction requestMint(uint256 collateralAmountIn)\n\t\u2026\n uint256 feesInCollateral = _getMintFees(collateralAmountIn);\n ...\n if (feesInCollateral > 0)\n collateral.safeTransferFrom(\n msg.sender,\n feeRecipient,\n feesInCollateral\n );", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " // Struct representing all redemption requests in an epoch\n struct RedemptionRequests {\n // Total CASH burned in the epoch\n uint256 totalBurned;\n // Mapping from address to amount of CASH address burned\n mapping(address => uint256) addressToBurnAmt;\n }\n\n // Mapping from epoch to redemption info struct for that epoch\n mapping(uint256 => RedemptionRequests) public redemptionInfoPerEpoch;\n\n // Mapping used for getting the exchange rate during a given epoch\n mapping(uint256 => uint256) public epochToExchangeRate;\n\n // Nested mapping containing mint requests for an epoch\n // { : { : }\n mapping(uint256 => mapping(address => uint256)) public mintRequestsPerEpoch;", "has_vulnerable_code_snippet": true, "fixed_code_actual": " // Struct representing all requests in an epoch\n struct Request {\n uint128 mintAmt;\n uint128 burnAmt;\n }\n // Struct representing all information in an epoch\n struct Info {\n uint128 exchangeRate;\n uint128 totalBurned;\n }\n\n mapping(uint256 => mapping(address => Request)) public requestsPerEpoch;\n\n mapping(uint256 => Info) public infoPerEpoch;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "02-ai-arena", "title": "ALTERNATE report", "severity_raw": "Critical", "severity": "critical", "description": "# Overview\n\n## About C4\n\nCode4rena (C4) is an open organization consisting of security researchers, auditors, developers, and individuals with domain expertise in smart contracts.\n\nA C4 audit is an event in which community participants, referred to as Wardens, review, audit, or analyze smart contract logic in exchange for a bounty provided by sponsoring projects.\n\nDuring the audit outlined in this document, C4 conducted an analysis of the AI Arena smart contract system written in Solidity. The audit took place between February 9\u2014February 21 2024.\n\nFollowing the C4 audit, 3 wardens ([d3e4](https://code4rena.com/@d3e4), [fnanni](https://code4rena.com/@fnanni), and [niser93](https://code4rena.com/@niser93)) reviewed the mitigations for all identified issues; the [mitigation review report](#mitigation-review) is appended below the audit report.\n\n## Wardens\n\n299 Wardens contributed reports to AI Arena:\n\n 1. [fnanni](https://code4rena.com/@fnanni)\n 2. [d3e4](https://code4rena.com/@d3e4)\n 3. [niser93](https://code4rena.com/@niser93)\n 4. [haxatron](https://code4rena.com/@haxatron)\n 5. [BARW](https://code4rena.com/@BARW) ([BenRai](https://code4rena.com/@BenRai) and [albertwh1te](https://code4rena.com/@albertwh1te))\n 6. [juancito](https://code4rena.com/@juancito)\n 7. [DanielArmstrong](https://code4rena.com/@DanielArmstrong)\n 8. [0xDetermination](https://code4rena.com/@0xDetermination)\n 9. [merlinboii](https://code4rena.com/@merlinboii)\n 10. [0x11singh99](https://code4rena.com/@0x11singh99)\n 11. [MrPotatoMagic](https://code4rena.com/@MrPotatoMagic)\n 12. [klau5](https://code4rena.com/@klau5)\n 13. [MidgarAudits](https://code4rena.com/@MidgarAudits) ([vangrim](https://code4rena.com/@vangrim) and [EVDoc](https://code4rena.com/@EVDoc))\n 14. [Timenov](https://code4rena.com/@Timenov)\n 15. [lil\\_eth](https://code4rena.com/@lil_eth)\n 16. [btk](https://code4rena.com/@btk)\n 17. [givn](https://code4rena.com/@givn)\n 18. [rspadi](https://code4rena.com/@rspadi)\n 19. [josep", "vulnerable_code": " function addMinter(address newMinterAddress) external {\n require(msg.sender == _ownerAddress);\n _setupRole(MINTER_ROLE, newMinterAddress);\n }\n\n function _setupRole(bytes32 role, address account) internal virtual {\n _grantRole(role, account);\n }\n\n function _grantRole(bytes32 role, address account) internal virtual {\n if (!hasRole(role, account)) {\n _roles[role].members[account] = true;\n emit RoleGranted(role, account, _msgSender());\n }\n }\n", "fixed_code": "* [WARNING]\n * ====\n * This function should only be called from the constructor when setting\n * up the initial roles for the system.\n *\n * Using this function in any other way is effectively circumventing the admin\n * system imposed by {AccessControl}.\n * ====\n *\n * NOTE: This function is deprecated in favor of {_grantRole}.\n */\n function _setupRole(bytes32 role, address account) internal virtual {\n _grantRole(role, account);\n }\n\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it.\n */\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/ALTERNATE-report.md", "collected_at": "2026-01-02T19:01:55.874282+00:00", "source_hash": "e7fd39ada27d7eccb3d4bb1372548b68f26c87b5651a7a84efc9eb82040f85aa", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function addMinter(address newMinterAddress) external {\n require(msg.sender == _ownerAddress);\n _setupRole(MINTER_ROLE, newMinterAddress);\n }\n\n function _setupRole(bytes32 role, address account) internal virtual {\n _grantRole(role, account);\n }\n\n function _grantRole(bytes32 role, address account) internal virtual {\n if (!hasRole(role, account)) {\n _roles[role].members[account] = true;\n emit RoleGranted(role, account, _msgSender());\n }\n }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "* [WARNING]\n * ====\n * This function should only be called from the constructor when setting\n * up the initial roles for the system.\n *\n * Using this function in any other way is effectively circumventing the admin\n * system imposed by {AccessControl}.\n * ====\n *\n * NOTE: This function is deprecated in favor of {_grantRole}.\n */\n function _setupRole(bytes32 role, address account) internal virtual {\n _grantRole(role, account);\n }\n\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it.\n */\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "02-ethos", "title": "Awesome Q", "severity_raw": "High", "severity": "high", "description": "# 1. Use mixedCase\n\nIt is recommended to use the mixedCase naming convention for improving the readability and consistency of source code.\n\nThis convention involves combining words with no spaces, with the first letter of each word capitalized except for the first word.\n\nFor more information, see the Solidity style guide at the following link:\n\n- [Naming Convention For Local and State Variable Names](https://docs.soliditylang.org/en/v0.5.3/style-guide.html#local-and-state-variable-names)\n\nAffected lines of code:\n\n- [TroveManager.sol#L86](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L86)\n\n- [TroveManager.sol#L116](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L116)\n\n- [TroveManager.sol#L119-L120](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/TroveManager.sol#L119-L120)\n\n# 2. Unspecific Compiler Version Pragma\n\nIt is generally not recommended to use floating pragmas (i.e. pragmas that do not specify a specific compiler version) in contracts that are not intended to be used as libraries.\n\nThis is because using floating pragmas in application contracts can pose a security risk.\n\nFor example, a known vulnerable compiler version may be selected by mistake, or security tools might revert to an older compiler version that produces a different EVM compilation than the one intended to be deployed on the blockchain.\n\nTo avoid these potential issues, consider specifying a specific compiler version in your pragmas.\n\nSo instead of using a floating pragma like `pragma solidity ^0.8.0;`, it is better to use a concrete compiler version like `pragma solidity 0.8.17;`.\n\nMore information can be found in the following links:\n\n- [Consensys Audit of 1inch](https://consensys.net/diligence/audits/2020/12/1inch-liquidity-protocol/#unspecific-compiler-version-pragma)\n- [Solidity docs](https://docs.soliditylang.org/en/latest/layout-of-sou", "vulnerable_code": "import {contract1, contract2} from \"filename.sol\";", "fixed_code": "File: Ethos-Core/contracts/TroveManager.sol\nLine 936: * The debt recorded on the trove's struct is zero'd elswhere, in _closeTrove.\n\n...\n\nLine 1155: * this indicates that rewards have occured since the snapshot was made, and the user therefore has", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/Awesome-Q.md", "collected_at": "2026-01-02T18:15:56.779773+00:00", "source_hash": "e80b526b64d5159080b31373d8940c79b829e577132e97a282902e8ddde4093e", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "TroveManager.sol#L86, TroveManager.sol#L116, TroveManager.sol#L119-L120", "github_files_list": "TroveManager.sol", "github_refs_count": 3, "vulnerable_code_actual": "import {contract1, contract2} from \"filename.sol\";", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: Ethos-Core/contracts/TroveManager.sol\nLine 936: * The debt recorded on the trove's struct is zero'd elswhere, in _closeTrove.\n\n...\n\nLine 1155: * this indicates that rewards have occured since the snapshot was made, and the user therefore has", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "09-ondo", "title": "c3phas G", "severity_raw": "High", "severity": "high", "description": "# Codebase Optimization Report\n\n## Auditor's Disclaimer \n\nWhile we try our best to maintain readability in the provided code snippets, some functions have been truncated to highlight the affected portions.\n\nIt's important to note that during the implementation of these suggested changes, developers must exercise caution to avoid introducing vulnerabilities. Although the optimizations have been tested prior to these recommendations, it is the responsibility of the developers to conduct thorough testing again.\n\nCode reviews and additional testing are strongly advised to minimize any potential risks associated with the refactoring process.\n\n## Table of contents\n\n- [Codebase Optimization Report](#codebase-optimization-report)\n - [Auditor's Disclaimer](#auditors-disclaimer)\n - [Table of contents](#table-of-contents)\n - [Codebase impressions](#codebase-impressions)\n - [Note on Gas estimates.](#note-on-gas-estimates)\n - [Pack structs by putting data types that can fit together next to each other](#pack-structs-by-putting-data-types-that-can-fit-together-next-to-each-other)\n - [We can pack start and end together by reducing their size to `uint48` since they are just timestamps(save 1 SLOT: 2K Gas)](#we-can-pack-start-and-end-together-by-reducing-their-size-to-uint48-since-they-are-just-timestampssave-1-slot-2k-gas)\n - [The function should first verify if msg.value \\> 0 before performing any other operation(Save 7146 Gas)](#the-function-should-first-verify-if-msgvalue--0-before-performing-any-other-operationsave-7146--gas)\n - [Optimize the function `_mintIfThresholdMet()`](#optimize-the-function-_mintifthresholdmet)\n - [Only read state if we are going to execute the entire logic(Saves ~2000 gas for the state read)](#only-read-state-if-we-are-going-to-execute-the-entire-logicsaves-2000-gas-for-the-state-read)\n - [Optimize check order: avoid making any state reads/writes if we have to validate some function parameters](#optimize-check-order-avoid-making-any-st", "vulnerable_code": "File: /contracts/rwaOracles/RWADynamicOracle.sol\n295: struct Range {\n296: uint256 start;\n297: uint256 end;\n298: uint256 dailyInterestRate;\n299: uint256 prevRangeClosePrice;\n300: }", "fixed_code": "https://github.com/code-423n4/2023-09-ondo/blob/02ebedeeb85b708345a4deb53a2b543ecae160d0/contracts/bridge/SourceBridge.sol#L61-L74\n\n### The function should first verify if msg.value > 0 before performing any other operation(Save 7146 Gas)\n\n**In case of a revert on `msg.value == 0` we save 7146 gas on average from the protocol gas tests(to simulate the sad path ie `msg.value == 0` see the test modification)**\n\n| | Min | Average | Median | Max |\n| ------ | --- | ------- | ----- | ----- |\n| Before | 9815 | 9815 | 9815 | 9815 |\n| After | 2669 | 2669 | 2669 | 2669 |\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/c3phas-G.md", "collected_at": "2026-01-02T18:25:49.338976+00:00", "source_hash": "e852dbf1b958cb6819e9e151901d7ddabec8e409d4a18e6f242fb412fee4b7f1", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SourceBridge.sol#L61-L74", "github_files_list": "SourceBridge.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: /contracts/rwaOracles/RWADynamicOracle.sol\n295: struct Range {\n296: uint256 start;\n297: uint256 end;\n298: uint256 dailyInterestRate;\n299: uint256 prevRangeClosePrice;\n300: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "https://github.com/code-423n4/2023-09-ondo/blob/02ebedeeb85b708345a4deb53a2b543ecae160d0/contracts/bridge/SourceBridge.sol#L61-L74\n\n### The function should first verify if msg.value > 0 before performing any other operation(Save 7146 Gas)\n\n**In case of a revert on `msg.value == 0` we save 7146 gas on average from the protocol gas tests(to simulate the sad path ie `msg.value == 0` see the test modification)**\n\n| | Min | Average | Median | Max |\n| ------ | --- | ------- | ----- | ----- |\n| Before | 9815 | 9815 | 9815 | 9815 |\n| After | 2669 | 2669 | 2669 | 2669 |\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "10-badger", "title": "SAQ G", "severity_raw": "High", "severity": "high", "description": "## Summary\n\n### Gas Optimization\n\nno | Issue |Instances||\n|-|:-|:-:|:-:|\n| [G-01] | Avoid contract existence checks by using low level calls | 13 - more than | - |\n| [G-02] | Internal functions only called once can be inlined to save gas | 6 | - |\n| [G-03] | keccak256()\u00a0should only need to be called on a specific string literal once | 1 | - |\n| [G-04] | Optimize Names to save Gas | 5 | - |\n| [G-05] | USE A MORE RECENT VERSION OF SOLIDITY | All files - 39 | - |\n| [G-06] | Using\u00a0PRIVATE\u00a0rather than\u00a0PUBLIC\u00a0FOR Constants/Immutable, Saves Gas | 6 | - |\n| [G-07] | Require()/Revert() string longer than 32 bytes cost extra gas | 10 | - |\n| [G-08] | SPLITTING\u00a0\u00a0REQUIRE() STATEMENTS THAT USE\u00a0\u00a0&& SAVES GAS | 4 | - |\n| [G-09] | Setting the constructor to payable | 4 | - |\n| [G-10] | Before transfer of some functions, we should check some variables for possible gas save | 2 | - |\n| [G-11] | Require() or revert() statements that check input arguments should be at the top of the function | 7 | - |\n| [G-12] | Bytes constants are more efficient than String constants | 6 | - |\n| [G-13] | Don't compare boolean expressions to boolean literals | 1 | - |\n| [G-14] | State varaibles only set in the Constructor should be declared Immutable | 2 | - |\n| [G-15] | Using storage instead of memory for structs/arrays saves gas | 5 | - |\n| [G-16] | Duplicated require()/if() checks should be refactored to a modifier or function | 1 | - |\n| [G-17] | Use constants instead of type(uintx).max | 5 | - |\n| [G-18] | A modifier used only once and not being inherited should be inlined to save gas | 3 | - |\n| [G-19] | abi.encode() is less efficient than abi.encodepacked() | 1 | - |\n| [G-20] | Do not calculate constant | 1 | - |\n| [G-21] | Structs can be packed into fewer storage slots by editing time variables | 1 | - |\n| [G-22] | require() Should Be Used Instead Of assert() | 1 | - |\n| [G-23] | Use assembly to emit events | 4 | - |\n| [G-24] | Use hardcode address instead address(this) | 4 | - |\n| [G-25] | ", "vulnerable_code": "file: /contracts/contracts/ActivePool.sol\n\n60 address _authorityAddress = address(AuthNoOwner(cdpManagerAddress).authority());\n\n186 ICollSurplusPool(_account).increaseTotalSurplusCollShares(_shares);\n\n272 uint256 oldRate = collateral.getPooledEthByShares(DECIMAL_PRECISION);\n\n278 receiver.onFlashLoan(msg.sender, token, amount, fee, data) == FLASH_SUCCESS_VALUE,\n\n303 collateral.getPooledEthByShares(DECIMAL_PRECISION) == oldRate,\n\n337 return collateral.balanceOf(address(this));\n\n391 ICdpManagerData(cdpManagerAddress).syncGlobalAccountingAndGracePeriod(); // Accrue State First\n\n418 ICdpManagerData(cdpManagerAddress).syncGlobalAccountingAndGracePeriod(); // Accrue State First\n", "fixed_code": "file: /contracts/contracts/BorrowerOperations.sol\n\n364 vars.collShares = cdpManager.getCdpCollShares(_cdpId);\n\n367 uint256 _cdpStEthBalance = collateral.getPooledEthByShares(vars.collShares);\n\n372 vars.oldICR = EbtcMath._computeCR(_cdpStEthBalance, vars.debt, vars.price);\n\n465 uint256 _netCollAsShares = collateral.getSharesByPooledEth(vars.netStEthBalance);\n\n466 uint256 _liquidatorRewardShares = collateral.getSharesByPooledEth(LIQUIDATOR_REWARD);\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/SAQ-G.md", "collected_at": "2026-01-02T18:26:36.092492+00:00", "source_hash": "e86e26eeda883c06333badd4313971f0937324e667b009d04289ab32b5cfa330", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "file: /contracts/contracts/ActivePool.sol\n\n60 address _authorityAddress = address(AuthNoOwner(cdpManagerAddress).authority());\n\n186 ICollSurplusPool(_account).increaseTotalSurplusCollShares(_shares);\n\n272 uint256 oldRate = collateral.getPooledEthByShares(DECIMAL_PRECISION);\n\n278 receiver.onFlashLoan(msg.sender, token, amount, fee, data) == FLASH_SUCCESS_VALUE,\n\n303 collateral.getPooledEthByShares(DECIMAL_PRECISION) == oldRate,\n\n337 return collateral.balanceOf(address(this));\n\n391 ICdpManagerData(cdpManagerAddress).syncGlobalAccountingAndGracePeriod(); // Accrue State First\n\n418 ICdpManagerData(cdpManagerAddress).syncGlobalAccountingAndGracePeriod(); // Accrue State First\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "file: /contracts/contracts/BorrowerOperations.sol\n\n364 vars.collShares = cdpManager.getCdpCollShares(_cdpId);\n\n367 uint256 _cdpStEthBalance = collateral.getPooledEthByShares(vars.collShares);\n\n372 vars.oldICR = EbtcMath._computeCR(_cdpStEthBalance, vars.debt, vars.price);\n\n465 uint256 _netCollAsShares = collateral.getSharesByPooledEth(vars.netStEthBalance);\n\n466 uint256 _liquidatorRewardShares = collateral.getSharesByPooledEth(LIQUIDATOR_REWARD);\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "04-caviar", "title": "Kaysoft Q", "severity_raw": "Low", "severity": "low", "description": "## [LC-01] AVOID FLOATING PRAGMA\nLock the prama version to ensure the contracts are deployed with the same version that they were tested with.\nConsider changing \n```\npragma solidity ^0.8.19;\n```\nto \n```\npragma solidity 0.8.19;\n```\nfiles: all files\nsee: https://swcregistry.io/docs/SWC-103\n\n## [LC-02] USE THE SAFECAST LIBRARY FOR CASTING VALUES TO AVOID OVERFLOW/UNDERFLOW\nFile: https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L230L231\n```\nvirtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n virtualNftReserves -= uint128(weightSum);\n```\n\n## [NC-01] Lines too long\nFile: https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L58-L60\nThe Solidity style guide recommends maximum of 120 characters per line of code. Use a formatter to ensure code are formatted to follow this guidelines.\n\n```\nevent Initialize(address indexed baseToken, address indexed nft, uint128 virtualBaseTokenReserves, uint128 virtualNftReserves, uint56 changeFee, uint16 feeRate, bytes32 merkleRoot, bool useStolenNftOracle, bool payRoyalties);\n event Buy(uint256[] tokenIds, uint256[] tokenWeights, uint256 inputAmount, uint256 feeAmount, uint256 protocolFeeAmount, uint256 royaltyFeeAmount);\n event Sell(uint256[] tokenIds, uint256[] tokenWeights, uint256 outputAmount, uint256 feeAmount, uint256 protocolFeeAmount, uint256 royaltyFeeAmount);\n```\n\n", "vulnerable_code": "pragma solidity ^0.8.19;", "fixed_code": "pragma solidity 0.8.19;", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/Kaysoft-Q.md", "collected_at": "2026-01-02T18:19:45.734260+00:00", "source_hash": "e895b91998367c6d9cd191e10832431378ce175cd124bfdbf8a08488751a1108", "code_block_count": 4, "solidity_block_count": 0, "total_code_chars": 712, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "pragma solidity ^0.8.19;", "primary_code_language": "unknown", "primary_code_char_count": 24, "all_code_blocks": "// Code block 1 (unknown):\npragma solidity ^0.8.19;\n\n// Code block 2 (unknown):\npragma solidity 0.8.19;\n\n// Code block 3 (unknown):\nvirtualBaseTokenReserves += uint128(netInputAmount - feeAmount - protocolFeeAmount);\n virtualNftReserves -= uint128(weightSum);\n\n// Code block 4 (unknown):\nevent Initialize(address indexed baseToken, address indexed nft, uint128 virtualBaseTokenReserves, uint128 virtualNftReserves, uint56 changeFee, uint16 feeRate, bytes32 merkleRoot, bool useStolenNftOracle, bool payRoyalties);\n event Buy(uint256[] tokenIds, uint256[] tokenWeights, uint256 inputAmount, uint256 feeAmount, uint256 protocolFeeAmount, uint256 royaltyFeeAmount);\n event Sell(uint256[] tokenIds, uint256[] tokenWeights, uint256 outputAmount, uint256 feeAmount, uint256 protocolFeeAmount, uint256 royaltyFeeAmount);", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "PrivatePool.sol#L230, PrivatePool.sol#L58-L60", "github_files_list": "PrivatePool.sol", "github_refs_count": 2, "vulnerable_code_actual": "pragma solidity ^0.8.19;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "pragma solidity 0.8.19;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9.83} {"source": "c4", "protocol": "02-ai-arena", "title": "PetarTolev G", "severity_raw": "Medium", "severity": "medium", "description": "## Gas Optimization Issues\n\n| ID | Finding |\n| ------ | ------------------------------------------------------------------------------------ |\n| [G-01] | Redundant `attributeProbabilities` Initialization in the `AiArenaHelper` Constructor |\n| [G-02] | Utilize Cached Variable in Require Statement Checks |\n| [G-03] | Use `_spendAllowance` in `Neuron.burnFrom` |\n| [G-04] | Omit Redundant Allowance Check in `Neuron.claim` |\n| [G-05] | Cache Array Length in Loops |\n| [G-06] | Reuse Cached Variables |\n| [G-07] | Avoid Modifying Storage Variables with Zero |\n\n### [G-01] Redundant `attributeProbabilities` Initialization in the `AiArenaHelper` Constructor\n\nGitHub: [Link](https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/AiArenaHelper.sol#L49), [Link](https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/AiArenaHelper.sol#L137)\n\nThe deployment cost is unnecessarily increased due to the `probabilities` being set twice in the `attributeProbabilities` mapping within the constructor: initially through the [addAttributeProbabilities](https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/AiArenaHelper.sol#L137) function and then within a [for loop](https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/AiArenaHelper.sol#L49). Therefore, it's advised to eliminate the `addAttributeProbabilities` call from the constructor.\n\nAdditionally, incorporate the `require(probabilities.length == 6, \"Invalid number of attribute arrays\");` statement in the constructor for validat", "vulnerable_code": "### [G-04] Omit Redundant Allowance Check in `Neuron.claim`\n\nThe [allowance check](https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/Neuron.sol#L139-L142) is already performed within `ERC20.transferFrom` -> `ERC20._spendAllowance`, making it unnecessary.\n\n[ERC20.\\_spendAllowance](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/b438cb695a1ac520cee6678610b161b1d5df4d9c/contracts/token/ERC20/ERC20.sol#L337)\n", "fixed_code": "### [G-05] Cache Array Length in Loops\n\nIn [FighterFarm.redeemMintPass](https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L233), caching `mintpassIdsToBurn.length` will decrease gas costs.\n\n#### Recommendation\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/PetarTolev-G.md", "collected_at": "2026-01-02T19:02:38.034427+00:00", "source_hash": "e8a61c3ad71eaf0bb163c4ed7edc1726d28d596999877908ed82273193d76a5a", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "AiArenaHelper.sol#L49, AiArenaHelper.sol#L137, Neuron.sol#L139-L142, ERC20.sol#L337, FighterFarm.sol#L233", "github_files_list": "ERC20.sol, Neuron.sol, AiArenaHelper.sol, FighterFarm.sol", "github_refs_count": 5, "vulnerable_code_actual": "### [G-04] Omit Redundant Allowance Check in `Neuron.claim`\n\nThe [allowance check](https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/Neuron.sol#L139-L142) is already performed within `ERC20.transferFrom` -> `ERC20._spendAllowance`, making it unnecessary.\n\n[ERC20.\\_spendAllowance](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/b438cb695a1ac520cee6678610b161b1d5df4d9c/contracts/token/ERC20/ERC20.sol#L337)\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "### [G-05] Cache Array Length in Loops\n\nIn [FighterFarm.redeemMintPass](https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L233), caching `mintpassIdsToBurn.length` will decrease gas costs.\n\n#### Recommendation\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-ondo", "title": "oberon G", "severity_raw": "Medium", "severity": "medium", "description": "### REFACTOR SIMILAR REQUIRE()/REVERT()\n---\n```javascript\nfunction oracleType() private view {\n require(\n fTokenToOracleType[fToken] == OracleType.CHAINLINK,\n \"OracleType must be Chainlink\"\n );\n}\n255: oracleType();\n280: oracleType();\n```\n\n[OndoPriceOracleV2:255_280](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/OndoPriceOracleV2.sol#L255)\n\n\n### USE MULTIPLE REQUIRE() FOR &&\n---\n```javascript\n require(answeredInRound >= roundId);\n require((updatedAt >= block.timestamp - maxChainlinkOracleTimeDelay),\n \"Chainlink oracle price is stale\"\n );\n```\n\n[OndoPriceOracleV2:293](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/OndoPriceOracleV2.sol#L293)\n[CTokenCash:46](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cCash/CTokenCash.sol#L46)\n[CTokenModified:46](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/tokens/cToken/CTokenModified.sol#L46)\n\n\n### USE FUNCTIONS INSTEAD OF MODIFIERS\n---\n```javascript\nfunction updateEpoch() private view {\n transitionEpoch();\n}\n```\n\n[CashManager:557](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L557)\n[CashManager:883](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L883)\n[CashFactory:151](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashFactory.sol#L151)\n[CashKYCSenderFactory:162](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashKYCSenderFactory.sol#L162)\n[CashKYCSenderReceiverFactory:162](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/factory/CashKYCSenderReceiverFactory.sol#L162)\n\n\n### X += Y COSTS MORE THAN X = X + Y FOR STATE VARIABLES\n---\n```javascript\n currentEpoch = currentEpoch + epochDifference;\n```\n\n[CashManager.sol:582_630_649_681](https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/CashManager.sol#L582)\n", "vulnerable_code": "function oracleType() private view {\n require(\n fTokenToOracleType[fToken] == OracleType.CHAINLINK,\n \"OracleType must be Chainlink\"\n );\n}\n255: oracleType();\n280: oracleType();", "fixed_code": " require(answeredInRound >= roundId);\n require((updatedAt >= block.timestamp - maxChainlinkOracleTimeDelay),\n \"Chainlink oracle price is stale\"\n );", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/oberon-G.md", "collected_at": "2026-01-02T18:15:24.171850+00:00", "source_hash": "e8e298fb26ad10d3b22b6d697448f70b12a8c8a9973904d06c28d095c58852f0", "code_block_count": 4, "solidity_block_count": 0, "total_code_chars": 456, "github_ref_count": 10, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function oracleType() private view {\n require(\n fTokenToOracleType[fToken] == OracleType.CHAINLINK,\n \"OracleType must be Chainlink\"\n );\n}\n255: oracleType();\n280: oracleType();", "primary_code_language": "javascript", "primary_code_char_count": 191, "all_code_blocks": "// Code block 1 (javascript):\nfunction oracleType() private view {\n require(\n fTokenToOracleType[fToken] == OracleType.CHAINLINK,\n \"OracleType must be Chainlink\"\n );\n}\n255: oracleType();\n280: oracleType();\n\n// Code block 2 (javascript):\nrequire(answeredInRound >= roundId);\n require((updatedAt >= block.timestamp - maxChainlinkOracleTimeDelay),\n \"Chainlink oracle price is stale\"\n );\n\n// Code block 3 (javascript):\nfunction updateEpoch() private view {\n transitionEpoch();\n}\n\n// Code block 4 (javascript):\ncurrentEpoch = currentEpoch + epochDifference;", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "OndoPriceOracleV2.sol#L255, OndoPriceOracleV2.sol#L293, CTokenCash.sol#L46, CTokenModified.sol#L46, CashManager.sol#L557, CashManager.sol#L883, CashFactory.sol#L151, CashKYCSenderFactory.sol#L162, CashKYCSenderReceiverFactory.sol#L162, CashManager.sol#L582", "github_files_list": "CashManager.sol, CTokenCash.sol, CTokenModified.sol, CashKYCSenderFactory.sol, CashFactory.sol, OndoPriceOracleV2.sol, CashKYCSenderReceiverFactory.sol", "github_refs_count": 10, "vulnerable_code_actual": "function oracleType() private view {\n require(\n fTokenToOracleType[fToken] == OracleType.CHAINLINK,\n \"OracleType must be Chainlink\"\n );\n}\n255: oracleType();\n280: oracleType();", "has_vulnerable_code_snippet": true, "fixed_code_actual": " require(answeredInRound >= roundId);\n require((updatedAt >= block.timestamp - maxChainlinkOracleTimeDelay),\n \"Chainlink oracle price is stale\"\n );", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "01-biconomy", "title": "lukris02 G", "severity_raw": "Low", "severity": "low", "description": "# Gas Optimizations Report for Biconomy - Smart Contract Wallet contest\n## Overview\nDuring the audit, 2 gas issues were found. \n\nTotal savings ~455.\n\n\u2116 | Title | Instance Count | Saved\n--- | --- | --- | ---\nG-1 | Use unchecked blocks for incrementing | 10 | 350\nG-2 | Use unchecked blocks for subtractions where underflow is impossible | 3 | 105\n\n## Gas Optimizations Findings(2)\n### G-1. Use unchecked blocks for incrementing\n##### Description\nIn Solidity 0.8+, there\u2019s a default overflow and underflow check on unsigned integers. In the loops, \"i\" (or other variable) will not overflow because the loop will run out of gas before that.\n##### Instances\n- https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L216\n- https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L502)\n- https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/base/ModuleManager.sol#L124\n- https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L100\n- https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L107\n- https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L112\n- https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L114\n- https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L128\n- https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L134\n- https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.", "vulnerable_code": "for (uint256 i; i < n; ++i) {\n // ...\n}", "fixed_code": "for (uint256 i; i < n;) { \n // ...\n unchecked { ++i; }\n}", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/lukris02-G.md", "collected_at": "2026-01-02T18:13:53.532320+00:00", "source_hash": "e8ea311919027f92a343a4f4fcd77f41518d0d4406013bacdc33d916e4edfb72", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 9, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SmartAccount.sol#L216, SmartAccount.sol#L502, ModuleManager.sol#L124, EntryPoint.sol#L100, EntryPoint.sol#L107, EntryPoint.sol#L112, EntryPoint.sol#L114, EntryPoint.sol#L128, EntryPoint.sol#L134", "github_files_list": "ModuleManager.sol, SmartAccount.sol, EntryPoint.sol", "github_refs_count": 9, "vulnerable_code_actual": "for (uint256 i; i < n; ++i) {\n // ...\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "for (uint256 i; i < n;) { \n // ...\n unchecked { ++i; }\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "08-dopex", "title": "MLmochi Q", "severity_raw": "High", "severity": "high", "description": "By MLmochi\nemail wooddustsniffer@gmail.com\ndiscord MLmochi#0400\ncode4rena contest: https://github.com/code-423n4/2023-08-dopex/tree/main\n\nOverview\n- LOW 01- Conflicting reservesIndex mappings\n- LOW 02- Incorrect reserveTokens element popped\n\n--- \n# LOW 01- Conflicting reservesIndex mappings\n## Description\n\n\nIn the Core-contract: `contract/core/RdpxV2Core.sol` the function:`addAssetTotokenReserves(address _asset, string memory _assetSymbol)` \nallows the **Admin** to add new Assets to the reserve. It checks that the reserveAssets's **address** is not already present, **however** it does not check if the input `string memory _assetSymbol` is already present. \n\nRepo Link: https://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/core/RdpxV2Core.sol#L240C36-L240C36\n\n```\n function addAssetTotokenReserves(\n address _asset,\n string memory _assetSymbol\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n require(_asset != address(0), \"RdpxV2Core: asset cannot be 0 address\");\n\n for (uint256 i = 1; i < reserveAsset.length; i++) {\n require(\n reserveAsset[i].tokenAddress != _asset,\n \"RdpxV2Core: asset already exists\"\n );\n }\n\n ReserveAsset memory asset = ReserveAsset({\n tokenAddress: _asset,\n tokenBalance: 0,\n tokenSymbol: _assetSymbol\n });\n reserveAsset.push(asset);\n reserveTokens.push(_assetSymbol);\n\n reservesIndex[_assetSymbol] = reserveAsset.length - 1;\n\n emit LogAssetAddedTotokenReserves(_asset, _assetSymbol);\n }\n```\n\nAdding a new reserveAsset with an existing `_assetSymbol` will render the entire previous existing `reseveAsset` inaccessible, which can result a loss of user funds. Due to the dependency on `reservesIndex` to extract a `reserveAsset` in this contract essential functions such as : \n\n- `_purchaseOptions(...)`\n- `_stake(...)`\n- `_transfer(...)`\n- `_bondWithDelegate(...)` \n- `settle(...)\n- etc .. \n### Assessed type\n**admin privilege**\n## Burden of proof\nAdd", "vulnerable_code": " function addAssetTotokenReserves(\n address _asset,\n string memory _assetSymbol\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n require(_asset != address(0), \"RdpxV2Core: asset cannot be 0 address\");\n\n for (uint256 i = 1; i < reserveAsset.length; i++) {\n require(\n reserveAsset[i].tokenAddress != _asset,\n \"RdpxV2Core: asset already exists\"\n );\n }\n\n ReserveAsset memory asset = ReserveAsset({\n tokenAddress: _asset,\n tokenBalance: 0,\n tokenSymbol: _assetSymbol\n });\n reserveAsset.push(asset);\n reserveTokens.push(_assetSymbol);\n\n reservesIndex[_assetSymbol] = reserveAsset.length - 1;\n\n emit LogAssetAddedTotokenReserves(_asset, _assetSymbol);\n }", "fixed_code": " function settle(\n uint256[] memory optionIds\n )\n external\n onlyRole(DEFAULT_ADMIN_ROLE)\n returns (uint256 amountOfWeth, uint256 rdpxAmount)\n {\n _whenNotPaused();\n (amountOfWeth, rdpxAmount) = IPerpetualAtlanticVault(\n addresses.perpetualAtlanticVault\n ).settle(optionIds);\n for (uint256 i = 0; i < optionIds.length; i++) {\n optionsOwned[optionIds[i]] = false;\n }\n\n reserveAsset[reservesIndex[\"WETH\"]].tokenBalance += amountOfWeth;\n reserveAsset[reservesIndex[\"RDPX\"]].tokenBalance -= rdpxAmount;\n\n emit LogSettle(optionIds);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/MLmochi-Q.md", "collected_at": "2026-01-02T18:24:50.630626+00:00", "source_hash": "e9617adfade01a0bb26c2ab2f6a78ec3feafc0391ed918b32f4554d16408900f", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 715, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function addAssetTotokenReserves(\n address _asset,\n string memory _assetSymbol\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n require(_asset != address(0), \"RdpxV2Core: asset cannot be 0 address\");\n\n for (uint256 i = 1; i < reserveAsset.length; i++) {\n require(\n reserveAsset[i].tokenAddress != _asset,\n \"RdpxV2Core: asset already exists\"\n );\n }\n\n ReserveAsset memory asset = ReserveAsset({\n tokenAddress: _asset,\n tokenBalance: 0,\n tokenSymbol: _assetSymbol\n });\n reserveAsset.push(asset);\n reserveTokens.push(_assetSymbol);\n\n reservesIndex[_assetSymbol] = reserveAsset.length - 1;\n\n emit LogAssetAddedTotokenReserves(_asset, _assetSymbol);\n }", "primary_code_language": "unknown", "primary_code_char_count": 715, "all_code_blocks": "// Code block 1 (unknown):\nfunction addAssetTotokenReserves(\n address _asset,\n string memory _assetSymbol\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n require(_asset != address(0), \"RdpxV2Core: asset cannot be 0 address\");\n\n for (uint256 i = 1; i < reserveAsset.length; i++) {\n require(\n reserveAsset[i].tokenAddress != _asset,\n \"RdpxV2Core: asset already exists\"\n );\n }\n\n ReserveAsset memory asset = ReserveAsset({\n tokenAddress: _asset,\n tokenBalance: 0,\n tokenSymbol: _assetSymbol\n });\n reserveAsset.push(asset);\n reserveTokens.push(_assetSymbol);\n\n reservesIndex[_assetSymbol] = reserveAsset.length - 1;\n\n emit LogAssetAddedTotokenReserves(_asset, _assetSymbol);\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "RdpxV2Core.sol#L240-L36", "github_files_list": "RdpxV2Core.sol", "github_refs_count": 1, "vulnerable_code_actual": " function addAssetTotokenReserves(\n address _asset,\n string memory _assetSymbol\n ) external onlyRole(DEFAULT_ADMIN_ROLE) {\n require(_asset != address(0), \"RdpxV2Core: asset cannot be 0 address\");\n\n for (uint256 i = 1; i < reserveAsset.length; i++) {\n require(\n reserveAsset[i].tokenAddress != _asset,\n \"RdpxV2Core: asset already exists\"\n );\n }\n\n ReserveAsset memory asset = ReserveAsset({\n tokenAddress: _asset,\n tokenBalance: 0,\n tokenSymbol: _assetSymbol\n });\n reserveAsset.push(asset);\n reserveTokens.push(_assetSymbol);\n\n reservesIndex[_assetSymbol] = reserveAsset.length - 1;\n\n emit LogAssetAddedTotokenReserves(_asset, _assetSymbol);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function settle(\n uint256[] memory optionIds\n )\n external\n onlyRole(DEFAULT_ADMIN_ROLE)\n returns (uint256 amountOfWeth, uint256 rdpxAmount)\n {\n _whenNotPaused();\n (amountOfWeth, rdpxAmount) = IPerpetualAtlanticVault(\n addresses.perpetualAtlanticVault\n ).settle(optionIds);\n for (uint256 i = 0; i < optionIds.length; i++) {\n optionsOwned[optionIds[i]] = false;\n }\n\n reserveAsset[reservesIndex[\"WETH\"]].tokenBalance += amountOfWeth;\n reserveAsset[reservesIndex[\"RDPX\"]].tokenBalance -= rdpxAmount;\n\n emit LogSettle(optionIds);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-biconomy", "title": "bloxploit G", "severity_raw": "Gas", "severity": "gas", "description": "# Gas Optimisation Report\n\n## Require,Asset and Revert string size should be small\n\n\n### Require\n\n```bash\n./paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol:49: require(!Address.isContract(paymasterId), \"Paymaster Id can not be smart contract address\");\n\n```\n\nOccurance:[VerifyingSingletonPaymaster.sol](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol)\n\n\n### Revert\n\n```bash\n./paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol:42: revert(\"Deposit must be for a paymasterId. Use depositFor\");\n./paymasters/BasePaymaster.sol:52: revert(\"must override\");\n```\n\nOccurance:[VerifyingSingletonPaymaster.sol](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol),[BasePaymaster.sol](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol)\n\n\n## Empty block should be removed or made to revert something.\n\n```bash\n./SmartAccount.sol:550: receive() external payable {}\n./aa-4337/core/EntryPoint.sol:119: try aggregator.validateSignatures(ops, opa.signature) {}\n./aa-4337/core/EntryPoint.sol:458: try IPaymaster(paymaster).postOp{gas : mUserOp.verificationGasLimit}(mode, context, actualGasCost) {}\n./SmartAccountNoAuth.sol:540: receive() external payable {}\n```\n\nOccurance:[SmartAccount.sol](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol),[Entrypoint.sol](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol),[SmartAccountNoAuth.sol](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol)\n\n", "vulnerable_code": "Occurance:[VerifyingSingletonPaymaster.sol](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol)\n\n\n### Revert\n", "fixed_code": "Occurance:[VerifyingSingletonPaymaster.sol](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol),[BasePaymaster.sol](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol)\n\n\n## Empty block should be removed or made to revert something.\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/bloxploit-G.md", "collected_at": "2026-01-02T18:13:34.177397+00:00", "source_hash": "e96d39a753d2551eae80496e7017f9a8a3028d930c73b8b34ab7ed2770481858", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 753, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "./paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol:49: require(!Address.isContract(paymasterId), \"Paymaster Id can not be smart contract address\");", "primary_code_language": "bash", "primary_code_char_count": 168, "all_code_blocks": "// Code block 1 (bash):\n./paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol:49: require(!Address.isContract(paymasterId), \"Paymaster Id can not be smart contract address\");\n\n// Code block 2 (bash):\n./paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol:42: revert(\"Deposit must be for a paymasterId. Use depositFor\");\n./paymasters/BasePaymaster.sol:52: revert(\"must override\");\n\n// Code block 3 (bash):\n./SmartAccount.sol:550: receive() external payable {}\n./aa-4337/core/EntryPoint.sol:119: try aggregator.validateSignatures(ops, opa.signature) {}\n./aa-4337/core/EntryPoint.sol:458: try IPaymaster(paymaster).postOp{gas : mUserOp.verificationGasLimit}(mode, context, actualGasCost) {}\n./SmartAccountNoAuth.sol:540: receive() external payable {}", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "VerifyingSingletonPaymaster.sol, VerifyingSingletonPaymaster.sol),[BasePaymaster.sol, BasePaymaster.sol, SmartAccount.sol),[Entrypoint.sol, EntryPoint.sol),[SmartAccountNoAuth.sol, SmartAccountNoAuth.sol", "github_files_list": "SmartAccountNoAuth.sol, VerifyingSingletonPaymaster.sol, BasePaymaster.sol, SmartAccount.sol),[Entrypoint.sol, EntryPoint.sol),[SmartAccountNoAuth.sol, VerifyingSingletonPaymaster.sol),[BasePaymaster.sol", "github_refs_count": 6, "vulnerable_code_actual": "Occurance:[VerifyingSingletonPaymaster.sol](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol)\n\n\n### Revert\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "Occurance:[VerifyingSingletonPaymaster.sol](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol),[BasePaymaster.sol](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol)\n\n\n## Empty block should be removed or made to revert something.\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "02-ethos", "title": "Kaysoft G", "severity_raw": "Low", "severity": "low", "description": "## [G-01] USE {unchecked ++i}/{unchecked i++} for ++i/i++ when operation is not possible to overflow.\n\nFiles:\n- [Ethos-Core/contracts/CollateralConfig.sol#L56](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/CollateralConfig.sol#L56)\n\n- [Ethos-Core/contracts/StabilityPool.sol#L351](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/StabilityPool.sol#L351)\n\n- [Ethos-Core/contracts/StabilityPool.sol#L397](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/StabilityPool.sol#L397)\n\n- [Ethos-Core/contracts/StabilityPool.sol#L640](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/StabilityPool.sol#L640)\n\n- [Ethos-Core/contracts/StabilityPool.sol#L810](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/StabilityPool.sol#L810)\n\n- [Ethos-Core/contracts/StabilityPool.sol#L831](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/StabilityPool.sol#L831)\n\n- [Ethos-Core/contracts/StabilityPool.sol#L859](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/StabilityPool.sol#L859)\n\n## [G-02] require()/revert() strings that are longer that 32 bytes cost extra gas\n\nEvery extra bytes more than the original 32 incurs extra MSTORE which is 3 gas.\nsee: https://gist.github.com/hrkrshnn/ee8fabd532058307229d65dcd5836ddc#consider-having-short-revert-strings\n\nFiles:\n- [Ethos-Vault/contracts/ReaperVaultV2.sol#L150](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Vault/contracts/ReaperVaultV2.sol#L150)\n\n```\nrequire(!emergencyShutdown, \"Cannot add strategy during emergency shutdown\");\n```\n\n## [G-03] x = x + y cost less gas than x +=y ", "vulnerable_code": "require(!emergencyShutdown, \"Cannot add strategy during emergency shutdown\");", "fixed_code": "", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/Kaysoft-G.md", "collected_at": "2026-01-02T18:16:17.996705+00:00", "source_hash": "e9ad6a2adb3354335e09f34a2a925768e806d082dfc0c2fc6fe89a0fd84195d7", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 77, "github_ref_count": 8, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "require(!emergencyShutdown, \"Cannot add strategy during emergency shutdown\");", "primary_code_language": "unknown", "primary_code_char_count": 77, "all_code_blocks": "// Code block 1 (unknown):\nrequire(!emergencyShutdown, \"Cannot add strategy during emergency shutdown\");", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CollateralConfig.sol#L56, StabilityPool.sol#L351, StabilityPool.sol#L397, StabilityPool.sol#L640, StabilityPool.sol#L810, StabilityPool.sol#L831, StabilityPool.sol#L859, ReaperVaultV2.sol#L150", "github_files_list": "ReaperVaultV2.sol, CollateralConfig.sol, StabilityPool.sol", "github_refs_count": 8, "vulnerable_code_actual": "require(!emergencyShutdown, \"Cannot add strategy during emergency shutdown\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "04-caviar", "title": "Polaris_tow G", "severity_raw": "High", "severity": "high", "description": "## SETTING THE CONSTRUCTOR TO PAYABLE\n Saves ~13 gas per instance\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L90\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/Factory.sol#L53\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L143\n```\n constructor(address _factory, address _royaltyRegistry, address _stolenNftOracle) {\n factory = payable(_factory);\n royaltyRegistry = _royaltyRegistry;\n stolenNftOracle = _stolenNftOracle;\n }\n```\n## FUNCTIONS GUARANTEED TO REVERT WHEN CALLED BY NORMAL USERS CAN BE MARKED PAYABLE\nIf a function modifier or require such as onlyOwner/onlyX is used, the function will revert if a normal user tries to pay the function. Marking the function as payable will lower the gas cost for legitimate callers because the compiler will not include checks for whether a payment was provided. The extra opcodes avoided are CALLVALUE(2), DUP1(3), ISZERO(3), PUSH2(3), JUMPI(10), PUSH1(3), DUP1(3), REVERT(0), JUMPDEST(1), POP(2) which costs an average of about 21 gas per call to the function, in addition to the extra deployment cost.\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/Factory.sol#L129\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/Factory.sol#L135\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/Factory.sol#L141\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/Factory.sol#L148\n` function withdraw(address token, uint256 amount) public onlyOwner {`\n\n## CAN MAKE THE VARIABLE OUTSIDE THE LOOP TO SAVE GAS\nMake it outside and only use it inside.\nhttps://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L106-L111\n```\n ", "vulnerable_code": " constructor(address _factory, address _royaltyRegistry, address _stolenNftOracle) {\n factory = payable(_factory);\n royaltyRegistry = _royaltyRegistry;\n stolenNftOracle = _stolenNftOracle;\n }", "fixed_code": " for (uint256 i = 0; i < buys.length; i++) {\n if (buys[i].isPublicPool) {\n // execute the buy against a public pool\n uint256 inputAmount = Pair(buys[i].pool).nftBuy{value: buys[i].baseTokenAmount}(\n buys[i].tokenIds, buys[i].baseTokenAmount, 0\n );", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/Polaris_tow-G.md", "collected_at": "2026-01-02T18:19:57.688322+00:00", "source_hash": "e9fbe3d97863ba69f3da6ffa742bd241aa38f7d8c10fe2b67239811619b2d91b", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 214, "github_ref_count": 8, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "constructor(address _factory, address _royaltyRegistry, address _stolenNftOracle) {\n factory = payable(_factory);\n royaltyRegistry = _royaltyRegistry;\n stolenNftOracle = _stolenNftOracle;\n }", "primary_code_language": "unknown", "primary_code_char_count": 214, "all_code_blocks": "// Code block 1 (unknown):\nconstructor(address _factory, address _royaltyRegistry, address _stolenNftOracle) {\n factory = payable(_factory);\n royaltyRegistry = _royaltyRegistry;\n stolenNftOracle = _stolenNftOracle;\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "EthRouter.sol#L90, Factory.sol#L53, PrivatePool.sol#L143, Factory.sol#L129, Factory.sol#L135, Factory.sol#L141, Factory.sol#L148, EthRouter.sol#L106-L111", "github_files_list": "EthRouter.sol, Factory.sol, PrivatePool.sol", "github_refs_count": 8, "vulnerable_code_actual": " constructor(address _factory, address _royaltyRegistry, address _stolenNftOracle) {\n factory = payable(_factory);\n royaltyRegistry = _royaltyRegistry;\n stolenNftOracle = _stolenNftOracle;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " for (uint256 i = 0; i < buys.length; i++) {\n if (buys[i].isPublicPool) {\n // execute the buy against a public pool\n uint256 inputAmount = Pair(buys[i].pool).nftBuy{value: buys[i].baseTokenAmount}(\n buys[i].tokenIds, buys[i].baseTokenAmount, 0\n );", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-ondo", "title": "Kaysoft Q", "severity_raw": "High", "severity": "high", "description": "## [NC-01] Use named imports\n\nFiles: All files.\n\nConsider using named imports like below\n\n```jsx\nimport {CTokenCash} from \"./CTokenCash.sol\";\n\n```\n\ninstead of \n\n```jsx\nimport \"./CTokenCash.sol\";\n\n```\n\n## [NC-02] Include the parameters in NatSpec comments\n- [KYCRegistryClientInitializable.sol#L58](https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/cash/kyc/KYCRegistryClientInitializable.sol#L58)\n\n```jsx\n/**\n * @dev Internal function to future-proof parent linearization. Matches OZ\n * upgradeable suggestions\n */\n function __KYCRegistryClientInitializable_init_unchained(\n address _kycRegistry,\n uint256 _kycRequirementGroup\n ) internal onlyInitializing {\n _setKYCRegistry(_kycRegistry);\n _setKYCRequirementGroup(_kycRequirementGroup);\n }\n\n```\n\n\n\n## [L-01] Use latest Solidity stable version 0.8.17\n\nFiles: All files\nLatest stable versions of Soildity compilers have bugfixes and security improvement.\n\nsee: https://swcregistry.io/docs/SWC-102\n#### Recommended Mitigation Steps\nConsider using latest Solidity version.\n\n\n## [L-02] Avoid floating pragma\nFiles: All files\n\nSee: https://swcregistry.io/docs/SWC-103\n\n#### Recommended Mitigation Steps\nConsider using fixed pragma version like below\n\n```jsx\npragma solidity 0.8.17;\n\n```\n\n## [L-03] Solidity compiler optimization can be problematic\n\n```\nconst config: HardhatUserConfig = {\n solidity: {\n compilers: [\n {\n version: \"0.8.16\",\n settings: {\n optimizer: {\n enabled: true,\n runs: 100,\n },\n },\n },\n```\n\n\n### Description\n\nProtocol has enabled optional compiler optimizations in Solidity. There have been several optimization bugs with security implications. Moreover, optimizations are actively being developed. Solidity compiler optimizations are disabled by default, and it is unclear how many contracts in the wild actually use them.\n\nTherefore, it is unclear how well they are being tested and ", "vulnerable_code": "instead of \n", "fixed_code": "## [NC-02] Include the parameters in NatSpec comments\n- [KYCRegistryClientInitializable.sol#L58](https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/cash/kyc/KYCRegistryClientInitializable.sol#L58)\n", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/Kaysoft-Q.md", "collected_at": "2026-01-02T18:14:40.885996+00:00", "source_hash": "ea982861509eeafd76869050b3ad0a7b524bb007f31d8ac0a2c57c9bc1bd42b7", "code_block_count": 5, "solidity_block_count": 0, "total_code_chars": 681, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "import {CTokenCash} from \"./CTokenCash.sol\";", "primary_code_language": "jsx", "primary_code_char_count": 44, "all_code_blocks": "// Code block 1 (jsx):\nimport {CTokenCash} from \"./CTokenCash.sol\";\n\n// Code block 2 (jsx):\nimport \"./CTokenCash.sol\";\n\n// Code block 3 (jsx):\n/**\n * @dev Internal function to future-proof parent linearization. Matches OZ\n * upgradeable suggestions\n */\n function __KYCRegistryClientInitializable_init_unchained(\n address _kycRegistry,\n uint256 _kycRequirementGroup\n ) internal onlyInitializing {\n _setKYCRegistry(_kycRegistry);\n _setKYCRequirementGroup(_kycRequirementGroup);\n }\n\n// Code block 4 (jsx):\npragma solidity 0.8.17;\n\n// Code block 5 (unknown):\nconst config: HardhatUserConfig = {\n solidity: {\n compilers: [\n {\n version: \"0.8.16\",\n settings: {\n optimizer: {\n enabled: true,\n runs: 100,\n },\n },\n },", "all_code_blocks_count": 5, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "KYCRegistryClientInitializable.sol#L58", "github_files_list": "KYCRegistryClientInitializable.sol", "github_refs_count": 1, "vulnerable_code_actual": "instead of \n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## [NC-02] Include the parameters in NatSpec comments\n- [KYCRegistryClientInitializable.sol#L58](https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/cash/kyc/KYCRegistryClientInitializable.sol#L58)\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 11} {"source": "c4", "protocol": "03-asymmetry", "title": "0xpanicError G", "severity_raw": "Gas", "severity": "gas", "description": "https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol\n\n# Gas Optimizations\n\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [GAS-1](#GAS-1) | Intialise non-zero variables at the time of declaration | 1 |\n| [GAS-2](#GAS-2) | Cache array length in memory when called in loops | 5 |\n| [GAS-3](#GAS-3) | If value is read only once, load directly from storage | 2 |\n| [GAS-4](#GAS-4) | No need to loop to add or adjust totalWeight | 2 |\n### [GAS-1] Intialise non-zero variables at the time of declaration\nIf a variable will hold a non-zero value then it should be set to a non-zero value at time of declaration.\n\n`preDepositPrice` is declared and later set to either `10 ** 18` or `(10 ** 18 * underlyingValue) / totalSupply`. Instead it can be set to `10**18` and\nif total supply is not zero, set to `(10 ** 18 * underlyingValue) / totalSuppl`.\n\n*SSTORE requires 20000 gas from zero to non-zero but only 2900 from non-zero to non-zero*\n\n*Instances (1)*:\n```solidity\nFile: contracts/SafEth/SafEth.sol\n\n78: uint256 preDepositPrice; // Price of safETH in regards to ETH\n\n79: if (totalSupply == 0)\n\n80: preDepositPrice = 10 ** 18; // initializes with a price of 1\n\n81: else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n```\n\n### [GAS-2] Cache array length in memory when called in loops\nWhenever looping through an array, cache the array length in memory to save gas.\n\nIn the given loops, `derivativesCount` is called from storage for each iteration. Instead set `derivativesCount` in memory and call that\nin loops to save gas inside each function.\n\n*SLOAD requires 100 gas while MLOAD only requires 3 gas*\n\n*Instances (5)*:\n```solidity\nFile: contracts/SafEth/SafEth.sol\n\n71: for (uint i = 0; i < derivativeCount; i++)\n\n84: for (uint i = 0; i < derivativeCount; i++)\n\n113: for (uint256 i = 0; i < derivativeCount; i++)\n\n140: for (uint i = 0; i < derivativeCount; i++)\n\n147: for (uint i = 0; i < derivativeCount; i++)\n```\n\n### [GAS-3] If value is read only ", "vulnerable_code": "File: contracts/SafEth/SafEth.sol\n\n78: uint256 preDepositPrice; // Price of safETH in regards to ETH\n\n79: if (totalSupply == 0)\n\n80: preDepositPrice = 10 ** 18; // initializes with a price of 1\n\n81: else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;", "fixed_code": "File: contracts/SafEth/SafEth.sol\n\n71: for (uint i = 0; i < derivativeCount; i++)\n\n84: for (uint i = 0; i < derivativeCount; i++)\n\n113: for (uint256 i = 0; i < derivativeCount; i++)\n\n140: for (uint i = 0; i < derivativeCount; i++)\n\n147: for (uint i = 0; i < derivativeCount; i++)", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/0xpanicError-G.md", "collected_at": "2026-01-02T18:17:45.423274+00:00", "source_hash": "ea9b74b03c307df6ae981c13a62cafc4c5272bce81937842bdcd0dab0734fc1d", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 562, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/SafEth/SafEth.sol\n\n78: uint256 preDepositPrice; // Price of safETH in regards to ETH\n\n79: if (totalSupply == 0)\n\n80: preDepositPrice = 10 ** 18; // initializes with a price of 1\n\n81: else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;", "primary_code_language": "solidity", "primary_code_char_count": 276, "all_code_blocks": "// Code block 1 (solidity):\nFile: contracts/SafEth/SafEth.sol\n\n78: uint256 preDepositPrice; // Price of safETH in regards to ETH\n\n79: if (totalSupply == 0)\n\n80: preDepositPrice = 10 ** 18; // initializes with a price of 1\n\n81: else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n\n// Code block 2 (solidity):\nFile: contracts/SafEth/SafEth.sol\n\n71: for (uint i = 0; i < derivativeCount; i++)\n\n84: for (uint i = 0; i < derivativeCount; i++)\n\n113: for (uint256 i = 0; i < derivativeCount; i++)\n\n140: for (uint i = 0; i < derivativeCount; i++)\n\n147: for (uint i = 0; i < derivativeCount; i++)", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: contracts/SafEth/SafEth.sol\n\n78: uint256 preDepositPrice; // Price of safETH in regards to ETH\n\n79: if (totalSupply == 0)\n\n80: preDepositPrice = 10 ** 18; // initializes with a price of 1\n\n81: else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n\nFile: contracts/SafEth/SafEth.sol\n\n71: for (uint i = 0; i < derivativeCount; i++)\n\n84: for (uint i = 0; i < derivativeCount; i++)\n\n113: for (uint256 i = 0; i < derivativeCount; i++)\n\n140: for (uint i = 0; i < derivativeCount; i++)\n\n147: for (uint i = 0; i < derivativeCount; i++)", "github_refs_formatted": "SafEth.sol", "github_files_list": "SafEth.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: contracts/SafEth/SafEth.sol\n\n78: uint256 preDepositPrice; // Price of safETH in regards to ETH\n\n79: if (totalSupply == 0)\n\n80: preDepositPrice = 10 ** 18; // initializes with a price of 1\n\n81: else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/SafEth/SafEth.sol\n\n71: for (uint i = 0; i < derivativeCount; i++)\n\n84: for (uint i = 0; i < derivativeCount; i++)\n\n113: for (uint256 i = 0; i < derivativeCount; i++)\n\n140: for (uint i = 0; i < derivativeCount; i++)\n\n147: for (uint i = 0; i < derivativeCount; i++)", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-biconomy", "title": "pauliax G", "severity_raw": "Unknown", "severity": "unknown", "description": "* Maybe this could be extracted to a constant because this data does not change:\n```solidity\n bytes memory deploymentData = abi.encodePacked(type(Proxy).creationCode, uint(uint160(_defaultImpl)));\n```\n\n* I think ```PaymasterHelpers``` does not actually use ```ECDSA``` library:\n```solidity\n library PaymasterHelpers {\n using ECDSA for bytes32;\n```", "vulnerable_code": " bytes memory deploymentData = abi.encodePacked(type(Proxy).creationCode, uint(uint160(_defaultImpl)));", "fixed_code": " library PaymasterHelpers {\n using ECDSA for bytes32;", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/pauliax-G.md", "collected_at": "2026-01-02T18:13:59.807752+00:00", "source_hash": "eabdc0726bd440f855a50bff156088efe73bbdf2b9bac489c8c7024f41387884", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 157, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "bytes memory deploymentData = abi.encodePacked(type(Proxy).creationCode, uint(uint160(_defaultImpl)));", "primary_code_language": "solidity", "primary_code_char_count": 102, "all_code_blocks": "// Code block 1 (solidity):\nbytes memory deploymentData = abi.encodePacked(type(Proxy).creationCode, uint(uint160(_defaultImpl)));\n\n// Code block 2 (solidity):\nlibrary PaymasterHelpers {\n using ECDSA for bytes32;", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "bytes memory deploymentData = abi.encodePacked(type(Proxy).creationCode, uint(uint160(_defaultImpl)));\n\nlibrary PaymasterHelpers {\n using ECDSA for bytes32;", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " bytes memory deploymentData = abi.encodePacked(type(Proxy).creationCode, uint(uint160(_defaultImpl)));", "has_vulnerable_code_snippet": true, "fixed_code_actual": " library PaymasterHelpers {\n using ECDSA for bytes32;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 4.7} {"source": "c4", "protocol": "02-ethos", "title": "Aymen0909 G", "severity_raw": "Low", "severity": "low", "description": "# Gas Optimizations\n\n## Summary\n\n| | Issue | Instances |\n| :-------------: |:-------------|:-------------:|\n| 1 | Variables inside struct should be packed to save gas | 2 |\n| 2 | `storage` variable should be cached into `memory` variables instead of re-reading them | 6 |\n| 3 | Use `unchecked` blocks to save gas | 5 |\n| 4 | `x += y/x -= y` costs more gas than `x = x + y/x = x - y` for state variables | 9 |\n\n\n## Findings\n\n### 1- Variables inside `struct` should be packed to save gas :\n\nAs the solidity EVM works with 32 bytes, variables less than 32 bytes should be packed inside a struct so that they can be stored in the same slot, each slot saved can avoid an extra Gsset (20000 gas) for the first setting of the struct. Subsequent reads as well as writes have smaller gas savings.\n\nThere are 2 instance of this issue:\n\nFile: interfaces/vault/IVaultRegistry.sol [Line 7-22](https://github.com/code-423n4/2023-01-popcorn/blob/main/src/interfaces/vault/IVaultRegistry.sol#L7-L22)\n\n```solidity\nstruct Config {\n bool allowed;\n uint256 decimals;\n uint256 MCR;\n uint256 CCR;\n}\n```\n\nAs the `MCR` and `CCR` variables values can't really overflow **2^96** and the `decimals` value (usually less than 18) can't overflow **2^8**, so their values should be packed in order to save gas, the struct should be modified as follow :\n\n```solidity\nstruct Config {\n bool allowed;\n uint8 decimals;\n uint96 MCR;\n uint96 CCR;\n}\n```\n\n\nFile: ReaperVaultV2.sol [Line 25-33](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L25-L33)\n\n```solidity\nstruct StrategyParams {\n uint256 activation; // Activation block.timestamp\n uint256 feeBPS; // Performance fee taken from profit, in BPS\n uint256 allocBPS; // Allocation in BPS of vault's total assets\n uint256 allocated; // Amount of capital allocated to this strategy\n uint256 gains; // Total returns that Strategy has realized for Vault\n uint256 lo", "vulnerable_code": "struct Config {\n bool allowed;\n uint256 decimals;\n uint256 MCR;\n uint256 CCR;\n}", "fixed_code": "struct Config {\n bool allowed;\n uint8 decimals;\n uint96 MCR;\n uint96 CCR;\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/Aymen0909-G.md", "collected_at": "2026-01-02T18:15:57.230222+00:00", "source_hash": "eb12089b3ba5a1f1eca0743983eb4f917c72051e40671b2db54b00a748d77cf7", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 178, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "struct Config {\n bool allowed;\n uint256 decimals;\n uint256 MCR;\n uint256 CCR;\n}", "primary_code_language": "solidity", "primary_code_char_count": 91, "all_code_blocks": "// Code block 1 (solidity):\nstruct Config {\n bool allowed;\n uint256 decimals;\n uint256 MCR;\n uint256 CCR;\n}\n\n// Code block 2 (solidity):\nstruct Config {\n bool allowed;\n uint8 decimals;\n uint96 MCR;\n uint96 CCR;\n}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "struct Config {\n bool allowed;\n uint256 decimals;\n uint256 MCR;\n uint256 CCR;\n}\n\nstruct Config {\n bool allowed;\n uint8 decimals;\n uint96 MCR;\n uint96 CCR;\n}", "github_refs_formatted": "IVaultRegistry.sol#L7-L22, ReaperVaultV2.sol#L25-L33", "github_files_list": "IVaultRegistry.sol, ReaperVaultV2.sol", "github_refs_count": 2, "vulnerable_code_actual": "struct Config {\n bool allowed;\n uint256 decimals;\n uint256 MCR;\n uint256 CCR;\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "struct Config {\n bool allowed;\n uint8 decimals;\n uint96 MCR;\n uint96 CCR;\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "08-dopex", "title": "HHK G", "severity_raw": "Gas", "severity": "gas", "description": "### GAS1: `reserveTokens` is not needed\n\n#### Technical Details\n\nIn the core contract, the storage array [`reserveTokens`](https://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/core/RdpxV2Core.sol#L70) is not needed as the token symbols are being stored in the `reserveAsset` array.\n\n#### Recommendation\n\nRemove `reserveTokens` and update the function [`removeAssetFromtokenReserves()`](https://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/core/RdpxV2Core.sol#L270) to use the `reserveAsset` array.\n\n### GAS2: If `minAmount` is set then no need to compute `minOut`.\n\n#### Technical Details\n\nIn the function [`_curveSwap()`](https://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/core/RdpxV2Core.sol#L515) of the core contract. `minOut` is always computed although it won't be use if `minAmount` was set in the params.\n\n#### Recommendation\n\nAdd an if statement to not compute `minOut` if `minAmount > 0`.\n\n### GAS3: Simplify `_calculateAmounts()` ratio\n\n#### Technical Details\n\nIn the function [`_calculateAmounts()`](https://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/core/RdpxV2Core.sol#L598) of the core contract, the `amount1` is calculated by recomputing the rdpx value and then finding the ratio of the bond amount.\n\nBut because the ratio of ETH and RDPX is a constant 75/25, we could just take 25% of the amount (rdpx part) and then apply the delegate fee.\n\n#### Recommendation\n\nRemove the oracle call and replace the `amount1` calculation with:\n```solidity\n// amount required for delegatee\namount1 = _amount * RDPX_RATIO_PERCENTAGE / (100 * DEFAULT_PRECISION)\n// account for delegate fee\namount1 = (amount1 * (100e8 - _delegateFee)) / 1e10;\n```\n\n### GAS4: `_whenNotPaused()` not needed in `mint()`\n\n#### Technical Details\n\nIn the [`mint()`](https://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd", "vulnerable_code": "// amount required for delegatee\namount1 = _amount * RDPX_RATIO_PERCENTAGE / (100 * DEFAULT_PRECISION)\n// account for delegate fee\namount1 = (amount1 * (100e8 - _delegateFee)) / 1e10;", "fixed_code": "", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/HHK-G.md", "collected_at": "2026-01-02T18:24:38.857397+00:00", "source_hash": "eb15777911cab28adf7fbfa1c410b3d3039e2ed24bae64882d3dd380b23ad048", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 183, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "// amount required for delegatee\namount1 = _amount * RDPX_RATIO_PERCENTAGE / (100 * DEFAULT_PRECISION)\n// account for delegate fee\namount1 = (amount1 * (100e8 - _delegateFee)) / 1e10;", "primary_code_language": "solidity", "primary_code_char_count": 183, "all_code_blocks": "// Code block 1 (solidity):\n// amount required for delegatee\namount1 = _amount * RDPX_RATIO_PERCENTAGE / (100 * DEFAULT_PRECISION)\n// account for delegate fee\namount1 = (amount1 * (100e8 - _delegateFee)) / 1e10;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "// amount required for delegatee\namount1 = _amount * RDPX_RATIO_PERCENTAGE / (100 * DEFAULT_PRECISION)\n// account for delegate fee\namount1 = (amount1 * (100e8 - _delegateFee)) / 1e10;", "github_refs_formatted": "RdpxV2Core.sol#L70, RdpxV2Core.sol#L270, RdpxV2Core.sol#L515, RdpxV2Core.sol#L598", "github_files_list": "RdpxV2Core.sol", "github_refs_count": 4, "vulnerable_code_actual": "// amount required for delegatee\namount1 = _amount * RDPX_RATIO_PERCENTAGE / (100 * DEFAULT_PRECISION)\n// account for delegate fee\namount1 = (amount1 * (100e8 - _delegateFee)) / 1e10;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "01-biconomy", "title": "Fon G", "severity_raw": "Informational", "severity": "informational", "description": "Function innerHandleOp is external but requires it be called from the contract entry point contract\n```solidity\n function innerHandleOp(bytes calldata callData, UserOpInfo memory opInfo, bytes calldata context) external returns (uint256 actualGasCost) {\n uint256 preGas = gasleft();\n require(msg.sender == address(this), \"AA92 internal call only\");\n```\nconsider changing the function to an internal function", "vulnerable_code": " function innerHandleOp(bytes calldata callData, UserOpInfo memory opInfo, bytes calldata context) external returns (uint256 actualGasCost) {\n uint256 preGas = gasleft();\n require(msg.sender == address(this), \"AA92 internal call only\");", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/Fon-G.md", "collected_at": "2026-01-02T18:13:04.885717+00:00", "source_hash": "ebb47840527a822de73fe9bc672e76fe095ed3066d1efc82042044565ee49146", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 249, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function innerHandleOp(bytes calldata callData, UserOpInfo memory opInfo, bytes calldata context) external returns (uint256 actualGasCost) {\n uint256 preGas = gasleft();\n require(msg.sender == address(this), \"AA92 internal call only\");", "primary_code_language": "solidity", "primary_code_char_count": 249, "all_code_blocks": "// Code block 1 (solidity):\nfunction innerHandleOp(bytes calldata callData, UserOpInfo memory opInfo, bytes calldata context) external returns (uint256 actualGasCost) {\n uint256 preGas = gasleft();\n require(msg.sender == address(this), \"AA92 internal call only\");", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function innerHandleOp(bytes calldata callData, UserOpInfo memory opInfo, bytes calldata context) external returns (uint256 actualGasCost) {\n uint256 preGas = gasleft();\n require(msg.sender == address(this), \"AA92 internal call only\");", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function innerHandleOp(bytes calldata callData, UserOpInfo memory opInfo, bytes calldata context) external returns (uint256 actualGasCost) {\n uint256 preGas = gasleft();\n require(msg.sender == address(this), \"AA92 internal call only\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 2.85} {"source": "c4", "protocol": "11-kelp", "title": "0xanmol G", "severity_raw": "Low", "severity": "low", "description": "## Unnecessary use of multiple mapping for the same key\n\nIn `LRTDepositConfig.sol` there are three mapping with the same key of token address.\n\n### Code Line\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/c5fdc2e62c5e1d78769f44d6e34a6fb9e40c00f0/src/LRTConfig.sol#L15C4-L17C78\n\n```js\n\n// @audit use struct instead\n mapping(address token => bool isSupported) public isSupportedAsset;\n mapping(address token => uint256 amount) public depositLimitByAsset;\n mapping(address token => address strategy) public override assetStrategy;\n\n```\n\n Instead of using multiple storage to store data corresponding to the same key, it can use a struct to store all data and update this struct when necessary. This way only one storage slot will be used saving a massive amount of gas, also it will be a lot easier to query the data this way.\n\n### Example\n\n```js\n\nstruct Asset {\n bool isSupportedAsset;\n uint256 depositLimit;\n address strategy; \n}\n\nmapping(address token => Asset asset) public asset;\n\n```", "vulnerable_code": "// @audit use struct instead\n mapping(address token => bool isSupported) public isSupportedAsset;\n mapping(address token => uint256 amount) public depositLimitByAsset;\n mapping(address token => address strategy) public override assetStrategy;\n", "fixed_code": "struct Asset {\n bool isSupportedAsset;\n uint256 depositLimit;\n address strategy; \n}\n\nmapping(address token => Asset asset) public asset;\n", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/0xanmol-G.md", "collected_at": "2026-01-02T18:27:12.754132+00:00", "source_hash": "ebd6cfe606ce39f4dfc4fe679a97f6a0492001870a70a1509c9c0142b5e0517c", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 393, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "// @audit use struct instead\n mapping(address token => bool isSupported) public isSupportedAsset;\n mapping(address token => uint256 amount) public depositLimitByAsset;\n mapping(address token => address strategy) public override assetStrategy;", "primary_code_language": "js", "primary_code_char_count": 251, "all_code_blocks": "// Code block 1 (js):\n// @audit use struct instead\n mapping(address token => bool isSupported) public isSupportedAsset;\n mapping(address token => uint256 amount) public depositLimitByAsset;\n mapping(address token => address strategy) public override assetStrategy;\n\n// Code block 2 (js):\nstruct Asset {\n bool isSupportedAsset;\n uint256 depositLimit;\n address strategy; \n}\n\nmapping(address token => Asset asset) public asset;", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LRTConfig.sol#L15-L4", "github_files_list": "LRTConfig.sol", "github_refs_count": 1, "vulnerable_code_actual": "// @audit use struct instead\n mapping(address token => bool isSupported) public isSupportedAsset;\n mapping(address token => uint256 amount) public depositLimitByAsset;\n mapping(address token => address strategy) public override assetStrategy;\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "struct Asset {\n bool isSupportedAsset;\n uint256 depositLimit;\n address strategy; \n}\n\nmapping(address token => Asset asset) public asset;\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7.01} {"source": "c4", "protocol": "10-badger", "title": "hunter_w3b Q", "severity_raw": "High", "severity": "high", "description": "## [L-01] Missing Checks Allow Collateral Balance to be Drained via Flash Loans\n\nThe ActivePool contract allows flash loans to be taken out of the collateral token (stETH) held by the contract. However, there are no checks to prevent multiple flash loans from being taken out simultaneously that could drain the entire collateral balance.\n\nThe maxFlashLoan() function returns the full collateral balance without accounting for any outstanding loans. And the flashLoan() function does not track the amount loaned out or decrement it from the available balance.\n\n```solidity\nFile: contracts/contracts/ActivePool.sol\n\n function maxFlashLoan(address token) public view override returns (uint256) {\n if (token != address(collateral)) {\n return 0;\n }\n\n if (flashLoansPaused) {\n return 0;\n }\n\n return collateral.balanceOf(address(this));\n }\n\n```\n\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/ActivePool.sol#L328-L339\n\nThis means if two or more flash loans are taken at the same time for the full balance amount, they could both succeed even though together they exceed the actual available balance. When the loans are repaid, there may be an insufficient balance to return one or both of the principal+fee amounts.\n\nThis is a security issue as an attacker could theoretically empty out the contract's collateral reserves by taking out multiple flash loans in quick succession before repayments are processed.\n\nTo remedy this, the contract should track the amount of loans outstanding and deduct that from the max loan amount reported. Individual loan origination should also fail if it would exceed the updated remaining balance amount.\n\n## [L-02] Lack of Validation Allows Unauthorized Accounts to Take Out Flash Loans\n\nThe flashLoan() function in the ActivePool contract does not validate or restrict the flash loan receiver address in any way. Any external account is able to be passed as the receiver ", "vulnerable_code": "File: contracts/contracts/ActivePool.sol\n\n function maxFlashLoan(address token) public view override returns (uint256) {\n if (token != address(collateral)) {\n return 0;\n }\n\n if (flashLoansPaused) {\n return 0;\n }\n\n return collateral.balanceOf(address(this));\n }\n", "fixed_code": "File: contracts/contracts/ActivePool.sol\n\n function flashLoan(\n IERC3156FlashBorrower receiver,\n address token,\n uint256 amount,\n bytes calldata data\n ) external override returns (bool) {\n require(amount > 0, \"ActivePool: 0 Amount\");\n uint256 fee = flashFee(token, amount); // NOTE: Check for `token` is implicit in the requires above // also checks for paused\n require(amount <= maxFlashLoan(token), \"ActivePool: Too much\");\n\n uint256 amountWithFee = amount + fee;\n uint256 oldRate = collateral.getPooledEthByShares(DECIMAL_PRECISION);\n\n collateral.transfer(address(receiver), amount);\n\n // Callback\n require(\n receiver.onFlashLoan(msg.sender, token, amount, fee, data) == FLASH_SUCCESS_VALUE,\n \"ActivePool: IERC3156: Callback failed\"\n );\n\n // Transfer of (principal + Fee) from flashloan receiver\n collateral.transferFrom(address(receiver), address(this), amountWithFee);\n\n // Send earned fee to designated recipient\n collateral.transfer(feeRecipientAddress, fee);\n\n // Check new balance\n // NOTE: Invariant Check, technically breaks CEI but I think we must use it\n // NOTE: This means any balance > systemCollShares is stuck, this is also present in LUSD as is\n\n // NOTE: This check effectively prevents running 2 FL at the same time\n // You technically could, but you'd be having to repay any amount below systemCollShares to get Fl2 to not revert\n require(\n collateral.balanceOf(address(this)) >= collateral.getPooledEthByShares(systemCollShares),\n \"ActivePool: Must repay Balance\"\n );\n require(\n collateral.sharesOf(address(this)) >= systemCollShares,\n \"ActivePool: Must repay Share\"\n );\n require(\n collateral.getPooledEthByShares(DECIMAL_PRECISION) == oldRate,\n \"ActivePool: Should keep same collateral share ", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/hunter_w3b-Q.md", "collected_at": "2026-01-02T18:26:51.104120+00:00", "source_hash": "ec065b0b8c340f7f6cac51bc5edd671f6fba5c1b19bae008b63d85a95a3a5a5e", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 323, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/contracts/ActivePool.sol\n\n function maxFlashLoan(address token) public view override returns (uint256) {\n if (token != address(collateral)) {\n return 0;\n }\n\n if (flashLoansPaused) {\n return 0;\n }\n\n return collateral.balanceOf(address(this));\n }", "primary_code_language": "solidity", "primary_code_char_count": 323, "all_code_blocks": "// Code block 1 (solidity):\nFile: contracts/contracts/ActivePool.sol\n\n function maxFlashLoan(address token) public view override returns (uint256) {\n if (token != address(collateral)) {\n return 0;\n }\n\n if (flashLoansPaused) {\n return 0;\n }\n\n return collateral.balanceOf(address(this));\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: contracts/contracts/ActivePool.sol\n\n function maxFlashLoan(address token) public view override returns (uint256) {\n if (token != address(collateral)) {\n return 0;\n }\n\n if (flashLoansPaused) {\n return 0;\n }\n\n return collateral.balanceOf(address(this));\n }", "github_refs_formatted": "ActivePool.sol#L328-L339", "github_files_list": "ActivePool.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: contracts/contracts/ActivePool.sol\n\n function maxFlashLoan(address token) public view override returns (uint256) {\n if (token != address(collateral)) {\n return 0;\n }\n\n if (flashLoansPaused) {\n return 0;\n }\n\n return collateral.balanceOf(address(this));\n }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/contracts/ActivePool.sol\n\n function flashLoan(\n IERC3156FlashBorrower receiver,\n address token,\n uint256 amount,\n bytes calldata data\n ) external override returns (bool) {\n require(amount > 0, \"ActivePool: 0 Amount\");\n uint256 fee = flashFee(token, amount); // NOTE: Check for `token` is implicit in the requires above // also checks for paused\n require(amount <= maxFlashLoan(token), \"ActivePool: Too much\");\n\n uint256 amountWithFee = amount + fee;\n uint256 oldRate = collateral.getPooledEthByShares(DECIMAL_PRECISION);\n\n collateral.transfer(address(receiver), amount);\n\n // Callback\n require(\n receiver.onFlashLoan(msg.sender, token, amount, fee, data) == FLASH_SUCCESS_VALUE,\n \"ActivePool: IERC3156: Callback failed\"\n );\n\n // Transfer of (principal + Fee) from flashloan receiver\n collateral.transferFrom(address(receiver), address(this), amountWithFee);\n\n // Send earned fee to designated recipient\n collateral.transfer(feeRecipientAddress, fee);\n\n // Check new balance\n // NOTE: Invariant Check, technically breaks CEI but I think we must use it\n // NOTE: This means any balance > systemCollShares is stuck, this is also present in LUSD as is\n\n // NOTE: This check effectively prevents running 2 FL at the same time\n // You technically could, but you'd be having to repay any amount below systemCollShares to get Fl2 to not revert\n require(\n collateral.balanceOf(address(this)) >= collateral.getPooledEthByShares(systemCollShares),\n \"ActivePool: Must repay Balance\"\n );\n require(\n collateral.sharesOf(address(this)) >= systemCollShares,\n \"ActivePool: Must repay Share\"\n );\n require(\n collateral.getPooledEthByShares(DECIMAL_PRECISION) == oldRate,\n \"ActivePool: Should keep same collateral share ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-ondo", "title": "eyexploit G", "severity_raw": "High", "severity": "high", "description": "# Finding 1 : check `borrower == liquidator` before getting KYC status to save the gas\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/lending/tokens/cCash/CTokenCash.sol#L1013\n\nAbove check is performed before checking the KYC status for both borrower and liquidator. Here KYC status is fetching through an external call to the KYC registry contract which cost high amount of gas and if borrower and liquidator are the same then there is unnecessary wastage of gas. \n\nWe might think vice versa, where borrower and liquidator are different, but unauthorize. But again it just perform equal to check, which is much cheaper than the external call in above case. \n\n*Recommendation* : Make sure above check execute before the \nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/lending/tokens/cCash/CTokenCash.sol#L997-L998\n\n# Finding 2 : `transferTokens` checking twice for KYC status for the same user\n\nTokens which are getting transferred via `transfer` function have same `spender` and `src`, which means in the `transferTokens` function it will check the KYC status twice for the same address. Its make an external call to the registry contract to get the KYC status for passed address, and doing it twice waste the gas.\n\n**File: contracts/lending/tokens/cCash/CTokenCash.sol**\n\n```\n function transferTokens(\n address spender,\n address src,\n address dst,\n uint tokens\n ) internal returns (uint) {\n /* Revert if KYC not valid */\n require(_getKYCStatus(spender), \"Spender not KYC'd\");\n require(_getKYCStatus(src), \"Source not KYC'd\");\n ...\n}\n```\n**File: contracts/lending/tokens/cCash/CTokenCash.sol**\n```\n function transfer(\n address dst,\n uint256 amount\n ) external override nonReentrant returns (bool) {\n return transferTokens(msg.sender, msg.sender, dst, amount) == NO_ERROR;\n }\n```\n\n*Recommendation*\nconsider modifiy `transferTokens` function to below\n\n```\n ", "vulnerable_code": " function transferTokens(\n address spender,\n address src,\n address dst,\n uint tokens\n ) internal returns (uint) {\n /* Revert if KYC not valid */\n require(_getKYCStatus(spender), \"Spender not KYC'd\");\n require(_getKYCStatus(src), \"Source not KYC'd\");\n ...\n}", "fixed_code": " function transfer(\n address dst,\n uint256 amount\n ) external override nonReentrant returns (bool) {\n return transferTokens(msg.sender, msg.sender, dst, amount) == NO_ERROR;\n }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/eyexploit-G.md", "collected_at": "2026-01-02T18:15:08.772449+00:00", "source_hash": "ec17777da60c64ae03e7f0dfb34cdefb301c9847855a11087bd42aaf2171c1ad", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 466, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function transferTokens(\n address spender,\n address src,\n address dst,\n uint tokens\n ) internal returns (uint) {\n /* Revert if KYC not valid */\n require(_getKYCStatus(spender), \"Spender not KYC'd\");\n require(_getKYCStatus(src), \"Source not KYC'd\");\n ...\n}", "primary_code_language": "unknown", "primary_code_char_count": 280, "all_code_blocks": "// Code block 1 (unknown):\nfunction transferTokens(\n address spender,\n address src,\n address dst,\n uint tokens\n ) internal returns (uint) {\n /* Revert if KYC not valid */\n require(_getKYCStatus(spender), \"Spender not KYC'd\");\n require(_getKYCStatus(src), \"Source not KYC'd\");\n ...\n}\n\n// Code block 2 (unknown):\nfunction transfer(\n address dst,\n uint256 amount\n ) external override nonReentrant returns (bool) {\n return transferTokens(msg.sender, msg.sender, dst, amount) == NO_ERROR;\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CTokenCash.sol#L1013, CTokenCash.sol#L997-L998", "github_files_list": "CTokenCash.sol", "github_refs_count": 2, "vulnerable_code_actual": " function transferTokens(\n address spender,\n address src,\n address dst,\n uint tokens\n ) internal returns (uint) {\n /* Revert if KYC not valid */\n require(_getKYCStatus(spender), \"Spender not KYC'd\");\n require(_getKYCStatus(src), \"Source not KYC'd\");\n ...\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function transfer(\n address dst,\n uint256 amount\n ) external override nonReentrant returns (bool) {\n return transferTokens(msg.sender, msg.sender, dst, amount) == NO_ERROR;\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "04-caviar", "title": "cryptonue Q", "severity_raw": "Low", "severity": "low", "description": "# [L] in Factory, create private pool doesn't check required variable already initialize in Constructor (or initialize function)\n\nThe following variable doesn't initialize up until the admin/owner manually set via dedicated function. This resulting when create private pool potential to failure since there is also no check in `create()` function if the variables already setted.\n\n- PrivatePoolMetadata\n- PrivatePoolImplementation\n\n```js\nFile: Factory.sol\n129: function setPrivatePoolMetadata(address _privatePoolMetadata) public onlyOwner {\n130: privatePoolMetadata = _privatePoolMetadata;\n131: }\n132:\n133: /// @notice Sets the private pool implementation contract that newly deployed proxies point to.\n134: /// @param _privatePoolImplementation The private pool implementation contract.\n135: function setPrivatePoolImplementation(address _privatePoolImplementation) public onlyOwner {\n136: privatePoolImplementation = _privatePoolImplementation;\n137: }\n```\n\n\n# [L] Solmate\u2019s SafeTransferLib doesn\u2019t check whether the ERC20 contract exists\n\nCaviar use Solmate\u2019s SafeTransferLib when transfering ERC20 token which contains a common issue.\n\nSolmate\u2019s SafeTransferLib, which is often used to interact with non-compliant/unsafe ERC20 tokens, does not check whether the ERC20 contract exists. The following code will not revert in case the token doesn\u2019t exist (yet).\n\nThis is stated in the Solmate library:\n\nhttps://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol#L9\n\n# [L] Two step transfer ownership\n\nCaviar use solmate's Owned library (`import {Owned} from \"solmate/auth/Owned.sol\";`) which doesn't have a two step transfer ownership.\n\nRecommend considering implementing a two step process where the owner or admin nominates an account and the nominated account needs to call an acceptOwnership() function for the transfer of ownership to fully succeed. This ensures the nominated EOA account is a valid and active account.\n\n\n# [L] Un", "vulnerable_code": "File: Factory.sol\n129: function setPrivatePoolMetadata(address _privatePoolMetadata) public onlyOwner {\n130: privatePoolMetadata = _privatePoolMetadata;\n131: }\n132:\n133: /// @notice Sets the private pool implementation contract that newly deployed proxies point to.\n134: /// @param _privatePoolImplementation The private pool implementation contract.\n135: function setPrivatePoolImplementation(address _privatePoolImplementation) public onlyOwner {\n136: privatePoolImplementation = _privatePoolImplementation;\n137: }", "fixed_code": "File: Factory.sol\n141: function setProtocolFeeRate(uint16 _protocolFeeRate) public onlyOwner {\n142: protocolFeeRate = _protocolFeeRate;\n143: }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/cryptonue-Q.md", "collected_at": "2026-01-02T18:20:25.189830+00:00", "source_hash": "ec1eb42d6c384f6b369e1fa71fc6c97222860636de8a6e110640a7c202e28852", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 556, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: Factory.sol\n129: function setPrivatePoolMetadata(address _privatePoolMetadata) public onlyOwner {\n130: privatePoolMetadata = _privatePoolMetadata;\n131: }\n132:\n133: /// @notice Sets the private pool implementation contract that newly deployed proxies point to.\n134: /// @param _privatePoolImplementation The private pool implementation contract.\n135: function setPrivatePoolImplementation(address _privatePoolImplementation) public onlyOwner {\n136: privatePoolImplementation = _privatePoolImplementation;\n137: }", "primary_code_language": "js", "primary_code_char_count": 556, "all_code_blocks": "// Code block 1 (js):\nFile: Factory.sol\n129: function setPrivatePoolMetadata(address _privatePoolMetadata) public onlyOwner {\n130: privatePoolMetadata = _privatePoolMetadata;\n131: }\n132:\n133: /// @notice Sets the private pool implementation contract that newly deployed proxies point to.\n134: /// @param _privatePoolImplementation The private pool implementation contract.\n135: function setPrivatePoolImplementation(address _privatePoolImplementation) public onlyOwner {\n136: privatePoolImplementation = _privatePoolImplementation;\n137: }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafeTransferLib.sol#L9", "github_files_list": "SafeTransferLib.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: Factory.sol\n129: function setPrivatePoolMetadata(address _privatePoolMetadata) public onlyOwner {\n130: privatePoolMetadata = _privatePoolMetadata;\n131: }\n132:\n133: /// @notice Sets the private pool implementation contract that newly deployed proxies point to.\n134: /// @param _privatePoolImplementation The private pool implementation contract.\n135: function setPrivatePoolImplementation(address _privatePoolImplementation) public onlyOwner {\n136: privatePoolImplementation = _privatePoolImplementation;\n137: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: Factory.sol\n141: function setProtocolFeeRate(uint16 _protocolFeeRate) public onlyOwner {\n142: protocolFeeRate = _protocolFeeRate;\n143: }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "07-amphora", "title": "DavidGiladi Q", "severity_raw": "Critical", "severity": "critical", "description": "\n\n### Low Issues\n|Title|Issue|Instances|\n|-|:-|:-:|\n|[L-1] Burn functions must be protected with a modifier | [Burn functions must be protected with a modifier](#burn-functions-must-be-protected-with-a-modifier) | 4 |\n|[L-2] Divide before multiply | [Divide before multiply](#divide-before-multiply) | 2 |\n|[L-3] ERC20 Approve Call is Not Safe | [ERC20 Approve Call is Not Safe](#erc20-approve-call-is-not-safe) | 3 |\n|[L-4] Fee/Rate Caps Missing in Smart Contracts | [Fee/Rate Caps Missing in Smart Contracts](#feerate-caps-missing-in-smart-contracts) | 2 |\n|[L-5] Calls inside a loop | [Calls inside a loop](#calls-inside-a-loop) | 21 |\n|[L-6] Reentrancy vulnerabilities | [Reentrancy vulnerabilities](#reentrancy-vulnerabilities-2) | 14 |\n|[L-7] Arrays can grow without a way to shrink them | [Arrays can grow without a way to shrink them](#arrays-can-grow-without-a-way-to-shrink-them) | 1 |\n|[L-8] Unsafe Cast Unsigned to Signed | [Unsafe Cast Unsigned to Signed](#unsafe-cast-unsigned-to-signed) | 3 |\n|[L-9] Zero-value transfers may revert | [Zero-value transfers may revert](#zero-value-transfers-may-revert) | 5 |\n\nTotal: 9 issues\n\n\n### Non-Critical Issues\n|Title|Issue|Instances|\n|-|:-|:-:|\n|[N-1] Do not calculate constants | [Do not calculate constants](#do-not-calculate-constants) | 7 |\n|[N-2] Cyclomatic complexity | [Cyclomatic complexity](#cyclomatic-complexity) | 1 |\n|[N-3] Dead-code | [Dead-code](#dead-code) | 1 |\n|[N-4] Else block not required | [Else block not required](#else-block-not-required) | 7 |\n|[N-5] Hardcoded addresses in contract | [Hardcoded addresses in contract](#hardcoded-addresses-in-contract) | 3 |\n|[N-6] Interfaces Should Be Defined in Separate Files From Their Usage | [Interfaces Should Be Defined in Separate Files From Their Usage](#interfaces-should-be-defined-in-separate-files-from-their-usage) | 1 |\n|[N-7] Token contract should have a blacklist function or modifier | [Token contract should have a blacklist function or modifier](#token-contract-s", "vulnerable_code": "Line: 188 function _burn(address _target, uint256 _amount) internal ", "fixed_code": "Line: 79 function burn(uint256 _wusdaAmount) external override returns (uint256 _usdaAmount) ", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/DavidGiladi-Q.md", "collected_at": "2026-01-02T18:23:25.083766+00:00", "source_hash": "ec4f01ac90aa4ef17e1907092b678c9c1f91b85a1af80acdc4a2f517fefbe0cd", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "Line: 188 function _burn(address _target, uint256 _amount) internal ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "Line: 79 function burn(uint256 _wusdaAmount) external override returns (uint256 _usdaAmount) ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "06-lybra", "title": "hals Q", "severity_raw": "Critical", "severity": "critical", "description": "# Findings Summary\n\n| ID | Title | Severity |\n| --------------- | --------------------------------------------------------------------------- | ------------ |\n| [L-01](#l-01) | `isOtherEarningsClaimable(address user)`: division by zero is not prevented | Low |\n| [L-02](#l-02) | Different pools might use different `esLBRBoost` contract | Low |\n| [L-03](#l-03) | `ProtocolRewardsPool` contract: any user can free mint 3 esLBR tokens | Low |\n| [L-04](#l-04) | LBR & esLBR tokens addresses might be changed in different contracts | Low |\n| [NC-01](#nc-01) | Boolean is compared to a boolean | Non Critical |\n| [NC-02](#nc-02) | `_checkHealth` function visibility must be public | Non Critical |\n| [NC-03](#nc-03) | Wrong error message | Non Critical |\n\n# Low\n\n## [L-01] `isOtherEarningsClaimable(address user)`: division by zero is not prevented
\n\n## Details\n\nIn `EUSDMiningIncentives.sol`/`isOtherEarningsClaimable(address user)` function : the result of stakedOf(user) could be zero if he doesn't have any borrowed amount in any pool.\n\n## Impact\n\nThis will cause run-time error when invoking `isOtherEarningsClaimable(address user)` or `getReward()` functions with an address with zero borrowed amounts.\n\n## Proof of Concept\n\n```solidity\nFile: 2023-06-lybra/contracts/lybra/miner/EUSDMiningIncentives.sol\nLine 188-190:\n function isOtherEarningsClaimable(address user) public view returns (bool) {\n return (stakedLBRLpValue(user) * 10000) / stakedOf(user) < 500;\n }\n```\n\n```solidity\nFile: 2023-06-lybra/contracts/lybra/miner/EUSDMiningIncentives.sol\nLine 193:\n require(!isOtherEarningsClaimable(msg.sender), \"Insufficient DLP, unable to claim rewards\");\n```\n\n```solidity\nFile: 2023", "vulnerable_code": "File: 2023-06-lybra/contracts/lybra/miner/EUSDMiningIncentives.sol\nLine 188-190:\n function isOtherEarningsClaimable(address user) public view returns (bool) {\n return (stakedLBRLpValue(user) * 10000) / stakedOf(user) < 500;\n }", "fixed_code": "File: 2023-06-lybra/contracts/lybra/miner/EUSDMiningIncentives.sol\nLine 193:\n require(!isOtherEarningsClaimable(msg.sender), \"Insufficient DLP, unable to claim rewards\");", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/hals-Q.md", "collected_at": "2026-01-02T18:22:59.253919+00:00", "source_hash": "ec64bd846d303fec42cabff9170a5978b7ccf1a1d40fbf781a5d4158277d7fd3", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 411, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: 2023-06-lybra/contracts/lybra/miner/EUSDMiningIncentives.sol\nLine 188-190:\n function isOtherEarningsClaimable(address user) public view returns (bool) {\n return (stakedLBRLpValue(user) * 10000) / stakedOf(user) < 500;\n }", "primary_code_language": "solidity", "primary_code_char_count": 238, "all_code_blocks": "// Code block 1 (solidity):\nFile: 2023-06-lybra/contracts/lybra/miner/EUSDMiningIncentives.sol\nLine 188-190:\n function isOtherEarningsClaimable(address user) public view returns (bool) {\n return (stakedLBRLpValue(user) * 10000) / stakedOf(user) < 500;\n }\n\n// Code block 2 (solidity):\nFile: 2023-06-lybra/contracts/lybra/miner/EUSDMiningIncentives.sol\nLine 193:\n require(!isOtherEarningsClaimable(msg.sender), \"Insufficient DLP, unable to claim rewards\");", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: 2023-06-lybra/contracts/lybra/miner/EUSDMiningIncentives.sol\nLine 188-190:\n function isOtherEarningsClaimable(address user) public view returns (bool) {\n return (stakedLBRLpValue(user) * 10000) / stakedOf(user) < 500;\n }\n\nFile: 2023-06-lybra/contracts/lybra/miner/EUSDMiningIncentives.sol\nLine 193:\n require(!isOtherEarningsClaimable(msg.sender), \"Insufficient DLP, unable to claim rewards\");", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: 2023-06-lybra/contracts/lybra/miner/EUSDMiningIncentives.sol\nLine 188-190:\n function isOtherEarningsClaimable(address user) public view returns (bool) {\n return (stakedLBRLpValue(user) * 10000) / stakedOf(user) < 500;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: 2023-06-lybra/contracts/lybra/miner/EUSDMiningIncentives.sol\nLine 193:\n require(!isOtherEarningsClaimable(msg.sender), \"Insufficient DLP, unable to claim rewards\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-biconomy", "title": "immeas Q", "severity_raw": "High", "severity": "high", "description": "# low\n\n## L-1 no validation that the owner is an EOA\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L172\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L112\n\nThe documentation specifies that it should be EOAs that are owners but there is no validation done to ensure that.\n\n# non crit\n\n## NC-1 lack of events emitted on state changes\n\nFor transparency and trust, important state changes should emit events:\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol#L65-L68\n\n```javascript\nFile: paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol\n\n65: function setSigner( address _newVerifyingSigner) external onlyOwner{\n66: require(_newVerifyingSigner != address(0), \"VerifyingPaymaster: new signer can not be zero address\");\n67: verifyingSigner = _newVerifyingSigner;\n68: }\n```\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L24-L26\n\n```javascript\nFile: paymasters/BasePaymaster.sol\n\n24: function setEntryPoint(IEntryPoint _entryPoint) public onlyOwner {\n25: entryPoint = _entryPoint;\n26: }\n```\n\n## NC-2 consider removing `Math.sol` (and `Strings.sol`)\n\n`Math.sol` is mentioned to be in scope but it is not used anywhere (but in `Strings.sol` that is not in scope an also not used anywhere).\n\n\nConsider removing these libraries as it is confusing with code that is not used.\n\n## NC-3 indentation is off\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L320-L342\n\nIndented with extra 4 spaces\n\nhttps://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L85-L93\n\nIndented with just", "vulnerable_code": "File: paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol\n\n65: function setSigner( address _newVerifyingSigner) external onlyOwner{\n66: require(_newVerifyingSigner != address(0), \"VerifyingPaymaster: new signer can not be zero address\");\n67: verifyingSigner = _newVerifyingSigner;\n68: }", "fixed_code": "File: paymasters/BasePaymaster.sol\n\n24: function setEntryPoint(IEntryPoint _entryPoint) public onlyOwner {\n25: entryPoint = _entryPoint;\n26: }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/immeas-Q.md", "collected_at": "2026-01-02T18:13:50.427472+00:00", "source_hash": "ec688d55d9d9b9ee120007fe0d53b41df76a594b91a67dbda0a620de92f04922", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 472, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol\n\n65: function setSigner( address _newVerifyingSigner) external onlyOwner{\n66: require(_newVerifyingSigner != address(0), \"VerifyingPaymaster: new signer can not be zero address\");\n67: verifyingSigner = _newVerifyingSigner;\n68: }", "primary_code_language": "javascript", "primary_code_char_count": 317, "all_code_blocks": "// Code block 1 (javascript):\nFile: paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol\n\n65: function setSigner( address _newVerifyingSigner) external onlyOwner{\n66: require(_newVerifyingSigner != address(0), \"VerifyingPaymaster: new signer can not be zero address\");\n67: verifyingSigner = _newVerifyingSigner;\n68: }\n\n// Code block 2 (javascript):\nFile: paymasters/BasePaymaster.sol\n\n24: function setEntryPoint(IEntryPoint _entryPoint) public onlyOwner {\n25: entryPoint = _entryPoint;\n26: }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SmartAccount.sol#L172, SmartAccount.sol#L112, VerifyingSingletonPaymaster.sol#L65-L68, BasePaymaster.sol#L24-L26, SmartAccount.sol#L320-L342, SmartAccount.sol#L85-L93", "github_files_list": "SmartAccount.sol, VerifyingSingletonPaymaster.sol, BasePaymaster.sol", "github_refs_count": 6, "vulnerable_code_actual": "File: paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol\n\n65: function setSigner( address _newVerifyingSigner) external onlyOwner{\n66: require(_newVerifyingSigner != address(0), \"VerifyingPaymaster: new signer can not be zero address\");\n67: verifyingSigner = _newVerifyingSigner;\n68: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: paymasters/BasePaymaster.sol\n\n24: function setEntryPoint(IEntryPoint _entryPoint) public onlyOwner {\n25: entryPoint = _entryPoint;\n26: }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "06-lybra", "title": "Rickard G", "severity_raw": "Gas", "severity": "gas", "description": "# [G-01] A modifier used only once and not being inherited should be inlined to save gas\n[https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/token/EUSD.sol#L83-L86](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/token/EUSD.sol#L83-L86)\n````solidity\nFile: contracts/lybra/token/EUSD.sol\n\n83 modifier MintPaused() {\n84 require(!configurator.vaultMintPaused(msg.sender), \"MPP\");\n85 _;\n86: }\n````\nThe above modifier is only being called on [Line 411](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/token/EUSD.sol#L411). \n\n \n[https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/token/PeUSDMainnetStableVision.sol#L46-L53](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/token/PeUSDMainnetStableVision.sol#L46-L53)\n````solidity\nFile: contracts/lybra/token/PeUSDMainnetStableVision.sol\n\n46 modifier MintPaused() {\n47 require(!configurator.vaultMintPaused(msg.sender), \"MPP\");\n48 _;\n49: }\n50 modifier BurnPaused() {\n51 require(!configurator.vaultBurnPaused(msg.sender), \"BPP\");\n52 _;\n53: }\n````\nThe MintPaused modifier is only being called on [Line 63](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/token/PeUSDMainnetStableVision.sol#L63) and the BurnPaused modifier on [Line 69](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/token/PeUSDMainnetStableVision.sol#L69).\n# [G-02] Immutables should be in uppercase\n````solidity\nFile: contracts/lybra/miner/EUSDMiningIncentives.sol\n28: Iconfigurator public immutable configurator;\n\n30: IEUSD public immutable EUSD;\n````\n[EUSDMiningIncentives.sol#L28](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/miner/EUSDMiningIncentives.sol#L28)\n````solidity\nFile: contracts/lybra/miner/ProtocolRewardsPool.sol\n", "vulnerable_code": "File: contracts/lybra/token/EUSD.sol\n\n83 modifier MintPaused() {\n84 require(!configurator.vaultMintPaused(msg.sender), \"MPP\");\n85 _;\n86: }", "fixed_code": "File: contracts/lybra/token/PeUSDMainnetStableVision.sol\n\n46 modifier MintPaused() {\n47 require(!configurator.vaultMintPaused(msg.sender), \"MPP\");\n48 _;\n49: }\n50 modifier BurnPaused() {\n51 require(!configurator.vaultBurnPaused(msg.sender), \"BPP\");\n52 _;\n53: }", "recommendation": "", "category": "oracle", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/Rickard-G.md", "collected_at": "2026-01-02T18:22:39.092735+00:00", "source_hash": "ece29d685903aebe0436ba51c6437465f82e44cccc1cbcf3c2e2c69991a00190", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 697, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/lybra/token/EUSD.sol\n\n83 modifier MintPaused() {\n84 require(!configurator.vaultMintPaused(msg.sender), \"MPP\");\n85 _;\n86: }", "primary_code_language": "solidity", "primary_code_char_count": 187, "all_code_blocks": "// Code block 1 (solidity):\nFile: contracts/lybra/token/EUSD.sol\n\n83 modifier MintPaused() {\n84 require(!configurator.vaultMintPaused(msg.sender), \"MPP\");\n85 _;\n86: }\n\n// Code block 2 (solidity):\nFile: contracts/lybra/token/PeUSDMainnetStableVision.sol\n\n46 modifier MintPaused() {\n47 require(!configurator.vaultMintPaused(msg.sender), \"MPP\");\n48 _;\n49: }\n50 modifier BurnPaused() {\n51 require(!configurator.vaultBurnPaused(msg.sender), \"BPP\");\n52 _;\n53: }\n\n// Code block 3 (solidity):\nFile: contracts/lybra/miner/EUSDMiningIncentives.sol\n28: Iconfigurator public immutable configurator;\n\n30: IEUSD public immutable EUSD;", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: contracts/lybra/token/EUSD.sol\n\n83 modifier MintPaused() {\n84 require(!configurator.vaultMintPaused(msg.sender), \"MPP\");\n85 _;\n86: }\n\nFile: contracts/lybra/token/PeUSDMainnetStableVision.sol\n\n46 modifier MintPaused() {\n47 require(!configurator.vaultMintPaused(msg.sender), \"MPP\");\n48 _;\n49: }\n50 modifier BurnPaused() {\n51 require(!configurator.vaultBurnPaused(msg.sender), \"BPP\");\n52 _;\n53: }\n\nFile: contracts/lybra/miner/EUSDMiningIncentives.sol\n28: Iconfigurator public immutable configurator;\n\n30: IEUSD public immutable EUSD;", "github_refs_formatted": "EUSD.sol#L83-L86, EUSD.sol#L411, PeUSDMainnetStableVision.sol#L46-L53, PeUSDMainnetStableVision.sol#L63, PeUSDMainnetStableVision.sol#L69, EUSDMiningIncentives.sol#L28", "github_files_list": "PeUSDMainnetStableVision.sol, EUSDMiningIncentives.sol, EUSD.sol", "github_refs_count": 6, "vulnerable_code_actual": "File: contracts/lybra/token/EUSD.sol\n\n83 modifier MintPaused() {\n84 require(!configurator.vaultMintPaused(msg.sender), \"MPP\");\n85 _;\n86: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/lybra/token/PeUSDMainnetStableVision.sol\n\n46 modifier MintPaused() {\n47 require(!configurator.vaultMintPaused(msg.sender), \"MPP\");\n48 _;\n49: }\n50 modifier BurnPaused() {\n51 require(!configurator.vaultBurnPaused(msg.sender), \"BPP\");\n52 _;\n53: }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "07-amphora", "title": "Musaka Q", "severity_raw": "Low", "severity": "low", "description": "#### **[L-01]** Withdrawing ERC20 from the Vault does not claim the rewards \nSimply, because of this false `withdrawAndUnwrap(_amount, false)` [withdrawERC20](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/Vault.sol#L117-L133) is only withdrawing the funds from convex and leaving the rewards. For users to claim them, they need to call another function [claimRewards](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/Vault.sol#L164-L229), this is unneeded, since `withdrawERC20` can be slightly modified to claim rewards on withdraw if the user wants, executing withdraw + claim in one TX instead of two. \nYou can modifiy it as follows:\n```jsx\n function withdrawERC20(address _tokenAddress, uint256 _amount, bool claimRewards) external override onlyMinter {\n if (CONTROLLER.tokenId(_tokenAddress) == 0) revert Vault_TokenNotRegistered();\n if (isTokenStaked[_tokenAddress]) {\n+ if(claimRewards){\n+ address[] rewardT = new address[](1)\n+ rewardT[0] = _tokenAddress;\n+ claimRewards(rewardT);\n+ }else{\n if (!CONTROLLER.tokenCrvRewardsContract(_tokenAddress).withdrawAndUnwrap(_amount, false)) {\n revert Vault_WithdrawAndUnstakeOnConvexFailed();\n }\n+ }\n }\n```\n\n---\n\n#### **[L-02]** User inconvenience when calling [Vault.canStake](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/Vault.sol#L156-L159)\nFrom the `canStake` function we can see that before returning true it checks if the pool exists, within the controller does the vault have any balance of such tokens and where the issue is, if the token is **already staked** - `!isTokenStaked[_token]` - where the function reverts if there is a stake on the token. This means if a User stakes a small amount of a given token and forgets about it, and after some time when he wants to stake more of the same token he will most likely call `canStake` to check if he would be abl", "vulnerable_code": "---\n\n#### **[L-02]** User inconvenience when calling [Vault.canStake](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/Vault.sol#L156-L159)\nFrom the `canStake` function we can see that before returning true it checks if the pool exists, within the controller does the vault have any balance of such tokens and where the issue is, if the token is **already staked** - `!isTokenStaked[_token]` - where the function reverts if there is a stake on the token. This means if a User stakes a small amount of a given token and forgets about it, and after some time when he wants to stake more of the same token he will most likely call `canStake` to check if he would be able to stake, but `canStake` will return false dues to this `!isTokenStaked[_token]`.", "fixed_code": "You can remove `!isTokenStaked[_token]` from the function, since there is no need for it.\n\n---\n\n#### **[L-03]** If one of the tokens in `StableCurveLpOracle` is undervalued it will report less price for the whole group\nUnder [_get](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/periphery/oracles/StableCurveLpOracle.sol#L41-L49) there is a for loop and a check inside of it which uses `Math.min` to determine the lowest price for one of the tokens. This price is later send as a return by `StableCurveLpOracle` oracle.", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/Musaka-Q.md", "collected_at": "2026-01-02T18:23:30.006977+00:00", "source_hash": "eceaac19a7e8d7ad5a2e80be6f3aff1a5f575e212b44de8580a6a41357eb1177", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 567, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function withdrawERC20(address _tokenAddress, uint256 _amount, bool claimRewards) external override onlyMinter {\n if (CONTROLLER.tokenId(_tokenAddress) == 0) revert Vault_TokenNotRegistered();\n if (isTokenStaked[_tokenAddress]) {\n+ if(claimRewards){\n+ address[] rewardT = new address[](1)\n+ rewardT[0] = _tokenAddress;\n+ claimRewards(rewardT);\n+ }else{\n if (!CONTROLLER.tokenCrvRewardsContract(_tokenAddress).withdrawAndUnwrap(_amount, false)) {\n revert Vault_WithdrawAndUnstakeOnConvexFailed();\n }\n+ }\n }", "primary_code_language": "jsx", "primary_code_char_count": 567, "all_code_blocks": "// Code block 1 (jsx):\nfunction withdrawERC20(address _tokenAddress, uint256 _amount, bool claimRewards) external override onlyMinter {\n if (CONTROLLER.tokenId(_tokenAddress) == 0) revert Vault_TokenNotRegistered();\n if (isTokenStaked[_tokenAddress]) {\n+ if(claimRewards){\n+ address[] rewardT = new address[](1)\n+ rewardT[0] = _tokenAddress;\n+ claimRewards(rewardT);\n+ }else{\n if (!CONTROLLER.tokenCrvRewardsContract(_tokenAddress).withdrawAndUnwrap(_amount, false)) {\n revert Vault_WithdrawAndUnstakeOnConvexFailed();\n }\n+ }\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Vault.sol#L117-L133, Vault.sol#L164-L229, Vault.sol#L156-L159, StableCurveLpOracle.sol#L41-L49", "github_files_list": "Vault.sol, StableCurveLpOracle.sol", "github_refs_count": 4, "vulnerable_code_actual": "---\n\n#### **[L-02]** User inconvenience when calling [Vault.canStake](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/core/Vault.sol#L156-L159)\nFrom the `canStake` function we can see that before returning true it checks if the pool exists, within the controller does the vault have any balance of such tokens and where the issue is, if the token is **already staked** - `!isTokenStaked[_token]` - where the function reverts if there is a stake on the token. This means if a User stakes a small amount of a given token and forgets about it, and after some time when he wants to stake more of the same token he will most likely call `canStake` to check if he would be able to stake, but `canStake` will return false dues to this `!isTokenStaked[_token]`.", "has_vulnerable_code_snippet": true, "fixed_code_actual": "You can remove `!isTokenStaked[_token]` from the function, since there is no need for it.\n\n---\n\n#### **[L-03]** If one of the tokens in `StableCurveLpOracle` is undervalued it will report less price for the whole group\nUnder [_get](https://github.com/code-423n4/2023-07-amphora/blob/main/core/solidity/contracts/periphery/oracles/StableCurveLpOracle.sol#L41-L49) there is a for loop and a check inside of it which uses `Math.min` to determine the lowest price for one of the tokens. This price is later send as a return by `StableCurveLpOracle` oracle.", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "07-amphora", "title": "MohammedRizwan Q", "severity_raw": "Medium", "severity": "medium", "description": "## Summary\n\n### Low Risk Issues\n|Number|Issue|Instances| |\n|-|:-|:-:|:-:|\n| [L‑01] | Violation of Checks, Effect and Interactions pattern in _deposit() | 1 |\n| [L‑02] | Set fee limit for changeProtocolFee() | 1 |\n| [L‑03] | draft-ERC20Permit.sol is deprecated by openzeppelin | 1 |\n| [L‑04] | owner must not be address(0) as per EIP-2612 in permit() | 1 |\n| [L‑05] | Violation of Checks, Effect and Interactions pattern in controllerTransfer() | 1 |\n\n\n\n### [L‑01] Violation of Checks, Effect and Interactions pattern in _deposit()\nIt is always recommended to follow Checks, Effect and Interactions(CEI) pattern in contracts to prevent re-entrancy attacks. However this is violated in _deposit() of USDA.sol contract.\n\nThere is 1 instance of this issue:\n\n```Solidity\nFile: core/solidity/contracts/core/USDA.sol\n\n function _deposit(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n if (_susdAmount == 0) revert USDA_ZeroAmount();\n sUSD.transferFrom(_msgSender(), address(this), _susdAmount);\n _mint(_target, _susdAmount);\n // Account for the susd received\n reserveAmount += _susdAmount;\n\n emit Deposit(_target, _susdAmount);\n }\n```\n\n### Recommended Mitigation steps\n\n```Solidity\n\n function _deposit(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n if (_susdAmount == 0) revert USDA_ZeroAmount();\n+ reserveAmount += _susdAmount;\n sUSD.transferFrom(_msgSender(), address(this), _susdAmount);\n _mint(_target, _susdAmount);\n // Account for the susd received\n- reserveAmount += _susdAmount;\n\n emit Deposit(_target, _susdAmount);\n }\n```\n\n### [L‑02] Set fee limit for changeProtocolFee()\nIn VaultController.sol, changeProtocolFee() is used to update the protocol fee. This function can only be accessed by owner of contract. However in a recent hack a malicious owner had set the fee to 100% causing severe loss to users. Therefore, to prevent such hacks it is", "vulnerable_code": "File: core/solidity/contracts/core/USDA.sol\n\n function _deposit(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n if (_susdAmount == 0) revert USDA_ZeroAmount();\n sUSD.transferFrom(_msgSender(), address(this), _susdAmount);\n _mint(_target, _susdAmount);\n // Account for the susd received\n reserveAmount += _susdAmount;\n\n emit Deposit(_target, _susdAmount);\n }", "fixed_code": " function _deposit(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n if (_susdAmount == 0) revert USDA_ZeroAmount();\n+ reserveAmount += _susdAmount;\n sUSD.transferFrom(_msgSender(), address(this), _susdAmount);\n _mint(_target, _susdAmount);\n // Account for the susd received\n- reserveAmount += _susdAmount;\n\n emit Deposit(_target, _susdAmount);\n }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-07-amphora-findings/blob/main/data/MohammedRizwan-Q.md", "collected_at": "2026-01-02T18:23:29.129489+00:00", "source_hash": "ed2408e409c8143e9343258ecea613284fc2da8495282cd0c62b998286ee0a23", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 801, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: core/solidity/contracts/core/USDA.sol\n\n function _deposit(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n if (_susdAmount == 0) revert USDA_ZeroAmount();\n sUSD.transferFrom(_msgSender(), address(this), _susdAmount);\n _mint(_target, _susdAmount);\n // Account for the susd received\n reserveAmount += _susdAmount;\n\n emit Deposit(_target, _susdAmount);\n }", "primary_code_language": "Solidity", "primary_code_char_count": 406, "all_code_blocks": "// Code block 1 (Solidity):\nFile: core/solidity/contracts/core/USDA.sol\n\n function _deposit(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n if (_susdAmount == 0) revert USDA_ZeroAmount();\n sUSD.transferFrom(_msgSender(), address(this), _susdAmount);\n _mint(_target, _susdAmount);\n // Account for the susd received\n reserveAmount += _susdAmount;\n\n emit Deposit(_target, _susdAmount);\n }\n\n// Code block 2 (Solidity):\nfunction _deposit(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n if (_susdAmount == 0) revert USDA_ZeroAmount();\n+ reserveAmount += _susdAmount;\n sUSD.transferFrom(_msgSender(), address(this), _susdAmount);\n _mint(_target, _susdAmount);\n // Account for the susd received\n- reserveAmount += _susdAmount;\n\n emit Deposit(_target, _susdAmount);\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: core/solidity/contracts/core/USDA.sol\n\n function _deposit(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n if (_susdAmount == 0) revert USDA_ZeroAmount();\n sUSD.transferFrom(_msgSender(), address(this), _susdAmount);\n _mint(_target, _susdAmount);\n // Account for the susd received\n reserveAmount += _susdAmount;\n\n emit Deposit(_target, _susdAmount);\n }\n\nfunction _deposit(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n if (_susdAmount == 0) revert USDA_ZeroAmount();\n+ reserveAmount += _susdAmount;\n sUSD.transferFrom(_msgSender(), address(this), _susdAmount);\n _mint(_target, _susdAmount);\n // Account for the susd received\n- reserveAmount += _susdAmount;\n\n emit Deposit(_target, _susdAmount);\n }", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: core/solidity/contracts/core/USDA.sol\n\n function _deposit(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n if (_susdAmount == 0) revert USDA_ZeroAmount();\n sUSD.transferFrom(_msgSender(), address(this), _susdAmount);\n _mint(_target, _susdAmount);\n // Account for the susd received\n reserveAmount += _susdAmount;\n\n emit Deposit(_target, _susdAmount);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function _deposit(uint256 _susdAmount, address _target) internal paysInterest whenNotPaused {\n if (_susdAmount == 0) revert USDA_ZeroAmount();\n+ reserveAmount += _susdAmount;\n sUSD.transferFrom(_msgSender(), address(this), _susdAmount);\n _mint(_target, _susdAmount);\n // Account for the susd received\n- reserveAmount += _susdAmount;\n\n emit Deposit(_target, _susdAmount);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-revert-lend", "title": "0xDemon Q", "severity_raw": "High", "severity": "high", "description": "## **[L-01]\u00a0Unsafe downcast may overflow**\n\nWhen a type is downcast to a smaller type, the higher order bits are discarded, resulting in the application of a modulo operation to the original value.\n\nIf the downcasted value is large enough, this may result in an overflow that will not revert.\n\n```solidity\n instructions.feeAmount0 == type(uint128).max\n ? type(uint128).max\n : (amount0 + instructions.feeAmount0).toUint128(),\n instructions.feeAmount1 == type(uint128).max\n ? type(uint128).max\n : (amount1 + instructions.feeAmount1).toUint128()\n```\n\n*Github : [133 - 138](https://github.com/code-423n4/2024-03-revert-lend/blob/435b054f9ad2404173f36f0f74a5096c894b12b7/src/transformers/V3Utils.sol#L133-L138)*\n\n## [L-02] Low level call to arbitrary address may lead to gas grieffing attack\n\nIf the destination address is a contract that has a fallback function then this can cause very large gas usage or if the destination address is a malicious actor who deliberately carries out gas grieffing.\n\n```solidity\n uint256 balance = address(this).balance;\n if (balance > 0) {\n (bool sent,) = to.call{value: balance}(\"\");\n if (!sent) {\n revert EtherSendFailed();\n }\n```\n\n*Github : [128 - 133](https://github.com/code-423n4/2024-03-revert-lend/blob/435b054f9ad2404173f36f0f74a5096c894b12b7/src/automators/Automator.sol#L128-L133)*", "vulnerable_code": " instructions.feeAmount0 == type(uint128).max\n ? type(uint128).max\n : (amount0 + instructions.feeAmount0).toUint128(),\n instructions.feeAmount1 == type(uint128).max\n ? type(uint128).max\n : (amount1 + instructions.feeAmount1).toUint128()", "fixed_code": " uint256 balance = address(this).balance;\n if (balance > 0) {\n (bool sent,) = to.call{value: balance}(\"\");\n if (!sent) {\n revert EtherSendFailed();\n }", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/0xDemon-Q.md", "collected_at": "2026-01-02T19:02:52.141622+00:00", "source_hash": "ed585452d9cff33ec1721023a33a422fe3330b8c1bed614f2063db052ba73b84", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 510, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "instructions.feeAmount0 == type(uint128).max\n ? type(uint128).max\n : (amount0 + instructions.feeAmount0).toUint128(),\n instructions.feeAmount1 == type(uint128).max\n ? type(uint128).max\n : (amount1 + instructions.feeAmount1).toUint128()", "primary_code_language": "solidity", "primary_code_char_count": 306, "all_code_blocks": "// Code block 1 (solidity):\ninstructions.feeAmount0 == type(uint128).max\n ? type(uint128).max\n : (amount0 + instructions.feeAmount0).toUint128(),\n instructions.feeAmount1 == type(uint128).max\n ? type(uint128).max\n : (amount1 + instructions.feeAmount1).toUint128()\n\n// Code block 2 (solidity):\nuint256 balance = address(this).balance;\n if (balance > 0) {\n (bool sent,) = to.call{value: balance}(\"\");\n if (!sent) {\n revert EtherSendFailed();\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "instructions.feeAmount0 == type(uint128).max\n ? type(uint128).max\n : (amount0 + instructions.feeAmount0).toUint128(),\n instructions.feeAmount1 == type(uint128).max\n ? type(uint128).max\n : (amount1 + instructions.feeAmount1).toUint128()\n\nuint256 balance = address(this).balance;\n if (balance > 0) {\n (bool sent,) = to.call{value: balance}(\"\");\n if (!sent) {\n revert EtherSendFailed();\n }", "github_refs_formatted": "V3Utils.sol#L133-L138, Automator.sol#L128-L133", "github_files_list": "Automator.sol, V3Utils.sol", "github_refs_count": 2, "vulnerable_code_actual": " instructions.feeAmount0 == type(uint128).max\n ? type(uint128).max\n : (amount0 + instructions.feeAmount0).toUint128(),\n instructions.feeAmount1 == type(uint128).max\n ? type(uint128).max\n : (amount1 + instructions.feeAmount1).toUint128()", "has_vulnerable_code_snippet": true, "fixed_code_actual": " uint256 balance = address(this).balance;\n if (balance > 0) {\n (bool sent,) = to.call{value: balance}(\"\");\n if (!sent) {\n revert EtherSendFailed();\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7.93} {"source": "c4", "protocol": "02-ethos", "title": "delfin454000 Q", "severity_raw": "Critical", "severity": "critical", "description": "## Summary\n### Low risk findings\n\n| Issue | Description | Instances |\n| -- | ----------- | -------- |\n|1| Use `require` rather than `assert` where appropriate|19|\n|2| Issues re warning should be resolved before deployment|1|\n|| Total|20|\n\n### Non-critical findings\n\n| Issue | Description | Instances |\n| -- | ----------- | -------- |\n|1| Avoid redundant return statement|5|\n|2| Constant definitions that include call to `keccak256` should use `immutable`|8|\n|3| Invalid import syntax|1|\n|4| Duplicate import statement|1|\n|5| Long single-line comments|68|\n|6| Update sensitive terms in both comments and code|4|\n|7| Typos not included in Automated Findings output|8|\n|8| Inconsistent `returns` syntax|6|\n|9| Inconsistent `require` statement syntax|2|\n|10| `pragma solidity` version should be upgraded to latest version|12|\n|11-1| Natspec is partially missing for some `functions`|3|\n|11-2| `@return` alone is missing for some `functions`|8|\n|11-3| Natspec is wholly missing for some `functions`|142|\n|11-4| Natspec is partially missing for some `constructors`|2|\n|11-5| Natspec is wholly missing for some `constructors`|3|\n|| Total|273|\n\n### Low risk findings\n\n| No. | Explanation + cases | \n|--| ----------- | \n|1|**Use `require` rather than `assert` where appropriate**|\n| |On failure, the `assert` function causes a `Panic` error and, unlike `require`, does not generate an error string. According to Solidity v0.8.18, \"properly functioning code should never create a Panic.\" Therefore, an `assert` should be used only if, based on the relevant associated code, it is never expected to throw an exception. \n\nBelow is an example of valid use of `assert` in Ethos Reserve:\n\n[TroveManager.sol: L1219-1224](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/TroveManager.sol#L1219-L1224)\n```solidity\n * The following assert() holds true because:\n * - The system always contains >= 1 trove\n * - When we close ", "vulnerable_code": " * The following assert() holds true because:\n * - The system always contains >= 1 trove\n * - When we close or liquidate a trove, we redistribute the pending rewards, so if all troves were closed/liquidated,\n * rewards would\u2019ve been emptied and totalCollateralSnapshot would be zero too.\n */\n assert(totalStakesSnapshot[_collateral] > 0);", "fixed_code": " assert(MIN_NET_DEBT > 0);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/delfin454000-Q.md", "collected_at": "2026-01-02T18:17:04.676303+00:00", "source_hash": "ed6dbee02966b8c54e5fc5ed3da7e353ad4e98f65e5818d96e762df5f04bc02a", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "TroveManager.sol#L1219-L1224", "github_files_list": "TroveManager.sol", "github_refs_count": 1, "vulnerable_code_actual": " * The following assert() holds true because:\n * - The system always contains >= 1 trove\n * - When we close or liquidate a trove, we redistribute the pending rewards, so if all troves were closed/liquidated,\n * rewards would\u2019ve been emptied and totalCollateralSnapshot would be zero too.\n */\n assert(totalStakesSnapshot[_collateral] > 0);", "has_vulnerable_code_snippet": true, "fixed_code_actual": " assert(MIN_NET_DEBT > 0);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "03-asymmetry", "title": "Rolezn Q", "severity_raw": "Critical", "severity": "critical", "description": "## Summary\n\n### Low Risk Issues\n| |Issue|Contexts|\n|-|:-|:-:|\n| [LOW‑1](#LOW‑1) | IERC20 `approve()` Is Deprecated | 2 |\n| [LOW‑2](#LOW‑2) | Missing Contract-existence Checks Before Low-level Calls | 5 |\n| [LOW‑3](#LOW‑3) | Contracts are not using their OZ Upgradeable counterparts | 4 |\n| [LOW‑4](#LOW‑4) | TransferOwnership Should Be Two Step | 4 |\n| [LOW‑5](#LOW‑5) | Unused `receive()` Function Will Lock Ether In Contract | 4 |\n| [LOW‑6](#LOW‑6) | No Storage Gap For Upgradeable Contracts | 1 |\n| [LOW‑7](#LOW‑7) | Upgrade OpenZeppelin Contract Dependency | 1 |\n| [LOW‑8](#LOW‑8) | Use `safeTransferOwnership` instead of `transferOwnership` function | 4 |\n| [LOW‑9](#LOW‑9) | Consider the case where totalsupply is 0 | 2 |\n\n\nTotal: 27 contexts over 9 issues\n\n### Non-critical Issues\n| |Issue|Contexts|\n|-|:-|:-:|\n| [NC‑1](#NC‑1) | Add a timelock to critical functions | 8 |\n| [NC‑2](#NC‑2) | Avoid Floating Pragmas: The Version Should Be Locked | 4 |\n| [NC‑3](#NC‑3) | No need for `== true` or `== false` checks | 2 |\n| [NC‑4](#NC‑4) | Constants in comparisons should appear on the left side | 3 |\n| [NC‑5](#NC‑5) | Critical Changes Should Use Two-step Procedure | 8 |\n| [NC‑6](#NC‑6) | Duplicated `require()`/`revert()` Checks Should Be Refactored To A Modifier Or Function | 2 |\n| [NC‑7](#NC‑7) | Event emit should emit a parameter | 1 |\n| [NC‑8](#NC‑8) | Function writing that does not comply with the Solidity Style Guide | 4 |\n| [NC‑9](#NC‑9) | Imports can be grouped together | 31 |\n| [NC‑10](#NC‑10) | NatSpec return parameters should be included in contracts | 1 |\n| [NC‑11](#NC‑11) | No need to initialize uints to zero | 3 |\n| [NC‑12](#NC‑12) | Initial value check is mis", "vulnerable_code": "90: IERC20(_tokenIn).approve(UNISWAP_ROUTER, _amountIn);", "fixed_code": "59: IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Rolezn-Q.md", "collected_at": "2026-01-02T18:18:30.121170+00:00", "source_hash": "ed77c84a7cf8e4172cb35dde13156d90d815552b305694321021f3c6f36a2bbf", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "90: IERC20(_tokenIn).approve(UNISWAP_ROUTER, _amountIn);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "59: IERC20(STETH_TOKEN).approve(LIDO_CRV_POOL, stEthBal);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "06-lybra", "title": "SM3_SS G", "severity_raw": "High", "severity": "high", "description": "\n\n# Summary\n\n\n# Gas Optimization \nno | Issue |Instances||\n|-|:-|:-:|:-:|\n| [G-01] | A modifier used only once and not being inherited should be inlined to save gas | 3 |\n| [G-02] | State variables with values known at compile time should be constants | 2 |\n| [G-03] | Using calldata instead of memory for read-only arguments in external functions saves gas | 1 |\n| [G-04] | Use assembly to check for address(0) | 17 |\n| [G-05] | Amounts should be checked for\u00a00\u00a0before calling a transfer| 5 |\n| [G-06] | Use\u00a0calldata\u00a0instead of\u00a0memory | 2 |\n| [G-07] | Can Make The Variable Outside The Loop To Save Gas | 1 |\n| [G-08] | Use assembly to write address storage values | 12 |\n| [G-09] | Use nested if statements instead of && | 4 |\n| [G-10] | Make 3 event parameters indexed when possible | 8 |\n| [G-11] | internal functions not called by the contract should be removed to save deployment gas | 4 |\n| [G-12] | Use hardcode address instead address(this) | 24 |\n| [G-13] | use Mappings Instead of Arrays | 2 |\n| [G-14] | Use constants instead of type(uintx).max | 1 |\n| [G-15] | State variables can be packed into fewer storage slots | 1 |\n\n\n\n\n## [G-01] A modifier used only once and not being inherited should be inlined to save gas\n\nWhen you use a modifier in Solidity, Solidity generates code to check the conditions of the modifier and execute the modified function if the conditions are met. This generated code can consume gas, especially if the modifier is used frequently or if the modified function is called multiple times.\n\nBy inlining a modifier that is used only once and not being inherited, you can eliminate the overhead of the generated code and reduce the gas cost of your contract.\n\n```solidity \nfile: lybra/token/EUSD.sol\n\n83 modifier MintPaused() {\n require(!configurator.vaultMintPaused(msg.sender), \"MPP\");\n _;\n }\n```\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/token/EUSD.sol#L83-L86\n\n```solidity\nfile: lybr", "vulnerable_code": "file: lybra/token/EUSD.sol\n\n83 modifier MintPaused() {\n require(!configurator.vaultMintPaused(msg.sender), \"MPP\");\n _;\n }", "fixed_code": "file: lybra/token/PeUSDMainnetStableVision.sol\n\n46 modifier MintPaused() {\n require(!configurator.vaultMintPaused(msg.sender), \"MPP\");\n _;\n }\n\n50 modifier BurnPaused() {\n require(!configurator.vaultBurnPaused(msg.sender), \"BPP\");\n _;\n }\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/SM3_SS-G.md", "collected_at": "2026-01-02T18:22:42.643057+00:00", "source_hash": "ed8300cd9ad8cb08f5a581c3593ed2ed644c0d9b0e1f8fd1bcee036b2473c8d5", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 92, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/token/EUSD.sol#L83-L86", "primary_code_language": "unknown", "primary_code_char_count": 92, "all_code_blocks": "// Code block 1 (unknown):\nhttps://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/token/EUSD.sol#L83-L86", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "EUSD.sol#L83-L86", "github_files_list": "EUSD.sol", "github_refs_count": 1, "vulnerable_code_actual": "file: lybra/token/EUSD.sol\n\n83 modifier MintPaused() {\n require(!configurator.vaultMintPaused(msg.sender), \"MPP\");\n _;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "file: lybra/token/PeUSDMainnetStableVision.sol\n\n46 modifier MintPaused() {\n require(!configurator.vaultMintPaused(msg.sender), \"MPP\");\n _;\n }\n\n50 modifier BurnPaused() {\n require(!configurator.vaultBurnPaused(msg.sender), \"BPP\");\n _;\n }\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "05-ajna", "title": "SM3_SS G", "severity_raw": "Medium", "severity": "medium", "description": "# Summary \n\n## Gas Optimization\n\n|No | Issue | Instances|\n|----|-------|-------|\n| [G-01] | Remove unnecessary code: The VOTING_POWER_SNAPSHOT_DELAY constant is not used in the contract and can be removed to reduce unnecessary code. | 1 | - | \n| [G-02] | Failure to check the zero address in the constructor causes the contract to be deployed again | 1 | - | \n| [G-03] | Emit can be rearranged| 1 | - |\n| [G-04] | Change Constant to Immutable for keccak Variables| 2 | - |\n| [G-05] | Using a positive conditional flow to save a NOT opcode | 6 | - | \n| [G-06] | USE ASSEMBLY TO CHECK FOR\u00a0ADDRESS(0) | 1 | - | \n| [G-07] | Use local variables: In the \\_getVotesAtSnapshotBlocks function, the same result is calculated twice, which can be expensive in terms of gas usage. To avoid this, you can store the result in a local variable and reuse it. | 1 | - | \n| [G-08] | Use bytes memory instead of bytes[] memory: In the _hashProposal function, the calldatas_ parameter can be declared as a single bytes memory parameter instead of an array of bytes. This can reduce gas costs by avoiding the overhead of creating an array.| 1 | - | \n| [G-09] | The result of function calls should be cached rather than re-calling the function | 8 | - | \n| [G-10] | Combine similar functions: The \\_getVotesAtSnapshotBlocks and \\_validateCallDatas functions have similar structures and could potentially be combined into a single function with different parameters. This can reduce code duplication and improve gas usage. | 7 | - | \n| [G-11] | Use bitmaps to save gas | 4 | - | \n| [G-12] | Splitting if() statements that use && saves gas| 6 | - | \n| [G-13] | Use != 0 instead of > 0 for unsigned integer comparison | 19 | - | \n| [G-14] | Use calldata instead of memory for function arguments that do not get mutated | 16 | - | \n| [G-15] | Don\u2019t initialize variables with default value | 26 | - | \n| [G-16] | Do not calculate constants | 5 | - | \n| [G-16] | Using delete statement can save gas | 1 ", "vulnerable_code": "file: Funding.sol\n31 uint256 internal constant VOTING_POWER_SNAPSHOT_DELAY = 33;", "fixed_code": "file: PositionManager.sol\n116 constructor(\n ERC20PoolFactory erc20Factory_,\n ERC721PoolFactory erc721Factory_\n ) PermitERC721(\"Ajna Positions NFT-V1\", \"AJNA-V1-POS\", \"1\") {\n erc20PoolFactory = erc20Factory_;\n erc721PoolFactory = erc721Factory_;\n }\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/SM3_SS-G.md", "collected_at": "2026-01-02T18:21:11.848803+00:00", "source_hash": "edadb8d117365cc8788193074db5153bba2fc2cfebfebf06a9721b020c0496a6", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "file: Funding.sol\n31 uint256 internal constant VOTING_POWER_SNAPSHOT_DELAY = 33;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "file: PositionManager.sol\n116 constructor(\n ERC20PoolFactory erc20Factory_,\n ERC721PoolFactory erc721Factory_\n ) PermitERC721(\"Ajna Positions NFT-V1\", \"AJNA-V1-POS\", \"1\") {\n erc20PoolFactory = erc20Factory_;\n erc721PoolFactory = erc721Factory_;\n }\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "09-ondo", "title": "BRONZEDISC Q", "severity_raw": "Medium", "severity": "medium", "description": "## QA\n---\n\n### Layout Order [1]\n\n- The best-practices for layout within a contract is the following order: state variables, events, modifiers, constructor and functions.\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/rwaOracles/RWADynamicOracle.sol\n\n```solidity\n// place this struct with the state variables.\n295: struct Range {\n\n// place these events before the constructor\n309: event RangeSet(\n326: event RangeOverriden(\n\n// place these errors before the constructor\n334: error InvalidPrice();\n335: error InvalidRange();\n336: error PriceNotSet();\n\n// place this state variable with the other ones\n343: uint256 private constant ONE = 10 ** 27;\n```\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDYFactory.sol\n\n```solidity\n// place this modifier before the constructor\n154: modifier onlyGuardian() {\n\n// place this event before the constructor\n146: event rUSDYDeployed(\n```\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDY.sol\n\n```solidity\n// place these events right after state variables.\n154: event TransferShares(\n172: event SharesBurnt(\n189: event TokensBurnt(address indexed account, uint256 tokensBurnt);\n```\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/SourceBridge.sol\n\n```solidity\n/// place these before the constructor\n183: event DestinationChainContractAddressSet(\n189: error DestinationNotSupported();\n190: error GasFeeTooLow();\n```\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/DestinationBridge.sol\n\n```solidity\n// place these structs with the other state variables\n369: struct Threshold {\n374: struct TxnThreshold {\n379: struct Transaction {\n\n// place these events before the constructor\n389: event ApproverRemoved(address approver);\n396: event ApproverAdded(address approver);\n405: event ChainIdSupported(string srcChain, string approvedSource);\n414: event ThresholdSet(string chain, uint256[] amounts, uint256[] numOfApprovers);\n422: event ", "vulnerable_code": "// place this struct with the state variables.\n295: struct Range {\n\n// place these events before the constructor\n309: event RangeSet(\n326: event RangeOverriden(\n\n// place these errors before the constructor\n334: error InvalidPrice();\n335: error InvalidRange();\n336: error PriceNotSet();\n\n// place this state variable with the other ones\n343: uint256 private constant ONE = 10 ** 27;", "fixed_code": "// place this modifier before the constructor\n154: modifier onlyGuardian() {\n\n// place this event before the constructor\n146: event rUSDYDeployed(", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/BRONZEDISC-Q.md", "collected_at": "2026-01-02T18:25:24.174413+00:00", "source_hash": "ee0273835b2305f7c992f294ab21dba45cc6cf794403881aef7f30e5ead79f25", "code_block_count": 4, "solidity_block_count": 4, "total_code_chars": 864, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "// place this struct with the state variables.\n295: struct Range {\n\n// place these events before the constructor\n309: event RangeSet(\n326: event RangeOverriden(\n\n// place these errors before the constructor\n334: error InvalidPrice();\n335: error InvalidRange();\n336: error PriceNotSet();\n\n// place this state variable with the other ones\n343: uint256 private constant ONE = 10 ** 27;", "primary_code_language": "solidity", "primary_code_char_count": 389, "all_code_blocks": "// Code block 1 (solidity):\n// place this struct with the state variables.\n295: struct Range {\n\n// place these events before the constructor\n309: event RangeSet(\n326: event RangeOverriden(\n\n// place these errors before the constructor\n334: error InvalidPrice();\n335: error InvalidRange();\n336: error PriceNotSet();\n\n// place this state variable with the other ones\n343: uint256 private constant ONE = 10 ** 27;\n\n// Code block 2 (solidity):\n// place this modifier before the constructor\n154: modifier onlyGuardian() {\n\n// place this event before the constructor\n146: event rUSDYDeployed(\n\n// Code block 3 (solidity):\n// place these events right after state variables.\n154: event TransferShares(\n172: event SharesBurnt(\n189: event TokensBurnt(address indexed account, uint256 tokensBurnt);\n\n// Code block 4 (solidity):\n/// place these before the constructor\n183: event DestinationChainContractAddressSet(\n189: error DestinationNotSupported();\n190: error GasFeeTooLow();", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "// place this struct with the state variables.\n295: struct Range {\n\n// place these events before the constructor\n309: event RangeSet(\n326: event RangeOverriden(\n\n// place these errors before the constructor\n334: error InvalidPrice();\n335: error InvalidRange();\n336: error PriceNotSet();\n\n// place this state variable with the other ones\n343: uint256 private constant ONE = 10 ** 27;\n\n// place this modifier before the constructor\n154: modifier onlyGuardian() {\n\n// place this event before the constructor\n146: event rUSDYDeployed(\n\n// place these events right after state variables.\n154: event TransferShares(\n172: event SharesBurnt(\n189: event TokensBurnt(address indexed account, uint256 tokensBurnt);\n\n/// place these before the constructor\n183: event DestinationChainContractAddressSet(\n189: error DestinationNotSupported();\n190: error GasFeeTooLow();", "github_refs_formatted": "RWADynamicOracle.sol, rUSDYFactory.sol, rUSDY.sol, SourceBridge.sol, DestinationBridge.sol", "github_files_list": "rUSDYFactory.sol, RWADynamicOracle.sol, rUSDY.sol, SourceBridge.sol, DestinationBridge.sol", "github_refs_count": 5, "vulnerable_code_actual": "// place this struct with the state variables.\n295: struct Range {\n\n// place these events before the constructor\n309: event RangeSet(\n326: event RangeOverriden(\n\n// place these errors before the constructor\n334: error InvalidPrice();\n335: error InvalidRange();\n336: error PriceNotSet();\n\n// place this state variable with the other ones\n343: uint256 private constant ONE = 10 ** 27;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "// place this modifier before the constructor\n154: modifier onlyGuardian() {\n\n// place this event before the constructor\n146: event rUSDYDeployed(", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "01-salty", "title": "0xHelium Analysis", "severity_raw": "High", "severity": "high", "description": "# Salty.io Analysis reports\n![Imgur](https://i.imgur.com/0kcgGjN.png)\n## Note for sponsor to contextualize the analysis\nThe following analysis should be taken with the following in mind:\n- Most of the recommendation are after the codebase overview, so there is where you should look at.\n- The following analysis reports of this codebase mainly adds lots of personal recommandation to improve said codebase.\n- Sponsor can use the visual representation to improve their docs and use the recommandations to improve the codebase.\n\n### Codebase Overview\nSalty.IO is a Decentralized Exchange on Ethereum which uses Automatic Atomic Arbitrage (AAA) to generate yield and provide Zero Fees on all swaps.\n![Imgur](https://i.imgur.com/4YNcJZ9.png)\n\nWith AAA, market inefficiencies are arbitraged at swap time to create profits - which are then distributed to liquidity providers and stakers and used to form Protocol Owned Liquidity (POL) for the DAO.\n\nAdditionally, Salty.IO provides USDS, an overcollateralized ERC20 stablecoin native to the protocol which uses WBTC/WETH LP as collateral.\n![Imgur](https://i.imgur.com/VJIPyeC.png)\n\n### Technical overview\nThe Salty.IO codebase is divided up into the following folders:\n/arbitrage - handles searching for arbitrage opportunities at user swap time with the actual arbitrage swaps being done within Pools.sol itself. \n![Imgur](https://i.imgur.com/gAgV19D.png)\nAs seen in the above image , we can conclude that swaping token1 -> token2 following the inverse route as swapping token2 -> token1 This mechanism is gas efficient in theory, but in practice it's prone to sandwich attacks by MEVs. Consider the scenario below:Arbitrage is following WETH-> WBTC-> SALT-> WETH path, A mev can just buy some WBTC to increase the price prior to swapping WETH-> WBTC and sell after the swapping to make profits.\nTo remediate consider adding a slippage protection to the arbitrage\n\n/dao - handles creating governance proposals, voting, acting on successful proposals and ma", "vulnerable_code": "\tfunction _aggregatePrices( uint256 price1, uint256 price2, uint256 price3 ) internal view returns (uint256)\n\t\t{\n\t\tuint256 numNonZero;\n\n\t\tif (price1 > 0)\n\t\t\tnumNonZero++;\n\n\t\tif (price2 > 0)\n\t\t\tnumNonZero++;\n\n\t\tif (price3 > 0)\n\t\t\tnumNonZero++;\n\n\t\t// If less than two price sources then return zero to indicate failure\n\t\tif ( numNonZero < 2 )\n\t\t\treturn 0;\n\n\t\tuint256 diff12 = _absoluteDifference(price1, price2);\n\t\tuint256 diff13 = _absoluteDifference(price1, price3);\n\t\tuint256 diff23 = _absoluteDifference(price2, price3);\n\n\t\tuint256 priceA;\n\t\tuint256 priceB;\n\n\t\tif ( ( diff12 <= diff13 ) && ( diff12 <= diff23 ) )\n\t\t\t(priceA, priceB) = (price1, price2);\n\t\telse if ( ( diff13 <= diff12 ) && ( diff13 <= diff23 ) )\n\t\t\t(priceA, priceB) = (price1, price3);\n\t\telse if ( ( diff23 <= diff12 ) && ( diff23 <= diff13 ) )\n\t\t\t(priceA, priceB) = (price2, price3);\n\n\t\tuint256 averagePrice = ( priceA + priceB ) / 2;\n\n\t\t// If price sources are too far apart then return zero to indicate failure\n\t\tif ( (_absoluteDifference(priceA, priceB) * 100000) / averagePrice > maximumPriceFeedPercentDifferenceTimes1000 )\n\t\t\treturn 0;\n\n\t\treturn averagePrice;\n\t\t}", "fixed_code": "function performUpkeep() public nonReentrant\n\t\t{\n\t\t// Perform the multiple steps of performUpkeep()\n \t\ttry this.step1() {}\n\t\tcatch (bytes memory error) { emit UpkeepError(\"Step 1\", error); }\n\n \t\ttry this.step2(msg.sender) {}\n\t\tcatch (bytes memory error) { emit UpkeepError(\"Step 2\", error); }\n\n \t\ttry this.step3() {}\n\t\tcatch (bytes memory error) { emit UpkeepError(\"Step 3\", error); }\n\n \t\ttry this.step4() {}\n\t\tcatch (bytes memory error) { emit UpkeepError(\"Step 4\", error); }\n\n \t\ttry this.step5() {}\n\t\tcatch (bytes memory error) { emit UpkeepError(\"Step 5\", error); }\n\n \t\ttry this.step6() {}\n\t\tcatch (bytes memory error) { emit UpkeepError(\"Step 6\", error); }\n\n \t\ttry this.step7() {}\n\t\tcatch (bytes memory error) { emit UpkeepError(\"Step 7\", error); }\n\n \t\ttry this.step8() {}\n\t\tcatch (bytes memory error) { emit UpkeepError(\"Step 8\", error); }\n\n \t\ttry this.step9() {}\n\t\tcatch (bytes memory error) { emit UpkeepError(\"Step 9\", error); }\n\n \t\ttry this.step10() {}\n\t\tcatch (bytes memory error) { emit UpkeepError(\"Step 10\", error); }\n\n \t\ttry this.step11() {}\n\t\tcatch (bytes memory error) { emit UpkeepError(\"Step 11\", error); }\n\t\t}", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/0xHelium-Analysis.md", "collected_at": "2026-01-02T19:01:03.800198+00:00", "source_hash": "ee09fac6b0213c5950e067dadca4ef5c241f641100249de8e1f712518a0b6eb8", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "\tfunction _aggregatePrices( uint256 price1, uint256 price2, uint256 price3 ) internal view returns (uint256)\n\t\t{\n\t\tuint256 numNonZero;\n\n\t\tif (price1 > 0)\n\t\t\tnumNonZero++;\n\n\t\tif (price2 > 0)\n\t\t\tnumNonZero++;\n\n\t\tif (price3 > 0)\n\t\t\tnumNonZero++;\n\n\t\t// If less than two price sources then return zero to indicate failure\n\t\tif ( numNonZero < 2 )\n\t\t\treturn 0;\n\n\t\tuint256 diff12 = _absoluteDifference(price1, price2);\n\t\tuint256 diff13 = _absoluteDifference(price1, price3);\n\t\tuint256 diff23 = _absoluteDifference(price2, price3);\n\n\t\tuint256 priceA;\n\t\tuint256 priceB;\n\n\t\tif ( ( diff12 <= diff13 ) && ( diff12 <= diff23 ) )\n\t\t\t(priceA, priceB) = (price1, price2);\n\t\telse if ( ( diff13 <= diff12 ) && ( diff13 <= diff23 ) )\n\t\t\t(priceA, priceB) = (price1, price3);\n\t\telse if ( ( diff23 <= diff12 ) && ( diff23 <= diff13 ) )\n\t\t\t(priceA, priceB) = (price2, price3);\n\n\t\tuint256 averagePrice = ( priceA + priceB ) / 2;\n\n\t\t// If price sources are too far apart then return zero to indicate failure\n\t\tif ( (_absoluteDifference(priceA, priceB) * 100000) / averagePrice > maximumPriceFeedPercentDifferenceTimes1000 )\n\t\t\treturn 0;\n\n\t\treturn averagePrice;\n\t\t}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function performUpkeep() public nonReentrant\n\t\t{\n\t\t// Perform the multiple steps of performUpkeep()\n \t\ttry this.step1() {}\n\t\tcatch (bytes memory error) { emit UpkeepError(\"Step 1\", error); }\n\n \t\ttry this.step2(msg.sender) {}\n\t\tcatch (bytes memory error) { emit UpkeepError(\"Step 2\", error); }\n\n \t\ttry this.step3() {}\n\t\tcatch (bytes memory error) { emit UpkeepError(\"Step 3\", error); }\n\n \t\ttry this.step4() {}\n\t\tcatch (bytes memory error) { emit UpkeepError(\"Step 4\", error); }\n\n \t\ttry this.step5() {}\n\t\tcatch (bytes memory error) { emit UpkeepError(\"Step 5\", error); }\n\n \t\ttry this.step6() {}\n\t\tcatch (bytes memory error) { emit UpkeepError(\"Step 6\", error); }\n\n \t\ttry this.step7() {}\n\t\tcatch (bytes memory error) { emit UpkeepError(\"Step 7\", error); }\n\n \t\ttry this.step8() {}\n\t\tcatch (bytes memory error) { emit UpkeepError(\"Step 8\", error); }\n\n \t\ttry this.step9() {}\n\t\tcatch (bytes memory error) { emit UpkeepError(\"Step 9\", error); }\n\n \t\ttry this.step10() {}\n\t\tcatch (bytes memory error) { emit UpkeepError(\"Step 10\", error); }\n\n \t\ttry this.step11() {}\n\t\tcatch (bytes memory error) { emit UpkeepError(\"Step 11\", error); }\n\t\t}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "10-badger", "title": "7ashraf Q", "severity_raw": "Low", "severity": "low", "description": "\n# Possible division by zero\n## Instances\nCDPManager.sol #621-622\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/CdpManager.sol#L621\n\nLiquidationLibrary.sol #555\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/LiquidationLibrary.sol#L555\n\nLiquidationLibrary.sol #558\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/LiquidationLibrary.sol#L558\n\nLiquidationLibrary.sol #579\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/LiquidationLibrary.sol#L579\n\nNeed to validate ```_redeemColFromCdp``` to avoid division by 0 risk\nCdpManager.sol #135\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/CdpManager.sol#L135\n\n## Description \nby tracing the function calls, after calling decrease system debt to zero, a zero value may be passed to the function\n\n## Mitigation\nAdd a ```require value > 0``` statement before diding by ```value```\n\n# Check if cpd exists first \n## Instances\n* LiquidationLibrary.sol #400\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/LiquidationLibrary.sol#L400\n\n* LiquidationLibrary.sol #455\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/LiquidationLibrary.sol#L455\n\n* CdpManager.sol #419\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/CdpManager.sol#L419\n\n* CdpManager.sol#432\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/CdpManager.sol#L432\n\n* LiquidationLibrary.sol #472\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/LiquidationLibrary.sol#L472\n\n* LiquidationLibrary.sol #754\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/LiquidationLibrary.sol#L754\n\n* CdpManager.sol #336\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/CdpManager.sol#L336", "vulnerable_code": "# Check if cpd exists first \n## Instances\n* LiquidationLibrary.sol #400\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/LiquidationLibrary.sol#L400\n\n* LiquidationLibrary.sol #455\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/LiquidationLibrary.sol#L455\n\n* CdpManager.sol #419\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/CdpManager.sol#L419\n\n* CdpManager.sol#432\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/CdpManager.sol#L432\n\n* LiquidationLibrary.sol #472\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/LiquidationLibrary.sol#L472\n\n* LiquidationLibrary.sol #754\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/LiquidationLibrary.sol#L754\n\n* CdpManager.sol #336\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/CdpManager.sol#L336\n\n* CdpManager.sol #334\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/CdpManager.sol#L334\n# Should check if borrower and position manager exist first\n\n## Instances\n* BorrowerOperations.sol #635 \nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/BorrowerOperations.sol#L635\n* BorrowerOperations.sol #647\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/BorrowerOperations.sol#L647\n* BorrowerOperations.sol #653\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/BorrowerOperations.sol#L653\n\n# Unsafe subtraction\n## Instances\n* BorrowerOperations.sol #1062\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/BorrowerOperations.sol#L1060C9-L1062C56", "fixed_code": "", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/7ashraf-Q.md", "collected_at": "2026-01-02T18:26:28.156504+00:00", "source_hash": "ee10321adf4f3157430942bcc9abd916ef24d86edc07f69ca4d0614babc0fafb", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 17, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CdpManager.sol#L621, LiquidationLibrary.sol#L555, LiquidationLibrary.sol#L558, LiquidationLibrary.sol#L579, CdpManager.sol#L135, LiquidationLibrary.sol#L400, LiquidationLibrary.sol#L455, CdpManager.sol#L419, CdpManager.sol#L432, LiquidationLibrary.sol#L472, LiquidationLibrary.sol#L754, CdpManager.sol#L336, CdpManager.sol#L334, BorrowerOperations.sol#L635, BorrowerOperations.sol#L647, BorrowerOperations.sol#L653, BorrowerOperations.sol#L1060-L9", "github_files_list": "BorrowerOperations.sol, CdpManager.sol, LiquidationLibrary.sol", "github_refs_count": 17, "vulnerable_code_actual": "# Check if cpd exists first \n## Instances\n* LiquidationLibrary.sol #400\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/LiquidationLibrary.sol#L400\n\n* LiquidationLibrary.sol #455\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/LiquidationLibrary.sol#L455\n\n* CdpManager.sol #419\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/CdpManager.sol#L419\n\n* CdpManager.sol#432\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/CdpManager.sol#L432\n\n* LiquidationLibrary.sol #472\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/LiquidationLibrary.sol#L472\n\n* LiquidationLibrary.sol #754\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/LiquidationLibrary.sol#L754\n\n* CdpManager.sol #336\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/CdpManager.sol#L336\n\n* CdpManager.sol #334\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/CdpManager.sol#L334\n# Should check if borrower and position manager exist first\n\n## Instances\n* BorrowerOperations.sol #635 \nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/BorrowerOperations.sol#L635\n* BorrowerOperations.sol #647\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/BorrowerOperations.sol#L647\n* BorrowerOperations.sol #653\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/BorrowerOperations.sol#L653\n\n# Unsafe subtraction\n## Instances\n* BorrowerOperations.sol #1062\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/BorrowerOperations.sol#L1060C9-L1062C56", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "11-kelp", "title": "Bauchibred Q", "severity_raw": "High", "severity": "high", "description": "# QA Report\n\n## Table of Contents\n\n| Issue ID | Description |\n| --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |\n| [QA-01](#qa-01-transfers-should-be-done-via-a-low-level-call-if-possible) | Transfers should be done via a low-level call if possible |\n| [QA-02](#qa-02-multiple-issues-on-how-external-protocols-are-being-integrated-to-kelp) | Multiple issues on how external protocols are being integrated to KELP |\n| [QA-03](#qa-03-protocol-might-break-for-a-token-with-a-proxy-and-implementation-contract-like-cbeth-reth) | Protocol might break for a token with a proxy and implementation contract (like cbETH/rETH) |\n| [QA-04](#qa-04-setters-should-always-have-equality-checkers) | Setters should always have equality checkers |\n| [QA-05](#qa-05-lrtoracle-sol-should-implement-the-whennotpaused-modifier) | `LrtOracle.sol` should implement the `whenNotPaused()` modifier |\n| [QA-06](#qa-06-lrtconfiginitialize-could-be-made-more-effective) | `LRTConfig::initialize()` could be made more effective |\n\n## QA-01 Transfers should be done via a low-level call if possible\n\n### Impact\n\nSome tokens do not follow the normal EIP20 specification, i.e instead of returning false on trnasfer failures they revert, which means that the current interface being used wouldn't work with these tokens\n\n### Proof of Concept\n\nUsing this search comman", "vulnerable_code": " function transferAssetToNodeDelegator(\n uint256 ndcIndex,\n address asset,\n uint256 amount\n )\n external\n nonReentrant\n onlyLRTManager\n onlySupportedAsset(asset)\n {\n address nodeDelegator = nodeDelegatorQueue[ndcIndex];\n if (!IERC20(asset).transfer(nodeDelegator, amount)) {\n revert TokenTransferFailed();\n }\n }", "fixed_code": " function transfer(address recipient, uint256 amount) external returns (bool);", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/Bauchibred-Q.md", "collected_at": "2026-01-02T18:27:21.891432+00:00", "source_hash": "ee1500a6c5405c12be27945797b0fc0c0909d34bfa56c9bb72fc8676efa54030", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function transferAssetToNodeDelegator(\n uint256 ndcIndex,\n address asset,\n uint256 amount\n )\n external\n nonReentrant\n onlyLRTManager\n onlySupportedAsset(asset)\n {\n address nodeDelegator = nodeDelegatorQueue[ndcIndex];\n if (!IERC20(asset).transfer(nodeDelegator, amount)) {\n revert TokenTransferFailed();\n }\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function transfer(address recipient, uint256 amount) external returns (bool);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-salty", "title": "n0kto G", "severity_raw": "Gas", "severity": "gas", "description": "# `PoolConfig::whitelistPool` can return PoolID to save gas.\n\n## Description\n\nThe `DAO::_finalizeTokenWhitelisting` function whitelists pools using `poolsConfig.whitelistPool`. This function already retrieves the poolID, but it doesn't return it. Modifying `PoolConfig::whitelistPool` to return the poolID can save approximately 1838 gas units per call, resulting in cost savings.\n\nThese savings can be significant, especially considering the current gas prices. With an average gas price of 20 gwei per unit and the price of Ether at \\$2250, this modification can save more than \\$0.08 for each call. It's important to note that `PoolConfig::whitelistPool` is only called in `DAO::_finalizeTokenWhitelisting`, which doesn\u2019t imply a big refactor.\n\n```javascript\n function _finalizeTokenWhitelisting(uint256 ballotID) internal {\n if (proposals.ballotIsApproved(ballotID)) {\n ...\n@> poolsConfig.whitelistPool(\n@> pools,\n@> IERC20(ballot.address1),\n@> exchangeConfig.wbtc()\n@> );\n@> poolsConfig.whitelistPool(\n@> pools,\n@> IERC20(ballot.address1),\n@> exchangeConfig.weth()\n@> );\n\n@> bytes32 pool1 = PoolUtils._poolID(\n@> IERC20(ballot.address1),\n@> exchangeConfig.wbtc()\n@> );\n@> bytes32 pool2 = PoolUtils._poolID(\n@> IERC20(ballot.address1),\n@> exchangeConfig.weth()\n@> );\n ...\n }\n ...\n }\n```\n\n## Impact\n\nOptimizes gas consumption.\n\n## Proof of Concept\n\n### Foundry PoC added to `DAO.t.sol`\n\n```javascript\nfunction testWhitelistTokenApprovedGasEfficiency() public {\n vm.startPrank(alice);\n staking.stakeSALT(1000000 ether);\n\n IERC20 token = new TestERC20(\"TEST\", 18);\n\n proposals.proposeTokenWhitelisting(token, \"\", \"\");\n\n uint256 ballotID = 1;\n proposals.castVote(ballotID, Vote.YES);\n\n // Incr", "vulnerable_code": " function _finalizeTokenWhitelisting(uint256 ballotID) internal {\n if (proposals.ballotIsApproved(ballotID)) {\n ...\n@> poolsConfig.whitelistPool(\n@> pools,\n@> IERC20(ballot.address1),\n@> exchangeConfig.wbtc()\n@> );\n@> poolsConfig.whitelistPool(\n@> pools,\n@> IERC20(ballot.address1),\n@> exchangeConfig.weth()\n@> );\n\n@> bytes32 pool1 = PoolUtils._poolID(\n@> IERC20(ballot.address1),\n@> exchangeConfig.wbtc()\n@> );\n@> bytes32 pool2 = PoolUtils._poolID(\n@> IERC20(ballot.address1),\n@> exchangeConfig.weth()\n@> );\n ...\n }\n ...\n }", "fixed_code": "function testWhitelistTokenApprovedGasEfficiency() public {\n vm.startPrank(alice);\n staking.stakeSALT(1000000 ether);\n\n IERC20 token = new TestERC20(\"TEST\", 18);\n\n proposals.proposeTokenWhitelisting(token, \"\", \"\");\n\n uint256 ballotID = 1;\n proposals.castVote(ballotID, Vote.YES);\n\n // Increase block time to finalize the ballot\n vm.warp(block.timestamp + 11 days);\n\n // Test Parameter Ballot finalization\n salt.transfer(address(dao), 399999 ether);\n salt.transfer(address(dao), 5 ether);\n\n uint gas_before = gasleft();\n dao.finalizeBallot(ballotID);\n uint gas_after = gasleft();\n console.log(gas_before - gas_after);\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/n0kto-G.md", "collected_at": "2026-01-02T19:01:53.443347+00:00", "source_hash": "ee1def0a227c3a02b0d7da00ace740f6dd09e475233856e4e00e16570af57247", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 806, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _finalizeTokenWhitelisting(uint256 ballotID) internal {\n if (proposals.ballotIsApproved(ballotID)) {\n ...\n@> poolsConfig.whitelistPool(\n@> pools,\n@> IERC20(ballot.address1),\n@> exchangeConfig.wbtc()\n@> );\n@> poolsConfig.whitelistPool(\n@> pools,\n@> IERC20(ballot.address1),\n@> exchangeConfig.weth()\n@> );\n\n@> bytes32 pool1 = PoolUtils._poolID(\n@> IERC20(ballot.address1),\n@> exchangeConfig.wbtc()\n@> );\n@> bytes32 pool2 = PoolUtils._poolID(\n@> IERC20(ballot.address1),\n@> exchangeConfig.weth()\n@> );\n ...\n }\n ...\n }", "primary_code_language": "javascript", "primary_code_char_count": 806, "all_code_blocks": "// Code block 1 (javascript):\nfunction _finalizeTokenWhitelisting(uint256 ballotID) internal {\n if (proposals.ballotIsApproved(ballotID)) {\n ...\n@> poolsConfig.whitelistPool(\n@> pools,\n@> IERC20(ballot.address1),\n@> exchangeConfig.wbtc()\n@> );\n@> poolsConfig.whitelistPool(\n@> pools,\n@> IERC20(ballot.address1),\n@> exchangeConfig.weth()\n@> );\n\n@> bytes32 pool1 = PoolUtils._poolID(\n@> IERC20(ballot.address1),\n@> exchangeConfig.wbtc()\n@> );\n@> bytes32 pool2 = PoolUtils._poolID(\n@> IERC20(ballot.address1),\n@> exchangeConfig.weth()\n@> );\n ...\n }\n ...\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function _finalizeTokenWhitelisting(uint256 ballotID) internal {\n if (proposals.ballotIsApproved(ballotID)) {\n ...\n@> poolsConfig.whitelistPool(\n@> pools,\n@> IERC20(ballot.address1),\n@> exchangeConfig.wbtc()\n@> );\n@> poolsConfig.whitelistPool(\n@> pools,\n@> IERC20(ballot.address1),\n@> exchangeConfig.weth()\n@> );\n\n@> bytes32 pool1 = PoolUtils._poolID(\n@> IERC20(ballot.address1),\n@> exchangeConfig.wbtc()\n@> );\n@> bytes32 pool2 = PoolUtils._poolID(\n@> IERC20(ballot.address1),\n@> exchangeConfig.weth()\n@> );\n ...\n }\n ...\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function testWhitelistTokenApprovedGasEfficiency() public {\n vm.startPrank(alice);\n staking.stakeSALT(1000000 ether);\n\n IERC20 token = new TestERC20(\"TEST\", 18);\n\n proposals.proposeTokenWhitelisting(token, \"\", \"\");\n\n uint256 ballotID = 1;\n proposals.castVote(ballotID, Vote.YES);\n\n // Increase block time to finalize the ballot\n vm.warp(block.timestamp + 11 days);\n\n // Test Parameter Ballot finalization\n salt.transfer(address(dao), 399999 ether);\n salt.transfer(address(dao), 5 ether);\n\n uint gas_before = gasleft();\n dao.finalizeBallot(ballotID);\n uint gas_after = gasleft();\n console.log(gas_before - gas_after);\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "04-caviar", "title": "RaymondFam Q", "severity_raw": "High", "severity": "high", "description": "## Missing setter for `changeFee`\n`setChangeFee()` is missing in PrivatePool. In the event an adjustment is needed due to incorrect initialization, there is no option for that. Consider implementing a setter for `changeFee` just like it has been done so for its all other counterparts.\n\n## Sanity checks at the constructor\nAdequate zero address and zero value checks should be implemented in [`initialize()`](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L157-L200) of PrivatePool to avoid accidental error(s) that could result in non-functional calls associated with it particularly when assigning presumably immutable variables, i.e. `baseToken`, `nft`, and `changeFee`.\n\n## Typo mistakes\n[File: Factory.sol#L166](https://github.com/code-423n4/2023-04-caviar/blob/main/src/Factory.sol#L166)\n\n```diff\n- /// @param salt The salt that will used on deployment.\n+ /// @param salt The salt that will be used on deployment.\n```\n## Unbounded loop in `deposit()`\nThe [for loops](https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L239-L241) entailed could easily run out of gas since an NFT collection usually entails thousands of tokenIds. The impact is low since the user can always retry with a smaller array size after encountering a DoS. Where possible, comment with a suggested `tokenIds.length` so users get an idea what array size to work with or better yet set an upper bound to it in the function logic . \n\n## Inadequate NatSpec\nSolidity contracts can use a special form of comments, i.e., the Ethereum Natural Language Specification Format (NatSpec) to provide rich documentation for functions, return variables and more. Please visit the following link for further details:\n\nhttps://docs.soliditylang.org/en/v0.8.16/natspec-format.html\n\nConsider fully equipping all contracts with complete set of NatSpec to better facilitate users/developers interacting with the protocol's smart contracts.\n\nFor instance, the function NatSpec of [`se", "vulnerable_code": "## Unbounded loop in `deposit()`\nThe [for loops](https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L239-L241) entailed could easily run out of gas since an NFT collection usually entails thousands of tokenIds. The impact is low since the user can always retry with a smaller array size after encountering a DoS. Where possible, comment with a suggested `tokenIds.length` so users get an idea what array size to work with or better yet set an upper bound to it in the function logic . \n\n## Inadequate NatSpec\nSolidity contracts can use a special form of comments, i.e., the Ethereum Natural Language Specification Format (NatSpec) to provide rich documentation for functions, return variables and more. Please visit the following link for further details:\n\nhttps://docs.soliditylang.org/en/v0.8.16/natspec-format.html\n\nConsider fully equipping all contracts with complete set of NatSpec to better facilitate users/developers interacting with the protocol's smart contracts.\n\nFor instance, the function NatSpec of [`sell()`](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L291-L306) in PrivatePool will be perfect with missing @return protocolFeeAmount added. \n\n## Unspecific compiler version pragma\nFor some source-units the compiler version pragma is very unspecific, i.e. ^0.8.19. While this often makes sense for libraries to allow them to be included with multiple different versions of an application, it may be a security risk for the actual application implementation itself. A known vulnerable compiler version may accidentally be selected or security tools might fall-back to an older compiler version ending up actually checking a different EVM compilation that is ultimately deployed on the blockchain.\n\nAvoid floating pragmas where possible. It is highly recommend pinning a concrete compiler version (latest without security issues) in at least the top-level \u201cdeployed\u201d contracts to make it unambiguous which compiler version is bein", "fixed_code": "## Gas griefing/theft is possible on unsafe external call\n`return` data (bool success,) has to be stored due to EVM architecture, if in a usage like below, \u2018out\u2019 and \u2018outsize\u2019 values are given (0,0). Thus, this storage disappears and may come from external contracts a possible gas grieving/theft problem is avoided as denoted in the link below:\n\nhttps://twitter.com/pashovkrum/status/1607024043718316032?t=xs30iD6ORWtE2bTTYsCFIQ&s=19\n\nHere is a specific instance entailed:\n\n[File: PrivatePool.sol#L461](PrivatePool.sol#L461](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L461)\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/RaymondFam-Q.md", "collected_at": "2026-01-02T18:20:00.955728+00:00", "source_hash": "ef8ee24262df4134d806505f3e9c118dbc88c5b381beb142ca43b0764f636e3f", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 122, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "- /// @param salt The salt that will used on deployment.\n+ /// @param salt The salt that will be used on deployment.", "primary_code_language": "diff", "primary_code_char_count": 122, "all_code_blocks": "// Code block 1 (diff):\n- /// @param salt The salt that will used on deployment.\n+ /// @param salt The salt that will be used on deployment.", "all_code_blocks_count": 1, "has_diff_blocks": true, "diff_code": "- /// @param salt The salt that will used on deployment.\n+ /// @param salt The salt that will be used on deployment.", "solidity_code": "", "github_refs_formatted": "PrivatePool.sol#L157-L200, Factory.sol#L166, EthRouter.sol#L239-L241, PrivatePool.sol#L291-L306, PrivatePool.sol#L461", "github_files_list": "EthRouter.sol, PrivatePool.sol, Factory.sol", "github_refs_count": 5, "vulnerable_code_actual": "## Unbounded loop in `deposit()`\nThe [for loops](https://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol#L239-L241) entailed could easily run out of gas since an NFT collection usually entails thousands of tokenIds. The impact is low since the user can always retry with a smaller array size after encountering a DoS. Where possible, comment with a suggested `tokenIds.length` so users get an idea what array size to work with or better yet set an upper bound to it in the function logic . \n\n## Inadequate NatSpec\nSolidity contracts can use a special form of comments, i.e., the Ethereum Natural Language Specification Format (NatSpec) to provide rich documentation for functions, return variables and more. Please visit the following link for further details:\n\nhttps://docs.soliditylang.org/en/v0.8.16/natspec-format.html\n\nConsider fully equipping all contracts with complete set of NatSpec to better facilitate users/developers interacting with the protocol's smart contracts.\n\nFor instance, the function NatSpec of [`sell()`](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L291-L306) in PrivatePool will be perfect with missing @return protocolFeeAmount added. \n\n## Unspecific compiler version pragma\nFor some source-units the compiler version pragma is very unspecific, i.e. ^0.8.19. While this often makes sense for libraries to allow them to be included with multiple different versions of an application, it may be a security risk for the actual application implementation itself. A known vulnerable compiler version may accidentally be selected or security tools might fall-back to an older compiler version ending up actually checking a different EVM compilation that is ultimately deployed on the blockchain.\n\nAvoid floating pragmas where possible. It is highly recommend pinning a concrete compiler version (latest without security issues) in at least the top-level \u201cdeployed\u201d contracts to make it unambiguous which compiler version is bein", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## Gas griefing/theft is possible on unsafe external call\n`return` data (bool success,) has to be stored due to EVM architecture, if in a usage like below, \u2018out\u2019 and \u2018outsize\u2019 values are given (0,0). Thus, this storage disappears and may come from external contracts a possible gas grieving/theft problem is avoided as denoted in the link below:\n\nhttps://twitter.com/pashovkrum/status/1607024043718316032?t=xs30iD6ORWtE2bTTYsCFIQ&s=19\n\nHere is a specific instance entailed:\n\n[File: PrivatePool.sol#L461](PrivatePool.sol#L461](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L461)\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "01-biconomy", "title": "tnevler Q", "severity_raw": "Critical", "severity": "critical", "description": "# Report\n## Low Risk ##\n### [L-1]: Critical changes should use two-step procedure\n**Context:**\n\n1. ```function setOwner(address _newOwner) external mixedAuth {``` [L109](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L109)\n1. ```function updateImplementation(address _implementation) external mixedAuth {``` [L120](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L120)\n1. ```function setEntryPoint(IEntryPoint _entryPoint) public onlyOwner {``` [L24](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol#L24)\n1. ```function setSigner( address _newVerifyingSigner) external onlyOwner{``` [L65](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol#L65) \n\n**Recommendation:**\n\nThe best practice is to use two-step procedure for critical changes to make them less error-prone. \n\n## Non-Critical Issues ##\n### [N-1]: Function defines a named return variable but then it uses return statements\n**Context:**\n\n1. ```return abi.encode(data.paymasterId);``` [L28](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/PaymasterHelpers.sol#L28) \n1. ```return (userOp.paymasterContext(paymasterData), 0);``` [L110](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/verifying/singleton/VerifyingSingletonPaymaster.sol#L110) \n\n**Recommendation:**\n\nChoose named return variable or return statement. It is unnecessary to use both.\n\n### [N-2]: Variable is unused\n**Context:**\n\n1. ```UserOperation calldata op,``` [L25](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/paymasters/PaymasterHelpers.sol#L2", "vulnerable_code": "### [N-4]: Wrong order of functions\n**Context:**\n\n1. ```function validateUserOp(UserOperation calldata userOp, bytes32 userOpHash, address aggregator, uint256 missingAccountFunds)``` [L60](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/BaseSmartAccount.sol#L60) (external function can not go after public function)\n1. ```receive() external payable {``` [L36](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/Proxy.sol#L36) (receive() function must go before fallback() function)\n1. ```function setOwner(address _newOwner) external mixedAuth {``` [L109](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L109) (external function can not go after public function)\n1. ```event SmartAccountCreated(address indexed _proxy, address indexed _implementation, address indexed _owner, string version, uint256 _index);``` [L24](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccountFactory.sol#L24) (event definition can not go after constructor)\n1. ```function supportsInterface(bytes4 interfaceId) external view virtual override returns (bool) {``` [L55](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/handler/DefaultCallbackHandler.sol#L55) (external view function can not go after external pure function)\n1. ```function handleOps(UserOperation[] calldata ops, address payable beneficiary) public {``` [L68](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L68) (public function can not go after private function)\n1. ```function gasPrice(UserOperation calldata userOp) internal view returns (uint256) {``` [L45](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/interf", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/tnevler-Q.md", "collected_at": "2026-01-02T18:14:13.676464+00:00", "source_hash": "ef94915fdf67bdd16e09963b1dc48c36c98cabd2fdbadafad6a252680b52d794", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 12, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SmartAccount.sol#L109, SmartAccount.sol#L120, BasePaymaster.sol#L24, VerifyingSingletonPaymaster.sol#L65, PaymasterHelpers.sol#L28, VerifyingSingletonPaymaster.sol#L110, PaymasterHelpers.sol#L2, BaseSmartAccount.sol#L60, Proxy.sol#L36, SmartAccountFactory.sol#L24, DefaultCallbackHandler.sol#L55, EntryPoint.sol#L68", "github_files_list": "DefaultCallbackHandler.sol, PaymasterHelpers.sol, VerifyingSingletonPaymaster.sol, BasePaymaster.sol, BaseSmartAccount.sol, Proxy.sol, SmartAccountFactory.sol, EntryPoint.sol, SmartAccount.sol", "github_refs_count": 12, "vulnerable_code_actual": "### [N-4]: Wrong order of functions\n**Context:**\n\n1. ```function validateUserOp(UserOperation calldata userOp, bytes32 userOpHash, address aggregator, uint256 missingAccountFunds)``` [L60](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/BaseSmartAccount.sol#L60) (external function can not go after public function)\n1. ```receive() external payable {``` [L36](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/Proxy.sol#L36) (receive() function must go before fallback() function)\n1. ```function setOwner(address _newOwner) external mixedAuth {``` [L109](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L109) (external function can not go after public function)\n1. ```event SmartAccountCreated(address indexed _proxy, address indexed _implementation, address indexed _owner, string version, uint256 _index);``` [L24](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccountFactory.sol#L24) (event definition can not go after constructor)\n1. ```function supportsInterface(bytes4 interfaceId) external view virtual override returns (bool) {``` [L55](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/handler/DefaultCallbackHandler.sol#L55) (external view function can not go after external pure function)\n1. ```function handleOps(UserOperation[] calldata ops, address payable beneficiary) public {``` [L68](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol#L68) (public function can not go after private function)\n1. ```function gasPrice(UserOperation calldata userOp) internal view returns (uint256) {``` [L45](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/interf", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "03-asymmetry", "title": "Matin Q", "severity_raw": "Low", "severity": "low", "description": "### Low-Risk Issues\n| |Issue|Instances|\n|-|:-|:-:|\n| [L‑01] | Derivative contract addresses cannot be modified | 1 |\n| [L‑02] | Wrong function natspec | 1 |\n\n\nTotal: 2 instances over 2 issues\n\n\nNote: The table above was created considering the **automatic findings** and thus, those are not included.\n\n\n\n## Low-Risk Issues\n\n### [L‑01] Derivative contract addresses cannot be modified\nAny wrong, deprecated, or upgraded address of the derivative contract cannot be modified in the future. The function `addDerivative()` just adds and pushes the contract address to the last index and considers its weights in every calculation.\n\n*There is 1 instance of this issue:*\n\n```solidity\n function addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n }\n```\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L182-L195\n\n### [L‑02] Wrong function natspec\nTwo functions `adjustWeight()` and `addDerivative()` has the same natspec comment in the @notice part:\n```solidity\n @notice - Adds new derivative to the index fund\n```\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L158\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L178\n", "vulnerable_code": " function addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n }", "fixed_code": " @notice - Adds new derivative to the index fund", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Matin-Q.md", "collected_at": "2026-01-02T18:18:19.351353+00:00", "source_hash": "efa9bc410ca772b86b7ae904cf74aba4c03c40f1dc9ad47ab6e31fd4219bc3db", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 553, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n }", "primary_code_language": "solidity", "primary_code_char_count": 506, "all_code_blocks": "// Code block 1 (solidity):\nfunction addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n }\n\n// Code block 2 (solidity):\n@notice - Adds new derivative to the index fund", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n }\n\n@notice - Adds new derivative to the index fund", "github_refs_formatted": "SafEth.sol#L182-L195, SafEth.sol#L158, SafEth.sol#L178", "github_files_list": "SafEth.sol", "github_refs_count": 3, "vulnerable_code_actual": " function addDerivative(\n address _contractAddress,\n uint256 _weight\n ) external onlyOwner {\n derivatives[derivativeCount] = IDerivative(_contractAddress);\n weights[derivativeCount] = _weight;\n derivativeCount++;\n\n uint256 localTotalWeight = 0;\n for (uint256 i = 0; i < derivativeCount; i++)\n localTotalWeight += weights[i];\n totalWeight = localTotalWeight;\n emit DerivativeAdded(_contractAddress, _weight, derivativeCount);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " @notice - Adds new derivative to the index fund", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-ondo", "title": "Bauer Q", "severity_raw": "Gas", "severity": "gas", "description": "## 1.No check mint fee is 0\nCashManager.sol\nIf the mintFee is not setted of 0 , the ```collateral.safeTransferFrom(msg.sender, feeRecipient, feesInCollateral);``` will transfer 0 amount to feeRecipient in the requestMint(), this will waste a lot of gas.\n\n```\nfunction requestMint(\n uint256 collateralAmountIn\n )\n external\n override\n updateEpoch\n nonReentrant\n whenNotPaused\n checkKYC(msg.sender)\n {\n if (collateralAmountIn < minimumDepositAmount) {\n revert MintRequestAmountTooSmall();\n }\n\n uint256 feesInCollateral = _getMintFees(collateralAmountIn);\n uint256 depositValueAfterFees = collateralAmountIn - feesInCollateral;\n\n _checkAndUpdateMintLimit(depositValueAfterFees);\n\n collateral.safeTransferFrom(msg.sender, feeRecipient, feesInCollateral);\n collateral.safeTransferFrom(\n msg.sender,\n assetRecipient,\n depositValueAfterFees\n );\n\n mintRequestsPerEpoch[currentEpoch][msg.sender] += depositValueAfterFees;\n\n emit MintRequested(\n msg.sender,\n currentEpoch,\n collateralAmountIn,\n depositValueAfterFees,\n feesInCollateral\n );\n }\n\n```\n## Recommended Mitigation Steps\uff1a\n```\nif (feesInCollateral != 0)\n collateral.safeTransferFrom(msg.sender, feeRecipient, feesInCollateral);\n\n```\n\n\n## 2. whenPaused is useless in function call multiexcall()\nCashManager.sol\nThree functions requestMint(),claimMint(),requestRedemption() have the not pause modifier. There is whenPaused modifier for function call multiexcall(), it means the multiexcall() can be trigger when the status is Paused, however at this point MANAGER_ADMIN stile not able to call function that is modified by not paused.\n\n```\nfunction multiexcall(\n ExCallData[] calldata exCallData\n )\n external\n payable\n override\n nonReentrant\n onlyRole(MANAGER_ADMIN)\n whenPaused\n returns (bytes[] memory results)\n {\n results = new bytes[](exCallData.length);\n for (uint256 i = 0; i < exCallData.length; ++i) {\n ", "vulnerable_code": "function requestMint(\n uint256 collateralAmountIn\n )\n external\n override\n updateEpoch\n nonReentrant\n whenNotPaused\n checkKYC(msg.sender)\n {\n if (collateralAmountIn < minimumDepositAmount) {\n revert MintRequestAmountTooSmall();\n }\n\n uint256 feesInCollateral = _getMintFees(collateralAmountIn);\n uint256 depositValueAfterFees = collateralAmountIn - feesInCollateral;\n\n _checkAndUpdateMintLimit(depositValueAfterFees);\n\n collateral.safeTransferFrom(msg.sender, feeRecipient, feesInCollateral);\n collateral.safeTransferFrom(\n msg.sender,\n assetRecipient,\n depositValueAfterFees\n );\n\n mintRequestsPerEpoch[currentEpoch][msg.sender] += depositValueAfterFees;\n\n emit MintRequested(\n msg.sender,\n currentEpoch,\n collateralAmountIn,\n depositValueAfterFees,\n feesInCollateral\n );\n }\n", "fixed_code": "if (feesInCollateral != 0)\n collateral.safeTransferFrom(msg.sender, feeRecipient, feesInCollateral);\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/Bauer-Q.md", "collected_at": "2026-01-02T18:14:31.523351+00:00", "source_hash": "efe84f47c665a570df8ad036fc3b9727d3e32f27b75e6aef7a531d85f4389b7a", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 977, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function requestMint(\n uint256 collateralAmountIn\n )\n external\n override\n updateEpoch\n nonReentrant\n whenNotPaused\n checkKYC(msg.sender)\n {\n if (collateralAmountIn < minimumDepositAmount) {\n revert MintRequestAmountTooSmall();\n }\n\n uint256 feesInCollateral = _getMintFees(collateralAmountIn);\n uint256 depositValueAfterFees = collateralAmountIn - feesInCollateral;\n\n _checkAndUpdateMintLimit(depositValueAfterFees);\n\n collateral.safeTransferFrom(msg.sender, feeRecipient, feesInCollateral);\n collateral.safeTransferFrom(\n msg.sender,\n assetRecipient,\n depositValueAfterFees\n );\n\n mintRequestsPerEpoch[currentEpoch][msg.sender] += depositValueAfterFees;\n\n emit MintRequested(\n msg.sender,\n currentEpoch,\n collateralAmountIn,\n depositValueAfterFees,\n feesInCollateral\n );\n }", "primary_code_language": "unknown", "primary_code_char_count": 874, "all_code_blocks": "// Code block 1 (unknown):\nfunction requestMint(\n uint256 collateralAmountIn\n )\n external\n override\n updateEpoch\n nonReentrant\n whenNotPaused\n checkKYC(msg.sender)\n {\n if (collateralAmountIn < minimumDepositAmount) {\n revert MintRequestAmountTooSmall();\n }\n\n uint256 feesInCollateral = _getMintFees(collateralAmountIn);\n uint256 depositValueAfterFees = collateralAmountIn - feesInCollateral;\n\n _checkAndUpdateMintLimit(depositValueAfterFees);\n\n collateral.safeTransferFrom(msg.sender, feeRecipient, feesInCollateral);\n collateral.safeTransferFrom(\n msg.sender,\n assetRecipient,\n depositValueAfterFees\n );\n\n mintRequestsPerEpoch[currentEpoch][msg.sender] += depositValueAfterFees;\n\n emit MintRequested(\n msg.sender,\n currentEpoch,\n collateralAmountIn,\n depositValueAfterFees,\n feesInCollateral\n );\n }\n\n// Code block 2 (unknown):\nif (feesInCollateral != 0)\n collateral.safeTransferFrom(msg.sender, feeRecipient, feesInCollateral);", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function requestMint(\n uint256 collateralAmountIn\n )\n external\n override\n updateEpoch\n nonReentrant\n whenNotPaused\n checkKYC(msg.sender)\n {\n if (collateralAmountIn < minimumDepositAmount) {\n revert MintRequestAmountTooSmall();\n }\n\n uint256 feesInCollateral = _getMintFees(collateralAmountIn);\n uint256 depositValueAfterFees = collateralAmountIn - feesInCollateral;\n\n _checkAndUpdateMintLimit(depositValueAfterFees);\n\n collateral.safeTransferFrom(msg.sender, feeRecipient, feesInCollateral);\n collateral.safeTransferFrom(\n msg.sender,\n assetRecipient,\n depositValueAfterFees\n );\n\n mintRequestsPerEpoch[currentEpoch][msg.sender] += depositValueAfterFees;\n\n emit MintRequested(\n msg.sender,\n currentEpoch,\n collateralAmountIn,\n depositValueAfterFees,\n feesInCollateral\n );\n }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "if (feesInCollateral != 0)\n collateral.safeTransferFrom(msg.sender, feeRecipient, feesInCollateral);\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "06-lybra", "title": "0xnev Q", "severity_raw": "Critical", "severity": "critical", "description": "### [Low Risk](#low-risk) \n| Count | Title | \n|:--:|:-------|\n| [L-01]| `liquidation()`: Liquidation allowance check insufficient in `liquidatio()`| \n| [L-02] | `LybraGovernance`: Vote casters cannot change or remove vote | \n| [L-03] | `LybraEUSDVaultBase.superLiquidation()`: Confusing code comments deviates from function logic | \n\n| Total Low Risk Issues | 3 |\n|:--:|:--:|\n\n### [Non-Critical](#non-critical) \n| Count | Title | \n|:--:|:-------|\n| [NC-01] | `rigidRedemption()`: Disallow rigid redemption of 0 value| \n| [NC-02] | Add reentrancy guard to Lybra's version of synthethix contract | \n| [NC-03] | `LybraStETHVault.excessIncomeDistribution()`: Use `_saveReport()` directly |\n| [NC-04] | `LybraStETHVault.excessIncomeDistribution()`: Cache result of `getDutchAuctionDiscountPrice()` |\n| [NC-05] | `liquidation()/superLiquidation`: Add 0 value check to prevent division by 0 in `liquidation` |\n| [NC-06] | Superfluous events |\n\n\n| Total Non-Critical Issues | 6 |\n|:--:|:--:|\n\n## Low Risk\n## [L-01] `liquidation()`: Liquidation allowance check insufficient in `liquidatio()`\n\n## Impact\n```solidity\nrequire(EUSD.allowance(provider, address(this)) > 0, \"provider should authorize to provide liquidation EUSD\");\n```\nLiquidation allowance check in `liquidation()` is insufficient since it only checks that allowance provided to vault contract is more than 0.\n\nProvider should authorize to provide at least eusdAmount to repay on behalf of borrower that is undercollateralized in `liquidation()` similar to `superLiquidation()`. If not, the transaction will still revert.\n\n## Recommendation\nConsider approving token allowance similar to `superLiquidation()`\n```solidity\nrequire(EUSD.allowance(provider, address(this)) >= eusdAmount, \"provider should authorize to provide liquidation EUSD\");\n```\n\n## [L-02] `LybraGovernance`: Vote casters cannot change or remove vote\n\n## Impact\n```solidity\nfunction _countVote(uint256 proposalId, address account, uint8 support, uint256 weight, bytes memory) inte", "vulnerable_code": "require(EUSD.allowance(provider, address(this)) > 0, \"provider should authorize to provide liquidation EUSD\");", "fixed_code": "require(EUSD.allowance(provider, address(this)) >= eusdAmount, \"provider should authorize to provide liquidation EUSD\");", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/0xnev-Q.md", "collected_at": "2026-01-02T18:22:06.466896+00:00", "source_hash": "f0383bc94b4373885bfa57662edbc88288cd67c1990d4d75b23660d7af4ce2c0", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 230, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "require(EUSD.allowance(provider, address(this)) > 0, \"provider should authorize to provide liquidation EUSD\");", "primary_code_language": "solidity", "primary_code_char_count": 110, "all_code_blocks": "// Code block 1 (solidity):\nrequire(EUSD.allowance(provider, address(this)) > 0, \"provider should authorize to provide liquidation EUSD\");\n\n// Code block 2 (solidity):\nrequire(EUSD.allowance(provider, address(this)) >= eusdAmount, \"provider should authorize to provide liquidation EUSD\");", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "require(EUSD.allowance(provider, address(this)) > 0, \"provider should authorize to provide liquidation EUSD\");\n\nrequire(EUSD.allowance(provider, address(this)) >= eusdAmount, \"provider should authorize to provide liquidation EUSD\");", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "require(EUSD.allowance(provider, address(this)) > 0, \"provider should authorize to provide liquidation EUSD\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": "require(EUSD.allowance(provider, address(this)) >= eusdAmount, \"provider should authorize to provide liquidation EUSD\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-asymmetry", "title": "0xkazim G", "severity_raw": "Medium", "severity": "medium", "description": "# Findings Summary\n\n| ID | Title | Severity |\n| ------ | ------------------------------------------------------ | -------- |\n| [G-01] | you can use one event instead of two event to save gas | low |\n\n# [G-01] you can use one event instead of two event to save gas\n\n## Description\n\nthere is no need to use 2 event for StakingPaused/UnstakingPaused and/or Staked/Unstaked, you can use one event for pause/unpause and one event for Stake/Unstake and saving some gas.\n\n## context\n\nThere are 5 instances of the topic.\n\n```solidity\n\nfile: contracts/SafEth/SafEth.sol\n\n //@audit-info use one event for both\n event StakingPaused(bool indexed paused);\n event UnstakingPaused(bool indexed paused);\n //@audit-info use one event for both below !\n event Staked(address indexed recipient, uint ethIn, uint safEthOut);\n event Unstaked(address indexed recipient, uint ethOut, uint safEthIn);\n```\n\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L23-L27\n\n## Recommendations\n\nchange the events above to something like this :\n\n`event stakeState(bool indexed paused)` and same thing to staked/unstaked event can be set this way.\n", "vulnerable_code": "file: contracts/SafEth/SafEth.sol\n\n //@audit-info use one event for both\n event StakingPaused(bool indexed paused);\n event UnstakingPaused(bool indexed paused);\n //@audit-info use one event for both below !\n event Staked(address indexed recipient, uint ethIn, uint safEthOut);\n event Unstaked(address indexed recipient, uint ethOut, uint safEthIn);", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/0xkazim-G.md", "collected_at": "2026-01-02T18:17:43.162189+00:00", "source_hash": "f0a9b6befb651567eb5cab190f8d9c92e9b180b3988f5bf3ae14b573858e535d", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 364, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "file: contracts/SafEth/SafEth.sol\n\n //@audit-info use one event for both\n event StakingPaused(bool indexed paused);\n event UnstakingPaused(bool indexed paused);\n //@audit-info use one event for both below !\n event Staked(address indexed recipient, uint ethIn, uint safEthOut);\n event Unstaked(address indexed recipient, uint ethOut, uint safEthIn);", "primary_code_language": "solidity", "primary_code_char_count": 364, "all_code_blocks": "// Code block 1 (solidity):\nfile: contracts/SafEth/SafEth.sol\n\n //@audit-info use one event for both\n event StakingPaused(bool indexed paused);\n event UnstakingPaused(bool indexed paused);\n //@audit-info use one event for both below !\n event Staked(address indexed recipient, uint ethIn, uint safEthOut);\n event Unstaked(address indexed recipient, uint ethOut, uint safEthIn);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "file: contracts/SafEth/SafEth.sol\n\n //@audit-info use one event for both\n event StakingPaused(bool indexed paused);\n event UnstakingPaused(bool indexed paused);\n //@audit-info use one event for both below !\n event Staked(address indexed recipient, uint ethIn, uint safEthOut);\n event Unstaked(address indexed recipient, uint ethOut, uint safEthIn);", "github_refs_formatted": "SafEth.sol#L23-L27", "github_files_list": "SafEth.sol", "github_refs_count": 1, "vulnerable_code_actual": "file: contracts/SafEth/SafEth.sol\n\n //@audit-info use one event for both\n event StakingPaused(bool indexed paused);\n event UnstakingPaused(bool indexed paused);\n //@audit-info use one event for both below !\n event Staked(address indexed recipient, uint ethIn, uint safEthOut);\n event Unstaked(address indexed recipient, uint ethOut, uint safEthIn);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5.51} {"source": "c4", "protocol": "01-salty", "title": "catwhiskeys Q", "severity_raw": "Medium", "severity": "medium", "description": "# Possible reentrancy attack and cooldown manipulation\nInstances:\nhttps://github.com/code-423n4/2024-01-salty/blob/main/src/staking/StakingRewards.sol#L57-L92\nhttps://github.com/code-423n4/2024-01-salty/blob/main/src/staking/StakingRewards.sol#L97-L140\n\n## PoC\n\nAbsence of reentrancy guards in the functions `_increaseUserShare` and `_decreaseUserShare` \nand possibly faulty cooldown mechanism:\n```\nif ( msg.sender != address(exchangeConfig.dao()) ) // DAO doesn't use the cooldown\n\t{\n@>\trequire( block.timestamp >= user.cooldownExpiration, \"Must wait for the cooldown to expire\" );\n\n\t// Update the cooldown expiration for future transactions\n@>\tuser.cooldownExpiration = block.timestamp + stakingConfig.modificationCooldown();\n\t}\n```\nIf we check interface `IStakingConfig.sol` we see that function `modificationCooldown` doesn't provide much functionality, seems like it's handled manually, by admins. This can lead to man-made risks.\n\nThere is a function below `userCooldowns`, but it seems to have nothing to do with the function above. \nProbably, user cooldown mechanism should be reviewed.\n\nEven though functions `_increaseUserShare` and `_decreaseUserShare` are internal, they handle funds, \nso the reentrancy guards should contribute a lot for the function security. \n\n\n## Impact\nLoss of funds\n\n## Tools:\nVSCode\n\n## Recommeded mitigation steps:\n1. Consider adding reentrancy guards for the functions `_increaseUserShare` and `_decreaseUserShare`.\n2. Consider making strinct comparison , just for case if `stakingConfig.modificationCooldown()` will be equal to 0:\n```\nfunction _increaseUserShare( address wallet, bytes32 poolID, uint256 increaseShareAmount, bool useCooldown ) internal\n\t{\n\trequire( poolsConfig.isWhitelisted( poolID ), \"Invalid pool\" );\n\trequire( increaseShareAmount != 0, \"Cannot increase zero share\" );\n\n\tUserShareInfo storage user = _userShareInfo[wallet][poolID];\n\n\tif ( useCooldown )\n\tif ( msg.sender != address(exchangeConfig.dao()) ) // DAO doesn't use the cooldown\n\t\t{\n", "vulnerable_code": "if ( msg.sender != address(exchangeConfig.dao()) ) // DAO doesn't use the cooldown\n\t{\n@>\trequire( block.timestamp >= user.cooldownExpiration, \"Must wait for the cooldown to expire\" );\n\n\t// Update the cooldown expiration for future transactions\n@>\tuser.cooldownExpiration = block.timestamp + stakingConfig.modificationCooldown();\n\t}", "fixed_code": "function _increaseUserShare( address wallet, bytes32 poolID, uint256 increaseShareAmount, bool useCooldown ) internal\n\t{\n\trequire( poolsConfig.isWhitelisted( poolID ), \"Invalid pool\" );\n\trequire( increaseShareAmount != 0, \"Cannot increase zero share\" );\n\n\tUserShareInfo storage user = _userShareInfo[wallet][poolID];\n\n\tif ( useCooldown )\n\tif ( msg.sender != address(exchangeConfig.dao()) ) // DAO doesn't use the cooldown\n\t\t{\n-\t\trequire( block.timestamp >= user.cooldownExpiration, \"Must wait for the cooldown to expire\" );\n+\t\trequire( block.timestamp > user.cooldownExpiration, \"Must wait for the cooldown to expire\" );", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/catwhiskeys-Q.md", "collected_at": "2026-01-02T19:01:34.975519+00:00", "source_hash": "f0ba13a41df77f2d110f223e6c000b300c1d593dd2ffe822fbaf8a33564e0120", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 331, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "if ( msg.sender != address(exchangeConfig.dao()) ) // DAO doesn't use the cooldown\n\t{\n@>\trequire( block.timestamp >= user.cooldownExpiration, \"Must wait for the cooldown to expire\" );\n\n\t// Update the cooldown expiration for future transactions\n@>\tuser.cooldownExpiration = block.timestamp + stakingConfig.modificationCooldown();\n\t}", "primary_code_language": "unknown", "primary_code_char_count": 331, "all_code_blocks": "// Code block 1 (unknown):\nif ( msg.sender != address(exchangeConfig.dao()) ) // DAO doesn't use the cooldown\n\t{\n@>\trequire( block.timestamp >= user.cooldownExpiration, \"Must wait for the cooldown to expire\" );\n\n\t// Update the cooldown expiration for future transactions\n@>\tuser.cooldownExpiration = block.timestamp + stakingConfig.modificationCooldown();\n\t}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "StakingRewards.sol#L57-L92, StakingRewards.sol#L97-L140", "github_files_list": "StakingRewards.sol", "github_refs_count": 2, "vulnerable_code_actual": "if ( msg.sender != address(exchangeConfig.dao()) ) // DAO doesn't use the cooldown\n\t{\n@>\trequire( block.timestamp >= user.cooldownExpiration, \"Must wait for the cooldown to expire\" );\n\n\t// Update the cooldown expiration for future transactions\n@>\tuser.cooldownExpiration = block.timestamp + stakingConfig.modificationCooldown();\n\t}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function _increaseUserShare( address wallet, bytes32 poolID, uint256 increaseShareAmount, bool useCooldown ) internal\n\t{\n\trequire( poolsConfig.isWhitelisted( poolID ), \"Invalid pool\" );\n\trequire( increaseShareAmount != 0, \"Cannot increase zero share\" );\n\n\tUserShareInfo storage user = _userShareInfo[wallet][poolID];\n\n\tif ( useCooldown )\n\tif ( msg.sender != address(exchangeConfig.dao()) ) // DAO doesn't use the cooldown\n\t\t{\n-\t\trequire( block.timestamp >= user.cooldownExpiration, \"Must wait for the cooldown to expire\" );\n+\t\trequire( block.timestamp > user.cooldownExpiration, \"Must wait for the cooldown to expire\" );", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "04-caviar", "title": "LewisBroadhurst Q", "severity_raw": "Critical", "severity": "critical", "description": "## Non-Critical \n\n### [NC-01]\n\nSimplification of the `try catch` block to make code more readable and the function more gas efficient.\n\n```\n// PrivatePool.sol\nfunction availableForFlashLoan(address token, uint256 tokenId) public view returns (bool) {\n // return if the NFT is owned by this contract\n try ERC721(token).ownerOf(tokenId) returns (address result) {\n return result == address(this);\n } catch {\n return false;\n }\n}\n\n// recommended change\nfunction availableForFlashLoan(address token, uint256 tokenId) public view returns (bool) {\n // return if the NFT is owned by this contract\n address owner = ERC721(token).ownerOf(tokenId);\n return owner == address(this);\n}\n```\n\n### [NC-02]\n\nIf statement can be simplified into a ternary operator. Gas savings from require.\n\n```\n// Factory.sol\nif ((_baseToken == address(0) && msg.value != baseTokenAmount) || (_baseToken != address(0) && msg.value > 0)) {\n revert PrivatePool.InvalidEthAmount();\n}\n\n// recommended change\nif (_baseToken == address(0) ? msg.value != baseTokenAmount : msg.value >= 0) {\n revert PrivatePool.InvalidEthAmount();\n}\n\n// Additional gas savings from merging into require\nrequire((_baseToken == address(0) ? msg.value == baseTokenAmount : msg.value >= 0), PrivatePool.InvalidEthAmount());\n```", "vulnerable_code": "// PrivatePool.sol\nfunction availableForFlashLoan(address token, uint256 tokenId) public view returns (bool) {\n // return if the NFT is owned by this contract\n try ERC721(token).ownerOf(tokenId) returns (address result) {\n return result == address(this);\n } catch {\n return false;\n }\n}\n\n// recommended change\nfunction availableForFlashLoan(address token, uint256 tokenId) public view returns (bool) {\n // return if the NFT is owned by this contract\n address owner = ERC721(token).ownerOf(tokenId);\n return owner == address(this);\n}", "fixed_code": "// Factory.sol\nif ((_baseToken == address(0) && msg.value != baseTokenAmount) || (_baseToken != address(0) && msg.value > 0)) {\n revert PrivatePool.InvalidEthAmount();\n}\n\n// recommended change\nif (_baseToken == address(0) ? msg.value != baseTokenAmount : msg.value >= 0) {\n revert PrivatePool.InvalidEthAmount();\n}\n\n// Additional gas savings from merging into require\nrequire((_baseToken == address(0) ? msg.value == baseTokenAmount : msg.value >= 0), PrivatePool.InvalidEthAmount());", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/LewisBroadhurst-Q.md", "collected_at": "2026-01-02T18:19:49.475771+00:00", "source_hash": "f11d7ff4414c2d067b687d1fc711949a7a261bb614f5a75c451de1a334e4bf7c", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 1056, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "// PrivatePool.sol\nfunction availableForFlashLoan(address token, uint256 tokenId) public view returns (bool) {\n // return if the NFT is owned by this contract\n try ERC721(token).ownerOf(tokenId) returns (address result) {\n return result == address(this);\n } catch {\n return false;\n }\n}\n\n// recommended change\nfunction availableForFlashLoan(address token, uint256 tokenId) public view returns (bool) {\n // return if the NFT is owned by this contract\n address owner = ERC721(token).ownerOf(tokenId);\n return owner == address(this);\n}", "primary_code_language": "unknown", "primary_code_char_count": 566, "all_code_blocks": "// Code block 1 (unknown):\n// PrivatePool.sol\nfunction availableForFlashLoan(address token, uint256 tokenId) public view returns (bool) {\n // return if the NFT is owned by this contract\n try ERC721(token).ownerOf(tokenId) returns (address result) {\n return result == address(this);\n } catch {\n return false;\n }\n}\n\n// recommended change\nfunction availableForFlashLoan(address token, uint256 tokenId) public view returns (bool) {\n // return if the NFT is owned by this contract\n address owner = ERC721(token).ownerOf(tokenId);\n return owner == address(this);\n}\n\n// Code block 2 (unknown):\n// Factory.sol\nif ((_baseToken == address(0) && msg.value != baseTokenAmount) || (_baseToken != address(0) && msg.value > 0)) {\n revert PrivatePool.InvalidEthAmount();\n}\n\n// recommended change\nif (_baseToken == address(0) ? msg.value != baseTokenAmount : msg.value >= 0) {\n revert PrivatePool.InvalidEthAmount();\n}\n\n// Additional gas savings from merging into require\nrequire((_baseToken == address(0) ? msg.value == baseTokenAmount : msg.value >= 0), PrivatePool.InvalidEthAmount());", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "// PrivatePool.sol\nfunction availableForFlashLoan(address token, uint256 tokenId) public view returns (bool) {\n // return if the NFT is owned by this contract\n try ERC721(token).ownerOf(tokenId) returns (address result) {\n return result == address(this);\n } catch {\n return false;\n }\n}\n\n// recommended change\nfunction availableForFlashLoan(address token, uint256 tokenId) public view returns (bool) {\n // return if the NFT is owned by this contract\n address owner = ERC721(token).ownerOf(tokenId);\n return owner == address(this);\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "// Factory.sol\nif ((_baseToken == address(0) && msg.value != baseTokenAmount) || (_baseToken != address(0) && msg.value > 0)) {\n revert PrivatePool.InvalidEthAmount();\n}\n\n// recommended change\nif (_baseToken == address(0) ? msg.value != baseTokenAmount : msg.value >= 0) {\n revert PrivatePool.InvalidEthAmount();\n}\n\n// Additional gas savings from merging into require\nrequire((_baseToken == address(0) ? msg.value == baseTokenAmount : msg.value >= 0), PrivatePool.InvalidEthAmount());", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6.61} {"source": "c4", "protocol": "03-asymmetry", "title": "codeslide G", "severity_raw": "Low", "severity": "low", "description": "### Gas Optimizations List\n\n| Number | Optimization Details | Instances |\n| :----: | :------------------------------------------------- | :-------: |\n| [G-01] | Use scientific notation | 18 |\n| [G-02] | Unnecessary computation | 3 |\n| [G-03] | Mark functions as payable | 17 |\n| [G-04] | Change function visibility from public to external | 2 |\n| [G-05] | Use short circuiting to save gas | 1 |\n| [G-06] | Remove unnecessary variables | 5 |\n\nTotal 6 issues\n\n#### [G-01] Use scientific notation\n\nUse scientific notation like `1e18` rather than `10 ** 18` to avoid an unnecessary arithmetic operation and save gas.\n\n```solidity\nFile: contracts/SafEth/SafEth.sol\n\n54: minAmount = 5 * 10 ** 17; // initializing with .5 ETH as minimum\n\n55: maxAmount = 200 * 10 ** 18; // initializing with 200 ETH as maximum\n\n80: preDepositPrice = 10 ** 18; // initializes with a price of 1\n\n81: else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n\n94: ) * depositAmount) / 10 ** 18;\n\n98: uint256 mintAmount = (totalStakeValueEth * 10 ** 18) / preDepositPrice;\n```\n\n```solidity\nFile: contracts/SafEth/deriviatives/Reth.sol\n\n44: maxSlippage = (1 * 10 ** 16); // 1%\n\n171: uint rethPerEth = (10 ** 36) / poolPrice();\n\n173: uint256 minOut = ((((rethPerEth * msg.value) / 10 ** 18) * ((10 ** 18 - maxSlippage))) / 10 ** 18);\n\n214: RocketTokenRETHInterface(rethAddress()).getEthValue(10 ** 18);\n\n215: else return (poolPrice() * 10 ** 18) / (10 ** 18);\n```\n\n```solidity\nFile: contracts/SafEth/deriviatives/SfrxEth.sol\n\n38: maxSlippage = (1 * 10 ** 16); // 1%\n\n74: uint256 minOut = (((ethPerDerivative(_amount) * _amount) / 10 ** 18) * (10 ** 18 - maxSlippage)) / 10 ** 18;\n\n112: uint256 frxAmount = IsFrxEth(SFRX_ETH_ADDRESS).convertToAssets(10 ** 18);\n\n115: return ((10 *", "vulnerable_code": "File: contracts/SafEth/SafEth.sol\n\n54: minAmount = 5 * 10 ** 17; // initializing with .5 ETH as minimum\n\n55: maxAmount = 200 * 10 ** 18; // initializing with 200 ETH as maximum\n\n80: preDepositPrice = 10 ** 18; // initializes with a price of 1\n\n81: else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n\n94: ) * depositAmount) / 10 ** 18;\n\n98: uint256 mintAmount = (totalStakeValueEth * 10 ** 18) / preDepositPrice;", "fixed_code": "File: contracts/SafEth/deriviatives/Reth.sol\n\n44: maxSlippage = (1 * 10 ** 16); // 1%\n\n171: uint rethPerEth = (10 ** 36) / poolPrice();\n\n173: uint256 minOut = ((((rethPerEth * msg.value) / 10 ** 18) * ((10 ** 18 - maxSlippage))) / 10 ** 18);\n\n214: RocketTokenRETHInterface(rethAddress()).getEthValue(10 ** 18);\n\n215: else return (poolPrice() * 10 ** 18) / (10 ** 18);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/codeslide-G.md", "collected_at": "2026-01-02T18:19:00.715785+00:00", "source_hash": "f141db8af6d789ef8e9c1afa1946aa0ac5aa79efe715719bd7eb87d5b2ff4176", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 828, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/SafEth/SafEth.sol\n\n54: minAmount = 5 * 10 ** 17; // initializing with .5 ETH as minimum\n\n55: maxAmount = 200 * 10 ** 18; // initializing with 200 ETH as maximum\n\n80: preDepositPrice = 10 ** 18; // initializes with a price of 1\n\n81: else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n\n94: ) * depositAmount) / 10 ** 18;\n\n98: uint256 mintAmount = (totalStakeValueEth * 10 ** 18) / preDepositPrice;", "primary_code_language": "solidity", "primary_code_char_count": 445, "all_code_blocks": "// Code block 1 (solidity):\nFile: contracts/SafEth/SafEth.sol\n\n54: minAmount = 5 * 10 ** 17; // initializing with .5 ETH as minimum\n\n55: maxAmount = 200 * 10 ** 18; // initializing with 200 ETH as maximum\n\n80: preDepositPrice = 10 ** 18; // initializes with a price of 1\n\n81: else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n\n94: ) * depositAmount) / 10 ** 18;\n\n98: uint256 mintAmount = (totalStakeValueEth * 10 ** 18) / preDepositPrice;\n\n// Code block 2 (solidity):\nFile: contracts/SafEth/deriviatives/Reth.sol\n\n44: maxSlippage = (1 * 10 ** 16); // 1%\n\n171: uint rethPerEth = (10 ** 36) / poolPrice();\n\n173: uint256 minOut = ((((rethPerEth * msg.value) / 10 ** 18) * ((10 ** 18 - maxSlippage))) / 10 ** 18);\n\n214: RocketTokenRETHInterface(rethAddress()).getEthValue(10 ** 18);\n\n215: else return (poolPrice() * 10 ** 18) / (10 ** 18);", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: contracts/SafEth/SafEth.sol\n\n54: minAmount = 5 * 10 ** 17; // initializing with .5 ETH as minimum\n\n55: maxAmount = 200 * 10 ** 18; // initializing with 200 ETH as maximum\n\n80: preDepositPrice = 10 ** 18; // initializes with a price of 1\n\n81: else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n\n94: ) * depositAmount) / 10 ** 18;\n\n98: uint256 mintAmount = (totalStakeValueEth * 10 ** 18) / preDepositPrice;\n\nFile: contracts/SafEth/deriviatives/Reth.sol\n\n44: maxSlippage = (1 * 10 ** 16); // 1%\n\n171: uint rethPerEth = (10 ** 36) / poolPrice();\n\n173: uint256 minOut = ((((rethPerEth * msg.value) / 10 ** 18) * ((10 ** 18 - maxSlippage))) / 10 ** 18);\n\n214: RocketTokenRETHInterface(rethAddress()).getEthValue(10 ** 18);\n\n215: else return (poolPrice() * 10 ** 18) / (10 ** 18);", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: contracts/SafEth/SafEth.sol\n\n54: minAmount = 5 * 10 ** 17; // initializing with .5 ETH as minimum\n\n55: maxAmount = 200 * 10 ** 18; // initializing with 200 ETH as maximum\n\n80: preDepositPrice = 10 ** 18; // initializes with a price of 1\n\n81: else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n\n94: ) * depositAmount) / 10 ** 18;\n\n98: uint256 mintAmount = (totalStakeValueEth * 10 ** 18) / preDepositPrice;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/SafEth/deriviatives/Reth.sol\n\n44: maxSlippage = (1 * 10 ** 16); // 1%\n\n171: uint rethPerEth = (10 ** 36) / poolPrice();\n\n173: uint256 minOut = ((((rethPerEth * msg.value) / 10 ** 18) * ((10 ** 18 - maxSlippage))) / 10 ** 18);\n\n214: RocketTokenRETHInterface(rethAddress()).getEthValue(10 ** 18);\n\n215: else return (poolPrice() * 10 ** 18) / (10 ** 18);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "04-caviar", "title": "BRONZEDISC Q", "severity_raw": "High", "severity": "high", "description": "## QA\n---\n\n### Layout Order [1]\n\n- The best-practices for layout within a contract is the following order: state variables, events, modifiers, constructor and functions.\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol\n\n```solidity\n// define these state variables before all the events\n82: address public baseToken;\n85: address public nft;\n88: uint56 public changeFee;\n91: uint16 public feeRate;\n94: bool public initialized;\n97: bool public payRoyalties;\n100: bool public useStolenNftOracle;\n104: uint128 public virtualBaseTokenReserves;\n112: uint128 public virtualNftReserves;\n116: bytes32 public merkleRoot;\n119: address public immutable stolenNftOracle;\n122: address payable public immutable factory;\n125: address public immutable royaltyRegistry;\n```\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol\n\n```solidity\n// place this state variable before all the error declarations.\n86: address public immutable royaltyRegistry;\n```\n\n---\n\n### Function Visibility [2]\n\n- Order of Functions: Ordering helps readers identify which functions they can call and to find the constructor and fallback definitions easier. Functions should be grouped according to their visibility and ordered: constructor, receive function (if exists), fallback function (if exists), public, external, internal, private. Within a grouping, place the view and pure functions last.\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol\n\n```solidity\n// receive function should come right after constructor\n134: receive() external payable {}\n\n// external function coming before public ones\n623: function flashLoan(IERC3156FlashBorrower receiver, address token, uint256 tokenId, bytes calldata data)\n```\n\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/EthRouter.sol\n\n```solidity\n// receive function should come after constructor\n88: receive() external payable {}\n```\n\n---\n\n### natSpec missing [3]", "vulnerable_code": "// define these state variables before all the events\n82: address public baseToken;\n85: address public nft;\n88: uint56 public changeFee;\n91: uint16 public feeRate;\n94: bool public initialized;\n97: bool public payRoyalties;\n100: bool public useStolenNftOracle;\n104: uint128 public virtualBaseTokenReserves;\n112: uint128 public virtualNftReserves;\n116: bytes32 public merkleRoot;\n119: address public immutable stolenNftOracle;\n122: address payable public immutable factory;\n125: address public immutable royaltyRegistry;", "fixed_code": "// place this state variable before all the error declarations.\n86: address public immutable royaltyRegistry;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/BRONZEDISC-Q.md", "collected_at": "2026-01-02T18:19:29.830521+00:00", "source_hash": "f144263df3cd720c1fa722e180fa48b35ea4e34eb8d8b05587938509d4c89289", "code_block_count": 4, "solidity_block_count": 4, "total_code_chars": 1008, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "// define these state variables before all the events\n82: address public baseToken;\n85: address public nft;\n88: uint56 public changeFee;\n91: uint16 public feeRate;\n94: bool public initialized;\n97: bool public payRoyalties;\n100: bool public useStolenNftOracle;\n104: uint128 public virtualBaseTokenReserves;\n112: uint128 public virtualNftReserves;\n116: bytes32 public merkleRoot;\n119: address public immutable stolenNftOracle;\n122: address payable public immutable factory;\n125: address public immutable royaltyRegistry;", "primary_code_language": "solidity", "primary_code_char_count": 557, "all_code_blocks": "// Code block 1 (solidity):\n// define these state variables before all the events\n82: address public baseToken;\n85: address public nft;\n88: uint56 public changeFee;\n91: uint16 public feeRate;\n94: bool public initialized;\n97: bool public payRoyalties;\n100: bool public useStolenNftOracle;\n104: uint128 public virtualBaseTokenReserves;\n112: uint128 public virtualNftReserves;\n116: bytes32 public merkleRoot;\n119: address public immutable stolenNftOracle;\n122: address payable public immutable factory;\n125: address public immutable royaltyRegistry;\n\n// Code block 2 (solidity):\n// place this state variable before all the error declarations.\n86: address public immutable royaltyRegistry;\n\n// Code block 3 (solidity):\n// receive function should come right after constructor\n134: receive() external payable {}\n\n// external function coming before public ones\n623: function flashLoan(IERC3156FlashBorrower receiver, address token, uint256 tokenId, bytes calldata data)\n\n// Code block 4 (solidity):\n// receive function should come after constructor\n88: receive() external payable {}", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "// define these state variables before all the events\n82: address public baseToken;\n85: address public nft;\n88: uint56 public changeFee;\n91: uint16 public feeRate;\n94: bool public initialized;\n97: bool public payRoyalties;\n100: bool public useStolenNftOracle;\n104: uint128 public virtualBaseTokenReserves;\n112: uint128 public virtualNftReserves;\n116: bytes32 public merkleRoot;\n119: address public immutable stolenNftOracle;\n122: address payable public immutable factory;\n125: address public immutable royaltyRegistry;\n\n// place this state variable before all the error declarations.\n86: address public immutable royaltyRegistry;\n\n// receive function should come right after constructor\n134: receive() external payable {}\n\n// external function coming before public ones\n623: function flashLoan(IERC3156FlashBorrower receiver, address token, uint256 tokenId, bytes calldata data)\n\n// receive function should come after constructor\n88: receive() external payable {}", "github_refs_formatted": "PrivatePool.sol, EthRouter.sol", "github_files_list": "EthRouter.sol, PrivatePool.sol", "github_refs_count": 2, "vulnerable_code_actual": "// define these state variables before all the events\n82: address public baseToken;\n85: address public nft;\n88: uint56 public changeFee;\n91: uint16 public feeRate;\n94: bool public initialized;\n97: bool public payRoyalties;\n100: bool public useStolenNftOracle;\n104: uint128 public virtualBaseTokenReserves;\n112: uint128 public virtualNftReserves;\n116: bytes32 public merkleRoot;\n119: address public immutable stolenNftOracle;\n122: address payable public immutable factory;\n125: address public immutable royaltyRegistry;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "// place this state variable before all the error declarations.\n86: address public immutable royaltyRegistry;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "02-ethos", "title": "arialblack14 G", "severity_raw": "High", "severity": "high", "description": "# GAS OPTIMIZATION REPORT\n\n### Summary of optimizations\n\n\n| Number | Issue details | Instances |\n| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------: |\n| [G-1](#G1) | `++i/i++` should be `unchecked{++i}`/`unchecked{i++}` when it is not possible for them to overflow, for example when used in `for` and `while` loops | 15 |\n| [G-2](#G2) | Multiple address mappings can be combined into a single mapping of an address to a struct, where appropriate. | 5 |\n| [G-3](#G3) | Using storage instead of memory for structs/arrays saves gas. | 12 |\n| [G-4](#G4) | Usage of`uint`s/`int`s smaller than 32 bytes (256 bits) incurs overhead. | 31 |\n| [G-5](#G5) | `abi.encode()` is less efficient than `abi.encodePacked()` | 2 |\n| [G-6](#G6) | Use`bytes32` instead of string. | 9 |\n| [G-7](#G7) | Internal functions only called once can be inlined to save gas. | 25 |\n| [G-8](#G8) | `>=` costs less gas than `>`. | 39 |\n| [G-9](#G9) | ` += ` costs more gas than ` = + ` for state variables ", "vulnerable_code": "for (uint i = 0; i < length; i++) {\n// do something that doesn't change the value of i\n}", "fixed_code": "for (uint i = 0; i < length; i = unchecked_inc(i)) {\n\t// do something that doesn't change the value of i\n}\n\nfunction unchecked_inc(uint i) returns (uint) {\n\tunchecked {\n\t\treturn i + 1;\n\t}\n}", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/arialblack14-G.md", "collected_at": "2026-01-02T18:16:48.127407+00:00", "source_hash": "f14aae60020b3f2e6b8292f86de62ad1bb57d478c1ae85d1d05d25f535e0fb1c", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "for (uint i = 0; i < length; i++) {\n// do something that doesn't change the value of i\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "for (uint i = 0; i < length; i = unchecked_inc(i)) {\n\t// do something that doesn't change the value of i\n}\n\nfunction unchecked_inc(uint i) returns (uint) {\n\tunchecked {\n\t\treturn i + 1;\n\t}\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-biconomy", "title": "oyc_109 G", "severity_raw": "High", "severity": "high", "description": "## [G-01] Don't Initialize Variables with Default Value\n\nUninitialized variables are assigned with the types default value. Explicitly initializing a variable with it's default value costs unnecesary gas.\n\n```\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::234 => uint256 payment = 0;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::310 => uint256 i = 0;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::468 => for (uint i = 0; i < dest.length;) {\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::234 => uint256 payment = 0;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::305 => uint256 i = 0;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::458 => for (uint i = 0; i < dest.length;) {\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/base/ModuleManager.sol::119 => uint256 moduleCount = 0;\n```\n\n## [G-02] Cache Array Length Outside of Loop\n\nCaching the array length outside a loop saves reading it on each iteration, as long as the array's length is not changed during the loop.\n\n```\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::468 => for (uint i = 0; i < dest.length;) {\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::458 => for (uint i = 0; i < dest.length;) {\n```\n\n## [G-03] Long Revert Strings\n\nShortening revert strings to fit in 32 bytes will decrease gas costs for deployment and gas costs when the revert condition has been met.\n\nIf the contract(s) in scope allow using Solidity >=0.8.4, consider using Custom Errors as they are more gas efficient while allowing developers to describe the error in detail using NatSpec.\n\n```\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::77 => require(msg.sender == owner, \"Smart Account:: Sender is not authorized\"", "vulnerable_code": "2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::234 => uint256 payment = 0;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::310 => uint256 i = 0;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::468 => for (uint i = 0; i < dest.length;) {\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::234 => uint256 payment = 0;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::305 => uint256 i = 0;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::458 => for (uint i = 0; i < dest.length;) {\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/base/ModuleManager.sol::119 => uint256 moduleCount = 0;", "fixed_code": "2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::468 => for (uint i = 0; i < dest.length;) {\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::458 => for (uint i = 0; i < dest.length;) {", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/oyc_109-G.md", "collected_at": "2026-01-02T18:13:58.908344+00:00", "source_hash": "f15ddf121d5b0a182b024309f0b2912e52e799d9b83baa8e0799bff38df9f186", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 1065, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::234 => uint256 payment = 0;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::310 => uint256 i = 0;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::468 => for (uint i = 0; i < dest.length;) {\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::234 => uint256 payment = 0;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::305 => uint256 i = 0;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::458 => for (uint i = 0; i < dest.length;) {\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/base/ModuleManager.sol::119 => uint256 moduleCount = 0;", "primary_code_language": "unknown", "primary_code_char_count": 810, "all_code_blocks": "// Code block 1 (unknown):\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::234 => uint256 payment = 0;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::310 => uint256 i = 0;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::468 => for (uint i = 0; i < dest.length;) {\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::234 => uint256 payment = 0;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::305 => uint256 i = 0;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::458 => for (uint i = 0; i < dest.length;) {\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/base/ModuleManager.sol::119 => uint256 moduleCount = 0;\n\n// Code block 2 (unknown):\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::468 => for (uint i = 0; i < dest.length;) {\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::458 => for (uint i = 0; i < dest.length;) {", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::234 => uint256 payment = 0;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::310 => uint256 i = 0;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::468 => for (uint i = 0; i < dest.length;) {\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::234 => uint256 payment = 0;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::305 => uint256 i = 0;\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::458 => for (uint i = 0; i < dest.length;) {\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/base/ModuleManager.sol::119 => uint256 moduleCount = 0;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol::468 => for (uint i = 0; i < dest.length;) {\n2023-01-biconomy/scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol::458 => for (uint i = 0; i < dest.length;) {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "04-caviar", "title": "Awesome Q", "severity_raw": "High", "severity": "high", "description": "# 1. Unspecific Compiler Version Pragma\n\nIt is generally not recommended to use floating pragmas (i.e. pragmas that do not specify a specific compiler version) in contracts that are not intended to be used as libraries.\n\nThis is because using floating pragmas in application contracts can pose a security risk.\n\nFor example, a known vulnerable compiler version may be selected by mistake, or security tools might revert to an older compiler version that produces a different EVM compilation than the one intended to be deployed on the blockchain.\n\nTo avoid these potential issues, consider specifying a specific compiler version in your pragmas.\n\nSo instead of using a floating pragma like `pragma solidity ^0.8.0;`, it is better to use a concrete compiler version like `pragma solidity 0.8.17;`.\n\nMore information can be found in the following links:\n\n- [Consensys Audit of 1inch](https://consensys.net/diligence/audits/2020/12/1inch-liquidity-protocol/#unspecific-compiler-version-pragma)\n- [Solidity docs](https://docs.soliditylang.org/en/latest/layout-of-source-files.html#version-pragma)\n- [Solidity Specific](https://consensys.github.io/smart-contract-best-practices/development-recommendations/solidity-specific/locking-pragmas/)\n\nAffected lines of code:\n\n- [Factory.sol#L2](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/Factory.sol#L2)\n- [PrivatePoolMetadata.sol#L2](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePoolMetadata.sol#L2)\n- [EthRouter.sol#L2](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L2)\n- [PrivatePool.sol#L2](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L2)\n\n# 2. Follow the function order of the solidity style guide\n\nThe [Solidity style guide](https://docs.soliditylang.org/en/v0.8.17/style-guide.html#order-of-functions) recommends the ", "vulnerable_code": "File: src/EthRouter.sol\nline 169: // exceute the sell against a public pool", "fixed_code": "File: src/PrivatePool.sol\nline 251: // add the royalty fee amount to the net input aount", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/Awesome-Q.md", "collected_at": "2026-01-02T18:19:28.478779+00:00", "source_hash": "f197a4e041c9c7ed244744e64b79ea46f4157959bd8c352247337597e5f19e6c", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Factory.sol#L2, PrivatePoolMetadata.sol#L2, EthRouter.sol#L2, PrivatePool.sol#L2", "github_files_list": "EthRouter.sol, Factory.sol, PrivatePool.sol, PrivatePoolMetadata.sol", "github_refs_count": 4, "vulnerable_code_actual": "File: src/EthRouter.sol\nline 169: // exceute the sell against a public pool", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: src/PrivatePool.sol\nline 251: // add the royalty fee amount to the net input aount", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-salty", "title": "chaduke Q", "severity_raw": "High", "severity": "high", "description": "QA1: functions _increaseUserShares() and _decreaseUserShares() fail to update user.cooldownExpiration when useCooldown = false. As a result, right after _increaseUserShares() is called with useCooldown = false, another call _increaseUserShares() can be possible since user.cooldownExpiration has not been updated in the previous calls.\n\n[https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/staking/StakingRewards.sol#L57-L140](https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/staking/StakingRewards.sol#L57-L140)\n\nMitigation: Regardless of the value of useCooldown, we should always update user.cooldownExpiration as follows:\n\n```javascript\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/staking/StakingRewards.sol#L57-L140\n```\n\nQA2. The _decreaseUserShare() function has a rounding-down precision error for ``virtualRewardsToRemove`` that is in favor of the user instead of the protocol.\n\n[https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/staking/StakingRewards.sol#L118C11-L118C33](https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/staking/StakingRewards.sol#L118C11-L118C33)\n\nAs a result, even when a user redeems all shares, user.virtualRewards still might be positive. Due to the rounding down precision of ``virtualRewardsToRemove``, claiming is in favor instead of the system. \n\nMitigation: the rounding should be in favor of the system. A rounding up should be used as follows: \n\n```javascipt\nuint256 virtualRewardsToRemove = Math.ceilDiv(user.virtualRewards * decreaseShareAmount), user.userShare);\n```\n\nQA3: _sendLiquidityRewards() might not send all ``liquidityRewardsAmount`` to the pools due to rounding down error. This is because when calculating the portion for each pool, there is a rounding down error: \n\n[https://github.com/code-423n4/2024-01-salty/blob/535", "vulnerable_code": "https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/staking/StakingRewards.sol#L57-L140", "fixed_code": "QA3: _sendLiquidityRewards() might not send all ``liquidityRewardsAmount`` to the pools due to rounding down error. This is because when calculating the portion for each pool, there is a rounding down error: \n\n[https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/rewards/SaltRewards.sol#L67-L68](https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/rewards/SaltRewards.sol#L67-L68)\n\nAs a result, when each time performUpKeep() is called, there might be leftover ``liquidityRewardsAmount`` that has not been distributed. \n\nMitigation: send the leftover either to the last pool, or better yet, send it to the staking as follows in the function ``performUpKeep()``: \n", "recommendation": "", "category": "rounding", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/chaduke-Q.md", "collected_at": "2026-01-02T19:01:35.884399+00:00", "source_hash": "f1ad637acea6f96f32923645c45fb827c89937ec5609c3d9df51d736b50ba2e9", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 235, "github_ref_count": 3, "vulnerable_code_is_url": true, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/staking/StakingRewards.sol#L57-L140", "primary_code_language": "javascript", "primary_code_char_count": 129, "all_code_blocks": "// Code block 1 (javascript):\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/staking/StakingRewards.sol#L57-L140\n\n// Code block 2 (javascipt):\nuint256 virtualRewardsToRemove = Math.ceilDiv(user.virtualRewards * decreaseShareAmount), user.userShare);", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "StakingRewards.sol#L57-L140, StakingRewards.sol#L118-L11, SaltRewards.sol#L67-L68", "github_files_list": "StakingRewards.sol, SaltRewards.sol", "github_refs_count": 3, "vulnerable_code_actual": "", "has_vulnerable_code_snippet": false, "fixed_code_actual": "QA3: _sendLiquidityRewards() might not send all ``liquidityRewardsAmount`` to the pools due to rounding down error. This is because when calculating the portion for each pool, there is a rounding down error: \n\n[https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/rewards/SaltRewards.sol#L67-L68](https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/rewards/SaltRewards.sol#L67-L68)\n\nAs a result, when each time performUpKeep() is called, there might be leftover ``liquidityRewardsAmount`` that has not been distributed. \n\nMitigation: send the leftover either to the last pool, or better yet, send it to the staking as follows in the function ``performUpKeep()``: \n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": false, "content_richness_score": 7} {"source": "c4", "protocol": "02-ethos", "title": "Rickard Q", "severity_raw": "Critical", "severity": "critical", "description": "# [L-01] Owner can renounce Ownership\n\n## Vulnerability details\n### Proof of Concept\n[https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/abstract/ReaperBaseStrategyv4.sol#L14-L19](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/abstract/ReaperBaseStrategyv4.sol#L14-L19)\n````solidity\n7 results - 7 files\n/ActivePool.sol\n13: import \"./Dependencies/Ownable.sol\";\n26: contract ActivePool is Ownable, CheckContract, IActivePool {\n\n/BorrowerOperations.sol\n13: import \"./Dependencies/Ownable.sol\";\n18: contract BorrowerOperations is LiquityBase, Ownable, CheckContract, IBorrowerOperations {\n\n/CollateralConfig.sol\n6: import \"./Dependencies/Ownable.sol\";\n15: contract CollateralConfig is ICollateralConfig, CheckContract, Ownable {\n\n/HintHelpers.sol\n9: import \"./Dependencies/Ownable.sol\";\n12: contract HintHelpers is LiquityBase, Ownable, CheckContract {\n\n/StabilityPool.sol\n16: import \"./Dependencies/Ownable.sol\";\n146: contract StabilityPool is LiquityBase, Ownable, CheckContract, IStabilityPool {\n\n/CommunityIssuance.sol\n9: import \"./Dependencies/Ownable.sol\";\n14: contract CommunityIssuance is ICommunityIssuance, Ownable, CheckContract, BaseMath { \n\n/LQTYStaking.sol\n7: import \"./Dependencies/Ownable.sol\";\n18: contract LQTYStaking is ILQTYStaking, Ownable, CheckContract, BaseMath {\n````\nTypically, the contract\u2019s owner is the account that deploys the contract. As a result, the owner is able to perform certain privileged activities. \n\nThe OpenZeppelin\u2019s Ownable used in this project contract implements renounceOwnership. This can represent a certain risk if the ownership is renounced for any other reason than by design. \n\nRenouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner. \n\n`onlyOwner` functions:\n````solidity\n/ActivePool.sol\n71: function setAddresses(\n address _collateralConfigAddress,\n address _borrowerOperationsAddr", "vulnerable_code": "7 results - 7 files\n/ActivePool.sol\n13: import \"./Dependencies/Ownable.sol\";\n26: contract ActivePool is Ownable, CheckContract, IActivePool {\n\n/BorrowerOperations.sol\n13: import \"./Dependencies/Ownable.sol\";\n18: contract BorrowerOperations is LiquityBase, Ownable, CheckContract, IBorrowerOperations {\n\n/CollateralConfig.sol\n6: import \"./Dependencies/Ownable.sol\";\n15: contract CollateralConfig is ICollateralConfig, CheckContract, Ownable {\n\n/HintHelpers.sol\n9: import \"./Dependencies/Ownable.sol\";\n12: contract HintHelpers is LiquityBase, Ownable, CheckContract {\n\n/StabilityPool.sol\n16: import \"./Dependencies/Ownable.sol\";\n146: contract StabilityPool is LiquityBase, Ownable, CheckContract, IStabilityPool {\n\n/CommunityIssuance.sol\n9: import \"./Dependencies/Ownable.sol\";\n14: contract CommunityIssuance is ICommunityIssuance, Ownable, CheckContract, BaseMath { \n\n/LQTYStaking.sol\n7: import \"./Dependencies/Ownable.sol\";\n18: contract LQTYStaking is ILQTYStaking, Ownable, CheckContract, BaseMath {", "fixed_code": "/ActivePool.sol\n71: function setAddresses(\n address _collateralConfigAddress,\n address _borrowerOperationsAddress,\n address _troveManagerAddress,\n address _stabilityPoolAddress,\n address _defaultPoolAddress,\n address _collSurplusPoolAddress,\n address _treasuryAddress,\n address _lqtyStakingAddress,\n address[] calldata _erc4626vaults\n )\n external\n onlyOwner\n {\n125: function setYieldingPercentage(address _collateral, uint256 _bps) external onlyOwner {\n\n132: function setYieldingPercentageDrift(uint256 _driftBps) external onlyOwner {\n\n138: function setYieldClaimThreshold(address _collateral, uint256 _threshold) external onlyOwner {\n\n144: function setYieldDistributionParams(uint256 _treasurySplit, uint256 _SPSplit, uint256 _stakingSplit) external onlyOwner {\n\n214: function manualRebalance(address _collateral, uint256 _simulatedAmountLeavingPool) external onlyOwner {\n\n/BorrowerOperations.sol\n110: function setAddresses(\n address _collateralConfigAddress,\n address _troveManagerAddress,\n address _activePoolAddress,\n address _defaultPoolAddress,\n address _stabilityPoolAddress,\n address _gasPoolAddress,\n address _collSurplusPoolAddress,\n address _priceFeedAddress,\n address _sortedTrovesAddress,\n address _lusdTokenAddress,\n address _lqtyStakingAddress\n )\n external\n override\n onlyOwner\n {\n\n/CollateralConfig.sol\n46: function initialize(\n address[] calldata _collaterals,\n uint256[] calldata _MCRs,\n uint256[] calldata _CCRs\n ) external override onlyOwner {\n\n85: function updateCollateralRatios(\n address _collateral,\n uint256 _MCR,\n uint256 _CCR\n ) external onlyOwner checkCollateral(_collateral) {\n\n/HintHelpers.sol\n27: function setAddresses(\n address _collateralConfigAddress,\n address _sortedTrovesAddress,\n ", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/Rickard-Q.md", "collected_at": "2026-01-02T18:16:34.624312+00:00", "source_hash": "f1d055f49e911126e60c7ebf8b6df781bfcbc493f73dcd54d454c2a155e0dfdf", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 1005, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "7 results - 7 files\n/ActivePool.sol\n13: import \"./Dependencies/Ownable.sol\";\n26: contract ActivePool is Ownable, CheckContract, IActivePool {\n\n/BorrowerOperations.sol\n13: import \"./Dependencies/Ownable.sol\";\n18: contract BorrowerOperations is LiquityBase, Ownable, CheckContract, IBorrowerOperations {\n\n/CollateralConfig.sol\n6: import \"./Dependencies/Ownable.sol\";\n15: contract CollateralConfig is ICollateralConfig, CheckContract, Ownable {\n\n/HintHelpers.sol\n9: import \"./Dependencies/Ownable.sol\";\n12: contract HintHelpers is LiquityBase, Ownable, CheckContract {\n\n/StabilityPool.sol\n16: import \"./Dependencies/Ownable.sol\";\n146: contract StabilityPool is LiquityBase, Ownable, CheckContract, IStabilityPool {\n\n/CommunityIssuance.sol\n9: import \"./Dependencies/Ownable.sol\";\n14: contract CommunityIssuance is ICommunityIssuance, Ownable, CheckContract, BaseMath { \n\n/LQTYStaking.sol\n7: import \"./Dependencies/Ownable.sol\";\n18: contract LQTYStaking is ILQTYStaking, Ownable, CheckContract, BaseMath {", "primary_code_language": "solidity", "primary_code_char_count": 1005, "all_code_blocks": "// Code block 1 (solidity):\n7 results - 7 files\n/ActivePool.sol\n13: import \"./Dependencies/Ownable.sol\";\n26: contract ActivePool is Ownable, CheckContract, IActivePool {\n\n/BorrowerOperations.sol\n13: import \"./Dependencies/Ownable.sol\";\n18: contract BorrowerOperations is LiquityBase, Ownable, CheckContract, IBorrowerOperations {\n\n/CollateralConfig.sol\n6: import \"./Dependencies/Ownable.sol\";\n15: contract CollateralConfig is ICollateralConfig, CheckContract, Ownable {\n\n/HintHelpers.sol\n9: import \"./Dependencies/Ownable.sol\";\n12: contract HintHelpers is LiquityBase, Ownable, CheckContract {\n\n/StabilityPool.sol\n16: import \"./Dependencies/Ownable.sol\";\n146: contract StabilityPool is LiquityBase, Ownable, CheckContract, IStabilityPool {\n\n/CommunityIssuance.sol\n9: import \"./Dependencies/Ownable.sol\";\n14: contract CommunityIssuance is ICommunityIssuance, Ownable, CheckContract, BaseMath { \n\n/LQTYStaking.sol\n7: import \"./Dependencies/Ownable.sol\";\n18: contract LQTYStaking is ILQTYStaking, Ownable, CheckContract, BaseMath {", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "7 results - 7 files\n/ActivePool.sol\n13: import \"./Dependencies/Ownable.sol\";\n26: contract ActivePool is Ownable, CheckContract, IActivePool {\n\n/BorrowerOperations.sol\n13: import \"./Dependencies/Ownable.sol\";\n18: contract BorrowerOperations is LiquityBase, Ownable, CheckContract, IBorrowerOperations {\n\n/CollateralConfig.sol\n6: import \"./Dependencies/Ownable.sol\";\n15: contract CollateralConfig is ICollateralConfig, CheckContract, Ownable {\n\n/HintHelpers.sol\n9: import \"./Dependencies/Ownable.sol\";\n12: contract HintHelpers is LiquityBase, Ownable, CheckContract {\n\n/StabilityPool.sol\n16: import \"./Dependencies/Ownable.sol\";\n146: contract StabilityPool is LiquityBase, Ownable, CheckContract, IStabilityPool {\n\n/CommunityIssuance.sol\n9: import \"./Dependencies/Ownable.sol\";\n14: contract CommunityIssuance is ICommunityIssuance, Ownable, CheckContract, BaseMath { \n\n/LQTYStaking.sol\n7: import \"./Dependencies/Ownable.sol\";\n18: contract LQTYStaking is ILQTYStaking, Ownable, CheckContract, BaseMath {", "github_refs_formatted": "ReaperBaseStrategyv4.sol#L14-L19", "github_files_list": "ReaperBaseStrategyv4.sol", "github_refs_count": 1, "vulnerable_code_actual": "7 results - 7 files\n/ActivePool.sol\n13: import \"./Dependencies/Ownable.sol\";\n26: contract ActivePool is Ownable, CheckContract, IActivePool {\n\n/BorrowerOperations.sol\n13: import \"./Dependencies/Ownable.sol\";\n18: contract BorrowerOperations is LiquityBase, Ownable, CheckContract, IBorrowerOperations {\n\n/CollateralConfig.sol\n6: import \"./Dependencies/Ownable.sol\";\n15: contract CollateralConfig is ICollateralConfig, CheckContract, Ownable {\n\n/HintHelpers.sol\n9: import \"./Dependencies/Ownable.sol\";\n12: contract HintHelpers is LiquityBase, Ownable, CheckContract {\n\n/StabilityPool.sol\n16: import \"./Dependencies/Ownable.sol\";\n146: contract StabilityPool is LiquityBase, Ownable, CheckContract, IStabilityPool {\n\n/CommunityIssuance.sol\n9: import \"./Dependencies/Ownable.sol\";\n14: contract CommunityIssuance is ICommunityIssuance, Ownable, CheckContract, BaseMath { \n\n/LQTYStaking.sol\n7: import \"./Dependencies/Ownable.sol\";\n18: contract LQTYStaking is ILQTYStaking, Ownable, CheckContract, BaseMath {", "has_vulnerable_code_snippet": true, "fixed_code_actual": "/ActivePool.sol\n71: function setAddresses(\n address _collateralConfigAddress,\n address _borrowerOperationsAddress,\n address _troveManagerAddress,\n address _stabilityPoolAddress,\n address _defaultPoolAddress,\n address _collSurplusPoolAddress,\n address _treasuryAddress,\n address _lqtyStakingAddress,\n address[] calldata _erc4626vaults\n )\n external\n onlyOwner\n {\n125: function setYieldingPercentage(address _collateral, uint256 _bps) external onlyOwner {\n\n132: function setYieldingPercentageDrift(uint256 _driftBps) external onlyOwner {\n\n138: function setYieldClaimThreshold(address _collateral, uint256 _threshold) external onlyOwner {\n\n144: function setYieldDistributionParams(uint256 _treasurySplit, uint256 _SPSplit, uint256 _stakingSplit) external onlyOwner {\n\n214: function manualRebalance(address _collateral, uint256 _simulatedAmountLeavingPool) external onlyOwner {\n\n/BorrowerOperations.sol\n110: function setAddresses(\n address _collateralConfigAddress,\n address _troveManagerAddress,\n address _activePoolAddress,\n address _defaultPoolAddress,\n address _stabilityPoolAddress,\n address _gasPoolAddress,\n address _collSurplusPoolAddress,\n address _priceFeedAddress,\n address _sortedTrovesAddress,\n address _lusdTokenAddress,\n address _lqtyStakingAddress\n )\n external\n override\n onlyOwner\n {\n\n/CollateralConfig.sol\n46: function initialize(\n address[] calldata _collaterals,\n uint256[] calldata _MCRs,\n uint256[] calldata _CCRs\n ) external override onlyOwner {\n\n85: function updateCollateralRatios(\n address _collateral,\n uint256 _MCR,\n uint256 _CCR\n ) external onlyOwner checkCollateral(_collateral) {\n\n/HintHelpers.sol\n27: function setAddresses(\n address _collateralConfigAddress,\n address _sortedTrovesAddress,\n ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "05-ajna", "title": "Sathish9098 Q", "severity_raw": "Critical", "severity": "critical", "description": " # LOW FINDINGS\n\nLow-level findings should not be ignored, as they can still pose potential risks or be indicative of vulnerabilities that could be exploited. It is recommended to address and remediate all identified issues, regardless of their severity, to enhance the overall security and reliability of the smart contract\n\n##\n\n| LOW COUNT| ISSUES | INSTANCES|\n|-------|-----|--------|\n| [L-1]| Event are missing sender information | 1 |\n| [L-2]| Prevent division by 0 | 1 |\n| [L-3]| LOW LEVEL CALLS WITH SOLIDITY VERSION 0.8.14 CAN RESULT IN OPTIMISER BUG | 1 |\n| [L-4]| Lack of sanity/threshold/limit checks for uint256 | 1 |\n| [L-5]| Gas griefing/theft is possible on unsafe external call | 1 |\n| [L-6]| Project has NPM Dependency which uses a vulnerable version : @openzeppelin | - |\n| [L-7]| Project Upgrade and Stop Scenario should be | - |\n| [L-8]| Lack of nonReentrant modifiers for critical external functions | 4 |\n| [L-9]| Missing Event for critical updates | 1 |\n| [L-10]| EnumerableSet.UintSet should be avoided | - |\n\n\n# NON CRITICAL FINDINGS\n\n| NC COUNT| ISSUES | INSTANCES|\n|-------|-----|--------|\n| [NC-1]| immutable should be uppercase | 5 |\n| [NC-2]| Use NATSPEC commands for all contracts | - |\n| [NC-3]| For functions,Variables follow Solidity standard naming conventions (internal function,Variable style rule) | 5 |\n| [NC-4]| According to the syntax rules, use => mapping ( instead of => mapping( using spaces as keyword | 17 |\n| [NC-5]| SMT Checker | - |\n| [NC-6]| Assembly Codes Specific \u2013 Should Have Comments | 3 |\n| [NC-7]| Shorthand way to write if / else statement | 2 |\n| [NC-8]| Don't use named return variables its confusing | 14 |\n| [NC-9]| Tokens accidentally sent to the contract cannot be recovered| - |\n| [NC-10]| NatSpec comments should be increased in contracts | - |\n\n##\n\n## [L-1] Event are missing sender information\n\nWhen an action is triggered based on a user's action, not being able to filter based on who triggered the action makes", "vulnerable_code": "FILE: 2023-05-ajna/ajna-grants/src/grants/GrantFund.sol\n\n64: emit FundTreasury(fundingAmount_, treasury);\n", "fixed_code": "emit FundTreasury(msg.sender,fundingAmount_, treasury);\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/Sathish9098-Q.md", "collected_at": "2026-01-02T18:21:12.866446+00:00", "source_hash": "f1f9e95b1504c369834329c08ad0cc4922218888fe2f3085afdbb6c70dd9897e", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "FILE: 2023-05-ajna/ajna-grants/src/grants/GrantFund.sol\n\n64: emit FundTreasury(fundingAmount_, treasury);\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "emit FundTreasury(msg.sender,fundingAmount_, treasury);\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "02-ethos", "title": "Brenzee G", "severity_raw": "Low", "severity": "low", "description": "## No need to specify value if that value is the initial value of the type\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol#L18\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/ActivePool.sol#L32\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LQTY/CommunityIssuance.sol#L21\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LUSDToken.sol#L37\n\n### Explanation\n\nBy default `bool` values in Solidity are `false` . By removing the `= false` gas can be saved.\n\nCollateralConfig.sol:\nDeploy gas before: 871266\nDeploy gas after: 870858\nGas saved: 408\n\nActivePool.sol\nDeploy gas before: 2391096\nDeploy gas after: 2390677\nGas saved: 419\n\nAverage saved gas per smart contract deployement - 410 gas\n\n## Suggestions\n\n```diff\ndiff --git a/contracts/CollateralConfig.sol.orig b/contracts/CollateralConfig.sol\nindex d524f23..6ad85b1 100644\n--- a/contracts/CollateralConfig.sol.orig\n+++ b/contracts/CollateralConfig.sol\n@@ -15,7 +15,7 @@ import \"./Interfaces/ICollateralConfig.sol\";\n contract CollateralConfig is ICollateralConfig, CheckContract, Ownable {\n using SafeERC20 for IERC20;\n\n- bool public initialized = false;\n+ bool public initialized;\n\n // Smallest allowed value for the minimum collateral ratio for individual troves in each market (collateral)\n uint256 constant public MIN_ALLOWED_MCR = 1.1 ether; // 110%\n```\n\n```diff\ndiff --git a/contracts/ActivePool.sol.orig b/contracts/ActivePool.sol\nindex 753fcd0..868a35e 100644\n--- a/contracts/ActivePool.sol.orig\n+++ b/contracts/ActivePool.sol\n@@ -29,7 +29,7 @@ contract ActivePool is Ownable, CheckContract, IActivePool {\n\n string constant public NAME = \"ActivePool\";\n\n- bool public addressesSet = false;\n+ bool public addressesSet;\n address public collateralConfigAddress;\n address public borrowerOperationsAddress;\n address public troveManagerAddress;\n```\n\n```diff\ndiff --git a/contracts/L", "vulnerable_code": "```diff\ndiff --git a/contracts/ActivePool.sol.orig b/contracts/ActivePool.sol\nindex 753fcd0..868a35e 100644\n--- a/contracts/ActivePool.sol.orig\n+++ b/contracts/ActivePool.sol\n@@ -29,7 +29,7 @@ contract ActivePool is Ownable, CheckContract, IActivePool {\n\n string constant public NAME = \"ActivePool\";\n\n- bool public addressesSet = false;\n+ bool public addressesSet;\n address public collateralConfigAddress;\n address public borrowerOperationsAddress;\n address public troveManagerAddress;", "fixed_code": "```diff\ndiff --git a/contracts/LUSDToken.sol.orig b/contracts/LUSDToken.sol\nindex 9c5424d..dd470c4 100644\n--- a/contracts/LUSDToken.sol.orig\n+++ b/contracts/LUSDToken.sol\n@@ -34,7 +34,7 @@ contract LUSDToken is CheckContract, ILUSDToken {\n string constant internal _VERSION = \"1\";\n uint8 constant internal _DECIMALS = 18;\n\n- bool public mintingPaused = false;\n+ bool public mintingPaused;\n\n // --- Data for EIP2612 ---", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/Brenzee-G.md", "collected_at": "2026-01-02T18:16:01.747090+00:00", "source_hash": "f218998c7b3dfaaebe183acfdff23e4e5c60c6b10a2dc85b335fc539d305e149", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 1109, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "diff --git a/contracts/CollateralConfig.sol.orig b/contracts/CollateralConfig.sol\nindex d524f23..6ad85b1 100644\n--- a/contracts/CollateralConfig.sol.orig\n+++ b/contracts/CollateralConfig.sol\n@@ -15,7 +15,7 @@ import \"./Interfaces/ICollateralConfig.sol\";\n contract CollateralConfig is ICollateralConfig, CheckContract, Ownable {\n using SafeERC20 for IERC20;\n\n- bool public initialized = false;\n+ bool public initialized;\n\n // Smallest allowed value for the minimum collateral ratio for individual troves in each market (collateral)\n uint256 constant public MIN_ALLOWED_MCR = 1.1 ether; // 110%", "primary_code_language": "diff", "primary_code_char_count": 610, "all_code_blocks": "// Code block 1 (diff):\ndiff --git a/contracts/CollateralConfig.sol.orig b/contracts/CollateralConfig.sol\nindex d524f23..6ad85b1 100644\n--- a/contracts/CollateralConfig.sol.orig\n+++ b/contracts/CollateralConfig.sol\n@@ -15,7 +15,7 @@ import \"./Interfaces/ICollateralConfig.sol\";\n contract CollateralConfig is ICollateralConfig, CheckContract, Ownable {\n using SafeERC20 for IERC20;\n\n- bool public initialized = false;\n+ bool public initialized;\n\n // Smallest allowed value for the minimum collateral ratio for individual troves in each market (collateral)\n uint256 constant public MIN_ALLOWED_MCR = 1.1 ether; // 110%\n\n// Code block 2 (diff):\ndiff --git a/contracts/ActivePool.sol.orig b/contracts/ActivePool.sol\nindex 753fcd0..868a35e 100644\n--- a/contracts/ActivePool.sol.orig\n+++ b/contracts/ActivePool.sol\n@@ -29,7 +29,7 @@ contract ActivePool is Ownable, CheckContract, IActivePool {\n\n string constant public NAME = \"ActivePool\";\n\n- bool public addressesSet = false;\n+ bool public addressesSet;\n address public collateralConfigAddress;\n address public borrowerOperationsAddress;\n address public troveManagerAddress;", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "diff --git a/contracts/CollateralConfig.sol.orig b/contracts/CollateralConfig.sol\nindex d524f23..6ad85b1 100644\n--- a/contracts/CollateralConfig.sol.orig\n+++ b/contracts/CollateralConfig.sol\n@@ -15,7 +15,7 @@ import \"./Interfaces/ICollateralConfig.sol\";\n contract CollateralConfig is ICollateralConfig, CheckContract, Ownable {\n using SafeERC20 for IERC20;\n\n- bool public initialized = false;\n+ bool public initialized;\n\n // Smallest allowed value for the minimum collateral ratio for individual troves in each market (collateral)\n uint256 constant public MIN_ALLOWED_MCR = 1.1 ether; // 110%\n\ndiff --git a/contracts/ActivePool.sol.orig b/contracts/ActivePool.sol\nindex 753fcd0..868a35e 100644\n--- a/contracts/ActivePool.sol.orig\n+++ b/contracts/ActivePool.sol\n@@ -29,7 +29,7 @@ contract ActivePool is Ownable, CheckContract, IActivePool {\n\n string constant public NAME = \"ActivePool\";\n\n- bool public addressesSet = false;\n+ bool public addressesSet;\n address public collateralConfigAddress;\n address public borrowerOperationsAddress;\n address public troveManagerAddress;", "solidity_code": "", "github_refs_formatted": "CollateralConfig.sol#L18, ActivePool.sol#L32, CommunityIssuance.sol#L21, LUSDToken.sol#L37", "github_files_list": "LUSDToken.sol, CollateralConfig.sol, CommunityIssuance.sol, ActivePool.sol", "github_refs_count": 4, "vulnerable_code_actual": "```diff\ndiff --git a/contracts/ActivePool.sol.orig b/contracts/ActivePool.sol\nindex 753fcd0..868a35e 100644\n--- a/contracts/ActivePool.sol.orig\n+++ b/contracts/ActivePool.sol\n@@ -29,7 +29,7 @@ contract ActivePool is Ownable, CheckContract, IActivePool {\n\n string constant public NAME = \"ActivePool\";\n\n- bool public addressesSet = false;\n+ bool public addressesSet;\n address public collateralConfigAddress;\n address public borrowerOperationsAddress;\n address public troveManagerAddress;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "```diff\ndiff --git a/contracts/LUSDToken.sol.orig b/contracts/LUSDToken.sol\nindex 9c5424d..dd470c4 100644\n--- a/contracts/LUSDToken.sol.orig\n+++ b/contracts/LUSDToken.sol\n@@ -34,7 +34,7 @@ contract LUSDToken is CheckContract, ILUSDToken {\n string constant internal _VERSION = \"1\";\n uint8 constant internal _DECIMALS = 18;\n\n- bool public mintingPaused = false;\n+ bool public mintingPaused;\n\n // --- Data for EIP2612 ---", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "02-ethos", "title": "JCN G", "severity_raw": "Critical", "severity": "critical", "description": "## Summary\nCertian optimizations were benchmarked to use as baselines for issues + illustrate average savings. All benchmarks were done via the protocol's tests, i.e. using the following config: `solc version 0.8.11`, `optimizer on` , `200 runs` for `Ethos-Vault` contracts. Instances are illustrated with diffs.\n\nFunctions that are not covered in the protocol's tests and/or not benchmarked: gas savings are explained via opcodes. Instances are also illustrated with diffs.\n\n**Note**: Some code snippets may be truncated to save space. Code snippets may also be accompanied by `@audit` tags in comments to aid in explaining the issue.\n\n### Gas Optimizations\n| Number |Issue|Instances|Total Gas Saved|\n|-|:-|:-:|:-:|\n| [G-01](#state-variables-can-be-packed-to-use-fewer-storage-slots) | State variables can be packed to use fewer storage slots | 12 | 24000 |\n| [G-02](#structs-can-be-packed-to-use-fewer-storage-slots) | Structs can be packed to use fewer storage slots | 4 | 8000 |\n| [G-03](#avoid-contract-existence-checks-by-using-solidity-version-0810-or-later) | Avoid contract existence checks by using solidity version 0.8.10 or later | 87 | 8700 |\n| [G-04](#multiple-accesses-of-a-mappingarray-should-use-a-storage-pointer) | Multiple accesses of a mapping/array should use a storage pointer | 41 | 1969 |\n| [G-05](#state-variables-can-be-cached-instead-of-re-reading-them-from-storage) | State variables can be cached instead of re-reading them from storage | 34 | 3400 |\n| [G-06](#avoid-emitting-storage-values) | Avoid emitting storage values | 26 | 2600 |\n| [G-07](#refactor-code-to-save-1-sstore-and-2-sloads) | Refactor code to save 1 SSTORE and 2 SLOADs | 1 | 337 |\n| [G-08](#internal-functions-are-cheaper-to-call-compared-to-public-functions) | `Internal` functions are cheaper to call compared to `public` functions | 13 | 286 |\n| [G-09](#x--yx---y-costs-more-gas-than-x--x--yx--x---y-for-state-variables) | `x += y/x -= y` costs more gas than `x = x + y/x = x - y` for state va", "vulnerable_code": "File: Ethos-Vault/contracts/abstract/ReaperBaseStrategyv4.sol\n30: bool public emergencyExit;\n31: uint256 public lastHarvestTimestamp;\n32:\n33: uint256 public upgradeProposalTime;\n34:\n35: /**\n36: * Reaper Roles in increasing order of privilege.\n37: * {KEEPER} - Stricly permissioned trustless access for off-chain programs or third party keepers.\n38: * {STRATEGIST} - Role conferred to authors of the strategy, allows for tweaking non-critical params.\n39: * {GUARDIAN} - Multisig requiring 2 signatures for emergency measures such as pausing and panicking.\n40: * {ADMIN}- Multisig requiring 3 signatures for unpausing.\n41: *\n42: * The DEFAULT_ADMIN_ROLE (in-built access control role) will be granted to a multisig requiring 4\n43: * signatures. This role would have upgrading capability, as well as the ability to grant any other\n44: * roles.\n45: *\n46: * Also note that roles are cascading. So any higher privileged role should be able to perform all the functions\n47: * of any lower privileged role.\n48: */\n49: bytes32 public constant KEEPER = keccak256(\"KEEPER\");\n50: bytes32 public constant STRATEGIST = keccak256(\"STRATEGIST\");\n51: bytes32 public constant GUARDIAN = keccak256(\"GUARDIAN\");\n52: bytes32 public constant ADMIN = keccak256(\"ADMIN\");\n53:\n54: /**\n55: * @dev Reaper contracts:\n56: * {vault} - Address of the vault that controls the strategy's funds.\n57: */\n58: address public vault;", "fixed_code": "https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L44-L57\n\n### We are able to pack `totalAllocBPS` & `emergencyShutdown` and `lastReport`, `withdrawMaxLoss`, & `lockedProfitDegradation` into 2 storage slots to save 3 SLOTs (~6000 gas).\n\n`lastReport` is simply a timestamp and therefore can be packed as a `uint40` value without fear of overflowing. See [reference 1](https://twitter.com/PaulRBerg/status/1591832937179250693) and [reference 2](https://twitter.com/RareSkills_io/status/1632033211609137156). `totalAllocBPS`, `withdrawMaxLoss`, and `lockedProfitDegradation` are asserted to stay within certain bounds. `uint80` is sufficient for `totalAllocBPS`, `withdrawMaxLoss`, and `lockedProfitDegradation` (larger uints could also work). `emergencyShutdown` is bool and therefore only occupies 1 byte.\n\nBelow are instances where `totalAllocBPS` is asserted to be `<= PERCENT_DIVISOR`:\n\n[ReaperVaultV2.sol#L144-L156](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L144-L156)\n\n[ReaperVaultV2.sol#L191-L199](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L191-L199)\n\nBelow are instances where `withdrawMaxLoss` is asserted to be `<= PERCENT_DIVISOR`:\n\n[ReaperVaultV2.sol#L566-L571](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L566-L571)\n\nBelow are instances where `lockedProfitDegradation` is asserted to be `<= DEGRADATION_COEFFICIENT`:\n\n[ReaperVaultV2.sol#L617-L622](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L617-L622)\n\nFunctions which would benefit from these values occupying the same storage slot by incurring a `Gwarmaccess (100 gas)` versus a `Gcoldsload (2100 gas)` for every subsequent storage slot access: [ReaperVaultV2.addStrategy()](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L144-L171), [Reaper", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/JCN-G.md", "collected_at": "2026-01-02T18:16:15.280485+00:00", "source_hash": "f22a5000e598f0e3d5a91dd09ee5704d9b79b5d4c5a501d2dda981c9f7cb611f", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ReaperVaultV2.sol#L44-L57, ReaperVaultV2.sol#L144-L156, ReaperVaultV2.sol#L191-L199, ReaperVaultV2.sol#L566-L571, ReaperVaultV2.sol#L617-L622", "github_files_list": "ReaperVaultV2.sol", "github_refs_count": 5, "vulnerable_code_actual": "File: Ethos-Vault/contracts/abstract/ReaperBaseStrategyv4.sol\n30: bool public emergencyExit;\n31: uint256 public lastHarvestTimestamp;\n32:\n33: uint256 public upgradeProposalTime;\n34:\n35: /**\n36: * Reaper Roles in increasing order of privilege.\n37: * {KEEPER} - Stricly permissioned trustless access for off-chain programs or third party keepers.\n38: * {STRATEGIST} - Role conferred to authors of the strategy, allows for tweaking non-critical params.\n39: * {GUARDIAN} - Multisig requiring 2 signatures for emergency measures such as pausing and panicking.\n40: * {ADMIN}- Multisig requiring 3 signatures for unpausing.\n41: *\n42: * The DEFAULT_ADMIN_ROLE (in-built access control role) will be granted to a multisig requiring 4\n43: * signatures. This role would have upgrading capability, as well as the ability to grant any other\n44: * roles.\n45: *\n46: * Also note that roles are cascading. So any higher privileged role should be able to perform all the functions\n47: * of any lower privileged role.\n48: */\n49: bytes32 public constant KEEPER = keccak256(\"KEEPER\");\n50: bytes32 public constant STRATEGIST = keccak256(\"STRATEGIST\");\n51: bytes32 public constant GUARDIAN = keccak256(\"GUARDIAN\");\n52: bytes32 public constant ADMIN = keccak256(\"ADMIN\");\n53:\n54: /**\n55: * @dev Reaper contracts:\n56: * {vault} - Address of the vault that controls the strategy's funds.\n57: */\n58: address public vault;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L44-L57\n\n### We are able to pack `totalAllocBPS` & `emergencyShutdown` and `lastReport`, `withdrawMaxLoss`, & `lockedProfitDegradation` into 2 storage slots to save 3 SLOTs (~6000 gas).\n\n`lastReport` is simply a timestamp and therefore can be packed as a `uint40` value without fear of overflowing. See [reference 1](https://twitter.com/PaulRBerg/status/1591832937179250693) and [reference 2](https://twitter.com/RareSkills_io/status/1632033211609137156). `totalAllocBPS`, `withdrawMaxLoss`, and `lockedProfitDegradation` are asserted to stay within certain bounds. `uint80` is sufficient for `totalAllocBPS`, `withdrawMaxLoss`, and `lockedProfitDegradation` (larger uints could also work). `emergencyShutdown` is bool and therefore only occupies 1 byte.\n\nBelow are instances where `totalAllocBPS` is asserted to be `<= PERCENT_DIVISOR`:\n\n[ReaperVaultV2.sol#L144-L156](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L144-L156)\n\n[ReaperVaultV2.sol#L191-L199](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L191-L199)\n\nBelow are instances where `withdrawMaxLoss` is asserted to be `<= PERCENT_DIVISOR`:\n\n[ReaperVaultV2.sol#L566-L571](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L566-L571)\n\nBelow are instances where `lockedProfitDegradation` is asserted to be `<= DEGRADATION_COEFFICIENT`:\n\n[ReaperVaultV2.sol#L617-L622](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L617-L622)\n\nFunctions which would benefit from these values occupying the same storage slot by incurring a `Gwarmaccess (100 gas)` versus a `Gcoldsload (2100 gas)` for every subsequent storage slot access: [ReaperVaultV2.addStrategy()](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L144-L171), [Reaper", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "11-kelp", "title": "Daniel526 Q", "severity_raw": "Low", "severity": "low", "description": "## A. Defensive Check Absence Before Deposit in depositAssetIntoStrategy Function\n[Link](https://github.com/code-423n4/2023-11-kelp/blob/c5fdc2e62c5e1d78769f44d6e34a6fb9e40c00f0/src/NodeDelegator.sol#L51-L68)\nThe `depositAssetIntoStrategy` function retrieves the balance of the asset and directly proceeds to deposit into the strategy without checking if the balance is non-zero. Without this check, the function might execute unnecessary deposit operations, potentially leading to unexpected behavior or wasted gas.\n\n```solidity\nfunction depositAssetIntoStrategy(address asset)\n external\n override\n whenNotPaused\n nonReentrant\n onlySupportedAsset(asset)\n onlyLRTManager\n{\n address strategy = lrtConfig.assetStrategy(asset);\n IERC20 token = IERC20(asset);\n address eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);\n\n // No check for a non-zero balance before proceeding\n uint256 balance = token.balanceOf(address(this));\n\n IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);\n\n emit AssetDepositIntoStrategy(asset, strategy, balance);\n}\n```\nThe absence of a check for a non-zero balance before proceeding with the deposit operation might result in unnecessary calls to `depositIntoStrategy`. This is suboptimal both in terms of gas efficiency and the potential for unintended consequences within the strategies.\n## Impact:\nThe impact of this issue is primarily efficiency-related, with unnecessary gas consumption and potential unexpected behavior within the strategies due to redundant deposit calls with a zero balance.\n## Mitigation:\nTo mitigate this issue, it is recommended to include a defensive check before the deposit operation to ensure that the balance is non-zero. This can be achieved by adding the following code snippet:\n\n```solidity\n// Check if the balance is non-zero before proceeding with the deposit\nrequire(balance > 0, \"Zero balance,", "vulnerable_code": "function depositAssetIntoStrategy(address asset)\n external\n override\n whenNotPaused\n nonReentrant\n onlySupportedAsset(asset)\n onlyLRTManager\n{\n address strategy = lrtConfig.assetStrategy(asset);\n IERC20 token = IERC20(asset);\n address eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);\n\n // No check for a non-zero balance before proceeding\n uint256 balance = token.balanceOf(address(this));\n\n IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);\n\n emit AssetDepositIntoStrategy(asset, strategy, balance);\n}", "fixed_code": "// Check if the balance is non-zero before proceeding with the deposit\nrequire(balance > 0, \"Zero balance, nothing to deposit\");", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/Daniel526-Q.md", "collected_at": "2026-01-02T18:27:25.099486+00:00", "source_hash": "f24c3c79c92b3e20f8d16c8b69b81a52738043799a3b534aca63ed34000bd0f5", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 651, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function depositAssetIntoStrategy(address asset)\n external\n override\n whenNotPaused\n nonReentrant\n onlySupportedAsset(asset)\n onlyLRTManager\n{\n address strategy = lrtConfig.assetStrategy(asset);\n IERC20 token = IERC20(asset);\n address eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);\n\n // No check for a non-zero balance before proceeding\n uint256 balance = token.balanceOf(address(this));\n\n IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);\n\n emit AssetDepositIntoStrategy(asset, strategy, balance);\n}", "primary_code_language": "solidity", "primary_code_char_count": 651, "all_code_blocks": "// Code block 1 (solidity):\nfunction depositAssetIntoStrategy(address asset)\n external\n override\n whenNotPaused\n nonReentrant\n onlySupportedAsset(asset)\n onlyLRTManager\n{\n address strategy = lrtConfig.assetStrategy(asset);\n IERC20 token = IERC20(asset);\n address eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);\n\n // No check for a non-zero balance before proceeding\n uint256 balance = token.balanceOf(address(this));\n\n IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);\n\n emit AssetDepositIntoStrategy(asset, strategy, balance);\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function depositAssetIntoStrategy(address asset)\n external\n override\n whenNotPaused\n nonReentrant\n onlySupportedAsset(asset)\n onlyLRTManager\n{\n address strategy = lrtConfig.assetStrategy(asset);\n IERC20 token = IERC20(asset);\n address eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);\n\n // No check for a non-zero balance before proceeding\n uint256 balance = token.balanceOf(address(this));\n\n IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);\n\n emit AssetDepositIntoStrategy(asset, strategy, balance);\n}", "github_refs_formatted": "NodeDelegator.sol#L51-L68", "github_files_list": "NodeDelegator.sol", "github_refs_count": 1, "vulnerable_code_actual": "function depositAssetIntoStrategy(address asset)\n external\n override\n whenNotPaused\n nonReentrant\n onlySupportedAsset(asset)\n onlyLRTManager\n{\n address strategy = lrtConfig.assetStrategy(asset);\n IERC20 token = IERC20(asset);\n address eigenlayerStrategyManagerAddress = lrtConfig.getContract(LRTConstants.EIGEN_STRATEGY_MANAGER);\n\n // No check for a non-zero balance before proceeding\n uint256 balance = token.balanceOf(address(this));\n\n IEigenStrategyManager(eigenlayerStrategyManagerAddress).depositIntoStrategy(IStrategy(strategy), token, balance);\n\n emit AssetDepositIntoStrategy(asset, strategy, balance);\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "// Check if the balance is non-zero before proceeding with the deposit\nrequire(balance > 0, \"Zero balance, nothing to deposit\");", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "09-ondo", "title": "catellatech Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA report for Ondo Finance contest by Catellatech\n\n## [01] assert is used only in tests \nin the rUSDYFactory contract in the line 100 the devs used the assert instead of require or custom errors.\n\ncheck the Solidity docs \u27a1\ufe0f https://docs.soliditylang.org/en/v0.8.19/control-structures.html#panic-via-assert-and-error-via-require\n\n## [02] in rUSDYFactory contract and in so many instances the devs doesn't check the imput \nPlease ckeck all the input addresses in the functions, constructor. \n\n\n## [03] If onlyOwner runs renounceOwnership() the contract become unavailable\nThe `onlyOwner` authority here is very important for some contracts, but the `Ownable.sol library` imported with the import has the renounceOwnership() feature, in case the owner accidentally triggers this function, the remove functions will not work and the contract will block gas due to arrays, may have a continuous structure that exceeds its limit.\n\nThe solution to this is to overide and disable the renounceOwnership() function as implemented in many contracts in his project, it is important to include this code in the contracts.\n\n```solidity\nfunction renounceOwnership() public payable override onlyOwner {\n revert(\"Cannot renounce ownership\");\n}\n```\n\n## [04] In RWADynamicOracle contract utilize Assembly - should have comments\nThe Moonwell team makes use of Assembly on RWADynamicOracle contract, since this is a low level language that is more difficult to parse by readers, include extensive documentation, comments on the rationale behind its use, clearly explaining what each assembly instruction does.\n\nThis will make it easier for users to trust the code, for reviewers to validate the code, and for developers to build on or update the code.\n\nNote that using Assembly removes several important security features of Solidity, which can make the code more insecure and more error-prone.\n\n### Recommendation\nIt is essential to clearly and comprehensively document all activities related to critical function `", "vulnerable_code": "function renounceOwnership() public payable override onlyOwner {\n revert(\"Cannot renounce ownership\");\n}", "fixed_code": "DestinationBridge.sol\n/*//////////////////////////////////////////////////////////////\n Public Functions\n //////////////////////////////////////////////////////////////*/\n\n /**\n * @notice internal function to mint a transaction if it has passed the threshold\n * for the number of approvers\n *\n * @param txnHash The hash of the transaction we wish to mint\n */\n function _mintIfThresholdMet(bytes32 txnHash) internal {..//}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/catellatech-Q.md", "collected_at": "2026-01-02T18:25:51.578469+00:00", "source_hash": "f26977e50eed593ea16b953188ef6a02a914eaa04119efe7cfb37ed568d325a6", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 107, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function renounceOwnership() public payable override onlyOwner {\n revert(\"Cannot renounce ownership\");\n}", "primary_code_language": "solidity", "primary_code_char_count": 107, "all_code_blocks": "// Code block 1 (solidity):\nfunction renounceOwnership() public payable override onlyOwner {\n revert(\"Cannot renounce ownership\");\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function renounceOwnership() public payable override onlyOwner {\n revert(\"Cannot renounce ownership\");\n}", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function renounceOwnership() public payable override onlyOwner {\n revert(\"Cannot renounce ownership\");\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "DestinationBridge.sol\n/*//////////////////////////////////////////////////////////////\n Public Functions\n //////////////////////////////////////////////////////////////*/\n\n /**\n * @notice internal function to mint a transaction if it has passed the threshold\n * for the number of approvers\n *\n * @param txnHash The hash of the transaction we wish to mint\n */\n function _mintIfThresholdMet(bytes32 txnHash) internal {..//}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "09-ondo", "title": "castle_chain Q", "severity_raw": "Medium", "severity": "medium", "description": "# destination bridge \n## 1) `rescueTokens()` function should prevent the withdrawal of USDY tokens . \nthe function `rescueTokens()`should make sure that the token to be withdrawn is not the core token of the bridge , but any tokens that had been sent by mistake , consider add this check : \n```diff\n function rescueTokens(address _token) external onlyOwner {\n+ if(_token == address(TOKEN)) revert();\n uint256 balance = IRWALike(_token).balanceOf(address(this));\n IRWALike(_token).transfer(owner(), balance);\n }\n```\n**code snippet**\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/bridge/DestinationBridge.sol#L322C1-L325C4\n\n## 2) if the numOfApprovals is 0 this will freeze the execute function add prevent receiving the messages . \nin the function `setThresholds()` there is no check if the `numberOfApprovers` is equal to 0 which be able to prevent receiving a messages of this amount . \nconsider add a check to make sure that the number of approvers in greater than zero . \n```diff\n for (uint256 i = 0; i < amounts.length; ++i) {\n+ if (numOfApprovers[i] == 0 ) revert();\n if (i == 0) {\n chainToThresholds[srcChain].push(\n Threshold(amounts[i], numOfApprovers[i])\n );\n } else {\n if (chainToThresholds[srcChain][i - 1].amount > amounts[i]) {\n revert ThresholdsNotInAscendingOrder();\n }\n chainToThresholds[srcChain].push(\n Threshold(amounts[i], numOfApprovers[i])\n );\n }\n }\n```\n**code snippet**\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/bridge/DestinationBridge.sol#L255-L279\n\n## 3) consider adding a function to remove a chain from the mapping `chainToApprovedSender` to allow the owner to deactivate receiving messages from a specific chain .\nthere is only the method to add chain and there is no removing mechanism \n**code snippet**\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34", "vulnerable_code": "**code snippet**\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/bridge/DestinationBridge.sol#L322C1-L325C4\n\n## 2) if the numOfApprovals is 0 this will freeze the execute function add prevent receiving the messages . \nin the function `setThresholds()` there is no check if the `numberOfApprovers` is equal to 0 which be able to prevent receiving a messages of this amount . \nconsider add a check to make sure that the number of approvers in greater than zero . ", "fixed_code": "**code snippet**\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/bridge/DestinationBridge.sol#L255-L279\n\n## 3) consider adding a function to remove a chain from the mapping `chainToApprovedSender` to allow the owner to deactivate receiving messages from a specific chain .\nthere is only the method to add chain and there is no removing mechanism \n**code snippet**\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/bridge/DestinationBridge.sol#L234-L240\n\n\n## 4) add a check to prevent the approvers to approve a deleted transaction and mint to address(zero) . \nthe function `approve()` allow approving a deleted transaction, and if the number reach the threshold the function will mint zero tokens to the zero address , so it is better to prevent this from happen . \nshould make sure that if(txn.sender == address(0)) revert();", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/castle_chain-Q.md", "collected_at": "2026-01-02T18:25:50.681113+00:00", "source_hash": "f26b57b7ec2ea062d49a6efeaac3c1b2b5ffbd4be3d71a14241d53fd30f676e1", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 695, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function rescueTokens(address _token) external onlyOwner {\n+ if(_token == address(TOKEN)) revert();\n uint256 balance = IRWALike(_token).balanceOf(address(this));\n IRWALike(_token).transfer(owner(), balance);\n }", "primary_code_language": "diff", "primary_code_char_count": 219, "all_code_blocks": "// Code block 1 (diff):\nfunction rescueTokens(address _token) external onlyOwner {\n+ if(_token == address(TOKEN)) revert();\n uint256 balance = IRWALike(_token).balanceOf(address(this));\n IRWALike(_token).transfer(owner(), balance);\n }\n\n// Code block 2 (diff):\nfor (uint256 i = 0; i < amounts.length; ++i) {\n+ if (numOfApprovers[i] == 0 ) revert();\n if (i == 0) {\n chainToThresholds[srcChain].push(\n Threshold(amounts[i], numOfApprovers[i])\n );\n } else {\n if (chainToThresholds[srcChain][i - 1].amount > amounts[i]) {\n revert ThresholdsNotInAscendingOrder();\n }\n chainToThresholds[srcChain].push(\n Threshold(amounts[i], numOfApprovers[i])\n );\n }\n }", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "function rescueTokens(address _token) external onlyOwner {\n+ if(_token == address(TOKEN)) revert();\n uint256 balance = IRWALike(_token).balanceOf(address(this));\n IRWALike(_token).transfer(owner(), balance);\n }\n\nfor (uint256 i = 0; i < amounts.length; ++i) {\n+ if (numOfApprovers[i] == 0 ) revert();\n if (i == 0) {\n chainToThresholds[srcChain].push(\n Threshold(amounts[i], numOfApprovers[i])\n );\n } else {\n if (chainToThresholds[srcChain][i - 1].amount > amounts[i]) {\n revert ThresholdsNotInAscendingOrder();\n }\n chainToThresholds[srcChain].push(\n Threshold(amounts[i], numOfApprovers[i])\n );\n }\n }", "solidity_code": "", "github_refs_formatted": "DestinationBridge.sol#L322-L1, DestinationBridge.sol#L255-L279, DestinationBridge.sol#L234-L240", "github_files_list": "DestinationBridge.sol", "github_refs_count": 3, "vulnerable_code_actual": "**code snippet**\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/bridge/DestinationBridge.sol#L322C1-L325C4\n\n## 2) if the numOfApprovals is 0 this will freeze the execute function add prevent receiving the messages . \nin the function `setThresholds()` there is no check if the `numberOfApprovers` is equal to 0 which be able to prevent receiving a messages of this amount . \nconsider add a check to make sure that the number of approvers in greater than zero . ", "has_vulnerable_code_snippet": true, "fixed_code_actual": "**code snippet**\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/bridge/DestinationBridge.sol#L255-L279\n\n## 3) consider adding a function to remove a chain from the mapping `chainToApprovedSender` to allow the owner to deactivate receiving messages from a specific chain .\nthere is only the method to add chain and there is no removing mechanism \n**code snippet**\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/bridge/DestinationBridge.sol#L234-L240\n\n\n## 4) add a check to prevent the approvers to approve a deleted transaction and mint to address(zero) . \nthe function `approve()` allow approving a deleted transaction, and if the number reach the threshold the function will mint zero tokens to the zero address , so it is better to prevent this from happen . \nshould make sure that if(txn.sender == address(0)) revert();", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "06-lybra", "title": "Sathish9098 Q", "severity_raw": "Critical", "severity": "critical", "description": "# LOW FINDINGS\n\n| LOW COUNT | ISSUES | INSTANCES |\n|-----------------|-----------------|-----------------|\n| [L-1] | ``assetAmount * 2 <= depositedAsset[onBehalfOf]`` check is conflict with docs | 1 |\n| [L-2] | Lack of ``check-effects-interactions (CEI) pattern`` is vulnerable to ``reentrancy attacks`` | 3 |\n| [L-3] | User could deposit a small amount of ``ether`` and then ``mint`` a large amount of ``PEUSD``, which could create a security risk | 1 |\n| [L-4] | Use the ``safeAllowance()`` function instead of the normal ``approve()`` function | 1 |\n| [L-5] | Use ``call`` instead of ``transfer`` to send ethers | 3 |\n| [L-6] | ``Timelocks`` not implemented as per documentation | - |\n| [L-7] | ``depositAssetToMint()`` does not check for a maximum limit on asset deposits | 1 |\n| [L-8] | Project Upgrade and Stop Scenario should be | - |\n| [L-9] | Lack of ``nonReentrant`` modifiers for critical external functions | 1 |\n| [L-10] | ``Divide by zero`` should be avoided | 2 |\n| [L-11] | ````name masking`` should be avoided to ``prevent errors`` | 2 |\n| [L-12] | ``Division`` before ``multiplication`` can lead to ``precision errors`` | 2 |\n| [L-13] | ``Hardcoding addresses`` in smart contracts can make them more ``vulnerable to attack``| 1 |\n| [L-14] | ``NATSPEC comments`` should be ``increased`` in contracts| - |\n| [L-15] | ``Negative values`` may return the ``unexpected`` values when using ``uint256(int)``conversion| 1|\n| [L-16] | ``Array`` does not have a ``pop function``| 1 |\n| [L-17] | ``Setters`` should have ``initial value check``| 1 |\n| [L-18] | ``External calls`` in an ``un-bounded`` for-loop may result in a ``DOS``| 2 |\n\n##\n\n## [L-1] ``assetAmount * 2 <= depositedAsset[onBehalfOf]`` check is conflict with docs \n\n``* - collateralAmount should be less than 50% of collateral``\n\n### Impact \nThe comment for the function states that the collateral amount should be ``less than 50%`` of the ``deposited asset``. However, the ``implementation`` of the function actually allow", "vulnerable_code": "FILE: 2023-06-lybra/contracts/lybra/pools/base/LybraEUSDVaultBase.sol\n\n* - collateralAmount should be less than 50% of collateral\n\n159:require(assetAmount * 2 <= depositedAsset[onBehalfOf], \"a max of 50% collateral can be liquidated\");\n", "fixed_code": "FILE: Breadcrumbs2023-06-lybra/contracts/lybra/pools/LybraWbETHVault.sol\n\n23: IWBETH(address(collateralAsset)).deposit{value: msg.value}(address(configurator));\n24: uint256 balance = collateralAsset.balanceOf(address(this));\n25: depositedAsset[msg.sender] += balance - preBalance;\n26:\n27: if (mintAmount > 0) {\n28: _mintPeUSD(msg.sender, msg.sender, mintAmount, getAssetPrice());\n29: }\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/Sathish9098-Q.md", "collected_at": "2026-01-02T18:22:44.476705+00:00", "source_hash": "f28c0243b646502dc9876cd5c90db75a727caf91c8c02eca9d2f4c31a03a605b", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "FILE: 2023-06-lybra/contracts/lybra/pools/base/LybraEUSDVaultBase.sol\n\n* - collateralAmount should be less than 50% of collateral\n\n159:require(assetAmount * 2 <= depositedAsset[onBehalfOf], \"a max of 50% collateral can be liquidated\");\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "FILE: Breadcrumbs2023-06-lybra/contracts/lybra/pools/LybraWbETHVault.sol\n\n23: IWBETH(address(collateralAsset)).deposit{value: msg.value}(address(configurator));\n24: uint256 balance = collateralAsset.balanceOf(address(this));\n25: depositedAsset[msg.sender] += balance - preBalance;\n26:\n27: if (mintAmount > 0) {\n28: _mintPeUSD(msg.sender, msg.sender, mintAmount, getAssetPrice());\n29: }\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "09-ondo", "title": "bowtiedvirus Q", "severity_raw": "Medium", "severity": "medium", "description": "# [L1] Lack of contract existence check on call\n\n**Severity:** Low \n\n**Effected Contract:** SourceBridge.sol, rUSDYFactory.sol\n\n## Summary\nThe rUSDYFactory and SourceBridge have a multiexcall function, which Allows for arbitrary batched calls to arbitrary address. If the target address of a given call is incorrect, has been destroyed, or is otherwise non-callable, the call will still return true. To fix this, there should be a contract existence check before each call.\n\n```solidity\nfunction multiexcall(\n ExCallData[] calldata exCallData\n ) external payable override onlyGuardian returns (bytes[] memory results) {\n results = new bytes[](exCallData.length);\n for (uint256 i = 0; i < exCallData.length; ++i) {\n (bool success, bytes memory ret) = address(exCallData[i].target).call{\n value: exCallData[i].value\n }(exCallData[i].data);\n require(success, \"Call Failed\");\n results[i] = ret;\n }\n}\n```\n\nThe Solidity documentation has the following warning about using `call`:\nThe low-level functions call, delegatecall and staticcall return true as their first return value if the account called is non-existent, as part of the design of the EVM. Account existence must be checked prior to calling if needed.\n\n\n### Exploit Scenario\nBob, the rUSDY Guardian, calls execute with `calldata[0].target == address(a self-destructed or non-contract address)`. Even though the address no longer points to an existing contract, the operation still succeeds.\n\n## Recommendations\n1. Implement a contract existence check before each call in `multiexcall`.\n\n# [L2] Ownership Transfers are a 1-step Process\n\n**Severity:** Low \n\n**Effected Contract:** SourceBridge.sol, rUSDYFactory.sol, DestinationBridge.sol\n\n## Summary\nContracts using OpenZeppelin's Ownable contract only utilize a single-step `transferOwnership` step.\nConsider using Ownable2Step to prevent accidentally locking the owner out.\n\n\n## Vulnerability Details\nBob, the Owner of SourceBridge, calls `transferOwners", "vulnerable_code": "function multiexcall(\n ExCallData[] calldata exCallData\n ) external payable override onlyGuardian returns (bytes[] memory results) {\n results = new bytes[](exCallData.length);\n for (uint256 i = 0; i < exCallData.length; ++i) {\n (bool success, bytes memory ret) = address(exCallData[i].target).call{\n value: exCallData[i].value\n }(exCallData[i].data);\n require(success, \"Call Failed\");\n results[i] = ret;\n }\n}", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/bowtiedvirus-Q.md", "collected_at": "2026-01-02T18:25:48.901321+00:00", "source_hash": "f3106d39ef8ae559289f0bf83b032f9f78dd20457df1a5bed5955791c6d2859b", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 448, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function multiexcall(\n ExCallData[] calldata exCallData\n ) external payable override onlyGuardian returns (bytes[] memory results) {\n results = new bytes[](exCallData.length);\n for (uint256 i = 0; i < exCallData.length; ++i) {\n (bool success, bytes memory ret) = address(exCallData[i].target).call{\n value: exCallData[i].value\n }(exCallData[i].data);\n require(success, \"Call Failed\");\n results[i] = ret;\n }\n}", "primary_code_language": "solidity", "primary_code_char_count": 448, "all_code_blocks": "// Code block 1 (solidity):\nfunction multiexcall(\n ExCallData[] calldata exCallData\n ) external payable override onlyGuardian returns (bytes[] memory results) {\n results = new bytes[](exCallData.length);\n for (uint256 i = 0; i < exCallData.length; ++i) {\n (bool success, bytes memory ret) = address(exCallData[i].target).call{\n value: exCallData[i].value\n }(exCallData[i].data);\n require(success, \"Call Failed\");\n results[i] = ret;\n }\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function multiexcall(\n ExCallData[] calldata exCallData\n ) external payable override onlyGuardian returns (bytes[] memory results) {\n results = new bytes[](exCallData.length);\n for (uint256 i = 0; i < exCallData.length; ++i) {\n (bool success, bytes memory ret) = address(exCallData[i].target).call{\n value: exCallData[i].value\n }(exCallData[i].data);\n require(success, \"Call Failed\");\n results[i] = ret;\n }\n}", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function multiexcall(\n ExCallData[] calldata exCallData\n ) external payable override onlyGuardian returns (bytes[] memory results) {\n results = new bytes[](exCallData.length);\n for (uint256 i = 0; i < exCallData.length; ++i) {\n (bool success, bytes memory ret) = address(exCallData[i].target).call{\n value: exCallData[i].value\n }(exCallData[i].data);\n require(success, \"Call Failed\");\n results[i] = ret;\n }\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "03-asymmetry", "title": "Polaris_tow G", "severity_raw": "Low", "severity": "low", "description": "## CAN MAKE THE VARIABLE OUTSIDE THE LOOP TO SAVE GAS\nMake it outside and only use it inside.\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L113-L119\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L84-L96\n```\n for (uint i = 0; i < derivativeCount; i++) {\n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight == 0) continue;\n uint256 ethAmount = (msg.value * weight) / totalWeight;\n\n\n // This is slightly less than ethAmount because slippage\n uint256 depositAmount = derivative.deposit{value: ethAmount}();\n uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n depositAmount\n ) * depositAmount) / 10 ** 18;\n totalStakeValueEth += derivativeReceivedEthValue;\n }\n```\n## SETTING THE CONSTRUCTOR TO PAYABLE \nSaves ~13 gas per instance \nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L38\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/Reth.sol#L33\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/SfrxEth.sol#L27\nhttps://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/WstEth.sol#L24\n## FUNCTIONS GUARANTEED TO REVERT WHEN CALLED BY NORMAL USERS CAN BE MARKED PAYABLE\nIf a function modifier or require such as onlyOwner/onlyX is used, the function will revert if a normal user tries to pay the function. Marking the function as payable will lower the gas cost for legitimate callers because the compiler wi", "vulnerable_code": " for (uint i = 0; i < derivativeCount; i++) {\n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight == 0) continue;\n uint256 ethAmount = (msg.value * weight) / totalWeight;\n\n\n // This is slightly less than ethAmount because slippage\n uint256 depositAmount = derivative.deposit{value: ethAmount}();\n uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n depositAmount\n ) * depositAmount) / 10 ** 18;\n totalStakeValueEth += derivativeReceivedEthValue;\n }", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/Polaris_tow-G.md", "collected_at": "2026-01-02T18:18:25.186233+00:00", "source_hash": "f32410029fb2e1aebbfb2bfd009ed1322ac8951e73058ec96ac19255fded02d1", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 613, "github_ref_count": 6, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "for (uint i = 0; i < derivativeCount; i++) {\n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight == 0) continue;\n uint256 ethAmount = (msg.value * weight) / totalWeight;\n\n\n // This is slightly less than ethAmount because slippage\n uint256 depositAmount = derivative.deposit{value: ethAmount}();\n uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n depositAmount\n ) * depositAmount) / 10 ** 18;\n totalStakeValueEth += derivativeReceivedEthValue;\n }", "primary_code_language": "unknown", "primary_code_char_count": 613, "all_code_blocks": "// Code block 1 (unknown):\nfor (uint i = 0; i < derivativeCount; i++) {\n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight == 0) continue;\n uint256 ethAmount = (msg.value * weight) / totalWeight;\n\n\n // This is slightly less than ethAmount because slippage\n uint256 depositAmount = derivative.deposit{value: ethAmount}();\n uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n depositAmount\n ) * depositAmount) / 10 ** 18;\n totalStakeValueEth += derivativeReceivedEthValue;\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SafEth.sol#L113-L119, SafEth.sol#L84-L96, SafEth.sol#L38, Reth.sol#L33, SfrxEth.sol#L27, WstEth.sol#L24", "github_files_list": "SfrxEth.sol, Reth.sol, WstEth.sol, SafEth.sol", "github_refs_count": 6, "vulnerable_code_actual": " for (uint i = 0; i < derivativeCount; i++) {\n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight == 0) continue;\n uint256 ethAmount = (msg.value * weight) / totalWeight;\n\n\n // This is slightly less than ethAmount because slippage\n uint256 depositAmount = derivative.deposit{value: ethAmount}();\n uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n depositAmount\n ) * depositAmount) / 10 ** 18;\n totalStakeValueEth += derivativeReceivedEthValue;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "09-ondo", "title": "twicek Q", "severity_raw": "Low", "severity": "low", "description": "# [L-01] For all block.timestamp > range.end the price will be stale\n\n## Proof of Concept\nThe README mentions the following regarding the `getPrice` function used in the calculation of the price of a rUSDY from the USDY amount:\n> There is also functionality within the contract that if a range has elapsed and there is no subsequent range set, the oracle will return the maximum price of the previous range for all `block.timestamp > Range.end`\n\nThis functionality will lead to a stale price if the condition is met.\n\nExample:\n\nInitial state\n1.0 USDY = 1.1 USD; 1.0 USDY = 1.1 rUSDY\n\nPossible state if `block.timestamp > Range.end`\n1.0 USDY = 1.2 USD; 1.0 USDY = 1.1 rUSDY\n-> The value of rUSDY will not be pegged at 1:1 with USD anymore.\n\n## Impact\nThe impact is low because the rUSDY is a read only projection of the USDY amount deposited in the contract (more precisely the shares), therefore even if the rUSDY balance for a given USDY amount is frozen, the same amount of USDY will always be unwrapped. What matters is that the same amount of share is redeemable against the same amount of USDY tokens.\nThe only issue is that the peg is not always guaranteed, which is the purpose of the contract.\n\n# [L-02] CEI pattern is not followed in transferFrom\n\n## Proof of Concept\nThe CEI pattern is not followed in the following function. The allowance is updated after transferring the tokens.\n\n[rUSDY.sol#L301-L312](https://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/usdy/rUSDY.sol#L301-L312)\n```\nfunction transferFrom(\n address _sender,\n address _recipient,\n uint256 _amount\n ) public returns (bool) {\n uint256 currentAllowance = allowances[_sender][msg.sender];\n require(currentAllowance >= _amount, \"TRANSFER_AMOUNT_EXCEEDS_ALLOWANCE\");\n\n\n _transfer(_sender, _recipient, _amount);\n _approve(_sender, msg.sender, currentAllowance - _amount);\n return true;\n }\n```\n\n## Impact\nIn this specific case it has no impact because `_t", "vulnerable_code": "function transferFrom(\n address _sender,\n address _recipient,\n uint256 _amount\n ) public returns (bool) {\n uint256 currentAllowance = allowances[_sender][msg.sender];\n require(currentAllowance >= _amount, \"TRANSFER_AMOUNT_EXCEEDS_ALLOWANCE\");\n\n\n _transfer(_sender, _recipient, _amount);\n _approve(_sender, msg.sender, currentAllowance - _amount);\n return true;\n }", "fixed_code": "function unwrap(uint256 _rUSDYAmount) external whenNotPaused {\n require(_rUSDYAmount > 0, \"rUSDY: can't unwrap zero rUSDY tokens\");\n uint256 usdyAmount = getSharesByRUSDY(_rUSDYAmount);\n if (usdyAmount < BPS_DENOMINATOR) revert UnwrapTooSmall();\n _burnShares(msg.sender, usdyAmount);\n usdy.transfer(msg.sender, usdyAmount / BPS_DENOMINATOR);\n emit TokensBurnt(msg.sender, _rUSDYAmount);\n }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/twicek-Q.md", "collected_at": "2026-01-02T18:26:20.255143+00:00", "source_hash": "f38322e9c782860459c814fefd1dbbb4d6069f15fcbfdab0dae12e056f287a59", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 389, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function transferFrom(\n address _sender,\n address _recipient,\n uint256 _amount\n ) public returns (bool) {\n uint256 currentAllowance = allowances[_sender][msg.sender];\n require(currentAllowance >= _amount, \"TRANSFER_AMOUNT_EXCEEDS_ALLOWANCE\");\n\n\n _transfer(_sender, _recipient, _amount);\n _approve(_sender, msg.sender, currentAllowance - _amount);\n return true;\n }", "primary_code_language": "unknown", "primary_code_char_count": 389, "all_code_blocks": "// Code block 1 (unknown):\nfunction transferFrom(\n address _sender,\n address _recipient,\n uint256 _amount\n ) public returns (bool) {\n uint256 currentAllowance = allowances[_sender][msg.sender];\n require(currentAllowance >= _amount, \"TRANSFER_AMOUNT_EXCEEDS_ALLOWANCE\");\n\n\n _transfer(_sender, _recipient, _amount);\n _approve(_sender, msg.sender, currentAllowance - _amount);\n return true;\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "rUSDY.sol#L301-L312", "github_files_list": "rUSDY.sol", "github_refs_count": 1, "vulnerable_code_actual": "function transferFrom(\n address _sender,\n address _recipient,\n uint256 _amount\n ) public returns (bool) {\n uint256 currentAllowance = allowances[_sender][msg.sender];\n require(currentAllowance >= _amount, \"TRANSFER_AMOUNT_EXCEEDS_ALLOWANCE\");\n\n\n _transfer(_sender, _recipient, _amount);\n _approve(_sender, msg.sender, currentAllowance - _amount);\n return true;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function unwrap(uint256 _rUSDYAmount) external whenNotPaused {\n require(_rUSDYAmount > 0, \"rUSDY: can't unwrap zero rUSDY tokens\");\n uint256 usdyAmount = getSharesByRUSDY(_rUSDYAmount);\n if (usdyAmount < BPS_DENOMINATOR) revert UnwrapTooSmall();\n _burnShares(msg.sender, usdyAmount);\n usdy.transfer(msg.sender, usdyAmount / BPS_DENOMINATOR);\n emit TokensBurnt(msg.sender, _rUSDYAmount);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "09-ondo", "title": "0x11singh99 Q", "severity_raw": "Critical", "severity": "critical", "description": "# Low-Level and Non-Critical issues\n\n## Summary\n\n### Low Level List\n\n| Number | Issue Details | Instances |\n| :----: | :----------------------------------------------------------------------------------------------------------------- | :-------: |\n| [L-01] | Address should be checked for 0 address before transferring to it. | 1 |\n\n\n### Non Critical List\n\n| Number | Issue Details | Instances |\n| :-----: | :------------------------------------------------------------------ | :-------: |\n| [NC-01] | Some Contracts are not following proper solidity style guide layout | 17 |\n\n\n\n# LOW FINDINGS\n\n## [L-01] Address should be checked for 0 address before transferring to it.\n\nCheck address is not zero before transferring to it. some tokens may not revert when tranferring to zero address.\n\n**_1 Instance - 1 File_**\n\n```solidity\nFile : contracts/usdy/rUSDY.sol\n\n301: function transferFrom(\n address _sender,\n address _recipient,\n uint256 _amount\n ) public returns (bool) {\n uint256 currentAllowance = allowances[_sender][msg.sender];\n require(currentAllowance >= _amount, \"TRANSFER_AMOUNT_EXCEEDS_ALLOWANCE\");\n\n _transfer(_sender, _recipient, _amount);///@audit check\n _approve(_sender, msg.sender, currentAllowance - _amount);\n return true;\n312: }\n\n```\n[301-312](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDY.sol#L301C1-L312C4)\n\n# NON-CRITICAL FINDINGS\n\n## [NC-01] Some Contracts are not following proper solidity style guide layout\n\n/ Layout of Contract: According to solidity Docs\n// version\n// imports\n// errors\n// interfaces, libraries, contracts\n// Type declarations\n// State variables\n// Events\n// Modifiers\n// Functions\n\n// Layout of Functions:\n// constructor\n// receive function (if exists)\n// fallba", "vulnerable_code": "File : contracts/usdy/rUSDY.sol\n\n301: function transferFrom(\n address _sender,\n address _recipient,\n uint256 _amount\n ) public returns (bool) {\n uint256 currentAllowance = allowances[_sender][msg.sender];\n require(currentAllowance >= _amount, \"TRANSFER_AMOUNT_EXCEEDS_ALLOWANCE\");\n\n _transfer(_sender, _recipient, _amount);///@audit check\n _approve(_sender, msg.sender, currentAllowance - _amount);\n return true;\n312: }\n", "fixed_code": "File : contracts/bridge/DestinationBridge.sol\n\n///@audit error should be declared in starting of contract\n439: error NotApprover();\n error NoThresholdMatch();\n error ThresholdsNotInAscendingOrder();\n error ChainNotSupported();\n error SourceNotSupported();\n error NonceSpent();\n error AlreadyApproved();\n error InvalidVersion();\n448: error ArrayLengthMismatch();", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/0x11singh99-Q.md", "collected_at": "2026-01-02T18:25:11.683120+00:00", "source_hash": "f39560a9fb82ca7a8546452a204b2dc0cf8cf31ff40d738bec06d4d70fa7e6e0", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 447, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File : contracts/usdy/rUSDY.sol\n\n301: function transferFrom(\n address _sender,\n address _recipient,\n uint256 _amount\n ) public returns (bool) {\n uint256 currentAllowance = allowances[_sender][msg.sender];\n require(currentAllowance >= _amount, \"TRANSFER_AMOUNT_EXCEEDS_ALLOWANCE\");\n\n _transfer(_sender, _recipient, _amount);///@audit check\n _approve(_sender, msg.sender, currentAllowance - _amount);\n return true;\n312: }", "primary_code_language": "solidity", "primary_code_char_count": 447, "all_code_blocks": "// Code block 1 (solidity):\nFile : contracts/usdy/rUSDY.sol\n\n301: function transferFrom(\n address _sender,\n address _recipient,\n uint256 _amount\n ) public returns (bool) {\n uint256 currentAllowance = allowances[_sender][msg.sender];\n require(currentAllowance >= _amount, \"TRANSFER_AMOUNT_EXCEEDS_ALLOWANCE\");\n\n _transfer(_sender, _recipient, _amount);///@audit check\n _approve(_sender, msg.sender, currentAllowance - _amount);\n return true;\n312: }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File : contracts/usdy/rUSDY.sol\n\n301: function transferFrom(\n address _sender,\n address _recipient,\n uint256 _amount\n ) public returns (bool) {\n uint256 currentAllowance = allowances[_sender][msg.sender];\n require(currentAllowance >= _amount, \"TRANSFER_AMOUNT_EXCEEDS_ALLOWANCE\");\n\n _transfer(_sender, _recipient, _amount);///@audit check\n _approve(_sender, msg.sender, currentAllowance - _amount);\n return true;\n312: }", "github_refs_formatted": "rUSDY.sol#L301-L1", "github_files_list": "rUSDY.sol", "github_refs_count": 1, "vulnerable_code_actual": "File : contracts/usdy/rUSDY.sol\n\n301: function transferFrom(\n address _sender,\n address _recipient,\n uint256 _amount\n ) public returns (bool) {\n uint256 currentAllowance = allowances[_sender][msg.sender];\n require(currentAllowance >= _amount, \"TRANSFER_AMOUNT_EXCEEDS_ALLOWANCE\");\n\n _transfer(_sender, _recipient, _amount);///@audit check\n _approve(_sender, msg.sender, currentAllowance - _amount);\n return true;\n312: }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File : contracts/bridge/DestinationBridge.sol\n\n///@audit error should be declared in starting of contract\n439: error NotApprover();\n error NoThresholdMatch();\n error ThresholdsNotInAscendingOrder();\n error ChainNotSupported();\n error SourceNotSupported();\n error NonceSpent();\n error AlreadyApproved();\n error InvalidVersion();\n448: error ArrayLengthMismatch();", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-biconomy", "title": "Breeje G", "severity_raw": "High", "severity": "high", "description": "## Gas Optimizations\n\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [GAS-1](#GAS-1) | ++I/I++ SHOULD BE UNCHECKED{++I}/UNCHECKED{I++} WHEN IT IS NOT POSSIBLE FOR THEM TO OVERFLOW | 7 |\n| [GAS-2](#GAS-2) | X += Y COSTS MORE GAS THAN X = X + Y FOR STATE VARIABLES | 28 |\n| [GAS-3](#GAS-3) | SPLITTING REQUIRE() STATEMENTS THAT USE && SAVES GAS | 3 |\n| [GAS-4](#GAS-4) | NOT USING THE NAMED RETURN VARIABLES WHEN A FUNCTION RETURNS, WASTES DEPLOYMENT GAS | 4 |\n\n### [GAS-1] ++I/I++ SHOULD BE UNCHECKED{++I}/UNCHECKED{I++} WHEN IT IS NOT POSSIBLE FOR THEM TO OVERFLOW\n\nThe unchecked keyword is new in solidity version 0.8.0, so this only applies to that version or higher, which these instances are. This saves 30-40 gas per loop.\n\n*Instances (7)*:\n```solidity\nFile: aa-4337/core/EntryPoint.sol\n\n100: for (uint256 i = 0; i < opasLen; i++) {\n\n107: for (uint256 a = 0; a < opasLen; a++) {\n\n112: for (uint256 i = 0; i < opslen; i++) {\n\n114: opIndex++;\n\n128: for (uint256 a = 0; a < opasLen; a++) {\n\n134: for (uint256 i = 0; i < opslen; i++) {\n\n136: opIndex++;\n\n```\n[Link to code](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol)\n\n### [GAS-2] X += Y COSTS MORE GAS THAN X = X + Y FOR STATE VARIABLES\n\n*Instances (28)*:\n```solidity\nFile: aa-4337/core/EntryPoint.sol\n\n81: collected += _executeUserOp(i, ops[i], opInfos[i]);\n\n101: totalOps += opsPerAggregator[i].userOps.length;\n\n135: collected += _executeUserOp(opIndex, ops[i], opInfos[opIndex]);\n\n468: actualGas += preGas - gasleft();\n\n```\n[Link to code](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol)\n\n```solidity\nFile: libs/Math.sol\n\n148: result += 1;\n\n210: result += 128;\n\n214: result += 64;\n\n218: result += 32;\n\n222: result += 16;\n\n226: result += 8;\n\n230: result += 4;\n\n234: result += 2;\n\n237", "vulnerable_code": "File: aa-4337/core/EntryPoint.sol\n\n100: for (uint256 i = 0; i < opasLen; i++) {\n\n107: for (uint256 a = 0; a < opasLen; a++) {\n\n112: for (uint256 i = 0; i < opslen; i++) {\n\n114: opIndex++;\n\n128: for (uint256 a = 0; a < opasLen; a++) {\n\n134: for (uint256 i = 0; i < opslen; i++) {\n\n136: opIndex++;\n", "fixed_code": "File: aa-4337/core/EntryPoint.sol\n\n81: collected += _executeUserOp(i, ops[i], opInfos[i]);\n\n101: totalOps += opsPerAggregator[i].userOps.length;\n\n135: collected += _executeUserOp(opIndex, ops[i], opInfos[opIndex]);\n\n468: actualGas += preGas - gasleft();\n", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/Breeje-G.md", "collected_at": "2026-01-02T18:12:59.481229+00:00", "source_hash": "f3e0e04150c5360785231d3a8aa28d471773ad1135647f294417efb2363ca8db", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 604, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: aa-4337/core/EntryPoint.sol\n\n100: for (uint256 i = 0; i < opasLen; i++) {\n\n107: for (uint256 a = 0; a < opasLen; a++) {\n\n112: for (uint256 i = 0; i < opslen; i++) {\n\n114: opIndex++;\n\n128: for (uint256 a = 0; a < opasLen; a++) {\n\n134: for (uint256 i = 0; i < opslen; i++) {\n\n136: opIndex++;", "primary_code_language": "solidity", "primary_code_char_count": 330, "all_code_blocks": "// Code block 1 (solidity):\nFile: aa-4337/core/EntryPoint.sol\n\n100: for (uint256 i = 0; i < opasLen; i++) {\n\n107: for (uint256 a = 0; a < opasLen; a++) {\n\n112: for (uint256 i = 0; i < opslen; i++) {\n\n114: opIndex++;\n\n128: for (uint256 a = 0; a < opasLen; a++) {\n\n134: for (uint256 i = 0; i < opslen; i++) {\n\n136: opIndex++;\n\n// Code block 2 (solidity):\nFile: aa-4337/core/EntryPoint.sol\n\n81: collected += _executeUserOp(i, ops[i], opInfos[i]);\n\n101: totalOps += opsPerAggregator[i].userOps.length;\n\n135: collected += _executeUserOp(opIndex, ops[i], opInfos[opIndex]);\n\n468: actualGas += preGas - gasleft();", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: aa-4337/core/EntryPoint.sol\n\n100: for (uint256 i = 0; i < opasLen; i++) {\n\n107: for (uint256 a = 0; a < opasLen; a++) {\n\n112: for (uint256 i = 0; i < opslen; i++) {\n\n114: opIndex++;\n\n128: for (uint256 a = 0; a < opasLen; a++) {\n\n134: for (uint256 i = 0; i < opslen; i++) {\n\n136: opIndex++;\n\nFile: aa-4337/core/EntryPoint.sol\n\n81: collected += _executeUserOp(i, ops[i], opInfos[i]);\n\n101: totalOps += opsPerAggregator[i].userOps.length;\n\n135: collected += _executeUserOp(opIndex, ops[i], opInfos[opIndex]);\n\n468: actualGas += preGas - gasleft();", "github_refs_formatted": "EntryPoint.sol", "github_files_list": "EntryPoint.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: aa-4337/core/EntryPoint.sol\n\n100: for (uint256 i = 0; i < opasLen; i++) {\n\n107: for (uint256 a = 0; a < opasLen; a++) {\n\n112: for (uint256 i = 0; i < opslen; i++) {\n\n114: opIndex++;\n\n128: for (uint256 a = 0; a < opasLen; a++) {\n\n134: for (uint256 i = 0; i < opslen; i++) {\n\n136: opIndex++;\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: aa-4337/core/EntryPoint.sol\n\n81: collected += _executeUserOp(i, ops[i], opInfos[i]);\n\n101: totalOps += opsPerAggregator[i].userOps.length;\n\n135: collected += _executeUserOp(opIndex, ops[i], opInfos[opIndex]);\n\n468: actualGas += preGas - gasleft();\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "06-lybra", "title": "MohammedRizwan G", "severity_raw": "Medium", "severity": "medium", "description": "## Summary\n\n### Gas Optimizations\n| |Issue|Instances| |\n|-|:-|:-:|:-:|\n| [G‑01] | Save gas by preventing zero amount in mint() and burn() | 2 |\n| [G‑02] | Catch function parameters as local variables to save gas | 1 |\n| [G‑03] | Use nested-if and avoid \"&&\" to save gas | 2 |\n| [G‑04] | Catch proposalId in LybraGovernance.sol within function | 3 |\n\n### [G‑01] Save gas by preventing zero amount in mint() and burn()\nIn esLBR.sol, L-30 to L-43.\nThere are 2 instances of this issue:\n[Link to code](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/token/esLBR.sol#L30-L43)\n\n### Recommended Mitigation steps\n```Solidity\nFile: contracts/lybra/token/esLBR.sol\n\n function mint(address user, uint256 amount) external returns (bool) {\n+ require(amount != 0, \"invalid amount);\n require(configurator.tokenMiner(msg.sender), \"not authorized\");\n require(totalSupply() + amount <= maxSupply, \"exceeding the maximum supply quantity.\");\n try IProtocolRewardsPool(configurator.getProtocolRewardsPool()).refreshReward(user) {} catch {}\n _mint(user, amount);\n return true;\n }\n\n function burn(address user, uint256 amount) external returns (bool) {\n+ require(amount != 0, \"invalid amount);\n require(configurator.tokenMiner(msg.sender), \"not authorized\");\n try IProtocolRewardsPool(configurator.getProtocolRewardsPool()).refreshReward(user) {} catch {}\n _burn(user, amount);\n return true;\n }\n```\n\n### [G‑02] Catch function parameters as local variables to save gas\nCaching of a state variable replaces each Gwarmaccess (100 gas) with a much cheaper stack read. \n\nIn esLBRBoost.sol, L-57 to L-69\nThere is 1 instance of this issue:\n[Link to code](https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/esLBRBoost.sol#L57-L69)\n\n### Recommended Mitigation steps\n```Solidity\nFile:", "vulnerable_code": "File: contracts/lybra/token/esLBR.sol\n\n function mint(address user, uint256 amount) external returns (bool) {\n+ require(amount != 0, \"invalid amount);\n require(configurator.tokenMiner(msg.sender), \"not authorized\");\n require(totalSupply() + amount <= maxSupply, \"exceeding the maximum supply quantity.\");\n try IProtocolRewardsPool(configurator.getProtocolRewardsPool()).refreshReward(user) {} catch {}\n _mint(user, amount);\n return true;\n }\n\n function burn(address user, uint256 amount) external returns (bool) {\n+ require(amount != 0, \"invalid amount);\n require(configurator.tokenMiner(msg.sender), \"not authorized\");\n try IProtocolRewardsPool(configurator.getProtocolRewardsPool()).refreshReward(user) {} catch {}\n _burn(user, amount);\n return true;\n }", "fixed_code": "File: contracts/lybra/miner/esLBRBoost.sol\n\n function getUserBoost(address user, uint256 userUpdatedAt, uint256 finishAt) external view returns (uint256) {\n+ address _user = user;\n+ uint256 _userUpdatedAt = userUpdatedAt;\n+ uint256 _finishAt = finishAt;\n- uint256 boostEndTime = userLockStatus[user].unlockTime;\n+ uint256 boostEndTime = userLockStatus[_user].unlockTime;\n- uint256 maxBoost = userLockStatus[user].miningBoost;\n+ uint256 maxBoost = userLockStatus[_user].miningBoost;\n\n- if (userUpdatedAt >= boostEndTime || userUpdatedAt >= finishAt) {\n+ if (_userUpdatedAt >= boostEndTime || _userUpdatedAt >= _finishAt) {\n return 0;\n }\n- if (finishAt <= boostEndTime || block.timestamp <= boostEndTime) {\n+ if (_finishAt <= boostEndTime || block.timestamp <= boostEndTime) {\n return maxBoost;\n } else {\n- uint256 time = block.timestamp > finishAt ? finishAt : block.timestamp;\n+ uint256 time = block.timestamp > _finishAt ? _finishAt : block.timestamp;\n- return ((boostEndTime - userUpdatedAt) * maxBoost) / (time - userUpdatedAt);\n+ return ((boostEndTime - _userUpdatedAt) * maxBoost) / (time - _userUpdatedAt);\n }\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/MohammedRizwan-G.md", "collected_at": "2026-01-02T18:22:28.139660+00:00", "source_hash": "f3e83f15e42282087ac03e4dee9f5ffc66278511155408ad48bf0f316136911b", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 841, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/lybra/token/esLBR.sol\n\n function mint(address user, uint256 amount) external returns (bool) {\n+ require(amount != 0, \"invalid amount);\n require(configurator.tokenMiner(msg.sender), \"not authorized\");\n require(totalSupply() + amount <= maxSupply, \"exceeding the maximum supply quantity.\");\n try IProtocolRewardsPool(configurator.getProtocolRewardsPool()).refreshReward(user) {} catch {}\n _mint(user, amount);\n return true;\n }\n\n function burn(address user, uint256 amount) external returns (bool) {\n+ require(amount != 0, \"invalid amount);\n require(configurator.tokenMiner(msg.sender), \"not authorized\");\n try IProtocolRewardsPool(configurator.getProtocolRewardsPool()).refreshReward(user) {} catch {}\n _burn(user, amount);\n return true;\n }", "primary_code_language": "Solidity", "primary_code_char_count": 841, "all_code_blocks": "// Code block 1 (Solidity):\nFile: contracts/lybra/token/esLBR.sol\n\n function mint(address user, uint256 amount) external returns (bool) {\n+ require(amount != 0, \"invalid amount);\n require(configurator.tokenMiner(msg.sender), \"not authorized\");\n require(totalSupply() + amount <= maxSupply, \"exceeding the maximum supply quantity.\");\n try IProtocolRewardsPool(configurator.getProtocolRewardsPool()).refreshReward(user) {} catch {}\n _mint(user, amount);\n return true;\n }\n\n function burn(address user, uint256 amount) external returns (bool) {\n+ require(amount != 0, \"invalid amount);\n require(configurator.tokenMiner(msg.sender), \"not authorized\");\n try IProtocolRewardsPool(configurator.getProtocolRewardsPool()).refreshReward(user) {} catch {}\n _burn(user, amount);\n return true;\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: contracts/lybra/token/esLBR.sol\n\n function mint(address user, uint256 amount) external returns (bool) {\n+ require(amount != 0, \"invalid amount);\n require(configurator.tokenMiner(msg.sender), \"not authorized\");\n require(totalSupply() + amount <= maxSupply, \"exceeding the maximum supply quantity.\");\n try IProtocolRewardsPool(configurator.getProtocolRewardsPool()).refreshReward(user) {} catch {}\n _mint(user, amount);\n return true;\n }\n\n function burn(address user, uint256 amount) external returns (bool) {\n+ require(amount != 0, \"invalid amount);\n require(configurator.tokenMiner(msg.sender), \"not authorized\");\n try IProtocolRewardsPool(configurator.getProtocolRewardsPool()).refreshReward(user) {} catch {}\n _burn(user, amount);\n return true;\n }", "github_refs_formatted": "esLBR.sol#L30-L43, esLBRBoost.sol#L57-L69", "github_files_list": "esLBRBoost.sol, esLBR.sol", "github_refs_count": 2, "vulnerable_code_actual": "File: contracts/lybra/token/esLBR.sol\n\n function mint(address user, uint256 amount) external returns (bool) {\n+ require(amount != 0, \"invalid amount);\n require(configurator.tokenMiner(msg.sender), \"not authorized\");\n require(totalSupply() + amount <= maxSupply, \"exceeding the maximum supply quantity.\");\n try IProtocolRewardsPool(configurator.getProtocolRewardsPool()).refreshReward(user) {} catch {}\n _mint(user, amount);\n return true;\n }\n\n function burn(address user, uint256 amount) external returns (bool) {\n+ require(amount != 0, \"invalid amount);\n require(configurator.tokenMiner(msg.sender), \"not authorized\");\n try IProtocolRewardsPool(configurator.getProtocolRewardsPool()).refreshReward(user) {} catch {}\n _burn(user, amount);\n return true;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/lybra/miner/esLBRBoost.sol\n\n function getUserBoost(address user, uint256 userUpdatedAt, uint256 finishAt) external view returns (uint256) {\n+ address _user = user;\n+ uint256 _userUpdatedAt = userUpdatedAt;\n+ uint256 _finishAt = finishAt;\n- uint256 boostEndTime = userLockStatus[user].unlockTime;\n+ uint256 boostEndTime = userLockStatus[_user].unlockTime;\n- uint256 maxBoost = userLockStatus[user].miningBoost;\n+ uint256 maxBoost = userLockStatus[_user].miningBoost;\n\n- if (userUpdatedAt >= boostEndTime || userUpdatedAt >= finishAt) {\n+ if (_userUpdatedAt >= boostEndTime || _userUpdatedAt >= _finishAt) {\n return 0;\n }\n- if (finishAt <= boostEndTime || block.timestamp <= boostEndTime) {\n+ if (_finishAt <= boostEndTime || block.timestamp <= boostEndTime) {\n return maxBoost;\n } else {\n- uint256 time = block.timestamp > finishAt ? finishAt : block.timestamp;\n+ uint256 time = block.timestamp > _finishAt ? _finishAt : block.timestamp;\n- return ((boostEndTime - userUpdatedAt) * maxBoost) / (time - userUpdatedAt);\n+ return ((boostEndTime - _userUpdatedAt) * maxBoost) / (time - _userUpdatedAt);\n }\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ethos", "title": "SuperRayss Q", "severity_raw": "Unknown", "severity": "unknown", "description": "# Issues Found\n## [Ethos-Core\\contracts\\LQTY\\CommunityIssuance.sol](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LQTY/CommunityIssuance.sol)\nThere is a loss of precision in calculating `rewardPerSecond`. This is due to `rewardPerSecond` being assigned the result of the lossy division of `distributionPeriod` from `amount` (line 112). This loss in precision results in a growing deviation between expected and actual issuance of $Oath tokens to the stability pool.\n## [Ethos-Core\\test\\LQTYIssuanceArithmeticTest.js](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/test/LQTYIssuanceArithmeticTest.js)\n[The test case on line 170](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/test/LQTYIssuanceArithmeticTest.js#L170) passes when it shouldn\u2019t due to improper usage of arithmetic operators and type conversion on BigNumber variables, resulting in the test case comparing the integers 4 and 3 ([line 181](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/test/LQTYIssuanceArithmeticTest.js#L170)) rather than their intended values. When corrected, this test case does not pass with the current implementation of [`fund()` in CommunityIssuance.sol](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/LQTY/CommunityIssuance.sol#L101) due to loss of precision with calculating `rewardPerSecond`. The corrected test case fails with `AssertionError: expected 2255118 [Wei] to be at most 1000 [Wei]`.\n\nThe corrected test case:\n```\n it(\"aggregates multiple funding rounds within a distribution period\", async () => {\n await setupFunder(accounts[0], oathToken, communityIssuanceTester, million);\n await communityIssuanceTester.fund(thousand);\n await th.fastForwardTime(604800, web3.currentProvider); // 7 days pass\n await communityIssuanceTester.unprotectedIssueLQTY(); // Issue Oath\n ", "vulnerable_code": " it(\"aggregates multiple funding rounds within a distribution period\", async () => {\n await setupFunder(accounts[0], oathToken, communityIssuanceTester, million);\n await communityIssuanceTester.fund(thousand);\n await th.fastForwardTime(604800, web3.currentProvider); // 7 days pass\n await communityIssuanceTester.unprotectedIssueLQTY(); // Issue Oath\n await communityIssuanceTester.fund(thousand);\n await th.fastForwardTime(604800, web3.currentProvider);\n await communityIssuanceTester.unprotectedIssueLQTY();\n await communityIssuanceTester.fund(thousand);\n await th.fastForwardTime(1209600, web3.currentProvider); // 14 days pass\n await communityIssuanceTester.unprotectedIssueLQTY();\n const final = await communityIssuanceTester.totalOATHIssued(); // Get total issued Oath\n th.assertIsApproximatelyEqual(final, thousand.mul(th.toBN(3)), 1000);\n })", "fixed_code": " function getRewardPerSecond() public view returns (uint) {\n return rewardPerSecond.div(DECIMAL_PRECISION);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/SuperRayss-Q.md", "collected_at": "2026-01-02T18:16:39.618801+00:00", "source_hash": "f414d2aa0509c299a7e158681b6adea57fb4f703c8148294fd0f88c8ac43fb23", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CommunityIssuance.sol, CommunityIssuance.sol#L101", "github_files_list": "CommunityIssuance.sol", "github_refs_count": 2, "vulnerable_code_actual": " it(\"aggregates multiple funding rounds within a distribution period\", async () => {\n await setupFunder(accounts[0], oathToken, communityIssuanceTester, million);\n await communityIssuanceTester.fund(thousand);\n await th.fastForwardTime(604800, web3.currentProvider); // 7 days pass\n await communityIssuanceTester.unprotectedIssueLQTY(); // Issue Oath\n await communityIssuanceTester.fund(thousand);\n await th.fastForwardTime(604800, web3.currentProvider);\n await communityIssuanceTester.unprotectedIssueLQTY();\n await communityIssuanceTester.fund(thousand);\n await th.fastForwardTime(1209600, web3.currentProvider); // 14 days pass\n await communityIssuanceTester.unprotectedIssueLQTY();\n const final = await communityIssuanceTester.totalOATHIssued(); // Get total issued Oath\n th.assertIsApproximatelyEqual(final, thousand.mul(th.toBN(3)), 1000);\n })", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function getRewardPerSecond() public view returns (uint) {\n return rewardPerSecond.div(DECIMAL_PRECISION);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "03-asymmetry", "title": "0xSmartContract Q", "severity_raw": "Critical", "severity": "critical", "description": "In terms of Quality Assurance;\n\nStrengths of the Project;\n-- The code has a structure written in a modern way, within the framework of generally accepted Soliditiy principles.\n-- Details such as the fact that the `initialize()` function is declared externally, it has quality and short NatSpec comments, and there are almost no typos, show us the importance given to the code.\n\nDevelopment Areas of the Project;\n-- The project uses the standard one-step owner model. 2-step ownership transfer is used in the most important projects in the new period, so 2-step ownership should be transferred [L-01]\n-- The use of 'emit' in general terms, specifying new and old values in emit parameters is missing, there is a development area here, also sending 'emit' after ether transmission should be re-evaluated in terms of security, [L-03] [L-08]\n-- `OnlyOwner` strength is not looked after as it is out of scope, but this is the weakest context of the project, here if timelock - multisign architectures are used together it will be the most robust structure and will increase trust in the project\n-- How is the proxy architecture of the project, which pattern is used, how to upgrade parts are missing, adding these strengthens the control and security structure [N-26]\n\n\n## Summary\n### Low Risk Issues List\n| Number |Issues Details|Context|\n|:--:|:-------|:--:|\n|[L-01]|Use `Ownable2StepUpgradeable` instead of ` OwnableUpgradeable ` contract| 4 |\n|[L-02]|There may be a problem when changing the `maxSlippage` value because there is no range | 3 |\n|[L-03]|Should declare to `emit` before the send ether in codebase for re-entrancy pattern | 1 |\n|[L-04]|Omissions in Events|3 |\n|[L-05]|Avoid using hardcode address in codebase| 11 |\n|[L-06]|Lack of control to assign 0 values in the value assignments of critical state variables in the initialize| 3 |\n|[L-07]|Use the latest updated version of OpenZeppelin dependencies| 1 |\n|[L-08]|Add parameter to Event-Emit for critical function| 3 |\n|[L-09]|Insufficie", "vulnerable_code": "4 results\n\ncontracts/SafEth/SafEth.sol:\n 9: import \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\n 15: contract SafEth is Initializable, ERC20Upgradeable, OwnableUpgradeable, SafEthStorage\n\ncontracts/SafEth/derivatives/Reth.sol:\n 13: import \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\n 19: contract Reth is IDerivative, Initializable, OwnableUpgradeable {\n\ncontracts/SafEth/derivatives/SfrxEth.sol:\n 6: import \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\n 13: contract SfrxEth is IDerivative, Initializable, OwnableUpgradeable {\n\ncontracts/SafEth/derivatives/WstEth.sol:\n 5: import \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\n 12: contract WstEth is IDerivative, Initializable, OwnableUpgradeable {\n", "fixed_code": "3 results - 3 files\n\ncontracts/SafEth/derivatives/Reth.sol:\n 57 */\n 58: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n 59: maxSlippage = _slippage;\n 60: }\n 61 \n\ncontracts/SafEth/derivatives/SfrxEth.sol:\n 50 */\n 51: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n 52: maxSlippage = _slippage;\n 53: }\n 54 \n\ncontracts/SafEth/derivatives/WstEth.sol:\n 47 */\n 48: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n 49: maxSlippage = _slippage;\n 50: }\n\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/0xSmartContract-Q.md", "collected_at": "2026-01-02T18:17:36.872399+00:00", "source_hash": "f48038e17c3d76b31cbe74f2888203c9f94f87c8c3829ccd7da9c3a4e9d4db50", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "4 results\n\ncontracts/SafEth/SafEth.sol:\n 9: import \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\n 15: contract SafEth is Initializable, ERC20Upgradeable, OwnableUpgradeable, SafEthStorage\n\ncontracts/SafEth/derivatives/Reth.sol:\n 13: import \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\n 19: contract Reth is IDerivative, Initializable, OwnableUpgradeable {\n\ncontracts/SafEth/derivatives/SfrxEth.sol:\n 6: import \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\n 13: contract SfrxEth is IDerivative, Initializable, OwnableUpgradeable {\n\ncontracts/SafEth/derivatives/WstEth.sol:\n 5: import \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\n 12: contract WstEth is IDerivative, Initializable, OwnableUpgradeable {\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "3 results - 3 files\n\ncontracts/SafEth/derivatives/Reth.sol:\n 57 */\n 58: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n 59: maxSlippage = _slippage;\n 60: }\n 61 \n\ncontracts/SafEth/derivatives/SfrxEth.sol:\n 50 */\n 51: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n 52: maxSlippage = _slippage;\n 53: }\n 54 \n\ncontracts/SafEth/derivatives/WstEth.sol:\n 47 */\n 48: function setMaxSlippage(uint256 _slippage) external onlyOwner {\n 49: maxSlippage = _slippage;\n 50: }\n\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-ondo", "title": "luxartvinsec Q", "severity_raw": "Low", "severity": "low", "description": "# 1. Insecure Initialization of the contract\n\nLink: https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/cash/token/CashKYCSender.sol#L31\n\nSummary: The CashKYCSender contract uses the _disableInitializers() function in its constructor, which disables the use of the initializer functions. This allows any address to call the initialize() function, potentially allowing them to set arbitrary values for the kycRegistry and kycRequirementGroup variables and bypassing the intended KYC checks.\n\nImpact: An attacker can potentially call the initialize() function and set arbitrary values for the kycRegistry and kycRequirementGroup variables, potentially allowing them to bypass KYC checks and transfer tokens to unauthorized addresses.\n\nRecommendation: The _disableInitializers() function should be removed or replaced with a secure initialization process that properly controls access to the initialize() function. Additionally, the role-based access control in the \"onlyRole\" function should be reviewed to ensure that it is configured correctly.\n\n# 2. Insecure Internal Function Access in OndoPriceOracle Contract\n\nLink : https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/OndoPriceOracle.sol#L119\n\nSummary:\nThe OndoPriceOracle contract contains an internal function \"_setFTokenToCToken()\" that is called by the external function \"setFTokenToCToken()\". The \"_setFTokenToCToken()\" function does not have any access restrictions and can be called by any address, potentially allowing an attacker to associate arbitrary fTokens with arbitrary cTokens.\n\nImpact:\nAn attacker could associate arbitrary fTokens with arbitrary cTokens, potentially manipulating the underlying prices of the fTokens, leading to financial losses for users and potentially destabilizing the lending market.\n\nRecommendation:\nThe \"_setFTokenToCToken()\" function should have the same access restrictions as the \"setFTokenToCToken()\" function, only allowing the contract owner to call it. Additionally,", "vulnerable_code": "require(mintAmount > 0, \"Mint amount should be greater than 0\");", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/luxartvinsec-Q.md", "collected_at": "2026-01-02T18:15:17.884355+00:00", "source_hash": "f48583e9d419062921c3b87203f7bdc0e9a6dec076375f2f72df85431ff5f6f6", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CashKYCSender.sol#L31, OndoPriceOracle.sol#L119", "github_files_list": "CashKYCSender.sol, OndoPriceOracle.sol", "github_refs_count": 2, "vulnerable_code_actual": "require(mintAmount > 0, \"Mint amount should be greater than 0\");", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "02-ethos", "title": "0x73696d616f G", "severity_raw": "Low", "severity": "low", "description": "## CollateralConfig.sol\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol\n\n### Allowed in the struct `Config` is not necessary\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol#L27\n\nThe `allowed` property in the struct Config is not required, since the other properties can be checked to verify if the collateral is allowed or not (check if decimals > 0, for example).\n\n### Properties in the struct `Config` can be packed\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol#L27\n\n Currently the properties are not packed, taking whole slots unnecessarily. I suggest packing into the following (or similar)\n``` \nstruct Config {\n bool allowed;\n uint24 decimals;\n uint112 MCR;\n uint112 CCR;\n}\n```\n\n### Use a getter for the whole `Config` struct\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol#L27\n\nSome places use all of the properties in the Config struct (except allowed, but as I mentioned previously, this one is not even required), so a getter for the whole struct is cheaper.\n\n## BorrowerOperations.sol \nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol\n\n### It's not necessary to store both `lqtyStaking` and `lqtyStakingAddress`, one can be casted to the other\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L34\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L35\n\n### Instead of storing all the contract addresses, a hash of the addresses concatenated could be stored instead, reducing sread operations\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L174\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/BorrowerOperations.sol#L175\nhttps://github.com/code-423n4/2023-02-ethos/b", "vulnerable_code": "struct Config {\n bool allowed;\n uint24 decimals;\n uint112 MCR;\n uint112 CCR;\n}", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/0x73696d616f-G.md", "collected_at": "2026-01-02T18:15:43.322205+00:00", "source_hash": "f495181a09df80e0b37eaa0633995e63547f8637821639578d1fd88ccb1b9a5b", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 7, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CollateralConfig.sol, CollateralConfig.sol#L27, BorrowerOperations.sol, BorrowerOperations.sol#L34, BorrowerOperations.sol#L35, BorrowerOperations.sol#L174, BorrowerOperations.sol#L175", "github_files_list": "BorrowerOperations.sol, CollateralConfig.sol", "github_refs_count": 7, "vulnerable_code_actual": "struct Config {\n bool allowed;\n uint24 decimals;\n uint112 MCR;\n uint112 CCR;\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "01-biconomy", "title": "HE1M Q", "severity_raw": "Medium", "severity": "medium", "description": "### No. 1 Two-step authentication\nSetting the owner should be done through two-step. \n```\nfunction setOwner(address _newOwner) external mixedAuth {\n require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n address oldOwner = owner;\n owner = _newOwner;\n emit EOAChanged(address(this), oldOwner, _newOwner);\n }\n```\nhttps://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L109\n\nShould be:\n```\nfunction setPendingOwner(address _newPendingOwner) external mixedAuth {\n require(_newPendingOwner != address(0));\n pendingOwner = _newPendingOwner;\n}\n\nfunction acceptOwnership() external {\n require(msg.sender == pendingOwner);\n owner = msg.sender;\n pendingOwner = address(0);\n}\n```\n\n### No. 2 Grieving by already deployed smart wallet contract\n\nIn the normal scenario, Alice sends fund to her smart wallet (which is not created yet) and then after some time sends the dapp transaction to the SDK. The SDK sends batch of transactions (create wallet and dapp transaction) to the relayer. The relayer first creates the wallet by calling the `SmartAccountFactory.sol`, and then sends the dapp transaction to the created wallet. \n\nIn the malicious scenario, Alice sends fund to her smart wallet (which is not created yet). Then Bob (a malicious user) calls the function `deployCounterFactualWallet` to create a smart wallet for Alice (with the same parameters that are used to predict the Alice's smart wallet address), so the smart wallet is deployed for Alice on the expected address. Then after some time Alice sends the dapp transaction to the SDK. The SDK sends batch of transactions (create wallet and dapp transaction) to the relayer. When the ralayer tries to create the wallet for Alice, it reverts, because it is already created by Bob.\n\nBetter to modify as:\n```\nfunction deployCounterFactualWallet(address _owner, address _e", "vulnerable_code": "function setOwner(address _newOwner) external mixedAuth {\n require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n address oldOwner = owner;\n owner = _newOwner;\n emit EOAChanged(address(this), oldOwner, _newOwner);\n }", "fixed_code": "function setPendingOwner(address _newPendingOwner) external mixedAuth {\n require(_newPendingOwner != address(0));\n pendingOwner = _newPendingOwner;\n}\n\nfunction acceptOwnership() external {\n require(msg.sender == pendingOwner);\n owner = msg.sender;\n pendingOwner = address(0);\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/HE1M-Q.md", "collected_at": "2026-01-02T18:13:05.781614+00:00", "source_hash": "f4d79ede7964fa2b6d154b5763537612ca290c28cc28d3e01621e5d31a1652d1", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 575, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function setOwner(address _newOwner) external mixedAuth {\n require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n address oldOwner = owner;\n owner = _newOwner;\n emit EOAChanged(address(this), oldOwner, _newOwner);\n }", "primary_code_language": "unknown", "primary_code_char_count": 283, "all_code_blocks": "// Code block 1 (unknown):\nfunction setOwner(address _newOwner) external mixedAuth {\n require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n address oldOwner = owner;\n owner = _newOwner;\n emit EOAChanged(address(this), oldOwner, _newOwner);\n }\n\n// Code block 2 (unknown):\nfunction setPendingOwner(address _newPendingOwner) external mixedAuth {\n require(_newPendingOwner != address(0));\n pendingOwner = _newPendingOwner;\n}\n\nfunction acceptOwnership() external {\n require(msg.sender == pendingOwner);\n owner = msg.sender;\n pendingOwner = address(0);\n}", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SmartAccount.sol#L109", "github_files_list": "SmartAccount.sol", "github_refs_count": 1, "vulnerable_code_actual": "function setOwner(address _newOwner) external mixedAuth {\n require(_newOwner != address(0), \"Smart Account:: new Signatory address cannot be zero\");\n address oldOwner = owner;\n owner = _newOwner;\n emit EOAChanged(address(this), oldOwner, _newOwner);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function setPendingOwner(address _newPendingOwner) external mixedAuth {\n require(_newPendingOwner != address(0));\n pendingOwner = _newPendingOwner;\n}\n\nfunction acceptOwnership() external {\n require(msg.sender == pendingOwner);\n owner = msg.sender;\n pendingOwner = address(0);\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "02-ethos", "title": "report", "severity_raw": "Critical", "severity": "critical", "description": "---\nsponsor: \"Ethos Reserve\"\nslug: \"2023-02-ethos\"\ndate: \"2023-05-02\"\ntitle: \"Ethos Reserve contest\"\nfindings: \"https://github.com/code-423n4/2023-02-ethos-findings/issues\"\ncontest: 216\n---\n\n# Overview\n\n## About C4\n\nCode4rena (C4) is an open organization consisting of security researchers, auditors, developers, and individuals with domain expertise in smart contracts.\n\nA C4 audit contest is an event in which community participants, referred to as Wardens, review, audit, or analyze smart contract logic in exchange for a bounty provided by sponsoring projects.\n\nDuring the audit contest outlined in this document, C4 conducted an analysis of the Ethos Reserve smart contract system written in Solidity. The audit contest took place between February 16\u2014March 7 2023.\n\n## Wardens\n\n166 Wardens contributed reports to the Ethos Reserve contest:\n\n 1. 0x3b\n 2. [0x52](https://twitter.com/IAm0x52)\n 3. [0x6980](https://twitter.com/0x6980)\n 4. [0x73696d616f](https://twitter.com/3xJanx2009)\n 5. [0xAgro](https://twitter.com/0xAgro)\n 6. [0xBeirao](https://twitter.com/0xBeirao)\n 7. [0xDING99YA](https://twitter.com/ding99ya)\n 8. 0xRobocop\n 9. [0xSmartContract](https://twitter.com/0xSmartContract)\n 10. [0xTheC0der](https://twitter.com/MarioPoneder)\n 11. 0xackermann\n 12. 0xbepresent\n 13. 0xhacksmithh\n 14. 0xmuxyz\n 15. [0xnev](https://twitter.com/bigbuttdev)\n 16. [0xsomeone](https://github.com/alex-ppg)\n 17. 2997ms\n 18. 7siech\n 19. [ABA](https://twitter.com/abarbatei)\n 20. [AkshaySrivastav](https://twitter.com/akshaysrivastv)\n 21. BRONZEDISC\n 22. Bauer\n 23. Bjorn\\_bug\n 24. Bnke0x0\n 25. [Bobface](https://twitter.com/bobface16)\n 26. Bough\n 27. Breeje\n 28. Budaghyan\n 29. [Co0nan](https://twitter.com/Conan0x3)\n 30. [CodeFoxInc](https://twitter.com/CodeFoxInc) ([thurendous](https://twitter.com/Markwu_crypto) and TerrierLover and retocrooman)\n 31. CodingNameKiki\n 32. [DadeKuma](https://twitter.com/DadeKuma)\n 33. Darshan\n 34. DeFiHackLabs (SunSec and gbaleee and 0x", "vulnerable_code": "if(_debtToOffset != 0){\n\t[StabilityPool.sol#L526-L538](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/StabilityPool.sol#L526-L538)\n}", "fixed_code": " // Internal helper function to burn {_shares} of vault shares belonging to {_owner}\n // and return corresponding assets to {_receiver}. Returns the number of assets that were returned.\n function _withdraw(\n uint256 _shares,\n address _receiver,\n address _owner\n ) internal nonReentrant returns (uint256 value) {\n ...\n\n vaultBalance = token.balanceOf(address(this));\n if (value > vaultBalance) {\n value = vaultBalance;\n }\n\n require(\n totalLoss <= ((value + totalLoss) * withdrawMaxLoss) / PERCENT_DIVISOR,\n \"Withdraw loss exceeds slippage\"\n );\n }\n\n token.safeTransfer(_receiver, value);\n emit Withdraw(msg.sender, _receiver, _owner, value, _shares);\n }", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/report.md", "collected_at": "2026-01-02T18:17:29.382619+00:00", "source_hash": "f4fdcdcb92136796a52061630ebe2b27b1077cc7a0f0fb6d86704ab5d75b712f", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "StabilityPool.sol#L526-L538", "github_files_list": "StabilityPool.sol", "github_refs_count": 1, "vulnerable_code_actual": "if(_debtToOffset != 0){\n\t[StabilityPool.sol#L526-L538](https://github.com/code-423n4/2023-02-ethos/blob/73687f32b934c9d697b97745356cdf8a1f264955/Ethos-Core/contracts/StabilityPool.sol#L526-L538)\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": " // Internal helper function to burn {_shares} of vault shares belonging to {_owner}\n // and return corresponding assets to {_receiver}. Returns the number of assets that were returned.\n function _withdraw(\n uint256 _shares,\n address _receiver,\n address _owner\n ) internal nonReentrant returns (uint256 value) {\n ...\n\n vaultBalance = token.balanceOf(address(this));\n if (value > vaultBalance) {\n value = vaultBalance;\n }\n\n require(\n totalLoss <= ((value + totalLoss) * withdrawMaxLoss) / PERCENT_DIVISOR,\n \"Withdraw loss exceeds slippage\"\n );\n }\n\n token.safeTransfer(_receiver, value);\n emit Withdraw(msg.sender, _receiver, _owner, value, _shares);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "04-caviar", "title": "matrix_0wl Q", "severity_raw": "Critical", "severity": "critical", "description": "## Non Critical Issues\n\n| | Issue |\n| ----- | :---------------------------------------------------------------------- |\n| NC-1 | ADD A TIMELOCK TO CRITICAL FUNCTIONS |\n| NC-2 | ADD TO BLACKLIST FUNCTION |\n| NC-3 | USE OF BYTES.CONCAT() INSTEAD OF ABI.ENCODEPACKED(,) |\n| NC-4 | GENERATE PERFECT CODE HEADERS EVERY TIME |\n| NC-5 | MARK VISIBILITY OF INITIALIZE(\u2026) FUNCTIONS AS EXTERNAL |\n| NC-6 | MISSING EVENT FOR CRITICAL PARAMETER CHANGE |\n| NC-7 | MISSING FEE PARAMETER VALIDATION |\n| NC-8 | NATSPEC COMMENTS SHOULD BE INCREASED IN CONTRACTS |\n| NC-9 | INCLUDE RETURN PARAMETERS IN NATSPEC COMMENTS |\n| NC-10 | NO SAME VALUE INPUT CONTROL |\n| NC-11 | OMISSIONS IN EVENTS |\n| NC-12 | SOLIDITY COMPILER OPTIMIZATIONS CAN BE PROBLEMATIC |\n| NC-13 | FUNCTION WRITING THAT DOES NOT COMPLY WITH THE SOLIDITY STYLE GUIDE |\n| NC-14 | NO CONFIG.SOL FILE |\n| NC-15 | DON\u2019T USE PERIODS WITH FRAGMENTS |\n| NC-16 | PRAGMA VERSION^0.8.19 VERSION TOO RECENT TO BE TRUSTED |\n| NC-17 | UNUSED IMPORTS |\n| NC-18 | FOR FUNCTIONS AND VARIABLES FOLLOW SOLIDITY STANDARD NAMING CONVENTIONS |\n| NC-19 | THE TOKENADDRESS STATE VARIABLE SHOULD BE RENAMED TO TOKEN |\n| NC-20 | LINES ARE TOO LONG |\n| NC-21 | USE OZ MERKLETREE IMPLEMENTATION INSTEAD OF CREATING A NEW ONE |\n\n### [NC-1] ADD A TIMELOCK TO CRITICAL FUNCT", "vulnerable_code": "File: src/EthRouter.sol\n\n166: ERC721(sells[i].nft).setApprovalForAll(sells[i].pool, true);\n\n244: ERC721(nft).setApprovalForAll(privatePool, true);\n\n270: ERC721(_change.nft).setApprovalForAll(_change.pool, true);\n", "fixed_code": "File: src/Factory.sol\n\n129: function setPrivatePoolMetadata(address _privatePoolMetadata) public onlyOwner {\n\n135: function setPrivatePoolImplementation(address _privatePoolImplementation) public onlyOwner {\n\n141: function setProtocolFeeRate(uint16 _protocolFeeRate) public onlyOwner {\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/matrix_0wl-Q.md", "collected_at": "2026-01-02T18:20:41.607309+00:00", "source_hash": "f52c00df10fe17cb9ad012137732e804bec65ff46d644ffcf430a9ee5b8d39f9", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: src/EthRouter.sol\n\n166: ERC721(sells[i].nft).setApprovalForAll(sells[i].pool, true);\n\n244: ERC721(nft).setApprovalForAll(privatePool, true);\n\n270: ERC721(_change.nft).setApprovalForAll(_change.pool, true);\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: src/Factory.sol\n\n129: function setPrivatePoolMetadata(address _privatePoolMetadata) public onlyOwner {\n\n135: function setPrivatePoolImplementation(address _privatePoolImplementation) public onlyOwner {\n\n141: function setProtocolFeeRate(uint16 _protocolFeeRate) public onlyOwner {\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "02-ai-arena", "title": "0x11singh99 Q", "severity_raw": "Low", "severity": "low", "description": "# Quality Assurance Report\n\n### Low-Severity\n\n## [L-01] NFT should not be minted on 0 tokenId\n\nThe current implementation of storing fighter structs in the fighters array by using the tokenId as an index may lead to inefficiencies, especially when minting NFTs with tokenId 0.\n\n```solidity\nFile : src/FighterFarm.sol\n\n68: /// @notice List of all fighter structs, accessible by using tokenId as index.\n69: FighterOps.Fighter[] public fighters;\n\n```\n\n[FighterFarm.sol#L68C1-L69C42](https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/FighterFarm.sol#L68C1-L69C42)\n\n## [L-02] Add require check in `incrementGeneration` function to ensure that generation won't exceeds the limit of uint8\n\nThe `incrementGeneration` function in your contract appears to be designed to increment the generation count for a specified fighterType. However, there's a consideration to ensure that the generation count doesn't exceed 255.\n\n```solidity\nFile : src/FighterFarm.sol\n\n42: uint8[2] public generation = [0, 0];\n\n129: function incrementGeneration(uint8 fighterType) external returns (uint8) {\n130: require(msg.sender == _ownerAddress);\n131: generation[fighterType] += 1;\n132: maxRerollsAllowed[fighterType] += 1;\n133: return generation[fighterType];\n134: }\n\n```\n\n[src/FighterFarm.sol#L129C1-L134C6](https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/FighterFarm.sol#L129C1-L134C6)\n\n## [L-03] Change the data type of `state variable` `totalNumTrained` `uint32` to `uint256`\n\nThe maximum value that can be held by a `uint32` variable is 2^32 - 1, which is 4,294,967,295. If someone wants to reach the maximum value of a `uint32` variable by using a loop in a smart contract, it is technically feasible. However, if there's a possibility that the value could exceed 4,294,967,295 it might be prudent to use `uint256` to ensure sufficient range.\n\n```diff\nFile : src/FighterFarm.sol\n\n44: /// @notice Aggregate number of training sessions recorded.\n-45: ", "vulnerable_code": "File : src/FighterFarm.sol\n\n68: /// @notice List of all fighter structs, accessible by using tokenId as index.\n69: FighterOps.Fighter[] public fighters;\n", "fixed_code": "File : src/FighterFarm.sol\n\n42: uint8[2] public generation = [0, 0];\n\n129: function incrementGeneration(uint8 fighterType) external returns (uint8) {\n130: require(msg.sender == _ownerAddress);\n131: generation[fighterType] += 1;\n132: maxRerollsAllowed[fighterType] += 1;\n133: return generation[fighterType];\n134: }\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/0x11singh99-Q.md", "collected_at": "2026-01-02T19:01:57.911566+00:00", "source_hash": "f5ac513aba7d9b7a93387cafb64e6b4e5531588311e7dbf458828c6197723720", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 506, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File : src/FighterFarm.sol\n\n68: /// @notice List of all fighter structs, accessible by using tokenId as index.\n69: FighterOps.Fighter[] public fighters;", "primary_code_language": "solidity", "primary_code_char_count": 158, "all_code_blocks": "// Code block 1 (solidity):\nFile : src/FighterFarm.sol\n\n68: /// @notice List of all fighter structs, accessible by using tokenId as index.\n69: FighterOps.Fighter[] public fighters;\n\n// Code block 2 (solidity):\nFile : src/FighterFarm.sol\n\n42: uint8[2] public generation = [0, 0];\n\n129: function incrementGeneration(uint8 fighterType) external returns (uint8) {\n130: require(msg.sender == _ownerAddress);\n131: generation[fighterType] += 1;\n132: maxRerollsAllowed[fighterType] += 1;\n133: return generation[fighterType];\n134: }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File : src/FighterFarm.sol\n\n68: /// @notice List of all fighter structs, accessible by using tokenId as index.\n69: FighterOps.Fighter[] public fighters;\n\nFile : src/FighterFarm.sol\n\n42: uint8[2] public generation = [0, 0];\n\n129: function incrementGeneration(uint8 fighterType) external returns (uint8) {\n130: require(msg.sender == _ownerAddress);\n131: generation[fighterType] += 1;\n132: maxRerollsAllowed[fighterType] += 1;\n133: return generation[fighterType];\n134: }", "github_refs_formatted": "FighterFarm.sol#L68-L1, FighterFarm.sol#L129-L1", "github_files_list": "FighterFarm.sol", "github_refs_count": 2, "vulnerable_code_actual": "File : src/FighterFarm.sol\n\n68: /// @notice List of all fighter structs, accessible by using tokenId as index.\n69: FighterOps.Fighter[] public fighters;\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File : src/FighterFarm.sol\n\n42: uint8[2] public generation = [0, 0];\n\n129: function incrementGeneration(uint8 fighterType) external returns (uint8) {\n130: require(msg.sender == _ownerAddress);\n131: generation[fighterType] += 1;\n132: maxRerollsAllowed[fighterType] += 1;\n133: return generation[fighterType];\n134: }\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "02-ai-arena", "title": "Blank_Space Q", "severity_raw": "Low", "severity": "low", "description": "#[L-01] Missing length check for `iconsTypes`\n\nThe `redeemMintPass` function does not include the `iconsTypes` array in its sanity length checks. This could cause an unintended revert. Consider adding this check as per the diff:\n\n```diff\nrequire(\n mintpassIdsToBurn.length == mintPassDnas.length && mintPassDnas.length == fighterTypes.length\n && fighterTypes.length == modelHashes.length && modelHashes.length == modelTypes.length\n++ && iconsTypes.length == modelTypes.length\n );\n```\nLocation: https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L243-L248\n\n#[L-02] The `claimRewards` function does not validate the lengths of the parameter arrays\n\nThere could be unintended reverts in `claimRewards` due to the fact that the function relies on the input array lengths to be the same (as the index positions are compared), but does not validate this fact. Consider adding a sanity check that compares the array lengths.\n\n```diff\n++ require(modelURIs.length == modelTypes.length, \"array length mismatch\");\n```\nLocation: https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/MergingPool.sol#L139-L167\n\n#[L-03] Players can update the `fighterType` due to lack of validation\nA player can change the fighterType by calling `reRoll`. The `reRoll` function takes two parameters namely `tokenId` and `fighterType`, but the function doesn\u2019t compare what the existing fighterType was. Which means that a player could `reRoll` their fighter type if they choose to do so. It will also skew the physicalAttributes of the fighter as the function will call `createPhysicalAttributes` with a false dendroidBool. Consider retrieving the fighterType from the fighters object in stead of passing it as a parameter. \n\nLocation: https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L370-L391\n\n#[L-04] The `incrementGeneration", "vulnerable_code": "Location: https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L243-L248\n\n#[L-02] The `claimRewards` function does not validate the lengths of the parameter arrays\n\nThere could be unintended reverts in `claimRewards` due to the fact that the function relies on the input array lengths to be the same (as the index positions are compared), but does not validate this fact. Consider adding a sanity check that compares the array lengths.\n", "fixed_code": "Location: https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/MergingPool.sol#L139-L167\n\n#[L-03] Players can update the `fighterType` due to lack of validation\nA player can change the fighterType by calling `reRoll`. The `reRoll` function takes two parameters namely `tokenId` and `fighterType`, but the function doesn\u2019t compare what the existing fighterType was. Which means that a player could `reRoll` their fighter type if they choose to do so. It will also skew the physicalAttributes of the fighter as the function will call `createPhysicalAttributes` with a false dendroidBool. Consider retrieving the fighterType from the fighters object in stead of passing it as a parameter. \n\nLocation: https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L370-L391\n\n#[L-04] The `incrementGeneration` function increases the `maxRerollsAllowed` per fighter type\n\nThe `incrementGeneration` function increments the generation per fighter type, but it also increases the `maxRerollsAllowed` for every generation increase, thus the new generation fighters will get an added re-roll every time `incrementGeneration` is called. Also consider that any existing fighter will gain a re-roll with each generation increment with reference to this line in the `reRoll` function: `require(numRerolls[tokenId] < maxRerollsAllowed[fighterType]);` as re-rolls are checked on a global level. Consider adding a function that is callable by the owner to specifically increment the re-rolls:\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/Blank_Space-Q.md", "collected_at": "2026-01-02T19:02:19.335436+00:00", "source_hash": "f5bd0f9980d9b8610ec26e81c4301cb87e0c99fae5a3c79a693b44307e43fdf9", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 349, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "require(\n mintpassIdsToBurn.length == mintPassDnas.length && mintPassDnas.length == fighterTypes.length\n && fighterTypes.length == modelHashes.length && modelHashes.length == modelTypes.length\n++ && iconsTypes.length == modelTypes.length\n );", "primary_code_language": "diff", "primary_code_char_count": 274, "all_code_blocks": "// Code block 1 (diff):\nrequire(\n mintpassIdsToBurn.length == mintPassDnas.length && mintPassDnas.length == fighterTypes.length\n && fighterTypes.length == modelHashes.length && modelHashes.length == modelTypes.length\n++ && iconsTypes.length == modelTypes.length\n );\n\n// Code block 2 (diff):\n++ require(modelURIs.length == modelTypes.length, \"array length mismatch\");", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "require(\n mintpassIdsToBurn.length == mintPassDnas.length && mintPassDnas.length == fighterTypes.length\n && fighterTypes.length == modelHashes.length && modelHashes.length == modelTypes.length\n++ && iconsTypes.length == modelTypes.length\n );\n\n++ require(modelURIs.length == modelTypes.length, \"array length mismatch\");", "solidity_code": "", "github_refs_formatted": "FighterFarm.sol#L243-L248, MergingPool.sol#L139-L167, FighterFarm.sol#L370-L391", "github_files_list": "FighterFarm.sol, MergingPool.sol", "github_refs_count": 3, "vulnerable_code_actual": "Location: https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L243-L248\n\n#[L-02] The `claimRewards` function does not validate the lengths of the parameter arrays\n\nThere could be unintended reverts in `claimRewards` due to the fact that the function relies on the input array lengths to be the same (as the index positions are compared), but does not validate this fact. Consider adding a sanity check that compares the array lengths.\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "Location: https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/MergingPool.sol#L139-L167\n\n#[L-03] Players can update the `fighterType` due to lack of validation\nA player can change the fighterType by calling `reRoll`. The `reRoll` function takes two parameters namely `tokenId` and `fighterType`, but the function doesn\u2019t compare what the existing fighterType was. Which means that a player could `reRoll` their fighter type if they choose to do so. It will also skew the physicalAttributes of the fighter as the function will call `createPhysicalAttributes` with a false dendroidBool. Consider retrieving the fighterType from the fighters object in stead of passing it as a parameter. \n\nLocation: https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L370-L391\n\n#[L-04] The `incrementGeneration` function increases the `maxRerollsAllowed` per fighter type\n\nThe `incrementGeneration` function increments the generation per fighter type, but it also increases the `maxRerollsAllowed` for every generation increase, thus the new generation fighters will get an added re-roll every time `incrementGeneration` is called. Also consider that any existing fighter will gain a re-roll with each generation increment with reference to this line in the `reRoll` function: `require(numRerolls[tokenId] < maxRerollsAllowed[fighterType]);` as re-rolls are checked on a global level. Consider adding a function that is callable by the owner to specifically increment the re-rolls:\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "01-ondo", "title": "chaduke G", "severity_raw": "Medium", "severity": "medium", "description": "G1. https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/lending/tokens/cToken/CTokenModified.sol#L123\nPutting it inside unchecked can save gas since overflow is impossible here:\n```\nuint dstTokensNew = accountTokens[dst] + tokens;\n\n```\n\nG2. https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/lending/tokens/cToken/CTokenModified.sol#L182-L190\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/lending/tokens/cCash/CTokenCash.sol#L182-L190\n\nNo need to introduce ``src`` to save gas:\n```\n function approve(\n address spender,\n uint256 amount\n ) external override returns (bool) {\n\n transferAllowances[msg.sender][spender] = amount;\n emit Approval(msg.sender, spender, amount);\n return true;\n }\n```\n\nG3. https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/lending/tokens/cToken/CTokenModified.sol#L818-L819\nEnclosing them inside unchecked can save gas since underflow is impossible due to previous checks\n```\nunchecked{\n uint accountBorrowsNew = accountBorrowsPrev - actualRepayAmount;\n uint totalBorrowsNew = totalBorrows - actualRepayAmount;\n}\n\n```\n\nG4. https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/lending/tokens/cToken/CTokenModified.sol#L1284\nEncoding it inside unchecked can save gas - underflow is impossible due to previous check.\n```\nunchecked{\n totalReservesNew = totalReserves - reduceAmount;\n}\n```\n\nG5. https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/lending/tokens/cCash/CTokenCash.sol#L624-L626\nThis check should be performed earlier (at L588) to save gas.\n\nG6. https://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/lending/tokens/cCash/CTokenCash.sol#L641\nEnclosing this line into unchecked can save gas as underflow", "vulnerable_code": "uint dstTokensNew = accountTokens[dst] + tokens;\n", "fixed_code": " function approve(\n address spender,\n uint256 amount\n ) external override returns (bool) {\n\n transferAllowances[msg.sender][spender] = amount;\n emit Approval(msg.sender, spender, amount);\n return true;\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/chaduke-G.md", "collected_at": "2026-01-02T18:14:59.642038+00:00", "source_hash": "f5c0c69e7317e5e6c4181c7d478eed57d181d165ebe85acf2749674d596dfe9e", "code_block_count": 4, "solidity_block_count": 0, "total_code_chars": 481, "github_ref_count": 7, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "uint dstTokensNew = accountTokens[dst] + tokens;", "primary_code_language": "unknown", "primary_code_char_count": 48, "all_code_blocks": "// Code block 1 (unknown):\nuint dstTokensNew = accountTokens[dst] + tokens;\n\n// Code block 2 (unknown):\nfunction approve(\n address spender,\n uint256 amount\n ) external override returns (bool) {\n\n transferAllowances[msg.sender][spender] = amount;\n emit Approval(msg.sender, spender, amount);\n return true;\n }\n\n// Code block 3 (unknown):\nunchecked{\n uint accountBorrowsNew = accountBorrowsPrev - actualRepayAmount;\n uint totalBorrowsNew = totalBorrows - actualRepayAmount;\n}\n\n// Code block 4 (unknown):\nunchecked{\n totalReservesNew = totalReserves - reduceAmount;\n}", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CTokenModified.sol#L123, CTokenModified.sol#L182-L190, CTokenCash.sol#L182-L190, CTokenModified.sol#L818-L819, CTokenModified.sol#L1284, CTokenCash.sol#L624-L626, CTokenCash.sol#L641", "github_files_list": "CTokenCash.sol, CTokenModified.sol", "github_refs_count": 7, "vulnerable_code_actual": "uint dstTokensNew = accountTokens[dst] + tokens;\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function approve(\n address spender,\n uint256 amount\n ) external override returns (bool) {\n\n transferAllowances[msg.sender][spender] = amount;\n emit Approval(msg.sender, spender, amount);\n return true;\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "01-biconomy", "title": "eyexploit Q", "severity_raw": "Low", "severity": "low", "description": "# Use SafeMath or Math library to do the arithmetic operation\n Consider a example below, \n```\n// calculating using operators\nmax((_tx.targetTxGas * 64) / 63,_tx.targetTxGas + 2500) + 500\n\n// calculating using SafeMath\nmax((_tx.targetTxGas.mul(64).div(63), _tx.targetTxGas.add(2500)).add(500)\n```\n\nThe first expression uses parentheses and the `/` and `+` operators to perform arithmetic operations. This can be confusing to read and understand, especially if you are not familiar with the operator precedence rules in Solidity.\n\nThe second expression uses the `mul`, `div`, and `add` functions from the `SafeMath` library to perform the same arithmetic operations. This is generally considered to be a better practice, because it is easier to read and understand. It also automatically handles overflows and underflows, which can help to protect against any potential bugs or vulnerabilities.\n\nIt's a good idea to use functions from the `SafeMath` library whenever you are performing arithmetic operations in your Solidity code. This can help make your code more readable, maintainable, and secure.\n\n*Impacted code* : https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol\n", "vulnerable_code": "// calculating using operators\nmax((_tx.targetTxGas * 64) / 63,_tx.targetTxGas + 2500) + 500\n\n// calculating using SafeMath\nmax((_tx.targetTxGas.mul(64).div(63), _tx.targetTxGas.add(2500)).add(500)", "fixed_code": "", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/eyexploit-Q.md", "collected_at": "2026-01-02T18:13:43.652508+00:00", "source_hash": "f5feb81880fb10dc8e969376bab7c6a668239dc949df043c86f78b9d16312954", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 198, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "// calculating using operators\nmax((_tx.targetTxGas * 64) / 63,_tx.targetTxGas + 2500) + 500\n\n// calculating using SafeMath\nmax((_tx.targetTxGas.mul(64).div(63), _tx.targetTxGas.add(2500)).add(500)", "primary_code_language": "unknown", "primary_code_char_count": 198, "all_code_blocks": "// Code block 1 (unknown):\n// calculating using operators\nmax((_tx.targetTxGas * 64) / 63,_tx.targetTxGas + 2500) + 500\n\n// calculating using SafeMath\nmax((_tx.targetTxGas.mul(64).div(63), _tx.targetTxGas.add(2500)).add(500)", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SmartAccount.sol", "github_files_list": "SmartAccount.sol", "github_refs_count": 1, "vulnerable_code_actual": "// calculating using operators\nmax((_tx.targetTxGas * 64) / 63,_tx.targetTxGas + 2500) + 500\n\n// calculating using SafeMath\nmax((_tx.targetTxGas.mul(64).div(63), _tx.targetTxGas.add(2500)).add(500)", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5.48} {"source": "c4", "protocol": "09-ondo", "title": "catellatech Analysis", "severity_raw": "High", "severity": "high", "description": "# Ondo Finance Smart Contracts Analysis\n\n## Description overview of Ondo Finance\n\n``Ondo Finance`` is a blockchain platform that offers investment opportunities with cryptocurrencies ``backed`` by U.S. dollar bank deposits ``(USDY)``. ``USDY`` earns interest over time, increasing its value. ``Ondo Finance`` introduces ``rUSDY``, a variant of ``USDY`` that automatically adjusts in quantity to reflect interest but maintains a nominal value of 1`` dollar`` per ``token``. ``Oracles`` track the value of ``USDY``. ``Ondo Finance`` enables asset transfers between ``blockchains`` through ``bridge`` contracts.\n\n![Ondo](https://github.com/catellaTech/Ondo/blob/main/Ondo1.drawio.png?raw=true)\n\n## 1- System Overview\n\n### **Scope**\n\n- [SourceBridge.sol](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/SourceBridge.sol)This ``contract`` facilitates the transfer of tokens between different blockchains using the ``Axelar protocol``, ensuring that tokens burned on one chain are minted on the corresponding destination chain, provided certain conditions are met, and the necessary gas is paid. Additionally, it provides administrative functionalities and a ``pause mechanism`` when needed.\n\n- [DestinationBridge.sol](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/DestinationBridge.sol): This ``contract`` functions as the destination ``chain bridge`` for ``USDY`` tokens. Its primary purpose is to facilitate the seamless transfer of ``USDY`` tokens from a source blockchain to the destination blockchain where this contract resides. This ``bridge`` contract plays a pivotal role in enabling ``cross-chain`` interoperability and ensuring that ``USDY`` tokens can be securely and efficiently moved between different ``blockchain networks``.\n\n- [rUSDY.sol](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDY.sol): This ``contract`` serves as the backbone for an ``interest-bearing`` token where users can ``wrap`` and ``unwrap`` their ``", "vulnerable_code": " /// @dev Role based access control roles\n bytes32 public constant USDY_MANAGER_ROLE = keccak256(\"ADMIN_ROLE\");\n bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n bytes32 public constant BURNER_ROLE = keccak256(\"BURN_ROLE\");\n bytes32 public constant LIST_CONFIGURER_ROLE =\n keccak256(\"LIST_CONFIGURER_ROLE\");\n", "fixed_code": "bytes32 public constant DEFAULT_ADMIN_ROLE = bytes32(0);", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/catellatech-Analysis.md", "collected_at": "2026-01-02T18:25:51.122487+00:00", "source_hash": "f63c5990c534d78cd3074cfe168e1226928971053cdacb5ea86dd84fecd49573", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SourceBridge.sol, DestinationBridge.sol, rUSDY.sol", "github_files_list": "DestinationBridge.sol, rUSDY.sol, SourceBridge.sol", "github_refs_count": 3, "vulnerable_code_actual": " /// @dev Role based access control roles\n bytes32 public constant USDY_MANAGER_ROLE = keccak256(\"ADMIN_ROLE\");\n bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n bytes32 public constant BURNER_ROLE = keccak256(\"BURN_ROLE\");\n bytes32 public constant LIST_CONFIGURER_ROLE =\n keccak256(\"LIST_CONFIGURER_ROLE\");\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "bytes32 public constant DEFAULT_ADMIN_ROLE = bytes32(0);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "02-ai-arena", "title": "PetarTolev Q", "severity_raw": "Critical", "severity": "critical", "description": "## Low Risk Findings Overview\n\n| ID | Finding |\n| ------ | ------------------------------------------------------------------- |\n| [L-01] | Staker Role Cannot Be Revoked |\n| [L-02] | `getFighterPoints` only returns the points for figter with id 1 |\n| [L-03] | The `Neuron` Contract Uses a Deprecated `AccessControl` Function |\n| [L-04] | Unstaked transferred fighter is unusable in the same roundId |\n| [L-05] | Loss of NRNs on token transfer failure in `RankedBattle.unstakeNRN` |\n| [L-06] | Possible Cross-Chain Replay Attack in `FighterFarm.claimFighters` |\n| [L-07] | The user can choose fighters' attributes in their favor |\n\n## Non-critical Findings Overview\n\n| ID | Finding |\n| ------- | --------------------------------------------------------------- |\n| [NC-01] | Implement `_ableToTransfer` in the `ERC20._beforeTokenTransfer` |\n| [NC-02] | Use OpenZeppelin's `AccessControl` for Role Management |\n| [NC-03] | Use OpenZeppelin's `Ownable` for Ownership Management |\n| [NC-04] | In `Neuron` Contract Utilize `AccessControl` Functionality |\n| [NC-05] | In `Neuron` Contract, Inherit OpenZeppelin's `ERC20Burnable` |\n| [NC-06] | Duplicated Validations Should Be Refactored to a Function |\n\n---\n\n# Low Risk Findings\n\n### [L-01] Staker Role Cannot Be Revoked\n\nIn `FighterFarm`, the staker role has permission to lock/unlock fighters, determining their transferability.\n\n```solidity\nfunction updateFighterStaking(uint256 tokenId, bool stakingStatus) external {\n require(hasStakerRole[msg.sender]);\n fighterStaked[tokenId] = stakingStatus;\n ...\n}\n```\n\n```solidity\nfunction _ableToTransfer(uint256 tokenId, address to) private view returns(bool) {\n return (\n _isApprovedOrOwner(msg.sender, tokenId) &&\n balanceOf(to) < MAX_FIGHTERS_ALLOWED &&\n !fi", "vulnerable_code": "function updateFighterStaking(uint256 tokenId, bool stakingStatus) external {\n require(hasStakerRole[msg.sender]);\n fighterStaked[tokenId] = stakingStatus;\n ...\n}", "fixed_code": "function _ableToTransfer(uint256 tokenId, address to) private view returns(bool) {\n return (\n _isApprovedOrOwner(msg.sender, tokenId) &&\n balanceOf(to) < MAX_FIGHTERS_ALLOWED &&\n !fighterStaked[tokenId]\n );\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/PetarTolev-Q.md", "collected_at": "2026-01-02T19:02:38.478364+00:00", "source_hash": "f6559ceeb39668d08f63cb88cb989304f22160272f14ee95a3ace20edca7abfe", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 171, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function updateFighterStaking(uint256 tokenId, bool stakingStatus) external {\n require(hasStakerRole[msg.sender]);\n fighterStaked[tokenId] = stakingStatus;\n ...\n}", "primary_code_language": "solidity", "primary_code_char_count": 171, "all_code_blocks": "// Code block 1 (solidity):\nfunction updateFighterStaking(uint256 tokenId, bool stakingStatus) external {\n require(hasStakerRole[msg.sender]);\n fighterStaked[tokenId] = stakingStatus;\n ...\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function updateFighterStaking(uint256 tokenId, bool stakingStatus) external {\n require(hasStakerRole[msg.sender]);\n fighterStaked[tokenId] = stakingStatus;\n ...\n}", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function updateFighterStaking(uint256 tokenId, bool stakingStatus) external {\n require(hasStakerRole[msg.sender]);\n fighterStaked[tokenId] = stakingStatus;\n ...\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function _ableToTransfer(uint256 tokenId, address to) private view returns(bool) {\n return (\n _isApprovedOrOwner(msg.sender, tokenId) &&\n balanceOf(to) < MAX_FIGHTERS_ALLOWED &&\n !fighterStaked[tokenId]\n );\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "04-caviar", "title": "Aymen0909 G", "severity_raw": "High", "severity": "high", "description": "# Gas Optimizations\n\n## Summary\n\n| | Issue | Instances |\n| :-------------: |:-------------|:-------------:|\n| 1 | `storage` variable should be cached into `memory` variables instead of re-reading them | 7 |\n| 2 | `salePrice` should be calculated outside the for loop | 1 |\n| 3 | Usage of `uints/ints` smaller than 32 bytes (256 bits) incurs overhead | 5 |\n| 4 | `x += y/x -= y` costs more gas than `x = x + y/x = x - y` for state variables | 4 |\n| 5 | Input check statements should be placed at the start of the functions | 2 |\n| 6 | Duplicated input check statements should be refactored to a modifier | 4 |\n| 7 | `public` functions not called by the contract should be declared `external` instead | 20 |\n\n\n## Findings\n\n### 1- `storage` variable should be cached into `memory` variables instead of re-reading them :\n\nThe instances below point to the second+ access of a state variable within a function, the caching of a state variable replaces each Gwarmaccess (100 gas) with a much cheaper stack read, thus saves **100gas** for each instance.\n\nThere are 7 instances of this issue :\n\nFile: PrivatePool.sol \n\n[Line 225-279](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L225-L279)\n\nIn the code linked above the value of `baseToken` is read multiple times (6) from storage and it's value does not change so it should be cached into a memory variable in order to save gas by avoiding multiple reads from storage.\n\n[Line 345-368](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L345-L368)\n\nIn the code linked above the value of `baseToken` is read multiple times (5) from storage and it's value does not change so it should be cached into a memory variable in order to save gas by avoiding multiple reads from storage.\n\n[Line 397-426](https://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L397-L426)\n\nIn the code linked above the value of `baseToken` is read multiple times (4) from s", "vulnerable_code": "uint256 salePrice = (netOutputAmount + feeAmount + protocolFeeAmount) / tokenIds.length;", "fixed_code": "uint16 public protocolFeeRate;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/Aymen0909-G.md", "collected_at": "2026-01-02T18:19:28.929816+00:00", "source_hash": "f65ca6320d52ab2c81d879fd339410ba64a47ffe78d0acfcfe645828d84b720d", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "PrivatePool.sol#L225-L279, PrivatePool.sol#L345-L368, PrivatePool.sol#L397-L426", "github_files_list": "PrivatePool.sol", "github_refs_count": 3, "vulnerable_code_actual": "uint256 salePrice = (netOutputAmount + feeAmount + protocolFeeAmount) / tokenIds.length;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "uint16 public protocolFeeRate;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "04-caviar", "title": "0xhacksmithh G", "severity_raw": "High", "severity": "high", "description": "### [Gas-01] A no. of ways present to `Short-circuit` Function call which significantly save high gas\nLike in ```buy()```\n*First way*\nIs to move ```if (baseToken != address(0) && msg.value > 0) revert InvalidEthAmount(); ``` to first step of function\nIf any user send any ETH(when basetoken is not ETH) then this function will revert right after, So no further gas wasted in further calculation\n\n*Second way* \nTo add a check whether both input array are of same size or not. \n\n*Third way*\nGas can save in ```buy()``` by simply checking user input ids are owned by pool or not\nbuy() simply makes all weight calculation, price calculation, then update state variables and then try to send nfts to caller.\nIf anyone of nfts not owned by pool then whole call will failed, and all gas which used to calculate above things will wasted.\nSo if you move important checks ```like is all nft ids input by caller is owned by protocal``` to the above and then proceed with weigth, price etc, it will cost less gas if any user intentionaly/unintensionaly input wrong ids.\n```solidity\nfunction buy(uint256[] calldata tokenIds, uint256[] calldata tokenWeights, MerkleMultiProof calldata proof) // @audit-issue function expose to reentrancy\n public\n payable\n returns (uint256 netInputAmount, uint256 feeAmount, uint256 protocolFeeAmount) // @audit much gas can save by making initial check whether these nft own by this contract or not, Save caller gas in case of front-running\n {\n // ~~~ Checks ~~~ // // @audit short-circuiting by checking if length of Ids and Weights are same or not.\n+ if (baseToken != address(0) && msg.value > 0) revert InvalidEthAmount(); \n+ require(tokenIds.length == tokenWeights.length);\n // calculate the sum of weights of the NFTs to buy\n uint256 weightSum = sumWeightsAndValidateProof(tokenIds, tokenWeights, proof);\n\n // calculate the required net input amount and fee amount\n (netInputAmount, feeAmount, protocolFe", "vulnerable_code": "*First way*\nIs to move ```if (baseToken != address(0) && msg.value > 0) revert InvalidEthAmount(); ``` to first step of function\nIf any user send any ETH(when basetoken is not ETH) then this function will revert right after, So no further gas wasted in further calculation\n\n*Second way* \nTo add a check whether both input array are of same size or not. \n\n*Third way*\nGas can save in ```buy()``` by simply checking user input ids are owned by pool or not\nbuy() simply makes all weight calculation, price calculation, then update state variables and then try to send nfts to caller.\nIf anyone of nfts not owned by pool then whole call will failed, and all gas which used to calculate above things will wasted.\nSo if you move important checks ```like is all nft ids input by caller is owned by protocal``` to the above and then proceed with weigth, price etc, it will cost less gas if any user intentionaly/unintensionaly input wrong ids.", "fixed_code": "```\nFile: src/PrivatePool.sol\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L211-L289", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/0xhacksmithh-G.md", "collected_at": "2026-01-02T18:19:23.047329+00:00", "source_hash": "f6de64c69dcdcd483a83168c299949731bd10a6bd24d4a52396ae8807808b0c4", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 22, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "*First way*\nIs to move", "primary_code_language": "unknown", "primary_code_char_count": 22, "all_code_blocks": "// Code block 1 (unknown):\n*First way*\nIs to move", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "PrivatePool.sol#L211-L289", "github_files_list": "PrivatePool.sol", "github_refs_count": 1, "vulnerable_code_actual": "*First way*\nIs to move ```if (baseToken != address(0) && msg.value > 0) revert InvalidEthAmount(); ``` to first step of function\nIf any user send any ETH(when basetoken is not ETH) then this function will revert right after, So no further gas wasted in further calculation\n\n*Second way* \nTo add a check whether both input array are of same size or not. \n\n*Third way*\nGas can save in ```buy()``` by simply checking user input ids are owned by pool or not\nbuy() simply makes all weight calculation, price calculation, then update state variables and then try to send nfts to caller.\nIf anyone of nfts not owned by pool then whole call will failed, and all gas which used to calculate above things will wasted.\nSo if you move important checks ```like is all nft ids input by caller is owned by protocal``` to the above and then proceed with weigth, price etc, it will cost less gas if any user intentionaly/unintensionaly input wrong ids.", "has_vulnerable_code_snippet": true, "fixed_code_actual": "```\nFile: src/PrivatePool.sol\nhttps://github.com/code-423n4/2023-04-caviar/blob/main/src/PrivatePool.sol#L211-L289", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ethos", "title": "coryli Q", "severity_raw": "Unknown", "severity": "unknown", "description": "# CHECK TODOs\nCode architecture, incentives, and error handling/reporting questions/issues should be resolved before deployment.\n## Instances\n- https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/StabilityPool.sol#L335\n- https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/StabilityPool.sol#L380\n\n# `decimals()` NOT PART OF `ERC20` STANDARD\n`decimals()` is not part of the official `ERC20` standard and could potentially fail for tokens that do not implement it. \nUnlikely in practice, but something to keep in mind as it could be potentially an issue.\n## Instances\n- https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/CollateralConfig.sol#L63\n- https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L651\n\n# IMMUTABLE ADDRESSES LACK ZERO-ADDRESS CHECK\nChecking addresses against zero-address during initialization or during setting is a security best-practice. \n## Instances\n- https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L120\n\n# NatSpec COMMENTS SHOULD BE INCREASED IN CONTRACTS\nIt's good practice to make sure Solidity contracts are fully annotated using NatSpec. Especially, in complex DeFi projects, clear comments about all functions, their arguments and returns is important for readability and auditability.\n\n# STAKING CONTRACT `LQTYStaking.sol` SHOULD HAVE PAUSE/UNPAUSE FUNCTIONALITY\nIn case a hack occurs or an exploit is discovered, the team should be able to pause functionality until the necessary changes are made to the system. The deposits should be paused with Pause modifier.\n\n# UNUSED VARIABLES\n## Instances\n\n- https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/StabilityPool.sol#L240\n- https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LQTY/LQTYStaking.sol#L50\n\n# UNUSED IMPORTS\n## Instances\n- https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/LQT", "vulnerable_code": " mapping (address => uint256) public yieldingPercentage;\n mapping (address => uint256) public yieldingAmount;\n mapping (address => address) public yieldGenerator;\n mapping (address => uint256) public yieldClaimThreshold;", "fixed_code": "struct Yield {\n\tuint256 percentage;\n\tuint256 amount;\n\taddress generator;\n\tuint256 claimThreshold;\n}", "recommendation": "", "category": "dos", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/coryli-Q.md", "collected_at": "2026-01-02T18:16:59.336413+00:00", "source_hash": "f6f7fb0bae60acd19c1757fb006d5fd757d7b17d3a793957396eef62e4fcca43", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 7, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "StabilityPool.sol#L335, StabilityPool.sol#L380, CollateralConfig.sol#L63, ReaperVaultV2.sol#L651, ReaperVaultV2.sol#L120, StabilityPool.sol#L240, LQTYStaking.sol#L50", "github_files_list": "ReaperVaultV2.sol, LQTYStaking.sol, CollateralConfig.sol, StabilityPool.sol", "github_refs_count": 7, "vulnerable_code_actual": " mapping (address => uint256) public yieldingPercentage;\n mapping (address => uint256) public yieldingAmount;\n mapping (address => address) public yieldGenerator;\n mapping (address => uint256) public yieldClaimThreshold;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "struct Yield {\n\tuint256 percentage;\n\tuint256 amount;\n\taddress generator;\n\tuint256 claimThreshold;\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "06-lybra", "title": "ktg Analysis", "severity_raw": "Unknown", "severity": "unknown", "description": "# My approach taken in evaluating the codebase\nI mainly focus on voting feature by analyzing how things work from\ncreating proposal to executing it. I also take deep look into how configurator\nmodule works.\n\nLybra protocol takes extensive uses of Openzeppelin's libraries like `Governor`,\n`TimelockController`, etc,...So I read these libraries carefully, test it\nmyself and see how the protocol uses these libraries, as this often causes\nproblems.\n\nIt takes quite sometime to set up the tests and understand how things work\nbecause there are no tests and the document is not that detailed.\n\n# About Lybra protocol architecture\nI think the architecture is already properly designed. The protocol takes\nextensive use of openzeppelin's libraries, which is a good idea comparing to\nimplementing them yourselves. The vulnerabilities I found usually involves\nproper usage of these libraries.\n\n# Access control risks\nI decided to set aside a separate part to talk about Lybra protocols'\naccess control risk; because this is the part where I spent the most times\nworking on. This involves understanding Lybra's `LybraGovernance`, `LybraConfigurator`\nmodules and also openzeppelin's `Governor`, `TimelockController`,...\n- First of all, although the protocol is designed to be `governed by esLBR holders` through\n proposal process (create proposal, vote, queue, execute,..), there are many users having\n administration privileges:\n + In `GovernanceTimelock`:\n ```solidity\n _setRoleAdmin(DAO, GOV);\n _setRoleAdmin(TIMELOCK, GOV);\n _setRoleAdmin(ADMIN, GOV);\n _grantRole(DAO, address(this));\n _grantRole(DAO, msg.sender);\n _grantRole(GOV, msg.sender);\n ```\n the deployer `msg.sender` automatically have all the rights to grant/revoke\n `TIMELOCK`, `ADMIN`, `DAO` role (users with `DAO` role can directly call\n functions in `Configurator` and make changes without going through voting process).\n \n + The `proposers`,`executors` and ", "vulnerable_code": "", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/ktg-Analysis.md", "collected_at": "2026-01-02T18:23:05.564406+00:00", "source_hash": "f7729f4ec45116e59f1f075194d388b7142b8bf0e06b2408f9cc625124617643", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 211, "github_ref_count": 0, "vulnerable_code_is_url": true, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "_setRoleAdmin(DAO, GOV);\n _setRoleAdmin(TIMELOCK, GOV);\n _setRoleAdmin(ADMIN, GOV);\n _grantRole(DAO, address(this));\n _grantRole(DAO, msg.sender);\n _grantRole(GOV, msg.sender);", "primary_code_language": "solidity", "primary_code_char_count": 211, "all_code_blocks": "// Code block 1 (solidity):\n_setRoleAdmin(DAO, GOV);\n _setRoleAdmin(TIMELOCK, GOV);\n _setRoleAdmin(ADMIN, GOV);\n _grantRole(DAO, address(this));\n _grantRole(DAO, msg.sender);\n _grantRole(GOV, msg.sender);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "_setRoleAdmin(DAO, GOV);\n _setRoleAdmin(TIMELOCK, GOV);\n _setRoleAdmin(ADMIN, GOV);\n _grantRole(DAO, address(this));\n _grantRole(DAO, msg.sender);\n _grantRole(GOV, msg.sender);", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "", "has_vulnerable_code_snippet": false, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4} {"source": "c4", "protocol": "01-ondo", "title": "damoklov G", "severity_raw": "Medium", "severity": "medium", "description": "## Ondo Finance Audit Report\n\n## Gas Optimizations\n\n### Increments should be unchecked\n\nIn Solidity 0.8+, there\u2019s a default overflow check on unsigned integers. It\u2019s possible to uncheck this in for-loops and save some gas at each iteration, but at the cost of some code readability, as this uncheck cannot be made inline.\n\nAlso increments can be made pre-increment instead of post-increment, so `i++` would become `++i` where necessary.\n\nhttps://github.com/ethereum/solidity/issues/10695\n\nInstances include:\n\n```solidity\nCashManager._processRedemption(): for (uint256 i = 0; i < size; ++i);\nCashManager._processRefund(): for (uint256 i = 0; i < size; ++i);\nCashManager._checkAddressesKYC(): for (uint256 i = 0; i < size; ++i);\n\nCashFactory.multiexcall(): for (uint256 i = 0; i < exCallData.length; ++i);\n\nCashKYCSenderFactory.multiexcall(): for (uint256 i = 0; i < exCallData.length; ++i);\n\nCashKYCSenderReceiverFactory.multiexcall(): for (uint256 i = 0; i < exCallData.length; ++i);\n\nKYCRegistry.addKYCAddresses(): for (uint256 i = 0; i < length; i++);\nKYCRegistry.removeKYCAddresses(): for (uint256 i = 0; i < length; i++);\n```\n\nThe code would go from:\n\n```solidity\nfor (uint256 i; i < numIterations; i++) { \n // ... \n} \n```\n\nTo:\n\n```solidity\nfor (uint256 i; i < numIterations;) { \n // ... \n unchecked { ++i; } \n} \n```\n\n### An array's length should be cached to save gas in for-loops\n\nReading array length at each iteration of the loop takes 6 gas (3 for mload and 3 to place memory_offset) in the stack.\n\nCaching the array length in the stack saves around 3 gas per iteration.\n\nInstances include:\n\n```solidity\nCashFactory.multiexcall(): for (uint256 i = 0; i < exCallData.length; ++i);\n\nCashKYCSenderFactory.multiexcall(): for (uint256 i = 0; i < exCallData.length; ++i);\n\nCashKYCSenderReceiverFactory.multiexcall(): for (uint256 i = 0; i < exCallData.length; ++i);\n```\n\nThe code would go from:\n\n```solidity\nfor (uint256 i; i < arr.length; ++i) { \n // ... \n} \n```\n\nTo:\n\n```solidity\nuint ", "vulnerable_code": "CashManager._processRedemption(): for (uint256 i = 0; i < size; ++i);\nCashManager._processRefund(): for (uint256 i = 0; i < size; ++i);\nCashManager._checkAddressesKYC(): for (uint256 i = 0; i < size; ++i);\n\nCashFactory.multiexcall(): for (uint256 i = 0; i < exCallData.length; ++i);\n\nCashKYCSenderFactory.multiexcall(): for (uint256 i = 0; i < exCallData.length; ++i);\n\nCashKYCSenderReceiverFactory.multiexcall(): for (uint256 i = 0; i < exCallData.length; ++i);\n\nKYCRegistry.addKYCAddresses(): for (uint256 i = 0; i < length; i++);\nKYCRegistry.removeKYCAddresses(): for (uint256 i = 0; i < length; i++);", "fixed_code": "for (uint256 i; i < numIterations; i++) { \n // ... \n} ", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/damoklov-G.md", "collected_at": "2026-01-02T18:15:05.020533+00:00", "source_hash": "f798268e1a12246d487a19ad8e192dcbf65b30da1a36f480753196048d793061", "code_block_count": 5, "solidity_block_count": 5, "total_code_chars": 1039, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "CashManager._processRedemption(): for (uint256 i = 0; i < size; ++i);\nCashManager._processRefund(): for (uint256 i = 0; i < size; ++i);\nCashManager._checkAddressesKYC(): for (uint256 i = 0; i < size; ++i);\n\nCashFactory.multiexcall(): for (uint256 i = 0; i < exCallData.length; ++i);\n\nCashKYCSenderFactory.multiexcall(): for (uint256 i = 0; i < exCallData.length; ++i);\n\nCashKYCSenderReceiverFactory.multiexcall(): for (uint256 i = 0; i < exCallData.length; ++i);\n\nKYCRegistry.addKYCAddresses(): for (uint256 i = 0; i < length; i++);\nKYCRegistry.removeKYCAddresses(): for (uint256 i = 0; i < length; i++);", "primary_code_language": "solidity", "primary_code_char_count": 604, "all_code_blocks": "// Code block 1 (solidity):\nCashManager._processRedemption(): for (uint256 i = 0; i < size; ++i);\nCashManager._processRefund(): for (uint256 i = 0; i < size; ++i);\nCashManager._checkAddressesKYC(): for (uint256 i = 0; i < size; ++i);\n\nCashFactory.multiexcall(): for (uint256 i = 0; i < exCallData.length; ++i);\n\nCashKYCSenderFactory.multiexcall(): for (uint256 i = 0; i < exCallData.length; ++i);\n\nCashKYCSenderReceiverFactory.multiexcall(): for (uint256 i = 0; i < exCallData.length; ++i);\n\nKYCRegistry.addKYCAddresses(): for (uint256 i = 0; i < length; i++);\nKYCRegistry.removeKYCAddresses(): for (uint256 i = 0; i < length; i++);\n\n// Code block 2 (solidity):\nfor (uint256 i; i < numIterations; i++) { \n // ... \n}\n\n// Code block 3 (solidity):\nfor (uint256 i; i < numIterations;) { \n // ... \n unchecked { ++i; } \n}\n\n// Code block 4 (solidity):\nCashFactory.multiexcall(): for (uint256 i = 0; i < exCallData.length; ++i);\n\nCashKYCSenderFactory.multiexcall(): for (uint256 i = 0; i < exCallData.length; ++i);\n\nCashKYCSenderReceiverFactory.multiexcall(): for (uint256 i = 0; i < exCallData.length; ++i);\n\n// Code block 5 (solidity):\nfor (uint256 i; i < arr.length; ++i) { \n // ... \n}", "all_code_blocks_count": 5, "has_diff_blocks": false, "diff_code": "", "solidity_code": "CashManager._processRedemption(): for (uint256 i = 0; i < size; ++i);\nCashManager._processRefund(): for (uint256 i = 0; i < size; ++i);\nCashManager._checkAddressesKYC(): for (uint256 i = 0; i < size; ++i);\n\nCashFactory.multiexcall(): for (uint256 i = 0; i < exCallData.length; ++i);\n\nCashKYCSenderFactory.multiexcall(): for (uint256 i = 0; i < exCallData.length; ++i);\n\nCashKYCSenderReceiverFactory.multiexcall(): for (uint256 i = 0; i < exCallData.length; ++i);\n\nKYCRegistry.addKYCAddresses(): for (uint256 i = 0; i < length; i++);\nKYCRegistry.removeKYCAddresses(): for (uint256 i = 0; i < length; i++);\n\nfor (uint256 i; i < numIterations; i++) { \n // ... \n}\n\nfor (uint256 i; i < numIterations;) { \n // ... \n unchecked { ++i; } \n}\n\nCashFactory.multiexcall(): for (uint256 i = 0; i < exCallData.length; ++i);\n\nCashKYCSenderFactory.multiexcall(): for (uint256 i = 0; i < exCallData.length; ++i);\n\nCashKYCSenderReceiverFactory.multiexcall(): for (uint256 i = 0; i < exCallData.length; ++i);\n\nfor (uint256 i; i < arr.length; ++i) { \n // ... \n}", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "CashManager._processRedemption(): for (uint256 i = 0; i < size; ++i);\nCashManager._processRefund(): for (uint256 i = 0; i < size; ++i);\nCashManager._checkAddressesKYC(): for (uint256 i = 0; i < size; ++i);\n\nCashFactory.multiexcall(): for (uint256 i = 0; i < exCallData.length; ++i);\n\nCashKYCSenderFactory.multiexcall(): for (uint256 i = 0; i < exCallData.length; ++i);\n\nCashKYCSenderReceiverFactory.multiexcall(): for (uint256 i = 0; i < exCallData.length; ++i);\n\nKYCRegistry.addKYCAddresses(): for (uint256 i = 0; i < length; i++);\nKYCRegistry.removeKYCAddresses(): for (uint256 i = 0; i < length; i++);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "for (uint256 i; i < numIterations; i++) { \n // ... \n} ", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "01-salty", "title": "igbinosuneric G", "severity_raw": "High", "severity": "high", "description": "## UNUSED NAMED RETURNS\n\nUsing both named returns and a return statement isn't necessary. Removing unused named return variables can reduce gas usage and improve code clarity.\n\nhttps://github.com//code-423n4/2024-01-salty/blob/main/src/dev/Utils.sol#L255-L282\n```\nfunction quoteAmountOut( IPools pools, IERC20[] memory tokens, uint256 amountIn ) external view returns (uint256 amountOut)\n\t\t{\n\t\trequire( tokens.length >= 2, \"Must have at least two tokens swapped\" );\n\n\t\tIERC20 tokenIn = tokens[0];\n\t\tIERC20 tokenOut;\n\n\t\tfor( uint256 i = 1; i < tokens.length; i++ )\n\t\t\t{\n\t\t\ttokenOut = tokens[i];\n\n\t\t\t(uint256 reserve0, uint256 reserve1) = pools.getPoolReserves(tokenIn, tokenOut);\n\n\t\t\tif ( reserve0 <= PoolUtils.DUST || reserve1 <= PoolUtils.DUST || amountIn <= PoolUtils.DUST )\n\t\t\t\treturn 0;\n\n\t\t\tuint256 k = reserve0 * reserve1;\n\n\t\t\t// Determine amountOut based on amountIn and the reserves\n\t\t\treserve0 += amountIn;\n\t\t\tamountOut = reserve1 - k / reserve0;\n\n\t\t\ttokenIn = tokenOut;\n\t\t\tamountIn = amountOut;\n\t\t\t}\n\n\t\treturn amountOut;\n\t\t}\n\n```\nhttps://github.com//code-423n4/2024-01-salty/blob/main/src/dev/Utils.sol#L287-L314\n\n```\nfunction quoteAmountIn( IPools pools, IERC20[] memory tokens, uint256 amountOut ) external view returns (uint256 amountIn)\n\t\t{\n\t\trequire( tokens.length >= 2, \"Must have at least two tokens swapped\" );\n\n\t\tIERC20 tokenOut = tokens[ tokens.length - 1 ];\n\t\tIERC20 tokenIn;\n\n\t\tfor( uint256 i = 2; i <= tokens.length; i++ )\n\t\t\t{\n\t\t\ttokenIn = tokens[ tokens.length - i];\n\n\t\t\t(uint256 reserve0, uint256 reserve1) = pools.getPoolReserves(tokenIn, tokenOut);\n\n\t\t\tif ( reserve0 <= PoolUtils.DUST || reserve1 <= PoolUtils.DUST || amountOut >= reserve1 || amountOut < PoolUtils.DUST)\n\t\t\t\treturn 0;\n\n\t\t\tuint256 k = reserve0 * reserve1;\n\n\t\t\t// Determine amountIn based on amountOut and the reserves\n\t\t\t// Round up here to err on the side of caution\n\t\t\tamountIn = Math.ceilDiv( k, reserve1 - amountOut ) - reserve0;\n\n\t\t\ttokenOut = tokenIn;\n\t\t\tamountOut = amountIn;\n\t\t\t}\n\n\t\treturn amountIn", "vulnerable_code": "function quoteAmountOut( IPools pools, IERC20[] memory tokens, uint256 amountIn ) external view returns (uint256 amountOut)\n\t\t{\n\t\trequire( tokens.length >= 2, \"Must have at least two tokens swapped\" );\n\n\t\tIERC20 tokenIn = tokens[0];\n\t\tIERC20 tokenOut;\n\n\t\tfor( uint256 i = 1; i < tokens.length; i++ )\n\t\t\t{\n\t\t\ttokenOut = tokens[i];\n\n\t\t\t(uint256 reserve0, uint256 reserve1) = pools.getPoolReserves(tokenIn, tokenOut);\n\n\t\t\tif ( reserve0 <= PoolUtils.DUST || reserve1 <= PoolUtils.DUST || amountIn <= PoolUtils.DUST )\n\t\t\t\treturn 0;\n\n\t\t\tuint256 k = reserve0 * reserve1;\n\n\t\t\t// Determine amountOut based on amountIn and the reserves\n\t\t\treserve0 += amountIn;\n\t\t\tamountOut = reserve1 - k / reserve0;\n\n\t\t\ttokenIn = tokenOut;\n\t\t\tamountIn = amountOut;\n\t\t\t}\n\n\t\treturn amountOut;\n\t\t}\n", "fixed_code": "function quoteAmountIn( IPools pools, IERC20[] memory tokens, uint256 amountOut ) external view returns (uint256 amountIn)\n\t\t{\n\t\trequire( tokens.length >= 2, \"Must have at least two tokens swapped\" );\n\n\t\tIERC20 tokenOut = tokens[ tokens.length - 1 ];\n\t\tIERC20 tokenIn;\n\n\t\tfor( uint256 i = 2; i <= tokens.length; i++ )\n\t\t\t{\n\t\t\ttokenIn = tokens[ tokens.length - i];\n\n\t\t\t(uint256 reserve0, uint256 reserve1) = pools.getPoolReserves(tokenIn, tokenOut);\n\n\t\t\tif ( reserve0 <= PoolUtils.DUST || reserve1 <= PoolUtils.DUST || amountOut >= reserve1 || amountOut < PoolUtils.DUST)\n\t\t\t\treturn 0;\n\n\t\t\tuint256 k = reserve0 * reserve1;\n\n\t\t\t// Determine amountIn based on amountOut and the reserves\n\t\t\t// Round up here to err on the side of caution\n\t\t\tamountIn = Math.ceilDiv( k, reserve1 - amountOut ) - reserve0;\n\n\t\t\ttokenOut = tokenIn;\n\t\t\tamountOut = amountIn;\n\t\t\t}\n\n\t\treturn amountIn;\n\t\t}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/igbinosuneric-G.md", "collected_at": "2026-01-02T19:01:43.996827+00:00", "source_hash": "f7c4b55bc181fb27e912bb126f68a5edc495267a59a5bac14fb803b956172955", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 769, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function quoteAmountOut( IPools pools, IERC20[] memory tokens, uint256 amountIn ) external view returns (uint256 amountOut)\n\t\t{\n\t\trequire( tokens.length >= 2, \"Must have at least two tokens swapped\" );\n\n\t\tIERC20 tokenIn = tokens[0];\n\t\tIERC20 tokenOut;\n\n\t\tfor( uint256 i = 1; i < tokens.length; i++ )\n\t\t\t{\n\t\t\ttokenOut = tokens[i];\n\n\t\t\t(uint256 reserve0, uint256 reserve1) = pools.getPoolReserves(tokenIn, tokenOut);\n\n\t\t\tif ( reserve0 <= PoolUtils.DUST || reserve1 <= PoolUtils.DUST || amountIn <= PoolUtils.DUST )\n\t\t\t\treturn 0;\n\n\t\t\tuint256 k = reserve0 * reserve1;\n\n\t\t\t// Determine amountOut based on amountIn and the reserves\n\t\t\treserve0 += amountIn;\n\t\t\tamountOut = reserve1 - k / reserve0;\n\n\t\t\ttokenIn = tokenOut;\n\t\t\tamountIn = amountOut;\n\t\t\t}\n\n\t\treturn amountOut;\n\t\t}", "primary_code_language": "unknown", "primary_code_char_count": 769, "all_code_blocks": "// Code block 1 (unknown):\nfunction quoteAmountOut( IPools pools, IERC20[] memory tokens, uint256 amountIn ) external view returns (uint256 amountOut)\n\t\t{\n\t\trequire( tokens.length >= 2, \"Must have at least two tokens swapped\" );\n\n\t\tIERC20 tokenIn = tokens[0];\n\t\tIERC20 tokenOut;\n\n\t\tfor( uint256 i = 1; i < tokens.length; i++ )\n\t\t\t{\n\t\t\ttokenOut = tokens[i];\n\n\t\t\t(uint256 reserve0, uint256 reserve1) = pools.getPoolReserves(tokenIn, tokenOut);\n\n\t\t\tif ( reserve0 <= PoolUtils.DUST || reserve1 <= PoolUtils.DUST || amountIn <= PoolUtils.DUST )\n\t\t\t\treturn 0;\n\n\t\t\tuint256 k = reserve0 * reserve1;\n\n\t\t\t// Determine amountOut based on amountIn and the reserves\n\t\t\treserve0 += amountIn;\n\t\t\tamountOut = reserve1 - k / reserve0;\n\n\t\t\ttokenIn = tokenOut;\n\t\t\tamountIn = amountOut;\n\t\t\t}\n\n\t\treturn amountOut;\n\t\t}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function quoteAmountOut( IPools pools, IERC20[] memory tokens, uint256 amountIn ) external view returns (uint256 amountOut)\n\t\t{\n\t\trequire( tokens.length >= 2, \"Must have at least two tokens swapped\" );\n\n\t\tIERC20 tokenIn = tokens[0];\n\t\tIERC20 tokenOut;\n\n\t\tfor( uint256 i = 1; i < tokens.length; i++ )\n\t\t\t{\n\t\t\ttokenOut = tokens[i];\n\n\t\t\t(uint256 reserve0, uint256 reserve1) = pools.getPoolReserves(tokenIn, tokenOut);\n\n\t\t\tif ( reserve0 <= PoolUtils.DUST || reserve1 <= PoolUtils.DUST || amountIn <= PoolUtils.DUST )\n\t\t\t\treturn 0;\n\n\t\t\tuint256 k = reserve0 * reserve1;\n\n\t\t\t// Determine amountOut based on amountIn and the reserves\n\t\t\treserve0 += amountIn;\n\t\t\tamountOut = reserve1 - k / reserve0;\n\n\t\t\ttokenIn = tokenOut;\n\t\t\tamountIn = amountOut;\n\t\t\t}\n\n\t\treturn amountOut;\n\t\t}\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function quoteAmountIn( IPools pools, IERC20[] memory tokens, uint256 amountOut ) external view returns (uint256 amountIn)\n\t\t{\n\t\trequire( tokens.length >= 2, \"Must have at least two tokens swapped\" );\n\n\t\tIERC20 tokenOut = tokens[ tokens.length - 1 ];\n\t\tIERC20 tokenIn;\n\n\t\tfor( uint256 i = 2; i <= tokens.length; i++ )\n\t\t\t{\n\t\t\ttokenIn = tokens[ tokens.length - i];\n\n\t\t\t(uint256 reserve0, uint256 reserve1) = pools.getPoolReserves(tokenIn, tokenOut);\n\n\t\t\tif ( reserve0 <= PoolUtils.DUST || reserve1 <= PoolUtils.DUST || amountOut >= reserve1 || amountOut < PoolUtils.DUST)\n\t\t\t\treturn 0;\n\n\t\t\tuint256 k = reserve0 * reserve1;\n\n\t\t\t// Determine amountIn based on amountOut and the reserves\n\t\t\t// Round up here to err on the side of caution\n\t\t\tamountIn = Math.ceilDiv( k, reserve1 - amountOut ) - reserve0;\n\n\t\t\ttokenOut = tokenIn;\n\t\t\tamountOut = amountIn;\n\t\t\t}\n\n\t\treturn amountIn;\n\t\t}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-salty", "title": "Kaysoft Q", "severity_raw": "Medium", "severity": "medium", "description": "## [L-1] Lack of `deadline` check on add and removing liquidity.\nThere are 2 instances of this\n\n- https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/pools/Pools.sol#L140\n- https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/pools/Pools.sol#L170\n\nThe `ensureNotExpired` modifier is used on the `Pool.swap()` function but not used on the `addLiquidity(...)` and `removeLiquidity(...)` functions of Pool.sol\n\nThe `ensureNotExpired` modifier is used to protect transactions from being kept by the miners till it is profitable for them before execution especially in unstable market swings.\n\n```\nFile: Pool.sol\nmodifier ensureNotExpired(uint deadline)\n\t\t{\n\t\trequire(block.timestamp <= deadline, \"TX EXPIRED\");\n\t\t_;\n\t\t}\n```\n\n```\nFile: Pool.sol\nfunction addLiquidity( ... ) external nonReentrant returns (uint256 addedAmountA, uint256 addedAmountB, uint256 addedLiquidity){\n...\n}\n```\nHowever, the `ensureNotExpired` modifier is not added to the `addLiquidity(...)` and `removeLiquidity(...)` functions.\n\nImpact: `removeLiquidity` and `addLiquidity` transactions can be \"saved for later\" for as long as possible until it incurs enough loss based on slippage.\n\nRecommendation: add a `deadline` parameter and the `ensureNotExpired` modifier to the `addLiquidity(...)` and `removeLiquidity(...)` functions as it is done on the `swap(...)` function. \n```\nfunction addLiquidity( ..., deadline) external nonReentrant ensureNotExpired(deadline) returns (uint256 addedAmountA, uint256 addedAmountB, uint256 addedLiquidity){\n...\n}\n```\n\n\n## [L-2] Use the available `private` `visibility specifier` instead of creating the `onlySameContract` modifier\n\nThere are 11 instances of this\n- https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/Upkeep.sol#L95C2-L112C58\n- https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/Upkeep.sol#L145C2-L231C43\n\nAccordi", "vulnerable_code": "File: Pool.sol\nmodifier ensureNotExpired(uint deadline)\n\t\t{\n\t\trequire(block.timestamp <= deadline, \"TX EXPIRED\");\n\t\t_;\n\t\t}", "fixed_code": "File: Pool.sol\nfunction addLiquidity( ... ) external nonReentrant returns (uint256 addedAmountA, uint256 addedAmountB, uint256 addedLiquidity){\n...\n}", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/Kaysoft-Q.md", "collected_at": "2026-01-02T19:01:23.271427+00:00", "source_hash": "f7c93558ea8f836c6ba3e9367779090cc05a227429b020b92a3238e6ff7f2db7", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 441, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: Pool.sol\nmodifier ensureNotExpired(uint deadline)\n\t\t{\n\t\trequire(block.timestamp <= deadline, \"TX EXPIRED\");\n\t\t_;\n\t\t}", "primary_code_language": "unknown", "primary_code_char_count": 122, "all_code_blocks": "// Code block 1 (unknown):\nFile: Pool.sol\nmodifier ensureNotExpired(uint deadline)\n\t\t{\n\t\trequire(block.timestamp <= deadline, \"TX EXPIRED\");\n\t\t_;\n\t\t}\n\n// Code block 2 (unknown):\nFile: Pool.sol\nfunction addLiquidity( ... ) external nonReentrant returns (uint256 addedAmountA, uint256 addedAmountB, uint256 addedLiquidity){\n...\n}\n\n// Code block 3 (unknown):\nfunction addLiquidity( ..., deadline) external nonReentrant ensureNotExpired(deadline) returns (uint256 addedAmountA, uint256 addedAmountB, uint256 addedLiquidity){\n...\n}", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "Pools.sol#L140, Pools.sol#L170, Upkeep.sol#L95-L2, Upkeep.sol#L145-L2", "github_files_list": "Upkeep.sol, Pools.sol", "github_refs_count": 4, "vulnerable_code_actual": "File: Pool.sol\nmodifier ensureNotExpired(uint deadline)\n\t\t{\n\t\trequire(block.timestamp <= deadline, \"TX EXPIRED\");\n\t\t_;\n\t\t}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: Pool.sol\nfunction addLiquidity( ... ) external nonReentrant returns (uint256 addedAmountA, uint256 addedAmountB, uint256 addedLiquidity){\n...\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "10-badger", "title": "mgf15 G", "severity_raw": "Medium", "severity": "medium", "description": "\n## **G-1** | Possible Optimizations in increaseSystemDebt and decreaseSystemDebt \n\n\nBy using assembly, we can directly interact with the storage slot of the stored variable, allowing us to efficiently write and read address values in storage.\n\n```diff\n\ndiff --git a/ActivePool.sol b/aActivePool.sol\nindex 40b6a1f..345d3dd 100644\n--- a/ActivePool.sol\n+++ b/aActivePool.sol\n@@ -193,10 +197,13 @@ contract ActivePool is IActivePool, ERC3156FlashLender, ReentrancyGuard, BaseMat\n \n function increaseSystemDebt(uint256 _amount) external override {\n _requireCallerIsBOorCdpM();\n-\n+ \n uint256 cachedSystemDebt = systemDebt + _amount;\n-\n- systemDebt = cachedSystemDebt;\n+ //@audit use assembly to update storge\n+ assembly{\n+ sstore(systemDebt.slot,cachedSystemDebt)\n+ }\n+ //systemDebt = cachedSystemDebt;\n emit ActivePoolEBTCDebtUpdated(cachedSystemDebt);\n }\n \n@@ -206,10 +213,13 @@ contract ActivePool is IActivePool, ERC3156FlashLender, ReentrancyGuard, BaseMat\n \n function decreaseSystemDebt(uint256 _amount) external override {\n _requireCallerIsBOorCdpM();\n-\n- uint256 cachedSystemDebt = systemDebt - _amount;\n-\n- systemDebt = cachedSystemDebt;\n+ uint256 cachedSystemDebt;\n+ unchecked{\n+ cachedSystemDebt = systemDebt - _amount;\n+ }\n+ assembly{\n+ sstore(systemDebt.slot,cachedSystemDebt)\n+ }\n emit ActivePoolEBTCDebtUpdated(cachedSystemDebt);\n }\n\n```\n\n> Gas diff\n\n```diff\n\n |----------------------------------------------|-----------------|-------|--------|--------|---------|\n | Deployment Cost | Deployment Size | | | | |\n | Function Name | min | avg | median | max | # calls |\n-| increaseSystemDebt | 1777 | 2746 | 1777 | 21677 | 3078 |\n+| increaseSystemDebt ", "vulnerable_code": "> Gas diff\n", "fixed_code": "## **G-2** | struct can be packed\n\nEach slot saved can avoid an extra Gsset (20000 gas) for the first setting of the struct. Subsequent reads as well as writes have smaller gas savings.\n\nto \n\n[link](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/BorrowerOperations.sol#L97-L104)", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/mgf15-G.md", "collected_at": "2026-01-02T18:26:56.046458+00:00", "source_hash": "f7cc54f727b1e39a744e67ebe714291a560ce07b77bb577c0e67676fc6c61e7f", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 1268, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "diff --git a/ActivePool.sol b/aActivePool.sol\nindex 40b6a1f..345d3dd 100644\n--- a/ActivePool.sol\n+++ b/aActivePool.sol\n@@ -193,10 +197,13 @@ contract ActivePool is IActivePool, ERC3156FlashLender, ReentrancyGuard, BaseMat\n \n function increaseSystemDebt(uint256 _amount) external override {\n _requireCallerIsBOorCdpM();\n-\n+ \n uint256 cachedSystemDebt = systemDebt + _amount;\n-\n- systemDebt = cachedSystemDebt;\n+ //@audit use assembly to update storge\n+ assembly{\n+ sstore(systemDebt.slot,cachedSystemDebt)\n+ }\n+ //systemDebt = cachedSystemDebt;\n emit ActivePoolEBTCDebtUpdated(cachedSystemDebt);\n }\n \n@@ -206,10 +213,13 @@ contract ActivePool is IActivePool, ERC3156FlashLender, ReentrancyGuard, BaseMat\n \n function decreaseSystemDebt(uint256 _amount) external override {\n _requireCallerIsBOorCdpM();\n-\n- uint256 cachedSystemDebt = systemDebt - _amount;\n-\n- systemDebt = cachedSystemDebt;\n+ uint256 cachedSystemDebt;\n+ unchecked{\n+ cachedSystemDebt = systemDebt - _amount;\n+ }\n+ assembly{\n+ sstore(systemDebt.slot,cachedSystemDebt)\n+ }\n emit ActivePoolEBTCDebtUpdated(cachedSystemDebt);\n }", "primary_code_language": "diff", "primary_code_char_count": 1268, "all_code_blocks": "// Code block 1 (diff):\ndiff --git a/ActivePool.sol b/aActivePool.sol\nindex 40b6a1f..345d3dd 100644\n--- a/ActivePool.sol\n+++ b/aActivePool.sol\n@@ -193,10 +197,13 @@ contract ActivePool is IActivePool, ERC3156FlashLender, ReentrancyGuard, BaseMat\n \n function increaseSystemDebt(uint256 _amount) external override {\n _requireCallerIsBOorCdpM();\n-\n+ \n uint256 cachedSystemDebt = systemDebt + _amount;\n-\n- systemDebt = cachedSystemDebt;\n+ //@audit use assembly to update storge\n+ assembly{\n+ sstore(systemDebt.slot,cachedSystemDebt)\n+ }\n+ //systemDebt = cachedSystemDebt;\n emit ActivePoolEBTCDebtUpdated(cachedSystemDebt);\n }\n \n@@ -206,10 +213,13 @@ contract ActivePool is IActivePool, ERC3156FlashLender, ReentrancyGuard, BaseMat\n \n function decreaseSystemDebt(uint256 _amount) external override {\n _requireCallerIsBOorCdpM();\n-\n- uint256 cachedSystemDebt = systemDebt - _amount;\n-\n- systemDebt = cachedSystemDebt;\n+ uint256 cachedSystemDebt;\n+ unchecked{\n+ cachedSystemDebt = systemDebt - _amount;\n+ }\n+ assembly{\n+ sstore(systemDebt.slot,cachedSystemDebt)\n+ }\n emit ActivePoolEBTCDebtUpdated(cachedSystemDebt);\n }", "all_code_blocks_count": 1, "has_diff_blocks": true, "diff_code": "diff --git a/ActivePool.sol b/aActivePool.sol\nindex 40b6a1f..345d3dd 100644\n--- a/ActivePool.sol\n+++ b/aActivePool.sol\n@@ -193,10 +197,13 @@ contract ActivePool is IActivePool, ERC3156FlashLender, ReentrancyGuard, BaseMat\n \n function increaseSystemDebt(uint256 _amount) external override {\n _requireCallerIsBOorCdpM();\n-\n+ \n uint256 cachedSystemDebt = systemDebt + _amount;\n-\n- systemDebt = cachedSystemDebt;\n+ //@audit use assembly to update storge\n+ assembly{\n+ sstore(systemDebt.slot,cachedSystemDebt)\n+ }\n+ //systemDebt = cachedSystemDebt;\n emit ActivePoolEBTCDebtUpdated(cachedSystemDebt);\n }\n \n@@ -206,10 +213,13 @@ contract ActivePool is IActivePool, ERC3156FlashLender, ReentrancyGuard, BaseMat\n \n function decreaseSystemDebt(uint256 _amount) external override {\n _requireCallerIsBOorCdpM();\n-\n- uint256 cachedSystemDebt = systemDebt - _amount;\n-\n- systemDebt = cachedSystemDebt;\n+ uint256 cachedSystemDebt;\n+ unchecked{\n+ cachedSystemDebt = systemDebt - _amount;\n+ }\n+ assembly{\n+ sstore(systemDebt.slot,cachedSystemDebt)\n+ }\n emit ActivePoolEBTCDebtUpdated(cachedSystemDebt);\n }", "solidity_code": "", "github_refs_formatted": "BorrowerOperations.sol#L97-L104", "github_files_list": "BorrowerOperations.sol", "github_refs_count": 1, "vulnerable_code_actual": "> Gas diff\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "## **G-2** | struct can be packed\n\nEach slot saved can avoid an extra Gsset (20000 gas) for the first setting of the struct. Subsequent reads as well as writes have smaller gas savings.\n\nto \n\n[link](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/BorrowerOperations.sol#L97-L104)", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "04-caviar", "title": "0x6980 Q", "severity_raw": "Critical", "severity": "critical", "description": "# 1. For functions, follow Solidity standard naming conventions (internal function style rule)\n- [PrivatePoolMetadata.sol#L112](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePoolMetadata.sol#L112)\n```js\nFile: src/PrivatePoolMetadata.sol\n\n112: function trait(string memory traitType, string memory value) internal pure returns (string memory) {\n113: // forgefmt: disable-next-item\n114: return string(\n115: abi.encodePacked(\n116: '{ \"trait_type\": \"', traitType, '\",', '\"value\": \"', value, '\" }'\n117: )\n118: );\n119: }\n```\nThe above codes don\u2019t follow Solidity\u2019s standard naming convention,\n\ninternal and private functions : the mixedCase format starting with an underscore (_mixedCase starting with an underscore)\n# 2. Floating pragma\nContracts should be deployed with the same compiler version and flags that they have been tested with thoroughly. Locking the pragma helps to ensure that contracts do not accidentally get deployed using, for example, an outdated compiler version that might introduce bugs that affect the contract system negatively.\n- [EthRouter.sol#L2](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/EthRouter.sol#L2)\n```js\nFile: src/EthRouter.sol\n\n2: pragma solidity ^0.8.19;\n```\n- [Factory.sol#L2](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/Factory.sol#L2)\n```js\nFile: src/Factory.sol\n\n2: pragma solidity ^0.8.19;\n```\n- [PrivatePool.sol#L2](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePool.sol#L2)\n```js\nFile: src/PrivatePool.sol\n\n2: pragma solidity ^0.8.19;\n```\n- [PrivatePoolMetadata.sol#L2](https://github.com/code-423n4/2023-04-caviar/blob/cd8a92667bcb6657f70657183769c244d04c015c/src/PrivatePoolMetadata.sol#L2)\n```js\nFile: src/PrivatePoolMetadata.sol\n\n2: pragma solidity ^0.8.19;\n```\n- [IStolen", "vulnerable_code": "File: src/PrivatePoolMetadata.sol\n\n112: function trait(string memory traitType, string memory value) internal pure returns (string memory) {\n113: // forgefmt: disable-next-item\n114: return string(\n115: abi.encodePacked(\n116: '{ \"trait_type\": \"', traitType, '\",', '\"value\": \"', value, '\" }'\n117: )\n118: );\n119: }", "fixed_code": "File: src/EthRouter.sol\n\n2: pragma solidity ^0.8.19;", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-04-caviar-findings/blob/main/data/0x6980-Q.md", "collected_at": "2026-01-02T18:19:17.637778+00:00", "source_hash": "f840728b0641e60c96b000b24885f7ca7bc6836d75e7732417ff2ec933382e87", "code_block_count": 5, "solidity_block_count": 0, "total_code_chars": 597, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: src/PrivatePoolMetadata.sol\n\n112: function trait(string memory traitType, string memory value) internal pure returns (string memory) {\n113: // forgefmt: disable-next-item\n114: return string(\n115: abi.encodePacked(\n116: '{ \"trait_type\": \"', traitType, '\",', '\"value\": \"', value, '\" }'\n117: )\n118: );\n119: }", "primary_code_language": "js", "primary_code_char_count": 375, "all_code_blocks": "// Code block 1 (js):\nFile: src/PrivatePoolMetadata.sol\n\n112: function trait(string memory traitType, string memory value) internal pure returns (string memory) {\n113: // forgefmt: disable-next-item\n114: return string(\n115: abi.encodePacked(\n116: '{ \"trait_type\": \"', traitType, '\",', '\"value\": \"', value, '\" }'\n117: )\n118: );\n119: }\n\n// Code block 2 (js):\nFile: src/EthRouter.sol\n\n2: pragma solidity ^0.8.19;\n\n// Code block 3 (js):\nFile: src/Factory.sol\n\n2: pragma solidity ^0.8.19;\n\n// Code block 4 (js):\nFile: src/PrivatePool.sol\n\n2: pragma solidity ^0.8.19;\n\n// Code block 5 (js):\nFile: src/PrivatePoolMetadata.sol\n\n2: pragma solidity ^0.8.19;", "all_code_blocks_count": 5, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "PrivatePoolMetadata.sol#L112, EthRouter.sol#L2, Factory.sol#L2, PrivatePool.sol#L2, PrivatePoolMetadata.sol#L2", "github_files_list": "EthRouter.sol, Factory.sol, PrivatePool.sol, PrivatePoolMetadata.sol", "github_refs_count": 5, "vulnerable_code_actual": "File: src/PrivatePoolMetadata.sol\n\n112: function trait(string memory traitType, string memory value) internal pure returns (string memory) {\n113: // forgefmt: disable-next-item\n114: return string(\n115: abi.encodePacked(\n116: '{ \"trait_type\": \"', traitType, '\",', '\"value\": \"', value, '\" }'\n117: )\n118: );\n119: }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: src/EthRouter.sol\n\n2: pragma solidity ^0.8.19;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 11} {"source": "c4", "protocol": "01-ondo", "title": "orion Q", "severity_raw": "Medium", "severity": "medium", "description": "The contracts on the require() function uses very long revert messages, as example :\n\n```\nCashKYCSender: must be KYC'd to initiate transfer\nCashKYCSender: `from` address must be KYC'd to send tokens\nonly the admin may call _resignImplementation\nonly the admin may call _becomeImplementation\n```\n\n...etc \n\nHowever there's something about solidity which is that the longer is the revert message the more gas is being consumed\nsee : https://www.youtube.com/watch?v=59MRDldSItU\n\nit's recommended to use less chars as revert messages, example \"\n\n```\n!admin\nfrom!=kyced\n```\n\n============\n\n\n\nFunction of CCashDelegate contract can all be avoided, the function of CCashDelegate are made just to ensure that. :\n\n```\n require(\n msg.sender == admin,\n \"only the admin may call _becomeImplementation\"\n );\n```\n\nas both of the function have no other purpose but that, while this is just an extra code and all can be replaced, \n_becomeImplementation and _resignImplementation can be made as modifiers to ensure `msg.sender == admin` or remove them as there is no logical action they are making\n\n(Manual review) ", "vulnerable_code": "CashKYCSender: must be KYC'd to initiate transfer\nCashKYCSender: `from` address must be KYC'd to send tokens\nonly the admin may call _resignImplementation\nonly the admin may call _becomeImplementation", "fixed_code": "!admin\nfrom!=kyced", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/orion-Q.md", "collected_at": "2026-01-02T18:15:25.490705+00:00", "source_hash": "f842ddc756d94df7e9bcfe56a64fc0d799a87f06e386a6b49f2a8baa29409d74", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 314, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "CashKYCSender: must be KYC'd to initiate transfer\nCashKYCSender: `from` address must be KYC'd to send tokens\nonly the admin may call _resignImplementation\nonly the admin may call _becomeImplementation", "primary_code_language": "unknown", "primary_code_char_count": 200, "all_code_blocks": "// Code block 1 (unknown):\nCashKYCSender: must be KYC'd to initiate transfer\nCashKYCSender: `from` address must be KYC'd to send tokens\nonly the admin may call _resignImplementation\nonly the admin may call _becomeImplementation\n\n// Code block 2 (unknown):\n!admin\nfrom!=kyced\n\n// Code block 3 (unknown):\nrequire(\n msg.sender == admin,\n \"only the admin may call _becomeImplementation\"\n );", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "CashKYCSender: must be KYC'd to initiate transfer\nCashKYCSender: `from` address must be KYC'd to send tokens\nonly the admin may call _resignImplementation\nonly the admin may call _becomeImplementation", "has_vulnerable_code_snippet": true, "fixed_code_actual": "!admin\nfrom!=kyced", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7.22} {"source": "c4", "protocol": "02-ai-arena", "title": "SM3_SS G", "severity_raw": "High", "severity": "high", "description": "\n## Gas Optimizations\n\n| Number | Issue | Instances |\n|--------|-------|-----------|\n|[G-01]| Precompute Off-Chain When Possible | 1 |\n|[G-02]| Use uint8 Can Increase Gas Cost | 39 |\n|[G-03]| Store Data in calldata Instead of Memory for Certain Function Parameters | 11 |\n|[G-04]| use Unchecked Blocks: | 41 |\n|[G-05]| Use the existing Local variable/global variable when equal to a state variable to avoid reading from state | 3 |\n|[G-06]| Avoid Assigning a Value that Will Never be Used | 12 |\n|[G-07]| Check Arguments Early | 5 |\n|[G-08]| State variables that could be declared constant | 2 |\n|[G-09]| Inefficient assignments to state variables | 20 |\n|[G-10]| Using Storage Instead of Memory for structs/arrays Saves Gas | 5 |\n|[G-11]| Use assembly to write address storage values | 31 |\n|[G-12]| Redundant state variable getters | 4 |\n|[G-13]| Refactor functions such that all checks are performed before assigni-ng values to state variables | 1 |\n|[G-14]| Refactor functions to combine events to reduce gas cost | 1 |\n|[G-15]| Avoid Unnecessary Use of Storage | 2 |\n|[G-16]| Using assembly to revert with an error message | 22 |\n|[G-17]| Don\u2019t cache if used only once | 3 |\n|[G-18]| Switching between 1 and 2 instead of 0 and 1 (or false and true) is more gas efficient | 12 |\n|[G-19]| aching global variables is more expensive than using the actual variable (use msg.sender instead of caching it) | 1 |\n|[G-20]| Expensive operation inside a for loop | 4 |\n|[G-21]| Use Mappings Instead of Arrays | 4 |\n|[G-22]| Do not Calculate constant | 3 |\n|[G-22]| Assigning keccak operations to constant variables results in extra gas costs | 3 |\n\n## [G-01] Precompute Off-Chain When Possible\n\nComputing values in advance outside the blockchain is cheaper than doing it inside smart contracts:\n\n```solidity\n// On-chain computation\nfunction verify(uint numA, uint numB) {\n require(numA * numB < 1000);\n}\n\n// Precomputed off-chain\nfunction verify(uint result) {\n require(result < 1000); \n}\n```\n\nDo comput", "vulnerable_code": "// On-chain computation\nfunction verify(uint numA, uint numB) {\n require(numA * numB < 1000);\n}\n\n// Precomputed off-chain\nfunction verify(uint result) {\n require(result < 1000); \n}", "fixed_code": "file: blob/main/src/RankedBattle.sol\n\n341 uint256 stakeAtRisk = _stakeAtRiskInstance.getStakeAtRisk(tokenId);\n if (amountStaked[tokenId] + stakeAtRisk > 0) {\n _addResultPoints(battleResult, tokenId, eloFactor, mergingPortion, fighterOwner);\n }\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/SM3_SS-G.md", "collected_at": "2026-01-02T19:02:43.840125+00:00", "source_hash": "f8c936ad5fdadeb1b7d84cc2be389e974b9f5d31939134ae1b8b987809146d95", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 182, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "// On-chain computation\nfunction verify(uint numA, uint numB) {\n require(numA * numB < 1000);\n}\n\n// Precomputed off-chain\nfunction verify(uint result) {\n require(result < 1000); \n}", "primary_code_language": "solidity", "primary_code_char_count": 182, "all_code_blocks": "// Code block 1 (solidity):\n// On-chain computation\nfunction verify(uint numA, uint numB) {\n require(numA * numB < 1000);\n}\n\n// Precomputed off-chain\nfunction verify(uint result) {\n require(result < 1000); \n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "// On-chain computation\nfunction verify(uint numA, uint numB) {\n require(numA * numB < 1000);\n}\n\n// Precomputed off-chain\nfunction verify(uint result) {\n require(result < 1000); \n}", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "// On-chain computation\nfunction verify(uint numA, uint numB) {\n require(numA * numB < 1000);\n}\n\n// Precomputed off-chain\nfunction verify(uint result) {\n require(result < 1000); \n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "file: blob/main/src/RankedBattle.sol\n\n341 uint256 stakeAtRisk = _stakeAtRiskInstance.getStakeAtRisk(tokenId);\n if (amountStaked[tokenId] + stakeAtRisk > 0) {\n _addResultPoints(battleResult, tokenId, eloFactor, mergingPortion, fighterOwner);\n }\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "08-dopex", "title": "0xc0ffEE Q", "severity_raw": "Critical", "severity": "critical", "description": "1. View function `UniV3LiquidityAMO#liquidityInPool` does not work properly as expected : https://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/amo/UniV3LiquidityAmo.sol#L94-L109. The specification for this function is `Returns this contract's liquidity in a specific [Rdpx]-[collateral] uni v3 pool`. This function calls to `UniswapV3 Pool` contract to get position liquidity, but meanwhile liquidity is added through `UniswapV3 NonfungiblePositionManager` contract (which will manage and track added liquidity through NFT positions). In short, the function get pool position liquidity instead of NFT position liquidity, which does not match with specification. \nThis issue is non-critical because it does not affect contracts in scope, but maybe it could affect contracts that integrate with it in the future\n```diff\ndiff --git a/tests/rdpxV2-core/Periphery.t.sol b/tests/rdpxV2-core/Periphery.t.sol\nindex aed7de4..590c8bb 100644\n--- a/tests/rdpxV2-core/Periphery.t.sol\n+++ b/tests/rdpxV2-core/Periphery.t.sol\n@@ -177,6 +177,8 @@ contract Periphery is ERC721Holder, Setup {\n \n uniV3LiquidityAMO.addLiquidity(params);\n \n+ assertEq(uniV3LiquidityAMO.liquidityInPool(address(weth), minTick, maxTick, fee), 0);\n+\n assertEq(rdpx.balanceOf(address(uniV3LiquidityAMO)), 0);\n assertEq(weth.balanceOf(address(uniV3LiquidityAMO)), 0);\n```", "vulnerable_code": "", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/0xc0ffEE-Q.md", "collected_at": "2026-01-02T18:24:22.268546+00:00", "source_hash": "f8cc982b62a8287aee4ea0a88ec2382a9678fa466fca84ebd15ae417f5188137", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 522, "github_ref_count": 1, "vulnerable_code_is_url": true, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "diff --git a/tests/rdpxV2-core/Periphery.t.sol b/tests/rdpxV2-core/Periphery.t.sol\nindex aed7de4..590c8bb 100644\n--- a/tests/rdpxV2-core/Periphery.t.sol\n+++ b/tests/rdpxV2-core/Periphery.t.sol\n@@ -177,6 +177,8 @@ contract Periphery is ERC721Holder, Setup {\n \n uniV3LiquidityAMO.addLiquidity(params);\n \n+ assertEq(uniV3LiquidityAMO.liquidityInPool(address(weth), minTick, maxTick, fee), 0);\n+\n assertEq(rdpx.balanceOf(address(uniV3LiquidityAMO)), 0);\n assertEq(weth.balanceOf(address(uniV3LiquidityAMO)), 0);", "primary_code_language": "diff", "primary_code_char_count": 522, "all_code_blocks": "// Code block 1 (diff):\ndiff --git a/tests/rdpxV2-core/Periphery.t.sol b/tests/rdpxV2-core/Periphery.t.sol\nindex aed7de4..590c8bb 100644\n--- a/tests/rdpxV2-core/Periphery.t.sol\n+++ b/tests/rdpxV2-core/Periphery.t.sol\n@@ -177,6 +177,8 @@ contract Periphery is ERC721Holder, Setup {\n \n uniV3LiquidityAMO.addLiquidity(params);\n \n+ assertEq(uniV3LiquidityAMO.liquidityInPool(address(weth), minTick, maxTick, fee), 0);\n+\n assertEq(rdpx.balanceOf(address(uniV3LiquidityAMO)), 0);\n assertEq(weth.balanceOf(address(uniV3LiquidityAMO)), 0);", "all_code_blocks_count": 1, "has_diff_blocks": true, "diff_code": "diff --git a/tests/rdpxV2-core/Periphery.t.sol b/tests/rdpxV2-core/Periphery.t.sol\nindex aed7de4..590c8bb 100644\n--- a/tests/rdpxV2-core/Periphery.t.sol\n+++ b/tests/rdpxV2-core/Periphery.t.sol\n@@ -177,6 +177,8 @@ contract Periphery is ERC721Holder, Setup {\n \n uniV3LiquidityAMO.addLiquidity(params);\n \n+ assertEq(uniV3LiquidityAMO.liquidityInPool(address(weth), minTick, maxTick, fee), 0);\n+\n assertEq(rdpx.balanceOf(address(uniV3LiquidityAMO)), 0);\n assertEq(weth.balanceOf(address(uniV3LiquidityAMO)), 0);", "solidity_code": "", "github_refs_formatted": "UniV3LiquidityAmo.sol#L94-L109", "github_files_list": "UniV3LiquidityAmo.sol", "github_refs_count": 1, "vulnerable_code_actual": "", "has_vulnerable_code_snippet": false, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6.78} {"source": "c4", "protocol": "02-ai-arena", "title": "0xRiO G", "severity_raw": "High", "severity": "high", "description": "# Gas Analysis Report\n\n# [G-1] AiArenaHelper::attributes.length can be initialized as a constant\n\n## Description\nThe `attributes.length` variable is used throughout the contract and can be initialized as constant. This constant declaration oversight can lead to increased gas costs during contract deployment and function executions. Also array attributes is not changing throught the contract\n\n## Cause\nThe cause of the issue is the absence of a constant declaration for the `attributes.length` variable. As a result, each reference to `attributes.length` incurs gas costs for storage reads, impacting contract efficiency.\n\n\n### Proposed Correction:\n```solidity\nuint8 constant public attributesLength = 6;\n```\n# [G-2] FighterFarm::redeemMintPass require statement can be made more gas efficient \n\n## Description\nThe `redeemMintPass` function contains redundant require statements to validate the lengths of input arrays, leading to inefficient gas usage.\n\n## Cause\nThe cause of the issue is the redundant require statements used to validate the lengths of input arrays (`mintpassIdsToBurn`, `mintPassDnas`, `fighterTypes`, `modelHashes`, and `modelTypes`). These redundant require statements contribute to gas inefficiency.\n\n### Proposed Correction:\n- Making a variable length and then comparing with \n```solidity\n// Validate lengths of input arrays\nuint256 length = mintpassIdsToBurn.length;\nrequire(\n length == mintPassDnas.length && \n length == fighterTypes.length && \n length == modelHashes.length &&\n length == modelTypes.length,\n \"Array lengths do not match\"\n);\n\nfor (uint16 i = 0; i < length; i++) {\n require(msg.sender == _mintpassInstance.ownerOf(mintpassIdsToBurn[i]), \"Sender is not the owner of the mint pass\");\n _mintpassInstance.burn(mintpassIdsToBurn[i]);\n _createNewFighter(\n msg.sender, \n uint256(keccak256(abi.encode(mintPassDnas[i]))), \n modelHashes[i], \n modelTypes[i],\n fighterTypes[i],\n iconsTypes[i],\n [", "vulnerable_code": "uint8 constant public attributesLength = 6;", "fixed_code": "// Validate lengths of input arrays\nuint256 length = mintpassIdsToBurn.length;\nrequire(\n length == mintPassDnas.length && \n length == fighterTypes.length && \n length == modelHashes.length &&\n length == modelTypes.length,\n \"Array lengths do not match\"\n);\n\nfor (uint16 i = 0; i < length; i++) {\n require(msg.sender == _mintpassInstance.ownerOf(mintpassIdsToBurn[i]), \"Sender is not the owner of the mint pass\");\n _mintpassInstance.burn(mintpassIdsToBurn[i]);\n _createNewFighter(\n msg.sender, \n uint256(keccak256(abi.encode(mintPassDnas[i]))), \n modelHashes[i], \n modelTypes[i],\n fighterTypes[i],\n iconsTypes[i],\n [uint256(100), uint256(100)]\n );\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/0xRiO-G.md", "collected_at": "2026-01-02T19:02:04.207406+00:00", "source_hash": "f8f586274882ea8e5e93b69da9d2ac7d540e846a8a9409201185037f10266829", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 43, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "uint8 constant public attributesLength = 6;", "primary_code_language": "solidity", "primary_code_char_count": 43, "all_code_blocks": "// Code block 1 (solidity):\nuint8 constant public attributesLength = 6;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "uint8 constant public attributesLength = 6;", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "uint8 constant public attributesLength = 6;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "// Validate lengths of input arrays\nuint256 length = mintpassIdsToBurn.length;\nrequire(\n length == mintPassDnas.length && \n length == fighterTypes.length && \n length == modelHashes.length &&\n length == modelTypes.length,\n \"Array lengths do not match\"\n);\n\nfor (uint16 i = 0; i < length; i++) {\n require(msg.sender == _mintpassInstance.ownerOf(mintpassIdsToBurn[i]), \"Sender is not the owner of the mint pass\");\n _mintpassInstance.burn(mintpassIdsToBurn[i]);\n _createNewFighter(\n msg.sender, \n uint256(keccak256(abi.encode(mintPassDnas[i]))), \n modelHashes[i], \n modelTypes[i],\n fighterTypes[i],\n iconsTypes[i],\n [uint256(100), uint256(100)]\n );\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "05-ajna", "title": "lukris02 Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA Report for Ajna Protocol contest\n## Overview\nDuring the audit, 9 non-critical issues were found.\n\n\u2116 | Title | Risk Rating | Instance Count\n--- | --- | --- | ---\nNC-1 | Create a modifier | Non-Critical | 3\nNC-2 | Hardcoded values | Non-Critical | 1\nNC-3 | Use gender-neutral pronouns | Non-Critical | 3\nNC-4 | Use double quotes | Non-Critical | 2\nNC-5 | Inconsistency when using uint and uint256 | Non-Critical | 6\nNC-6 | Prevent zero transfers | Non-Critical | 2\nNC-7 | No space between the control structures | Non-Critical | 4\nNC-8 | Remove extra spaces | Non-Critical | 11+\nNC-9 | Missing leading underscores | Non-Critical | 20\n\n## Non-Critical Risk Findings(9)\n### NC-1. Create a modifier\n##### Description\nDuplicate code can be declared as modifier.\n##### Instances\n- [```if (msg.sender != stakeInfo.owner) revert NotOwnerOfDeposit();```](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/RewardsManager.sol#L120) \n- [```if (msg.sender != stakeInfo.owner) revert NotOwnerOfDeposit();```](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/RewardsManager.sol#L143) \n- [```if (msg.sender != stakeInfo.owner) revert NotOwnerOfDeposit();```](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/RewardsManager.sol#L275) \n\n#\n### NC-2. Hardcoded values\n##### Description\nIt is recommended to avoid using hardcoded values because they can change between implementations, networks or projects.\n##### Instances\n- [```address public immutable ajnaTokenAddress = 0x9a96ec9B57Fb64FbC60B423d1f4da7691Bd35079; /```](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/Funding.sol#L21) \n\n#\n### NC-3. Use gender-neutral pronouns\n##### Description\nAvoid using he/his/him.\n##### Instances\n- [```* @notice Mapping of distributionId to user address to whether user has claimed his delegate reward```](https://github.com/code-423n4/2023-05-ajna/blob/main/ajna-grants/src/grants/base/StandardFunding.sol#L103) \n- [```* @notice Emitte", "vulnerable_code": "if(...) {\n ...\n}", "fixed_code": "if (...) {\n ...\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/lukris02-Q.md", "collected_at": "2026-01-02T18:21:36.141355+00:00", "source_hash": "f8f913a1c6d99c9c44e11e48ce6aa38c9056003a1ffacee9dc6ca6c5c3d12515", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 5, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "RewardsManager.sol#L120, RewardsManager.sol#L143, RewardsManager.sol#L275, Funding.sol#L21, StandardFunding.sol#L103", "github_files_list": "RewardsManager.sol, Funding.sol, StandardFunding.sol", "github_refs_count": 5, "vulnerable_code_actual": "if(...) {\n ...\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "if (...) {\n ...\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-biconomy", "title": "0xdevPed G", "severity_raw": "Low", "severity": "low", "description": "1. Remove the check\n ```\n require (owner == address(0), \"Already Initialized\");\n ```\n\n It's not necessary because the initializer modifier already prevents the function from being reinitialized.\n\n https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract- wallet/SmartAccount.sol#L167\n\n2. Remove the check \n ```\n require(address(_entryPoint) == address(0), \"Already initialized\");\n ```\n It's not necessary because the initializer modifier already prevents the function from being reinitialized.\n\n\n https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L168\n\n\n3. Remove the check\n ```\n if (_handler != address(0))\n ```\n \n https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L174\n\nNot necessary because input for address(0) has already been checked here\n\n require(_handler != address(0), \"Invalid Entrypoint\");\n\n4. uint256 requiredGas = startGas - gasleft(); should be unchecked \n\n startGas will always be greater than gasleft(), no means of underflow.\n\n https://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L291\n\nhere to\nhttps://github.com/code-423n4/2023-01-biconomy/blob/53c8c3823175aeb26dee5529eeefa81240a406ba/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L372\n\n\n\n \n\n\n", "vulnerable_code": "", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/0xdevPed-G.md", "collected_at": "2026-01-02T18:12:49.498835+00:00", "source_hash": "f908300721ef4ad89dfe26308ec2447c8a021ae7634ac6bdae727fa35b95ac5f", "code_block_count": 3, "solidity_block_count": 0, "total_code_chars": 147, "github_ref_count": 4, "vulnerable_code_is_url": true, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "require (owner == address(0), \"Already Initialized\");", "primary_code_language": "unknown", "primary_code_char_count": 53, "all_code_blocks": "// Code block 1 (unknown):\nrequire (owner == address(0), \"Already Initialized\");\n\n// Code block 2 (unknown):\nrequire(address(_entryPoint) == address(0), \"Already initialized\");\n\n// Code block 3 (unknown):\nif (_handler != address(0))", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SmartAccount.sol#L168, SmartAccount.sol#L174, SmartAccount.sol#L291, SmartAccount.sol#L372", "github_files_list": "SmartAccount.sol", "github_refs_count": 4, "vulnerable_code_actual": "", "has_vulnerable_code_snippet": false, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 7} {"source": "c4", "protocol": "11-kelp", "title": "0xepley Q", "severity_raw": "Unknown", "severity": "unknown", "description": "## 1): Wrong event emittion\nIn the function `depositAssetIntoStrategy` of `NodeDelegator` the event\n```solidity\nemit AssetDepositIntoStrategy(asset, strategy, balance);\n```\n\nis being emitted but the location of this event emission is wrong, the event is emitted before the tokens are being deposited into the `strategy` so make sure to correct it and emit the event after the assets are being deposited into the `strategy`\n\n## 2): Approving max to Eigen Layer\nThe function `maxApproveToEigenStrategyManager` is approving max (`uint256`) to eigen layer strategy which is really dangerous if the strategy is malicious so it is better to approve it according to the needs\n\n## 3): `nodeDelegatorQueue` can be DOS\nThe smart contract is storing all the node Delegators into an array, although the initial limit is 10 delegators but it can be increase so an `uin256.max` amount and storing such an amount in an array is dangerous as the code is alliterating over the array and the array can be DOS.\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L202-L205\n\n## 4): NO check on amount being transfered\nIn the function `transferAssetToNodeDelegator` `onlyLRTManager` is transfering the money deposited into the node Delegator but there isn't any check on the amount he passed, it could be zero or could be more then what the contract is currently holding, so it is recommended to add a check for this purpose\n\nhttps://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L183-L197", "vulnerable_code": "emit AssetDepositIntoStrategy(asset, strategy, balance);", "fixed_code": "", "recommendation": "", "category": "dos", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/0xepley-Q.md", "collected_at": "2026-01-02T18:27:14.587252+00:00", "source_hash": "f909e9d376d619b28f6485ba0180948b4ae556691017cf91ba129276684a2a08", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 56, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "emit AssetDepositIntoStrategy(asset, strategy, balance);", "primary_code_language": "solidity", "primary_code_char_count": 56, "all_code_blocks": "// Code block 1 (solidity):\nemit AssetDepositIntoStrategy(asset, strategy, balance);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "emit AssetDepositIntoStrategy(asset, strategy, balance);", "github_refs_formatted": "LRTDepositPool.sol#L202-L205, LRTDepositPool.sol#L183-L197", "github_files_list": "LRTDepositPool.sol", "github_refs_count": 2, "vulnerable_code_actual": "emit AssetDepositIntoStrategy(asset, strategy, balance);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 6} {"source": "c4", "protocol": "01-salty", "title": "Pechenite G", "severity_raw": "High", "severity": "high", "description": "## Summary\n\n- [[G-01] Replace `type(uint).max` with constants](#g-01-replace-typeuintnmax-with-constants)\n- [[G-02] State variables can be packed into fewer storage slots by truncating timestamp bytes](#g-02-state-variables-can-be-packed-into-fewer-storage-slots-by-truncating-timestamp-bytes)\n- [[G-03] Order of initial checks in a function can be optimized](#g-03-order-of-initial-checks-in-a-function-can-be-optimized)\n- [[G-04] Stack variable is only used once](#g-04-stack-variable-is-only-used-once)\n- [[G-05] Consider caching `FixedPoint96.Q96 * (10 ** 18)`](#g-05-consider-caching-fixedpoint96q96--10--18)\n- [[G-06] Use hardcoded address instead of `address(this)`](#g-06-use-hardcoded-address-instead-of-addressthis)\n- [[G-07] Use assembly to perform efficient back-to-back calls](#g-07-use-assembly-to-perform-efficient-back-to-back-calls)\n- [[G-08] Inverting the condition of an `if`-`else`-statement wastes gas](#g-08-inverting-the-condition-of-an-if-else-statement-wastes-gas)\n- [[G-09] Declare variables outside of loops](#g-09-declare-variables-outside-of-loops)\n- [[G-10] Do not calculate constants](#g-10-do-not-calculate-constants)\n- [[G-11] Counting down in `for` statements is more gas efficient](#g-11-counting-down-in-for-statements-is-more-gas-efficient)\n- [[G-12] Use assembly scratch space to build calldata for event emits](#g-12-use-assembly-scratch-space-to-build-calldata-for-event-emits)\n\n## [G-01] Replace `type(uint).max` with constants\n\n**Saved gas per instance: 4**\n\n```solidity\nFile: src/ManagedWallet.sol\n\n37: \t\tactiveTimelock = type(uint256).max;\n\n68: \t\t\tactiveTimelock = type(uint256).max; // effectively never\n\n86: \t\tactiveTimelock = type(uint256).max;\n```\n\n- https://github.com/code-423n4/2024-01-salty/blob/main/src/ManagedWallet.sol/#L37-L37\n- https://github.com/code-423n4/2024-01-salty/blob/main/src/ManagedWallet.sol/#L68-L68\n- https://github.com/code-423n4/2024-01-salty/blob/main/src/ManagedWallet.sol/#L86-L86\n\n##### Optimized Code:\n\n```diff\n ", "vulnerable_code": "File: src/ManagedWallet.sol\n\n37: \t\tactiveTimelock = type(uint256).max;\n\n68: \t\t\tactiveTimelock = type(uint256).max; // effectively never\n\n86: \t\tactiveTimelock = type(uint256).max;", "fixed_code": "
\nOther instances:\n\n- https://github.com/code-423n4/2024-01-salty/blob/main/src/Upkeep.sol/#L91-L91\n- https://github.com/code-423n4/2024-01-salty/blob/main/src/dao/DAO.sol/#L90-L92\n- https://github.com/code-423n4/2024-01-salty/blob/main/src/dao/Proposals.sol/#L165-L165\n- https://github.com/code-423n4/2024-01-salty/blob/main/src/pools/PoolStats.sol/#L14-L14\n- https://github.com/code-423n4/2024-01-salty/blob/main/src/rewards/RewardsEmitter.sol/#L50-L50\n- https://github.com/code-423n4/2024-01-salty/blob/main/src/rewards/SaltRewards.sol/#L41-L42\n- https://github.com/code-423n4/2024-01-salty/blob/main/src/stable/Liquidizer.sol/#L71-L73\n\n
\n\n---\n\n## [G-02] State variables can be packed into fewer storage slots by truncating timestamp bytes\n\nBy using a `uint32` rather than a larger type for variables that track timestamps, one can save gas by using fewer storage slots per struct, at the expense of the protocol breaking after the year 2106 (when `uint32` wraps). If this is an acceptable tradeoff, if variables occupying the same slot are both written the same function or by the constructor, avoids a separate Gsset (**20000 gas**). Reads of the variables can also be cheaper\n\n**Saved gas: 20,000**\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/Pechenite-G.md", "collected_at": "2026-01-02T19:01:25.536893+00:00", "source_hash": "f9409d0ce09e71129e45659e157387d61d5011837821b77f45b5a6873cb5155a", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 178, "github_ref_count": 8, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: src/ManagedWallet.sol\n\n37: \t\tactiveTimelock = type(uint256).max;\n\n68: \t\t\tactiveTimelock = type(uint256).max; // effectively never\n\n86: \t\tactiveTimelock = type(uint256).max;", "primary_code_language": "solidity", "primary_code_char_count": 178, "all_code_blocks": "// Code block 1 (solidity):\nFile: src/ManagedWallet.sol\n\n37: \t\tactiveTimelock = type(uint256).max;\n\n68: \t\t\tactiveTimelock = type(uint256).max; // effectively never\n\n86: \t\tactiveTimelock = type(uint256).max;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: src/ManagedWallet.sol\n\n37: \t\tactiveTimelock = type(uint256).max;\n\n68: \t\t\tactiveTimelock = type(uint256).max; // effectively never\n\n86: \t\tactiveTimelock = type(uint256).max;", "github_refs_formatted": "ManagedWallet.sol, Upkeep.sol, DAO.sol, Proposals.sol, PoolStats.sol, RewardsEmitter.sol, SaltRewards.sol, Liquidizer.sol", "github_files_list": "Liquidizer.sol, DAO.sol, PoolStats.sol, Upkeep.sol, SaltRewards.sol, RewardsEmitter.sol, Proposals.sol, ManagedWallet.sol", "github_refs_count": 8, "vulnerable_code_actual": "File: src/ManagedWallet.sol\n\n37: \t\tactiveTimelock = type(uint256).max;\n\n68: \t\t\tactiveTimelock = type(uint256).max; // effectively never\n\n86: \t\tactiveTimelock = type(uint256).max;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "
\nOther instances:\n\n- https://github.com/code-423n4/2024-01-salty/blob/main/src/Upkeep.sol/#L91-L91\n- https://github.com/code-423n4/2024-01-salty/blob/main/src/dao/DAO.sol/#L90-L92\n- https://github.com/code-423n4/2024-01-salty/blob/main/src/dao/Proposals.sol/#L165-L165\n- https://github.com/code-423n4/2024-01-salty/blob/main/src/pools/PoolStats.sol/#L14-L14\n- https://github.com/code-423n4/2024-01-salty/blob/main/src/rewards/RewardsEmitter.sol/#L50-L50\n- https://github.com/code-423n4/2024-01-salty/blob/main/src/rewards/SaltRewards.sol/#L41-L42\n- https://github.com/code-423n4/2024-01-salty/blob/main/src/stable/Liquidizer.sol/#L71-L73\n\n
\n\n---\n\n## [G-02] State variables can be packed into fewer storage slots by truncating timestamp bytes\n\nBy using a `uint32` rather than a larger type for variables that track timestamps, one can save gas by using fewer storage slots per struct, at the expense of the protocol breaking after the year 2106 (when `uint32` wraps). If this is an acceptable tradeoff, if variables occupying the same slot are both written the same function or by the constructor, avoids a separate Gsset (**20000 gas**). Reads of the variables can also be cheaper\n\n**Saved gas: 20,000**\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "02-ai-arena", "title": "0xRiO Q", "severity_raw": "High", "severity": "high", "description": "# [QA-1] Issue in `mint` Function\n\n## Description\nThe `mint` function in the contract has a comparison operator issue in the `require` statement, where it checks if the total supply plus the minted amount exceeds the maximum supply.\n\n## Error\nThe cause of the issue is the incorrect usage of the comparison operator in the `require` statement. The operator `<` is used instead of `<=`, which results in incorrect validation of the minted amount against the maximum supply.\n```\n function mint(address to, uint256 amount) public virtual {\n require(totalSupply() + amount < MAX_SUPPLY, \"Trying to mint more than the max supply\");\n require(hasRole(MINTER_ROLE, msg.sender), \"ERC20: must have minter role to mint\");\n _mint(to, amount);\n }\n```\n\n## Impact\n- Actual supply will always be less than the MAX_SUPPLY of the token which can have impact on economic price of the token.\n\n## Correction\nTo address this issue, the comparison operator in the `require` statement should be changed from `<` to `<=` to correctly validate if the total supply plus the minted amount is less than or equal to the maximum supply.\n\n# [QA-2]User can never lose stake even if they have very little points\n\n## Instance \n- This check in RankedBattle::addBalance function make it impossible to lose on their stake if they have very little points which let them perform poorly with some player which will let the opponents to have a high elo and to get high share on Pool.\n[These opponents can also be their different Id, which will be end up in a win situation for the user]\n```\n if (points > accumulatedPointsPerFighter[tokenId][roundId]) {\n points = accumulatedPointsPerFighter[tokenId][roundId];\n }\n```\n\n# [QA-3] FighterFarm::redeemMintPass in not checking array length on iconsTypes array\n\n## Description\nThe redeemMintPass function in the contract allows users to redeem multiple mint passes in exchange for fighter NFTs. However, there is a potenti", "vulnerable_code": " function mint(address to, uint256 amount) public virtual {\n require(totalSupply() + amount < MAX_SUPPLY, \"Trying to mint more than the max supply\");\n require(hasRole(MINTER_ROLE, msg.sender), \"ERC20: must have minter role to mint\");\n _mint(to, amount);\n }", "fixed_code": " if (points > accumulatedPointsPerFighter[tokenId][roundId]) {\n points = accumulatedPointsPerFighter[tokenId][roundId];\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/0xRiO-Q.md", "collected_at": "2026-01-02T19:02:04.650397+00:00", "source_hash": "f94b70344b94ae2a91c214e851d4f6d1904c7ff661e2dd616c0b3f5c6b04de83", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 434, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function mint(address to, uint256 amount) public virtual {\n require(totalSupply() + amount < MAX_SUPPLY, \"Trying to mint more than the max supply\");\n require(hasRole(MINTER_ROLE, msg.sender), \"ERC20: must have minter role to mint\");\n _mint(to, amount);\n }", "primary_code_language": "unknown", "primary_code_char_count": 279, "all_code_blocks": "// Code block 1 (unknown):\nfunction mint(address to, uint256 amount) public virtual {\n require(totalSupply() + amount < MAX_SUPPLY, \"Trying to mint more than the max supply\");\n require(hasRole(MINTER_ROLE, msg.sender), \"ERC20: must have minter role to mint\");\n _mint(to, amount);\n }\n\n// Code block 2 (unknown):\nif (points > accumulatedPointsPerFighter[tokenId][roundId]) {\n points = accumulatedPointsPerFighter[tokenId][roundId];\n }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function mint(address to, uint256 amount) public virtual {\n require(totalSupply() + amount < MAX_SUPPLY, \"Trying to mint more than the max supply\");\n require(hasRole(MINTER_ROLE, msg.sender), \"ERC20: must have minter role to mint\");\n _mint(to, amount);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " if (points > accumulatedPointsPerFighter[tokenId][roundId]) {\n points = accumulatedPointsPerFighter[tokenId][roundId];\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "11-kelp", "title": "0xSmartContract Analysis", "severity_raw": "High", "severity": "high", "description": "# \ud83d\udee0\ufe0f Analysis - Kelp Protocol\n### Summary\n| List |Head |Details|\n|:--|:----------------|:------|\n|a) |The approach I followed when reviewing the code | Stages in my code review and analysis |\n|b) |Analysis of the code base | What is unique? How are the existing patterns used? \"Solidity-metrics\" was used |\n|c) |Test analysis | Test scope of the project and quality of tests |\n|d) |Security Approach of the Project | Audit approach of the Project |\n|e) |Packages and Dependencies Analysis | Details about the project Packages |\n|f) |Other recommendations | What is unique? How are the existing patterns used? |\n|g) |New insights and learning from this audit | Things learned from the project |\n\n\n\n## a) The approach I followed when reviewing the code\n\nFirst, by examining the scope of the code, I determined my code review and analysis strategy.\nhttps://github.com/code-423n4/2023-11-kelp\n\nAccordingly, I analyzed and audited the subject in the following steps;\n\n| Number |Stage |Details|Information|\n|:--|:----------------|:------|:------|\n|1|Compile and Run Test|[Installation](https://github.com/code-423n4/2023-11-kelp#compile)|Test and installation structure is simple, cleanly designed|\n|2|Architecture Review| [Kelp](https://blog.kelpdao.xyz/) |Provides a basic architectural teaching for General Architecture|\n|3|Graphical Analysis |Graphical Analysis with [Solidity-metrics](https://github.com/ConsenSys/solidity-metrics)|A visual view has been made to dominate the general structure of the codes of the project.|\n|4|Slither Analysis | [Slither Report](https://github.com/crytic/slither)| The project does not currently have a slither result, a slither control was created from scratch |\n|5|Test Suits|[Tests](https://github.com/code-423n4/2023-11-kelp#tests)|In this section, the scope and content of the tests of the project are analyzed.|\n|6|Manuel Code Review|[Scope](https://github.com/code-423n4/2023-11-kelp#additional-context)||\n|7|Infographic|[Figma](https://www.figma.com/)|I ma", "vulnerable_code": "nonReentrant modifier functions : 2 results \n\nsrc/LRTDepositPool.sol:\n 119: function depositAsset(\n 120: address asset,\n 121: uint256 depositAmount\n 122: )\n 123: external\n 124: whenNotPaused\n 125: nonReentrant\n 126: onlySupportedAsset(asset)\n 127: {\n\n\n 183: function transferAssetToNodeDelegator(\n 184: uint256 ndcIndex,\n 185: address asset,\n 186: uint256 amount\n 187: )\n 188: external\n 189: nonReentrant\n 190: onlyLRTManager\n 191: onlySupportedAsset(asset)\n 192: {\n", "fixed_code": "", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/0xSmartContract-Analysis.md", "collected_at": "2026-01-02T18:27:11.400061+00:00", "source_hash": "f96d019a44d89adc59a2b26057c7c24b5539b75b1b3a8ae75b2d5fcedb4dd901", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "nonReentrant modifier functions : 2 results \n\nsrc/LRTDepositPool.sol:\n 119: function depositAsset(\n 120: address asset,\n 121: uint256 depositAmount\n 122: )\n 123: external\n 124: whenNotPaused\n 125: nonReentrant\n 126: onlySupportedAsset(asset)\n 127: {\n\n\n 183: function transferAssetToNodeDelegator(\n 184: uint256 ndcIndex,\n 185: address asset,\n 186: uint256 amount\n 187: )\n 188: external\n 189: nonReentrant\n 190: onlyLRTManager\n 191: onlySupportedAsset(asset)\n 192: {\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4} {"source": "c4", "protocol": "06-lybra", "title": "niser93 Q", "severity_raw": "Critical", "severity": "critical", "description": "## Low Risk Issues\n| |Issue |Instances|\n|:-----:|:-----:|:-------:|\n|L-01|Division by zero not prevented|9|\n|L-02|Setters should have initial value check|32|\n|L-03|Use of floating pragma|21|\n\n## Not Critical Issues\n| |Issue |Instances|\n|:-----:|:-----:|:-------:|\n|NC-01|Use scientific notation (e.g. ```1e18```) rather than exponentiation (e.g. ```10**18```)|13|\n|NC-02|Inconsistent spacing in comments|2|\n|NC-03|Typos|2|\n|NC-04|Imports could be organized more systematically|11|\n|NC-05|```public``` functions not called by the contract should be declared ```external``` instead|5|\n|NC-06|Empty Function Body. Considering commenting why.|6|\n|NC-07|Strings should use double quotes rather than single quotes|1|\n|NC-08|Function always returns true (or false)|11|\n\n\n### Comment\nSome report titles are same of [winning bot](https://gist.github.com/liveactionllama/27513952718ec3cbcf9de0fda7fef49c), but we report instances whose are't already found.\n\n# Low Risk Issues\n## L-01\n### Division by zero not prevented\n#### Description\nThe divisions below take an input parameter which does not have any zero-value checks, which may lead to the functions reverting when zero is passed.\n\n\n
\nThere are 9 instances of this issue:\n\n```\nFile: EUSDMiningIncentives.sol\n\n \n 189 return (stakedLBRLpValue(user) * 10000) / stakedOf(user) < 500;\n\n```\n[https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/miner/EUSDMiningIncentives.sol#L189](https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/miner/EUSDMiningIncentives.sol#L189)\n\n```\nFile: LybraEUSDVaultBase.sol\n\n \n 156 uint256 onBehalfOfCollateralRatio = (depositedAsset[onBehalfOf] * assetPrice * 100) / borrowed[onBehalfOf];\n\n \n 190 uint256 onBehalfOfCollateralRatio = (depositedAsset[onBehalfOf] * assetPrice * 100) / borrowed[onBehalfOf];\n\n \n 236 uint256 providerCollateralRatio = (depositedAsset[provider] * assetPrice * 100) / borrowed[provider]", "vulnerable_code": "File: EUSDMiningIncentives.sol\n\n \n 189 return (stakedLBRLpValue(user) * 10000) / stakedOf(user) < 500;\n", "fixed_code": "File: LybraEUSDVaultBase.sol\n\n \n 156 uint256 onBehalfOfCollateralRatio = (depositedAsset[onBehalfOf] * assetPrice * 100) / borrowed[onBehalfOf];\n\n \n 190 uint256 onBehalfOfCollateralRatio = (depositedAsset[onBehalfOf] * assetPrice * 100) / borrowed[onBehalfOf];\n\n \n 236 uint256 providerCollateralRatio = (depositedAsset[provider] * assetPrice * 100) / borrowed[provider];\n\n \n 292 if (((depositedAsset[_user] * _assetPrice * 100) / borrowed[_user]) < configurator.getSafeCollateralRatio(address(this))) revert(\"collateralRatio is Below safeCollateralRatio\");\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/niser93-Q.md", "collected_at": "2026-01-02T18:23:13.582990+00:00", "source_hash": "f9ab8530f70d5458b7f8c7d0bf4224722bb70013723be03a8cfde54007968567", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 112, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: EUSDMiningIncentives.sol\n\n \n 189 return (stakedLBRLpValue(user) * 10000) / stakedOf(user) < 500;", "primary_code_language": "unknown", "primary_code_char_count": 112, "all_code_blocks": "// Code block 1 (unknown):\nFile: EUSDMiningIncentives.sol\n\n \n 189 return (stakedLBRLpValue(user) * 10000) / stakedOf(user) < 500;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "EUSDMiningIncentives.sol#L189", "github_files_list": "EUSDMiningIncentives.sol", "github_refs_count": 1, "vulnerable_code_actual": "File: EUSDMiningIncentives.sol\n\n \n 189 return (stakedLBRLpValue(user) * 10000) / stakedOf(user) < 500;\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: LybraEUSDVaultBase.sol\n\n \n 156 uint256 onBehalfOfCollateralRatio = (depositedAsset[onBehalfOf] * assetPrice * 100) / borrowed[onBehalfOf];\n\n \n 190 uint256 onBehalfOfCollateralRatio = (depositedAsset[onBehalfOf] * assetPrice * 100) / borrowed[onBehalfOf];\n\n \n 236 uint256 providerCollateralRatio = (depositedAsset[provider] * assetPrice * 100) / borrowed[provider];\n\n \n 292 if (((depositedAsset[_user] * _assetPrice * 100) / borrowed[_user]) < configurator.getSafeCollateralRatio(address(this))) revert(\"collateralRatio is Below safeCollateralRatio\");\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "09-ondo", "title": "marcobesier G", "severity_raw": "Critical", "severity": "critical", "description": "| No. | Issue | Instances |\n|---------|----------|-----------|\n|[G-01]| `++nonce` costs less gas than `nonce++` |1|\n|[G-02]| Deploying `private` state variables costs less gas than deploying `public` state variables | 7 |\n\n\n\n## [G-01] `++nonce` costs less gas than `nonce++`\n\n### Instances\n\n[SourceBridge.sol/#L79](https://github.com/code-423n4/2023-09-ondo/blob/main/contracts/bridge/SourceBridge.sol#L79)\n```solidity\nbytes memory payload = abi.encode(VERSION, msg.sender, amount, nonce++);\n```\n\n### Issue\n\n`++i` (pre-increment) costs less gas than `i++` (post-increment). The reason is that `i++` increments the value of `i` but returns the original value. This means the EVM needs to temporarily store the original value before incrementing `i`. In the case of `++i`, however, the EVM can increment the value of `i` right away and simply return the incremented value; no need for temporary storage.\n\nSo, roughly speaking, the EVM will operate as follows:\n\n`i++`:\n1. Store the current value of `i` temporarily.\n2. Increment `i`.\n3. Return the stored (original) value.\n\n`++i`:\n1. Increment `i`.\n2. Return the new value of `i`.\n\nIn particular, this means that pre- and post-increment are generally *not* equivalent operations. For example, doing\n\n```solidity\ni = 0;\narray[i++];\n```\n\nwill increment `i` by 1 but access the array at index 0. On the contrary, using `array[++i]` will increment `i` by 1, too, but access the array at index 1.\n\nSo, depending on the context, one *cannot* always replace `i++` with `++i` to save gas without changing the contract's logic.\n\n### Recommendation\n\nIn the context of this project, the post-increment is exclusively used for the `nonce` whose only purpose is to ensure a unique `payload`. In particular, whether the `nonce`s start at 0 (using `nonce++`) or at 1 (using `++nonce`) isn't relevant. In either case, the `payload` is going to be unique. For this reason, I suggest the following change:\n\n[SourceBridge.sol/#L79](https://github.com/code-423n4/202", "vulnerable_code": "bytes memory payload = abi.encode(VERSION, msg.sender, amount, nonce++);", "fixed_code": "i = 0;\narray[i++];", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/marcobesier-G.md", "collected_at": "2026-01-02T18:26:05.019638+00:00", "source_hash": "f9b256394be5d22288974c4a4b8b7b6e40fd4270f7dd18f24bf3aa06c596f35c", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 90, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "bytes memory payload = abi.encode(VERSION, msg.sender, amount, nonce++);", "primary_code_language": "solidity", "primary_code_char_count": 72, "all_code_blocks": "// Code block 1 (solidity):\nbytes memory payload = abi.encode(VERSION, msg.sender, amount, nonce++);\n\n// Code block 2 (solidity):\ni = 0;\narray[i++];", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "bytes memory payload = abi.encode(VERSION, msg.sender, amount, nonce++);\n\ni = 0;\narray[i++];", "github_refs_formatted": "SourceBridge.sol#L79", "github_files_list": "SourceBridge.sol", "github_refs_count": 1, "vulnerable_code_actual": "bytes memory payload = abi.encode(VERSION, msg.sender, amount, nonce++);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "i = 0;\narray[i++];", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-biconomy", "title": "Aymen0909 Q", "severity_raw": "Critical", "severity": "critical", "description": "\n# QA Report\n\n## Summary\n\n| | Issue | Risk | Instances |\n| :-------------: |:-------------|:-------------:|:-------------:|\n| 1 | Redundant if check in the `init` function can be removed | NC | 1 |\n| 2 | Named return variables not used anywhere in the functions | NC | 2 |\n| 3 | Non-assembly method available | NC | 1 |\n\n\n## Findings\n\n### 1- Redundant if check in the `init` function can be removed :\n\n### Risk : NON CRITICAL\n\nIn the `init` function from the `SmartAccount` the following check is redundant :\n\nFile: SmartAccount.sol [Line 174](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L174)\n```\nif (_handler != address(0)) internalSetFallbackHandler(_handler);\n```\n\nBecause the check [line 171](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol#L171) ensures that we always have `_handler != address(0)` and so the `internalSetFallbackHandler` should be called immediatly and the if statement should be removed.\n\n\n### 2- Named return variables not used anywhere in the function :\n\nWhen Named return variable are declared they should be used inside the function instead of the return statement or if not they should be removed to avoid confusion.\n\n### Risk : NON CRITICAL\n\n### Proof of Concept\nInstances include:\n\nFile: aa-4337/core/StakeManager.sol [Line 18](https://github.com/code-423n4/2023-01-biconomy/blob/main/scw-contracts/contracts/smart-contract-wallet/aa-4337/core/StakeManager.sol#L18)\n```\nreturns (DepositInfo memory info)\n```\n\n### Mitigation\n\nEither use the named return variables inplace of the return statement or remove them.\n\n### 3- Non-assembly method available :\n\n`
.code.length` can be used in Solidity `>= 0.8.0` to access an account\u2019s code size and check if it is a contract without inline assembly.\n\n### Risk : NON CRITICAL\n\n### Proof of Concept\n\nThere is 1 instance of this issue :\n", "vulnerable_code": "if (_handler != address(0)) internalSetFallbackHandler(_handler);", "fixed_code": "returns (DepositInfo memory info)", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/Aymen0909-Q.md", "collected_at": "2026-01-02T18:12:55.362207+00:00", "source_hash": "f9ef7604d8fa4f6824797eb907cde644df7291471aeb9435c1a48ca041935833", "code_block_count": 2, "solidity_block_count": 0, "total_code_chars": 98, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "if (_handler != address(0)) internalSetFallbackHandler(_handler);", "primary_code_language": "unknown", "primary_code_char_count": 65, "all_code_blocks": "// Code block 1 (unknown):\nif (_handler != address(0)) internalSetFallbackHandler(_handler);\n\n// Code block 2 (unknown):\nreturns (DepositInfo memory info)", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "SmartAccount.sol#L174, SmartAccount.sol#L171, StakeManager.sol#L18", "github_files_list": "SmartAccount.sol, StakeManager.sol", "github_refs_count": 3, "vulnerable_code_actual": "if (_handler != address(0)) internalSetFallbackHandler(_handler);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "returns (DepositInfo memory info)", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-salty", "title": "HALITUS Q", "severity_raw": "Low", "severity": "low", "description": "# Reserve1 is unchecked in Pools.removeLiquidity()\n\nSeverity: LOW\n\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/pools/Pools.sol#L187\n\n## Vulnerability\nAs shown below, `reserves.reserve0 >= PoolUtils.DUST` is checked twice. One of the conditions should be `reserves.reserve1 >= PoolUtils.DUST`.\n\n```solidity\nfunction removeLiquidity() {\n.\n.\n // Make sure that removing liquidity doesn't drive either of the reserves below DUST.\n // This is to ensure that ratios remain relatively constant even after a maximum withdrawal.\n require(\n (reserves.reserve0 >= PoolUtils.DUST) && (reserves.reserve0 >= PoolUtils.DUST),\n 'Insufficient reserves after liquidity removal'\n );\n.\n.\n}\n```", "vulnerable_code": "function removeLiquidity() {\n.\n.\n // Make sure that removing liquidity doesn't drive either of the reserves below DUST.\n // This is to ensure that ratios remain relatively constant even after a maximum withdrawal.\n require(\n (reserves.reserve0 >= PoolUtils.DUST) && (reserves.reserve0 >= PoolUtils.DUST),\n 'Insufficient reserves after liquidity removal'\n );\n.\n.\n}", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/HALITUS-Q.md", "collected_at": "2026-01-02T19:01:16.977549+00:00", "source_hash": "fa099c650aa1cac1759fe47fe5daaaaf7ec730084b0df905f2a570dd61979d42", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 385, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "function removeLiquidity() {\n.\n.\n // Make sure that removing liquidity doesn't drive either of the reserves below DUST.\n // This is to ensure that ratios remain relatively constant even after a maximum withdrawal.\n require(\n (reserves.reserve0 >= PoolUtils.DUST) && (reserves.reserve0 >= PoolUtils.DUST),\n 'Insufficient reserves after liquidity removal'\n );\n.\n.\n}", "primary_code_language": "solidity", "primary_code_char_count": 385, "all_code_blocks": "// Code block 1 (solidity):\nfunction removeLiquidity() {\n.\n.\n // Make sure that removing liquidity doesn't drive either of the reserves below DUST.\n // This is to ensure that ratios remain relatively constant even after a maximum withdrawal.\n require(\n (reserves.reserve0 >= PoolUtils.DUST) && (reserves.reserve0 >= PoolUtils.DUST),\n 'Insufficient reserves after liquidity removal'\n );\n.\n.\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function removeLiquidity() {\n.\n.\n // Make sure that removing liquidity doesn't drive either of the reserves below DUST.\n // This is to ensure that ratios remain relatively constant even after a maximum withdrawal.\n require(\n (reserves.reserve0 >= PoolUtils.DUST) && (reserves.reserve0 >= PoolUtils.DUST),\n 'Insufficient reserves after liquidity removal'\n );\n.\n.\n}", "github_refs_formatted": "Pools.sol#L187", "github_files_list": "Pools.sol", "github_refs_count": 1, "vulnerable_code_actual": "function removeLiquidity() {\n.\n.\n // Make sure that removing liquidity doesn't drive either of the reserves below DUST.\n // This is to ensure that ratios remain relatively constant even after a maximum withdrawal.\n require(\n (reserves.reserve0 >= PoolUtils.DUST) && (reserves.reserve0 >= PoolUtils.DUST),\n 'Insufficient reserves after liquidity removal'\n );\n.\n.\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.49} {"source": "c4", "protocol": "02-ethos", "title": "Dinesh11G Q", "severity_raw": "Low", "severity": "low", "description": "### Unspecific Compiler Version Pragma\n\n#### Impact\nIssue Information: \nAvoid floating pragmas for non-library contracts.\n\nWhile floating pragmas make sense for libraries to allow them to be included with multiple different versions of applications, it may be a security risk for application implementations.\n\nA known vulnerable compiler version may accidentally be selected or security tools might fall-back to an older compiler version ending up checking a different EVM compilation that is ultimately deployed on the blockchain.\n\nIt is recommended to pin to a concrete compiler version.\n\nExample\n\ud83e\udd26 Bad:\n\npragma solidity ^0.8.0;\n\ud83d\ude80 Good:\n\npragma solidity 0.8.4;\n\n#### Findings:\n```\n2023-02-ethos/Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/ReaperVaultERC4626.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/ReaperVaultV2.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/abstract/ReaperBaseStrategyv4.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/IAToken.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/IAaveIncentivesController.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/IAaveProtocolDataProvider.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/IERC20Minimal.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/IERC4626Events.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/IERC4626Functions.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/IInitializableAToken.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/ILendingPool.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/ILendingPoolAddressesProvider.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interf", "vulnerable_code": "2023-02-ethos/Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/ReaperVaultERC4626.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/ReaperVaultV2.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/abstract/ReaperBaseStrategyv4.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/IAToken.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/IAaveIncentivesController.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/IAaveProtocolDataProvider.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/IERC20Minimal.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/IERC4626Events.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/IERC4626Functions.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/IInitializableAToken.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/ILendingPool.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/ILendingPoolAddressesProvider.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/IScaledBalanceToken.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/IStrategy.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/IVault.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/IVeloPair.sol::2 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/IVeloRouter.sol::2 => pragma solidity ^0.8.0;", "fixed_code": "", "recommendation": "", "category": "upgrade", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/Dinesh11G-Q.md", "collected_at": "2026-01-02T18:16:11.177692+00:00", "source_hash": "fa1c825d9cd3672890d85000958db7306bb5ed82e794d15cbefe1c2c30ed9044", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "2023-02-ethos/Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/ReaperVaultERC4626.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/ReaperVaultV2.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/abstract/ReaperBaseStrategyv4.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/IAToken.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/IAaveIncentivesController.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/IAaveProtocolDataProvider.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/IERC20Minimal.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/IERC4626Events.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/IERC4626Functions.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/IInitializableAToken.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/ILendingPool.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/ILendingPoolAddressesProvider.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/IScaledBalanceToken.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/IStrategy.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/IVault.sol::3 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/IVeloPair.sol::2 => pragma solidity ^0.8.0;\n2023-02-ethos/Ethos-Vault/contracts/interfaces/IVeloRouter.sol::2 => pragma solidity ^0.8.0;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4} {"source": "c4", "protocol": "10-badger", "title": "alix40 G", "severity_raw": "Gas", "severity": "gas", "description": "On line 404, in file SortedCdps.sol\n[link](https://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/SortedCdps.sol#L404) \n\n```solidity\ndata.size = data.size + 1;\n``` \n\nCould be changed to:\n\n```solidity\ndata.size++\n```\nThis could save gas, and due to the insert function, being used a lot this could reduce gas costs significantly long term\n\n\nThe same Issue is also found on line 489 in file SortedCdps.sol\n[link](https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/SortedCdps.sol#L489C1-L490C1)\n\n```solidity\ndata.size = data.size - 1;\n```\ncould be changed to:\n\n```solidity\ndata.size--\n```\n\n", "vulnerable_code": "data.size = data.size + 1;", "fixed_code": "data.size++", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/alix40-G.md", "collected_at": "2026-01-02T18:26:41.940559+00:00", "source_hash": "fa21a9a7144ced2eada08494496dfaeb7e3e81c22d9475109c1f588730074332", "code_block_count": 4, "solidity_block_count": 4, "total_code_chars": 74, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "data.size = data.size + 1;", "primary_code_language": "solidity", "primary_code_char_count": 26, "all_code_blocks": "// Code block 1 (solidity):\ndata.size = data.size + 1;\n\n// Code block 2 (solidity):\ndata.size++\n\n// Code block 3 (solidity):\ndata.size = data.size - 1;\n\n// Code block 4 (solidity):\ndata.size--", "all_code_blocks_count": 4, "has_diff_blocks": false, "diff_code": "", "solidity_code": "data.size = data.size + 1;\n\ndata.size++\n\ndata.size = data.size - 1;\n\ndata.size--", "github_refs_formatted": "SortedCdps.sol#L404, SortedCdps.sol#L489-L1", "github_files_list": "SortedCdps.sol", "github_refs_count": 2, "vulnerable_code_actual": "data.size = data.size + 1;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "data.size++", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8.37} {"source": "c4", "protocol": "01-ondo", "title": "gzeon Q", "severity_raw": "Critical", "severity": "critical", "description": "## Low\n\n### KYC can be removed while user still have fund in the protocol\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/cash/kyc/KYCRegistry.sol#L169-L184\n\n```solidity\n /**\n * @notice Remove addresses from KYC list\n *\n * @param kycRequirementGroup KYC group associated with `addresses`\n * @param addresses List of addresses to revoke KYC'd status\n */\n function removeKYCAddresses(\n uint256 kycRequirementGroup,\n address[] calldata addresses\n ) external onlyRole(kycGroupRoles[kycRequirementGroup]) {\n uint256 length = addresses.length;\n for (uint256 i = 0; i < length; i++) {\n kycState[kycRequirementGroup][addresses[i]] = false;\n }\n emit KYCAddressesRemoved(msg.sender, kycRequirementGroup, addresses);\n }\n```\n\nSince function like claimMint and transfer require KYC, user fund might be stuck\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/cash/CashManager.sol#L241-L244\n\n```solidity\n function claimMint(\n address user,\n uint256 epochToClaim\n ) external override updateEpoch nonReentrant whenNotPaused checkKYC(user) {\n```\n\n## Non-Critical\n\n### KYCRegistry does not check if address is already in the list\n\nIt is possible to add an already existing address or remove a non-existing address, emitting confusing events.\n\nhttps://github.com/code-423n4/2023-01-ondo/blob/f3426e5b6b4561e09460b2e6471eb694efdd6c70/contracts/cash/kyc/KYCRegistry.sol#L152-L184\n\n```solidity\n /**\n * @notice Add addresses to KYC list for specified `kycRequirementGroup`\n *\n * @param kycRequirementGroup KYC group associated with `addresses`\n * @param addresses List of addresses to grant KYC'd status\n */\n function addKYCAddresses(\n uint256 kycRequirementGroup,\n address[] calldata addresses\n ) external onlyRole(kycGroupRoles[kycRequirementGroup]) {\n uint256 length = addresses.length;\n for (uint256 i = 0; i < length; i++) {\n ", "vulnerable_code": " /**\n * @notice Remove addresses from KYC list\n *\n * @param kycRequirementGroup KYC group associated with `addresses`\n * @param addresses List of addresses to revoke KYC'd status\n */\n function removeKYCAddresses(\n uint256 kycRequirementGroup,\n address[] calldata addresses\n ) external onlyRole(kycGroupRoles[kycRequirementGroup]) {\n uint256 length = addresses.length;\n for (uint256 i = 0; i < length; i++) {\n kycState[kycRequirementGroup][addresses[i]] = false;\n }\n emit KYCAddressesRemoved(msg.sender, kycRequirementGroup, addresses);\n }", "fixed_code": " function claimMint(\n address user,\n uint256 epochToClaim\n ) external override updateEpoch nonReentrant whenNotPaused checkKYC(user) {", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/gzeon-Q.md", "collected_at": "2026-01-02T18:15:12.038118+00:00", "source_hash": "fa5f71d8e48ae9e64a66c24878182e7be899cdf0e413bb926b32ebfc777b8aa0", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 723, "github_ref_count": 3, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "/**\n * @notice Remove addresses from KYC list\n *\n * @param kycRequirementGroup KYC group associated with `addresses`\n * @param addresses List of addresses to revoke KYC'd status\n */\n function removeKYCAddresses(\n uint256 kycRequirementGroup,\n address[] calldata addresses\n ) external onlyRole(kycGroupRoles[kycRequirementGroup]) {\n uint256 length = addresses.length;\n for (uint256 i = 0; i < length; i++) {\n kycState[kycRequirementGroup][addresses[i]] = false;\n }\n emit KYCAddressesRemoved(msg.sender, kycRequirementGroup, addresses);\n }", "primary_code_language": "solidity", "primary_code_char_count": 583, "all_code_blocks": "// Code block 1 (solidity):\n/**\n * @notice Remove addresses from KYC list\n *\n * @param kycRequirementGroup KYC group associated with `addresses`\n * @param addresses List of addresses to revoke KYC'd status\n */\n function removeKYCAddresses(\n uint256 kycRequirementGroup,\n address[] calldata addresses\n ) external onlyRole(kycGroupRoles[kycRequirementGroup]) {\n uint256 length = addresses.length;\n for (uint256 i = 0; i < length; i++) {\n kycState[kycRequirementGroup][addresses[i]] = false;\n }\n emit KYCAddressesRemoved(msg.sender, kycRequirementGroup, addresses);\n }\n\n// Code block 2 (solidity):\nfunction claimMint(\n address user,\n uint256 epochToClaim\n ) external override updateEpoch nonReentrant whenNotPaused checkKYC(user) {", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "/**\n * @notice Remove addresses from KYC list\n *\n * @param kycRequirementGroup KYC group associated with `addresses`\n * @param addresses List of addresses to revoke KYC'd status\n */\n function removeKYCAddresses(\n uint256 kycRequirementGroup,\n address[] calldata addresses\n ) external onlyRole(kycGroupRoles[kycRequirementGroup]) {\n uint256 length = addresses.length;\n for (uint256 i = 0; i < length; i++) {\n kycState[kycRequirementGroup][addresses[i]] = false;\n }\n emit KYCAddressesRemoved(msg.sender, kycRequirementGroup, addresses);\n }\n\nfunction claimMint(\n address user,\n uint256 epochToClaim\n ) external override updateEpoch nonReentrant whenNotPaused checkKYC(user) {", "github_refs_formatted": "KYCRegistry.sol#L169-L184, CashManager.sol#L241-L244, KYCRegistry.sol#L152-L184", "github_files_list": "CashManager.sol, KYCRegistry.sol", "github_refs_count": 3, "vulnerable_code_actual": " /**\n * @notice Remove addresses from KYC list\n *\n * @param kycRequirementGroup KYC group associated with `addresses`\n * @param addresses List of addresses to revoke KYC'd status\n */\n function removeKYCAddresses(\n uint256 kycRequirementGroup,\n address[] calldata addresses\n ) external onlyRole(kycGroupRoles[kycRequirementGroup]) {\n uint256 length = addresses.length;\n for (uint256 i = 0; i < length; i++) {\n kycState[kycRequirementGroup][addresses[i]] = false;\n }\n emit KYCAddressesRemoved(msg.sender, kycRequirementGroup, addresses);\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function claimMint(\n address user,\n uint256 epochToClaim\n ) external override updateEpoch nonReentrant whenNotPaused checkKYC(user) {", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "09-ondo", "title": "Bube Q", "severity_raw": "Low", "severity": "low", "description": "low[01]\nThe Daily Interest Rate is not validated\n\nThe contract `RWADynamicOracle.sol` does not validate the input parameter `dailyIR` (daily interest rate)\nin constructor, which is used in `simulateRange` function. This could lead to incorrect price calculations if it set improperly.\n\nThere is 1 instance of this issue:\n\nFile: contracts/rwaOracles/RWADynamicOracle.sol:\n\n```\nconstructor(\n address admin,\n address setter,\n address pauser,\n uint256 firstRangeStart,\n uint256 firstRangeEnd,\n uint256 dailyIR,\n uint256 startPrice\n ) {\n _grantRole(DEFAULT_ADMIN_ROLE, admin);\n _grantRole(PAUSER_ROLE, pauser);\n _grantRole(SETTER_ROLE, setter);\n\n if (firstRangeStart >= firstRangeEnd) revert InvalidRange();\n uint256 trueStart = (startPrice * ONE) / dailyIR;\n ranges.push(Range(firstRangeStart, firstRangeEnd, dailyIR, trueStart));\n }\n```\nhttps://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/rwaOracles/RWADynamicOracle.sol#L30-L46\n\nAdd checks to ensure that the dailyIR is within an expected range to prevent any potential issues.", "vulnerable_code": "constructor(\n address admin,\n address setter,\n address pauser,\n uint256 firstRangeStart,\n uint256 firstRangeEnd,\n uint256 dailyIR,\n uint256 startPrice\n ) {\n _grantRole(DEFAULT_ADMIN_ROLE, admin);\n _grantRole(PAUSER_ROLE, pauser);\n _grantRole(SETTER_ROLE, setter);\n\n if (firstRangeStart >= firstRangeEnd) revert InvalidRange();\n uint256 trueStart = (startPrice * ONE) / dailyIR;\n ranges.push(Range(firstRangeStart, firstRangeEnd, dailyIR, trueStart));\n }", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/Bube-Q.md", "collected_at": "2026-01-02T18:25:25.961569+00:00", "source_hash": "fb7759db306e41ac90ab3400b174a1a65972fc004f3657b1e8093a86e4c63229", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 494, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "constructor(\n address admin,\n address setter,\n address pauser,\n uint256 firstRangeStart,\n uint256 firstRangeEnd,\n uint256 dailyIR,\n uint256 startPrice\n ) {\n _grantRole(DEFAULT_ADMIN_ROLE, admin);\n _grantRole(PAUSER_ROLE, pauser);\n _grantRole(SETTER_ROLE, setter);\n\n if (firstRangeStart >= firstRangeEnd) revert InvalidRange();\n uint256 trueStart = (startPrice * ONE) / dailyIR;\n ranges.push(Range(firstRangeStart, firstRangeEnd, dailyIR, trueStart));\n }", "primary_code_language": "unknown", "primary_code_char_count": 494, "all_code_blocks": "// Code block 1 (unknown):\nconstructor(\n address admin,\n address setter,\n address pauser,\n uint256 firstRangeStart,\n uint256 firstRangeEnd,\n uint256 dailyIR,\n uint256 startPrice\n ) {\n _grantRole(DEFAULT_ADMIN_ROLE, admin);\n _grantRole(PAUSER_ROLE, pauser);\n _grantRole(SETTER_ROLE, setter);\n\n if (firstRangeStart >= firstRangeEnd) revert InvalidRange();\n uint256 trueStart = (startPrice * ONE) / dailyIR;\n ranges.push(Range(firstRangeStart, firstRangeEnd, dailyIR, trueStart));\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "RWADynamicOracle.sol#L30-L46", "github_files_list": "RWADynamicOracle.sol", "github_refs_count": 1, "vulnerable_code_actual": "constructor(\n address admin,\n address setter,\n address pauser,\n uint256 firstRangeStart,\n uint256 firstRangeEnd,\n uint256 dailyIR,\n uint256 startPrice\n ) {\n _grantRole(DEFAULT_ADMIN_ROLE, admin);\n _grantRole(PAUSER_ROLE, pauser);\n _grantRole(SETTER_ROLE, setter);\n\n if (firstRangeStart >= firstRangeEnd) revert InvalidRange();\n uint256 trueStart = (startPrice * ONE) / dailyIR;\n ranges.push(Range(firstRangeStart, firstRangeEnd, dailyIR, trueStart));\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5.23} {"source": "c4", "protocol": "08-dopex", "title": "0x6980 Q", "severity_raw": "Critical", "severity": "critical", "description": "# Report\n\n## Non-critical Issues\n\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [N-01](#N-01) | Adding a `return` statement when the function defines a named return variable, is redundant | 8 | \n| [N-02](#N-02) | No need for `== true` or `== false` checks | 1 | \n| [N-03](#N-03) | `constant` variable names should use capital letters and underscore | 3 | \n| [N-04](#N-04) | Do not calculate constants | 11 | \n| [N-05](#N-05) | Empty Function Body - Consider commenting why | 1 | \n| [N-06](#N-06) | Empty `bytes` check is missing | 4 | \n| [N-07](#N-07) | Function definition modifier order does not follow Solidity style guide | 3 | \n| [N-08](#N-08) | Hardcoded `address` should be avoided | 3 | \n| [N-09](#N-09) | Inconsistent spacing in comments | 5 | \n| [N-10](#N-10) | Don't initialize `uint`s and `int`s with zero | 10 | \n| [N-11](#N-11) | State variable declaration should include NatSpec documentation | 17 | \n| [N-12](#N-12) | Contracts are not using their OZ Upgradeable counterparts | 9 | \n| [N-13](#N-13) | Two or more functions contain the same code | 34 | \n| [N-14](#N-14) | Unused contract variables | 3 | \n| [N-15](#N-15) | Unused named `return` | 7 | \n| [N-16](#N-16) | Unused parameter | 1 | \n| [N-17](#N-17) | Use `delete` instead of assigning values to `false` | 1 | \n| [N-18](#N-18) | Use named function calls | 2 | \n| [N-19](#N-19) | Use a single file for system wide constants | 14 | \n| [N-20](#N-20) | `uint` variables should have the bit size defined explicitly | 1 | \n| [N-21](#N-21) | Whitespace in Expressions | 11 |\n\nTotal: 1,241 instances over 78 issues.\n\n## Non-critical Issues\n\n### [N-01] Adding a `return` statement when the function defines a named return variable, is redundant\nOnce the return variable has been assigned (or has its default value), there is no need to explicitly return it at the end of the function, since it's returned automatically\n\n*Instances (8)*:\n
\nsee instances\n\n\n```solidity\nFile: contracts/core/RdpxV2Core.s", "vulnerable_code": "File: contracts/core/RdpxV2Core.sol\n\n884: return (receiptTokenAmount, delegateReceiptTokenAmounts);\n\n1217: return\n\n1228: return\n\n1273: return (\n", "fixed_code": "File: contracts/perp-vault/PerpetualAtlanticVault.sol\n\n568: return genesis + (latestFundingPaymentPointer * fundingDuration);\n\n579: return _strike;\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/0x6980-Q.md", "collected_at": "2026-01-02T18:24:12.784258+00:00", "source_hash": "fb95e3eae47c0ec9d2eada75f16e3aa92dd059ec7f504a1659793c9f825b6639", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: contracts/core/RdpxV2Core.sol\n\n884: return (receiptTokenAmount, delegateReceiptTokenAmounts);\n\n1217: return\n\n1228: return\n\n1273: return (\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/perp-vault/PerpetualAtlanticVault.sol\n\n568: return genesis + (latestFundingPaymentPointer * fundingDuration);\n\n579: return _strike;\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-ondo", "title": "cthulhu_cult G", "severity_raw": "Medium", "severity": "medium", "description": "# Gas-Report\n\n| | Issue | Instances |\n| ------------------------------------------------------------------------------ | :-------------------------------------------------------------- | :-------: |\n| [GAS-1](#gas-1-consider-using-ir-cogen-compiler-pipeline-for-gas-optimization) | Consider using IR Codgen compiler pipeline for gas optimization | N/A |\n| [GAS-2](#gas-2-declare-constructor-as-payable) | Declare Constructor as payable. | 18 |\n| [GAS-3](#-gas-3-function-modifiers-can-be-inefficient) | Function modifiers can be inefficient | 1 |\n| [GAS-4](#gas-4-the-increment-in-for-loop-post-condition-can-be-made-unchecked) | The increment in for loop post condition can be made unchecked | 9 |\n\n---\n## GAS-1: Consider using IR Cogen compiler pipeline for gas optimization\n- Description: The IR-based code generator was introduced with an aim to not only allow code generation to be more transparent and auditable but also to enable more powerful optimization passes that span across functions. Enabling {viaIR: true} in the compiler settings will enable the IR-based code generator. This will allow the compiler to use more powerful optimization passes that span across functions. The gas savings will be in the range of 5-10%.\n- Caution: If you use via-ir use the latest compiler version 0.8.17: (The compiler version 0.8.17 has a fix for a bug in the code generator that could lead to the code generator producing invalid code for certain contracts. This bug was introduced in version 0.8.16 and fixed in version 0.8.17.)\n- Location: Project Wide\n\n---\n## GAS-2: Declare Constructor as payable.\n- Description: You eliminate the payable check in the init code fragment Thereby reducing deployment byte code thus ga", "vulnerable_code": "// Before\n\n modifier onlyGuardian() {\n require(msg.sender == guardian, \"CashFactory: You are not the Guardian\");\n _;\n }", "fixed_code": "// after\n modifier onlyGuardian() {\n onlyGuardian();\n _;\n }\n\n function OnlyGuardian() internal view {\n require(msg.sender == guardian, \"CashFactory: You are not the Guardian\");\n }", "recommendation": "", "category": "overflow", "report_url": "https://github.com/code-423n4/2023-01-ondo-findings/blob/main/data/cthulhu_cult-G.md", "collected_at": "2026-01-02T18:15:03.688864+00:00", "source_hash": "fbbd97835983e7b503943a9fd83044e4b796d7e1597d1642733c36be3a2d9125", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "// Before\n\n modifier onlyGuardian() {\n require(msg.sender == guardian, \"CashFactory: You are not the Guardian\");\n _;\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "// after\n modifier onlyGuardian() {\n onlyGuardian();\n _;\n }\n\n function OnlyGuardian() internal view {\n require(msg.sender == guardian, \"CashFactory: You are not the Guardian\");\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "02-ai-arena", "title": "Silvermist Q", "severity_raw": "Low", "severity": "low", "description": "## User can sabotage `_addResultPoints`\n\n### Description\nUser can make a bot which executes `spendVoltage()` on every block.timestamp + 1 days with `voltageSpent = 100` which would make the `_addResultPoints` revert every time when the user is the initiator. \n\nOn every battle, the `updateBattleRecord` will be executed for both sides - winner and losser. However, a malisious user can sabotage the update of the points on his side nevermind win or loss. That would lead to incorrect value of the `totalAccumulatedPoints` which are used in the calculations for how much NRN tokens user can claim inside `claimNRN`. \n\n### Recommendation \nOnly `allowedVoltageSpenders` should be allowed to execute `spendVoltage()`\n\n\n## User can execute `reRoll` with different fighterType\n\n### Description\nIn `reRoll` there is an argument for the fighterType, but there is no validation if the passed value is the correct fighter type. \n\nA user can reroll his Champion fighter and pass 1 as fighterType (1 is for Dendroid) when rerolling which would lead to manupulation of the dna. If fighterType=1, the `newDna` would be 1, however it should be a hash of the msg.sender, tokenId and numRerolls[tokenId].\n\n```js\n uint256 newDna = fighterType == 0 ? dna : uint256(fighterType);\n```\n\n### Recommendation \nValidate the passed `fighterType` \n", "vulnerable_code": " uint256 newDna = fighterType == 0 ? dna : uint256(fighterType);", "fixed_code": "", "recommendation": "", "category": "validation", "report_url": "https://github.com/code-423n4/2024-02-ai-arena-findings/blob/main/data/Silvermist-Q.md", "collected_at": "2026-01-02T19:02:45.628506+00:00", "source_hash": "fbd0e71d00c797f99b67a0edb13271483190e5b3e0b2e8a08c6e6c96b9e463d4", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 63, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "uint256 newDna = fighterType == 0 ? dna : uint256(fighterType);", "primary_code_language": "js", "primary_code_char_count": 63, "all_code_blocks": "// Code block 1 (js):\nuint256 newDna = fighterType == 0 ? dna : uint256(fighterType);", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " uint256 newDna = fighterType == 0 ? dna : uint256(fighterType);", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.65} {"source": "c4", "protocol": "03-asymmetry", "title": "brevis Q", "severity_raw": "High", "severity": "high", "description": "| SN | Description |\n| --- | --- |\n| L-01 | Failure to add a storage gap variable in upgradable contracts |\n| L-02 | Unused function named parameter |\n| L-03 | Inconsistent `uint256` variables declaration |\n| L-04 | Unnecessary code run when `derivativeCount` is zero |\n| L-05 | Using floating pragma version |\n| L-06 | Use scientific notation in lieu of exponentiation |\n| L-07 | The private and internal function names don\u2019t start with an underscore |\n| L-08 | Incorrect NatSpec |\n| L-09 | Missing input param validation |\n\n## L-01. Failure to add a storage gap variable in upgradable contracts\n\n### Context\n\n[https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol)\n\n[https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol)\n\n[https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol)\n\n[https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol](https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol)\n\n### Impact\n\nPotentially, any Ethereum developer can inherit their contracts from any of the Asymmetry project contracts. However, it\u2019s worth noting, that if a contract having state variables is upgradable, and it has a child contract which declares its own state variables, in case the base contract is modified and new storage variables are added, the newly created storage slots will clash with the child\u2019s ones.\n\n### Proof of Concept\n\n**`BaseContract` version 1:**\n\n```solidity\ncontract BaseContract is OwnableUpgradeable {\n\tuint256 baseVar1;\n}\n\ncontract ChildContract is BaseContract {\n\tuint256 childVar1;\n}\n```", "vulnerable_code": "contract BaseContract is OwnableUpgradeable {\n\tuint256 baseVar1;\n}\n\ncontract ChildContract is BaseContract {\n\tuint256 childVar1;\n}", "fixed_code": "contract BaseContract is OwnableUpgradeable {\n\tuint256 baseVar1;\n\tuint256 baseVar2;\n}\n\ncontract ChildContract is BaseContract {\n\tuint256 childVar1;\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/brevis-Q.md", "collected_at": "2026-01-02T18:18:51.721752+00:00", "source_hash": "fc1fe71f9d6b4ab8b85ff42a949614a98c188c44076d02d81a384c4babcbdd22", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 130, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "contract BaseContract is OwnableUpgradeable {\n\tuint256 baseVar1;\n}\n\ncontract ChildContract is BaseContract {\n\tuint256 childVar1;\n}", "primary_code_language": "solidity", "primary_code_char_count": 130, "all_code_blocks": "// Code block 1 (solidity):\ncontract BaseContract is OwnableUpgradeable {\n\tuint256 baseVar1;\n}\n\ncontract ChildContract is BaseContract {\n\tuint256 childVar1;\n}", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "contract BaseContract is OwnableUpgradeable {\n\tuint256 baseVar1;\n}\n\ncontract ChildContract is BaseContract {\n\tuint256 childVar1;\n}", "github_refs_formatted": "SafEth.sol, Reth.sol, SfrxEth.sol, WstEth.sol", "github_files_list": "SfrxEth.sol, Reth.sol, WstEth.sol, SafEth.sol", "github_refs_count": 4, "vulnerable_code_actual": "contract BaseContract is OwnableUpgradeable {\n\tuint256 baseVar1;\n}\n\ncontract ChildContract is BaseContract {\n\tuint256 childVar1;\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "contract BaseContract is OwnableUpgradeable {\n\tuint256 baseVar1;\n\tuint256 baseVar2;\n}\n\ncontract ChildContract is BaseContract {\n\tuint256 childVar1;\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "08-dopex", "title": "Strk7 Q", "severity_raw": "Medium", "severity": "medium", "description": "# Hardcoded strings to reference mapping values\n\n## Impact\nL-01: The use of magic numbers and hardcoded strings is spread out in several contracts, making it error-prone.\nIn RdpxV2Core.sol:657, the usage of magic numbers and hardcoded strings in several places. This can lead to potential issues and make the code difficult to maintain and understand.\n\nTools Used\nManual Review\n\n## Mitigation\nTo mitigate this issue, it is recommended to replace the magic numbers and hardcoded strings with constants that are named in a way that clearly expresses their intended use. For example:\n\n```solidity\nstring constant public RESERVE_INDEX_RDPX = \"RDPX\";\n```\nBy using constants like RESERVE_INDEX_RDPX, the code becomes more readable and less error-prone. The constant can be used to reference the item in the reservesIndex mapping, as shown in the code snippet.\n\n```solidity\nIERC20WithBurn(reserveAsset[reservesIndex[RESERVE_INDEX_RDPX]].tokenAddress).burn(\n (_rdpxAmount * rdpxBurnPercentage) / 1e10\n);\n```\nThis improves code maintainability and reduces the risk of introducing bugs due to the use of magic numbers and hardcoded strings.\n\n\n# Magic Numbers Usage in Funding Rate Calculation\n\n## Impact\nIn `PerpetualAtlanticVault.sol:527`, the contract uses magic numbers to calculate the funding rate. This can lead to potential errors and make the code less maintainable.\n\n## Proof of Concept\nThe vulnerability can be observed in the following code snippet from the contract:\n\n```solidity\nfunction _updateFundingRate(uint256 amount) private {\n if (fundingRates[latestFundingPaymentPointer] == 0) {\n uint256 startTime;\n if (lastUpdateTime > nextFundingPaymentTimestamp() - fundingDuration) {\n startTime = lastUpdateTime;\n } else {\n startTime = nextFundingPaymentTimestamp() - fundingDuration;\n }\n uint256 endTime = nextFundingPaymentTimestamp();\n fundingRates[latestFundingPaymentPointer] = (amount * 1e18) / (endTime - startTime); // @au", "vulnerable_code": "string constant public RESERVE_INDEX_RDPX = \"RDPX\";", "fixed_code": "IERC20WithBurn(reserveAsset[reservesIndex[RESERVE_INDEX_RDPX]].tokenAddress).burn(\n (_rdpxAmount * rdpxBurnPercentage) / 1e10\n);", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/Strk7-Q.md", "collected_at": "2026-01-02T18:25:07.671042+00:00", "source_hash": "fca3cf9584c10252aa67f131b651b91f0b4ba6fe12bc9f3a54b04dc1c794aa5e", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 182, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "string constant public RESERVE_INDEX_RDPX = \"RDPX\";", "primary_code_language": "solidity", "primary_code_char_count": 51, "all_code_blocks": "// Code block 1 (solidity):\nstring constant public RESERVE_INDEX_RDPX = \"RDPX\";\n\n// Code block 2 (solidity):\nIERC20WithBurn(reserveAsset[reservesIndex[RESERVE_INDEX_RDPX]].tokenAddress).burn(\n (_rdpxAmount * rdpxBurnPercentage) / 1e10\n);", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "string constant public RESERVE_INDEX_RDPX = \"RDPX\";\n\nIERC20WithBurn(reserveAsset[reservesIndex[RESERVE_INDEX_RDPX]].tokenAddress).burn(\n (_rdpxAmount * rdpxBurnPercentage) / 1e10\n);", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "string constant public RESERVE_INDEX_RDPX = \"RDPX\";", "has_vulnerable_code_snippet": true, "fixed_code_actual": "IERC20WithBurn(reserveAsset[reservesIndex[RESERVE_INDEX_RDPX]].tokenAddress).burn(\n (_rdpxAmount * rdpxBurnPercentage) / 1e10\n);", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "03-asymmetry", "title": "helios Q", "severity_raw": "High", "severity": "high", "description": "# 1. Reentrancy Vulnerability in SafEth Contract's `unstake` function\n~ The `SafEth` contract may be vulnerable to reentrancy attacks due to the order of operations in the `unstake` function. An attacker can potentially call a malicious fallback function in an external contract and repeatedly withdraw funds from the `SafEth` contract before the balance is updated, leading to loss of funds.\n\nAn attacker could potentially steal all funds from the contract leading to significant financial losses for both the contract owner and any users who have staked their `ETH`.\n\n~ Recommended Mitigation Steps: To prevent reentrancy attacks, it is recommended to perform state updates before calling external contracts. In the `unstake` function, the `_burn` statement should be called before withdrawing funds from the derivative contracts. This ensures that the attacker cannot repeatedly withdraw funds before the `_burn` statement updates the balance of the user's account in the `SafEth` contract.\ne.g:\n```\nfunction unstake(uint256 _safEthAmount) external {\n require(pauseUnstaking == false, \"unstaking is paused\");\n uint256 safEthTotalSupply = totalSupply();\n uint256 ethAmountBefore = address(this).balance;\n \n // update state first\n _burn(msg.sender, _safEthAmount);\n \n for (uint256 i = 0; i < derivativeCount; i++) {\n // withdraw a percentage of each asset based on the amount of safETH\n uint256 derivativeAmount = (derivatives[i].balance() *\n _safEthAmount) / safEthTotalSupply;\n if (derivativeAmount == 0) continue; // if derivative empty ignore\n derivatives[i].withdraw(derivativeAmount);\n }\n \n uint256 ethAmountAfter = address(this).balance;\n uint256 ethAmountToWithdraw = ethAmountAfter - ethAmountBefore;\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: ethAmountToWithdraw}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n emit Unstaked(msg.sender, ethAmountToWithd", "vulnerable_code": "function unstake(uint256 _safEthAmount) external {\n require(pauseUnstaking == false, \"unstaking is paused\");\n uint256 safEthTotalSupply = totalSupply();\n uint256 ethAmountBefore = address(this).balance;\n \n // update state first\n _burn(msg.sender, _safEthAmount);\n \n for (uint256 i = 0; i < derivativeCount; i++) {\n // withdraw a percentage of each asset based on the amount of safETH\n uint256 derivativeAmount = (derivatives[i].balance() *\n _safEthAmount) / safEthTotalSupply;\n if (derivativeAmount == 0) continue; // if derivative empty ignore\n derivatives[i].withdraw(derivativeAmount);\n }\n \n uint256 ethAmountAfter = address(this).balance;\n uint256 ethAmountToWithdraw = ethAmountAfter - ethAmountBefore;\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: ethAmountToWithdraw}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n emit Unstaked(msg.sender, ethAmountToWithdraw, _safEthAmount);\n}", "fixed_code": " function stake() external payable {\n require(pauseStaking == false, \"staking is paused\");\n require(msg.value >= minAmount, \"amount too low\");\n require(msg.value <= maxAmount, \"amount too high\");\n\n uint256 underlyingValue = 0;\n\n // Getting underlying value in terms of ETH for each derivative\n for (uint i = 0; i < derivativeCount; i++)\n underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;\n\n uint256 totalSupply = totalSupply();\n uint256 totalStakeValueEth = 0; // total amount of derivatives worth of ETH in system\n for (uint i = 0; i < derivativeCount; i++) {\n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight == 0) continue;\n uint256 ethAmount = (msg.value * weight) / totalWeight;\n\n // This is slightly less than ethAmount because slippage\n uint256 depositAmount = derivative.deposit{value: ethAmount}();\n uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n depositAmount\n ) * depositAmount) / 10 ** 18;\n totalStakeValueEth += derivativeReceivedEthValue;\n }\n uint256 preDepositPrice; // Price of safETH in regards to ETH\n if (totalSupply == 0)\n preDepositPrice = 10 ** 18; // initializes with a price of 1\n else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n \n // mintAmount represents a percentage of the total assets in the system\n uint256 mintAmount = (totalStakeValueEth * 10 ** 18) / preDepositPrice;\n _mint(msg.sender, mintAmount);\n emit Staked(msg.sender, msg.value, mintAmount);\n}", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/helios-Q.md", "collected_at": "2026-01-02T18:19:11.104875+00:00", "source_hash": "fcb94b1dd53d618a78df1a7008f8ce99f611c3d1638133bd9f5a77a983a89559", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "function unstake(uint256 _safEthAmount) external {\n require(pauseUnstaking == false, \"unstaking is paused\");\n uint256 safEthTotalSupply = totalSupply();\n uint256 ethAmountBefore = address(this).balance;\n \n // update state first\n _burn(msg.sender, _safEthAmount);\n \n for (uint256 i = 0; i < derivativeCount; i++) {\n // withdraw a percentage of each asset based on the amount of safETH\n uint256 derivativeAmount = (derivatives[i].balance() *\n _safEthAmount) / safEthTotalSupply;\n if (derivativeAmount == 0) continue; // if derivative empty ignore\n derivatives[i].withdraw(derivativeAmount);\n }\n \n uint256 ethAmountAfter = address(this).balance;\n uint256 ethAmountToWithdraw = ethAmountAfter - ethAmountBefore;\n // solhint-disable-next-line\n (bool sent, ) = address(msg.sender).call{value: ethAmountToWithdraw}(\n \"\"\n );\n require(sent, \"Failed to send Ether\");\n emit Unstaked(msg.sender, ethAmountToWithdraw, _safEthAmount);\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function stake() external payable {\n require(pauseStaking == false, \"staking is paused\");\n require(msg.value >= minAmount, \"amount too low\");\n require(msg.value <= maxAmount, \"amount too high\");\n\n uint256 underlyingValue = 0;\n\n // Getting underlying value in terms of ETH for each derivative\n for (uint i = 0; i < derivativeCount; i++)\n underlyingValue +=\n (derivatives[i].ethPerDerivative(derivatives[i].balance()) *\n derivatives[i].balance()) /\n 10 ** 18;\n\n uint256 totalSupply = totalSupply();\n uint256 totalStakeValueEth = 0; // total amount of derivatives worth of ETH in system\n for (uint i = 0; i < derivativeCount; i++) {\n uint256 weight = weights[i];\n IDerivative derivative = derivatives[i];\n if (weight == 0) continue;\n uint256 ethAmount = (msg.value * weight) / totalWeight;\n\n // This is slightly less than ethAmount because slippage\n uint256 depositAmount = derivative.deposit{value: ethAmount}();\n uint derivativeReceivedEthValue = (derivative.ethPerDerivative(\n depositAmount\n ) * depositAmount) / 10 ** 18;\n totalStakeValueEth += derivativeReceivedEthValue;\n }\n uint256 preDepositPrice; // Price of safETH in regards to ETH\n if (totalSupply == 0)\n preDepositPrice = 10 ** 18; // initializes with a price of 1\n else preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;\n \n // mintAmount represents a percentage of the total assets in the system\n uint256 mintAmount = (totalStakeValueEth * 10 ** 18) / preDepositPrice;\n _mint(msg.sender, mintAmount);\n emit Staked(msg.sender, msg.value, mintAmount);\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "11-kelp", "title": "CatsSecurity Analysis", "severity_raw": "Critical", "severity": "critical", "description": "# Kelp Protocol Analysis\n\n## Description of Kelp\nKelp represents a collaborative DAO with the purpose of enhancing liquidity, DeFi, and maximizing rewards for assets that are restaked. The core of this initiative lies in the integration of a single liquid restaked token made for recognized LSTs, ensuring seamless accessibility. The protocol will allow users to employ their rsETH within EigenLayer strategies, enabling them to generate returns. The ongoing development of rsETH will be carried out within the framework of the Kelp brand.\n## 1. System Overview\n\n### 1.1 Scoping\n\n- [LRTConfig](https://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTConfig.sol): This contract includes the functionality to configure the system such as adding new supported assets, updating assets' deposit limit, updating an asset's strategy, setting the `rsETH` contract address, setting the token address and numerous getter functions.\n- [LRTDepositPool](https://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol): This contract is the main user-facing contract and includes the functionality to deposit assets, mint `rsETH`, add node delegator's to the queue, transfer assets to node delegators, update the max node delegators count and numerous getter functions.\n- [NodeDelegator](https://github.com/code-423n4/2023-11-kelp/blob/main/src/NodeDelegator.sol): This contract is the recipient of funds from the [LRTDepositPool](https://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol) contract and in turn sends them to the EigenLayer strategies, includes functionality to approve assets to EigenLayer, deposit assets into the strategy, transfer funds back to [LRTDepositPool](https://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol), and numerous getter functions.\n- [LRTOracle](https://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTOracle.sol): This contract is utilized as the `Oracle` to get prices of liquid staking tokens, includes functional", "vulnerable_code": "Gus \u2014 Yesterday at 6:38 PM\nWhen Eigenlayer adds/accepts more LSTs, we will want to support those as well", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-11-kelp-findings/blob/main/data/CatsSecurity-Analysis.md", "collected_at": "2026-01-02T18:27:23.276179+00:00", "source_hash": "fccc68cbd56a26655edbdbdcef5d21531801806c103d31eea99d2b6e6ca6f7cf", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "LRTConfig.sol, LRTDepositPool.sol, NodeDelegator.sol, LRTOracle.sol", "github_files_list": "LRTConfig.sol, LRTDepositPool.sol, NodeDelegator.sol, LRTOracle.sol", "github_refs_count": 4, "vulnerable_code_actual": "Gus \u2014 Yesterday at 6:38 PM\nWhen Eigenlayer adds/accepts more LSTs, we will want to support those as well", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 5} {"source": "c4", "protocol": "10-badger", "title": "Madalad G", "severity_raw": "High", "severity": "high", "description": "# Gas Report\n\n## Gas Optimizations\n| |Issue|Instances|Gas Saved|\n|:-:|:-|:-:|:-:|\n|[[G-01]](#g-01-abiencodepacked-is-more-gas-efficient-than-abiencode)|`abi.encodePacked` is more gas efficient than `abi.encode`|5|-|\n|[[G-02]](#g-02-use-assembly-to-emit-events)|Use assembly to emit events|88|3344|\n|[[G-03]](#g-03-use-assembly-to-check-for-address0)|Use assembly to check for `address(0)`|24|432|\n|[[G-04]](#g-04-use-assembly-to-calculate-hashes)|Use assembly to calculate hashes|11|4114|\n|[[G-05]](#g-05--use-assembly-to-write-storage-values)| Use assembly to write storage values|112|8400|\n|[[G-06]](#g-06-use-require-instead-of-assert)|Use `require` instead of `assert`|1|-|\n|[[G-07]](#g-07-avoid-zero-transfer-to-save-gas)|Avoid zero transfer to save gas|10|1000|\n|[[G-08]](#g-08-using-bool-for-storage-incurs-overhead)|Using `bool` for storage incurs overhead|4|68400|\n|[[G-09]](#g-09-do-not-compare-boolean-expressions-to-boolean-literals)|Do not compare boolean expressions to boolean literals|4|36|\n|[[G-10]](#g-10-cache-multiple-accesses-of-mappingarray-values)|Cache multiple accesses of mapping/array values|39|1638|\n|[[G-11]](#g-11-using-constants-directly-rather-than-caching-the-value-saves-gas)|Using `constant`s directly, rather than caching the value, saves gas|2|-|\n|[[G-12]](#g-12-function-result-should-be-cached)|Function result should be cached|90|-|\n|[[G-13]](#g-13-cache-storage-variables-read-from-more-than-once)|Cache storage variables read from more than once|37|3589|\n|[[G-14]](#g-14-use-calldata-instead-of-memory-for-function-arguments-that-are-read-only)|Use `calldata` instead of `memory` for function arguments that are read only|26|-|\n|[[G-15]](#g-15-divisionmultiplication-by-powers-of-2-should-use-bit-shifting)|Division/Multiplication by powers of 2 should use bit shifting|4|80|\n|[[G-16]](#g-16-initializing-variable-to-default-value-costs-unnecessary-gas)|Initializing variable to default value costs unnecessary gas|7|42|\n|[[G-17]](#g-17-same-cast-is-done-mul", "vulnerable_code": "File: packages/contracts/contracts/BorrowerOperations.sol\n\n682: return keccak256(abi.encode(typeHash, name, version, _chainID(), address(this)));\n", "fixed_code": "File: packages/contracts/contracts/EBTCToken.sol\n\n214: abi.encode(_PERMIT_TYPEHASH, owner, spender, amount, _nonces[owner]++, deadline)\n\n240: return keccak256(abi.encode(typeHash, name, version, _chainID(), address(this)));\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/Madalad-G.md", "collected_at": "2026-01-02T18:26:34.180852+00:00", "source_hash": "fcf82a539569e8b904505abf849414b007ca2cd1b2eb33fee28e8fcdcaa2a65e", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: packages/contracts/contracts/BorrowerOperations.sol\n\n682: return keccak256(abi.encode(typeHash, name, version, _chainID(), address(this)));\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: packages/contracts/contracts/EBTCToken.sol\n\n214: abi.encode(_PERMIT_TYPEHASH, owner, spender, amount, _nonces[owner]++, deadline)\n\n240: return keccak256(abi.encode(typeHash, name, version, _chainID(), address(this)));\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "01-biconomy", "title": "btk Q", "severity_raw": "Critical", "severity": "critical", "description": "### Total L issues\n\n| Number | Issues Details | Context |\n|--------|------------------------------------------------------------------------------------|---------|\n| [L-1] | Low level calls with solidity version 0.8.14 and lower can result in optimiser bug | |\n| [L-2] | Critical changes should use-two step procedure | 1 |\n| [L-3] | `initialize()` function can be called by anyone | 2 |\n| [L-4] | Avoid using `tx.origin` | 4 |\n\n### Total NC issues\n\n| Number | Issues Details | Context |\n|---------|---------------------------------------------------------|---------|\n| [NC-1] | Open TODO | 1 |\n| [NC-2] | Include return parameters in NatSpec comments | |\n| [NC-3] | Non-usage of specific imports | |\n| [NC-4] | Lines are too long | 14 |\n| [NC-5] | Use `bytes.concat()` | 10 |\n| [NC-6] | Use require instead of assert | 2 |\n| [NC-7] | Typos | 1 |\n| [NC-8] | Lack of event emit | 2 |\n| [NC-9] | Require messages are too short and unclear | 5 |\n| [NC-10]| Unused `receive()` Function Will Lock Ether In Contract | 2 |\n\n\n## [L-1] Low level calls with solidity version 0.8.14 and lower can result in optimiser bug\n\nThe protocol is using low level calls with solidity version 0.8.12 which can result in optimizer bug.\n\n> Ref: https://medium.com/certora/overly-optimistic-optimizer-certora-bug-disclosure-2101e3f7994d\n\n### Recommended Mitigation Steps\n\nConsider upgrading to solidity ", "vulnerable_code": " /**\n * @notice Throws if the sender is not the owner.\n */", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/btk-Q.md", "collected_at": "2026-01-02T18:13:34.621808+00:00", "source_hash": "fcfe43ef58f8233c5b2ac2575a2be4b4ef57487ff9130887f40f8e00b822b497", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " /**\n * @notice Throws if the sender is not the owner.\n */", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4} {"source": "c4", "protocol": "01-biconomy", "title": "SaharDevep Q", "severity_raw": "Medium", "severity": "medium", "description": "# c4udit Report\n\n### Summery\n[L001] Unspecific Compiler Version Pragma\n[N001] Line length must be no more than 120\n[N002] USE NAMED IMPORTS INSTEAD OF PLAIN `IMPORT \u2018FILE.SOL\u2019\n[L002] REQUIRE() SHOULD BE USED INSTEAD OF ASSERT()\n[L003] EVENT IS MISSING INDEXED FIELDS\n[N003] REQUIRE() / REVERT() STATEMENTS SHOULD HAVE DESCRIPTIVE REASON STRINGS\n[N004] WRONG INDENTATION AND CODE STYLE\n[N005] INCORRECT FUNCTION ORDER \n[L004] EXPRESSIONS FOR CONSTANT VALUES SUCH AS A CALL TO KECCAK256(), SHOULD USE IMMUTABLE RATHER THAN CONSTANT\n[N006] INCONSISTANT FUNCTION NAMING\n[L005] USE OF BLOCK.TIMESTAMP\n[N007] NOT USING THE NAMED RETURN VARIABLES ANYWHERE IN THE FUNCTION IS CONFUSING\n\n## Issues found\n\n### [L001] Unspecific Compiler Version Pragma\n\n#### Impact\nIssue Information:(https://github.com/byterocket/c4-common-issues/blob/main/2-Low-Risk.md#l003---unspecific-compiler-version-pragma)\n\n#### Findings:\n```\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::6 => pragma solidity ^0.8.12;\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\StakeManager.sol::2 => pragma solidity ^0.8.12;\n```\n#### Tools used\n[c4udit](https://github.com/byterocket/c4udit)\n\n### [N001] Line length must be no more than 120\n\n#### Findings:\n```\nscw-contracts\\contracts\\smart-contract-wallet\\BaseSmartAccount.sol::39 \nscw-contracts\\contracts\\smart-contract-wallet\\BaseSmartAccount.sol::45 \nscw-contracts\\contracts\\smart-contract-wallet\\BaseSmartAccount.sol::57 \nscw-contracts\\contracts\\smart-contract-wallet\\BaseSmartAccount.sol::60\nscw-contracts\\contracts\\smart-contract-wallet\\Proxy.sol::10\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::42\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::46\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::186\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::222\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::223\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.", "vulnerable_code": "scw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::6 => pragma solidity ^0.8.12;\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\StakeManager.sol::2 => pragma solidity ^0.8.12;", "fixed_code": "scw-contracts\\contracts\\smart-contract-wallet\\BaseSmartAccount.sol::39 \nscw-contracts\\contracts\\smart-contract-wallet\\BaseSmartAccount.sol::45 \nscw-contracts\\contracts\\smart-contract-wallet\\BaseSmartAccount.sol::57 \nscw-contracts\\contracts\\smart-contract-wallet\\BaseSmartAccount.sol::60\nscw-contracts\\contracts\\smart-contract-wallet\\Proxy.sol::10\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::42\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::46\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::186\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::222\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::223\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::227\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::228\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::229\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::230\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::231\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::233\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::239\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::300\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::320\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::327\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::339\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::342\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::346\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::356\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::257\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::489\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccountFactory.sol::24\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccountFactory.sol::33", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/SaharDevep-Q.md", "collected_at": "2026-01-02T18:13:18.393716+00:00", "source_hash": "fd3046eeedc683f030ae9cbda69075a9bb40ab9ef8bcf5823bf413c6c8f95855", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 211, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "scw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::6 => pragma solidity ^0.8.12;\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\StakeManager.sol::2 => pragma solidity ^0.8.12;", "primary_code_language": "unknown", "primary_code_char_count": 211, "all_code_blocks": "// Code block 1 (unknown):\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::6 => pragma solidity ^0.8.12;\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\StakeManager.sol::2 => pragma solidity ^0.8.12;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "scw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\EntryPoint.sol::6 => pragma solidity ^0.8.12;\nscw-contracts\\contracts\\smart-contract-wallet\\aa-4337\\core\\StakeManager.sol::2 => pragma solidity ^0.8.12;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "scw-contracts\\contracts\\smart-contract-wallet\\BaseSmartAccount.sol::39 \nscw-contracts\\contracts\\smart-contract-wallet\\BaseSmartAccount.sol::45 \nscw-contracts\\contracts\\smart-contract-wallet\\BaseSmartAccount.sol::57 \nscw-contracts\\contracts\\smart-contract-wallet\\BaseSmartAccount.sol::60\nscw-contracts\\contracts\\smart-contract-wallet\\Proxy.sol::10\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::42\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::46\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::186\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::222\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::223\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::227\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::228\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::229\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::230\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::231\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::233\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::239\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::300\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::320\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::327\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::339\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::342\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::346\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::356\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::257\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccount.sol::489\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccountFactory.sol::24\nscw-contracts\\contracts\\smart-contract-wallet\\SmartAccountFactory.sol::33", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 6} {"source": "c4", "protocol": "01-biconomy", "title": "yongskiws Q", "severity_raw": "High", "severity": "high", "description": "### [L-1] Dont use tx.origin and tx.gasprice\nConsider tx.origin and tx.gasprice is a global variable in Solidity that returns the address of the account that sent the transaction. Using the variable could make a contract vulnerable if an authorized account calls a malicious contract impersonate a user using a third party contract.\n\n``` solidity\ncontracts/SmartAccount.sol\n257: address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\n258: if (gasToken == address(0)) {\n259: // For ETH we will only adjust the gas price to not be higher than the actual used gas price\n260: payment = (gasUsed + baseGas) * (gasPrice < tx.gasprice ? gasPrice : tx.gasprice);\n261: (bool success,) = receiver.call{value: payment}(\"\");\n262: require(success, \"BSA011\");\n263: } else {\n264: payment = (gasUsed + baseGas) * (gasPrice) / (tokenGasPriceFactor);\n265: require(transferToken(gasToken, receiver, payment), \"BSA012\");\n266: }\n\n\n281: address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;\n282: if (gasToken == address(0)) {\n283: // For ETH we will only adjust the gas price to not be higher than the actual used gas price\n284: payment = (gasUsed + baseGas) * (gasPrice < tx.gasprice ? gasPrice : tx.gasprice);\n285: (bool success,) = receiver.call{value: payment}(\"\");\n286: require(success, \"BSA011\");\n287: } else {\n288: payment = (gasUsed + baseGas) * (gasPrice) / (tokenGasPriceFactor);\n289: require(transferToken(gasToken, receiver, payment), \"BSA012\");\n290: }\n\n511: require(owner == hash.recover(userOp.signature) || tx.origin == address(0), \"account: wrong signature\");\n512: return 0;\n\n```\n\n### [L-2] Consider an ether lockout may occur in the function\nIf the summoner sends ether to this contract, then the eth", "vulnerable_code": "### [L-2] Consider an ether lockout may occur in the function\nIf the summoner sends ether to this contract, then the ether will be locked in the contract and cannot be retrieved, which can lead to an ether lock\nRemove the payable attribute or add a withdraw function.", "fixed_code": "### [L-3] Consider the unused return value\nWhile not consuming more gas with the Optimizer enabled: using both named returns and a return statement isn't necessary. Removing one of those can improve code clarity:\nUsing both named returns and a return statement isn't necessary.\nRemoving unused named return variables can reduce gas usage and improve code clarity. To save gas and improve code quality: consider using only one of those.\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-01-biconomy-findings/blob/main/data/yongskiws-Q.md", "collected_at": "2026-01-02T18:14:15.479774+00:00", "source_hash": "fd3481de71971a5dcc01bc40e25d3ce31753557cfbe20540e19d761660745255", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "### [L-2] Consider an ether lockout may occur in the function\nIf the summoner sends ether to this contract, then the ether will be locked in the contract and cannot be retrieved, which can lead to an ether lock\nRemove the payable attribute or add a withdraw function.", "has_vulnerable_code_snippet": true, "fixed_code_actual": "### [L-3] Consider the unused return value\nWhile not consuming more gas with the Optimizer enabled: using both named returns and a return statement isn't necessary. Removing one of those can improve code clarity:\nUsing both named returns and a return statement isn't necessary.\nRemoving unused named return variables can reduce gas usage and improve code clarity. To save gas and improve code quality: consider using only one of those.\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "03-asymmetry", "title": "adriro Q", "severity_raw": "Critical", "severity": "critical", "description": "# Report\n\n- Non Critical Issues (5)\n- Low Issues (5)\n\n## Non Critical Issues\n\n| |Issue|Instances|\n|-|:-|:-:|\n| [NC-1](#NC-1) | Bool expression compared to literal value | 2 |\n| [NC-2](#NC-2) | Import declarations should import specific symbols | 31 |\n| [NC-3](#NC-3) | Use `uint256` instead of the `uint` alias | 16 |\n| [NC-4](#NC-4) | Use constants for literal or magic values | 5 |\n| [NC-5](#NC-5) | Use `rethAddress` function instead of duplicating functionality | 2 |\n\n### [NC-1] Bool expression compared to literal value\nBool expressions do not need to be compared against a literal value. For example, `aBoolExpression == true` can be directly stated as `aBoolExpression`, or `aBoolExpression == false` as `!aBoolExpression`.\n\n*Instances (2)*:\n```solidity\nFile: contracts/SafEth/SafEth.sol\n\n65: require(pauseStaking == false, \"staking is paused\");\n\n117: require(pauseUnstaking == false, \"unstaking is paused\");\n\n```\n\n### [NC-2] Import declarations should import specific symbols\nPrefer import declarations that specify the symbol(s) using the form `import {SYMBOL} from \"SomeContract.sol\"` rather than importing the whole file\n\n*Instances (31)*:\n```solidity\nFile: contracts/SafEth/SafEth.sol\n\n4: import \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\n5: import \"../interfaces/IWETH.sol\";\n\n6: import \"../interfaces/uniswap/ISwapRouter.sol\";\n\n7: import \"../interfaces/lido/IWStETH.sol\";\n\n8: import \"../interfaces/lido/IstETH.sol\";\n\n9: import \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\n\n10: import \"./SafEthStorage.sol\";\n\n11: import \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n\n```\n\n```solidity\nFile: contracts/SafEth/derivatives/Reth.sol\n\n4: import \"../../interfaces/IDerivative.sol\";\n\n5: import \"../../interfaces/frax/IsFrxEth.sol\";\n\n6: import \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\n7: import \"../../interfaces/rocketpool/RocketStorageInterface.sol\";\n\n8: import \"../../int", "vulnerable_code": "File: contracts/SafEth/SafEth.sol\n\n65: require(pauseStaking == false, \"staking is paused\");\n\n117: require(pauseUnstaking == false, \"unstaking is paused\");\n", "fixed_code": "File: contracts/SafEth/SafEth.sol\n\n4: import \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\n5: import \"../interfaces/IWETH.sol\";\n\n6: import \"../interfaces/uniswap/ISwapRouter.sol\";\n\n7: import \"../interfaces/lido/IWStETH.sol\";\n\n8: import \"../interfaces/lido/IstETH.sol\";\n\n9: import \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\n\n10: import \"./SafEthStorage.sol\";\n\n11: import \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-03-asymmetry-findings/blob/main/data/adriro-Q.md", "collected_at": "2026-01-02T18:18:44.532624+00:00", "source_hash": "fd3febbb3fbdcb973b1ad171c98bb3912e1272fa1dd8955b5b67834570b47ccb", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 642, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File: contracts/SafEth/SafEth.sol\n\n65: require(pauseStaking == false, \"staking is paused\");\n\n117: require(pauseUnstaking == false, \"unstaking is paused\");", "primary_code_language": "solidity", "primary_code_char_count": 170, "all_code_blocks": "// Code block 1 (solidity):\nFile: contracts/SafEth/SafEth.sol\n\n65: require(pauseStaking == false, \"staking is paused\");\n\n117: require(pauseUnstaking == false, \"unstaking is paused\");\n\n// Code block 2 (solidity):\nFile: contracts/SafEth/SafEth.sol\n\n4: import \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\n5: import \"../interfaces/IWETH.sol\";\n\n6: import \"../interfaces/uniswap/ISwapRouter.sol\";\n\n7: import \"../interfaces/lido/IWStETH.sol\";\n\n8: import \"../interfaces/lido/IstETH.sol\";\n\n9: import \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\n\n10: import \"./SafEthStorage.sol\";\n\n11: import \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File: contracts/SafEth/SafEth.sol\n\n65: require(pauseStaking == false, \"staking is paused\");\n\n117: require(pauseUnstaking == false, \"unstaking is paused\");\n\nFile: contracts/SafEth/SafEth.sol\n\n4: import \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\n5: import \"../interfaces/IWETH.sol\";\n\n6: import \"../interfaces/uniswap/ISwapRouter.sol\";\n\n7: import \"../interfaces/lido/IWStETH.sol\";\n\n8: import \"../interfaces/lido/IstETH.sol\";\n\n9: import \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\n\n10: import \"./SafEthStorage.sol\";\n\n11: import \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: contracts/SafEth/SafEth.sol\n\n65: require(pauseStaking == false, \"staking is paused\");\n\n117: require(pauseUnstaking == false, \"unstaking is paused\");\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: contracts/SafEth/SafEth.sol\n\n4: import \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\n5: import \"../interfaces/IWETH.sol\";\n\n6: import \"../interfaces/uniswap/ISwapRouter.sol\";\n\n7: import \"../interfaces/lido/IWStETH.sol\";\n\n8: import \"../interfaces/lido/IstETH.sol\";\n\n9: import \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\n\n10: import \"./SafEthStorage.sol\";\n\n11: import \"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\";\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "05-ajna", "title": "0xSmartContract G", "severity_raw": "High", "severity": "high", "description": "### Gas Optimizations List\n| Number | Optimization Details | Context |\n|:--:|:-------| :-----:|\n| [G-01] |Missing `zero-address` check in `constructor` | 3 |\n| [G-02] |if () / require() statements that check input arguments should be at the top of the function |1 |\n| [G-03] |Use nested if and, avoid multiple check combinations | 6 |\n| [G-04] | Ternary operation is cheaper than if-else statement |1|\n| [G-05] |Do not calculate constants variables | 5 |\n| [G-06] |Sort Solidity operations using short-circuit mode | 10 |\n| [G-07] | Pre-increment and pre-decrement are cheaper than `\u00b11` | 2 |\n\nTotal 7 issues\n\n\n### [G-01] Missing `zero-address` check in `constructor`\n\nMissing checks for zero-addresses may lead to infunctional protocol, if the variable addresses are updated incorrectly. It also wast gas as it requires the redeployment of the contract.\n\n3 results - 2 files:\n```solidity\najna-core\\src\\PositionManager.sol:\n 115 \n 116: constructor(\n 117: ERC20PoolFactory erc20Factory_,\n 118: ERC721PoolFactory erc721Factory_\n 119: ) PermitERC721(\"Ajna Positions NFT-V1\", \"AJNA-V1-POS\", \"1\") {\n 120: erc20PoolFactory = erc20Factory_;\n 121: erc721PoolFactory = erc721Factory_;\n 122: }\n\n```\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/PositionManager.sol#L120-L121\n\n\n```solidity\najna-core\\src\\RewardsManager.sol:\n 94 \n 95: constructor(address ajnaToken_, IPositionManager positionManager_) {\n\n 99: positionManager = positionManager_;\n 100: }\n\n```\nhttps://github.com/code-423n4/2023-05-ajna/blob/main/ajna-core/src/RewardsManager.sol#L99\n\n### [G-02] if () / require() statements that check input arguments should be at the top of the function\n\nChecks that involve constants should come before checks that involve state variables, function calls, and calculations. By doing these checks first, the function is able to revert before wasting a Gcoldsload (2100 gas) in a function that may ultimately rev", "vulnerable_code": "ajna-core\\src\\PositionManager.sol:\n 115 \n 116: constructor(\n 117: ERC20PoolFactory erc20Factory_,\n 118: ERC721PoolFactory erc721Factory_\n 119: ) PermitERC721(\"Ajna Positions NFT-V1\", \"AJNA-V1-POS\", \"1\") {\n 120: erc20PoolFactory = erc20Factory_;\n 121: erc721PoolFactory = erc721Factory_;\n 122: }\n", "fixed_code": "ajna-core\\src\\RewardsManager.sol:\n 94 \n 95: constructor(address ajnaToken_, IPositionManager positionManager_) {\n\n 99: positionManager = positionManager_;\n 100: }\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/0xSmartContract-G.md", "collected_at": "2026-01-02T18:20:49.277320+00:00", "source_hash": "fd97ce4dc3164ec52bf8dd2f7add2477ab5fb065d4660a6d08a150c849bd0287", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 534, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "ajna-core\\src\\PositionManager.sol:\n 115 \n 116: constructor(\n 117: ERC20PoolFactory erc20Factory_,\n 118: ERC721PoolFactory erc721Factory_\n 119: ) PermitERC721(\"Ajna Positions NFT-V1\", \"AJNA-V1-POS\", \"1\") {\n 120: erc20PoolFactory = erc20Factory_;\n 121: erc721PoolFactory = erc721Factory_;\n 122: }", "primary_code_language": "solidity", "primary_code_char_count": 348, "all_code_blocks": "// Code block 1 (solidity):\najna-core\\src\\PositionManager.sol:\n 115 \n 116: constructor(\n 117: ERC20PoolFactory erc20Factory_,\n 118: ERC721PoolFactory erc721Factory_\n 119: ) PermitERC721(\"Ajna Positions NFT-V1\", \"AJNA-V1-POS\", \"1\") {\n 120: erc20PoolFactory = erc20Factory_;\n 121: erc721PoolFactory = erc721Factory_;\n 122: }\n\n// Code block 2 (solidity):\najna-core\\src\\RewardsManager.sol:\n 94 \n 95: constructor(address ajnaToken_, IPositionManager positionManager_) {\n\n 99: positionManager = positionManager_;\n 100: }", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "ajna-core\\src\\PositionManager.sol:\n 115 \n 116: constructor(\n 117: ERC20PoolFactory erc20Factory_,\n 118: ERC721PoolFactory erc721Factory_\n 119: ) PermitERC721(\"Ajna Positions NFT-V1\", \"AJNA-V1-POS\", \"1\") {\n 120: erc20PoolFactory = erc20Factory_;\n 121: erc721PoolFactory = erc721Factory_;\n 122: }\n\najna-core\\src\\RewardsManager.sol:\n 94 \n 95: constructor(address ajnaToken_, IPositionManager positionManager_) {\n\n 99: positionManager = positionManager_;\n 100: }", "github_refs_formatted": "PositionManager.sol#L120-L121, RewardsManager.sol#L99", "github_files_list": "RewardsManager.sol, PositionManager.sol", "github_refs_count": 2, "vulnerable_code_actual": "ajna-core\\src\\PositionManager.sol:\n 115 \n 116: constructor(\n 117: ERC20PoolFactory erc20Factory_,\n 118: ERC721PoolFactory erc721Factory_\n 119: ) PermitERC721(\"Ajna Positions NFT-V1\", \"AJNA-V1-POS\", \"1\") {\n 120: erc20PoolFactory = erc20Factory_;\n 121: erc721PoolFactory = erc721Factory_;\n 122: }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "ajna-core\\src\\RewardsManager.sol:\n 94 \n 95: constructor(address ajnaToken_, IPositionManager positionManager_) {\n\n 99: positionManager = positionManager_;\n 100: }\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "08-dopex", "title": "K42 G", "severity_raw": "Low", "severity": "low", "description": "## Gas Optimization Report for [DopeX](https://github.com/code-423n4/2023-08-dopex/tree/main) by K42\n\n### Possible Optimization in [UniV2LiquidityAmo.sol](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/amo/UniV2LiquidityAmo.sol)\n\nPossible Optimization 1 = \n- Remove redundant ``require`` checks for zero addresses in [approveContractToSpend](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/amo/UniV2LiquidityAmo.sol#L126C1-L153C4). This is valid only if you are sure that zero addresses will never be passed to this function, by the ``DEFAULT_ADMIN_ROLE`` role, if you are not sure of this, this optimization is not advised.\n\nHere is the optimized code: \n\n\n\n\n```solidity\nfunction approveContractToSpend(\n address _token,\n address _spender,\n uint256 _amount\n) external onlyRole(DEFAULT_ADMIN_ROLE) {\n require(_amount > 0, \"reLPContract: amount must be greater than 0\");\n IERC20WithBurn(_token).approve(_spender, _amount);\n}\n```\n\n\n\n\n- Estimated gas saved = Approximately 20,000 gas for the eliminated ``require`` check.\n\nPossible Optimization 2 = \n- Batch multiple state variable updates into a single operation by modifying [_sendTokensToRdpxV2Core](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/amo/UniV2LiquidityAmo.sol#L160C1-L178C4) to return the new [lpTokenBalance](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/amo/UniV2LiquidityAmo.sol#L54C2-L54C33).\n\nAfter Optimization:\n\n\n\n\n```solidity\nfunction _sendTokensToRdpxV2Core(uint256 lpReceived) internal returns (uint256 newLpTokenBalance) {\n // ... (existing code)\n return lpTokenBalance + lpReceived;\n}\n```\n\n\n\nThen in the calling function: \n\n\n\n\n```solidity\n// After\n(lpTokenBalance, ) = _sendTokensToRdpxV2Core(lpReceived);\n```\n\n\n\n\n\n- Estimated gas saved = Approximately 5,000-10,000 gas due to reduced ``SSTORE`` operations.\n\n### Possible Optimizations in [UniV3LiquidityAmo.sol](https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/amo/UniV3L", "vulnerable_code": "function approveContractToSpend(\n address _token,\n address _spender,\n uint256 _amount\n) external onlyRole(DEFAULT_ADMIN_ROLE) {\n require(_amount > 0, \"reLPContract: amount must be greater than 0\");\n IERC20WithBurn(_token).approve(_spender, _amount);\n}", "fixed_code": "function _sendTokensToRdpxV2Core(uint256 lpReceived) internal returns (uint256 newLpTokenBalance) {\n // ... (existing code)\n return lpTokenBalance + lpReceived;\n}", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-08-dopex-findings/blob/main/data/K42-G.md", "collected_at": "2026-01-02T18:24:46.140905+00:00", "source_hash": "fdb7f8e21906b8db07c648540c1b14234d29d9ec776133236e760edb69ca4762", "code_block_count": 3, "solidity_block_count": 3, "total_code_chars": 500, "github_ref_count": 4, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function approveContractToSpend(\n address _token,\n address _spender,\n uint256 _amount\n) external onlyRole(DEFAULT_ADMIN_ROLE) {\n require(_amount > 0, \"reLPContract: amount must be greater than 0\");\n IERC20WithBurn(_token).approve(_spender, _amount);\n}", "primary_code_language": "solidity", "primary_code_char_count": 266, "all_code_blocks": "// Code block 1 (solidity):\nfunction approveContractToSpend(\n address _token,\n address _spender,\n uint256 _amount\n) external onlyRole(DEFAULT_ADMIN_ROLE) {\n require(_amount > 0, \"reLPContract: amount must be greater than 0\");\n IERC20WithBurn(_token).approve(_spender, _amount);\n}\n\n// Code block 2 (solidity):\nfunction _sendTokensToRdpxV2Core(uint256 lpReceived) internal returns (uint256 newLpTokenBalance) {\n // ... (existing code)\n return lpTokenBalance + lpReceived;\n}\n\n// Code block 3 (solidity):\n// After\n(lpTokenBalance, ) = _sendTokensToRdpxV2Core(lpReceived);", "all_code_blocks_count": 3, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function approveContractToSpend(\n address _token,\n address _spender,\n uint256 _amount\n) external onlyRole(DEFAULT_ADMIN_ROLE) {\n require(_amount > 0, \"reLPContract: amount must be greater than 0\");\n IERC20WithBurn(_token).approve(_spender, _amount);\n}\n\nfunction _sendTokensToRdpxV2Core(uint256 lpReceived) internal returns (uint256 newLpTokenBalance) {\n // ... (existing code)\n return lpTokenBalance + lpReceived;\n}\n\n// After\n(lpTokenBalance, ) = _sendTokensToRdpxV2Core(lpReceived);", "github_refs_formatted": "UniV2LiquidityAmo.sol, UniV2LiquidityAmo.sol#L126-L1, UniV2LiquidityAmo.sol#L160-L1, UniV2LiquidityAmo.sol#L54-L2", "github_files_list": "UniV2LiquidityAmo.sol", "github_refs_count": 4, "vulnerable_code_actual": "function approveContractToSpend(\n address _token,\n address _spender,\n uint256 _amount\n) external onlyRole(DEFAULT_ADMIN_ROLE) {\n require(_amount > 0, \"reLPContract: amount must be greater than 0\");\n IERC20WithBurn(_token).approve(_spender, _amount);\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function _sendTokensToRdpxV2Core(uint256 lpReceived) internal returns (uint256 newLpTokenBalance) {\n // ... (existing code)\n return lpTokenBalance + lpReceived;\n}", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 9} {"source": "c4", "protocol": "02-ethos", "title": "dharma09 G", "severity_raw": "High", "severity": "high", "description": "## Summary\n\n**Gas Optimizations**\n\n| | Issue | Instances |\n| --- | --- | --- |\n| [G\u201101] | No need for type conversion as\u00a0token\u00a0is already an address | 1 |\n| [G\u201102] | Duplicated require()/revert() checks should be refactored to a modifier or function | 1 |\n| [G-03] | Using\u00a0delete\u00a0instead of setting state variable/mapping to\u00a00\u00a0saves gas | 17 |\n| [G-04] | Use\u00a0double require\u00a0instead of using\u00a0&& | 4 |\n| [G-05] | Emitting storage values instead of the memory one | 1 |\n| [G-06] | The result of function calls should be cached rather than re-calling the function | 6 |\n| [G-07] | Using storage instead of memory for structs/arrays saves gas | 4 |\n| [G-08] | StabilityPool.sol.updateRewardSum(): totalLUSD should be cached in local storage | 2 |\n| [G-09] | Usage of\u00a0uints/ints\u00a0smaller than 32 bytes (256 bits) incurs overhead | 1 |\n| [G-10] | Not using the named return variables when a function returns, wastes deployment gas | 1 |\n| [G-11] | Add\u00a0unchecked {}\u00a0for subtractions where the operands cannot underflow because of a previous\u00a0require()\u00a0or\u00a0ifstatement | 2 |\n| [G-12] | Multiple accesses of a mapping/array should use a local variable cache | 2 |\n\nTotal: 42 instances over 12 issues\n\n### **[G-01] No need for type conversion as\u00a0`token`\u00a0is already an address**\n\n```diff\n\t29: function asset() external view override returns (address assetTokenAddress) {\n -30: return address(token);\n\t+30: return token;\n 31: }\n```\n\n### **[G-02] Duplicated require()/revert() checks should be refactored to a modifier or function**\n\nThis saves deployement gas\n\n2 results- 1 file:\n\n```solidity\nFile: /contracts/TroveManager.sol\n\t551: require(totals.totalDebtInSequence > 0);\n...\n\t754: require(totals.totalDebtInSequence > 0);\n```\n\n- [TroveManager.sol#L551](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L)\n\n### [G-03] Using\u00a0`delete`\u00a0instead of setting state variable/mapping to\u00a0`0`\u00a0saves gas\n\n17 results - 4 file:\n\n```solidity\nFile: /contracts/ActivePool.s", "vulnerable_code": "### **[G-02] Duplicated require()/revert() checks should be refactored to a modifier or function**\n\nThis saves deployement gas\n\n2 results- 1 file:\n", "fixed_code": "- [TroveManager.sol#L551](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L)\n\n### [G-03] Using\u00a0`delete`\u00a0instead of setting state variable/mapping to\u00a0`0`\u00a0saves gas\n\n17 results - 4 file:\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/dharma09-G.md", "collected_at": "2026-01-02T18:17:06.050549+00:00", "source_hash": "fdc472e7283db8b32e079280cf9d8323d797770c58c12e2f9cfd3333b48d64f8", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 282, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "29: function asset() external view override returns (address assetTokenAddress) {\n -30: return address(token);\n\t+30: return token;\n 31: }", "primary_code_language": "diff", "primary_code_char_count": 151, "all_code_blocks": "// Code block 1 (diff):\n29: function asset() external view override returns (address assetTokenAddress) {\n -30: return address(token);\n\t+30: return token;\n 31: }\n\n// Code block 2 (solidity):\nFile: /contracts/TroveManager.sol\n\t551: require(totals.totalDebtInSequence > 0);\n...\n\t754: require(totals.totalDebtInSequence > 0);", "all_code_blocks_count": 2, "has_diff_blocks": true, "diff_code": "29: function asset() external view override returns (address assetTokenAddress) {\n -30: return address(token);\n\t+30: return token;\n 31: }", "solidity_code": "File: /contracts/TroveManager.sol\n\t551: require(totals.totalDebtInSequence > 0);\n...\n\t754: require(totals.totalDebtInSequence > 0);", "github_refs_formatted": "TroveManager.sol", "github_files_list": "TroveManager.sol", "github_refs_count": 1, "vulnerable_code_actual": "### **[G-02] Duplicated require()/revert() checks should be refactored to a modifier or function**\n\nThis saves deployement gas\n\n2 results- 1 file:\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "- [TroveManager.sol#L551](https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Core/contracts/TroveManager.sol#L)\n\n### [G-03] Using\u00a0`delete`\u00a0instead of setting state variable/mapping to\u00a0`0`\u00a0saves gas\n\n17 results - 4 file:\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 10} {"source": "c4", "protocol": "10-badger", "title": "prapandey031 Q", "severity_raw": "Critical", "severity": "critical", "description": "**Low Risk Issues**\n----------------------------------\n\n**[LOW-1] No default value available for the ```Cdps[cdpId].arrayIndex``` in CdpManagerStorage.sol:**\nThere is no default value for the ```Cdps[cdpId].arrayIndex``` in CdpManagerStorage.sol. Zero(0) cannot be considered a default value for this as it would be the value for the 1st CDP in the ```CdpIds[]``` array. \n\n***Recommended Mitigation Steps:***\nStart valuing ```Cdps[cdpId].arrayIndex``` by 1 and not zero(0). This would let it get the zero(0) value as a default.\n\n\n**[LOW-2] No proper set of ```Cdps[_cdpId].arrayIndex``` in ```_removeCdp(bytes32 _cdpId, uint256 cdpIdsArrayLength)```:**\nThe ```Cdps[_cdpId].arrayIndex``` is not set to default in ```_removeCdp(bytes32 _cdpId, uint256 cdpIdsArrayLength)```.\n\n**Proof of Concept:**\nIn the ```_removeCdp(bytes32 _cdpId, uint256 cdpIdsArrayLength)``` function of CdpManagerStorage.sol, the ```Cdps[_cdpId].arrayIndex``` is not set to zero(0) (the default value) after popping it out of the ```CdpIds[]``` array:\nhttps://github.com/code-423n4/2023-10-badger/blob/main/packages/contracts/contracts/CdpManagerStorage.sol#L463\n```\nfunction _removeCdp(bytes32 _cdpId, uint256 cdpIdsArrayLength) internal {\n Status cdpStatus = Cdps[_cdpId].status;\n // It\u2019s set in caller function `_closeCdp`\n require(\n cdpStatus != Status.nonExistent && cdpStatus != Status.active,\n \"CdpManagerStorage: remove non-exist or non-active CDP!\"\n );\n\n uint128 index = Cdps[_cdpId].arrayIndex;\n uint256 length = cdpIdsArrayLength;\n uint256 idxLast = length - 1;\n\n require(index <= idxLast, \"CdpManagerStorage: CDP indexing overflow!\");\n\n bytes32 idToMove = CdpIds[idxLast];\n\n CdpIds[index] = idToMove;\n Cdps[idToMove].arrayIndex = index;\n emit CdpArrayIndexUpdated(idToMove, index);\n\n CdpIds.pop();\n }\n```\nThe ```_cdpId``` is the id of the cdp to be removed from the ```CdpIds[]``` array. After removi", "vulnerable_code": "function _removeCdp(bytes32 _cdpId, uint256 cdpIdsArrayLength) internal {\n Status cdpStatus = Cdps[_cdpId].status;\n // It\u2019s set in caller function `_closeCdp`\n require(\n cdpStatus != Status.nonExistent && cdpStatus != Status.active,\n \"CdpManagerStorage: remove non-exist or non-active CDP!\"\n );\n\n uint128 index = Cdps[_cdpId].arrayIndex;\n uint256 length = cdpIdsArrayLength;\n uint256 idxLast = length - 1;\n\n require(index <= idxLast, \"CdpManagerStorage: CDP indexing overflow!\");\n\n bytes32 idToMove = CdpIds[idxLast];\n\n CdpIds[index] = idToMove;\n Cdps[idToMove].arrayIndex = index;\n emit CdpArrayIndexUpdated(idToMove, index);\n\n CdpIds.pop();\n }", "fixed_code": "function _requireTCRisNotBelowMCR(uint256 _price, uint256 _TCR) internal view {\n require(_TCR >= MCR, \"CdpManager: Cannot redeem when TCR < MCR\");\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-10-badger-findings/blob/main/data/prapandey031-Q.md", "collected_at": "2026-01-02T18:27:00.822521+00:00", "source_hash": "fdd9338bc03e253a7d3adffb77c51bd85d2ac92a03d0b2ed15144a080784e9b5", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 761, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function _removeCdp(bytes32 _cdpId, uint256 cdpIdsArrayLength) internal {\n Status cdpStatus = Cdps[_cdpId].status;\n // It\u2019s set in caller function `_closeCdp`\n require(\n cdpStatus != Status.nonExistent && cdpStatus != Status.active,\n \"CdpManagerStorage: remove non-exist or non-active CDP!\"\n );\n\n uint128 index = Cdps[_cdpId].arrayIndex;\n uint256 length = cdpIdsArrayLength;\n uint256 idxLast = length - 1;\n\n require(index <= idxLast, \"CdpManagerStorage: CDP indexing overflow!\");\n\n bytes32 idToMove = CdpIds[idxLast];\n\n CdpIds[index] = idToMove;\n Cdps[idToMove].arrayIndex = index;\n emit CdpArrayIndexUpdated(idToMove, index);\n\n CdpIds.pop();\n }", "primary_code_language": "unknown", "primary_code_char_count": 761, "all_code_blocks": "// Code block 1 (unknown):\nfunction _removeCdp(bytes32 _cdpId, uint256 cdpIdsArrayLength) internal {\n Status cdpStatus = Cdps[_cdpId].status;\n // It\u2019s set in caller function `_closeCdp`\n require(\n cdpStatus != Status.nonExistent && cdpStatus != Status.active,\n \"CdpManagerStorage: remove non-exist or non-active CDP!\"\n );\n\n uint128 index = Cdps[_cdpId].arrayIndex;\n uint256 length = cdpIdsArrayLength;\n uint256 idxLast = length - 1;\n\n require(index <= idxLast, \"CdpManagerStorage: CDP indexing overflow!\");\n\n bytes32 idToMove = CdpIds[idxLast];\n\n CdpIds[index] = idToMove;\n Cdps[idToMove].arrayIndex = index;\n emit CdpArrayIndexUpdated(idToMove, index);\n\n CdpIds.pop();\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "CdpManagerStorage.sol#L463", "github_files_list": "CdpManagerStorage.sol", "github_refs_count": 1, "vulnerable_code_actual": "function _removeCdp(bytes32 _cdpId, uint256 cdpIdsArrayLength) internal {\n Status cdpStatus = Cdps[_cdpId].status;\n // It\u2019s set in caller function `_closeCdp`\n require(\n cdpStatus != Status.nonExistent && cdpStatus != Status.active,\n \"CdpManagerStorage: remove non-exist or non-active CDP!\"\n );\n\n uint128 index = Cdps[_cdpId].arrayIndex;\n uint256 length = cdpIdsArrayLength;\n uint256 idxLast = length - 1;\n\n require(index <= idxLast, \"CdpManagerStorage: CDP indexing overflow!\");\n\n bytes32 idToMove = CdpIds[idxLast];\n\n CdpIds[index] = idToMove;\n Cdps[idToMove].arrayIndex = index;\n emit CdpArrayIndexUpdated(idToMove, index);\n\n CdpIds.pop();\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "function _requireTCRisNotBelowMCR(uint256 _price, uint256 _TCR) internal view {\n require(_TCR >= MCR, \"CdpManager: Cannot redeem when TCR < MCR\");\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "01-salty", "title": "juancito Q", "severity_raw": "Critical", "severity": "critical", "description": "# QA Report\n\n## Low Severity Findings\n\n### L-1 - `callContract` proposals are created with no `description`\n\n## Impact\n\n`callContract` proposals will be created with no `description`. The `Proposal` contract will be bricked, as it can't be fixed on-chain. Off-chain tools and integrations will have to create special code to lead with this error. Integrating contracts will have to take this error into account as well.\n\n## Vulnerability Details\n\nNote how `description` is placed on the `string1` parameter of [_possiblyCreateProposal](https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/dao/Proposals.sol#L81) for `callContract` proposals. `string2` is actually used for the `description`, so its actual value here will be `\"\"`.\n\n```solidity\n // Proposes calling the callFromDAO(uint256) function on an arbitrary contract.\n function proposeCallContract( address contractAddress, uint256 number, string calldata description ) external nonReentrant returns (uint256 ballotID) {\n require( contractAddress != address(0), \"Contract address cannot be address(0)\" );\n\n string memory ballotName = string.concat(\"callContract:\", Strings.toHexString(address(contractAddress)) );\n\ud83d\udc49 return _possiblyCreateProposal( ballotName, BallotType.CALL_CONTRACT, contractAddress, number, description, \"\" );\n }\n```\n\n`string1` is used for calling attributes everywhere else, and `string2` is used instead for the `description`, like in [createConfirmationProposal()](https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/dao/Proposals.sol#L126), [`proposeParameterBallot()`](https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/dao/Proposals.sol#L158), [`proposeTokenWhitelisting()`](https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/dao/Proposals.sol#L173) just to name a few, but it holds for all proposals.\n\n## Recommended Mi", "vulnerable_code": " // Proposes calling the callFromDAO(uint256) function on an arbitrary contract.\n function proposeCallContract( address contractAddress, uint256 number, string calldata description ) external nonReentrant returns (uint256 ballotID) {\n require( contractAddress != address(0), \"Contract address cannot be address(0)\" );\n\n string memory ballotName = string.concat(\"callContract:\", Strings.toHexString(address(contractAddress)) );\n\ud83d\udc49 return _possiblyCreateProposal( ballotName, BallotType.CALL_CONTRACT, contractAddress, number, description, \"\" );\n }", "fixed_code": "### L-2 - `withdrawArbitrageProfits()` will revert when `depositedWETH <= PoolUtils.DUST`\n\n`withdrawArbitrageProfits()` will revert when attempting [to withdraw](https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/dao/DAO.sol#L304) less than the dust amount, [because of a check on the pool](https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/pools/Pools.sol#L222).\n\nThis is called [in step 2 of the Upkeep](https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/Upkeep.sol#L114).\n\n#### Recommendation\n\nSafely return when the `depositedWETH` is less than the pools dust:\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/juancito-Q.md", "collected_at": "2026-01-02T19:01:48.030900+00:00", "source_hash": "fe786c42593a3a722d5858768db3fe9d2934a8e74d2e491c1e4a7beb5046676d", "code_block_count": 1, "solidity_block_count": 1, "total_code_chars": 569, "github_ref_count": 7, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "// Proposes calling the callFromDAO(uint256) function on an arbitrary contract.\n function proposeCallContract( address contractAddress, uint256 number, string calldata description ) external nonReentrant returns (uint256 ballotID) {\n require( contractAddress != address(0), \"Contract address cannot be address(0)\" );\n\n string memory ballotName = string.concat(\"callContract:\", Strings.toHexString(address(contractAddress)) );\n\ud83d\udc49 return _possiblyCreateProposal( ballotName, BallotType.CALL_CONTRACT, contractAddress, number, description, \"\" );\n }", "primary_code_language": "solidity", "primary_code_char_count": 569, "all_code_blocks": "// Code block 1 (solidity):\n// Proposes calling the callFromDAO(uint256) function on an arbitrary contract.\n function proposeCallContract( address contractAddress, uint256 number, string calldata description ) external nonReentrant returns (uint256 ballotID) {\n require( contractAddress != address(0), \"Contract address cannot be address(0)\" );\n\n string memory ballotName = string.concat(\"callContract:\", Strings.toHexString(address(contractAddress)) );\n\ud83d\udc49 return _possiblyCreateProposal( ballotName, BallotType.CALL_CONTRACT, contractAddress, number, description, \"\" );\n }", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "// Proposes calling the callFromDAO(uint256) function on an arbitrary contract.\n function proposeCallContract( address contractAddress, uint256 number, string calldata description ) external nonReentrant returns (uint256 ballotID) {\n require( contractAddress != address(0), \"Contract address cannot be address(0)\" );\n\n string memory ballotName = string.concat(\"callContract:\", Strings.toHexString(address(contractAddress)) );\n\ud83d\udc49 return _possiblyCreateProposal( ballotName, BallotType.CALL_CONTRACT, contractAddress, number, description, \"\" );\n }", "github_refs_formatted": "Proposals.sol#L81, Proposals.sol#L126, Proposals.sol#L158, Proposals.sol#L173, DAO.sol#L304, Pools.sol#L222, Upkeep.sol#L114", "github_files_list": "Upkeep.sol, Proposals.sol, DAO.sol, Pools.sol", "github_refs_count": 7, "vulnerable_code_actual": " // Proposes calling the callFromDAO(uint256) function on an arbitrary contract.\n function proposeCallContract( address contractAddress, uint256 number, string calldata description ) external nonReentrant returns (uint256 ballotID) {\n require( contractAddress != address(0), \"Contract address cannot be address(0)\" );\n\n string memory ballotName = string.concat(\"callContract:\", Strings.toHexString(address(contractAddress)) );\n\ud83d\udc49 return _possiblyCreateProposal( ballotName, BallotType.CALL_CONTRACT, contractAddress, number, description, \"\" );\n }", "has_vulnerable_code_snippet": true, "fixed_code_actual": "### L-2 - `withdrawArbitrageProfits()` will revert when `depositedWETH <= PoolUtils.DUST`\n\n`withdrawArbitrageProfits()` will revert when attempting [to withdraw](https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/dao/DAO.sol#L304) less than the dust amount, [because of a check on the pool](https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/pools/Pools.sol#L222).\n\nThis is called [in step 2 of the Upkeep](https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/Upkeep.sol#L114).\n\n#### Recommendation\n\nSafely return when the `depositedWETH` is less than the pools dust:\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 7} {"source": "c4", "protocol": "05-ajna", "title": "TS G", "severity_raw": "Gas", "severity": "gas", "description": "# Gas Optimization\n## Caching the array length outside a loop saves reading it on each iteration\n\nIn none of the affected instances the array's length is changed. That means that it is possible to save gas by storing the length of the array outside of the loop. \n\nAffected instances:\n\n```\n/ajna-core/src/RewardsManager.sol#229\n/ajna-core/src/RewardsManager.sol#290\n/ajna-core/src/RewardsManager.sol#440\n/ajna-core/src/RewardsManager.sol#680\n/ajna-core/src/RewardsManager.sol#704\n/ajna-grants/src/grants/base/Funding.sol#62\n/ajna-grants/src/grants/base/Funding.sol#112\n/ajna-grants/src/grants/base/StandardFunding.sol#491\n```", "vulnerable_code": "/ajna-core/src/RewardsManager.sol#229\n/ajna-core/src/RewardsManager.sol#290\n/ajna-core/src/RewardsManager.sol#440\n/ajna-core/src/RewardsManager.sol#680\n/ajna-core/src/RewardsManager.sol#704\n/ajna-grants/src/grants/base/Funding.sol#62\n/ajna-grants/src/grants/base/Funding.sol#112\n/ajna-grants/src/grants/base/StandardFunding.sol#491", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-05-ajna-findings/blob/main/data/TS-G.md", "collected_at": "2026-01-02T18:21:15.853623+00:00", "source_hash": "fe7b72ef11b271dba64b8ba986a023af2eae86194fd09a4109c69bcda707e0ef", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 331, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "/ajna-core/src/RewardsManager.sol#229\n/ajna-core/src/RewardsManager.sol#290\n/ajna-core/src/RewardsManager.sol#440\n/ajna-core/src/RewardsManager.sol#680\n/ajna-core/src/RewardsManager.sol#704\n/ajna-grants/src/grants/base/Funding.sol#62\n/ajna-grants/src/grants/base/Funding.sol#112\n/ajna-grants/src/grants/base/StandardFunding.sol#491", "primary_code_language": "unknown", "primary_code_char_count": 331, "all_code_blocks": "// Code block 1 (unknown):\n/ajna-core/src/RewardsManager.sol#229\n/ajna-core/src/RewardsManager.sol#290\n/ajna-core/src/RewardsManager.sol#440\n/ajna-core/src/RewardsManager.sol#680\n/ajna-core/src/RewardsManager.sol#704\n/ajna-grants/src/grants/base/Funding.sol#62\n/ajna-grants/src/grants/base/Funding.sol#112\n/ajna-grants/src/grants/base/StandardFunding.sol#491", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "/ajna-core/src/RewardsManager.sol#229\n/ajna-core/src/RewardsManager.sol#290\n/ajna-core/src/RewardsManager.sol#440\n/ajna-core/src/RewardsManager.sol#680\n/ajna-core/src/RewardsManager.sol#704\n/ajna-grants/src/grants/base/Funding.sol#62\n/ajna-grants/src/grants/base/Funding.sol#112\n/ajna-grants/src/grants/base/StandardFunding.sol#491", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 3.25} {"source": "c4", "protocol": "06-lybra", "title": "bytes032 Q", "severity_raw": "Medium", "severity": "medium", "description": "## QA REPORT\n\n| | Issue |\n| ---- |:----------------------------------------------------------------------------------------- |\n| [01] | Flash loans can be exploited by whales |\n| [02] | The owner can set the flash loan fee to 100% |\n| [03] | Not following LayerZero's integration checklist |\n| [04] | EVM vs NON-EVM |\n| [05] | When setting tokenMiners, there could be duplicates that would lead to overwriting values |\n| [06] | The user can select non-existing lock settings |\n| [07] | If vault mint fee is not set, fees will be lost |\n| [08] | Optional proposal threshold is not optional |\n| [09] | Allowance might not be enough |\n| [10] | Keeper reward can be 0 |\n\n\n## [01] Flash loans can be exploited by whales \n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity 0.8.19;\nimport \"forge-std/Test.sol\";\nimport \"forge-std/console.sol\";\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\";\n\ncontract Test3 is Test {\n using SafeMath for uint256;\n uint256 private _totalShares = 13346578470111834461045143;\n uint256 private _totalSupply = 109628939112783448801625680;\n\n\n function getSharesByMintedEUSD(uint256 _EUSDAmount) public view returns (uint256) {\n uint256 totalMintedEUSD = _totalSupply;\n if (totalMintedEUSD == 0) {\n return 0;\n } else {\n return _EUSDAmount.mul(_totalShares).div(totalMintedEUSD);\n }\n }\n\n \n function getMintedEUSDBySha", "vulnerable_code": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.19;\nimport \"forge-std/Test.sol\";\nimport \"forge-std/console.sol\";\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\";\n\ncontract Test3 is Test {\n using SafeMath for uint256;\n uint256 private _totalShares = 13346578470111834461045143;\n uint256 private _totalSupply = 109628939112783448801625680;\n\n\n function getSharesByMintedEUSD(uint256 _EUSDAmount) public view returns (uint256) {\n uint256 totalMintedEUSD = _totalSupply;\n if (totalMintedEUSD == 0) {\n return 0;\n } else {\n return _EUSDAmount.mul(_totalShares).div(totalMintedEUSD);\n }\n }\n\n \n function getMintedEUSDByShares(uint256 _sharesAmount) public view returns (uint256) {\n if (_totalShares == 0) {\n return 0;\n } else {\n return _sharesAmount.mul(_totalSupply).div(_totalShares);\n }\n }\n \n function mint(uint256 _mintAmount) external returns (uint256 newTotalShares) {\n\n uint256 sharesAmount = getSharesByMintedEUSD(_mintAmount);\n if (sharesAmount == 0) {\n //EUSD totalSupply is 0: assume that shares correspond to EUSD 1-to-1\n sharesAmount = _mintAmount;\n }\n\n newTotalShares = _totalShares.add(sharesAmount);\n _totalShares = newTotalShares;\n\n _totalSupply += _mintAmount;\n }\n\n function burn(uint256 _burnAmount) public returns (uint256 newTotalShares) {\n uint256 sharesAmount = getSharesByMintedEUSD(_burnAmount);\n newTotalShares = _onlyBurnShares(sharesAmount);\n _totalSupply -= _burnAmount;\n }\n\n function _onlyBurnShares(uint256 _sharesAmount) private returns (uint256 newTotalShares) {\n newTotalShares = _totalShares.sub(_sharesAmount);\n _totalShares = newTotalShares;\n }\n function testPEUSDFlashLoan() external {\n uint256 amount = 500_000_000e18;\n uint256 shareAmount = getSharesByMintedEUSD(amount); \n burn(shareAmount);\n assertEq(getMintedEUSD", "fixed_code": " function setFlashloanFee(uint256 fee) external checkRole(TIMELOCK) {\n if (fee > 10_000) revert('EL');\n emit FlashloanFeeUpdated(fee);\n flashloanFee = fee;\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/bytes032-Q.md", "collected_at": "2026-01-02T18:22:53.449884+00:00", "source_hash": "ff047313c6de07c0c3a39f63242c7d39a93d6de1b66e24ec9e28414937e49f1b", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.19;\nimport \"forge-std/Test.sol\";\nimport \"forge-std/console.sol\";\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\";\n\ncontract Test3 is Test {\n using SafeMath for uint256;\n uint256 private _totalShares = 13346578470111834461045143;\n uint256 private _totalSupply = 109628939112783448801625680;\n\n\n function getSharesByMintedEUSD(uint256 _EUSDAmount) public view returns (uint256) {\n uint256 totalMintedEUSD = _totalSupply;\n if (totalMintedEUSD == 0) {\n return 0;\n } else {\n return _EUSDAmount.mul(_totalShares).div(totalMintedEUSD);\n }\n }\n\n \n function getMintedEUSDByShares(uint256 _sharesAmount) public view returns (uint256) {\n if (_totalShares == 0) {\n return 0;\n } else {\n return _sharesAmount.mul(_totalSupply).div(_totalShares);\n }\n }\n \n function mint(uint256 _mintAmount) external returns (uint256 newTotalShares) {\n\n uint256 sharesAmount = getSharesByMintedEUSD(_mintAmount);\n if (sharesAmount == 0) {\n //EUSD totalSupply is 0: assume that shares correspond to EUSD 1-to-1\n sharesAmount = _mintAmount;\n }\n\n newTotalShares = _totalShares.add(sharesAmount);\n _totalShares = newTotalShares;\n\n _totalSupply += _mintAmount;\n }\n\n function burn(uint256 _burnAmount) public returns (uint256 newTotalShares) {\n uint256 sharesAmount = getSharesByMintedEUSD(_burnAmount);\n newTotalShares = _onlyBurnShares(sharesAmount);\n _totalSupply -= _burnAmount;\n }\n\n function _onlyBurnShares(uint256 _sharesAmount) private returns (uint256 newTotalShares) {\n newTotalShares = _totalShares.sub(_sharesAmount);\n _totalShares = newTotalShares;\n }\n function testPEUSDFlashLoan() external {\n uint256 amount = 500_000_000e18;\n uint256 shareAmount = getSharesByMintedEUSD(amount); \n burn(shareAmount);\n assertEq(getMintedEUSD", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function setFlashloanFee(uint256 fee) external checkRole(TIMELOCK) {\n if (fee > 10_000) revert('EL');\n emit FlashloanFeeUpdated(fee);\n flashloanFee = fee;\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "02-ethos", "title": "ansoncrypto007 Q", "severity_raw": "Unknown", "severity": "unknown", "description": "### Checking in the incorrect position.\nhttps://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperVaultV2.sol#L324\n```\n323 uint256 pool = balance();\n324 require(pool + _amount <= tvlCap, \"Vault is full\");\n325\n326 uint256 freeFunds = _freeFunds();\n327 uint256 balBefore = token.balanceOf(address(this));\n328 token.safeTransferFrom(msg.sender, address(this), _amount);\n329 uint256 balAfter = token.balanceOf(address(this));\n330 _amount = balAfter - balBefore;\n```\n\n`require(pool + _amount <= tvlCap, \"Vault is full\");` should be checked after `_amount` reassignment.\nIf the token is an inflation token with fee logic when transferring, tvlCap should be checked based on the amount reached in the contract.", "vulnerable_code": "323 uint256 pool = balance();\n324 require(pool + _amount <= tvlCap, \"Vault is full\");\n325\n326 uint256 freeFunds = _freeFunds();\n327 uint256 balBefore = token.balanceOf(address(this));\n328 token.safeTransferFrom(msg.sender, address(this), _amount);\n329 uint256 balAfter = token.balanceOf(address(this));\n330 _amount = balAfter - balBefore;", "fixed_code": "", "recommendation": "", "category": "other", "report_url": "https://github.com/code-423n4/2023-02-ethos-findings/blob/main/data/ansoncrypto007-Q.md", "collected_at": "2026-01-02T18:16:47.233742+00:00", "source_hash": "ff0c29953f878303d16e2b1d931292e90cf53cdac2fd80d51751b8f1cbbdea6c", "code_block_count": 1, "solidity_block_count": 0, "total_code_chars": 387, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "323 uint256 pool = balance();\n324 require(pool + _amount <= tvlCap, \"Vault is full\");\n325\n326 uint256 freeFunds = _freeFunds();\n327 uint256 balBefore = token.balanceOf(address(this));\n328 token.safeTransferFrom(msg.sender, address(this), _amount);\n329 uint256 balAfter = token.balanceOf(address(this));\n330 _amount = balAfter - balBefore;", "primary_code_language": "unknown", "primary_code_char_count": 387, "all_code_blocks": "// Code block 1 (unknown):\n323 uint256 pool = balance();\n324 require(pool + _amount <= tvlCap, \"Vault is full\");\n325\n326 uint256 freeFunds = _freeFunds();\n327 uint256 balBefore = token.balanceOf(address(this));\n328 token.safeTransferFrom(msg.sender, address(this), _amount);\n329 uint256 balAfter = token.balanceOf(address(this));\n330 _amount = balAfter - balBefore;", "all_code_blocks_count": 1, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "ReaperVaultV2.sol#L324", "github_files_list": "ReaperVaultV2.sol", "github_refs_count": 1, "vulnerable_code_actual": "323 uint256 pool = balance();\n324 require(pool + _amount <= tvlCap, \"Vault is full\");\n325\n326 uint256 freeFunds = _freeFunds();\n327 uint256 balBefore = token.balanceOf(address(this));\n328 token.safeTransferFrom(msg.sender, address(this), _amount);\n329 uint256 balAfter = token.balanceOf(address(this));\n330 _amount = balAfter - balBefore;", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4.55} {"source": "c4", "protocol": "03-revert-lend", "title": "Bauchibred Q", "severity_raw": "High", "severity": "high", "description": "# QA Report for Revert Lend\n\n## Table of Contents\n\n| Issue ID | Description |\n| -------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |\n| [QA-01](#qa-01-min_twap_seconds-is-too-low-and-an-avenue-to-ingest-manipulated-prices) | `MIN_TWAP_SECONDS` is too low and an avenue to ingest manipulated prices |\n| [QA-02](#qa-02-unhandled-chainlink-revert-would-halt-core-functionalities) | Unhandled Chainlink revert would halt core functionalities |\n| [QA-03](#qa-03-_checkapprovals-should-be-reimplemented-to-count-for-the-allowance-depleting) | `_checkApprovals` should be reimplemented to count for the allowance depleting |\n| [QA-04](#qa-04-setters-should-always-have-equality-checkers) | Setters should always have equality checkers |\n| [QA-05](#qa-05-allow-totalrewardx64-to-be-set-higher-via-autocompound-setreward) | Allow `totalRewardX64` to be set higher via `AutoCompound.setReward()` |\n| [QA-06](#qa-06-pricing-logic-", "vulnerable_code": " function setTWAPConfig(uint16 _maxTWAPTickDifference, uint32 _TWAPSeconds) public onlyOwner {\n if (_TWAPSeconds < MIN_TWAP_SECONDS) {\n revert InvalidConfig();\n }\n if (_maxTWAPTickDifference > MAX_TWAP_TICK_DIFFERENCE) {\n revert InvalidConfig();\n }\n emit TWAPConfigChanged(_TWAPSeconds, _maxTWAPTickDifference);\n TWAPSeconds = _TWAPSeconds;\n maxTWAPTickDifference = _maxTWAPTickDifference;\n }\n", "fixed_code": " function _getChainlinkPriceX96(address token) internal view returns (uint256) {\n if (token == chainlinkReferenceToken) {\n return Q96;\n }\n\n TokenConfig memory feedConfig = feedConfigs[token];\n //@audit\n // if stale data - revert\n (, int256 answer,, uint256 updatedAt,) = feedConfig.feed.latestRoundData();\n if (updatedAt + feedConfig.maxFeedAge < block.timestamp || answer < 0) {\n revert ChainlinkPriceError();\n }\n\n return uint256(answer) * Q96 / (10 ** feedConfig.feedDecimals);\n }", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2024-03-revert-lend-findings/blob/main/data/Bauchibred-Q.md", "collected_at": "2026-01-02T19:02:58.356457+00:00", "source_hash": "ff0cf5ff49f9e2778539ebe0a3777dac2d30a7aef6a95e7ba9ab6ec494578b0e", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": " function setTWAPConfig(uint16 _maxTWAPTickDifference, uint32 _TWAPSeconds) public onlyOwner {\n if (_TWAPSeconds < MIN_TWAP_SECONDS) {\n revert InvalidConfig();\n }\n if (_maxTWAPTickDifference > MAX_TWAP_TICK_DIFFERENCE) {\n revert InvalidConfig();\n }\n emit TWAPConfigChanged(_TWAPSeconds, _maxTWAPTickDifference);\n TWAPSeconds = _TWAPSeconds;\n maxTWAPTickDifference = _maxTWAPTickDifference;\n }\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": " function _getChainlinkPriceX96(address token) internal view returns (uint256) {\n if (token == chainlinkReferenceToken) {\n return Q96;\n }\n\n TokenConfig memory feedConfig = feedConfigs[token];\n //@audit\n // if stale data - revert\n (, int256 answer,, uint256 updatedAt,) = feedConfig.feed.latestRoundData();\n if (updatedAt + feedConfig.maxFeedAge < block.timestamp || answer < 0) {\n revert ChainlinkPriceError();\n }\n\n return uint256(answer) * Q96 / (10 ** feedConfig.feedDecimals);\n }", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5} {"source": "c4", "protocol": "09-ondo", "title": "ybansal2403 G", "severity_raw": "Gas", "severity": "gas", "description": "| Number | Optimization Details | Instances |\n| :----: | :--------------------------------------------------------------------------------- | :-------: |\n| [G-01] | Do not calculate constant variables | 7 |\n| [G-02] | Non efficient zero initialization | 7 |\n| [G-03] | Using ternary operator instead of if else saves gas | 2 |\n| [G-04] | Pre-increment and pre-decrement are cheaper as compared to post increment and post decrement | 1 |\n\nTotal 4 issues\n\n## [G-01] Do not calculate constant variables\n\nDue to how constant variables are implemented (replacements at compile-time), an expression assigned to a constant variable is recomputed each time that the variable is used, which wastes some gas each time of use.\n\n_Total 7 instances - 1 files:_\n\n### Instance#1-5 : Assign direct simple constant value after calculating off chain\n\n```solidity\nFile : contracts/usdy/rUSDY.sol\n\n97: bytes32 public constant USDY_MANAGER_ROLE = keccak256(\"ADMIN_ROLE\");\n98: bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n99: bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n100: bytes32 public constant BURNER_ROLE = keccak256(\"BURN_ROLE\");\n101: bytes32 public constant LIST_CONFIGURER_ROLE =\n102: keccak256(\"LIST_CONFIGURER_ROLE\");\n\n```\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contracts/usdy/rUSDY.sol#L97C3-L102C39\n\n### Instance#6-7 : Assign direct simple constant value after calculating off chain\n\n```solidity\nFile : contracts/rwaOracles/RWADynamicOracle.sol\n\n27: bytes32 public constant SETTER_ROLE = keccak256(\"SETTER_ROLE\");\n28: bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n\n```\n\nhttps://github.com/code-423n4/2023-09-ondo/blob/main/contrac", "vulnerable_code": "File : contracts/usdy/rUSDY.sol\n\n97: bytes32 public constant USDY_MANAGER_ROLE = keccak256(\"ADMIN_ROLE\");\n98: bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n99: bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n100: bytes32 public constant BURNER_ROLE = keccak256(\"BURN_ROLE\");\n101: bytes32 public constant LIST_CONFIGURER_ROLE =\n102: keccak256(\"LIST_CONFIGURER_ROLE\");\n", "fixed_code": "File : contracts/rwaOracles/RWADynamicOracle.sol\n\n27: bytes32 public constant SETTER_ROLE = keccak256(\"SETTER_ROLE\");\n28: bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-09-ondo-findings/blob/main/data/ybansal2403-G.md", "collected_at": "2026-01-02T18:26:22.048960+00:00", "source_hash": "ff12775ba265e06ef1793fad644202fa3891b996bdf295a7d02a6d6e80ca17f2", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 593, "github_ref_count": 1, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "File : contracts/usdy/rUSDY.sol\n\n97: bytes32 public constant USDY_MANAGER_ROLE = keccak256(\"ADMIN_ROLE\");\n98: bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n99: bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n100: bytes32 public constant BURNER_ROLE = keccak256(\"BURN_ROLE\");\n101: bytes32 public constant LIST_CONFIGURER_ROLE =\n102: keccak256(\"LIST_CONFIGURER_ROLE\");", "primary_code_language": "solidity", "primary_code_char_count": 406, "all_code_blocks": "// Code block 1 (solidity):\nFile : contracts/usdy/rUSDY.sol\n\n97: bytes32 public constant USDY_MANAGER_ROLE = keccak256(\"ADMIN_ROLE\");\n98: bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n99: bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n100: bytes32 public constant BURNER_ROLE = keccak256(\"BURN_ROLE\");\n101: bytes32 public constant LIST_CONFIGURER_ROLE =\n102: keccak256(\"LIST_CONFIGURER_ROLE\");\n\n// Code block 2 (solidity):\nFile : contracts/rwaOracles/RWADynamicOracle.sol\n\n27: bytes32 public constant SETTER_ROLE = keccak256(\"SETTER_ROLE\");\n28: bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "File : contracts/usdy/rUSDY.sol\n\n97: bytes32 public constant USDY_MANAGER_ROLE = keccak256(\"ADMIN_ROLE\");\n98: bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n99: bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n100: bytes32 public constant BURNER_ROLE = keccak256(\"BURN_ROLE\");\n101: bytes32 public constant LIST_CONFIGURER_ROLE =\n102: keccak256(\"LIST_CONFIGURER_ROLE\");\n\nFile : contracts/rwaOracles/RWADynamicOracle.sol\n\n27: bytes32 public constant SETTER_ROLE = keccak256(\"SETTER_ROLE\");\n28: bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");", "github_refs_formatted": "rUSDY.sol#L97-L3", "github_files_list": "rUSDY.sol", "github_refs_count": 1, "vulnerable_code_actual": "File : contracts/usdy/rUSDY.sol\n\n97: bytes32 public constant USDY_MANAGER_ROLE = keccak256(\"ADMIN_ROLE\");\n98: bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n99: bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n100: bytes32 public constant BURNER_ROLE = keccak256(\"BURN_ROLE\");\n101: bytes32 public constant LIST_CONFIGURER_ROLE =\n102: keccak256(\"LIST_CONFIGURER_ROLE\");\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File : contracts/rwaOracles/RWADynamicOracle.sol\n\n27: bytes32 public constant SETTER_ROLE = keccak256(\"SETTER_ROLE\");\n28: bytes32 public constant PAUSER_ROLE = keccak256(\"PAUSER_ROLE\");\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "06-lybra", "title": "Rageur G", "severity_raw": "Medium", "severity": "medium", "description": "## GAS-1: * 2 costs more gas then << 1\n\n### Description\n\nUsing bitwize operator instead of '*' or '/' saves gas.\n\n### Affected file\n\n* LybraEUSDVaultBase.sol (Line: 159)\n* LybraPeUSDVaultBase.sol (Line: 130)\n\n## GAS-2: Add unchecked{} for subtractions where the operands cannot underflow because of a previous require() or if statement\n\n### Description\n\nrequire(a <= b); x = b - a => require(a <= b); unchecked { x = b - a }\n if(a <= b); x = b - a => if(a <= b); unchecked { x = b - a }\n This will stop the check for overflow and underflow so it will save gas.\n\n### Affected file\n\n* LBR.sol (Line: 22)\n* LybraPeUSDVaultBase.sol (Line: 200)\n* LybraStETHVault.sol (Line: 75, 78)\n* PeUSD.sol (Line: 14)\n* PeUSDMainnetStableVision.sol (Line: 60)\n* ProtocolRewardsPool.sol (Line: 201, 202, 203, 209, 211)\n\n## GAS-3: Caching global variables is more expensive than using the actual variable\n\n### Description\n\n It\u2019s cheaper to use global variable as compared to caching.\n\n### Affected file\n\n* EUSDMiningIncentives.sol (Line: 240)\n* LybraEUSDVaultBase.sol (Line: 297)\n* LybraStETHVault.sol (Line: 43, 92)\n* stakerewardV2pool.sol (Line: 143)\n\n## GAS-4: Do not calculate constants\n\n### Description\n\nDue to how constant variables are implemented (replacements at compile-time), an expression assigned to a constant variable is recomputed each time that the variable is used, which wastes some gas.\n\n### Affected file\n\n* GovernanceTimelock.sol (Line: 10, 11, 12, 13)\n* LybraConfigurator.sol (Line: 76, 77, 78)\n\n## GAS-5: Internal functions not called by the contract should be removed to save deployment gas\n\n### Description\n\nIf the functions are required by an interface, the contract should inherit from that interface and use the override keyword.\n\n### Affected file\n\n* LBR.sol (Line: 49, 56, 61, 70)\n* LybraEUSDVaultBase.sol (Line: 307)\n* LybraGovernance.sol (Line: 59, 66, 76, 98)\n* LybraPeUSDVaultBase.sol (Line: 244)\n* PeUSD.sol (Line: 31, 38, 43, 52)\n* PeUSDMainnetStableVision.sol (Line: 184, 19", "vulnerable_code": "assembly {\n if iszero(_addr) {\n mstore(0x00, \"zero address\")\n revert(0x00, 0x20)\n }\n}", "fixed_code": "", "recommendation": "", "category": "access-control", "report_url": "https://github.com/code-423n4/2023-06-lybra-findings/blob/main/data/Rageur-G.md", "collected_at": "2026-01-02T18:22:35.942399+00:00", "source_hash": "ff8e37360f4248d60a30cb01ff973760d1b6f8fe2d6b8f4b5fe1d84109699e9a", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": true, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "assembly {\n if iszero(_addr) {\n mstore(0x00, \"zero address\")\n revert(0x00, 0x20)\n }\n}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "", "has_fixed_code_snippet": false, "has_vuln_fix_pair": false, "content_richness_score": 4} {"source": "c4", "protocol": "01-salty", "title": "inzinko Q", "severity_raw": "Low", "severity": "low", "description": "## [L-01] Users can still vote after the ballot expiry is over\n\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/dao/Proposals.sol#L259C2-L293C4\n\nIf the Ballot end time has been completed, users are not supposed to be able to cast vote again, but the cast vote does not check that the ballot end time has reached\n```solidity\nfunction castVote( uint256 ballotID, Vote vote ) external nonReentrant\n\t\t{\n\t\tBallot memory ballot = ballots[ballotID];\n\n\t\t// Require that the ballot is actually live\n\t\trequire( ballot.ballotIsLive, \"The specified ballot is not open for voting\" );\n\n//@audit This check here that asks if the ballot is live or not does not prove that the ballot end time has been completed, because that value is only updated if the ballot has been finalized\n\n...more code\n\t\t}\n```\n\n- Only on finalizeBallot does ballotIsLive gets updated\nThis means that before finalize ballot is called users can still cast their vote\n\nMitigation \nImplement a check to see if The ballot duration has ended \n\n## [L-02] Different amount of SALT rewards from Protocol Owned Liquidity to be burnt from the Docs and the Code Implementation\n\nIn the Docs of the project, it says that 45% of SALT rewards must be burnt, but this value is different in the code \n\nthe docs as shown below \n\n> It generates yield for the DAO in the form of SALT. By default 45% of this generated SALT is burned.\n\nhttps://docs.salty.io/decentralization/protocol-owned-liquidity\n\nBut in the code of the `DAOConfig` The Value is 50%\n\nas shown below\n\nhttps://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/dao/DAOConfig.sol#L26C2-L28C49\n\n```solidity\n// For rewards distributed to the DAO, the percentage of SALT that is burned with the remaining staying in the DAO for later use.\n\t// Range: 25% to 75% with an adjustment of 5%\n uint256 public percentPolRewardsBurned = 50;\n```\n## [L-03] Pools contract can contain Unwhitelisted Tokens \n\nIn the `Pools::dep", "vulnerable_code": "function castVote( uint256 ballotID, Vote vote ) external nonReentrant\n\t\t{\n\t\tBallot memory ballot = ballots[ballotID];\n\n\t\t// Require that the ballot is actually live\n\t\trequire( ballot.ballotIsLive, \"The specified ballot is not open for voting\" );\n\n//@audit This check here that asks if the ballot is live or not does not prove that the ballot end time has been completed, because that value is only updated if the ballot has been finalized\n\n...more code\n\t\t}", "fixed_code": "// For rewards distributed to the DAO, the percentage of SALT that is burned with the remaining staying in the DAO for later use.\n\t// Range: 25% to 75% with an adjustment of 5%\n uint256 public percentPolRewardsBurned = 50;", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/inzinko-Q.md", "collected_at": "2026-01-02T19:01:45.320761+00:00", "source_hash": "ff91c17aa941f296b38237c6dca8f7404c3d2d80bfd1720029f00a2f95028599", "code_block_count": 2, "solidity_block_count": 2, "total_code_chars": 682, "github_ref_count": 2, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": true, "has_recommendation": false, "quality_estimate": "high", "primary_code": "function castVote( uint256 ballotID, Vote vote ) external nonReentrant\n\t\t{\n\t\tBallot memory ballot = ballots[ballotID];\n\n\t\t// Require that the ballot is actually live\n\t\trequire( ballot.ballotIsLive, \"The specified ballot is not open for voting\" );\n\n//@audit This check here that asks if the ballot is live or not does not prove that the ballot end time has been completed, because that value is only updated if the ballot has been finalized\n\n...more code\n\t\t}", "primary_code_language": "solidity", "primary_code_char_count": 457, "all_code_blocks": "// Code block 1 (solidity):\nfunction castVote( uint256 ballotID, Vote vote ) external nonReentrant\n\t\t{\n\t\tBallot memory ballot = ballots[ballotID];\n\n\t\t// Require that the ballot is actually live\n\t\trequire( ballot.ballotIsLive, \"The specified ballot is not open for voting\" );\n\n//@audit This check here that asks if the ballot is live or not does not prove that the ballot end time has been completed, because that value is only updated if the ballot has been finalized\n\n...more code\n\t\t}\n\n// Code block 2 (solidity):\n// For rewards distributed to the DAO, the percentage of SALT that is burned with the remaining staying in the DAO for later use.\n\t// Range: 25% to 75% with an adjustment of 5%\n uint256 public percentPolRewardsBurned = 50;", "all_code_blocks_count": 2, "has_diff_blocks": false, "diff_code": "", "solidity_code": "function castVote( uint256 ballotID, Vote vote ) external nonReentrant\n\t\t{\n\t\tBallot memory ballot = ballots[ballotID];\n\n\t\t// Require that the ballot is actually live\n\t\trequire( ballot.ballotIsLive, \"The specified ballot is not open for voting\" );\n\n//@audit This check here that asks if the ballot is live or not does not prove that the ballot end time has been completed, because that value is only updated if the ballot has been finalized\n\n...more code\n\t\t}\n\n// For rewards distributed to the DAO, the percentage of SALT that is burned with the remaining staying in the DAO for later use.\n\t// Range: 25% to 75% with an adjustment of 5%\n uint256 public percentPolRewardsBurned = 50;", "github_refs_formatted": "Proposals.sol#L259-L2, DAOConfig.sol#L26-L2", "github_files_list": "DAOConfig.sol, Proposals.sol", "github_refs_count": 2, "vulnerable_code_actual": "function castVote( uint256 ballotID, Vote vote ) external nonReentrant\n\t\t{\n\t\tBallot memory ballot = ballots[ballotID];\n\n\t\t// Require that the ballot is actually live\n\t\trequire( ballot.ballotIsLive, \"The specified ballot is not open for voting\" );\n\n//@audit This check here that asks if the ballot is live or not does not prove that the ballot end time has been completed, because that value is only updated if the ballot has been finalized\n\n...more code\n\t\t}", "has_vulnerable_code_snippet": true, "fixed_code_actual": "// For rewards distributed to the DAO, the percentage of SALT that is burned with the remaining staying in the DAO for later use.\n\t// Range: 25% to 75% with an adjustment of 5%\n uint256 public percentPolRewardsBurned = 50;", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 8} {"source": "c4", "protocol": "01-salty", "title": "Rolezn G", "severity_raw": "High", "severity": "high", "description": "## GAS Summary\n\n### Gas Optimizations\n| |Issue|Contexts|Estimated Gas Saved|\n|-|:-|:-|:-:|\n| [GAS‑1](#GAS‑1) | `address(this)` can be stored in `state variable` that will ultimately cost less, than every time calculating this, specifically when it used multiple times in a `contract` | 5 | 250 |\n| [GAS‑2](#GAS‑2) | Avoid repeating computations | 4 | - |\n| [GAS‑3](#GAS‑3) | Consider using solady's 'FixedPointMathLib' | 63 | - |\n| [GAS‑4](#GAS‑4) | Counting down in `for` statements is more gas efficient | 12 | 3084 |\n| [GAS‑5](#GAS‑5) | Duplicated `require()`/`revert()` Checks Should Be Refactored To A Modifier Or Function | 13 | 364 |\n| [GAS‑6](#GAS‑6) | Using `delete` statement can save gas | 6 | 48 |\n| [GAS‑7](#GAS‑7) | Increments can be `unchecked` to save gas | 27 | 810 |\n| [GAS‑8](#GAS‑8) | The result of a function call should be cached rather than re-calling the function | 26 | 1300 |\n| [GAS‑9](#GAS‑9) | Usage of `uints`/`ints` smaller than 32 bytes (256 bits) incurs overhead | 2 | 12 |\n| [GAS‑10](#GAS‑10) | Use assembly to validate `msg.sender` | 2 | 24 |\n| [GAS‑11](#GAS‑11) | Using XOR (^) and AND (&) bitwise equivalents for gas optimizations | 117 | 1521 |\n| [GAS‑12](#GAS‑12) | Using assembly to check for zero can save gas | 39 | 234 |\n| [GAS‑13](#GAS‑13) | Using `constant`s instead of `enum` can save gas | 1 | - |\n| [GAS‑14](#GAS‑14) | The more likely conditional `require` can be checked first | 3 | - |\n| [GAS‑15](#GAS‑15) | Move `proposals.ballotForID(ballotID)` call after the conditional checks to save gas | 1 | - |\n| [GAS‑16](#GAS‑16) | Move `uint256 minUnstakePercent = stakingConfig.minUnstakePercent();` call after the conditional checks to save gas | 1 | - |\n\nTotal: 379 contexts over 16 issues\n\n## Gas Optimizati", "vulnerable_code": "File: DAO.sol\n\n170: if ( exchangeConfig.salt().balanceOf(address(this)) >= ballot.number1 )\n\n", "fixed_code": "File: DAO.sol\n\n246: uint256 saltBalance = exchangeConfig.salt().balanceOf( address(this) );\n\n", "recommendation": "", "category": "reentrancy", "report_url": "https://github.com/code-423n4/2024-01-salty-findings/blob/main/data/Rolezn-G.md", "collected_at": "2026-01-02T19:01:27.319183+00:00", "source_hash": "ffaa9d97a15438a6b26cb408ffc7760ee2b8ace46c86f05cf90bc32eb976765a", "code_block_count": 0, "solidity_block_count": 0, "total_code_chars": 0, "github_ref_count": 0, "vulnerable_code_is_url": false, "fixed_code_is_url": false, "has_code_in_description": false, "has_recommendation": false, "quality_estimate": "medium", "primary_code": "", "primary_code_language": "", "primary_code_char_count": 0, "all_code_blocks": "", "all_code_blocks_count": 0, "has_diff_blocks": false, "diff_code": "", "solidity_code": "", "github_refs_formatted": "", "github_files_list": "", "github_refs_count": 0, "vulnerable_code_actual": "File: DAO.sol\n\n170: if ( exchangeConfig.salt().balanceOf(address(this)) >= ballot.number1 )\n\n", "has_vulnerable_code_snippet": true, "fixed_code_actual": "File: DAO.sol\n\n246: uint256 saltBalance = exchangeConfig.salt().balanceOf( address(this) );\n\n", "has_fixed_code_snippet": true, "has_vuln_fix_pair": true, "content_richness_score": 5}