# Smart Contracts

There are in total three smart contracts as seen in the image below. The owners of an NFT from the **TimePiecePassport** contract have the ability to transfer it wherever they want. Just like a normal ERC-721 NFT.

The **TimePieceEscrow** contract is meant to be used during the step of an order via the OpenChrono website.

The **TimePiecePayments** contract is meant to be used for crypto payments and to set the Royalties of an NFT.<br>

<figure><img src="/files/reNzclK40KolzXEh0aJJ" alt="" width="563"><figcaption><p>Smart Contract Information</p></figcaption></figure>

### Access Control

Each smart contract has several roles to determine who can perform what actions.

#### TimePiecePassport

| Role                        | Description                                                                             |
| --------------------------- | --------------------------------------------------------------------------------------- |
| DEFAULT\_ADMIN\_ROLE        | Can update the role assignments.                                                        |
| ROLE\_MINTER                | The only one that is allowed to mint new NFTs.                                          |
| ROLE\_CONFIGURATOR          | Can update the base URI of the token URL.                                               |
| ROLE\_ROYALTY\_CONFIGURATOR | Can set and delete ERC-2981 fee data. Must be at least the TimePiecePayments contract.  |
| ROLE\_REDEEMER              | Can set the redeem flag in the contract. Must be at least the TimePieceEscrow contract. |
| ROLE\_UPDATER               | Can upgrade the contract.                                                               |

#### TimePieceEscrow

| Role                 | Description                                                     |
| -------------------- | --------------------------------------------------------------- |
| DEFAULT\_ADMIN\_ROLE | Can update the role assignments.                                |
| ROLE\_CONFIGURATOR   | Update the configuration of contract addresses and escrow data. |
| ROLE\_ESCROWER       | Can start an escrow.                                            |

#### TimePiecePayments

| Role                        | Description                                                       |
| --------------------------- | ----------------------------------------------------------------- |
| DEFAULT\_ADMIN\_ROLE        | Can update the role assignments.                                  |
| ROLE\_CONFIGURATOR          | Can configure the contract addresses. Can (un)pause the contract. |
| ROLE\_ROYALTY\_CONFIGURATOR | Can set and delete the default and token fee structure.           |
| ROLE\_FUNDS\_MANAGER        | Can split the received fee and withdraw tokens from the contract. |
| ROLE\_UPDATER               | Can upgrade the contract.                                         |


---

# 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://openchrono.gitbook.io/openchrono/platform-technical-info/smart-contracts.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.
