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
add set base uri ;; Set base uri (define-public (set-base-uri (new-base-uri (string-ascii 80))) (begin (asserts! (is-eq tx-sender CONTRACT-OWNER) ERR-NOT-AUTHORIZED) (asserts! (not (var-get metadata-frozen)) ERR-METADATA-FROZEN) (var-set base-uri new-base-uri) (ok true)))
This option provides some more flexibility compared to hard coding the uri yet still makes it immutable after you've checked everything is in order.
Just like in the SP3D6PV2ACBPEKYJTCMH7HEN02KP87QSP8KTEH335.megapont-ape-club-nft (see from line 142 and 150 (and line 019, 037))
Add error
(define-constant ERR-METADATA-FROZEN (err u505))
Add variable
(define-data-var metadata-frozen bool false)
assumes:
(define-data-var base-uri (string-ascii 80) "ipfs://Qmad43sssgNbG9TpC6NfeiTi9X6f9vPYuzgW2S19BEi49m/{id}")
add set base uri
;; Set base uri (define-public (set-base-uri (new-base-uri (string-ascii 80))) (begin (asserts! (is-eq tx-sender CONTRACT-OWNER) ERR-NOT-AUTHORIZED) (asserts! (not (var-get metadata-frozen)) ERR-METADATA-FROZEN) (var-set base-uri new-base-uri) (ok true)))
add Freeze metadata
;; Freeze metadata (define-public (freeze-metadata) (begin (asserts! (is-eq tx-sender CONTRACT-OWNER) ERR-NOT-AUTHORIZED) (var-set metadata-frozen true) (ok true)))
The text was updated successfully, but these errors were encountered: