Platform: Code4rena
Start Date: 18/11/2021
Pot Size: $50,000 USDC
Total HM: 18
Participants: 26
Period: 7 days
Judge: leastwood
Total Solo HM: 12
Id: 54
League: ETH
Rank: 13/26
Findings: 1
Award: $450.75
🌟 Selected for report: 1
🚀 Solo Findings: 0
🌟 Selected for report: elprofesor
Also found by: 0x0x0x, harleythedog, loop, pauliax
52.2858 USDC - $52.29
harleythedog
In Unlock.sol, the function upgradeLock allows a lock manager to upgrade the implementation of the lock by increasing the version number by one. However, no checks are done to make sure that the version even exists, so there could be some logic errors or future problems if this check is not explicitly made. I recommend adding the following code to the start of upgradeLock:
require(version <= publicLockLatestVersion, "version does not exist");
To prevent against users accidentally trying to upgrade their contracts when they are already at the latest version.
See function here: https://github.com/code-423n4/2021-11-unlock/blob/ec41eada1dd116bcccc5603ce342257584bec783/smart-contracts/contracts/Unlock.sol#L237
Inspection.
Add require statement described above.
#0 - clemsos
2022-01-04T14:39:36Z
Duplicate of #39 that has been addressed in unlock-protocol/unlock@532b806 ?
#1 - 0xleastwood
2022-01-16T12:15:17Z
Duplicate of #39
🌟 Selected for report: harleythedog
398.4587 USDC - $398.46
harleythedog
The function computeAvailableDiscountFor is left unimplemented in Unlock.sol. Recommend implementing this function or removing it.
Inspection.
Implement function or remove it to save gas.
#0 - julien51
2022-01-03T14:24:36Z
Indeed, this was not implemented and will be removed. Thanks.