Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

vals can be null in decodeParameters and lib crashes #40

Open
Elyx0 opened this issue Jun 30, 2021 · 1 comment
Open

vals can be null in decodeParameters and lib crashes #40

Elyx0 opened this issue Jun 30, 2021 · 1 comment

Comments

@Elyx0
Copy link

Elyx0 commented Jun 30, 2021

function decodeParameters(types, vals) {
  return defaultAbiCoder.decode(types, '0x' + vals.replace(/0x/i, ''));
}

vals being null the replace crashes the whole stuff.

Coming from

            outerResultsDecoded = decodeParameters(['uint256', 'bytes[]'], outerResults);

with outerResults being undefined.

returnDataMeta is the correct length.

testmulticall.js TypeError: Cannot read property 'replace' of undefined
    at rs (multicall.esm.js:24)
    at multicall.esm.js:264
    at c (runtime.js:63)
@Elyx0
Copy link
Author

Elyx0 commented Jul 1, 2021

It fixed itself. No clue, maybe the RPC hit quotas... any other idea why vals could be undefined?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant