coral-xyz / sealevel-attacks

☠️ Common Security Exploits and Protections on Solana
507 stars 95 forks source link

Missing documentation for examples #11

Open yourarj opened 2 years ago

yourarj commented 2 years ago

@armaniferrante we should add one/two liner comments or doc comments on every example

explaining unsafe - why it's unsafe recommended - why this practice is recommended secure - why it's secure.

It'll definitely help new repo visitor understand the moto behind the different approaches and will help get deeper understanding overall.

yourarj commented 2 years ago

@armaniferrante I've attempted this here https://github.com/yourarj/doc-me-sealevel-attacks/commit/c2788df1fc8ac9c9bb2f3138bd0e653bab85fd10

Please have a look at the above example commit, if that seems fine. May be I can pick it up from there on and document other cases too.

yourarj commented 2 years ago

Or maybe we can add a README.md in every example about the recommended practice (theory). The motivation is to get reader a clear idea about what is that we are trying to achieve and what approach we are taking

oslfmt commented 2 years ago

Man, this would be absolutely awesome