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: 17/67
Findings: 2
Award: $367.96
🌟 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
341.9967 USDC - $342.00
initialize function does not check that _fundingCycleStore
is not zero. Given that state variable fundingCycleStore
can not be set anywhere else, setting it to zero can lead to contract redeployment
The deployer mistakenly call JB721Delegate#initialize with _fundingCycleStore = IJBFundingCycleStore(0)
as parameter, then mintReservesFor
and _beforeTokenTransfer
will always revert
Manual review.
Add a require statement require(_fundingCycleStore != IJBFundingCycleStore(0))
in JB721Delegate#initialize function
Checking addresses against zero-address during initialization or during setting is a security best-practice. However, such checks are missing in address variable initializations/changes.
Allowing zero-addresses will lead to contract reverts and force redeployments if there are no setters for such address variables.
Setting zero address will lead to redeployment, and payable functions didPay and didRedeem will be unusable.
Manual review
Add zero address check.
The function does not check that _oldDelegate != _delegatee
, emiting a wrong DelegateChanged
event.
While TierDelegateVotesChanged
last parameter should changed from callre
to caller
.
While TierDelegateVotesChanged
is defined as
event TierDelegateVotesChanged( address indexed delegate, uint256 indexed tierId, uint256 previousBalance, uint256 newBalance, address callre );
This line set parameters wrong. it should be changed to:
emit TierDelegateVotesChanged(_from, _tierId, _oldValue, _newValue, , msg.sender);
JBTiered721DelegateDeployer#constructor JBTiered721DelegateProjectDeployer#constructor
Checking addresses against zero-address during initialization or during setting is a security best-practice. However, such checks are missing in address variable initializations/changes
#0 - c4-judge
2022-11-04T21:34:50Z
Picodes marked the issue as grade-a
🌟 Selected for report: Jeiwan
Also found by: 0x1f8b, 0x4non, 0x5rings, 0xSmartContract, Awesome, Aymen0909, Bnke0x0, CodingNameKiki, Diana, DimSon, JC, JrNet, LeoS, RaymondFam, ReyAdmirado, Saintcode_, Shinchan, __141345__, berndartmueller, bharg4v, brgltd, carlitox477, ch0bu, chaduke, cryptostellar5, emrekocak, gogo, lukris02, martin, mcwildy, sakman, trustindistrust, zishansami
25.9629 USDC - $25.96
State variable projectId
is accessed twice in functions didPay
and didRedeem
.
Add uint256 _projectId = projectId;
at the start of both functions, and replace every occurency of projectId
in this functions for the new variable.
pricingCurrency
can be put in a memory variable in function _processPayment
to avoid double access to state variable.
store
can be put in a memory variable to avoid double access to state variable. In functions
#0 - c4-judge
2022-11-08T17:44:51Z
Picodes marked the issue as grade-b