4.2.1 Buy Property Token

Buy Property Token Step-by-Step test guide

Investor buys property tokens. Validates buyer + listing, calculates fees/taxes, reserves funds, updates token allocations, enforces ≤ 50% cap, emits PropertyTokenBought.

Pre-checks:

Developer → Chain State

  • OngoingObjectListing(listing_id) exists and listed_token_amount >= amount.

  • Check investor Bob , Dave and Alice asset balance for payment_asset (Accounts -> Assets / Balances).

  • Query property_details.token_price.

Action:

  1. Developer → Extrinsics → pallet marketplacebuyPropertyToken

    • origin: Bob. This needs to be investor.

    • listing_id: (from previous). In this case 0. This is the listing that the investor wants to buy token from.

    • amount: 33. This is the amount of token that the investor wants to buy.

    • payment_asset: choose accepted id ( 1337 or 1984 ). See Post-checks marketplaceOngoingObjectListing 4.1.1 List Property

  1. Submit & sign.

  1. Repeat the process above for other investors, 33 tokens for Dave and 34 for Alice to make all 100 listed_token_amount completely sold.

Post-checks:

Developer → Chain State

marketplaceOngoingObjectListing :

  • OngoingObjectListing(listing_id).listed_token_amount decreased by amount. Shown in green font below.

  • OngoingObjectListing(listing_id).unclaimed_token_amount increased by amount. Shown in green font below.

{ realEstateDeveloper: 14Gjs1TD93gnwEBfDMHoCgsuf1s2TVKUP6Z1qKmAZnZ8cW5q tokenPrice: 10,000,000,000 collectedFunds: { 1337: 0 1984: 0 } collectedTax: { 1337: 0 1984: 0 } collectedFees: { 1337: 0 1984: 0 } assetId: 0 itemId: 0 collectionId: 0 tokenAmount: 100 listedTokenAmount: 0 taxPaidByDeveloper: false tax: 0.02% listingExpiry: 1,691 investorFunds: {} claimExpiry: null relistCount: 0 unclaimedTokenAmount: 100 }

Last updated