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(treasury): add swap functionalities through osmosis #126

Merged
merged 22 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
File renamed without changes.
79 changes: 33 additions & 46 deletions Cargo.lock

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

11 changes: 8 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[workspace]
members = ["contracts/*", "packages/*"]
resolver = "2"

[workspace.package]
version = "0.4.19"
Expand All @@ -13,12 +14,16 @@ documentation = "https://docs.milkyway.zone/"
keywords = ["cosmwasm", "milkyway", "cosmos"]

[workspace.dependencies]
cosmwasm-schema = "1.3.1"
cosmwasm-std = {version = "1.4.1"}
bech32 = "0.9.1"
cosmwasm-schema = "1.5.2"
cosmwasm-std = "1.5.2"
cw2 = "1.0.1"
cw-controllers = "1.1.2"
cw-storage-plus = "1.1.0"
cw-utils = "1.0.1"
osmosis-std = "0.20.1"
osmosis-std = "0.25.0"
schemars = "0.8.12"
semver = "1.0.20"
serde = { version = "1.0.155", default-features = false, features = ["derive"] }
thiserror = "1.0.39"

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This repository contains MilkyWay's core contracts that is deployed and operated
| Contract | Description |
| ---------------------------------- | ------------------------------------------------------- |
| [`staking`](./contracts/staking) | Core contract for liquid staking / liquid unstaking TIA |
| [`treasury`](./contracts/treasury) | MilkyWay DAO |
| [`treasury`](./contracts/treasury) | MilkyWay treasury contract |

## Testing

Expand Down
33 changes: 16 additions & 17 deletions contracts/staking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,24 @@ backtraces = ["cosmwasm-std/backtraces"]
library = []

[dependencies]
cosmwasm-schema = { workspace = true }
cosmwasm-std = {version = "1.4.1", features = ["stargate"]}
cw-storage-plus = "1.1.0"
cw2 = { workspace = true }
schemars = { workspace = true }
serde = { workspace = true }
serde_json = "1.0"
thiserror = { workspace = true }
osmosis-std = { workspace = true }
cw-controllers = "1.1.1"
cw-utils = { workspace = true }
milky_way = { path = "../../packages/milky_way" }
bech32 = "0.9.1"
bech32-no_std = "0.7.3"
sha2 = "0.10.8"
prost = {version = "0.11.2", default-features = false, features = ["prost-derive"]}
bech32.workspace = true
manu0466 marked this conversation as resolved.
Show resolved Hide resolved
cw2.workspace = true
cosmwasm-schema.workspace = true
cosmwasm-std = { workspace = true, features = ["stargate"]}
cw-controllers.workspace = true
cw-storage-plus.workspace = true
cw-utils.workspace = true
enum-repr = "0.2.6"
milky_way = { path = "../../packages/milky_way" }
osmosis-std.workspace = true
prost = { version = "0.12.3", default-features = false, features = ["prost-derive"] }
prost-derive = "0.12.3"
semver = "1.0.20"
schemars.workspace = true
serde.workspace = true
serde_json = "1.0"
sha2 = "0.10.8"
thiserror.workspace = true
semver.workspace = true

[dev-dependencies]
cw-multi-test = "0.17.0"
6 changes: 3 additions & 3 deletions contracts/staking/src/ack.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use cosmwasm_schema::cw_serde;
use cosmwasm_std::{to_binary, Binary};
use cosmwasm_std::{to_json_binary, Binary};
use enum_repr::EnumRepr;
/// IBC ACK. See:
/// https://github.com/cosmos/cosmos-sdk/blob/f999b1ff05a4db4a338a855713864497bedd4396/proto/ibc/core/channel/v1/channel.proto#L141-L147
Expand All @@ -11,12 +11,12 @@ pub enum Ack {

pub fn make_ack_success() -> Binary {
let res = Ack::Result(b"1".into());
to_binary(&res).unwrap()
to_json_binary(&res).unwrap()
}

pub fn make_ack_fail(err: String) -> Binary {
let res = Ack::Error(err);
to_binary(&res).unwrap()
to_json_binary(&res).unwrap()
manu0466 marked this conversation as resolved.
Show resolved Hide resolved
}

// reply id
Expand Down
Loading
Loading