Skip to content

Commit b8fa8e1

Browse files
authored
CVC-919 Testing accounts provisioning (#9)
CVC-919 Mint tokens & credit test accounts
1 parent af05927 commit b8fa8e1

1 file changed

Lines changed: 16 additions & 7 deletions

File tree

migrations/3_mint_cvc_tokens.js

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,10 @@ module.exports = transform(async (deployer, network, accounts) => {
1111

1212
const token = await getDeployedContract('CvcToken');
1313
const web3 = new Web3(deployer.provider);
14-
1514
// Provision default IDR:
1615
const idr = '0x8935161928e65081bcaef7358e97dce1c560dc9b'; // SIP
17-
// Credit tokens
18-
const cvcAmount = 1000;
19-
await token.transfer(idr, cvcAmount * ONE_CVC, { from: admin, gasPrice });
20-
console.log(`${idr} has been credited with ${cvcAmount} CVC`);
21-
// Credit ETH
22-
const ethAmount = 100;
16+
console.log('Crediting ETH...');
17+
const ethAmount = 10;
2318
await web3.eth.sendTransaction({
2419
from: admin,
2520
to: idr,
@@ -29,6 +24,20 @@ module.exports = transform(async (deployer, network, accounts) => {
2924
});
3025
console.log(`${idr} has been credited with ${ethAmount} ETH`);
3126

27+
// Credit tokens
28+
console.log('Crediting tokens...');
29+
const cvcAmount = 1000;
30+
accounts.push(idr);
31+
accounts.push('0xf91a4ddfa76451d00b703311aae273f2f77cd52c');
32+
accounts.push('0x3a8bc151852c3771b5933419e5c74481679789d0');
33+
accounts.push('0xa27d4886302c55345a82f94436019e209c5c7bd6');
34+
await Promise.all(
35+
accounts.map(
36+
address => token.transfer(address, cvcAmount * ONE_CVC, { from: admin, gasPrice }).then(() => {
37+
console.log(`${address} has been credited with ${cvcAmount} CVC`);
38+
})
39+
)
40+
);
3241
});
3342

3443
function transform(callback) {

0 commit comments

Comments
 (0)