safe-client-gateway icon indicating copy to clipboard operation
safe-client-gateway copied to clipboard

Investigate refactoring use of `DataDecodedParamHelper`

Open iamacook opened this issue 9 months ago • 0 comments

Description

When mapping ERC-20/721 transfers, we extract the values of the sender, recipient, etc. from the decodedData of a given transaction.

Each transaction that transfers tokens also has a transfers array that seemingly contains all the information of the above and using that would simply a lot of the above.

Requirements

As the mapping is only of ERC-20/721 token, the transaction types are that of MultisigTransaction | ModuleTransaction:

  1. Investigate if both transaction types always return transfers array.
  2. If so, add transfers array to validation schemas.
  3. Replace DataDecodedParamHelper['getFromParam' | 'getToParam' | 'getValueParam'] with transfers value(s).
  4. Update associated tests.

Additional information

This transfers array does not exist in the MultisigTransaction | ModuleTransaction types despite being returned by the Transaction Service. (As the above was implemented early in the project, it may not have existed then.)

iamacook avatar May 15 '24 11:05 iamacook