Skip to content

Load dynamic arrays from calldata #249

Open
@clearloop

Description

@clearloop

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bounty-$150Payable large onboarding issues

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions