Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
SwayStar123 committed Sep 11, 2024
1 parent 731e5a2 commit 6948958
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 37 deletions.
14 changes: 2 additions & 12 deletions examples/src6-vault/multi_asset_vault/src/main.sw
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,7 @@ pub fn _mint(
let new_supply = supply.unwrap_or(0) + amount;
storage.total_supply.insert(asset_id, new_supply);
mint_to(recipient, vault_sub_id, amount);
TotalSupplyEvent::new(
asset_id,
new_supply,
msg_sender()
.unwrap(),
)
TotalSupplyEvent::new(asset_id, new_supply, msg_sender().unwrap())
.log();
}

Expand All @@ -319,11 +314,6 @@ pub fn _burn(asset_id: AssetId, vault_sub_id: SubId, amount: u64) {
let new_supply = supply - amount;
storage.total_supply.insert(asset_id, new_supply);
burn(vault_sub_id, amount);
TotalSupplyEvent::new(
asset_id,
new_supply,
msg_sender()
.unwrap(),
)
TotalSupplyEvent::new(asset_id, new_supply, msg_sender().unwrap())
.log();
}
15 changes: 2 additions & 13 deletions examples/src6-vault/single_asset_single_sub_vault/src/main.sw
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ storage {
managed_assets: u64 = 0,
/// The total amount of shares minted by this vault.
total_supply: u64 = 0,

/// The name of a specific asset minted by this contract.
name: StorageString = StorageString {},
/// The symbol of a specific asset minted by this contract.
Expand Down Expand Up @@ -287,12 +286,7 @@ pub fn _mint(recipient: Identity, amount: u64) {
let new_supply = supply + amount;
storage.total_supply.write(new_supply);
mint_to(recipient, PRE_CALCULATED_SHARE_VAULT_SUB_ID, amount);
TotalSupplyEvent::new(
vault_assetid(),
new_supply,
msg_sender()
.unwrap(),
)
TotalSupplyEvent::new(vault_assetid(), new_supply, msg_sender().unwrap())
.log();
}

Expand All @@ -309,11 +303,6 @@ pub fn _burn(asset_id: AssetId, amount: u64) {
let new_supply = supply - amount;
storage.total_supply.write(new_supply);
burn(PRE_CALCULATED_SHARE_VAULT_SUB_ID, amount);
TotalSupplyEvent::new(
vault_assetid(),
new_supply,
msg_sender()
.unwrap(),
)
TotalSupplyEvent::new(vault_assetid(), new_supply, msg_sender().unwrap())
.log();
}
14 changes: 2 additions & 12 deletions examples/src6-vault/single_asset_vault/src/main.sw
Original file line number Diff line number Diff line change
Expand Up @@ -311,12 +311,7 @@ pub fn _mint(
let new_supply = supply.unwrap_or(0) + amount;
storage.total_supply.insert(asset_id, new_supply);
mint_to(recipient, vault_sub_id, amount);
TotalSupplyEvent::new(
asset_id,
new_supply,
msg_sender()
.unwrap(),
)
TotalSupplyEvent::new(asset_id, new_supply, msg_sender().unwrap())
.log();
}

Expand All @@ -333,11 +328,6 @@ pub fn _burn(asset_id: AssetId, vault_sub_id: SubId, amount: u64) {
let new_supply = supply - amount;
storage.total_supply.insert(asset_id, new_supply);
burn(vault_sub_id, amount);
TotalSupplyEvent::new(
asset_id,
new_supply,
msg_sender()
.unwrap(),
)
TotalSupplyEvent::new(asset_id, new_supply, msg_sender().unwrap())
.log();
}

0 comments on commit 6948958

Please sign in to comment.