0

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;
    _entries.push(msg.sender);
    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). – goodvibration Jan 27 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. – Abhijeet Samanta Jan 27 at 9:02
1

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 acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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