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: add lockdrop vault NTRN-343 #35

Merged
merged 11 commits into from
Feb 21, 2023
Merged
31 changes: 31 additions & 0 deletions Cargo.lock

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

5 changes: 3 additions & 2 deletions artifacts/checksums.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ bdddd6ea8f7dc36e1b73d97c7caf20f59a3f2e3544a307098fbd02d838f260bd cwd_subdao_pre
e98782b00d3a36f85dfe899025848beae3b330deefb818204d6251e431417f1a cwd_subdao_pre_propose_single.wasm
be0fb8de87fad3da5f4fee52b27dbcef6426af56692401945873b2b0894779cc cwd_subdao_proposal_single.wasm
aed528b20c9d432414858d0a825e945365145b3d375cb174fd7a8ba4f7234693 cwd_subdao_timelock_single.wasm
2a1304d580ad173a76a7c6874d764611bec03db3e027b4cdd9860be0ba654958 lockdrop_vault.wasm
9bbd1d908adc2e3d50ae3f3d74073a4d39c437c6b389fed2163eff3bf238ee28 neutron_distribution.wasm
8c58519e5a278fbce1c912a5832cab7e29768b69f05c2338e2a10d584c517c5a neutron_reserve.wasm
f4be156137da8588bf7215fa62a8bddb5d9cc31415c524716ebc1b53bd0448a8 neutron_treasury.wasm
c84e2ba2d6d63045cec318e6951a4819c53de185fff04cd5b543d37dc6e39ba3 neutron_vault.wasm
dcba10f524ca82a7dd777d56ed1a058d825b313cf650a77141745c70214fd92b neutron_voting_registry.wasm
e55401ed044aa88eca95b3f6d767ef9c5d8257429fbbc65872e2b30766b5c050 neutron_vault.wasm
580073c0b31b906bcf3b144c06d38a4c3ac4e48317c34cc35d64ee3e377f3140 neutron_voting_registry.wasm
7 changes: 5 additions & 2 deletions artifacts/checksums_intermediate.txt
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
98d530814928c28813685bdd634d33c6d10bde7d8d3d14054dd28c18ecc082c7 target/wasm32-unknown-unknown/release/cwd_core.wasm
5683c77f46619bea0dfc466792110a0008c447f9fec08e6e929892f70f11a53c target/wasm32-unknown-unknown/release/cwd_pre_propose_multiple.wasm
d328a563a7125e5c1bd8d31004eacfea2417467efc040aac2ecc981040f566a6 target/wasm32-unknown-unknown/release/cwd_pre_propose_overrule.wasm
9045a14917b5fe2aae20e8778bdb315ddee88dcd3f38e6d86fd2e1e820e585d0 target/wasm32-unknown-unknown/release/cwd_pre_propose_single.wasm
78764327dccf528394eb79786bb75d8737687dfff33ea8e0497a71276a7ee926 target/wasm32-unknown-unknown/release/cwd_proposal_multiple.wasm
fc79389148ad4653d8a9da2926c683d297b0c7ddce8bf2a865c70e0897cdb176 target/wasm32-unknown-unknown/release/cwd_proposal_single.wasm
1ae934f9b3e188a4d7096f4f9231edfad84a482a33a66e90b5d0ce124065c062 target/wasm32-unknown-unknown/release/cwd_subdao_pre_propose_single.wasm
91be9e3bbb44c0abfafc1602887348ac67c41511c6f2cbbca26e945e7125b159 target/wasm32-unknown-unknown/release/neutron_distribution.wasm
2243d1d288ebc8c8110a95ea69226ba9012ffd79cad637147c6e9aa5a27c7942 target/wasm32-unknown-unknown/release/neutron_treasury.wasm
b0ec185bb41233b43f1e38459b2397c4d15af2d814d2630f597d943dd1c86c01 target/wasm32-unknown-unknown/release/neutron_voting_registry.wasm
98d530814928c28813685bdd634d33c6d10bde7d8d3d14054dd28c18ecc082c7 target/wasm32-unknown-unknown/release/cwd_core.wasm
d328a563a7125e5c1bd8d31004eacfea2417467efc040aac2ecc981040f566a6 target/wasm32-unknown-unknown/release/cwd_pre_propose_overrule.wasm
5f5de39421089a6edc7f6e8bbcfe90aa57115e6257d8f3e2c4ee9f026a8acf0e target/wasm32-unknown-unknown/release/cwd_subdao_proposal_single.wasm
958d16502995b3793d757debf31462925a83d2a7ff64a9085cb039cdc647c6a6 target/wasm32-unknown-unknown/release/neutron_reserve.wasm
2555e729336d8ea646673a72b044da8eb1a2277344715b4ac593bc609b5d44bb target/wasm32-unknown-unknown/release/neutron_vault.wasm
182595fe1ffd93701b14c6f04d5ac40af1f43aabcfbdb7144b63d609a87154d0 target/wasm32-unknown-unknown/release/cwd_subdao_core.wasm
2cbd1aeb99f73a7089fbcb94140096585c4db4611fb342a6e9843989feee1fd2 target/wasm32-unknown-unknown/release/cwd_subdao_timelock_single.wasm
982741fd45b2e92967969e3f0953bd230bfd8e45a750c5916a1c40a30870d793 target/wasm32-unknown-unknown/release/lockdrop_vault.wasm
a8db4fd0309edf7ddb2b8e222451126c0f2d80032467c3f7ed2bbd18cfb7bcb5 target/wasm32-unknown-unknown/release/neutron_vault.wasm
7c99dc1f895fb4cc18fa62451ab70ff68ceefef63974cf066f191c260dfcf482 target/wasm32-unknown-unknown/release/neutron_voting_registry.wasm
Binary file added artifacts/lockdrop_vault.wasm
Binary file not shown.
Binary file modified artifacts/neutron_vault.wasm
Binary file not shown.
Binary file modified artifacts/neutron_voting_registry.wasm
Binary file not shown.
32 changes: 32 additions & 0 deletions contracts/dao/voting/lockdrop-vault/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[package]
name = "lockdrop-vault"
version = "0.1.0"
authors = ["Sergei Sotnikov <sergei.s@p2p.org>"]
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.0.0" }
cw-storage-plus = "0.13"
cw2 = "0.13"
Comment on lines +20 to +21
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, use version 1.0.1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

