From c46a7fd3143062cd8252d83a6919aad27d83d679 Mon Sep 17 00:00:00 2001 From: Adam Dunkels Date: Thu, 13 Aug 2020 16:07:32 +0200 Subject: [PATCH] Fix possible bugs in claim-from-faucet The `claim-from-faucet` function seems to have two minor bugs in it: * the `map-set` function should take three arguments, map-name, tuple_A, and tuple_B, but it seems like it was just taking two arguments * the `err` function seems like it should take a `u1` and not a `1` --- src/pages/smart-contracts/principals.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/smart-contracts/principals.md b/src/pages/smart-contracts/principals.md index f6c03047..201dc5d1 100644 --- a/src/pages/smart-contracts/principals.md +++ b/src/pages/smart-contracts/principals.md @@ -106,9 +106,9 @@ faucet" could be implemented as so: (if (is-none (map-get? claimed-before (tuple (sender tx-sender)))) (let ((requester tx-sender)) ;; set a local variable requester = tx-sender (begin - (map-set claimed-before { sender: requester, claimed: true }) + (map-set claimed-before { sender: requester } { claimed: true }) (as-contract (stx-transfer? u1 tx-sender requester)))) - (err 1))) + (err u1))) ``` In this example, the public function `claim-from-faucet`: