We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bf69bbf commit 6c85b47Copy full SHA for 6c85b47
1 file changed
stacks/contracts/wormhole-core-state.clar
@@ -185,7 +185,8 @@
185
(let ((registration (try! (contract-call? .addr32 register emitter)))
186
(sequence (default-to u0 (emitter-sequence-get emitter))))
187
;; If `sequence` has reached its limit we cannot continue
188
- (asserts! (< sequence MAX_VALUE_U64) ERR_STATE_OVERFLOW_SEQUENCE)
+ (asserts! (<= sequence MAX_VALUE_U64) ERR_STATE_OVERFLOW_SEQUENCE)
189
+ ;; This is SAFE and won't overflow since `sequence` is a `u128`
190
(map-set emitter-sequence emitter (+ sequence u1))
191
(ok (merge
192
registration
0 commit comments