Skip to content

Commit

Permalink
Merge pull request #116 from osmosis-labs/ownership-check-on-simple-p…
Browse files Browse the repository at this point in the history
…rice-feeder

Ownership check on simple price feeder
  • Loading branch information
JakeHartnell authored Aug 31, 2023
2 parents b007ced + 5447369 commit 77dc0a7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions contracts/consumer/simple-price-feed/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ impl SimplePriceFeedContract<'_> {
nonpayable(&ctx.info)?;

let mut config = self.config.load(ctx.deps.storage)?;

// Only allow owner to call this
ensure_eq!(
ctx.info.sender,
config.owner,
ContractError::Unauthorized {}
);

config.native_per_foreign = native_per_foreign;
self.config.save(ctx.deps.storage, &config)?;
Ok(Response::new())
Expand Down

0 comments on commit 77dc0a7

Please sign in to comment.