You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when a caller is using the batcher contract to create multiple strategies in a single transaction, the create event will indicate the strategy owner/creator as the batcher contract.
we would like to identify these cases and change the owner to be the transaction caller instead.
Notification
in the notification service, we would need to update the owner information we use in the message (deep link in the URL)
Activity
in the activity, we would need to update the owner information on the create event in order to allocate the create action to the correct wallet.
This transaction created 3 strategies using the batcher contract.
The flow of events include StrategyCreated which is followed by a Transfer of the new strategy from the batcher contract to the caller.
My suggestion is that we track the "StrategiesCreated" Event that is emitted from the Batcher and then replace the owner by joining on the txhash.
This would be more consistent with the logic we use in the backend.
It would match the implementation on Dune.
And it requires no knowledge of the Batcher address allowing it to be future-proof for new contract deployments.
The implementation would look similar to this:
WITH batcher_events AS (
SELECT
"transactionHash",
owner as real_owner,
UNNEST("strategyIds") AS id -- Expand the array into individual stratid values
FROM "strategies-created-events" -- New backend table from Batcher
)
SELECT sc."blockNumber", sc.token0, sc.token1, sc.id, -- list relevant strategy-created-event columns here
CASE WHEN real_owner is NULL THEN sc.owner else b.real_owner END as owner,
sc."transactionHash"
FROM "strategy-created-events" sc
LEFT JOIN batcher_events b on b.id = sc.id AND b."transactionHash" = sc."transactionHash"
Goal
when a caller is using the batcher contract to create multiple strategies in a single transaction, the create event will indicate the strategy owner/creator as the batcher contract.
we would like to identify these cases and change the owner to be the transaction caller instead.
Notification
in the notification service, we would need to update the
owner
information we use in the message (deep link in the URL)Activity
in the activity, we would need to update the
owner
information on the create event in order to allocate the create action to the correct wallet.Conditions
The event we track:
This is the condition we would like to apply:
IF StrategyCreated.owner = batcherContract, use transaction caller (not part of the event).
Batcher address
TBA - contract not live yet.
Tenderly example
https://dashboard.tenderly.co/bancor/ivan-test-forks/testnet/1671fd5d-50b5-4f51-ac16-e47cc165e460/tx/mainnet/0xeab5deda923beeb7ee85e7e93abc0d7029440c173cc85554ce0bad37894a7c92/logs
This transaction created 3 strategies using the batcher contract.
The flow of events include
StrategyCreated
which is followed by aTransfer
of the new strategy from the batcher contract to the caller.StrategyCreated event:
as we can see, the
owner
is the batcher contract address.Transfer event:
The recipient of this event is the actual creator of the strategy.
Expected results
Current indication:
StrategyCreated.owner
is the creator.updated indication:
IF
StrategyCreated.owner
= batcher contract, useTransfer.to
address as the creator.The text was updated successfully, but these errors were encountered: