Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add token-distribution package to repo #948

Merged
merged 2 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/ci-token-dist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI

env:
CI: true

on:
push:
branches: "*"
paths:
- packages/token-distribution/**
pull_request:
branches: "*"
paths:
- packages/token-distribution/**
workflow_dispatch:

jobs:
test-ci:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up environment
uses: ./.github/actions/setup
- name: Run tests
run: yarn test
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ cached/
# Build artifacts
dist/
build/
deployments/hardhat/

# Ignore solc bin output
bin/
Expand All @@ -43,3 +44,9 @@ addresses-fork.json

# Keys
.keystore

# Graph client
.graphclient

tx-builder-*.json
!tx-builder-template.json
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"packageManager": "[email protected]",
"workspaces": [
"packages/contracts",
"packages/sdk"
"packages/sdk",
"packages/token-distribution"
],
"scripts": {
"postinstall": "husky install",
Expand Down
3 changes: 3 additions & 0 deletions packages/token-distribution/.env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MNEMONIC=
ETHERSCAN_API_KEY=
INFURA_KEY=
5 changes: 5 additions & 0 deletions packages/token-distribution/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
build/
cache/
dist/
node_modules/
reports/
15 changes: 15 additions & 0 deletions packages/token-distribution/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
},
"extends": ["plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"],
"rules": {
"prefer-const": "warn",
"no-extra-semi": "off",
"@typescript-eslint/no-extra-semi": "warn",
"@typescript-eslint/no-inferrable-types": "warn",
"@typescript-eslint/no-empty-function": "warn"
}
}
21 changes: 21 additions & 0 deletions packages/token-distribution/.graphclientrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
sources:
- name: graph-network
handler:
graphql:
endpoint: https://api.thegraph.com/subgraphs/name/graphprotocol/graph-network-mainnet
retry: 5

- name: token-distribution
handler:
graphql:
endpoint: https://api.thegraph.com/subgraphs/name/graphprotocol/token-distribution
retry: 5
transforms:
- autoPagination:
validateSchema: true

documents:
- ops/queries/account.graphql
- ops/queries/curators.graphql
- ops/queries/network.graphql
- ops/queries/tokenLockWallets.graphql
135 changes: 135 additions & 0 deletions packages/token-distribution/.openzeppelin/goerli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
{
"manifestVersion": "3.2",
"admin": {
"address": "0x4e8EC4059854d0634d7Ba04eA41B453cD56Afa5d",
"txHash": "0x47c8a0973f2457fda3f1243238d3b590cb78e6e78f2cd1040d97e94ced6834c4"
},
"proxies": [
{
"address": "0xa725CF32c367778CFF2ba7089Ab4e941BDD88612",
"txHash": "0x7297670fbbf9f1c014aac93fa0219522c079bdd0ad4bb16c75a204ba97b1bc81",
"kind": "transparent"
}
],
"impls": {
"483bf2556291169f0be3d109cdfe83a3493b0312de77748f3926fc7426444bb5": {
"address": "0xF546bF936241571C380272bbf169D66D4184390c",
"txHash": "0xa276937f5f5913524ba900fa100509bfb3428e98e74f9f76345337c408c2614b",
"layout": {
"solcVersion": "0.7.3",
"storage": [
{
"label": "_owner",
"offset": 0,
"slot": "0",
"type": "t_address",
"contract": "Ownable",
"src": "contracts/Ownable.sol:19"
},
{
"label": "__gap",
"offset": 0,
"slot": "1",
"type": "t_array(t_uint256)50_storage",
"contract": "Ownable",
"src": "contracts/Ownable.sol:22"
},
{
"label": "_initialized",
"offset": 0,
"slot": "51",
"type": "t_bool",
"contract": "Initializable",
"src": "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol:25"
},
{
"label": "_initializing",
"offset": 1,
"slot": "51",
"type": "t_bool",
"contract": "Initializable",
"src": "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol:30"
},
{
"label": "l2LockManager",
"offset": 0,
"slot": "52",
"type": "t_mapping(t_address,t_address)",
"contract": "L1GraphTokenLockTransferTool",
"src": "contracts/L1GraphTokenLockTransferTool.sol:50"
},
{
"label": "l2WalletOwner",
"offset": 0,
"slot": "53",
"type": "t_mapping(t_address,t_address)",
"contract": "L1GraphTokenLockTransferTool",
"src": "contracts/L1GraphTokenLockTransferTool.sol:53"
},
{
"label": "l2WalletAddress",
"offset": 0,
"slot": "54",
"type": "t_mapping(t_address,t_address)",
"contract": "L1GraphTokenLockTransferTool",
"src": "contracts/L1GraphTokenLockTransferTool.sol:56"
},
{
"label": "tokenLockETHBalances",
"offset": 0,
"slot": "55",
"type": "t_mapping(t_address,t_uint256)",
"contract": "L1GraphTokenLockTransferTool",
"src": "contracts/L1GraphTokenLockTransferTool.sol:59"
},
{
"label": "l2Beneficiary",
"offset": 0,
"slot": "56",
"type": "t_mapping(t_address,t_address)",
"contract": "L1GraphTokenLockTransferTool",
"src": "contracts/L1GraphTokenLockTransferTool.sol:62"
},
{
"label": "l2WalletAddressSetManually",
"offset": 0,
"slot": "57",
"type": "t_mapping(t_address,t_bool)",
"contract": "L1GraphTokenLockTransferTool",
"src": "contracts/L1GraphTokenLockTransferTool.sol:66"
}
],
"types": {
"t_address": {
"label": "address",
"numberOfBytes": "20"
},
"t_array(t_uint256)50_storage": {
"label": "uint256[50]",
"numberOfBytes": "1600"
},
"t_bool": {
"label": "bool",
"numberOfBytes": "1"
},
"t_mapping(t_address,t_address)": {
"label": "mapping(address => address)",
"numberOfBytes": "32"
},
"t_mapping(t_address,t_bool)": {
"label": "mapping(address => bool)",
"numberOfBytes": "32"
},
"t_mapping(t_address,t_uint256)": {
"label": "mapping(address => uint256)",
"numberOfBytes": "32"
},
"t_uint256": {
"label": "uint256",
"numberOfBytes": "32"
}
}
}
}
}
}
135 changes: 135 additions & 0 deletions packages/token-distribution/.openzeppelin/mainnet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
{
"manifestVersion": "3.2",
"admin": {
"address": "0x79E321CB828A0D1435050a1ce8d7985C4C3dfFFA",
"txHash": "0x7ed23b9530cd24071011637e782f43e942b2e0206042a67f5efe3affddbbc9c8"
},
"proxies": [
{
"address": "0xCa82c7Ce3388b0B5d307574099aC57d7a00d509F",
"txHash": "0x8535f77828c04d09f10107dea149d9ad72b477a386fd482d109d456e487667e0",
"kind": "transparent"
}
],
"impls": {
"81b972d1a45d53657aeda6174118a103da6ec0b7e74535dd83748f6618297656": {
"address": "0x6a2A9bAd7b9Fa6ecEE8f249a0850f47eE184a275",
"txHash": "0x5c0dea018da76739bc39d324588a3fdd87b35c86a28469eb1442f701af0a7a82",
"layout": {
"solcVersion": "0.7.3",
"storage": [
{
"label": "_owner",
"offset": 0,
"slot": "0",
"type": "t_address",
"contract": "Ownable",
"src": "contracts/Ownable.sol:19"
},
{
"label": "__gap",
"offset": 0,
"slot": "1",
"type": "t_array(t_uint256)50_storage",
"contract": "Ownable",
"src": "contracts/Ownable.sol:22"
},
{
"label": "_initialized",
"offset": 0,
"slot": "51",
"type": "t_bool",
"contract": "Initializable",
"src": "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol:25"
},
{
"label": "_initializing",
"offset": 1,
"slot": "51",
"type": "t_bool",
"contract": "Initializable",
"src": "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol:30"
},
{
"label": "l2LockManager",
"offset": 0,
"slot": "52",
"type": "t_mapping(t_address,t_address)",
"contract": "L1GraphTokenLockTransferTool",
"src": "contracts/L1GraphTokenLockTransferTool.sol:50"
},
{
"label": "l2WalletOwner",
"offset": 0,
"slot": "53",
"type": "t_mapping(t_address,t_address)",
"contract": "L1GraphTokenLockTransferTool",
"src": "contracts/L1GraphTokenLockTransferTool.sol:53"
},
{
"label": "l2WalletAddress",
"offset": 0,
"slot": "54",
"type": "t_mapping(t_address,t_address)",
"contract": "L1GraphTokenLockTransferTool",
"src": "contracts/L1GraphTokenLockTransferTool.sol:56"
},
{
"label": "tokenLockETHBalances",
"offset": 0,
"slot": "55",
"type": "t_mapping(t_address,t_uint256)",
"contract": "L1GraphTokenLockTransferTool",
"src": "contracts/L1GraphTokenLockTransferTool.sol:59"
},
{
"label": "l2Beneficiary",
"offset": 0,
"slot": "56",
"type": "t_mapping(t_address,t_address)",
"contract": "L1GraphTokenLockTransferTool",
"src": "contracts/L1GraphTokenLockTransferTool.sol:62"
},
{
"label": "l2WalletAddressSetManually",
"offset": 0,
"slot": "57",
"type": "t_mapping(t_address,t_bool)",
"contract": "L1GraphTokenLockTransferTool",
"src": "contracts/L1GraphTokenLockTransferTool.sol:66"
}
],
"types": {
"t_address": {
"label": "address",
"numberOfBytes": "20"
},
"t_array(t_uint256)50_storage": {
"label": "uint256[50]",
"numberOfBytes": "1600"
},
"t_bool": {
"label": "bool",
"numberOfBytes": "1"
},
"t_mapping(t_address,t_address)": {
"label": "mapping(address => address)",
"numberOfBytes": "32"
},
"t_mapping(t_address,t_bool)": {
"label": "mapping(address => bool)",
"numberOfBytes": "32"
},
"t_mapping(t_address,t_uint256)": {
"label": "mapping(address => uint256)",
"numberOfBytes": "32"
},
"t_uint256": {
"label": "uint256",
"numberOfBytes": "32"
}
}
}
}
}
}
Loading