Skip to content
This repository was archived by the owner on Oct 6, 2023. It is now read-only.

Commit 4d23238

Browse files
authored
Merge pull request #31 from spicehq/yf/ommitted-output-field-in-trace
handle missing output field in trace
2 parents 51575c2 + 8f2a66c commit 4d23238

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

ethereumetl/jobs/extract_contracts_job.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,14 @@ def process_call(transaction_trace, block_number):
7979
for trace in contract_creation_traces:
8080
contract = EthContract()
8181
contract.address = trace["to"]
82-
bytecode = trace['output']
83-
contract.bytecode = bytecode
8482
contract.block_number = trace['block_number']
8583

86-
function_sighashes = self.contract_service.get_function_sighashes(bytecode)
84+
bytecode = None
85+
if "output" in trace:
86+
bytecode = trace['output']
87+
contract.bytecode = bytecode
8788

89+
function_sighashes = self.contract_service.get_function_sighashes(bytecode)
8890
contract.function_sighashes = function_sighashes
8991
contract.is_erc20 = self.contract_service.is_erc20_contract(function_sighashes)
9092
contract.is_erc721 = self.contract_service.is_erc721_contract(function_sighashes)

0 commit comments

Comments
 (0)