Skip to content

Commit

Permalink
Add missing isSupported check to bulkWithdraw
Browse files Browse the repository at this point in the history
  • Loading branch information
crispymangoes committed Apr 4, 2024
1 parent 61d9a48 commit 59a1804
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/base/Roles/TellerWithMultiAssetSupport.sol
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ contract TellerWithMultiAssetSupport is Auth, BeforeTransferHook, ReentrancyGuar
returns (uint256 shares)
{
if (!isSupported[depositAsset]) revert TellerWithMultiAssetSupport__AssetNotSupported();

shares = _erc20Deposit(depositAsset, depositAmount, minimumMint, to);
emit BulkDeposit(address(depositAsset), depositAmount);
}
Expand All @@ -300,6 +301,8 @@ contract TellerWithMultiAssetSupport is Auth, BeforeTransferHook, ReentrancyGuar
requiresAuth
returns (uint256 assetsOut)
{
if (!isSupported[withdrawAsset]) revert TellerWithMultiAssetSupport__AssetNotSupported();

if (shareAmount == 0) revert TellerWithMultiAssetSupport__ZeroShares();
assetsOut = shareAmount.mulDivDown(accountant.getRateInQuoteSafe(withdrawAsset), ONE_SHARE);
if (assetsOut < minimumAssets) revert TellerWithMultiAssetSupport__MinimumAssetsNotMet();
Expand Down

0 comments on commit 59a1804

Please sign in to comment.