From 72264d6de268fc6b45121cb43c8f766a50e58a1d Mon Sep 17 00:00:00 2001 From: Joey Yandle Date: Fri, 20 Jan 2023 11:44:21 -0500 Subject: [PATCH] define err constants to just be the uints, and explicitly add the err in the function bodies --- .../contracts/sbtc-token-key-admin.clar | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/contrib/sbtc/token-key-admin/contracts/sbtc-token-key-admin.clar b/contrib/sbtc/token-key-admin/contracts/sbtc-token-key-admin.clar index 112afad5891..e65efb8d6f3 100644 --- a/contrib/sbtc/token-key-admin/contracts/sbtc-token-key-admin.clar +++ b/contrib/sbtc/token-key-admin/contracts/sbtc-token-key-admin.clar @@ -15,9 +15,9 @@ ;; constants ;; (define-constant contract-owner tx-sender) -(define-constant err-invalid-caller (err u1)) -(define-constant err-owner-only (err u100)) -(define-constant err-not-token-owner (err u101)) +(define-constant err-invalid-caller u1) +(define-constant err-owner-only u100) +(define-constant err-not-token-owner u101) ;; data vars ;; @@ -32,41 +32,41 @@ (define-public (set-coordinator-data (data {addr: principal, key: (buff 33)})) (if (is-valid-caller) (ok (var-set coordinator (some data))) - err-invalid-caller + (err err-invalid-caller) ) ) (define-public (set-signer-data (id uint) (data {addr: principal, key: (buff 33)})) (if (is-valid-caller) (ok (map-set signers id data)) - err-invalid-caller + (err err-invalid-caller) ) ) (define-public (delete-signer-data (id uint)) (if (is-valid-caller) (ok (map-delete signers id)) - err-invalid-caller + (err err-invalid-caller) ) ) (define-public (mint! (amount uint)) (if (is-valid-caller) (token-credit! tx-sender amount) - err-invalid-caller + (err err-invalid-caller) ) ) (define-public (burn! (amount uint)) (if (is-valid-caller) (token-debit! tx-sender amount) - err-invalid-caller + (err err-invalid-caller) ) ) (define-public (transfer (amount uint) (sender principal) (recipient principal) (memo (optional (buff 34)))) (begin - (asserts! (is-eq tx-sender sender) err-not-token-owner) + (asserts! (is-eq tx-sender sender) (err err-not-token-owner)) (try! (ft-transfer? sbtc amount sender recipient)) (match memo to-print (print to-print) 0x) (ok true)