File tree 3 files changed +11
-4
lines changed
3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @latticexyz/world " : minor
3
+ ---
4
+
5
+ Return address of the newly created World from ` WorldFactory.deployWorld ` .
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ interface IWorldFactory {
22
22
/**
23
23
* @notice Deploys a new World contract.
24
24
* @dev The deployment of the World contract will result in the `WorldDeployed` event being emitted.
25
+ * @return worldAddress The address of the newly deployed World contract.
25
26
*/
26
- function deployWorld () external ;
27
+ function deployWorld () external returns ( address worldAddress ) ;
27
28
}
Original file line number Diff line number Diff line change @@ -26,13 +26,14 @@ contract WorldFactory is IWorldFactory {
26
26
}
27
27
28
28
/**
29
- * @notice Deploys a new World instance, sets the CoreModule and transfers its ownership to the caller.
29
+ * @notice Deploys a new World instance, installs the CoreModule and transfers ownership to the caller.
30
30
* @dev Uses the Create2 for deterministic deployment.
31
+ * @return worldAddress The address of the newly deployed World contract.
31
32
*/
32
- function deployWorld () public {
33
+ function deployWorld () public returns ( address worldAddress ) {
33
34
// Deploy a new World and increase the WorldCount
34
35
bytes memory bytecode = type (World).creationCode;
35
- address worldAddress = Create2.deploy (bytecode, worldCount++ );
36
+ worldAddress = Create2.deploy (bytecode, worldCount++ );
36
37
IBaseWorld world = IBaseWorld (worldAddress);
37
38
38
39
// Initialize the World and transfer ownership to the caller
You can’t perform that action at this time.
0 commit comments