Skip to content
Open
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
3 changes: 2 additions & 1 deletion contracts/AllPayAuction.sol
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,10 @@ contract AllPayAuction is Auction {
emit bidPlaced(auctionId, msg.sender, bids[auctionId][msg.sender]);
}

function withdraw(uint256 auctionId) external nonReentrant exists(auctionId) {
function withdraw(uint256 auctionId) external nonReentrant exists(auctionId) onlyAfterDeadline(auctions[auctionId].deadline) {
AuctionData storage auction = auctions[auctionId];
uint256 withdrawAmount = auction.availableFunds;
require(withdrawAmount > 0, 'No funds to withdraw');
auction.availableFunds = 0;
uint256 fees = (auction.protocolFee * withdrawAmount) / 10000;
address feeRecipient = protocolParameters.treasury();
Expand Down
1 change: 1 addition & 0 deletions contracts/EnglishAuction.sol
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ contract EnglishAuction is Auction {
function withdraw(uint256 auctionId) external nonReentrant exists(auctionId) onlyAfterDeadline(auctions[auctionId].deadline) {
AuctionData storage auction = auctions[auctionId];
uint256 withdrawAmount = auction.availableFunds;
require(withdrawAmount > 0, 'No funds to withdraw');
Comment thread
aniket866 marked this conversation as resolved.
auction.availableFunds = 0;
uint256 fees = (auction.protocolFee * withdrawAmount) / 10000;
address feeRecipient = protocolParameters.treasury();
Expand Down
3 changes: 2 additions & 1 deletion contracts/VickreyAuction.sol
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,11 @@ contract VickreyAuction is Auction {
function withdraw(uint256 auctionId) external nonReentrant exists(auctionId) onlyAfterDeadline(auctions[auctionId].bidRevealEnd) {
AuctionData storage auction = auctions[auctionId];
uint256 withdrawAmount = auction.availableFunds;
uint256 commitFeeToTransfer = auction.accumulatedCommitFee;
require(withdrawAmount > 0 || commitFeeToTransfer != 0, 'No funds to withdraw');
auction.availableFunds = 0;
uint256 fees = (auction.protocolFee * withdrawAmount) / 10000;
address feeRecipient = protocolParameters.treasury();
uint256 commitFeeToTransfer = auction.accumulatedCommitFee;
sendERC20(auction.biddingToken, auction.auctioneer, withdrawAmount - fees);
sendERC20(auction.biddingToken, feeRecipient, fees);
if (auction.accumulatedCommitFee != 0) {
Expand Down
Loading