Platform: Code4rena
Start Date: 21/07/2023
Pot Size: $90,500 USDC
Total HM: 8
Participants: 60
Period: 7 days
Judge: 0xean
Total Solo HM: 2
Id: 264
League: ETH
Rank: 11/60
Findings: 1
Award: $766.83
🌟 Selected for report: 1
🚀 Solo Findings: 0
🌟 Selected for report: Anirruth
Also found by: DadeKuma, Matin, MohammedRizwan, bart1e, giovannidisiena, ladboy233, rvierdiiev
766.833 USDC - $766.83
https://github.com/code-423n4/2023-07-arcade/blob/main/contracts/external/council/CoreVoting.sol#L15
The day in blocks is calculated with the block time as 13.3 seconds in CoreVoting.sol.
uint256 public constant DAY_IN_BLOCKS = 6496;
but since moving to proof of stake block times are fixed to 12 seconds per block https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/#:~:text=Whereas%20under%20proof%2Dof%2Dwork,block%20proposer%20in%20every%20slot
This results in incorrect calculation of the lockDuration and extraVoteTime which is used in setting the total duration a proposal should be active and also the max vote time. The time difference can be calculated:
3246060 / 13.3 = 19488.721804511 (lockDuration with 13.3 seconds) 3246060 / 12 = 21600 (lockDuration with 12 seconds) 21600-19488.7 = 2111.3 2111.3 * 12 / (60*60) = 7.03 (difference in hours for lockDuration)
5246060 / 13.3 = 32481.203007519 (extraVoteTime with 13.3 seconds) 5246060 / 12 = 36000 (extraVoteTime with 12 seconds) 36000 - 32481.2 = 3518.8 3518.8 * 12 / (60*60) = 11.72 (difference in hours extraVoteTime)
By using block time as 13.3 seconds the lockDuration expires 7 hours earlier and the extraVoteTime expires 11.72 hours earlier. Since it is a significant time and affects the proposal and voting duration I consider medium severity to be fair.
VS code
86400 / 12 = 7200
Change the DAY_IN_BLOCKS to 7200
uint256 public constant DAY_IN_BLOCKS = 7200;
Error
#0 - c4-pre-sort
2023-07-30T09:57:45Z
141345 marked the issue as duplicate of #56
#1 - c4-judge
2023-08-11T16:35:10Z
0xean marked the issue as satisfactory
#2 - c4-judge
2023-08-14T16:26:09Z
0xean changed the severity to QA (Quality Assurance)
#3 - c4-judge
2023-08-14T16:27:36Z
0xean marked the issue as grade-c
#4 - c4-judge
2023-08-16T12:34:13Z
This previously downgraded issue has been upgraded by 0xean
#5 - captainmangoC4
2023-08-16T17:03:51Z
Removing stray "unsatisfactory" label per judge's request
#6 - c4-judge
2023-08-16T20:17:09Z
0xean marked the issue as not a duplicate
#7 - c4-judge
2023-08-16T20:17:41Z
0xean marked the issue as duplicate of #56
#8 - c4-judge
2023-08-16T20:52:05Z
0xean marked the issue as selected for report