-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add optimist sbt and refactor trust model * refactor: grab fid : address mappings direct from farcaster * add: whether address is passport user or not * fix: modify non-farcaster verifications * fix: simplify user checks * feat: deployers_v1 * contracts model that includes deployments from factories * add: artifact source field * fix: union statement
- Loading branch information
Showing
4 changed files
with
134 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
apps/hasura/metadata/databases/cloudsql/tables/contracts_v1.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
table: | ||
name: contracts_v1 | ||
schema: public | ||
select_permissions: | ||
- role: anonymous | ||
permission: | ||
columns: "*" | ||
filter: {} | ||
allow_aggregations: false | ||
comment: "" | ||
- role: user | ||
permission: | ||
columns: "*" | ||
filter: {} | ||
allow_aggregations: false | ||
comment: "" | ||
- role: developer | ||
permission: | ||
columns: "*" | ||
filter: {} | ||
allow_aggregations: true | ||
comment: "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 94 additions & 0 deletions
94
warehouse/dbt/models/intermediate/directory/int_contracts.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
with deployers as ( | ||
select | ||
*, | ||
'OPTIMISM' as artifact_source | ||
from {{ ref('stg_optimism__deployers') }} | ||
union all | ||
select | ||
*, | ||
'BASE' as artifact_source | ||
from {{ ref('stg_base__deployers') }} | ||
union all | ||
select | ||
*, | ||
'FRAX' as artifact_source | ||
from {{ ref('stg_frax__deployers') }} | ||
union all | ||
select | ||
*, | ||
'MODE' as artifact_source | ||
from {{ ref('stg_mode__deployers') }} | ||
union all | ||
select | ||
*, | ||
'ZORA' as artifact_source | ||
from {{ ref('stg_zora__deployers') }} | ||
), | ||
|
||
factories as ( | ||
select | ||
*, | ||
'OPTIMISM' as artifact_source | ||
from {{ ref('stg_optimism__factories') }} | ||
union all | ||
select | ||
*, | ||
'BASE' as artifact_source | ||
from {{ ref('stg_base__factories') }} | ||
union all | ||
select | ||
*, | ||
'FRAX' as artifact_source | ||
from {{ ref('stg_frax__factories') }} | ||
union all | ||
select | ||
*, | ||
'MODE' as artifact_source | ||
from {{ ref('stg_mode__factories') }} | ||
union all | ||
select | ||
*, | ||
'ZORA' as artifact_source | ||
from {{ ref('stg_zora__factories') }} | ||
), | ||
|
||
contract_deployments as ( | ||
select | ||
artifact_source, | ||
transaction_hash, | ||
block_timestamp, | ||
deployer_address as root_deployer_address, | ||
deployer_address as created_by_address, | ||
contract_address, | ||
deployer_address as originating_eoa_address, | ||
'EOA' as creator_type, | ||
case | ||
when contract_address in ( | ||
select distinct factory_address | ||
from factories | ||
) then 'FACTORY' | ||
else 'CONTRACT' | ||
end as contract_type | ||
from deployers | ||
), | ||
|
||
factory_deployments as ( | ||
select | ||
factories.artifact_source, | ||
factories.transaction_hash, | ||
factories.block_timestamp, | ||
deployers.deployer_address as root_deployer_address, | ||
factories.factory_address as created_by_address, | ||
factories.contract_address, | ||
'FACTORY' as creator_type, | ||
'CONTRACT' as contract_type, | ||
COALESCE(factories.originating_address, deployers.deployer_address) | ||
as originating_eoa_address | ||
from factories | ||
inner join deployers | ||
on factories.factory_address = deployers.contract_address | ||
) | ||
|
||
select * from contract_deployments | ||
union all | ||
select * from factory_deployments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{{ | ||
config(meta = { | ||
'sync_to_db': True | ||
}) | ||
}} | ||
|
||
select | ||
artifact_source, | ||
transaction_hash, | ||
block_timestamp, | ||
root_deployer_address, | ||
created_by_address, | ||
contract_address, | ||
originating_eoa_address, | ||
creator_type, | ||
contract_type | ||
from {{ ref('int_contracts') }} |