Salted contract creation
Deploy a contract with CREATE2 syntax and a deterministic salt.
Solidity 0.8.36REPL mode
Why use this example
Use this pattern to test contract composition, external calls, events, and return values inside one reproducible run. The entry isolates salted contract creation so its input, result, and state changes stay easy to compare.
Solidity to run
contract SaltedValue {
uint256 public value;
constructor(uint256 initialValue) { value = initialValue; }
}
bytes32 salt = keccak256("solidity-repl")
SaltedValue salted = new SaltedValue{ salt: salt }(42)
address(salted)
salted.value()Official Solidity reference
Compare this focused investigation with the complete language definition in the Solidity documentation.
Salted contract creationsWhat to expect
The salted creation returns the deployed address and its constructor-set value getter returns 42.
Continue the investigation
Change a value, add another expression, or open Inspect after the run. Accepted entries remain available to the next entry, and the clean replay keeps the complete result reproducible.
Read about calls and logs Reproducible investigation