-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a89262b
commit c25ae1e
Showing
13 changed files
with
137 additions
and
11 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
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,39 @@ | ||
use common::structs::BlockTimestamp; | ||
use common::utils::bytes_to_hex; | ||
use substreams_ethereum::pb::eth::v2::{Block, CallType}; | ||
|
||
use crate::pb::evm::CreationTrace; | ||
|
||
// https://github.com/streamingfast/firehose-ethereum/blob/1bcb32a8eb3e43347972b6b5c9b1fcc4a08c751e/proto/sf/ethereum/type/v2/type.proto#L744 | ||
// DetailLevel: EXTENDED | ||
pub fn collect_creation_traces(block: &Block, timestamp: &BlockTimestamp) -> Vec<CreationTrace> { | ||
let mut creation_traces: Vec<CreationTrace> = vec![]; | ||
|
||
// Collect code changes from system calls | ||
for trace in block.transaction_traces.iter() { | ||
for call in trace.calls.iter() { | ||
if call.call_type() == CallType::Create { | ||
for code in call.code_changes.iter() { | ||
let factory = if trace.to == code.address { "".to_string() } else { bytes_to_hex(&trace.to) }; | ||
|
||
creation_traces.push(CreationTrace { | ||
// block | ||
block_time: Some(timestamp.time), | ||
block_number: timestamp.number, | ||
block_hash: timestamp.hash.clone(), | ||
block_date: timestamp.date.clone(), | ||
|
||
// creation trace | ||
from: bytes_to_hex(&trace.from), | ||
tx_hash: bytes_to_hex(&trace.hash), | ||
address: bytes_to_hex(&code.address), | ||
factory: factory.to_string(), | ||
code: bytes_to_hex(&code.new_code), | ||
}); | ||
} | ||
} | ||
} | ||
} | ||
|
||
creation_traces | ||
} |
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
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,5 @@ | ||
## Google Big Query | ||
|
||
<https://cloud.google.com/blockchain-analytics/docs/example-ethereum> | ||
|
||
<https://console.cloud.google.com/marketplace/details/ethereum/crypto-ethereum-blockchain?inv=1&invt=Abh5Fw&organizationId=628547290088> |
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