Various small seed/script improvements #138

Merged
raucao merged 4 commits from dev/seeds into master 2019-06-13 16:36:39 +00:00
3 changed files with 20 additions and 17 deletions

1
.eslintignore Normal file
View File

@ -0,0 +1 @@
/scripts/

View File

@ -7,7 +7,7 @@ const contractCalls = [
github_username: 'bumi', github_username: 'bumi',
github_uid: 318, github_uid: 318,
gitea_username: 'bumi', gitea_username: 'bumi',
wiki_username: 'Bumi' wiki_username: 'Bumi',
}, { gasLimit: 200000 }]], }, { gasLimit: 200000 }]],
['Contributor', 'add', [{ ['Contributor', 'add', [{
@ -18,7 +18,7 @@ const contractCalls = [
github_username: 'skddc', github_username: 'skddc',
github_uid: 842, github_uid: 842,
gitea_username: 'raucao', gitea_username: 'raucao',
wiki_username: 'Basti' wiki_username: 'Basti',
}, { gasLimit: 200000 }]], }, { gasLimit: 200000 }]],
['Contributor', 'add', [{ ['Contributor', 'add', [{
@ -28,21 +28,21 @@ const contractCalls = [
url: '', url: '',
github_username: 'fsmanuel', github_username: 'fsmanuel',
github_uid: 54812, github_uid: 54812,
wiki_username: 'Manuel' wiki_username: 'Manuel',
}, { gasLimit: 200000 }]], }, { gasLimit: 200000 }]],
['Proposal', 'addProposal', [{ contributorId: 1, contributorIpfsHash: 'QmWKCYGr2rSf6abUPaTYqf98urvoZxGrb7dbspFZA6oyVF', date: '2019-04-09', amount: 500, kind: 'dev', description: '[67P/kredits-contracts] Ran the seeds', url: '' }, { gasLimit: 350000 }]], ['Proposal', 'add', [{ contributorId: 1, contributorIpfsHash: 'QmWKCYGr2rSf6abUPaTYqf98urvoZxGrb7dbspFZA6oyVF', date: '2019-04-09', amount: 500, kind: 'dev', description: '[67P/kredits-contracts] Ran the seeds', url: '' }, { gasLimit: 350000 }]],
['Proposal', 'addProposal', [{ contributorId: 2, contributorIpfsHash: 'QmcHzEeAM26HV2zHTf5HnZrCtCtGdEccL5kUtDakAB7ozB', date: '2019-04-10', amount: 500, kind: 'dev', description: '[67P/kredits-contracts] Ran the seeds', url: '' }, { gasLimit: 350000 }]], ['Proposal', 'add', [{ contributorId: 2, contributorIpfsHash: 'QmcHzEeAM26HV2zHTf5HnZrCtCtGdEccL5kUtDakAB7ozB', date: '2019-04-10', amount: 500, kind: 'dev', description: '[67P/kredits-contracts] Ran the seeds', url: '' }, { gasLimit: 350000 }]],
['Proposal', 'addProposal', [{ contributorId: 2, contributorIpfsHash: 'QmcHzEeAM26HV2zHTf5HnZrCtCtGdEccL5kUtDakAB7ozB', date: '2019-04-11', amount: 500, kind: 'dev', description: '[67P/kredits-contracts] Hacked on kredits', url: '' }, { gasLimit: 350000 }]], ['Proposal', 'add', [{ contributorId: 2, contributorIpfsHash: 'QmcHzEeAM26HV2zHTf5HnZrCtCtGdEccL5kUtDakAB7ozB', date: '2019-04-11', amount: 500, kind: 'dev', description: '[67P/kredits-contracts] Hacked on kredits', url: '' }, { gasLimit: 350000 }]],
['Proposal', 'vote', [1, { gasLimit: 550000 }]], ['Proposal', 'vote', [1, { gasLimit: 550000 }]],
['Contribution', 'addContribution', [{ contributorId: 1, contributorIpfsHash: 'QmWKCYGr2rSf6abUPaTYqf98urvoZxGrb7dbspFZA6oyVF', date: '2019-04-11', amount: 5000, kind: 'dev', description: '[67P/kredits-contracts] Introduce contribution token', url: '' }, { gasLimit: 350000 }]], ['Contribution', 'add', [{ contributorId: 1, contributorIpfsHash: 'QmWKCYGr2rSf6abUPaTYqf98urvoZxGrb7dbspFZA6oyVF', date: '2019-04-11', amount: 5000, kind: 'dev', description: '[67P/kredits-contracts] Introduce contribution token', url: '' }, { gasLimit: 350000 }]],
['Contribution', 'addContribution', [{ contributorId: 2, contributorIpfsHash: 'QmcHzEeAM26HV2zHTf5HnZrCtCtGdEccL5kUtDakAB7ozB', date: '2019-04-11', amount: 1500, kind: 'dev', description: '[67P/kredits-web] Reviewed stuff', url: '' }, { gasLimit: 350000 }]], ['Contribution', 'add', [{ contributorId: 2, contributorIpfsHash: 'QmcHzEeAM26HV2zHTf5HnZrCtCtGdEccL5kUtDakAB7ozB', date: '2019-04-11', amount: 1500, kind: 'dev', description: '[67P/kredits-web] Reviewed stuff', url: '' }, { gasLimit: 350000 }]],
['Contribution', 'claim', [1, { gasLimit: 300000 }]] ['Contribution', 'claim', [1, { gasLimit: 300000 }]],
]; ];
const funds = [ const funds = [
'0x7e8f313c56f809188313aa274fa67ee58c31515d', '0x7e8f313c56f809188313aa274fa67ee58c31515d',
'0xa502eb4021f3b9ab62f75b57a94e1cfbf81fd827' '0xa502eb4021f3b9ab62f75b57a94e1cfbf81fd827',
]; ];
module.exports = { contractCalls, funds }; module.exports = { contractCalls, funds };

View File

@ -17,13 +17,15 @@ module.exports = async function(callback) {
let fundingAmount = 2; let fundingAmount = 2;
each(seeds.funds, (address, next) => { each(seeds.funds, (address, next) => {
console.log(`funding ${address} with 2 ETH`); console.log(`funding ${address} with 2 ETH`);
web3.eth.sendTransaction({ try {
to: address, web3.eth.sendTransaction({
value: web3.toWei(fundingAmount), to: address,
from: web3.eth.accounts[0] value: web3.toWei(fundingAmount),
}, from: web3.eth.accounts[0]
(result) => { next(); } }, result => next())
) } catch(e) {
console.log('FAILED:', e);
}
}); });
each(seeds.contractCalls, (call, next) => { each(seeds.contractCalls, (call, next) => {