REVLoans
Inherits: ERC721, ERC2771Context, Ownable, IREVLoans
A contract for borrowing from revnets.
Tokens used as collateral are burned, and reminted when the loan is paid off. This keeps the revnet's token structure orderly.
The borrowable amount is the same as the cash out amount.
An upfront fee is taken when a loan is created. 2.5% is charged by the underlying protocol, 2.5% is charged by the revnet issuing the loan, and a variable amount charged by the revnet that receives the fees. This variable amount is chosen by the borrower, the more paid upfront, the longer the prepaid duration. The loan can be repaid anytime within the prepaid duration without additional fees. After the prepaid duration, the loan will increasingly cost more to pay off. After 10 years, the loan collateral cannot be recouped.
The loaned amounts include the fees taken, meaning the amount paid back is the amount borrowed plus the fees.
State Variables
LOAN_LIQUIDATION_DURATION
After the prepaid duration, the loan will cost more to pay off. After 10 years, the loan collateral cannot be recouped. This means paying 50% of the loan amount upfront will pay for having access to the remaining 50% for 10 years, whereas paying 0% of the loan upfront will cost 100% of the loan amount to be paid off after 10 years. After 10 years with repayment, both loans cost 100% and are liquidated.
uint256 public constant override LOAN_LIQUIDATION_DURATION = 3650 days;
MAX_PREPAID_FEE_PERCENT
The maximum amount of a loan that can be prepaid at the time of borrowing, in terms of JBConstants.MAX_FEE.
uint256 public constant override MAX_PREPAID_FEE_PERCENT = 500;
REV_PREPAID_FEE_PERCENT
A fee of 1% is charged by the $REV revnet.
uint256 public constant override REV_PREPAID_FEE_PERCENT = 5;
MIN_PREPAID_FEE_PERCENT
A fee of 2.5% is charged by the loan's source upfront.
uint256 public constant override MIN_PREPAID_FEE_PERCENT = 25;
_ONE_TRILLION
Just a kind reminder to our readers.
Used in loan token ID generation.
uint256 private constant _ONE_TRILLION = 1_000_000_000_000;
PERMIT2
The permit2 utility.
IPermit2 public immutable override PERMIT2;
CONTROLLER
The controller of revnets that use this loans contract.
IJBController public immutable override CONTROLLER;
REVNETS
Mints ERC-721s that represent project ownership and transfers.
IREVDeployer public immutable override REVNETS;