Xcavate Community Loan Pallet - Testing
1.0 Add Committee Members
To add members to the voting committee, the sudo account should call the addCommitteeMember function. The accountId of the new member is required as a parameter.
2.0 Loan application process
To interact with the Loan Pool pallet, 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 pallet.
The voting time is currently only a few blocks for test purposes.
To apply for a loan, the developer must call up the propose function.
The loan amount, the accountId of the loan recipient (beneficiary), the developerExperience of the developer in years and the term of the loan in months (loanTerm) are required as parameters.
Once an application has been submitted, the voting committee can vote for or against the loan. First, a committee member must set the milestones in which the loan is to be distributed. This can be done by calling the setMilestones function.
The index of the proposal (proposalIndex) and a vector with the various milestones are required as parameters. The various milestones are represented by the percentage that is to be paid out for each milestone.
Once the milestones are set, other committee members can vote for or against the proposal by calling the voteOnPropsal function.
As parameters, the function requires the proposalIndex and the vote, which is an enum with Yes or No as the value.
3.0 Loan approved
If the loan is approved, the real estate developer can withdraw funds from the loan pool. Only the beneficiary wallet from the loan application can withdraw funds.
The function requires the parameter loanId as the index of the loan and the amount that the developer wants to withdraw from the loan. Only the amount that was activated in the first milestone can be withdrawn.
The developer can make a proposal for the next milestone by calling the proposeMilestone function. This function can be called up by any user who is on the whitelist.
Only the loanId is required as a parameter.
The committee can vote on the milestone proposal by calling voteOnMilestoneProposal.
The function takes the parameter proposalIndex which is the proposal index of the milestone proposal, and it takes the vote enum which can be yes or no.
Once the milestone vote passed the next charge of the next milestone will be available for the real estate developer.
To repay the loan, the developer can simply call the repay function.
This function requires the loanId and the amount that the developer wants to repay as parameters. All users who are on the whitelist can call the function and repay a loan for someone else.
Once the loan has been repaid in full, the developer can call the proposeDeletion function to request the deletion of the loan.
This function only requires the loanId as a parameter.
Here too, the voting committee must vote on the deletion proposal by calling the voteOnDeletionProposal function.
The function receives the proposalIndex parameter, which specifies the proposal index of the deletion proposal, and the enum vote, which can be yes or no.
If the vote was successful, the loan is deleted.
Last updated