Skip to content

Commit

Permalink
docs: ticked payload of reward grant
Browse files Browse the repository at this point in the history
  • Loading branch information
scorpioborn committed Dec 11, 2023
1 parent b30c4be commit 5a56f8e
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 6 deletions.
6 changes: 3 additions & 3 deletions docs/specs/Reward/02_Concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ This reward can be given when a user is creating an account by signing up in sys

#### **2. Referral**

This reward can be given when a user is referring another new user to the system, the referrer and referee reward is in `subaccount` balance and can be used for betting or be the house functionalities.
This reward can be given when a user is referred by another user to the system, the referee reward is in `subaccount` balance and can be used for betting or be the house functionalities.

#### **3. Affiliation**
### **Referral**

This reward can be given when an influencer or advertisement entity brings an amount of attention to the platform, responsible user account will be rewarded.
This reward can be given when a user is referring another new user to the system, the referrer reward is in `subaccount` balance and can be used for betting or be the house functionalities.
2 changes: 1 addition & 1 deletion docs/specs/Reward/03_Accounts.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

There is one account in the Reward module.

- Reward Pool: This account holds the reward amount transferred from the campaign `funder` to the `reward_pool` module account.
- Reward Pool: This account holds the reward amount transferred from the campaign `promoter` to the `reward_pool` module account.

During the campaign creation the pool amount will be transferred to the reward pool module account.

Expand Down
107 changes: 105 additions & 2 deletions docs/specs/Reward/06_Messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,118 @@ message MsgGrantReward {
message MsgApplyRewardResponse {}
```

### **Sample Grant Reward ticket**
### MsgGrantRewardTicket Payloads

#### Common ticket payload type

This is a common type that should be present in all of the ticket payloads

```proto
// RewardPayloadCommon
message RewardPayloadCommon {
// receiver is the address of the account that receives the reward.
string receiver = 1;
// source_uid is the address of the source.
// It is used to identify the source of the reward.
// For example, the source uid of a referral signup reward is the address of
// the referer.
string source_uid = 2 [
(gogoproto.customname) = "SourceUID",
(gogoproto.jsontag) = "source_uid",
json_name = "source_uid"
];
// meta is the metadata of the campaign.
// It is a stringified base64 encoded json.
string meta = 3;
}
```

#### **1. Individual Signup**

```proto
// GrantSignupRewardPayload is the type for signup reward grant payload.
message GrantSignupRewardPayload {
// common is the common properties of a reward
RewardPayloadCommon common = 2 [ (gogoproto.nullable) = false ];
}
```

##### **Sample Signup Grant Reward ticket**

The `source_uid` should be empty.

```json
{
"common": {
"receiver": "sge1rk85ptmy3gkphlp6wyvuee3lyvz88q6x59jelc",
"source_uid": "",
"meta": "custom grant metadata"
},
"exp": 1667863498866062000,
"iat": 1667827498,
"iss": "Oracle",
"sub": "GrantReward"
}
```

#### **2. Referral Sign Up**

The `source_uid` is the address of the referrer.

```proto
// GrantSignupRewardPayload is the type for signup reward grant payload.
message GrantSignupRewardPayload {
// common is the common properties of a reward
RewardPayloadCommon common = 2 [ (gogoproto.nullable) = false ];
}
```

### **Sample Referral Signup Grant Reward ticket**

```json
{
"common": {
"receiver": "sge1rk85ptmy3gkphlp6wyvuee3lyvz88q6x59jelc",
"source_uid": "{account address of the referrer}",
"meta": "custom grant metadata"
},
"exp": 1667863498866062000,
"iat": 1667827498,
"iss": "Oracle",
"sub": "GrantReward"
}
```

#### **2. Referral**

- The `source_uid` should be empty.
- The `referee` should contain the address of referee who already claimed their signup referral reward.

```proto
// GrantSignupReferrerRewardPayload is the type for signup referrer reward grant
// payload.
message GrantSignupReferrerRewardPayload {
// common is the common properties of a reward
RewardPayloadCommon common = 1 [ (gogoproto.nullable) = false ];
// referee is the address of the account that used this referrer address as
// source_uid
string referee = 2;
}
```

#### **Sample Referral Grant Reward ticket**

```json
{
"common": {
"receiver": "sge1rk85ptmy3gkphlp6wyvuee3lyvz88q6x59jelc",
"source_uid": "source uid",
"source_uid": "",
"meta": "custom grant metadata"
},
"referee": "{account address of the referee who has already claimed their reward}",
"exp": 1667863498866062000,
"iat": 1667827498,
"iss": "Oracle",
Expand Down

0 comments on commit 5a56f8e

Please sign in to comment.