Skip to content

Commit

Permalink
♻️ Refactor Using vm.setNonceUnsafe
Browse files Browse the repository at this point in the history
Signed-off-by: Pascal Marco Caversaccio <[email protected]>
  • Loading branch information
pcaversaccio committed Dec 1, 2023
1 parent 3e44ebe commit 1dd50b5
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 44 deletions.
44 changes: 22 additions & 22 deletions .gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ CreateX_ComputeCreate2Address_1Arg_Public_Test:testFuzz_ReturnsThe20ByteAddressW
CreateX_ComputeCreate2Address_2Args_Public_Test:testFuzz_ReturnsThe20ByteAddressWhereAContractWillBeStoredAndShouldNeverRevert(bytes32) (runs: 256, μ: 2385867, ~: 2385867)
CreateX_ComputeCreate2Address_3Args_Public_Test:testFuzz_ReturnsThe20ByteAddressWhereAContractWillBeStoredAndShouldNeverRevert(bytes32,address) (runs: 256, μ: 2386443, ~: 2386443)
CreateX_ComputeCreate3Address_2Args_Public_Test:testFuzz_ReturnsThe20ByteAddressWhereAContractWillBeStoredAndShouldNeverRevert(bytes32,address) (runs: 256, μ: 2417262, ~: 2417262)
CreateX_ComputeCreateAddress_1Arg_Public_Test:testFuzz_WhenTheNonceValueDoesNotExceed18446744073709551614(uint64) (runs: 256, μ: 2381897, ~: 2381875)
CreateX_ComputeCreateAddress_1Arg_Public_Test:testFuzz_WhenTheNonceValueExceeds18446744073709551614(uint256) (runs: 256, μ: 37176, ~: 37174)
CreateX_ComputeCreateAddress_2Args_Public_Test:testFuzz_WhenTheNonceValueDoesNotExceed18446744073709551614(address,uint64) (runs: 256, μ: 2385128, ~: 2385114)
CreateX_ComputeCreateAddress_2Args_Public_Test:testFuzz_WhenTheNonceValueExceeds18446744073709551614(address,uint256) (runs: 256, μ: 37332, ~: 37316)
CreateX_ComputeCreateAddress_1Arg_Public_Test:testFuzz_WhenTheNonceValueDoesNotExceed18446744073709551614(uint64) (runs: 256, μ: 2381309, ~: 2381289)
CreateX_ComputeCreateAddress_1Arg_Public_Test:testFuzz_WhenTheNonceValueExceeds18446744073709551614(uint256) (runs: 256, μ: 37187, ~: 37174)
CreateX_ComputeCreateAddress_2Args_Public_Test:testFuzz_WhenTheNonceValueDoesNotExceed18446744073709551614(address,uint64) (runs: 256, μ: 2384258, ~: 2384290)
CreateX_ComputeCreateAddress_2Args_Public_Test:testFuzz_WhenTheNonceValueExceeds18446744073709551614(address,uint256) (runs: 256, μ: 37339, ~: 37316)
CreateX_DeployCreate2AndInit_3Args_Public_Test:testFuzz_WhenTheCreateXContractHasANonZeroBalanceAndWhenTheRefundTransactionIsSuccessful(address,(uint256,uint256),uint64,address,uint256) (runs: 256, μ: 2590079, ~: 2591637)
CreateX_DeployCreate2AndInit_3Args_Public_Test:testFuzz_WhenTheInitCodeFailsToDeployARuntimeBytecode(address,(uint256,uint256)) (runs: 256, μ: 8937393460516731430, ~: 8937393460516731390)
CreateX_DeployCreate2AndInit_3Args_Public_Test:testFuzz_WhenTheInitCodeSuccessfullyCreatesARuntimeBytecodeWithANonZeroLengthAndWhenTheInitialisationCallIsSuccessful(address,(uint256,uint256),uint64,address) (runs: 256, μ: 2552043, ~: 2552965)
Expand Down Expand Up @@ -78,24 +78,24 @@ CreateX_DeployCreate3_2Args_Public_Test:testFuzz_WhenTheInitCodeFailsToDeployARu
CreateX_DeployCreate3_2Args_Public_Test:testFuzz_WhenTheInitCodeSuccessfullyCreatesARuntimeBytecodeWithANonZeroLength(address,uint256,bytes32,uint64,address) (runs: 256, μ: 1336939, ~: 1106634)
CreateX_DeployCreate3_2Args_Public_Test:testFuzz_WhenTheInitCodeSuccessfullyCreatesARuntimeBytecodeWithAZeroLength(address,uint256,bytes32,uint64) (runs: 256, μ: 94728, ~: 108366)
CreateX_DeployCreate3_2Args_Public_Test:testFuzz_WhenTheProxyContractCreationFails(address,uint256,bytes32,uint64) (runs: 256, μ: 7156897107054489958, ~: 8937393460516740067)
CreateX_DeployCreateAndInit_3Args_Public_Test:testFuzz_WhenTheCreateXContractHasANonZeroBalanceAndWhenTheRefundTransactionIsSuccessful(uint64,(uint256,uint256),uint256) (runs: 256, μ: 1070630, ~: 1070907)
CreateX_DeployCreateAndInit_3Args_Public_Test:testFuzz_WhenTheInitCodeFailsToDeployARuntimeBytecode(uint64,(uint256,uint256)) (runs: 256, μ: 8937393460516731185, ~: 8937393460516731166)
CreateX_DeployCreateAndInit_3Args_Public_Test:testFuzz_WhenTheInitCodeSuccessfullyCreatesARuntimeBytecodeWithANonZeroLengthAndWhenTheInitialisationCallIsSuccessful(uint64,(uint256,uint256)) (runs: 256, μ: 1014390, ~: 1014796)
CreateX_DeployCreateAndInit_3Args_Public_Test:testFuzz_WhenTheInitCodeSuccessfullyCreatesARuntimeBytecodeWithAZeroLength(uint64,(uint256,uint256)) (runs: 256, μ: 62023, ~: 62147)
CreateX_DeployCreateAndInit_3Args_Public_Test:testFuzz_WhenTheInitialisationCallIsUnsuccessful(uint64,(uint256,uint256)) (runs: 256, μ: 992088, ~: 992448)
CreateX_DeployCreateAndInit_3Args_Public_Test:testFuzz_WhenTheRefundTransactionIsUnsuccessful(uint64,(uint256,uint256),uint256) (runs: 256, μ: 1028004, ~: 1028285)
CreateX_DeployCreateAndInit_4Args_Public_Test:testFuzz_WhenTheCreateXContractHasANonZeroBalanceAndWhenTheRefundTransactionIsSuccessful(uint64,(uint256,uint256),uint256) (runs: 256, μ: 1071946, ~: 1072239)
CreateX_DeployCreateAndInit_4Args_Public_Test:testFuzz_WhenTheInitCodeFailsToDeployARuntimeBytecode(uint64,(uint256,uint256)) (runs: 256, μ: 8937393460516729918, ~: 8937393460516729894)
CreateX_DeployCreateAndInit_4Args_Public_Test:testFuzz_WhenTheInitCodeSuccessfullyCreatesARuntimeBytecodeWithANonZeroLengthAndWhenTheInitialisationCallIsSuccessful(uint64,(uint256,uint256)) (runs: 256, μ: 1013120, ~: 1013584)
CreateX_DeployCreateAndInit_4Args_Public_Test:testFuzz_WhenTheInitCodeSuccessfullyCreatesARuntimeBytecodeWithAZeroLength(uint64,(uint256,uint256)) (runs: 256, μ: 59934, ~: 60012)
CreateX_DeployCreateAndInit_4Args_Public_Test:testFuzz_WhenTheInitialisationCallIsUnsuccessful(uint64,(uint256,uint256)) (runs: 256, μ: 990410, ~: 990868)
CreateX_DeployCreateAndInit_4Args_Public_Test:testFuzz_WhenTheRefundTransactionIsUnsuccessful(uint64,(uint256,uint256),uint256) (runs: 256, μ: 1026708, ~: 1026812)
CreateX_DeployCreateClone_Public_Test:testFuzz_WhenTheEIP1167MinimalProxyContractCreationFails(uint64,uint256) (runs: 256, μ: 8937393460516730069, ~: 8937393460516730147)
CreateX_DeployCreateClone_Public_Test:testFuzz_WhenTheEIP1167MinimalProxyContractIsSuccessfullyCreatedAndWhenTheEIP1167MinimalProxyInitialisationCallIsSuccessful(uint64,uint256) (runs: 256, μ: 106324, ~: 106599)
CreateX_DeployCreateClone_Public_Test:testFuzz_WhenTheEIP1167MinimalProxyInitialisationCallIsUnsuccessful(uint64,uint256) (runs: 256, μ: 74725, ~: 74932)
CreateX_DeployCreate_Public_Test:testFuzz_WhenTheInitCodeFailsToDeployARuntimeBytecode(uint64,uint256) (runs: 256, μ: 8937393460516729964, ~: 8937393460516730031)
CreateX_DeployCreate_Public_Test:testFuzz_WhenTheInitCodeSuccessfullyCreatesARuntimeBytecodeWithANonZeroLength(uint64,uint256) (runs: 256, μ: 999457, ~: 999477)
CreateX_DeployCreate_Public_Test:testFuzz_WhenTheInitCodeSuccessfullyCreatesARuntimeBytecodeWithAZeroLength(uint64,uint256) (runs: 256, μ: 52442, ~: 52418)
CreateX_DeployCreateAndInit_3Args_Public_Test:testFuzz_WhenTheCreateXContractHasANonZeroBalanceAndWhenTheRefundTransactionIsSuccessful(uint64,(uint256,uint256),uint256) (runs: 256, μ: 1070601, ~: 1070907)
CreateX_DeployCreateAndInit_3Args_Public_Test:testFuzz_WhenTheInitCodeFailsToDeployARuntimeBytecode(uint64,(uint256,uint256)) (runs: 256, μ: 8937393460516731172, ~: 8937393460516731136)
CreateX_DeployCreateAndInit_3Args_Public_Test:testFuzz_WhenTheInitCodeSuccessfullyCreatesARuntimeBytecodeWithANonZeroLengthAndWhenTheInitialisationCallIsSuccessful(uint64,(uint256,uint256)) (runs: 256, μ: 1014416, ~: 1014765)
CreateX_DeployCreateAndInit_3Args_Public_Test:testFuzz_WhenTheInitCodeSuccessfullyCreatesARuntimeBytecodeWithAZeroLength(uint64,(uint256,uint256)) (runs: 256, μ: 62071, ~: 62147)
CreateX_DeployCreateAndInit_3Args_Public_Test:testFuzz_WhenTheInitialisationCallIsUnsuccessful(uint64,(uint256,uint256)) (runs: 256, μ: 992130, ~: 992448)
CreateX_DeployCreateAndInit_3Args_Public_Test:testFuzz_WhenTheRefundTransactionIsUnsuccessful(uint64,(uint256,uint256),uint256) (runs: 256, μ: 1028072, ~: 1028285)
CreateX_DeployCreateAndInit_4Args_Public_Test:testFuzz_WhenTheCreateXContractHasANonZeroBalanceAndWhenTheRefundTransactionIsSuccessful(uint64,(uint256,uint256),uint256) (runs: 256, μ: 1071885, ~: 1072261)
CreateX_DeployCreateAndInit_4Args_Public_Test:testFuzz_WhenTheInitCodeFailsToDeployARuntimeBytecode(uint64,(uint256,uint256)) (runs: 256, μ: 8937393460516729926, ~: 8937393460516729905)
CreateX_DeployCreateAndInit_4Args_Public_Test:testFuzz_WhenTheInitCodeSuccessfullyCreatesARuntimeBytecodeWithANonZeroLengthAndWhenTheInitialisationCallIsSuccessful(uint64,(uint256,uint256)) (runs: 256, μ: 1013273, ~: 1013607)
CreateX_DeployCreateAndInit_4Args_Public_Test:testFuzz_WhenTheInitCodeSuccessfullyCreatesARuntimeBytecodeWithAZeroLength(uint64,(uint256,uint256)) (runs: 256, μ: 59898, ~: 60012)
CreateX_DeployCreateAndInit_4Args_Public_Test:testFuzz_WhenTheInitialisationCallIsUnsuccessful(uint64,(uint256,uint256)) (runs: 256, μ: 990567, ~: 990868)
CreateX_DeployCreateAndInit_4Args_Public_Test:testFuzz_WhenTheRefundTransactionIsUnsuccessful(uint64,(uint256,uint256),uint256) (runs: 256, μ: 1026644, ~: 1026812)
CreateX_DeployCreateClone_Public_Test:testFuzz_WhenTheEIP1167MinimalProxyContractCreationFails(uint64,uint256) (runs: 256, μ: 8937393460516730063, ~: 8937393460516730135)
CreateX_DeployCreateClone_Public_Test:testFuzz_WhenTheEIP1167MinimalProxyContractIsSuccessfullyCreatedAndWhenTheEIP1167MinimalProxyInitialisationCallIsSuccessful(uint64,uint256) (runs: 256, μ: 106239, ~: 106599)
CreateX_DeployCreateClone_Public_Test:testFuzz_WhenTheEIP1167MinimalProxyInitialisationCallIsUnsuccessful(uint64,uint256) (runs: 256, μ: 74641, ~: 74932)
CreateX_DeployCreate_Public_Test:testFuzz_WhenTheInitCodeFailsToDeployARuntimeBytecode(uint64,uint256) (runs: 256, μ: 8937393460516729965, ~: 8937393460516730036)
CreateX_DeployCreate_Public_Test:testFuzz_WhenTheInitCodeSuccessfullyCreatesARuntimeBytecodeWithANonZeroLength(uint64,uint256) (runs: 256, μ: 999461, ~: 999477)
CreateX_DeployCreate_Public_Test:testFuzz_WhenTheInitCodeSuccessfullyCreatesARuntimeBytecodeWithAZeroLength(uint64,uint256) (runs: 256, μ: 52421, ~: 52418)
CreateX_EfficientHash_Internal_Test:testFuzz_MatchesTheOutputOfAHighLevelHashAndShouldNeverRevert(bytes32,bytes32) (runs: 256, μ: 6021, ~: 6021)
CreateX_GenerateSalt_Internal_Test:testFuzz_NeverReverts(uint256) (runs: 256, μ: 19154, ~: 19154)
CreateX_GenerateSalt_Internal_Test:testFuzz_ShouldBeAFunctionOfMultipleBlockPropertiesAndTheCaller(uint256,address,string,uint64,address) (runs: 256, μ: 55771, ~: 55566)
Expand Down
4 changes: 2 additions & 2 deletions test/public/CREATE/CreateX.computeCreateAddress_1Arg.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ contract CreateX_ComputeCreateAddress_1Arg_Public_Test is BaseTest {
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

modifier whenTheNonceValueDoesNotExceed18446744073709551614(uint64 nonce) {
vm.assume(nonce != 0 && nonce < type(uint64).max && nonce >= vm.getNonce(createXAddr));
vm.setNonce(createXAddr, nonce);
vm.assume(nonce != 0 && nonce < type(uint64).max);
vm.setNonceUnsafe(createXAddr, nonce);
_;
}

Expand Down
4 changes: 2 additions & 2 deletions test/public/CREATE/CreateX.computeCreateAddress_2Args.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ contract CreateX_ComputeCreateAddress_2Args_Public_Test is BaseTest {
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

modifier whenTheNonceValueDoesNotExceed18446744073709551614(address deployer, uint64 nonce) {
vm.assume(nonce < type(uint64).max && nonce >= vm.getNonce(deployer));
vm.assume(nonce < type(uint64).max);
if (deployer.code.length != 0) {
vm.assume(nonce != 0);
}
vm.setNonce(deployer, nonce);
vm.setNonceUnsafe(deployer, nonce);
_;
}

Expand Down
6 changes: 3 additions & 3 deletions test/public/CREATE/CreateX.deployCreate.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ contract CreateX_DeployCreate_Public_Test is BaseTest {
uint256 msgValue
) external whenTheInitCodeSuccessfullyCreatesARuntimeBytecodeWithANonZeroLength {
vm.assume(nonce != 0 && nonce < type(uint64).max);
vm.setNonce(createXAddr, nonce);
vm.setNonceUnsafe(createXAddr, nonce);
msgValue = bound(msgValue, 0, type(uint64).max);
// We calculate the address beforehand where the contract is to be deployed.
address computedAddress = createX.computeCreateAddress(createXAddr, nonce);
Expand Down Expand Up @@ -66,7 +66,7 @@ contract CreateX_DeployCreate_Public_Test is BaseTest {
uint256 msgValue
) external whenTheInitCodeSuccessfullyCreatesARuntimeBytecodeWithAZeroLength {
vm.assume(nonce != 0 && nonce < type(uint64).max);
vm.setNonce(createXAddr, nonce);
vm.setNonceUnsafe(createXAddr, nonce);
msgValue = bound(msgValue, 0, type(uint64).max);
// It should revert.
bytes memory expectedErr = abi.encodeWithSelector(CreateX.FailedContractCreation.selector, createXAddr);
Expand All @@ -83,7 +83,7 @@ contract CreateX_DeployCreate_Public_Test is BaseTest {
uint256 msgValue
) external whenTheInitCodeFailsToDeployARuntimeBytecode {
vm.assume(nonce != 0 && nonce < type(uint64).max);
vm.setNonce(createXAddr, nonce);
vm.setNonceUnsafe(createXAddr, nonce);
msgValue = bound(msgValue, 0, type(uint64).max);
// The following contract creation code contains the invalid opcode `PUSH0` (`0x5F`) and `CREATE` must therefore
// return the zero address (technically zero bytes `0x`), as the deployment fails. This test also ensures that if
Expand Down
12 changes: 6 additions & 6 deletions test/public/CREATE/CreateX.deployCreateAndInit_3Args.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ contract CreateX_DeployCreateAndInit_3Args_Public_Test is BaseTest {
whenTheInitialisationCallIsSuccessful
{
vm.assume(nonce != 0 && nonce < type(uint64).max);
vm.setNonce(createXAddr, nonce);
vm.setNonceUnsafe(createXAddr, nonce);
values.constructorAmount = bound(values.constructorAmount, 0, type(uint64).max);
values.initCallAmount = bound(values.initCallAmount, 0, type(uint64).max);
// We calculate the address beforehand where the contract is to be deployed.
Expand Down Expand Up @@ -95,7 +95,7 @@ contract CreateX_DeployCreateAndInit_3Args_Public_Test is BaseTest {
whenTheRefundTransactionIsSuccessful
{
vm.assume(nonce != 0 && nonce < type(uint64).max);
vm.setNonce(createXAddr, nonce);
vm.setNonceUnsafe(createXAddr, nonce);
values.constructorAmount = bound(values.constructorAmount, 0, type(uint64).max);
values.initCallAmount = bound(values.initCallAmount, 0, type(uint64).max);
// We calculate the address beforehand where the contract is to be deployed.
Expand Down Expand Up @@ -145,7 +145,7 @@ contract CreateX_DeployCreateAndInit_3Args_Public_Test is BaseTest {
whenTheRefundTransactionIsUnsuccessful
{
vm.assume(nonce != 0 && nonce < type(uint64).max);
vm.setNonce(createXAddr, nonce);
vm.setNonceUnsafe(createXAddr, nonce);
values.constructorAmount = bound(values.constructorAmount, 0, type(uint64).max);
values.initCallAmount = bound(values.initCallAmount, 0, type(uint64).max);
vm.deal(SELF, values.constructorAmount + values.initCallAmount);
Expand Down Expand Up @@ -178,7 +178,7 @@ contract CreateX_DeployCreateAndInit_3Args_Public_Test is BaseTest {
whenTheInitialisationCallIsUnsuccessful
{
vm.assume(nonce != 0 && nonce < type(uint64).max);
vm.setNonce(createXAddr, nonce);
vm.setNonceUnsafe(createXAddr, nonce);
values.constructorAmount = bound(values.constructorAmount, 0, type(uint64).max);
values.initCallAmount = bound(values.initCallAmount, 0, type(uint64).max);
vm.deal(arg3, values.constructorAmount + values.initCallAmount);
Expand Down Expand Up @@ -207,7 +207,7 @@ contract CreateX_DeployCreateAndInit_3Args_Public_Test is BaseTest {
CreateX.Values memory values
) external whenTheInitCodeSuccessfullyCreatesARuntimeBytecodeWithAZeroLength {
vm.assume(nonce != 0 && nonce < type(uint64).max);
vm.setNonce(createXAddr, nonce);
vm.setNonceUnsafe(createXAddr, nonce);
values.constructorAmount = bound(values.constructorAmount, 0, type(uint64).max);
values.initCallAmount = bound(values.initCallAmount, 0, type(uint64).max);
vm.deal(arg3, values.constructorAmount + values.initCallAmount);
Expand All @@ -232,7 +232,7 @@ contract CreateX_DeployCreateAndInit_3Args_Public_Test is BaseTest {
CreateX.Values memory values
) external whenTheInitCodeFailsToDeployARuntimeBytecode {
vm.assume(nonce != 0 && nonce < type(uint64).max);
vm.setNonce(createXAddr, nonce);
vm.setNonceUnsafe(createXAddr, nonce);
values.constructorAmount = bound(values.constructorAmount, 0, type(uint64).max);
values.initCallAmount = bound(values.initCallAmount, 0, type(uint64).max);
// The following contract creation code contains the invalid opcode `PUSH0` (`0x5F`) and `CREATE` must therefore
Expand Down
12 changes: 6 additions & 6 deletions test/public/CREATE/CreateX.deployCreateAndInit_4Args.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ contract CreateX_DeployCreateAndInit_4Args_Public_Test is BaseTest {
whenTheInitialisationCallIsSuccessful
{
vm.assume(nonce != 0 && nonce < type(uint64).max);
vm.setNonce(createXAddr, nonce);
vm.setNonceUnsafe(createXAddr, nonce);
values.constructorAmount = bound(values.constructorAmount, 0, type(uint64).max);
values.initCallAmount = bound(values.initCallAmount, 0, type(uint64).max);
// We calculate the address beforehand where the contract is to be deployed.
Expand Down Expand Up @@ -93,7 +93,7 @@ contract CreateX_DeployCreateAndInit_4Args_Public_Test is BaseTest {
whenTheRefundTransactionIsSuccessful
{
vm.assume(nonce != 0 && nonce < type(uint64).max);
vm.setNonce(createXAddr, nonce);
vm.setNonceUnsafe(createXAddr, nonce);
values.constructorAmount = bound(values.constructorAmount, 0, type(uint64).max);
values.initCallAmount = bound(values.initCallAmount, 0, type(uint64).max);
// We calculate the address beforehand where the contract is to be deployed.
Expand Down Expand Up @@ -141,7 +141,7 @@ contract CreateX_DeployCreateAndInit_4Args_Public_Test is BaseTest {
whenTheRefundTransactionIsUnsuccessful
{
vm.assume(nonce != 0 && nonce < type(uint64).max);
vm.setNonce(createXAddr, nonce);
vm.setNonceUnsafe(createXAddr, nonce);
values.constructorAmount = bound(values.constructorAmount, 0, type(uint64).max);
values.initCallAmount = bound(values.initCallAmount, 0, type(uint64).max);
// It should revert.
Expand Down Expand Up @@ -172,7 +172,7 @@ contract CreateX_DeployCreateAndInit_4Args_Public_Test is BaseTest {
whenTheInitialisationCallIsUnsuccessful
{
vm.assume(nonce != 0 && nonce < type(uint64).max);
vm.setNonce(createXAddr, nonce);
vm.setNonceUnsafe(createXAddr, nonce);
values.constructorAmount = bound(values.constructorAmount, 0, type(uint64).max);
values.initCallAmount = bound(values.initCallAmount, 0, type(uint64).max);
// It should revert.
Expand All @@ -199,7 +199,7 @@ contract CreateX_DeployCreateAndInit_4Args_Public_Test is BaseTest {
CreateX.Values memory values
) external whenTheInitCodeSuccessfullyCreatesARuntimeBytecodeWithAZeroLength {
vm.assume(nonce != 0 && nonce < type(uint64).max);
vm.setNonce(createXAddr, nonce);
vm.setNonceUnsafe(createXAddr, nonce);
values.constructorAmount = bound(values.constructorAmount, 0, type(uint64).max);
values.initCallAmount = bound(values.initCallAmount, 0, type(uint64).max);
// It should revert.
Expand All @@ -222,7 +222,7 @@ contract CreateX_DeployCreateAndInit_4Args_Public_Test is BaseTest {
CreateX.Values memory values
) external whenTheInitCodeFailsToDeployARuntimeBytecode {
vm.assume(nonce != 0 && nonce < type(uint64).max);
vm.setNonce(createXAddr, nonce);
vm.setNonceUnsafe(createXAddr, nonce);
values.constructorAmount = bound(values.constructorAmount, 0, type(uint64).max);
values.initCallAmount = bound(values.initCallAmount, 0, type(uint64).max);
// The following contract creation code contains the invalid opcode `PUSH0` (`0x5F`) and `CREATE` must therefore
Expand Down
Loading

0 comments on commit 1dd50b5

Please sign in to comment.