Closed onggunhao closed 5 years ago
To use fractional shares, somthing in the lines of this should suffice @tspoff
Loan {
...
uint blockSize
}
constructor(
...
uint _blockSize,
...
) ...{
...
loan.blockSize = _blockSize;
...
}
function getEffectiveValue(amount) internal returns (uint){
if (loan.blockSize === 0) {
return amount;
} else {
return (amount/loan.blockSize) * loan.blockSize;
}
}
function buyTokens(address beneficiary, uint amount) public nonReentrant {
amount = getEffectiveValue(amount);
...
}
Superseded by debt token
Step 3: Lenders can view Loan Request and amortization schedule Once Loan Contract (at the stage of 'new request') has been deployed, lenders should be able to view the loan request on a frontend app. The frontend app should show the loan parameters that the borrower requested. The frontend app should also show the amortization schedule (i.e. repayment table). The frontend app might also show some graphs to show the declining outstanding balance.
Step 4: Lenders can fund the loan request [Needs more thought] Lender should be able to either:
For simplicity, Lender should use a stablecoin (e.g. Dai). However, given that Dai is currently trading at 0.95, we might explore fiat-collateralized stablecoins (e.g. Paxos, USDC) as an interim measure.
To dos: