I am trying to use external modifier however I getting error as below code.

    require(block.timestamp < start + buyPeriod);
    require(1 ether == msg.sender);<--- error got here
    require(_tickets[msg.sender] == 0);
    _tickets[msg.sender] = hash;
    return true;
Getting error as Getting TypeError: Operator == not compatible with 
types int_const 1000000000000000000 and address payable.

Could anyone can help me to fixed it?

  • 2
    1 ether == msg.sender? What the hell does that even mean??? (pardon my French). Jan 27 '19 at 8:54
  • Sorry @ goodvibration, Its my bad Its should be msg.value. I need some sleep as I am doing silly mistake in code. Jan 27 '19 at 9:02

Maybe you meant msg.value instead of msg.sender? You're currently comparing a number (1 ether) to the address of the account that called your function.

If you meant to be checking the amount of ether that was sent in the transaction, you want msg.value.

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.