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

Init boba chain #7209

Open
wants to merge 5 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
4 changes: 2 additions & 2 deletions dbt_subprojects/daily_spellbook/models/evms/evms_info.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
, "base"
, "blast"
, "bnb"
, "boba"
, "celo"
, "ethereum"
, "fantom"
Expand Down Expand Up @@ -63,7 +64,7 @@ FROM (
, (1101, 'zkevm', 'Polygon zkEVM', 'Layer 2', 'ZK Rollup', 'ETH', 0x4f9a0e7fd2bf6067db6994cf12e4495df938e6e9, 'https://zkevm.polygonscan.com/', timestamp '2023-03-24 05:30', 'Polygon', 'Ethereum', 'Ethereum', true)
, (1088, 'metis_andromeda', 'Metis Andromeda', NULL, NULL, NULL, NULL, 'https://andromeda-explorer.metis.io/', timestamp '2021-11-18 22:19', 'Optimistic Virtual Machine', 'Ethereum', 'Ethereum', false)
, (59144, 'linea', 'Linea', 'Layer 2', 'ZK Rollup', 'ETH', 0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f, 'https://lineascan.build/', timestamp '2023-07-06 13:15', NULL, 'Ethereum Blobs', 'Ethereum', true)
, (288, 'boba', 'Boba Network', 'Layer 2', 'Optimistic Rollup', 'ETH', NULL, 'https://bobascan.com/', timestamp '2021-10-28 05:03', 'Optimistic Virtual Machine', 'Ethereum', 'Ethereum', false)
, (288, 'boba', 'Boba Network', 'Layer 2', 'Optimistic Rollup', 'ETH', 0x4200000000000000000000000000000000000006, 'https://bobascan.com/', timestamp '2021-10-28 05:03', 'OP Stack', 'Ethereum', 'Ethereum', true)
, (7700, 'canto', 'Canto', 'Layer 2', NULL, 'ETH', NULL, 'https://evm.explorer.canto.io/', timestamp '2022-07-26 19:27', NULL, 'Ethereum', 'Ethereum', false)
, (420, 'optimism_goerli', 'Optimism Goerli', 'Testnet', 'Optimistic Rollup', 'GTH', 0x4200000000000000000000000000000000000006, 'https://optimism-goerli.blockscout.com/', timestamp '2022-06-09 16:55', 'OP Stack', 'Goerli', 'Goerli', false)
, (1313161554, 'aurora', 'Aurora', 'Layer 2', NULL, 'ETH', 0xC9BdeEd33CD01541e1eeD10f90519d2C06Fe3feB, 'https://explorer.aurora.dev/', timestamp '2020-07-21 21:50:11', NULL, NULL, NULL, false)
Expand Down Expand Up @@ -91,4 +92,3 @@ FROM (
, (42170, 'nova', 'Arbitrum Nova', 'Layer 2', 'Optimistic Rollup', 'ETH', 0x722e8bdd2ce80a4422e880164f2079488e115365, 'https://nova-explorer.arbitrum.io/', timestamp '2022-06-25 04:01', 'Arbitrum', 'Ethereum', 'Ethereum', true)
, (2020, 'ronin', 'Ronin', 'Layer 1', null, 'RON', 0xe514d9deb7966c8be0ca922de8a064264ea6bcd4, 'https://app.roninchain.com/', timestamp '2021-01-25 10:49', NULL, NULL, NULL, 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/boba/_schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: 2

models:
- name: prices_boba_tokens
meta:
blockchain: boba
sector: prices
contributors: hosuke
config:
tags: ['prices', 'tokens', 'usd', 'boba']
description: "Price tokens on Boba Network 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: [ "boba" ]
- 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"
28 changes: 28 additions & 0 deletions dbt_subprojects/tokens/models/prices/boba/prices_boba_tokens.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{% set blockchain = 'boba' %}

{{ 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
('usdt-tether', 'USDT', 0x5DE1677344D3Cb0D7D465c10b72A8f60699C062d, 6)
, ('usdc-usd-coin', 'USDC', 0x66a2A913e447d6b4BF33EFbec43aAeF87890FBbc, 6)
, ('eth-ethereum', 'WETH', 0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000, 18)
, ('boba-boba-network', 'BOBA', 0xa18bF3994C0Cc6E3b63ac420308E5383f53120D7, 18)
, ('dai-dai', 'DAI', 0xf74195Bb8a5cf652411867c5C2C5b8C2a402be35, 18)
, ('frax-frax', 'FRAX', 0x7562F525106F5d54E891e005867Bf489B5988CD9, 18)
, ('bnb-binance-coin', 'BNB', 0x68ac1623ACf9eB9F88b65B5F229fE3e2c0d5789E, 18)
) as temp (token_id, symbol, contract_address, decimals)
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ FROM
('avax-avalanche', null, 'AVAX', null, null),
('bch-bitcoin-cash', null, 'BCH', null, null),
('bnb-binance-coin', null, 'BNB', null, null),
('boba-boba-network', null, 'BOBA', null, null),
('bsv-bitcoin-sv', null, 'BSV', null, null),
('btc-bitcoin', null, 'BTC', null, null),
('celo-celo', null, 'CELO', null, null),
Expand Down
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 @@ -11,6 +11,7 @@
, "bitcoin"
, "blast"
, "bnb"
, "boba"
, "cardano"
, "celo"
, "ethereum"
Expand Down Expand Up @@ -64,6 +65,7 @@ ref('prices_native_tokens')
,ref('prices_kaia_tokens')
,ref('prices_tron_tokens')
,ref('prices_ronin_tokens')
,ref('prices_boba_tokens')
] %}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ WITH trusted_tokens AS (
, ('bnb', 0x2170ed0880ac9a755fd29b2688956bd959f933f8)
, ('bnb', 0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c)
, ('bnb', 0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3)
, ('boba', 0x5DE1677344D3Cb0D7D465c10b72A8f60699C062d)
, ('boba', 0x66a2A913e447d6b4BF33EFbec43aAeF87890FBbc)
, ('boba', 0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000)
, ('boba', 0xa18bF3994C0Cc6E3b63ac420308E5383f53120D7)
, ('boba', 0xf74195Bb8a5cf652411867c5C2C5b8C2a402be35)
, ('boba', 0x7562F525106F5d54E891e005867Bf489B5988CD9)
, ('boba', 0x68ac1623ACf9eB9F88b65B5F229fE3e2c0d5789E)
, ('celo', 0x765de816845861e75a25fca122bb6898b8b1282a)
, ('celo', 0x471ece3750da237f93b8e339c536989b8978a438)
, ('celo', 0xceba9300f2b948710d2653dd7b07f33a8b32118c)
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
blockchain: arbitrum, avalanche_c, bnb, ethereum, gnosis, mantle, optimism, fantom, polygon, base, blast, sepolia, sei, nova, worldchain, kaia, ronin, boba
sector: tokens
contributors: hildobby, 0xManny, dot2dotseurat, soispoke, mtitus6, wuligy, angus_1, Henrystats, viniabussafi, jeff-dude, rantum, hosuke
config:
tags: ['tokens','erc20', 'arbitrum', 'avalanche_c', 'bnb', 'ethereum', 'gnosis', 'mantle', 'optimism', 'fantom', 'base', 'blast', 'sei', 'nova', 'linea', 'worldchain', 'kaia', 'ronin']
tags: ['tokens','erc20', 'arbitrum', 'avalanche_c', 'bnb', 'ethereum', 'gnosis', 'mantle', 'optimism', 'fantom', 'base', 'blast', 'sei', 'nova', 'linea', 'worldchain', 'kaia', 'ronin', 'boba']
description: >
Crosschain ERC20 tokens
data_tests:
Expand Down
21 changes: 21 additions & 0 deletions dbt_subprojects/tokens/models/tokens/boba/_schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: 2

models:
- name: tokens_boba_erc20
meta:
blockchain: boba
sector: tokens
project: erc20
contributors: hosuke
config:
tags: ['table', 'erc20', 'boba']
description: "ERC20 Token Addresses, Symbols and Decimals on Boba Network"
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"
21 changes: 21 additions & 0 deletions dbt_subprojects/tokens/models/tokens/boba/tokens_boba_erc20.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{
config(
schema = 'tokens_boba'
,alias = 'erc20'
,tags = ['static']
,materialized = 'table'
)
}}

SELECT
contract_address
, symbol
, decimals
FROM (VALUES
(0xa18bf3994c0cc6e3b63ac420308e5383f53120d7, 'BOBA', 18)
, (0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000, 'ETH', 18)
, (0x66a2a913e447d6b4bf33efbec43aaef87890fbbc, 'USDC', 6)
, (0x5de1677344d3cb0d7d465c10b72a8f60699c062d, 'USDT', 6)
, (0xf74195bb8a5cf652411867c5c2c5b8c2a402be35, 'DAI', 18)
, (0xd203de32170130082896b4111edf825a4774c18e, 'WETH', 18)
) as temp (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 @@ -10,6 +10,7 @@
,"base"
,"blast"
,"bnb"
,"boba"
,"celo"
,"ethereum"
,"fantom"
Expand Down Expand Up @@ -71,6 +72,7 @@
,'tokens_tron': {'blockchain': 'tron', 'model': ref('tokens_tron_erc20')}
,'tokens_ronin': {'blockchain': 'ronin', 'model': ref('tokens_ronin_erc20')}
,'tokens_bob': {'blockchain': 'bob', 'model': ref('tokens_bob_erc20')}
,'tokens_boba': {'blockchain': 'boba', 'model': ref('tokens_boba_erc20')}
} %}

with automated_source as (
Expand Down
3 changes: 2 additions & 1 deletion scripts/token_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ def __init__(self):
"zkevm": "eth-ethereum",
"ronin": "ron-ronin-token",
"cardano": "ada-cardano",
"tron": "trx-tron"
"tron": "trx-tron",
"boba": "eth-ethereum"
}
self.tokens_by_id = self.get_tokens()
self.contracts_by_chain = self.get_contracts()
Expand Down
119 changes: 119 additions & 0 deletions sources/_base_sources/evm/boba_base_sources.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
version: 2

sources:
# Boba Tables
- name: boba
description: "raw tables for the chain"

tables:
- name: transactions
meta:
docs_slug: /evm/boba/raw/transactions
short_description: The transactions table contains detailed information about transactions on the network.
description: '{{ doc("boba_transactions_doc") }}'

columns:
- &block_date
name: block_date
description: "The UTC date of the block in which this transaction was included"
- &block_time
name: block_time
description: "The exact UTC timestamp when the block containing this transaction was added to the chain"
- &block_number
name: block_number
description: "The number of the block containing this transaction"
- &block_hash
name: block_hash
description: "The hash of the block containing this transaction"
- name: index
description: "The index position of the transaction within its block"
- name: hash
description: "The transaction hash"
- name: from
description: "The sending address"
- name: to
description: "The receiving address"
- name: value
description: "The value transferred in wei"
- name: gas_limit
description: "The maximum amount of gas units that can be consumed by the transaction"
- name: gas_price
description: "The price per unit of gas in wei"
- name: gas_used
description: "The actual amount of gas used for the transaction"
- name: nonce
description: "The number of transactions sent from this address before this one"
- name: success
description: "Whether the transaction was successful (1) or failed (0)"

- name: traces
meta:
docs_slug: /evm/boba/raw/traces
short_description: The traces table contains information about traces on the network.
description: '{{ doc("boba_traces_doc") }}'

columns:
- *block_number
- *block_time
- name: tx_hash
description: "The hash of the transaction this trace belongs to"
- name: from
description: "Address where the trace call originated from"
- name: to
description: "Address where the trace call was made to"
- name: value
description: "Value transferred in the trace in wei"
- name: gas
description: "Gas provided for the trace call"
- name: input
description: "The data sent along with the trace call"
- name: output
description: "The data returned from the trace call"
- name: type
description: "The type of trace (call, create, suicide, reward)"
- name: error
description: "Error message if the trace failed"

- name: logs
meta:
docs_slug: /evm/boba/raw/logs
short_description: The `boba.logs` table contains information about event logs emitted by smart contracts on the boba blockchain.
description: '{{ doc("boba_logs_doc") }}'

columns:
- *block_number
- *block_time
- name: tx_hash
description: "The hash of the transaction that emitted this log"
- name: contract_address
description: "The address of the contract that emitted this log"
- name: topic0
description: "The first topic (typically the event signature)"
- name: topic1
description: "The second topic (if any)"
- name: topic2
description: "The third topic (if any)"
- name: topic3
description: "The fourth topic (if any)"
- name: data
description: "The data field of the log"
- name: index
description: "The index of the log within its transaction"

- name: contracts
meta:
docs_slug: /evm/boba/raw/contracts
short_description: The `boba.contracts` table tracks decoded contracts on boba, including associated metadata such as namespace, name, address, ABI.
description: '{{ doc("boba_contracts_doc") }}'

columns:
- name: address
description: "The contract address"
- name: bytecode
description: "The contract bytecode"
- name: name
description: "The name of the contract"
- name: namespace
description: "The namespace the contract belongs to"
- name: abi
description: "The contract ABI"
75 changes: 75 additions & 0 deletions sources/_base_sources/evm/boba_docs_block.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{% docs boba_transactions_doc %}

The `boba.transactions` table contains detailed information about transactions on the boba blockchain. It includes:

- Block information: number, timestamp, hash
- Transaction details: hash, from_address, to_address, value
- Gas data: gas_price, gas_limit, gas_used
- Status: success or failure
- Input data for contract interactions
- Nonce
- Transaction type

This table is used for analyzing transaction patterns, gas usage, value transfers, and overall network activity on boba.

{% enddocs %}

{% docs boba_traces_doc %}

The `boba.traces` table contains records of execution steps for transactions on the boba blockchain. Each trace represents an atomic operation that modifies the state of the Ethereum Virtual Machine (EVM). Key components include:

- Transaction hash
- Block number and timestamp
- From and to addresses
- Value transferred
- Input data
- Call type (e.g., CALL, DELEGATECALL, CREATE)
- Gas information
- Error messages (if any)

This table is essential for:
- Analyzing internal transactions
- Debugging smart contract interactions
- Tracking value flows through complex transactions
- Understanding contract creation and deployment

{% enddocs %}

{% docs boba_logs_doc %}

The `boba.logs` table contains information about event logs emitted by smart contracts on the boba blockchain. It includes:

- Block information: number, timestamp
- Transaction hash
- Contract address (emitting the event)
- Topic0 (event signature)
- Additional topics (indexed parameters)
- Data field (non-indexed parameters)
- Log index

This table is crucial for:
- Tracking on-chain events
- Monitoring contract activity
- Analyzing token transfers
- Following protocol-specific events

{% enddocs %}

{% docs boba_contracts_doc %}

The `boba.contracts` table tracks decoded contracts on boba, including:

- Contract address
- Bytecode
- Contract name
- Namespace
- ABI
- Creation details

This table is used for:
- Contract verification
- Smart contract analysis
- Protocol research
- Development and debugging

{% enddocs %}
Loading