participantgroup #lightblue Voting Contract participantgroup Methods boundary "createVote()" as create_vote boundary "voteResults()" as voting_vote_result end participantgroup Data database "Params" as voting_params end end participantgroup #lightyellow Vote Contract participantgroup Methods boundary "vote()" as vote end participantgroup Data database "Votes" as votes end end participantgroup #pink Forum Contract participantgroup Methods boundary "post()" as post boundary "voteResult()" as forum_vote_result end participantgroup Data database "Params" as forum_params end end participantgroup #orange Post\nContract participantgroup Data database "Posts" as posts end end participantgroup #lightgreen Operating Accounts participant "Reputation\nNFT" as rep participant "Reviewer" as reviewer participant "Public" as public end activate voting_params activate forum_params activate rep group Author a post public -> post : post() activate public activate post post<-forum_params:Read param values post -> posts : Create post instance;\nInitialize with current\nparam values activate posts posts->posts:Reference\nother posts deactivate post deactivate public end group Initiate a vote reviewer -> create_vote : createVote() activate reviewer activate create_vote create_vote<-voting_params:Read params create_vote -> votes : Create vote instance;\nInitialize with current\nparam values activate votes votes -> posts : Reference a post deactivate create_vote deactivate reviewer end group Cast a vote reviewer->vote:vote() activate vote activate reviewer vote<-votes:Read prior votes rep->vote:Read voter reputations vote->vote:Evaluate\nterminating\nconditions end alt Voting terminates, according to params alt Voting param change posts->vote:Read post contents vote->voting_vote_result:voteResult() voting_vote_result ->voting_params : Update\nparams end votes->forum_vote_result:voteResult() activate forum_vote_result posts ->forum_vote_result : Read post contents forum_vote_result<-forum_params:Read params alt Forum param change forum_vote_result -> forum_params : Update\nparams end forum_vote_result<-rep:Read authors reputations forum_vote_result->rep:Mint reputation for post / authors / references deactivate forum_vote_result activate rep votes->rep:Mint reputation for vote winners activate rep end vote->votes:Update\nvote\nrecord deactivate vote deactivate reviewer