Platform: Code4rena
Start Date: 07/01/2022
Pot Size: $80,000 USDC
Total HM: 21
Participants: 37
Period: 7 days
Judge: 0xean
Total Solo HM: 14
Id: 71
League: ETH
Rank: 29/37
Findings: 2
Award: $40.50
🌟 Selected for report: 0
🚀 Solo Findings: 0
37.3929 INSURE - $13.09
22.7028 USDC - $22.70
Meta0xNull
A wrong user input or wallets defaulting to the zero addresses for a missing input can lead to the contract needing to redeploy or wasted gas.
https://github.com/code-423n4/2022-01-insure/blob/main/contracts/Factory.sol#L81-L83
Manual Review
Requires Addresses is not zero.
require(_registry != address(0), "Address Can't Be Zero") require(_ownership != address(0), "Address Can't Be Zero")
#0 - 0xHaku
2022-01-26T10:20:25Z
@oishun1112 already fixed.
#1 - oishun1112
2022-01-27T06:50:23Z
#2 - 0xean
2022-01-28T02:27:38Z
dupe of #120
🌟 Selected for report: 0xngndev
Also found by: Dravee, Jujic, Meta0xNull, defsec, p4st13r4, robee, sirhashalot, tqts
2.9784 INSURE - $1.04
1.5637 USDC - $1.56
Meta0xNull
Shortening revert strings to fit in 32 bytes will decrease deployment time gas and will decrease runtime gas when the revert condition has been met.
Revert strings that are longer than 32 bytes require at least one additional mstore, along with additional overhead for computing memory offset, etc.
https://github.com/code-423n4/2022-01-insure/blob/main/contracts/Ownership.sol#L39 https://github.com/code-423n4/2022-01-insure/blob/main/contracts/Ownership.sol#L47
Manual Review
Shorten the revert strings to fit in 32 bytes.
Or consider using Custom Errors (solc >=0.8.4).
#0 - oishun1112
2022-01-13T18:07:26Z
2.4125 INSURE - $0.84
1.2666 USDC - $1.27
Meta0xNull
The local variable used as for loop index need not be initialized to 0 because the default value is 0. Avoiding this anti-pattern can save a few opcodes and therefore a tiny bit of gas.
https://github.com/code-423n4/2022-01-insure/blob/main/contracts/Factory.sol#L176 https://github.com/code-423n4/2022-01-insure/blob/main/contracts/Factory.sol#L186
Manual Review
for (uint256 i = 0; After for (uint256 i;
#0 - oishun1112
2022-01-13T18:07:49Z