@@ -4,10 +4,112 @@ use soroban_sdk::contracterror;
44#[ derive( Copy , Clone , Debug , Eq , PartialEq , PartialOrd , Ord ) ]
55#[ repr( u32 ) ]
66pub enum ContractError {
7+ // Core (1–10)
78 AlreadyInitialized = 1 ,
89 NotInitialized = 2 ,
910 InvalidAmount = 3 ,
1011 InvalidFeeBps = 4 ,
12+ Overflow = 5 ,
13+ Unauthorized = 6 ,
14+ ContractPaused = 7 ,
15+ InvalidStatus = 8 ,
16+ TradeNotFound = 9 ,
17+ ArbitratorNotRegistered = 10 ,
18+
19+ // Compliance (11–15)
20+ KycNotVerified = 11 ,
21+ AmlNotCleared = 12 ,
22+ JurisdictionRestricted = 13 ,
23+ TradeAmountLimitExceeded = 14 ,
24+ ComplianceDataMissing = 15 ,
25+
26+ // Fees / Tiers (16–20)
27+ NoFeesToWithdraw = 16 ,
28+ InvalidTierConfig = 17 ,
29+ TierNotFound = 18 ,
30+ InvalidMetadata = 19 ,
31+ MetadataValueTooLong = 20 ,
32+
33+ // Templates (21–26)
34+ TemplateNotFound = 21 ,
35+ TemplateInactive = 22 ,
36+ TemplateNameTooLong = 23 ,
37+ TemplateVersionLimitExceeded = 24 ,
38+ TemplateAmountMismatch = 25 ,
39+ InvalidExpiry = 26 ,
40+
41+ // Arbitrator reputation (27–30)
42+ InvalidRating = 27 ,
43+ AlreadyRated = 28 ,
44+ NoArbitrator = 29 ,
45+ TradeExpired = 30 ,
46+ TradeNotExpired = 31 ,
47+ InvalidSplitBps = 32 ,
48+
49+ // Subscriptions (33–36)
50+ SubscriptionNotFound = 33 ,
51+ SubscriptionExpired = 34 ,
52+ SubscriptionAlreadyActive = 35 ,
53+
54+ // Governance (36–43)
55+ ProposalNotFound = 36 ,
56+ ProposalNotActive = 37 ,
57+ AlreadyVoted = 38 ,
58+ InsufficientVotingPower = 39 ,
59+ ProposalNotPassed = 40 ,
60+ ProposalAlreadyExecuted = 41 ,
61+ VotingEnded = 42 ,
62+
63+ // Privacy (43–45)
64+ PrivacyDataTooLong = 43 ,
65+ DisclosureGrantNotFound = 44 ,
66+ DisclosureUnauthorized = 45 ,
67+
68+ // Migration / Bridge (46–51)
69+ MigrationAlreadyApplied = 46 ,
70+ MigrationVersionMismatch = 47 ,
71+ BridgeOracleNotSet = 48 ,
72+ BridgeTradeExpired = 49 ,
73+ BridgeTradeNotExpired = 50 ,
74+
75+ // Insurance (51–55)
76+ InsuranceProviderNotRegistered = 51 ,
77+ InsurancePremiumTooHigh = 52 ,
78+ TradeNotInsured = 53 ,
79+ InsuranceAlreadyClaimed = 54 ,
80+ InsuranceClaimNotEligible = 55 ,
81+
82+ // Oracle (60–64)
83+ OracleNotFound = 60 ,
84+ OracleAlreadyRegistered = 61 ,
85+ OracleListFull = 62 ,
86+ OracleUnavailable = 63 ,
87+ OraclePriceInvalid = 64 ,
88+
89+ // AMM (70–74)
90+ AmmPoolNotFound = 70 ,
91+ AmmSlippageExceeded = 71 ,
92+ AmmInsufficientShares = 72 ,
93+ AmmInvalidPair = 73 ,
94+ AmmPoolAlreadyExists = 74 ,
95+
96+ // Upgrade (80–85)
97+ UpgradeInProgress = 80 ,
98+ NoUpgradeProposal = 81 ,
99+ UpgradeTimelockActive = 82 ,
100+ NoUpgradeInProgress = 83 ,
101+ RollbackWindowExpired = 84 ,
102+
103+ // Multi-sig arbitration (90–94)
104+ InvalidMultiSigConfig = 90 ,
105+ VotingExpired = 91 ,
106+ VotingNotExpired = 92 ,
107+ NoConsensus = 93 ,
108+
109+ // Social (95–96)
110+ CannotFollowSelf = 95 ,
111+ NotFollowing = 96 ,
112+ }
11113 KycNotVerified = 5 ,
12114 AmlNotCleared = 6 ,
13115 JurisdictionRestricted = 7 ,
@@ -123,4 +225,4 @@ pub enum ContractError {
123225 // Social feature errors (70-74)
124226 CannotFollowSelf = 70 ,
125227 NotFollowing = 71 ,
126- }
228+ }
0 commit comments