Skip to content

Commit

Permalink
add missing check for owner
Browse files Browse the repository at this point in the history
  • Loading branch information
caglavol committed Jan 30, 2024
1 parent cea6fbe commit 7e85b0d
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions contracts/src/manager/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,12 @@ mod manager {
self.markets.clone()
}

#[ink(message)]
pub fn increment_id(&mut self) -> u128 {
let id = self.incremented_id.clone();
self.incremented_id = self.incremented_id.saturating_add(1);
id
}

#[ink(message)]
pub fn add_collateral_asset(&mut self, asset: AccountId) -> Result<(), ManagerError> {
if self.env().caller() != self.owner {
return Err(ManagerError::NotOwner);
}

let mut vault: contract_ref!(CollateralVault) = self.vault.into();
vault.add_asset(asset)
.map_err(|err| ManagerError::VaultError(err))
Expand Down

0 comments on commit 7e85b0d

Please sign in to comment.