Skip to content

Commit

Permalink
format scarb check
Browse files Browse the repository at this point in the history
  • Loading branch information
MSghais committed Jun 18, 2024
1 parent 3e919fe commit 8506728
Showing 1 changed file with 32 additions and 6 deletions.
38 changes: 32 additions & 6 deletions onchain/src/social/deposit.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub trait IDepositEscrow<TContractState> {
#[derive(Drop, starknet::Event)]
struct ClaimEvent {
#[key]
deposit_id:DepositId,
deposit_id: DepositId,
sender: ContractAddress,
amount: u256,
token_address: ContractAddress,
Expand All @@ -53,7 +53,7 @@ struct ClaimEvent {
#[derive(Drop, starknet::Event)]
struct DepositEvent {
#[key]
deposit_id:DepositId,
deposit_id: DepositId,
sender: ContractAddress,
amount: u256,
token_address: ContractAddress,
Expand Down Expand Up @@ -81,7 +81,6 @@ struct TransferEvent {
}



#[starknet::contract]
pub mod DepositEscrow {
use core::num::traits::Zero;
Expand Down Expand Up @@ -173,7 +172,16 @@ pub mod DepositEscrow {
ttl: get_block_timestamp() + timelock
}
);
self.emit(DepositEvent { deposit_id:deposit_id+1, sender:get_caller_address(), recipient:nostr_recipient, amount:amount, token_address:token_address });
self
.emit(
DepositEvent {
deposit_id: deposit_id + 1,
sender: get_caller_address(),
recipient: nostr_recipient,
amount: amount,
token_address: token_address
}
);

DepositResult::Deposit(deposit_id)
}
Expand All @@ -190,7 +198,16 @@ pub mod DepositEscrow {

erc20.transfer(get_caller_address(), deposit.amount);
self.deposits.write(deposit_id, Default::default());
self.emit(CancelEvent {deposit_id:deposit_id, sender:get_caller_address(), recipient:deposit.recipient, amount:deposit.amount, token_address:deposit.token_address });
self
.emit(
CancelEvent {
deposit_id: deposit_id,
sender: get_caller_address(),
recipient: deposit.recipient,
amount: deposit.amount,
token_address: deposit.token_address
}
);
}

fn claim(ref self: ContractState, request: SocialRequest<DepositId>) {
Expand All @@ -205,7 +222,16 @@ pub mod DepositEscrow {

self.nostr_to_sn.write(request.public_key, get_caller_address());
self.deposits.write(deposit_id, Default::default());
self.emit(ClaimEvent { deposit_id:deposit_id, sender:get_caller_address(), recipient:request.public_key, amount:deposit.amount, token_address:deposit.token_address });
self
.emit(
ClaimEvent {
deposit_id: deposit_id,
sender: get_caller_address(),
recipient: request.public_key,
amount: deposit.amount,
token_address: deposit.token_address
}
);
}
}
}
Expand Down

0 comments on commit 8506728

Please sign in to comment.