> For the complete documentation index, see [llms.txt](https://docs.mellow.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mellow.finance/resources/mellow-lrt-depreciated/validators/defaultbondvalidator.md).

# DefaultBondValidator

### Overview

`DefaultBondValidator` ensures that only authorized bonds are involved in deposit and withdrawal operations. It uses validation methods, mappings for supported bonds, and emits events when bonds are updated, ensuring comprehensive control over delegate `DefaultBondModule`.

### Key Features

* **Bond Support**: Determines which bonds are authorized for deposits and withdrawals.
* **Validation**: Enforces compliance for bond operations, ensuring only supported bonds are accessed.
* **Error Reporting**: Raises specific errors when bond operations fail validation.

### Error Definitions

* **InvalidLength**: Raised when the data length for bond transactions is incorrect.
* **ZeroAmount**: Indicates that the transaction specifies a zero amount, which is invalid.
* **InvalidSelector**: The function selector is unrecognized.
* **UnsupportedBond**: The bond used in the transaction is unsupported.

### Core Methods

1. **View Functions**
   * `isSupportedBond(address)`: Checks if a bond is authorized for deposits and withdrawals.
2. **Configuration Functions**
   * `setSupportedBond(address, bool)`: Sets a bond's supported status.
3. **Validation Function**
   * `validate(address, address, bytes)`: Verifies that the bond transaction complies with the rules:
     * Checks for proper data formatting.
     * Verifies that the bond is authorized.
     * Checks for `deposit` and `withdraw` function signatures.

### Event

* `DefaultBondValidatorSetSupportedBond(address, bool, uint256)`: Emitted when a bond's support status is updated.
  * **bond**: Address of the bond.
  * **flag**: Boolean indicating support status.
  * **timestamp**: Timestamp of the action.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.mellow.finance/resources/mellow-lrt-depreciated/validators/defaultbondvalidator.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
