Skip to content

Commit

Permalink
gas optimisation
Browse files Browse the repository at this point in the history
  • Loading branch information
sparrowDom committed Dec 6, 2023
1 parent 47b9c0b commit 8fb75ec
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,11 +313,12 @@ contract BalancerMetaPoolStrategy is BaseAuraStrategy {
if (poolAssetAmount > 0) {
strategyAssetsToPoolAssetsAmounts[i] = poolAssetAmount;

Check warning on line 314 in contracts/contracts/strategies/balancer/BalancerMetaPoolStrategy.sol

View check run for this annotation

Codecov / codecov/patch

contracts/contracts/strategies/balancer/BalancerMetaPoolStrategy.sol#L314

Added line #L314 was not covered by tests

uint256 indexOfPoolAsset = poolAssetIndex[poolAsset];

Check warning on line 316 in contracts/contracts/strategies/balancer/BalancerMetaPoolStrategy.sol

View check run for this annotation

Codecov / codecov/patch

contracts/contracts/strategies/balancer/BalancerMetaPoolStrategy.sol#L316

Added line #L316 was not covered by tests
/* This check is triggered when the _withdrawal is called with
* a duplicate asset in the _strategyAssets array
*/
require(
poolAssetsAmountsOut[poolAssetIndex[poolAsset]] == 0,
poolAssetsAmountsOut[indexOfPoolAsset] == 0,
"No duplicate withdrawal assets"
);

Expand All @@ -330,9 +331,7 @@ contract BalancerMetaPoolStrategy is BaseAuraStrategy {
* For that reason we `overshoot` the required tokens expected to
* circumvent the error
*/
poolAssetsAmountsOut[poolAssetIndex[poolAsset]] =
poolAssetAmount +
2;
poolAssetsAmountsOut[indexOfPoolAsset] = poolAssetAmount + 2;

Check warning on line 334 in contracts/contracts/strategies/balancer/BalancerMetaPoolStrategy.sol

View check run for this annotation

Codecov / codecov/patch

contracts/contracts/strategies/balancer/BalancerMetaPoolStrategy.sol#L334

Added line #L334 was not covered by tests
}
}

Expand Down

0 comments on commit 8fb75ec

Please sign in to comment.