Synthetixio / synthetix-v3

MIT License
117 stars 58 forks source link

Forkability improvements #2335

Closed dbeal-eth closed 1 week ago

dbeal-eth commented 1 month ago

This PR introduces a new core utility contract, ForkDetector, which provides a way for developer forks (such as Tenderly, Anvil) to distinguish themselves from the canonical chain safely. This can be useful as there are some functionalities which are difficult to operate on a fork (ex. offchain prices or precompiled contracts), and the behavior in those places can be selectively mocked to prevent interruption of testing.

Design Considerations:

Specific changes:

Tests to be written tomorrow