aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-03-31 19:08:51 +0800
committerchriseth <c@ethdev.com>2016-03-31 19:08:51 +0800
commit4d200e3ee681d47b11fc31f343901b30f9a15fef (patch)
tree7cd6517cc77217cbcbe8a483689976521fb064ca /docs
parent2acdfc527e4be019ecacf2487f479cca9585bea1 (diff)
parent9720851bd6b3f03e0c822becc8cd4657f9aeb63e (diff)
downloaddexon-solidity-4d200e3ee681d47b11fc31f343901b30f9a15fef.tar.gz
dexon-solidity-4d200e3ee681d47b11fc31f343901b30f9a15fef.tar.zst
dexon-solidity-4d200e3ee681d47b11fc31f343901b30f9a15fef.zip
Merge pull request #461 from ethereum/mappingStructDocumentation
Inner struct mapping copy into a mapping question
Diffstat (limited to 'docs')
-rw-r--r--docs/frequently-asked-questions.rst17
1 files changed, 17 insertions, 0 deletions
diff --git a/docs/frequently-asked-questions.rst b/docs/frequently-asked-questions.rst
index 6ac5a9e9..fc7d7b7f 100644
--- a/docs/frequently-asked-questions.rst
+++ b/docs/frequently-asked-questions.rst
@@ -666,6 +666,23 @@ 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 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;
+ }
+ function somefunction{
+ 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 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?
==================================================================