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

Load dynamic arrays from calldata #249

Open
clearloop opened this issue Oct 30, 2024 · 0 comments
Open

Load dynamic arrays from calldata #249

clearloop opened this issue Oct 30, 2024 · 0 comments
Labels
budget-$150 Payable large onboarding issues

Comments

@clearloop
Copy link
Member

Describe the feature

case 1 - dynamic array as the only param

pub fn foo(dyn_array: String) {
  // ...
}

case 2 - dynamic array after types

pub fn foo(num: i32, dyn_array: String) {
  // ...
}

case 3 - dynamic array in the middle of params

pub fn foo(num: i32, dyn_array: String, boolean: bool) {
  // ...
}

Solution

  1. align calldata to the solidity ABI spec
  2. detect dynamic arrays in parameters from function signature
  3. when local.get happens on dynamic arrays, use chained instructions to extract them
@clearloop clearloop changed the title Load dynamic arrays in calldata Load dynamic arrays from calldata Oct 30, 2024
@clearloop clearloop added budget-$50 Payable small onboarding issues budget-$150 Payable large onboarding issues and removed budget-$50 Payable small onboarding issues labels Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
budget-$150 Payable large onboarding issues
Projects
Status: No status
Development

No branches or pull requests

1 participant