Skip to content

Commit 9d43ef5

Browse files
committed
[v1.5.0] Merge main, fix merge conflict
1 parent 5b86c06 commit 9d43ef5

File tree

2 files changed

+24
-25
lines changed

2 files changed

+24
-25
lines changed

safe_transaction_service/history/indexers/safe_events_indexer.py

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -591,39 +591,17 @@ def _process_safe_creation_events(
591591
# Find events by type (each Safe should have at most one of each)
592592
setup_event: EventData | None = None
593593
proxy_creation_event: EventData | None = None
594+
proxy_creation_event_l2: EventData | None = None
595+
chain_specific_proxy_creation_event_l2: EventData | None = None
594596
for event in events:
595597
if event["event"] == "SafeSetup":
596598
setup_event = event
597599
elif event["event"] == "ProxyCreation":
598600
proxy_creation_event = event
599-
# Generate InternalTx for ProxyCreation
600-
internal_tx = self._get_internal_tx_from_decoded_element(
601-
proxy_creation_event,
602-
contract_address=proxy_creation_event["args"].get("proxy"),
603-
tx_type=InternalTxType.CREATE.value,
604-
call_type=None,
605-
)
606-
internal_txs.append(internal_tx)
607601
elif event["event"] == "ProxyCreationL2":
608602
proxy_creation_event_l2 = event
609-
internal_tx = self._get_internal_tx_from_decoded_element(
610-
proxy_creation_event_l2,
611-
contract_address=proxy_creation_event_l2["args"].get("proxy"),
612-
tx_type=InternalTxType.CREATE.value,
613-
call_type=None,
614-
)
615-
internal_txs.append(internal_tx)
616603
elif event["event"] == "ChainSpecificProxyCreationL2":
617604
chain_specific_proxy_creation_event_l2 = event
618-
internal_tx = self._get_internal_tx_from_decoded_element(
619-
chain_specific_proxy_creation_event_l2,
620-
contract_address=chain_specific_proxy_creation_event_l2[
621-
"args"
622-
].get("proxy"),
623-
tx_type=InternalTxType.CREATE.value,
624-
call_type=None,
625-
)
626-
internal_txs.append(internal_tx)
627605
else:
628606
logger.error("Unexpected event type: %s", event["event"])
629607

@@ -636,11 +614,32 @@ def _process_safe_creation_events(
636614
call_type=None,
637615
)
638616
internal_txs.append(internal_tx)
617+
if proxy_creation_event_l2:
618+
internal_tx = self._get_internal_tx_from_decoded_element(
619+
proxy_creation_event_l2,
620+
contract_address=proxy_creation_event_l2["args"].get("proxy"),
621+
tx_type=InternalTxType.CREATE.value,
622+
call_type=None,
623+
)
624+
internal_txs.append(internal_tx)
625+
if chain_specific_proxy_creation_event_l2:
626+
internal_tx = self._get_internal_tx_from_decoded_element(
627+
chain_specific_proxy_creation_event_l2,
628+
contract_address=chain_specific_proxy_creation_event_l2["args"].get(
629+
"proxy"
630+
),
631+
tx_type=InternalTxType.CREATE.value,
632+
call_type=None,
633+
)
634+
internal_txs.append(internal_tx)
639635

640636
# Process SafeSetup - initializes the Safe
641637
if setup_event:
642638
if not proxy_creation_event:
643639
# SafeSetup without ProxyCreation means proxy was created in a previous block
640+
# ProxyCreationL2 or ChainSpecificProxyCreationL2 (only available v1.5.0 onwards) are not considered here because tracking ProxyCreation is enough.
641+
# ProxyCreation is also emmited when ProxyCreationL2 or ChainSpecificProxyCreationL2 are emmited.
642+
# See: https://github.com/safe-fndn/safe-smart-account/blob/release/v1.5.0/contracts/proxies/SafeProxyFactory.sol
644643
logger.debug(
645644
"[%s] Proxy was created in previous blocks, deleting the old InternalTx",
646645
safe_address,

safe_transaction_service/history/migrations/0098_guard_changes_v150.py renamed to safe_transaction_service/history/migrations/0099_guard_changes_v150.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
class Migration(migrations.Migration):
88

99
dependencies = [
10-
('history', '0097_internaltxdecoded_safe_address_processed'),
10+
('history', '0098_internaltxdecoded_setup_idx'),
1111
]
1212

1313
operations = [

0 commit comments

Comments
 (0)