From b8fa8e1d36e02f0a77f7c5ed331ddbd6e98e4374 Mon Sep 17 00:00:00 2001 From: Vsevolods Mihailovs Date: Wed, 19 Dec 2018 22:19:23 +0200 Subject: [PATCH] CVC-919 Testing accounts provisioning (#9) CVC-919 Mint tokens & credit test accounts --- migrations/3_mint_cvc_tokens.js | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/migrations/3_mint_cvc_tokens.js b/migrations/3_mint_cvc_tokens.js index 2a4d1e2..6ba4f61 100644 --- a/migrations/3_mint_cvc_tokens.js +++ b/migrations/3_mint_cvc_tokens.js @@ -11,15 +11,10 @@ module.exports = transform(async (deployer, network, accounts) => { const token = await getDeployedContract('CvcToken'); const web3 = new Web3(deployer.provider); - // Provision default IDR: const idr = '0x8935161928e65081bcaef7358e97dce1c560dc9b'; // SIP - // Credit tokens - const cvcAmount = 1000; - await token.transfer(idr, cvcAmount * ONE_CVC, { from: admin, gasPrice }); - console.log(`${idr} has been credited with ${cvcAmount} CVC`); - // Credit ETH - const ethAmount = 100; + console.log('Crediting ETH...'); + const ethAmount = 10; await web3.eth.sendTransaction({ from: admin, to: idr, @@ -29,6 +24,20 @@ module.exports = transform(async (deployer, network, accounts) => { }); console.log(`${idr} has been credited with ${ethAmount} ETH`); + // Credit tokens + console.log('Crediting tokens...'); + const cvcAmount = 1000; + accounts.push(idr); + accounts.push('0xf91a4ddfa76451d00b703311aae273f2f77cd52c'); + accounts.push('0x3a8bc151852c3771b5933419e5c74481679789d0'); + accounts.push('0xa27d4886302c55345a82f94436019e209c5c7bd6'); + await Promise.all( + accounts.map( + address => token.transfer(address, cvcAmount * ONE_CVC, { from: admin, gasPrice }).then(() => { + console.log(`${address} has been credited with ${cvcAmount} CVC`); + }) + ) + ); }); function transform(callback) {