Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(#34) Verify vault addresses in Investment Manager #383

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/InvestmentManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ contract InvestmentManager is Auth, IInvestmentManager {
uint128 shares
) public auth {
address vault = poolManager.getVault(poolId, trancheId, assetId);
require(vault != address(0), "InvestmentManager/vault-not-found");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can add this check to PoolManager.getVault, similar to what we do in PoolManager.getVaultAsset


InvestmentState storage state = investments[vault][user];
require(state.pendingDepositRequest != 0, "InvestmentManager/no-pending-deposit-request");
Expand All @@ -271,6 +272,7 @@ contract InvestmentManager is Auth, IInvestmentManager {
uint128 shares
) public auth {
address vault = poolManager.getVault(poolId, trancheId, assetId);
require(vault != address(0), "InvestmentManager/vault-not-found");

InvestmentState storage state = investments[vault][user];
require(state.pendingRedeemRequest != 0, "InvestmentManager/no-pending-redeem-request");
Expand Down Expand Up @@ -300,6 +302,7 @@ contract InvestmentManager is Auth, IInvestmentManager {
uint128 fulfillment
) public auth {
address vault = poolManager.getVault(poolId, trancheId, assetId);
require(vault != address(0), "InvestmentManager/vault-not-found");

InvestmentState storage state = investments[vault][user];
require(state.pendingCancelDepositRequest == true, "InvestmentManager/no-pending-cancel-deposit-request");
Expand All @@ -319,6 +322,8 @@ contract InvestmentManager is Auth, IInvestmentManager {
auth
{
address vault = poolManager.getVault(poolId, trancheId, assetId);
require(vault != address(0), "InvestmentManager/vault-not-found");

InvestmentState storage state = investments[vault][user];
require(state.pendingCancelRedeemRequest == true, "InvestmentManager/no-pending-cancel-redeem-request");

Expand All @@ -337,6 +342,7 @@ contract InvestmentManager is Auth, IInvestmentManager {
{
require(shares != 0, "InvestmentManager/tranche-token-amount-is-zero");
address vault = poolManager.getVault(poolId, trancheId, assetId);
require(vault != address(0), "InvestmentManager/vault-not-found");

// If there's any unclaimed deposits, claim those first
InvestmentState storage state = investments[vault][user];
Expand Down
Loading