fair-squares
fair-squares copied to clipboard
Finalization enhancement/pallet
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 thebidding-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.
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.
Implemenation
In order to implement the asset processs finalization.
- Update the pallet-bidding. In
process_onboarded_assets()
, the house status will be set toFINALISING
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 withFINALISING
status - Add a new asset status
CANCELLED
to manage the status of a asset in a transaction cancelled by the seller
- Add the method
- Create the pallet-finalizer
- Add the method
get_assets()
to retrieve assets for the Notary to process and can only be called by theNotary
role. Assets will haveFINALISNG
status - Add the method
validate_transaction_asset
. This method set the asset status toFINALISED
and can only be called by theNotary
role. - Add the method
reject_transaction_asset
. This method set the asset status toREJECTED
and unreserve the investors participation (by callingHousingFund::cancel_house_bidding()
) and can only be called by theNotary
role. - Add the method
cancel_transaction_asset()
. This method set the asset status toCANCELLED
, unreserved the investors fund and can only be called by theSELLER
role owner of the asset. The call is only possible on an asset with theFINALISED
status after the Notary has approved the transaction. - Update the tests to cover the implementation
- Add the method
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