feature/add-contract-support - #716
Conversation
|
@Bamzy123 is attempting to deploy a commit to the ritik4ever's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Bamzy123 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! 🚀 |
|
Warning Review limit reached
Next review available in: 41 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdds conditional matching grants with sponsor escrow, campaign qualification, capped payouts during claims, unused-fund returns, refunds for failed campaigns, public query methods, tests, and workflow documentation. ChangesConditional matching grants
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Sponsor
participant StellarGoalVaultContract
participant CampaignCreator
participant TokenClient
Sponsor->>StellarGoalVaultContract: create_matching_grant
StellarGoalVaultContract->>TokenClient: Lock max_match_cap in escrow
StellarGoalVaultContract-->>Sponsor: Return grant ID
StellarGoalVaultContract->>StellarGoalVaultContract: claim campaign
StellarGoalVaultContract->>StellarGoalVaultContract: process_campaign_matching_grants
StellarGoalVaultContract->>TokenClient: Transfer capped match
TokenClient-->>CampaignCreator: Release matched funds
StellarGoalVaultContract->>TokenClient: Return unused escrow
TokenClient-->>Sponsor: Refund unused funds
Possibly related issues
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@contracts/Cargo.toml`:
- Around line 19-22: Update the soroban-sdk dependencies in contracts/Cargo.toml
and all workspace manifests from 23.5.2 to a supported major within the two most
recent release majors, keeping the dev-dependency testutils feature intact and
aligning all workspace versions.
In `@contracts/src/matching.rs`:
- Around line 274-277: Update refund_matching_grant so it rejects refunds when
the campaign has already reached grant.min_campaign_target, even after the
deadline and before claim(). Preserve refunds for canceled or expired campaigns
that remain below the target, and ensure a qualifying campaign’s grant remains
available for claim().
In `@workflow.md`:
- Around line 8-21: Add the text language identifier to the fenced diagram block
in workflow.md, changing the opening fence to specify text while preserving the
diagram content unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: f6846f13-ded8-4f72-b122-e1dc6cbbddef
⛔ Files ignored due to path filters (1)
contracts/Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (5)
contracts/Cargo.tomlcontracts/src/lib.rscontracts/src/matching.rscontracts/src/test.rsworkflow.md
| soroban-sdk = "23.5.2" | ||
|
|
||
| [dev-dependencies] | ||
| soroban-sdk = { version = "21.0.0", features = ["testutils"] } | ||
| proptest = "1.4" | ||
| soroban-sdk = { version = "23.5.2", features = ["testutils"] } |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🌐 Web query:
What is the latest soroban-sdk major version and which majors currently receive security fixes?
💡 Result:
As of July 29, 2026, the latest major version of the soroban-sdk is 27 [1][2]. Regarding the support policy, the two most recent major releases are supported with critical security fixes [3][4][5]. While critical security issues may be backported to earlier versions if practical, this is not guaranteed [3][4][5]. General bug fixes and new features are exclusively provided for the latest major release [3][4][5].
Citations:
- 1: https://github.com/stellar/rs-soroban-sdk/releases/tag/v27.0.0
- 2: https://github.com/stellar/rs-soroban-sdk/releases/tag/v27.0.2
- 3: https://docs.rs/crate/soroban-sdk/latest
- 4: https://docs.rs/soroban-sdk/latest/soroban_sdk/
- 5: https://crates.io/crates/soroban-sdk
Lock soroban-sdk to a supported security-fix release.
The supported security-fix window is the two most recent majors; with 27.x current, 23.5.2 is two majors behind and can rely only on backports, not guaranteed fixes. Update contracts/Cargo.toml to a supported major and bump dependency versions across the workspace.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@contracts/Cargo.toml` around lines 19 - 22, Update the soroban-sdk
dependencies in contracts/Cargo.toml and all workspace manifests from 23.5.2 to
a supported major within the two most recent release majors, keeping the
dev-dependency testutils feature intact and aligning all workspace versions.
|
Hi @Bamzy123, This PR could not be merged because it has merge conflicts with the target branch. Please resolve the merge conflicts, push the updated changes, and the PR can be reviewed and merged. Thank you! |
1 similar comment
|
Hi @Bamzy123, This PR could not be merged because it has merge conflicts with the target branch. Please resolve the merge conflicts, push the updated changes, and the PR can be reviewed and merged. Thank you! |
Summary
This PR introduces Conditional Matching Grants to the
stellar-goal-vaultsmart contracts, enabling sponsors to escrow matching funds for campaigns that satisfy predefined funding conditions.Matching grants are released only when a campaign meets the configured minimum funding target. If the campaign does not qualify, any escrowed funds are returned to the sponsor. The implementation also enforces configurable matching ratios and maximum match caps while ensuring unused escrow is refunded appropriately.
Changes Made
Matching Grant Creation
MatchingGrantCreatedevent when a grant is successfully created.Campaign Claim Integration
Matching Grant Refunds
MatchingGrantRefundedevent upon successful refund.Testing
Added comprehensive test coverage to verify:
Impact
Closes #554
Summary by CodeRabbit
New Features
Documentation
Tests