Skip to content

Add Cross-Contract Integration Functions #506

@ONEONUORA

Description

@ONEONUORA

Component: Contracts (All) | Effort: 5-7 days | Priority: HIGH

Current State

Contracts exist independently. No cross-contract integration functions.

Missing Functions

Cross-contract integration:

  • InheritanceContract::get_lending_contract() - Get lending contract address
  • InheritanceContract::set_lending_contract() - Set lending contract (admin)
  • InheritanceContract::get_governance_contract() - Get governance contract
  • LendingContract::get_inheritance_contract() - Get inheritance contract
  • LendingContract::verify_plan_ownership() - Verify caller owns plan
  • GovernanceContract::get_controlled_contracts() - List contracts under governance
  • GovernanceContract::execute_on_contract() - Execute governance decision on contract

Why This Matters

  • Integration: Contracts need to communicate
  • Security: Verify cross-contract calls
  • Governance: Governance contract controls other contracts
  • Functionality: Lending needs to verify plan ownership

Tasks

  • Add contract address storage in each contract
  • Implement set_lending_contract() in InheritanceContract
  • Implement set_inheritance_contract() in LendingContract
  • Add set_governance_contract() in all contracts
  • Implement cross-contract verification functions
  • Add verify_plan_ownership() in LendingContract
  • Implement execute_on_contract() in GovernanceContract
  • Add contract registry pattern
  • Implement contract upgrade coordination
  • Add ContractLinked events
  • Add tests for cross-contract calls
  • Document integration architecture

Acceptance Criteria

  • Contracts can reference each other
  • Cross-contract calls work securely
  • Governance can control other contracts
  • Ownership verification works
  • Tests cover integration scenarios
  • Documentation explains architecture

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions