-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from bsh98/dev
Support for contracts, tokens
- Loading branch information
Showing
7 changed files
with
48 additions
and
6 deletions.
There are no files selected for viewing
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
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
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,12 @@ | ||
select | ||
address, | ||
bytecode, | ||
-- convert bq array to array literal | ||
-- this allows us to export nested data to a csv and | ||
-- import it to postgres as a text array | ||
concat('{', array_to_string(function_sighashes, ','), '}') as function_sighashes, | ||
is_erc20, | ||
is_erc721, | ||
block_number, | ||
block_timestamp | ||
from `bigquery-public-data.crypto_ethereum.contracts` |
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,5 @@ | ||
alter table contracts add constraint contracts_pk primary key (address, block_number); | ||
|
||
create index contracts_block_number_index on contracts (block_number desc); | ||
create index contracts_is_erc20_index on contracts (is_erc20, block_number desc); | ||
create index contracts_is_erc721_index on contracts (is_erc721, block_number desc); |
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,3 @@ | ||
alter table tokens add constraint tokens_pk primary key (address, block_number); | ||
|
||
create index tokens_block_number_index on tokens (block_number desc); |
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
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