Skip to content

Issue #1 - Contract: Cross-Chain Asset Data Structures and Enums #732

@ONEONUORA

Description

@ONEONUORA

📝 Description

Implement the core data structures and enums for cross-chain asset support in the inheritance contract.

🎯 Acceptance Criteria

  • Create SupportedChain enum with all supported blockchains
  • Create CrossChainAsset struct for multi-chain asset representation
  • Create BridgeProtocol enum for different bridge protocols
  • Create CrossChainInheritancePlan struct
  • Add validation functions for cross-chain data

🔧 Implementation Details

Required Enums and Structs

#[contracttype]
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum SupportedChain {
    Stellar,
    Ethereum,
    Bitcoin,
    Polygon,
    Arbitrum,
    BinanceSmartChain,
    Avalanche,
}

#[contracttype]
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum BridgeProtocol {
    Allbridge,
    Wormhole,
    LayerZero,
    ChainlinkCCIP,
}

#[contracttype]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct CrossChainAsset {
    pub chain: SupportedChain,
    pub contract_address: Address,
    pub amount: u128,
    pub asset_symbol: String,
    pub bridge_protocol: BridgeProtocol,
}

🧪 Testing Requirements

  • Unit tests for all data structure validation
  • Test enum conversions and comparisons
  • Test struct serialization/deserialization
  • Validate asset symbol length limits
  • Test address format validation

📋 Deliverables

  • Updated lib.rs with new data structures
  • Validation functions for each struct
  • Comprehensive unit tests
  • Documentation for each data type

Estimated effort: 1 day
Difficulty: Beginner-Intermediate

Tags: contract, cross-chain, data-structures, foundation

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official Campaign

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions