Skip to content

Commit 624c6b2

Browse files
committed
fix: issues parsing ABI causing errors in ethers-decode-error library
1 parent e622db3 commit 624c6b2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

javascript/engine-js/src/tokenScript/Contract.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,11 @@ export class Contract {
3535
if (abiXml.length){
3636
try {
3737
this.abi = JSON.parse(abiXml[0].innerHTML);
38+
if (!Array.isArray(this.abi))
39+
throw new Error("ABI is not a valid ABI");
3840
} catch (e){
3941
console.warn("Failed to parse contract ABI", e);
42+
this.abi = [];
4043
}
4144
}
4245
}

0 commit comments

Comments
 (0)