enforce interface-functions to be external-declared

- libsolidity: Enforce interface-functions must be external-declared.
- Changelog adapted to reflect changes wrt. functions in interfaces.
- test: Adjustments according to prior interface-function changes.
- tests: Adapting SolidityEndToEndTest to interface-function change.
- docs: Adapted documentation to interface-function change.
This commit is contained in:
Christian Parpart
2018-07-16 12:15:36 +02:00
parent 31e56f9f99
commit 396bf11858
14 changed files with 19 additions and 29 deletions
+2 -1
View File
@@ -1150,6 +1150,7 @@ Interfaces
Interfaces are similar to abstract contracts, but they cannot have any functions implemented. There are further restrictions:
- Cannot inherit other contracts or interfaces.
- All declared functions must be external.
- Cannot define constructor.
- Cannot define variables.
- Cannot define structs.
@@ -1167,7 +1168,7 @@ Interfaces are denoted by their own keyword:
pragma solidity ^0.4.11;
interface Token {
function transfer(address recipient, uint amount) public;
function transfer(address recipient, uint amount) external;
}
Contracts can inherit interfaces as they would inherit other contracts.
+1 -1
View File
@@ -203,7 +203,7 @@ Now someone tricks you into sending ether to the address of this attack wallet:
pragma solidity >0.4.24;
interface TxUserWallet {
function transferTo(address dest, uint amount) public;
function transferTo(address dest, uint amount) external;
}
contract TxAttackWallet {