Skip to content

Commit

Permalink
emit event when creating a party
Browse files Browse the repository at this point in the history
  • Loading branch information
arr00 committed Jan 23, 2024
1 parent e2a8112 commit 4d4b1f6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions contracts/authorities/BondingCurveAuthority.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ contract BondingCurveAuthority {
error DistributionsNotSupported();
error NeedAtLeastOneHost();

event BondingCurvePartyCreated(Party indexed party, address indexed creator);
event TreasuryFeeUpdated(uint16 previousTreasuryFee, uint16 newTreasuryFee);
event PartyDaoFeeUpdated(uint16 previousPartyDaoFee, uint16 newPartyDaoFee);
event CreatorFeeUpdated(uint16 previousCreatorFee, uint16 newCreatorFee);
Expand Down Expand Up @@ -171,6 +172,8 @@ contract BondingCurveAuthority {
b: partyOpts.b
});

emit BondingCurvePartyCreated(party, msg.sender);

buyPartyCards(party, amountToBuy, address(0));
}

Expand Down Expand Up @@ -216,6 +219,8 @@ contract BondingCurveAuthority {
b: partyOpts.b
});

emit BondingCurvePartyCreated(party, msg.sender);

buyPartyCards(party, amountToBuy, address(0));
}

Expand Down
3 changes: 3 additions & 0 deletions test/authorities/BondingCurveAuthority.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { Test } from "forge-std/Test.sol";
import { IERC721 } from "contracts/tokens/IERC721.sol";

contract BondingCurveAuthorityTest is SetupPartyHelper {
event BondingCurvePartyCreated(Party indexed party, address indexed creator);
event TreasuryFeeUpdated(uint16 previousTreasuryFee, uint16 newTreasuryFee);
event PartyDaoFeeUpdated(uint16 previousPartyDaoFee, uint16 newPartyDaoFee);
event CreatorFeeUpdated(uint16 previousCreatorFee, uint16 newCreatorFee);
Expand Down Expand Up @@ -90,6 +91,8 @@ contract BondingCurveAuthorityTest is SetupPartyHelper {
);

vm.deal(creator, initialPrice);
vm.expectEmit(false, true, true, true); // Don't check party address so we don't have to derive it
emit BondingCurvePartyCreated(Party(payable(address(0))), creator);
vm.prank(creator);
party = authority.createParty{ value: initialPrice }(
BondingCurveAuthority.BondingCurvePartyOptions({
Expand Down

0 comments on commit 4d4b1f6

Please sign in to comment.