function bid(bytes32 _blindedBid)
public
payable
onlyBefore(biddingEnd)
{
// If the bid is not higher, send the money back
// (the failing require will revert all changes in this function execution including it having received the money).
require(msg.value >= minBid, "Your bid is lower then minimum bidding amount. Try bidding higher!");
bids[msg.sender].push(Bid({
blindedBid: _blindedBid,
deposit: msg.value
}));
}
1 Answer
You can, for instance, have a mapping of addresses having already placed a bid and a require based on it
mapping(address=>bool) alreadyBid;
then require(!alreadyBid[msg.sender], "max bid reachded");
-
I make a contract in which i am making a multiple auction using singal contract and bidders can bid. But i want to add functionality when bidder place a bid he can selet auction from multiple auctions. IS there any solution?– SalmanNov 11, 2021 at 7:13