question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Contract creation transactions don't specify a salt

See original GitHub issue

What is wrong?

Contract creation transactions don’t specify a salt (see https://github.com/ethereum/py-evm/blob/sharding/evm/vm/forks/sharding/vm_state.py#L60-L63). As a result, the address of the created contract is given by the bytecode only and thus it’s impossible to deploy the same contract twice.

How can it be fixed

Specify the salt somehow. Potential candidates could be

  • the first/last 32 bytes of transaction.code
  • the first/last 32 bytes of transaction.data
  • transaction.to (which is meaningless for contract creation transactions right now)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:18 (17 by maintainers)

github_iconTop GitHub Comments

2reactions
NIC619commented, Feb 16, 2018

EIP232 looks like a cleaner and better approach in the long term but I suppose it’s not going to be as trivial to implement as adding a salt field? What about adding salt field for now(short term) and starts an issue about implementing EIP232?

2reactions
NIC619commented, Jan 31, 2018

@pipermerriam @hwwhww @jannikluhn It seems cleaner if we just add salt to transaction format, as suggested by @vbuterin and to conform with suggested transaction format of main chain in this EIP.

Read more comments on GitHub >

github_iconTop Results From Across the Web

what does keyword "salt" mean in solidity?
A salt (in cryptography) is a bit of randomness added to a transaction (usually inputs to a hashing function) in order to make...
Read more >
Spice Up Your Solidity with Salted Contract Creations & create2
Salted contract creation uses cryptographic “salt” to add an additional layer of security to a smart contract. Salt is a random string added...
Read more >
Expressions and Control Structures - Solidity
If you specify the option salt (a bytes32 value), then contract creation will use a different mechanism to come up with the address...
Read more >
Configuring a SALT Application - Oracle Help Center
Specifies the corresponding XML Schema element name of the parameter. It is generated by the SALT WSDL converter. This keyword is for SALT...
Read more >
Getting the most out of CREATE2 - OpenZeppelin blog
Our only reason for tying the deployment address to the transaction sender address is to validate that the contract creation is done following ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found