File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed
packages/libs/contracts-sdk/contracts/fees Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,11 @@ library LibFeeStorage {
2727 EnumerableSet.AddressSet tokensWithCollectedFees;
2828 // aave pool contract address for this chain
2929 address aavePool;
30+ // maps user address to a set of vault or pool asset addresses
31+ // this means the user has deposited into this vault or pool
32+ // and if the vincent app disappears, the user can grab this set
33+ // and then call deposits(userAddress, addressFromThisSet) to find their deposits
34+ mapping (address => EnumerableSet.AddressSet) userVaultOrPoolAssetAddresses;
3035 }
3136
3237 function getStorage () internal pure returns (FeeStorage storage as_ ) {
Original file line number Diff line number Diff line change @@ -55,6 +55,10 @@ contract AavePerfFeeFacet {
5555
5656 deposit.assetAmount += assetAmount;
5757 deposit.vaultProvider = VAULT_PROVIDER;
58+
59+ // add the pool asset address to the set of vault or pool asset addresses
60+ // so the user can find their deposits later
61+ LibFeeStorage.getStorage ().userVaultOrPoolAssetAddresses[msg .sender ].add (poolAsset);
5862 }
5963
6064 /**
@@ -74,6 +78,10 @@ contract AavePerfFeeFacet {
7478 // contracts to prevent reentrancy attacks
7579 delete LibFeeStorage.getStorage ().deposits[msg .sender ][poolAsset];
7680
81+ // remove the pool asset address from the set of vault or pool asset addresses
82+ // so the user can't find their deposits later
83+ LibFeeStorage.getStorage ().userVaultOrPoolAssetAddresses[msg .sender ].remove (poolAsset);
84+
7785 // get the aave pool contract and asset
7886 IPool aave = IPool (LibFeeStorage.getStorage ().aavePool);
7987 IERC20 asset = IERC20 (poolAsset);
Original file line number Diff line number Diff line change @@ -56,6 +56,10 @@ contract MorphoPerfFeeFacet {
5656 deposit.assetAmount += assetAmount;
5757 deposit.vaultShares += vaultShares;
5858 deposit.vaultProvider = VAULT_PROVIDER;
59+
60+ // add the vault address to the set of vault or pool asset addresses
61+ // so the user can find their deposits later
62+ LibFeeStorage.getStorage ().userVaultOrPoolAssetAddresses[msg .sender ].add (vaultAddress);
5963 }
6064
6165 /**
@@ -76,6 +80,10 @@ contract MorphoPerfFeeFacet {
7680 // contracts to prevent reentrancy attacks
7781 delete LibFeeStorage.getStorage ().deposits[msg .sender ][vaultAddress];
7882
83+ // remove the vault address from the set of vault or pool asset addresses
84+ // so the user can't find their deposits later
85+ LibFeeStorage.getStorage ().userVaultOrPoolAssetAddresses[msg .sender ].remove (vaultAddress);
86+
7987 // get the vault and asset
8088 ERC4626 vault = ERC4626 (vaultAddress);
8189 IERC20 asset = IERC20 (vault.asset ());
You can’t perform that action at this time.
0 commit comments