Platform: Code4rena
Start Date: 10/05/2024
Pot Size: $300,500 USDC
Total HM: 4
Participants: 27
Period: 17 days
Judge: Picodes
Total Solo HM: 1
Id: 375
League: ETH
Rank: 21/27
Findings: 1
Award: $0.00
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: Sathish9098
Also found by: Audinarey, Dup1337, K42, KupiaSec, LessDupes, Rhaydden, SpicyMeatball, Takarez, ZanyBonzy, bronze_pickaxe, carlitox477, dontonka, forgebyola, fyamf, guhu95, hihen, josephdara, ladboy233, slvDev, twcctop, xuwinnie, zanderbyte
0 USDC - $0.00
Some stakers in old roll up will lose their stake when upgrading to new rollup.
when bold
update , in function perform
, we will call cleanupOldRollup
to clean up old rollup.
The stake count is set to max value 50
, it's a magic number, if the staker count is greater than 50, the staker will lose their stake when upgrading to new rollup.
In roll up logic, we don't have any check to make sure that staker amount is less than 50, so it's possible to lose stake when upgrading to new rollup.
function cleanupOldRollup() private { IOldRollupAdmin(address(OLD_ROLLUP)).pause(); uint64 stakerCount = ROLLUP_READER.stakerCount(); // since we for-loop these stakers we set an arbitrary limit - we dont // expect any instances to have close to this number of stakers @> if (stakerCount > 50) { stakerCount = 50; } for (uint64 i = 0; i < stakerCount; i++) { address stakerAddr = ROLLUP_READER.getStakerAddress(i); OldStaker memory staker = ROLLUP_READER.getStaker(stakerAddr); if (staker.isStaked && staker.currentChallenge == 0) { address[] memory stakersToRefund = new address[](1); stakersToRefund[0] = stakerAddr; IOldRollupAdmin(address(OLD_ROLLUP)).forceRefundStaker(stakersToRefund); } } // upgrade the rollup to one that allows validators to withdraw even whilst paused DoubleLogicUUPSUpgradeable(address(OLD_ROLLUP)).upgradeSecondaryTo(IMPL_PATCHED_OLD_ROLLUP_USER); }
manual
add check to make sure that staker amount is less than 50 when upgrading to new rollup or remove the magic number 50
.
Invalid Validation
#0 - c4-judge
2024-06-05T08:21:20Z
Picodes changed the severity to QA (Quality Assurance)
#1 - c4-judge
2024-06-08T16:43:10Z
This previously downgraded issue has been upgraded by Picodes
#2 - c4-judge
2024-06-08T16:43:23Z
Picodes changed the severity to QA (Quality Assurance)
#3 - c4-judge
2024-06-10T17:23:32Z
Picodes marked the issue as grade-b