-
|
Hello everyone, I have been coming across this error TypeError: Contract {nameOfContract} should be marked as abstract. So far in the course there hasn't been any mention of abstract contract yet, if I add abstract to the contract the error goes away. What does it mean ? Another typerror i get is - TypeError: Function has override specified but does not override anything. If I remove override from the function, the error goes away. Please can anyone explain this errors. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hello @TobiYusuf Also I also had the override problem, for me was i had a incorrect indentation on the code and I had to restart the editor. I hope this info might help |
Beta Was this translation helpful? Give feedback.
Hello @TobiYusuf
An abstract contract (object) is something that could no be used by itself and should be used on another contract, basically is creating a contract with functions without specifying what those functions do.
So, let's suppose you have an abstract contract (all interfaces are abstract) with 5 functions, and you import it from another contract you would have to declare what each of does functions does on your new contract, otherwise the functionality will be incomplete. If that happen, the compiler complains saying that unless you implement all the methods (function) the new contract should be marked as abstract as well.
Here is a more detailed explanation:
https://docs.soli…