Skip to content

Commit 256c9a0

Browse files
authored
Merge pull request #35 from TrueBlocks/develop
Develop
2 parents 37786e5 + 100a556 commit 256c9a0

File tree

22 files changed

+475
-19
lines changed

22 files changed

+475
-19
lines changed

Ideas.md

Whitespace-only changes.

R/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.RData
2+
.Rhistory

R/Ideas.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Chart ideas
2+
===============
3+
- Histogram of Contrib Amount
4+
- Scatter Contrib vs. Sybil score
5+
- Unclaimed from Round 8
6+
- Scatter plot of sybil score vs. time
7+
- Time vs. amount per sender (a lot of sends in not a person)
8+
- Heat maps are interesting
9+
- Distribution is important
10+
- Mean is appearantly important
11+
- Category (by function) comparison for smart contracts
12+
13+
- latest data https://github.com/gitcoinco/gitcoin_cadcad_model/blob/main/data/2020-03-18/2021-03-18-round9-contributions.csv.xz
14+
15+
- From the Payout Contract there were:
16+
17+
- 1 Finalized calls
18+
- 364 PayoutAdded calls
19+
- 1 Transfer In
20+
- 1 Funded calls
21+
- 167 Transfer Outs
22+
- 167 PayoutClaimed calls
23+
24+
- Function calls per contract
25+
26+
- Calculated estimate after each donation vs. actual
27+
28+
- Auditing
29+
30+
- Add up all donations from grant files and see if it adds to the total in the contract files
31+
32+
- Add the pre-round 4 contracts
33+
34+
- We did reconcilations of the PayoutAdded / PayoutClaimed and compared that against the smart contract. We could have called that a reconcilation and allow the user to download.

R/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## R
2+
3+
This is a collection of 'R' code for analyizing the data found in the [./data folder](../data/README.md).

R/Untitled.Rmd

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
title: "TrueBlocks Exploration of GitCoin Data"
3+
output: html_notebook
4+
---
5+
6+
We used TrueBlocks to extract as much publically available information from
7+
the GitCoin ecosystem as we could in an effort to explore just how open
8+
open shared ledgers are. All data was aquired either from the GitCoin
9+
public APIs or the from on-chain data.
10+
11+
This is a growing document. Please add to it via GitHub Pull Requests
12+
13+
```{r}
14+
require(tidyverse)
15+
l <- c(1,2,3)
16+
plot(l)
17+
```
18+
19+
---
20+
This is some more shit
21+
---
22+

R/Untitled.nb.html

Lines changed: 300 additions & 0 deletions
Large diffs are not rendered by default.

R/explore.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
require(tidyverse)
2+

R/ideas.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Total number of addresses
2+
3+
Total number of uniq addresses
4+
5+
Distribution of the number of times an address appears

gitcoin/exports/mainnet/neighbors/networks/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
### Network Graphs
22

