Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need tuple support for ABI library #383

Open
trinhdn2 opened this issue Sep 28, 2023 · 0 comments
Open

Need tuple support for ABI library #383

trinhdn2 opened this issue Sep 28, 2023 · 0 comments

Comments

@trinhdn2
Copy link

trinhdn2 commented Sep 28, 2023

The future universal IPaymaster contract interface will be decribed as below:

interface IPaymaster {
    function validateAndPayForPaymasterTransaction(
        bytes32 _txHash,
        Transaction calldata _transaction
    ) external payable returns (bytes4 magic, bytes memory context);

    function postTransaction(
        bytes calldata _context,
        Transaction calldata _transaction,
        bytes32 _txHash,
        ExecutionResult _txResult,
        uint256 _maxRefundedGas
    ) external payable;
}

The validateAndPayForPaymasterTransaction will be called first by core blockchain during the transaction processing, in order to determine if this transaction can be sponsored gas or not. It's output is a tuple (bytes4 magic, bytes memory context), and there isn't any method to properly unpack this bytes slice result. It throws unsupported arg type: tuple error.

Currently the outdated ABI library of tomochain only supports these types. We need an official and unified method to handle tuple packing/unpacking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant