0
 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 1

0

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");

1
  • 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?
    – Salman
    Nov 11, 2021 at 7:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.