I know that external is cheaper than public due to how arguments are parsed. Is making a function private or internal cheaper?

  • have you tried to monitor the gas in a testnet in both scenarios to check which one is cheaper? I am guessing it is the private function as opposed to internal but it is worth trying.
    – rsc05
    Nov 27 '21 at 17:26


internal: Those functions and state variables can only be accessed internally (i.e. from within the current contract or contracts deriving from it), without using this. private: Private functions and state variables are only visible for the contract they are defined in and not in derived contracts.

  • 1
    How exactly does that answer the question????? Jul 18 '18 at 15:45

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.