# Smart Contract Overview

Stellar Talent uses Soroban smart contracts to power flexible escrow agreements. Once a recipient accepts, the contract is deployed and funds are locked securely on-chain.

#### Payout Structures

**Single-payment contracts:** Funds are released manually or automatically after a set date.\
**Milestone-based contracts:** Funds are released in parts, either manually or automatically per schedule.

Contracts are immutable once deployed.

***

### On-Chain vs Off-Chain Data

#### Stored On-Chain

* sender and recipient wallet addresses
* totalAmount (XLM)
* releaseType (manual or auto)
* autoReleaseDate
* status
* milestones\[]
* currentMilestoneIndex

#### Stored Off-Chain

* User auth (email, password, wallet metadata)
* Drafts and pending proposals
* UI state (filters, notifications)
* Internal logs (non-critical)

***

### Execution and Permissions

| Function               | Callable By            | Description                   |
| ---------------------- | ---------------------- | ----------------------------- |
| `createEscrow()`       | Backend (post-accept)  | Deploys and funds contract    |
| `releaseFunds()`       | Sender or time trigger | Releases payment or milestone |
| `getContractStatus()`  | Frontend/backend       | Displays contract state       |
| `getContractDetails()` | Frontend/backend       | Shows contract data           |

***


---

# Agent Instructions: 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:

```
GET https://stellar-talent.gitbook.io/stellar-talent-handbook/technical-architecture/smart-contract-overview.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
