When you access elements of a mapping or array multiple times within a single function, it involves multiple reads from storage or memory. Each access incurs gas costs due to the need to load data from storage or memory.
By caching the mapping or array elements in a local variable, you can avoid redundant reads and reduce gas consumption.
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.