Developers Forum for XinFin XDC Network

Chris Buonocore
Chris Buonocore

Posted on

Error interacting with a XDC contract from ethers.js

Hey All,

Just started working with XDC Testnet and trying to interact with a deployed contract here using ethers.js

https://explorer.apothem.network/address/xdcdb73769d3132dcde68d27b91e2dd278bd6be917a

Was able to successfully deploy this contract above, however when I interact with it via ethers I get the below uncaught exception:

Image description

From a quick search, looks like the ENS error is typically associated with a unparseable address, might be the xdc prefix working with ethers?

Could also share code, but using new ethers.Contract(...) with this address. Appreciate any advice/help!

Discussion (2)

Collapse
ruslan_wing profile image
ruslan wing

You can check out some of the similar issue which has been posted at Ether.js

github.com/ethers-io/ethers.js/iss...

github.com/NomicFoundation/hardhat...

stackoverflow.com/questions/723714...

Collapse
cbonoz profile image
Chris Buonocore Author

Following up here in case others run into this - using the regular 0x prefix instead of xdc appears to have worked.

Thanks for the links otherwise Ruslan!