-
Notifications
You must be signed in to change notification settings - Fork 32
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
Showing
6 changed files
with
890 additions
and
50 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,30 @@ | ||
// SPDX-License-Identifier: AGPL-3.0 | ||
pragma solidity ^0.8.0; | ||
|
||
import {ERC20} from "solmate/tokens/ERC20.sol"; | ||
import {ERC4626} from "solmate/mixins/ERC4626.sol"; | ||
|
||
// mock clearinghouse to use with testing the yieldRepo contract | ||
// most functions / variables are omitted | ||
contract MockClearinghouse { | ||
ERC20 public reserve; | ||
ERC4626 public wrappedReserve; | ||
uint256 public principalReceivables; | ||
|
||
constructor(address _reserve, address _wrappedReserve) { | ||
reserve = ERC20(_reserve); | ||
wrappedReserve = ERC4626(_wrappedReserve); | ||
} | ||
|
||
function setPrincipalReceivables(uint256 _principalReceivables) external { | ||
principalReceivables = _principalReceivables; | ||
} | ||
|
||
function withdrawReserve(uint256 _amount) external { | ||
reserve.transfer(msg.sender, _amount); | ||
} | ||
|
||
function withdrawWrappedReserve(uint256 _amount) external { | ||
wrappedReserve.transfer(msg.sender, _amount); | ||
} | ||
} |
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,29 @@ | ||
// SPDX-License-Identifier: AGPL-3.0 | ||
pragma solidity ^0.8.0; | ||
|
||
import {IYieldRepo} from "../../policies/interfaces/IYieldRepo.sol"; | ||
|
||
contract MockYieldRepo is IYieldRepo { | ||
uint48 public epoch; | ||
bool public isShutdown; | ||
|
||
function endEpoch() external override { | ||
// do nothing | ||
} | ||
|
||
function shutdown() external { | ||
isShutdown = true; | ||
} | ||
|
||
function getReserveBalance() external pure override returns (uint256) { | ||
return 0; | ||
} | ||
|
||
function getNextYield() external pure override returns (uint256) { | ||
return 0; | ||
} | ||
|
||
function getOhmBalanceAndBacking() external pure override returns (uint256, uint256) { | ||
return (0, 0); | ||
} | ||
} |
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
Oops, something went wrong.