Skip to content

feat(crowdfunding): implement token config and campaign creation fees#44

Merged
martinvibes merged 7 commits intoWeb3Novalabs:mainfrom
petersdt:crowdfunding-config
Jan 28, 2026
Merged

feat(crowdfunding): implement token config and campaign creation fees#44
martinvibes merged 7 commits intoWeb3Novalabs:mainfrom
petersdt:crowdfunding-config

Conversation

@petersdt
Copy link
Contributor

@petersdt petersdt commented Jan 26, 2026

Crowdfunding Configuration & Fee Collection

This PR implements the configuration logic for the crowdfunding contract, enabling dynamic control over the supported token and campaign creation fees.

Changes

  • Configuration: Added admin functions to set the global crowdfunding token and creation fee.
  • Fee Collection: Updated create_campaign to deduct the configured fee from the creator's balance before creating a campaign.
  • Storage: Added persistent storage for crowdfunding_token, creation_fee, and admin.
  • Events: Added new events CrowdfundingTokenSet, CreationFeeSet, and CreationFeePaid.
  • Tests: Added comprehensive tests covering configuration updates, fee payments, insufficient balance checks, and non-admin access restrictions.

Verification

  • Run cargo test crowdfunding_test to verify all 37 tests pass.
  • Run cargo build --target wasm32-unknown-unknown --release to verify successful compilation.
crowdfunding test

closes #14

Copy link
Contributor

@Akshola00 Akshola00 left a comment

Choose a reason for hiding this comment

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

gm @petersdt pls include your test snapshots
great modularizing of test setup, makes it a lot easier to create a large change

@Akshola00
Copy link
Contributor

ci is failing, please format your code

@martinvibes
Copy link
Contributor

@petersdt pls there's no need to add back the test snap shots since it's an unnecessary file that amounts to making the codebase larger than expected

@martinvibes
Copy link
Contributor

so fix conflict and don't push back the snapshots it's unncessary

Copy link
Contributor

@martinvibes martinvibes left a comment

Choose a reason for hiding this comment

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

LGTM!

@martinvibes martinvibes merged commit 9b30462 into Web3Novalabs:main Jan 28, 2026
1 check passed
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.

Implement configuration functions to set and get the crowdfunding token and creation fee

3 participants