-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathallowList.php
More file actions
55 lines (43 loc) · 1.64 KB
/
allowList.php
File metadata and controls
55 lines (43 loc) · 1.64 KB
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
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
// create a list of all contributors that where amountUSD is between 10 and 25
$contributors = array();
$amounts = array(); // Array to keep track of aggregated amounts
$voteCounts = array(); // Array to keep track of vote counts
$roundInformationGG18 = json_decode(file_get_contents('data/GG18.json'), true);
foreach ($roundInformationGG18 as $roundInfo) {
// check if amountUSD is between 10 and 25
if ($roundInfo['amountUSD'] >= 100) {
if ($roundInfo['votes'] >= 10 && $roundInfo['votes'] <= 999999) {
// add to contributors array
$contributors[] = $roundInfo;
}
}
}
$roundInformationGG19 = json_decode(file_get_contents('data/GG19.json'), true);
foreach ($roundInformationGG19 as $roundInfo) {
// check if amountUSD is between 10 and 25
if ($roundInfo['amountUSD'] >= 100) {
if ($roundInfo['votes'] >= 10 && $roundInfo['votes'] <= 999999) {
// add to contributors array
$contributors[] = $roundInfo;
}
}
}
print_r($contributors);
// make array with unique contributor IDs
$uniqueContributorIDs = array();
foreach ($contributors as $contributor) {
$uniqueContributorIDs[] = $contributor['id'];
}
$uniqueContributorIDs = array_unique($uniqueContributorIDs);
// make a csv file with unique contributor IDs with the following columns:
// address, maxClaimable (1)
// and fill in the unique contributor IDs under address
// and fill in 1 under maxClaimable
$csv = fopen('data/PatronModel3.csv', 'w');
fputcsv($csv, array('address', 'maxClaimable'));
foreach ($uniqueContributorIDs as $uniqueContributorID) {
fputcsv($csv, array($uniqueContributorID, 1));
}