Skip to content

Commit

Permalink
fix: owner check removed in addAdmin in xcall-mock-connection (#715)
Browse files Browse the repository at this point in the history
  • Loading branch information
gcranju authored Sep 12, 2023
1 parent 0f1e764 commit 666e05b
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions contracts/cosmwasm-vm/cw-mock-ibc-connection/src/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,12 @@ impl<'a> CwIbcConnection<'a> {
pub fn add_admin(
&self,
store: &mut dyn Storage,
info: MessageInfo,
_info: MessageInfo,
admin: String,
) -> Result<Response, ContractError> {
if admin.is_empty() {
return Err(ContractError::AdminAddressCannotBeNull {});
}

let owner = self
.owner()
.load(store)
.map_err(|_| ContractError::Unauthorized {})?;

if info.sender != owner {
return Err(ContractError::Unauthorized {});
}
self.admin().save(store, &admin)?;
Ok(Response::new()
.add_attribute("method", "add_admin")
Expand Down

0 comments on commit 666e05b

Please sign in to comment.