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

Dynamic arrays as parameters of internal functions #250

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

Dynamic arrays as parameters of internal functions #250

clearloop opened this issue Oct 30, 2024 · 0 comments

Comments

@clearloop
Copy link
Member

clearloop commented Oct 30, 2024

Describe the feature

for the case using dynamic parameters in internal functions:

pub fn foo(arr: String) {
  // here we are using `calldataload`
  bar(arr)
}

fn bar(arr: String) {
  // do sth ...
}

Solution

We are loading parameters of internal function from memory in zink, the memory slots are allocated in compilation but for dynamic variables, we'll use the pre-calculated slot & MSIZE to implement this

NOTE: if the above solution doesn't work, try to figure out a better one, otherwise totally align to solidity's implementation

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

No branches or pull requests

1 participant