Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add chains to erc4337 #7089

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
models:
- name: account_abstraction_erc4337_userops
meta:
blockchain: arbitrum,avalanche_c,base,bnb,celo,ethereum,gnosis,optimism,polygon,zora
blockchain: arbitrum,avalanche_c,base,bnb,b3,celo,ethereum,gnosis,optimism,polygon,zora
sector: erc4337
project: erc4337
contributors: 0xbitfly, hosuke, intensodefi
Expand Down Expand Up @@ -69,7 +69,7 @@ models:

- name: account_abstraction_erc4337_account_deployed
meta:
blockchain: arbitrum,avalanche_c,base,bnb,celo,ethereum,gnosis,optimism,polygon,zora
blockchain: arbitrum,avalanche_c,b3,base,bnb,celo,ethereum,gnosis,optimism,polygon,zora
sector: erc4337
project: erc4337
contributors: 0xbitfly, intensodefi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
ref('account_abstraction_erc4337_ethereum_account_deployed')
, ref('account_abstraction_erc4337_polygon_account_deployed')
, ref('account_abstraction_erc4337_arbitrum_account_deployed')
, ref('account_abstraction_erc4337_b3_account_deployed')
, ref('account_abstraction_erc4337_optimism_account_deployed')
, ref('account_abstraction_erc4337_avalanche_c_account_deployed')
, ref('account_abstraction_erc4337_gnosis_account_deployed')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
, ref('account_abstraction_erc4337_polygon_userops')
, ref('account_abstraction_erc4337_arbitrum_userops')
, ref('account_abstraction_erc4337_optimism_userops')
, ref('account_abstraction_erc4337_b3_userops')
, ref('account_abstraction_erc4337_avalanche_c_userops')
, ref('account_abstraction_erc4337_gnosis_userops')
, ref('account_abstraction_erc4337_base_userops')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

{% set chain = 'arbitrum' %}
{% set gas_symbol = 'ETH' %}
{% set wrapped_gas_address = '0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270' %}
{% set wrapped_gas_address = '0x82af49447d8a07e3bd95bd0d56f35241523fbab1' %}
{% set version = 'v0.6' %}
{% set deployed_date = '2023-02-15' %}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
version: 2

models:
- name: account_abstraction_erc4337_b3_v0_6_userops_basics
meta:
blockchain: b3
sector: erc4337
project: erc4337
contributors: 0xbitfly
config:
tags: ["b3", "erc4337", "account", "abstraction", "entrypoint"]
description: "erc4337 v0.6 user operations on b3"
columns:
- &blockchain
name: blockchain
description: "blockchain which EntryPoint was deployed"
- &version
name: version
description: "version of the EntryPoint contract"
- &block_month
name: block_month
description: "UTC event block date of each User Operation"
- &block_time
name: block_time
description: "UTC event block time of each User Operation"
- &entrypoint_contract
name: entrypoint_contract
description: "the contract address of the EntryPoint"
- &tx_hash
name: tx_hash
description: "Unique transaction hash value tied to each transaction on the User Operation"
- &sender
name: sender
description: "the sender(AA wallet address) that submmited the user operation"
- &userop_hash
name: userop_hash
description: "Unique user operation hash"
- &success
name: success
description: "weather the user operation is successfully execuated"
- &paymaster
name: paymaster
description: "the address that pay for the user operation gas fees on behalf of the user"
- &op_fee
name: op_fee
description: "The gas paid by sender or paymaster It depends on the chain gas setting"
- &beneficiary
name: beneficiary
description: "the address where the bundler setting for the user operation pay for thier gas fee"

- name: account_abstraction_erc4337_b3_v0_7_userops_basics
meta:
blockchain: b3
sector: erc4337
project: erc4337
contributors: 0xbitfly
config:
tags: ["b3", "erc4337", "account", "abstraction", "entrypoint"]
description: "erc4337 v0.7 user operations on b3"
columns:
- *blockchain
- *version
- *block_month
- *block_time
- *entrypoint_contract
- *tx_hash
- *sender
- *userop_hash
- *success
- *paymaster
- *op_fee
- *beneficiary

- name: account_abstraction_erc4337_b3_userops
meta:
blockchain: b3
sector: erc4337
project: erc4337
contributors: 0xbitfly
config:
tags: ["b3", "erc4337", "account", "abstraction", "entrypoint"]
description: "erc4337 user operations on b3"
columns:
- *blockchain
- *version
- *block_month
- *block_time
- *entrypoint_contract
- *tx_hash
- *sender
- *userop_hash
- *success
- *paymaster
- *op_fee
- &op_fee_usd
name: op_fee_usd
description: "The user operation gas (in usd) paid by sender or paymaster"
- &bundler
name: bundler
description: "address that bundle UserOps and submit those UserOps to the final on-chain by send a EOA transaction"
- &tx_to
name: tx_to
description: "address where the bundler send the transaction"
- &gas_symbol
name: gas_symbol
description: "the gas symbol paied for the transaction"
- &tx_fee
name: tx_fee
description: "the bundler paied gas value for the transaction"
- &tx_fee_usd
name: tx_fee_usd
description: "the bundler paied gas (in usd) value for the transaction"
- *beneficiary

