Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix event argument type and add test for checking event emitting #145

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/crowdsale/CrowdSale.sol
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ contract CrowdSale is ReentrancyGuard, Ownable {
/// @notice emitted when sales owner / beneficiary claims `salesAmount` `auctionTokens` after a non successful sale
event ClaimedAuctionTokens(uint256 indexed saleId);

event FeesUpdated(uint256 feeBp);
event FeesUpdated(uint16 feeBp);

constructor() Ownable() { }

Expand Down
4 changes: 4 additions & 0 deletions test/CrowdSale.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ contract CrowdSaleTest is Test {
FakeERC20 internal biddingToken;
CrowdSale internal crowdSale;

event FeesUpdated(uint16 feeBp);

function setUp() public {
vm.startPrank(deployer);
crowdSale = new CrowdSale();
Expand Down Expand Up @@ -71,6 +73,8 @@ contract CrowdSaleTest is Test {
crowdSale.setCurrentFeesBp(5001);

//10%
vm.expectEmit(true, true, true, true, address(crowdSale));
emit FeesUpdated(1000);
crowdSale.setCurrentFeesBp(1000);
assertEq(crowdSale.currentFeeBp(), 1000);
vm.stopPrank();
Expand Down