-
Notifications
You must be signed in to change notification settings - Fork 4
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
Issue #8: no modules on root #10
Conversation
it is now possible to install a module through a Solidity script containing two lines: ``` SmartObjectFrameworkModule module = new SmartObjectFrameworkModule(); IBaseWorld(worldAddress).installModule(module, abi.encode(namespace)); ``` `Deploying with namespace==bytes14(0)` is forbidden for security reasons; the fact that _namespace() has been added to `EveSystem` means it will probably break the current Access Control PR since there's systems there that also have their own implementation of it, but since the PR has not been merged yet it's okay.
There's a misconfig somewhere and it's driving me insane idk if it's, like, a wrong tableID or some registration tomfoolery at play, or just some general deployment shennanigan but there's *something* happening with the Test smart-deployable-system Anyways, I know the structure is (for the most part,) fine, so it's just a matter of debugging this.
This is a dirty fix, where we need to manually make sure that the namespace used to access tables in EveSystem matches the one given during the Smart Object Framework deployment; because we don't know in advance where that module is going to be deployed exactly, and because the goal is for contracts to inherit `EveSystem` methods everywhere, we can't just use whatever _namespace() returns because it would only work for core contracts and nothing else e.g. builders trying to deploy new systems, _namespace() method inside EveSystem will fetch the namespace they deployed their stuff to, and that's bad anyways. There might be a clean and efficient way to do this that doesnt require to use hard-coded values, but I don;'t see it for now. It's not meant for us to deploy a bunch of core contract suites anywaym it only needs to be done once, so hardcoding stuff is fine and gas-efficient, at the cost of potentially breaking stuff if we need to re-deploy a new suite in the future. If anything, it shouldnt be too hard to catch that
same as smart-object-framework, added unit tests
Could we also run |
My bad, I thought I had my husky pre-commit hooks set up properly but it wasnt. Fixed formatting in d402e83 |
Co-authored-by: skygirl <100742846+0xxlegolas@users.noreply.github.com>
I believe this is not quite correct.. the Solidity conflict only occurs if the method signatures are exactly the same. This behaviour holds for all contracts, not just libraries. So, if there are different parameters in the two function calls, then their method signature will be different and no conflict will occur as you mentioned. E.g.
will cause a conflict, but
should not |
As we move to having full modules in our monorepo (which we will treat as standalone cc: @gunnigylfa |
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.
A few inline comments to get clarity and agreement on, but overall looking good!
One point of discussion:
I think there is a need for abstracting cross-module interaction. I'm not sure using the current lib pattern is the perfect solutions for this. It is a rather heavy thing for just exposing a namespace and interface.
That being said, I do not have an alternate solution ATM. So I think we should go with the current implementation for now, get feedback, and think about if there is a lighter way to accomplish this.
as 0xxlegolas said it's defaulted to true so there's no need to explicitly add this flag
unfortunately, that's an issue at the Compiler level; for some reason, In a perfect world it should work, yeah |
Yes I have used overloaded functions as well and it works fine. |
Sorry, I didn't explain the issue properly.
|
Now it makes sense, If we define overloaded functions in library then it does not recognise the functions unlike interfaces. |
temporarily adding all `worlds.json` files to `.gitignore` since it's cluttering up commits at increasing speeds
Making modules more modular by refactoring them into a Module contract , which significantly streamlines things
A few considerations:
__Modules
contracts to deploy said modules; instead, it seem MUD's command-line tool tries to deploy whatever he can find in that subfolder and just assumes it belongs in the same namespace, and deploys everything there (Tables, Systems, along with some World-level function signatures)I feel like we should build a simple script that just uses the
__Module
implementation we have to deploy said module in a World, so that we have full control of the deployment script instead of relying on MUD's. There's also the issue with function signatures that are registered at World-level, which could lead to issues, on top of having to use autogenerated interfaces that doesn't match the genuine ones.Also adding a library that packages all Smart-Object-Framework features into a useable "object" that you can instantiate to call any and all functions contained in that framework. There's an issue with the Solidity compiler, apparently there is no way to have an interface that contains function overloading, and use that interface as an input
==> in
abi.encodeCall( Interface.foo, (a, b))
only works if there is onlyfoo(uint a, uint b)
defined in the interface.If
foo(uint a, uint b, string c)
andfoo(uint a, uint b)
exists concurrently inInterface
, the compiler will throw an error.See related issue on GitHub : etherum/solidity/issues#12981