3-
Using the `neighbors` files in the folder above this one, this Python script (thanks in large part to nollied#6773) genates network graphs, images of the same, and adjacency lists.
3+
Using the `neighbors` files in the folder above this one, this Python script (thanks in large part to nollied#6773)
4+
genates network graphs, images of the same, and adjacency lists.
45

56
This data is very much a work in progress.
67

@@ -16,7 +17,7 @@ This data is alpha status and may be (and probably is) incomplete.
1617
```
1718
python -m venv env
1819
source env/bin/activate
19-
pip install -r requirements.txt
20+
pip install -r requirements.fil
2021
python neighbor_networks.py <address>
2122
```
2223

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
colorhash==1.0.4
2+
cycler==0.11.0
3+
fonttools==4.33.3
4+
kiwisolver==1.4.2
5+
matplotlib==3.5.2
6+
networkx==2.8
7+
numpy==1.22.3
8+
packaging==21.3
9+
pandas==1.4.2
10+
Pillow==9.1.0
11+
pyparsing==3.0.8
12+
python-dateutil==2.8.2
13+
pytz==2022.1
14+
scipy==1.8.0
15+
six==1.16.0

gitcoin/ui/src/App.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ header a.install-tb {
7979
white-space: nowrap;
8080
}
8181

82+
.main-rows .column-suspicious {
83+
font-size: xx-large;
84+
}
85+
8286
.with-sidebar {
8387
text-align: left;
8488
}

gitcoin/ui/src/ColumnCells.jsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,16 @@ export const NameCell = ({ grantData }) => {
6363
"/" +
6464
grantData.name.replace(/[^a-z0-9 -]/g, '').replace(/\s+/g, '-').replace(/-+/g, '-');
6565

66-
if (!slug)
66+
if (!slug) {
6767
return (
6868
<div>
6969
{name} <ZipLink grantData={grantData} />
7070
<br />
7171
{explorerLink}
7272
</div>
7373
);
74+
}
75+
7476
return (
7577
<div>
7678
<div>
@@ -124,6 +126,14 @@ export const NeighborsHeader = () => (
124126
/>
125127
)
126128

129+
//--------------------------------------------------
130+
export const SuspiciousHeader = () => (
131+
<ColumnTitle
132+
title='Suspicious'
133+
tooltip='Does this address look suspicious?'
134+
/>
135+
)
136+
127137
//--------------------------------------------------
128138
const dateDisplay = (block) => {
129139
if (block === '0')

gitcoin/ui/src/ColumnDefs.jsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import { DownloadIcon } from './Utils';
2-
import { DateHeader, DateCell, NameHeader, NameCell, BalanceHeader, AppearanceHeader, TransactionHeader, EventLogsHeader, NeighborsHeader } from "./ColumnCells"
2+
import { DateHeader, DateCell, NameHeader, NameCell, BalanceHeader, AppearanceHeader, TransactionHeader, EventLogsHeader, NeighborsHeader, SuspiciousHeader } from "./ColumnCells"
33
import { getChainData } from './GlobalState';
44

5+
// To mocked predicate to tell if an address is suspicious
6+
const mockedIsSuspicious = (index) => (index + 1) % 5 === 0;
7+
58
export const columns = [
69
{
710
title: <DateHeader />,
@@ -27,8 +30,12 @@ export const columns = [
2730
sorter: {
2831
compare: (a, b) => a.address - b.address,
2932
},
30-
render: function (u, grantData) {
31-
return <NameCell grantData={grantData} />
33+
render: function (u, grantData, index) {
34+
const overrideName = mockedIsSuspicious(index)
35+
? "Name has been changed to protect the innocent"
36+
: false;
37+
38+
return <NameCell grantData={grantData} overrideName={overrideName} />
3239
},
3340
},
3441
{

gitcoin/ui/src/last-update.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const lastUpdate = "Last updated at block: 14721137 2022-05-06 03:21:01 UTC";
1+
export const lastUpdate = "Last updated at block: 15008207 2022-06-22 15:08:13 UTC";

giveth/exports/mainnet/neighbors/networks/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
### Network Graphs
22

3-
Using the `neighbors` files in the folder above this one, this Python script (thanks in large part to nollied#6773) genates network graphs, images of the same, and adjacency lists.
3+
Using the `neighbors` files in the folder above this one, this Python script (thanks in large part to nollied#6773)
4+
genates network graphs, images of the same, and adjacency lists.
45

56
This data is very much a work in progress.
67

@@ -16,7 +17,7 @@ This data is alpha status and may be (and probably is) incomplete.
1617
```
1718
python -m venv env
1819
source env/bin/activate
19-
pip install -r requirements.txt
20+
pip install -r requirements.fil
2021
python neighbor_networks.py <address>
2122
```
2223

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
colorhash==1.0.4
2+
cycler==0.11.0
3+
fonttools==4.33.3
4+
kiwisolver==1.4.2
5+
matplotlib==3.5.2
6+
networkx==2.8
7+
numpy==1.22.3
8+
packaging==21.3
9+
pandas==1.4.2
10+
Pillow==9.1.0
11+
pyparsing==3.0.8
12+
python-dateutil==2.8.2
13+
pytz==2022.1
14+
scipy==1.8.0
15+
six==1.16.0

giveth/ui/src/App.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ header a.install-tb {
7979
white-space: nowrap;
8080
}
8181

82+
.main-rows .column-suspicious {
83+
font-size: xx-large;
84+
}
85+
8286
.with-sidebar {
8387
text-align: left;
8488
}

giveth/ui/src/ColumnCells.jsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const NameHeader = () => (
3333
tooltip='The name and address of the grant or core contract.'
3434
/>
3535
)
36-
export const NameCell = ({ grantData }) => {
36+
export const NameCell = ({ grantData, overrideName }) => {
3737
const [copied, setCopied] = useState(false);
3838
const { localExplorer } = useGlobalState();
3939

@@ -63,14 +63,17 @@ export const NameCell = ({ grantData }) => {
6363
"/" +
6464
grantData.name.replace(/[^a-z0-9 -]/g, '').replace(/\s+/g, '-').replace(/-+/g, '-');
6565

66-
if (!slug)
66+
if (!slug || overrideName) {
67+
const nameToShow = overrideName || name;
6768
return (
6869
<div>
69-
{name} <ZipLink grantData={grantData} />
70+
{nameToShow} <ZipLink grantData={grantData} />
7071
<br />
7172
{explorerLink}
7273
</div>
7374
);
75+
}
76+
7477
return (
7578
<div>
7679
<div>
@@ -124,6 +127,14 @@ export const NeighborsHeader = () => (
124127
/>
125128
)
126129

130+
//--------------------------------------------------
131+
export const SuspiciousHeader = () => (
132+
<ColumnTitle
133+
title='Suspicious'
134+
tooltip='Does this address look suspicious?'
135+
/>
136+
)
137+
127138
//--------------------------------------------------
128139
const dateDisplay = (block) => {
129140
if (block === '0')

giveth/ui/src/ColumnDefs.jsx

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import { DownloadIcon } from './Utils';
2-
import { DateHeader, DateCell, NameHeader, NameCell, BalanceHeader, AppearanceHeader, TransactionHeader, EventLogsHeader, NeighborsHeader } from "./ColumnCells"
2+
import { DateHeader, DateCell, NameHeader, NameCell, BalanceHeader, AppearanceHeader, TransactionHeader, EventLogsHeader, NeighborsHeader, SuspiciousHeader } from "./ColumnCells"
33
import { getChainData } from './GlobalState';
44

5+
// To mocked predicate to tell if an address is suspicious
6+
const mockedIsSuspicious = (index) => (index + 1) % 5 === 0;
7+
58
export const columns = [
69
{
710
title: <DateHeader />,
@@ -27,8 +30,12 @@ export const columns = [
2730
sorter: {
2831
compare: (a, b) => a.address - b.address,
2932
},
30-
render: function (u, grantData) {
31-
return <NameCell grantData={grantData} />
33+
render: function (u, grantData, index) {
34+
const overrideName = mockedIsSuspicious(index)
35+
? "Name has been changed to protect the innocent"
36+
: false;
37+
38+
return <NameCell grantData={grantData} overrideName={overrideName} />
3239
},
3340
},
3441
{
@@ -140,4 +147,15 @@ export const columns = [
140147
);
141148
},
142149
},
150+
{
151+
title: <SuspiciousHeader />,
152+
width: '2%',
153+
render(text, record, index) {
154+
const icon = mockedIsSuspicious(index)
155+
? <span>😡</span>
156+
: null;
157+
158+
return <div className='column-suspicious'>{icon}</div>
159+
}
160+
},
143161
];

giveth/ui/src/last-update.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const lastUpdate = "Last updated at block: 14721137 2022-05-06 03:21:01 UTC";
1+
export const lastUpdate = "Last updated at block: 15008207 2022-06-22 15:08:13 UTC";

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ <h2>
5151
</h2>
5252
<ol>
5353
<li>
54-
<a href="/gitcoin">
54+
<a href="https://gitcoin.tokenomics.io">
5555
GitCoin Grants Data Pouch
5656
</a>
5757
</li>
5858
<li>
59-
<a href="/giveth">
59+
<a href="https://giveth.tokenomics.io">
6060
Giveth Data Pouch
6161
</a>
6262
</li>

update-all.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/usr/bin/env bash
22

3-
# ./update-one.sh wallets "gnosis --chain mainnet" txt
3+
PATH=$PATH:/home/jrush/Development/trueblocks-core/bin/
4+
cd /home/jrush/Development/tokenomics.io/
5+
46
./update-one.sh giveth "gnosis --chain mainnet" csv
57
./update-one.sh gitcoin "mainnet" csv
68
chifra when latest --no_header | cut -f1,3 | tr '\t' ' ' | sed 's/^/export const lastUpdate = \"Last updated at block: /' | sed 's/$/\";/' >giveth/ui/src/last-update.js

0 commit comments

Comments
 (0)