> For the complete documentation index, see [llms.txt](https://docs.reallayer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.reallayer.com/developers/how-to-test-real-protocol.md).

# How to Test Real Protocol

<mark style="color:red;">**Real Protocol Testnet is provided strictly for testing and development purposes. Test tokens hold no monetary value and must not be resold, traded, or used for speculation. As this is a beta environment, performance, uptime, and available features are subject to change during ongoing development. Community feedback is encouraged and will help strengthen the Real protocol ahead of mainnet launch.**</mark>

***

### Overview <a href="#testing-chips-testnet" id="testing-chips-testnet"></a>

Real provides a testnet environment where developers and crypto enthusiasts can explore a full end-to-end tokenization and secondary trading workflow before moving to production. The platform allows users to create and issue on-chain representations of real-world and digital assets, apply permissioning or compliance logic where required, and observe how those assets behave throughout their lifecycle. By testing on testnet, participants can safely validate contract interactions, transaction flows, and edge cases without real capital at risk.

In addition to asset issuance, the Real Protocol test environment includes a native marketplace where issued assets can be listed, discovered, and traded peer-to-peer. Testers can simulate real market activity by creating listings, submitting offers, executing purchases, and cancelling orders while verifying settlement, fee logic, and event emissions directly on-chain. Together, the protocol platform and marketplace offer a practical sandbox for understanding how Real Protocol functions as a unified system, enabling developers to build integrations and allowing crypto-native users to gain hands-on familiarity with the trading experience prior to mainnet launch.

***

### What You'll Test

#### Real Protocol Smart Contracts&#x20;

* Asset onboarding flows (create an asset, define metadata, set permissions/roles)
* Token issuance on testnet (mint/issue to test wallets)
* Compliance/permission gating behavior (who can hold, transfer, or trade)

#### Marketplace

* Create a listing (fixed price) or order (offer/bid)
* Buy, accept, cancel
* Settlement (token transfers + payment transfers)
* Fees (market fee, maker/taker fee, if enabled)
* Events + indexing (confirm emitted events match UI state)

***

### Prerequisites

#### Wallet and Tools

* A wallet that supports custom networks (MetaMask / Rabby recommended)
* Node.js 18+ and pnpm/npm (if using scripts/SDK)
* A funded test wallet (testnet native token for gas + any test stable/payment token)

***

### Testing Real Protocol on Testnet <a href="#testing-chips-testnet" id="testing-chips-testnet"></a>

#### **Setting Up a Testnet Wallet**

Before testing on Real, you need a compatible wallet that supports testnet transactions. Some popular choices include:

* [MetaMask](https://metamask.io/download)

#### Configuring MetaMask for Real Testnet

To manually add the Binance Smart Chain testnet to MetaMask:

1. Open MetaMask and navigate to the top left drop-down for Networks.
2. Click Add a Network and enter the following details:
   1. Network Name:  BSC TESTNET
   2. New RPC URL:  <https://data-seed-prebsc-1-s1.bnbchain.org:8545>
   3. Chain ID:  97
   4. Currency Symbol:  tBNB
   5. Block Explorer URL:  <https://testnet.bscscan.com>

3\. Save and switch to the Binance Smart Chain BNB Testnet network.

***

### Getting Binance Smart Chain (BNB) Testnet Tokens <a href="#getting-chips-testnet-tokens" id="getting-chips-testnet-tokens"></a>

To conduct transactions on the Real Protocol testnet platform, you’ll need test BNB tokens.

1. Visit the Binance BSC testnet faucet at any of the faucets below:
   1. <https://www.bnbchain.org/en/testnet-faucet>
   2. <https://thirdweb.com/binance-testnet>
2. Enter your testnet wallet address
3. Tap claim to receive test BNB tokens

***

### Test the Real Protocol platform

Real testnet is [https://realtestnet.com](https://realtestnet.com/)

#### Step 1:  Create / register a test asset

Depending on your architecture, you’ll do one of these:

* UI flow: “List Your Asset” → set metadata → confirm transaction
* Contract call: createAsset(metadataURI, config...)

Minimum metadata you should attach:

* name, symbol, description
* image (optional)
* external\_url (optional)
* attributes (optional)

Verify:

* Transaction success
* Asset ID or token contract address is returned
* Asset appears in the platform UI (if indexed)

#### Step 2:  Issue test tokens

Issue to at least two wallets:

* Wallet A (seller)
* Wallet B (buyer)

Verify:

* Balances updated
* Transfer restrictions behave as expected (if permissions are enabled)

#### Step 3:  Permissions and compliance checks

Try:

* Transfer from Wallet A → Wallet B
* Transfer to an unapproved Wallet C

Expected outcomes:

* Approved transfers succeed
* Restricted transfers revert with an understandable error (or fail in UI gracefully)

Verify:

* Revert reason (if available)
* Events emitted (e.g., Transfer, Approval, plus any protocol-specific events)

***

### Test the Marketplace

#### Marketplace Actions to Test (Recommended order)

**Step 1:  Approvals**

If using ERC-20 payment token:

* Buyer approves marketplace to spend PAYMENT\_TOKEN

If listing requires escrow or transfer approvals:

* Seller approves marketplace/operator to transfer the asset token

Verify:

* Approval / ApprovalForAll events on explorer

**Step 2:  Create a listing (Seller: Wallet A)**

Choose:

* Asset/token
* Quantity (if semi-fungible / ERC-1155)
* Price
* Expiration (optional)

Verify:

* Listing ID created
* Listing visible in UI
* ListingCreated (or equivalent) event emitted

**Step 3:  Buy / accept (Buyer: Wallet B)**

Execute purchase:

* Confirm payment token deducted (or native token sent)
* Confirm asset received

Verify:

* Balances updated
* Listing state becomes “Sold/Settled”
* Fees match expected configuration
* Events emitted (e.g., TradeExecuted, ListingFilled)

**Step 4:  Cancel listing (Seller)**

Create a second listing, then cancel it.

Verify:

* Listing becomes “Canceled”
* Cannot be purchased afterward

***

### Validate Via Explorer and Events

You should be able to confirm, for every major action:

* Transaction status: Success
* Gas used (sanity check)
* Logs/events:
  * Token transfers
  * Marketplace events
  * Any protocol permission events

Tip: Keep a simple checklist of tx hashes for:

* asset creation
* issuance
* approvals
* listing create
* buy/settle
* cancel

***

### Developer Testing Using Scripts (Optional)

If your team provides an SDK or sample repo, structure it like:

#### Install

```bash
git clone YOUR_REPO_URL
cd real-protocol-examples
pnpm install
```

#### Configure environment

Create .env:

```bash
RPC_URL=YOUR_RPC_URL
CHAIN_ID=YOUR_CHAIN_ID
PRIVATE_KEY=0xYOUR_TEST_PRIVATE_KEY
REAL_PROTOCOL_CORE_ADDRESS=0x...
REAL_MARKETPLACE_ADDRESS=0x...
PAYMENT_TOKEN_ADDRESS=0x...
```

#### Run sample flows

```bash
pnpm ts-node scripts/01_create_asset.ts
pnpm ts-node scripts/02_issue_tokens.ts
pnpm ts-node scripts/03_create_listing.ts
pnpm ts-node scripts/04_buy_listing.ts
pnpm ts-node scripts/05_cancel_listing.ts
```

Verify each script prints:

* tx hash
* resulting asset ID / listing ID
* post-state balances

***

### Common Issues and Fixes

#### “Insufficient funds for gas”

* You don’t have enough native test token. Use the faucet again.

#### “ERC20: insufficient allowance”

* Buyer hasn’t approved marketplace spending enough payment token.
* Re-approve with a higher amount.

#### “Transfer restricted / not allowed”

* Permissions/compliance gating is blocking the transfer.
* Ensure the wallet is allowlisted or meets whatever rule is configured.

#### UI shows stale data

* Indexer hasn’t caught up yet.
* Refresh after 30–60 seconds, or check explorer directly to confirm chain state.

***

### Best Practices for Good Test Coverage

* Test with 3 wallets (approved seller, approved buyer, unapproved user)
* Test both:
  * fixed-price listing
  * offer/bid flow (if supported)
* Test edge cases:
  * expired listing
  * cancel after partial fill (if partial fills exist)
  * wrong token decimals causing price mismatch
* Record tx hashes for reproducibility

***

### Real Protocol Smart Contract Addresses <a href="#getting-chips-testnet-tokens" id="getting-chips-testnet-tokens"></a>

Below are the official contract addresses for all deployed components of the Real Protocol on the testnet, available for development, auditing, and integration.

* **RealTokenFactory:**  0x6058787335EE9c5116Ff260064e5BCA5DF776E0E
* **OfferingFactory:**  0xEB37257130975C8129557ad1E0cD7ECCB1E05FC3
* **P2PRouter:**  0xf952F7A66EC122b0c23F92B6F0f8Eb46096a90C0
* **MockStableCoin:**  0x4ddB36Ebf798C5A74bEA3A91C8fF6b900e654aB5
* **RealFractionalToken:**  0xE0e782a259ad977d7132AB1AD4D56b38cE08bFD2
* R**ealStakingDistributor:**  0xe25f3a84af8B5462d431A45070abc0F18E5A4024
* **RealLending:**  0xd74e0084B65555aB522481ec7dC883f76d06c828


---

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

```
GET https://docs.reallayer.com/developers/how-to-test-real-protocol.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.
