Encode-Club-Solidity-Foundations / Lesson-02

4 stars 7 forks source link

Error while deploying IhelloWorld #6

Closed Yash-Gadhade closed 2 years ago

Yash-Gadhade commented 2 years ago

image

Getting this as an error while deploying IHelloWorld This is code `// SPDX-License-Identifier: MIT

pragma solidity >=0.7.0 <0.9.0;

interface IHelloWorld { function helloWorld() external view returns (string memory); function setText(string memory newText) external ;
}

contract HelloWorld is IHelloWorld{ string internal text;

function helloWorld() public view override returns (string memory) {

}
function setText(string memory newText) public override  {
    text= newText;
}

}`

Please help me resolve it

MatheusDaros commented 2 years ago

It seems that you are trying to deploy the HelloWorld contract, but you have selected the IHelloWorld at the dropdown

Yash-Gadhade commented 2 years ago

Yes, I want to deploy IHelloWorld, but for some reason, I cannot deploy it due to the error showcased.

MatheusDaros commented 2 years ago

But IHelloWorld is an interface. Are you indeed trying to deploy an interface? Interfaces don't have any implementations on itself.

Yash-Gadhade commented 2 years ago

Okay, I got it. Thank you, Matheus!