Contract creation transactions don't specify a salt
See original GitHub issueWhat 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:
- Created 6 years ago
- Comments:18 (17 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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 addingsalt
field for now(short term) and starts an issue about implementing EIP232?@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.