You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: onchain/docs/error-codes.md
+4-5Lines changed: 4 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,9 +18,9 @@ This document lists all error codes raised by the StellarHunts Soroban contracts
18
18
| 10 | AttemptTooSoon |`submit_answer`| The caller is attempting to submit another answer too quickly (rate limit). |
19
19
| 11 | LevelImmutable | - | Reserved for future use (currently defined but not raised). |
20
20
| 12 | ArithmeticOverflow |`add_question`, `submit_answer`, `update_question`| An arithmetic operation would overflow. |
21
-
| 6 | ContractPaused |`claim_level_completion_nft`, `submit_answer`| The contract is paused and cannot accept submissions. |
21
+
| 13 | ContractPaused |`claim_level_completion_nft`, `submit_answer`| The contract is paused and cannot accept submissions. |
22
+
| 14 | WrongQuestion |`submit_answer`| The submitted question is not the next active question in the level index. |
22
23
23
-
**Note:** Code 6 is used for both `NotInitialized` and `ContractPaused`. This is a legacy duplication that should be avoided in new code.
24
24
25
25
## stellar_hunts_nft Error Codes
26
26
@@ -32,9 +32,8 @@ This document lists all error codes raised by the StellarHunts Soroban contracts
32
32
| 4 | InvalidBaseUri |`init`| The provided base URI for metadata is invalid. |
33
33
| 5 | MetadataTooLarge |`init`| The metadata exceeds the maximum allowed size. |
34
34
| 6 | NotInitialized |`mint_level_badge`| The contract is not initialized. |
35
-
|6| ContractPaused |`mint_level_badge`| The contract is paused and cannot mint badges. |
35
+
|7| ContractPaused |`mint_level_badge`| The contract is paused and cannot mint badges. |
36
36
37
-
**Note:** Code 6 is used for both `NotInitialized` and `ContractPaused` in the NFT contract as well. This duplication should be avoided in new code.
38
37
39
38
## Error Code Assignment Guidelines
40
39
@@ -48,7 +47,7 @@ When adding new error codes:
48
47
49
48
## Reserved/Legacy Codes
50
49
51
-
-Code 6 in both contracts is currently used for two different errors (`NotInitialized` and `ContractPaused`). This is a legacy pattern that should not be repeated for new error codes.
50
+
-Error codes are unique within each contract; the NFT contract's `ContractPaused` uses code 7.
0 commit comments