Skip to content

Commit

Permalink
Merge pull request #11 from timewave-computer/benskey/lp
Browse files Browse the repository at this point in the history
base liquidity pooler
  • Loading branch information
bekauz authored Jun 29, 2023
2 parents fd5a898 + bd7293f commit 95538ae
Show file tree
Hide file tree
Showing 26 changed files with 1,430 additions and 393 deletions.
456 changes: 407 additions & 49 deletions Cargo.lock

Large diffs are not rendered by default.

47 changes: 30 additions & 17 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ members = [
[workspace.package]
edition = "2021"
license = "BSD-3"
version = "1.0.0"
repository = "https://github.com/timewave-computer/covenants/stride-covenant"

rust-version = "1.66"
version = "0.1.0"

[profile.release]
codegen-units = 1
Expand All @@ -22,28 +24,39 @@ panic = 'abort'
rpath = false

[workspace.dependencies]
cosmwasm-schema = "1.2"
cosmwasm-std = { version = "1.2", features = ["ibc3"] }
cw-storage-plus = "1.0"
cw-utils = "1.0"
cw2 = "1.0"
covenant-depositor = { path = "./packages/depositor", version = "*" }
covenant-lper = { path = "./packages/lper", version = "*" }
covenant-clock = { path = "contracts/clock" }
covenant-clock-tester = { path = "contracts/clock-tester" }
covenant-lp = { path = "contracts/lper" }
covenant-clock-derive = { path = "packages/clock-derive" }
cw-fifo = { path = "packages/cw-fifo" }


serde = { version = "1", default-features = false, features = ["derive"] }
thiserror = "1"

# the sha2 version here is the same as the one used by
# cosmwasm-std. when bumping cosmwasm-std, this should also be
# updated. to find cosmwasm_std's sha function:
# ```cargo tree --package cosmwasm-std```
sha2 = "0.10.6"

covenant-clock-derive = { path = "packages/clock-derive" }
cw-fifo = { path = "packages/cw-fifo" }

covenant-clock = { path = "contracts/clock" }
covenant-clock-tester = { path = "contracts/clock-tester" }
covenant-depositor = { path = "contracts/depositor" }
neutron-sdk = { git = "https://github.com/neutron-org/neutron-sdk", default-features = false, version = "0.5.0" }
cosmos-sdk-proto = { version = "0.14.0", default-features = false }
protobuf = { version = "3.2.0", features = ["with-bytes"] }
serde-json-wasm = { version = "0.4.1" }
base64 = "0.13.0"
prost = "0.11"
prost-types = "0.11"
bech32 = "0.9.0"
cosmwasm-schema = "1.2.1"
cosmwasm-std = { version = "1.2.4", features = ["ibc3"] }
cw-storage-plus = "1.0.1"
cw-utils = "1.0.1"
cw2 = "1.0.1"
serde = { version = "1.0.145", default-features = false, features = ["derive"] }
thiserror = "1.0.31"
schemars = "0.8.10"

# dev-dependencies
cw-multi-test = "0.16"
anyhow = "1"
cw-multi-test = "0.16.2"
anyhow = { version = "1.0.51" }

7 changes: 2 additions & 5 deletions contracts/depositor/.cargo/config
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[alias]
wasm = "build --release --target wasm32-unknown-unknown"
wasm-debug = "build --target wasm32-unknown-unknown"
unit-test = "test --lib --features backtraces"
integration-test = "test --test integration"
schema = "run --example schema"
wasm = "build --release --lib --target wasm32-unknown-unknown"
schema = "run --bin schema"
89 changes: 32 additions & 57 deletions contracts/depositor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
[package]
name = "stride-depositor"
version = "0.0.1"
edition = "2021"
name = "covenant-depositor"
edition = { workspace = true }
authors = ["benskey [email protected]"]
description = "Depositor module for stride covenant"
license = "BSD-3"
license = { workspace = true }
repository = { workspace = true }
version = { workspace = true }

exclude = [
"contract.wasm",
"hash.txt",
]


[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 = []

[profile.release]
opt-level = 3
debug = true
Expand All @@ -25,59 +34,25 @@ panic = 'abort'
incremental = false
overflow-checks = true

[features]
# for more explicit tests, cargo test --features=backtraces
backtraces = ["cosmwasm-std/backtraces"]
library = []

[dependencies]
cosmwasm-schema = "1.2.1"
cosmwasm-std = { version = "1.2.4", features = ["ibc3"] }
cw-storage-plus = "1.0.1"
cw-utils = "1.0.1"
cw2 = "1.0.1"
serde = { version = "1.0.145", default-features = false, features = ["derive"] }
thiserror = "1.0.31"
# the sha2 version here is the same as the one used by
# cosmwasm-std. when bumping cosmwasm-std, this should also be
# updated. to find cosmwasm_std's sha function:
# ```cargo tree --package cosmwasm-std```
sha2 = "0.10.6"
neutron-sdk = { git = "https://github.com/neutron-org/neutron-sdk", default-features = false, version = "0.5.0" }
cosmos-sdk-proto = { version = "0.14.0", default-features = false }
protobuf = { version = "3.2.0", features = ["with-bytes"] }
schemars = "0.8.10"
serde-json-wasm = { version = "0.4.1" }
base64 = "0.13.0"
prost = "0.11"
prost-types = "0.11"
bech32 = "0.9.0"

# cosmwasm-schema = { workspace = true }
# cosmwasm-std = { workspace = true }
# cw-storage-plus = { workspace = true }
# serde = { workspace = true }
# cw2 = { workspace = true }
# thiserror = { workspace = true }
# cw-multi-test = { workspace = true }
# neutron-sdk = { workspace = true }
# cosmos-sdk-proto = { workspace = true }
# protobuf = { workspace = true }
# schemars = { workspace = true }
# prost = { workspace = true }
# prost-types = { workspace = true }
# serde-json-wasm = { workspace = true }


# # the sha2 version here is the same as the one used by
# # cosmwasm-std. when bumping cosmwasm-std, this should also be
# # updated. to find cosmwasm_std's sha function:
# # ```cargo tree --package cosmwasm-std```
# sha2 = { workspace = true }
cosmwasm-schema = { workspace = true }
cosmwasm-std = { workspace = true }
cw-storage-plus = { workspace = true }
cw-utils = { workspace = true }
cw2 = { workspace = true }
serde = { workspace = true }
thiserror = { workspace = true }
sha2 = { workspace = true }
neutron-sdk = { workspace = true }
cosmos-sdk-proto = { workspace = true }
protobuf = { workspace = true }
schemars = { workspace = true }
serde-json-wasm = { workspace = true }
base64 = { workspace = true }
prost = { workspace = true }
prost-types = { workspace = true }
bech32 ={ workspace = true }

# dev-dependencies
[dev-dependencies]
cw-multi-test = "0.16.2"
anyhow = { version = "1.0.51" }
# cw-multi-test = { workspace = true }
# anyhow = { workspace = true }
cw-multi-test = { workspace = true }
anyhow = { workspace = true }
2 changes: 1 addition & 1 deletion contracts/depositor/examples/schema.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use cosmwasm_schema::{export_schema, remove_schemas, schema_for};
use stride_depositor::msg::{InstantiateMsg, ExecuteMsg, QueryMsg};
use covenant_depositor::msg::{InstantiateMsg, ExecuteMsg, QueryMsg};
use neutron_sdk::bindings::query::QueryInterchainAccountAddressResponse;
use neutron_sdk::sudo::msg::SudoMsg;
use std::env::current_dir;
Expand Down
2 changes: 1 addition & 1 deletion contracts/depositor/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const ICS_CONNECTION_ID: &str = "connection-1";
const INTERCHAIN_ACCOUNT_ID: &str = "test";
const TRANSFER_PORT: &str = "transfer";

const CONTRACT_NAME: &str = "crates.io:stride-depositor";
const CONTRACT_NAME: &str = "crates.io:covenant-depositor";
const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION");

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
Expand Down
3 changes: 3 additions & 0 deletions contracts/lper/.cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[alias]
wasm = "build --release --lib --target wasm32-unknown-unknown"
schema = "run --bin schema"
46 changes: 46 additions & 0 deletions contracts/lper/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[package]
name = "covenant-lper"
authors = ["benskey [email protected]"]
description = "LP module for stride covenant"
license = { workspace = true }
repository = { workspace = true }
version = { workspace = true }
edition = { workspace = true }

[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-schema = { workspace = true }
cosmwasm-std = { workspace = true }
cw-storage-plus = { workspace = true }
cw-utils = { workspace = true }
cw2 = { workspace = true }
serde = { workspace = true }
thiserror = { workspace = true }
# the sha2 version here is the same as the one used by
# cosmwasm-std. when bumping cosmwasm-std, this should also be
# updated. to find cosmwasm_std's sha function:
# ```cargo tree --package cosmwasm-std```
sha2 = { workspace = true }
neutron-sdk = { workspace = true }
cosmos-sdk-proto = { workspace = true }
protobuf = { workspace = true }
schemars = { workspace = true }
serde-json-wasm = { workspace = true }
base64 = { workspace = true }
prost = { workspace = true }
prost-types = { workspace = true }
bech32 ={ workspace = true }
astroport = "2.8.0"
cw20 = { version = "0.15" }

# dev-dependencies
[dev-dependencies]
cw-multi-test = { workspace = true }
File renamed without changes.
15 changes: 15 additions & 0 deletions contracts/lper/examples/schema.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
use cosmwasm_schema::{export_schema, remove_schemas, schema_for};
use covenant_lper::msg::{InstantiateMsg, ExecuteMsg, QueryMsg};
use std::env::current_dir;
use std::fs::create_dir_all;

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!(QueryMsg), &out_dir);
export_schema(&schema_for!(ExecuteMsg), &out_dir);
}
Loading

0 comments on commit 95538ae

Please sign in to comment.