Skip to content

Commit

Permalink
milkyway derivative oracle (#47)
Browse files Browse the repository at this point in the history
* milkyway derivative oracle

* adding cargo lock
  • Loading branch information
DrPresident authored Nov 4, 2024
1 parent 1c52f9d commit 82654cb
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Cargo.lock

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

21 changes: 21 additions & 0 deletions contracts/staking_derivatives/milkyway/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "milkyway_staking_derivatives_oracle"
version = "0.1.0"
authors = ["sbeem <[email protected]>", "scrtreddev <[email protected]", "hoomp"]
edition = "2021"

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

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

[features]
default = []
library = []

[dependencies]
cosmwasm-std = { workspace = true }
shade-oracles = { path = "../../../packages/shade_oracles", features = ["derivatives"] }
33 changes: 33 additions & 0 deletions contracts/staking_derivatives/milkyway/src/contract.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
use cosmwasm_std::{entry_point, Deps, Env, Response, StdResult};
use cosmwasm_std::{DepsMut, MessageInfo, QueryResponse};
use shade_oracles::interfaces::common::config::BotPermission;
use shade_oracles::interfaces::derivatives::bot::*;

const ACTION_PREFIX: &str = "milkyway-staking-derivatives-oracle_";

#[cfg_attr(not(feature = "library"), entry_point)]
pub fn instantiate(
deps: DepsMut,
_env: Env,
_info: MessageInfo,
msg: InstantiateMsg,
) -> StdResult<Response> {
BotStakingDerivativesOracle::instantiate(deps, msg)
}

#[cfg_attr(not(feature = "library"), entry_point)]
pub fn execute(deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg) -> StdResult<Response> {
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<QueryResponse> {
BotStakingDerivativesOracle::query(deps, env, msg)
}
1 change: 1 addition & 0 deletions contracts/staking_derivatives/milkyway/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod contract;
4 changes: 4 additions & 0 deletions packages/shade_oracles/src/interfaces/common/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub enum BotPermission {
UpdateQuicksilverRates,
UpdateLidoRates,
UpdateIstPrice,
UpdateMilkyWayRates,
UpdateErisRates,
UpdateDropRates,
}
Expand All @@ -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),
}
Expand Down

0 comments on commit 82654cb

Please sign in to comment.