Skip to content

Commit

Permalink
CVC-919 Testing accounts provisioning (#9)
Browse files Browse the repository at this point in the history
CVC-919 Mint tokens & credit test accounts
  • Loading branch information
cheelahim authored Dec 19, 2018
1 parent af05927 commit b8fa8e1
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions migrations/3_mint_cvc_tokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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) {
Expand Down

0 comments on commit b8fa8e1

Please sign in to comment.