-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFractonVesting.clar
41 lines (35 loc) · 980 Bytes
/
FractonVesting.clar
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
(define-data-var vesting-token principal 'ST12345)
(define-map vesting-schedules
{ vesting-location: principal }
{
is-revocable: bool,
duration: uint,
cliff-duration: uint,
interval: uint
}
)
(define-map token-grants
{ grant-holder: principal }
{
vesting-location: principal,
is-active: bool,
was-revoked: bool
}
)
(define-public (withdraw-tokens (beneficiary principal) (amount uint))
(begin
(ft-transfer? fracton-ft amount (as-contract tx-sender) beneficiary)
)
)
(define-public (claim-vesting-tokens (beneficiary principal))
;; Vesting token talebi işlevi
(ok true)
)
(define-public (revoke-grant (grant-holder principal))
;; Grant iptal işlevi
(ok true)
)
;; Sadece sahibi veya belirli bir hesap tarafından çalıştırılabilir işlevleri kontrol eden bir modifier ekleyebiliriz.
(define-read-only (only-owner-or-self (account principal))
(or (is-eq tx-sender (contract-caller)) (is-eq tx-sender account))
)