@@ -31,6 +31,7 @@ interface ISpotIOULoan {
3131 string memory _name ,
3232 string memory _symbol ,
3333 address _IOUMint ,
34+ string memory memo_ ,
3435 bool _flexible
3536 ) external ;
3637
@@ -48,7 +49,6 @@ interface ISpotIOULoan {
4849 function totalRedeemed () external view returns (uint256 );
4950 function _totalRepayments () external view returns (uint256 );
5051 function _totalPrincipalRepaid () external view returns (uint256 );
51-
5252 // Real-time interest
5353 function viewAccruedInterest () external view returns (uint256 );
5454 function totalOwed () external view returns (uint256 );
@@ -64,6 +64,7 @@ interface ISpotIOULoan {
6464 // Direct function for interest claimable
6565 function interestClaimable (address user ) external view returns (uint256 );
6666 function flexible () external view returns (bool );
67+ function memo () external view returns (string memory );
6768}
6869
6970interface IIOUMint {
@@ -133,7 +134,7 @@ contract SpotIOULoan is ERC20 {
133134 uint256 public repayments; // principal repaid so far (used in "Version2")
134135 uint256 public interestrepayments; // interest repaid so far
135136 uint256 public totalRedeemed; // total principal redeemed by IOU holders
136-
137+ string public memo;
137138 // For interest distribution
138139 mapping (address => uint256 ) public lastInterestIndex;
139140
@@ -172,6 +173,7 @@ contract SpotIOULoan is ERC20 {
172173 string memory name_ ,
173174 string memory symbol_ ,
174175 address _IOUMint ,
176+ string memory memo_ ,
175177 bool _flexible
176178 ) external {
177179 // Simple check so we don't double-init
@@ -192,7 +194,7 @@ contract SpotIOULoan is ERC20 {
192194
193195 loanToken = IERC20 (_loanToken);
194196 dec = ERC20 (_loanToken).decimals ();
195-
197+ memo = memo_;
196198 // Overwrite the ERC20 name/symbol if desired
197199 _name = name_;
198200 _symbol = symbol_;
@@ -331,7 +333,9 @@ contract SpotIOULoan is ERC20 {
331333 }
332334 loanGoal = newGoal;
333335 }
334-
336+ function updateMemo (string memory newMemo ) external onlyBorrower {
337+ memo = newMemo;
338+ }
335339 // -----------------------------
336340 // Unfund
337341 // -----------------------------
@@ -592,6 +596,7 @@ contract IOUMint {
592596 uint256 interestClaimable;
593597 uint256 tokensUnderlying;
594598 uint256 totalRedeemed;
599+ string memo;
595600 bool flexible;
596601 }
597602
@@ -618,6 +623,7 @@ contract IOUMint {
618623 address _feeAddress ,
619624 string memory _name ,
620625 string memory _symbol ,
626+ string memory memo ,
621627 bool _flexible
622628 ) external returns (address loanAddress ) {
623629 require (msg .sender == _borrower, "Only borrower can deploy " );
@@ -637,6 +643,7 @@ contract IOUMint {
637643 _name,
638644 _symbol,
639645 address (this ),
646+ memo,
640647 _flexible
641648 );
642649
@@ -734,7 +741,7 @@ contract IOUMint {
734741 // Real-time interest
735742 info.updatedInterest = loan.viewAccruedInterest ();
736743 info.updatedTotalOwed = loan.totalOwed ();
737-
744+ info.memo = loan. memo ();
738745 // Repayments
739746 uint256 totalReps = loan._totalRepayments ();
740747 uint256 principalReps = loan._totalPrincipalRepaid ();
0 commit comments