Skip to content

Commit 51e22dc

Browse files
author
Joey Santoro
committed
restrict user flows pre-genesis
1 parent c352e73 commit 51e22dc

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

contracts/bondingcurve/BondingCurve.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ abstract contract BondingCurve is IBondingCurve, OracleRef, PCVSplitter, Timed {
7777
}
7878

7979
/// @notice batch allocate held PCV
80-
function allocate() external override {
80+
function allocate() external override postGenesis {
8181
uint256 amount = getTotalPCVHeld();
8282
require(amount != 0, "BondingCurve: No PCV held");
8383

test/bondingcurve/EthBondingCurve.test.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,19 @@ describe('EthBondingCurve', function () {
421421
});
422422

423423
describe('Allocate', function() {
424+
425+
describe('Pre Launch', function() {
426+
beforeEach(async function() {
427+
this.core = await getCore(false);
428+
await this.core.init({from: governorAddress});
429+
await this.bondingCurve.setCore(this.core.address, {from: governorAddress});
430+
});
431+
432+
it('reverts', async function() {
433+
await expectRevert(this.bondingCurve.allocate({from: keeperAddress}), "CoreRef: Still in Genesis Period");
434+
});
435+
});
436+
424437
describe('No Purchase', function() {
425438
it('reverts', async function() {
426439
await expectRevert(this.bondingCurve.allocate({from: keeperAddress}), "BondingCurve: No PCV held");

0 commit comments

Comments
 (0)