I'm going through the Ethernaut levels and I have some fundamental questions I need answered before I can continue. This question is particularly in reference to the levels that require you to deploy a contract to complete the level.
So I understand that the Ethernaut contracts are already deployed to the blockchain, when I want to interact with the specific level instance of the contract I'm working on. How do I reference that specifically? Are there multiple ways to interact with an already deployed contract?
I'm confused about topics related to interfaces and abstract contracts. It seems that different solutions for said levels, like CoinFlip and Telephone, utilize different ways of referencing the contracts, some of which even involve copying the contract code and deploying it again via Remix. I know i'm asking kind of a vague question but if anyone has anything they think will help in my understanding, please share. Thank you.
UPDATE
I'm sharing a code snippet that follows the suggestion made below. The error i'm getting in Remix is [Member "changeOwner" not found or not visible after argument-depending lookup in address]. I get that the function wouldn't be able to be called because I haven't deployed the contract and passed through the contract instance that would reference where changeOwner lives. What is the work around? Thanks.
contract HackTelephone {
address telephoneInstance;
constructor(address _telephoneInstance) {
telephoneInstance = _telephoneInstance;
}
function changeOwner(address _owner) public {
telephoneInstance.changeOwner(_owner);
}
}