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

0 stars 0 forks source link

`++s.lockCounter` is more efficient than `s.lockCounter++` for storage variable #210

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

WatchPug

Vulnerability details

https://github.com/code-423n4/2021-12-amun/blob/98f6e2ff91f5fcebc0489f5871183566feaec307/contracts/basket/contracts/facets/shared/Reentry/ReentryProtection.sol#L11

s.lockCounter++;

Using ++s.lockCounter is more gas efficient than s.lockCounter++ for storage variable.

0xleastwood commented 2 years ago

Duplicate of #108