code-423n4 / 2021-04-meebits-findings

0 stars 0 forks source link

Atypical contract structure affects maintainability and readability #23

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

0xRajeev

Vulnerability details

Impact

A typical/recommended contract structure has the variable declarations followed by events instead of the other way around. This affects readability/maintainability and may introduce/persist security issues.

Proof of Concept

https://github.com/code-423n4/2021-04-redacted/blob/2ec4ce8e98374be2048126485ad8ddacc2d36d2f/Beebots.sol#L77-L164

Tools Used

Manual Analysis

Recommended Mitigation Steps

Consider restructuring the contract to place the variable declarations before events.