Contract: Native function to retrieve entire call input bytes array #112
Labels
I5-enhancement
An additional feature request.
I10-unconfirmed
Issue might be valid, but it's not yet known.
Is there an existing issue?
Experiencing problems? Have you tried our Stack Exchange first?
Motivation
In certain scenarios involving Wasm contracts, there is a desire to transmit data as extra bytes within the ExecutionInput of cross-contract calls and subsequently access this data within the callee contracts. Unfortunately, as long as I know, there is presently no capability to read the complete array of call input bytes within contracts, making it impractical to accomplish this objective without changing the signature of the functions within the callee contracts.
For example,
ERC2771-like meta transaction use case, Forwarder contract append extra 32bytes array representing AccountId of Transaction Signer to the ExecutionInput of cross-contract call.
Since there are currently no built-in mechanisms to read the complete array of ExecutionInput bytes, it is necessary to modify the function signatures of the callee contracts in order to read extra bytes. Specifically, the function signatures of these contracts will need to be adjusted to include a parameter of type Vec, which will be used to decode any additional bytes appended by the calling contracts.
If pallet-contracts had this feature, modifying the function signatures of the callee contracts to transmit additional data wouldn't be required.
Request
The same feature as Solidity's
calldataload
,calldatasize
(Doc: https://docs.soliditylang.org/en/v0.8.16/yul.html#evm-dialect, Example usage: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/7e7060e00e107460fc57c178859d3cf0c6ac64ef/contracts/metatx/ERC2771Context.sol#LL29C35-L29C47) in pallet-contracts and available in contracts language such as ink!.Solution
No response
Are you willing to help with this request?
Yes!
The text was updated successfully, but these errors were encountered: