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

[enhancement] enable placing constructor params in any part of function body #156

Open
A60AB5450353F40E opened this issue Sep 5, 2023 · 1 comment

Comments

@A60AB5450353F40E
Copy link

Declare them in contract() statement, but decide their position later, so compiled bytecode can add them later to avoid unnecessary stack juggling

@rkalis
Copy link
Member

rkalis commented Nov 8, 2023

This could be a nice optimisation. There's also some advantages to keeping them at the start with e.g. simulated state. I think it's also easier to use compiled CashScript contracts outside of the official SDK if the constructor args are at the start.

So it might not be worth the extra complexity / tradeoffs to add this functionality, and the optimisation is probably not super big, so it might be more fruitful to allow for larger contracts on BCH instead. I'll leave the issue open to consider in the future.

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

2 participants