-
Notifications
You must be signed in to change notification settings - Fork 6k
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
'Generic call' to return bytes instead of boolean #434
Comments
The reason call does not return the raw ABI bytes is because there is no way in the EVM to find out how much the called contract actually returned - in fact the caller has to "guess" or "know" that number and reserve the memory in advance. With inline assembly, you can implement a version of call that returns a given number of bytes. |
Well actually there's a way you have proposed https://github.com/ethereum/EIPs/blob/master/EIPS/eip-5.md - would it make sense having this open until that is implemented? |
Question: should we re-throw on failure or somehow report the failure condition (e.g. by returning (bytes, bool))? |
This is now possible with I am not entirely sure what would be the best method, but perhaps a tuple |
I had opened #3368. But let's move the discussion there as it seems quite related. I think we must make this change non-breaking by creating a new function making a raw call. We could also reserve the first return to indicate if the call succeeded, so it could be used like |
@axic do we want to have this for 0.5.0? |
I'd be happy but it may be too many changes (from the users' perspective). Also it will be more useful once the |
I agree. In addition to that, we wanted to deprecate the use of low-level features that do not go all the way down the rabbit hole. So I think a generic |
Given
input |
The original issue statement should be extended that this should apply to all low-level calls: In that case we'd need to come up with 3 new names, which seems a bit too much namespace pollution. |
Since |
I vote for including it in 0.5.0. |
Currently the
call()
with a method signature and parameters returns a boolean stating the success of execution (true
if successful).I think it would make more sense to return (or to have a version of
call
which does) the raw ABI bytes.The text was updated successfully, but these errors were encountered: