Skip to content

Commit 3d9091b

Browse files
committed
feat: astro rewards on claim
1 parent 21288b4 commit 3d9091b

30 files changed

+1394
-407
lines changed

contracts/alliance-lp-hub/schema/alliance-lp-hub.json

Lines changed: 362 additions & 176 deletions
Large diffs are not rendered by default.

contracts/alliance-lp-hub/schema/raw/execute.json

Lines changed: 88 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -5,47 +5,37 @@
55
{
66
"type": "object",
77
"required": [
8-
"stake"
8+
"modify_asset_pairs"
99
],
1010
"properties": {
11-
"stake": {
12-
"type": "object",
13-
"additionalProperties": false
11+
"modify_asset_pairs": {
12+
"type": "array",
13+
"items": {
14+
"$ref": "#/definitions/ModifyAssetPair"
15+
}
1416
}
1517
},
1618
"additionalProperties": false
1719
},
1820
{
1921
"type": "object",
2022
"required": [
21-
"unstake"
23+
"receive"
2224
],
2325
"properties": {
24-
"unstake": {
25-
"$ref": "#/definitions/AssetBase_for_Addr"
26+
"receive": {
27+
"$ref": "#/definitions/Cw20ReceiveMsg"
2628
}
2729
},
2830
"additionalProperties": false
2931
},
3032
{
3133
"type": "object",
3234
"required": [
33-
"claim_rewards"
34-
],
35-
"properties": {
36-
"claim_rewards": {
37-
"$ref": "#/definitions/AssetInfoBase_for_Addr"
38-
}
39-
},
40-
"additionalProperties": false
41-
},
42-
{
43-
"type": "object",
44-
"required": [
45-
"update_rewards"
35+
"stake"
4636
],
4737
"properties": {
48-
"update_rewards": {
38+
"stake": {
4939
"type": "object",
5040
"additionalProperties": false
5141
}
@@ -55,45 +45,45 @@
5545
{
5646
"type": "object",
5747
"required": [
58-
"whitelist_assets"
48+
"unstake"
5949
],
6050
"properties": {
61-
"whitelist_assets": {
62-
"type": "object",
63-
"additionalProperties": {
64-
"type": "array",
65-
"items": {
66-
"$ref": "#/definitions/AssetInfoBase_for_Addr"
67-
}
68-
}
51+
"unstake": {
52+
"$ref": "#/definitions/AssetBase_for_Addr"
6953
}
7054
},
7155
"additionalProperties": false
7256
},
7357
{
7458
"type": "object",
7559
"required": [
76-
"remove_assets"
60+
"unstake_callback"
7761
],
7862
"properties": {
79-
"remove_assets": {
63+
"unstake_callback": {
8064
"type": "array",
81-
"items": {
82-
"$ref": "#/definitions/AssetInfoBase_for_Addr"
83-
}
65+
"items": [
66+
{
67+
"$ref": "#/definitions/AssetBase_for_Addr"
68+
},
69+
{
70+
"$ref": "#/definitions/Addr"
71+
}
72+
],
73+
"maxItems": 2,
74+
"minItems": 2
8475
}
8576
},
8677
"additionalProperties": false
8778
},
8879
{
8980
"type": "object",
9081
"required": [
91-
"update_rewards_callback"
82+
"claim_rewards"
9283
],
9384
"properties": {
94-
"update_rewards_callback": {
95-
"type": "object",
96-
"additionalProperties": false
85+
"claim_rewards": {
86+
"$ref": "#/definitions/AssetInfoBase_for_Addr"
9787
}
9888
},
9989
"additionalProperties": false
@@ -137,10 +127,10 @@
137127
{
138128
"type": "object",
139129
"required": [
140-
"rebalance_emissions"
130+
"update_rewards"
141131
],
142132
"properties": {
143-
"rebalance_emissions": {
133+
"update_rewards": {
144134
"type": "object",
145135
"additionalProperties": false
146136
}
@@ -150,10 +140,10 @@
150140
{
151141
"type": "object",
152142
"required": [
153-
"rebalance_emissions_callback"
143+
"update_alliance_rewards_callback"
154144
],
155145
"properties": {
156-
"rebalance_emissions_callback": {
146+
"update_alliance_rewards_callback": {
157147
"type": "object",
158148
"additionalProperties": false
159149
}
@@ -325,6 +315,61 @@
325315
}
326316
]
327317
},
318+
"Binary": {
319+
"description": "Binary is a wrapper around Vec<u8> to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec<u8>. See also <https://github.com/CosmWasm/cosmwasm/blob/main/docs/MESSAGE_TYPES.md>.",
320+
"type": "string"
321+
},
322+
"Cw20ReceiveMsg": {
323+
"description": "Cw20ReceiveMsg should be de/serialized under `Receive()` variant in a ExecuteMsg",
324+
"type": "object",
325+
"required": [
326+
"amount",
327+
"msg",
328+
"sender"
329+
],
330+
"properties": {
331+
"amount": {
332+
"$ref": "#/definitions/Uint128"
333+
},
334+
"msg": {
335+
"$ref": "#/definitions/Binary"
336+
},
337+
"sender": {
338+
"type": "string"
339+
}
340+
},
341+
"additionalProperties": false
342+
},
343+
"ModifyAssetPair": {
344+
"type": "object",
345+
"required": [
346+
"asset_distribution",
347+
"asset_info",
348+
"delete"
349+
],
350+
"properties": {
351+
"asset_distribution": {
352+
"$ref": "#/definitions/Uint128"
353+
},
354+
"asset_info": {
355+
"$ref": "#/definitions/AssetInfoBase_for_Addr"
356+
},
357+
"delete": {
358+
"type": "boolean"
359+
},
360+
"reward_asset_info": {
361+
"anyOf": [
362+
{
363+
"$ref": "#/definitions/AssetInfoBase_for_Addr"
364+
},
365+
{
366+
"type": "null"
367+
}
368+
]
369+
}
370+
},
371+
"additionalProperties": false
372+
},
328373
"Uint128": {
329374
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```",
330375
"type": "string"

contracts/alliance-lp-hub/schema/raw/instantiate.json

Lines changed: 71 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,85 @@
33
"title": "InstantiateMsg",
44
"type": "object",
55
"required": [
6+
"alliance_reward_denom",
7+
"astro_incentives_addr",
8+
"astro_reward_denom",
69
"controller",
7-
"governance",
8-
"reward_denom"
10+
"governance"
911
],
1012
"properties": {
11-
"controller": {
13+
"alliance_reward_denom": {
14+
"$ref": "#/definitions/AssetInfoBase_for_Addr"
15+
},
16+
"astro_incentives_addr": {
1217
"type": "string"
1318
},
14-
"governance": {
19+
"astro_reward_denom": {
20+
"$ref": "#/definitions/AssetInfoBase_for_Addr"
21+
},
22+
"controller": {
1523
"type": "string"
1624
},
17-
"reward_denom": {
25+
"governance": {
1826
"type": "string"
1927
}
2028
},
21-
"additionalProperties": false
29+
"additionalProperties": false,
30+
"definitions": {
31+
"Addr": {
32+
"description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.",
33+
"type": "string"
34+
},
35+
"AssetInfoBase_for_Addr": {
36+
"description": "Represents the type of an fungible asset\n\nEach **asset info** instance can be one of three variants:\n\n- Native SDK coins. To create an **asset info** instance of this type, provide the denomination. - CW20 tokens. To create an **asset info** instance of this type, provide the contract address. - CW1155 tokens. To create an **asset info** instance of this type, provide the contract address and token ID.",
37+
"oneOf": [
38+
{
39+
"type": "object",
40+
"required": [
41+
"native"
42+
],
43+
"properties": {
44+
"native": {
45+
"type": "string"
46+
}
47+
},
48+
"additionalProperties": false
49+
},
50+
{
51+
"type": "object",
52+
"required": [
53+
"cw20"
54+
],
55+
"properties": {
56+
"cw20": {
57+
"$ref": "#/definitions/Addr"
58+
}
59+
},
60+
"additionalProperties": false
61+
},
62+
{
63+
"type": "object",
64+
"required": [
65+
"cw1155"
66+
],
67+
"properties": {
68+
"cw1155": {
69+
"type": "array",
70+
"items": [
71+
{
72+
"$ref": "#/definitions/Addr"
73+
},
74+
{
75+
"type": "string"
76+
}
77+
],
78+
"maxItems": 2,
79+
"minItems": 2
80+
}
81+
},
82+
"additionalProperties": false
83+
}
84+
]
85+
}
86+
}
2287
}

0 commit comments

Comments
 (0)