From 2689f961fdefe8cb9bf431a6eb73c46a61f91f16 Mon Sep 17 00:00:00 2001 From: Adam Dunkels Date: Sun, 16 Aug 2020 11:04:27 +0200 Subject: [PATCH] Added define-map definition of claimed-before so that the examplele is self-contained --- src/pages/smart-contracts/principals.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pages/smart-contracts/principals.md b/src/pages/smart-contracts/principals.md index 201dc5d1..d15aaa8b 100644 --- a/src/pages/smart-contracts/principals.md +++ b/src/pages/smart-contracts/principals.md @@ -102,6 +102,10 @@ For example, a smart contract that implements something like a "token faucet" could be implemented as so: ```clarity +(define-map claimed-before + ((sender principal)) + ((claimed bool))) + (define-public (claim-from-faucet) (if (is-none (map-get? claimed-before (tuple (sender tx-sender)))) (let ((requester tx-sender)) ;; set a local variable requester = tx-sender