diff --git a/dbt_subprojects/daily_spellbook/models/chain_info/chain_info_chain_ids.sql b/dbt_subprojects/daily_spellbook/models/chain_info/chain_info_chain_ids.sql index 83a864dd8dd..a0df844e8e3 100644 --- a/dbt_subprojects/daily_spellbook/models/chain_info/chain_info_chain_ids.sql +++ b/dbt_subprojects/daily_spellbook/models/chain_info/chain_info_chain_ids.sql @@ -31,12 +31,12 @@ FROM ( values ,('Metadium Mainnet' ,'META' ,'META' ,'11' ,'11' ,'https://metadium.com' ,'') ,('Metadium Testnet' ,'META' ,'KAL' ,'12' ,'12' ,'https://metadium.com' ,'') ,('Diode Testnet Staging' ,'DIODE' ,'sDIODE' ,'13' ,'13' ,'https://diode.io/staging' ,'') -,('Flare Mainnet' ,'FLR' ,'FLR' ,'14' ,'14' ,'https://flare.xyz' ,'https://flare-explorer.flare.network') +,('Flare Mainnet', 'FLR', 'FLR', '14', '14', 'https://flare.network', 'https://flare-explorer.flare.network') ,('Diode Prenet' ,'DIODE' ,'DIODE' ,'15' ,'15' ,'https://diode.io/prenet' ,'') -,('Flare Testnet Coston' ,'FLR' ,'CFLR' ,'16' ,'16' ,'https://flare.xyz' ,'https://coston-explorer.flare.network') +,('Flare Testnet Coston', 'CFLR', 'CFLR', '16', '16', 'https://flare.network', 'https://coston-explorer.flare.network') ,('ThaiChain 2.0 ThaiFi' ,'TCH' ,'TFI' ,'17' ,'17' ,'https://exp.thaifi.com' ,'') ,('ThunderCore Testnet' ,'TST' ,'TST' ,'18' ,'18' ,'https://thundercore.com' ,'https://explorer-testnet.thundercore.com') -,('Songbird Canary-Network' ,'SGB' ,'SGB' ,'19' ,'19' ,'https://flare.xyz' ,'https://songbird-explorer.flare.network') +,('Songbird Canary-Network' ,'SGB' ,'SGB' ,'19' ,'19' ,'https://flare.network' ,'https://songbird-explorer.flare.network') ,('Elastos Smart Chain' ,'ETH' ,'ELA' ,'20' ,'20' ,'https://www.elastos.org/' ,'https://esc.elastos.io') ,('Elastos Smart Chain Testnet' ,'ETH' ,'tELA' ,'21' ,'21' ,'https://www.elastos.org/' ,'https://esc-testnet.elastos.io') ,('ELA-DID-Sidechain Mainnet' ,'ETH' ,'ELA' ,'22' ,'22' ,'https://www.elastos.org/' ,'') diff --git a/dbt_subprojects/daily_spellbook/models/evms/evms_info.sql b/dbt_subprojects/daily_spellbook/models/evms/evms_info.sql index dcb86d95584..d64499f62be 100644 --- a/dbt_subprojects/daily_spellbook/models/evms/evms_info.sql +++ b/dbt_subprojects/daily_spellbook/models/evms/evms_info.sql @@ -11,6 +11,7 @@ , "celo" , "ethereum" , "fantom" + , "flare" , "gnosis" , "kaia" , "linea" @@ -90,5 +91,5 @@ FROM ( , (5000, 'mantle', 'Mantle', 'Layer 2', 'Optimistic Rollup', 'MNT', 0x78c1b0c915c4faa5fffa6cabf0219da63d7f4cb8, 'https://mantlescan.xyz/', timestamp '2023-07-02 18:21', 'Optimistic Virtual Machine', 'Ethereum', 'Ethereum', true) , (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) + , (14, 'flare', 'Flare', 'Layer 1', NULL, 'FLR', NULL, 'https://flare-explorer.flare.network/', timestamp '2022-07-13 15:32', 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) - diff --git a/dbt_subprojects/tokens/models/prices/flare/_schema.yml b/dbt_subprojects/tokens/models/prices/flare/_schema.yml new file mode 100644 index 00000000000..67bac2872f6 --- /dev/null +++ b/dbt_subprojects/tokens/models/prices/flare/_schema.yml @@ -0,0 +1,29 @@ +version: 2 + +models: + - name: prices_flare_tokens + meta: + blockchain: flare + sector: prices + contributors: hosuke + config: + tags: ['prices', 'tokens', 'usd', 'flare'] + description: "Price tokens on Flare 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: [ "flare" ] + - 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" diff --git a/dbt_subprojects/tokens/models/prices/flare/prices_flare_tokens.sql b/dbt_subprojects/tokens/models/prices/flare/prices_flare_tokens.sql new file mode 100644 index 00000000000..40ff58dc861 --- /dev/null +++ b/dbt_subprojects/tokens/models/prices/flare/prices_flare_tokens.sql @@ -0,0 +1,22 @@ +{% set blockchain = 'flare' %} + +{{ config( + schema = 'prices_' + blockchain, + alias = 'tokens', + tags = ['static'] + ) +}} + +SELECT + token_id + , '{{ blockchain }}' as blockchain + , symbol + , contract_address + , decimals +FROM +( + VALUES + ('flare-flare', 'WFLR', 0x1D80c49BbBCd1C0911346656B529DF9E5c2F783d, 18) + -- Note: Currently only WFLR has a reliable price feed. Other tokens will be added + -- when they have established price feeds on major price aggregators. +) as temp (token_id, symbol, contract_address, decimals) diff --git a/dbt_subprojects/tokens/models/prices/prices_native_tokens.sql b/dbt_subprojects/tokens/models/prices/prices_native_tokens.sql index f86c6a37a71..e574b71d6ec 100644 --- a/dbt_subprojects/tokens/models/prices/prices_native_tokens.sql +++ b/dbt_subprojects/tokens/models/prices/prices_native_tokens.sql @@ -34,6 +34,7 @@ FROM ('eos-eos', null, 'EOS', null, null), ('etc-ethereum-classic', null, 'ETC', null, null), ('eth-ethereum', null, 'ETH', null, null), + ('flare-flare', null, 'FLR', null, null), ('ftm-fantom', null, 'FTM', null, null), ('hbar-hedera-hashgraph', null, 'HBAR', null, null), ('icp-internet-computer', null, 'ICP', null, null), diff --git a/dbt_subprojects/tokens/models/prices/prices_tokens.sql b/dbt_subprojects/tokens/models/prices/prices_tokens.sql index 665f2adde64..a0207259bc9 100644 --- a/dbt_subprojects/tokens/models/prices/prices_tokens.sql +++ b/dbt_subprojects/tokens/models/prices/prices_tokens.sql @@ -15,6 +15,7 @@ , "celo" , "ethereum" , "fantom" + , "flare" , "gnosis" , "kaia" , "linea" @@ -45,6 +46,7 @@ ref('prices_native_tokens') ,ref('prices_cardano_tokens') ,ref('prices_ethereum_tokens') ,ref('prices_fantom_tokens') +,ref('prices_flare_tokens') ,ref('prices_gnosis_tokens') ,ref('prices_optimism_tokens') ,ref('prices_polygon_tokens') diff --git a/dbt_subprojects/tokens/models/prices/prices_trusted_tokens.sql b/dbt_subprojects/tokens/models/prices/prices_trusted_tokens.sql index 37ad50a9faa..9d3f563d4cc 100644 --- a/dbt_subprojects/tokens/models/prices/prices_trusted_tokens.sql +++ b/dbt_subprojects/tokens/models/prices/prices_trusted_tokens.sql @@ -61,6 +61,7 @@ WITH trusted_tokens AS ( , ('ethereum', 0x2260fac5e5542a773aa44fbcfedf7c193bc2c599) , ('ethereum', 0xf939e0a03fb07f59a73314e73794be0e57ac1b4e) , ('fantom', 0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83) + , ('flare', 0x1D80c49BbBCd1C0911346656B529DF9E5c2F783d) , ('fantom', 0x04068da6c83afcfa0e13ba15a6696662335d5b75) , ('fantom', 0x74b23882a30290451a17c44f4f05243b6b58c76d) , ('fantom', 0x8d11ec38a3eb5e956b052f67da8bdc9bef8abf3e) diff --git a/dbt_subprojects/tokens/models/tokens/_schema.yml b/dbt_subprojects/tokens/models/tokens/_schema.yml index 5b5784747a1..5dc7217068e 100644 --- a/dbt_subprojects/tokens/models/tokens/_schema.yml +++ b/dbt_subprojects/tokens/models/tokens/_schema.yml @@ -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, flare 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', 'flare'] description: > Crosschain ERC20 tokens data_tests: diff --git a/dbt_subprojects/tokens/models/tokens/flare/tokens_flare_erc20.sql b/dbt_subprojects/tokens/models/tokens/flare/tokens_flare_erc20.sql new file mode 100644 index 00000000000..05149e7d093 --- /dev/null +++ b/dbt_subprojects/tokens/models/tokens/flare/tokens_flare_erc20.sql @@ -0,0 +1,30 @@ +{{ + config( + schema = 'tokens_flare', + alias = 'erc20', + post_hook = '{{ expose_spells(\'["flare"]\', + "sector", + "tokens", + \'["hosuke"]\') }}' + ) +}} + +SELECT DISTINCT + 'flare' as blockchain, + contract_address, + symbol, + decimals, + token_name as name +FROM ( + VALUES + -- Base tokens + (0x1D80c49BbBCd1C0911346656B529DF9E5c2F783d, 'Wrapped Flare', 'WFLR', 18), + -- Other tokens + (0x282b88514A52FcAdCD92b742745398f3574697d4, 'Finu', 'FINU', 18), + (0x64cB9bE6323c7a2cE39773674F380da30663bae4, 'ScottyCash', 'SCOTTY', 18), + (0xDE373AE127A11E756A9D1cc7743816928B239283, 'DAX.BEST', 'DAX', 18), + (0x932E691aA8c8306C4bB0b19F3f00a284371be8Ba, 'Phili Inu', 'PHIL', 18), + (0x22757fb83836e3F9F0F353126cACD3B1Dc82a387, 'FlareFox', 'FLX', 18), + (0xa80C114A90565C03BDCAbC1fcF913cC225d2c5ab, 'F-Asset Token', 'FASSET', 18), + (0xc6B19B06A92B337Cbca5f7334d29d45ec4d5E532, 'Dog on Moon', 'Moon', 18) +) as temp (contract_address, token_name, symbol, decimals) diff --git a/sources/_base_sources/evm/flare_docs_block.md b/sources/_base_sources/evm/flare_docs_block.md new file mode 100644 index 00000000000..38398dd0ea2 --- /dev/null +++ b/sources/_base_sources/evm/flare_docs_block.md @@ -0,0 +1,75 @@ +{% docs flare_transactions_doc %} + +The `flare.transactions` table contains detailed information about transactions on the flare 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 flare. + +{% enddocs %} + +{% docs flare_traces_doc %} + +The `flare.traces` table contains records of execution steps for transactions on the flare 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 flare_logs_doc %} + +The `flare.logs` table contains information about event logs emitted by smart contracts on the flare 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 flare_contracts_doc %} + +The `flare.contracts` table tracks decoded contracts on flare, 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 %} diff --git a/sources/_base_sources/flare/flare_base_sources.yml b/sources/_base_sources/flare/flare_base_sources.yml new file mode 100644 index 00000000000..3ef75b83450 --- /dev/null +++ b/sources/_base_sources/flare/flare_base_sources.yml @@ -0,0 +1,195 @@ +version: 2 + +sources: + # flare Tables + - name: flare + description: "raw tables for the chain" + + tables: + - name: transactions + meta: + docs_slug: /evm/flare/raw/transactions + short_description: The transactions table contains detailed information about transactions on the network. + description: '{{ doc("flare_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/flare/raw/traces + short_description: The traces table contains information about traces on the network. + description: '{{ doc("flare_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/flare/raw/logs + short_description: The `flare.logs` table contains information about event logs emitted by smart contracts on the flare blockchain. + description: '{{ doc("flare_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/flare/raw/contracts + short_description: The `flare.contracts` table tracks decoded contracts on flare, including associated metadata such as namespace, name, address, ABI. + description: '{{ doc("flare_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" + - *block_number + - *block_hash + - *tx_count + - *difficulty + - *gas_limit + - *gas_used + - *miner + - *nonce + - *parent_hash + - *size + - *total_difficulty + - *extra_data + + - name: transactions + loaded_at_field: block_time + description: "Transactions on the Flare Network" + columns: + - *blockchain + - *block_time + - *block_number + - *tx_hash + - *tx_index + - *tx_from + - *tx_to + - *tx_success + - *tx_gas_used + - *tx_gas_limit + - *tx_gas_price + - *tx_nonce + - *tx_value + - *tx_input + - *tx_type + - *max_fee_per_gas + - *max_priority_fee_per_gas + - *priority_fee_per_gas + + - name: traces + loaded_at_field: block_time + description: "Traces of transactions on the Flare Network" + columns: + - *blockchain + - *block_time + - *block_number + - *tx_hash + - *tx_index + - *tx_from + - *tx_to + - *tx_success + - *tx_gas_used + - *tx_gas_limit + - *tx_value + - *tx_input + - *trace_index + - *trace_address + - *trace_type + - *trace_status + - *trace_error + - *trace_output + - *sub_traces + + - name: logs + loaded_at_field: block_time + description: "Logs of transactions on the Flare Network" + columns: + - *blockchain + - *block_time + - *block_number + - *tx_hash + - *tx_index + - *log_index + - *contract_address + - *topic0 + - *topic1 + - *topic2 + - *topic3 + - *data