Skip to content

Commit

Permalink
fix(world): use WorldContextConsumerLib._msgSender() instead of msg.s…
Browse files Browse the repository at this point in the history
…ender (#3436)
  • Loading branch information
vdrg authored Jan 9, 2025
1 parent ff8a065 commit 653f378
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/heavy-eggs-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@latticexyz/world": patch
---

Use `WorldContextConsumerLib._msgSender()` instead of `msg.sender` in system libraries.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ export function renderSystemLibrary(options: RenderSystemLibraryOptions) {
symbol: "SystemCall",
path: `${worldImportPath}/SystemCall.sol`,
},
{
symbol: "WorldContextConsumerLib",
path: `${worldImportPath}/WorldContext.sol`,
},
{
symbol: "Systems",
path: `${worldImportPath}/codegen/tables/Systems.sol`,
Expand Down Expand Up @@ -96,7 +100,7 @@ export function renderSystemLibrary(options: RenderSystemLibraryOptions) {
}
function callAsRoot(${userTypeName} self) internal view returns (RootCallWrapper memory) {
return RootCallWrapper(self.toResourceId(), msg.sender);
return RootCallWrapper(self.toResourceId(), WorldContextConsumerLib._msgSender());
}
function callAsRootFrom(${userTypeName} self, address from) internal pure returns (RootCallWrapper memory) {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 653f378

Please sign in to comment.