Context
Per the design doc, EventParam wraps a Web3j TypeReference<?> and additionally tracks whether the parameter is indexed, since that's needed to correctly split event data between topics and data when Web3j decodes a log.
public abstract class EventParam {
private EventParam(TypeReference<?> typeReference) {
Objects.requireNonNull(typeReference, "typeReference must not be null");
}
}
Scope
- Implement
EventParam with Objects.requireNonNull validation on the wrapped TypeReference<?> as shown in the doc.
- Static factory methods for the initial supported type set:
EventParam.address(boolean indexed)
EventParam.string(boolean indexed)
EventParam.bool(boolean indexed)
EventParam.bytes(boolean indexed)
EventParam.uint256(boolean indexed)
EventParam.int256(boolean indexed)
- Each factory must construct its
TypeReference<?> with the indexed flag preserved (Web3j's TypeReference supports an indexed constructor argument) — this is called out explicitly in the doc as something that must not be dropped.
- Structure the class so additional Solidity ABI types (e.g. uint8/int8 through uint256/int256 variants, fixed-size bytesN, arrays) can be added later without breaking the public factory-method API.
Acceptance Criteria
Open Questions
- Confirm whether
EventParam should be a sealed/abstract class with concrete per-type subclasses, or a single class with a type-name field the snippet shows public abstract class EventParam(...), implying compact/record-like subclassing; confirm intended structure with mentors before implementing.
Context
Per the design doc, EventParam wraps a Web3j TypeReference<?> and additionally tracks whether the parameter is indexed, since that's needed to correctly split event data between topics and data when Web3j decodes a log.
Scope
EventParamwithObjects.requireNonNullvalidation on the wrappedTypeReference<?>as shown in the doc.EventParam.address(boolean indexed)EventParam.string(boolean indexed)EventParam.bool(boolean indexed)EventParam.bytes(boolean indexed)EventParam.uint256(boolean indexed)EventParam.int256(boolean indexed)TypeReference<?>with the indexed flag preserved (Web3j's TypeReference supports an indexed constructor argument) — this is called out explicitly in the doc as something that must not be dropped.Acceptance Criteria
TypeReferencerejected viaObjects.requireNonNull(as specified).Open Questions
EventParamshould be a sealed/abstract class with concrete per-type subclasses, or a single class with a type-name field the snippet shows public abstract classEventParam(...), implying compact/record-like subclassing; confirm intended structure with mentors before implementing.