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

Add Db schema #300

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ If you want to change the schema, you'll need to write a migration:
The framework will run migrations in sequence, so you are guaranteed that your data is valid as of the previous version.
Note: we only currently support migrating in one direction (and not reverting)

![Schema](src/resources/.data/schema.png)

## Making onchain attestations about projects

### EAS schemas
Expand Down
76 changes: 76 additions & 0 deletions src/resources/.data/schema.dbml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// All social profile
Table social_profile {
id int [pk, increment]
medium varchar[] [null]
twitter varchar[] [null]
telegram varchar[] [null]
}

// Tags that classify the address. Options include: \n- 'eoa': Externally Owned Account \n- 'safe': Gnosis Safe or other multi-sig wallet \n- 'deployer' (or 'creator'): An address that should be monitored for contract deployment events \n- 'factory': A contract that deploys other contracts \n- 'proxy': Proxy contract \n- 'contract': A smart contract address \n- 'wallet': An address that should be monitored for funding events
enum blockchain_address_tags {
contract
creator
deployer
eoa
factory
proxy
safe
wallet
}

enum blockchain_address_networks {
"any_evm"
"arbitrum-one"
"base"
"frax"
"mainnet"
"matic"
"metal"
"mode"
"optimism"
"pgn"
"zora"
"linea"
"zksync-era"
"polygon-zkevm"
"scroll"
"mantle"
}

// An address on a blockchain
Table blockchain_address {
id int [pk, increment]
address varchar
tags blockchain_address_tags[]
networks blockchain_address_networks[]
name varchar [null]
}

// A collection of projects
Table collection {
id int [pk, increment]
version int
name varchar
display_name varchar
description text [null]
projects int [ref: > project.id]
}

// A project is a collection of artifacts
Table project {
id int [pk, increment]
version int
name varchar
display_name varchar
description text [null]
websites int [ref: > url.id]
github int [ref: > url.id]
npm int [ref: > url.id]
blockchain int [ref: > blockchain_address.id]
social int [ref: > social_profile.id]
}

Table url {
id int [pk, increment]
url varchar
}
Binary file added src/resources/.data/schema.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading