code-423n4 / 2021-12-amun-findings

0 stars 0 forks source link

Assigning local variables to unchanging storage variables #264

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

Czar102

Vulnerability details

Optimization

Assign the value of a storage variable to a local one when possible to avoid multiple reads.

Proof of Concept

Values in the brackets are indicating potential SLOAD opcode number decrease.

Relevant to, for example: