jklepatch / eattheblocks

Source code for Eat The Blocks, a screencast for Ethereum Dapp Developers

Home Page:https://eattheblocks.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

vinipx opened this issue · comments

commented

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?