project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4
project screenshot 5
project screenshot 6

Circuit Breaker SNIP

ThIS feature could prevent hackers from immediately draining the assets of exploited DeFi protocols and protect users against losses

Circuit Breaker SNIP

Created At

ETHGlobal Istanbul

Winner of

Starknet - Grand Prize 2nd Place

Project Description

This standard outlines a smart contract interface for a Circuit Breaker that triggers a temporary halt on protocol-wide token outflows when a threshold is exceeded for a predefined metric. This circuit breaker does not assume the structure of the underlying protocol, and mainly serves as a pass-through vehicle for token outflows. In order to maintain correct internal accounting for integrated protocols, and to provide maximum flexibility for developers, developers can specify if the circuit breaker contract should delay settlement and temporarily custody outflows during the cooldown period, or revert on attempted outflows.

How it's Made

This project has been building only for starknet for moving forward with a SNIP proposal that could be implemented onto various defi protocols and could potentially save the protocols from being rekt in case of a hack. I have used cairo to write the contracts and starknet foundry for writing test cases, at the same time have implemented a mock defi contract on how this could be used as well. This would allow developers to specify the value of withdrawals that triggers the circuit breaker, and whether that takes the form of delayed settlement after a cooldown or completely revert attempted outflows.

background image mobile

Join the mailing list

Get the latest news and updates