-
Notifications
You must be signed in to change notification settings - Fork 22
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
Compute stuff using futures #714
Comments
You can't compute over the value of a future. We do want to support complex use cases though, to help me understand, the intent here is to allow So maybe some API enhancements like: const deployedAddress = m.readEventArgument(
rocketImpl,
"Deployed",
"deployedAddress"
);
const callData = m.encodeCallData([deployedAddress])
m.call(myContract, "someFunction", [callData]); |
Yes, almost. I'd like to encode a function call, so it would be convenient to also be able to compute the function selector using the function signature - or something along those lines. I haven't looked into the futures internals properly yet, but is it possible to just expose a lower-level future builder that we could use to build custom stuff? Then common usecases could be added to the module builder api? |
const initCall = m.encodeFunctionCall('init(address)', deployedAddress)
// or
const initCall = m.encodeFunctionCall('init', ['address'], [deployedAddress]) or if the ABI is available in the module builder at some point, could even infer the function signature types? |
Hey, this is really interesting, @kevincharm! Can you tell us a bit more about the need to encode the function call? Are you using some sort of factory that deploys and inits in the same call? Or something like that? We'd like to understand what's the right capability to expose that would enable your usecase. |
Not exactly - I'm just trying to deploy and initialise a standard ERC1967 proxy (see second argument in constructor here: |
Having the same problem. I tried initialization in a separate call like this
But this also doesn't work due to validation (method 'init' does not exist on a proxy contract) |
Apologies if this is covered somewhere in docs, but I couldn't find it. Is there a way to do more complex stuff with futures? e.g. I need to construct some function call using a future address:
The text was updated successfully, but these errors were encountered: