forked from rstormsf/cindicator_tokensale
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwhitelist.js
More file actions
24 lines (20 loc) · 974 Bytes
/
Copy pathwhitelist.js
File metadata and controls
24 lines (20 loc) · 974 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const contract = require('truffle-contract');
const ContributionABI = require('./build/contracts/Contribution.json');
const Contribution = contract(ContributionABI);
const Web3 = require('web3');
var web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8549'));
const ADDRESSES = require('./ARRAY_OF_ADDRESSES.js')();
const CONTRIBUTION_ADDRESS = '0x2215ea9f19f977dda6a7a7003bd04aabd0c2822e';
const UNLOCKED_CONTROLLER_CONTRIBUTION = web3.eth.accounts[0];
Contribution.setProvider(web3.currentProvider);
let instance;
Contribution.at(CONTRIBUTION_ADDRESS).then((i)=> {
instance = i;
return i.whitelistAddresses(ADDRESSES,
0, true, {from: UNLOCKED_CONTROLLER_CONTRIBUTION, gas: 4000000})
}).then((txConfirmation) => {
console.log('GAS USED', txConfirmation.receipt.gasUsed);
return instance.isWhitelisted(ADDRESSES[ADDRESSES.length - 1], 0, {from: UNLOCKED_CONTROLLER_CONTRIBUTION});
}).then((isWhitelisted) => {
console.log(isWhitelisted);
})