Skip to content

Instantly share code, notes, and snippets.

View DistributedDoge's full-sized avatar
🦁
The lion does not concern itself with status messages

DistributedDoge

🦁
The lion does not concern itself with status messages
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@DistributedDoge
DistributedDoge / sankey_draft.ipynb
Created January 30, 2024 21:54
Sankey diagram for all Gitcoin rounds (on Allo v1 protocol)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@DistributedDoge
DistributedDoge / sankey.py
Last active January 30, 2024 04:09
Sankey for Every gitcoin round
import pandas as pd
import plotly.offline as pyo
data = pd.read_parquet('http://grant-data.xyz/rounds.parquet')
data = data[data['amount_usd'] > 100]
dat = data
dat['donations'] = 'Community'
sankey_fig = make_sankey_graph(
df=dat,
@DistributedDoge
DistributedDoge / markdown_fu.py
Last active January 4, 2024 15:09
Markdown file with multiple tables into pandas dataframe
import bs4
import markdown
import pandas
import requests
import lxml
chains = requests.get('https://raw.githubusercontent.com/allo-protocol/allo-contracts/main/docs/CHAINS.md').text
html = markdown.markdown(text=chains, extensions=['tables'])
soup = bs4.BeautifulSoup(html, 'html.parser')
@DistributedDoge
DistributedDoge / get_donation_events.sql
Last active February 26, 2024 03:04
[old] Get and decode all Gitcoin grant round Voted events up-till now.
-- Google Big Query... query(?) to catch all Events emitted by successful donations to old Gitcoin grant round. No matter what contract/round is emitting them.
-- In post-processing might be prudent to check that only official Gitcoin grant rounds are emitting such events.
-- Event ABI corresponds to `Voted` event emitted by QuadraticFundingVotingStrategyImplementation
-- https://etherscan.io/tx/0x02d062a8605c518b07343230b35d9aa23c3781a65e58d45a71ffb607a8b00ced#eventlog
-- NOTE: Won't work for recent Gicoin rounds as ABI has changed.
-- Voted (address token, uint256 amount, index_topic_1 address voter, address grantAddress, index_topic_2 bytes32 projectId, uint256 applicationIndex, index_topic_3 address roundAddress)