Skip to content
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

feat: vesting and vault interface #18

Merged
merged 18 commits into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions contracts/vesting-lp/schema/raw/query.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,20 @@
},
"additionalProperties": false
},
{
"description": "VestingState returns the current vesting state.",
"type": "object",
"required": [
"vesting_state"
],
"properties": {
"vesting_state": {
"type": "object",
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"description": "Returns list of vesting managers (the persons who are able to add/remove vesting schedules)",
"type": "object",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
],
"properties": {
"released_amount": {
"description": "The total amount of ASTRO already claimed",
"description": "The total amount of vested already claimed",
"allOf": [
{
"$ref": "#/definitions/Uint128"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
],
"properties": {
"released_amount": {
"description": "The total amount of ASTRO already claimed",
"description": "The total amount of vested already claimed",
"allOf": [
{
"$ref": "#/definitions/Uint128"
Expand Down
14 changes: 14 additions & 0 deletions contracts/vesting-lp/schema/raw/response_to_vesting_managers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Array_of_Addr",
"type": "array",
"items": {
"$ref": "#/definitions/Addr"
},
"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"
}
}
}
53 changes: 51 additions & 2 deletions contracts/vesting-lp/schema/vesting-lp.json
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,20 @@
},
"additionalProperties": false
},
{
"description": "VestingState returns the current vesting state.",
"type": "object",
"required": [
"vesting_state"
],
"properties": {
"vesting_state": {
"type": "object",
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"description": "Returns list of vesting managers (the persons who are able to add/remove vesting schedules)",
"type": "object",
Expand Down Expand Up @@ -679,7 +693,7 @@
],
"properties": {
"released_amount": {
"description": "The total amount of ASTRO already claimed",
"description": "The total amount of vested already claimed",
"allOf": [
{
"$ref": "#/definitions/Uint128"
Expand Down Expand Up @@ -815,7 +829,7 @@
],
"properties": {
"released_amount": {
"description": "The total amount of ASTRO already claimed",
"description": "The total amount of vested already claimed",
"allOf": [
{
"$ref": "#/definitions/Uint128"
Expand Down Expand Up @@ -901,6 +915,41 @@
"type": "string"
}
}
},
"vesting_state": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "VestingState",
"description": "This structure stores the accumulated vesting information for all addresses.",
"type": "object",
"required": [
"total_granted",
"total_released"
],
"properties": {
"total_granted": {
"description": "The total amount of tokens granted to the users",
"allOf": [
{
"$ref": "#/definitions/Uint128"
}
]
},
"total_released": {
"description": "The total amount of tokens already claimed",
"allOf": [
{
"$ref": "#/definitions/Uint128"
}
]
}
},
"additionalProperties": false,
"definitions": {
"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"
}
}
}
}
}
50 changes: 50 additions & 0 deletions contracts/vesting-managed/schema/raw/execute.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,56 @@
}
},
"additionalProperties": false
},
{
"description": "Adds vesting managers ## Executor Only the current owner can execute this",
"type": "object",
"required": [
"add_vesting_managers"
],
"properties": {
"add_vesting_managers": {
"type": "object",
"required": [
"managers"
],
"properties": {
"managers": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"description": "Removes vesting managers ## Executor Only the current owner can execute this",
"type": "object",
"required": [
"remove_vesting_managers"
],
"properties": {
"remove_vesting_managers": {
"type": "object",
"required": [
"managers"
],
"properties": {
"managers": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
],
"definitions": {
Expand Down
8 changes: 8 additions & 0 deletions contracts/vesting-managed/schema/raw/instantiate.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,21 @@
"type": "object",
"required": [
"owner",
"vesting_managers",
"vesting_token"
],
"properties": {
"owner": {
"description": "Address allowed to change contract parameters",
"type": "string"
},
"vesting_managers": {
"description": "Initial list of whitelisted vesting managers",
"type": "array",
"items": {
"type": "string"
}
},
"vesting_token": {
"description": "[`AssetInfo`] of the token that's being vested",
"allOf": [
Expand Down
28 changes: 28 additions & 0 deletions contracts/vesting-managed/schema/raw/query.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,34 @@
}
},
"additionalProperties": false
},
{
"description": "VestingState returns the current vesting state.",
"type": "object",
"required": [
"vesting_state"
],
"properties": {
"vesting_state": {
"type": "object",
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"description": "Returns list of vesting managers (the persons who are able to add/remove vesting schedules)",
"type": "object",
"required": [
"vesting_managers"
],
"properties": {
"vesting_managers": {
"type": "object",
"additionalProperties": false
}
},
"additionalProperties": false
}
],
"definitions": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
],
"properties": {
"released_amount": {
"description": "The total amount of ASTRO already claimed",
"description": "The total amount of vested already claimed",
"allOf": [
{
"$ref": "#/definitions/Uint128"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
],
"properties": {
"released_amount": {
"description": "The total amount of ASTRO already claimed",
"description": "The total amount of vested already claimed",
"allOf": [
{
"$ref": "#/definitions/Uint128"
Expand Down
Loading