Professionalization
The Expert contract allows users to professionalize as experts...
The Expert
contract provides the platform with a complete system for managing experts and subscribers. It allows users to professionalize as experts, set subscription fees, and manage subscription services.
Contract Features
The Expert contract provides an expert system that allows users to apply to become experts, subscribe to experts, renew expert subscriptions, and manage subscription relationships.
The Variables
expertTotal
: Total number of experts.TOKEN
: Token contract address.feeTo
: Address for fees.applyExpertFee
: Mapping of fees for applying to become an expert.expertList
: List of all experts.experts
: Stores detailed information of each expert.expert2Bool
: Indicates whether an address is an expert.expert2Subscribe
: Mapping of user subscription statuses.expertToFans
: List of subscribers for each expert.fanToSubscribedExperts
: List of experts subscribed to by a user.maturityTime
: Stores subscription expiration times.
The Functions
Events
ApplyExpert
: Triggered when applying to become an expert.CollectSubscriptionFee
: Triggered when an expert collects subscription fees.Subscribe
: Triggered when a user subscribes to an expert.
Initialization Function
initialize
: Initializes the contract, setting the token and fee addresses.
Management Functions
updateToken
: Updates the token contract address.updateFeeTo
: Updates the fee address.
Expert Application and Renewal
applyExpert
: User applies to become an expert, requiring payment of the respective fee.updateApplyExpertFee
: Admin updates the fee for applying to become an expert.updateSubscriptionFee
: Expert updates their own subscription fee.expertRenewal
: Expert renews their subscription.
User Subscription
subscribe
: User subscribes to an expert, requiring payment of the subscription fee.
Queries and Revenue Collection
getExpertFans
: Retrieves the list of an expert's subscribers.getFanSubscriptions
: Retrieves the list of experts a user has subscribed to.getAllExpert
: Retrieves information on all experts.collectSubscriptionFee
: Expert collects their subscription fees.getExpert2Subscribe
: Retrieves a user's subscription status for an expert.getExpertInfo
: Retrieves detailed information about an expert.
Logic
Users can apply to become an expert using the
applyExpert
function, which requires payment of a fee and setting their subscription fee.Experts can update their subscription fee using the
updateSubscriptionFee
function.Users can subscribe to experts using the
subscribe
function, pay the corresponding subscription fee, and renew their subscription throughexpertRenewal
.Experts can collect their subscription fees using the
collectSubscriptionFee
function. The contract provides a series of query functions to facilitate users and experts in querying relevant information.
Interface
Last updated