Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions sample-contracts/tokens-ft-mint.clar
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(begin
(as-contract
(contract-call? 'S1G2081040G2081040G2081040G208105NK8PE5.tokens-ft mint! u100)
)
)
16 changes: 16 additions & 0 deletions sample-contracts/tokens-ft.clar
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
(define-fungible-token tokens)
(define-private (get-balance (account principal))
(ft-get-balance tokens account))

(define-private (token-credit! (account principal) (amount uint))
(ft-mint? tokens amount account))

(define-public (token-transfer (to principal) (amount uint))
(ft-transfer? tokens amount tx-sender to))

(define-public (mint! (amount uint))
(token-credit! tx-sender amount))

(token-credit! tx-sender u10300)
(token-transfer 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR u10000)
(token-transfer 'SM2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQVX8X0G u300)
2 changes: 1 addition & 1 deletion sample-contracts/tokens-mint.clar
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
(as-contract
(contract-call? 'S1G2081040G2081040G2081040G208105NK8PE5.tokens mint! u100)
)
)
)
Loading