Extensions
The Extensions.sol contract handles the logic necessary to request and vote on extensions. During the course of a loan, the borrower has the opportunity to for a single extension of the instalment deadline. Lenders in favour of the extension are required to vote in support for it, wherein their voting power is proportional to their balance of the pool tokens. While only one extension can be granted, the borrower can place a request multiple times during the loan period (of course, once an extension has been granted, further requests are rejected automatically).
Extensions for a given period need to be requested before the grace period of the interval in question ends. Lenders are also required to cast their vote before that deadline - thus, borrowers are expected to plan in advance if they wish to receive an extension.
Extensions can be requested by borrower in case they are unable to pay the interest for a period. If approved, borrower can skip the repayment for the period and repay it together with the next installment repayment. Only one extension can be availed in the lifecycle of a pool. Even if extension is rejected, as long as extension wasn't previously granted for pool, extension can be requested again.
- by pool creation
- can place extension requests
- Having possession of the pool's tokens
- can vote on extensions
function requestExtension(address _pool)
external onlyBorrower(_pool) {
- None
- an extension request must not be currently active (
require(block.timestamp > _extensionVoteEndTime,
) - extension must not have been granted before (
require(extensions[_pool].periodWhenExtensionIsPassed == 0
, ) msg.sender
should be the borrower
_pool
: address of the pool for which extension is being requested
Lenders of a particular pool vote on any extension requests by the borrower. Whether a user is a valid lender or not is checked by their balance of the relevant pool tokens. Votes are made only in support of the extension request - those who are against it are not required to vote.
function voteOnExtension(address _pool) external {
- None
- Voting period should be active
msg.sender
must have pool token balancemsg.sender
should not have voted for the current request before
_pool
: address of the pool for whichmsg.sender
is voting
This function is called internally by the
voteOnExtension()
function if the threshold for passing the extension request is reached.function grantExtension(address _pool) internal {
- None
- Internal function, can only be called by
voteOnExtension()
_pool
: address of the pool that is being granted an extension
Borrower can request for extension using
function requestExtension(address pool)
msg.sender
: Borrower of the poolpool
: Pool address
Note: Extension can only be availed once in the lifecycle of a pool.
Last modified 1yr ago