-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Support outside configuration values during compilation time #1650
Comments
I would prefer this to be more explicit and part of the language at the same time. It could work as follows: When compiling, you supply one file literally:
And when you want to refer to them in Solidity code, you use:
|
I like using imports for that. How about making this:
Because I still do like defining them as a non-snippet. |
My current proposal is: JSON I/O
Contract:
|
We discussed this on the call today:
|
As for specific syntax proposal, we could standardize some kind of substitution marker. The enum BuildType {
Release,
Debug
}
uint constant MAX_SIZE = #{{ globals.max_size }};
string constant network = "#{{ globals.network }}";
BuildType constant buildType = BuildType.#{{ globals.build_type }}; Looking at the grammar, it seems that we're not using |
This would affect build reproducibility and require support from tools like etherscan. |
True, that's something to consider. Though on the other hand constructor arguments also have the same problem and Etherscan did solve it by requiring you to specify them. So this is not an unsolvable problem.
Just wanted to note that if we go with this, we should not use |
This issue has been marked as stale due to inactivity for the last 90 days. |
Hi everyone! This issue has been automatically closed due to inactivity. |
With the upcoming JSON compiler interface it would be easy to supply a list of values with types, e.g. this would be a new section in the JSON input:
These values could be either defined as contract level variables or more preferably a special method could be used to retrieve them:
Fixes #242.
The text was updated successfully, but these errors were encountered: