this mainly allows us to check if an account has a certain role and thus if the account can call specific contract functions. At some point we might want to extend that to support the check if an account can call the function. For that we would need to have a mapping between function names and roles, which we have not right now.
24 lines
635 B
JavaScript
24 lines
635 B
JavaScript
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 files = [
|
|
'Contributor',
|
|
'Contribution',
|
|
'Kernel',
|
|
'Proposal',
|
|
'Token',
|
|
'ACL'
|
|
];
|
|
|
|
files.forEach((fileName) => {
|
|
let file = require(`${contractsPath}/${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");
|