-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(world): change requireOwnerOrSelf to requireOwner #1457
Conversation
🦋 Changeset detectedLatest commit: 51b7b05 The changes in this PR will be included in the next version bump. This PR includes changesets to release 28 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
@@ -19,12 +19,16 @@ import { NAMESPACE, MODULE_NAME, SYSTEM_NAME, TABLE_NAME } from "./constants.sol | |||
contract UniqueEntityModule is IModule, WorldContextConsumer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this and others use oops, confused this with the other PRis Module
instead of is IModule
?
cccdb2f
to
6820bf8
Compare
ResourceSelector.from(ROOT_NAMESPACE, CORE_SYSTEM_NAME), | ||
coreSystem, | ||
true | ||
funcSelectorAndArgs: abi.encodeCall( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not blocking this PR but would it make more sense to call this calldata
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we use funcSelectorAndArgs
in a couple places, could consider changing that to callData
(calldata
wouldn't work because it's a reserved word). Let's track in an issue!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -58,68 +59,68 @@ contract KeysInTableHook is IStoreHook { | |||
|
|||
function onBeforeDeleteRecord(bytes32 tableId, bytes32[] memory key, Schema) public { | |||
bytes32 keysHash = keccak256(abi.encode(key)); | |||
(bool has, uint40 index) = UsedKeysIndex.get(tableId, keysHash); | |||
(bool has, uint40 index) = UsedKeysIndex.get(UsedKeysIndexTableId, tableId, keysHash); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does StoreSwitch not work here anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume it's cause they got namespaced?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah exactly, it's not using the root namespace anymore but we don't support separate namespaces in the config yet, so need to do it manually here for now by creating a separate table id
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think technically it doesn't have to be namespaced though but could continue using the root namespace since we only support installing it as root module for now anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted this change. Had originally started to refactor the module to support non-root installations but then realized it would be a bigger change because we need to register a store hook on an arbitrary table.
); | ||
if (!success) revertWithBytes(returnData); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it make sense to move this pattern into a lib for the commonly used methods for ergonomics?
WorldRoot.registerStoreHook(world, ...)
WorldRoot.registerSystem(world, ...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree it would be more ergonomic to use, but unfortunately more gas expensive because of all the parameters that need to be passed around in memory, and that library would be pretty painful to maintain (because it would have to include all the function signatures of all systems of IBaseWorld
which includes all the functions the CoreModule
registers)
|
||
function getName() public pure returns (bytes16) { | ||
return MODULE_NAME; | ||
} | ||
|
||
function installRoot(bytes memory args) public { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it ok that installRoot
won't delegatecall anything here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah this module doesn't require any root access, it's just registering the table and system in its own namespace
no major changes since last approvals, going ahead with mege |
No description provided.