From eddd9d71e83484287ca96f1b0875a2e2ac7aa958 Mon Sep 17 00:00:00 2001 From: dk1a Date: Fri, 9 May 2025 20:30:15 +0300 Subject: [PATCH 1/2] fix(world): add missing virtual to World methods --- packages/world/src/World.sol | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/world/src/World.sol b/packages/world/src/World.sol index eb4f9db2d1..2cb1ba7be0 100644 --- a/packages/world/src/World.sol +++ b/packages/world/src/World.sol @@ -71,7 +71,7 @@ contract World is StoreKernel, IWorldKernel { * @param initModule The core module to initialize the World with. * @dev Only the initial creator can initialize. This can be done only once. */ - function initialize(IModule initModule) public prohibitDirectCallback { + function initialize(IModule initModule) public virtual prohibitDirectCallback { // Only the initial creator of the World can initialize it if (msg.sender != creator) { revert World_AccessDenied(ROOT_NAMESPACE_ID.toString(), msg.sender); @@ -94,7 +94,7 @@ contract World is StoreKernel, IWorldKernel { * @param encodedArgs The ABI encoded arguments for module installation. * @dev The caller must own the root namespace. */ - function installRootModule(IModule module, bytes memory encodedArgs) public prohibitDirectCallback { + function installRootModule(IModule module, bytes memory encodedArgs) public virtual prohibitDirectCallback { AccessControl._requireOwner(ROOT_NAMESPACE_ID, msg.sender); _installRootModule(module, encodedArgs); } @@ -104,7 +104,7 @@ contract World is StoreKernel, IWorldKernel { * @param module The module to be installed. * @param encodedArgs The ABI encoded arguments for module installation. */ - function _installRootModule(IModule module, bytes memory encodedArgs) internal { + function _installRootModule(IModule module, bytes memory encodedArgs) internal virtual { // Require the provided address to implement the IModule interface requireInterface(address(module), type(IModule).interfaceId); @@ -403,7 +403,7 @@ contract World is StoreKernel, IWorldKernel { /** * @notice Accepts ETH and adds to the root namespace's balance. */ - receive() external payable { + receive() external payable virtual { uint256 rootBalance = Balances._get(ROOT_NAMESPACE_ID); Balances._set(ROOT_NAMESPACE_ID, rootBalance + msg.value); } @@ -411,7 +411,7 @@ contract World is StoreKernel, IWorldKernel { /** * @dev Fallback function to call registered function selectors. */ - fallback() external payable prohibitDirectCallback { + fallback() external payable virtual prohibitDirectCallback { (ResourceId systemId, bytes4 systemFunctionSelector) = FunctionSelectors._get(msg.sig); if (ResourceId.unwrap(systemId) == 0) revert World_FunctionSelectorNotFound(msg.sig); From 280e906ab9e42e0097da411fe86d05d0e6f1b97c Mon Sep 17 00:00:00 2001 From: dk1a Date: Fri, 9 May 2025 20:40:03 +0300 Subject: [PATCH 2/2] docs --- docs/pages/world/reference/world.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/pages/world/reference/world.mdx b/docs/pages/world/reference/world.mdx index 87f249c938..af4fb28725 100644 --- a/docs/pages/world/reference/world.mdx +++ b/docs/pages/world/reference/world.mdx @@ -62,7 +62,7 @@ Initializes the World by installing the core module. _Only the initial creator can initialize. This can be done only once._ ```solidity -function initialize(IModule initModule) public prohibitDirectCallback; +function initialize(IModule initModule) public virtual prohibitDirectCallback; ``` **Parameters** @@ -78,7 +78,7 @@ Installs a given root module in the World. _The caller must own the root namespace._ ```solidity -function installRootModule(IModule module, bytes memory encodedArgs) public prohibitDirectCallback; +function installRootModule(IModule module, bytes memory encodedArgs) public virtual prohibitDirectCallback; ``` **Parameters** @@ -384,7 +384,7 @@ DYNAMIC FUNCTION SELECTORS Accepts ETH and adds to the root namespace's balance. ```solidity -receive() external payable; +receive() external payable virtual; ``` #### fallback @@ -392,7 +392,7 @@ receive() external payable; _Fallback function to call registered function selectors._ ```solidity -fallback() external payable prohibitDirectCallback; +fallback() external payable virtual prohibitDirectCallback; ``` ## WorldFactory