Skip to content

Commit

Permalink
Merge pull request #106 from neutron-org/feat/add-dex-pause
Browse files Browse the repository at this point in the history
NTRN-323 Feat: Add dex pause dao logic
  • Loading branch information
pr0n00gler authored Jul 31, 2024
2 parents 3067993 + dbb04f4 commit cc590b9
Show file tree
Hide file tree
Showing 13 changed files with 644 additions and 586 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fmt:
@cargo fmt -- --check

check_contracts:
@cargo install cosmwasm-check --locked
@cargo install cosmwasm-check --version 2.0.4 --locked
@cosmwasm-check --available-capabilities iterator,staking,stargate,neutron artifacts/*.wasm

compile:
Expand Down
393 changes: 106 additions & 287 deletions contracts/dao/neutron-chain-manager/schema/neutron-chain-manager.json

Large diffs are not rendered by default.

287 changes: 61 additions & 226 deletions contracts/dao/neutron-chain-manager/schema/raw/execute.json
Original file line number Diff line number Diff line change
Expand Up @@ -410,31 +410,8 @@
"additionalProperties": false
},
{
"type": "object",
"required": [
"staking"
],
"properties": {
"staking": {
"$ref": "#/definitions/StakingMsg"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"distribution"
],
"properties": {
"distribution": {
"$ref": "#/definitions/DistributionMsg"
}
},
"additionalProperties": false
},
{
"description": "A Stargate message encoded the same way as a protobuf [Any](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto). This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md)",
"description": "This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md)",
"deprecated": true,
"type": "object",
"required": [
"stargate"
Expand Down Expand Up @@ -880,57 +857,32 @@
}
]
},
"DistributionMsg": {
"description": "The message types of the distribution module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto",
"oneOf": [
{
"description": "This is translated to a [MsgSetWithdrawAddress](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L29-L37). `delegator_address` is automatically filled with the current contract's address.",
"type": "object",
"required": [
"set_withdraw_address"
],
"properties": {
"set_withdraw_address": {
"type": "object",
"required": [
"address"
],
"properties": {
"address": {
"description": "The `withdraw_address`",
"type": "string"
}
}
}
},
"additionalProperties": false
"DexUpdateParamsPermission": {
"type": "object",
"required": [
"fee_tiers",
"good_til_purge_allowance",
"max_jits_per_block",
"paused"
],
"properties": {
"fee_tiers": {
"type": "boolean"
},
{
"description": "This is translated to a [[MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address.",
"type": "object",
"required": [
"withdraw_delegator_reward"
],
"properties": {
"withdraw_delegator_reward": {
"type": "object",
"required": [
"validator"
],
"properties": {
"validator": {
"description": "The `validator_address`",
"type": "string"
}
}
}
},
"additionalProperties": false
"good_til_purge_allowance": {
"type": "boolean"
},
"max_jits_per_block": {
"type": "boolean"
},
"paused": {
"type": "boolean"
}
]
},
"additionalProperties": false
},
"GovMsg": {
"description": "This message type allows the contract interact with the [x/gov] module in order to cast votes.\n\n[x/gov]: https://github.com/cosmos/cosmos-sdk/tree/v0.45.12/x/gov\n\n## Examples\n\nCast a simple vote:\n\n``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); use cosmwasm_std::{GovMsg, VoteOption};\n\n#[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result<Response, StdError> { // ... Ok(Response::new().add_message(GovMsg::Vote { proposal_id: 4, vote: VoteOption::Yes, })) } ```\n\nCast a weighted vote:\n\n``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); # #[cfg(feature = \"cosmwasm_1_2\")] use cosmwasm_std::{Decimal, GovMsg, VoteOption, WeightedVoteOption};\n\n# #[cfg(feature = \"cosmwasm_1_2\")] #[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result<Response, StdError> { // ... Ok(Response::new().add_message(GovMsg::VoteWeighted { proposal_id: 4, options: vec![ WeightedVoteOption { option: VoteOption::Yes, weight: Decimal::percent(65), }, WeightedVoteOption { option: VoteOption::Abstain, weight: Decimal::percent(35), }, ], })) } ```",
"description": "This message type allows the contract interact with the [x/gov] module in order to cast votes.\n\n[x/gov]: https://github.com/cosmos/cosmos-sdk/tree/v0.45.12/x/gov\n\n## Examples\n\nCast a simple vote:\n\n``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); use cosmwasm_std::{GovMsg, VoteOption};\n\n#[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result<Response, StdError> { // ... Ok(Response::new().add_message(GovMsg::Vote { proposal_id: 4, option: VoteOption::Yes, })) } ```\n\nCast a weighted vote:\n\n``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); # #[cfg(feature = \"cosmwasm_1_2\")] use cosmwasm_std::{Decimal, GovMsg, VoteOption, WeightedVoteOption};\n\n# #[cfg(feature = \"cosmwasm_1_2\")] #[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result<Response, StdError> { // ... Ok(Response::new().add_message(GovMsg::VoteWeighted { proposal_id: 4, options: vec![ WeightedVoteOption { option: VoteOption::Yes, weight: Decimal::percent(65), }, WeightedVoteOption { option: VoteOption::Abstain, weight: Decimal::percent(35), }, ], })) } ```",
"oneOf": [
{
"description": "This maps directly to [MsgVote](https://github.com/cosmos/cosmos-sdk/blob/v0.42.5/proto/cosmos/gov/v1beta1/tx.proto#L46-L56) in the Cosmos SDK with voter set to the contract address.",
Expand All @@ -942,22 +894,22 @@
"vote": {
"type": "object",
"required": [
"proposal_id",
"vote"
"option",
"proposal_id"
],
"properties": {
"proposal_id": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"vote": {
"description": "The vote option.\n\nThis should be called \"option\" for consistency with Cosmos SDK. Sorry for that. See <https://github.com/CosmWasm/cosmwasm/issues/1571>.",
"option": {
"description": "The vote option.\n\nThis used to be called \"vote\", but was changed for consistency with Cosmos SDK.",
"allOf": [
{
"$ref": "#/definitions/VoteOption"
}
]
},
"proposal_id": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
}
}
}
Expand Down Expand Up @@ -1029,6 +981,13 @@
"description": "existing channel to send the tokens over",
"type": "string"
},
"memo": {
"description": "An optional memo. See the blog post [\"Moving Beyond Simple Token Transfers\"](https://medium.com/the-interchain-foundation/moving-beyond-simple-token-transfers-d42b2b1dc29b) for more information.\n\nThere is no difference between setting this to `None` or an empty string.\n\nThis field is only supported on chains with CosmWasm >= 2.0 and silently ignored on older chains. If you need support for both 1.x and 2.x chain with the same codebase, it is recommended to use `CosmosMsg::Stargate` with a custom MsgTransfer protobuf encoder instead.",
"type": [
"string",
"null"
]
},
"timeout": {
"description": "when packet times out, measured on remote chain",
"allOf": [
Expand Down Expand Up @@ -1953,35 +1912,47 @@
{
"type": "object",
"required": [
"update_params_permission"
"update_cron_params_permission"
],
"properties": {
"update_params_permission": {
"$ref": "#/definitions/UpdateParamsPermission"
"update_cron_params_permission": {
"$ref": "#/definitions/CronUpdateParamsPermission"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"cron_permission"
"update_tokenfactory_params_permission"
],
"properties": {
"cron_permission": {
"$ref": "#/definitions/CronPermission"
"update_tokenfactory_params_permission": {
"$ref": "#/definitions/TokenfactoryUpdateParamsPermission"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"update_dex_params_permission"
],
"properties": {
"update_dex_params_permission": {
"$ref": "#/definitions/DexUpdateParamsPermission"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"tokenfactory_permission"
"cron_permission"
],
"properties": {
"tokenfactory_permission": {
"$ref": "#/definitions/TokenfactoryPermission"
"cron_permission": {
"$ref": "#/definitions/CronPermission"
}
},
"additionalProperties": false
Expand Down Expand Up @@ -2136,90 +2107,6 @@
}
}
},
"StakingMsg": {
"description": "The message types of the staking module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto",
"oneOf": [
{
"description": "This is translated to a [MsgDelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L81-L90). `delegator_address` is automatically filled with the current contract's address.",
"type": "object",
"required": [
"delegate"
],
"properties": {
"delegate": {
"type": "object",
"required": [
"amount",
"validator"
],
"properties": {
"amount": {
"$ref": "#/definitions/Coin"
},
"validator": {
"type": "string"
}
}
}
},
"additionalProperties": false
},
{
"description": "This is translated to a [MsgUndelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L112-L121). `delegator_address` is automatically filled with the current contract's address.",
"type": "object",
"required": [
"undelegate"
],
"properties": {
"undelegate": {
"type": "object",
"required": [
"amount",
"validator"
],
"properties": {
"amount": {
"$ref": "#/definitions/Coin"
},
"validator": {
"type": "string"
}
}
}
},
"additionalProperties": false
},
{
"description": "This is translated to a [MsgBeginRedelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L95-L105). `delegator_address` is automatically filled with the current contract's address.",
"type": "object",
"required": [
"redelegate"
],
"properties": {
"redelegate": {
"type": "object",
"required": [
"amount",
"dst_validator",
"src_validator"
],
"properties": {
"amount": {
"$ref": "#/definitions/Coin"
},
"dst_validator": {
"type": "string"
},
"src_validator": {
"type": "string"
}
}
}
},
"additionalProperties": false
}
]
},
"StrategyMsg": {
"oneOf": [
{
Expand Down Expand Up @@ -2286,30 +2173,6 @@
}
]
},
"TokenfactoryPermission": {
"type": "object",
"required": [
"denom_creation_fee",
"denom_creation_gas_consume",
"fee_collector_address",
"whitelisted_hooks"
],
"properties": {
"denom_creation_fee": {
"type": "boolean"
},
"denom_creation_gas_consume": {
"type": "boolean"
},
"fee_collector_address": {
"type": "boolean"
},
"whitelisted_hooks": {
"type": "boolean"
}
},
"additionalProperties": false
},
"TokenfactoryUpdateParamsPermission": {
"type": "object",
"required": [
Expand Down Expand Up @@ -2400,34 +2263,6 @@
}
}
},
"UpdateParamsPermission": {
"oneOf": [
{
"type": "object",
"required": [
"cron_update_params_permission"
],
"properties": {
"cron_update_params_permission": {
"$ref": "#/definitions/CronUpdateParamsPermission"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"tokenfactory_update_params_permission"
],
"properties": {
"tokenfactory_update_params_permission": {
"$ref": "#/definitions/TokenfactoryUpdateParamsPermission"
}
},
"additionalProperties": false
}
]
},
"UpgradeProposal": {
"description": "UpgradeProposal defines the struct for IBC upgrade proposal.",
"deprecated": true,
Expand Down
Loading

0 comments on commit cc590b9

Please sign in to comment.