Merge remote-tracking branch 'origin/master' into orderspec

This commit is contained in:
Tim Olson
2023-12-08 15:24:48 -04:00

11
abi.js
View File

@@ -41,7 +41,16 @@ export async function getAbi(className) {
let found = abi[className] let found = abi[className]
if (found === undefined) { if (found === undefined) {
console.log('warning: loading ABI from filesystem for '+className) console.log('warning: loading ABI from filesystem for '+className)
const data = await readFile(ABI_BASE_PATH + `/${className}.sol/${className}.json`) let data = await readFile(ABI_BASE_PATH + `/${className}.sol/${className}.json`)
// Tricky code to handle proxy Vault where interface file is needed instead of class file
if (className == 'Vault') {
try {
data = await readFile(ABI_BASE_PATH + `/I${className}.sol/I${className}.json`)
}
catch (e) {
if (e.code !== 'ENOENT') throw e;
}
}
found = JSON.parse(data.toString())['abi'] found = JSON.parse(data.toString())['abi']
abi[className] = found abi[className] = found
} }