# Smart Contracts

The Black Pearl Market OTC escrow contract is the EVM settlement layer for PEARL/USDC swaps. It holds buyer USDC, records bid lifecycle state, and exposes claim, refund, and cancellation paths.

The contract does not verify Pearl chain state directly. Pearl-side lock, release, and refund status is tracked by the application and indexer layer.

## Verified Deployment

| Item              | Value                                                                                   |
| ----------------- | --------------------------------------------------------------------------------------- |
| Network           | Arbitrum One                                                                            |
| Chain id          | `42161`                                                                                 |
| Escrow            | `0xE0651f6E900a2DbB5FEc01e84d5eA082D83576EE`                                            |
| USDC              | `0xaf88d065e77c8cC2239327C5EDb3A432268e5831`                                            |
| Deployed at block | `464873628`                                                                             |
| Deploy tx         | `0x83f6ad4993aaa059112df0920b36aaa6f4c3774ffdbc779cec757d4024be4b05`                    |
| Verified source   | [Arbiscan](https://arbiscan.io/address/0xE0651f6E900a2DbB5FEc01e84d5eA082D83576EE#code) |

## Fee Model

* Buyer protocol fee: 0%.
* Network gas: paid separately to the network.
* Seller-side protocol fee: 200 bps, equal to 2% in the current production deployment.
* Fee recipient: `0x19b16dAe0d2a34f223E8C18728B1014830Bb236f`.

Example: for a 100 USDC order, the buyer locks 100 USDC. The buyer pays 0 USDC protocol fee. On successful claim, the seller receives 98 USDC, plus any returned seller bond where applicable.

## Lifecycle

1. Buyer locks USDC in escrow.
2. Seller accepts or an ask-take flow opens a deal.
3. Seller completes the PEARL-side step.
4. The swap becomes claimable when the required secret/proof condition is met.
5. Seller claims USDC before the EVM refund window expires.
6. If the flow expires, the buyer may refund according to contract rules.

The current production EVM refund delay is 2 hours. Sellers should claim promptly once a swap becomes claimable.

## User-Facing Actions

| Action          | Purpose                                                   |
| --------------- | --------------------------------------------------------- |
| Create bid      | Buyer locks USDC in escrow.                               |
| Accept bid      | Seller accepts an open bid.                               |
| Claim           | Seller receives USDC when conditions are met.             |
| Refund          | Buyer recovers USDC after the refund window when allowed. |
| Cancel open bid | Buyer cancels before seller acceptance.                   |

## Direct Contract Access

Direct contract interaction is an advanced fallback. Most users should use the web app or Telegram bot.

Before using Arbiscan's Write Contract tab:

* verify the network is Arbitrum One;
* verify the contract address;
* connect the expected buyer or seller wallet;
* confirm the order hash and action;
* never share seed phrases or private keys.

## Contract Roles

The contract includes owner-controlled configuration for fee settings, bid limits, refund delays, pause state, and the public Bot-Assisted Order controlled acceptor role. These roles are visible on-chain and should be monitored through contract events and official announcements.

## Design Boundary

Black Pearl Market is designed for transparent, recoverable cross-network settlement. The EVM contract secures USDC-side escrow. Pearl-side state is coordinated through verified application and indexer state, wallet approvals, and visible transaction history.

See [PEARL HTLC Settlement Model](/overview/pearl-htlc-model.md) for the PEARL-side Taproot lock-release model that works with this contract-based USDC escrow.


---

# 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://docs.blackpearlmarket.com/pearl-usdc-escrow.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.
