0

when i compile a simple code ,i catch with "[solc] Expected primary expression."under the code

if (highestBidder != 0) {
          highestBidder.send((highestBid),
        }

.i know that there is some wrong about the code format ,but i do not know how to modify it ?

pragma solidity ^0.4.4;
contract SimpleAuction {

  address public beneficiary;
  uint public auctionStart;
  uint public biddingTime;


  address public highestBidder;

  uint public highestBid;


  bool ended;


  event HighestBidIncreased(address bidder, uint amount);

  event AuctionEnded(address winner, uint amount);


  function SimpleAuction(uint _biddingTime, address _beneficiary) {
    beneficiary = _beneficiary;
    auctionStart = now;
    biddingTime = _biddingTime;
  }


  function bid() {

    require(condition, message); (now > auctionStart + biddingTime) ;


    require(condition, message); (msg.value <= highestBid);



    if (highestBidder != 0) {
      highestBidder.send((highestBid),
    }
    highestBidder = msg.sender;
    highestBid = msg.value;
    HighestBidIncreased(msg.sender, msg.value);
  }

  function auctionEnd() {
    require(condition, message); (now <= auctionStart + biddingTime);
    require(condition, message); (ended);
    AuctionEnded(highestBidder, highestBid);

    beneficiary.send(this.balance);
    ended = true;
  }

  function () {
    throw;
  }
}
1

Change send((highestBid), to send(highestBid);!!!

And keep in mind that Solidity is not a language where you can just add some random characters to an expression and hope it will compile (pretty much like any other language, except for interpreted languages, where you can replace the word "compile" with "run").

  • By the way, going over the rest of your code, there seem to be a whole bunch of other problems there, like the pattern require(condition, message); (some_condition);. You might want to learn the language basics to begin with... – goodvibration Jul 23 '18 at 6:24

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.