Platform: Code4rena
Start Date: 14/07/2022
Pot Size: $25,000 USDC
Total HM: 2
Participants: 63
Period: 3 days
Judge: PierrickGT
Total Solo HM: 1
Id: 147
League: ETH
Rank: 19/63
Findings: 2
Award: $59.48
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: hickuphh3
Also found by: 0x29A, 0x52, 0xNazgul, Chom, Deivitto, ElKu, Funen, IllIllI, Meera, ReyAdmirado, SooYa, TomJ, Trumpero, Waze, __141345__, ak1, asutorufos, c3phas, cRat1st0s, csanuragjain, delfin454000, exd0tpy, fatherOfBlocks, hake, hansfriese, horsefacts, hyh, karanctf, kenzo, kyteg, ladboy233, pashov, peritoflores, rajatbeladiya, rbserver, reassor, rokinot, simon135, wastewa
42.6142 USDC - $42.61
elapsed = uint32(block.timestamp) - uint256(auction_.start);
unchecked { elapsed = uint32(block.timestamp) - uint256(auction_.start); // Overflow on block.timestamp is fine }
if uint256(auction_.start) > uint32(block.timestamp)
, elapsed will be underflow.
type(uint32).max = 4294967295 which is Sunday, February 7, 2106 6:28:15
This mean that if you use uint32 to store timestamp, your program only work until Sunday, February 7, 2106 6:28:15 and there aren't any idea proposed on how to migrate beyond that date.
#0 - alcueca
2022-07-22T14:41:05Z
This mean that if you use uint32 to store timestamp, your program only work until Sunday, February 7, 2106 6:28:15 and there aren't any idea proposed on how to migrate beyond that date.
Not sure if sarcasm. One useful.
🌟 Selected for report: IllIllI
Also found by: 0x1f8b, 0x29A, 0xKitsune, 0xNazgul, Aymen0909, Chom, Deivitto, ElKu, JC, JohnSmith, Kaiziron, Limbooo, MadWookie, Meera, ReyAdmirado, Rohan16, Sm4rty, SooYa, TomJ, Trumpero, Waze, __141345__, ajtra, ak1, antonttc, bulej93, c3phas, cRat1st0s, csanuragjain, defsec, durianSausage, fatherOfBlocks, gogo, hake, hickuphh3, ignacio, joestakey, karanctf, kyteg, m_Rassska, pashov, rajatbeladiya, rbserver, robee, rokinot, samruna, sashik_eth, simon135, tofunmi
16.8729 USDC - $16.87
This reduce gas cost as show here https://forum.openzeppelin.com/t/a-collection-of-gas-optimisation-tricks/19966/5
Solidity 0.8.4 introduced custom errors. They are more gas efficient than revert strings, when it comes to deployment cost as well as runtime cost when the revert condition is met. Use custom errors instead of revert strings for gas savings.
Any require statement in your code can be replaced with custom error for example,
require(ilkJoin != IJoin(address(0)), "Join not found");
Can be replaced with
// declare error before contract declaration error JoinNotFound(); if (ilkJoin != IJoin(address(0)) revert JoinNotFound();