create a generateClass function
This commit is contained in:
parent
e993ec27ae
commit
a8e89a4451
|
@ -0,0 +1,95 @@
|
||||||
|
|
||||||
|
function checkWeb3(web3) {
|
||||||
|
if (typeof web3.version !== 'string' || !web3.version.startsWith('1.')) {
|
||||||
|
throw new Error('web3 version 1.x is required');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const estimateGas = (web3, method, opts) => {
|
||||||
|
if (opts.$noEstimateGas) return Promise.resolve(4700000);
|
||||||
|
if (opts.$gas || opts.gas) return Promise.resolve(opts.$gas || opts.gas);
|
||||||
|
|
||||||
|
return method.estimateGas(opts)
|
||||||
|
// eslint-disable-next-line no-confusing-arrow
|
||||||
|
.then(gas => opts.$extraGas ? gas + opts.$extraGas : Math.floor(gas * 1.1));
|
||||||
|
};
|
||||||
|
|
||||||
|
// if constant method, executes a call, otherwise, estimates gas and executes send
|
||||||
|
const execute = (web3, txObject, opts, cb) => {
|
||||||
|
const { _method } = txObject;
|
||||||
|
|
||||||
|
if (_method.constant) return txObject.call(opts);
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-param-reassign
|
||||||
|
return estimateGas(web3, txObject, opts)
|
||||||
|
.then((gas) => {
|
||||||
|
Object.assign(opts, { gas });
|
||||||
|
return (cb) ? txObject.send(opts, cb) : txObject.send(opts);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const methodWrapper = (web3, method, ...args) => {
|
||||||
|
let cb;
|
||||||
|
let opts = {};
|
||||||
|
|
||||||
|
if (typeof args[args.length - 1] === 'function') cb = args.pop();
|
||||||
|
if (typeof args[args.length - 1] === 'object') opts = args.pop();
|
||||||
|
|
||||||
|
const txObject = method(...args);
|
||||||
|
|
||||||
|
return execute(web3, txObject, opts, cb);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
module.exports = (abi, bytecode) => {
|
||||||
|
const C = function C(web3, address) {
|
||||||
|
checkWeb3(web3);
|
||||||
|
|
||||||
|
this.$web3 = web3;
|
||||||
|
this.$address = address;
|
||||||
|
this.$contract = new web3.eth.Contract(abi, address);
|
||||||
|
this.$abi = abi;
|
||||||
|
this.$byteCode = bytecode;
|
||||||
|
|
||||||
|
|
||||||
|
Object.keys(this.$contract.methods)
|
||||||
|
.filter(key => !key.startsWith('0x'))
|
||||||
|
.forEach((key) => {
|
||||||
|
this[key] = (...args) => methodWrapper(web3, this.$contract.methods[key], ...args);
|
||||||
|
});
|
||||||
|
|
||||||
|
// set default from address
|
||||||
|
web3.eth.getAccounts()
|
||||||
|
.then((accounts) => {
|
||||||
|
this.$contract.options.from = (accounts.length > 0) ? accounts[0] : undefined;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
C.new = function (web3, ...args) {
|
||||||
|
let opts = {};
|
||||||
|
if (args && args.length > 0 && typeof args[args.length - 1] === 'object') {
|
||||||
|
opts = args.pop();
|
||||||
|
}
|
||||||
|
|
||||||
|
const deploy = new web3.eth.Contract(abi)
|
||||||
|
.deploy({
|
||||||
|
data: bytecode,
|
||||||
|
arguments: args,
|
||||||
|
});
|
||||||
|
|
||||||
|
const getAccount = () => {
|
||||||
|
if (opts.from) return Promise.resolve(opts.from);
|
||||||
|
|
||||||
|
return web3.eth.getAccounts()
|
||||||
|
// eslint-disable-next-line no-confusing-arrow
|
||||||
|
.then(accounts => (accounts.length > 0) ? accounts[0] : undefined);
|
||||||
|
};
|
||||||
|
|
||||||
|
return getAccount()
|
||||||
|
.then(account => Object.assign(opts, { from: account }))
|
||||||
|
.then(() => execute(web3, deploy, opts))
|
||||||
|
.then(contract => new C(web3, contract.options.address));
|
||||||
|
};
|
||||||
|
|
||||||
|
return C;
|
||||||
|
};
|
|
@ -3,279 +3,195 @@ const LiquidPledgingAbi = require('../build/LiquidPledging.sol').LiquidPledgingA
|
||||||
const LiquidPledgingCode = require('../build/LiquidPledging.sol').LiquidPledgingByteCode;
|
const LiquidPledgingCode = require('../build/LiquidPledging.sol').LiquidPledgingByteCode;
|
||||||
const LiquidPledgingMockAbi = require('../build/LiquidPledgingMock.sol').LiquidPledgingMockAbi;
|
const LiquidPledgingMockAbi = require('../build/LiquidPledgingMock.sol').LiquidPledgingMockAbi;
|
||||||
const LiquidPledgingMockCode = require('../build/LiquidPledgingMock.sol').LiquidPledgingMockByteCode;
|
const LiquidPledgingMockCode = require('../build/LiquidPledgingMock.sol').LiquidPledgingMockByteCode;
|
||||||
|
const generateClass = require('./generateClass');
|
||||||
function checkWeb3(web3) {
|
|
||||||
if (typeof web3.version !== 'string' || !web3.version.startsWith('1.')) {
|
|
||||||
throw new Error('web3 version 1.x is required');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const estimateGas = (web3, method, opts) => {
|
|
||||||
if (opts.$noEstimateGas) return Promise.resolve(4700000);
|
|
||||||
if (opts.$gas || opts.gas) return Promise.resolve(opts.$gas || opts.gas);
|
|
||||||
|
|
||||||
return method.estimateGas(opts)
|
|
||||||
// eslint-disable-next-line no-confusing-arrow
|
|
||||||
.then(gas => opts.$extraGas ? gas + opts.$extraGas : Math.floor(gas * 1.1));
|
|
||||||
};
|
|
||||||
|
|
||||||
// if constant method, executes a call, otherwise, estimates gas and executes send
|
|
||||||
const execute = (web3, txObject, opts, cb) => {
|
|
||||||
const { _method } = txObject;
|
|
||||||
|
|
||||||
if (_method.constant) return txObject.call(opts);
|
|
||||||
|
|
||||||
// eslint-disable-next-line no-param-reassign
|
|
||||||
return estimateGas(web3, txObject, opts)
|
|
||||||
.then((gas) => {
|
|
||||||
Object.assign(opts, { gas });
|
|
||||||
return (cb) ? txObject.send(opts, cb) : txObject.send(opts);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const methodWrapper = (web3, method, ...args) => {
|
|
||||||
let cb;
|
|
||||||
let opts = {};
|
|
||||||
|
|
||||||
if (typeof args[args.length - 1] === 'function') cb = args.pop();
|
|
||||||
if (typeof args[args.length - 1] === 'object') opts = args.pop();
|
|
||||||
|
|
||||||
const txObject = method(...args);
|
|
||||||
|
|
||||||
return execute(web3, txObject, opts, cb);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
module.exports = (test) => {
|
module.exports = (test) => {
|
||||||
const $abi = (test) ? LiquidPledgingMockAbi : LiquidPledgingAbi;
|
const $abi = (test) ? LiquidPledgingMockAbi : LiquidPledgingAbi;
|
||||||
const $byteCode = (test) ? LiquidPledgingMockCode : LiquidPledgingCode;
|
const $byteCode = (test) ? LiquidPledgingMockCode : LiquidPledgingCode;
|
||||||
|
|
||||||
|
const LiquidPledging = generateClass($abi, $byteCode);
|
||||||
|
|
||||||
return class LiquidPledging {
|
async function $getNote(idNote) {
|
||||||
constructor(web3, address) {
|
const note = {
|
||||||
checkWeb3(web3);
|
delegates: [],
|
||||||
|
};
|
||||||
|
const res = await this.getNote(idNote);
|
||||||
|
note.amount = this.$toNumber(res.amount);
|
||||||
|
note.owner = res.owner;
|
||||||
|
for (let i = 1; i <= this.$toDecimal(res.nDelegates); i += 1) {
|
||||||
|
const delegate = {};
|
||||||
|
const resd = await this.getNoteDelegate(idNote, i);
|
||||||
|
delegate.id = this.$toDecimal(resd.idDelegate);
|
||||||
|
delegate.addr = resd.addr;
|
||||||
|
delegate.name = resd.name;
|
||||||
|
note.delegates.push(delegate);
|
||||||
|
}
|
||||||
|
if (res.proposedProject) {
|
||||||
|
note.proposedProject = this.$toDecimal(res.proposedProject);
|
||||||
|
note.commmitTime = this.$toDecimal(res.commitTime);
|
||||||
|
}
|
||||||
|
if (res.oldNote) {
|
||||||
|
note.oldProject = this.$toDecimal(res.oldNote);
|
||||||
|
}
|
||||||
|
if (res.paymentState === '0') {
|
||||||
|
note.paymentState = 'NotPaid';
|
||||||
|
} else if (res.paymentState === '1') {
|
||||||
|
note.paymentState = 'Paying';
|
||||||
|
} else if (res.paymentState === '2') {
|
||||||
|
note.paymentState = 'Paid';
|
||||||
|
} else {
|
||||||
|
note.paymentState = 'Unknown';
|
||||||
|
}
|
||||||
|
return note;
|
||||||
|
}
|
||||||
|
|
||||||
this.$web3 = web3;
|
LiquidPledging.prototype.$getNote = $getNote;
|
||||||
this.$address = address;
|
|
||||||
this.$contract = new web3.eth.Contract($abi, address);
|
|
||||||
this.$abi = $abi;
|
|
||||||
this.$byteCode = $byteCode;
|
|
||||||
|
|
||||||
// helpers
|
async function $getManager(idManager) {
|
||||||
this.$toNumber = web3.utils.toBN;
|
const manager = {};
|
||||||
this.$toDecimal = web3.utils.toDecimal;
|
const res = await this.getNoteManager(idManager);
|
||||||
|
if (res.managerType === '0') {
|
||||||
|
manager.type = 'Donor';
|
||||||
|
} else if (res.managerType === '1') {
|
||||||
|
manager.type = 'Delegate';
|
||||||
|
} else if (res.managerType === '2') {
|
||||||
|
manager.type = 'Project';
|
||||||
|
} else {
|
||||||
|
manager.type = 'Unknown';
|
||||||
|
}
|
||||||
|
manager.addr = res.addr;
|
||||||
|
manager.name = res.name;
|
||||||
|
manager.commitTime = this.$toDecimal(res.commitTime);
|
||||||
|
if (manager.paymentState === 'Project') {
|
||||||
|
manager.parentProject = res.parentProject;
|
||||||
|
manager.canceled = res.canceled;
|
||||||
|
}
|
||||||
|
return manager;
|
||||||
|
};
|
||||||
|
|
||||||
this.notes = [];
|
LiquidPledging.prototype.$getManager = $getManager;
|
||||||
this.managers = [];
|
|
||||||
|
|
||||||
Object.keys(this.$contract.methods)
|
async function getState() {
|
||||||
.filter(key => !key.startsWith('0x'))
|
const st = {
|
||||||
.forEach((key) => {
|
notes: [null],
|
||||||
this[key] = (...args) => methodWrapper(web3, this.$contract.methods[key], ...args);
|
managers: [null],
|
||||||
});
|
};
|
||||||
|
const nNotes = await this.numberOfNotes();
|
||||||
// set default from address
|
for (let i = 1; i <= nNotes; i += 1) {
|
||||||
web3.eth.getAccounts()
|
const note = await this.$getNote(i);
|
||||||
.then((accounts) => {
|
st.notes.push(note);
|
||||||
this.$contract.options.from = (accounts.length > 0) ? accounts[0] : undefined;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async $getNote(idNote) {
|
const nManagers = await this.numberOfNoteManagers();
|
||||||
const note = {
|
for (let i = 1; i <= nManagers; i += 1) {
|
||||||
delegates: [],
|
const manager = await this.$getManager(i);
|
||||||
};
|
st.managers.push(manager);
|
||||||
const res = await this.getNote(idNote);
|
|
||||||
note.amount = this.$toNumber(res.amount);
|
|
||||||
note.owner = res.owner;
|
|
||||||
for (let i = 1; i <= this.$toDecimal(res.nDelegates); i += 1) {
|
|
||||||
const delegate = {};
|
|
||||||
const resd = await this.getNoteDelegate(idNote, i);
|
|
||||||
delegate.id = this.$toDecimal(resd.idDelegate);
|
|
||||||
delegate.addr = resd.addr;
|
|
||||||
delegate.name = resd.name;
|
|
||||||
note.delegates.push(delegate);
|
|
||||||
}
|
|
||||||
if (res.proposedProject) {
|
|
||||||
note.proposedProject = this.$toDecimal(res.proposedProject);
|
|
||||||
note.commmitTime = this.$toDecimal(res.commitTime);
|
|
||||||
}
|
|
||||||
if (res.oldNote) {
|
|
||||||
note.oldProject = this.$toDecimal(res.oldNote);
|
|
||||||
}
|
|
||||||
if (res.paymentState === '0') {
|
|
||||||
note.paymentState = 'NotPaid';
|
|
||||||
} else if (res.paymentState === '1') {
|
|
||||||
note.paymentState = 'Paying';
|
|
||||||
} else if (res.paymentState === '2') {
|
|
||||||
note.paymentState = 'Paid';
|
|
||||||
} else {
|
|
||||||
note.paymentState = 'Unknown';
|
|
||||||
}
|
|
||||||
return note;
|
|
||||||
}
|
}
|
||||||
|
return st;
|
||||||
|
};
|
||||||
|
|
||||||
async $getManager(idManager) {
|
LiquidPledging.prototype.getState = getState;
|
||||||
const manager = {};
|
|
||||||
const res = await this.getNoteManager(idManager);
|
|
||||||
if (res.managerType === '0') {
|
|
||||||
manager.type = 'Donor';
|
|
||||||
} else if (res.managerType === '1') {
|
|
||||||
manager.type = 'Delegate';
|
|
||||||
} else if (res.managerType === '2') {
|
|
||||||
manager.type = 'Project';
|
|
||||||
} else {
|
|
||||||
manager.type = 'Unknown';
|
|
||||||
}
|
|
||||||
manager.addr = res.addr;
|
|
||||||
manager.name = res.name;
|
|
||||||
manager.commitTime = this.$toDecimal(res.commitTime);
|
|
||||||
if (manager.paymentState === 'Project') {
|
|
||||||
manager.parentProject = res.parentProject;
|
|
||||||
manager.canceled = res.canceled;
|
|
||||||
}
|
|
||||||
return manager;
|
|
||||||
}
|
|
||||||
|
|
||||||
async getState() {
|
LiquidPledging.prototype.generateDonorsState = function () {
|
||||||
const st = {
|
const donorsState = [];
|
||||||
notes: [null],
|
|
||||||
managers: [null],
|
|
||||||
};
|
|
||||||
const nNotes = await this.numberOfNotes();
|
|
||||||
for (let i = 1; i <= nNotes; i += 1) {
|
|
||||||
const note = await this.$getNote(i);
|
|
||||||
st.notes.push(note);
|
|
||||||
}
|
|
||||||
|
|
||||||
const nManagers = await this.numberOfNoteManagers();
|
const getDonor = (idNote) => {
|
||||||
for (let i = 1; i <= nManagers; i += 1) {
|
let note = this.notes[idNote];
|
||||||
const manager = await this.$getManager(i);
|
while (note.oldNode) note = this.notes[idNote];
|
||||||
st.managers.push(manager);
|
return note.owner;
|
||||||
}
|
};
|
||||||
return st;
|
|
||||||
}
|
|
||||||
|
|
||||||
generateDonorsState() {
|
|
||||||
const donorsState = [];
|
|
||||||
|
|
||||||
const getDonor = (idNote) => {
|
|
||||||
let note = this.notes[idNote];
|
|
||||||
while (note.oldNode) note = this.notes[idNote];
|
|
||||||
return note.owner;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Add a donor structure to the list
|
// Add a donor structure to the list
|
||||||
const addDonor = (_list, idDonor) => {
|
const addDonor = (_list, idDonor) => {
|
||||||
const list = _list;
|
const list = _list;
|
||||||
if (!list[idDonor]) {
|
if (!list[idDonor]) {
|
||||||
list[idDonor] = {
|
list[idDonor] = {
|
||||||
idDonor,
|
idDonor,
|
||||||
notAssigned: {
|
notAssigned: {
|
||||||
notes: [],
|
notes: [],
|
||||||
delegates: [],
|
delegates: [],
|
||||||
},
|
},
|
||||||
precommitedProjects: [],
|
precommitedProjects: [],
|
||||||
commitedProjects: [],
|
commitedProjects: [],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Add a delegate structure to the list
|
// Add a delegate structure to the list
|
||||||
const addDelegate = (_list, idDelegate) => {
|
const addDelegate = (_list, idDelegate) => {
|
||||||
const list = _list;
|
const list = _list;
|
||||||
if (!list[idDelegate]) {
|
if (!list[idDelegate]) {
|
||||||
list[idDelegate] = {
|
list[idDelegate] = {
|
||||||
idDelegate,
|
idDelegate,
|
||||||
name: this.managers[idDelegate].name,
|
name: this.managers[idDelegate].name,
|
||||||
notes: [],
|
notes: [],
|
||||||
delegtes: [],
|
delegtes: [],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const addProject = (_list, idProject) => {
|
const addProject = (_list, idProject) => {
|
||||||
const list = _list;
|
const list = _list;
|
||||||
if (!list[idProject]) {
|
if (!list[idProject]) {
|
||||||
list[idProject] = {
|
list[idProject] = {
|
||||||
idProject,
|
idProject,
|
||||||
notes: [],
|
notes: [],
|
||||||
commitedProjects: [],
|
commitedProjects: [],
|
||||||
name: this.managers[idProject].name,
|
name: this.managers[idProject].name,
|
||||||
commitTime: this.managers[idProject].commitTime,
|
commitTime: this.managers[idProject].commitTime,
|
||||||
owner: this.managers[idProject].owner,
|
owner: this.managers[idProject].owner,
|
||||||
parentProject: this.managers[idProject].parentProject,
|
parentProject: this.managers[idProject].parentProject,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const addDelegateNote = (stDonor, idNote) => {
|
const addDelegateNote = (stDonor, idNote) => {
|
||||||
const note = this.notes[idNote];
|
const note = this.notes[idNote];
|
||||||
stDonor.notAssigned.notes.push(idNote);
|
stDonor.notAssigned.notes.push(idNote);
|
||||||
let list = stDonor.notAssigned.delegates;
|
let list = stDonor.notAssigned.delegates;
|
||||||
for (let i = 0; i < note.delegationChain.length; i += 1) {
|
for (let i = 0; i < note.delegationChain.length; i += 1) {
|
||||||
const idDelegate = note.delegationChain[i];
|
const idDelegate = note.delegationChain[i];
|
||||||
addDelegate(list, idDelegate);
|
addDelegate(list, idDelegate);
|
||||||
list = list[idDelegate].delegates;
|
list = list[idDelegate].delegates;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const addProjectNote = (stDonor, idNote) => {
|
const addProjectNote = (stDonor, idNote) => {
|
||||||
const note = this.notes[idNote];
|
const note = this.notes[idNote];
|
||||||
|
|
||||||
const projectList = [];
|
const projectList = [];
|
||||||
let n = note;
|
let n = note;
|
||||||
while (n.oldNode) {
|
while (n.oldNode) {
|
||||||
projectList.unshift(n.owner);
|
projectList.unshift(n.owner);
|
||||||
n = this.notes[n.oldNode];
|
n = this.notes[n.oldNode];
|
||||||
}
|
|
||||||
|
|
||||||
let list = stDonor.commitedProjects;
|
|
||||||
for (let j = 0; j < projectList.length; j += 1) {
|
|
||||||
addProject(list, projectList[j]);
|
|
||||||
list[projectList[j]].notes.push(idNote);
|
|
||||||
list = list[projectList[j]].commitedProjects;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
for (let i = 0; i < this.notes; i += 1) {
|
|
||||||
const idNote = this.notes[i];
|
|
||||||
const idDonor = getDonor(idNote);
|
|
||||||
addDonor(donorsState, idDonor);
|
|
||||||
const stDonor = donorsState[idDonor];
|
|
||||||
const note = this.notes[idNote];
|
|
||||||
if ((note.owner === idDonor) && (note.precommitedProject === 0)) {
|
|
||||||
addDelegateNote(stDonor, idNote);
|
|
||||||
} else if ((note.owner === idDonor) && (note.precommitedProject !== 0)) {
|
|
||||||
addProject(stDonor.precommitedProjects, note.precommitedProject);
|
|
||||||
stDonor.precommitedProjects[note.precommitedProject].notes.push(idNote);
|
|
||||||
} else {
|
|
||||||
addProjectNote(stDonor, idNote);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.donorsState = donorsState;
|
let list = stDonor.commitedProjects;
|
||||||
|
for (let j = 0; j < projectList.length; j += 1) {
|
||||||
|
addProject(list, projectList[j]);
|
||||||
|
list[projectList[j]].notes.push(idNote);
|
||||||
|
list = list[projectList[j]].commitedProjects;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
for (let i = 0; i < this.notes; i += 1) {
|
||||||
|
const idNote = this.notes[i];
|
||||||
|
const idDonor = getDonor(idNote);
|
||||||
|
addDonor(donorsState, idDonor);
|
||||||
|
const stDonor = donorsState[idDonor];
|
||||||
|
const note = this.notes[idNote];
|
||||||
|
if ((note.owner === idDonor) && (note.precommitedProject === 0)) {
|
||||||
|
addDelegateNote(stDonor, idNote);
|
||||||
|
} else if ((note.owner === idDonor) && (note.precommitedProject !== 0)) {
|
||||||
|
addProject(stDonor.precommitedProjects, note.precommitedProject);
|
||||||
|
stDonor.precommitedProjects[note.precommitedProject].notes.push(idNote);
|
||||||
|
} else {
|
||||||
|
addProjectNote(stDonor, idNote);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static new(web3, vault, opts = {}) {
|
this.donorsState = donorsState;
|
||||||
const deploy = new web3.eth.Contract($abi)
|
|
||||||
.deploy({
|
|
||||||
data: $byteCode,
|
|
||||||
arguments: [vault],
|
|
||||||
});
|
|
||||||
|
|
||||||
const getAccount = () => {
|
|
||||||
if (opts.from) return Promise.resolve(opts.from);
|
|
||||||
|
|
||||||
return web3.eth.getAccounts()
|
|
||||||
// eslint-disable-next-line no-confusing-arrow
|
|
||||||
.then(accounts => (accounts.length > 0) ? accounts[0] : undefined);
|
|
||||||
};
|
|
||||||
|
|
||||||
return getAccount()
|
|
||||||
.then(account => Object.assign(opts, { from: account }))
|
|
||||||
.then(() => execute(web3, deploy, opts))
|
|
||||||
.then(contract => new LiquidPledging(web3, contract.options.address));
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
return LiquidPledging;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
const VaultAbi = require("../build/Vault.sol").VaultAbi;
|
const VaultAbi = require('../build/Vault.sol').VaultAbi;
|
||||||
const VaultByteCode = require("../build/Vault.sol").VaultByteCode;
|
const VaultByteCode = require('../build/Vault.sol').VaultByteCode;
|
||||||
const runethtx = require("runethtx");
|
const generateClass = require('./generateClass');
|
||||||
|
|
||||||
module.exports = runethtx.generateClass(VaultAbi, VaultByteCode);
|
module.exports = generateClass(VaultAbi, VaultByteCode);
|
||||||
|
|
Loading…
Reference in New Issue