Skip to content
This repository has been archived by the owner on Jan 18, 2023. It is now read-only.

Commit

Permalink
Add restriction to minimumBid being at most 1% of market cap. (#569)
Browse files Browse the repository at this point in the history
Add restriction to minimumBid being at most 1% of market cap.
  • Loading branch information
bweick committed Jan 10, 2020
1 parent 58d9d40 commit 501ecd0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions contracts/core/liquidators/impl/LinearAuction.sol
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ contract LinearAuction is Auction {

// remainingCurrentSets must be greater than minimumBid or no bidding would be allowed
require(
_startingCurrentSetQuantity >= minimumBid,
"Auction.initializeAuction: Not enough collateral to rebalance"
_startingCurrentSetQuantity.div(minimumBid) >= 100,
"Auction.initializeAuction: Minimum bid must be less than or equal to 1% of collateral."
);

_linearAuction.auction.minimumBid = minimumBid;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "set-protocol-contracts",
"version": "1.3.17-beta",
"version": "1.3.18-beta",
"description": "Smart contracts for {Set} Protocol",
"main": "dist/artifacts/index.js",
"typings": "dist/typings/artifacts/index.d.ts",
Expand Down
10 changes: 10 additions & 0 deletions test/contracts/core/liquidators/impl/linearAuction.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,16 @@ contract('LinearAuction', accounts => {
await expectRevertError(subject());
});
});

describe('when there is insufficient collateral to rebalance', async () => {
beforeEach(async () => {
subjectStartingCurrentSetQuantity = gWei(199);
});

it('should revert', async () => {
await expectRevertError(subject());
});
});
});

describe('[CONTEXT] Initialized auction', async () => {
Expand Down

0 comments on commit 501ecd0

Please sign in to comment.