Code has been added to clipboard!

Ending the Solidity Auction

Example
function auctionEnd() public {

        require(now >= auctionEndTime, "Auction hasn’t ended yet.");
        require(!ended, "auctionEnd has already been called.");


        ended = true;
        emit AuctionEnded(highestBidder, highestBid);


        beneficiary.transfer(highestBid);
    }
}