zilpay / zil-pay

ZilPay browser extension enables browsing Zilliqa blockchain enabled websites.
https://zilpay.io
Other
3 stars 1 forks source link

Fix provider crashes when calling `getInit` on a non-contract address. #69

Closed stevenkhong closed 2 years ago

stevenkhong commented 2 years ago

Reproduction Steps:

zilPay.contracts.at("0x5454de40eb75020deba6a57fc6e258577cf35858").getInit();

0x5454de40eb75020deba6a57fc6e258577cf35858 is an externally owned address. Calling getInit on any non-contract address will result in this uncaught error.

This fix returns undefined if getInit is called on a non-contract address. Imitates the behaviour of Zilliqa JS SDK

Screenshot 2022-01-26 at 3 16 55 PM

Edit: Although this issue is fundamentally with the transaction.provider, it should not be returning undefined for response.

hicaru commented 2 years ago

Hello thanks for PR, but a bug on content.js side