mud icon indicating copy to clipboard operation
mud copied to clipboard

declare and deploy module systems with deploy CLI instead of inside module install

Open frolic opened this issue 1 year ago • 4 comments

creating system contracts eats up a lot of the gas used in a module install so we should figure out how to separate the system deploy, esp since we can route it through the deterministic deployer

frolic avatar Apr 25 '24 13:04 frolic

@alvrs noted this would prob be easier if we could point to a module dir/package that as a mud config and load from that, but we'll probably need some way to determine that it's a module and not a world?

frolic avatar Apr 25 '24 13:04 frolic

Maybe we have some preprocessor that replace system creation with their deterministic address. Sadly i'm not sure Solidity alone will play nice here.

ludns avatar Apr 25 '24 19:04 ludns

Maybe we have some preprocessor that replace system creation with their deterministic address. Sadly i'm not sure Solidity alone will play nice here.

We use a common deployer interface, so I think we could pass in the deployer address and call it to create the contract?

(bool success, bytes memory data) = deployer.call(abi.encodePacked(SALT, type(SomeSystem).creationCode));

but prob need to wrap this in a lib that can do a bytecode check to make sure its not already deployed, returns a nice address, etc.

frolic avatar Apr 25 '24 23:04 frolic