-
Notifications
You must be signed in to change notification settings - Fork 14
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
4552258
commit 7856970
Showing
7 changed files
with
1,197 additions
and
57 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,6 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity 0.8.18; | ||
|
||
import {AprOracle} from "@periphery/AprOracle/AprOracle.sol"; | ||
|
||
contract MockOracle is AprOracle {} |
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,36 @@ | ||
// SPDX-License-Identifier: AGPL-3.0 | ||
pragma solidity 0.8.18; | ||
|
||
import {MockTokenizedStrategy} from "@yearn-vaults/test/mocks/ERC4626/MockTokenizedStrategy.sol"; | ||
|
||
contract MockTokenized is MockTokenizedStrategy { | ||
uint256 public apr; | ||
uint256 public loss; | ||
|
||
constructor( | ||
address _asset, | ||
string memory _name, | ||
address _management, | ||
address _keeper, | ||
uint256 _apr | ||
) MockTokenizedStrategy(_asset, _name, _management, _keeper) { | ||
apr = _apr; | ||
} | ||
|
||
function aprAfterDebtChange( | ||
address, | ||
int256 | ||
) external view returns (uint256) { | ||
return apr; | ||
} | ||
|
||
function setApr(uint256 _apr) external { | ||
apr = _apr; | ||
} | ||
|
||
function realizeLoss(uint256 _amount) external { | ||
strategyStorage().asset.transfer(msg.sender, _amount); | ||
strategyStorage().totalIdle -= _amount; | ||
strategyStorage().totalDebt += _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
Oops, something went wrong.