Skip to content

Commit f812f69

Browse files
committed
feat: bubble up error in stylus init
1 parent 701deb3 commit f812f69

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/stylus/StylusDeployer.sol

+9-2
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,16 @@ contract StylusDeployer {
7575
// initialize - this will fail if the program wasn't activated by this point
7676
// we check if initData exists to avoid calling contracts unnecessarily
7777
if (initData.length != 0) {
78-
(bool success,) = address(newContractAddress).call{value: initValue}(initData);
78+
(bool success, bytes32 memory data) =
79+
address(newContractAddress).call{value: initValue}(initData);
7980
if (!success) {
80-
revert ContractInitializationError(newContractAddress);
81+
if (data.length > 0) {
82+
assembly {
83+
revert(add(data, 32), mload(data))
84+
}
85+
} else {
86+
revert ContractInitializationError(newContractAddress);
87+
}
8188
}
8289
} else if (initValue != 0) {
8390
// if initValue exists init data should too

0 commit comments

Comments
 (0)