Merge pull request #4500 from ethereum/v050-interface-functions-must-be-external

[BREAKING] interface functions must be external
This commit is contained in:
chriseth
2018-07-16 14:43:56 +02:00
committed by GitHub
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 {