> For the complete documentation index, see [llms.txt](https://ogroute.gitbook.io/ogroute-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ogroute.gitbook.io/ogroute-docs/smart-contract-reference/reputation.md).

# reputation

Permanent, cross-circle record of member outcomes. Written only by authorized reporter contracts; read by anyone. Source: [`openajo-contract/contracts/reputation`](https://github.com/OGRoute/openajo-contract/tree/main/contracts/reputation).

**Testnet:** [`CDXPH2PYUTRW7GV57X6CJH3E3JOPROSC23NXPMAXOO3EOBI5UTCB2GTQ`](https://stellar.expert/explorer/testnet/contract/CDXPH2PYUTRW7GV57X6CJH3E3JOPROSC23NXPMAXOO3EOBI5UTCB2GTQ)

## Types

```rust
pub struct Reputation {
    completed: u32,   // circles finished cleanly
    defaulted: u32,   // circles defaulted on
}
```

## Functions

### `initialize(admin: Address)`

Callable once. Stores the admin who manages the reporter allow-list. Panics `AlreadyInitialized` if called again.

### `set_reporter(admin: Address, reporter: Address, allowed: bool)`

* **Auth:** `admin` (must match the stored admin, else `NotAdmin`)
* Adds or removes `reporter` from the allow-list. The `circle` contract's address is registered here at deployment.

### `report_completion(reporter: Address, member: Address)`

* **Auth:** `reporter`, and `reporter` must be allow-listed (else `NotReporter`)
* Increments `member.completed`. Emits `("rep", "complete")`.

### `report_default(reporter: Address, member: Address)`

* **Auth:** `reporter`, and `reporter` must be allow-listed (else `NotReporter`)
* Increments `member.defaulted`. Emits `("rep", "default")`.

### `get_reputation(member: Address) -> Reputation`

* **Auth:** none
* Returns the member's counts, or `{ completed: 0, defaulted: 0 }` for an unknown address.

## Errors

| Code | Name                 | Meaning                                |
| ---- | -------------------- | -------------------------------------- |
| 1    | `NotInitialized`     | Contract not initialized               |
| 2    | `AlreadyInitialized` | `initialize` called twice              |
| 3    | `NotAdmin`           | Caller is not the stored admin         |
| 4    | `NotReporter`        | Caller is not an allow-listed reporter |

## Trust model

The two-check gate — invoker authorization **and** the storage allow-list — means a user can never write their own reputation. Only a contract the admin has explicitly authorized (the `circle` contract) can record outcomes, and only as a side effect of a real completion or default it just processed.


---

# 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://ogroute.gitbook.io/ogroute-docs/smart-contract-reference/reputation.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.
