Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Correct contract address for EIP-86 #5473

Merged
merged 2 commits into from
Apr 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ethcore/src/executive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
},
Expand Down
6 changes: 3 additions & 3 deletions ethcore/src/types/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ impl From<ethjson::state::Transaction> for SignedTransaction {
};
match secret {
Some(s) => tx.sign(&s, None),
None => tx.null_sign(),
None => tx.null_sign(1),
}
}
}
Expand Down Expand Up @@ -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,
Expand Down