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

[Sol->Yul] Support exponentiation in constants #9110

Closed
axic opened this issue Jun 3, 2020 · 3 comments · Fixed by #9479
Closed

[Sol->Yul] Support exponentiation in constants #9110

axic opened this issue Jun 3, 2020 · 3 comments · Fixed by #9479

Comments

@axic
Copy link
Member

axic commented Jun 3, 2020

The following should compile:

    uint constant DEPOSIT_CONTRACT_TREE_DEPTH = 32;
    // NOTE: this also ensures `deposit_count` will fit into 64-bits
    uint constant MAX_DEPOSIT_COUNT = 2**DEPOSIT_CONTRACT_TREE_DEPTH - 1;

This previously attempted by #8945.

Closes #8853.

@chriseth
Copy link
Contributor

chriseth commented Jun 3, 2020

I don't think this is different from regular 'exp'.

@axic
Copy link
Member Author

axic commented Jun 3, 2020

It is not, unless we would have constant expressions. Is there a tracking issue for support exp in sol-yul?

@chriseth
Copy link
Contributor

chriseth commented Jun 3, 2020

The value of the constant is just treated as a regular expression: https://github.com/ethereum/solidity/blob/develop/libsolidity/codegen/ir/IRGeneratorForStatements.cpp#L196

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

Successfully merging a pull request may close this issue.

2 participants