1

Is there anyway to know the name of the external method calling a contract's method from within the called contract method?

As an example, msg.sender gives you the address of the calling contract. I tried using msg.sig, however msg.sig gives you the function of the contract being called and not the name of the function where the original call came from.

In my particular application, I do not have control of the calling contract so I cant have a solution on that end.

Method A From Contract A calls Method B From Contract B.

Contract B needs to know what method from Contract A Called without Contract A passing that information.

Is this possible?

1
  • Do you have ABI from the contract you want to interact with ? Every methods are written there.
    – GrindCode
    Jul 1 at 21:36
1

Is there anyway to know the name of the external method calling a contract's method from within the called contract method?

EVM or Solidity do not pass such information, so this is impossible.

Contract B needs to know what method from Contract A Called without Contract A passing that information.

Redesign your application.

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.