Skip to content

[688] Add cross-contract call safety test for yield#767

Open
ToryMic wants to merge 1 commit into
CalloraOrg:mainfrom
ToryMic:fix/688-add-cross-contract-call-safety-test-for-yield
Open

[688] Add cross-contract call safety test for yield#767
ToryMic wants to merge 1 commit into
CalloraOrg:mainfrom
ToryMic:fix/688-add-cross-contract-call-safety-test-for-yield

Conversation

@ToryMic

@ToryMic ToryMic commented Jul 26, 2026

Copy link
Copy Markdown

Summary

  • Add contracts/yield/tests/xcontract.rs covering deposit_yield when the USDC token callee panics or reverts
  • Transfer USDC before updating the cumulative yield metric so callee failure cannot leave storage ahead of a failed transfer
  • Document the cross-contract safety guarantees in YIELD_DEPOSIT.md

Test plan

  • cargo test -p callora-yield --test xcontract (5 passed)
  • cargo test -p callora-revenue-pool (159 passed)
  • cargo clippy -p callora-yield -p callora-revenue-pool --all-targets -- -D warnings
  • Confirm CI once workflows are approved/run

Closes #688

Made with Cursor

Exercise deposit_yield against a failing USDC callee, transfer before
persisting the cumulative yield metric, and document the safety path.

Co-authored-by: Cursor <cursoragent@cursor.com>
@drips-wave

drips-wave Bot commented Jul 26, 2026

Copy link
Copy Markdown

@ToryMic 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! 🚀

Learn more about application limits

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.

Add cross-contract call safety test for yield

1 participant