# Testing & QA

# Wallet Setup & Faucet

## Step 1: Setup your wallet

I use Eternl which you can get here:

[https://eternl.io/](https://eternl.io/)

Before you create a wallet, switch to the "Pre-prod" network. You do this by clicking this button at the bottom right of the wallet app:

[![image.png](https://docs.l4va.com/uploads/images/gallery/2025-03/scaled-1680-/g1J8dsYCyGsQnI1Z-image.png)](https://docs.l4va.com/uploads/images/gallery/2025-03/g1J8dsYCyGsQnI1Z-image.png)

You'll then be shown this popup:

[![image.png](https://docs.l4va.com/uploads/images/gallery/2025-03/scaled-1680-/T04Yb34chuaXdjPN-image.png)](https://docs.l4va.com/uploads/images/gallery/2025-03/T04Yb34chuaXdjPN-image.png)

Select "**Pre-production Testnet**" and then click on "**Add Wallet**" to begin:

[![image.png](https://docs.l4va.com/uploads/images/gallery/2025-03/scaled-1680-/408oitjfHv7VlChE-image.png)](https://docs.l4va.com/uploads/images/gallery/2025-03/408oitjfHv7VlChE-image.png)

Follow the process carefully, and immediately note down your password, and your secret keys. Once you're done you'll be able to go to the "**Receive**" tab to copy your wallet address to clipboard for the next step.

## Step 2 - Get some funds into your wallet

Before you can test our platform you'll need some test ADA. The faucet below will currently give you 10,000 ADA. Paste your wallet address into the form and you should receive those test funds in less than a minute:

[https://docs.cardano.org/cardano-testnets/tools/faucet](https://docs.cardano.org/cardano-testnets/tools/faucet)

# Other Asset types

## Let's generate an NFT

##### **<span style="color: rgb(230, 126, 35);">Step 1: Create NMKR Studio Account</span>**

<span style="color: rgb(0, 0, 0);">NMKR Studio is an easy-to-use application that enables you to create, manage, and sell NFTs at scale. Native to Cardano, where it has minted millions of NFTs, NMKR now supports minting on multiple chains.</span>

<span style="color: rgb(0, 0, 0);">For Pre-production testnet, you can visit this link and create account.</span>

[<span style="color: rgb(53, 152, 219);">https://studio.preprod.nmkr.io/</span>](https://studio.preprod.nmkr.io/)

##### **<span style="color: rgb(230, 126, 35);">Step 2: Create &amp; Mint your test NFT</span>**

**<span style="color: rgb(0, 0, 0);">- Create a new NFT project</span>**

[![image.png](https://docs.l4va.com/uploads/images/gallery/2025-04/scaled-1680-/7gSow9QxX2ouL36e-image.png)](https://docs.l4va.com/uploads/images/gallery/2025-04/7gSow9QxX2ouL36e-image.png)

[![image.png](https://docs.l4va.com/uploads/images/gallery/2025-04/scaled-1680-/Ah84V3duKrASK1Dp-image.png)](https://docs.l4va.com/uploads/images/gallery/2025-04/Ah84V3duKrASK1Dp-image.png)

<span style="color: rgb(224, 62, 45);"> **note: images have to be .jpg or.png format** </span>

<span style="color: rgb(0, 0, 0);">The next field fields are all optional but important when launching a commercial project. The <span style="color: rgb(53, 152, 219);">**project url**</span> is the website of the collection; the **<span style="color: rgb(53, 152, 219);">Description</span>** pertains to the NFT, a <span style="color: rgb(53, 152, 219);">**TokenName prefix**</span> is a name that goes before the number of a collection, and finally, the <span style="color: rgb(53, 152, 219);">**X (Twitter)**</span> handle of the project. The <span style="color: rgb(53, 152, 219);">**NFT reservation**</span> time is how long an account can have the asset in reserve before a purchase.</span>

[![image.png](https://docs.l4va.com/uploads/images/gallery/2025-04/scaled-1680-/TLGGeXY3ILhJq6Ck-image.png)](https://docs.l4va.com/uploads/images/gallery/2025-04/TLGGeXY3ILhJq6Ck-image.png)

- Go to Setup Wallets and input your wallet address
- [![image.png](https://docs.l4va.com/uploads/images/gallery/2025-04/scaled-1680-/LAKjDtC3aLZ00FcG-image.png)](https://docs.l4va.com/uploads/images/gallery/2025-04/LAKjDtC3aLZ00FcG-image.png)

This wallet will be used to mint the NFTs.

<span style="color: rgb(53, 152, 219);">**CIP-25**</span> is the original standard for Cardano NFTs, providing a fixed, immutable metadata format, <span style="color: rgb(53, 152, 219);">**CIP-68**</span>, on the other hand, is a newer standard that allows metadata to be mutable, meaning it can be updated over time

A new <span style="color: rgb(53, 152, 219);">**Policy ID** </span>creates a unique identifier tied to the provided wallet address, establishing a fresh collection for new NFTs. If a user selects an existing Policy ID, the new NFT will be added to an already-established collection.

Next, the <span style="color: rgb(53, 152, 219);">**Policyscript lock**</span> allows you to set a future date as a minting deadline. After this date, no additional NFTs can be crated under this policy ID, effectively locking the supply permanently and ensuring scarcity of your collection.

[![image.png](https://docs.l4va.com/uploads/images/gallery/2025-04/scaled-1680-/AuucK5PVX2FJOXla-image.png)](https://docs.l4va.com/uploads/images/gallery/2025-04/AuucK5PVX2FJOXla-image.png)

Finally, a user can configure the NFT **metadata**. This information is embedded in the token and visible on Cardano, allowing compatible wallets in the ecosystem to read and display it within the NFT section when users view their NFTs.

**- Managing the NFT**

[![image.png](https://docs.l4va.com/uploads/images/gallery/2025-04/scaled-1680-/Ar2JwlTlNUQNCDpY-image.png)](https://docs.l4va.com/uploads/images/gallery/2025-04/Ar2JwlTlNUQNCDpY-image.png)

You can see this menu appears in the Projects section of NNKR studio. From this menu, a user can access the sale option in NMKR Studio by clicking on "Manage Project" for those interested in putting it up for sale.

[![image.png](https://docs.l4va.com/uploads/images/gallery/2025-04/scaled-1680-/B3nuoV2cO4kJb5DF-image.png)](https://docs.l4va.com/uploads/images/gallery/2025-04/B3nuoV2cO4kJb5DF-image.png)

The first choice <span style="color: rgb(53, 152, 219);">**Cardano Collection Token** </span>in the dropdown menu allows a user to create a royalty token. This will ensure that a percentage of every NFT resale goes to the wallet specified by the token's creator.

[![image.png](https://docs.l4va.com/uploads/images/gallery/2025-04/scaled-1680-/1pDXSZI77dKQ1uXq-image.png)](https://docs.l4va.com/uploads/images/gallery/2025-04/1pDXSZI77dKQ1uXq-image.png)

 Here to mint token, you should buy <span style="color: rgb(53, 152, 219);">**MINT COUPONS**</span> on dashboard.

[![image.png](https://docs.l4va.com/uploads/images/gallery/2025-04/scaled-1680-/bP4jzOyDvIP91UhM-image.png)](https://docs.l4va.com/uploads/images/gallery/2025-04/bP4jzOyDvIP91UhM-image.png)

The second dropdown menu item <span style="color: rgb(53, 152, 219);">**Set NFT Prices** </span>is where a user can settle on the price of each minted NFT in their collection.

[![image.png](https://docs.l4va.com/uploads/images/gallery/2025-04/scaled-1680-/X6HXVp2iM93Y38UN-image.png)](https://docs.l4va.com/uploads/images/gallery/2025-04/X6HXVp2iM93Y38UN-image.png)

The next feature NMKR Studio allows is for the user to create <span style="color: rgb(53, 152, 219);">**discount conditions**</span>. Users can set up a series of discounts based on some criteria met by the buyers

[![image.png](https://docs.l4va.com/uploads/images/gallery/2025-04/scaled-1680-/m5JAo0RpjpAv0oK8-image.png)](https://docs.l4va.com/uploads/images/gallery/2025-04/m5JAo0RpjpAv0oK8-image.png)

# E2E Scenario

# Real World Assets (RWA) on Cardano Blockchain with L4VA

This document outlines how L4VA enables the tokenization, aggregation, and fractionalization of commercial real estate assets on the Cardano blockchain, along with the specific transaction types and smart contracts needed for each step of implementation.

## The Story

### Introduction

A commercial real estate investment firm, RealX Holdings, identified an opportunity to increase liquidity and accessibility in the traditionally illiquid commercial real estate market. They decided to use L4VA to tokenize their portfolio of commercial properties and create fractionalized ownership tokens that could be traded on the blockchain.

### Holding Company Tokenization

RealX Holdings had several LLCs, each holding different commercial properties (office buildings, retail spaces, and industrial warehouses). They tokenized these holding companies by issuing share classes representing percentage ownership of each LLC. These share classes were then minted into NFTs on the Cardano blockchain.

### Vault Creation

Using L4VA, RealX created specialized vaults for different asset categories:

1. ****Office Space Vault****: Aggregating tokens from office building LLCs
2. ****Retail Space Vault****: Aggregating tokens from retail property LLCs
3. ****Industrial Space Vault****: Aggregating tokens from industrial warehouse LLCs

Each vault was designed to manage the aggregated tokens and enable fractionalized ownership through fungible tokens (FTs).

### Investment Round

Investors were able to purchase fractionalized tokens from any of the vaults, gaining exposure to specific commercial real estate sectors without needing to buy entire properties. Each investor could contribute any amount of ADA, making commercial real estate investment accessible to a much wider audience.

### Diversified Portfolio Creation

A financial influencer named Charlie saw an opportunity to create a more diversified commercial real estate portfolio. Charlie created a new vault on L4VA that aggregated tokens from all three sector-specific vaults (Office, Retail, and Industrial) into a "Commercial Real Estate Index" vault. This vault issued its own tokens representing exposure to the entire commercial real estate market, reducing risk through diversification.

### Governance Decisions

Each vault implemented strictly defined governance systems allowing token holders to vote on a specific set of permitted actions:

****Permitted Governance Actions:****

1. ****Asset Sales:****<span style="white-space: pre-wrap;"> Proposals to list or sell vault assets at market price to generate liquidity or rebalance the portfolio.</span>
2. ****Asset Acquisition:****<span style="white-space: pre-wrap;"> Proposals to purchase new assets that match the vault's whitelist using available ADA in the vault.</span>
3. ****Asset Staking:****<span style="white-space: pre-wrap;"> Proposals to stake assets to generate additional yield for the vault.</span>
4. ****Distribution to Token Holders:****<span style="white-space: pre-wrap;"> Proposals to distribute fungible token assets (including ADA) to fractional token holders through an asset claim and token burn process.</span>
5. ****Vault Mergers (v2):****<span style="white-space: pre-wrap;"> Proposals to merge compatible vaults, requiring approval from both vaults' token holders, creating a new vault with combined assets and a whitelist restricted to the sum of the original whitelists.</span>

****Prohibited Governance Actions:****<span style="white-space: pre-wrap;"> To prevent potential fraud and maintain vault integrity, certain operations were explicitly prohibited by the smart contract:</span>

1. ****Direct External Transfers:****<span style="white-space: pre-wrap;"> The governance system prevented proposals to send ADA or fungible token assets from the vault to specific external addresses.</span>
2. ****Whitelist Expansion:****<span style="white-space: pre-wrap;"> Vaults could not expand their asset whitelist beyond their initial scope without a full protocol upgrade.</span>
3. ****Non-Market-Based Transactions:****<span style="white-space: pre-wrap;"> All asset sales and purchases required verifiable market price validation.</span>

This strictly defined governance system ensured that vault operations remained secure, transparent, and aligned with token holders' interests while preventing potential abuse.

### Revenue Distribution

As the commercial properties generated rental income, this revenue flowed into the respective vaults. The governance system automatically distributed these returns to token holders proportional to their ownership, creating a steady income stream for investors while maintaining complete transparency.

## Blockchain Implementation: Transaction Types and Smart Contracts

### 1. LLC Share Tokenization

****Transaction Type****: Minting Transaction

- Creates NFTs representing LLC share classes
- Includes metadata about the commercial property details (location, size, income, valuation)

****Smart Contract Required****<span style="white-space: pre-wrap;">: </span>`<span class="editor-theme-code">AssetTokenizationContract</span>`<span style="white-space: pre-wrap;"> (Contract Hash: </span>`<span class="editor-theme-code">479f356943df735488e8f6ce7dd7dd9e757b68b9e01175da42031111</span>`)

- Mints NFTs with property metadata
- Links legal documents to the asset (property deed, LLC operating agreement)
- Creates verifiable link between LLC shares and digital tokens

****Implementation****:

```
# Required functions from lib-assets.ts
createAsset("commercial_property", ["operating_agreement.pdf", "valuation_report.pdf", "title_deed.pdf"])
```

### 2. Vault Creation

****Transaction Type****: Minting Transaction

- Creates new tokens representing specialized vaults (Office, Retail, Industrial)
- Establishes governance parameters and fee structures

****Smart Contract Required****<span style="white-space: pre-wrap;">: </span>`<span class="editor-theme-code">VaultContract</span>`<span style="white-space: pre-wrap;"> (Contract Hash: </span>`<span class="editor-theme-code">ac2bb90a5a34ee1a7fe5340b73932132df67afb54d90605be6a8329f</span>`)

- Creates vault structure with specified parameters
- Sets up token acceptance policies (which asset types can be deposited)
- Establishes governance rules
- Manages fractionalization mechanisms

****Implementation****:

```
deno run --env-file -A create_vault.ts
```

### 3. Asset Aggregation

****Transaction Type****: Transfer Transaction

- Transfers LLC NFTs into appropriate sector vaults
- Records ownership provenance

****Smart Contract Required****<span style="white-space: pre-wrap;">: </span>`<span class="editor-theme-code">AssetAggregationContract</span>`<span style="white-space: pre-wrap;"> (utilizing </span>`<span class="editor-theme-code">VaultContract</span>`)

- Validates asset type matches vault criteria
- Records contribution details and ownership transfer
- Updates vault composition

****Implementation****:

```
# Uses getVaultUtxo function from lib.ts
getVaultUtxo(vaultPolicyId, vaultAssetName)
```

### 4. Fractionalization

****Transaction Type****: Minting Transaction

- Mints fungible tokens (FTs) representing fractional ownership of the vault
- Associates FT supply with vault asset value

****Smart Contract Required****<span style="white-space: pre-wrap;">: </span>`<span class="editor-theme-code">FractionalizationContract</span>`<span style="white-space: pre-wrap;"> (part of </span>`<span class="editor-theme-code">VaultContract</span>`)

- Calculates appropriate token supply based on asset values
- Enforces proportional ownership rules
- Manages token supply updates when assets are added/removed

****Implementation****:

```
# Function from lib.ts to calculate token distributions
assetsToValue(vaultAssets)
```

### 5. Diversified Portfolio Creation

****Transaction Type****: Vault Creation + Transfer Transactions

- Creates a new vault that accepts tokens from other vaults
- Transfers tokens from sector-specific vaults to the diversified vault

****Smart Contract Required****<span style="white-space: pre-wrap;">: </span>`<span class="editor-theme-code">MetaVaultContract</span>`<span style="white-space: pre-wrap;"> (extending </span>`<span class="editor-theme-code">VaultContract</span>`)

- Handles vault-of-vaults structure
- Manages nested governance rules
- Calculates appropriate index token supply based on underlying vault tokens

****Implementation****:

```
# Uses multiple functions from lib.ts
generate_assetname_from_txhash_index(metavaultTxHash, outputIndex)
```

### 6. Governance Voting

****Transaction Type****: Voting Transactions

- Records votes from token holders
- Enforces voting weight based on token ownership
- Executes approved actions within strict constraints

****Smart Contract Required****<span style="white-space: pre-wrap;">: </span>`<span class="editor-theme-code">GovernanceContract</span>`<span style="white-space: pre-wrap;"> (part of </span>`<span class="editor-theme-code">VaultContract</span>`)

- Validates voter eligibility based on token ownership
- Enforces voting timeframes
- Requires minimum participation thresholds
- Validates that proposals match permitted operations
- Rejects prohibited operations (e.g., direct transfers to external addresses)
- Executes approved decisions automatically

****Implementation****:

```
# Function from lib.ts to track governance proposals
getUtxos(governanceAddress, minimumStake)
```

### 7. Asset Distribution

****Transaction Type****: Distribution Transactions

- Creates asset claims for token holders
- Requires token burn to claim assets
- Distributes assets proportionally to token ownership

****Smart Contract Required****<span style="white-space: pre-wrap;">: </span>`<span class="editor-theme-code">DistributionContract</span>`<span style="white-space: pre-wrap;"> (part of </span>`<span class="editor-theme-code">VaultContract</span>`)

- Calculates distributions based on token ownership percentages
- Creates secure claim mechanism requiring token burn
- Validates distribution timeframes
- Executes automatic distributions to token holders
- Updates distribution records

****Implementation****:

```
# Asset claim and token burn process
createAssetClaim(vaultId, assetId, distributionAmount) + 
burnTokenForClaim(fractionalTokenId, claimId)
```

### 8. Vault Merging (v2)

****Transaction Type****: Complex Transaction

- Requires approval from both vault governance systems
- Creates new vault with combined assets
- Burns original vault tokens
- Mints new vault tokens for holders from both original vaults

****Smart Contract Required****<span style="white-space: pre-wrap;">: </span>`<span class="editor-theme-code">VaultMergerContract</span>`<span style="white-space: pre-wrap;"> (extending </span>`<span class="editor-theme-code">VaultContract</span>`)

- Handles complex multi-vault governance voting
- Creates new vault with properly restricted whitelist
- Manages asset transfers from original vaults
- Calculates fair token distribution in new vault
- Ensures continuity of ownership rights

****Implementation****:

```
# Implementation for vault merging
proposeVaultMerger(sourceVaultId, targetVaultId, newParams) +
approveVaultMerger(sourceVaultId, targetVaultId, approvalSignature) +
executeVaultMerger(sourceVaultId, targetVaultId, newVaultId)
```

### 9. DeFi Integration

****Transaction Type****: Collateralization Transactions

- Uses vault tokens as collateral for lending platforms
- Enables yield farming with vault tokens

****Smart Contract Required****<span style="white-space: pre-wrap;">: </span>`<span class="editor-theme-code">DeFiIntegrationContract</span>`

- Creates compatible interfaces with other DeFi protocols
- Manages collateralization ratios and liquidation parameters
- Enables automated yield strategies

****Implementation****:

```
# Integration with external DeFi protocols
getUtxos(userAddress) + collateralizeAssets(vaultTokens, loanAmount)
```

## L4VA System Architecture Diagram

[![image.png](https://docs.l4va.com/uploads/images/gallery/2025-04/scaled-1680-/LF65HeR94Bu7eql1-image.png)](https://docs.l4va.com/uploads/images/gallery/2025-04/LF65HeR94Bu7eql1-image.png)

```mermaid
flowchart TD;
  A[RealX LLC] --> |Mint NFT| B[NFT];
  C[L4VA] --> |Create Vault| V[🔒 Vault];
  B --> V;
  E[Investors] --> |Send Assets| V;
  V --> |Create Vote| F[Governance];
  F --> |Votes| V;


  V@{ shape: rounded}
  E@{ shape: rounded}
```

## Transaction Types and Flow

<table id="bkmrk-steptransaction-type"><colgroup><col></col><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th>Step

</th><th>Transaction Type

</th><th>Asset Involved

</th><th>Smart Contract

</th><th>Purpose

</th></tr><tr><td>LLC Tokenization

</td><td>Minting

</td><td>Commercial Property NFT

</td><td>AssetTokenizationContract

</td><td>Create digital representation of LLC shares

</td></tr><tr><td>Vault Creation

</td><td>Minting

</td><td>Vault Token

</td><td>VaultContract

</td><td>Create specialized vaults for asset categories

</td></tr><tr><td>Asset Aggregation

</td><td>Transfer

</td><td>Property NFT → Vault

</td><td>AssetAggregationContract

</td><td>Move assets into appropriate vaults

</td></tr><tr><td>Fractionalization

</td><td>Minting

</td><td>Fungible Tokens

</td><td>FractionalizationContract

</td><td>Create tradable fractional ownership tokens

</td></tr><tr><td>Meta-Vault Creation

</td><td>Minting

</td><td>Meta-Vault Token

</td><td>MetaVaultContract

</td><td>Create diversified portfolio vault

</td></tr><tr><td>Token Transfer

</td><td>Transfer

</td><td>Vault FT → Meta-Vault

</td><td>VaultContract

</td><td>Move tokens between vaults for diversification

</td></tr><tr><td>Governance Vote

</td><td>Voting

</td><td>Governance Token

</td><td>GovernanceContract

</td><td>Record holder votes on proposals

</td></tr><tr><td>Asset Sale

</td><td>Market Sale

</td><td>Vault Asset → ADA

</td><td>VaultContract

</td><td>Sell assets at market price

</td></tr><tr><td>Asset Purchase

</td><td>Market Purchase

</td><td>ADA → New Asset

</td><td>VaultContract

</td><td>Buy assets from whitelist at market price

</td></tr><tr><td>Asset Distribution

</td><td>Claim + Burn

</td><td>Token Burn → Asset Claim

</td><td>DistributionContract

</td><td>Distribute assets to token holders

</td></tr><tr><td>Vault Merger

</td><td>Complex

</td><td>Vault A + Vault B → New Vault

</td><td>VaultMergerContract

</td><td>Combine compatible vaults

</td></tr></tbody></table>

## Implementation Workflow

This implementation demonstrates how L4VA facilitates the fractionalization, aggregation, and governance of commercial real estate assets on the Cardano blockchain. The key value propositions include:

1. ****Tokenization****: Converting illiquid real estate into tradable digital assets
2. ****Fractionalization****: Breaking down large investments into affordable units
3. ****Aggregation****: Combining multiple assets into thematic vaults
4. ****Diversification****: Creating index-like products across property types
5. ****Governance****: Enabling democratic management of real estate portfolios within strict security constraints
6. ****DeFi Integration****: Unlocking new financial use cases for real estate assets

By leveraging L4VA, creators with influence and ideas can aggregate large vaults by attracting existing tokenized asset holders to contribute to vaults with specific configurations that represent an investment theme or strategy. The creators can then apply utility to their tokens as part of their community or other decentralized applications.

<span style="white-space: pre-wrap;">To execute this implementation on the Cardano preprod network, we'll use the Blockfrost API (project ID: </span>`<span class="editor-theme-code">preprodGLOrJOlqUt1HBVbDhBTEh9oq7GVUBszv</span>`) and our custom scripts to interact with the smart contracts.