Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
notV4l committed May 3, 2024
1 parent ff518b0 commit 058ef3e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 8 deletions.
11 changes: 9 additions & 2 deletions token/src/erc1155/erc1155.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,11 @@ mod ERC1155 {
}

fn get_balance(self: @ContractState, account: ContractAddress, id: u256) -> ERC1155Balance {
get!(self.world(), (get_contract_address(), account, TryInto::<u256, felt252>::try_into(id).unwrap()), ERC1155Balance)
get!(
self.world(),
(get_contract_address(), account, TryInto::<u256, felt252>::try_into(id).unwrap()),
ERC1155Balance
)
}

fn get_operator_approval(
Expand Down Expand Up @@ -251,7 +255,10 @@ mod ERC1155 {

fn set_balance(ref self: ContractState, account: ContractAddress, id: u256, amount: u256) {
set!(
self.world(), ERC1155Balance { token: get_contract_address(), account, id: id.try_into().unwrap(), amount }
self.world(),
ERC1155Balance {
token: get_contract_address(), account, id: id.try_into().unwrap(), amount
}
);
}

Expand Down
27 changes: 21 additions & 6 deletions token/src/erc721/erc721.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,19 @@ mod ERC721 {
}

fn get_owner_of(self: @ContractState, token_id: u256) -> ERC721Owner {

get!(self.world(), (get_contract_address(), TryInto::<u256, felt252>::try_into(token_id).unwrap()), ERC721Owner)
get!(
self.world(),
(get_contract_address(), TryInto::<u256, felt252>::try_into(token_id).unwrap()),
ERC721Owner
)
}

fn get_token_approval(self: @ContractState, token_id: u256) -> ERC721TokenApproval {
get!(self.world(), (get_contract_address(), TryInto::<u256, felt252>::try_into(token_id).unwrap()), ERC721TokenApproval)
get!(
self.world(),
(get_contract_address(), TryInto::<u256, felt252>::try_into(token_id).unwrap()),
ERC721TokenApproval
)
}

fn get_operator_approval(
Expand All @@ -246,10 +253,13 @@ mod ERC721 {
token_id: u256,
emit: bool
) {

set!(
self.world(),
ERC721TokenApproval { token: get_contract_address(), token_id: token_id.try_into().unwrap(), address: to, }
ERC721TokenApproval {
token: get_contract_address(),
token_id: token_id.try_into().unwrap(),
address: to,
}
);
if emit {
let approval_event = Approval { owner, approved: to, token_id: token_id };
Expand Down Expand Up @@ -281,7 +291,12 @@ mod ERC721 {
}

fn set_owner(ref self: ContractState, token_id: u256, address: ContractAddress) {
set!(self.world(), ERC721Owner { token: get_contract_address(), token_id: token_id.try_into().unwrap(), address });
set!(
self.world(),
ERC721Owner {
token: get_contract_address(), token_id: token_id.try_into().unwrap(), address
}
);
}
}

Expand Down

0 comments on commit 058ef3e

Please sign in to comment.