;; @contract Recover
;; @version 1
;;-------------------------------------
;; Constants
;;-------------------------------------
(define-constant ERR_NOT_BLACKLISTED (err u7001))
;;-------------------------------------
;; Recover
;;-------------------------------------
(define-public (recover-usdh (address principal) (recipient principal))
(let (
(balance (unwrap-panic (contract-call? .test-usdh-token-final get-balance address)))
)
(try! (contract-call? .test-hq check-is-enabled))
(try! (contract-call? .test-hq check-is-protocol tx-sender))
(try! (contract-call? .test-usdh-token-final burn-for-protocol balance address))
(ok (try! (contract-call? .test-usdh-token-final mint-for-protocol balance recipient)))
)
)
(define-public (recover-susdh (address principal) (recipient principal))
(let (
(balance (unwrap-panic (contract-call? .test-susdh-token-final get-balance address)))
)
(try! (contract-call? .test-hq check-is-enabled))
(try! (contract-call? .test-hq check-is-protocol tx-sender))
(if (contract-call? .test-susdh-token-final get-blacklist-enabled)
(begin
(try! (contract-call? .test-blacklist-susdh check-is-not-full-blacklist recipient))
(asserts! (contract-call? .test-blacklist-susdh get-full-blacklist address) ERR_NOT_BLACKLISTED)
)
true
)
(try! (contract-call? .test-susdh-token-final burn-for-protocol balance address))
(ok (try! (contract-call? .test-susdh-token-final mint-for-protocol balance recipient)))
)
)