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 andlisted_token_amount >= amount.Check investor
Bob,DaveandAliceasset balance forpayment_asset(Accounts -> Assets / Balances).Query
property_details.token_price.
Action:
Developer → Extrinsics → pallet
marketplace→buyPropertyTokenorigin: 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 (
1337or1984). See Post-checksmarketplace→OngoingObjectListing

Submit & sign.

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
marketplace → OngoingObjectListing :
OngoingObjectListing(listing_id).listed_token_amountdecreased byamount. Shown in green font below.OngoingObjectListing(listing_id).unclaimed_token_amountincreased byamount. 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