Skip to content

refactor: align contracts with standardized interface traits (#574)#692

Merged
Jagadeeshftw merged 1 commit intoJagadeeshftw:masterfrom
Chucks1093:refactor/align-with-standard-interface-traits
Feb 27, 2026
Merged

refactor: align contracts with standardized interface traits (#574)#692
Jagadeeshftw merged 1 commit intoJagadeeshftw:masterfrom
Chucks1093:refactor/align-with-standard-interface-traits

Conversation

@Chucks1093
Copy link
Contributor

Closes #574

Changes

  • contracts/bounty_escrow/contracts/escrow/src/traits.rs

    • Added PauseInterface and FeeInterface alongside existing escrow/upgrade traits
    • Added canonical operation symbol helpers (op_lock, op_release, op_refund)
    • Added trait/spec alignment documentation in module docs
  • contracts/bounty_escrow/contracts/escrow/src/lib.rs

    • BountyEscrowContract now explicitly implements:
      • EscrowInterface
      • UpgradeInterface
      • PauseInterface
      • FeeInterface
    • New trait impls delegate to existing concrete methods (no intended behavior changes)
  • soroban/contracts/escrow/src/lib.rs + soroban/contracts/escrow/src/traits.rs

    • Added local EscrowInterface and UpgradeInterface definitions and implementations
    • Added get_balance and get_escrow_info public methods to match expected standardized surface
    • Aligns this escrow variant with the main bounty escrow interface from a consumer/view perspective
  • contracts/grainlify-core/src/lib.rs

    • Added local UpgradeInterface trait and implementation for GrainlifyContract
    • Kept feature-gating aligned with existing "contract"-gated contract pattern
  • contracts/view-facade/src/lib.rs + contracts/view-facade/src/test.rs

    • Implemented ViewFacade contract for cross-contract discovery
    • Admin-gated write operations: register, deregister
    • Public read operations: list_contracts, get_contract, contract_count
    • Added/updated tests for current view-facade API

Testing

  • contracts/bounty_escrow/contracts/escrow

    • cargo fmt --check --all
    • cargo build --release --target wasm32v1-none
    • cargo test --verbose --lib
    • cargo test --verbose --lib invariant_checker_ci
  • contracts/grainlify-core

    • cargo test --lib
    • cargo test --lib test::e2e_upgrade_migration_tests -- --nocapture --test-threads=1
    • cargo test --lib test::upgrade_rollback_tests -- --nocapture --test-threads=1
  • contracts/view-facade

    • cargo test --lib

Notes

  • Traits are currently defined locally per crate to avoid introducing dependency cycles in the current workspace layout.
  • If a shared interfaces crate (for example grainlify-interfaces) is introduced later, these local traits can be replaced by re-exports.
  • Some migration/rollback tests in grainlify-core were updated to match current implemented migration semantics (same-version migration is rejected by guard checks).

@vercel
Copy link

vercel bot commented Feb 26, 2026

@Chucks1093 is attempting to deploy a commit to the Jagadeesh B's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Jagadeeshftw
Copy link
Owner

please resolve the conflicts

@Chucks1093
Copy link
Contributor Author

Am working on it

@Chucks1093 Chucks1093 force-pushed the refactor/align-with-standard-interface-traits branch from 980193e to 1157f27 Compare February 26, 2026 09:15
@Chucks1093
Copy link
Contributor Author

@Jagadeeshftw merge conflicts have been resolved. Please merge .

@Jagadeeshftw
Copy link
Owner

@Chucks1093 Can you please resolve the conflicts?

- Expanded traits.rs: added PauseInterface and FeeInterface with full
  doc comments referencing Grainlify internal spec
- BountyEscrowContract now formally implements all four traits
  (EscrowInterface, UpgradeInterface, PauseInterface, FeeInterface)
- soroban/contracts/escrow: added local EscrowInterface + UpgradeInterface
  trait definitions and implementations; added get_balance and
  get_escrow_info to satisfy standard surface
- grainlify-core: added local UpgradeInterface trait and impl for
  GrainlifyContract (feature-gated to match existing contract gate)
- contracts/view-facade: implemented ViewFacade contract with
  register/deregister/list/get_contract for cross-contract discovery
@Chucks1093 Chucks1093 force-pushed the refactor/align-with-standard-interface-traits branch from 1157f27 to 8acf9ef Compare February 27, 2026 08:06
@Chucks1093
Copy link
Contributor Author

@Jagadeeshftw pls merge this

@Chucks1093
Copy link
Contributor Author

@Jagadeeshftw pls review and merge this

@Chucks1093
Copy link
Contributor Author

@Jagadeeshftw please review and merge

@Chucks1093
Copy link
Contributor Author

@Jagadeeshftw

@Jagadeeshftw Jagadeeshftw merged commit 9230be3 into Jagadeeshftw:master Feb 27, 2026
1 of 4 checks 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.

Align Contracts with Standardized Interface Traits

2 participants