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

feat: fixed audit findings #23

Merged
merged 3 commits into from
Nov 11, 2021
Merged

feat: fixed audit findings #23

merged 3 commits into from
Nov 11, 2021

Conversation

JGcarv
Copy link
Contributor

@JGcarv JGcarv commented Nov 11, 2021

Addressing the 2 issues found during debt locker audit

uint256 fundsCaptured = _fundsToCapture;

// Funds recovered from liquidation and any unclaimed previous payment amounts
uint256 recoveredFunds = IERC20Like(fundsAsset).balanceOf(address(this)) - fundsCaptured;

Choose a reason for hiding this comment

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

Extra space

@@ -209,19 +211,24 @@ contract DebtLocker is IDebtLocker, DebtLockerStorage, MapleProxied {
require(!_isLiquidationActive(), "DL:HCOR:LIQ_NOT_FINISHED");

address fundsAsset = IMapleLoanLike(_loan).fundsAsset();
uint256 recoveredFunds = IERC20Like(fundsAsset).balanceOf(address(this)); // Funds recovered from liquidation and any unclaimed previous payment amounts
uint256 principalToCover = _principalRemainingAtLastClaim; // Principal remaining at time of liquidation
uint256 principalToCover = _principalRemainingAtLastClaim; // Principal remaining at time of liquidation

Choose a reason for hiding this comment

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

Needs another space before comment

assertEq(debtLocker.principalRemainingAtLastClaim(), loan.principalRequested());
assertEq(debtLocker.fundsToCapture(), 0);

//trigger default

Choose a reason for hiding this comment

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

Add spaces after all //

Choose a reason for hiding this comment

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

Also sentence case

@lucas-manuel lucas-manuel merged commit 096810f into audit Nov 11, 2021
@lucas-manuel lucas-manuel deleted the jg/audit branch November 11, 2021 21:42
lucas-manuel pushed a commit that referenced this pull request Nov 11, 2021
* chore: start cleaning up debt locker

* feat: add README

* feat: fixed audit findings (#23)

* feat: fixed audit findings

* fix: PR comments

* formatting: update comments

Co-authored-by: Lucas <[email protected]>

Co-authored-by: Joao Gabriel Carvalho <[email protected]>
deluca-mike added a commit that referenced this pull request Dec 12, 2021
lucas-manuel pushed a commit that referenced this pull request Dec 12, 2021
* chore: Remove TODO on pullFunds (c4 #10)

* chore: strict 0.8.7 (c4 #23)
lucas-manuel pushed a commit that referenced this pull request Dec 12, 2021
* chore: Remove TODO on pullFunds (c4 #10)

* chore: strict 0.8.7 (c4 #23)

* fix: Add named returns where missing (c4 #25)

Co-authored-by: Lucas Manuel <[email protected]>
lucas-manuel pushed a commit that referenced this pull request Dec 12, 2021
* chore: Remove TODO on pullFunds (c4 #10)

* chore: strict 0.8.7 (c4 #23)

* fix: Add named returns where missing (c4 #25)

* fix: `handleClaimOfRepossessed` gas optimization (c4 #66)

Co-authored-by: Lucas Manuel <[email protected]>
lucas-manuel pushed a commit that referenced this pull request Dec 12, 2021
* chore: Remove TODO on pullFunds (c4 #10)

* chore: strict 0.8.7 (c4 #23)

* fix: Add named returns where missing (c4 #25)

* fix: `handleClaimOfRepossessed` gas optimization (c4 #66)

* fix: `getExpectedAmount` gas savings (c4 #62)

* formatting: use loan instead of loanAddress

Co-authored-by: Lucas Manuel <[email protected]>
lucas-manuel pushed a commit that referenced this pull request Dec 13, 2021
* chore: Remove TODO on pullFunds (c4 #10)

* chore: strict 0.8.7 (c4 #23)

* fix: Add named returns where missing (c4 #25)

* fix: `handleClaimOfRepossessed` gas optimization (c4 #66)

* fix: `getExpectedAmount` gas savings (c4 #62)

* fix: Use `!= 0` instead of `> 0` (c4 #24)

* fix: Input validation for `setAllowedSlippage` (c4 #45)

* refactor: POst-C4 Audit Cleanup

- natspec, spacing, and alignment
- factory `mapleGlobals_` check now handled by mpf
- `success_` -> `success` for non-param variable
- reordered `DebtLockerStorage`
- take latest dependencies
- `acceptNewTerms` gas savings
- `claim`, `_handleClaimOfRepossessed`, and `_handleClaim` gas savings
- `_isLiquidationActive` gas savings
- `triggerDefault` gas savings

Co-authored-by: Joao Gabriel Carvalho <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants