-
-
Notifications
You must be signed in to change notification settings - Fork 827
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
create_with_code_of() does not execute __init__ #773
Comments
@haydenadams I will have to dig deeper exactly what's wrong. Could it be that the init code isn't ever executed? |
@jacqueswww Tried setting something else in init and it returned 0. As far as I can tell, init is never executed in |
That's what I suspected, basically the init code isn't part of the runtime code on chain. We'll have to figure out a new function or extension of the existing function that allows you to scrape the init code. |
In the meantime you can build a fake init function with a boolean that can only be called once :-P |
Makes sense, thanks! Already implemented that as a temporary solution. |
btw b/c of this, Unisocks classic was able to verify on etherscan with this code: despite their init function being different. |
🤣🤣🤣 |
Nice! |
What's your issue about?
My post might be unnecessary if #649 is going to be the standard factory pattern.
I'm working on a factory contract that uses
create_with_code_of()
to launch exchange contracts.Ideally I want the contract that is launched to know the address of the factory. Since
create_with_code_of()
does not support passing arguments, I tried setting it in the constructor of the exchange:unfortunately, this does not work:
How can it be fixed?
Allow contracts created using
create_with_code_of()
to recognize msg.sender in the constructor.Or not if #649 is implemented
Or I'm missing something/there is a better factory pattern I should be using that allows passing parameters?
Cute Animal Picture
The text was updated successfully, but these errors were encountered: