function burn(uint256 _amount) in DecentralizedStableCoin.sol has a check:
if (_amount <= 0) {
revert DecentralizedStableCoin__MustBeMoreThanZero();
}
<= is more gas inefficient than just a < as it has to use 2 opcodes instead of 1.
Less gas consumption
I propose the following change to make it more efficient:
if (_amount < 1) {
revert DecentralizedStableCoin__MustBeMoreThanZero();
}
I also recommend moving the balance fetch on L:47 after the above check. That removes a storage read and reduces the gas costs a lot in the case of someone calling this function with _amount < 1.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.