Skip to content

Buy and Burn ​

Spend streamed token A to acquire and burn token B.

mermaid
flowchart LR
    S[Stream A] --> O[Open Fill for B] --> B[Burn B]

Use a Stream budget, Open Fill and Burn. The demanded token must implement burn(uint256).

Start with Run a recurring buyback for the auction mechanism, solver competition and a complete recipe. This variant burns the purchased tokens.

The supplied recipe burns the declared demand. It leaves forwardSurplus false, so extra B stays in the DAO.sol contract. To burn surplus too, explicitly enable forwarding on the Open Fill node in a custom recipe. A failed burn rolls back the fill and checkpoint.

Configure and install ​

Use Recipes.buyAndBurn and the configuration example. Follow setup and permissions to install the flow. Replace addresses and choose amounts in each token's smallest unit.

Component source: StreamBudget.sol · OpenFillAction.sol · BurnAction.sol.

All examples.