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

fv lock bids reverts fix #18

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions certora/specs/termAuctionBidLocker/locking.spec
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ rule lockBidsRevertConditions(

// support for 2 collateral tokens
TermAuctionBidLockerHarness.TermAuctionBid existingBid = harnessGetInternalBids(bidSubmissions[0].id);
require(existingBid.amount == 0 => existingBid.collateralTokens[0] == 0 && existingBid.collateralTokens[1] == 0); // nonexistent bid will not have existing collateral due to minimum bid requirement.
require(existingBid.amount == 0 => existingBid.collateralAmounts[0] == 0 && existingBid.collateralAmounts[1] == 0); // nonexistent bid will not have existing collateral due to minimum bid requirement.
require(existingBid.collateralTokens[0] == lockingAuctionCollateralTokenOne);
require(existingBid.collateralTokens[1] == lockingAuctionCollateralTokenTwo);
require existingBid.collateralTokens.length == 2;
Expand Down Expand Up @@ -543,7 +543,7 @@ rule lockBidsWithReferralRevertConditions(

// support for 2 collateral tokens
TermAuctionBidLockerHarness.TermAuctionBid existingBid = harnessGetInternalBids(bidSubmissions[0].id);
require(existingBid.amount == 0 => existingBid.collateralTokens[0] == 0 && existingBid.collateralTokens[1] == 0); // nonexistent bid will not have existing collateral due to minimum bid requirement.
require(existingBid.amount == 0 => existingBid.collateralAmounts[0] == 0 && existingBid.collateralAmounts[1] == 0); // nonexistent bid will not have existing collateral due to minimum bid requirement.
require(existingBid.collateralTokens[0] == lockingAuctionCollateralTokenOne);
require(existingBid.collateralTokens[1] == lockingAuctionCollateralTokenTwo);
require existingBid.collateralTokens.length == 2;
Expand Down Expand Up @@ -716,15 +716,15 @@ rule lockRolloverBidRevertConditions(
) {
bool lockingPaused = lockingPaused(); // LockingPaused
bool auctionNotOpen = e.block.timestamp > revealTime(); // AuctionNotOpen
bool nonExistentBid = harnessGetInternalBids(bid.id).amount == 0 && bid.amount == 0; // NonExistentBid
bool nonExistentBid = harnessGetInternalBids(bid.id).amount == 0; // NonExistentBid
bool maxBidCountReached = bid.amount != 0 && bidCount() >= MAX_BID_COUNT(); // MaxBidCountReached
bool nonRolloverBid = bid.amount != 0 && !bid.isRollover; // NonRolloverBid
bool bidAmountTooLow = bid.amount != 0 && bid.amount < minimumTenderAmount(); // BidAmountTooLow
bool invalidPurchaseToken = bid.amount != 0 && bid.purchaseToken != purchaseToken(); // InvalidPurchaseToken

bool isExpectedToRevert = lockingPaused || auctionNotOpen || nonExistentBid || maxBidCountReached || nonRolloverBid || bidAmountTooLow || invalidPurchaseToken;

lockRolloverBid(e, bid);
lockRolloverBid@withrevert(e, bid);

assert lastReverted == isExpectedToRevert,
"lockRolloverBid should revert when one of the revert conditions is reached";
Expand Down
Loading