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

N-04 Unused Code #1922

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,8 @@ abstract contract BaseBalancerStrategy is InitializableAbstractStrategy {
* To mitigate MEV possibilities during deposits and withdraws, the VaultValueChecker will use checkBalance before and after the move
* to ensure the expected changes took place.
*
* @param _poolAsset Address of the Balancer pool asset
* @param _poolAmount Amount of the Balancer pool asset
* @param _poolAssets Array of addresses of the Balancer pool assets
* @param _poolAmounts Array of amounts of the Balancer pool assets
* @return bptExpected of BPT expected in exchange for the asset
*
* @dev
Expand All @@ -296,19 +296,6 @@ abstract contract BaseBalancerStrategy is InitializableAbstractStrategy {
* https://www.notion.so/originprotocol/Balancer-OETH-strategy-9becdea132704e588782a919d7d471eb?pvs=4#ce01495ae70346d8971f5dced809fb83
*/
/* solhint-enable max-line-length */
function _getBPTExpected(address _poolAsset, uint256 _poolAmount)
internal
view
virtual
returns (uint256 bptExpected)
{
uint256 bptRate = IRateProvider(platformAddress).getRate();
uint256 poolAssetRate = _getRateProviderRate(_poolAsset);
bptExpected = _poolAmount.mulTruncate(poolAssetRate).divPrecisely(
bptRate
);
}

function _getBPTExpected(
address[] memory _poolAssets,
uint256[] memory _poolAmounts
Expand Down Expand Up @@ -430,32 +417,6 @@ abstract contract BaseBalancerStrategy is InitializableAbstractStrategy {
}
}

/**
* @dev If an asset is rebasing the Balancer pools have a wrapped versions of assets
* that the strategy supports. This function converts the rebasing strategy asset
* and corresponding amount to wrapped(pool) asset.
*/
function _fromPoolAsset(address poolAsset, uint256 poolAmount)
internal
view
returns (address asset, uint256 amount)
{
if (poolAsset == wstETH) {
asset = stETH;
if (poolAmount > 0) {
amount = IWstETH(wstETH).getStETHByWstETH(poolAmount);
}
} else if (poolAsset == sfrxETH) {
asset = frxETH;
if (poolAmount > 0) {
amount = IERC4626(sfrxETH).convertToAssets(poolAmount);
}
} else {
asset = poolAsset;
amount = poolAmount;
}
}

function _fromPoolAsset(address poolAsset)
internal
view
Expand Down