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

Add ability to use encoded init variables to optimize deployment gas usage #1023

Open
imartemy1524 opened this issue Nov 11, 2024 · 0 comments
Labels
gas Gas consumption and fee-related things language feature

Comments

@imartemy1524
Copy link

If one wants to pass some values to contract using init/initOf he have to do this:

contract Test{
   flags: Int as uint8;
   init(f: Int){
       self.flags = f;
   }

}

But under the hood passing Int into init would serialize it as int257 (and send int257 in deployment data instead of int8). One can't do this:

contract Bob{
    init(f: Int as uint8, randomId: Int as uint64){
        self.flags = f;
    }
}

But on my opinion he should be able to.

@novusnota novusnota added the gas Gas consumption and fee-related things label Nov 11, 2024
@anton-trunov anton-trunov changed the title [Feature request] Add ability to use encoded init variables to optimize deployment gas usage Add ability to use encoded init variables to optimize deployment gas usage Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gas Gas consumption and fee-related things language feature
Projects
None yet
Development

No branches or pull requests

3 participants