1

As we know, in order for a contract to call the other contract, it needs to know the called contract interface/abstract.

Question 1: Can we pass that interface/abstract as a function argument to a contract?

Question 2: Can we design contract C1 such that it would be able to call a function of another contract C2, where C2 will be deployed after C1 is deployed?

2

Question 1: No, that is not possible as far as I know.

Question 2: Yes, if you define an interface beforehand, and give C1 access to that interface, then you can call that function on C2, as long as its method signature is the same, regardless of its implementation, though it seems you're aware of this possibility already.

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.