Skip to content

Commit

Permalink
fix: vault manager withdraw
Browse files Browse the repository at this point in the history
  • Loading branch information
ricklista committed Nov 12, 2024
1 parent c41aacd commit e409ceb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contracts/psm/VaultManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ contract VaultManager is ReentrancyGuardUpgradeable, AccessControlUpgradeable, U
*/
function withdraw(address receiver, uint256 amount) external nonReentrant onlyPSMOrManager {
require(amount > 0, "withdraw amount cannot be zero");
require(adapters.length > 0, "no adapter");

uint256 remain = amount;
uint256 vaultBalance = IERC20(token).balanceOf(address(this));
Expand All @@ -135,6 +134,7 @@ contract VaultManager is ReentrancyGuardUpgradeable, AccessControlUpgradeable, U
}

if (remain > 0) {
require(adapters.length > 0, "no adapter");
// withdraw token from adapters
uint256 startIdx = block.number % adapters.length;

Expand Down

0 comments on commit e409ceb

Please sign in to comment.