0

Someone asked about the internal visibility function in solidity.

Two comments claimed that despite being internal at the access and code level, there would be some ways to be able to access and call a function marked internal from another contract.

  • the first comment says that through the "deposit challenge verify" mechanism it is possible to get around this

  • the second says that through upcode EXTCODECOPY is also possible.

The post: 'internal' keyword in a function definition in Solidity

I don't know if I'm getting confused or if they actually said that it's possible to access and call from outside the contract a function marked internal. I've studied and read several things and I haven't seen how this is possible.

1 Answer 1

0

So in general internal is something that can only be accessed via the contract and derived contracts, but let's get into those instances.

The deposit-challenge-verify mechanism is defining the codebase off-chain then use group consensus (i.e. a workaround).

The EXTCODECOPY method as described in the code retrieves the byte code for the entire contract and then it's your jobs to do what you need. https://github.com/0xsequence/sstore2/blob/master/contracts/utils/Bytecode.sol

1
  • 1
    I loved your comment, it was the best so far. So is it really possible to call an internal function from outside the contract through these actions? If you can clarify more about EXTCODCOPY I would be very grateful. It retrieves the byte code, but even in that retrieval I don't understand how it will be able to call and interact with an internal function that forbids it to call.
    – Ether Man
    Feb 17, 2022 at 1:13

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.