# Audit

The **Audit** module in the CESS Rust SDK provides interfaces to interact with the **audit pallet** on the CESS blockchain.\
This pallet manages **storage miner challenge verification**, including submission of proofs, verification results, and tracking challenge-related states.

Using this module, developers can:

* Query the audit state and miner challenge results.
* Submit storage or service proofs to the chain.
* Verify proof results for idle or service challenges.

***

## Query Interfaces

The following query APIs allow you to retrieve audit-related information directly from the blockchain:

* [challenge\_snapshot](https://doc.cess.network/developer/cess-sdk/sdk-rust/chain/audit/challenge_snapshot) - Retrieve challenge snapshot information for a specific miner or block.
* [counted\_clear](https://doc.cess.network/developer/cess-sdk/sdk-rust/chain/audit/counted_clear) - Query the count of cleared (successfully completed) challenges.
* [counted\_service\_failed](https://doc.cess.network/developer/cess-sdk/sdk-rust/chain/audit/counted_service_failed) - Retrieve the count of failed service challenges for a miner.
* [challenge\_slip](https://github.com/CESSProject/doc-v2/blob/main/developer/cess-sdk/sdk-rust/chain/audit/query/challenge_slip.md) - Check if a challenge slip exists for a given miner at a specific block, representing the deadline for proof submission.
* [verify\_slip](https://github.com/CESSProject/doc-v2/blob/main/developer/cess-sdk/sdk-rust/chain/audit/query/verify_slip.md) - Verify whether a challenge slip has been validated, storing the verification and liquidation time node along with the corresponding miner.

***

## Transaction Interfaces

The following call (transaction) APIs allow miners or validators to interact with the audit system by submitting and verifying proofs:

* [submit\_idle\_proof](https://doc.cess.network/developer/cess-sdk/sdk-rust/chain/audit/submit_idle_proof) - Submit proof of idle storage space to demonstrate reliability.
* [submit\_service\_proof](https://doc.cess.network/developer/cess-sdk/sdk-rust/chain/audit/submit_service_proof) - Submit proof of completed service-related tasks.
* [submit\_verify\_idle\_result](https://doc.cess.network/developer/cess-sdk/sdk-rust/chain/audit/submit_verify_idle_result) - Submit the verification result for idle space proof.
* [submit\_verify\_service\_result](https://doc.cess.network/developer/cess-sdk/sdk-rust/chain/audit/submit_verify_service_result) - Submit the verification result for service proof.

***

### Example Usage

All query and transaction functions under the `audit` module can be accessed through:

```rust
use cess_rust_sdk::chain::audit::query::StorageQuery as AuditQuery;
use cess_rust_sdk::chain::audit::transaction::StorageTransaction as AuditTransaction
```
