KaiserKarel / substrace

Static analysis for Substrate based projects
27 stars 1 forks source link

Lint for missing storage write-back #26

Open ggwpez opened 1 year ago

ggwpez commented 1 year ago

Often a storage value is first loaded, modify it and then hopefully written back to storage. A lint could be added which checks that modified values from storage are written back. Example:

let mut val = Value::<T>::get();
val += 123;
…
Value::<T>::set(&val); // Errors if this line is missing.

No idea how difficult that is to implement, just wanted to drop that idea.