-
Notifications
You must be signed in to change notification settings - Fork 95
Add Mint Cap to Bonding Curve #119
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,6 +61,8 @@ describe('BondingCurve', function () { | |
|
|
||
| await this.token.mint(userAddress, '1000000000000000000000000'); | ||
| await this.core.grantMinter(this.bondingCurve.address, {from: governorAddress}); | ||
|
|
||
| await this.bondingCurve.setMintCap(this.scale.mul(new BN('10')), {from: governorAddress}); | ||
| }); | ||
|
|
||
| describe('Init', function() { | ||
|
|
@@ -270,7 +272,16 @@ describe('BondingCurve', function () { | |
| }); | ||
| }); | ||
| }); | ||
|
|
||
| describe('Exceeding cap', function() { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't tell if there is a test in this file that buys under the mint cap to check that its still possible to buy even with the mint cap on
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To add to this point, I only see purchasing happening in the before each hook and we don't verify the fei they received. Recommend adding a test purchasing from the bonding curve that actually succeeds. After the success, we should verify FEI balances and that the bonding curve or receiving contract's eth balance incremented.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are tests for the FEI being received higher up in the file |
||
| it('reverts', async function() { | ||
| this.purchaseAmount = new BN('4000000000'); | ||
| await this.token.approve(this.bondingCurve.address, this.purchaseAmount, {from: userAddress}); | ||
| await expectRevert( | ||
| this.bondingCurve.purchase(userAddress, this.purchaseAmount, {from: userAddress}), | ||
| 'BondingCurve: exceeds mint cap' | ||
| ); | ||
| }); | ||
| }); | ||
| describe('Crossing Scale', function() { | ||
| beforeEach(async function() { | ||
| this.purchaseAmount = new BN('400000000'); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we upgrade the contracts, are we doing it with a proxy/storage pattern or some other method?
If we are using a proxy/storage pattern, the variable should be added after BASIS_POINTS_GRANULARITY.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't use proxy/storage its just drop-and-replace