@@ -65,18 +65,24 @@ contract Create2FactoryTest is Test {
65
65
assertEq (MockInitializableImplementation (proxyAddr).num (), num);
66
66
}
67
67
68
- function testDeployAndCall (
68
+ function testDeployAndMultiCall (
69
69
address addr ,
70
70
uint256 num ,
71
71
uint256 amount ,
72
72
bytes32 salt
73
73
) public {
74
- // Construct initializer
75
- bytes memory initializer = abi.encodeWithSelector (
74
+ // Construct initializers
75
+ bytes memory initializer1 = abi.encodeWithSelector (
76
76
MockInitializableImplementation.initialize.selector ,
77
77
addr,
78
78
num
79
79
);
80
+ bytes memory initializer2 = abi.encodeWithSelector (
81
+ MockInitializableImplementation.initializeV2.selector
82
+ );
83
+ bytes [] memory data = new bytes [](2 );
84
+ data[0 ] = initializer1;
85
+ data[1 ] = initializer2;
80
86
// Construct bytecode
81
87
bytes memory bytecode = abi.encodePacked (
82
88
type (UpgradeableProxy).creationCode,
@@ -88,11 +94,16 @@ contract Create2FactoryTest is Test {
88
94
keccak256 (bytecode)
89
95
);
90
96
vm.deal (address (this ), amount);
91
- address proxyAddr = create2Factory.deployAndCall {value: amount}(
97
+
98
+ // Expect calls
99
+ vm.expectCall (expectedAddr, initializer1);
100
+ vm.expectCall (expectedAddr, initializer2);
101
+
102
+ address proxyAddr = create2Factory.deployAndMultiCall {value: amount}(
92
103
amount,
93
104
salt,
94
105
bytecode,
95
- initializer
106
+ data
96
107
);
97
108
98
109
// Verify deterministic
0 commit comments