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

[Feature] Allow using references when serializing contract calls to bytes #1958

Open
jkylling opened this issue Jan 28, 2025 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@jkylling
Copy link

Component

other

Describe the feature you would like

There should be a way to serialize contract calls to bytes using references. For code like

fn my_call(input: &Address, output: &[Address]) -> Vec<u8> {
    MyContract::myCall::new((*target, output.to_vec()))
        .abi_encode() // Immediately throws away to_vec() allocation
}

we should also allow some variation of

fn my_call(input: &Address, output: &[Address]) -> Vec<u8> {
    MyContract::myCall::new((target, output))
        .abi_encode()
}

Additional context

No response

@jkylling jkylling added the enhancement New feature or request label Jan 28, 2025
@mattsse
Copy link
Member

mattsse commented Feb 1, 2025

could you please also share the generated code of that function?

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

No branches or pull requests

2 participants