> For the complete documentation index, see [llms.txt](https://openchrono.gitbook.io/openchrono/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://openchrono.gitbook.io/openchrono/platform-technical-info/smart-contracts.md).

# 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.                                         |
