Skip to content

Commit

Permalink
add natspec
Browse files Browse the repository at this point in the history
  • Loading branch information
alvrs committed Jan 11, 2024
1 parent 7695ebb commit 52808d4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/world/src/modules/core/LimitedCallContext.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.21;

/**
* @title LimitedCallContext
* @dev Systems are expected to be always called via the central World contract.
* Depending on whether it is a root or non-root system, the call is performed via `delegatecall` or `call`.
* Since Systems are expected to be stateless and only interact with the World state,
* it is normally not necessary to prevent direct calls to the systems.
* However, since the `CoreSystem` is known to always be registered as a root system in the World,
* it is always expected to be delegatecalled, so we made this expectation explicit by reverting if it is not delegatecalled.
*
* @dev Based on OpenZeppelin's UUPSUpgradeable.sol
* https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.0/contracts/proxy/utils/UUPSUpgradeable.sol#L50
*/
contract LimitedCallContext {
address private immutable __self = address(this);

Expand Down

0 comments on commit 52808d4

Please sign in to comment.