Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/pages/world/reference/world.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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**
Expand All @@ -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**
Expand Down Expand Up @@ -384,15 +384,15 @@ DYNAMIC FUNCTION SELECTORS
Accepts ETH and adds to the root namespace's balance.

```solidity
receive() external payable;
receive() external payable virtual;
```

#### fallback

_Fallback function to call registered function selectors._

```solidity
fallback() external payable prohibitDirectCallback;
fallback() external payable virtual prohibitDirectCallback;
```

## WorldFactory
Expand Down
10 changes: 5 additions & 5 deletions packages/world/src/World.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
Expand All @@ -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);

Expand Down Expand Up @@ -403,15 +403,15 @@ 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);
}

/**
* @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);
Expand Down
Loading