Skip to content

Commit

Permalink
docs(world): add comments for prohibitDirectCallback modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
yonadaa committed Feb 26, 2024
1 parent 3be4dee commit 26d54da
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/world/src/World.sol
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ contract World is StoreData, IWorldKernel {

/**
* @dev Prevents the World contract from calling itself.
* The world is not able to call itself; all operations to internal tables happen as internal library calls, and all calls to root system happen as a delegatecall to the system.
* However, since this is an important invariant, we make it explicit by reverting if `msg.sender` is `address(this)` in all `World` methods.
* If it was possible to make the `World` call itself, it would be possible to access internal tables that only the `World` should have access to.
*/
modifier prohibitDirectCallback() {
if (msg.sender == address(this)) {
Expand Down

0 comments on commit 26d54da

Please sign in to comment.