Platform: Code4rena
Start Date: 23/11/2022
Pot Size: $24,500 CANTO
Total HM: 5
Participants: 37
Period: 5 days
Judge: berndartmueller
Total Solo HM: 2
Id: 185
League: ETH
Rank: 23/37
Findings: 1
Award: $13.69
๐ Selected for report: 0
๐ Solo Findings: 0
๐ Selected for report: Tricko
Also found by: 0xhacksmithh, AkshaySrivastav, Awesome, Beepidibop, Deivitto, DijkstraDev, Dinesh11G, Englave, JC, Rahoz, RaymondFam, ReyAdmirado, SaeedAlipoor01988, Sathish9098, abiih, aphak5010, chaduke, chrisdior4, exolorkistis, gzeon, martin, nicobevi, oyc_109, peritoflores, rotcivegaf
84.7394 CANTO - $13.69
Total: 5 instances in 3 issues
Instance (1):
Turnstile.sol https://github.com/code-423n4/2022-11-canto/blob/main/CIP-001/src/Turnstile.sol#L151
The 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. 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{...}})
Instance (1):
Turnstile.sol https://github.com/code-423n4/2022-11-canto/blob/main/CIP-001/src/Turnstile.sol#L57
Public functions not called by the contract should be declared external instead. Contracts are allowed to override their parentsโ functions and change the visibility from external to public and can save gas by doing so. https://docs.soliditylang.org/en/latest/contracts.html#function-overriding
Instance (3):
Turnstile.sol https://github.com/code-423n4/2022-11-canto/blob/main/CIP-001/src/Turnstile.sol#L107 https://github.com/code-423n4/2022-11-canto/blob/main/CIP-001/src/Turnstile.sol#L128 https://github.com/code-423n4/2022-11-canto/blob/main/CIP-001/src/Turnstile.sol#L148
#0 - c4-judge
2022-11-29T19:09:49Z
berndartmueller marked the issue as grade-b