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

Flashloans lessons 26/27 - Adjust code & documentation to reflect changes to Interfaces and Contracts in Solidity 0.6.0 #30

Open
vinipx opened this issue Jan 13, 2021 · 0 comments

Comments

@vinipx
Copy link

vinipx commented Jan 13, 2021

Hello,

Given recent changes introduced in Solidity 0.6.0, issues are appearing during compilation of project based on code from your lessons and repo:

Solidity 0.6.0 Release Notes

The new keyword abstract can be used to mark contracts as abstract. It has to be used if a contract does not implement all its functions. Abstract contracts cannot be created using the new operator, and it is not possible to generate bytecode for them during compilation.
Libraries have to implement all their functions, not only the internal ones

Functions can now only be overridden when they are either marked with the virtual keyword or defined in an interface. Functions without implementation outside an interface have to be marked virtual. When overriding a function or modifier, the new keyword override must be used. When overriding a function or modifier defined in multiple parallel bases, all bases must be listed in parentheses after the keyword like so: override(Base1, Base2).

In case you add abstract to contract:

IUniswapV2Router02.sol:5:1: ParserError: Expected pragma, import directive o
r contract/interface/library definition.
abstract contract IUniswapV2Router02 is IUniswapV2Router01 {
^------^

Could you please provide some documentation reference and guidance how to proceed with latest versions of Solidity?

@vinipx vinipx changed the title Adjust lessons to reflect changes to Interfaces and Contracts in Solidity 0.6.0 Flashloans lessons 26/27 - Adjust code & documentation to reflect changes to Interfaces and Contracts in Solidity 0.6.0 Jan 13, 2021
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

1 participant