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

No purchase after early genesis #11

Merged
merged 1 commit into from Jan 28, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion contracts/genesis/GenesisGroup.sol
Expand Up @@ -71,7 +71,7 @@ contract GenesisGroup is IGenesisGroup, CoreRef, ERC20, ERC20Burnable, Timed {
}

modifier onlyGenesisPeriod() {
require(!isTimeEnded(), "GenesisGroup: Not in Genesis Period");
require(!isTimeEnded() && !core().hasGenesisGroupCompleted(), "GenesisGroup: Not in Genesis Period");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you still need !isTimeEnded()? This would prevent purchases after the time has ended even if the launch hasn't happend yet. Is that the intention?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this is intended!

_;
}

Expand Down
9 changes: 8 additions & 1 deletion test/genesis/GenesisGroup.test.js
Expand Up @@ -158,8 +158,15 @@ describe('GenesisGroup', function () {
it('inits Bonding Curve Oracle', async function() {
expect(await this.bo.initPrice()).to.be.bignumber.equal(new BN('950000000000000000'));
});
});

it('reverts purchase', async function() {
await expectRevert(this.genesisGroup.purchase(userAddress, 100, {from: userAddress, value: 100}), "GenesisGroup: Not in Genesis Period");
});

it('reverts pre-commit', async function() {
await expectRevert(this.genesisGroup.commit(userAddress, userAddress, '500', {from: userAddress}), "GenesisGroup: Not in Genesis Period");
});
});
});

describe('Redeem', function() {
Expand Down