created a task to update it across the whole repo: https://p2pvalidator.atlassian.net/browse/NTRN-381

schemars = "0.8"
serde = { version = "1.0.147", default-features = false, features = ["derive"] }
thiserror = { version = "1.0" }
cwd-macros = { path = "../../../../packages/cwd-macros" }
cwd-interface = { path = "../../../../packages/cwd-interface" }
neutron-lockdrop-vault = { path = "../../../../packages/neutron-lockdrop-vault" }

[dev-dependencies]
cosmwasm-schema = { version = "1.0.0" }
cw-multi-test = "0.13"
anyhow = "1.0.57"
3 changes: 3 additions & 0 deletions contracts/dao/voting/lockdrop-vault/README.md
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.
32 changes: 32 additions & 0 deletions contracts/dao/voting/lockdrop-vault/examples/schema.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
use std::env::current_dir;
use std::fs::create_dir_all;

use cosmwasm_schema::{export_schema, export_schema_with_title, remove_schemas, schema_for};
use cosmwasm_std::Addr;
use cwd_interface::voting::{
BondingStatusResponse, InfoResponse, TotalPowerAtHeightResponse, VotingPowerAtHeightResponse,
};
use neutron_lockdrop_vault::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg};
use neutron_lockdrop_vault::types::Config;

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);
export_schema(&schema_for!(MigrateMsg), &out_dir);

export_schema(&schema_for!(InfoResponse), &out_dir);
export_schema(&schema_for!(TotalPowerAtHeightResponse), &out_dir);
export_schema(&schema_for!(VotingPowerAtHeightResponse), &out_dir);
export_schema(&schema_for!(BondingStatusResponse), &out_dir);

// Auto TS code generation expects the query return type as QueryNameResponse
// Here we map query resonses to the correct name
export_schema_with_title(&schema_for!(Addr), &out_dir, "DaoResponse");
export_schema_with_title(&schema_for!(Config), &out_dir, "GetConfigResponse");
}
Loading