-
Notifications
You must be signed in to change notification settings - Fork 9
User account can get stuck for pools with creditApprovalExpirationInSeconds changed to 0 #279
Copy link
Copy link
Open
Description
Steps to reproduce:
- Create a pool with creditApprovalExpirationInSeconds configured as non-zero in poolConfig
- A user account request a credit line and got approved, but no drawdown
- Changed creditApprovalExpirationInSeconds to 0 in poolConfig
- Wait until the credit expiration window of the approved credit line to pass
- When the user tries to drawdown, the system complains with error creditExpiredDueToFirstDrawdownTooLate
- When the user tries to request a new credit line and got approved, the system updates the user state, but since creditApprovalExpirationInSeconds is 0, the if condition in line 398 in BaseCreditPool is evaluated to false, thus, the dueDate is not updated. When the user tries to drawdown, it complains creditExpiredDueToFirstDrawdownTooLate.
Desired behavior: In _approveCredit(), if validPeriod > 0 or dueDate > 0, the dueDate should be refreshed. The current implementation did not consider the case when creditApprovalExpirationInSeconds is changed from non-zero to zero.
Workaround: Because the next contract upgrade, require all pools to set creditApprovalExpirationInSeconds to non-zero, which is totally reasonable.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels