There is not check to prevent initializing i_dsc
with the null address
The i_dsc
variable is set as immutable
. Therefore, it is important to verify that we are not initializing it with the null address .
https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/blob/d1c5501aa79320ca0aeaa73f47f0dbc88c7b77e2/src/DSCEngine.sol#L82
https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/blob/d1c5501aa79320ca0aeaa73f47f0dbc88c7b77e2/src/DSCEngine.sol#L112C4-L123C6
Any interactions with i_dsc
would result in runtime exceptions or revert transactions.
Virtual Studio Code
Foundry
Consider adding an address(0)
check for immutable variables.
To save gas, this check could also be done in assembly:
This should save **6 gas**
per call
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.