Skip to content

Commit

Permalink
feat: astro rewards on claim
Browse files Browse the repository at this point in the history
  • Loading branch information
emidev98 committed Feb 7, 2024
1 parent 21288b4 commit 3d9091b
Show file tree
Hide file tree
Showing 30 changed files with 1,394 additions and 407 deletions.
538 changes: 362 additions & 176 deletions contracts/alliance-lp-hub/schema/alliance-lp-hub.json

Large diffs are not rendered by default.

131 changes: 88 additions & 43 deletions contracts/alliance-lp-hub/schema/raw/execute.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,47 +5,37 @@
{
"type": "object",
"required": [
"stake"
"modify_asset_pairs"
],
"properties": {
"stake": {
"type": "object",
"additionalProperties": false
"modify_asset_pairs": {
"type": "array",
"items": {
"$ref": "#/definitions/ModifyAssetPair"
}
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"unstake"
"receive"
],
"properties": {
"unstake": {
"$ref": "#/definitions/AssetBase_for_Addr"
"receive": {
"$ref": "#/definitions/Cw20ReceiveMsg"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"claim_rewards"
],
"properties": {
"claim_rewards": {
"$ref": "#/definitions/AssetInfoBase_for_Addr"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"update_rewards"
"stake"
],
"properties": {
"update_rewards": {
"stake": {
"type": "object",
"additionalProperties": false
}
Expand All @@ -55,45 +45,45 @@
{
"type": "object",
"required": [
"whitelist_assets"
"unstake"
],
"properties": {
"whitelist_assets": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"$ref": "#/definitions/AssetInfoBase_for_Addr"
}
}
"unstake": {
"$ref": "#/definitions/AssetBase_for_Addr"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"remove_assets"
"unstake_callback"
],
"properties": {
"remove_assets": {
"unstake_callback": {
"type": "array",
"items": {
"$ref": "#/definitions/AssetInfoBase_for_Addr"
}
"items": [
{
"$ref": "#/definitions/AssetBase_for_Addr"
},
{
"$ref": "#/definitions/Addr"
}
],
"maxItems": 2,
"minItems": 2
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"update_rewards_callback"
"claim_rewards"
],
"properties": {
"update_rewards_callback": {
"type": "object",
"additionalProperties": false
"claim_rewards": {
"$ref": "#/definitions/AssetInfoBase_for_Addr"
}
},
"additionalProperties": false
Expand Down Expand Up @@ -137,10 +127,10 @@
{
"type": "object",
"required": [
"rebalance_emissions"
"update_rewards"
],
"properties": {
"rebalance_emissions": {
"update_rewards": {
"type": "object",
"additionalProperties": false
}
Expand All @@ -150,10 +140,10 @@
{
"type": "object",
"required": [
"rebalance_emissions_callback"
"update_alliance_rewards_callback"
],
"properties": {
"rebalance_emissions_callback": {
"update_alliance_rewards_callback": {
"type": "object",
"additionalProperties": false
}
Expand Down Expand Up @@ -325,6 +315,61 @@
}
]
},
"Binary": {
"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>.",
"type": "string"
},
"Cw20ReceiveMsg": {
"description": "Cw20ReceiveMsg should be de/serialized under `Receive()` variant in a ExecuteMsg",
"type": "object",
"required": [
"amount",
"msg",
"sender"
],
"properties": {
"amount": {
"$ref": "#/definitions/Uint128"
},
"msg": {
"$ref": "#/definitions/Binary"
},
"sender": {
"type": "string"
}
},
"additionalProperties": false
},
"ModifyAssetPair": {
"type": "object",
"required": [
"asset_distribution",
"asset_info",
"delete"
],
"properties": {
"asset_distribution": {
"$ref": "#/definitions/Uint128"
},
"asset_info": {
"$ref": "#/definitions/AssetInfoBase_for_Addr"
},
"delete": {
"type": "boolean"
},
"reward_asset_info": {
"anyOf": [
{
"$ref": "#/definitions/AssetInfoBase_for_Addr"
},
{
"type": "null"
}
]
}
},
"additionalProperties": false
},
"Uint128": {
"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); ```",
"type": "string"
Expand Down
77 changes: 71 additions & 6 deletions contracts/alliance-lp-hub/schema/raw/instantiate.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,85 @@
"title": "InstantiateMsg",
"type": "object",
"required": [
"alliance_reward_denom",
"astro_incentives_addr",
"astro_reward_denom",
"controller",
"governance",
"reward_denom"
"governance"
],
"properties": {
"controller": {
"alliance_reward_denom": {
"$ref": "#/definitions/AssetInfoBase_for_Addr"
},
"astro_incentives_addr": {
"type": "string"
},
"governance": {
"astro_reward_denom": {
"$ref": "#/definitions/AssetInfoBase_for_Addr"
},
"controller": {
"type": "string"
},
"reward_denom": {
"governance": {
"type": "string"
}
},
"additionalProperties": false
"additionalProperties": false,
"definitions": {
"Addr": {
"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.",
"type": "string"
},
"AssetInfoBase_for_Addr": {
"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.",
"oneOf": [
{
"type": "object",
"required": [
"native"
],
"properties": {
"native": {
"type": "string"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"cw20"
],
"properties": {
"cw20": {
"$ref": "#/definitions/Addr"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"cw1155"
],
"properties": {
"cw1155": {
"type": "array",
"items": [
{
"$ref": "#/definitions/Addr"
},
{
"type": "string"
}
],
"maxItems": 2,
"minItems": 2
}
},
"additionalProperties": false
}
]
}
}
}
Loading

0 comments on commit 3d9091b

Please sign in to comment.