Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: remove asserts, errors
  • Loading branch information
reedrosenbluth committed Jun 17, 2021
commit fc1435480a810519a7c289c4625c47bcf9d5edec
6 changes: 2 additions & 4 deletions examples/billboard/contracts/billboard.clar
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

;; error consts
(define-constant ERR_STX_TRANSFER u0)
(define-constant ERR_SET_MESSAGE u1)
(define-constant ERR_SET_PRICE u2)

;; data vars
(define-data-var billboard-message (string-utf8 500) u"Hello World!")
Expand All @@ -26,10 +24,10 @@
(unwrap! (stx-transfer? cur-price tx-sender (as-contract tx-sender)) (err ERR_STX_TRANSFER))

;; update the billboard's message
(asserts! (var-set billboard-message message) (err ERR_SET_MESSAGE))
(var-set billboard-message message)

;; update the price of setting a message
(asserts! (var-set price new-price) (err ERR_SET_PRICE))
(var-set price new-price)

;; return the updated price
(ok new-price)
Expand Down