Skip to content

feat: add shared cross-contract view helpers - #1114

Open
Silver36-ship-it wants to merge 7 commits into
Pulsefy:mainfrom
Silver36-ship-it:ContractsCrossContractViewHelperLibrary
Open

feat: add shared cross-contract view helpers#1114
Silver36-ship-it wants to merge 7 commits into
Pulsefy:mainfrom
Silver36-ship-it:ContractsCrossContractViewHelperLibrary

Conversation

@Silver36-ship-it

Copy link
Copy Markdown

Closes #865

Summary

Describe what changed and why.

Linked Issue

Closes #

Type of Change

  • feat
  • fix
  • docs
  • refactor
  • test
  • chore

Validation

  • Lint passed for affected area(s)
  • Tests passed for affected area(s)
  • Manual verification completed (if applicable)

Documentation

  • Documentation updated (or N/A with explanation)
  • Screenshots/videos attached for UI changes

Checklist

  • Branch name uses feat/, fix/, or docs/
  • Commit messages follow Conventional Commits
  • PR scope matches linked issue acceptance criteria

PR Summary

This PR introduces a shared helper library for safe, reusable cross-contract reads in the Soroban on-chain workspace.

What changed

  • Added a new shared helper crate for cross-contract view calls
  • Implemented reusable helpers for:
    • generic view invocation
    • boolean view reads
    • unsigned integer view reads
  • Updated the project registry contract to use the shared helper for reputation and registration lookups
  • Updated the community curation contract to use the shared helper for reputation and total-reputation reads
  • Standardized error handling by mapping shared view failures into each contract’s own error enum
  • Added documentation describing intended usage and error handling patterns

Why

This removes duplicated cross-contract read logic across modules and provides a consistent approach for safe read-only contract interactions.

Benefits

  • Reduces duplicate code
  • Improves consistency across contracts
  • Standardizes failure handling for cross-contract reads
  • Makes future contract integrations easier to implement safely

Validation

  • Reviewed the updated contract files and helper crate
  • Confirmed the new helper is used by multiple contracts
  • Verified the implementation is scoped to the relevant on-chain contract packages and docs

@drips-wave

drips-wave Bot commented Jul 25, 2026

Copy link
Copy Markdown

@Silver36-ship-it 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

@Cedarich Cedarich left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Kindly fix failing CI

@Cedarich

Copy link
Copy Markdown
Contributor

@Silver36-ship-it

@Cedarich

Copy link
Copy Markdown
Contributor

@Silver36-ship-it

@Cedarich

Copy link
Copy Markdown
Contributor

@Silver36-ship-it

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.

Contracts: Cross-contract view helper library for consistent read patterns

2 participants