Open oilnam opened 3 years ago
@oilnam Hey, thanks for looking into this and taking the time to open the PR! Yeah what you're saying makes a lot of sense, the whole thing shouldn't error out on a single decode issue. But I think the implementation would need to satisfy two additional properties to make sense:
I would also not overwrite the Success
property because that's tied to the response struct from the Multicall contract and changing that could lead to confusion.
Description: Decoding errors on sub-calls should not break the entire multicall.
Current behavior: a single decoding error on a sub-call results in the whole multicall breaking, returning an error.
Proposed behavior: a single decoding error on a sub-call will mark the sub-call as failed, without impacting all other calls.
Decoding errors can happen for a variety of reasons, for example if Geth doesn't return any data. I added a test with two calls to demonstrate the new behavior, where the broken calls is targeting a contract that self-distructed.
PS thanks for open sourcing this! 🙏