-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from neutron-org/feat/pcl-pools
PCL pools migration
- Loading branch information
Showing
57 changed files
with
4,532 additions
and
135 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
contracts/dao/voting/lockdrop-vault-for-cl-pools/.cargo/config
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,4 @@ | ||
[alias] | ||
wasm = "build --release --target wasm32-unknown-unknown" | ||
unit-test = "test --lib" | ||
schema = "run --example schema" |
36 changes: 36 additions & 0 deletions
36
contracts/dao/voting/lockdrop-vault-for-cl-pools/Cargo.toml
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,36 @@ | ||
[package] | ||
name = "lockdrop-vault-for-cl-pools" | ||
version = "0.1.0" | ||
authors = ["Sergei Sotnikov <[email protected]>"] | ||
edition = "2021" | ||
license = "Apache-2.0" | ||
repository = "https://github.com/neutron/neutron-dao" | ||
|
||
[lib] | ||
crate-type = ["cdylib", "rlib"] | ||
|
||
[features] | ||
# for more explicit tests, cargo test --features=backtraces | ||
backtraces = ["cosmwasm-std/backtraces"] | ||
# use library feature to disable all instantiate/execute/query exports | ||
library = [] | ||
|
||
[dependencies] | ||
cosmwasm-std = { version = "1.3.0" } | ||
cw-storage-plus = "1.1.0" | ||
cw2 = "1.1.0" | ||
cw20 = "1.1.0" | ||
schemars = "0.8.8" | ||
serde = { version = "1.0.175", default-features = false, features = ["derive"] } | ||
thiserror = { version = "1.0" } | ||
cwd-macros = { path = "../../../../packages/cwd-macros" } | ||
cwd-interface = { path = "../../../../packages/cwd-interface" } | ||
cwd-voting = { path = "../../../../packages/cwd-voting" } | ||
neutron-lockdrop-vault-for-cl-pools = { path = "../../../../packages/neutron-lockdrop-vault-for-cl-pools" } | ||
astroport-periphery = { package="astroport-periphery", git = "https://github.com/neutron-org/neutron-tge-contracts.git", rev = "e306308dd23d567399c15d899f295a910ede945b" } | ||
astroport = { package="astroport", git = "https://github.com/neutron-org/neutron-tge-contracts.git", rev = "e306308dd23d567399c15d899f295a910ede945b" } | ||
|
||
[dev-dependencies] | ||
cosmwasm-schema = { version = "^1.2.1" } | ||
cw-multi-test = "0.16.5" | ||
anyhow = "1.0.57" |
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,3 @@ | ||
### Neutron Lockdrop Voting Vault | ||
|
||
This contract is not really a voting vault. It's rather an interface to get voting power from a Lockdrop contract. It's not possible to Bond or Unbond funds to this vault cause these ExecuteMsg handlers are introduced just to make the contract comply with the voting vault interface. |
31 changes: 31 additions & 0 deletions
31
contracts/dao/voting/lockdrop-vault-for-cl-pools/examples/schema.rs
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,31 @@ | ||
// Copyright 2022 Neutron | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
use std::env::current_dir; | ||
use std::fs::create_dir_all; | ||
|
||
use cosmwasm_schema::{export_schema, remove_schemas, schema_for}; | ||
|
||
use neutron_lockdrop_vault_for_cl_pools::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; | ||
|
||
fn main() { | ||
let mut out_dir = current_dir().unwrap(); | ||
out_dir.push("schema"); | ||
create_dir_all(&out_dir).unwrap(); | ||
remove_schemas(&out_dir).unwrap(); | ||
|
||
export_schema(&schema_for!(InstantiateMsg), &out_dir); | ||
export_schema(&schema_for!(ExecuteMsg), &out_dir); | ||
export_schema(&schema_for!(QueryMsg), &out_dir); | ||
} |
94 changes: 94 additions & 0 deletions
94
contracts/dao/voting/lockdrop-vault-for-cl-pools/schema/execute_msg.json
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,94 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "ExecuteMsg", | ||
"oneOf": [ | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"update_config" | ||
], | ||
"properties": { | ||
"update_config": { | ||
"type": "object", | ||
"properties": { | ||
"atom_cl_pool_contract": { | ||
"type": [ | ||
"string", | ||
"null" | ||
] | ||
}, | ||
"description": { | ||
"type": [ | ||
"string", | ||
"null" | ||
] | ||
}, | ||
"lockdrop_contract": { | ||
"type": [ | ||
"string", | ||
"null" | ||
] | ||
}, | ||
"name": { | ||
"type": [ | ||
"string", | ||
"null" | ||
] | ||
}, | ||
"owner": { | ||
"type": [ | ||
"string", | ||
"null" | ||
] | ||
}, | ||
"usdc_cl_pool_contract": { | ||
"type": [ | ||
"string", | ||
"null" | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"bond" | ||
], | ||
"properties": { | ||
"bond": { | ||
"type": "object" | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"unbond" | ||
], | ||
"properties": { | ||
"unbond": { | ||
"type": "object", | ||
"required": [ | ||
"amount" | ||
], | ||
"properties": { | ||
"amount": { | ||
"$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" | ||
} | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
contracts/dao/voting/lockdrop-vault-for-cl-pools/schema/instantiate_msg.json
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,39 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "InstantiateMsg", | ||
"type": "object", | ||
"required": [ | ||
"atom_cl_pool_contract", | ||
"description", | ||
"lockdrop_contract", | ||
"name", | ||
"owner", | ||
"usdc_cl_pool_contract" | ||
], | ||
"properties": { | ||
"atom_cl_pool_contract": { | ||
"description": "The ATOM/NTRN CL pool oracle contract.", | ||
"type": "string" | ||
}, | ||
"description": { | ||
"description": "Description contains information that characterizes the vault.", | ||
"type": "string" | ||
}, | ||
"lockdrop_contract": { | ||
"description": "The lockdrop contract behind the vault.", | ||
"type": "string" | ||
}, | ||
"name": { | ||
"description": "Name contains the vault name which is used to ease the vault's recognition.", | ||
"type": "string" | ||
}, | ||
"owner": { | ||
"description": "Owner can update all configs including changing the owner. This will generally be a DAO.", | ||
"type": "string" | ||
}, | ||
"usdc_cl_pool_contract": { | ||
"description": "The USDC/NTRN CL pool contract.", | ||
"type": "string" | ||
} | ||
} | ||
} |
181 changes: 181 additions & 0 deletions
181
contracts/dao/voting/lockdrop-vault-for-cl-pools/schema/query_msg.json
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,181 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "QueryMsg", | ||
"oneOf": [ | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"config" | ||
], | ||
"properties": { | ||
"config": { | ||
"type": "object", | ||
"additionalProperties": false | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"voting_power_at_height" | ||
], | ||
"properties": { | ||
"voting_power_at_height": { | ||
"type": "object", | ||
"required": [ | ||
"address" | ||
], | ||
"properties": { | ||
"address": { | ||
"type": "string" | ||
}, | ||
"height": { | ||
"type": [ | ||
"integer", | ||
"null" | ||
], | ||
"format": "uint64", | ||
"minimum": 0.0 | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"total_power_at_height" | ||
], | ||
"properties": { | ||
"total_power_at_height": { | ||
"type": "object", | ||
"properties": { | ||
"height": { | ||
"type": [ | ||
"integer", | ||
"null" | ||
], | ||
"format": "uint64", | ||
"minimum": 0.0 | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"bonding_status" | ||
], | ||
"properties": { | ||
"bonding_status": { | ||
"type": "object", | ||
"required": [ | ||
"address" | ||
], | ||
"properties": { | ||
"address": { | ||
"type": "string" | ||
}, | ||
"height": { | ||
"type": [ | ||
"integer", | ||
"null" | ||
], | ||
"format": "uint64", | ||
"minimum": 0.0 | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"dao" | ||
], | ||
"properties": { | ||
"dao": { | ||
"type": "object", | ||
"additionalProperties": false | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"name" | ||
], | ||
"properties": { | ||
"name": { | ||
"type": "object", | ||
"additionalProperties": false | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"description" | ||
], | ||
"properties": { | ||
"description": { | ||
"type": "object", | ||
"additionalProperties": false | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"list_bonders" | ||
], | ||
"properties": { | ||
"list_bonders": { | ||
"type": "object", | ||
"properties": { | ||
"limit": { | ||
"type": [ | ||
"integer", | ||
"null" | ||
], | ||
"format": "uint32", | ||
"minimum": 0.0 | ||
}, | ||
"start_after": { | ||
"type": [ | ||
"string", | ||
"null" | ||
] | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"info" | ||
], | ||
"properties": { | ||
"info": { | ||
"type": "object", | ||
"additionalProperties": false | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
] | ||
} |
Oops, something went wrong.