Skip to content

Comments

feat: add update_campaign_goal#107

Open
elmuby wants to merge 4 commits intoWeb3Novalabs:mainfrom
elmuby:feature/update_campaign_goal
Open

feat: add update_campaign_goal#107
elmuby wants to merge 4 commits intoWeb3Novalabs:mainfrom
elmuby:feature/update_campaign_goal

Conversation

@elmuby
Copy link

@elmuby elmuby commented Feb 20, 2026

Closes #83

This PR enables creators to reduce their campaign goal while strictly preventing any increase to mitigate rug pull risks.

  • Added InvalidGoalUpdate error
  • Implemented update_campaign_goal with:
    • Creator-only access
    • Active campaign validation
    • new_goal <= current_goal (no increases)
    • new_goal >= total_raised (cannot go below raised amount)
  • Added campaign_goal_updated event

Tests

Added tests to verify:

  • Successful goal reduction
  • Increase attempt reverts with InvalidGoalUpdate
  • Cannot reduce below total_raised
  • Cannot update expired campaign

All tests passing ✅

@elmuby
Copy link
Author

elmuby commented Feb 20, 2026

Kindly review my pr @Akshola00

@Akshola00
Copy link
Contributor

Kindly review my pr @Akshola00

Thanks
Pls remove test snapshots as they are added in the gitignore

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.

[FUNCTION] implement update_campaign_goal

2 participants