-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
8 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,8 @@ import {IFlashLoanRecipient} from "../integrations/balancer/IFlashLoanRecipient. | |
import {IBVault} from "../integrations/balancer/IBVault.sol"; | ||
|
||
/// @title Silo V2 advanced leverage strategy | ||
/// Changelog: | ||
/// 1.0.1: initVariants bugfix | ||
/// @author Alien Deployer (https://github.com/a17) | ||
contract SiloAdvancedLeverageStrategy is LeverageLendingBase, IFlashLoanRecipient { | ||
using SafeERC20 for IERC20; | ||
|
@@ -34,7 +36,7 @@ contract SiloAdvancedLeverageStrategy is LeverageLendingBase, IFlashLoanRecipien | |
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ | ||
|
||
/// @inheritdoc IControllable | ||
string public constant VERSION = "1.0.0"; | ||
string public constant VERSION = "1.0.1"; | ||
|
||
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ | ||
/* INITIALIZATION */ | ||
|
@@ -119,7 +121,7 @@ contract SiloAdvancedLeverageStrategy is LeverageLendingBase, IFlashLoanRecipien | |
uint len = params.initAddresses.length / 4; | ||
variants = new string[](len); | ||
addresses = new address[](len * 4); | ||
nums = new uint[](0); | ||
nums = new uint[](len); | ||
ticks = new int24[](0); | ||
for (uint i; i < len; ++i) { | ||
address collateralAsset = IERC4626(params.initAddresses[i * 2]).asset(); | ||
|
@@ -129,6 +131,7 @@ contract SiloAdvancedLeverageStrategy is LeverageLendingBase, IFlashLoanRecipien | |
addresses[i * 2 + 1] = params.initAddresses[i * 2 + 1]; | ||
addresses[i * 2 + 2] = params.initAddresses[i * 2 + 2]; | ||
addresses[i * 2 + 3] = params.initAddresses[i * 2 + 3]; | ||
nums[i] = params.initNums[i]; | ||
} | ||
} | ||
Check warning Code scanning / Slither Divide before multiply Medium
SiloAdvancedLeverageStrategy.initVariants(address) performs a multiplication on the result of a division:
- len = params.initAddresses.length / 4 - addresses = new address[](len * 4) Check notice Code scanning / Slither Calls inside a loop Low
SiloAdvancedLeverageStrategy.initVariants(address) has external calls inside a loop: borrowAsset = IERC4626(params.initAddresses[i * 2 + 1]).asset()
Check notice Code scanning / Slither Calls inside a loop Low
SiloAdvancedLeverageStrategy.initVariants(address) has external calls inside a loop: collateralAsset = IERC4626(params.initAddresses[i * 2]).asset()
|
||
|
||
|
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