I have seen contracts creating contracts like here:

Where could I find more information about this feature?



  • JasperJasper Eindhoven, the NetherlandsMember Posts: 514 ✭✭✭
    This wiki page on serpent lists create looks to be just a file in, and returning the contract address.. I suppose that means the addresses important to the creating contract need to be baked in that data. That might be sufficient to you.

    To be honest, i havent encountered the need for create yet, even in just thinking about it. Anyway, it may be desirable to be able to read the create from at some point, have people vote on it or something, and then launch it. But really.. might aswel just have people submit the contract, then register the address, and vote about that addres.. That said, heard project douglas uses them.

    Bit hardcore, but rewriter.cpp has 'replacement rules' that are recursively used, yielding LLL-like stuff, i.e. you can sort-of see how that relates to other things.

    This replacement rule(L217) has three arguments, the endowment is clear there. Think (msize) expands to the current location where variables are being put, i.e. it is moved forward every time something like creating a variable writes something. (lll ... (msize)) would then write the code into the memory starting from (msize), and when done returns the length of data written. Cpp-ethereum code shows the same. So it is create(endowment, from_memory, use_size). So you can create that memory any way you wish, but tbh, it sounds like something to think twice about if there is not a better approach.
Sign In or Register to comment.