forked from TevaLabs/Xelma-Blockchain
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.rs
More file actions
103 lines (97 loc) · 3.99 KB
/
Copy patherrors.rs
File metadata and controls
103 lines (97 loc) · 3.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
// SPDX-License-Identifier: MIT
//! Contract error types for the XLM Price Prediction Market.
use soroban_sdk::contracterror;
/// Contract error types
#[contracterror]
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
#[repr(u32)]
pub enum ContractError {
/// Contract has already been initialized
AlreadyInitialized = 1,
/// Admin address not set - call initialize first
AdminNotSet = 2,
/// Oracle address not set - call initialize first
OracleNotSet = 3,
/// Bet amount must be greater than zero
InvalidBetAmount = 6,
/// No active round exists
NoActiveRound = 7,
/// Round has already ended
RoundEnded = 8,
/// User has insufficient balance
InsufficientBalance = 9,
/// User has already placed a bet in this round
AlreadyBet = 10,
/// Arithmetic overflow occurred
Overflow = 11,
/// Invalid price value
InvalidPrice = 12,
/// Invalid duration value
InvalidDuration = 13,
/// Invalid round mode (must be 0 or 1)
InvalidMode = 14,
/// Wrong prediction type for current round mode
WrongModeForPrediction = 15,
/// Round has not reached end_ledger yet
RoundNotEnded = 16,
/// Oracle data is too old (STALE)
StaleOracleData = 18,
/// Oracle payload round_id doesn't match ActiveRound
InvalidOracleRound = 19,
/// An active round already exists and cannot be overwritten
RoundAlreadyActive = 20,
/// Contract is paused for emergency recovery
ContractPaused = 22,
/// One or more window values exceed configured maximum bounds
WindowOutOfRange = 23,
/// Oracle payload timestamp is in the future
FutureOracleData = 24,
/// Arithmetic overflow in payout accumulation — no funds moved
PayoutOverflow = 25,
/// Round cannot be cancelled (no active round or already resolved)
RoundNotCancellable = 27,
/// Bet amount exceeds the configured maximum stake
StakeExceedsMax = 28,
/// User's cumulative exposure in this round exceeds the configured cap
ExposureCapExceeded = 29,
/// Pending winnings accumulation would exceed the configured cap
PendingWinningsCapExceeded = 30,
/// Start price is outside the allowed range
InvalidStartPrice = 31,
/// Oracle payload nonce was already consumed for this round (replay)
OracleNonceReused = 33,
/// Minimum participants value is out of valid range (must be 1–10000)
InvalidMinParticipants = 35,
/// Precision participant cap is out of range (must be 1–10000)
InvalidPrecisionCap = 38,
/// Precision round has reached the configured participant cap
PrecisionCapExceeded = 39,
/// Oracle final price deviates beyond configured threshold
OracleDeviationExceeded = 41,
/// Stored schema version is unknown or unsupported by this contract build
UnsupportedSchemaVersion = 42,
/// Migration cannot run while a round is active
MigrationActiveRound = 44,
/// Commitment for precision prediction not found
CommitmentNotFound = 45,
/// Precision prediction has already been revealed
AlreadyRevealed = 46,
/// Attempted to reveal prediction outside the valid window
InvalidRevealWindow = 47,
/// Revealed prediction hash does not match committed hash
HashMismatch = 48,
/// Oracle payload network_id does not match the runtime network
OracleNetworkMismatch = 49,
/// Protocol fee bps is outside the allowed range (must be in `1..=MAX_PROTOCOL_FEE_BPS`)
InvalidProtocolFeeBps = 51,
/// Rate limit for minting in the current ledger has been exceeded
MintLimitExceeded = 53,
/// No pending oracle rotation proposal to accept or cancel
NoPendingRotation = 54,
/// Invalid archive retention limit
InvalidArchiveRetention = 62,
/// Commitment hash is malformed (e.g. the all-zero placeholder)
InvalidCommitment = 63,
/// Reveal salt fails minimum entropy rules (all-zero or constant-byte)
InvalidSalt = 64,
}