Skip to content

Commit

Permalink
feat(pair xASTRO): add virtual pair backed by ASTRO staking contract (#…
Browse files Browse the repository at this point in the history
…433)

* feat(pair xASTRO): add virtual pair backed by ASTRO staking contract

* clippy
  • Loading branch information
epanchee authored Oct 16, 2024
1 parent b9566f2 commit 9c20f5a
Show file tree
Hide file tree
Showing 44 changed files with 4,491 additions and 31 deletions.
44 changes: 32 additions & 12 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ members = [
"contracts/pair_astro_converter",
"contracts/pair_transmuter",
# "contracts/pair_concentrated_inj", TODO: rewrite OB liquidity deployment
"contracts/pair_xastro",
"contracts/pair_xyk_sale_tax",
"contracts/router",
"contracts/whitelist",
Expand All @@ -24,7 +25,7 @@ thiserror = "1.0"
itertools = "0.12"
cosmwasm-schema = "1.5"
cw-utils = "1"
astroport = { path = "./packages/astroport", version = "5.4.0" }
astroport = { path = "./packages/astroport", version = "5.6.0" }

[profile.release]
opt-level = "z"
Expand Down
6 changes: 6 additions & 0 deletions contracts/pair_xastro/.cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[alias]
wasm = "build --release --target wasm32-unknown-unknown"
wasm-debug = "build --target wasm32-unknown-unknown"
unit-test = "test --lib"
integration-test = "test --test integration"
schema = "run --example pair_schema"
11 changes: 11 additions & 0 deletions contracts/pair_xastro/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.rs]
indent_size = 4
33 changes: 33 additions & 0 deletions contracts/pair_xastro/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[package]
name = "astroport-pair-xastro"
version = "1.0.0"
authors = ["Astroport"]
edition = "2021"
description = "Astroport virtual pair for ASTRO<>xASTRO conversion backed by staking contract"
license = "GPL-3.0-only"
repository = "https://github.com/astroport-fi/astroport"
homepage = "https://astroport.fi"

[lib]
crate-type = ["cdylib", "rlib"]

[features]
backtraces = ["cosmwasm-std/backtraces"]
library = []

[dependencies]
astroport.workspace = true
cw2.workspace = true
cosmwasm-std = { workspace = true, features = ["cosmwasm_1_1", "stargate"] }
cw-storage-plus.workspace = true
thiserror.workspace = true
cosmwasm-schema.workspace = true

[dev-dependencies]
anyhow = "1"
derivative = "2.2"
itertools.workspace = true
astroport-test = { path = "../../packages/astroport_test" }
astroport-factory = { path = "../factory" }
astroport-staking = { path = "../tokenomics/staking" }
astroport-tokenfactory-tracker = "1.0.0"
1 change: 1 addition & 0 deletions contracts/pair_xastro/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Astroport ASTRO<>xASTRO virtual pair backed by staking contract.
11 changes: 11 additions & 0 deletions contracts/pair_xastro/examples/pair_xastro_schema.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
use cosmwasm_schema::write_api;

use astroport::pair::{ExecuteMsg, InstantiateMsg, QueryMsg};

fn main() {
write_api! {
instantiate: InstantiateMsg,
query: QueryMsg,
execute: ExecuteMsg,
}
}
15 changes: 15 additions & 0 deletions contracts/pair_xastro/rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# stable
newline_style = "unix"
hard_tabs = false
tab_spaces = 4

# unstable... should we require `rustup run nightly cargo fmt` ?
# or just update the style guide when they are stable?
#fn_single_line = true
#format_code_in_doc_comments = true
#overflow_delimited_expr = true
#reorder_impl_items = true
#struct_field_align_threshold = 20
#struct_lit_single_line = true
#report_todo = "Always"

Loading

0 comments on commit 9c20f5a

Please sign in to comment.