diff options
author | RJ <catalanor0220@gmail.com> | 2016-03-31 01:08:48 +0800 |
---|---|---|
committer | RJ <catalanor0220@gmail.com> | 2016-03-31 01:08:48 +0800 |
commit | 9720851bd6b3f03e0c822becc8cd4657f9aeb63e (patch) | |
tree | 2e91f6d5b28aad55a5eff456566ba0c8db109616 /docs/frequently-asked-questions.rst | |
parent | 0df5f40ac41220aae8a9d082ebd45fb17b8b821b (diff) | |
download | dexon-solidity-9720851bd6b3f03e0c822becc8cd4657f9aeb63e.tar.gz dexon-solidity-9720851bd6b3f03e0c822becc8cd4657f9aeb63e.tar.zst dexon-solidity-9720851bd6b3f03e0c822becc8cd4657f9aeb63e.zip |
Update frequently-asked-questions.rst
Diffstat (limited to 'docs/frequently-asked-questions.rst')
-rw-r--r-- | docs/frequently-asked-questions.rst | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/docs/frequently-asked-questions.rst b/docs/frequently-asked-questions.rst index b1ca04ff..fc7d7b7f 100644 --- a/docs/frequently-asked-questions.rst +++ b/docs/frequently-asked-questions.rst @@ -666,21 +666,22 @@ gas and return your 20 Wei). In the above example, the low-level function `call` is used to invoke another contract with `p.data` as payload and `p.amount` Wei is sent with that call. -What happens to a mapping copied from a mapping of structs? -=========================================================== +What happens to a struct's mapping when copying over a struct? +============================================================== This is a very interesting question. Suppose that we have a contract field set up like such:: struct user{ mapping(string => address) usedContracts; } - mapping(uint => user) userList; function somefunction{ - user userA = userList[1]; - userList[2] = userA; + user user1; + user1.usedContracts["Hello"] = "World"; + user user2 = user1; } -In this case, the mapping of the struct being copied over into the userList is ignored. +In this case, the mapping of the struct being copied over into the userList is ignored as there is no "list of mapped keys". +Therefore it is not possible to find out which values should be copied over. How do I initialize a contract with only a specific amount of wei? ================================================================== |