Skip to content

Commit

Permalink
Merge pull request #5 from symbioticfi/burner-router
Browse files Browse the repository at this point in the history
Burner router
  • Loading branch information
1kresh authored Oct 28, 2024
2 parents 8190adc + 2da0385 commit 7896712
Show file tree
Hide file tree
Showing 53 changed files with 2,402 additions and 257 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "lib/openzeppelin-contracts-upgradeable"]
path = lib/openzeppelin-contracts-upgradeable
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
[submodule "lib/core"]
path = lib/core
url = https://github.com/symbioticfi/core
1 change: 1 addition & 0 deletions lib/core
Submodule core added at bdbb05
1 change: 1 addition & 0 deletions remappings.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
forge-std/=lib/forge-std/src/
@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/
@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/
@symbioticfi/core/=lib/core/
24 changes: 23 additions & 1 deletion specs/Burner.md → specs/Burners.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Burner
## Burners

## General Overview

Expand All @@ -8,6 +8,28 @@ Symbiotic achieves this by separating the ability to slash assets from the under

For example, if asset is ETH LST it can be used as a collateral if it's possible to create `Burner` contract that withdraw ETH from beaconchain and burn it, if asset is native e.g. governance token it also can be used as collateral since burner might be implemented as "black-hole" contract or address.

## Burner Router

[See the code here](../src/contracts/router/)

The Burner Router allows redirecting the slashed collateral tokens to different addresses, which may be represented by Burners, Treasury contracts, LP lockers, etc.

### Full Flow

1. Setup

- Before the Vault's creation, deploy a new Burner Router via `BurnerRouterFactory` with the same collateral address as the Vault will use
- Deploy the Vault inputting the received `BurnerRouter` address and `IBaseSlasher.BaseParams.isBurnerHook` set to `true`

2. Slashing

- The router is called via `onSlash()` function
- It determines the needed address for redirection and saves the redirection amount for it

3. Trigger transfer

- Transfers a given account's whole balance from the router to this account

## Default Burners

We've implemented default Burners for the assets restaked at Symbiotic, which need "unwrapping" (and allow it in a permissionless way):
Expand Down
4 changes: 2 additions & 2 deletions src/contracts/burners/ETHx_Burner.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;

import {SelfDestruct} from "../SelfDestruct.sol";
import {UintRequests} from "../UintRequests.sol";
import {SelfDestruct} from "../common/SelfDestruct.sol";
import {UintRequests} from "../common/UintRequests.sol";

import {IETHx_Burner} from "../../interfaces/burners/ETHx/IETHx_Burner.sol";
import {IStaderConfig} from "../../interfaces/burners/ETHx/IStaderConfig.sol";
Expand Down
4 changes: 2 additions & 2 deletions src/contracts/burners/mETH_Burner.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;

import {SelfDestruct} from "../SelfDestruct.sol";
import {UintRequests} from "../UintRequests.sol";
import {SelfDestruct} from "../common/SelfDestruct.sol";
import {UintRequests} from "../common/UintRequests.sol";

import {IMETH} from "../../interfaces/burners/mETH/IMETH.sol";
import {IStaking} from "../../interfaces/burners/mETH/IStaking.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/burners/rETH_Burner.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;

import {SelfDestruct} from "../SelfDestruct.sol";
import {SelfDestruct} from "../common/SelfDestruct.sol";

import {IRocketTokenRETH} from "../../interfaces/burners/rETH/IRocketTokenRETH.sol";
import {IrETH_Burner} from "../../interfaces/burners/rETH/IrETH_Burner.sol";
Expand Down
4 changes: 2 additions & 2 deletions src/contracts/burners/sUSDe/sUSDe_Burner.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;

import {AddressRequests} from "../../AddressRequests.sol";
import {SelfDestruct} from "../../SelfDestruct.sol";
import {AddressRequests} from "../../common/AddressRequests.sol";
import {SelfDestruct} from "../../common/SelfDestruct.sol";
import {sUSDe_Miniburner} from "./sUSDe_Miniburner.sol";

import {IEthenaMinting} from "../../../interfaces/burners/sUSDe/IEthenaMinting.sol";
Expand Down
4 changes: 2 additions & 2 deletions src/contracts/burners/sfrxETH_Burner.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;

import {SelfDestruct} from "../SelfDestruct.sol";
import {UintRequests} from "../UintRequests.sol";
import {SelfDestruct} from "../common/SelfDestruct.sol";
import {UintRequests} from "../common/UintRequests.sol";

import {IFraxEtherRedemptionQueue} from "../../interfaces/burners/sfrxETH/IFraxEtherRedemptionQueue.sol";
import {IsfrxETH_Burner} from "../../interfaces/burners/sfrxETH/IsfrxETH_Burner.sol";
Expand Down
4 changes: 2 additions & 2 deletions src/contracts/burners/swETH_Burner.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;

import {SelfDestruct} from "../SelfDestruct.sol";
import {UintRequests} from "../UintRequests.sol";
import {SelfDestruct} from "../common/SelfDestruct.sol";
import {UintRequests} from "../common/UintRequests.sol";

import {ISwEXIT} from "../../interfaces/burners/swETH/ISwEXIT.sol";
import {IswETH_Burner} from "../../interfaces/burners/swETH/IswETH_Burner.sol";
Expand Down
4 changes: 2 additions & 2 deletions src/contracts/burners/wstETH_Burner.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;

import {SelfDestruct} from "../SelfDestruct.sol";
import {UintRequests} from "../UintRequests.sol";
import {SelfDestruct} from "../common/SelfDestruct.sol";
import {UintRequests} from "../common/UintRequests.sol";

import {IWithdrawalQueue} from "../../interfaces/burners/wstETH/IWithdrawalQueue.sol";
import {IWstETH} from "../../interfaces/burners/wstETH/IWstETH.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;

import {IAddressRequests} from "../interfaces/IAddressRequests.sol";
import {IAddressRequests} from "../../interfaces/common/IAddressRequests.sol";

import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;

import {IUintRequests} from "../interfaces/IUintRequests.sol";
import {IUintRequests} from "../../interfaces/common/IUintRequests.sol";

import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
Expand Down
Loading

0 comments on commit 7896712

Please sign in to comment.