-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
90f1436
commit 4ab5939
Showing
3 changed files
with
151 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
LockTest:test_smartLock() (gas: 7940) | ||
LockTest:test_stdLock() (gas: 7672) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// SPDX-License-Identifier: AGPL-3.0 | ||
pragma solidity ^0.8.0; | ||
|
||
import {CoolerCallback} from "src/CoolerCallback.sol"; | ||
import {Cooler} from "src/Cooler.sol"; | ||
|
||
contract MockMaliciousLender is CoolerCallback { | ||
constructor(address coolerFactory_) CoolerCallback(coolerFactory_) {} | ||
|
||
/// @notice Callback function that handles repayments. Override for custom logic. | ||
function _onRepay(uint256 loanID_, uint256 amount_) internal override { | ||
Cooler(msg.sender).repayLoan(loanID_, amount_); | ||
} | ||
|
||
/// @notice Callback function that handles rollovers. | ||
function _onRoll(uint256 loanID_, uint256 newDebt, uint256 newCollateral) internal override { | ||
Cooler(msg.sender).rollLoan(loanID_); | ||
} | ||
|
||
/// @notice Callback function that handles defaults. | ||
function _onDefault(uint256 loanID_, uint256 debt, uint256 collateral) internal override { | ||
Cooler(msg.sender).claimDefaulted(loanID_); | ||
} | ||
} |