Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 328 - new repayment logic for v2 calculations #92

Merged
merged 11 commits into from
Jun 21, 2023

Conversation

ethereumdegen
Copy link
Contributor

@ethereumdegen ethereumdegen commented May 16, 2023

uint256 endDate = uint256(_bid.loanDetails.acceptedTimestamp) + uint256(_bid.loanDetails.loanDuration);
uint256 lastPaymentCycleStart = endDate - uint256(bid.terms.paymentCycle);
bool isLastPaymentCycle = uint256(timestamp) > lastPaymentCycleStart || owedPrincipal +interest
<= _bid.terms.paymentCycleAmount;

@passabilities passabilities added the Sherlock Audit Fix Fixes relating to a Sherlock audit report label May 19, 2023
Comment on lines 111 to 116
uint256 endDate = uint256(_bid.loanDetails.acceptedTimestamp) +
uint256(_bid.loanDetails.loanDuration);
uint256 lastPaymentCycleStart = endDate -
uint256(lastPaymentCycleDuration);
bool isLastPaymentCycle = uint256(_timestamp) > lastPaymentCycleStart ||
owedPrincipal_ + interest_ <= _bid.terms.paymentCycleAmount;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uint256 endDate = uint256(_bid.loanDetails.acceptedTimestamp) +
uint256(_bid.loanDetails.loanDuration);
uint256 lastPaymentCycleStart = endDate -
uint256(lastPaymentCycleDuration);
bool isLastPaymentCycle = uint256(_timestamp) > lastPaymentCycleStart ||
owedPrincipal_ + interest_ <= _bid.terms.paymentCycleAmount;
bool isLastPaymentCycle;
{
uint256 endDate = uint256(_bid.loanDetails.acceptedTimestamp) +
uint256(_bid.loanDetails.loanDuration);
uint256 lastPaymentCycleStart = endDate -
uint256(lastPaymentCycleDuration);
isLastPaymentCycle = uint256(_timestamp) > lastPaymentCycleStart ||
owedPrincipal_ + interest_ <= _bid.terms.paymentCycleAmount;
}

@passabilities passabilities merged commit 572743b into fix-review Jun 21, 2023
2 checks passed
@passabilities passabilities deleted the fix/sherlock/328 branch June 21, 2023 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contracts Sherlock Audit Fix Fixes relating to a Sherlock audit report
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants