Skip to content

Commit

Permalink
fix: signing
Browse files Browse the repository at this point in the history
  • Loading branch information
Picodes committed Feb 5, 2024
1 parent 4a4ee02 commit 19b1eb9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions contracts/DistributionCreator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,8 @@ contract DistributionCreator is UUPSHelper, ReentrancyGuardUpgradeable {
uint256 rewardTokenMinAmount = rewardTokenMinAmounts[newCampaign.rewardToken];
// if epoch parameters lead to a past campaign
if (newCampaign.startTimestamp < block.timestamp) revert CampaignSouldStartInFuture();
// if the campaign doesn't last at least one second
if (newCampaign.duration == 0) revert CampaignDurationIsZero();
// if the campaign doesn't last at least one hour
if (newCampaign.duration < HOUR) revert CampaignDurationBelowHour();
// if the reward token is not whitelisted as an incentive token
if (rewardTokenMinAmount == 0) revert CampaignRewardTokenNotWhitelisted();
// if the amount distributed is too small with respect to what is allowed
Expand Down
2 changes: 1 addition & 1 deletion contracts/utils/Errors.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pragma solidity ^0.8.17;

error CampaignDoesNotExist();
error CampaignAlreadyExists();
error CampaignDurationIsZero();
error CampaignDurationBelowHour();
error CampaignRewardTokenNotWhitelisted();
error CampaignRewardTooLow();
error CampaignSouldStartInFuture();
Expand Down
4 changes: 2 additions & 2 deletions test/foundry/unit/DistributionCreator.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ contract Test_DistributionCreator_CreateDistribution is DistributionCreatorTest
rewardId: keccak256("TEST"),
additionalData: hex""
});
vm.expectRevert(CampaignDurationIsZero.selector);
vm.expectRevert(CampaignDurationBelowHour.selector);

vm.prank(alice);
creator.createDistribution(distribution);
Expand Down Expand Up @@ -377,7 +377,7 @@ contract Test_DistributionCreator_CreateCampaign is DistributionCreatorTest {
startTimestamp: uint32(block.timestamp + 1),
duration: 0
});
vm.expectRevert(CampaignDurationIsZero.selector);
vm.expectRevert(CampaignDurationBelowHour.selector);

vm.prank(alice);
creator.createCampaign(campaign);
Expand Down

0 comments on commit 19b1eb9

Please sign in to comment.