forked from SiLioLabs/PayFlow
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.rs
More file actions
71 lines (70 loc) · 3.31 KB
/
Copy patherrors.rs
File metadata and controls
71 lines (70 loc) · 3.31 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
use soroban_sdk::contracterror;
#[contracterror]
#[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord)]
#[repr(u32)]
pub enum ContractError {
/// Returned when attempting to initialize a contract that has already been initialized
AlreadyInitialized = 1,
/// Returned when a payment or subscription amount is not positive
AmountMustBePositive = 2,
/// Returned when a subscription interval is not positive
IntervalMustBePositive = 3,
/// Returned when no subscription exists for a given user and token
NoSubscriptionFound = 4,
/// Returned when attempting to charge an inactive subscription
SubscriptionInactive = 5,
/// Returned when attempting to charge before the interval has elapsed
IntervalNotElapsed = 6,
/// Returned when attempting to use contract functionality before initialization
NotInitialized = 7,
/// Returned when the user has insufficient token allowance for payment
InsufficientAllowance = 8,
/// Returned when the grace period for a subscription has elapsed
GracePeriodElapsed = 9,
/// Returned when a merchant is not whitelisted
MerchantNotWhitelisted = 10,
/// Returned when a user attempts to refer themselves
SelfReferral = 11,
/// Returned when the token address is not a contract
InvalidTokenAddress = 12,
/// Returned when fee basis points exceed 10000
InvalidFeeBps = 13,
/// Returned when the metadata label exceeds the 64-byte length limit
MetadataLabelTooLong = 14,
/// Returned when a payment amount is greater than the configured maximum
AmountExceedsMaximum = 15,
/// Returned when attempting to operate on a subscription that is not active
SubscriptionNotActive = 16,
/// Returned when attempting to operate on a subscription that is paused
SubscriptionPaused = 17,
/// Returned when the contract has been paused by admin
ContractPaused = 18,
/// Returned when a subscription interval is below the minimum permitted floor
IntervalTooShort = 19,
/// Returned when the batch size exceeds the maximum allowed
BatchTooLarge = 20,
/// Returned when a merchant attempts to withdraw with no accrued revenue
ZeroBalanceAvailable = 21,
/// Returned when attempting to subscribe to a frozen merchant
MerchantFrozen = 22,
/// Returned when a two-step commit is attempted without a pending proposal
NoPendingProposal = 23,
/// Returned when attempting to transfer to an address that already has an active subscription
SubscriptionAlreadyActive = 24,
/// Returned when a pay_per_use call would exceed the user's daily spending limit
DailyLimitExceeded = 25,
/// Returned when the fee collector address is invalid (e.g. the contract's own address)
InvalidFeeCollector = 26,
/// Returned when pause_until expiry_timestamp is not strictly in the future
InvalidPauseExpiry = 27,
GlobalVolumeExceeded = 28,
/// Returned when a configured batch limit is invalid
InvalidBatchSize = 29,
ContractPausedError = 30,
/// Returned when a provided recipient address is invalid (e.g., contract address)
InvalidRecipient = 32,
/// Returned when a configured global volume cap is not positive
InvalidVolumeCap = 33,
/// Returned when configured fee bounds are inconsistent (min > max, or max > 10000)
InvalidFeeBounds = 34,
}