I have the following setup of two internal and external functions. Is such a setup correct?

address public addr;

function addValue() external payable {

function _addValue(uint256 value) internal payable {
  • answer updated.........
    – Majd TL
    May 7, 2021 at 12:52

1 Answer 1


No internal and private function can't be declared as payable

you will get a compiler error

TypeError: "internal" and "private" functions cannot be payable

The idea of having payable modifier is "to permission or prevent intentional and accidental value transfers" and using it twice first in external/public function and then again in internal function which is called by that function does not make sense :)

but you can use msg.value inside the internal function so something like this

    function addValue() external payable {
    function _addValue() internal {
  • So we can still transfer/call{value} even we don't have payable modifier on the internal function?
    – kitta
    Oct 25, 2021 at 7:21
  • As long as the internal function is called inside a "public" or "external" function, you should be fine without the payable keyword on the internal function. Also make sure that the address receiving the funds is casted as "payable": payable(_receiver).transfer(_amount)
    – AllJs
    Nov 12, 2022 at 6:18

Your Answer

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

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