Skip to content

Commit

Permalink
forge fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
xhad committed Oct 22, 2024
1 parent 5d413a7 commit 57729a2
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 19 deletions.
9 changes: 4 additions & 5 deletions src/Vault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ contract Vault is IVault, ERC20PermitUpgradeable, AccessControlUpgradeable, Reen
function depositAsset(address asset_, uint256 assets_, address receiver) public returns (uint256) {
if (paused()) revert Paused();
if (_getAssetStorage().assets[asset_].index == 0) revert InvalidAsset();

uint256 shares = previewDepositAsset(asset_, assets_);
_deposit(asset_, _msgSender(), receiver, assets_, shares);

Expand Down Expand Up @@ -207,13 +207,12 @@ contract Vault is IVault, ERC20PermitUpgradeable, AccessControlUpgradeable, Reen

/// @dev Being Multi asset, we need to add the asset param here to deposit the user's asset accordingly.
function _deposit(address asset_, address caller, address receiver, uint256 assets, uint256 shares) internal {

_getVaultStorage().totalAssets += assets;

SafeERC20.safeTransferFrom(IERC20(asset_), caller, address(this), assets);

_mint(receiver, shares);

emit Deposit(caller, receiver, assets, shares);
}

Expand Down
2 changes: 0 additions & 2 deletions test/helpers/Etches.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {MockStETH} from "test/mocks/MockStETH.sol";
import "forge-std/Test.sol";

contract Etches is Test, MainnetContracts {

function mockAllAssets() public {
mockWETH9();
mockStETH();
Expand All @@ -25,6 +24,5 @@ contract Etches is Test, MainnetContracts {
MockStETH steth = new MockStETH();
bytes memory code = address(steth).code;
vm.etch(STETH, code);

}
}
6 changes: 3 additions & 3 deletions test/unit/admin.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ contract VaultAdminUintTest is Test, MainnetContracts, MainnetActors, Etches {
function test_Vault_addStrategy() public {
address strat = address(42069);
vm.startPrank(ADMIN);
vault.addStrategy(strat);
vault.addStrategy(strat);
assertEq(vault.getStrategies().length, 1);
}

function test_Vault_addStrategy_unauthorized() public {
address strat = address(42069);
vm.expectRevert();
vault.addStrategy(strat);
vault.addStrategy(strat);
}

function test_Vault_addAsset() public {
Expand All @@ -65,5 +65,5 @@ contract VaultAdminUintTest is Test, MainnetContracts, MainnetActors, Etches {
vm.startPrank(ADMIN);
// vault.addAsset(asset, 18);
// assertEq(vault.get[asset].active == true);
}
}
}
6 changes: 1 addition & 5 deletions test/unit/deposit.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,12 @@ contract VaultDepositUnitTest is Test, MainnetContracts, Etches {
assertEq(vault.totalAssets(), depositAmount, "Total assets did not increase correctly");
}

function test_Vault_depositAsset() public {

}
function test_Vault_depositAsset() public {}

// function testDepositZeroAmount() public {
// vm.prank(alice);
// uint256 sharesMinted = vault.deposit(0, alice);

// assertEq(sharesMinted, 0, "Shares were minted for zero deposit");
// }


}
5 changes: 1 addition & 4 deletions test/unit/withdraw.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ contract VaultWithdrawUnitTest is Test, MainnetContracts, Etches {

assertEq(amount, assets);



// fees have to be included with previewWithdraw
}

}
}

0 comments on commit 57729a2

Please sign in to comment.