There are two ways to create references to contracts:

  1. Deploy a new instance with Contr c = new Contr(possible_constructor_arguments);

  2. Reference a contract which has already been deployed: Contr c = Contr(address_of_contract);. Here Contr can either be an interface or the contract implementation (if you have its source code).

So, to answer your question, the line is referencing an existing implementation of the contract at address 0xABCD. It uses an interface so that the interface's functionality is available for the reference (so you can actually call the contract's functionality).

  • Very helpful and important for solidity beginer, tks sir. Sep 13 at 5:46

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.