Skip to content

Mtinkering/solidity-best-practices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 

Repository files navigation

Payment Protection Patterns

1. Check Effects Interaction

  • Check conditions, check validity of parameters
  • Change state variables
  • Only interact with the other contracts last

2. Require msg.data.length == 0 in fallback function.

  • Nothing should be executed aside from receiving ether

3. Avoid State changes in modifier

4. External calls are untrusted. Prefix function calling external calls with untrusted to write more test cases

5. Debit before credit

6. Functions should be private for those that handle transactions, unless being called by external

7. Separating app logic and data if possible, so that when changing the logic and redeploying, data won't be lost

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published