Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions ci/integration-tests/src/tests/cw_vesting_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ fn test_cw_vesting_staking(chain: &mut Chain) {
total: Uint128::new(100_000_000),
denom: cw_vesting::UncheckedDenom::Native("ujunox".to_string()),

dao_staking: None,
schedule: Schedule::SaturatingLinear,
start_time: None,
vesting_duration_seconds: 10,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,21 @@
},
"additionalProperties": false
},
"DaoStakingLimits": {
"type": "object",
"required": [
"staking_contract_allowlist"
],
"properties": {
"staking_contract_allowlist": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
},
"Expiration": {
"description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)",
"oneOf": [
Expand Down Expand Up @@ -241,6 +256,17 @@
"vesting_duration_seconds"
],
"properties": {
"dao_staking": {
"description": "TODO support limits for native staked tokens as well? Optionally enabling this vesting contract to stake in token DAOs. Set to None if vesting a native token.",
"anyOf": [
{
"$ref": "#/definitions/DaoStakingLimits"
},
{
"type": "null"
}
]
},
"denom": {
"description": "The type and denom of token being vested.",
"allOf": [
Expand Down
5 changes: 5 additions & 0 deletions contracts/external/cw-payroll-factory/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ pub fn test_instantiate_native_payroll_contract() {
vesting_duration_seconds: 200,
unbonding_duration_seconds: 2592000, // 30 days
start_time: None,
dao_staking: None,
},
label: "Payroll".to_string(),
};
Expand Down Expand Up @@ -275,6 +276,7 @@ pub fn test_instantiate_cw20_payroll_contract() {
vesting_duration_seconds: 200,
unbonding_duration_seconds: 2592000, // 30 days
start_time: None,
dao_staking: None,
};

// Attempting to call InstantiatePayrollContract directly with cw20 fails
Expand Down Expand Up @@ -397,6 +399,7 @@ fn test_instantiate_wrong_ownership_native() {
vesting_duration_seconds: 200,
unbonding_duration_seconds: 2592000, // 30 days
start_time: None,
dao_staking: None,
},
label: "vesting".to_string(),
},
Expand Down Expand Up @@ -481,6 +484,7 @@ fn test_update_vesting_code_id() {
vesting_duration_seconds: 200,
unbonding_duration_seconds: 2592000, // 30 days
start_time: None,
dao_staking: None,
},
label: "Payroll".to_string(),
};
Expand Down Expand Up @@ -571,6 +575,7 @@ pub fn test_inconsistent_cw20_amount() {
vesting_duration_seconds: 200,
unbonding_duration_seconds: 2592000, // 30 days
start_time: None,
dao_staking: None,
};
let err: ContractError = app
.execute_contract(
Expand Down
3 changes: 3 additions & 0 deletions contracts/external/cw-vesting/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ cw-utils = { workspace = true }
cw-wormhole = { workspace = true }
cw2 = { workspace = true }
cw20 = { workspace = true }
dao-proposal-single = { workspace = true, features = ["library"] }
dao-voting = { workspace = true }
dao-voting-token-staked = { workspace = true }
serde = { workspace = true }
thiserror = { workspace = true }
wynd-utils = { workspace = true }
Expand Down
180 changes: 179 additions & 1 deletion contracts/external/cw-vesting/schema/cw-vesting.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@
"vesting_duration_seconds"
],
"properties": {
"dao_staking": {
"description": "Optionally enabling this vesting contract to stake in token DAOs. Set to None if vesting a native staking token.",
"anyOf": [
{
"$ref": "#/definitions/DaoStakingLimits"
},
{
"type": "null"
}
]
},
"denom": {
"description": "The type and denom of token being vested.",
"allOf": [
Expand Down Expand Up @@ -88,6 +99,21 @@
},
"additionalProperties": false,
"definitions": {
"DaoStakingLimits": {
"type": "object",
"required": [
"staking_contract_allowlist"
],
"properties": {
"staking_contract_allowlist": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
},
"Schedule": {
"oneOf": [
{
Expand Down Expand Up @@ -194,7 +220,7 @@
"additionalProperties": false
},
{
"description": "Distribute vested tokens to the vest receiver. Anyone may call this method.",
"description": "TODO we need something for things like airdrops? Should we have a general execute method that can be used for this? Distribute vested tokens to the vest receiver. Anyone may call this method.",
"type": "object",
"required": [
"distribute"
Expand Down Expand Up @@ -446,6 +472,19 @@
},
"additionalProperties": false
},
{
"description": "Actions related to staking and voting in DAOs",
"type": "object",
"required": [
"dao_actions"
],
"properties": {
"dao_actions": {
"$ref": "#/definitions/DaoActionsMsg"
}
},
"additionalProperties": false
},
{
"description": "Update the contract's ownership. The `action` to be provided can be either to propose transferring ownership to an account, accept a pending ownership transfer, or renounce the ownership permanently.",
"type": "object",
Expand Down Expand Up @@ -537,6 +576,120 @@
},
"additionalProperties": false
},
"DaoActionsMsg": {
"oneOf": [
{
"description": "Stake to a DAO",
"type": "object",
"required": [
"stake"
],
"properties": {
"stake": {
"type": "object",
"required": [
"amount",
"staking_contract"
],
"properties": {
"amount": {
"description": "The amount to stake.",
"allOf": [
{
"$ref": "#/definitions/Uint128"
}
]
},
"staking_contract": {
"description": "The staking contract address",
"type": "string"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"description": "Unstake from a DAO",
"type": "object",
"required": [
"unstake"
],
"properties": {
"unstake": {
"type": "object",
"required": [
"amount",
"staking_contract"
],
"properties": {
"amount": {
"description": "The amount to unstake.",
"allOf": [
{
"$ref": "#/definitions/Uint128"
}
]
},
"staking_contract": {
"description": "The staking contract address",
"type": "string"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"description": "Vote on single choice proposal",
"type": "object",
"required": [
"vote"
],
"properties": {
"vote": {
"type": "object",
"required": [
"proposal_id",
"proposal_module",
"vote"
],
"properties": {
"proposal_id": {
"description": "The ID of the proposal to vote on.",
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"proposal_module": {
"description": "The address of the proposal module you are voting on.",
"type": "string"
},
"rationale": {
"description": "An optional rationale for why this vote was cast. This can be updated, set, or removed later by the address casting the vote.",
"type": [
"string",
"null"
]
},
"vote": {
"description": "The senders position on the proposal.",
"allOf": [
{
"$ref": "#/definitions/Vote"
}
]
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
]
},
"Expiration": {
"description": "Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future)",
"oneOf": [
Expand Down Expand Up @@ -599,6 +752,31 @@
"Uint64": {
"description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 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 `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```",
"type": "string"
},
"Vote": {
"oneOf": [
{
"description": "Marks support for the proposal.",
"type": "string",
"enum": [
"yes"
]
},
{
"description": "Marks opposition to the proposal.",
"type": "string",
"enum": [
"no"
]
},
{
"description": "Marks participation but does not count towards the ratio of support / opposed.",
"type": "string",
"enum": [
"abstain"
]
}
]
}
}
},
Expand Down
Loading