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

Fix: limits unlimited vault creation. closes #65 #66

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

meetjn
Copy link
Contributor

@meetjn meetjn commented Jan 29, 2025

This PR fixes #65

Changes Proposed:

error FairFund__VaultLimitExceeded(address user, uint256 maxAllowed);

 uint256 public constant MAX_VAULTS_PER_ADDRESS = 5;
 mapping(address => uint256) private s_vaultsCreated;

if (s_vaultsCreated[msg.sender] >= MAX_VAULTS_PER_ADDRESS) {
        revert FairFund__VaultLimitExceeded(msg.sender, MAX_VAULTS_PER_ADDRESS);
        }

s_vaultsCreated[msg.sender]++;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Unlimited Vault Creation
1 participant