Platform: Code4rena
Start Date: 01/08/2023
Pot Size: $91,500 USDC
Total HM: 14
Participants: 80
Period: 6 days
Judge: gzeon
Total Solo HM: 6
Id: 269
League: ETH
Rank: 48/80
Findings: 2
Award: $28.23
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: dd0x7e8
Also found by: Bughunter101, Fulum, Kaysoft, MatricksDeCoder, SanketKogekar, Sathish9098, T1MOH, Udsen, debo, fatherOfBlocks, grearlake, hpsb, j4ld1na, josephdara, parsely, pep7siup, piyushshukla, ravikiranweb3, shirochan
12.8772 USDC - $12.88
https://github.com/code-423n4/2023-08-goodentry/blob/71c0c0eca8af957202ccdbf5ce2f2a514ffe2e24/contracts/helper/V3Proxy.sol#L156 https://github.com/code-423n4/2023-08-goodentry/blob/71c0c0eca8af957202ccdbf5ce2f2a514ffe2e24/contracts/helper/V3Proxy.sol#L174 https://github.com/code-423n4/2023-08-goodentry/blob/71c0c0eca8af957202ccdbf5ce2f2a514ffe2e24/contracts/helper/V3Proxy.sol#L192
Three low level calls are made, msg.sender.call{value:}, but the result is not validated if it was correct. This could generate inconsistency in the state of the contracts, if it returned false, because it would change states, but without transferring the gas.
validate the return of the calls and revert if necessary.
Invalid Validation
#0 - c4-pre-sort
2023-08-09T02:07:55Z
141345 marked the issue as duplicate of #481
#1 - c4-pre-sort
2023-08-09T09:25:55Z
141345 marked the issue as duplicate of #83
#2 - c4-judge
2023-08-20T17:11:15Z
gzeon-c4 marked the issue as satisfactory
🌟 Selected for report: Team_FliBit
Also found by: 0x70C9, 3docSec, 8olidity, DavidGiladi, Krace, LokiThe5th, Rolezn, Sathish9098, UniversalCrypto, banpaleo5, catellatech, digitizeworx, fatherOfBlocks, hpsb, j4ld1na, josephdara, kutugu, niser93, nonseodion, oakcobalt, osmanozdemir1, pep7siup, ravikiranweb3, said, sivanesh_808
15.3494 USDC - $15.35
OptionsPositionManager.sol
L367/524 - A division is made by: oracle.getAssetPrice(collateralAsset), before executing the operation it should be validated that the oracle value is != 0, to handle the exception if it happens.
L516/517/518/519/520 - There is commented code, which should be removed, since it is not used and generates a reduction in the understanding of the code.
RangeManager.g
PoolAddress.sol
L38/39 - abi.encodePacked() should not be used with dynamic types when passing the result to a hash function such as keccak256() Use 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. If all arguments are strings and or bytes, bytes.concat() should be used instead.
The contract is a library, but it is in the interfaces folder, this is confusing and should be modified, as it can cause confusion for programmers looking at the source code.
PositionManager.sol
L23 - The variable ROEROUTER is created in storage, for a matter of convention, the name should preferably be separated with underscore: ROE_ROUTER.
L89 - The name of the function in cleanup, but having two words would not be respecting snake case, the correct name should be: cleanUp().
L143/144 - When carrying out a previous validation, the unchecked operation could be carried out, since there would be no way to generate underflow.
V3Proxy.sol
GeVault.sol
L8 - IAaveLendingPoolV2 is imported, but never used.
L62 - The constant nearbyRanges is created, as a matter of convention, the name should preferably be in uppercase: NEARBY_RANGES.
L222/376 - A division is made by: oracle.getAssetPrice(token), before executing the operation it should be validated that the value of the oracle is != 0, to handle the exception if it happens.
L247/255/261 - The deposit() function has two deposit mechanisms, one for gas and the other for tokens, the problem with this is that if one sets the two variables, send gas and put a different value to amount, to the user It is not clear what is being executed, also making the amount input useless. The recommendation is to create two different functions, one for tokens and one for gas.
L247 - The deposit() function has multiple logics inside, therefore they should use auxiliary functions to provide greater simplicity and readability in the code.
#0 - c4-judge
2023-08-20T16:38:25Z
gzeon-c4 marked the issue as grade-b