Load contract APIs from hardhat artifacts
This commit is contained in:
parent
9d87636fb0
commit
ba52e61d50
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,24 +1,18 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const contractsPath = path.join(__dirname, '..', 'build', 'contracts');
|
||||
const libPath = path.join(__dirname, '..', 'lib');
|
||||
const abisPath = path.join(libPath, 'abis');
|
||||
const contractsPath = path.join(__dirname, "..", "artifacts", "contracts");
|
||||
const libPath = path.join(__dirname, "..", "lib");
|
||||
const abisPath = path.join(libPath, "abis");
|
||||
|
||||
const files = [
|
||||
'Contributor',
|
||||
'Contribution',
|
||||
'Kernel',
|
||||
'Proposal',
|
||||
'Token',
|
||||
'Reimbursement',
|
||||
'ACL'
|
||||
];
|
||||
const files = ["Contributor", "Contribution", "Token", "Reimbursement"];
|
||||
|
||||
files.forEach((fileName) => {
|
||||
let file = require(`${contractsPath}/${fileName}.json`);
|
||||
let file = require(`${contractsPath}/${fileName}.sol/${fileName}.json`);
|
||||
let abiFile = path.join(abisPath, `${fileName}.json`);
|
||||
fs.writeFileSync(abiFile, JSON.stringify(file.abi));
|
||||
});
|
||||
|
||||
console.log("Don't forget to reaload the JSON files from your application; i.e. restart kredits-web");
|
||||
console.log(
|
||||
"Don't forget to reaload the JSON files from your application; i.e. restart kredits-web"
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user