Skip to content

Commit

Permalink
Merge pull request #155 from EmmanuelAR/format_issues
Browse files Browse the repository at this point in the history
fix format and remove comments
  • Loading branch information
EmmanuelAR authored Oct 25, 2024
2 parents 85b45cd + 9ecf02d commit 87dd170
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions contracts/src/fund.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,12 @@ mod Fund {
// *************************************************************************
// EVENTS
// *************************************************************************

#[event]
#[derive(Drop, starknet::Event)]
enum Event {
DonationWithdraw: DonationWithdraw,
}
// Struct DonationWithdraw

#[derive(Drop, starknet::Event)]
pub struct DonationWithdraw {
#[key]
Expand Down Expand Up @@ -175,12 +174,14 @@ mod Fund {
starknet_dispatcher.transfer(self.getOwner(), balance);
assert(self.getCurrentGoalState() != 0, 'Fund hasnt reached its goal yet');
self.setState(4);
// Emit Event DonationWithdraw (amount=balance)
self.emit(DonationWithdraw {
owner_address: self.getOwner(),
fund_contract_address: get_contract_address(),
withdrawn_amount: balance
});
self
.emit(
DonationWithdraw {
owner_address: self.getOwner(),
fund_contract_address: get_contract_address(),
withdrawn_amount: balance
}
);
}
}
}

0 comments on commit 87dd170

Please sign in to comment.