Skip to content

Commit

Permalink
incentives percent must be less than total
Browse files Browse the repository at this point in the history
  • Loading branch information
jummy123 authored and cryptofish7 committed Feb 1, 2022
1 parent c33e2fc commit 065d167
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions contracts/LaunchEvent.sol
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,10 @@ contract LaunchEvent {
_maxAllocation > 0,
"LaunchEvent: max allocation must not be zero"
);
require(
_tokenIncentivesPercent < 1 ether,
"LaunchEvent: token incentives too high"
);

issuer = _issuer;

Expand Down
12 changes: 12 additions & 0 deletions test/LaunchEvent.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,18 @@ describe("launch event contract initialisation", function () {
);
});

it("should revert if incentives percent too high", async function () {
const args = {
...this.validParams,
_tokenIncentivesPercent: ethers.utils.parseEther("1"),
};
await testReverts(
this.RocketFactory,
args,
"LaunchEvent: token incentives too high"
);
});

it("should revert if startime has elapsed", async function () {
const args = {
...this.validParams,
Expand Down

0 comments on commit 065d167

Please sign in to comment.