Closed nathanielCherian closed 2 years ago
This is great, thanks!
I have one request:
Modifier
enum and use that instead of the 'constant'
literal value in checks? Similar to e.g. TimeOp.
enum Modifier {
CONSTANT = 'constant'
}
And I also have one more thought that I'd like to discuss. Do you think we should create an array of modifiers in case we would want to add additional modifiers in the future? It may be premature optimisation because I can't really think of other modifiers, so I'll leave the decision up to you.
For sure! Thanks for the pointer!
Regarding the array of modifiers... I was really torn on this one. At first, I supported an array of modifiers but after implementing it I felt that accommodating additional modifiers right now made the code less concise. Favoring simplicity at this stage, I think we shouldn't use an array of modifiers.
However, I saved the array of modifier code to a different branch in my fork, so if we ever have a need for another modifier it should be convenient to implement.
Awesome! Thanks for taking the time to consider the trade-off. Let's go with your suggestion then, we'll always be able to add the array when necessary in the future. I'll merge this soon and include it in the 0.7.0
mainnet release.
13. The syntax is similar to solidity
int constant m = 5
.When a variable declared constant is mutated, the
ConstantModificationError
is thrown.