Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
219 changes: 160 additions & 59 deletions src/sales/SettlementSale.sol

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/sales/SettlementSaleFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {SettlementSale} from "sales/SettlementSale.sol";
/// @notice A permissionless factory for creating SettlementSale clones using the minimal proxy pattern (EIP-1167).
/// @dev Anyone can create a new sale by calling `createSale`. The caller provides all initialization parameters.
/// @custom:security-contact security@echo.xyz
contract SettlementSaleFactory is Versioned(1, 0, 0) {
contract SettlementSaleFactory is Versioned(2, 0, 0) {
/// @notice Emitted when a new sale is created.
/// @param saleUUID The unique identifier for the sale on the sonar platform.
/// @param saleAddress The address of the newly created sale contract.
Expand Down
12 changes: 7 additions & 5 deletions test/BidSubmission.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ contract SettlementSaleBidTestBase is SettlementSaleBaseTest {
vm.expectEmit(true, true, true, true, address(sale));
emit SettlementSale.BidPlaced(entityID, user, bid);

vm.expectEmit(true, true, true, true, address(sale));
emit SettlementSale.CommitmentIncreased(entityID, user, address(token), amountDelta);

{
bytes memory purchasePermitSignature = signPurchasePermit(purchasePermit);

Expand Down Expand Up @@ -545,18 +548,18 @@ contract SettlementSaleBidTest is SettlementSaleBidTestBase {
assertEq(sale.entityStateByID(aliceID).currentBid.amount, 2000e6);
}

function testBid_AfterClose_Reverts() public {
function testBid_AfterCancellation_Reverts() public {
bidSuccess({user: alice, price: 10, amount: 1000e6, token: usdc});

closeCommitment();
assertEq(uint8(sale.stage()), uint8(SettlementSale.Stage.Closed));
openCancellation();
assertEq(uint8(sale.stage()), uint8(SettlementSale.Stage.Cancellation));

bidFail({
user: alice,
price: 10,
amount: 1000e6,
token: usdc,
err: encodeInvalidStage(SettlementSale.Stage.Closed, SettlementSale.Stage.Commitment)
err: encodeInvalidStage(SettlementSale.Stage.Cancellation, SettlementSale.Stage.Commitment)
});
}

Expand Down Expand Up @@ -771,7 +774,6 @@ contract SettlementSaleBidAfterRefundTest is SettlementSaleBidTestBase {
// Alice places a bid
doBid({user: alice, amount: 2000e6, price: 10, token: usdc});

closeCommitment();
openCancellation();

// Alice cancels (gets refunded)
Expand Down
Loading