This file is a merged representation of a subset of the codebase, containing files not matching ignore patterns, combined into a single document by Repomix.
The content has been processed where content has been compressed (code blocks are separated by ⋮---- delimiter).
# File Summary
## Purpose
This file contains a packed representation of a subset of the repository's contents that is considered the most important context.
It is designed to be easily consumable by AI systems for analysis, code review,
or other automated processes.
## File Format
The content is organized as follows:
1. This summary section
2. Repository information
3. Directory structure
4. Repository files (if enabled)
5. Multiple file entries, each consisting of:
a. A header with the file path (## File: path/to/file)
b. The full contents of the file in a code block
## Usage Guidelines
- This file should be treated as read-only. Any changes should be made to the
original repository files, not this packed version.
- When processing this file, use the file path to distinguish
between different files in the repository.
- Be aware that this file may contain sensitive information. Handle it with
the same level of security as you would the original repository.
## Notes
- Some files may have been excluded based on .gitignore rules and Repomix's configuration
- Binary files are not included in this packed representation. Please refer to the Repository Structure section for a complete list of file paths, including binary files
- Files matching these patterns are excluded: docs/
- Files matching patterns in .gitignore are excluded
- Files matching default ignore patterns are excluded
- Content has been compressed - code blocks are separated by ⋮---- delimiter
- Files are sorted by Git change count (files with more changes are at the bottom)
# Directory Structure
```
.github/
workflows/
lint.yml
test.yml
audits/
ChainSecurity-Burners.pdf
script/
deploy/
genesis/
BurnerRouterFactory.s.sol
Burners.s.sol
ETHx_Burner.s.sol
mETH_Burner.s.sol
rETH_Burner.s.sol
sfrxETH_Burner.s.sol
swETH_Burner.s.sol
wstETH_Burner.s.sol
BurnerRouter.s.sol
specs/
BurnerRouter.md
Burners.md
src/
contracts/
burners/
sUSDe/
sUSDe_Burner.sol
sUSDe_Miniburner.sol
ETHx_Burner.sol
mETH_Burner.sol
rETH_Burner.sol
sfrxETH_Burner.sol
swETH_Burner.sol
wstETH_Burner.sol
common/
AddressRequests.sol
SelfDestruct.sol
UintRequests.sol
router/
BurnerRouter.sol
BurnerRouterFactory.sol
interfaces/
burners/
ETHx/
IETHx_Burner.sol
IStaderConfig.sol
IStaderStakePoolsManager.sol
IUserWithdrawalManager.sol
mETH/
ImETH_Burner.sol
IMETH.sol
IStaking.sol
rETH/
IrETH_Burner.sol
IRocketTokenRETH.sol
sfrxETH/
IFraxEtherRedemptionQueue.sol
IsfrxETH_Burner.sol
sUSDe/
IEthenaMinting.sol
IsUSDe_Burner.sol
ISUSDe.sol
IUSDe.sol
swETH/
IswETH_Burner.sol
ISwETH.sol
ISwEXIT.sol
wstETH/
IWithdrawalQueue.sol
IwstETH_Burner.sol
IWstETH.sol
common/
IAddressRequests.sol
IUintRequests.sol
router/
IBurnerRouter.sol
IBurnerRouterFactory.sol
test/
burners/
ETHx_Burner.t.sol
mETH_Burner.t.sol
rETH_Burner.t.sol
sfrxETH_Burner.t.sol
sUSDe_Burner.t.sol
swETH_Burner.t.sol
wstETH_Burner.t.sol
common/
SelfDestruct.t.sol
integration/
SymbioticBurnersBindings.sol
SymbioticBurnersConstants.sol
SymbioticBurnersImports.sol
SymbioticBurnersImportsContracts.sol
SymbioticBurnersInit.sol
SymbioticBurnersIntegration.sol
SymbioticBurnersIntegrationExample.sol
router/
BurnerRouter.t.sol
BurnerRouterFactory.t.sol
.env.example
.gitignore
.gitmodules
foundry.toml
LICENSE
package.json
README.md
remappings.txt
```
# Files
## File: .github/workflows/lint.yml
````yaml
name: lint
on:
push:
branches:
- main
pull_request:
jobs:
run-linters:
name: Run linters
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v3
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Lint
run: forge fmt --check
````
## File: .github/workflows/test.yml
````yaml
name: test
on:
push:
branches:
- main
pull_request:
jobs:
run-tests:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Run Forge tests
run: |
forge test -vvv
id: test
env:
ETH_RPC_URL: ${{ secrets.ETH_RPC_URL }}
````
## File: script/deploy/genesis/BurnerRouterFactory.s.sol
````
// SPDX-License-Identifier: BUSL-1.1
⋮----
import {Script, console2} from "forge-std/Script.sol";
⋮----
import {BurnerRouterFactory} from "../../../src/contracts/router/BurnerRouterFactory.sol";
import {BurnerRouter} from "../../../src/contracts/router/BurnerRouter.sol";
⋮----
contract BurnerRouterFactoryScript is Script {
function run() public {
````
## File: script/deploy/genesis/Burners.s.sol
````
// SPDX-License-Identifier: BUSL-1.1
⋮----
import {Script, console2} from "forge-std/Script.sol";
⋮----
import {BurnerRouterFactory} from "../../../src/contracts/router/BurnerRouterFactory.sol";
import {BurnerRouter} from "../../../src/contracts/router/BurnerRouter.sol";
⋮----
import {wstETH_Burner} from "../../../src/contracts/burners/wstETH_Burner.sol";
import {rETH_Burner} from "../../../src/contracts/burners/rETH_Burner.sol";
import {mETH_Burner} from "../../../src/contracts/burners/mETH_Burner.sol";
import {swETH_Burner} from "../../../src/contracts/burners/swETH_Burner.sol";
import {sfrxETH_Burner} from "../../../src/contracts/burners/sfrxETH_Burner.sol";
import {ETHx_Burner} from "../../../src/contracts/burners/ETHx_Burner.sol";
⋮----
contract BurnersScript is Script {
function run() public {
⋮----
// mainnet
⋮----
// holesky
⋮----
// sepolia
⋮----
// hoodi
````
## File: script/deploy/genesis/ETHx_Burner.s.sol
````
// SPDX-License-Identifier: BUSL-1.1
⋮----
import {Script, console2} from "forge-std/Script.sol";
⋮----
import {ETHx_Burner} from "../../../src/contracts/burners/ETHx_Burner.sol";
⋮----
contract ETHx_BurnerScript is Script {
function run() public {
⋮----
// mainnet
⋮----
// holesky
````
## File: script/deploy/genesis/mETH_Burner.s.sol
````
// SPDX-License-Identifier: BUSL-1.1
⋮----
import {Script, console2} from "forge-std/Script.sol";
⋮----
import {mETH_Burner} from "../../../src/contracts/burners/mETH_Burner.sol";
⋮----
contract mETH_BurnerScript is Script {
function run() public {
⋮----
// mainnet
⋮----
// holesky
⋮----
// sepolia
````
## File: script/deploy/genesis/rETH_Burner.s.sol
````
// SPDX-License-Identifier: BUSL-1.1
⋮----
import {Script, console2} from "forge-std/Script.sol";
⋮----
import {rETH_Burner} from "../../../src/contracts/burners/rETH_Burner.sol";
⋮----
contract rETH_BurnerScript is Script {
function run() public {
⋮----
// mainnet
⋮----
// holesky
````
## File: script/deploy/genesis/sfrxETH_Burner.s.sol
````
// SPDX-License-Identifier: BUSL-1.1
⋮----
import {Script, console2} from "forge-std/Script.sol";
⋮----
import {sfrxETH_Burner} from "../../../src/contracts/burners/sfrxETH_Burner.sol";
⋮----
contract sfrxETH_BurnerScript is Script {
function run() public {
⋮----
// mainnet
````
## File: script/deploy/genesis/swETH_Burner.s.sol
````
// SPDX-License-Identifier: BUSL-1.1
⋮----
import {Script, console2} from "forge-std/Script.sol";
⋮----
import {swETH_Burner} from "../../../src/contracts/burners/swETH_Burner.sol";
⋮----
contract swETH_BurnerScript is Script {
function run() public {
⋮----
// mainnet
````
## File: script/deploy/genesis/wstETH_Burner.s.sol
````
// SPDX-License-Identifier: BUSL-1.1
⋮----
import {Script, console2} from "forge-std/Script.sol";
⋮----
import {wstETH_Burner} from "../../../src/contracts/burners/wstETH_Burner.sol";
⋮----
contract wstETH_BurnerScript is Script {
function run() public {
⋮----
// mainnet
⋮----
// holesky
⋮----
// sepolia
````
## File: script/deploy/BurnerRouter.s.sol
````
// SPDX-License-Identifier: BUSL-1.1
⋮----
import {Script, console2} from "forge-std/Script.sol";
⋮----
import {SymbioticBurnersConstants} from "../../test/integration/SymbioticBurnersConstants.sol";
⋮----
import {IBurnerRouter} from "../../src/interfaces/router/IBurnerRouter.sol";
⋮----
contract BurnerRouterScript is Script {
function run(
````
## File: specs/BurnerRouter.md
````markdown
## 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. Update setup
- Change global receiver, network-specific receivers, operator-network-specific receivers with the configured delay (in case of pending set requests, they are overrided with the new ones)
- Change `delay` itself after the delay (in case of pending set requests, they are overrided with the new ones)
3. Slashing
- The router is called via `onSlash()` function
- It determines the needed address for redirection and saves the redirection amount for it
4. Trigger transfer
- Transfers a given account's whole balance from the router to this account
### Deploy
```shell
source .env
```
#### Deploy factory
Deployment script: [click](../script/deploy/genesis/BurnerRouterFactory.s.sol)
```shell
forge script script/deploy/genesis/BurnerRouterFactory.s.sol:BurnerRouterFactoryScript --broadcast --rpc-url=$ETH_RPC_URL
```
#### Deploy entity
Deployment script: [click](../script/deploy/BurnerRouter.s.sol)
```shell
forge script script/deploy/BurnerRouter.s.sol:BurnerRouterScript 0x0000000000000000000000000000000000000000 0x0000000000000000000000000000000000000000 0 0x0000000000000000000000000000000000000000 [\(0x0000000000000000000000000000000000000000,0x0000000000000000000000000000000000000000\),\(0x0000000000000000000000000000000000000000,0x0000000000000000000000000000000000000000\)] [\(0x0000000000000000000000000000000000000000,0x0000000000000000000000000000000000000000,0x0000000000000000000000000000000000000000\),\(0x0000000000000000000000000000000000000000,0x0000000000000000000000000000000000000000,0x0000000000000000000000000000000000000000\)] --sig "run(address,address,uint48,address,(address,address)[],(address,address,address)[])" --broadcast --rpc-url=$ETH_RPC_URL
```
````
## File: specs/Burners.md
````markdown
## Burners
## General Overview
Collateral is a concept introduced by Symbiotic that brings capital efficiency and scale by enabling assets used to secure Symbiotic networks to be held outside of the Symbiotic protocol itself - e.g., in DeFi positions on networks other than Ethereum itself.
Symbiotic achieves this by separating the ability to slash assets from the underlying asset itself, similar to how liquid staking tokens create tokenized representations of underlying staked positions. Technically, collateral positions in Symbiotic are ERC-20 tokens with extended functionality to handle slashing incidents if applicable. In other words, if the collateral token aims to support slashing, it should be possible to create a `Burner` responsible for proper burning of the asset.
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.
## Default Burners
We've implemented default Burners for the assets restaked at Symbiotic, which need "unwrapping" (and allow it in a permissionless way):
### wstETH Burner
An asset transfered to the [Burner](../src/contracts/burners/wstETH_Burner.sol) - wstETH
#### Unwrap flow
1. Trigger withdrawal
- Unwrap wstETH into stETH via wstETH contract
- Create requests with acceptable by the Lido Withdrawal Queue amounts
- Send withdrawal requests to the Lido Withdrawal Queue
2. Trigger burn
- Claim withdrawal request by its ID
- Burn ETH by `selfdestruct()`
#### Deploy entity
Deployment script: [click](../script/deploy/genesis/wstETH_Burner.s.sol)
```shell
forge script script/deploy/genesis/wstETH_Burner.s.sol:wstETH_BurnerScript --broadcast --rpc-url=$ETH_RPC_URL
```
### rETH Burner
An asset transfered to the [Burner](../src/contracts/burners/rETH_Burner.sol) - rETH
#### Unwrap flow
1. Trigger burn
- Unwrap rETH into ETH via rETH contract
- Burn ETH by `selfdestruct()`
#### Deploy entity
Deployment script: [click](../script/deploy/genesis/rETH_Burner.s.sol)
```shell
forge script script/deploy/genesis/rETH_Burner.s.sol:rETH_BurnerScript --broadcast --rpc-url=$ETH_RPC_URL
```
### mETH Burner
An asset transfered to the [Burner](../src/contracts/burners/mETH_Burner.sol) - mETH
#### Unwrap flow
1. Trigger withdrawal
- Send a withdrawal request to the Mantle Staking contract
2. Trigger burn
- Claim withdrawal request by its ID
- Burn ETH by `selfdestruct()`
#### Deploy entity
Deployment script: [click](../script/deploy/genesis/mETH_Burner.s.sol)
```shell
forge script script/deploy/genesis/mETH_Burner.s.sol:mETH_BurnerScript --broadcast --rpc-url=$ETH_RPC_URL
```
### swETH Burner
An asset transfered to the [Burner](../src/contracts/burners/swETH_Burner.sol) - swETH
#### Unwrap flow
1. Trigger withdrawal
- Create requests with acceptable by the Swell Exit contract amounts
- Send withdrawal requests to the Swell Exit contract
2. Trigger burn
- Claim withdrawal request by its ID
- Burn ETH by `selfdestruct()`
#### Deploy entity
Deployment script: [click](../script/deploy/genesis/swETH_Burner.s.sol)
```shell
forge script script/deploy/genesis/swETH_Burner.s.sol:swETH_BurnerScript --broadcast --rpc-url=$ETH_RPC_URL
```
### sfrxETH Burner
An asset transfered to the [Burner](../src/contracts/burners/sfrxETH_Burner.sol) - sfrxETH
#### Unwrap flow
1. Trigger withdrawal
- Send a withdrawal request to the frxETH Redemption Queue
2. Trigger burn
- Claim withdrawal request by its ID
- Burn ETH by `selfdestruct()`
#### Deploy entity
Deployment script: [click](../script/deploy/genesis/sfrxETH_Burner.s.sol)
```shell
forge script script/deploy/genesis/sfrxETH_Burner.s.sol:sfrxETH_BurnerScript --broadcast --rpc-url=$ETH_RPC_URL
```
### ETHx Burner
An asset transfered to the [Burner](../src/contracts/burners/ETHx_Burner.sol) - ETHx
#### Unwrap flow
1. Trigger withdrawal
- Create requests with acceptable by the User Withdraw Manager contract amounts
- Send withdrawal requests to the User Withdraw Manager contract
2. Trigger burn
- Claim withdrawal request by its ID
- Burn ETH by `selfdestruct()`
#### Deploy entity
Deployment script: [click](../script/deploy/genesis/ETHx_Burner.s.sol)
```shell
forge script script/deploy/genesis/ETHx_Burner.s.sol:ETHx_BurnerScript --broadcast --rpc-url=$ETH_RPC_URL
```
````
## File: src/contracts/burners/sUSDe/sUSDe_Burner.sol
````
// SPDX-License-Identifier: MIT
⋮----
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";
import {ISUSDe} from "../../../interfaces/burners/sUSDe/ISUSDe.sol";
import {IUSDe} from "../../../interfaces/burners/sUSDe/IUSDe.sol";
import {IsUSDe_Burner} from "../../../interfaces/burners/sUSDe/IsUSDe_Burner.sol";
⋮----
import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";
import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";
import {SafeERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
⋮----
contract sUSDe_Burner is AddressRequests, IERC1271, IsUSDe_Burner {
⋮----
/**
* @inheritdoc IsUSDe_Burner
*/
⋮----
/**
* @inheritdoc IERC1271
*/
function isValidSignature(bytes32 hash_, bytes memory signature) external view returns (bytes4) {
⋮----
function triggerWithdrawal() external returns (address requestId) {
⋮----
function triggerClaim(
⋮----
function triggerInstantClaim() external {
⋮----
function triggerBurn(
⋮----
function approveUSDeMinter() external {
````
## File: src/contracts/burners/sUSDe/sUSDe_Miniburner.sol
````
// SPDX-License-Identifier: MIT
⋮----
import {ISUSDe} from "../../../interfaces/burners/sUSDe/ISUSDe.sol";
⋮----
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
⋮----
contract sUSDe_Miniburner is OwnableUpgradeable {
⋮----
function initialize(
⋮----
function triggerClaim() external onlyOwner {
````
## File: src/contracts/burners/ETHx_Burner.sol
````
// SPDX-License-Identifier: MIT
⋮----
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";
import {IStaderStakePoolsManager} from "../../interfaces/burners/ETHx/IStaderStakePoolsManager.sol";
import {IUserWithdrawalManager} from "../../interfaces/burners/ETHx/IUserWithdrawalManager.sol";
⋮----
import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
import {Multicall} from "@openzeppelin/contracts/utils/Multicall.sol";
⋮----
contract ETHx_Burner is UintRequests, Multicall, IETHx_Burner {
⋮----
/**
* @inheritdoc IETHx_Burner
*/
⋮----
function triggerWithdrawal(
⋮----
function triggerBurn(
````
## File: src/contracts/burners/mETH_Burner.sol
````
// SPDX-License-Identifier: MIT
⋮----
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";
import {ImETH_Burner} from "../../interfaces/burners/mETH/ImETH_Burner.sol";
⋮----
import {IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
⋮----
contract mETH_Burner is UintRequests, ImETH_Burner {
/**
* @inheritdoc ImETH_Burner
*/
⋮----
function triggerWithdrawal() external returns (uint256 requestId) {
⋮----
function triggerBurn(
````
## File: src/contracts/burners/rETH_Burner.sol
````
// SPDX-License-Identifier: MIT
⋮----
import {SelfDestruct} from "../common/SelfDestruct.sol";
⋮----
import {IRocketTokenRETH} from "../../interfaces/burners/rETH/IRocketTokenRETH.sol";
import {IrETH_Burner} from "../../interfaces/burners/rETH/IrETH_Burner.sol";
⋮----
contract rETH_Burner is IrETH_Burner {
/**
* @inheritdoc IrETH_Burner
*/
⋮----
function triggerBurn(
````
## File: src/contracts/burners/sfrxETH_Burner.sol
````
// SPDX-License-Identifier: MIT
⋮----
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";
⋮----
import {IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
⋮----
contract sfrxETH_Burner is UintRequests, IsfrxETH_Burner, IERC721Receiver {
/**
* @inheritdoc IsfrxETH_Burner
*/
⋮----
function triggerWithdrawal() external returns (uint256 requestId) {
⋮----
function triggerBurn(
⋮----
/**
* @inheritdoc IERC721Receiver
*/
function onERC721Received(address, address, uint256, bytes calldata) external returns (bytes4) {
````
## File: src/contracts/burners/swETH_Burner.sol
````
// SPDX-License-Identifier: MIT
⋮----
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";
⋮----
import {IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
⋮----
contract swETH_Burner is UintRequests, IswETH_Burner, IERC721Receiver {
⋮----
/**
* @inheritdoc IswETH_Burner
*/
⋮----
function triggerWithdrawal(
⋮----
function triggerBurn(
⋮----
/**
* @inheritdoc IERC721Receiver
*/
function onERC721Received(address, address, uint256, bytes calldata) external returns (bytes4) {
````
## File: src/contracts/burners/wstETH_Burner.sol
````
// SPDX-License-Identifier: MIT
⋮----
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";
import {IwstETH_Burner} from "../../interfaces/burners/wstETH/IwstETH_Burner.sol";
⋮----
import {IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
⋮----
contract wstETH_Burner is UintRequests, IwstETH_Burner {
⋮----
/**
* @inheritdoc IwstETH_Burner
*/
⋮----
function triggerWithdrawal(
⋮----
function triggerBurn(
⋮----
function triggerBurnBatch(uint256[] calldata requestIds_, uint256[] calldata hints) external {
````
## File: src/contracts/common/AddressRequests.sol
````
// SPDX-License-Identifier: MIT
⋮----
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";
⋮----
contract AddressRequests is IAddressRequests {
⋮----
/**
* @inheritdoc IAddressRequests
*/
function requestIdsLength() external view returns (uint256) {
⋮----
function requestIds(uint256 index, uint256 maxRequestIds) external view returns (address[] memory requestIds_) {
⋮----
function _addRequestId(
⋮----
function _removeRequestId(
````
## File: src/contracts/common/SelfDestruct.sol
````
// SPDX-License-Identifier: MIT
⋮----
contract SelfDestruct {
````
## File: src/contracts/common/UintRequests.sol
````
// SPDX-License-Identifier: MIT
⋮----
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";
⋮----
contract UintRequests is IUintRequests {
⋮----
/**
* @inheritdoc IUintRequests
*/
function requestIdsLength() external view returns (uint256) {
⋮----
function requestIds(uint256 index, uint256 maxRequestIds) external view returns (uint256[] memory requestIds_) {
⋮----
function _addRequestId(
⋮----
function _removeRequestId(
````
## File: src/contracts/router/BurnerRouter.sol
````
// SPDX-License-Identifier: MIT
⋮----
import {IBurnerRouter} from "../../interfaces/router/IBurnerRouter.sol";
⋮----
import {IBurner} from "@symbioticfi/core/src/interfaces/slasher/IBurner.sol";
import {Subnetwork} from "@symbioticfi/core/src/contracts/libraries/Subnetwork.sol";
⋮----
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import {SafeERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {Time} from "@openzeppelin/contracts/utils/types/Time.sol";
⋮----
contract BurnerRouter is OwnableUpgradeable, IBurnerRouter {
⋮----
/**
* @inheritdoc IBurnerRouter
*/
⋮----
/**
* @inheritdoc IBurner
*/
function onSlash(
⋮----
uint256, /* amount */
uint48 /* captureTimestamp */
⋮----
function triggerTransfer(
⋮----
function setGlobalReceiver(
⋮----
function acceptGlobalReceiver() external {
⋮----
function setNetworkReceiver(address network, address receiver) external onlyOwner {
⋮----
function acceptNetworkReceiver(
⋮----
function setOperatorNetworkReceiver(address network, address operator, address receiver) external onlyOwner {
⋮----
function acceptOperatorNetworkReceiver(address network, address operator) external {
⋮----
function setDelay(
⋮----
function acceptDelay() external {
⋮----
function initialize(
⋮----
function _getReceiver(address network, address operator) internal view returns (address receiver) {
⋮----
function _setReceiver(
⋮----
function _acceptReceiver(Address storage currentReceiver, PendingAddress storage pendingReceiver) internal {
⋮----
function _tryAcceptDelay() internal {
````
## File: src/contracts/router/BurnerRouterFactory.sol
````
// SPDX-License-Identifier: MIT
⋮----
import {BurnerRouter} from "./BurnerRouter.sol";
⋮----
import {IBurnerRouterFactory} from "../../interfaces/router/IBurnerRouterFactory.sol";
⋮----
import {Registry} from "@symbioticfi/core/src/contracts/common/Registry.sol";
⋮----
import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";
⋮----
contract BurnerRouterFactory is Registry, IBurnerRouterFactory {
⋮----
/**
* @inheritdoc IBurnerRouterFactory
*/
function create(
````
## File: src/interfaces/burners/ETHx/IETHx_Burner.sol
````
// SPDX-License-Identifier: MIT
⋮----
import {IUintRequests} from "../../common/IUintRequests.sol";
⋮----
interface IETHx_Burner is IUintRequests {
⋮----
/**
* @notice Emitted when a withdrawal is triggered.
* @param caller caller of the function
* @param requestId request ID that was created
*/
event TriggerWithdrawal(address indexed caller, uint256 requestId);
⋮----
/**
* @notice Emitted when a burn is triggered.
* @param caller caller of the function
* @param requestId request ID of the withdrawal that was claimed and burned
*/
event TriggerBurn(address indexed caller, uint256 requestId);
⋮----
/**
* @notice Get an address of the collateral.
*/
function COLLATERAL() external view returns (address);
⋮----
/**
* @notice Get an address of the Stader Config contract.
*/
function STADER_CONFIG() external view returns (address);
⋮----
/**
* @notice Get an address of the User Withdraw Manager contract.
*/
function USER_WITHDRAW_MANAGER() external view returns (address);
⋮----
/**
* @notice Get an address of the Stake Pools Manager contract.
*/
function STAKE_POOLS_MANAGER() external view returns (address);
⋮----
/**
* @notice Trigger a withdrawal of ETH from the collateral's underlying asset.
* @param maxWithdrawalAmount maximum amount of ETHx it is possible to withdraw in one request
* @return requestId request ID that was created
*/
function triggerWithdrawal(
⋮----
/**
* @notice Trigger a claim and a burn of ETH.
* @param requestId request ID of the withdrawal to process
*/
function triggerBurn(
````
## File: src/interfaces/burners/ETHx/IStaderConfig.sol
````
// SPDX-License-Identifier: MIT
⋮----
interface IStaderConfig {
function getUserWithdrawManager() external view returns (address);
⋮----
function getStakePoolManager() external view returns (address);
⋮----
function getMinWithdrawAmount() external view returns (uint256);
⋮----
function getMaxWithdrawAmount() external view returns (uint256);
⋮----
function getMinBlockDelayToFinalizeWithdrawRequest() external view returns (uint256);
````
## File: src/interfaces/burners/ETHx/IStaderStakePoolsManager.sol
````
// SPDX-License-Identifier: MIT
⋮----
interface IStaderStakePoolsManager {
// returns the amount of share corresponding to `_assets` assets
function previewDeposit(
⋮----
// return the amount of assets corresponding to `_shares` shares
function previewWithdraw(
````
## File: src/interfaces/burners/ETHx/IUserWithdrawalManager.sol
````
// SPDX-License-Identifier: MIT
⋮----
interface IUserWithdrawalManager {
function nextRequestId() external view returns (uint256);
⋮----
function nextRequestIdToFinalize() external view returns (uint256);
⋮----
/**
* @notice put a withdrawal request
* @param _ethXAmount amount of ethX shares to withdraw
* @param _owner owner of withdraw request to redeem
* @return requestId
*/
function requestWithdraw(uint256 _ethXAmount, address _owner) external returns (uint256);
⋮----
/**
* @notice finalize user requests
* @dev check for safeMode to finalizeRequest
*/
function finalizeUserWithdrawalRequest() external;
⋮----
/**
* @notice transfer the eth of finalized request to recipient and delete the request
* @param _requestId request id to redeem
*/
function claim(
````
## File: src/interfaces/burners/mETH/ImETH_Burner.sol
````
// SPDX-License-Identifier: MIT
⋮----
import {IUintRequests} from "../../common/IUintRequests.sol";
⋮----
interface ImETH_Burner is IUintRequests {
/**
* @notice Emitted when a withdrawal is triggered.
* @param caller caller of the function
* @param requestId request ID that was created
*/
event TriggerWithdrawal(address indexed caller, uint256 requestId);
⋮----
/**
* @notice Emitted when a burn is triggered.
* @param caller caller of the function
* @param requestId request ID of the withdrawal that was claimed and burned
*/
event TriggerBurn(address indexed caller, uint256 requestId);
⋮----
/**
* @notice Get an address of the collateral.
*/
function COLLATERAL() external view returns (address);
⋮----
/**
* @notice Get an address of the Mantle Staking contract.
*/
function STAKING() external view returns (address);
⋮----
/**
* @notice Trigger a withdrawal of ETH from the collateral's underlying asset.
* @return requestId request ID that was created
*/
function triggerWithdrawal() external returns (uint256 requestId);
⋮----
/**
* @notice Trigger a claim and a burn of ETH.
* @param requestId request ID of the withdrawal to process
*/
function triggerBurn(
````
## File: src/interfaces/burners/mETH/IMETH.sol
````
// SPDX-License-Identifier: MIT
⋮----
interface IMETH {
/// @notice The staking contract which has permissions to mint tokens.
function stakingContract() external view returns (address);
⋮----
/// @notice Mint mETH to the staker.
/// @param staker The address of the staker.
/// @param amount The amount of tokens to mint.
/// @dev Expected to be called during the stake operation.
function mint(address staker, uint256 amount) external;
````
## File: src/interfaces/burners/mETH/IStaking.sol
````
// SPDX-License-Identifier: MIT
⋮----
interface IStaking {
/// @notice The minimum amount of mETH users can unstake.
function minimumUnstakeBound() external view returns (uint256);
⋮----
/// @notice Converts from ETH to mETH using the current exchange rate.
/// The exchange rate is given by the total supply of mETH and total ETH controlled by the protocol.
function mETHToETH(
⋮----
/// @notice Interface for users to submit a request to unstake.
/// @dev Transfers the specified amount of mETH to the staking contract and locks it there until it is burned on
/// request claim. The staking contract must therefore be approved to move the user's mETH on their behalf.
/// @param methAmount The amount of mETH to unstake.
/// @param minETHAmount The minimum amount of ETH that the user expects to receive.
/// @return The request ID.
function unstakeRequest(uint128 methAmount, uint128 minETHAmount) external returns (uint256);
⋮----
/// @notice Interface for users to claim their finalized and filled unstaking requests.
/// @dev See also {UnstakeRequestsManager} for a more detailed explanation of finalization and request filling.
function claimUnstakeRequest(
````
## File: src/interfaces/burners/rETH/IrETH_Burner.sol
````
// SPDX-License-Identifier: MIT
⋮----
interface IrETH_Burner {
/**
* @notice Emitted when a burn is triggered.
* @param caller caller of the function
* @param assetAmount amount of collateral that was withdrawn
* @param ethAmount amount of ETH that was burned
*/
event TriggerBurn(address indexed caller, uint256 assetAmount, uint256 ethAmount);
⋮----
/**
* @notice Get an address of the collateral.
*/
function COLLATERAL() external view returns (address);
⋮----
/**
* @notice Trigger a claim and a burn of ETH.
* @param amount amount of collateral to burn
*/
function triggerBurn(
````
## File: src/interfaces/burners/rETH/IRocketTokenRETH.sol
````
// SPDX-License-Identifier: MIT
⋮----
interface IRocketTokenRETH {
// Calculate the amount of ETH backing an amount of rETH
function getEthValue(
⋮----
// Calculate the amount of rETH backed by an amount of ETH
function getRethValue(
⋮----
// Get the total amount of collateral available
// Includes rETH contract balance & excess deposit pool balance
function getTotalCollateral() external view returns (uint256);
⋮----
// Mint rETH
// Only accepts calls from the RocketDepositPool contract
function mint(uint256 _ethAmount, address _to) external;
⋮----
// Burn rETH for ETH
function burn(
````
## File: src/interfaces/burners/sfrxETH/IFraxEtherRedemptionQueue.sol
````
// SPDX-License-Identifier: MIT
⋮----
interface IFraxEtherRedemptionQueue {
/// @notice State of Frax's frxETH redemption queue
/// @return nextNftId Autoincrement for the NFT id
/// @return queueLengthSecs Current wait time (in seconds) a new redeemer would have. Should be close to Beacon.
/// @return redemptionFee Redemption fee given as a percentage with 1e6 precision
/// @return earlyExitFee Early NFT back to frxETH exit fee given as a percentage with 1e6 precision
function redemptionQueueState()
⋮----
/// @notice Enter the queue for redeeming sfrxEth to frxETH at the current rate, then frxETH to ETH 1-to-1. Must have approved or permitted first.
/// @notice Will generate a FrxETHRedemptionTicket NFT that can be redeemed for the actual ETH later.
/// @param _recipient Recipient of the NFT. Must be ERC721 compatible if a contract
/// @param _sfrxEthAmount Amount of sfrxETH to redeem (in shares / balanceOf)
/// @param _nftId The ID of the FrxEthRedemptionTicket NFT
/// @dev Must call approve/permit on frxEth contract prior to this call
function enterRedemptionQueueViaSfrxEth(
⋮----
/// @notice Redeems a FrxETHRedemptionTicket NFT for ETH. Must have reached the maturity date first.
/// @param _nftId The ID of the NFT
/// @param _recipient The recipient of the redeemed ETH
function burnRedemptionTicketNft(uint256 _nftId, address payable _recipient) external;
````
## File: src/interfaces/burners/sfrxETH/IsfrxETH_Burner.sol
````
// SPDX-License-Identifier: MIT
⋮----
import {IUintRequests} from "../../common/IUintRequests.sol";
⋮----
interface IsfrxETH_Burner is IUintRequests {
/**
* @notice Emitted when a withdrawal is triggered.
* @param caller caller of the function
* @param requestId request ID that was created
*/
event TriggerWithdrawal(address indexed caller, uint256 requestId);
⋮----
/**
* @notice Emitted when a burn is triggered.
* @param caller caller of the function
* @param requestId request ID of the withdrawal that was claimed and burned
*/
event TriggerBurn(address indexed caller, uint256 requestId);
⋮----
/**
* @notice Get an address of the collateral.
*/
function COLLATERAL() external view returns (address);
⋮----
/**
* @notice Get an address of the Frax Ether Redemption Queue.
*/
function FRAX_ETHER_REDEMPTION_QUEUE() external view returns (address);
⋮----
/**
* @notice Trigger a withdrawal of ETH from the collateral's underlying asset.
* @return requestId request ID that was created
*/
function triggerWithdrawal() external returns (uint256 requestId);
⋮----
/**
* @notice Trigger a claim and a burn of ETH.
* @param requestId request ID of the withdrawal to process
*/
function triggerBurn(
````
## File: src/interfaces/burners/sUSDe/IEthenaMinting.sol
````
// SPDX-License-Identifier: MIT
⋮----
interface IEthenaMinting {
⋮----
/// @notice tracks asset type (STABLE or ASSET)
⋮----
/// @notice tracks if the asset is active
⋮----
/// @notice max mint per block this given asset
⋮----
/// @notice max redeem per block this given asset
⋮----
/// @notice USDe minted per block / per asset per block
⋮----
/// @notice USDe redeemed per block / per asset per block
⋮----
/// @notice max USDe that can be minted across all assets within a single block.
⋮----
/// @notice max USDe that can be redeemed across all assets within a single block.
⋮----
/// @notice hash an Order struct
function hashOrder(
⋮----
/// @notice total USDe that can be minted/redeemed across all assets per single block.
function totalPerBlockPerAsset(uint256 blockNumber, address asset) external view returns (BlockTotals memory);
⋮----
function totalPerBlock(
⋮----
/// @notice global single block totals
function globalConfig() external view returns (GlobalConfig memory);
⋮----
function tokenConfig(
⋮----
/// @notice Adds a benefactor address to the benefactor whitelist
function addWhitelistedBenefactor(
⋮----
/**
* @notice Redeem stablecoins for assets
* @param order struct containing order details and confirmation from server
* @param signature signature of the taker
*/
function redeem(Order calldata order, Signature calldata signature) external;
````
## File: src/interfaces/burners/sUSDe/IsUSDe_Burner.sol
````
// SPDX-License-Identifier: MIT
⋮----
import {IAddressRequests} from "../../common/IAddressRequests.sol";
⋮----
interface IsUSDe_Burner is IAddressRequests {
⋮----
/**
* @notice Emitted when a withdrawal is triggered.
* @param caller caller of the function
* @param amount amount of the collateral to be withdrawn
* @param requestId request ID that was created
*/
event TriggerWithdrawal(address indexed caller, uint256 amount, address requestId);
⋮----
/**
* @notice Emitted when a claim is triggered.
* @param caller caller of the function
* @param requestId request ID of the withdrawal that was claimed
*/
event TriggerClaim(address indexed caller, address requestId);
⋮----
/**
* @notice Emitted when an instant claim is triggered.
* @param caller caller of the function
* @param amount amount of the collateral that was unwrapped
*/
event TriggerInstantClaim(address indexed caller, uint256 amount);
⋮----
/**
* @notice Emitted when a burn is triggered.
* @param caller caller of the function
* @param asset address of the asset burned (except sUSDe and USDe)
* @param amount amount of the asset burned
*/
event TriggerBurn(address indexed caller, address indexed asset, uint256 amount);
⋮----
/**
* @notice Get an address of the collateral.
*/
function COLLATERAL() external view returns (address);
⋮----
/**
* @notice Get an address of the USDe contract.
*/
function USDE() external view returns (address);
⋮----
/**
* @notice Trigger a withdrawal of USDe from the collateral's underlying asset.
* @return requestId request ID that was created
*/
function triggerWithdrawal() external returns (address requestId);
⋮----
/**
* @notice Trigger a claim of USDe (if `cooldownDuration` didn't equal zero while triggering withdrawal).
* @param requestId request ID of the withdrawal to process
*/
function triggerClaim(
⋮----
/**
* @notice Trigger an instant claim of USDe (if `cooldownDuration` equals zero).
*/
function triggerInstantClaim() external;
⋮----
/**
* @notice Trigger a burn of any asset lying on this contract except sUSDe and USDe (after USDe redemption).
* @param asset address of the asset to burn
*/
function triggerBurn(
⋮----
/**
* @notice Approve the USDe to a minter (if a new minter appears).
*/
function approveUSDeMinter() external;
````
## File: src/interfaces/burners/sUSDe/ISUSDe.sol
````
// SPDX-License-Identifier: MIT
⋮----
interface ISUSDe {
/**
* @dev See {IERC4626-asset}.
*/
function asset() external view returns (address);
⋮----
function cooldownDuration() external view returns (uint24);
⋮----
/// @notice redeem shares into assets and starts a cooldown to claim the converted underlying asset
/// @param shares shares to redeem
function cooldownShares(
⋮----
/**
* @dev See {IERC4626-previewRedeem}.
*/
function previewRedeem(
⋮----
/// @notice Set cooldown duration. If cooldown duration is set to zero, the StakedUSDeV2 behavior changes to follow ERC4626 standard and disables cooldownShares and cooldownAssets methods. If cooldown duration is greater than zero, the ERC4626 withdrawal and redeem functions are disabled, breaking the ERC4626 standard, and enabling the cooldownShares and the cooldownAssets functions.
/// @param duration Duration of the cooldown
function setCooldownDuration(
⋮----
/**
* @dev See {IERC4626-deposit}.
*/
function deposit(uint256 assets, address receiver) external returns (uint256);
⋮----
/**
* @dev See {IERC4626-redeem}.
*/
function redeem(uint256 shares, address receiver, address _owner) external returns (uint256);
⋮----
/// @notice Claim the staking amount after the cooldown has finished. The address can only retire the full amount of assets.
/// @dev unstake can be called after cooldown have been set to 0, to let accounts to be able to claim remaining assets locked at Silo
/// @param receiver Address to send the assets by the staker
function unstake(
````
## File: src/interfaces/burners/sUSDe/IUSDe.sol
````
// SPDX-License-Identifier: MIT
⋮----
interface IUSDe {
function minter() external view returns (address);
⋮----
function mint(address account, uint256 amount) external;
⋮----
/**
* @dev Destroys a `value` amount of tokens from the caller.
*
* See {ERC20-_burn}.
*/
function burn(
````
## File: src/interfaces/burners/swETH/IswETH_Burner.sol
````
// SPDX-License-Identifier: MIT
⋮----
import {IUintRequests} from "../../common/IUintRequests.sol";
⋮----
interface IswETH_Burner is IUintRequests {
⋮----
/**
* @notice Emitted when a withdrawal is triggered.
* @param caller caller of the function
* @param firstRequestId first request ID that was created
* @param lastRequestId last request ID that was created
*/
event TriggerWithdrawal(address indexed caller, uint256 firstRequestId, uint256 lastRequestId);
⋮----
/**
* @notice Emitted when a burn is triggered.
* @param caller caller of the function
* @param requestId request ID of the withdrawal that was claimed and burned
*/
event TriggerBurn(address indexed caller, uint256 requestId);
⋮----
/**
* @notice Get an address of the collateral.
*/
function COLLATERAL() external view returns (address);
⋮----
/**
* @notice Get an address of the Swell Exit contract.
*/
function SWEXIT() external view returns (address);
⋮----
/**
* @notice Trigger a withdrawal of ETH from the collateral's underlying asset.
* @param maxRequests maximum number of withdrawal requests to create
* @return firstRequestId first request ID that was created
* @return lastRequestId last request ID that was created
*/
function triggerWithdrawal(
⋮----
/**
* @notice Trigger a claim and a burn of ETH.
* @param requestId request ID of the withdrawal to process
*/
function triggerBurn(
````
## File: src/interfaces/burners/swETH/ISwETH.sol
````
// SPDX-License-Identifier: MIT
⋮----
interface ISwETH {
function deposit() external payable;
````
## File: src/interfaces/burners/swETH/ISwEXIT.sol
````
// SPDX-License-Identifier: MIT
⋮----
interface ISwEXIT {
function getLastTokenIdCreated() external view returns (uint256);
⋮----
function withdrawRequestMaximum() external view returns (uint256);
⋮----
function withdrawRequestMinimum() external view returns (uint256);
⋮----
function processWithdrawals(
⋮----
function createWithdrawRequest(
⋮----
function finalizeWithdrawal(
````
## File: src/interfaces/burners/wstETH/IWithdrawalQueue.sol
````
// SPDX-License-Identifier: MIT
⋮----
interface IWithdrawalQueue {
/// @notice Lido stETH token address
function STETH() external view returns (address);
⋮----
/// @notice minimal amount of stETH that is possible to withdraw
function MIN_STETH_WITHDRAWAL_AMOUNT() external view returns (uint256);
⋮----
/// @notice maximum amount of stETH that is possible to withdraw by a single request
/// Prevents accumulating too much funds per single request fulfillment in the future.
/// @dev To withdraw larger amounts, it's recommended to split it to several requests
function MAX_STETH_WITHDRAWAL_AMOUNT() external view returns (uint256);
⋮----
/// @notice id of the last request
/// NB! requests are indexed from 1, so it returns 0 if there is no requests in the queue
function getLastRequestId() external view returns (uint256);
⋮----
/// @notice Request the batch of stETH for withdrawal. Approvals for the passed amounts should be done before.
/// @param _amounts an array of stETH amount values.
/// The standalone withdrawal request will be created for each item in the passed list.
/// @param _owner address that will be able to manage the created requests.
/// If `address(0)` is passed, `msg.sender` will be used as owner.
/// @return requestIds an array of the created withdrawal request ids
function requestWithdrawals(
⋮----
/// @notice Claim a batch of withdrawal requests if they are finalized sending locked ether to the owner
/// @param _requestIds array of request ids to claim
/// @param _hints checkpoint hint for each id. Can be obtained with `findCheckpointHints()`
/// @dev
/// Reverts if requestIds and hints arrays length differs
/// Reverts if any requestId or hint in arguments are not valid
/// Reverts if any request is not finalized or already claimed
/// Reverts if msg sender is not an owner of the requests
function claimWithdrawals(uint256[] calldata _requestIds, uint256[] calldata _hints) external;
⋮----
/// @notice Claim one`_requestId` request once finalized sending locked ether to the owner
/// @param _requestId request id to claim
/// @dev use unbounded loop to find a hint, which can lead to OOG
⋮----
/// Reverts if requestId or hint are not valid
/// Reverts if request is not finalized or already claimed
/// Reverts if msg sender is not an owner of request
function claimWithdrawal(
⋮----
/// @notice Finalize requests from last finalized one up to `_lastRequestIdToBeFinalized`
/// @dev ether to finalize all the requests should be calculated using `prefinalize()` and sent along
function finalize(uint256 _lastRequestIdToBeFinalized, uint256 _maxShareRate) external payable;
⋮----
/// @notice length of the checkpoint array. Last possible value for the hint.
/// NB! checkpoints are indexed from 1, so it returns 0 if there is no checkpoints
function getLastCheckpointIndex() external view returns (uint256);
⋮----
/// @notice Finds the list of hints for the given `_requestIds` searching among the checkpoints with indices
/// in the range `[_firstIndex, _lastIndex]`.
/// NB! Array of request ids should be sorted
/// NB! `_firstIndex` should be greater than 0, because checkpoint list is 1-based array
/// Usage: findCheckpointHints(_requestIds, 1, getLastCheckpointIndex())
/// @param _requestIds ids of the requests sorted in the ascending order to get hints for
/// @param _firstIndex left boundary of the search range. Should be greater than 0
/// @param _lastIndex right boundary of the search range. Should be less than or equal to getLastCheckpointIndex()
/// @return hintIds array of hints used to find required checkpoint for the request
function findCheckpointHints(
````
## File: src/interfaces/burners/wstETH/IwstETH_Burner.sol
````
// SPDX-License-Identifier: MIT
⋮----
import {IUintRequests} from "../../common/IUintRequests.sol";
⋮----
interface IwstETH_Burner is IUintRequests {
⋮----
/**
* @notice Emitted when a withdrawal is triggered.
* @param caller caller of the function
* @param requestIds request IDs that were created
*/
event TriggerWithdrawal(address indexed caller, uint256[] requestIds);
⋮----
/**
* @notice Emitted when a burn is triggered.
* @param caller caller of the function
* @param requestId request ID of the withdrawal that was claimed and burned
*/
event TriggerBurn(address indexed caller, uint256 requestId);
⋮----
/**
* @notice Emitted when a batch burn is triggered.
* @param caller caller of the function
* @param requestIds request IDs of the withdrawals that were claimed and burned
*/
event TriggerBurnBatch(address indexed caller, uint256[] requestIds);
⋮----
/**
* @notice Get an address of the collateral.
*/
function COLLATERAL() external view returns (address);
⋮----
/**
* @notice Get an address of the stETH token.
*/
function STETH() external view returns (address);
⋮----
/**
* @notice Get an address of the Lido Withdrawal Queue.
*/
function LIDO_WITHDRAWAL_QUEUE() external view returns (address);
⋮----
/**
* @notice Get a minimum amount of stETH that can be withdrawn at a request.
*/
function MIN_STETH_WITHDRAWAL_AMOUNT() external view returns (uint256);
⋮----
/**
* @notice Get a maximum amount of stETH that can be withdrawn at a request.
*/
function MAX_STETH_WITHDRAWAL_AMOUNT() external view returns (uint256);
⋮----
/**
* @notice Trigger a withdrawal of ETH from the collateral's underlying asset.
* @param maxRequests maximum number of withdrawal requests to create
* @return requestIds request IDs that were created
*/
function triggerWithdrawal(
⋮----
/**
* @notice Trigger a claim and a burn of ETH.
* @param requestId request ID of the withdrawal to process
*/
function triggerBurn(
⋮----
/**
* @notice Trigger a batch claim and burn of ETH.
* @param requestIds request IDs of the withdrawals to process
* @param hints hints for the requests
*/
function triggerBurnBatch(uint256[] calldata requestIds, uint256[] calldata hints) external;
````
## File: src/interfaces/burners/wstETH/IWstETH.sol
````
// SPDX-License-Identifier: MIT
⋮----
interface IWstETH {
/**
* @notice Get amount of stETH for a given amount of wstETH
* @param _wstETHAmount amount of wstETH
* @return Amount of stETH for a given wstETH amount
*/
function getStETHByWstETH(
⋮----
/**
* @notice Exchanges wstETH to stETH
* @param _wstETHAmount amount of wstETH to uwrap in exchange for stETH
* @dev Requirements:
* - `_wstETHAmount` must be non-zero
* - msg.sender must have at least `_wstETHAmount` wstETH.
* @return Amount of stETH user receives after unwrap
*/
function unwrap(
````
## File: src/interfaces/common/IAddressRequests.sol
````
// SPDX-License-Identifier: MIT
⋮----
interface IAddressRequests {
⋮----
/**
* @notice Get the number of unprocessed request IDs.
*/
function requestIdsLength() external view returns (uint256);
⋮----
/**
* @notice Get a list of unprocessed request IDs.
* @param index index of the first request ID
* @param maxRequestIds maximum number of request IDs to return
* @return requestIds request IDs
*/
function requestIds(uint256 index, uint256 maxRequestIds) external view returns (address[] memory requestIds);
````
## File: src/interfaces/common/IUintRequests.sol
````
// SPDX-License-Identifier: MIT
⋮----
interface IUintRequests {
⋮----
/**
* @notice Get the number of unprocessed request IDs.
*/
function requestIdsLength() external view returns (uint256);
⋮----
/**
* @notice Get a list of unprocessed request IDs.
* @param index index of the first request ID
* @param maxRequestIds maximum number of request IDs to return
* @return requestIds request IDs
*/
function requestIds(uint256 index, uint256 maxRequestIds) external view returns (uint256[] memory requestIds);
````
## File: src/interfaces/router/IBurnerRouter.sol
````
// SPDX-License-Identifier: MIT
⋮----
import {IBurner} from "@symbioticfi/core/src/interfaces/slasher/IBurner.sol";
⋮----
interface IBurnerRouter is IBurner {
⋮----
/**
* @notice Structure for a value of `address` type.
* @param value value of `address` type
*/
⋮----
/**
* @notice Structure for a pending value of `address` type.
* @param value pending value of `address` type
* @param timestamp timestamp since which the pending value can be used
*/
⋮----
/**
* @notice Structure for a value of `uint48` type.
* @param value value of `uint48` type
*/
⋮----
/**
* @notice Structure for a pending value of `uint48` type.
* @param value pending value of `uint48` type
* @param timestamp timestamp since which the pending value can be used
*/
⋮----
/**
* @notice Structure used to set a `receiver` for a slashing `network`.
* @param network address of the slashing network
* @param receiver address of the recipient of the slashed funds
*/
⋮----
/**
* @notice Structure used to set a `receiver` for a slashed `operator` by a slashing `network`.
* @param network address of the slashing network
* @param operator address of the slashed operator
* @param receiver address of the recipient of the slashed funds
*/
⋮----
/**
* @notice Initial parameters needed for a router deployment.
* @param owner manager of the router's receivers
* @param collateral router's underlying collateral (MUST be the same as the vault's underlying collateral)
* @param delay delay for setting a new receiver or changing the delay itself (in seconds)
* @param globalReceiver address of the global receiver of the slashed funds (if no receiver is set for a network or operator)
* @param networkReceivers array of network receivers to set on deployment (network => receiver)
* @param operatorNetworkReceivers array of operator network receivers to set on deployment (network-operator => receiver)
*/
⋮----
/**
* @notice Emitted when a transfer from the router to the receiver is triggered.
* @param receiver address of the receiver
* @param amount amount of the transfer
*/
event TriggerTransfer(address indexed receiver, uint256 amount);
⋮----
/**
* @notice Emitted when a global receiver is set (becomes pending for a `delay`).
* @param receiver address of the receiver
*/
event SetGlobalReceiver(address receiver);
⋮----
/**
* @notice Emitted when a pending global receiver is accepted.
*/
event AcceptGlobalReceiver();
⋮----
/**
* @notice Emitted when a network receiver is set (becomes pending for a `delay`).
* @param network address of the network
* @param receiver address of the receiver
*/
event SetNetworkReceiver(address indexed network, address receiver);
⋮----
/**
* @notice Emitted when a pending network receiver is accepted.
* @param network address of the network
*/
event AcceptNetworkReceiver(address indexed network);
⋮----
/**
* @notice Emitted when an operator network receiver is set (becomes pending for a `delay`).
* @param network address of the network
* @param operator address of the operator
* @param receiver address of the receiver
*/
event SetOperatorNetworkReceiver(address indexed network, address indexed operator, address receiver);
⋮----
/**
* @notice Emitted when a pending operator network receiver is accepted.
* @param network address of the network
* @param operator address of the operator
*/
event AcceptOperatorNetworkReceiver(address indexed network, address indexed operator);
⋮----
/**
* @notice Emitted when a delay is set (becomes pending for a `delay`).
* @param delay new delay
*/
event SetDelay(uint48 delay);
⋮----
/**
* @notice Emitted when a pending delay is accepted.
*/
event AcceptDelay();
⋮----
/**
* @notice Get a router collateral.
* @return address of the underlying collateral
*/
function collateral() external view returns (address);
⋮----
/**
* @notice Get a router last checked balance.
* @return last balance of the router
*/
function lastBalance() external view returns (uint256);
⋮----
/**
* @notice Get a router delay.
* @return delay for setting a new receiver or changing the delay itself (in seconds)
*/
function delay() external view returns (uint48);
⋮----
/**
* @notice Get a router pending delay.
* @return value pending delay
* @return timestamp timestamp since which the pending delay can be used
*/
function pendingDelay() external view returns (uint48, uint48);
⋮----
/**
* @notice Get a router global receiver.
* @return address of the global receiver of the slashed funds
*/
function globalReceiver() external view returns (address);
⋮----
/**
* @notice Get a router pending global receiver.
* @return value pending global receiver
* @return timestamp timestamp since which the pending global receiver can be used
*/
function pendingGlobalReceiver() external view returns (address, uint48);
⋮----
/**
* @notice Get a router receiver for a slashing network.
* @param network address of the slashing network
* @return address of the receiver
*/
function networkReceiver(
⋮----
/**
* @notice Get a router pending receiver for a slashing network.
* @param network address of the slashing network
* @return value pending receiver
* @return timestamp timestamp since which the pending receiver can be used
*/
function pendingNetworkReceiver(
⋮----
/**
* @notice Get a router receiver for a slashed operator by a slashing network.
* @param network address of the slashing network
* @param operator address of the slashed operator
* @return address of the receiver
*/
function operatorNetworkReceiver(address network, address operator) external view returns (address);
⋮----
/**
* @notice Get a router pending receiver for a slashed operator by a slashing network.
* @param network address of the slashing network
* @param operator address of the slashed operator
* @return value pending receiver
* @return timestamp timestamp since which the pending receiver can be used
*/
function pendingOperatorNetworkReceiver(
⋮----
/**
* @notice Get a receiver balance of unclaimed collateral.
* @param receiver address of the receiver
* @return amount of the unclaimed collateral tokens
*/
function balanceOf(
⋮----
/**
* @notice Trigger a transfer of the unclaimed collateral to the receiver.
* @param receiver address of the receiver
* @return amount of the transfer
*/
function triggerTransfer(
⋮----
/**
* @notice Set a new global receiver of the slashed funds.
* @param receiver address of the new receiver
*/
function setGlobalReceiver(
⋮----
/**
* @notice Accept a pending global receiver.
*/
function acceptGlobalReceiver() external;
⋮----
/**
* @notice Set a new receiver for a slashing network.
* @param network address of the slashing network
* @param receiver address of the new receiver
*/
function setNetworkReceiver(address network, address receiver) external;
⋮----
/**
* @notice Accept a pending receiver for a slashing network.
* @param network address of the slashing network
*/
function acceptNetworkReceiver(
⋮----
/**
* @notice Set a new receiver for a slashed operator by a slashing network.
* @param network address of the slashing network
* @param operator address of the slashed operator
* @param receiver address of the new receiver
*/
function setOperatorNetworkReceiver(address network, address operator, address receiver) external;
⋮----
/**
* @notice Accept a pending receiver for a slashed operator by a slashing network.
* @param network address of the slashing network
* @param operator address of the slashed operator
*/
function acceptOperatorNetworkReceiver(address network, address operator) external;
⋮----
/**
* @notice Set a new delay for setting a new receiver or changing the delay itself.
* @param newDelay new delay (in seconds)
*/
function setDelay(
⋮----
/**
* @notice Accept a pending delay.
*/
function acceptDelay() external;
````
## File: src/interfaces/router/IBurnerRouterFactory.sol
````
// SPDX-License-Identifier: MIT
⋮----
import {IBurnerRouter} from "./IBurnerRouter.sol";
⋮----
import {IRegistry} from "@symbioticfi/core/src/interfaces/common/IRegistry.sol";
⋮----
interface IBurnerRouterFactory is IRegistry {
/**
* @notice Create a burner router contract.
* @param params initial parameters needed for a burner router contract deployment
* @return address of the created burner router contract
*/
function create(
````
## File: test/burners/ETHx_Burner.t.sol
````
// SPDX-License-Identifier: MIT
⋮----
import {Test, console2} from "forge-std/Test.sol";
⋮----
import {ETHx_Burner} from "../../src/contracts/burners/ETHx_Burner.sol";
⋮----
import {IETHx_Burner} from "../../src/interfaces/burners/ETHx/IETHx_Burner.sol";
import {IStaderConfig} from "../../src/interfaces/burners/ETHx/IStaderConfig.sol";
import {IStaderStakePoolsManager} from "../../src/interfaces/burners/ETHx/IStaderStakePoolsManager.sol";
import {IUserWithdrawalManager} from "../../src/interfaces/burners/ETHx/IUserWithdrawalManager.sol";
⋮----
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
⋮----
contract ETHx_BurnerTest is Test {
⋮----
// in shares
⋮----
function setUp() public {
⋮----
function test_Create() public {
⋮----
function test_TriggerWithdrawal(
⋮----
function test_TriggerWithdrawalRevertInvalidHints(uint256 depositAmount1, uint256 withdrawRequestMaximum_) public {
⋮----
function test_TriggerBurn(
⋮----
function test_TriggerBurnRevertInvalidRequestId(
⋮----
interface IETHx {
/**
* @notice Mints ethX when called by an authorized caller
* @param to the account to mint to
* @param amount the amount of ethX to mint
*/
function mint(address to, uint256 amount) external;
````
## File: test/burners/mETH_Burner.t.sol
````
// SPDX-License-Identifier: MIT
⋮----
import {Test, console2} from "forge-std/Test.sol";
⋮----
import {mETH_Burner} from "../../src/contracts/burners/mETH_Burner.sol";
⋮----
import {IStaking} from "../../src/interfaces/burners/mETH/IStaking.sol";
import {IMETH} from "../../src/interfaces/burners/mETH/IMETH.sol";
import {ImETH_Burner} from "../../src/interfaces/burners/mETH/ImETH_Burner.sol";
import {IUintRequests} from "../../src/interfaces/common/IUintRequests.sol";
⋮----
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
⋮----
contract mETH_BurnerTest is Test {
⋮----
function setUp() public {
⋮----
function test_Create() public {
⋮----
function test_TriggerWithdrawal(uint256 depositAmount1, uint256 depositAmount2) public {
⋮----
function test_TriggerBurn(
⋮----
function test_TriggerBurnRevertInvalidRequestId(
⋮----
interface ITransparentUpgradeableProxy {
function admin() external view returns (address);
⋮----
function implementation() external view returns (address);
⋮----
function changeAdmin(
⋮----
function upgradeTo(
⋮----
function upgradeToAndCall(address, bytes memory) external payable;
⋮----
interface IUnstakeRequestsManagerWrite {
/// @notice Returns the ID of the next unstake requests to be created.
function nextRequestId() external view returns (uint256);
⋮----
/// @notice Allocate ether into the contract.
/// @dev Handles incoming ether from the staking contract, increasing the allocatedETHForClaims counter by the value
/// of the incoming allocatedETH.
function allocateETH() external payable;
⋮----
interface IOracle {
/// @notice The records stored by the oracle contract informing the protocol about consensus layer activity. It is
/// computed and reported by off-chain oracle services.
/// @dev "current" quantities refer to the state at the `updateEndBlock` block number.
/// @dev "cumulative" quantities refer to sums up to the `updateEndBlock` block number.
/// @dev "window" quantities refer to sums over the block window between the `updateStartBlock` and `updateEndBlock`.
/// @param updateStartBlock The start of the oracle record block window. This should be 1 higher than the
/// updateEndBlock of the previous oracle record.
/// @param updateEndBlock The block number up to which this oracle record was computed (inclusive).
/// @param currentNumValidatorsNotWithdrawable The number of our validators that do not have the withdrawable status.
/// @param cumulativeNumValidatorsWithdrawable The total number of our validators that have the withdrawable status.
/// These validators have either the status `withdrawal_possible` or `withdrawal_done`. Note: validators can
/// fluctuate between the two statuses due to top ups.
/// @param windowWithdrawnPrincipalAmount The amount of principal that has been withdrawn from the consensus layer in
/// the analyzed block window.
/// @param windowWithdrawnRewardAmount The amount of rewards that has been withdrawn from the consensus layer in the
/// analysed block window.
/// @param currentTotalValidatorBalance The total amount of ETH in the consensus layer (i.e. the sum of all validator
/// balances). This is one of the major quantities to compute the total value controlled by the protocol.
/// @param cumulativeProcessedDepositAmount The total amount of ETH that has been deposited into and processed by the
/// consensus layer. This is used to prevent double counting of the ETH deposited to the consensus layer.
⋮----
/// @notice Returns the latest validated record.
/// @return `OracleRecord` The latest validated record.
function latestRecord() external view returns (OracleRecord memory);
⋮----
contract Oracle is IOracle {
function latestRecord() external view override returns (OracleRecord memory) {
````
## File: test/burners/rETH_Burner.t.sol
````
// SPDX-License-Identifier: MIT
⋮----
import {Test, console2} from "forge-std/Test.sol";
⋮----
import {rETH_Burner} from "../../src/contracts/burners/rETH_Burner.sol";
⋮----
import {IrETH_Burner} from "../../src/interfaces/burners/rETH/IrETH_Burner.sol";
import {IRocketTokenRETH} from "../../src/interfaces/burners/rETH/IRocketTokenRETH.sol";
⋮----
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
⋮----
contract rETH_BurnerTest is Test {
⋮----
function setUp() public {
⋮----
function test_Create() public {
⋮----
function test_TriggerBurn(uint256 depositAmount1, uint256 burnAmount1, uint256 burnAmount2) public {
⋮----
function test_TriggerBurnRevert(uint256 depositAmount1, uint256 burnAmount1) public {
````
## File: test/burners/sfrxETH_Burner.t.sol
````
// SPDX-License-Identifier: MIT
⋮----
import {Test, console2} from "forge-std/Test.sol";
⋮----
import {sfrxETH_Burner} from "../../src/contracts/burners/sfrxETH_Burner.sol";
⋮----
import {IFraxEtherRedemptionQueue} from "../../src/interfaces/burners/sfrxETH/IFraxEtherRedemptionQueue.sol";
import {IsfrxETH_Burner} from "../../src/interfaces/burners/sfrxETH/IsfrxETH_Burner.sol";
import {IUintRequests} from "../../src/interfaces/common/IUintRequests.sol";
⋮----
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
⋮----
contract sfrxETH_BurnerTest is Test {
⋮----
function setUp() public {
⋮----
function test_Create() public {
⋮----
function test_TriggerWithdrawal(uint256 depositAmount1, uint256 depositAmount2) public {
⋮----
function test_TriggerBurn(
⋮----
function test_TriggerBurnRevertInvalidRequestId(
⋮----
interface IFrxETH {
// This function is what other minters will call to mint new tokens
function minter_mint(address m_address, uint256 m_amount) external;
⋮----
interface ISfrxETH {
function deposit(uint256 assets, address receiver) external returns (uint256 shares);
````
## File: test/burners/sUSDe_Burner.t.sol
````
// SPDX-License-Identifier: MIT
⋮----
import {Test, console2} from "forge-std/Test.sol";
⋮----
import {sUSDe_Burner} from "../../src/contracts/burners/sUSDe/sUSDe_Burner.sol";
import {sUSDe_Miniburner} from "../../src/contracts/burners/sUSDe/sUSDe_Miniburner.sol";
⋮----
import {IsUSDe_Burner} from "../../src/interfaces/burners/sUSDe/IsUSDe_Burner.sol";
import {ISUSDe} from "../../src/interfaces/burners/sUSDe/ISUSDe.sol";
import {IUSDe} from "../../src/interfaces/burners/sUSDe/IUSDe.sol";
import {IEthenaMinting} from "../../src/interfaces/burners/sUSDe/IEthenaMinting.sol";
import {IAddressRequests} from "../../src/interfaces/common/IAddressRequests.sol";
⋮----
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
⋮----
contract sUSDe_BurnerTest is Test {
⋮----
function setUp() public {
⋮----
function test_Create() public {
⋮----
function test_TriggerWithdrawal(uint256 depositAmount1, uint256 depositAmount2, uint24 duration) public {
⋮----
function test_TriggerClaim(uint256 depositAmount1, uint24 duration) public {
⋮----
function test_TriggerClaimRevertInvalidRequestId(uint256 depositAmount1, uint24 duration) public {
⋮----
function test_TriggerClaimRevertNoCooldown(
⋮----
function test_TriggerInstantClaim(
⋮----
function test_TriggerInstantClaimRevertHasCooldown(uint256 depositAmount1, uint24 duration) public {
⋮----
function test_TriggerBurn1(uint256 depositAmount1, uint24 duration) public {
⋮----
function test_TriggerBurn2(uint256 depositAmount1, uint24 duration) public {
⋮----
function test_TriggerBurnRevertInvalidAsset1(uint256 depositAmount1, uint24 duration) public {
⋮----
function test_TriggerBurnRevertInvalidAsset2(uint256 depositAmount1, uint24 duration) public {
⋮----
function test_ApproveUSDeMinter(uint256 depositAmount1, uint24 duration) public {
⋮----
function test_ApproveUSDeMinterRevertSufficientAllowance(uint256 depositAmount1, uint24 duration) public {
````
## File: test/burners/swETH_Burner.t.sol
````
// SPDX-License-Identifier: MIT
⋮----
import {Test, console2} from "forge-std/Test.sol";
⋮----
import {swETH_Burner} from "../../src/contracts/burners/swETH_Burner.sol";
⋮----
import {ISwEXIT} from "../../src/interfaces/burners/swETH/ISwEXIT.sol";
import {ISwETH} from "../../src/interfaces/burners/swETH/ISwETH.sol";
import {IswETH_Burner} from "../../src/interfaces/burners/swETH/IswETH_Burner.sol";
import {IUintRequests} from "../../src/interfaces/common/IUintRequests.sol";
⋮----
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
⋮----
contract swETH_BurnerTest is Test {
⋮----
function setUp() public {
⋮----
function test_Create() public {
⋮----
function test_TriggerWithdrawal(uint256 depositAmount1, uint256 depositAmount2, uint256 maxRequests) public {
⋮----
function test_TriggerWithdrawalRevertInsufficientWithdrawal(
⋮----
function test_TriggerBurn(
⋮----
function test_TriggerBurnRevertInvalidRequestId(
````
## File: test/burners/wstETH_Burner.t.sol
````
// SPDX-License-Identifier: MIT
⋮----
import {Test, console2} from "forge-std/Test.sol";
⋮----
import {wstETH_Burner} from "../../src/contracts/burners/wstETH_Burner.sol";
⋮----
import {IWithdrawalQueue} from "../../src/interfaces/burners/wstETH/IWithdrawalQueue.sol";
import {IWstETH} from "../../src/interfaces/burners/wstETH/IWstETH.sol";
import {IwstETH_Burner} from "../../src/interfaces/burners/wstETH/IwstETH_Burner.sol";
import {IUintRequests} from "../../src/interfaces/common/IUintRequests.sol";
⋮----
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
⋮----
contract wstETH_BurnerTest is Test {
⋮----
function setUp() public {
⋮----
function test_Create() public {
⋮----
function test_TriggerWithdrawal(uint256 depositAmount1, uint256 depositAmount2, uint256 maxRequests) public {
⋮----
function test_TriggerWithdrawalRevertInsufficientWithdrawal(
⋮----
function test_TriggerBurn(
⋮----
function test_TriggerBurnRevertInvalidRequestId(
⋮----
function test_TriggerBurnBatch(
⋮----
function test_TriggerBurnBatchRevertInvalidRequestId(
````
## File: test/common/SelfDestruct.t.sol
````
// SPDX-License-Identifier: MIT
⋮----
import {Test, console2} from "forge-std/Test.sol";
⋮----
import {SelfDestruct} from "../../src/contracts/common/SelfDestruct.sol";
⋮----
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
⋮----
contract SelfDestructTest is Test {
⋮----
function setUp() public {
⋮----
function test_Create() public {
````
## File: test/integration/SymbioticBurnersBindings.sol
````
// SPDX-License-Identifier: MIT
⋮----
import "./SymbioticBurnersImports.sol";
⋮----
import {Test} from "forge-std/Test.sol";
⋮----
contract SymbioticBurnersBindings is Test {
function _createBurnerRouter_SymbioticBurners(
⋮----
function _triggerTransfer_SymbioticBurners(address who, address burnerRouter, address receiver) internal virtual {
⋮----
function _setGlobalReceiver_SymbioticBurners(
⋮----
function _acceptGlobalReceiver_SymbioticBurners(address who, address burnerRouter) internal virtual {
⋮----
function _setNetworkReceiver_SymbioticBurners(
⋮----
function _acceptNetworkReceiver_SymbioticBurners(
⋮----
function _setOperatorNetworkReceiver_SymbioticBurners(
⋮----
function _acceptOperatorNetworkReceiver_SymbioticBurners(
⋮----
function _setDelay_SymbioticBurners(address who, address burnerRouter, uint48 newDelay) internal virtual {
⋮----
function _acceptDelay_SymbioticBurners(address who, address burnerRouter) internal virtual {
⋮----
function _triggerWithdrawal_ETHx_SymbioticBurners(
⋮----
function _triggerBurn_ETHx_SymbioticBurners(address who, address burner, uint256 requestId) internal virtual {
⋮----
function _triggerWithdrawal_mETH_SymbioticBurners(
⋮----
function _triggerBurn_mETH_SymbioticBurners(address who, address burner, uint256 requestId) internal virtual {
⋮----
function _triggerBurn_rETH_SymbioticBurners(address who, address burner, uint256 amount) internal virtual {
⋮----
function _triggerWithdrawal_sfrxETH_SymbioticBurners(
⋮----
function _triggerBurn_sfrxETH_SymbioticBurners(address who, address burner, uint256 requestId) internal virtual {
⋮----
function _triggerWithdrawal_sUSDe_SymbioticBurners(
⋮----
function _triggerClaim_sUSDe_SymbioticBurners(address who, address burner, address requestId) internal virtual {
⋮----
function _triggerInstantClaim_sUSDe_SymbioticBurners(address who, address burner) internal virtual {
⋮----
function _triggerBurn_sUSDe_SymbioticBurners(address who, address burner, address asset) internal virtual {
⋮----
function _approveUSDeMinter_sUSDe_SymbioticBurners(address who, address burner) internal virtual {
⋮----
function _triggerWithdrawal_swETH_SymbioticBurners(
⋮----
function _triggerBurn_swETH_SymbioticBurners(address who, address burner, uint256 requestId) internal virtual {
⋮----
function _triggerWithdrawal_wstETH_SymbioticBurners(
⋮----
function _triggerBurn_wstETH_SymbioticBurners(address who, address burner, uint256 requestId) internal virtual {
⋮----
function _triggerBurnBatch_wstETH_SymbioticBurners(
````
## File: test/integration/SymbioticBurnersConstants.sol
````
// SPDX-License-Identifier: MIT
⋮----
import "./SymbioticBurnersImports.sol";
⋮----
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
⋮----
import {SymbioticCoreConstants} from "@symbioticfi/core/test/integration/SymbioticCoreConstants.sol";
⋮----
function burners() internal view returns (Burners memory) {
⋮----
// mainnet
⋮----
// holesky
⋮----
// sepolia
⋮----
// hoodi
⋮----
function burnerRouterFactory() internal view returns (ISymbioticBurnerRouterFactory) {
⋮----
function ETHx_BurnerSupported() internal view returns (bool) {
⋮----
function mETH_BurnerSupported() internal view returns (bool) {
⋮----
function rETH_BurnerSupported() internal view returns (bool) {
⋮----
function sfrxETH_BurnerSupported() internal view returns (bool) {
⋮----
function swETH_BurnerSupported() internal view returns (bool) {
⋮----
function wstETH_BurnerSupported() internal view returns (bool) {
⋮----
function burner(
⋮----
function burnerSupported(
⋮----
function allBurners() internal view returns (string[] memory result) {
⋮----
function tokenAddressToBurner(
⋮----
function tokenAddressToBurnerSupported(
⋮----
function lidoWithdrawalQueue() internal view returns (address) {
⋮----
function swEXIT() internal view returns (address) {
⋮----
function fraxEtherRedemptionQueue() internal view returns (address) {
⋮----
function staderConfig() internal view returns (address) {
````
## File: test/integration/SymbioticBurnersImports.sol
````
// SPDX-License-Identifier: MIT
⋮----
import {IBurnerRouter as ISymbioticBurnerRouter} from "../../src/interfaces/router/IBurnerRouter.sol";
import {IBurnerRouterFactory as ISymbioticBurnerRouterFactory} from
"../../src/interfaces/router/IBurnerRouterFactory.sol";
import {IAddressRequests as ISymbioticAddressRequests} from "../../src/interfaces/common/IAddressRequests.sol";
import {IUintRequests as ISymbioticUintRequests} from "../../src/interfaces/common/IUintRequests.sol";
import {IETHx_Burner as ISymbioticETHx_Burner} from "../../src/interfaces/burners/ETHx/IETHx_Burner.sol";
import {ImETH_Burner as ISymbioticmETH_Burner} from "../../src/interfaces/burners/mETH/ImETH_Burner.sol";
import {IrETH_Burner as ISymbioticrETH_Burner} from "../../src/interfaces/burners/rETH/IrETH_Burner.sol";
import {IsfrxETH_Burner as ISymbioticsfrxETH_Burner} from "../../src/interfaces/burners/sfrxETH/IsfrxETH_Burner.sol";
import {IsUSDe_Burner as ISymbioticsUSDe_Burner} from "../../src/interfaces/burners/sUSDe/IsUSDe_Burner.sol";
import {IswETH_Burner as ISymbioticswETH_Burner} from "../../src/interfaces/burners/swETH/IswETH_Burner.sol";
import {IwstETH_Burner as ISymbioticwstETH_Burner} from "../../src/interfaces/burners/wstETH/IwstETH_Burner.sol";
⋮----
interface SymbioticBurnersImports {}
````
## File: test/integration/SymbioticBurnersImportsContracts.sol
````
// SPDX-License-Identifier: MIT
⋮----
import {BurnerRouter as SymbioticBurnerRouter} from "../../src/contracts/router/BurnerRouter.sol";
import {BurnerRouterFactory as SymbioticBurnerRouterFactory} from "../../src/contracts/router/BurnerRouterFactory.sol";
import {AddressRequests as SymbioticAddressRequests} from "../../src/contracts/common/AddressRequests.sol";
import {UintRequests as SymbioticUintRequests} from "../../src/contracts/common/UintRequests.sol";
import {SelfDestruct as SymbioticSelfDestruct} from "../../src/contracts/common/SelfDestruct.sol";
import {ETHx_Burner as SymbioticETHx_Burner} from "../../src/contracts/burners/ETHx_Burner.sol";
import {mETH_Burner as SymbioticmETH_Burner} from "../../src/contracts/burners/mETH_Burner.sol";
import {rETH_Burner as SymbioticrETH_Burner} from "../../src/contracts/burners/rETH_Burner.sol";
import {sfrxETH_Burner as SymbioticsfrxETH_Burner} from "../../src/contracts/burners/sfrxETH_Burner.sol";
import {
sUSDe_Burner as SymbioticsUSDe_Burner,
sUSDe_Miniburner as SymbioticsUSDe_Miniburner
} from "../../src/contracts/burners/sUSDe/sUSDe_Burner.sol";
import {swETH_Burner as SymbioticswETH_Burner} from "../../src/contracts/burners/swETH_Burner.sol";
import {wstETH_Burner as SymbioticwstETH_Burner} from "../../src/contracts/burners/wstETH_Burner.sol";
⋮----
interface SymbioticBurnersImportsContracts {}
````
## File: test/integration/SymbioticBurnersInit.sol
````
// SPDX-License-Identifier: MIT
⋮----
import "@symbioticfi/core/test/integration/SymbioticCoreInit.sol";
⋮----
import "./SymbioticBurnersImports.sol";
⋮----
import {SymbioticBurnersConstants} from "./SymbioticBurnersConstants.sol";
import {SymbioticBurnersBindings} from "./SymbioticBurnersBindings.sol";
⋮----
import {SafeERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
⋮----
contract SymbioticBurnersInit is SymbioticCoreInit, SymbioticBurnersBindings {
⋮----
// General config
⋮----
// Burner Router config
⋮----
function setUp() public virtual override {
⋮----
// ------------------------------------------------------------ GENERAL HELPERS ------------------------------------------------------------ //
⋮----
function _initBurners_SymbioticBurners() internal virtual {
⋮----
function _initBurners_SymbioticBurners(
⋮----
function _initBurnerRouter_SymbioticBurners() internal virtual {
⋮----
function _initBurnerRouter_SymbioticBurners(
⋮----
// ------------------------------------------------------------ BURNER-ROUTER-RELATED HELPERS ------------------------------------------------------------ //
⋮----
function _getBurnerRouter_SymbioticBurners(
⋮----
function _getBurnerRouterRandom_SymbioticBurners(
⋮----
// ------------------------------------------------------------ ANYONE-RELATED HELPERS ------------------------------------------------------------ //
⋮----
// function _anyoneTriggerAction_SymbioticBurners(
// address anyone,
// address burner
// ) internal virtual returns (bool lastStep) {
// // address collateral = ISymbioticETHx_Burner(burner).COLLATERAL();
// // address collateral = ISymbioticmETH_Burner(burner).COLLATERAL();
// // address collateral = ISymbioticrETH_Burner(burner).COLLATERAL();
// // address collateral = ISymbioticsfrxETH_Burner(burner).COLLATERAL();
// // address collateral = ISymbioticswETH_Burner(burner).COLLATERAL();
// address collateral = ISymbioticwstETH_Burner(burner).COLLATERAL();
⋮----
// if (collateral == SymbioticCoreConstants.token("ETHx")) {
// ;
// return false;
// } else if (collateral == SymbioticCoreConstants.token("mETH")) {
⋮----
// } else if (collateral == SymbioticCoreConstants.token("rETH")) {
⋮----
// return true;
// } else if (collateral == SymbioticCoreConstants.token("sfrxETH")) {
⋮----
// } else if (collateral == SymbioticCoreConstants.token("swETH")) {
⋮----
// } else if (collateral == SymbioticCoreConstants.token("wstETH")) {
⋮----
// } else {
// revert("Unsupported collateral");
// }
// }
⋮----
function _anyoneTriggerTransfer_SymbioticBurners(
⋮----
function _anyoneAcceptGlobalReceiver_SymbioticBurners(address anyone, address burnerRouter) internal virtual {
⋮----
function _anyoneAcceptNetworkReceiver_SymbioticBurners(
⋮----
function _anyoneAcceptOperatorNetworkReceiver_SymbioticBurners(
⋮----
function _anyoneAcceptDelay_SymbioticBurners(address anyone, address burnerRouter) internal virtual {
⋮----
// ------------------------------------------------------------ CURATOR-RELATED HELPERS ------------------------------------------------------------ //
⋮----
function _curatorSetGlobalReceiver_SymbioticBurners(
⋮----
function _curatorSetNetworkReceiver_SymbioticBurners(
⋮----
function _curatorSetOperatorNetworkReceiver_SymbioticBurners(
⋮----
function _curatorSetDelay_SymbioticBurners(address curator, address burnerRouter, uint48 delay) internal virtual {
````
## File: test/integration/SymbioticBurnersIntegration.sol
````
// SPDX-License-Identifier: MIT
⋮----
import "@symbioticfi/core/test/integration/SymbioticCoreIntegration.sol";
⋮----
import "./SymbioticBurnersInit.sol";
⋮----
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
⋮----
contract SymbioticBurnersIntegration is SymbioticBurnersInit, SymbioticCoreIntegration {
⋮----
function setUp() public virtual override(SymbioticBurnersInit, SymbioticCoreIntegration) {
⋮----
function _getVaultRandom_SymbioticCore(
⋮----
// New code
````
## File: test/integration/SymbioticBurnersIntegrationExample.sol
````
// SPDX-License-Identifier: MIT
⋮----
import "./SymbioticBurnersIntegration.sol";
⋮----
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
⋮----
import {console2} from "forge-std/Test.sol";
⋮----
contract SymbioticBurnersIntegrationExample is SymbioticBurnersIntegration {
⋮----
uint256 public SELECT_OPERATOR_CHANCE = 1; // lower -> higher probability
⋮----
function setUp() public override {
⋮----
// vm.selectFork(vm.createFork(vm.rpcUrl("holesky")));
// SYMBIOTIC_INIT_BLOCK = 2_727_202;
// SYMBIOTIC_CORE_USE_EXISTING_DEPLOYMENT = true;
// SYMBIOTIC_BURNERS_USE_EXISTING_DEPLOYMENT = true;
⋮----
function test_NetworkWithCustomBurner() public {
⋮----
_skipBlocks_Symbiotic(SYMBIOTIC_BURNERS_MAX_DELAY); // for simplicity
````
## File: test/router/BurnerRouter.t.sol
````
// SPDX-License-Identifier: MIT
⋮----
import {Test} from "forge-std/Test.sol";
⋮----
import {VaultFactory} from "@symbioticfi/core/src/contracts/VaultFactory.sol";
import {DelegatorFactory} from "@symbioticfi/core/src/contracts/DelegatorFactory.sol";
import {SlasherFactory} from "@symbioticfi/core/src/contracts/SlasherFactory.sol";
import {NetworkRegistry} from "@symbioticfi/core/src/contracts/NetworkRegistry.sol";
import {OperatorRegistry} from "@symbioticfi/core/src/contracts/OperatorRegistry.sol";
import {MetadataService} from "@symbioticfi/core/src/contracts/service/MetadataService.sol";
import {NetworkMiddlewareService} from "@symbioticfi/core/src/contracts/service/NetworkMiddlewareService.sol";
import {OptInService} from "@symbioticfi/core/src/contracts/service/OptInService.sol";
⋮----
import {Vault} from "@symbioticfi/core/src/contracts/vault/Vault.sol";
import {NetworkRestakeDelegator} from "@symbioticfi/core/src/contracts/delegator/NetworkRestakeDelegator.sol";
import {FullRestakeDelegator} from "@symbioticfi/core/src/contracts/delegator/FullRestakeDelegator.sol";
import {OperatorSpecificDelegator} from "@symbioticfi/core/src/contracts/delegator/OperatorSpecificDelegator.sol";
import {Slasher} from "@symbioticfi/core/src/contracts/slasher/Slasher.sol";
import {VetoSlasher} from "@symbioticfi/core/src/contracts/slasher/VetoSlasher.sol";
⋮----
import {Token} from "@symbioticfi/core/test/mocks/Token.sol";
import {VaultConfigurator, IVaultConfigurator} from "@symbioticfi/core/src/contracts/VaultConfigurator.sol";
import {IVault} from "@symbioticfi/core/src/interfaces/vault/IVault.sol";
import {INetworkRestakeDelegator} from "@symbioticfi/core/src/interfaces/delegator/INetworkRestakeDelegator.sol";
import {IBaseDelegator} from "@symbioticfi/core/src/interfaces/delegator/IBaseDelegator.sol";
import {IBaseSlasher} from "@symbioticfi/core/src/interfaces/slasher/IBaseSlasher.sol";
import {ISlasher} from "@symbioticfi/core/src/interfaces/slasher/ISlasher.sol";
import {Subnetwork} from "@symbioticfi/core/src/contracts/libraries/Subnetwork.sol";
⋮----
import {BurnerRouterFactory} from "../../src/contracts/router/BurnerRouterFactory.sol";
import {BurnerRouter} from "../../src/contracts/router/BurnerRouter.sol";
import {IBurnerRouter} from "../../src/interfaces/router/IBurnerRouter.sol";
⋮----
contract BurnerRouterTest is Test {
⋮----
function setUp() public {
⋮----
function test_SetGlobalReceiver() external {
⋮----
function test_SetGlobalReceiverRevertAlreadySet() external {
⋮----
function test_AcceptGlobalReceiver() external {
⋮----
function test_AcceptGlobalReceiverRevertNotReady() external {
⋮----
function test_SetNetworkReceiver() external {
⋮----
function test_SetNetworkReceiverRevertAlreadySet() external {
⋮----
function test_AcceptNetworkReceiver() external {
⋮----
function test_AcceptNetworkReceiverRevertNotReady() external {
⋮----
function test_SetOperatorNetworkReceiver() external {
⋮----
function test_SetOperatorNetworkReceiverRevertAlreadySet() external {
⋮----
function test_AcceptOperatorNetworkReceiver() external {
⋮----
function test_AcceptOperatorNetworkReceiverRevertNotReady() external {
⋮----
function test_SetDelay() external {
⋮----
function test_SetDelayRevertAlreadySet() external {
⋮----
function test_AcceptDelay() external {
⋮----
function test_AcceptDelayRevertNotReady() external {
⋮----
function test_OnSlash(uint256 amount1, uint256 amount2, uint256 amount3) external {
⋮----
function test_TriggerTransfer(uint256 amount1, uint256 amount2, uint256 amount3) external {
⋮----
function test_TriggerTransferRevertInsufficientBalance(
⋮----
function _getVaultWithDelegatorWithSlasher(
````
## File: test/router/BurnerRouterFactory.t.sol
````
// SPDX-License-Identifier: MIT
⋮----
import {Test} from "forge-std/Test.sol";
⋮----
import {VaultFactory} from "@symbioticfi/core/src/contracts/VaultFactory.sol";
import {DelegatorFactory} from "@symbioticfi/core/src/contracts/DelegatorFactory.sol";
import {SlasherFactory} from "@symbioticfi/core/src/contracts/SlasherFactory.sol";
import {NetworkRegistry} from "@symbioticfi/core/src/contracts/NetworkRegistry.sol";
import {OperatorRegistry} from "@symbioticfi/core/src/contracts/OperatorRegistry.sol";
import {MetadataService} from "@symbioticfi/core/src/contracts/service/MetadataService.sol";
import {NetworkMiddlewareService} from "@symbioticfi/core/src/contracts/service/NetworkMiddlewareService.sol";
import {OptInService} from "@symbioticfi/core/src/contracts/service/OptInService.sol";
⋮----
import {Vault} from "@symbioticfi/core/src/contracts/vault/Vault.sol";
import {NetworkRestakeDelegator} from "@symbioticfi/core/src/contracts/delegator/NetworkRestakeDelegator.sol";
import {FullRestakeDelegator} from "@symbioticfi/core/src/contracts/delegator/FullRestakeDelegator.sol";
import {OperatorSpecificDelegator} from "@symbioticfi/core/src/contracts/delegator/OperatorSpecificDelegator.sol";
import {Slasher} from "@symbioticfi/core/src/contracts/slasher/Slasher.sol";
import {VetoSlasher} from "@symbioticfi/core/src/contracts/slasher/VetoSlasher.sol";
⋮----
import {Token} from "@symbioticfi/core/test/mocks/Token.sol";
import {VaultConfigurator, IVaultConfigurator} from "@symbioticfi/core/src/contracts/VaultConfigurator.sol";
import {IVault} from "@symbioticfi/core/src/interfaces/vault/IVault.sol";
import {INetworkRestakeDelegator} from "@symbioticfi/core/src/interfaces/delegator/INetworkRestakeDelegator.sol";
import {IBaseDelegator} from "@symbioticfi/core/src/interfaces/delegator/IBaseDelegator.sol";
import {IBaseSlasher} from "@symbioticfi/core/src/interfaces/slasher/IBaseSlasher.sol";
import {ISlasher} from "@symbioticfi/core/src/interfaces/slasher/ISlasher.sol";
⋮----
import {BurnerRouterFactory} from "../../src/contracts/router/BurnerRouterFactory.sol";
import {BurnerRouter} from "../../src/contracts/router/BurnerRouter.sol";
import {IBurnerRouter} from "../../src/interfaces/router/IBurnerRouter.sol";
⋮----
contract BurnerRouterFactoryTest is Test {
⋮----
function setUp() public {
⋮----
function test_Create(uint48 delay, address globalReceiver) public {
⋮----
function test_CreateRevertInvalidCollateral(uint48 delay, address globalReceiver) public {
⋮----
function test_CreateRevertInvalidReceiver1(uint48 delay, address globalReceiver) public {
⋮----
function test_CreateRevertInvalidReceiver2(uint48 delay, address globalReceiver) public {
⋮----
function test_CreateRevertDuplicateNetworkReceiver(uint48 delay, address globalReceiver) public {
⋮----
function test_CreateRevertDuplicateOperatorNetworkReceiver(uint48 delay, address globalReceiver) public {
⋮----
function _getVaultWithDelegatorWithSlasher(
````
## File: .env.example
````
ETH_RPC_URL=
ETH_RPC_URL_HOLESKY=
ETHERSCAN_API_KEY=
````
## File: .gitignore
````
# Compiler files
cache/
out/**/
!out/sUSDe_Burner.sol/
!out/sUSDe_Minburner.sol/
!out/ETHx_Burner.sol/
!out/mETH_Burner.sol/
!out/rETH_Burner.sol/
!out/sfrxETH_Burner.sol/
!out/swETH_Burner.sol/
!out/wstETH_Burner.sol/
!out/BurnerRouterFactory.sol/
!out/BurnerRouter.sol/
# Ignores development broadcast logs
!/broadcast
/broadcast/*/31337/
/broadcast/*/11155111/
/broadcast/**/dry-run/
# Docs
docs/
# Dotenv file
.env
# Other files
.gas-snapshot
lcov.info
````
## File: .gitmodules
````
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
[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
````
## File: foundry.toml
````toml
[profile.default]
evm_version = "cancun"
solc = "0.8.25"
optimizer = true
optimizer_runs = 200
via_ir = true
src = "src"
out = "out"
libs = ["lib"]
fs_permissions = [{ access = "read-write", path = "./"}]
gas_reports = ["*"]
gas_limit = "18446744073709551615"
[rpc_endpoints]
mainnet = "${ETH_RPC_URL}"
holesky = "${ETH_RPC_URL_HOLESKY}"
[fmt]
bracket_spacing = false
int_types = "long"
line_length = 120
multiline_func_header = "params_first"
number_underscore = "thousands"
quote_style = "double"
tab_width = 4
[fuzz]
runs = 4096
max_test_rejects = 262144
# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options
````
## File: LICENSE
````
MIT License
Copyright (c) 2024 Symbiotic
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
````
## File: package.json
````json
{
"name": "@symbioticfi/burners",
"version": "1.0.0",
"description": "Symbiotic Burners repository contains an implementation of Burner Router allowing the construction of flexible on-slash burning mechanics and several pure Burners for different assets.",
"homepage": "https://symbiotic.fi/",
"bugs": "https://github.com/symbioticfi/burners/issues",
"license": "MIT",
"author": "Symbiotic Team",
"files": [
"src/**/*",
"test/mocks/**/*",
"out/**/*.json"
],
"repository": {
"type": "git",
"url": "https://github.com/symbioticfi/burners.git"
},
"keywords": [
"solidity",
"ethereum",
"smart",
"contracts",
"security"
],
"dependencies": {
"@openzeppelin/contracts": "5.0.2",
"@openzeppelin/contracts-upgradeable": "5.0.2",
"@symbioticfi/core": "1.0.0-devnet.9"
}
}
````
## File: README.md
````markdown
**[Symbiotic Protocol](https://symbiotic.fi) is an extremely flexible and permissionless shared security system.**
This repository contains Symbiotic Default Burners contracts.
[](https://deepwiki.com/symbioticfi/burners)
## Technical Documentation
Technical documentation can be found [here](./specs).
## Security
Security audits can be found [here](./audits).
Not included files:
- [`src/contracts/burners/sUSDe`](src/contracts/burners/sUSDe)
## Usage
### Env
Create `.env` file using a template:
```
ETH_RPC_URL=
ETH_RPC_URL_HOLESKY=
ETHERSCAN_API_KEY=
```
\* ETH_RPC_URL is optional.
\* ETH_RPC_URL_HOLESKY is optional.
\* ETHERSCAN_API_KEY is optional.
### Build
```shell
forge build
```
### Test
```shell
forge test
```
### Format
```shell
forge fmt
```
### Gas Snapshots
```shell
forge snapshot
```
````
## File: remappings.txt
````
forge-std/=lib/forge-std/src/
@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/
@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/
@symbioticfi/core/=lib/core/
````