mirror of
https://github.com/zhigang1992/liquid-stacking.git
synced 2026-04-29 20:46:33 +08:00
34 lines
1.0 KiB
Plaintext
34 lines
1.0 KiB
Plaintext
(define-constant err-unauthorised (err u10000))
|
|
|
|
(define-map authorised-managers principal bool)
|
|
(map-set authorised-managers tx-sender true)
|
|
|
|
(define-read-only (is-dao-or-extension)
|
|
(ok (asserts! (or (is-eq tx-sender .lisa-dao) (contract-call? .lisa-dao is-extension contract-caller)) err-unauthorised))
|
|
)
|
|
|
|
(define-read-only (is-authorised-manager (who principal))
|
|
(default-to false (map-get? authorised-managers who))
|
|
)
|
|
|
|
(define-public (fund-strategy (amounts (list 20 uint)))
|
|
(begin
|
|
(asserts! (is-authorised-manager tx-sender) err-unauthorised)
|
|
(contract-call? .vault fund-strategy .fastpool-strategy (unwrap-panic (to-consensus-buff? amounts)))
|
|
)
|
|
)
|
|
|
|
(define-public (refund-strategy (selection (list 20 bool)))
|
|
(begin
|
|
(asserts! (is-authorised-manager tx-sender) err-unauthorised)
|
|
(contract-call? .vault refund-strategy .fastpool-strategy (unwrap-panic (to-consensus-buff? selection)))
|
|
)
|
|
)
|
|
|
|
(define-public (set-authorised-manager (who principal) (enabled bool))
|
|
(begin
|
|
(try! (is-dao-or-extension))
|
|
(ok (map-set authorised-managers who enabled))
|
|
)
|
|
)
|