0

I want to write a library which can be callcalled by any contract.

As part of this, I want to write a function which returns the contract address of the library to the contract which callcalled it.

address(this) is normally the solution, but in the case of callcode, it can only be used to check if the contract is being callcalled through if(address(this)==msg.sender) which become always true.

So how to perform this without having to rewrite the code each time because of the requirement to predict the future library’s contract address ?

user2284570
  • 2,891
  • 3
  • 26
  • 74

0 Answers0