Improve helper scripts #41

Merged
bumi merged 7 commits from feature/improve-scripts into master 2018-04-29 07:43:23 +00:00
Showing only changes of commit 85032353ca - Show all commits

View File

@ -1,38 +1,46 @@
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
const Registry = artifacts.require('./Registry.sol');
const Operator = artifacts.require('./Operator.sol');
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
const Contributors = artifacts.require('./Contributors.sol');
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
const promptly = require('promptly');
const bs58 = require('bs58');
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
function getBytes32FromMultiash(multihash) {
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
const decoded = bs58.decode(multihash);
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
return {
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
digest: `0x${decoded.slice(2).toString('hex')}`,
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
hashFunction: decoded[0],
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
size: decoded[1],
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
};
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
}
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
const ethers = require('ethers');
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
const Kredits = require('../lib/kredits');
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
module.exports = function(callback) {
Registry.deployed().then(async (registry) => {
var operatorAddress = await registry.getProxyFor('Operator');
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
var contributorsAddress = await registry.getProxyFor('Contributors');
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
const networkId = parseInt(web3.version.network);
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
const provider = new ethers.providers.Web3Provider(
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
web3.currentProvider, { chainId: networkId }
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
);
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
const kredits = await Kredits.setup(provider, provider.getSigner());
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
var operator = await Operator.at(operatorAddress);
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
var contributors = await Contributors.at(contributorsAddress);
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
console.log(`Using operator at: ${kredits.Operator.contract.address}`);
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
let recipientAddress = await promptly.prompt('Contributor address: ');
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
let ipfsHash = await promptly.prompt('IPFS hash (blank for default): ', { default: 'QmQNA1hhVyL1Vm6HiRxXe9xmc6LUMBDyiNMVgsjThtyevs' });
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
let contributor = await promptly.prompt('Contributor (address or id): ');
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
let contributorId;
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
if (contributor.length < 5) {
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
contributorId = contributor;
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
} else {
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
contributorId = await contributors.getContributorIdByAddress(contributor);
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
}
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
console.log(`Creating a proposal for contributor ID #${contributorId}`);
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
let multihash = getBytes32FromMultiash(ipfsHash);
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
let contributionAttributes = {
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
contributorId,
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
amount: await promptly.prompt('Amount: '),
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
description: await promptly.prompt('Description: '),
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
kind: await promptly.prompt('Kind: ', { default: 'dev' }),
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
url: await promptly.prompt('URL: ', { default: '' })
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
}
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
let contributorId = await contributors.getContributorIdByAddress(recipientAddress);
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
console.log("\nAdding proposal:");
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
console.log(contributionAttributes);
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
let result = await operator.addProposal(contributorId.toNumber(), 23, multihash.digest, multihash.hashFunction, multihash.size);
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
console.log('Proposal added, tx: ', result.tx);
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
callback();
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
kredits.Operator.addProposal(contributionAttributes, { gasLimit: 300000 }).then((result) => {
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
console.log("\n\nResult:");
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
console.log(result);
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
callback();
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
}).catch((error) => {
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
console.log('Failed to create proposal');
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
console.log(error);
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
});
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
});
}

fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?
fsmanuel commented 2018-04-25 21:20:35 +00:00 (Migrated from github.com)
Review

Where does contributors come from?

Where does `contributors` come from?