-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/of 328 replace missionaction with one universal entity in the #76
Merged
george-openformat
merged 9 commits into
staging
from
feature/of-328-replace-missionaction-with-one-universal-entity-in-the
Dec 11, 2024
Merged
Feature/of 328 replace missionaction with one universal entity in the #76
george-openformat
merged 9 commits into
staging
from
feature/of-328-replace-missionaction-with-one-universal-entity-in-the
Dec 11, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
george-openformat
force-pushed
the
feature/of-328-replace-missionaction-with-one-universal-entity-in-the
branch
from
December 10, 2024 14:19
5eb46d4
to
a4d1327
Compare
tinypell3ts
reviewed
Dec 11, 2024
tinypell3ts
reviewed
Dec 11, 2024
tinypell3ts
approved these changes
Dec 11, 2024
nup9151f
approved these changes
Dec 11, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! 👍
george-openformat
deleted the
feature/of-328-replace-missionaction-with-one-universal-entity-in-the
branch
December 11, 2024 16:03
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Reward
entity that aims to replace bothMission
andAction
Cleanup
collectedBadges
entity from schema as it is unusedReasoning
The name
Reward
The name
Reward
has been chosen as it fits the current use case without over abstracting.Event
was considered but it is similar to events in solidity and felt it was quite confusing from a dev perspective. Events also felt too abstract for right now and I didn't want take that name and have to settle for something worse later. I'm more than open to other suggestions on this.Resulting schema
The aim is to improve developer experience by having a less opinionated data structure. By changing the approach in two distinct ways, have the type as a field and don't bundle tokens, we are able to achieve a flat data structure that should be much easier to query against. Moving forward it will be much easier to aggregate also.
The field
rewardType
rewardType
will beMISSION
for missions andACTION
for actions. This should mean we can easily move to using theReward
entity in the api by just changing the queries and not have to change the reward endpoints immediately. We can open it up to anyrewardType
so that devs can decide how they organise their rewards. For examplediscord:mission
,telegram:mission
will let us give more insight into where the rewards were triggered while keepingrewardId
to the "for what"No bundling happens at a subgraph level
An important difference to note is
Missions
currently bundles tokens and badges rewarded in the same transaction so that badges and tokens could be linked to one mission.Rewards
are less opinionated and follow the contract logic on the reward facet exactly.Pros:
Multicall
can now be used to issue lots of different rewards at onceCons:
To add bundling back in I propose we add it at the contract level and then create a parent entity that groups
Reward
entities. Or have an explicit bundling logic that does not hinder the functionality of multicallStaging
I have deployed
v0.1.1-alpha
to staging to help with reviewPlayground ->
Example query