- name: account_abstraction_erc4337_b3_account_deployed
meta:
blockchain: b3
sector: erc4337
project: erc4337
contributors: 0xbitfly
config:
tags: ["b3", "erc4337", "account", "abstraction", "entrypoint"]
description: "erc4337 account deployed on b3"
columns:
- *blockchain
- *version
- *block_time
- *block_month
- *userop_hash
- *entrypoint_contract
- *tx_hash
- *sender
- *paymaster
- &factory
name: factory
description: "who can create a new AA Wallet. It's smart contract address"
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{{ config(
alias = 'account_deployed',
schema = 'account_abstraction_erc4337_b3',
partition_by = ['block_month'],
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
unique_key = ['userop_hash', 'tx_hash'],
post_hook='{{ expose_spells(\'["b3"]\',
"project",
"erc4337",
\'["0xbitfly"]\') }}'
)}}

{% set erc4337_base_models = [
ref('account_abstraction_erc4337_b3_v0_6_account_deployed'),
ref('account_abstraction_erc4337_b3_v0_7_account_deployed')
] %}

SELECT
blockchain
, version
, block_time
, block_month
, userop_hash
, entrypoint_contract
, tx_hash
, sender
, paymaster
, factory
FROM (
{% for erc4337_model in erc4337_base_models %}
SELECT
blockchain
, version
, block_time
, block_month
, userop_hash
, entrypoint_contract
, tx_hash
, sender
, paymaster
, factory
FROM {{ erc4337_model }}

{% if is_incremental() %}
WHERE {{ incremental_predicate('block_time') }}
{% endif %}

{% if not loop.last %}
UNION ALL
{% endif %}
{% endfor %}
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{{ config(
alias = 'userops',
schema = 'account_abstraction_erc4337_b3',
partition_by = ['block_month'],
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
unique_key = ['userop_hash', 'tx_hash'],
post_hook='{{ expose_spells(\'["b3"]\',
"project",
"erc4337",
\'["0xbitfly"]\') }}'
)}}

{% set chain = 'b3' %}
{% set gas_symbol = 'B3' %}
{% set wrapped_gas_address = '0x4200000000000000000000000000000000000006' %} -- Need to update with actual wrapped gas token address
{% set deployed_date = '2023-02-15' %}

{% set erc4337_models = [
ref('account_abstraction_erc4337_b3_v0_6_userops_basics'),
ref('account_abstraction_erc4337_b3_v0_7_userops_basics')
] %}

{{
erc4337_userops_enrichments(
blockchain = 'b3',
base_models = erc4337_models,
wrapped_gas_address = wrapped_gas_address,
gas_symbol = gas_symbol,
deployed_date = deployed_date,
transactions_model = source('b3', 'transactions'),
prices_model = source('prices','usd')
)
}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{ config(
alias = 'v0_6_account_deployed',
schema = 'account_abstraction_erc4337_b3',
partition_by = ['block_month'],
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
unique_key = ['userop_hash', 'tx_hash']
)}}

{{
erc4337_account_deployed(
blockchain = 'b3',
version = 'v0.6',
account_deployed_evt_model = source('erc4337_b3','EntryPoint_v0_6_evt_AccountDeployed')
)
}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{ config(
alias = 'v0_6_userops_basics',
schema = 'account_abstraction_erc4337_b3',
partition_by = ['block_month'],
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
unique_key = ['userop_hash', 'tx_hash']
)}}

{% set chain = 'b3' %}
{% set gas_symbol = 'B3' %}
{% set wrapped_gas_address = '0x4200000000000000000000000000000000000006' %} -- Need to update with actual wrapped gas token address
{% set version = 'v0.6' %}
{% set deployed_date = '2023-02-15' %}

{{
erc4337_userops_basics(
blockchain = 'b3',
version = 'v0.6',
userops_evt_model = source('erc4337_b3','EntryPoint_v0_6_evt_UserOperationEvent'),
handleops_call_model = source('erc4337_b3', 'EntryPoint_v0_6_call_handleOps')
)
}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{ config(
alias = 'v0_7_account_deployed',
schema = 'account_abstraction_erc4337_b3',
partition_by = ['block_month'],
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
unique_key = ['userop_hash', 'tx_hash']
)}}

{{
erc4337_account_deployed(
blockchain = 'b3',
version = 'v0.7',
account_deployed_evt_model = source('erc4337_b3','EntryPoint_v0_7_evt_AccountDeployed')
)
}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{ config(
alias = 'v0_7_userops_basics',
schema = 'account_abstraction_erc4337_b3',
partition_by = ['block_month'],
materialized = 'incremental',
file_format = 'delta',
incremental_strategy = 'merge',
unique_key = ['userop_hash', 'tx_hash']
)}}

{% set chain = 'b3' %}
{% set gas_symbol = 'B3' %}
{% set wrapped_gas_address = '0x4200000000000000000000000000000000000006' %} -- Need to update with actual wrapped gas token address
{% set version = 'v0.7' %}
{% set deployed_date = '2023-02-15' %}

{{
erc4337_userops_basics(
blockchain = 'b3',
version = 'v0.7',
userops_evt_model = source('erc4337_b3','EntryPoint_v0_7_evt_UserOperationEvent'),
handleops_call_model = source('erc4337_b3', 'EntryPoint_v0_7_call_handleOps')
)
}}
Loading
Loading