Skip to content

owlprotocol/reentrancy-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Re-entrancy Examples

Very simple re-entrancy examples (simple deposit/withdraw) that violate check-effects-interactions pattern. Implemented in progressively more challenging ways for static analyzers.

These simple examples are useful for testing out support for libraries & namespaced storage:

  1. Simple Example: Basic example that violates the pattern, and introduces a re-entrancy as suggested by check-effects-interactions
  2. Library Example: Logic implemented as a library with storage pointers. Contract just calls the library.
  3. Namespaced Storage: Storage using EIP-7201 namespaced storage commonly used by proxies & diamond pattern contracts.
  4. Namespaced Storage Library: Combine both examples 2 & 3 using a library with namespaced storage

The key things were looking to test are support for detecting re-entrancy in the following context:

  • Libraries that interact with storage pointers (Example 2)
  • Contracts with namespaced storage (Example 3)
  • Libraries that interact with namespaced storage (Example 4)

About

Common Solidity Re-entrancy Examples

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published