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
Currently, the factory address tracks child addresses in the interval between start and endBlock of the contract/account config.
However, in some niche use cases there might be a need to track factory address only for a small subinterval of the contract indexing timeline. The other use case might be when the factory needs to track child addresses before the contract indexing timeline. Ex: collect uniswap pools via factory but only interested in contract activity from a week ago.
In the current implementation, you would either need to run contract indexing for an unnecessarily big interval or collect more child addresses than needed.
I would propose a solution building on current factory implementation with optional startBlock and endBlock fields:
typeFactory<eventextendsAbiEvent=AbiEvent>={/** Address of the factory contract that creates this contract. */address: `0x${string}` |readonly `0x${string}`[];/** ABI event that announces the creation of a new instance of this contract. */event: event;/** Name of the factory event parameter that contains the new child contract address. */parameter: Exclude<event["inputs"][number]["name"],undefined>;/** Optional factory interval */startBlock?: number;endBlock?: number;};
Due to the nature of the factory addresses, the following validations would make sense:
factory startBlock <= contract/account startBlock:
- either error out during validation or default contract startBlock to factory startBlock
factory endBlock <= contarct/account endBlock:
- either error out during validation of default factory endBlock to contract endBlock
The text was updated successfully, but these errors were encountered:
Problem / use case
Currently, the factory address tracks child addresses in the interval between start and endBlock of the contract/account config.
However, in some niche use cases there might be a need to track factory address only for a small subinterval of the contract indexing timeline. The other use case might be when the factory needs to track child addresses before the contract indexing timeline. Ex: collect uniswap pools via factory but only interested in contract activity from a week ago.
In the current implementation, you would either need to run contract indexing for an unnecessarily big interval or collect more child addresses than needed.
@kyscott18 @typedarray let me know what you think.
Proposed solution
I would propose a solution building on current factory implementation with optional startBlock and endBlock fields:
Due to the nature of the factory addresses, the following validations would make sense:
factory startBlock <= contract/account startBlock:
- either error out during validation or default contract startBlock to factory startBlock
factory endBlock <= contarct/account endBlock:
- either error out during validation of default factory endBlock to contract endBlock
The text was updated successfully, but these errors were encountered: