From 04e581db616416ddec966359492470b70cd56f5d Mon Sep 17 00:00:00 2001 From: arkpar Date: Wed, 19 Apr 2017 14:48:02 +0200 Subject: [PATCH 1/2] Correct contract address for EIP-86 --- ethcore/src/executive.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethcore/src/executive.rs b/ethcore/src/executive.rs index dc9dcec17..494d59db9 100644 --- a/ethcore/src/executive.rs +++ b/ethcore/src/executive.rs @@ -46,7 +46,7 @@ pub fn contract_address(address_scheme: CreateContractAddress, sender: &Address, From::from(stream.as_raw().sha3()) }, CreateContractAddress::FromCodeHash => { - let mut buffer = [0u8; 20 + 32]; + let mut buffer = [0xffu8; 20 + 32]; &mut buffer[20..].copy_from_slice(&code_hash[..]); From::from((&buffer[..]).sha3()) }, From 97052f391288bf96a70e462bed01fef4ac0b636a Mon Sep 17 00:00:00 2001 From: arkpar Date: Wed, 19 Apr 2017 19:10:12 +0200 Subject: [PATCH 2/2] null_sign with network id --- ethcore/src/types/transaction.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ethcore/src/types/transaction.rs b/ethcore/src/types/transaction.rs index f9e9f2c47..2c35400a8 100644 --- a/ethcore/src/types/transaction.rs +++ b/ethcore/src/types/transaction.rs @@ -127,7 +127,7 @@ impl From for SignedTransaction { }; match secret { Some(s) => tx.sign(&s, None), - None => tx.null_sign(), + None => tx.null_sign(1), } } } @@ -210,13 +210,13 @@ impl Transaction { } /// Add EIP-86 compatible empty signature. - pub fn null_sign(self) -> SignedTransaction { + pub fn null_sign(self, network_id: u64) -> SignedTransaction { SignedTransaction { transaction: UnverifiedTransaction { unsigned: self, r: U256::zero(), s: U256::zero(), - v: 0, + v: network_id, hash: 0.into(), }.compute_hash(), sender: UNSIGNED_SENDER,