Platform: Code4rena
Start Date: 30/11/2021
Pot Size: $30,000 USDC
Total HM: 0
Participants: 21
Period: 3 days
Judge: pauliax
Id: 63
League: ETH
Rank: 10/21
Findings: 1
Award: $80.82
🌟 Selected for report: 1
🚀 Solo Findings: 0
🌟 Selected for report: TomFrenchBlockchain
73.5785 USDC - $73.58
TomFrench
gas savings
Here we perform a check against zero every time we requery the oracle even though it's very unlikely to be zero again after initialisation.
Swap if statements to avoid redundant checking
#0 - pauliax
2021-12-10T19:09:25Z
Valid optimization, especially when combined with #74
TomFrench
Deployment gas
Both contracts have storage variables which are explicitly set to zero on construction.
These can be just declared like
bool public party0Accepted; // rgt timelock accepted bool public party1Accepted; // tribe timelock accepted
And will default to being false, etc.
It's well known that an explicit assignment to zero/false results in higher deployment costs than the above so doing so just spends gas for no reason.
Make use of storage variables defaulting to zero/false.
#0 - elee1766
2021-12-06T04:56:19Z
#157
#1 - pauliax
2021-12-11T09:56:19Z
A duplicate of #157