clearmatics / mobius

Trustless Tumbling for Transaction Privacy
GNU Lesser General Public License v3.0
85 stars 23 forks source link

Solidity good practices #58

Closed AntoineRondelet closed 6 years ago

AntoineRondelet commented 6 years ago

This PR acts as a cleanup of the Mobius code.

A saw many inconsistencies that make the code hard/annoying to read. Thus I implemented some "solidity good practices" extracted from:

Overall, here are the things I saw the most:

Moreover, I introduced some constants for the events value in the tests. I think this is better as it makes the code more flexible. If one needs to change the name of an event, one only needs to change the value of the constant. Finally, I would suggest that we adopt the convention Test[FunctionName] for the testing function. I didn't change it everywhere though.

AntoineRondelet commented 6 years ago

While this PR might not be seen as fundamental, I believe that we should follow the style recommendations (This is just a suggestion though). The "code style" should be checked every time someone opens a PR. That way we'll keep a code base as clean (and understandable) as possible :)