feat: campaign edit mode, top sponsor token rewards, and rainy season… - #763
feat: campaign edit mode, top sponsor token rewards, and rainy season…#763sonoflawal wants to merge 2 commits into
Conversation
… CO2 bonus multiplier - Resolve Fundable-Protocol#721: Campaign edit mode allowing creators to update details before launch * Updated Campaign interface in web types (apps/web/src/types/index.ts) with optional name and description fields. * Created updateCampaignSchema in apps/web/src/lib/validations.ts for validating pre-launch edits (name, description, goal amount, deadline). * Implemented CampaignEditModal.tsx in apps/web/src/components/modules/campaign/ with state management, form validation, and pre-launch status checks. * Added PATCH /api/campaigns/[id] route in apps/web/src/app/api/campaigns/[id]/route.ts for server-side update processing. * Added updateCampaign mutation to GraphQL resolvers (apps/web/src/graphql/resolvers.ts). - Resolve Fundable-Protocol#719: Campaign token rewards for top sponsors * Updated contracts/campaign-funding/src/lib.rs with RewardToken and CampaignSponsors persistent storage keys. * Extended contribute to track unique campaign sponsors per campaign. * Added set_reward_token and get_reward_token contract administration functions. * Added distribute_sponsor_rewards function in CampaignFundingContract to sort top 10 sponsors by contribution and distribute ERC20 governance tokens proportionally. * Emitted SponsorRewardsDistributed event for on-chain auditability. - Resolve Fundable-Protocol#714: Campaign bonus multiplier for rainy season planting * Added get_month_from_timestamp helper in contracts/campaign-funding/src/lib.rs using civil date conversion to identify campaign creation month. * Implemented calculate_co2_multiplier and get_co2_multiplier to assign a 2x bonus CO2 multiplier for campaigns created between May and October (months 5 to 10 inclusive) and 1x otherwise. * Included co2_multiplier in Campaign record and CampaignCreatedEvent. * Updated calculateCo2Offset in apps/web/src/lib/co2-impact.ts to apply the 2x rainy season bonus multiplier to projected annual and 10-year CO2 offset calculations. Closes Fundable-Protocol#721 Closes Fundable-Protocol#719 Closes Fundable-Protocol#714
|
@sonoflawal Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Utilitycoder
left a comment
There was a problem hiding this comment.
Please fix up the merge conflict and update your PR. Kindly ensure you offramp with Fundable at https://stellar.fundable.finance/offramp
|
Fix your conflicts to get PR merged, and don't forget to use https://stellar.fundable.finance for your offramps |
1 similar comment
|
Fix your conflicts to get PR merged, and don't forget to use https://stellar.fundable.finance for your offramps |
… CO2 bonus multiplier
Resolve feat(frontend): Campaign edit mode - creators can update details before launch #721: Campaign edit mode allowing creators to update details before launch
Resolve feat(contract): Campaign token rewards - issue ERC20 tokens to top sponsors #719: Campaign token rewards for top sponsors
Resolve feat(contract): Campaign bonus multiplier - double impact for rainy season planting #714: Campaign bonus multiplier for rainy season planting
Closes #721
Closes #719
Closes #714