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:
- Simple Example: Basic example that violates the pattern, and introduces a re-entrancy as suggested by check-effects-interactions
- Library Example: Logic implemented as a library with storage pointers. Contract just calls the library.
- Namespaced Storage: Storage using EIP-7201 namespaced storage commonly used by proxies & diamond pattern contracts.
- 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)