From db739dff69e0d117145c7abbe2c40ce087bbd961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Tenorio-Forn=C3=A9s?= Date: Mon, 24 Jul 2017 18:30:54 +0200 Subject: Change Mapping example to valid (executable) code Current example will not compile and would need to be compiled in separate files, unlike how it is shown (see https://github.com/ethereum/solidity/pull/2618). The proposed changes provide both a source code that compiles and a easier to understand Contract creation (using new instead of a contract address). --- docs/types.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/types.rst b/docs/types.rst index b9ecd083..adac16e7 100644 --- a/docs/types.rst +++ b/docs/types.rst @@ -815,9 +815,10 @@ for each ``_KeyType``, recursively. } contract MappingUser { - address contractAddress = 0x42; function f() returns (uint) { - return MappingExample(contractAddress).balances(this); + MappingExample m = new MappingExample(); + m.update(100); + return m.balances(this); } } -- cgit v1.2.3