// SPDX-License-Identifier: MIT pragma solidity ^0.7.1; contract FastLoan { // consider using access control from openzepplin for Escrow part. struct LoanRequest { address borrower; uint amount; uint projectID; string projectTitle; uint projectDuration; uint bonus; //uint certifications -offchain; //string description - offchain; } struct Loan { address lender; address borrower; uint amount; uint endTime; uint interest; uint projectID; string projectTitle; //uint certTarget; // Target number of certifications //uint curCert; // Current number of certifications //string description; bool done; } struct CreditHistoryOracle{ uint creditScore; uint dateCreditScoreReceived; } mapping (address => CreditHistoryOracle) borroweCreditHistory; // Request info bytes8[] public requestIDs; mapping(bytes8 => LoanRequest) public requests; // Loan info. // one loan per user. mapping(address => bytes8) public userLoan; mapping(bytes8 => Loan) public allLoans; // Aggregate Lenders info address[] public allLenders; //mapping(address => string) public userMap; // Aggregate borrowers' info address[] public allBorrowers; //mapping(address => string) public userMap; // User-specific information //mapping(address => Reputation) public reputation; //mapping (address => uint) public balanceOf; mapping(address => uint) public debt; // All projects ever started (excludes requests) bytes8[] public allProjects; mapping(address => bytes8[]) public userProjects; // Validators mapping(bytes8 => address[]) public Validators; // Super validator address public superValidator; constructor (){ } // create and submit request. function submitLoanRequest() public { } // approve submitted request. Should be done by the superValidator or delegated validator function approveLoanRequest() public { } //terminate Loan when the loan is paid function terminateLoan() public{ } // record the payments of the loans / the installment process function recordPayment() public { } //default in loan payments function defaultInPayment() public { } //getters function getRequests() public { } function getBorrowes() public { } function getLenders() public { } function getProjectName() public { } // returns the borrower's debt function getDebt() public { } // returns defaulted loans function getOutStandingLoan() public { } }
0.7.1