Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP TryLSD strategy #1911

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions contracts/contracts/proxies/Proxies.sol
Original file line number Diff line number Diff line change
Expand Up @@ -211,3 +211,10 @@ contract ConvexFrxEthWethStrategyProxy is
contract ConvexFrxETHAMOStrategyProxy is InitializeGovernedUpgradeabilityProxy {

}

/**
* @notice ConvexTryLSDStrategyProxy delegates calls to a ConvexCryptoStrategy implementation
*/
contract ConvexTryLSDStrategyProxy is InitializeGovernedUpgradeabilityProxy {

}
28 changes: 16 additions & 12 deletions contracts/contracts/strategies/BaseCurveStrategy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,8 @@ import { Helpers } from "../utils/Helpers.sol";
struct CurveFunctions {
function(uint256[] memory, uint256) add_liquidity;
function(uint256, uint256[] memory) remove_liquidity;
function(
uint256,
uint256,
uint256,
address,
address
) remove_liquidity_imbalance;
function(uint256, uint256, uint256, address, address)
returns (uint256) remove_liquidity_imbalance;
function(uint256, uint256) view returns (uint256) calcWithdrawLpAmount;
}

Expand Down Expand Up @@ -139,6 +134,7 @@ abstract contract BaseCurveStrategy is InitializableAbstractStrategy {
*/
function deposit(address _asset, uint256 _amount)
external
virtual
override
onlyVault
nonReentrant
Expand Down Expand Up @@ -183,7 +179,7 @@ abstract contract BaseCurveStrategy is InitializableAbstractStrategy {
* `deposit` must be protected by the `VaultValueChecker` when the `Strategist` or `Governor`
* calls `depositToStrategy` on the `Vault`.
*/
function depositAll() external override onlyVault nonReentrant {
function depositAll() external virtual override onlyVault nonReentrant {
uint256[] memory _amounts = new uint256[](CURVE_POOL_ASSETS_COUNT);
uint256 totalScaledAmount = 0;

Expand Down Expand Up @@ -253,7 +249,7 @@ abstract contract BaseCurveStrategy is InitializableAbstractStrategy {
address _recipient,
address _asset,
uint256 _amount
) external override onlyVault nonReentrant {
) external virtual override onlyVault nonReentrant {
require(_amount > 0, "Must withdraw something");

emit Withdrawal(_asset, CURVE_POOL, _amount);
Expand Down Expand Up @@ -297,7 +293,13 @@ abstract contract BaseCurveStrategy is InitializableAbstractStrategy {
* `withdrawAll` must be protected by the `VaultValueChecker` when the `Strategist` or `Governor`
* calls `withdrawAllFromStrategy` or `withdrawAllFromStrategies` on the `Vault`.
*/
function withdrawAll() external override onlyVaultOrGovernor nonReentrant {
function withdrawAll()
external
virtual
override
onlyVaultOrGovernor
nonReentrant
{
_lpWithdrawAll();

// Withdraws are proportional to assets held by Curve pool
Expand Down Expand Up @@ -331,7 +333,7 @@ abstract contract BaseCurveStrategy is InitializableAbstractStrategy {
****************************************/

/**
* @dev Approve the spending of all assets by their corresponding pool tokens,
* @notice Approve the spending of all assets by their corresponding pool tokens,
* if for some reason is it necessary.
*/
function safeApproveAllTokens()
Expand Down Expand Up @@ -380,6 +382,7 @@ abstract contract BaseCurveStrategy is InitializableAbstractStrategy {
function _getCoinIndex(address _asset)
internal
view
virtual
returns (uint256 coinIndex)
{
// This check is needed for Curve pools with only two assets as
Expand Down Expand Up @@ -483,7 +486,8 @@ abstract contract BaseCurveStrategy is InitializableAbstractStrategy {
internal
override
{
require(_curveSupportedCoin(_asset), "Not a Curve pool coin");
// TODO
// require(_curveSupportedCoin(_asset), "Not a Curve pool coin");
InitializableAbstractStrategy._setPTokenAddress(_asset, _pToken);
}

Expand Down