fair-squares icon indicating copy to clipboard operation
fair-squares copied to clipboard

Finalization enhancement/pallet

Open ilhanu opened this issue 2 years ago • 3 comments

In M3 we implemented in the bidding pallet the event InvestorListCreationSuccessful when an asset is onboarded and a successful investors list is able to be created. If nothing is done with the current state in the next epoch it switches to process_finalised_assets.

The enhancement

Instead of the runtime changing the state, we need someone with authoritity to finalize the deal for the title transfers. The authority is set by the law and it checks the shareholders and the asset to approve.

The new flow:

graph
A[InvestorsListCreationSuccessful]-- next epoch -->B[Notary]
B-- Approves --> C[The sale is final `fn process_finalised_assets` purchased state]
B-- Rejects --> D[Rejected status]
C --> E[Shares are distributed]

Note The seller should also approve the sale in this intermediate step, we assume that they are willing to sale for the price. In a production env this will be the case.

Further Requirements:

  • The sale cannot continue without approval of the notary
  • Link to the NftItemId that is in question
  • Hash of link to land registry (off-chain) for public verification. As new entry 0x....
  • The Status Finalizing is applied when the reserved list of investors and the asset is being finalized.
  • When the status is finalizing we don't want the bidding-pallet to reserve a new investors list. The asset should essentially be locked.

structure

Let's create a new pallet for this functionality, as this will be expanded a lot in the future.

ilhanu avatar Nov 08 '22 13:11 ilhanu

Concerning the Note, the seller by submitting the proposal in the previous steps has already approved the sale. He/She had time to make his/her decision. What is the need to have an another approval after the voting process? I propose it's assumed that the seller approval is already done, for the MVP at least.

letodunc avatar Nov 14 '22 09:11 letodunc

Implemenation

In order to implement the asset processs finalization.

  • Update the pallet-bidding. In process_onboarded_assets(), the house status will be set to FINALISING at the end of the process if the investors list is successfully created.
  • Update the pallet-onboarded.
    • Add the method get_finalising_assets() to retrieve assets with FINALISING status
    • Add a new asset status CANCELLED to manage the status of a asset in a transaction cancelled by the seller
  • Create the pallet-finalizer
    • Add the method get_assets() to retrieve assets for the Notary to process and can only be called by the Notary role. Assets will have FINALISNG status
    • Add the method validate_transaction_asset. This method set the asset status to FINALISED and can only be called by the Notary role.
    • Add the method reject_transaction_asset. This method set the asset status to REJECTED and unreserve the investors participation (by calling HousingFund::cancel_house_bidding() ) and can only be called by the Notary role.
    • Add the method cancel_transaction_asset(). This method set the asset status to CANCELLED, unreserved the investors fund and can only be called by the SELLER role owner of the asset. The call is only possible on an asset with the FINALISED status after the Notary has approved the transaction.
    • Update the tests to cover the implementation

letodunc avatar Nov 14 '22 10:11 letodunc

concerning the Note, the seller by submitting the proposal in the previous steps has already approved the sale. He/She had time to make his/her decision. What is the need to have an another approval after the voting process? I propose it's assumed that the seller approval is already done, for the MVP at least.

The seller should have the opportunity to back-out of the deal. For now this won't have any consquences, but there should be some penalty fees, for invoking everyone's time and energy to bring it to a sale and then back-out

ilhanu avatar Nov 14 '22 11:11 ilhanu