Closed bobanm closed 2 years ago
Thanks for this!
If we use the constant
keyword, we should change the name of the variables. Like s_requestConfirmations
-> REQUEST_CONFIRMATIONS
All right, I've also changed all the constants names to UPPERCASE.
I was trying to understand which naming standard do you use? Is UPPERCASE used for all the constants and for all the contract instances, e.g. COORDINATOR
?
What about the prefix s_
? Is used to identify a state variable? If yes, it doesn't seem like it is used consistently, as none of the other 3 contracts in this repo use the prefix.
Do you have the coding standards documented somewhere?
Is UPPERCASE used for all the constants and for all the contract instances, e.g. COORDINATOR
No, just constants.
What about the prefix s_? Is used to identify a state variable? If yes, it doesn't seem like it is used consistently, as none of the other 3 contracts in this repo use the prefix.
You're right... that should be fixed!
Do you have the coding standards documented somewhere?
Most of them are pulled from the solidity style guide. I actually have had a backlogged issue to add the additional style guides somewhere... Thanks again for this PR!
Unlike immutable variables
s_subscriptionId
ands_keyHash
whose values are provided during contract deployment as arguments, the contract defines in advance the values fors_callbackGasLimit
,s_requestConfirmations
ands_numWords
. Therefore, it makes more sense to declare those 3 asconstant
instead ofimmutable
.As per Solidity documentation:
https://docs.soliditylang.org/en/latest/contracts.html?#constant-and-immutable-state-variables