Hello, I’m curious if it’s possible to design a simple smart contract in such a way that interacting with it will require a higher gas fee than usual? Any input is greatly appreciated.

  • eggzecutor@alien.topB
    link
    fedilink
    English
    arrow-up
    1
    ·
    10 months ago

    You use the gasleft() function and revert if it’s not above some threshold you want

  • atrizzle@alien.topB
    link
    fedilink
    English
    arrow-up
    1
    ·
    10 months ago

    Yes, there are multiple ways that you could burn unnecessary arbitrary gas when calling functions on a smart contract.

    To start, go to the Yellow Paper, see what some of the most expensive gas operations are, and do those things in your smart contract functions.

    Why would you want to do this though?