Closed Plopmenz closed 4 months ago
Hmm good to know! I haven't been keeping up with the latest viem changes, will need to investigate.
Should be fixed in the latest release v0.13.1, can you please confirm that it's working for you now? Thanks for the bug report!
Thank you for the fast resolution!
Confirmed it is working now, at least within the scope of my project. Happy I could contribute!
Calling
whatsabi.autoload(< address >, {provider: < viem public client >})
will throw an error when using the latest version of viem. getBytecode is now deprecated and viem is also using getCode. This makes CompatibleProvider classify it as Ethers5Provider, resulting in none of the function arguments to be correctly passed to the viem provider. Hence the call to retrieve the (byte)code of the provided address will throw an RPC error, due to address being null (the .address property is requested and equals to null, as viem expects an object as input, not a string).A current workaround to make this getCode call succeed until whatsabi is updated would be to use an extension of string as address passed to autoload:
This would need to be extended with arguments of any other provider calls in case they are desired to succeed.