diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/contracts.rst | 3 | ||||
-rw-r--r-- | docs/security-considerations.rst | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/docs/contracts.rst b/docs/contracts.rst index ea41cb54..033e9a45 100644 --- a/docs/contracts.rst +++ b/docs/contracts.rst @@ -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. diff --git a/docs/security-considerations.rst b/docs/security-considerations.rst index afdecb98..b997466b 100644 --- a/docs/security-considerations.rst +++ b/docs/security-considerations.rst @@ -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 { |