Skip to content

Commit e8bb5e1

Browse files
authored
chore: add token-distribution package to repo (#948)
* chore: add token-distribution package to repo Signed-off-by: Tomás Migone <[email protected]>
1 parent ccfe923 commit e8bb5e1

File tree

142 files changed

+46626
-1383
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+46626
-1383
lines changed

.gitattributes

-1
This file was deleted.

.github/workflows/ci-token-dist.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: CI
2+
3+
env:
4+
CI: true
5+
6+
on:
7+
push:
8+
branches: "*"
9+
paths:
10+
- packages/token-distribution/**
11+
pull_request:
12+
branches: "*"
13+
paths:
14+
- packages/token-distribution/**
15+
workflow_dispatch:
16+
17+
jobs:
18+
test-ci:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
- name: Set up environment
24+
uses: ./.github/actions/setup
25+
- name: Run tests
26+
run: yarn test

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ cached/
2121
# Build artifacts
2222
dist/
2323
build/
24+
deployments/hardhat/
2425

2526
# Ignore solc bin output
2627
bin/
@@ -43,3 +44,9 @@ addresses-fork.json
4344

4445
# Keys
4546
.keystore
47+
48+
# Graph client
49+
.graphclient
50+
51+
tx-builder-*.json
52+
!tx-builder-template.json

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ This repository is a Yarn workspaces monorepo containing the following packages:
3737
| Package | Latest version | Description |
3838
| --- | --- | --- |
3939
| [contracts](./packages/contracts) | [![npm version](https://badge.fury.io/js/@graphprotocol%2Fcontracts.svg)](https://badge.fury.io/js/@graphprotocol%2Fcontracts) | Contracts enabling the open and permissionless decentralized network known as The Graph protocol. |
40+
| [token-distribution](./packages/token-distribution) | - | Contracts managing token locks for network participants |
4041
| [sdk](./packages/sdk) | [![npm version](https://badge.fury.io/js/@graphprotocol%2Fsdk.svg)](https://badge.fury.io/js/@graphprotocol%2Fsdk) | TypeScript based SDK to interact with the protocol contracts |
4142

4243

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"packageManager": "[email protected]",
99
"workspaces": [
1010
"packages/contracts",
11-
"packages/sdk"
11+
"packages/sdk",
12+
"packages/token-distribution"
1213
],
1314
"scripts": {
1415
"postinstall": "husky install",
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
MNEMONIC=
2+
ETHERSCAN_API_KEY=
3+
INFURA_KEY=
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
build/
2+
cache/
3+
dist/
4+
node_modules/
5+
reports/

packages/token-distribution/.eslintrc

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"parserOptions": {
4+
"ecmaVersion": 2020,
5+
"sourceType": "module"
6+
},
7+
"extends": ["plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"],
8+
"rules": {
9+
"prefer-const": "warn",
10+
"no-extra-semi": "off",
11+
"@typescript-eslint/no-extra-semi": "warn",
12+
"@typescript-eslint/no-inferrable-types": "warn",
13+
"@typescript-eslint/no-empty-function": "warn"
14+
}
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
sources:
2+
- name: graph-network
3+
handler:
4+
graphql:
5+
endpoint: https://api.thegraph.com/subgraphs/name/graphprotocol/graph-network-mainnet
6+
retry: 5
7+
8+
- name: token-distribution
9+
handler:
10+
graphql:
11+
endpoint: https://api.thegraph.com/subgraphs/name/graphprotocol/token-distribution
12+
retry: 5
13+
transforms:
14+
- autoPagination:
15+
validateSchema: true
16+
17+
documents:
18+
- ops/queries/account.graphql
19+
- ops/queries/curators.graphql
20+
- ops/queries/network.graphql
21+
- ops/queries/tokenLockWallets.graphql
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
{
2+
"manifestVersion": "3.2",
3+
"admin": {
4+
"address": "0x4e8EC4059854d0634d7Ba04eA41B453cD56Afa5d",
5+
"txHash": "0x47c8a0973f2457fda3f1243238d3b590cb78e6e78f2cd1040d97e94ced6834c4"
6+
},
7+
"proxies": [
8+
{
9+
"address": "0xa725CF32c367778CFF2ba7089Ab4e941BDD88612",
10+
"txHash": "0x7297670fbbf9f1c014aac93fa0219522c079bdd0ad4bb16c75a204ba97b1bc81",
11+
"kind": "transparent"
12+
}
13+
],
14+
"impls": {
15+
"483bf2556291169f0be3d109cdfe83a3493b0312de77748f3926fc7426444bb5": {
16+
"address": "0xF546bF936241571C380272bbf169D66D4184390c",
17+
"txHash": "0xa276937f5f5913524ba900fa100509bfb3428e98e74f9f76345337c408c2614b",
18+
"layout": {
19+
"solcVersion": "0.7.3",
20+
"storage": [
21+
{
22+
"label": "_owner",
23+
"offset": 0,
24+
"slot": "0",
25+
"type": "t_address",
26+
"contract": "Ownable",
27+
"src": "contracts/Ownable.sol:19"
28+
},
29+
{
30+
"label": "__gap",
31+
"offset": 0,
32+
"slot": "1",
33+
"type": "t_array(t_uint256)50_storage",
34+
"contract": "Ownable",
35+
"src": "contracts/Ownable.sol:22"
36+
},
37+
{
38+
"label": "_initialized",
39+
"offset": 0,
40+
"slot": "51",
41+
"type": "t_bool",
42+
"contract": "Initializable",
43+
"src": "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol:25"
44+
},
45+
{
46+
"label": "_initializing",
47+
"offset": 1,
48+
"slot": "51",
49+
"type": "t_bool",
50+
"contract": "Initializable",
51+
"src": "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol:30"
52+
},
53+
{
54+
"label": "l2LockManager",
55+
"offset": 0,
56+
"slot": "52",
57+
"type": "t_mapping(t_address,t_address)",
58+
"contract": "L1GraphTokenLockTransferTool",
59+
"src": "contracts/L1GraphTokenLockTransferTool.sol:50"
60+
},
61+
{
62+
"label": "l2WalletOwner",
63+
"offset": 0,
64+
"slot": "53",
65+
"type": "t_mapping(t_address,t_address)",
66+
"contract": "L1GraphTokenLockTransferTool",
67+
"src": "contracts/L1GraphTokenLockTransferTool.sol:53"
68+
},
69+
{
70+
"label": "l2WalletAddress",
71+
"offset": 0,
72+
"slot": "54",
73+
"type": "t_mapping(t_address,t_address)",
74+
"contract": "L1GraphTokenLockTransferTool",
75+
"src": "contracts/L1GraphTokenLockTransferTool.sol:56"
76+
},
77+
{
78+
"label": "tokenLockETHBalances",
79+
"offset": 0,
80+
"slot": "55",
81+
"type": "t_mapping(t_address,t_uint256)",
82+
"contract": "L1GraphTokenLockTransferTool",
83+
"src": "contracts/L1GraphTokenLockTransferTool.sol:59"
84+
},
85+
{
86+
"label": "l2Beneficiary",
87+
"offset": 0,
88+
"slot": "56",
89+
"type": "t_mapping(t_address,t_address)",
90+
"contract": "L1GraphTokenLockTransferTool",
91+
"src": "contracts/L1GraphTokenLockTransferTool.sol:62"
92+
},
93+
{
94+
"label": "l2WalletAddressSetManually",
95+
"offset": 0,
96+
"slot": "57",
97+
"type": "t_mapping(t_address,t_bool)",
98+
"contract": "L1GraphTokenLockTransferTool",
99+
"src": "contracts/L1GraphTokenLockTransferTool.sol:66"
100+
}
101+
],
102+
"types": {
103+
"t_address": {
104+
"label": "address",
105+
"numberOfBytes": "20"
106+
},
107+
"t_array(t_uint256)50_storage": {
108+
"label": "uint256[50]",
109+
"numberOfBytes": "1600"
110+
},
111+
"t_bool": {
112+
"label": "bool",
113+
"numberOfBytes": "1"
114+
},
115+
"t_mapping(t_address,t_address)": {
116+
"label": "mapping(address => address)",
117+
"numberOfBytes": "32"
118+
},
119+
"t_mapping(t_address,t_bool)": {
120+
"label": "mapping(address => bool)",
121+
"numberOfBytes": "32"
122+
},
123+
"t_mapping(t_address,t_uint256)": {
124+
"label": "mapping(address => uint256)",
125+
"numberOfBytes": "32"
126+
},
127+
"t_uint256": {
128+
"label": "uint256",
129+
"numberOfBytes": "32"
130+
}
131+
}
132+
}
133+
}
134+
}
135+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
{
2+
"manifestVersion": "3.2",
3+
"admin": {
4+
"address": "0x79E321CB828A0D1435050a1ce8d7985C4C3dfFFA",
5+
"txHash": "0x7ed23b9530cd24071011637e782f43e942b2e0206042a67f5efe3affddbbc9c8"
6+
},
7+
"proxies": [
8+
{
9+
"address": "0xCa82c7Ce3388b0B5d307574099aC57d7a00d509F",
10+
"txHash": "0x8535f77828c04d09f10107dea149d9ad72b477a386fd482d109d456e487667e0",
11+
"kind": "transparent"
12+
}
13+
],
14+
"impls": {
15+
"81b972d1a45d53657aeda6174118a103da6ec0b7e74535dd83748f6618297656": {
16+
"address": "0x6a2A9bAd7b9Fa6ecEE8f249a0850f47eE184a275",
17+
"txHash": "0x5c0dea018da76739bc39d324588a3fdd87b35c86a28469eb1442f701af0a7a82",
18+
"layout": {
19+
"solcVersion": "0.7.3",
20+
"storage": [
21+
{
22+
"label": "_owner",
23+
"offset": 0,
24+
"slot": "0",
25+
"type": "t_address",
26+
"contract": "Ownable",
27+
"src": "contracts/Ownable.sol:19"
28+
},
29+
{
30+
"label": "__gap",
31+
"offset": 0,
32+
"slot": "1",
33+
"type": "t_array(t_uint256)50_storage",
34+
"contract": "Ownable",
35+
"src": "contracts/Ownable.sol:22"
36+
},
37+
{
38+
"label": "_initialized",
39+
"offset": 0,
40+
"slot": "51",
41+
"type": "t_bool",
42+
"contract": "Initializable",
43+
"src": "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol:25"
44+
},
45+
{
46+
"label": "_initializing",
47+
"offset": 1,
48+
"slot": "51",
49+
"type": "t_bool",
50+
"contract": "Initializable",
51+
"src": "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol:30"
52+
},
53+
{
54+
"label": "l2LockManager",
55+
"offset": 0,
56+
"slot": "52",
57+
"type": "t_mapping(t_address,t_address)",
58+
"contract": "L1GraphTokenLockTransferTool",
59+
"src": "contracts/L1GraphTokenLockTransferTool.sol:50"
60+
},
61+
{
62+
"label": "l2WalletOwner",
63+
"offset": 0,
64+
"slot": "53",
65+
"type": "t_mapping(t_address,t_address)",
66+
"contract": "L1GraphTokenLockTransferTool",
67+
"src": "contracts/L1GraphTokenLockTransferTool.sol:53"
68+
},
69+
{
70+
"label": "l2WalletAddress",
71+
"offset": 0,
72+
"slot": "54",
73+
"type": "t_mapping(t_address,t_address)",
74+
"contract": "L1GraphTokenLockTransferTool",
75+
"src": "contracts/L1GraphTokenLockTransferTool.sol:56"
76+
},
77+
{
78+
"label": "tokenLockETHBalances",
79+
"offset": 0,
80+
"slot": "55",
81+
"type": "t_mapping(t_address,t_uint256)",
82+
"contract": "L1GraphTokenLockTransferTool",
83+
"src": "contracts/L1GraphTokenLockTransferTool.sol:59"
84+
},
85+
{
86+
"label": "l2Beneficiary",
87+
"offset": 0,
88+
"slot": "56",
89+
"type": "t_mapping(t_address,t_address)",
90+
"contract": "L1GraphTokenLockTransferTool",
91+
"src": "contracts/L1GraphTokenLockTransferTool.sol:62"
92+
},
93+
{
94+
"label": "l2WalletAddressSetManually",
95+
"offset": 0,
96+
"slot": "57",
97+
"type": "t_mapping(t_address,t_bool)",
98+
"contract": "L1GraphTokenLockTransferTool",
99+
"src": "contracts/L1GraphTokenLockTransferTool.sol:66"
100+
}
101+
],
102+
"types": {
103+
"t_address": {
104+
"label": "address",
105+
"numberOfBytes": "20"
106+
},
107+
"t_array(t_uint256)50_storage": {
108+
"label": "uint256[50]",
109+
"numberOfBytes": "1600"
110+
},
111+
"t_bool": {
112+
"label": "bool",
113+
"numberOfBytes": "1"
114+
},
115+
"t_mapping(t_address,t_address)": {
116+
"label": "mapping(address => address)",
117+
"numberOfBytes": "32"
118+
},
119+
"t_mapping(t_address,t_bool)": {
120+
"label": "mapping(address => bool)",
121+
"numberOfBytes": "32"
122+
},
123+
"t_mapping(t_address,t_uint256)": {
124+
"label": "mapping(address => uint256)",
125+
"numberOfBytes": "32"
126+
},
127+
"t_uint256": {
128+
"label": "uint256",
129+
"numberOfBytes": "32"
130+
}
131+
}
132+
}
133+
}
134+
}
135+
}

0 commit comments

Comments
 (0)