Skip to content

Commit

Permalink
Initiate abstract chain (#7493)
Browse files Browse the repository at this point in the history
* feat: add Abstract blockchain base sources and docs

Add base sources and documentation for Abstract blockchain including: - Core tables (blocks, transactions, traces, logs) - Decoded logs and creation traces - ERC20/721/1155 event tables

Note: Following tables are pending data availability: - traces_decoded - contracts - contracts_submitted

* Update evms_info.sql

* Update abstract_base_sources.yml

* Add abstract files

* Update tokens

* update wrapped address in evmc

---------

Co-authored-by: jeff-dude <[email protected]>
  • Loading branch information
Hosuke and jeff-dude authored Jan 28, 2025
1 parent bdb2073 commit 5250304
Show file tree
Hide file tree
Showing 11 changed files with 846 additions and 3 deletions.
1 change: 1 addition & 0 deletions dbt_subprojects/daily_spellbook/models/evms/evms_info.sql
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,6 @@ FROM (
, (21000000, 'corn', 'Corn', 'Layer 1', NULL, 'BTCN', NULL, 'https://cornscan.io/', timestamp '2024-11-19 10:29:11', NULL, NULL, NULL, true)
, (146, 'sonic', 'Sonic', 'Layer 1', NULL, 'SONIC', NULL, 'https://sonicscan.org/', timestamp '2024-12-01 00:00', NULL, NULL, NULL, true)
, (57073, 'ink', 'Ink', 'Layer 2', 'Optimistic Rollup', 'ETH', 0x4200000000000000000000000000000000000006, 'https://explorer.inkonchain.com/', timestamp '2024-12-06 15:20', 'OP Stack', 'Ethereum Blobs', 'Ethereum', true)
, (2741, 'abstract', 'Abstract', 'Layer 2', 'Optimistic Rollup', 'ETH', 0x3439153EB7AF838Ad19d56E1571FBD09333C2809, 'https://explorer.testnet.abs.xyz/', timestamp '2024-06-17 22:39', 'OP Stack', 'Ethereum Blobs', 'Ethereum', true)
) AS temp_table (chain_id, blockchain, name, chain_type, rollup_type, native_token_symbol, wrapped_native_token_address, explorer_link, first_block_time, codebase, data_availability, settlement, is_on_dune)

29 changes: 29 additions & 0 deletions dbt_subprojects/tokens/models/prices/abstract/_schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: 2

models:
- name: prices_abstract_tokens
meta:
blockchain: abstract
sector: prices
contributors: hosuke
config:
tags: ['prices', 'tokens', 'usd', 'abstract']
description: "Price tokens on Abstract EVM chain"
data_tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- contract_address
columns:
- name: token_id
description: "Id of the token at coinpaprika. This id is required to pull the price feed data. NOTE: Not all tokens are listed at coinpaprika - consider using price data from DEX sources in this case or submit a listing request at coinpaprika."
- name: blockchain
description: "Native blockchain of the token, if any"
data_tests:
- accepted_values:
values: [ "abstract" ]
- name: contract_address
description: "Contract address of the token, if any"
- name: symbol
description: "Token symbol"
- name: decimals
description: "Number of decimals for the token contract"
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{% set blockchain = 'abstract' %}

{{ config(
schema = 'prices_' + blockchain,
alias = 'tokens',
materialized = 'table',
file_format = 'delta',
tags = ['static']
)
}}

SELECT
token_id
, '{{ blockchain }}' as blockchain
, symbol
, contract_address
, decimals
FROM
(
VALUES
('weth-weth', 'WETH', 0x3439153EB7AF838Ad19d56E1571FBD09333C2809, 18)
, ('usdc-usd-coin', 'USDC.e', 0x84a71ccd554cc1b02749b35d22f684cc8ec987e1, 6)
, ('pengu-pudgy-penguins', 'PENGU', 0x9ebe3a824ca958e4b3da772d2065518f009cba62, 18)
, ('eth-ethereum', 'ETH', 0x000000000000000000000000000000000000800a, 18)
) as temp (token_id, symbol, contract_address, decimals)
2 changes: 2 additions & 0 deletions dbt_subprojects/tokens/models/prices/prices_tokens.sql
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
, "zksync"
, "zkevm"
, "zora"
, "abstract"
]\',
"sector",
"prices",
Expand Down Expand Up @@ -76,6 +77,7 @@ ref('prices_native_tokens')
,ref('prices_corn_tokens')
,ref('prices_sonic_tokens')
,ref('prices_ink_tokens')
,ref('prices_abstract_tokens')
] %}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ WITH trusted_tokens AS (
, contract_address
FROM (
VALUES
('arbitrum', 0xff970a61a04b1ca14834a43f5de4533ebddb5cc8)
('abstract', 0x3439153EB7AF838Ad19d56E1571FBD09333C2809)
, ('abstract', 0x84a71ccd554cc1b02749b35d22f684cc8ec987e1)
, ('abstract', 0x000000000000000000000000000000000000800a)
, ('arbitrum', 0xff970a61a04b1ca14834a43f5de4533ebddb5cc8)
, ('arbitrum', 0x82af49447d8a07e3bd95bd0d56f35241523fbab1)
, ('arbitrum', 0xaf88d065e77c8cc2239327c5edb3a432268e5831)
, ('arbitrum', 0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9)
Expand Down
4 changes: 2 additions & 2 deletions dbt_subprojects/tokens/models/tokens/_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ version: 2
models:
- name: tokens_erc20
meta:
blockchain: arbitrum, avalanche_c, bnb, ethereum, gnosis, mantle, optimism, fantom, polygon, base, blast, sepolia, sei, nova, worldchain, kaia, ronin, boba, flare, viction, sonic, ink
blockchain: arbitrum, avalanche_c, bnb, ethereum, gnosis, mantle, optimism, fantom, polygon, base, blast, sepolia, sei, nova, worldchain, kaia, ronin, boba, flare, viction, sonic, ink, abstract
sector: tokens
contributors: hildobby, 0xManny, dot2dotseurat, soispoke, mtitus6, wuligy, angus_1, Henrystats, viniabussafi, jeff-dude, rantum, hosuke, irishlatte19
config:
tags: ['tokens','erc20', 'arbitrum', 'avalanche_c', 'bnb', 'ethereum', 'gnosis', 'mantle', 'optimism', 'fantom', 'base', 'blast', 'sei', 'nova', 'linea', 'worldchain', 'kaia', 'ronin', 'boba', 'flare', 'viction', 'sonic', 'ink']
tags: ['tokens','erc20', 'arbitrum', 'avalanche_c', 'bnb', 'ethereum', 'gnosis', 'mantle', 'optimism', 'fantom', 'base', 'blast', 'sei', 'nova', 'linea', 'worldchain', 'kaia', 'ronin', 'boba', 'flare', 'viction', 'sonic', 'ink', 'abstract']

description: >
Crosschain ERC20 tokens
Expand Down
21 changes: 21 additions & 0 deletions dbt_subprojects/tokens/models/tokens/abstract/_schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: 2

models:
- name: tokens_abstract_erc20
meta:
blockchain: abstract
sector: tokens
project: erc20
contributors: hosuke
config:
tags: ['table', 'erc20', 'abstract']
description: "ERC20 Token Addresses, Symbols and Decimals"
columns:
- name: contract_address
description: "ERC20 token contract address"
data_tests:
- unique
- name: symbol
description: "ERC20 token symbol"
- name: decimals
description: "Number of decimals, refers to how divisible an ERC20 token can be"
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{
config(
schema = 'tokens_abstract'
,alias = 'erc20'
,tags = ['static']
,materialized = 'table'
)
}}

SELECT
contract_address
, symbol
, decimals
FROM (VALUES
(0x3439153EB7AF838Ad19d56E1571FBD09333C2809, 'WETH', 18)
, (0x84a71ccd554cc1b02749b35d22f684cc8ec987e1, 'USDC.e', 6)
, (0x9ebe3a824ca958e4b3da772d2065518f009cba62, 'PENGU', 18)
, (0x000000000000000000000000000000000000800a, 'ETH', 18)
) AS temp_table (contract_address, symbol, decimals)
2 changes: 2 additions & 0 deletions dbt_subprojects/tokens/models/tokens/tokens_erc20.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
,"gnosis"
,"goerli"
,"ink"
,"abstract"
,"kaia"
,"linea"
,"mantle"
Expand Down Expand Up @@ -81,6 +82,7 @@
,'tokens_sonic': {'blockchain': 'sonic', 'model': ref('tokens_sonic_erc20')}
,'tokens_corn': {'blockchain': 'corn', 'model': ref('tokens_corn_erc20')}
,'tokens_ink': {'blockchain': 'ink', 'model': ref('tokens_ink_erc20')}
,'tokens_abstract': {'blockchain': 'abstract', 'model': ref('tokens_abstract_erc20')}
} %}

with automated_source as (
Expand Down
Loading

0 comments on commit 5250304

Please sign in to comment.