Open code423n4 opened 2 years ago
pauliax
You can get rid of hasBonded state variable if you treat bondTimestamp with a value of 0 as not bonded. This would save some gas.
E.g.: replace require(!hasBonded); with require(bondTimestamp == 0); and hasBonded = false; with bondTimestamp = 0;
Agree that you can remove the boolean hasBonded by giving a special meaning to the value 0 for bondTimestamp
hasBonded
bondTimestamp
Handle
pauliax
Vulnerability details
Impact
You can get rid of hasBonded state variable if you treat bondTimestamp with a value of 0 as not bonded. This would save some gas.
Recommended Mitigation Steps
E.g.: replace require(!hasBonded); with require(bondTimestamp == 0); and hasBonded = false; with bondTimestamp = 0;