Platform: Code4rena
Start Date: 18/10/2022
Pot Size: $50,000 USDC
Total HM: 13
Participants: 67
Period: 5 days
Judge: Picodes
Total Solo HM: 7
Id: 172
League: ETH
Rank: 33/67
Findings: 1
Award: $37.88
๐ Selected for report: 0
๐ Solo Findings: 0
๐ Selected for report: berndartmueller
Also found by: 0x1f8b, 0x4non, 0xNazgul, 0xSmartContract, Aymen0909, BClabs, Diana, Jeiwan, Lambda, LeoS, RaoulSchaffranek, RaymondFam, RedOneN, ReyAdmirado, Rolezn, SaharAP, Trust, V_B, __141345__, a12jmx, bharg4v, brgltd, carlitox477, ch0bu, chaduke, cloudjunky, cryptostellar5, cryptphi, csanuragjain, d3e4, delfin454000, erictee, fatherOfBlocks, hansfriese, ignacio, joestakey, karanctf, ladboy233, lukris02, mcwildy, minhtrng, peanuts, ret2basic, seyni, slowmoses, svskaushik, tnevler, yixxas
37.8829 USDC - $37.88
Severity: Low
Context: JBTiered721Delegate.sol#L321
, JBTiered721Delegate.sol#L370
, JBTiered721Delegate.sol#L386
, JBTiered721Delegate.sol#L402
, JBTiered721Delegate.sol#L418
Description: When critical parameters of systems need to be changed, it is required to broadcast the change via event emission and recommended to enforce the changes after a time-delay. This is to allow system users to be aware of such critical changes and give them an opportunity to exit or adjust their engagement with the system accordingly. None of the onlyOwner functions that change critical protocol addresses/parameters have a timelock for a time-delayed change to alert: (1) users and give them a chance to engage/exit protocol if they are not agreeable to the changes (2) team in case of compromised owner(s) and give them a chance to perform incident response.
Recommendation: Users may be surprised when critical parameters are changed. Furthermore, it can erode users' trust since they canโt be sure the protocol rules wonโt be changed later on. Compromised owner keys may be used to change protocol addresses/parameters to benefit attackers. Without a time-delay, authorised owners have no time for any planned incident response.
Severity: Low
Context: JB721Delegate.sol#L203
, JBTiered721Delegate.sol#L202
Description: Lack of zero-address validation on address parameters may lead to transaction reverts, waste gas, require resubmission of transactions and may even force contract redeployments in certain cases within the protocol.
Recommendation: Consider adding explicit zero-address validation on input parameters of address type.
Severity: Low
Context: JBTiered721Delegate.sol#L321
, JBTiered721Delegate.sol#L370
, JBTiered721Delegate.sol#L386
, JBTiered721Delegate.sol#L402
, JBTiered721Delegate.sol#L418
Description: Setter functions are missing checks to validate if the new value being set is the same as the current value already set in the contract. Such checks will showcase mismatches between on-chain and off-chain states.
Recommendation: This may hinder detecting discrepancies between on-chain and off-chain states leading to flawed assumptions of on-chain state and protocol behavior.
Severity: Low
Context: JB721Delegate.sol#L203
, JBTiered721Delegate.sol#L202
Description: None of the initialize functions emit emit init-specific events. They all however have the initializer modifier (from Initializable) so that they can be called only once. Off-chain monitoring of calls to these critical functions is not possible.
Recommendation: It is recommended to emit events in your initialization functions.
Severity Informational
Context: JB721Delegate.sol#L110-L111
, JB721GlobalGovernance.sol#L37
, JBTiered721Delegate.sol#L123
, JBTiered721DelegateProjectDeployer.sol#L119
, JBTiered721DelegateProjectDeployer.sol#L162
Description: The linked function(s) have a named return that is not used. Using both named returns and a return statement isn't necessary.
Recommendation: Removing one of those can improve code clarity.
Severity: Informational
Context: JB721Delegate.sol#L221
, JB721Delegate.sol#L229
, JB721Delegate.sol#L242
, JB721Delegate.sol#L250
, JB721TieredGovernance.sol#L235
, JBBitmap.sol#L37
, JBTiered721Delegate.sol#L17
, JBTiered721Delegate.sol#L21
, JBTiered721Delegate.sol#L27
, JBTiered721Delegate.sol#L94
, JBTiered721Delegate.sol#L198
, JBTiered721Delegate.sol#L542
, JBTiered721Delegate.sol#L545
, JBTiered721Delegate.sol#L548
, JBTiered721DelegateDeployer.sol#L15
Description: Max line length must be no more than 120 but many lines are extended past this length.
Recommendation: Consider cutting down the line length below 120.
Severity Informational
Context: JBBitmap.sol#L73
Description:
The linked variables do not conform to the standard naming convention of Solidity whereby functions and variable names(local and state) utilize the mixedCase
format unless variables are declared as constant
in which case they utilize the UPPER_CASE_WITH_UNDERSCORES
format. Private variables and functions should lead with an _underscore
.
Recommendation: Consider naming conventions utilized by the linked statements are adjusted to reflect the correct type of declaration according to the Solidity style guide.
Severity: Informational
Context: JBBitmap.sol#L37
Description: The best-practice layout for a contract should follow the following order: state variables, events, modifiers, constructor and functions. Function ordering helps readers identify which functions they can call and find constructor and fallback functions easier. Functions should be grouped according to their visibility and ordered as: constructor, receive function (if exists), fallback function (if exists), external, public, internal, private. Functions should then further be ordered with view functions coming after the non-view labeled ones.
Recommendation: Consider adopting recommended best-practice for code structure and layout.
Severity Informational
Context: JBTiered721Delegate.sol#L216
, JBTiered721Delegate.sol#L218
Description: Some revert messages are unclear which can lead to confusion. Unclear revert messages may cause misunderstandings on reverted transactions.
Recommendation: Consider making revert messages more clear.
Severity: Informational
Context: JB721Delegate.sol#L88 (recieved => received)
, JB721Delegate.sol#L176 (adherance => adherence)
, JB721GlobalGovernance.sol#L48 (transfered => transferred)
, JB721TieredGovernance.sol#L209 (transfered => transferred)
, JB721TieredGovernance.sol#L239 (transfered => transferred)
, JB721TieredGovernance.sol#L269 (transfered => transferred)
, JB721TieredGovernance.sol#L306 (transfered => transferred)
, JBBitmap.sol#L13 (initialse => initialize)
, JBTiered721Delegate.sol#L121 (accross => across)
, JBTiered721Delegate.sol#L173 (adherance => adherence)
, JBTiered721Delegate.sol#L288 (how who => who)
, JBTiered721Delegate.sol#L545 (provded => provided)
, JBTiered721Delegate.sol#L717 (regitered => registered)
, JBTiered721Delegate.sol#L721 (transfered => transferred)
, JBTiered721Delegate.sol#L757 (transfered => transferred)
, JBTiered721Delegate.sol#L782 (transfered => transferred)
, JBTiered721DelegateProjectDeployer.sol#L19 (preconfifigured => preconfigured)
, JBTiered721DelegateProjectDeployer.sol#L34 (responsibile => responsible)
, JBTiered721DelegateStore.sol#L176 (superceeds => supersede)
, JBTiered721DelegateStore.sol#L230 (referecen => reference)
, JBTiered721DelegateStore.sol#L233 (initialise => initialize)
, JBTiered721DelegateStore.sol#L497 (accross => across)
, JBTiered721DelegateStore.sol#L597 (benficiary => beneficiary)
, JBTiered721DelegateStore.sol#L852 (reservd => reserved)
, JBTiered721DelegateStore.sol#L862 (transfered => transferred)
, JBTiered721DelegateStore.sol#L947 (initialise => initialze)
, JBTiered721DelegateStore.sol#L1032 (initialise => initialze)
, JBTiered721DelegateStore.sol#L1183 (initialise => initialze)
Description: Spelling errors in comments can cause confusion to both users and developers.
Recommendation: Consider checking all misspellings to ensure they are corrected.
Severity: Informational
Context: All Contracts
Description: Some 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.
Recommendation: Consider adding in full NatSpec comments for all functions to have complete code documentation for future use.
Severity: Informational
Context: All Contracts
Description: Contracts 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.
Recommendation: Consider locking the pragma version.
Severity: Informational
Context: All Contracts
Description: Using very old versions of Solidity prevents benefits of bug fixes and newer security checks. Using the latest versions might make contracts susceptible to undiscovered compiler bugs.
Recommendation: Consider using the most recent version.
#0 - c4-judge
2022-11-08T17:40:46Z
Picodes marked the issue as grade-b