L1Vault's storage contains only one variable, called token
. The declaration is as follows:
Because the value of this variable never changes and is provided as input during the deployment, it would be better to declare it with the keyword immutable
.
Not using the immutable
keyword for constant variables which have their value set in constructor will cost gas for no reason. Indeed, the immutable
keyword directly integrates the value of the variable in the runtime bytecode wherever it is used. This way, there is no need to pay the gas associated with sload
instruction each time the value is read.
The impact is LOW as it is just a gas related issue.
Manual
I suggest to replace the declaration of token
variable with this declaration :
This will save gas for each call to approveTo
function.
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.