NFT Marketplace - Testing
NFT Real Estate Marketplace testing with polkadot js as frontend
To interact with the NFT Real Estate Marketplace, all user must have already gone through the DID/KYC/KYB/AML (Kilt DID & Deloitte Verifiable Credentials) process (and be whitelisted) in order to be able to call the extrinsics of the marketplace.
At the moment, an account must be added to the xcavate whitelist by calling the add_to_whitelist function in the xcavate_whitelist pallet. This can only be done by the sudo account.
1.0 Create new Region
Before users can list objects on the marketplace, a region must be created with the sudo account.
This can be done by calling the createNewRegion function.
A region represents a country.
2.0 Create new Location
Once a region has been created, a location must be created in this region with the sudo account.
To do this, the createNewLocation function must be called. The region is created as a parameter. The region is the region ID of the region. The location is the postcode of the location that should be created.
A location represents a city in the country.
3.0 Listing Object
The listObject function must be called by the real estate developer to list an object on the marketplace.
The region is the region ID of the country in which the property is located.
The location is the postcode of the city in which the property is located.
The tokenPrice must be selected as a parameter. This is the price of a single token.
The tokenAmount is the amount of token the property is divided in.
The data is the metadata of the nft that represents the property.
4.0 Listed Object
Once the object is listed, the user has the option to upgrade the price of the object.
To do this, they must call the upgradeObject function.
The listingId is the listing ID of the listed object.
The newPrice is the updated price of the real estate object.
5.0 Buying process
To buy tokens the real estate investor must call the function buyToken.
As parameters, the investor must specify the listingId of the property and the number of tokens they wish to purchase.
6.0 Lawyer process
A lawyer must first be registered by the sudo account.
This is done by calling the registerLawyer function with the lawyer’s account ID as a parameter.
Once all tokens of a property are sold, the lawyers can claim the property to manage the process.
Two lawyers are needed for a property transaction: one lawyer to represent the real estate investor’s side (SPV) and one lawyer to represent the real estate developer. This process requires two different lawyers, as it would be illegal for both sides to be represented by the same lawyer.
To take on the case, a lawyer must call the lawyerClaimProperty function.
The listingId is the ID of the listed object.
The legalSide is either RealEstateDeveloperSide or SpvSide.
The costs represent the lawyer’s fees, which cannot exceed 1% of the property price.
Once the lawyer completes the legal work, he needs to call the lawyerConfirmDocuments function.
The listingId is the ID of the listed object.
Approve is a boolean value. A value of true means the documents are approved and the process can be finalised. A value of false means the process cannot be finalised, and the lawyer wishes to cancel the process.
Both lawyers need to confirm the process with true. Once this happens, the tokens will be distributed to the real estate investors. The fees will go to the treasury, and the lawyer's costs will be paid to the lawyer, including the 3% tax.
If one lawyer confirms with true and the other confirms with false, there will be a second round where the lawyers must confirm again. If both lawyers do not agree, the process will be rejected and not finalised.
This means that the NFTs and tokens will be burned. Additionally, the funds will be returned to the investors, including the 3% tax. Only the 1% fee will be paid to the lawyers to cover their costs, and the remaining fee will be sent to the treasury.
7.0 Object sold
Once the SPV is created, the property is sold and the lawyers finalised the process, the funds go to the real estate developer and the tokens are sent to the investors/buyers.
The real estate investors can offer the tokens on the marketplace again by calling the relistToken function.
As parameters, the investor must specify the regionId, itemId of the nft of the property, price and quantity of tokens they wish to sell.
The property is represented by an nft and the nft is represented by the tokens, which are fractions of the nft. For this extrinsic, the seller needs the nft ID of the property.
The tokenPrice is the price of a single token.
After listing, the investor can upgrade the price by calling the upgradeListing function.
The listingId of the listing is required as a parameter for this function. The newPrice is the price of a token.
To remove the newly listed tokens from the marketplace, the investor can call the delistToken function.
The listsingId of the listing that the investor wishes to remove is required as a parameter for this function.
8.0 Buy relisted tokens
To buy newly listed tokens, the buyer must call the function buyRelistedToken.
The parameters required for this function are the listingId from the listing that the buyer wishes to purchase and the amount of token he wants to buy.
8.0 Make Offer
As an alternative a user can create an offer for a token listing by calling the makeOffer function.
As parameters the listing id of the token listing, the token price for a token and the amount of token the user wants to buy are required.
The seller of the token has now the option to either accept or reject the offer by calling the handleOffer function.
The listingId, the offerId and the enum Offer with the choices Accept or Reject are required as parameters.
In case the seller rejects the offer the funds that have been blocked from the user that made the offer will be released again.
The user that made the offer can cancel the offer anytime as long as the seller did not handle the offer, by calling the cancelOffer function.
As parameters the listingId and the offerId are needed.
Last updated