diff options
Diffstat (limited to 'docs/contracts.rst')
-rw-r--r-- | docs/contracts.rst | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/docs/contracts.rst b/docs/contracts.rst index fa6df6bf..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. @@ -1295,12 +1296,12 @@ custom types without the overhead of external function calls: uint[] limbs; } - function fromUint(uint x) internal pure returns (bigint r) { + function fromUint(uint x) internal pure returns (bigint memory r) { r.limbs = new uint[](1); r.limbs[0] = x; } - function add(bigint _a, bigint _b) internal pure returns (bigint r) { + function add(bigint memory _a, bigint memory _b) internal pure returns (bigint memory r) { r.limbs = new uint[](max(_a.limbs.length, _b.limbs.length)); uint carry = 0; for (uint i = 0; i < r.limbs.length; ++i) { @@ -1323,7 +1324,7 @@ custom types without the overhead of external function calls: } } - function limb(bigint _a, uint _limb) internal pure returns (uint) { + function limb(bigint memory _a, uint _limb) internal pure returns (uint) { return _limb < _a.limbs.length ? _a.limbs[_limb] : 0; } |