Platform: Code4rena
Start Date: 31/01/2023
Pot Size: $36,500 CANTO
Total HM: 5
Participants: 38
Period: 3 days
Judge: berndartmueller
Total Solo HM: 2
Id: 212
League: ETH
Rank: 33/38
Findings: 1
Award: $44.97
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: HardlyDifficult
Also found by: 0xAgro, 0xSmartContract, Aymen0909, DevABDee, JC, Matin, Rolezn, SleepingBugs, adriro, brevis, btk, chaduke, d3e4, enckrish, hihen, joestakey, libratus, merlin, nicobevi, rotcivegaf, shark, sorrynotsorry
149.2473 CANTO - $44.97
Issue index | |
---|---|
1 | Missing checks for address(0x0) when assigning values to address state or immutable variables |
address
state or immutable
variablesNOTE
: None of these findings where found by 4naly3er output - NC
Zero address should be checked for state variables, immutable variables. A zero address can lead into problems.
0 address control should be done in these parts
[CidNFT.sol#L129-L130](https://github.com/code-423n4/2023-01-canto-identity/blob/d7843c5d7ab731ba959cdb1389ba6bd5a2f5bbd3/src/CidNFT.sol#L129-L130
[SubprotocolRegistry.sol#L66](https://github.com/code-423n4/2023-01-canto-identity/blob/d7843c5d7ab731ba959cdb1389ba6bd5a2f5bbd3/src/SubprotocolRegistry.sol#L66
Check zero address before assigning or using it
Usually lines in source code are limited to 80 characters. Today’s screens are much larger so it’s reasonable to stretch this in some cases. Solidity newer guidelines suggest 120 characters. Reference: Long lines should be wrapped to conform with Solidity Style guidelines
Following lines with more than 120:
NOTE
: None of these findings where found by 4naly3er output - NC
1e18
) rather than exponentiation (e.g. 10 ** 18
)NatSpec is missing for the following functions / constructor / modifiers:
In a some places, a parameter is missing in the documentation:
If Return parameters are declared, you must prefix them with ”/// @return”. References
Some code analysis programs do analysis by reading NatSpec details, if they can’t see the @return
tag, they do incomplete analysis.
Include return parameters in NatSpec comments
Recommendation Code Style:
/// @notice information about what a fooFighter function does /// @param fooParam what the fooParam represents /// @return what is the fooReturnValue returned by fooFighter function fooFighter(uint256 fooParam) public returns (uint256 fooReturnValue) { ... }
#0 - c4-judge
2023-02-18T12:58:28Z
berndartmueller marked the issue as grade-b