mud icon indicating copy to clipboard operation
mud copied to clipboard

add access list to namespaces, tables

Open frolic opened this issue 11 months ago • 1 comments

systems in config already have accessList

we could add something similar to namespaces and tables to more easily define granular access via config and get deployed automatically

example: I have a MintSystem in my app namespace and I create an ERC20 in a token namespace. I should be able to specify something like

namespaces: {
  app: {
    systems: {
      MintSystem: { ... }
    },
  },
  token: {
    accessList: ["MintSystem"],
    ...
  }
},
modules: [defineERC20Module("token", ...)]

then my MintSystem should be able to call ERC20(tokenAddress).mint()

~~https://github.com/latticexyz/mud/issues/3541 should come first though, because specifying namespaces in the config means they'll get registered before the module is called, which won't have access to the namespace~~ not needed with https://github.com/latticexyz/mud/issues/3569

frolic avatar Jan 30 '25 15:01 frolic

would be really useful. especially when building multi-token apps or complex games

executionreverted avatar Jan 30 '25 18:01 executionreverted