.derupt-profiles

All .derupt-profile contract activations are logged in .derupt-profiles contract

The following function call is only only callable by .derupt-profile:

  • activate-member

General:

  • The .derupt-profiles contract is for logging user contract activations.

Warning:

  • users should deploy a .derupt-profile contract in app to interact with core features.

  • users should call.derupt-profile

  • users should not call.derupt-core-yyyymmdd (nor logging contracts)

  • users should only enable 1 extension per 1 key function at a time (eg up to 6 active extensions at a time)

In should be noted, users deploy their .derupt-profile contracts to Stacks Mainnet, then their Activation is what is logged in .derupt-profiles events

Work in Progress

;; title: derupt-profiles
;; version: 1.3.1
;; summary: Profiles Contract
;; description: used to log all user .derupt-profile contract activations

(use-trait derupt-profile-trait 'ST1ZK4MRVTQQJMVAAJQWBV2WPQ87QV2851YCTHD7X.derupt-profile-trait.derupt-profile-trait)
;; (use-trait derupt-profile-trait 'MAINNETADDRESS.derupt-profile-trait.derupt-profile-trait)

;; Errors
(define-constant ERR-UNAUTHORIZED (err u100))
(define-constant ERR-NOTFOUND (err u101))
(define-constant ERR-ALREADY-ACTIVATED (err u106))

(define-public (activate-member (contract-address <derupt-profile-trait>)) 
    (let 
        (
            (member-caller (unwrap! (get name (unwrap! (principal-destruct? contract-caller) ERR-NOTFOUND)) ERR-NOTFOUND))
            (member-status (unwrap! (contract-call? contract-address get-activation-status tx-sender) ERR-NOTFOUND))
        )
        (asserts! (is-eq member-caller "derupt-profile") ERR-UNAUTHORIZED)
        (asserts! (is-eq (contract-of contract-address) contract-caller) ERR-UNAUTHORIZED)
        (asserts! (is-eq member-status false) ERR-ALREADY-ACTIVATED)                                 
        (is-ok (contract-call? contract-address registration-activation tx-sender))
        (print {publisher: tx-sender, contract: contract-caller})
        (ok true)
    )
)

Last updated