-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* build: add factory * chore: install new version * chore: update periphery * fix: factory
- Loading branch information
1 parent
d185c78
commit f8afbce
Showing
7 changed files
with
141 additions
and
17 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
Submodule tokenized-strategy
updated
17 files
+1 −1 | README.md | |
+6 −6 | SPECIFICATION.md | |
+ − | audits/Yearn V3 report Statemind.pdf | |
+1,489 −0 | flattened/FlatBaseStrategy.sol | |
+3,378 −0 | flattened/FlatTokenizedStrategy.sol | |
+1 −2 | foundry.toml | |
+4 −5 | script/Deploy.s.sol | |
+1 −1 | src/BaseStrategy.sol | |
+65 −57 | src/TokenizedStrategy.sol | |
+12 −0 | src/interfaces/ITokenizedStrategy.sol | |
+15 −0 | src/test/AccessControl.t.sol | |
+128 −13 | src/test/Accounting.t.sol | |
+97 −0 | src/test/CustomImplementation.t.sol | |
+1 −1 | src/test/ERC20Std.t.sol | |
+18 −0 | src/test/ERC4626Std.t.sol | |
+2 −2 | src/test/handlers/StrategyHandler.sol | |
+0 −2 | src/test/mocks/MockStorage.sol |
Submodule tokenized-strategy-periphery
updated
15 files
+2 −2 | .gitmodules | |
+7 −3 | README.md | |
+1 −1 | lib/tokenized-strategy | |
+1 −1 | lib/yearn-vaults-v3 | |
+28 −0 | script/BaseScript.s.sol | |
+4 −16 | script/DeployAprOracle.s.sol | |
+3 −15 | script/DeployAuctionFactory.sol | |
+1 −2 | script/DeployCommonTrigger.s.sol | |
+24 −0 | script/DeployInitGov.s.sol | |
+15 −9 | src/swappers/TradeFactorySwapper.sol | |
+6 −3 | src/test/Auction.t.sol | |
+4 −2 | src/test/AuctionSwapper.t.sol | |
+4 −2 | src/test/BaseAuctioneer.t.sol | |
+130 −0 | src/test/InitGov.t.sol | |
+76 −0 | src/utils/InitGov.sol |
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,80 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity ^0.8.18; | ||
|
||
import {Strategy, ERC20} from "./Strategy.sol"; | ||
import {IStrategyInterface} from "./interfaces/IStrategyInterface.sol"; | ||
|
||
contract StrategyFactory { | ||
event NewStrategy(address indexed strategy, address indexed asset); | ||
|
||
address public immutable emergencyAdmin; | ||
|
||
address public immutable lendingPool; | ||
address public immutable router; | ||
address public immutable base; | ||
|
||
address public management; | ||
address public performanceFeeRecipient; | ||
address public keeper; | ||
|
||
/// @notice Track the deployments. asset => pool => strategy | ||
mapping(address => address) public deployments; | ||
|
||
constructor( | ||
address _management, | ||
address _performanceFeeRecipient, | ||
address _keeper, | ||
address _emergencyAdmin | ||
) { | ||
management = _management; | ||
performanceFeeRecipient = _performanceFeeRecipient; | ||
keeper = _keeper; | ||
emergencyAdmin = _emergencyAdmin; | ||
} | ||
|
||
/** | ||
* @notice Deploy a new Strategy. | ||
* @param _asset The underlying asset for the strategy to use. | ||
* @return . The address of the new strategy. | ||
*/ | ||
function newStrategy( | ||
address _asset, | ||
string calldata _name | ||
) external virtual returns (address) { | ||
// tokenized strategies available setters. | ||
IStrategyInterface _newStrategy = IStrategyInterface( | ||
address(new Strategy(_asset, _name)) | ||
); | ||
|
||
_newStrategy.setPerformanceFeeRecipient(performanceFeeRecipient); | ||
|
||
_newStrategy.setKeeper(keeper); | ||
|
||
_newStrategy.setPendingManagement(management); | ||
|
||
_newStrategy.setEmergencyAdmin(emergencyAdmin); | ||
|
||
emit NewStrategy(address(_newStrategy), _asset); | ||
|
||
deployments[_asset] = address(_newStrategy); | ||
return address(_newStrategy); | ||
} | ||
|
||
function setAddresses( | ||
address _management, | ||
address _performanceFeeRecipient, | ||
address _keeper | ||
) external { | ||
require(msg.sender == management, "!management"); | ||
management = _management; | ||
performanceFeeRecipient = _performanceFeeRecipient; | ||
keeper = _keeper; | ||
} | ||
|
||
function isDeployedStrategy( | ||
address _strategy | ||
) external view returns (bool) { | ||
address _asset = IStrategyInterface(_strategy).asset(); | ||
return deployments[_asset] == _strategy; | ||
} | ||
} |
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