# Payments

Bunnybox projects are adaptable to various payment terminal contracts compliant with the Bunnybox protocol standards, offering versatility in managing token flows. Understanding the fundamental concepts is crucial, so we recommend familiarizing yourself with the glossary.

In practice, terminal functionalities are distributed across multiple interfaces, abstract contracts, and implementation contracts, embodying a modular design that enhances protocol extensibility.

Interfaces: The core interfaces include:

* **IBunnyPaymentTerminal**: Facilitates inbound payments.
* **IBunnyPayoutTerminal3\_1**: Facilitates payout distributions.
* **IBunnyAllowanceTerminal3\_1**: Facilitates discretionary fund allocations.
* **IBunnyRedemptionTerminal**: Facilitates token redemptions.

These interfaces are extended by:

* **IBunnySingleTokenPaymentTerminal** (inherits IBunnyPaymentTerminal): Restricts inbound payments to a single token type.
* **IBunnyPayoutRedemptionPaymentTerminal3\_1\_1** (inherits IBunnyPaymentTerminal, IBunnyPayoutTerminal3\_1, IBunnyAllowanceTerminal3\_1, IBunnyRedemptionTerminal): Combines functionalities for inbound payments, payout distributions, discretionary fund allocations, and token redemptions.

Abstract Implementation Contracts: These interfaces find implementation in abstract contracts:

* **BunnySingleTokenPaymentTerminal** (inherits IBunnySingleTokenPaymentTerminal): Implements a payment terminal accepting only one token type.
* **BunnyPayoutRedemptionPaymentTerminal3\_1\_1** (inherits BunnySingleTokenPaymentTerminal, IBunnyPayoutRedemptionPaymentTerminal3\_1\_1): Implements a payment terminal managing inbound payments, payout distributions, discretionary fund allocations, and token redemptions for a specific token type.

Implementation Contracts: Lastly, these contracts implement the aforementioned abstract contracts:

* **BunnyETHPaymentTerminal3\_1\_1** (inherits BunnyPayoutRedemptionPaymentTerminal3\_1\_1): Implements a fully functional ETH terminal.
* **BunnyERC20PaymentTerminal3\_1\_1** (inherits BunnyPayoutRedemptionPaymentTerminal3\_1\_1): Implements a fully functional ERC-20 terminal.

To register a terminal with BunnyDirectory, adherence to IBunnyPaymentTerminal, the basic interface requiring a standardized method for sending funds to the terminal (via pay or addToBalance), is necessary. Protocol extensions can enforce their specific requirements by leveraging alternative interfaces or abstract contracts, ensuring seamless interoperability among extensions.
