A frequent pattern of smart contracts is having calldata of another function passed via a parameter. This presents an issue for us as we want to provide a nice view for users not random byte code.
To enable this we'll add a new type in rich contracts for calldata as a parameter. Since the calldata represents a function call we can simply nest a reference to that function inside of the rich contract.
In the ui for this field we'll then just show the fields from the nested call alongside the main functions params.
We can then try to reuse existing logic inside action builder to encode as its doing the same job just one layer down.
A frequent pattern of smart contracts is having calldata of another function passed via a parameter. This presents an issue for us as we want to provide a nice view for users not random byte code.
Example: https://github.com/ImpeccableHQ/stackly/blob/development/packages/contracts/src/OrderFactory.sol#L25
To enable this we'll add a new type in rich contracts for calldata as a parameter. Since the calldata represents a function call we can simply nest a reference to that function inside of the rich contract.
In the ui for this field we'll then just show the fields from the nested call alongside the main functions params.
We can then try to reuse existing logic inside action builder to encode as its doing the same job just one layer down.