refactor contrats with aragonos
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
const Registry = artifacts.require('./Registry.sol');
|
||||
const promptly = require('promptly');
|
||||
|
||||
const ethers = require('ethers');
|
||||
@@ -11,39 +10,35 @@ async function prompt(message, options) {
|
||||
return await promptly.prompt(message, options);
|
||||
}
|
||||
|
||||
module.exports = function(callback) {
|
||||
Registry.deployed().then(async (registry) => {
|
||||
module.exports = async function(callback) {
|
||||
const networkId = parseInt(web3.version.network);
|
||||
const provider = new ethers.providers.Web3Provider(
|
||||
web3.currentProvider, { chainId: networkId }
|
||||
);
|
||||
const kredits = await new Kredits(provider, provider.getSigner()).init();
|
||||
|
||||
const networkId = parseInt(web3.version.network);
|
||||
const provider = new ethers.providers.Web3Provider(
|
||||
web3.currentProvider, { chainId: networkId }
|
||||
);
|
||||
const kredits = await Kredits.setup(provider, provider.getSigner());
|
||||
console.log(`Using contributors at: ${kredits.Contributor.contract.address}`);
|
||||
|
||||
console.log(`Using contributors at: ${kredits.Contributor.contract.address}`);
|
||||
let contributorAttributes = {
|
||||
account: await prompt('Contributor address: ', {}),
|
||||
name: await prompt('Name: '),
|
||||
isCore: await prompt('core? y/n') === 'y',
|
||||
kind: await prompt('Kind (default person): ', {default: 'person'}),
|
||||
url: await prompt('URL: '),
|
||||
github_username: await prompt('GitHub username: '),
|
||||
github_uid: await prompt('GitHub UID: '),
|
||||
wiki_username: await prompt('Wiki username: '),
|
||||
};
|
||||
|
||||
let contributorAttributes = {
|
||||
account: await prompt('Contributor address: ', {}),
|
||||
name: await prompt('Name: '),
|
||||
isCore: await prompt('core? y/n') === 'y',
|
||||
kind: await prompt('Kind (default person): ', {default: 'person'}),
|
||||
url: await prompt('URL: '),
|
||||
github_username: await prompt('GitHub username: '),
|
||||
github_uid: await prompt('GitHub UID: '),
|
||||
wiki_username: await prompt('Wiki username: '),
|
||||
};
|
||||
|
||||
console.log("\nAdding contributor:");
|
||||
console.log(contributorAttributes);
|
||||
|
||||
kredits.Contributor.add(contributorAttributes, { gasLimit: 250000 }).then((result) => {
|
||||
console.log("\n\nResult:");
|
||||
console.log(result);
|
||||
callback();
|
||||
}).catch((error) => {
|
||||
console.log('Failed to create contributor');
|
||||
callback(error);
|
||||
});
|
||||
console.log("\nAdding contributor:");
|
||||
console.log(contributorAttributes);
|
||||
|
||||
kredits.Contributor.add(contributorAttributes, { gasLimit: 250000 }).then((result) => {
|
||||
console.log("\n\nResult:");
|
||||
console.log(result);
|
||||
callback();
|
||||
}).catch((error) => {
|
||||
console.log('Failed to create contributor');
|
||||
callback(error);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user