Skip to content

Latest commit

 

History

History
16 lines (11 loc) · 1.28 KB

README.md

File metadata and controls

16 lines (11 loc) · 1.28 KB

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)