-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUNITYSetup.js
64 lines (57 loc) · 2.58 KB
/
UNITYSetup.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
require('dotenv').config()
const WL = require("./ContractData/WL/WL.json")
const URIS = require("./ContractData/URIs/URIs.json")
var contract = artifacts.require("UNITY");
//////////////// PROD VARIABLES ///////////////////
var contract_address = process.env.PROD_CONTRACT_ADDRESS;
// const royalties_recipient_address = process.env.ROYALTIES_RECIPIENT_ADDRESS;
const WLaddresses = WL.addresses;
///////////////////////////////////////////////////
//////////////// DEV VARIABLES ///////////////////
// var contract_address = process.env.DEV_CONTRACT_ADDRESS;
// const WLaddresses = WL.test;
// const royalties_recipient_address = "0xba45e32c3D74d8db4981271542892a425CFC4a69";
///////////////////////////////////////////////////
module.exports = async function() {
const UNITY = await contract.at(contract_address);
// console.log(contract_address)
// const uri = URIS.link
// const royaltiesAmount = 10; //In %
// // Setting up the URI
// console.log('Setting up the URI')
// try{
// console.log(uri)
// let res = await UNITY.setURI(uri);
// console.log('Successfully set the URI')
// console.log(res)
// console.log('/////////////////////////')
// }catch(err){console.log(err)}
// Load the WL
// console.log('Loading the WL')
// try{
// console.log(WLaddresses)
// let res = await UNITY.loadWL(WLaddresses);
// console.log('Successfully loaded the WL')
// console.log(res)
// console.log('/////////////////////////')
// }catch(err){console.log(err)}
try{
console.log('fetching addresses mint')
console.log(WLaddresses)
for(i=0;i<WLaddresses.length;i++){
let addressBal = await UNITY.balanceOf(WLaddresses[i],1)
let addressTokens = addressBal.toNumber()
console.log(`${WLaddresses[i]} ${addressTokens}`)
}
}catch(err){ console.log(err)}
// Set royalties info
// console.log('Setting royalties info')
// try{
// let res = await UNITY.setRoyalties(royalties_recipient_address, royaltiesAmount);
// console.log('Successfully set Royalties info')
// console.log(res)
// console.log('/////////////////////////')
// }catch(err){console.log(err)}
// }
console.log('program done executing - please terminate')
}