0

I have this modifier, and it never allows the method to be called as "tx.gasprice" always seems to be zero. Does anyone know why that is?

modifier gasPriceIsValid() {
        require(tx.gasprice != 0);
        _;
    }
7
  • Try to add an error message to require. With this, you can understand is the revert comes from this modifier. Jun 9, 2022 at 13:26
  • I already did, and the revert comes from this modifier
    – Kees
    Jun 9, 2022 at 13:27
  • Which network do you use? Jun 9, 2022 at 13:28
  • Our own network which is currently just a test network
    – Kees
    Jun 9, 2022 at 13:28
  • Do you specify the gas prices on your client-side? Jun 9, 2022 at 13:30

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.