ChainSafe / ChainSafe/open-creator-rails

Feature: Support injectable assets via IAssetFactory in AssetRegistry

Open
#109 0 comments 0 reactions 1 assignee Claimed by @rob1997 View on GitHub
Dominant language
Solidity
Stars
2
Forks
1
PR merge metrics
No merged PRs in 30d

Description

**What**

Add support for injectable asset implementations via `IAssetFactory`.

Currently, `AssetRegistry` effectively supports creating only one `IAsset` implementation. We need to abstract creation so the registry can create different `IAsset` implementations through `IAssetFactory.create`.

**Why**

Hard-coding a single asset implementation limits extensibility and makes it difficult to evolve asset behavior without modifying core registry logic. Factory-based injection allows multiple `IAsset` implementations while keeping creation logic standardized.

**How**

- Refactor `AssetRegistry` to delegate asset creation to `IAssetFactory.create`.
- Introduce/extend configuration to select or inject the desired `IAssetFactory` implementation.
- Ensure factory output conforms to `IAsset` and preserves existing registry invariants.
- Support creating multiple `IAsset` implementations through factory abstraction.
- Add access controls/validation around factory changes to prevent unsafe reconfiguration.
- Add/adjust tests to cover default behavior, alternate factory implementations, and failure paths.

**Acceptance Criteria**

- `AssetRegistry` no longer assumes a single concrete `IAsset` implementation.
- Asset creation flows through `IAssetFactory.create`.
- At least one alternate `IAsset` implementation can be created via injected factory.
- Existing behavior remains compatible for current/default asset creation.
- Tests validate factory injection, creation success paths, and expected rejections.

**Estimation**

**Dependencies**

None currently identified.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.