diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2018-11-15 18:10:08 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-15 18:10:08 +0800 |
commit | 9db76403bb378e3b36bde8b42794ad6da0262ec9 (patch) | |
tree | f1ceeaf89f1f22554731f8d1d323298077f4c3fb | |
parent | 92ebf6606764748229acf07e83dbe3824bde540e (diff) | |
parent | caf44302e56208a5ee428d87b27fe647813886da (diff) | |
download | dexon-solidity-9db76403bb378e3b36bde8b42794ad6da0262ec9.tar dexon-solidity-9db76403bb378e3b36bde8b42794ad6da0262ec9.tar.gz dexon-solidity-9db76403bb378e3b36bde8b42794ad6da0262ec9.tar.bz2 dexon-solidity-9db76403bb378e3b36bde8b42794ad6da0262ec9.tar.lz dexon-solidity-9db76403bb378e3b36bde8b42794ad6da0262ec9.tar.xz dexon-solidity-9db76403bb378e3b36bde8b42794ad6da0262ec9.tar.zst dexon-solidity-9db76403bb378e3b36bde8b42794ad6da0262ec9.zip |
Merge pull request #5430 from kn1g/patch-1
Consistent use of address()
-rw-r--r-- | docs/types.rst | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/types.rst b/docs/types.rst index 87e7011a..020cb105 100644 --- a/docs/types.rst +++ b/docs/types.rst @@ -280,15 +280,15 @@ Example:: It is possible to adjust the supplied gas with the ``.gas()`` modifier:: - namReg.call.gas(1000000)(abi.encodeWithSignature("register(string)", "MyName")); + address(nameReg).call.gas(1000000)(abi.encodeWithSignature("register(string)", "MyName")); Similarly, the supplied Ether value can be controlled too:: - nameReg.call.value(1 ether)(abi.encodeWithSignature("register(string)", "MyName")); + address(nameReg).call.value(1 ether)(abi.encodeWithSignature("register(string)", "MyName")); Lastly, these modifiers can be combined. Their order does not matter:: - nameReg.call.gas(1000000).value(1 ether)(abi.encodeWithSignature("register(string)", "MyName")); + address(nameReg).call.gas(1000000).value(1 ether)(abi.encodeWithSignature("register(string)", "MyName")); In a similar way, the function ``delegatecall`` can be used: the difference is that only the code of the given address is used, all other aspects (storage, balance, ...) are taken from the current contract. The purpose of ``delegatecall`` is to use library code which is stored in another contract. The user has to ensure that the layout of storage in both contracts is suitable for delegatecall to be used. |