Skip to content

Commit

Permalink
Ensures factory deployers and deployers are separated (#1511)
Browse files Browse the repository at this point in the history
  • Loading branch information
ravenac95 authored May 23, 2024
1 parent 2e2abe2 commit d5948e3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ with {% for network in networks %}
select
factories.block_timestamp as block_timestamp,
factories.transaction_hash as transaction_hash,
deployers.deployer_address as deployer_address,
factories.originating_address as deployer_address,
deployers.deployer_address as factory_deployer_address,
factories.contract_address as contract_address
from {{ ref("stg_%s__factories" % network) }} as factories
inner join {{ ref("stg_%s__deployers" % network) }} as deployers
Expand All @@ -19,6 +20,7 @@ with {% for network in networks %}
block_timestamp,
transaction_hash,
deployer_address,
null as factory_deployer_address,
contract_address
from {{ ref("stg_%s__deployers" % network) }}
){% if not loop.last %},{% endif %}
Expand All @@ -32,6 +34,7 @@ with {% for network in networks %}
transaction_hash,
"{{ network.upper() }}" as network,
deployer_address,
factory_deployer_address,
contract_address
from {{ network }}_factories_and_deployers
{% endfor %}
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ all_deployers as (
"ARBITRUM_ONE" as artifact_source
from {{ ref("stg_arbitrum__deployers") }}
union all
{# Includes all deployers of a contract #}
select
block_timestamp,
transaction_hash,
Expand All @@ -105,6 +106,16 @@ all_deployers as (
UPPER(network) as artifact_namespace,
UPPER(network) as artifact_source
from {{ ref("int_derived_contracts") }}
union all
{# Includes all factory deployers of a contract #}
select
block_timestamp,
transaction_hash,
factory_deployer_address as deployer_address,
contract_address,
UPPER(network) as artifact_namespace,
UPPER(network) as artifact_source
from {{ ref("int_derived_contracts") }}
),

discovered_contracts as (
Expand Down

0 comments on commit d5948e3

Please sign in to comment.