0

I've overloaded a function in a consequent upgradeable Solidity contract implementation. In previous implementation the function was:

function example() external { ... }

In new implementation overloaded function was added:

function example(uint _arg) external { ... }

It turns out example(uint _arg) variant is not possible to call, it's just not being executed. If example1(uint _arg) is added instead - it's possible to call. Truffle is used in development, and OpenZeppelin libraries used for upgradeable. All works well except overloading. One of hypothesis is that the issue can be in how Truffle works. Is this true?

AndCode
  • 384
  • 1
  • 10
  • No, truffle works fine, it just compiles sol files like any other compiler. Have you placed `virtual` and `override` on the parent and child functions tho? https://docs.soliditylang.org/en/latest/using-the-compiler.html?highlight=override#available-upgrade-modules – MrFrenzoid Jun 08 '22 at 18:17
  • We don't need virtual/override in overloading. – AndCode Jun 10 '22 at 05:36
  • Ohh right, sorry, i misunderstood the question. – MrFrenzoid Jun 10 '22 at 07:19

0 Answers0