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: 20/26
Findings: 1
Award: $68.12
🌟 Selected for report: 1
🚀 Solo Findings: 0
🌟 Selected for report: HardlyDifficult
Also found by: TomFrenchBlockchain, cmichel
14.4834 USDC - $14.48
TomFrench
Gas costs
Here we store the address of the proxy admin twice: https://github.com/code-423n4/2021-11-unlock/blob/ec41eada1dd116bcccc5603ce342257584bec783/smart-contracts/contracts/Unlock.sol#L98-L99
The motivation behind this seems to be to use the ProxyAdmin
type internally but expose a getter which returns a plain address.
We could save gas by only storing this address once and having an explicit getter
function proxyAdminAddress() external view returns (address) { return address(proxyAdmin); }
Internal usage of proxyAdminAddress
for non-zero checks could be changed to compare against proxyAdmin
instead as so proxyAdmin != ProxyAdmin(0)
As above.
#0 - 0xleastwood
2022-01-17T08:37:26Z
Duplicate of #129
🌟 Selected for report: TomFrenchBlockchain
TomFrench
Gas costs
The version of lock contracts is stored and manipulated as a uint16 number.
There's no benefit to doing this as it doesn't take advantage of storage slot packing so we're just accepting greater costs of operating on non 32-byte words for no benefits.
Change lock versions to be uint256 values.
#0 - 0xleastwood
2022-01-17T08:38:00Z
Nice!