Skip to content

Price feed oracle implement flex multisig interface

License

Notifications You must be signed in to change notification settings

OrchaiLowcodeDefi/cw-oracle-hub

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CW Oracle Hub

The CW Oracle Hub contains the logic for oracle price feeding.

CosmWasm Integration

To invoke the pricefeed contract at the end of each round, set the cw-oracle-hub address as the admin and add the following code to your contract:

// msg.rs
#[cw_serde]
pub enum SudoMsg {
    AppendPrice {
        key: String,
        price: Uint128,
        timestamp: u64,
     },
}

// contract.rs
#[cfg_attr(not(feature = "library"), entry_point)]
pub fn execute(deps: DepsMut, _env: Env, msg: SudoMsg) -> Result<Response, ContractError> {
    match msg {
        ExecuteMsg::AppendPrice {
            key,
            price,
            timestamp,
        } => append_price(deps, info, key, price, timestamp),
    }
}

About

Price feed oracle implement flex multisig interface

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 99.0%
  • Makefile 1.0%