-
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.
* build: yield manager * fix: check loss and outsource reporting * fix: yield not apr * test: yield manager * feat: add events * fix: remove generic call * fix: permissions * fix: deployments * fix: workflow * fix: rebase tests * feat: use allocator * feat: manage strategy * test: update tests * fix: fixes * fix: remove event * feat: just a keeper contract * fix: removal * feat: report when going to 0 * feat: script and changes * fix: make virtual * fix: formatting * feat: check max redeem and deposit * feat: dont duplicate vaults * chore: change dep * fix: versions * chore: pin ape version * chore: downgrade ape * chore: pin all versions * feat: increase and decrease * fix: formatting * fix: naming * build: use central allocator factory (#31) * build: use central factory * chore: comments * test: update for factory * fix: bump by 20% * chore: renaming * chore: comments * fix: black
- Loading branch information
1 parent
17dce26
commit bd7c8c4
Showing
20 changed files
with
3,013 additions
and
601 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
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
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,54 @@ | ||
// 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; | ||
uint256 public limit; | ||
|
||
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; | ||
} | ||
|
||
function tendThis(uint256) external {} | ||
|
||
function availableWithdrawLimit( | ||
address _owner | ||
) public view virtual override returns (uint256) { | ||
if (limit != 0) { | ||
uint256 _totalAssets = strategyStorage().totalIdle; | ||
return _totalAssets > limit ? _totalAssets - limit : 0; | ||
} else { | ||
return super.availableWithdrawLimit(_owner); | ||
} | ||
} | ||
|
||
function setLimit(uint256 _limit) external { | ||
limit = _limit; | ||
} | ||
} |
Oops, something went wrong.