We currently extract the listener address from transaction input like this:
const listenerAddr = Bytes.fromUint8Array(
event.transaction.input.subarray(16, 36)
);
This works correctly when the data set is created through:
function createDataSet(
address listenerAddr,
bytes calldata extraData
) public payable returns (uint256)
However, a data set can also be created via:
function addPieces(
uint256 setId,
address listenerAddr,
Cids.Cid[] calldata pieceData,
bytes calldata extraData
) public payable returns (uint256)
In this flow, setId is 0 for new data sets, so the first 32-byte slot in calldata contains the setId. As a result, reading bytes 16..36 returns the zero address instead of the actual listener address.
We should update the listener extraction logic to correctly handle both transaction formats.
We currently extract the listener address from transaction input like this:
This works correctly when the data set is created through:
However, a data set can also be created via:
In this flow,
setIdis0for new data sets, so the first 32-byte slot in calldata contains thesetId. As a result, reading bytes16..36returns the zero address instead of the actual listener address.We should update the listener extraction logic to correctly handle both transaction formats.