My contract should have a function that reads the creation date of the sender address. Possible?
3 Answers
All 20 byte values are valid addresses, and can be sent from if the corresponding private key is known. Thus, it does not make much sense for an address to have a creation date.
It's also not possible for a contract to find another account's transactions (or their dates). In the EVM and Solidity, basically a contract can only find another account's balance or code.
If the senders address was created on an air-gapped machine the network (or your contract) you would not even be aware of its existence until it was used for the first time. So a contract finding the creation date of a sender's address would not be possible.
Your contract can certainly reference the date and time the sender's address ever participated in a transaction.
- 11,638
- 3
- 44
- 83
- 438
- 2
- 5
-
how would I fetch this first transaction date of an account? – Roland Kofler Jun 05 '16 at 10:05
This is not possible in general as this information is not available to the Ethereum VM.
However, you can create your own contracts that store publicly theirs creation date.
- 1,355
- 1
- 9
- 28