Skip to content

Commit

Permalink
fix: issues parsing ABI causing errors in ethers-decode-error library
Browse files Browse the repository at this point in the history
  • Loading branch information
micwallace committed Oct 29, 2024
1 parent e622db3 commit 624c6b2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions javascript/engine-js/src/tokenScript/Contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ export class Contract {
if (abiXml.length){
try {
this.abi = JSON.parse(abiXml[0].innerHTML);
if (!Array.isArray(this.abi))
throw new Error("ABI is not a valid ABI");
} catch (e){
console.warn("Failed to parse contract ABI", e);
this.abi = [];
}
}
}
Expand Down

0 comments on commit 624c6b2

Please sign in to comment.