From 82654cbabefe290a18b88cc72c738b704b71b4ab Mon Sep 17 00:00:00 2001 From: Jack Swenson Date: Mon, 4 Nov 2024 11:06:02 -0600 Subject: [PATCH] milkyway derivative oracle (#47) * milkyway derivative oracle * adding cargo lock --- Cargo.lock | 8 +++++ .../staking_derivatives/milkyway/Cargo.toml | 21 ++++++++++++ .../milkyway/src/contract.rs | 33 +++++++++++++++++++ .../staking_derivatives/milkyway/src/lib.rs | 1 + .../src/interfaces/common/config.rs | 4 +++ 5 files changed, 67 insertions(+) create mode 100644 contracts/staking_derivatives/milkyway/Cargo.toml create mode 100644 contracts/staking_derivatives/milkyway/src/contract.rs create mode 100644 contracts/staking_derivatives/milkyway/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index a3889d22..f3c01a7b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -742,6 +742,14 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "milkyway_staking_derivatives_oracle" +version = "0.1.0" +dependencies = [ + "secret-cosmwasm-std", + "shade-oracles", +] + [[package]] name = "mock_band" version = "0.2.0" diff --git a/contracts/staking_derivatives/milkyway/Cargo.toml b/contracts/staking_derivatives/milkyway/Cargo.toml new file mode 100644 index 00000000..4721398b --- /dev/null +++ b/contracts/staking_derivatives/milkyway/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "milkyway_staking_derivatives_oracle" +version = "0.1.0" +authors = ["sbeem ", "scrtreddev StdResult { + BotStakingDerivativesOracle::instantiate(deps, msg) +} + +#[cfg_attr(not(feature = "library"), entry_point)] +pub fn execute(deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg) -> StdResult { + BotStakingDerivativesOracle::execute( + deps, + env, + info, + msg, + BotPermission::UpdateMilkyWayRates, + ACTION_PREFIX, + ) +} + +#[cfg_attr(not(feature = "library"), entry_point)] +pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> StdResult { + BotStakingDerivativesOracle::query(deps, env, msg) +} diff --git a/contracts/staking_derivatives/milkyway/src/lib.rs b/contracts/staking_derivatives/milkyway/src/lib.rs new file mode 100644 index 00000000..2943dbb5 --- /dev/null +++ b/contracts/staking_derivatives/milkyway/src/lib.rs @@ -0,0 +1 @@ +pub mod contract; diff --git a/packages/shade_oracles/src/interfaces/common/config.rs b/packages/shade_oracles/src/interfaces/common/config.rs index da1ef022..9e255164 100644 --- a/packages/shade_oracles/src/interfaces/common/config.rs +++ b/packages/shade_oracles/src/interfaces/common/config.rs @@ -19,6 +19,7 @@ pub enum BotPermission { UpdateQuicksilverRates, UpdateLidoRates, UpdateIstPrice, + UpdateMilkyWayRates, UpdateErisRates, UpdateDropRates, } @@ -37,6 +38,9 @@ impl ToString for BotPermission { } BotPermission::UpdateLidoRates => format!("{}LIDO_RATES_BOT", PERMISSION_PREFIX), BotPermission::UpdateIstPrice => format!("{}IST_PRICE_BOT", PERMISSION_PREFIX), + BotPermission::UpdateMilkyWayRates => { + format!("{}MILKY_WAY_PRICE_BOT", PERMISSION_PREFIX) + } BotPermission::UpdateErisRates => format!("{}ERIS_PRICE_BOT", PERMISSION_PREFIX), BotPermission::UpdateDropRates => format!("{}DROP_PRICE_BOT", PERMISSION_PREFIX), }