-
Notifications
You must be signed in to change notification settings - Fork 8
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
Changes from 10 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
81d2107
init vesting contract
146a8db
wip
516cdaa
added vesting base type. Added vesting-lp contract
35c39f8
moved CONFIG and OWNERSHIP_PROPOSAL to BaseVesting fields
865b304
Update contracts/vesting-lp/src/lib.rs
swelf19 7db8e3b
added test. fixed bug. run fmt
swelf19 659fcd1
Merge remote-tracking branch 'origin/feat/vesting-and-vault-interface…
swelf19 75a4f64
merged base, more clippy fixes
abb0ce6
fmt
swelf19 f84d06c
Merge branch 'main' into feat/vesting-and-vault-interface
swelf19 dcb8663
Update contracts/vesting-lp/src/contract.rs
swelf19 4fee745
entripoint macros for query
swelf19 3f44a88
added whitelisted list of vesting managers
swelf19 7fdf6b4
fixed wasm floa32
swelf19 fd3a9ea
review fixes. Comments typos. Description fixes. Checks the vesting m…
swelf19 b3a60e3
feat: vesting managed (#20)
zavgorodnii 7acaec1
review fixes
swelf19 b4480a2
review fixes
swelf19 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[alias] | ||
wasm = "build --release --target wasm32-unknown-unknown" | ||
wasm-debug = "build --target wasm32-unknown-unknown" | ||
unit-test = "test --lib" | ||
integration-test = "test --test integration" | ||
schema = "run --example vesting_schema" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
[package] | ||
name = "vesting-lp" | ||
version = "1.1.0" | ||
authors = ["Astroport"] | ||
edition = "2021" | ||
|
||
[lib] | ||
crate-type = ["cdylib", "rlib"] | ||
|
||
[features] | ||
# use library feature to disable all init/handle/query exports | ||
library = [] | ||
|
||
[dependencies] | ||
vesting-base = {path = "../../packages/vesting-base"} | ||
astroport = { path = "../../packages/astroport", default-features = false } | ||
cosmwasm-schema = { version = "1.1", default-features = false } | ||
cosmwasm-std = { version = "1.1" } | ||
cw-storage-plus = "0.15" | ||
|
||
[dev-dependencies] | ||
cw-multi-test = "0.15" | ||
astroport-token = {path = "../astroport/token"} | ||
cw20 = { version = "0.15" } | ||
cw-utils = "0.15" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
use cosmwasm_schema::write_api; | ||
|
||
use astroport::vesting::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg}; | ||
|
||
fn main() { | ||
write_api! { | ||
instantiate: InstantiateMsg, | ||
query: QueryMsg, | ||
execute: ExecuteMsg, | ||
migrate: MigrateMsg | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,244 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "ExecuteMsg", | ||
"description": "This structure describes the execute messages available in the contract.", | ||
"oneOf": [ | ||
{ | ||
"description": "Claim claims vested tokens and sends them to a recipient", | ||
"type": "object", | ||
"required": [ | ||
"claim" | ||
], | ||
"properties": { | ||
"claim": { | ||
"type": "object", | ||
"properties": { | ||
"amount": { | ||
"description": "The amount of tokens to claim", | ||
"anyOf": [ | ||
{ | ||
"$ref": "#/definitions/Uint128" | ||
}, | ||
{ | ||
"type": "null" | ||
} | ||
] | ||
}, | ||
"recipient": { | ||
"description": "The address that receives the vested tokens", | ||
"type": [ | ||
"string", | ||
"null" | ||
] | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"description": "Receives a message of type [`Cw20ReceiveMsg`] and processes it depending on the received template", | ||
"type": "object", | ||
"required": [ | ||
"receive" | ||
], | ||
"properties": { | ||
"receive": { | ||
"$ref": "#/definitions/Cw20ReceiveMsg" | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"description": "RegisterVestingAccounts registers vesting targets/accounts", | ||
"type": "object", | ||
"required": [ | ||
"register_vesting_accounts" | ||
], | ||
"properties": { | ||
"register_vesting_accounts": { | ||
"type": "object", | ||
"required": [ | ||
"vesting_accounts" | ||
], | ||
"properties": { | ||
"vesting_accounts": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/VestingAccount" | ||
} | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"description": "Creates a request to change contract ownership ## Executor Only the current owner can execute this", | ||
"type": "object", | ||
"required": [ | ||
"propose_new_owner" | ||
], | ||
"properties": { | ||
"propose_new_owner": { | ||
"type": "object", | ||
"required": [ | ||
"expires_in", | ||
"owner" | ||
], | ||
"properties": { | ||
"expires_in": { | ||
"description": "The validity period of the offer to change the owner", | ||
"type": "integer", | ||
"format": "uint64", | ||
"minimum": 0.0 | ||
}, | ||
"owner": { | ||
"description": "The newly proposed owner", | ||
"type": "string" | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"description": "Removes a request to change contract ownership ## Executor Only the current owner can execute this", | ||
"type": "object", | ||
"required": [ | ||
"drop_ownership_proposal" | ||
], | ||
"properties": { | ||
"drop_ownership_proposal": { | ||
"type": "object", | ||
"additionalProperties": false | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"description": "Claims contract ownership ## Executor Only the newly proposed owner can execute this", | ||
"type": "object", | ||
"required": [ | ||
"claim_ownership" | ||
], | ||
"properties": { | ||
"claim_ownership": { | ||
"type": "object", | ||
"additionalProperties": false | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
], | ||
"definitions": { | ||
"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 | ||
}, | ||
"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" | ||
}, | ||
"VestingAccount": { | ||
"description": "This structure stores vesting information for a specific address that is getting tokens.", | ||
"type": "object", | ||
"required": [ | ||
"address", | ||
"schedules" | ||
], | ||
"properties": { | ||
"address": { | ||
"description": "The address that is getting tokens", | ||
"type": "string" | ||
}, | ||
"schedules": { | ||
"description": "The vesting schedules targeted at the `address`", | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/VestingSchedule" | ||
} | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
"VestingSchedule": { | ||
"description": "This structure stores parameters for a specific vesting schedule", | ||
"type": "object", | ||
"required": [ | ||
"start_point" | ||
], | ||
"properties": { | ||
"end_point": { | ||
"description": "The end point for the vesting schedule", | ||
"anyOf": [ | ||
{ | ||
"$ref": "#/definitions/VestingSchedulePoint" | ||
}, | ||
{ | ||
"type": "null" | ||
} | ||
] | ||
}, | ||
"start_point": { | ||
"description": "The start date for the vesting schedule", | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/VestingSchedulePoint" | ||
} | ||
] | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
"VestingSchedulePoint": { | ||
"description": "This structure stores the parameters used to create a vesting schedule.", | ||
"type": "object", | ||
"required": [ | ||
"amount", | ||
"time" | ||
], | ||
"properties": { | ||
"amount": { | ||
"description": "The amount of tokens being vested", | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/Uint128" | ||
} | ||
] | ||
}, | ||
"time": { | ||
"description": "The start time for the vesting schedule", | ||
"type": "integer", | ||
"format": "uint64", | ||
"minimum": 0.0 | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
} | ||
} |
Oops, something went wrong.
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.
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.
why is it vesting-lp? what does lp mean here?
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.
Usually lp stands for liquidity provider, but to be honest I don't see anything related to market making in this contract.