Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing interface/contract address #9

Open
Booker-CU opened this issue Oct 6, 2022 · 1 comment
Open

Importing interface/contract address #9

Booker-CU opened this issue Oct 6, 2022 · 1 comment

Comments

@Booker-CU
Copy link

In the example code, wouldn't HelloWorldInterface need to be imported in some way and/or have a contract address for it to be imported into our contract?

Like for Chainlink you have to import their interface at the top and then create an instance of their interface inside the contract.
https://docs.chain.link/docs/consuming-data-feeds/

Are there different ways to code interfaces?
thx

@MatheusDaros
Copy link
Contributor

Hello @Booker-CU
Thanks for the question.
Interfaces can be either imported from another file or defined at the same file where the other(s) contract(s) is(are).
As for the usage, it could be inherited by other contracts and even interfaces, or it could be used to define a contract interface for an address and allow external calls for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants