keycard-redeem/scripts/utils.js

12 lines
325 B
JavaScript
Raw Normal View History

2020-05-13 11:23:17 +00:00
const fs = require('fs');
module.exports.loadJSON = function(path) {
let file = fs.readFileSync(path, "utf-8");
let loadedAsset = JSON.parse(file);
return loadedAsset;
}
module.exports.loadContract = function(web3, path) {
let config = this.loadJSON(path);
return new web3.eth.Contract(config["abiDefinition"]);
}