-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathsrc20-trait.clar
More file actions
24 lines (19 loc) · 821 Bytes
/
src20-trait.clar
File metadata and controls
24 lines (19 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
;; Time for a Stacks Request for Comment, the 20th edition...
;; The function needed by tokens compatible with swapr, and the geyser
;; a subset of ERC20 methods
(define-trait src20-trait
(
;; Transfer from the caller to a new principal
(transfer (principal uint) (response bool uint))
;; the human readable name of the token
(name () (response (string-ascii 32) uint))
;; the ticker symbol, or empty if none
(symbol () (response (string-ascii 32) uint))
;; the number of decimals used, e.g. 6 would mean 1_000_000 represents 1 token
(decimals () (response uint uint))
;; the balance of the passed principal
(balance-of (principal) (response uint uint))
;; the current total supply (which does not need to be a constant)
(total-supply () (response uint uint))
)
)