Skip to content

Commit

Permalink
Update comment and prevent staticcalls to root namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
vdrg committed Nov 22, 2024
1 parent e53bbea commit 45b7539
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions packages/world/src/SystemCall.sol
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ library SystemCall {
// Check if the system exists
if (systemAddress == address(0)) revert IWorldErrors.World_ResourceNotFound(systemId, systemId.toString());

// Staticcalls are not supported for root systems
if (systemId.getNamespace() == ROOT_NAMESPACE) revert IWorldErrors.World_InvalidNamespace(ROOT_NAMESPACE);

// Allow access if the system is public or the caller has access to the namespace or name
if (!publicAccess) AccessControl._requireAccess(systemId, caller);

Expand Down
6 changes: 3 additions & 3 deletions packages/world/src/WorldContext.sol
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ library WorldContextProviderLib {
* @notice Makes a staticcall to the target contract with context values appended to the calldata.
* @param msgSender The address of the transaction sender.
* @param target The address of the contract to call.
* @param callData The calldata for the call.
* @return success A boolean indicating whether the call was successful or not.
* @return data The abi encoded return data from the call.
* @param callData The calldata for the staticcall.
* @return success A boolean indicating whether the staticcall was successful or not.
* @return data The abi encoded return data from the staticcall.
*/
function staticcallWithContext(
address msgSender,
Expand Down

0 comments on commit 45b7539

Please sign in to comment.