From 90a961243e222025c43e42d89a90fa0e8f0ba8dc Mon Sep 17 00:00:00 2001 From: Jamie Lokier Date: Fri, 14 May 2021 15:20:36 +0100 Subject: [PATCH] Clear up meaning of `ZERO_ADDRESS`, delete `CREATE_CONTRACT_ADDRESS` There is no valid `CREATE_CONTRACT_ADDRESS`. Some places on the internet say account zero means contract creation, but that's not correct. Transactions to `ZERO_ADDRESS` are legitimate transfers to that account, not contract creations. They are used to "burn" Eth. People also send Eth to address zero by accident, unrecoverably, due to poor user interface issues. Signed-off-by: Jamie Lokier --- nimbus/constants.nim | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/nimbus/constants.nim b/nimbus/constants.nim index 129759e5c..88e2db9d2 100644 --- a/nimbus/constants.nim +++ b/nimbus/constants.nim @@ -10,11 +10,13 @@ const UINT_256_MAX*: UInt256 = high(UInt256) INT_256_MAX_AS_UINT256* = high(Uint256) shr 1 UINT160CEILING*: UInt256 = 2.u256.pow(160) + + # Transactions to ZERO_ADDRESS are legitimate transfers to that account, not + # contract creations. They are used to "burn" Eth. People also send Eth to + # address zero by accident, unrecoverably, due to poor user interface issues. ZERO_ADDRESS* = default(EthAddress) - # TODO: use Option[EthAddress]? - # create contract address cannot be ZERO_ADDRESS - # because actual zero address exists - CREATE_CONTRACT_ADDRESS* = ZERO_ADDRESS + + # ZERO_HASH32 is the parent hash of genesis blocks. ZERO_HASH32* = Hash256() GAS_LIMIT_EMA_DENOMINATOR* = 1_024